diff options
Diffstat (limited to 'include')
306 files changed, 5942 insertions, 3044 deletions
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 3e798593b17b..ab0b85cf21f3 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
| @@ -242,6 +242,10 @@ acpi_os_derive_pci_id(acpi_handle rhandle, | |||
| 242 | acpi_status acpi_os_validate_interface(char *interface); | 242 | acpi_status acpi_os_validate_interface(char *interface); |
| 243 | acpi_status acpi_osi_invalidate(char* interface); | 243 | acpi_status acpi_osi_invalidate(char* interface); |
| 244 | 244 | ||
| 245 | acpi_status | ||
| 246 | acpi_os_validate_address(u8 space_id, acpi_physical_address address, | ||
| 247 | acpi_size length, char *name); | ||
| 248 | |||
| 245 | u64 acpi_os_get_timer(void); | 249 | u64 acpi_os_get_timer(void); |
| 246 | 250 | ||
| 247 | acpi_status acpi_os_signal(u32 function, void *info); | 251 | acpi_status acpi_os_signal(u32 function, void *info); |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index baf1e0a9a7ee..740ac3ad8fd0 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
| @@ -174,7 +174,7 @@ struct acpi_processor_throttling { | |||
| 174 | cpumask_var_t shared_cpu_map; | 174 | cpumask_var_t shared_cpu_map; |
| 175 | int (*acpi_processor_get_throttling) (struct acpi_processor * pr); | 175 | int (*acpi_processor_get_throttling) (struct acpi_processor * pr); |
| 176 | int (*acpi_processor_set_throttling) (struct acpi_processor * pr, | 176 | int (*acpi_processor_set_throttling) (struct acpi_processor * pr, |
| 177 | int state); | 177 | int state, bool force); |
| 178 | 178 | ||
| 179 | u32 address; | 179 | u32 address; |
| 180 | u8 duty_offset; | 180 | u8 duty_offset; |
| @@ -321,7 +321,8 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr) | |||
| 321 | /* in processor_throttling.c */ | 321 | /* in processor_throttling.c */ |
| 322 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); | 322 | int acpi_processor_tstate_has_changed(struct acpi_processor *pr); |
| 323 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); | 323 | int acpi_processor_get_throttling_info(struct acpi_processor *pr); |
| 324 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, int state); | 324 | extern int acpi_processor_set_throttling(struct acpi_processor *pr, |
| 325 | int state, bool force); | ||
| 325 | extern const struct file_operations acpi_processor_throttling_fops; | 326 | extern const struct file_operations acpi_processor_throttling_fops; |
| 326 | extern void acpi_processor_throttling_init(void); | 327 | extern void acpi_processor_throttling_init(void); |
| 327 | /* in processor_idle.c */ | 328 | /* in processor_idle.c */ |
diff --git a/include/asm-generic/4level-fixup.h b/include/asm-generic/4level-fixup.h index 9d40e879f99e..77ff547730af 100644 --- a/include/asm-generic/4level-fixup.h +++ b/include/asm-generic/4level-fixup.h | |||
| @@ -27,9 +27,9 @@ | |||
| 27 | #define pud_page_vaddr(pud) pgd_page_vaddr(pud) | 27 | #define pud_page_vaddr(pud) pgd_page_vaddr(pud) |
| 28 | 28 | ||
| 29 | #undef pud_free_tlb | 29 | #undef pud_free_tlb |
| 30 | #define pud_free_tlb(tlb, x) do { } while (0) | 30 | #define pud_free_tlb(tlb, x, addr) do { } while (0) |
| 31 | #define pud_free(mm, x) do { } while (0) | 31 | #define pud_free(mm, x) do { } while (0) |
| 32 | #define __pud_free_tlb(tlb, x) do { } while (0) | 32 | #define __pud_free_tlb(tlb, x, addr) do { } while (0) |
| 33 | 33 | ||
| 34 | #undef pud_addr_end | 34 | #undef pud_addr_end |
| 35 | #define pud_addr_end(addr, end) (end) | 35 | #define pud_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/Kbuild.asm b/include/asm-generic/Kbuild.asm index 290910e4ede4..96d7c9804dc1 100644 --- a/include/asm-generic/Kbuild.asm +++ b/include/asm-generic/Kbuild.asm | |||
| @@ -3,6 +3,11 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | |||
| 3 | header-y += kvm.h | 3 | header-y += kvm.h |
| 4 | endif | 4 | endif |
| 5 | 5 | ||
| 6 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | ||
| 7 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | ||
| 8 | header-y += kvm_para.h | ||
| 9 | endif | ||
| 10 | |||
| 6 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | 11 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
| 7 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 12 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) |
| 8 | unifdef-y += a.out.h | 13 | unifdef-y += a.out.h |
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h index 5406a601185c..e694263445f7 100644 --- a/include/asm-generic/dma-mapping-common.h +++ b/include/asm-generic/dma-mapping-common.h | |||
| @@ -103,7 +103,6 @@ static inline void dma_sync_single_for_cpu(struct device *dev, dma_addr_t addr, | |||
| 103 | if (ops->sync_single_for_cpu) | 103 | if (ops->sync_single_for_cpu) |
| 104 | ops->sync_single_for_cpu(dev, addr, size, dir); | 104 | ops->sync_single_for_cpu(dev, addr, size, dir); |
| 105 | debug_dma_sync_single_for_cpu(dev, addr, size, dir); | 105 | debug_dma_sync_single_for_cpu(dev, addr, size, dir); |
| 106 | flush_write_buffers(); | ||
| 107 | } | 106 | } |
| 108 | 107 | ||
| 109 | static inline void dma_sync_single_for_device(struct device *dev, | 108 | static inline void dma_sync_single_for_device(struct device *dev, |
| @@ -116,7 +115,6 @@ static inline void dma_sync_single_for_device(struct device *dev, | |||
| 116 | if (ops->sync_single_for_device) | 115 | if (ops->sync_single_for_device) |
| 117 | ops->sync_single_for_device(dev, addr, size, dir); | 116 | ops->sync_single_for_device(dev, addr, size, dir); |
| 118 | debug_dma_sync_single_for_device(dev, addr, size, dir); | 117 | debug_dma_sync_single_for_device(dev, addr, size, dir); |
| 119 | flush_write_buffers(); | ||
| 120 | } | 118 | } |
| 121 | 119 | ||
| 122 | static inline void dma_sync_single_range_for_cpu(struct device *dev, | 120 | static inline void dma_sync_single_range_for_cpu(struct device *dev, |
| @@ -132,7 +130,6 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev, | |||
| 132 | ops->sync_single_range_for_cpu(dev, addr, offset, size, dir); | 130 | ops->sync_single_range_for_cpu(dev, addr, offset, size, dir); |
| 133 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); | 131 | debug_dma_sync_single_range_for_cpu(dev, addr, offset, size, dir); |
| 134 | 132 | ||
| 135 | flush_write_buffers(); | ||
| 136 | } else | 133 | } else |
| 137 | dma_sync_single_for_cpu(dev, addr, size, dir); | 134 | dma_sync_single_for_cpu(dev, addr, size, dir); |
| 138 | } | 135 | } |
| @@ -150,7 +147,6 @@ static inline void dma_sync_single_range_for_device(struct device *dev, | |||
| 150 | ops->sync_single_range_for_device(dev, addr, offset, size, dir); | 147 | ops->sync_single_range_for_device(dev, addr, offset, size, dir); |
| 151 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); | 148 | debug_dma_sync_single_range_for_device(dev, addr, offset, size, dir); |
| 152 | 149 | ||
| 153 | flush_write_buffers(); | ||
| 154 | } else | 150 | } else |
| 155 | dma_sync_single_for_device(dev, addr, size, dir); | 151 | dma_sync_single_for_device(dev, addr, size, dir); |
| 156 | } | 152 | } |
| @@ -165,7 +161,6 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, | |||
| 165 | if (ops->sync_sg_for_cpu) | 161 | if (ops->sync_sg_for_cpu) |
| 166 | ops->sync_sg_for_cpu(dev, sg, nelems, dir); | 162 | ops->sync_sg_for_cpu(dev, sg, nelems, dir); |
| 167 | debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); | 163 | debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); |
| 168 | flush_write_buffers(); | ||
| 169 | } | 164 | } |
| 170 | 165 | ||
| 171 | static inline void | 166 | static inline void |
| @@ -179,7 +174,6 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, | |||
| 179 | ops->sync_sg_for_device(dev, sg, nelems, dir); | 174 | ops->sync_sg_for_device(dev, sg, nelems, dir); |
| 180 | debug_dma_sync_sg_for_device(dev, sg, nelems, dir); | 175 | debug_dma_sync_sg_for_device(dev, sg, nelems, dir); |
| 181 | 176 | ||
| 182 | flush_write_buffers(); | ||
| 183 | } | 177 | } |
| 184 | 178 | ||
| 185 | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) | 179 | #define dma_map_single(d, a, s, r) dma_map_single_attrs(d, a, s, r, NULL) |
diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h index aa00800adacc..90079c373f1c 100644 --- a/include/asm-generic/percpu.h +++ b/include/asm-generic/percpu.h | |||
| @@ -81,14 +81,17 @@ extern void setup_per_cpu_areas(void); | |||
| 81 | 81 | ||
| 82 | #ifdef MODULE | 82 | #ifdef MODULE |
| 83 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 83 | #define PER_CPU_SHARED_ALIGNED_SECTION "" |
| 84 | #define PER_CPU_ALIGNED_SECTION "" | ||
| 84 | #else | 85 | #else |
| 85 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | 86 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" |
| 87 | #define PER_CPU_ALIGNED_SECTION ".shared_aligned" | ||
| 86 | #endif | 88 | #endif |
| 87 | #define PER_CPU_FIRST_SECTION ".first" | 89 | #define PER_CPU_FIRST_SECTION ".first" |
| 88 | 90 | ||
| 89 | #else | 91 | #else |
| 90 | 92 | ||
| 91 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | 93 | #define PER_CPU_SHARED_ALIGNED_SECTION "" |
| 94 | #define PER_CPU_ALIGNED_SECTION ".shared_aligned" | ||
| 92 | #define PER_CPU_FIRST_SECTION "" | 95 | #define PER_CPU_FIRST_SECTION "" |
| 93 | 96 | ||
| 94 | #endif | 97 | #endif |
diff --git a/include/asm-generic/pgtable-nopmd.h b/include/asm-generic/pgtable-nopmd.h index a7cdc48e8b78..725612b793ce 100644 --- a/include/asm-generic/pgtable-nopmd.h +++ b/include/asm-generic/pgtable-nopmd.h | |||
| @@ -59,7 +59,7 @@ static inline pmd_t * pmd_offset(pud_t * pud, unsigned long address) | |||
| 59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | 59 | static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) |
| 60 | { | 60 | { |
| 61 | } | 61 | } |
| 62 | #define __pmd_free_tlb(tlb, x) do { } while (0) | 62 | #define __pmd_free_tlb(tlb, x, a) do { } while (0) |
| 63 | 63 | ||
| 64 | #undef pmd_addr_end | 64 | #undef pmd_addr_end |
| 65 | #define pmd_addr_end(addr, end) (end) | 65 | #define pmd_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/pgtable-nopud.h b/include/asm-generic/pgtable-nopud.h index 87cf449a6df3..810431d8351b 100644 --- a/include/asm-generic/pgtable-nopud.h +++ b/include/asm-generic/pgtable-nopud.h | |||
| @@ -52,7 +52,7 @@ static inline pud_t * pud_offset(pgd_t * pgd, unsigned long address) | |||
| 52 | */ | 52 | */ |
| 53 | #define pud_alloc_one(mm, address) NULL | 53 | #define pud_alloc_one(mm, address) NULL |
| 54 | #define pud_free(mm, x) do { } while (0) | 54 | #define pud_free(mm, x) do { } while (0) |
| 55 | #define __pud_free_tlb(tlb, x) do { } while (0) | 55 | #define __pud_free_tlb(tlb, x, a) do { } while (0) |
| 56 | 56 | ||
| 57 | #undef pud_addr_end | 57 | #undef pud_addr_end |
| 58 | #define pud_addr_end(addr, end) (end) | 58 | #define pud_addr_end(addr, end) (end) |
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h index 5d79e409241c..538991cef6f0 100644 --- a/include/asm-generic/socket.h +++ b/include/asm-generic/socket.h | |||
| @@ -60,4 +60,7 @@ | |||
| 60 | #define SO_TIMESTAMPING 37 | 60 | #define SO_TIMESTAMPING 37 |
| 61 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | 61 | #define SCM_TIMESTAMPING SO_TIMESTAMPING |
| 62 | 62 | ||
| 63 | #define SO_PROTOCOL 38 | ||
| 64 | #define SO_DOMAIN 39 | ||
| 65 | |||
| 63 | #endif /* __ASM_GENERIC_SOCKET_H */ | 66 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/asm-generic/tlb.h b/include/asm-generic/tlb.h index f490e43a90b9..e43f9766259f 100644 --- a/include/asm-generic/tlb.h +++ b/include/asm-generic/tlb.h | |||
| @@ -123,24 +123,24 @@ static inline void tlb_remove_page(struct mmu_gather *tlb, struct page *page) | |||
| 123 | __tlb_remove_tlb_entry(tlb, ptep, address); \ | 123 | __tlb_remove_tlb_entry(tlb, ptep, address); \ |
| 124 | } while (0) | 124 | } while (0) |
| 125 | 125 | ||
| 126 | #define pte_free_tlb(tlb, ptep) \ | 126 | #define pte_free_tlb(tlb, ptep, address) \ |
| 127 | do { \ | 127 | do { \ |
| 128 | tlb->need_flush = 1; \ | 128 | tlb->need_flush = 1; \ |
| 129 | __pte_free_tlb(tlb, ptep); \ | 129 | __pte_free_tlb(tlb, ptep, address); \ |
| 130 | } while (0) | 130 | } while (0) |
| 131 | 131 | ||
| 132 | #ifndef __ARCH_HAS_4LEVEL_HACK | 132 | #ifndef __ARCH_HAS_4LEVEL_HACK |
| 133 | #define pud_free_tlb(tlb, pudp) \ | 133 | #define pud_free_tlb(tlb, pudp, address) \ |
| 134 | do { \ | 134 | do { \ |
| 135 | tlb->need_flush = 1; \ | 135 | tlb->need_flush = 1; \ |
| 136 | __pud_free_tlb(tlb, pudp); \ | 136 | __pud_free_tlb(tlb, pudp, address); \ |
| 137 | } while (0) | 137 | } while (0) |
| 138 | #endif | 138 | #endif |
| 139 | 139 | ||
| 140 | #define pmd_free_tlb(tlb, pmdp) \ | 140 | #define pmd_free_tlb(tlb, pmdp, address) \ |
| 141 | do { \ | 141 | do { \ |
| 142 | tlb->need_flush = 1; \ | 142 | tlb->need_flush = 1; \ |
| 143 | __pmd_free_tlb(tlb, pmdp); \ | 143 | __pmd_free_tlb(tlb, pmdp, address); \ |
| 144 | } while (0) | 144 | } while (0) |
| 145 | 145 | ||
| 146 | #define tlb_migrate_finish(mm) do {} while (0) | 146 | #define tlb_migrate_finish(mm) do {} while (0) |
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 010545436efa..1ffb53f74d37 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
| @@ -22,11 +22,9 @@ struct seq_file; | |||
| 22 | 22 | ||
| 23 | struct crypto_type { | 23 | struct crypto_type { |
| 24 | unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask); | 24 | unsigned int (*ctxsize)(struct crypto_alg *alg, u32 type, u32 mask); |
| 25 | unsigned int (*extsize)(struct crypto_alg *alg, | 25 | unsigned int (*extsize)(struct crypto_alg *alg); |
| 26 | const struct crypto_type *frontend); | ||
| 27 | int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); | 26 | int (*init)(struct crypto_tfm *tfm, u32 type, u32 mask); |
| 28 | int (*init_tfm)(struct crypto_tfm *tfm, | 27 | int (*init_tfm)(struct crypto_tfm *tfm); |
| 29 | const struct crypto_type *frontend); | ||
| 30 | void (*show)(struct seq_file *m, struct crypto_alg *alg); | 28 | void (*show)(struct seq_file *m, struct crypto_alg *alg); |
| 31 | struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); | 29 | struct crypto_alg *(*lookup)(const char *name, u32 type, u32 mask); |
| 32 | 30 | ||
| @@ -52,6 +50,7 @@ struct crypto_template { | |||
| 52 | 50 | ||
| 53 | struct crypto_instance *(*alloc)(struct rtattr **tb); | 51 | struct crypto_instance *(*alloc)(struct rtattr **tb); |
| 54 | void (*free)(struct crypto_instance *inst); | 52 | void (*free)(struct crypto_instance *inst); |
| 53 | int (*create)(struct crypto_template *tmpl, struct rtattr **tb); | ||
| 55 | 54 | ||
| 56 | char name[CRYPTO_MAX_ALG_NAME]; | 55 | char name[CRYPTO_MAX_ALG_NAME]; |
| 57 | }; | 56 | }; |
| @@ -60,6 +59,7 @@ struct crypto_spawn { | |||
| 60 | struct list_head list; | 59 | struct list_head list; |
| 61 | struct crypto_alg *alg; | 60 | struct crypto_alg *alg; |
| 62 | struct crypto_instance *inst; | 61 | struct crypto_instance *inst; |
| 62 | const struct crypto_type *frontend; | ||
| 63 | u32 mask; | 63 | u32 mask; |
| 64 | }; | 64 | }; |
| 65 | 65 | ||
| @@ -114,11 +114,19 @@ int crypto_register_template(struct crypto_template *tmpl); | |||
| 114 | void crypto_unregister_template(struct crypto_template *tmpl); | 114 | void crypto_unregister_template(struct crypto_template *tmpl); |
| 115 | struct crypto_template *crypto_lookup_template(const char *name); | 115 | struct crypto_template *crypto_lookup_template(const char *name); |
| 116 | 116 | ||
| 117 | int crypto_register_instance(struct crypto_template *tmpl, | ||
| 118 | struct crypto_instance *inst); | ||
| 119 | |||
| 117 | int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg, | 120 | int crypto_init_spawn(struct crypto_spawn *spawn, struct crypto_alg *alg, |
| 118 | struct crypto_instance *inst, u32 mask); | 121 | struct crypto_instance *inst, u32 mask); |
| 122 | int crypto_init_spawn2(struct crypto_spawn *spawn, struct crypto_alg *alg, | ||
| 123 | struct crypto_instance *inst, | ||
| 124 | const struct crypto_type *frontend); | ||
| 125 | |||
| 119 | void crypto_drop_spawn(struct crypto_spawn *spawn); | 126 | void crypto_drop_spawn(struct crypto_spawn *spawn); |
| 120 | struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type, | 127 | struct crypto_tfm *crypto_spawn_tfm(struct crypto_spawn *spawn, u32 type, |
| 121 | u32 mask); | 128 | u32 mask); |
| 129 | void *crypto_spawn_tfm2(struct crypto_spawn *spawn); | ||
| 122 | 130 | ||
| 123 | static inline void crypto_set_spawn(struct crypto_spawn *spawn, | 131 | static inline void crypto_set_spawn(struct crypto_spawn *spawn, |
| 124 | struct crypto_instance *inst) | 132 | struct crypto_instance *inst) |
| @@ -129,14 +137,26 @@ static inline void crypto_set_spawn(struct crypto_spawn *spawn, | |||
| 129 | struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb); | 137 | struct crypto_attr_type *crypto_get_attr_type(struct rtattr **tb); |
| 130 | int crypto_check_attr_type(struct rtattr **tb, u32 type); | 138 | int crypto_check_attr_type(struct rtattr **tb, u32 type); |
| 131 | const char *crypto_attr_alg_name(struct rtattr *rta); | 139 | const char *crypto_attr_alg_name(struct rtattr *rta); |
| 132 | struct crypto_alg *crypto_attr_alg(struct rtattr *rta, u32 type, u32 mask); | 140 | struct crypto_alg *crypto_attr_alg2(struct rtattr *rta, |
| 141 | const struct crypto_type *frontend, | ||
| 142 | u32 type, u32 mask); | ||
| 143 | |||
| 144 | static inline struct crypto_alg *crypto_attr_alg(struct rtattr *rta, | ||
| 145 | u32 type, u32 mask) | ||
| 146 | { | ||
| 147 | return crypto_attr_alg2(rta, NULL, type, mask); | ||
| 148 | } | ||
| 149 | |||
| 133 | int crypto_attr_u32(struct rtattr *rta, u32 *num); | 150 | int crypto_attr_u32(struct rtattr *rta, u32 *num); |
| 151 | void *crypto_alloc_instance2(const char *name, struct crypto_alg *alg, | ||
| 152 | unsigned int head); | ||
| 134 | struct crypto_instance *crypto_alloc_instance(const char *name, | 153 | struct crypto_instance *crypto_alloc_instance(const char *name, |
| 135 | struct crypto_alg *alg); | 154 | struct crypto_alg *alg); |
| 136 | 155 | ||
| 137 | void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen); | 156 | void crypto_init_queue(struct crypto_queue *queue, unsigned int max_qlen); |
| 138 | int crypto_enqueue_request(struct crypto_queue *queue, | 157 | int crypto_enqueue_request(struct crypto_queue *queue, |
| 139 | struct crypto_async_request *request); | 158 | struct crypto_async_request *request); |
| 159 | void *__crypto_dequeue_request(struct crypto_queue *queue, unsigned int offset); | ||
| 140 | struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue); | 160 | struct crypto_async_request *crypto_dequeue_request(struct crypto_queue *queue); |
| 141 | int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm); | 161 | int crypto_tfm_in_queue(struct crypto_queue *queue, struct crypto_tfm *tfm); |
| 142 | 162 | ||
| @@ -156,12 +176,8 @@ int blkcipher_walk_virt_block(struct blkcipher_desc *desc, | |||
| 156 | 176 | ||
| 157 | static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm) | 177 | static inline void *crypto_tfm_ctx_aligned(struct crypto_tfm *tfm) |
| 158 | { | 178 | { |
| 159 | unsigned long addr = (unsigned long)crypto_tfm_ctx(tfm); | 179 | return PTR_ALIGN(crypto_tfm_ctx(tfm), |
| 160 | unsigned long align = crypto_tfm_alg_alignmask(tfm); | 180 | crypto_tfm_alg_alignmask(tfm) + 1); |
| 161 | |||
| 162 | if (align <= crypto_tfm_ctx_alignment()) | ||
| 163 | align = 1; | ||
| 164 | return (void *)ALIGN(addr, align); | ||
| 165 | } | 181 | } |
| 166 | 182 | ||
| 167 | static inline struct crypto_instance *crypto_tfm_alg_instance( | 183 | static inline struct crypto_instance *crypto_tfm_alg_instance( |
diff --git a/include/crypto/cryptd.h b/include/crypto/cryptd.h index 55fa7bbdbc71..2f65a6e8ea4d 100644 --- a/include/crypto/cryptd.h +++ b/include/crypto/cryptd.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | #include <linux/crypto.h> | 8 | #include <linux/crypto.h> |
| 9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
| 10 | #include <crypto/hash.h> | ||
| 10 | 11 | ||
| 11 | struct cryptd_ablkcipher { | 12 | struct cryptd_ablkcipher { |
| 12 | struct crypto_ablkcipher base; | 13 | struct crypto_ablkcipher base; |
| @@ -24,4 +25,20 @@ struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name, | |||
| 24 | struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm); | 25 | struct crypto_blkcipher *cryptd_ablkcipher_child(struct cryptd_ablkcipher *tfm); |
| 25 | void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm); | 26 | void cryptd_free_ablkcipher(struct cryptd_ablkcipher *tfm); |
| 26 | 27 | ||
| 28 | struct cryptd_ahash { | ||
| 29 | struct crypto_ahash base; | ||
| 30 | }; | ||
| 31 | |||
| 32 | static inline struct cryptd_ahash *__cryptd_ahash_cast( | ||
| 33 | struct crypto_ahash *tfm) | ||
| 34 | { | ||
| 35 | return (struct cryptd_ahash *)tfm; | ||
| 36 | } | ||
| 37 | |||
| 38 | /* alg_name should be algorithm to be cryptd-ed */ | ||
| 39 | struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name, | ||
| 40 | u32 type, u32 mask); | ||
| 41 | struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm); | ||
| 42 | void cryptd_free_ahash(struct cryptd_ahash *tfm); | ||
| 43 | |||
| 27 | #endif | 44 | #endif |
diff --git a/include/crypto/hash.h b/include/crypto/hash.h index d56bb71617c3..26cb1eb16f4c 100644 --- a/include/crypto/hash.h +++ b/include/crypto/hash.h | |||
| @@ -15,6 +15,42 @@ | |||
| 15 | 15 | ||
| 16 | #include <linux/crypto.h> | 16 | #include <linux/crypto.h> |
| 17 | 17 | ||
| 18 | struct crypto_ahash; | ||
| 19 | |||
| 20 | struct hash_alg_common { | ||
| 21 | unsigned int digestsize; | ||
| 22 | unsigned int statesize; | ||
| 23 | |||
| 24 | struct crypto_alg base; | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct ahash_request { | ||
| 28 | struct crypto_async_request base; | ||
| 29 | |||
| 30 | unsigned int nbytes; | ||
| 31 | struct scatterlist *src; | ||
| 32 | u8 *result; | ||
| 33 | |||
| 34 | /* This field may only be used by the ahash API code. */ | ||
| 35 | void *priv; | ||
| 36 | |||
| 37 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct ahash_alg { | ||
| 41 | int (*init)(struct ahash_request *req); | ||
| 42 | int (*update)(struct ahash_request *req); | ||
| 43 | int (*final)(struct ahash_request *req); | ||
| 44 | int (*finup)(struct ahash_request *req); | ||
| 45 | int (*digest)(struct ahash_request *req); | ||
| 46 | int (*export)(struct ahash_request *req, void *out); | ||
| 47 | int (*import)(struct ahash_request *req, const void *in); | ||
| 48 | int (*setkey)(struct crypto_ahash *tfm, const u8 *key, | ||
| 49 | unsigned int keylen); | ||
| 50 | |||
| 51 | struct hash_alg_common halg; | ||
| 52 | }; | ||
| 53 | |||
| 18 | struct shash_desc { | 54 | struct shash_desc { |
| 19 | struct crypto_shash *tfm; | 55 | struct crypto_shash *tfm; |
| 20 | u32 flags; | 56 | u32 flags; |
| @@ -24,7 +60,6 @@ struct shash_desc { | |||
| 24 | 60 | ||
| 25 | struct shash_alg { | 61 | struct shash_alg { |
| 26 | int (*init)(struct shash_desc *desc); | 62 | int (*init)(struct shash_desc *desc); |
| 27 | int (*reinit)(struct shash_desc *desc); | ||
| 28 | int (*update)(struct shash_desc *desc, const u8 *data, | 63 | int (*update)(struct shash_desc *desc, const u8 *data, |
| 29 | unsigned int len); | 64 | unsigned int len); |
| 30 | int (*final)(struct shash_desc *desc, u8 *out); | 65 | int (*final)(struct shash_desc *desc, u8 *out); |
| @@ -32,38 +67,48 @@ struct shash_alg { | |||
| 32 | unsigned int len, u8 *out); | 67 | unsigned int len, u8 *out); |
| 33 | int (*digest)(struct shash_desc *desc, const u8 *data, | 68 | int (*digest)(struct shash_desc *desc, const u8 *data, |
| 34 | unsigned int len, u8 *out); | 69 | unsigned int len, u8 *out); |
| 70 | int (*export)(struct shash_desc *desc, void *out); | ||
| 71 | int (*import)(struct shash_desc *desc, const void *in); | ||
| 35 | int (*setkey)(struct crypto_shash *tfm, const u8 *key, | 72 | int (*setkey)(struct crypto_shash *tfm, const u8 *key, |
| 36 | unsigned int keylen); | 73 | unsigned int keylen); |
| 37 | 74 | ||
| 38 | unsigned int descsize; | 75 | unsigned int descsize; |
| 39 | unsigned int digestsize; | 76 | |
| 77 | /* These fields must match hash_alg_common. */ | ||
| 78 | unsigned int digestsize | ||
| 79 | __attribute__ ((aligned(__alignof__(struct hash_alg_common)))); | ||
| 80 | unsigned int statesize; | ||
| 40 | 81 | ||
| 41 | struct crypto_alg base; | 82 | struct crypto_alg base; |
| 42 | }; | 83 | }; |
| 43 | 84 | ||
| 44 | struct crypto_ahash { | 85 | struct crypto_ahash { |
| 86 | int (*init)(struct ahash_request *req); | ||
| 87 | int (*update)(struct ahash_request *req); | ||
| 88 | int (*final)(struct ahash_request *req); | ||
| 89 | int (*finup)(struct ahash_request *req); | ||
| 90 | int (*digest)(struct ahash_request *req); | ||
| 91 | int (*export)(struct ahash_request *req, void *out); | ||
| 92 | int (*import)(struct ahash_request *req, const void *in); | ||
| 93 | int (*setkey)(struct crypto_ahash *tfm, const u8 *key, | ||
| 94 | unsigned int keylen); | ||
| 95 | |||
| 96 | unsigned int reqsize; | ||
| 45 | struct crypto_tfm base; | 97 | struct crypto_tfm base; |
| 46 | }; | 98 | }; |
| 47 | 99 | ||
| 48 | struct crypto_shash { | 100 | struct crypto_shash { |
| 101 | unsigned int descsize; | ||
| 49 | struct crypto_tfm base; | 102 | struct crypto_tfm base; |
| 50 | }; | 103 | }; |
| 51 | 104 | ||
| 52 | static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) | 105 | static inline struct crypto_ahash *__crypto_ahash_cast(struct crypto_tfm *tfm) |
| 53 | { | 106 | { |
| 54 | return (struct crypto_ahash *)tfm; | 107 | return container_of(tfm, struct crypto_ahash, base); |
| 55 | } | 108 | } |
| 56 | 109 | ||
| 57 | static inline struct crypto_ahash *crypto_alloc_ahash(const char *alg_name, | 110 | struct crypto_ahash *crypto_alloc_ahash(const char *alg_name, u32 type, |
| 58 | u32 type, u32 mask) | 111 | u32 mask); |
| 59 | { | ||
| 60 | type &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 61 | mask &= ~CRYPTO_ALG_TYPE_MASK; | ||
| 62 | type |= CRYPTO_ALG_TYPE_AHASH; | ||
| 63 | mask |= CRYPTO_ALG_TYPE_AHASH_MASK; | ||
| 64 | |||
| 65 | return __crypto_ahash_cast(crypto_alloc_base(alg_name, type, mask)); | ||
| 66 | } | ||
| 67 | 112 | ||
| 68 | static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) | 113 | static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) |
| 69 | { | 114 | { |
| @@ -72,7 +117,7 @@ static inline struct crypto_tfm *crypto_ahash_tfm(struct crypto_ahash *tfm) | |||
| 72 | 117 | ||
| 73 | static inline void crypto_free_ahash(struct crypto_ahash *tfm) | 118 | static inline void crypto_free_ahash(struct crypto_ahash *tfm) |
| 74 | { | 119 | { |
| 75 | crypto_free_tfm(crypto_ahash_tfm(tfm)); | 120 | crypto_destroy_tfm(tfm, crypto_ahash_tfm(tfm)); |
| 76 | } | 121 | } |
| 77 | 122 | ||
| 78 | static inline unsigned int crypto_ahash_alignmask( | 123 | static inline unsigned int crypto_ahash_alignmask( |
| @@ -81,14 +126,26 @@ static inline unsigned int crypto_ahash_alignmask( | |||
| 81 | return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); | 126 | return crypto_tfm_alg_alignmask(crypto_ahash_tfm(tfm)); |
| 82 | } | 127 | } |
| 83 | 128 | ||
| 84 | static inline struct ahash_tfm *crypto_ahash_crt(struct crypto_ahash *tfm) | 129 | static inline struct hash_alg_common *__crypto_hash_alg_common( |
| 130 | struct crypto_alg *alg) | ||
| 131 | { | ||
| 132 | return container_of(alg, struct hash_alg_common, base); | ||
| 133 | } | ||
| 134 | |||
| 135 | static inline struct hash_alg_common *crypto_hash_alg_common( | ||
| 136 | struct crypto_ahash *tfm) | ||
| 85 | { | 137 | { |
| 86 | return &crypto_ahash_tfm(tfm)->crt_ahash; | 138 | return __crypto_hash_alg_common(crypto_ahash_tfm(tfm)->__crt_alg); |
| 87 | } | 139 | } |
| 88 | 140 | ||
| 89 | static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) | 141 | static inline unsigned int crypto_ahash_digestsize(struct crypto_ahash *tfm) |
| 90 | { | 142 | { |
| 91 | return crypto_ahash_crt(tfm)->digestsize; | 143 | return crypto_hash_alg_common(tfm)->digestsize; |
| 144 | } | ||
| 145 | |||
| 146 | static inline unsigned int crypto_ahash_statesize(struct crypto_ahash *tfm) | ||
| 147 | { | ||
| 148 | return crypto_hash_alg_common(tfm)->statesize; | ||
| 92 | } | 149 | } |
| 93 | 150 | ||
| 94 | static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) | 151 | static inline u32 crypto_ahash_get_flags(struct crypto_ahash *tfm) |
| @@ -114,7 +171,7 @@ static inline struct crypto_ahash *crypto_ahash_reqtfm( | |||
| 114 | 171 | ||
| 115 | static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) | 172 | static inline unsigned int crypto_ahash_reqsize(struct crypto_ahash *tfm) |
| 116 | { | 173 | { |
| 117 | return crypto_ahash_crt(tfm)->reqsize; | 174 | return tfm->reqsize; |
| 118 | } | 175 | } |
| 119 | 176 | ||
| 120 | static inline void *ahash_request_ctx(struct ahash_request *req) | 177 | static inline void *ahash_request_ctx(struct ahash_request *req) |
| @@ -122,44 +179,30 @@ static inline void *ahash_request_ctx(struct ahash_request *req) | |||
| 122 | return req->__ctx; | 179 | return req->__ctx; |
| 123 | } | 180 | } |
| 124 | 181 | ||
| 125 | static inline int crypto_ahash_setkey(struct crypto_ahash *tfm, | 182 | int crypto_ahash_setkey(struct crypto_ahash *tfm, const u8 *key, |
| 126 | const u8 *key, unsigned int keylen) | 183 | unsigned int keylen); |
| 127 | { | 184 | int crypto_ahash_finup(struct ahash_request *req); |
| 128 | struct ahash_tfm *crt = crypto_ahash_crt(tfm); | 185 | int crypto_ahash_final(struct ahash_request *req); |
| 129 | 186 | int crypto_ahash_digest(struct ahash_request *req); | |
| 130 | return crt->setkey(tfm, key, keylen); | ||
| 131 | } | ||
| 132 | 187 | ||
| 133 | static inline int crypto_ahash_digest(struct ahash_request *req) | 188 | static inline int crypto_ahash_export(struct ahash_request *req, void *out) |
| 134 | { | 189 | { |
| 135 | struct ahash_tfm *crt = crypto_ahash_crt(crypto_ahash_reqtfm(req)); | 190 | return crypto_ahash_reqtfm(req)->export(req, out); |
| 136 | return crt->digest(req); | ||
| 137 | } | 191 | } |
| 138 | 192 | ||
| 139 | static inline void crypto_ahash_export(struct ahash_request *req, u8 *out) | 193 | static inline int crypto_ahash_import(struct ahash_request *req, const void *in) |
| 140 | { | 194 | { |
| 141 | memcpy(out, ahash_request_ctx(req), | 195 | return crypto_ahash_reqtfm(req)->import(req, in); |
| 142 | crypto_ahash_reqsize(crypto_ahash_reqtfm(req))); | ||
| 143 | } | 196 | } |
| 144 | 197 | ||
| 145 | int crypto_ahash_import(struct ahash_request *req, const u8 *in); | ||
| 146 | |||
| 147 | static inline int crypto_ahash_init(struct ahash_request *req) | 198 | static inline int crypto_ahash_init(struct ahash_request *req) |
| 148 | { | 199 | { |
| 149 | struct ahash_tfm *crt = crypto_ahash_crt(crypto_ahash_reqtfm(req)); | 200 | return crypto_ahash_reqtfm(req)->init(req); |
| 150 | return crt->init(req); | ||
| 151 | } | 201 | } |
| 152 | 202 | ||
| 153 | static inline int crypto_ahash_update(struct ahash_request *req) | 203 | static inline int crypto_ahash_update(struct ahash_request *req) |
| 154 | { | 204 | { |
| 155 | struct ahash_tfm *crt = crypto_ahash_crt(crypto_ahash_reqtfm(req)); | 205 | return crypto_ahash_reqtfm(req)->update(req); |
| 156 | return crt->update(req); | ||
| 157 | } | ||
| 158 | |||
| 159 | static inline int crypto_ahash_final(struct ahash_request *req) | ||
| 160 | { | ||
| 161 | struct ahash_tfm *crt = crypto_ahash_crt(crypto_ahash_reqtfm(req)); | ||
| 162 | return crt->final(req); | ||
| 163 | } | 206 | } |
| 164 | 207 | ||
| 165 | static inline void ahash_request_set_tfm(struct ahash_request *req, | 208 | static inline void ahash_request_set_tfm(struct ahash_request *req, |
| @@ -184,7 +227,7 @@ static inline struct ahash_request *ahash_request_alloc( | |||
| 184 | 227 | ||
| 185 | static inline void ahash_request_free(struct ahash_request *req) | 228 | static inline void ahash_request_free(struct ahash_request *req) |
| 186 | { | 229 | { |
| 187 | kfree(req); | 230 | kzfree(req); |
| 188 | } | 231 | } |
| 189 | 232 | ||
| 190 | static inline struct ahash_request *ahash_request_cast( | 233 | static inline struct ahash_request *ahash_request_cast( |
| @@ -251,6 +294,11 @@ static inline unsigned int crypto_shash_digestsize(struct crypto_shash *tfm) | |||
| 251 | return crypto_shash_alg(tfm)->digestsize; | 294 | return crypto_shash_alg(tfm)->digestsize; |
| 252 | } | 295 | } |
| 253 | 296 | ||
| 297 | static inline unsigned int crypto_shash_statesize(struct crypto_shash *tfm) | ||
| 298 | { | ||
| 299 | return crypto_shash_alg(tfm)->statesize; | ||
| 300 | } | ||
| 301 | |||
| 254 | static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) | 302 | static inline u32 crypto_shash_get_flags(struct crypto_shash *tfm) |
| 255 | { | 303 | { |
| 256 | return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); | 304 | return crypto_tfm_get_flags(crypto_shash_tfm(tfm)); |
| @@ -268,7 +316,7 @@ static inline void crypto_shash_clear_flags(struct crypto_shash *tfm, u32 flags) | |||
| 268 | 316 | ||
| 269 | static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) | 317 | static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm) |
| 270 | { | 318 | { |
| 271 | return crypto_shash_alg(tfm)->descsize; | 319 | return tfm->descsize; |
| 272 | } | 320 | } |
| 273 | 321 | ||
| 274 | static inline void *shash_desc_ctx(struct shash_desc *desc) | 322 | static inline void *shash_desc_ctx(struct shash_desc *desc) |
| @@ -281,12 +329,15 @@ int crypto_shash_setkey(struct crypto_shash *tfm, const u8 *key, | |||
| 281 | int crypto_shash_digest(struct shash_desc *desc, const u8 *data, | 329 | int crypto_shash_digest(struct shash_desc *desc, const u8 *data, |
| 282 | unsigned int len, u8 *out); | 330 | unsigned int len, u8 *out); |
| 283 | 331 | ||
| 284 | static inline void crypto_shash_export(struct shash_desc *desc, u8 *out) | 332 | static inline int crypto_shash_export(struct shash_desc *desc, void *out) |
| 285 | { | 333 | { |
| 286 | memcpy(out, shash_desc_ctx(desc), crypto_shash_descsize(desc->tfm)); | 334 | return crypto_shash_alg(desc->tfm)->export(desc, out); |
| 287 | } | 335 | } |
| 288 | 336 | ||
| 289 | int crypto_shash_import(struct shash_desc *desc, const u8 *in); | 337 | static inline int crypto_shash_import(struct shash_desc *desc, const void *in) |
| 338 | { | ||
| 339 | return crypto_shash_alg(desc->tfm)->import(desc, in); | ||
| 340 | } | ||
| 290 | 341 | ||
| 291 | static inline int crypto_shash_init(struct shash_desc *desc) | 342 | static inline int crypto_shash_init(struct shash_desc *desc) |
| 292 | { | 343 | { |
diff --git a/include/crypto/internal/hash.h b/include/crypto/internal/hash.h index 82b70564bcab..5bfad8c80595 100644 --- a/include/crypto/internal/hash.h +++ b/include/crypto/internal/hash.h | |||
| @@ -34,6 +34,22 @@ struct crypto_hash_walk { | |||
| 34 | unsigned int flags; | 34 | unsigned int flags; |
| 35 | }; | 35 | }; |
| 36 | 36 | ||
| 37 | struct ahash_instance { | ||
| 38 | struct ahash_alg alg; | ||
| 39 | }; | ||
| 40 | |||
| 41 | struct shash_instance { | ||
| 42 | struct shash_alg alg; | ||
| 43 | }; | ||
| 44 | |||
| 45 | struct crypto_ahash_spawn { | ||
| 46 | struct crypto_spawn base; | ||
| 47 | }; | ||
| 48 | |||
| 49 | struct crypto_shash_spawn { | ||
| 50 | struct crypto_spawn base; | ||
| 51 | }; | ||
| 52 | |||
| 37 | extern const struct crypto_type crypto_ahash_type; | 53 | extern const struct crypto_type crypto_ahash_type; |
| 38 | 54 | ||
| 39 | int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); | 55 | int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err); |
| @@ -43,18 +59,100 @@ int crypto_hash_walk_first_compat(struct hash_desc *hdesc, | |||
| 43 | struct crypto_hash_walk *walk, | 59 | struct crypto_hash_walk *walk, |
| 44 | struct scatterlist *sg, unsigned int len); | 60 | struct scatterlist *sg, unsigned int len); |
| 45 | 61 | ||
| 62 | static inline int crypto_hash_walk_last(struct crypto_hash_walk *walk) | ||
| 63 | { | ||
| 64 | return !(walk->entrylen | walk->total); | ||
| 65 | } | ||
| 66 | |||
| 67 | int crypto_register_ahash(struct ahash_alg *alg); | ||
| 68 | int crypto_unregister_ahash(struct ahash_alg *alg); | ||
| 69 | int ahash_register_instance(struct crypto_template *tmpl, | ||
| 70 | struct ahash_instance *inst); | ||
| 71 | void ahash_free_instance(struct crypto_instance *inst); | ||
| 72 | |||
| 73 | int crypto_init_ahash_spawn(struct crypto_ahash_spawn *spawn, | ||
| 74 | struct hash_alg_common *alg, | ||
| 75 | struct crypto_instance *inst); | ||
| 76 | |||
| 77 | static inline void crypto_drop_ahash(struct crypto_ahash_spawn *spawn) | ||
| 78 | { | ||
| 79 | crypto_drop_spawn(&spawn->base); | ||
| 80 | } | ||
| 81 | |||
| 82 | struct hash_alg_common *ahash_attr_alg(struct rtattr *rta, u32 type, u32 mask); | ||
| 83 | |||
| 46 | int crypto_register_shash(struct shash_alg *alg); | 84 | int crypto_register_shash(struct shash_alg *alg); |
| 47 | int crypto_unregister_shash(struct shash_alg *alg); | 85 | int crypto_unregister_shash(struct shash_alg *alg); |
| 86 | int shash_register_instance(struct crypto_template *tmpl, | ||
| 87 | struct shash_instance *inst); | ||
| 88 | void shash_free_instance(struct crypto_instance *inst); | ||
| 89 | |||
| 90 | int crypto_init_shash_spawn(struct crypto_shash_spawn *spawn, | ||
| 91 | struct shash_alg *alg, | ||
| 92 | struct crypto_instance *inst); | ||
| 93 | |||
| 94 | static inline void crypto_drop_shash(struct crypto_shash_spawn *spawn) | ||
| 95 | { | ||
| 96 | crypto_drop_spawn(&spawn->base); | ||
| 97 | } | ||
| 98 | |||
| 99 | struct shash_alg *shash_attr_alg(struct rtattr *rta, u32 type, u32 mask); | ||
| 100 | |||
| 101 | int shash_ahash_update(struct ahash_request *req, struct shash_desc *desc); | ||
| 102 | int shash_ahash_finup(struct ahash_request *req, struct shash_desc *desc); | ||
| 103 | int shash_ahash_digest(struct ahash_request *req, struct shash_desc *desc); | ||
| 104 | |||
| 105 | int crypto_init_shash_ops_async(struct crypto_tfm *tfm); | ||
| 48 | 106 | ||
| 49 | static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm) | 107 | static inline void *crypto_ahash_ctx(struct crypto_ahash *tfm) |
| 50 | { | 108 | { |
| 51 | return crypto_tfm_ctx(&tfm->base); | 109 | return crypto_tfm_ctx(crypto_ahash_tfm(tfm)); |
| 110 | } | ||
| 111 | |||
| 112 | static inline struct ahash_alg *__crypto_ahash_alg(struct crypto_alg *alg) | ||
| 113 | { | ||
| 114 | return container_of(__crypto_hash_alg_common(alg), struct ahash_alg, | ||
| 115 | halg); | ||
| 116 | } | ||
| 117 | |||
| 118 | static inline void crypto_ahash_set_reqsize(struct crypto_ahash *tfm, | ||
| 119 | unsigned int reqsize) | ||
| 120 | { | ||
| 121 | tfm->reqsize = reqsize; | ||
| 122 | } | ||
| 123 | |||
| 124 | static inline struct crypto_instance *ahash_crypto_instance( | ||
| 125 | struct ahash_instance *inst) | ||
| 126 | { | ||
| 127 | return container_of(&inst->alg.halg.base, struct crypto_instance, alg); | ||
| 52 | } | 128 | } |
| 53 | 129 | ||
| 54 | static inline struct ahash_alg *crypto_ahash_alg( | 130 | static inline struct ahash_instance *ahash_instance( |
| 55 | struct crypto_ahash *tfm) | 131 | struct crypto_instance *inst) |
| 56 | { | 132 | { |
| 57 | return &crypto_ahash_tfm(tfm)->__crt_alg->cra_ahash; | 133 | return container_of(&inst->alg, struct ahash_instance, alg.halg.base); |
| 134 | } | ||
| 135 | |||
| 136 | static inline void *ahash_instance_ctx(struct ahash_instance *inst) | ||
| 137 | { | ||
| 138 | return crypto_instance_ctx(ahash_crypto_instance(inst)); | ||
| 139 | } | ||
| 140 | |||
| 141 | static inline unsigned int ahash_instance_headroom(void) | ||
| 142 | { | ||
| 143 | return sizeof(struct ahash_alg) - sizeof(struct crypto_alg); | ||
| 144 | } | ||
| 145 | |||
| 146 | static inline struct ahash_instance *ahash_alloc_instance( | ||
| 147 | const char *name, struct crypto_alg *alg) | ||
| 148 | { | ||
| 149 | return crypto_alloc_instance2(name, alg, ahash_instance_headroom()); | ||
| 150 | } | ||
| 151 | |||
| 152 | static inline struct crypto_ahash *crypto_spawn_ahash( | ||
| 153 | struct crypto_ahash_spawn *spawn) | ||
| 154 | { | ||
| 155 | return crypto_spawn_tfm2(&spawn->base); | ||
| 58 | } | 156 | } |
| 59 | 157 | ||
| 60 | static inline int ahash_enqueue_request(struct crypto_queue *queue, | 158 | static inline int ahash_enqueue_request(struct crypto_queue *queue, |
| @@ -80,5 +178,46 @@ static inline void *crypto_shash_ctx(struct crypto_shash *tfm) | |||
| 80 | return crypto_tfm_ctx(&tfm->base); | 178 | return crypto_tfm_ctx(&tfm->base); |
| 81 | } | 179 | } |
| 82 | 180 | ||
| 181 | static inline struct crypto_instance *shash_crypto_instance( | ||
| 182 | struct shash_instance *inst) | ||
| 183 | { | ||
| 184 | return container_of(&inst->alg.base, struct crypto_instance, alg); | ||
| 185 | } | ||
| 186 | |||
| 187 | static inline struct shash_instance *shash_instance( | ||
| 188 | struct crypto_instance *inst) | ||
| 189 | { | ||
| 190 | return container_of(__crypto_shash_alg(&inst->alg), | ||
| 191 | struct shash_instance, alg); | ||
| 192 | } | ||
| 193 | |||
| 194 | static inline void *shash_instance_ctx(struct shash_instance *inst) | ||
| 195 | { | ||
| 196 | return crypto_instance_ctx(shash_crypto_instance(inst)); | ||
| 197 | } | ||
| 198 | |||
| 199 | static inline struct shash_instance *shash_alloc_instance( | ||
| 200 | const char *name, struct crypto_alg *alg) | ||
| 201 | { | ||
| 202 | return crypto_alloc_instance2(name, alg, | ||
| 203 | sizeof(struct shash_alg) - sizeof(*alg)); | ||
| 204 | } | ||
| 205 | |||
| 206 | static inline struct crypto_shash *crypto_spawn_shash( | ||
| 207 | struct crypto_shash_spawn *spawn) | ||
| 208 | { | ||
| 209 | return crypto_spawn_tfm2(&spawn->base); | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline void *crypto_shash_ctx_aligned(struct crypto_shash *tfm) | ||
| 213 | { | ||
| 214 | return crypto_tfm_ctx_aligned(&tfm->base); | ||
| 215 | } | ||
| 216 | |||
| 217 | static inline struct crypto_shash *__crypto_shash_cast(struct crypto_tfm *tfm) | ||
| 218 | { | ||
| 219 | return container_of(tfm, struct crypto_shash, base); | ||
| 220 | } | ||
| 221 | |||
| 83 | #endif /* _CRYPTO_INTERNAL_HASH_H */ | 222 | #endif /* _CRYPTO_INTERNAL_HASH_H */ |
| 84 | 223 | ||
diff --git a/include/crypto/internal/skcipher.h b/include/crypto/internal/skcipher.h index 2ba42cd7d6aa..3a748a6bf772 100644 --- a/include/crypto/internal/skcipher.h +++ b/include/crypto/internal/skcipher.h | |||
| @@ -79,8 +79,8 @@ static inline int skcipher_enqueue_givcrypt( | |||
| 79 | static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt( | 79 | static inline struct skcipher_givcrypt_request *skcipher_dequeue_givcrypt( |
| 80 | struct crypto_queue *queue) | 80 | struct crypto_queue *queue) |
| 81 | { | 81 | { |
| 82 | return container_of(ablkcipher_dequeue_request(queue), | 82 | return __crypto_dequeue_request( |
| 83 | struct skcipher_givcrypt_request, creq); | 83 | queue, offsetof(struct skcipher_givcrypt_request, creq.base)); |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | static inline void *skcipher_givcrypt_reqctx( | 86 | static inline void *skcipher_givcrypt_reqctx( |
diff --git a/include/crypto/sha.h b/include/crypto/sha.h index c0ccc2b1a2d8..069e85ba97e1 100644 --- a/include/crypto/sha.h +++ b/include/crypto/sha.h | |||
| @@ -5,6 +5,8 @@ | |||
| 5 | #ifndef _CRYPTO_SHA_H | 5 | #ifndef _CRYPTO_SHA_H |
| 6 | #define _CRYPTO_SHA_H | 6 | #define _CRYPTO_SHA_H |
| 7 | 7 | ||
| 8 | #include <linux/types.h> | ||
| 9 | |||
| 8 | #define SHA1_DIGEST_SIZE 20 | 10 | #define SHA1_DIGEST_SIZE 20 |
| 9 | #define SHA1_BLOCK_SIZE 64 | 11 | #define SHA1_BLOCK_SIZE 64 |
| 10 | 12 | ||
| @@ -62,4 +64,22 @@ | |||
| 62 | #define SHA512_H6 0x1f83d9abfb41bd6bULL | 64 | #define SHA512_H6 0x1f83d9abfb41bd6bULL |
| 63 | #define SHA512_H7 0x5be0cd19137e2179ULL | 65 | #define SHA512_H7 0x5be0cd19137e2179ULL |
| 64 | 66 | ||
| 67 | struct sha1_state { | ||
| 68 | u64 count; | ||
| 69 | u32 state[SHA1_DIGEST_SIZE / 4]; | ||
| 70 | u8 buffer[SHA1_BLOCK_SIZE]; | ||
| 71 | }; | ||
| 72 | |||
| 73 | struct sha256_state { | ||
| 74 | u64 count; | ||
| 75 | u32 state[SHA256_DIGEST_SIZE / 4]; | ||
| 76 | u8 buf[SHA256_BLOCK_SIZE]; | ||
| 77 | }; | ||
| 78 | |||
| 79 | struct sha512_state { | ||
| 80 | u64 count[2]; | ||
| 81 | u64 state[SHA512_DIGEST_SIZE / 8]; | ||
| 82 | u8 buf[SHA512_BLOCK_SIZE]; | ||
| 83 | }; | ||
| 84 | |||
| 65 | #endif | 85 | #endif |
diff --git a/include/crypto/vmac.h b/include/crypto/vmac.h new file mode 100644 index 000000000000..c4467c55df1e --- /dev/null +++ b/include/crypto/vmac.h | |||
| @@ -0,0 +1,61 @@ | |||
| 1 | /* | ||
| 2 | * Modified to interface to the Linux kernel | ||
| 3 | * Copyright (c) 2009, Intel Corporation. | ||
| 4 | * | ||
| 5 | * This program is free software; you can redistribute it and/or modify it | ||
| 6 | * under the terms and conditions of the GNU General Public License, | ||
| 7 | * version 2, as published by the Free Software Foundation. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 12 | * more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License along with | ||
| 15 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
| 16 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
| 17 | */ | ||
| 18 | |||
| 19 | #ifndef __CRYPTO_VMAC_H | ||
| 20 | #define __CRYPTO_VMAC_H | ||
| 21 | |||
| 22 | /* -------------------------------------------------------------------------- | ||
| 23 | * VMAC and VHASH Implementation by Ted Krovetz (tdk@acm.org) and Wei Dai. | ||
| 24 | * This implementation is herby placed in the public domain. | ||
| 25 | * The authors offers no warranty. Use at your own risk. | ||
| 26 | * Please send bug reports to the authors. | ||
| 27 | * Last modified: 17 APR 08, 1700 PDT | ||
| 28 | * ----------------------------------------------------------------------- */ | ||
| 29 | |||
| 30 | /* | ||
| 31 | * User definable settings. | ||
| 32 | */ | ||
| 33 | #define VMAC_TAG_LEN 64 | ||
| 34 | #define VMAC_KEY_SIZE 128/* Must be 128, 192 or 256 */ | ||
| 35 | #define VMAC_KEY_LEN (VMAC_KEY_SIZE/8) | ||
| 36 | #define VMAC_NHBYTES 128/* Must 2^i for any 3 < i < 13 Standard = 128*/ | ||
| 37 | |||
| 38 | /* | ||
| 39 | * This implementation uses u32 and u64 as names for unsigned 32- | ||
| 40 | * and 64-bit integer types. These are defined in C99 stdint.h. The | ||
| 41 | * following may need adaptation if you are not running a C99 or | ||
| 42 | * Microsoft C environment. | ||
| 43 | */ | ||
| 44 | struct vmac_ctx { | ||
| 45 | u64 nhkey[(VMAC_NHBYTES/8)+2*(VMAC_TAG_LEN/64-1)]; | ||
| 46 | u64 polykey[2*VMAC_TAG_LEN/64]; | ||
| 47 | u64 l3key[2*VMAC_TAG_LEN/64]; | ||
| 48 | u64 polytmp[2*VMAC_TAG_LEN/64]; | ||
| 49 | u64 cached_nonce[2]; | ||
| 50 | u64 cached_aes[2]; | ||
| 51 | int first_block_processed; | ||
| 52 | }; | ||
| 53 | |||
| 54 | typedef u64 vmac_t; | ||
| 55 | |||
| 56 | struct vmac_ctx_t { | ||
| 57 | struct crypto_cipher *child; | ||
| 58 | struct vmac_ctx __vmac_ctx; | ||
| 59 | }; | ||
| 60 | |||
| 61 | #endif /* __CRYPTO_VMAC_H */ | ||
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index 7174818c2c13..853508499d20 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
| @@ -257,9 +257,12 @@ | |||
| 257 | {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \ | 257 | {0x1002, 0x940F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_R600|RADEON_NEW_MEMMAP}, \ |
| 258 | {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 258 | {0x1002, 0x94A0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 259 | {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 259 | {0x1002, 0x94A1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 260 | {0x1002, 0x94A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 260 | {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | 261 | {0x1002, 0x94B1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ |
| 261 | {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | 262 | {0x1002, 0x94B3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ |
| 263 | {0x1002, 0x94B4, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | ||
| 262 | {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ | 264 | {0x1002, 0x94B5, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_NEW_MEMMAP}, \ |
| 265 | {0x1002, 0x94B9, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV740|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 263 | {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 266 | {0x1002, 0x9440, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
| 264 | {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 267 | {0x1002, 0x9441, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
| 265 | {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ | 268 | {0x1002, 0x9442, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV770|RADEON_NEW_MEMMAP}, \ |
| @@ -288,6 +291,7 @@ | |||
| 288 | {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 291 | {0x1002, 0x948F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 289 | {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 292 | {0x1002, 0x9490, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 290 | {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 293 | {0x1002, 0x9491, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 294 | {0x1002, 0x9495, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | ||
| 291 | {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 295 | {0x1002, 0x9498, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 292 | {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 296 | {0x1002, 0x949C, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| 293 | {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ | 297 | {0x1002, 0x949E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV730|RADEON_NEW_MEMMAP}, \ |
| @@ -325,6 +329,7 @@ | |||
| 325 | {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 329 | {0x1002, 0x9552, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 326 | {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 330 | {0x1002, 0x9553, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 327 | {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 331 | {0x1002, 0x9555, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 332 | {0x1002, 0x9557, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | ||
| 328 | {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ | 333 | {0x1002, 0x9580, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_NEW_MEMMAP}, \ |
| 329 | {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 334 | {0x1002, 0x9581, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| 330 | {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 335 | {0x1002, 0x9583, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RV630|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
| @@ -365,6 +370,11 @@ | |||
| 365 | {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 370 | {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 366 | {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 371 | {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 367 | {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | 372 | {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ |
| 373 | {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 374 | {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 375 | {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 376 | {0x1002, 0x9713, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 377 | {0x1002, 0x9714, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ | ||
| 368 | {0, 0, 0} | 378 | {0, 0, 0} |
| 369 | 379 | ||
| 370 | #define r128_PCI_IDS \ | 380 | #define r128_PCI_IDS \ |
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index 41862e9a4c20..2ba61e18fc8b 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
| @@ -506,6 +506,9 @@ typedef struct { | |||
| 506 | #define DRM_RADEON_GEM_WAIT_IDLE 0x24 | 506 | #define DRM_RADEON_GEM_WAIT_IDLE 0x24 |
| 507 | #define DRM_RADEON_CS 0x26 | 507 | #define DRM_RADEON_CS 0x26 |
| 508 | #define DRM_RADEON_INFO 0x27 | 508 | #define DRM_RADEON_INFO 0x27 |
| 509 | #define DRM_RADEON_GEM_SET_TILING 0x28 | ||
| 510 | #define DRM_RADEON_GEM_GET_TILING 0x29 | ||
| 511 | #define DRM_RADEON_GEM_BUSY 0x2a | ||
| 509 | 512 | ||
| 510 | #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) | 513 | #define DRM_IOCTL_RADEON_CP_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t) |
| 511 | #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) | 514 | #define DRM_IOCTL_RADEON_CP_START DRM_IO( DRM_COMMAND_BASE + DRM_RADEON_CP_START) |
| @@ -544,7 +547,9 @@ typedef struct { | |||
| 544 | #define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) | 547 | #define DRM_IOCTL_RADEON_GEM_WAIT_IDLE DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle) |
| 545 | #define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) | 548 | #define DRM_IOCTL_RADEON_CS DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs) |
| 546 | #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) | 549 | #define DRM_IOCTL_RADEON_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info) |
| 547 | 550 | #define DRM_IOCTL_RADEON_SET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling) | |
| 551 | #define DRM_IOCTL_RADEON_GET_TILING DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling) | ||
| 552 | #define DRM_IOCTL_RADEON_GEM_BUSY DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy) | ||
| 548 | 553 | ||
| 549 | typedef struct drm_radeon_init { | 554 | typedef struct drm_radeon_init { |
| 550 | enum { | 555 | enum { |
| @@ -704,6 +709,7 @@ typedef struct drm_radeon_indirect { | |||
| 704 | #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ | 709 | #define RADEON_PARAM_FB_LOCATION 14 /* FB location */ |
| 705 | #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ | 710 | #define RADEON_PARAM_NUM_GB_PIPES 15 /* num GB pipes */ |
| 706 | #define RADEON_PARAM_DEVICE_ID 16 | 711 | #define RADEON_PARAM_DEVICE_ID 16 |
| 712 | #define RADEON_PARAM_NUM_Z_PIPES 17 /* num Z pipes */ | ||
| 707 | 713 | ||
| 708 | typedef struct drm_radeon_getparam { | 714 | typedef struct drm_radeon_getparam { |
| 709 | int param; | 715 | int param; |
| @@ -796,6 +802,24 @@ struct drm_radeon_gem_create { | |||
| 796 | uint32_t flags; | 802 | uint32_t flags; |
| 797 | }; | 803 | }; |
| 798 | 804 | ||
| 805 | #define RADEON_TILING_MACRO 0x1 | ||
| 806 | #define RADEON_TILING_MICRO 0x2 | ||
| 807 | #define RADEON_TILING_SWAP 0x4 | ||
| 808 | #define RADEON_TILING_SURFACE 0x8 /* this object requires a surface | ||
| 809 | * when mapped - i.e. front buffer */ | ||
| 810 | |||
| 811 | struct drm_radeon_gem_set_tiling { | ||
| 812 | uint32_t handle; | ||
| 813 | uint32_t tiling_flags; | ||
| 814 | uint32_t pitch; | ||
| 815 | }; | ||
| 816 | |||
| 817 | struct drm_radeon_gem_get_tiling { | ||
| 818 | uint32_t handle; | ||
| 819 | uint32_t tiling_flags; | ||
| 820 | uint32_t pitch; | ||
| 821 | }; | ||
| 822 | |||
| 799 | struct drm_radeon_gem_mmap { | 823 | struct drm_radeon_gem_mmap { |
| 800 | uint32_t handle; | 824 | uint32_t handle; |
| 801 | uint32_t pad; | 825 | uint32_t pad; |
| @@ -817,7 +841,7 @@ struct drm_radeon_gem_wait_idle { | |||
| 817 | 841 | ||
| 818 | struct drm_radeon_gem_busy { | 842 | struct drm_radeon_gem_busy { |
| 819 | uint32_t handle; | 843 | uint32_t handle; |
| 820 | uint32_t busy; | 844 | uint32_t domain; |
| 821 | }; | 845 | }; |
| 822 | 846 | ||
| 823 | struct drm_radeon_gem_pread { | 847 | struct drm_radeon_gem_pread { |
| @@ -874,6 +898,7 @@ struct drm_radeon_cs { | |||
| 874 | 898 | ||
| 875 | #define RADEON_INFO_DEVICE_ID 0x00 | 899 | #define RADEON_INFO_DEVICE_ID 0x00 |
| 876 | #define RADEON_INFO_NUM_GB_PIPES 0x01 | 900 | #define RADEON_INFO_NUM_GB_PIPES 0x01 |
| 901 | #define RADEON_INFO_NUM_Z_PIPES 0x02 | ||
| 877 | 902 | ||
| 878 | struct drm_radeon_info { | 903 | struct drm_radeon_info { |
| 879 | uint32_t request; | 904 | uint32_t request; |
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 62ed733c52a2..a68829db381a 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -121,6 +121,7 @@ struct ttm_backend { | |||
| 121 | #define TTM_PAGE_FLAG_SWAPPED (1 << 4) | 121 | #define TTM_PAGE_FLAG_SWAPPED (1 << 4) |
| 122 | #define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) | 122 | #define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) |
| 123 | #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) | 123 | #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) |
| 124 | #define TTM_PAGE_FLAG_DMA32 (1 << 7) | ||
| 124 | 125 | ||
| 125 | enum ttm_caching_state { | 126 | enum ttm_caching_state { |
| 126 | tt_uncached, | 127 | tt_uncached, |
| @@ -353,6 +354,14 @@ struct ttm_bo_driver { | |||
| 353 | int (*sync_obj_flush) (void *sync_obj, void *sync_arg); | 354 | int (*sync_obj_flush) (void *sync_obj, void *sync_arg); |
| 354 | void (*sync_obj_unref) (void **sync_obj); | 355 | void (*sync_obj_unref) (void **sync_obj); |
| 355 | void *(*sync_obj_ref) (void *sync_obj); | 356 | void *(*sync_obj_ref) (void *sync_obj); |
| 357 | |||
| 358 | /* hook to notify driver about a driver move so it | ||
| 359 | * can do tiling things */ | ||
| 360 | void (*move_notify)(struct ttm_buffer_object *bo, | ||
| 361 | struct ttm_mem_reg *new_mem); | ||
| 362 | /* notify the driver we are taking a fault on this BO | ||
| 363 | * and have reserved it */ | ||
| 364 | void (*fault_reserve_notify)(struct ttm_buffer_object *bo); | ||
| 356 | }; | 365 | }; |
| 357 | 366 | ||
| 358 | #define TTM_NUM_MEM_TYPES 8 | 367 | #define TTM_NUM_MEM_TYPES 8 |
| @@ -429,6 +438,8 @@ struct ttm_bo_device { | |||
| 429 | */ | 438 | */ |
| 430 | 439 | ||
| 431 | struct delayed_work wq; | 440 | struct delayed_work wq; |
| 441 | |||
| 442 | bool need_dma32; | ||
| 432 | }; | 443 | }; |
| 433 | 444 | ||
| 434 | /** | 445 | /** |
| @@ -648,7 +659,14 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev); | |||
| 648 | extern int ttm_bo_device_init(struct ttm_bo_device *bdev, | 659 | extern int ttm_bo_device_init(struct ttm_bo_device *bdev, |
| 649 | struct ttm_mem_global *mem_glob, | 660 | struct ttm_mem_global *mem_glob, |
| 650 | struct ttm_bo_driver *driver, | 661 | struct ttm_bo_driver *driver, |
| 651 | uint64_t file_page_offset); | 662 | uint64_t file_page_offset, bool need_dma32); |
| 663 | |||
| 664 | /** | ||
| 665 | * ttm_bo_unmap_virtual | ||
| 666 | * | ||
| 667 | * @bo: tear down the virtual mappings for this BO | ||
| 668 | */ | ||
| 669 | extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | ||
| 652 | 670 | ||
| 653 | /** | 671 | /** |
| 654 | * ttm_bo_reserve: | 672 | * ttm_bo_reserve: |
diff --git a/include/drm/ttm/ttm_module.h b/include/drm/ttm/ttm_module.h index 889a4c7958ae..d1d433834e4f 100644 --- a/include/drm/ttm/ttm_module.h +++ b/include/drm/ttm/ttm_module.h | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | 33 | ||
| 34 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
| 35 | 35 | ||
| 36 | #define TTM_PFX "[TTM]" | 36 | #define TTM_PFX "[TTM] " |
| 37 | 37 | ||
| 38 | enum ttm_global_types { | 38 | enum ttm_global_types { |
| 39 | TTM_GLOBAL_TTM_MEM = 0, | 39 | TTM_GLOBAL_TTM_MEM = 0, |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 334a3593cdfd..cff4a101f266 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -268,6 +268,10 @@ ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | |||
| 268 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 268 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) |
| 269 | unifdef-y += kvm.h | 269 | unifdef-y += kvm.h |
| 270 | endif | 270 | endif |
| 271 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | ||
| 272 | $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),) | ||
| 273 | unifdef-y += kvm_para.h | ||
| 274 | endif | ||
| 271 | unifdef-y += llc.h | 275 | unifdef-y += llc.h |
| 272 | unifdef-y += loop.h | 276 | unifdef-y += loop.h |
| 273 | unifdef-y += lp.h | 277 | unifdef-y += lp.h |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 9b93cafa82a0..ab94335b4bb9 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -36,6 +36,11 @@ struct amba_driver { | |||
| 36 | struct amba_id *id_table; | 36 | struct amba_id *id_table; |
| 37 | }; | 37 | }; |
| 38 | 38 | ||
| 39 | enum amba_vendor { | ||
| 40 | AMBA_VENDOR_ARM = 0x41, | ||
| 41 | AMBA_VENDOR_ST = 0x80, | ||
| 42 | }; | ||
| 43 | |||
| 39 | #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) | 44 | #define amba_get_drvdata(d) dev_get_drvdata(&d->dev) |
| 40 | #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) | 45 | #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p) |
| 41 | 46 | ||
diff --git a/include/linux/amba/pl093.h b/include/linux/amba/pl093.h new file mode 100644 index 000000000000..2983e3671adb --- /dev/null +++ b/include/linux/amba/pl093.h | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | /* linux/amba/pl093.h | ||
| 2 | * | ||
| 3 | * Copyright (c) 2008 Simtec Electronics | ||
| 4 | * http://armlinux.simtec.co.uk/ | ||
| 5 | * Ben Dooks <ben@simtec.co.uk> | ||
| 6 | * | ||
| 7 | * AMBA PL093 SSMC (synchronous static memory controller) | ||
| 8 | * See DDI0236.pdf (r0p4) for more details | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | #define SMB_BANK(x) ((x) * 0x20) /* each bank control set is 0x20 apart */ | ||
| 16 | |||
| 17 | /* Offsets for SMBxxxxRy registers */ | ||
| 18 | |||
| 19 | #define SMBIDCYR (0x00) | ||
| 20 | #define SMBWSTRDR (0x04) | ||
| 21 | #define SMBWSTWRR (0x08) | ||
| 22 | #define SMBWSTOENR (0x0C) | ||
| 23 | #define SMBWSTWENR (0x10) | ||
| 24 | #define SMBCR (0x14) | ||
| 25 | #define SMBSR (0x18) | ||
| 26 | #define SMBWSTBRDR (0x1C) | ||
| 27 | |||
| 28 | /* Masks for SMB registers */ | ||
| 29 | #define IDCY_MASK (0xf) | ||
| 30 | #define WSTRD_MASK (0xf) | ||
| 31 | #define WSTWR_MASK (0xf) | ||
| 32 | #define WSTOEN_MASK (0xf) | ||
| 33 | #define WSTWEN_MASK (0xf) | ||
| 34 | |||
| 35 | /* Notes from datasheet: | ||
| 36 | * WSTOEN <= WSTRD | ||
| 37 | * WSTWEN <= WSTWR | ||
| 38 | * | ||
| 39 | * WSTOEN is not used with nWAIT | ||
| 40 | */ | ||
| 41 | |||
| 42 | /* SMBCR bit definitions */ | ||
| 43 | #define SMBCR_BIWRITEEN (1 << 21) | ||
| 44 | #define SMBCR_ADDRVALIDWRITEEN (1 << 20) | ||
| 45 | #define SMBCR_SYNCWRITE (1 << 17) | ||
| 46 | #define SMBCR_BMWRITE (1 << 16) | ||
| 47 | #define SMBCR_WRAPREAD (1 << 14) | ||
| 48 | #define SMBCR_BIREADEN (1 << 13) | ||
| 49 | #define SMBCR_ADDRVALIDREADEN (1 << 12) | ||
| 50 | #define SMBCR_SYNCREAD (1 << 9) | ||
| 51 | #define SMBCR_BMREAD (1 << 8) | ||
| 52 | #define SMBCR_SMBLSPOL (1 << 6) | ||
| 53 | #define SMBCR_WP (1 << 3) | ||
| 54 | #define SMBCR_WAITEN (1 << 2) | ||
| 55 | #define SMBCR_WAITPOL (1 << 1) | ||
| 56 | #define SMBCR_RBLE (1 << 0) | ||
| 57 | |||
| 58 | #define SMBCR_BURSTLENWRITE_MASK (3 << 18) | ||
| 59 | #define SMBCR_BURSTLENWRITE_4 (0 << 18) | ||
| 60 | #define SMBCR_BURSTLENWRITE_8 (1 << 18) | ||
| 61 | #define SMBCR_BURSTLENWRITE_RESERVED (2 << 18) | ||
| 62 | #define SMBCR_BURSTLENWRITE_CONTINUOUS (3 << 18) | ||
| 63 | |||
| 64 | #define SMBCR_BURSTLENREAD_MASK (3 << 10) | ||
| 65 | #define SMBCR_BURSTLENREAD_4 (0 << 10) | ||
| 66 | #define SMBCR_BURSTLENREAD_8 (1 << 10) | ||
| 67 | #define SMBCR_BURSTLENREAD_16 (2 << 10) | ||
| 68 | #define SMBCR_BURSTLENREAD_CONTINUOUS (3 << 10) | ||
| 69 | |||
| 70 | #define SMBCR_MW_MASK (3 << 4) | ||
| 71 | #define SMBCR_MW_8BIT (0 << 4) | ||
| 72 | #define SMBCR_MW_16BIT (1 << 4) | ||
| 73 | #define SMBCR_MW_M32BIT (2 << 4) | ||
| 74 | |||
| 75 | /* SSMC status registers */ | ||
| 76 | #define SSMCCSR (0x200) | ||
| 77 | #define SSMCCR (0x204) | ||
| 78 | #define SSMCITCR (0x208) | ||
| 79 | #define SSMCITIP (0x20C) | ||
| 80 | #define SSMCITIOP (0x210) | ||
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index cd4bcb6989ce..7d650a0e3d8f 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
| @@ -337,7 +337,8 @@ struct net_device *alloc_arcdev(const char *name); | |||
| 337 | 337 | ||
| 338 | int arcnet_open(struct net_device *dev); | 338 | int arcnet_open(struct net_device *dev); |
| 339 | int arcnet_close(struct net_device *dev); | 339 | int arcnet_close(struct net_device *dev); |
| 340 | int arcnet_send_packet(struct sk_buff *skb, struct net_device *dev); | 340 | netdev_tx_t arcnet_send_packet(struct sk_buff *skb, |
| 341 | struct net_device *dev); | ||
| 341 | void arcnet_timeout(struct net_device *dev); | 342 | void arcnet_timeout(struct net_device *dev); |
| 342 | 343 | ||
| 343 | #endif /* __KERNEL__ */ | 344 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 9c75921f0c16..6299a259ed19 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -210,15 +210,25 @@ enum { | |||
| 210 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ | 210 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ |
| 211 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ | 211 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ |
| 212 | ATA_CMD_EDD = 0x90, /* execute device diagnostic */ | 212 | ATA_CMD_EDD = 0x90, /* execute device diagnostic */ |
| 213 | ATA_CMD_DOWNLOAD_MICRO = 0x92, | ||
| 214 | ATA_CMD_NOP = 0x00, | ||
| 213 | ATA_CMD_FLUSH = 0xE7, | 215 | ATA_CMD_FLUSH = 0xE7, |
| 214 | ATA_CMD_FLUSH_EXT = 0xEA, | 216 | ATA_CMD_FLUSH_EXT = 0xEA, |
| 215 | ATA_CMD_ID_ATA = 0xEC, | 217 | ATA_CMD_ID_ATA = 0xEC, |
| 216 | ATA_CMD_ID_ATAPI = 0xA1, | 218 | ATA_CMD_ID_ATAPI = 0xA1, |
| 219 | ATA_CMD_SERVICE = 0xA2, | ||
| 217 | ATA_CMD_READ = 0xC8, | 220 | ATA_CMD_READ = 0xC8, |
| 218 | ATA_CMD_READ_EXT = 0x25, | 221 | ATA_CMD_READ_EXT = 0x25, |
| 222 | ATA_CMD_READ_QUEUED = 0x26, | ||
| 223 | ATA_CMD_READ_STREAM_EXT = 0x2B, | ||
| 224 | ATA_CMD_READ_STREAM_DMA_EXT = 0x2A, | ||
| 219 | ATA_CMD_WRITE = 0xCA, | 225 | ATA_CMD_WRITE = 0xCA, |
| 220 | ATA_CMD_WRITE_EXT = 0x35, | 226 | ATA_CMD_WRITE_EXT = 0x35, |
| 227 | ATA_CMD_WRITE_QUEUED = 0x36, | ||
| 228 | ATA_CMD_WRITE_STREAM_EXT = 0x3B, | ||
| 229 | ATA_CMD_WRITE_STREAM_DMA_EXT = 0x3A, | ||
| 221 | ATA_CMD_WRITE_FUA_EXT = 0x3D, | 230 | ATA_CMD_WRITE_FUA_EXT = 0x3D, |
| 231 | ATA_CMD_WRITE_QUEUED_FUA_EXT = 0x3E, | ||
| 222 | ATA_CMD_FPDMA_READ = 0x60, | 232 | ATA_CMD_FPDMA_READ = 0x60, |
| 223 | ATA_CMD_FPDMA_WRITE = 0x61, | 233 | ATA_CMD_FPDMA_WRITE = 0x61, |
| 224 | ATA_CMD_PIO_READ = 0x20, | 234 | ATA_CMD_PIO_READ = 0x20, |
| @@ -235,6 +245,7 @@ enum { | |||
| 235 | ATA_CMD_PACKET = 0xA0, | 245 | ATA_CMD_PACKET = 0xA0, |
| 236 | ATA_CMD_VERIFY = 0x40, | 246 | ATA_CMD_VERIFY = 0x40, |
| 237 | ATA_CMD_VERIFY_EXT = 0x42, | 247 | ATA_CMD_VERIFY_EXT = 0x42, |
| 248 | ATA_CMD_WRITE_UNCORR_EXT = 0x45, | ||
| 238 | ATA_CMD_STANDBYNOW1 = 0xE0, | 249 | ATA_CMD_STANDBYNOW1 = 0xE0, |
| 239 | ATA_CMD_IDLEIMMEDIATE = 0xE1, | 250 | ATA_CMD_IDLEIMMEDIATE = 0xE1, |
| 240 | ATA_CMD_SLEEP = 0xE6, | 251 | ATA_CMD_SLEEP = 0xE6, |
| @@ -243,15 +254,34 @@ enum { | |||
| 243 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, | 254 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, |
| 244 | ATA_CMD_SET_MAX = 0xF9, | 255 | ATA_CMD_SET_MAX = 0xF9, |
| 245 | ATA_CMD_SET_MAX_EXT = 0x37, | 256 | ATA_CMD_SET_MAX_EXT = 0x37, |
| 246 | ATA_CMD_READ_LOG_EXT = 0x2f, | 257 | ATA_CMD_READ_LOG_EXT = 0x2F, |
| 258 | ATA_CMD_WRITE_LOG_EXT = 0x3F, | ||
| 259 | ATA_CMD_READ_LOG_DMA_EXT = 0x47, | ||
| 260 | ATA_CMD_WRITE_LOG_DMA_EXT = 0x57, | ||
| 261 | ATA_CMD_TRUSTED_RCV = 0x5C, | ||
| 262 | ATA_CMD_TRUSTED_RCV_DMA = 0x5D, | ||
| 263 | ATA_CMD_TRUSTED_SND = 0x5E, | ||
| 264 | ATA_CMD_TRUSTED_SND_DMA = 0x5F, | ||
| 247 | ATA_CMD_PMP_READ = 0xE4, | 265 | ATA_CMD_PMP_READ = 0xE4, |
| 248 | ATA_CMD_PMP_WRITE = 0xE8, | 266 | ATA_CMD_PMP_WRITE = 0xE8, |
| 249 | ATA_CMD_CONF_OVERLAY = 0xB1, | 267 | ATA_CMD_CONF_OVERLAY = 0xB1, |
| 268 | ATA_CMD_SEC_SET_PASS = 0xF1, | ||
| 269 | ATA_CMD_SEC_UNLOCK = 0xF2, | ||
| 270 | ATA_CMD_SEC_ERASE_PREP = 0xF3, | ||
| 271 | ATA_CMD_SEC_ERASE_UNIT = 0xF4, | ||
| 250 | ATA_CMD_SEC_FREEZE_LOCK = 0xF5, | 272 | ATA_CMD_SEC_FREEZE_LOCK = 0xF5, |
| 273 | ATA_CMD_SEC_DISABLE_PASS = 0xF6, | ||
| 274 | ATA_CMD_CONFIG_STREAM = 0x51, | ||
| 251 | ATA_CMD_SMART = 0xB0, | 275 | ATA_CMD_SMART = 0xB0, |
| 252 | ATA_CMD_MEDIA_LOCK = 0xDE, | 276 | ATA_CMD_MEDIA_LOCK = 0xDE, |
| 253 | ATA_CMD_MEDIA_UNLOCK = 0xDF, | 277 | ATA_CMD_MEDIA_UNLOCK = 0xDF, |
| 254 | ATA_CMD_DSM = 0x06, | 278 | ATA_CMD_DSM = 0x06, |
| 279 | ATA_CMD_CHK_MED_CRD_TYP = 0xD1, | ||
| 280 | ATA_CMD_CFA_REQ_EXT_ERR = 0x03, | ||
| 281 | ATA_CMD_CFA_WRITE_NE = 0x38, | ||
| 282 | ATA_CMD_CFA_TRANS_SECT = 0x87, | ||
| 283 | ATA_CMD_CFA_ERASE = 0xC0, | ||
| 284 | ATA_CMD_CFA_WRITE_MULT_NE = 0xCD, | ||
| 255 | /* marked obsolete in the ATA/ATAPI-7 spec */ | 285 | /* marked obsolete in the ATA/ATAPI-7 spec */ |
| 256 | ATA_CMD_RESTORE = 0x10, | 286 | ATA_CMD_RESTORE = 0x10, |
| 257 | 287 | ||
| @@ -306,6 +336,7 @@ enum { | |||
| 306 | /* SETFEATURE Sector counts for SATA features */ | 336 | /* SETFEATURE Sector counts for SATA features */ |
| 307 | SATA_AN = 0x05, /* Asynchronous Notification */ | 337 | SATA_AN = 0x05, /* Asynchronous Notification */ |
| 308 | SATA_DIPM = 0x03, /* Device Initiated Power Management */ | 338 | SATA_DIPM = 0x03, /* Device Initiated Power Management */ |
| 339 | SATA_FPDMA_AA = 0x02, /* DMA Setup FIS Auto-Activate */ | ||
| 309 | 340 | ||
| 310 | /* feature values for SET_MAX */ | 341 | /* feature values for SET_MAX */ |
| 311 | ATA_SET_MAX_ADDR = 0x00, | 342 | ATA_SET_MAX_ADDR = 0x00, |
| @@ -525,6 +556,9 @@ static inline int ata_is_data(u8 prot) | |||
| 525 | #define ata_id_has_atapi_AN(id) \ | 556 | #define ata_id_has_atapi_AN(id) \ |
| 526 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ | 557 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ |
| 527 | ((id)[78] & (1 << 5)) ) | 558 | ((id)[78] & (1 << 5)) ) |
| 559 | #define ata_id_has_fpdma_aa(id) \ | ||
| 560 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ | ||
| 561 | ((id)[78] & (1 << 2)) ) | ||
| 528 | #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) | 562 | #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) |
| 529 | #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) | 563 | #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) |
| 530 | #define ata_id_u32(id,n) \ | 564 | #define ata_id_u32(id,n) \ |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 1d52425a6118..f169bcb90b58 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | #include <linux/proportions.h> | 13 | #include <linux/proportions.h> |
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
| 16 | #include <linux/sched.h> | ||
| 17 | #include <linux/writeback.h> | ||
| 16 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
| 17 | 19 | ||
| 18 | struct page; | 20 | struct page; |
| @@ -23,9 +25,11 @@ struct dentry; | |||
| 23 | * Bits in backing_dev_info.state | 25 | * Bits in backing_dev_info.state |
| 24 | */ | 26 | */ |
| 25 | enum bdi_state { | 27 | enum bdi_state { |
| 26 | BDI_pdflush, /* A pdflush thread is working this device */ | 28 | BDI_pending, /* On its way to being activated */ |
| 29 | BDI_wb_alloc, /* Default embedded wb allocated */ | ||
| 27 | BDI_async_congested, /* The async (write) queue is getting full */ | 30 | BDI_async_congested, /* The async (write) queue is getting full */ |
| 28 | BDI_sync_congested, /* The sync queue is getting full */ | 31 | BDI_sync_congested, /* The sync queue is getting full */ |
| 32 | BDI_registered, /* bdi_register() was done */ | ||
| 29 | BDI_unused, /* Available bits start here */ | 33 | BDI_unused, /* Available bits start here */ |
| 30 | }; | 34 | }; |
| 31 | 35 | ||
| @@ -39,7 +43,22 @@ enum bdi_stat_item { | |||
| 39 | 43 | ||
| 40 | #define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) | 44 | #define BDI_STAT_BATCH (8*(1+ilog2(nr_cpu_ids))) |
| 41 | 45 | ||
| 46 | struct bdi_writeback { | ||
| 47 | struct list_head list; /* hangs off the bdi */ | ||
| 48 | |||
| 49 | struct backing_dev_info *bdi; /* our parent bdi */ | ||
| 50 | unsigned int nr; | ||
| 51 | |||
| 52 | unsigned long last_old_flush; /* last old data flush */ | ||
| 53 | |||
| 54 | struct task_struct *task; /* writeback task */ | ||
| 55 | struct list_head b_dirty; /* dirty inodes */ | ||
| 56 | struct list_head b_io; /* parked for writeback */ | ||
| 57 | struct list_head b_more_io; /* parked for more writeback */ | ||
| 58 | }; | ||
| 59 | |||
| 42 | struct backing_dev_info { | 60 | struct backing_dev_info { |
| 61 | struct list_head bdi_list; | ||
| 43 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ | 62 | unsigned long ra_pages; /* max readahead in PAGE_CACHE_SIZE units */ |
| 44 | unsigned long state; /* Always use atomic bitops on this */ | 63 | unsigned long state; /* Always use atomic bitops on this */ |
| 45 | unsigned int capabilities; /* Device capabilities */ | 64 | unsigned int capabilities; /* Device capabilities */ |
| @@ -48,6 +67,8 @@ struct backing_dev_info { | |||
| 48 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); | 67 | void (*unplug_io_fn)(struct backing_dev_info *, struct page *); |
| 49 | void *unplug_io_data; | 68 | void *unplug_io_data; |
| 50 | 69 | ||
| 70 | char *name; | ||
| 71 | |||
| 51 | struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; | 72 | struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; |
| 52 | 73 | ||
| 53 | struct prop_local_percpu completions; | 74 | struct prop_local_percpu completions; |
| @@ -56,6 +77,14 @@ struct backing_dev_info { | |||
| 56 | unsigned int min_ratio; | 77 | unsigned int min_ratio; |
| 57 | unsigned int max_ratio, max_prop_frac; | 78 | unsigned int max_ratio, max_prop_frac; |
| 58 | 79 | ||
| 80 | struct bdi_writeback wb; /* default writeback info for this bdi */ | ||
| 81 | spinlock_t wb_lock; /* protects update side of wb_list */ | ||
| 82 | struct list_head wb_list; /* the flusher threads hanging off this bdi */ | ||
| 83 | unsigned long wb_mask; /* bitmask of registered tasks */ | ||
| 84 | unsigned int wb_cnt; /* number of registered tasks */ | ||
| 85 | |||
| 86 | struct list_head work_list; | ||
| 87 | |||
| 59 | struct device *dev; | 88 | struct device *dev; |
| 60 | 89 | ||
| 61 | #ifdef CONFIG_DEBUG_FS | 90 | #ifdef CONFIG_DEBUG_FS |
| @@ -71,6 +100,19 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent, | |||
| 71 | const char *fmt, ...); | 100 | const char *fmt, ...); |
| 72 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); | 101 | int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); |
| 73 | void bdi_unregister(struct backing_dev_info *bdi); | 102 | void bdi_unregister(struct backing_dev_info *bdi); |
| 103 | void bdi_start_writeback(struct writeback_control *wbc); | ||
| 104 | int bdi_writeback_task(struct bdi_writeback *wb); | ||
| 105 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | ||
| 106 | |||
| 107 | extern spinlock_t bdi_lock; | ||
| 108 | extern struct list_head bdi_list; | ||
| 109 | |||
| 110 | static inline int wb_has_dirty_io(struct bdi_writeback *wb) | ||
| 111 | { | ||
| 112 | return !list_empty(&wb->b_dirty) || | ||
| 113 | !list_empty(&wb->b_io) || | ||
| 114 | !list_empty(&wb->b_more_io); | ||
| 115 | } | ||
| 74 | 116 | ||
| 75 | static inline void __add_bdi_stat(struct backing_dev_info *bdi, | 117 | static inline void __add_bdi_stat(struct backing_dev_info *bdi, |
| 76 | enum bdi_stat_item item, s64 amount) | 118 | enum bdi_stat_item item, s64 amount) |
| @@ -261,6 +303,11 @@ static inline bool bdi_cap_swap_backed(struct backing_dev_info *bdi) | |||
| 261 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; | 303 | return bdi->capabilities & BDI_CAP_SWAP_BACKED; |
| 262 | } | 304 | } |
| 263 | 305 | ||
| 306 | static inline bool bdi_cap_flush_forker(struct backing_dev_info *bdi) | ||
| 307 | { | ||
| 308 | return bdi == &default_backing_dev_info; | ||
| 309 | } | ||
| 310 | |||
| 264 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) | 311 | static inline bool mapping_cap_writeback_dirty(struct address_space *mapping) |
| 265 | { | 312 | { |
| 266 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); | 313 | return bdi_cap_writeback_dirty(mapping->backing_dev_info); |
| @@ -276,4 +323,10 @@ static inline bool mapping_cap_swap_backed(struct address_space *mapping) | |||
| 276 | return bdi_cap_swap_backed(mapping->backing_dev_info); | 323 | return bdi_cap_swap_backed(mapping->backing_dev_info); |
| 277 | } | 324 | } |
| 278 | 325 | ||
| 326 | static inline int bdi_sched_wait(void *word) | ||
| 327 | { | ||
| 328 | schedule(); | ||
| 329 | return 0; | ||
| 330 | } | ||
| 331 | |||
| 279 | #endif /* _LINUX_BACKING_DEV_H */ | 332 | #endif /* _LINUX_BACKING_DEV_H */ |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index 61ee18c1bdb4..2046b5b8af48 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -117,6 +117,7 @@ extern int setup_arg_pages(struct linux_binprm * bprm, | |||
| 117 | int executable_stack); | 117 | int executable_stack); |
| 118 | extern int bprm_mm_init(struct linux_binprm *bprm); | 118 | extern int bprm_mm_init(struct linux_binprm *bprm); |
| 119 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); | 119 | extern int copy_strings_kernel(int argc,char ** argv,struct linux_binprm *bprm); |
| 120 | extern int prepare_bprm_creds(struct linux_binprm *bprm); | ||
| 120 | extern void install_exec_creds(struct linux_binprm *bprm); | 121 | extern void install_exec_creds(struct linux_binprm *bprm); |
| 121 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); | 122 | extern void do_coredump(long signr, int exit_code, struct pt_regs *regs); |
| 122 | extern int set_binfmt(struct linux_binfmt *new); | 123 | extern int set_binfmt(struct linux_binfmt *new); |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 2892b710771c..5be93f18d842 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
| @@ -142,56 +142,51 @@ struct bio { | |||
| 142 | * | 142 | * |
| 143 | * bit 0 -- data direction | 143 | * bit 0 -- data direction |
| 144 | * If not set, bio is a read from device. If set, it's a write to device. | 144 | * If not set, bio is a read from device. If set, it's a write to device. |
| 145 | * bit 1 -- rw-ahead when set | 145 | * bit 1 -- fail fast device errors |
| 146 | * bit 2 -- barrier | 146 | * bit 2 -- fail fast transport errors |
| 147 | * bit 3 -- fail fast driver errors | ||
| 148 | * bit 4 -- rw-ahead when set | ||
| 149 | * bit 5 -- barrier | ||
| 147 | * Insert a serialization point in the IO queue, forcing previously | 150 | * Insert a serialization point in the IO queue, forcing previously |
| 148 | * submitted IO to be completed before this one is issued. | 151 | * submitted IO to be completed before this one is issued. |
| 149 | * bit 3 -- synchronous I/O hint. | 152 | * bit 6 -- synchronous I/O hint. |
| 150 | * bit 4 -- Unplug the device immediately after submitting this bio. | 153 | * bit 7 -- Unplug the device immediately after submitting this bio. |
| 151 | * bit 5 -- metadata request | 154 | * bit 8 -- metadata request |
| 152 | * Used for tracing to differentiate metadata and data IO. May also | 155 | * Used for tracing to differentiate metadata and data IO. May also |
| 153 | * get some preferential treatment in the IO scheduler | 156 | * get some preferential treatment in the IO scheduler |
| 154 | * bit 6 -- discard sectors | 157 | * bit 9 -- discard sectors |
| 155 | * Informs the lower level device that this range of sectors is no longer | 158 | * Informs the lower level device that this range of sectors is no longer |
| 156 | * used by the file system and may thus be freed by the device. Used | 159 | * used by the file system and may thus be freed by the device. Used |
| 157 | * for flash based storage. | 160 | * for flash based storage. |
| 158 | * bit 7 -- fail fast device errors | ||
| 159 | * bit 8 -- fail fast transport errors | ||
| 160 | * bit 9 -- fail fast driver errors | ||
| 161 | * Don't want driver retries for any fast fail whatever the reason. | 161 | * Don't want driver retries for any fast fail whatever the reason. |
| 162 | * bit 10 -- Tell the IO scheduler not to wait for more requests after this | 162 | * bit 10 -- Tell the IO scheduler not to wait for more requests after this |
| 163 | one has been submitted, even if it is a SYNC request. | 163 | one has been submitted, even if it is a SYNC request. |
| 164 | */ | 164 | */ |
| 165 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ | 165 | enum bio_rw_flags { |
| 166 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ | 166 | BIO_RW, |
| 167 | #define BIO_RW_BARRIER 2 | 167 | BIO_RW_FAILFAST_DEV, |
| 168 | #define BIO_RW_SYNCIO 3 | 168 | BIO_RW_FAILFAST_TRANSPORT, |
| 169 | #define BIO_RW_UNPLUG 4 | 169 | BIO_RW_FAILFAST_DRIVER, |
| 170 | #define BIO_RW_META 5 | 170 | /* above flags must match REQ_* */ |
| 171 | #define BIO_RW_DISCARD 6 | 171 | BIO_RW_AHEAD, |
| 172 | #define BIO_RW_FAILFAST_DEV 7 | 172 | BIO_RW_BARRIER, |
| 173 | #define BIO_RW_FAILFAST_TRANSPORT 8 | 173 | BIO_RW_SYNCIO, |
| 174 | #define BIO_RW_FAILFAST_DRIVER 9 | 174 | BIO_RW_UNPLUG, |
| 175 | #define BIO_RW_NOIDLE 10 | 175 | BIO_RW_META, |
| 176 | 176 | BIO_RW_DISCARD, | |
| 177 | #define bio_rw_flagged(bio, flag) ((bio)->bi_rw & (1 << (flag))) | 177 | BIO_RW_NOIDLE, |
| 178 | }; | ||
| 178 | 179 | ||
| 179 | /* | 180 | /* |
| 180 | * Old defines, these should eventually be replaced by direct usage of | 181 | * First four bits must match between bio->bi_rw and rq->cmd_flags, make |
| 181 | * bio_rw_flagged() | 182 | * that explicit here. |
| 182 | */ | 183 | */ |
| 183 | #define bio_barrier(bio) bio_rw_flagged(bio, BIO_RW_BARRIER) | 184 | #define BIO_RW_RQ_MASK 0xf |
| 184 | #define bio_sync(bio) bio_rw_flagged(bio, BIO_RW_SYNCIO) | 185 | |
| 185 | #define bio_unplug(bio) bio_rw_flagged(bio, BIO_RW_UNPLUG) | 186 | static inline bool bio_rw_flagged(struct bio *bio, enum bio_rw_flags flag) |
| 186 | #define bio_failfast_dev(bio) bio_rw_flagged(bio, BIO_RW_FAILFAST_DEV) | 187 | { |
| 187 | #define bio_failfast_transport(bio) \ | 188 | return (bio->bi_rw & (1 << flag)) != 0; |
| 188 | bio_rw_flagged(bio, BIO_RW_FAILFAST_TRANSPORT) | 189 | } |
| 189 | #define bio_failfast_driver(bio) \ | ||
| 190 | bio_rw_flagged(bio, BIO_RW_FAILFAST_DRIVER) | ||
| 191 | #define bio_rw_ahead(bio) bio_rw_flagged(bio, BIO_RW_AHEAD) | ||
| 192 | #define bio_rw_meta(bio) bio_rw_flagged(bio, BIO_RW_META) | ||
| 193 | #define bio_discard(bio) bio_rw_flagged(bio, BIO_RW_DISCARD) | ||
| 194 | #define bio_noidle(bio) bio_rw_flagged(bio, BIO_RW_NOIDLE) | ||
| 195 | 190 | ||
| 196 | /* | 191 | /* |
| 197 | * upper 16 bits of bi_rw define the io priority of this bio | 192 | * upper 16 bits of bi_rw define the io priority of this bio |
| @@ -216,7 +211,7 @@ struct bio { | |||
| 216 | #define bio_offset(bio) bio_iovec((bio))->bv_offset | 211 | #define bio_offset(bio) bio_iovec((bio))->bv_offset |
| 217 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) | 212 | #define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) |
| 218 | #define bio_sectors(bio) ((bio)->bi_size >> 9) | 213 | #define bio_sectors(bio) ((bio)->bi_size >> 9) |
| 219 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) | 214 | #define bio_empty_barrier(bio) (bio_rw_flagged(bio, BIO_RW_BARRIER) && !bio_has_data(bio) && !bio_rw_flagged(bio, BIO_RW_DISCARD)) |
| 220 | 215 | ||
| 221 | static inline unsigned int bio_cur_bytes(struct bio *bio) | 216 | static inline unsigned int bio_cur_bytes(struct bio *bio) |
| 222 | { | 217 | { |
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h index 2878811c6134..756d78b8c1c5 100644 --- a/include/linux/bitmap.h +++ b/include/linux/bitmap.h | |||
| @@ -94,13 +94,13 @@ extern void __bitmap_shift_right(unsigned long *dst, | |||
| 94 | const unsigned long *src, int shift, int bits); | 94 | const unsigned long *src, int shift, int bits); |
| 95 | extern void __bitmap_shift_left(unsigned long *dst, | 95 | extern void __bitmap_shift_left(unsigned long *dst, |
| 96 | const unsigned long *src, int shift, int bits); | 96 | const unsigned long *src, int shift, int bits); |
| 97 | extern void __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, | 97 | extern int __bitmap_and(unsigned long *dst, const unsigned long *bitmap1, |
| 98 | const unsigned long *bitmap2, int bits); | 98 | const unsigned long *bitmap2, int bits); |
| 99 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, | 99 | extern void __bitmap_or(unsigned long *dst, const unsigned long *bitmap1, |
| 100 | const unsigned long *bitmap2, int bits); | 100 | const unsigned long *bitmap2, int bits); |
| 101 | extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, | 101 | extern void __bitmap_xor(unsigned long *dst, const unsigned long *bitmap1, |
| 102 | const unsigned long *bitmap2, int bits); | 102 | const unsigned long *bitmap2, int bits); |
| 103 | extern void __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, | 103 | extern int __bitmap_andnot(unsigned long *dst, const unsigned long *bitmap1, |
| 104 | const unsigned long *bitmap2, int bits); | 104 | const unsigned long *bitmap2, int bits); |
| 105 | extern int __bitmap_intersects(const unsigned long *bitmap1, | 105 | extern int __bitmap_intersects(const unsigned long *bitmap1, |
| 106 | const unsigned long *bitmap2, int bits); | 106 | const unsigned long *bitmap2, int bits); |
| @@ -171,13 +171,12 @@ static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, | |||
| 171 | } | 171 | } |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | static inline void bitmap_and(unsigned long *dst, const unsigned long *src1, | 174 | static inline int bitmap_and(unsigned long *dst, const unsigned long *src1, |
| 175 | const unsigned long *src2, int nbits) | 175 | const unsigned long *src2, int nbits) |
| 176 | { | 176 | { |
| 177 | if (small_const_nbits(nbits)) | 177 | if (small_const_nbits(nbits)) |
| 178 | *dst = *src1 & *src2; | 178 | return (*dst = *src1 & *src2) != 0; |
| 179 | else | 179 | return __bitmap_and(dst, src1, src2, nbits); |
| 180 | __bitmap_and(dst, src1, src2, nbits); | ||
| 181 | } | 180 | } |
| 182 | 181 | ||
| 183 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, | 182 | static inline void bitmap_or(unsigned long *dst, const unsigned long *src1, |
| @@ -198,13 +197,12 @@ static inline void bitmap_xor(unsigned long *dst, const unsigned long *src1, | |||
| 198 | __bitmap_xor(dst, src1, src2, nbits); | 197 | __bitmap_xor(dst, src1, src2, nbits); |
| 199 | } | 198 | } |
| 200 | 199 | ||
| 201 | static inline void bitmap_andnot(unsigned long *dst, const unsigned long *src1, | 200 | static inline int bitmap_andnot(unsigned long *dst, const unsigned long *src1, |
| 202 | const unsigned long *src2, int nbits) | 201 | const unsigned long *src2, int nbits) |
| 203 | { | 202 | { |
| 204 | if (small_const_nbits(nbits)) | 203 | if (small_const_nbits(nbits)) |
| 205 | *dst = *src1 & ~(*src2); | 204 | return (*dst = *src1 & ~(*src2)) != 0; |
| 206 | else | 205 | return __bitmap_andnot(dst, src1, src2, nbits); |
| 207 | __bitmap_andnot(dst, src1, src2, nbits); | ||
| 208 | } | 206 | } |
| 209 | 207 | ||
| 210 | static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, | 208 | static inline void bitmap_complement(unsigned long *dst, const unsigned long *src, |
diff --git a/include/linux/blk-iopoll.h b/include/linux/blk-iopoll.h new file mode 100644 index 000000000000..308734d3d4a2 --- /dev/null +++ b/include/linux/blk-iopoll.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | #ifndef BLK_IOPOLL_H | ||
| 2 | #define BLK_IOPOLL_H | ||
| 3 | |||
| 4 | struct blk_iopoll; | ||
| 5 | typedef int (blk_iopoll_fn)(struct blk_iopoll *, int); | ||
| 6 | |||
| 7 | struct blk_iopoll { | ||
| 8 | struct list_head list; | ||
| 9 | unsigned long state; | ||
| 10 | unsigned long data; | ||
| 11 | int weight; | ||
| 12 | int max; | ||
| 13 | blk_iopoll_fn *poll; | ||
| 14 | }; | ||
| 15 | |||
| 16 | enum { | ||
| 17 | IOPOLL_F_SCHED = 0, | ||
| 18 | IOPOLL_F_DISABLE = 1, | ||
| 19 | }; | ||
| 20 | |||
| 21 | /* | ||
| 22 | * Returns 0 if we successfully set the IOPOLL_F_SCHED bit, indicating | ||
| 23 | * that we were the first to acquire this iop for scheduling. If this iop | ||
| 24 | * is currently disabled, return "failure". | ||
| 25 | */ | ||
| 26 | static inline int blk_iopoll_sched_prep(struct blk_iopoll *iop) | ||
| 27 | { | ||
| 28 | if (!test_bit(IOPOLL_F_DISABLE, &iop->state)) | ||
| 29 | return test_and_set_bit(IOPOLL_F_SCHED, &iop->state); | ||
| 30 | |||
| 31 | return 1; | ||
| 32 | } | ||
| 33 | |||
| 34 | static inline int blk_iopoll_disable_pending(struct blk_iopoll *iop) | ||
| 35 | { | ||
| 36 | return test_bit(IOPOLL_F_DISABLE, &iop->state); | ||
| 37 | } | ||
| 38 | |||
| 39 | extern void blk_iopoll_sched(struct blk_iopoll *); | ||
| 40 | extern void blk_iopoll_init(struct blk_iopoll *, int, blk_iopoll_fn *); | ||
| 41 | extern void blk_iopoll_complete(struct blk_iopoll *); | ||
| 42 | extern void __blk_iopoll_complete(struct blk_iopoll *); | ||
| 43 | extern void blk_iopoll_enable(struct blk_iopoll *); | ||
| 44 | extern void blk_iopoll_disable(struct blk_iopoll *); | ||
| 45 | |||
| 46 | extern int blk_iopoll_enabled; | ||
| 47 | |||
| 48 | #endif | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index e7cb5dbf6c26..e23a86cae5ac 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -86,13 +86,14 @@ enum { | |||
| 86 | }; | 86 | }; |
| 87 | 87 | ||
| 88 | /* | 88 | /* |
| 89 | * request type modified bits. first two bits match BIO_RW* bits, important | 89 | * request type modified bits. first four bits match BIO_RW* bits, important |
| 90 | */ | 90 | */ |
| 91 | enum rq_flag_bits { | 91 | enum rq_flag_bits { |
| 92 | __REQ_RW, /* not set, read. set, write */ | 92 | __REQ_RW, /* not set, read. set, write */ |
| 93 | __REQ_FAILFAST_DEV, /* no driver retries of device errors */ | 93 | __REQ_FAILFAST_DEV, /* no driver retries of device errors */ |
| 94 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ | 94 | __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ |
| 95 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ | 95 | __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ |
| 96 | /* above flags must match BIO_RW_* */ | ||
| 96 | __REQ_DISCARD, /* request to discard sectors */ | 97 | __REQ_DISCARD, /* request to discard sectors */ |
| 97 | __REQ_SORTED, /* elevator knows about this request */ | 98 | __REQ_SORTED, /* elevator knows about this request */ |
| 98 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 99 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
| @@ -114,6 +115,7 @@ enum rq_flag_bits { | |||
| 114 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ | 115 | __REQ_INTEGRITY, /* integrity metadata has been remapped */ |
| 115 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ | 116 | __REQ_NOIDLE, /* Don't anticipate more IO after this one */ |
| 116 | __REQ_IO_STAT, /* account I/O stat */ | 117 | __REQ_IO_STAT, /* account I/O stat */ |
| 118 | __REQ_MIXED_MERGE, /* merge of different types, fail separately */ | ||
| 117 | __REQ_NR_BITS, /* stops here */ | 119 | __REQ_NR_BITS, /* stops here */ |
| 118 | }; | 120 | }; |
| 119 | 121 | ||
| @@ -142,6 +144,10 @@ enum rq_flag_bits { | |||
| 142 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) | 144 | #define REQ_INTEGRITY (1 << __REQ_INTEGRITY) |
| 143 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) | 145 | #define REQ_NOIDLE (1 << __REQ_NOIDLE) |
| 144 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) | 146 | #define REQ_IO_STAT (1 << __REQ_IO_STAT) |
| 147 | #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE) | ||
| 148 | |||
| 149 | #define REQ_FAILFAST_MASK (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | \ | ||
| 150 | REQ_FAILFAST_DRIVER) | ||
| 145 | 151 | ||
| 146 | #define BLK_MAX_CDB 16 | 152 | #define BLK_MAX_CDB 16 |
| 147 | 153 | ||
| @@ -453,10 +459,12 @@ struct request_queue | |||
| 453 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 459 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
| 454 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 460 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
| 455 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 461 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
| 462 | #define QUEUE_FLAG_CQ 16 /* hardware does queuing */ | ||
| 456 | 463 | ||
| 457 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 464 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
| 458 | (1 << QUEUE_FLAG_CLUSTER) | \ | 465 | (1 << QUEUE_FLAG_CLUSTER) | \ |
| 459 | (1 << QUEUE_FLAG_STACKABLE)) | 466 | (1 << QUEUE_FLAG_STACKABLE) | \ |
| 467 | (1 << QUEUE_FLAG_SAME_COMP)) | ||
| 460 | 468 | ||
| 461 | static inline int queue_is_locked(struct request_queue *q) | 469 | static inline int queue_is_locked(struct request_queue *q) |
| 462 | { | 470 | { |
| @@ -575,6 +583,7 @@ enum { | |||
| 575 | 583 | ||
| 576 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 584 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
| 577 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 585 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
| 586 | #define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags) | ||
| 578 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 587 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
| 579 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 588 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
| 580 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 589 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
| @@ -828,11 +837,13 @@ static inline void blk_run_address_space(struct address_space *mapping) | |||
| 828 | } | 837 | } |
| 829 | 838 | ||
| 830 | /* | 839 | /* |
| 831 | * blk_rq_pos() : the current sector | 840 | * blk_rq_pos() : the current sector |
| 832 | * blk_rq_bytes() : bytes left in the entire request | 841 | * blk_rq_bytes() : bytes left in the entire request |
| 833 | * blk_rq_cur_bytes() : bytes left in the current segment | 842 | * blk_rq_cur_bytes() : bytes left in the current segment |
| 834 | * blk_rq_sectors() : sectors left in the entire request | 843 | * blk_rq_err_bytes() : bytes left till the next error boundary |
| 835 | * blk_rq_cur_sectors() : sectors left in the current segment | 844 | * blk_rq_sectors() : sectors left in the entire request |
| 845 | * blk_rq_cur_sectors() : sectors left in the current segment | ||
| 846 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
| 836 | */ | 847 | */ |
| 837 | static inline sector_t blk_rq_pos(const struct request *rq) | 848 | static inline sector_t blk_rq_pos(const struct request *rq) |
| 838 | { | 849 | { |
| @@ -849,6 +860,8 @@ static inline int blk_rq_cur_bytes(const struct request *rq) | |||
| 849 | return rq->bio ? bio_cur_bytes(rq->bio) : 0; | 860 | return rq->bio ? bio_cur_bytes(rq->bio) : 0; |
| 850 | } | 861 | } |
| 851 | 862 | ||
| 863 | extern unsigned int blk_rq_err_bytes(const struct request *rq); | ||
| 864 | |||
| 852 | static inline unsigned int blk_rq_sectors(const struct request *rq) | 865 | static inline unsigned int blk_rq_sectors(const struct request *rq) |
| 853 | { | 866 | { |
| 854 | return blk_rq_bytes(rq) >> 9; | 867 | return blk_rq_bytes(rq) >> 9; |
| @@ -859,6 +872,11 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
| 859 | return blk_rq_cur_bytes(rq) >> 9; | 872 | return blk_rq_cur_bytes(rq) >> 9; |
| 860 | } | 873 | } |
| 861 | 874 | ||
| 875 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
| 876 | { | ||
| 877 | return blk_rq_err_bytes(rq) >> 9; | ||
| 878 | } | ||
| 879 | |||
| 862 | /* | 880 | /* |
| 863 | * Request issue related functions. | 881 | * Request issue related functions. |
| 864 | */ | 882 | */ |
| @@ -885,10 +903,12 @@ extern bool blk_end_request(struct request *rq, int error, | |||
| 885 | unsigned int nr_bytes); | 903 | unsigned int nr_bytes); |
| 886 | extern void blk_end_request_all(struct request *rq, int error); | 904 | extern void blk_end_request_all(struct request *rq, int error); |
| 887 | extern bool blk_end_request_cur(struct request *rq, int error); | 905 | extern bool blk_end_request_cur(struct request *rq, int error); |
| 906 | extern bool blk_end_request_err(struct request *rq, int error); | ||
| 888 | extern bool __blk_end_request(struct request *rq, int error, | 907 | extern bool __blk_end_request(struct request *rq, int error, |
| 889 | unsigned int nr_bytes); | 908 | unsigned int nr_bytes); |
| 890 | extern void __blk_end_request_all(struct request *rq, int error); | 909 | extern void __blk_end_request_all(struct request *rq, int error); |
| 891 | extern bool __blk_end_request_cur(struct request *rq, int error); | 910 | extern bool __blk_end_request_cur(struct request *rq, int error); |
| 911 | extern bool __blk_end_request_err(struct request *rq, int error); | ||
| 892 | 912 | ||
| 893 | extern void blk_complete_request(struct request *); | 913 | extern void blk_complete_request(struct request *); |
| 894 | extern void __blk_complete_request(struct request *); | 914 | extern void __blk_complete_request(struct request *); |
| @@ -913,7 +933,9 @@ extern void blk_queue_logical_block_size(struct request_queue *, unsigned short) | |||
| 913 | extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); | 933 | extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); |
| 914 | extern void blk_queue_alignment_offset(struct request_queue *q, | 934 | extern void blk_queue_alignment_offset(struct request_queue *q, |
| 915 | unsigned int alignment); | 935 | unsigned int alignment); |
| 936 | extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); | ||
| 916 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); | 937 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); |
| 938 | extern void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt); | ||
| 917 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | 939 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); |
| 918 | extern void blk_set_default_limits(struct queue_limits *lim); | 940 | extern void blk_set_default_limits(struct queue_limits *lim); |
| 919 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 941 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
| @@ -976,15 +998,18 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
| 976 | } | 998 | } |
| 977 | 999 | ||
| 978 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 1000 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
| 979 | extern int blkdev_issue_discard(struct block_device *, | 1001 | #define DISCARD_FL_WAIT 0x01 /* wait for completion */ |
| 980 | sector_t sector, sector_t nr_sects, gfp_t); | 1002 | #define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */ |
| 1003 | extern int blkdev_issue_discard(struct block_device *, sector_t sector, | ||
| 1004 | sector_t nr_sects, gfp_t, int flags); | ||
| 981 | 1005 | ||
| 982 | static inline int sb_issue_discard(struct super_block *sb, | 1006 | static inline int sb_issue_discard(struct super_block *sb, |
| 983 | sector_t block, sector_t nr_blocks) | 1007 | sector_t block, sector_t nr_blocks) |
| 984 | { | 1008 | { |
| 985 | block <<= (sb->s_blocksize_bits - 9); | 1009 | block <<= (sb->s_blocksize_bits - 9); |
| 986 | nr_blocks <<= (sb->s_blocksize_bits - 9); | 1010 | nr_blocks <<= (sb->s_blocksize_bits - 9); |
| 987 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); | 1011 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL, |
| 1012 | DISCARD_FL_BARRIER); | ||
| 988 | } | 1013 | } |
| 989 | 1014 | ||
| 990 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | 1015 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 4a37a56f6cdd..5824b20b5fcb 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -66,5 +66,6 @@ void can_bus_off(struct net_device *dev); | |||
| 66 | 66 | ||
| 67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); | 67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); |
| 68 | void can_get_echo_skb(struct net_device *dev, int idx); | 68 | void can_get_echo_skb(struct net_device *dev, int idx); |
| 69 | void can_free_echo_skb(struct net_device *dev, int idx); | ||
| 69 | 70 | ||
| 70 | #endif /* CAN_DEV_H */ | 71 | #endif /* CAN_DEV_H */ |
diff --git a/include/linux/cb710.h b/include/linux/cb710.h index 63bc9a4d2926..8cc10411bab2 100644 --- a/include/linux/cb710.h +++ b/include/linux/cb710.h | |||
| @@ -140,29 +140,6 @@ void cb710_dump_regs(struct cb710_chip *chip, unsigned dump); | |||
| 140 | #include <linux/highmem.h> | 140 | #include <linux/highmem.h> |
| 141 | #include <linux/scatterlist.h> | 141 | #include <linux/scatterlist.h> |
| 142 | 142 | ||
| 143 | /** | ||
| 144 | * cb710_sg_miter_stop_writing - stop mapping iteration after writing | ||
| 145 | * @miter: sg mapping iter to be stopped | ||
| 146 | * | ||
| 147 | * Description: | ||
| 148 | * Stops mapping iterator @miter. @miter should have been started | ||
| 149 | * started using sg_miter_start(). A stopped iteration can be | ||
| 150 | * resumed by calling sg_miter_next() on it. This is useful when | ||
| 151 | * resources (kmap) need to be released during iteration. | ||
| 152 | * | ||
| 153 | * This is a convenience wrapper that will be optimized out for arches | ||
| 154 | * that don't need flush_kernel_dcache_page(). | ||
| 155 | * | ||
| 156 | * Context: | ||
| 157 | * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. | ||
| 158 | */ | ||
| 159 | static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter) | ||
| 160 | { | ||
| 161 | if (miter->page) | ||
| 162 | flush_kernel_dcache_page(miter->page); | ||
| 163 | sg_miter_stop(miter); | ||
| 164 | } | ||
| 165 | |||
| 166 | /* | 143 | /* |
| 167 | * 32-bit PIO mapping sg iterator | 144 | * 32-bit PIO mapping sg iterator |
| 168 | * | 145 | * |
| @@ -171,12 +148,12 @@ static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter) | |||
| 171 | * without DMA support). | 148 | * without DMA support). |
| 172 | * | 149 | * |
| 173 | * Best-case reading (transfer from device): | 150 | * Best-case reading (transfer from device): |
| 174 | * sg_miter_start(); | 151 | * sg_miter_start(, SG_MITER_TO_SG); |
| 175 | * cb710_sg_dwiter_write_from_io(); | 152 | * cb710_sg_dwiter_write_from_io(); |
| 176 | * cb710_sg_miter_stop_writing(); | 153 | * sg_miter_stop(); |
| 177 | * | 154 | * |
| 178 | * Best-case writing (transfer to device): | 155 | * Best-case writing (transfer to device): |
| 179 | * sg_miter_start(); | 156 | * sg_miter_start(, SG_MITER_FROM_SG); |
| 180 | * cb710_sg_dwiter_read_to_io(); | 157 | * cb710_sg_dwiter_read_to_io(); |
| 181 | * sg_miter_stop(); | 158 | * sg_miter_stop(); |
| 182 | */ | 159 | */ |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 665fa70e4094..90bba9e62286 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -179,14 +179,11 @@ struct cgroup { | |||
| 179 | */ | 179 | */ |
| 180 | struct list_head release_list; | 180 | struct list_head release_list; |
| 181 | 181 | ||
| 182 | /* pids_mutex protects the fields below */ | 182 | /* pids_mutex protects pids_list and cached pid arrays. */ |
| 183 | struct rw_semaphore pids_mutex; | 183 | struct rw_semaphore pids_mutex; |
| 184 | /* Array of process ids in the cgroup */ | 184 | |
| 185 | pid_t *tasks_pids; | 185 | /* Linked list of struct cgroup_pids */ |
| 186 | /* How many files are using the current tasks_pids array */ | 186 | struct list_head pids_list; |
| 187 | int pids_use_count; | ||
| 188 | /* Length of the current tasks_pids array */ | ||
| 189 | int pids_length; | ||
| 190 | 187 | ||
| 191 | /* For RCU-protected deletion */ | 188 | /* For RCU-protected deletion */ |
| 192 | struct rcu_head rcu_head; | 189 | struct rcu_head rcu_head; |
| @@ -366,6 +363,23 @@ int cgroup_task_count(const struct cgroup *cgrp); | |||
| 366 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); | 363 | int cgroup_is_descendant(const struct cgroup *cgrp, struct task_struct *task); |
| 367 | 364 | ||
| 368 | /* | 365 | /* |
| 366 | * When the subsys has to access css and may add permanent refcnt to css, | ||
| 367 | * it should take care of racy conditions with rmdir(). Following set of | ||
| 368 | * functions, is for stop/restart rmdir if necessary. | ||
| 369 | * Because these will call css_get/put, "css" should be alive css. | ||
| 370 | * | ||
| 371 | * cgroup_exclude_rmdir(); | ||
| 372 | * ...do some jobs which may access arbitrary empty cgroup | ||
| 373 | * cgroup_release_and_wakeup_rmdir(); | ||
| 374 | * | ||
| 375 | * When someone removes a cgroup while cgroup_exclude_rmdir() holds it, | ||
| 376 | * it sleeps and cgroup_release_and_wakeup_rmdir() will wake him up. | ||
| 377 | */ | ||
| 378 | |||
| 379 | void cgroup_exclude_rmdir(struct cgroup_subsys_state *css); | ||
| 380 | void cgroup_release_and_wakeup_rmdir(struct cgroup_subsys_state *css); | ||
| 381 | |||
| 382 | /* | ||
| 369 | * Control Group subsystem type. | 383 | * Control Group subsystem type. |
| 370 | * See Documentation/cgroups/cgroups.txt for details | 384 | * See Documentation/cgroups/cgroups.txt for details |
| 371 | */ | 385 | */ |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index c56457c8334e..1219be4fb42e 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -293,7 +293,12 @@ static inline int clocksource_enable(struct clocksource *cs) | |||
| 293 | if (cs->enable) | 293 | if (cs->enable) |
| 294 | ret = cs->enable(cs); | 294 | ret = cs->enable(cs); |
| 295 | 295 | ||
| 296 | /* save mult_orig on enable */ | 296 | /* |
| 297 | * The frequency may have changed while the clocksource | ||
| 298 | * was disabled. If so the code in ->enable() must update | ||
| 299 | * the mult value to reflect the new frequency. Make sure | ||
| 300 | * mult_orig follows this change. | ||
| 301 | */ | ||
| 297 | cs->mult_orig = cs->mult; | 302 | cs->mult_orig = cs->mult; |
| 298 | 303 | ||
| 299 | return ret; | 304 | return ret; |
| @@ -309,6 +314,13 @@ static inline int clocksource_enable(struct clocksource *cs) | |||
| 309 | */ | 314 | */ |
| 310 | static inline void clocksource_disable(struct clocksource *cs) | 315 | static inline void clocksource_disable(struct clocksource *cs) |
| 311 | { | 316 | { |
| 317 | /* | ||
| 318 | * Save mult_orig in mult so clocksource_enable() can | ||
| 319 | * restore the value regardless if ->enable() updates | ||
| 320 | * the value of mult or not. | ||
| 321 | */ | ||
| 322 | cs->mult = cs->mult_orig; | ||
| 323 | |||
| 312 | if (cs->disable) | 324 | if (cs->disable) |
| 313 | cs->disable(cs); | 325 | cs->disable(cs); |
| 314 | } | 326 | } |
diff --git a/include/linux/connector.h b/include/linux/connector.h index b68d27850d51..47ebf416f512 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
| @@ -136,7 +136,7 @@ struct cn_callback_data { | |||
| 136 | void *ddata; | 136 | void *ddata; |
| 137 | 137 | ||
| 138 | void *callback_priv; | 138 | void *callback_priv; |
| 139 | void (*callback) (void *); | 139 | void (*callback) (struct cn_msg *); |
| 140 | 140 | ||
| 141 | void *free; | 141 | void *free; |
| 142 | }; | 142 | }; |
| @@ -167,11 +167,11 @@ struct cn_dev { | |||
| 167 | struct cn_queue_dev *cbdev; | 167 | struct cn_queue_dev *cbdev; |
| 168 | }; | 168 | }; |
| 169 | 169 | ||
| 170 | int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); | 170 | int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *)); |
| 171 | void cn_del_callback(struct cb_id *); | 171 | void cn_del_callback(struct cb_id *); |
| 172 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); | 172 | int cn_netlink_send(struct cn_msg *, u32, gfp_t); |
| 173 | 173 | ||
| 174 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); | 174 | int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *)); |
| 175 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); | 175 | void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); |
| 176 | 176 | ||
| 177 | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); | 177 | int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 4d668e05d458..47536197ffdd 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -48,6 +48,15 @@ struct notifier_block; | |||
| 48 | 48 | ||
| 49 | #ifdef CONFIG_SMP | 49 | #ifdef CONFIG_SMP |
| 50 | /* Need to know about CPUs going up/down? */ | 50 | /* Need to know about CPUs going up/down? */ |
| 51 | #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) | ||
| 52 | #define cpu_notifier(fn, pri) { \ | ||
| 53 | static struct notifier_block fn##_nb __cpuinitdata = \ | ||
| 54 | { .notifier_call = fn, .priority = pri }; \ | ||
| 55 | register_cpu_notifier(&fn##_nb); \ | ||
| 56 | } | ||
| 57 | #else /* #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ | ||
| 58 | #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) | ||
| 59 | #endif /* #else #if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) */ | ||
| 51 | #ifdef CONFIG_HOTPLUG_CPU | 60 | #ifdef CONFIG_HOTPLUG_CPU |
| 52 | extern int register_cpu_notifier(struct notifier_block *nb); | 61 | extern int register_cpu_notifier(struct notifier_block *nb); |
| 53 | extern void unregister_cpu_notifier(struct notifier_block *nb); | 62 | extern void unregister_cpu_notifier(struct notifier_block *nb); |
| @@ -74,6 +83,8 @@ extern void cpu_maps_update_done(void); | |||
| 74 | 83 | ||
| 75 | #else /* CONFIG_SMP */ | 84 | #else /* CONFIG_SMP */ |
| 76 | 85 | ||
| 86 | #define cpu_notifier(fn, pri) do { (void)(fn); } while (0) | ||
| 87 | |||
| 77 | static inline int register_cpu_notifier(struct notifier_block *nb) | 88 | static inline int register_cpu_notifier(struct notifier_block *nb) |
| 78 | { | 89 | { |
| 79 | return 0; | 90 | return 0; |
| @@ -99,11 +110,7 @@ extern struct sysdev_class cpu_sysdev_class; | |||
| 99 | 110 | ||
| 100 | extern void get_online_cpus(void); | 111 | extern void get_online_cpus(void); |
| 101 | extern void put_online_cpus(void); | 112 | extern void put_online_cpus(void); |
| 102 | #define hotcpu_notifier(fn, pri) { \ | 113 | #define hotcpu_notifier(fn, pri) cpu_notifier(fn, pri) |
| 103 | static struct notifier_block fn##_nb __cpuinitdata = \ | ||
| 104 | { .notifier_call = fn, .priority = pri }; \ | ||
| 105 | register_cpu_notifier(&fn##_nb); \ | ||
| 106 | } | ||
| 107 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) | 114 | #define register_hotcpu_notifier(nb) register_cpu_notifier(nb) |
| 108 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) | 115 | #define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb) |
| 109 | int cpu_down(unsigned int cpu); | 116 | int cpu_down(unsigned int cpu); |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index c5ac87ca7bc6..796df12091b7 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -43,10 +43,10 @@ | |||
| 43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask | 43 | * int cpu_isset(cpu, mask) true iff bit 'cpu' set in mask |
| 44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask | 44 | * int cpu_test_and_set(cpu, mask) test and set bit 'cpu' in mask |
| 45 | * | 45 | * |
| 46 | * void cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] | 46 | * int cpus_and(dst, src1, src2) dst = src1 & src2 [intersection] |
| 47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] | 47 | * void cpus_or(dst, src1, src2) dst = src1 | src2 [union] |
| 48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 | 48 | * void cpus_xor(dst, src1, src2) dst = src1 ^ src2 |
| 49 | * void cpus_andnot(dst, src1, src2) dst = src1 & ~src2 | 49 | * int cpus_andnot(dst, src1, src2) dst = src1 & ~src2 |
| 50 | * void cpus_complement(dst, src) dst = ~src | 50 | * void cpus_complement(dst, src) dst = ~src |
| 51 | * | 51 | * |
| 52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? | 52 | * int cpus_equal(mask1, mask2) Does mask1 == mask2? |
| @@ -179,10 +179,10 @@ static inline int __cpu_test_and_set(int cpu, cpumask_t *addr) | |||
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) | 181 | #define cpus_and(dst, src1, src2) __cpus_and(&(dst), &(src1), &(src2), NR_CPUS) |
| 182 | static inline void __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, | 182 | static inline int __cpus_and(cpumask_t *dstp, const cpumask_t *src1p, |
| 183 | const cpumask_t *src2p, int nbits) | 183 | const cpumask_t *src2p, int nbits) |
| 184 | { | 184 | { |
| 185 | bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); | 185 | return bitmap_and(dstp->bits, src1p->bits, src2p->bits, nbits); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) | 188 | #define cpus_or(dst, src1, src2) __cpus_or(&(dst), &(src1), &(src2), NR_CPUS) |
| @@ -201,10 +201,10 @@ static inline void __cpus_xor(cpumask_t *dstp, const cpumask_t *src1p, | |||
| 201 | 201 | ||
| 202 | #define cpus_andnot(dst, src1, src2) \ | 202 | #define cpus_andnot(dst, src1, src2) \ |
| 203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) | 203 | __cpus_andnot(&(dst), &(src1), &(src2), NR_CPUS) |
| 204 | static inline void __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, | 204 | static inline int __cpus_andnot(cpumask_t *dstp, const cpumask_t *src1p, |
| 205 | const cpumask_t *src2p, int nbits) | 205 | const cpumask_t *src2p, int nbits) |
| 206 | { | 206 | { |
| 207 | bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); | 207 | return bitmap_andnot(dstp->bits, src1p->bits, src2p->bits, nbits); |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) | 210 | #define cpus_complement(dst, src) __cpus_complement(&(dst), &(src), NR_CPUS) |
| @@ -738,11 +738,11 @@ static inline void cpumask_clear(struct cpumask *dstp) | |||
| 738 | * @src1p: the first input | 738 | * @src1p: the first input |
| 739 | * @src2p: the second input | 739 | * @src2p: the second input |
| 740 | */ | 740 | */ |
| 741 | static inline void cpumask_and(struct cpumask *dstp, | 741 | static inline int cpumask_and(struct cpumask *dstp, |
| 742 | const struct cpumask *src1p, | 742 | const struct cpumask *src1p, |
| 743 | const struct cpumask *src2p) | 743 | const struct cpumask *src2p) |
| 744 | { | 744 | { |
| 745 | bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), | 745 | return bitmap_and(cpumask_bits(dstp), cpumask_bits(src1p), |
| 746 | cpumask_bits(src2p), nr_cpumask_bits); | 746 | cpumask_bits(src2p), nr_cpumask_bits); |
| 747 | } | 747 | } |
| 748 | 748 | ||
| @@ -779,11 +779,11 @@ static inline void cpumask_xor(struct cpumask *dstp, | |||
| 779 | * @src1p: the first input | 779 | * @src1p: the first input |
| 780 | * @src2p: the second input | 780 | * @src2p: the second input |
| 781 | */ | 781 | */ |
| 782 | static inline void cpumask_andnot(struct cpumask *dstp, | 782 | static inline int cpumask_andnot(struct cpumask *dstp, |
| 783 | const struct cpumask *src1p, | 783 | const struct cpumask *src1p, |
| 784 | const struct cpumask *src2p) | 784 | const struct cpumask *src2p) |
| 785 | { | 785 | { |
| 786 | bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), | 786 | return bitmap_andnot(cpumask_bits(dstp), cpumask_bits(src1p), |
| 787 | cpumask_bits(src2p), nr_cpumask_bits); | 787 | cpumask_bits(src2p), nr_cpumask_bits); |
| 788 | } | 788 | } |
| 789 | 789 | ||
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4fa999696310..24520a539c6f 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -114,6 +114,13 @@ struct thread_group_cred { | |||
| 114 | */ | 114 | */ |
| 115 | struct cred { | 115 | struct cred { |
| 116 | atomic_t usage; | 116 | atomic_t usage; |
| 117 | #ifdef CONFIG_DEBUG_CREDENTIALS | ||
| 118 | atomic_t subscribers; /* number of processes subscribed */ | ||
| 119 | void *put_addr; | ||
| 120 | unsigned magic; | ||
| 121 | #define CRED_MAGIC 0x43736564 | ||
| 122 | #define CRED_MAGIC_DEAD 0x44656144 | ||
| 123 | #endif | ||
| 117 | uid_t uid; /* real UID of the task */ | 124 | uid_t uid; /* real UID of the task */ |
| 118 | gid_t gid; /* real GID of the task */ | 125 | gid_t gid; /* real GID of the task */ |
| 119 | uid_t suid; /* saved UID of the task */ | 126 | uid_t suid; /* saved UID of the task */ |
| @@ -143,7 +150,9 @@ struct cred { | |||
| 143 | }; | 150 | }; |
| 144 | 151 | ||
| 145 | extern void __put_cred(struct cred *); | 152 | extern void __put_cred(struct cred *); |
| 153 | extern void exit_creds(struct task_struct *); | ||
| 146 | extern int copy_creds(struct task_struct *, unsigned long); | 154 | extern int copy_creds(struct task_struct *, unsigned long); |
| 155 | extern struct cred *cred_alloc_blank(void); | ||
| 147 | extern struct cred *prepare_creds(void); | 156 | extern struct cred *prepare_creds(void); |
| 148 | extern struct cred *prepare_exec_creds(void); | 157 | extern struct cred *prepare_exec_creds(void); |
| 149 | extern struct cred *prepare_usermodehelper_creds(void); | 158 | extern struct cred *prepare_usermodehelper_creds(void); |
| @@ -158,6 +167,60 @@ extern int set_security_override_from_ctx(struct cred *, const char *); | |||
| 158 | extern int set_create_files_as(struct cred *, struct inode *); | 167 | extern int set_create_files_as(struct cred *, struct inode *); |
| 159 | extern void __init cred_init(void); | 168 | extern void __init cred_init(void); |
| 160 | 169 | ||
| 170 | /* | ||
| 171 | * check for validity of credentials | ||
| 172 | */ | ||
| 173 | #ifdef CONFIG_DEBUG_CREDENTIALS | ||
| 174 | extern void __invalid_creds(const struct cred *, const char *, unsigned); | ||
| 175 | extern void __validate_process_creds(struct task_struct *, | ||
| 176 | const char *, unsigned); | ||
| 177 | |||
| 178 | static inline bool creds_are_invalid(const struct cred *cred) | ||
| 179 | { | ||
| 180 | if (cred->magic != CRED_MAGIC) | ||
| 181 | return true; | ||
| 182 | if (atomic_read(&cred->usage) < atomic_read(&cred->subscribers)) | ||
| 183 | return true; | ||
| 184 | #ifdef CONFIG_SECURITY_SELINUX | ||
| 185 | if ((unsigned long) cred->security < PAGE_SIZE) | ||
| 186 | return true; | ||
| 187 | if ((*(u32*)cred->security & 0xffffff00) == | ||
| 188 | (POISON_FREE << 24 | POISON_FREE << 16 | POISON_FREE << 8)) | ||
| 189 | return true; | ||
| 190 | #endif | ||
| 191 | return false; | ||
| 192 | } | ||
| 193 | |||
| 194 | static inline void __validate_creds(const struct cred *cred, | ||
| 195 | const char *file, unsigned line) | ||
| 196 | { | ||
| 197 | if (unlikely(creds_are_invalid(cred))) | ||
| 198 | __invalid_creds(cred, file, line); | ||
| 199 | } | ||
| 200 | |||
| 201 | #define validate_creds(cred) \ | ||
| 202 | do { \ | ||
| 203 | __validate_creds((cred), __FILE__, __LINE__); \ | ||
| 204 | } while(0) | ||
| 205 | |||
| 206 | #define validate_process_creds() \ | ||
| 207 | do { \ | ||
| 208 | __validate_process_creds(current, __FILE__, __LINE__); \ | ||
| 209 | } while(0) | ||
| 210 | |||
| 211 | extern void validate_creds_for_do_exit(struct task_struct *); | ||
| 212 | #else | ||
| 213 | static inline void validate_creds(const struct cred *cred) | ||
| 214 | { | ||
| 215 | } | ||
| 216 | static inline void validate_creds_for_do_exit(struct task_struct *tsk) | ||
| 217 | { | ||
| 218 | } | ||
| 219 | static inline void validate_process_creds(void) | ||
| 220 | { | ||
| 221 | } | ||
| 222 | #endif | ||
| 223 | |||
| 161 | /** | 224 | /** |
| 162 | * get_new_cred - Get a reference on a new set of credentials | 225 | * get_new_cred - Get a reference on a new set of credentials |
| 163 | * @cred: The new credentials to reference | 226 | * @cred: The new credentials to reference |
| @@ -186,7 +249,9 @@ static inline struct cred *get_new_cred(struct cred *cred) | |||
| 186 | */ | 249 | */ |
| 187 | static inline const struct cred *get_cred(const struct cred *cred) | 250 | static inline const struct cred *get_cred(const struct cred *cred) |
| 188 | { | 251 | { |
| 189 | return get_new_cred((struct cred *) cred); | 252 | struct cred *nonconst_cred = (struct cred *) cred; |
| 253 | validate_creds(cred); | ||
| 254 | return get_new_cred(nonconst_cred); | ||
| 190 | } | 255 | } |
| 191 | 256 | ||
| 192 | /** | 257 | /** |
| @@ -204,7 +269,7 @@ static inline void put_cred(const struct cred *_cred) | |||
| 204 | { | 269 | { |
| 205 | struct cred *cred = (struct cred *) _cred; | 270 | struct cred *cred = (struct cred *) _cred; |
| 206 | 271 | ||
| 207 | BUG_ON(atomic_read(&(cred)->usage) <= 0); | 272 | validate_creds(cred); |
| 208 | if (atomic_dec_and_test(&(cred)->usage)) | 273 | if (atomic_dec_and_test(&(cred)->usage)) |
| 209 | __put_cred(cred); | 274 | __put_cred(cred); |
| 210 | } | 275 | } |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index ec29fa268b94..fd929889e8dc 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
| @@ -115,7 +115,6 @@ struct crypto_async_request; | |||
| 115 | struct crypto_aead; | 115 | struct crypto_aead; |
| 116 | struct crypto_blkcipher; | 116 | struct crypto_blkcipher; |
| 117 | struct crypto_hash; | 117 | struct crypto_hash; |
| 118 | struct crypto_ahash; | ||
| 119 | struct crypto_rng; | 118 | struct crypto_rng; |
| 120 | struct crypto_tfm; | 119 | struct crypto_tfm; |
| 121 | struct crypto_type; | 120 | struct crypto_type; |
| @@ -146,16 +145,6 @@ struct ablkcipher_request { | |||
| 146 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | 145 | void *__ctx[] CRYPTO_MINALIGN_ATTR; |
| 147 | }; | 146 | }; |
| 148 | 147 | ||
| 149 | struct ahash_request { | ||
| 150 | struct crypto_async_request base; | ||
| 151 | |||
| 152 | unsigned int nbytes; | ||
| 153 | struct scatterlist *src; | ||
| 154 | u8 *result; | ||
| 155 | |||
| 156 | void *__ctx[] CRYPTO_MINALIGN_ATTR; | ||
| 157 | }; | ||
| 158 | |||
| 159 | /** | 148 | /** |
| 160 | * struct aead_request - AEAD request | 149 | * struct aead_request - AEAD request |
| 161 | * @base: Common attributes for async crypto requests | 150 | * @base: Common attributes for async crypto requests |
| @@ -220,18 +209,6 @@ struct ablkcipher_alg { | |||
| 220 | unsigned int ivsize; | 209 | unsigned int ivsize; |
| 221 | }; | 210 | }; |
| 222 | 211 | ||
| 223 | struct ahash_alg { | ||
| 224 | int (*init)(struct ahash_request *req); | ||
| 225 | int (*reinit)(struct ahash_request *req); | ||
| 226 | int (*update)(struct ahash_request *req); | ||
| 227 | int (*final)(struct ahash_request *req); | ||
| 228 | int (*digest)(struct ahash_request *req); | ||
| 229 | int (*setkey)(struct crypto_ahash *tfm, const u8 *key, | ||
| 230 | unsigned int keylen); | ||
| 231 | |||
| 232 | unsigned int digestsize; | ||
| 233 | }; | ||
| 234 | |||
| 235 | struct aead_alg { | 212 | struct aead_alg { |
| 236 | int (*setkey)(struct crypto_aead *tfm, const u8 *key, | 213 | int (*setkey)(struct crypto_aead *tfm, const u8 *key, |
| 237 | unsigned int keylen); | 214 | unsigned int keylen); |
| @@ -318,7 +295,6 @@ struct rng_alg { | |||
| 318 | #define cra_cipher cra_u.cipher | 295 | #define cra_cipher cra_u.cipher |
| 319 | #define cra_digest cra_u.digest | 296 | #define cra_digest cra_u.digest |
| 320 | #define cra_hash cra_u.hash | 297 | #define cra_hash cra_u.hash |
| 321 | #define cra_ahash cra_u.ahash | ||
| 322 | #define cra_compress cra_u.compress | 298 | #define cra_compress cra_u.compress |
| 323 | #define cra_rng cra_u.rng | 299 | #define cra_rng cra_u.rng |
| 324 | 300 | ||
| @@ -346,7 +322,6 @@ struct crypto_alg { | |||
| 346 | struct cipher_alg cipher; | 322 | struct cipher_alg cipher; |
| 347 | struct digest_alg digest; | 323 | struct digest_alg digest; |
| 348 | struct hash_alg hash; | 324 | struct hash_alg hash; |
| 349 | struct ahash_alg ahash; | ||
| 350 | struct compress_alg compress; | 325 | struct compress_alg compress; |
| 351 | struct rng_alg rng; | 326 | struct rng_alg rng; |
| 352 | } cra_u; | 327 | } cra_u; |
| @@ -433,18 +408,6 @@ struct hash_tfm { | |||
| 433 | unsigned int digestsize; | 408 | unsigned int digestsize; |
| 434 | }; | 409 | }; |
| 435 | 410 | ||
| 436 | struct ahash_tfm { | ||
| 437 | int (*init)(struct ahash_request *req); | ||
| 438 | int (*update)(struct ahash_request *req); | ||
| 439 | int (*final)(struct ahash_request *req); | ||
| 440 | int (*digest)(struct ahash_request *req); | ||
| 441 | int (*setkey)(struct crypto_ahash *tfm, const u8 *key, | ||
| 442 | unsigned int keylen); | ||
| 443 | |||
| 444 | unsigned int digestsize; | ||
| 445 | unsigned int reqsize; | ||
| 446 | }; | ||
| 447 | |||
| 448 | struct compress_tfm { | 411 | struct compress_tfm { |
| 449 | int (*cot_compress)(struct crypto_tfm *tfm, | 412 | int (*cot_compress)(struct crypto_tfm *tfm, |
| 450 | const u8 *src, unsigned int slen, | 413 | const u8 *src, unsigned int slen, |
| @@ -465,7 +428,6 @@ struct rng_tfm { | |||
| 465 | #define crt_blkcipher crt_u.blkcipher | 428 | #define crt_blkcipher crt_u.blkcipher |
| 466 | #define crt_cipher crt_u.cipher | 429 | #define crt_cipher crt_u.cipher |
| 467 | #define crt_hash crt_u.hash | 430 | #define crt_hash crt_u.hash |
| 468 | #define crt_ahash crt_u.ahash | ||
| 469 | #define crt_compress crt_u.compress | 431 | #define crt_compress crt_u.compress |
| 470 | #define crt_rng crt_u.rng | 432 | #define crt_rng crt_u.rng |
| 471 | 433 | ||
| @@ -479,7 +441,6 @@ struct crypto_tfm { | |||
| 479 | struct blkcipher_tfm blkcipher; | 441 | struct blkcipher_tfm blkcipher; |
| 480 | struct cipher_tfm cipher; | 442 | struct cipher_tfm cipher; |
| 481 | struct hash_tfm hash; | 443 | struct hash_tfm hash; |
| 482 | struct ahash_tfm ahash; | ||
| 483 | struct compress_tfm compress; | 444 | struct compress_tfm compress; |
| 484 | struct rng_tfm rng; | 445 | struct rng_tfm rng; |
| 485 | } crt_u; | 446 | } crt_u; |
| @@ -770,7 +731,7 @@ static inline struct ablkcipher_request *ablkcipher_request_alloc( | |||
| 770 | 731 | ||
| 771 | static inline void ablkcipher_request_free(struct ablkcipher_request *req) | 732 | static inline void ablkcipher_request_free(struct ablkcipher_request *req) |
| 772 | { | 733 | { |
| 773 | kfree(req); | 734 | kzfree(req); |
| 774 | } | 735 | } |
| 775 | 736 | ||
| 776 | static inline void ablkcipher_request_set_callback( | 737 | static inline void ablkcipher_request_set_callback( |
| @@ -901,7 +862,7 @@ static inline struct aead_request *aead_request_alloc(struct crypto_aead *tfm, | |||
| 901 | 862 | ||
| 902 | static inline void aead_request_free(struct aead_request *req) | 863 | static inline void aead_request_free(struct aead_request *req) |
| 903 | { | 864 | { |
| 904 | kfree(req); | 865 | kzfree(req); |
| 905 | } | 866 | } |
| 906 | 867 | ||
| 907 | static inline void aead_request_set_callback(struct aead_request *req, | 868 | static inline void aead_request_set_callback(struct aead_request *req, |
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h index 7d2e10006188..b7cdbb4373df 100644 --- a/include/linux/dcbnl.h +++ b/include/linux/dcbnl.h | |||
| @@ -50,6 +50,8 @@ struct dcbmsg { | |||
| 50 | * @DCB_CMD_SNUMTCS: set the number of traffic classes | 50 | * @DCB_CMD_SNUMTCS: set the number of traffic classes |
| 51 | * @DCB_CMD_GBCN: set backward congestion notification configuration | 51 | * @DCB_CMD_GBCN: set backward congestion notification configuration |
| 52 | * @DCB_CMD_SBCN: get backward congestion notification configration. | 52 | * @DCB_CMD_SBCN: get backward congestion notification configration. |
| 53 | * @DCB_CMD_GAPP: get application protocol configuration | ||
| 54 | * @DCB_CMD_SAPP: set application protocol configuration | ||
| 53 | */ | 55 | */ |
| 54 | enum dcbnl_commands { | 56 | enum dcbnl_commands { |
| 55 | DCB_CMD_UNDEFINED, | 57 | DCB_CMD_UNDEFINED, |
| @@ -80,6 +82,9 @@ enum dcbnl_commands { | |||
| 80 | DCB_CMD_BCN_GCFG, | 82 | DCB_CMD_BCN_GCFG, |
| 81 | DCB_CMD_BCN_SCFG, | 83 | DCB_CMD_BCN_SCFG, |
| 82 | 84 | ||
| 85 | DCB_CMD_GAPP, | ||
| 86 | DCB_CMD_SAPP, | ||
| 87 | |||
| 83 | __DCB_CMD_ENUM_MAX, | 88 | __DCB_CMD_ENUM_MAX, |
| 84 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, | 89 | DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, |
| 85 | }; | 90 | }; |
| @@ -114,6 +119,7 @@ enum dcbnl_attrs { | |||
| 114 | DCB_ATTR_CAP, | 119 | DCB_ATTR_CAP, |
| 115 | DCB_ATTR_NUMTCS, | 120 | DCB_ATTR_NUMTCS, |
| 116 | DCB_ATTR_BCN, | 121 | DCB_ATTR_BCN, |
| 122 | DCB_ATTR_APP, | ||
| 117 | 123 | ||
| 118 | __DCB_ATTR_ENUM_MAX, | 124 | __DCB_ATTR_ENUM_MAX, |
| 119 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, | 125 | DCB_ATTR_MAX = __DCB_ATTR_ENUM_MAX - 1, |
| @@ -338,5 +344,17 @@ enum dcb_general_attr_values { | |||
| 338 | DCB_ATTR_VALUE_UNDEFINED = 0xff | 344 | DCB_ATTR_VALUE_UNDEFINED = 0xff |
| 339 | }; | 345 | }; |
| 340 | 346 | ||
| 347 | #define DCB_APP_IDTYPE_ETHTYPE 0x00 | ||
| 348 | #define DCB_APP_IDTYPE_PORTNUM 0x01 | ||
| 349 | enum dcbnl_app_attrs { | ||
| 350 | DCB_APP_ATTR_UNDEFINED, | ||
| 351 | |||
| 352 | DCB_APP_ATTR_IDTYPE, | ||
| 353 | DCB_APP_ATTR_ID, | ||
| 354 | DCB_APP_ATTR_PRIORITY, | ||
| 355 | |||
| 356 | __DCB_APP_ATTR_ENUM_MAX, | ||
| 357 | DCB_APP_ATTR_MAX = __DCB_APP_ATTR_ENUM_MAX - 1, | ||
| 358 | }; | ||
| 341 | 359 | ||
| 342 | #endif /* __LINUX_DCBNL_H__ */ | 360 | #endif /* __LINUX_DCBNL_H__ */ |
diff --git a/include/linux/decompress/generic.h b/include/linux/decompress/generic.h index 6dfb856327bb..0c7111a55a1a 100644 --- a/include/linux/decompress/generic.h +++ b/include/linux/decompress/generic.h | |||
| @@ -1,31 +1,37 @@ | |||
| 1 | #ifndef DECOMPRESS_GENERIC_H | 1 | #ifndef DECOMPRESS_GENERIC_H |
| 2 | #define DECOMPRESS_GENERIC_H | 2 | #define DECOMPRESS_GENERIC_H |
| 3 | 3 | ||
| 4 | /* Minimal chunksize to be read. | ||
| 5 | *Bzip2 prefers at least 4096 | ||
| 6 | *Lzma prefers 0x10000 */ | ||
| 7 | #define COMPR_IOBUF_SIZE 4096 | ||
| 8 | |||
| 9 | typedef int (*decompress_fn) (unsigned char *inbuf, int len, | 4 | typedef int (*decompress_fn) (unsigned char *inbuf, int len, |
| 10 | int(*fill)(void*, unsigned int), | 5 | int(*fill)(void*, unsigned int), |
| 11 | int(*writebb)(void*, unsigned int), | 6 | int(*flush)(void*, unsigned int), |
| 12 | unsigned char *output, | 7 | unsigned char *outbuf, |
| 13 | int *posp, | 8 | int *posp, |
| 14 | void(*error)(char *x)); | 9 | void(*error)(char *x)); |
| 15 | 10 | ||
| 16 | /* inbuf - input buffer | 11 | /* inbuf - input buffer |
| 17 | *len - len of pre-read data in inbuf | 12 | *len - len of pre-read data in inbuf |
| 18 | *fill - function to fill inbuf if empty | 13 | *fill - function to fill inbuf when empty |
| 19 | *writebb - function to write out outbug | 14 | *flush - function to write out outbuf |
| 15 | *outbuf - output buffer | ||
| 20 | *posp - if non-null, input position (number of bytes read) will be | 16 | *posp - if non-null, input position (number of bytes read) will be |
| 21 | * returned here | 17 | * returned here |
| 22 | * | 18 | * |
| 23 | *If len != 0, the inbuf is initialized (with as much data), and fill | 19 | *If len != 0, inbuf should contain all the necessary input data, and fill |
| 24 | *should not be called | 20 | *should be NULL |
| 25 | *If len = 0, the inbuf is allocated, but empty. Its size is IOBUF_SIZE | 21 | *If len = 0, inbuf can be NULL, in which case the decompressor will allocate |
| 26 | *fill should be called (repeatedly...) to read data, at most IOBUF_SIZE | 22 | *the input buffer. If inbuf != NULL it must be at least XXX_IOBUF_SIZE bytes. |
| 23 | *fill will be called (repeatedly...) to read data, at most XXX_IOBUF_SIZE | ||
| 24 | *bytes should be read per call. Replace XXX with the appropriate decompressor | ||
| 25 | *name, i.e. LZMA_IOBUF_SIZE. | ||
| 26 | * | ||
| 27 | *If flush = NULL, outbuf must be large enough to buffer all the expected | ||
| 28 | *output. If flush != NULL, the output buffer will be allocated by the | ||
| 29 | *decompressor (outbuf = NULL), and the flush function will be called to | ||
| 30 | *flush the output buffer at the appropriate time (decompressor and stream | ||
| 31 | *dependent). | ||
| 27 | */ | 32 | */ |
| 28 | 33 | ||
| 34 | |||
| 29 | /* Utility routine to detect the decompression method */ | 35 | /* Utility routine to detect the decompression method */ |
| 30 | decompress_fn decompress_method(const unsigned char *inbuf, int len, | 36 | decompress_fn decompress_method(const unsigned char *inbuf, int len, |
| 31 | const char **name); | 37 | const char **name); |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 0d6310657f32..df7607e6dce8 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
| @@ -84,13 +84,16 @@ typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | |||
| 84 | 84 | ||
| 85 | typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, | 85 | typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, |
| 86 | struct dm_dev *dev, | 86 | struct dm_dev *dev, |
| 87 | sector_t physical_start, | 87 | sector_t start, sector_t len, |
| 88 | void *data); | 88 | void *data); |
| 89 | 89 | ||
| 90 | typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, | 90 | typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, |
| 91 | iterate_devices_callout_fn fn, | 91 | iterate_devices_callout_fn fn, |
| 92 | void *data); | 92 | void *data); |
| 93 | 93 | ||
| 94 | typedef void (*dm_io_hints_fn) (struct dm_target *ti, | ||
| 95 | struct queue_limits *limits); | ||
| 96 | |||
| 94 | /* | 97 | /* |
| 95 | * Returns: | 98 | * Returns: |
| 96 | * 0: The target can handle the next I/O immediately. | 99 | * 0: The target can handle the next I/O immediately. |
| @@ -104,7 +107,7 @@ void dm_error(const char *message); | |||
| 104 | * Combine device limits. | 107 | * Combine device limits. |
| 105 | */ | 108 | */ |
| 106 | int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, | 109 | int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, |
| 107 | sector_t start, void *data); | 110 | sector_t start, sector_t len, void *data); |
| 108 | 111 | ||
| 109 | struct dm_dev { | 112 | struct dm_dev { |
| 110 | struct block_device *bdev; | 113 | struct block_device *bdev; |
| @@ -151,6 +154,7 @@ struct target_type { | |||
| 151 | dm_merge_fn merge; | 154 | dm_merge_fn merge; |
| 152 | dm_busy_fn busy; | 155 | dm_busy_fn busy; |
| 153 | dm_iterate_devices_fn iterate_devices; | 156 | dm_iterate_devices_fn iterate_devices; |
| 157 | dm_io_hints_fn io_hints; | ||
| 154 | 158 | ||
| 155 | /* For internal device-mapper use. */ | 159 | /* For internal device-mapper use. */ |
| 156 | struct list_head list; | 160 | struct list_head list; |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h index 642e3017b51f..8a1f972c0fe9 100644 --- a/include/linux/dm-log-userspace.h +++ b/include/linux/dm-log-userspace.h | |||
| @@ -371,7 +371,18 @@ | |||
| 371 | (DM_ULOG_REQUEST_MASK & (request_type)) | 371 | (DM_ULOG_REQUEST_MASK & (request_type)) |
| 372 | 372 | ||
| 373 | struct dm_ulog_request { | 373 | struct dm_ulog_request { |
| 374 | char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */ | 374 | /* |
| 375 | * The local unique identifier (luid) and the universally unique | ||
| 376 | * identifier (uuid) are used to tie a request to a specific | ||
| 377 | * mirror log. A single machine log could probably make due with | ||
| 378 | * just the 'luid', but a cluster-aware log must use the 'uuid' and | ||
| 379 | * the 'luid'. The uuid is what is required for node to node | ||
| 380 | * communication concerning a particular log, but the 'luid' helps | ||
| 381 | * differentiate between logs that are being swapped and have the | ||
| 382 | * same 'uuid'. (Think "live" and "inactive" device-mapper tables.) | ||
| 383 | */ | ||
| 384 | uint64_t luid; | ||
| 385 | char uuid[DM_UUID_LEN]; | ||
| 375 | char padding[7]; /* Padding because DM_UUID_LEN = 129 */ | 386 | char padding[7]; /* Padding because DM_UUID_LEN = 129 */ |
| 376 | 387 | ||
| 377 | int32_t error; /* Used to report back processing errors */ | 388 | int32_t error; /* Used to report back processing errors */ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 07dfd460d286..c0f6c3cd788c 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
| @@ -98,11 +98,6 @@ static inline int is_device_dma_capable(struct device *dev) | |||
| 98 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; | 98 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size) | ||
| 102 | { | ||
| 103 | return addr + size <= mask; | ||
| 104 | } | ||
| 105 | |||
| 106 | #ifdef CONFIG_HAS_DMA | 101 | #ifdef CONFIG_HAS_DMA |
| 107 | #include <asm/dma-mapping.h> | 102 | #include <asm/dma-mapping.h> |
| 108 | #else | 103 | #else |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index bb5489c82c99..a8a3e1ac281d 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
| @@ -43,7 +43,7 @@ extern const char * dmi_get_system_info(int field); | |||
| 43 | extern const struct dmi_device * dmi_find_device(int type, const char *name, | 43 | extern const struct dmi_device * dmi_find_device(int type, const char *name, |
| 44 | const struct dmi_device *from); | 44 | const struct dmi_device *from); |
| 45 | extern void dmi_scan_machine(void); | 45 | extern void dmi_scan_machine(void); |
| 46 | extern int dmi_get_year(int field); | 46 | extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); |
| 47 | extern int dmi_name_in_vendors(const char *str); | 47 | extern int dmi_name_in_vendors(const char *str); |
| 48 | extern int dmi_name_in_serial(const char *str); | 48 | extern int dmi_name_in_serial(const char *str); |
| 49 | extern int dmi_available; | 49 | extern int dmi_available; |
| @@ -58,7 +58,16 @@ static inline const char * dmi_get_system_info(int field) { return NULL; } | |||
| 58 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, | 58 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, |
| 59 | const struct dmi_device *from) { return NULL; } | 59 | const struct dmi_device *from) { return NULL; } |
| 60 | static inline void dmi_scan_machine(void) { return; } | 60 | static inline void dmi_scan_machine(void) { return; } |
| 61 | static inline int dmi_get_year(int year) { return 0; } | 61 | static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) |
| 62 | { | ||
| 63 | if (yearp) | ||
| 64 | *yearp = 0; | ||
| 65 | if (monthp) | ||
| 66 | *monthp = 0; | ||
| 67 | if (dayp) | ||
| 68 | *dayp = 0; | ||
| 69 | return false; | ||
| 70 | } | ||
| 62 | static inline int dmi_name_in_vendors(const char *s) { return 0; } | 71 | static inline int dmi_name_in_vendors(const char *s) { return 0; } |
| 63 | static inline int dmi_name_in_serial(const char *s) { return 0; } | 72 | static inline int dmi_name_in_serial(const char *s) { return 0; } |
| 64 | #define dmi_available 0 | 73 | #define dmi_available 0 |
diff --git a/include/linux/dtlk.h b/include/linux/dtlk.h index 2896d90118a9..22a7b9a5f5d1 100644 --- a/include/linux/dtlk.h +++ b/include/linux/dtlk.h | |||
| @@ -1,22 +1,3 @@ | |||
| 1 | #if 0 | ||
| 2 | |||
| 3 | #define TRACE_TXT(text) \ | ||
| 4 | { \ | ||
| 5 | if(dtlk_trace) \ | ||
| 6 | { \ | ||
| 7 | console_print(text); \ | ||
| 8 | console_print("\n"); \ | ||
| 9 | } \ | ||
| 10 | } | ||
| 11 | |||
| 12 | #define TRACE_CHR(chr) \ | ||
| 13 | { \ | ||
| 14 | if(dtlk_trace) \ | ||
| 15 | console_print(chr); \ | ||
| 16 | } \ | ||
| 17 | |||
| 18 | #endif | ||
| 19 | |||
| 20 | #define DTLK_MINOR 0 | 1 | #define DTLK_MINOR 0 |
| 21 | #define DTLK_IO_EXTENT 0x02 | 2 | #define DTLK_IO_EXTENT 0x02 |
| 22 | 3 | ||
diff --git a/include/linux/enclosure.h b/include/linux/enclosure.h index 4332442b1b57..90d1c2184112 100644 --- a/include/linux/enclosure.h +++ b/include/linux/enclosure.h | |||
| @@ -122,8 +122,9 @@ enclosure_component_register(struct enclosure_device *, unsigned int, | |||
| 122 | enum enclosure_component_type, const char *); | 122 | enum enclosure_component_type, const char *); |
| 123 | int enclosure_add_device(struct enclosure_device *enclosure, int component, | 123 | int enclosure_add_device(struct enclosure_device *enclosure, int component, |
| 124 | struct device *dev); | 124 | struct device *dev); |
| 125 | int enclosure_remove_device(struct enclosure_device *enclosure, int component); | 125 | int enclosure_remove_device(struct enclosure_device *, struct device *); |
| 126 | struct enclosure_device *enclosure_find(struct device *dev); | 126 | struct enclosure_device *enclosure_find(struct device *dev, |
| 127 | struct enclosure_device *start); | ||
| 127 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), | 128 | int enclosure_for_each_device(int (*fn)(struct enclosure_device *, void *), |
| 128 | void *data); | 129 | void *data); |
| 129 | 130 | ||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 9b660bd2e2b3..15e4eb713694 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -362,12 +362,25 @@ struct ethtool_rxnfc { | |||
| 362 | __u32 rule_locs[0]; | 362 | __u32 rule_locs[0]; |
| 363 | }; | 363 | }; |
| 364 | 364 | ||
| 365 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | ||
| 366 | enum ethtool_flash_op_type { | ||
| 367 | ETHTOOL_FLASH_ALL_REGIONS = 0, | ||
| 368 | }; | ||
| 369 | |||
| 370 | /* for passing firmware flashing related parameters */ | ||
| 371 | struct ethtool_flash { | ||
| 372 | __u32 cmd; | ||
| 373 | __u32 region; | ||
| 374 | char data[ETHTOOL_FLASH_MAX_FILENAME]; | ||
| 375 | }; | ||
| 376 | |||
| 365 | #ifdef __KERNEL__ | 377 | #ifdef __KERNEL__ |
| 366 | 378 | ||
| 367 | struct net_device; | 379 | struct net_device; |
| 368 | 380 | ||
| 369 | /* Some generic methods drivers may use in their ethtool_ops */ | 381 | /* Some generic methods drivers may use in their ethtool_ops */ |
| 370 | u32 ethtool_op_get_link(struct net_device *dev); | 382 | u32 ethtool_op_get_link(struct net_device *dev); |
| 383 | u32 ethtool_op_get_rx_csum(struct net_device *dev); | ||
| 371 | u32 ethtool_op_get_tx_csum(struct net_device *dev); | 384 | u32 ethtool_op_get_tx_csum(struct net_device *dev); |
| 372 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); | 385 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); |
| 373 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); | 386 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); |
| @@ -488,6 +501,7 @@ struct ethtool_ops { | |||
| 488 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ | 501 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ |
| 489 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 502 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); |
| 490 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 503 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
| 504 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | ||
| 491 | }; | 505 | }; |
| 492 | #endif /* __KERNEL__ */ | 506 | #endif /* __KERNEL__ */ |
| 493 | 507 | ||
| @@ -544,6 +558,7 @@ struct ethtool_ops { | |||
| 544 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ | 558 | #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */ |
| 545 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 559 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
| 546 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 560 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
| 561 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | ||
| 547 | 562 | ||
| 548 | /* compatibility with older code */ | 563 | /* compatibility with older code */ |
| 549 | #define SPARC_ETH_GSET ETHTOOL_GSET | 564 | #define SPARC_ETH_GSET ETHTOOL_GSET |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 634a5e5aba3e..7499b3667798 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
| @@ -874,7 +874,7 @@ struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | |||
| 874 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 874 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
| 875 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, | 875 | int ext3_get_blocks_handle(handle_t *handle, struct inode *inode, |
| 876 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, | 876 | sector_t iblock, unsigned long maxblocks, struct buffer_head *bh_result, |
| 877 | int create, int extend_disksize); | 877 | int create); |
| 878 | 878 | ||
| 879 | extern struct inode *ext3_iget(struct super_block *, unsigned long); | 879 | extern struct inode *ext3_iget(struct super_block *, unsigned long); |
| 880 | extern int ext3_write_inode (struct inode *, int); | 880 | extern int ext3_write_inode (struct inode *, int); |
diff --git a/include/linux/fips.h b/include/linux/fips.h new file mode 100644 index 000000000000..f8fb07b0b6b8 --- /dev/null +++ b/include/linux/fips.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef _FIPS_H | ||
| 2 | #define _FIPS_H | ||
| 3 | |||
| 4 | #ifdef CONFIG_CRYPTO_FIPS | ||
| 5 | extern int fips_enabled; | ||
| 6 | #else | ||
| 7 | #define fips_enabled 0 | ||
| 8 | #endif | ||
| 9 | |||
| 10 | #endif | ||
diff --git a/include/linux/flex_array.h b/include/linux/flex_array.h new file mode 100644 index 000000000000..45ff18491514 --- /dev/null +++ b/include/linux/flex_array.h | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | #ifndef _FLEX_ARRAY_H | ||
| 2 | #define _FLEX_ARRAY_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <asm/page.h> | ||
| 6 | |||
| 7 | #define FLEX_ARRAY_PART_SIZE PAGE_SIZE | ||
| 8 | #define FLEX_ARRAY_BASE_SIZE PAGE_SIZE | ||
| 9 | |||
| 10 | struct flex_array_part; | ||
| 11 | |||
| 12 | /* | ||
| 13 | * This is meant to replace cases where an array-like | ||
| 14 | * structure has gotten too big to fit into kmalloc() | ||
| 15 | * and the developer is getting tempted to use | ||
| 16 | * vmalloc(). | ||
| 17 | */ | ||
| 18 | |||
| 19 | struct flex_array { | ||
| 20 | union { | ||
| 21 | struct { | ||
| 22 | int element_size; | ||
| 23 | int total_nr_elements; | ||
| 24 | struct flex_array_part *parts[]; | ||
| 25 | }; | ||
| 26 | /* | ||
| 27 | * This little trick makes sure that | ||
| 28 | * sizeof(flex_array) == PAGE_SIZE | ||
| 29 | */ | ||
| 30 | char padding[FLEX_ARRAY_BASE_SIZE]; | ||
| 31 | }; | ||
| 32 | }; | ||
| 33 | |||
| 34 | #define FLEX_ARRAY_INIT(size, total) { { {\ | ||
| 35 | .element_size = (size), \ | ||
| 36 | .total_nr_elements = (total), \ | ||
| 37 | } } } | ||
| 38 | |||
| 39 | struct flex_array *flex_array_alloc(int element_size, unsigned int total, | ||
| 40 | gfp_t flags); | ||
| 41 | int flex_array_prealloc(struct flex_array *fa, unsigned int start, | ||
| 42 | unsigned int end, gfp_t flags); | ||
| 43 | void flex_array_free(struct flex_array *fa); | ||
| 44 | void flex_array_free_parts(struct flex_array *fa); | ||
| 45 | int flex_array_put(struct flex_array *fa, unsigned int element_nr, void *src, | ||
| 46 | gfp_t flags); | ||
| 47 | void *flex_array_get(struct flex_array *fa, unsigned int element_nr); | ||
| 48 | |||
| 49 | #endif /* _FLEX_ARRAY_H */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 0872372184fe..b21cf6b9c80b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -161,8 +161,8 @@ struct inodes_stat_t { | |||
| 161 | * These aren't really reads or writes, they pass down information about | 161 | * These aren't really reads or writes, they pass down information about |
| 162 | * parts of device that are now unused by the file system. | 162 | * parts of device that are now unused by the file system. |
| 163 | */ | 163 | */ |
| 164 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) | 164 | #define DISCARD_NOBARRIER (WRITE | (1 << BIO_RW_DISCARD)) |
| 165 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) | 165 | #define DISCARD_BARRIER (DISCARD_NOBARRIER | (1 << BIO_RW_BARRIER)) |
| 166 | 166 | ||
| 167 | #define SEL_IN 1 | 167 | #define SEL_IN 1 |
| 168 | #define SEL_OUT 2 | 168 | #define SEL_OUT 2 |
| @@ -715,7 +715,7 @@ struct posix_acl; | |||
| 715 | 715 | ||
| 716 | struct inode { | 716 | struct inode { |
| 717 | struct hlist_node i_hash; | 717 | struct hlist_node i_hash; |
| 718 | struct list_head i_list; | 718 | struct list_head i_list; /* backing dev IO list */ |
| 719 | struct list_head i_sb_list; | 719 | struct list_head i_sb_list; |
| 720 | struct list_head i_dentry; | 720 | struct list_head i_dentry; |
| 721 | unsigned long i_ino; | 721 | unsigned long i_ino; |
| @@ -1336,9 +1336,6 @@ struct super_block { | |||
| 1336 | struct xattr_handler **s_xattr; | 1336 | struct xattr_handler **s_xattr; |
| 1337 | 1337 | ||
| 1338 | struct list_head s_inodes; /* all inodes */ | 1338 | struct list_head s_inodes; /* all inodes */ |
| 1339 | struct list_head s_dirty; /* dirty inodes */ | ||
| 1340 | struct list_head s_io; /* parked for writeback */ | ||
| 1341 | struct list_head s_more_io; /* parked for more writeback */ | ||
| 1342 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ | 1339 | struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ |
| 1343 | struct list_head s_files; | 1340 | struct list_head s_files; |
| 1344 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ | 1341 | /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */ |
| @@ -1458,11 +1455,6 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | |||
| 1458 | #define DT_SOCK 12 | 1455 | #define DT_SOCK 12 |
| 1459 | #define DT_WHT 14 | 1456 | #define DT_WHT 14 |
| 1460 | 1457 | ||
| 1461 | #define OSYNC_METADATA (1<<0) | ||
| 1462 | #define OSYNC_DATA (1<<1) | ||
| 1463 | #define OSYNC_INODE (1<<2) | ||
| 1464 | int generic_osync_inode(struct inode *, struct address_space *, int); | ||
| 1465 | |||
| 1466 | /* | 1458 | /* |
| 1467 | * This is the "filldir" function type, used by readdir() to let | 1459 | * This is the "filldir" function type, used by readdir() to let |
| 1468 | * the kernel specify what kind of dirent layout it wants to have. | 1460 | * the kernel specify what kind of dirent layout it wants to have. |
| @@ -1528,6 +1520,7 @@ struct inode_operations { | |||
| 1528 | void (*put_link) (struct dentry *, struct nameidata *, void *); | 1520 | void (*put_link) (struct dentry *, struct nameidata *, void *); |
| 1529 | void (*truncate) (struct inode *); | 1521 | void (*truncate) (struct inode *); |
| 1530 | int (*permission) (struct inode *, int); | 1522 | int (*permission) (struct inode *, int); |
| 1523 | int (*check_acl)(struct inode *, int); | ||
| 1531 | int (*setattr) (struct dentry *, struct iattr *); | 1524 | int (*setattr) (struct dentry *, struct iattr *); |
| 1532 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); | 1525 | int (*getattr) (struct vfsmount *mnt, struct dentry *, struct kstat *); |
| 1533 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); | 1526 | int (*setxattr) (struct dentry *, const char *,const void *,size_t,int); |
| @@ -1788,6 +1781,7 @@ extern int get_sb_pseudo(struct file_system_type *, char *, | |||
| 1788 | struct vfsmount *mnt); | 1781 | struct vfsmount *mnt); |
| 1789 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); | 1782 | extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); |
| 1790 | int __put_super_and_need_restart(struct super_block *sb); | 1783 | int __put_super_and_need_restart(struct super_block *sb); |
| 1784 | void put_super(struct super_block *sb); | ||
| 1791 | 1785 | ||
| 1792 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ | 1786 | /* Alas, no aliases. Too much hassle with bringing module.h everywhere */ |
| 1793 | #define fops_get(fops) \ | 1787 | #define fops_get(fops) \ |
| @@ -1946,6 +1940,7 @@ extern void putname(const char *name); | |||
| 1946 | extern int register_blkdev(unsigned int, const char *); | 1940 | extern int register_blkdev(unsigned int, const char *); |
| 1947 | extern void unregister_blkdev(unsigned int, const char *); | 1941 | extern void unregister_blkdev(unsigned int, const char *); |
| 1948 | extern struct block_device *bdget(dev_t); | 1942 | extern struct block_device *bdget(dev_t); |
| 1943 | extern struct block_device *bdgrab(struct block_device *bdev); | ||
| 1949 | extern void bd_set_size(struct block_device *, loff_t size); | 1944 | extern void bd_set_size(struct block_device *, loff_t size); |
| 1950 | extern void bd_forget(struct inode *inode); | 1945 | extern void bd_forget(struct inode *inode); |
| 1951 | extern void bdput(struct block_device *); | 1946 | extern void bdput(struct block_device *); |
| @@ -1997,12 +1992,25 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
| 1997 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1992 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
| 1998 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 1993 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
| 1999 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 1994 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
| 2000 | extern int register_chrdev(unsigned int, const char *, | 1995 | extern int __register_chrdev(unsigned int major, unsigned int baseminor, |
| 2001 | const struct file_operations *); | 1996 | unsigned int count, const char *name, |
| 2002 | extern void unregister_chrdev(unsigned int, const char *); | 1997 | const struct file_operations *fops); |
| 1998 | extern void __unregister_chrdev(unsigned int major, unsigned int baseminor, | ||
| 1999 | unsigned int count, const char *name); | ||
| 2003 | extern void unregister_chrdev_region(dev_t, unsigned); | 2000 | extern void unregister_chrdev_region(dev_t, unsigned); |
| 2004 | extern void chrdev_show(struct seq_file *,off_t); | 2001 | extern void chrdev_show(struct seq_file *,off_t); |
| 2005 | 2002 | ||
| 2003 | static inline int register_chrdev(unsigned int major, const char *name, | ||
| 2004 | const struct file_operations *fops) | ||
| 2005 | { | ||
| 2006 | return __register_chrdev(major, 0, 256, name, fops); | ||
| 2007 | } | ||
| 2008 | |||
| 2009 | static inline void unregister_chrdev(unsigned int major, const char *name) | ||
| 2010 | { | ||
| 2011 | __unregister_chrdev(major, 0, 256, name); | ||
| 2012 | } | ||
| 2013 | |||
| 2006 | /* fs/block_dev.c */ | 2014 | /* fs/block_dev.c */ |
| 2007 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 2015 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
| 2008 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | 2016 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ |
| @@ -2069,12 +2077,12 @@ static inline void invalidate_remote_inode(struct inode *inode) | |||
| 2069 | extern int invalidate_inode_pages2(struct address_space *mapping); | 2077 | extern int invalidate_inode_pages2(struct address_space *mapping); |
| 2070 | extern int invalidate_inode_pages2_range(struct address_space *mapping, | 2078 | extern int invalidate_inode_pages2_range(struct address_space *mapping, |
| 2071 | pgoff_t start, pgoff_t end); | 2079 | pgoff_t start, pgoff_t end); |
| 2072 | extern void generic_sync_sb_inodes(struct super_block *sb, | ||
| 2073 | struct writeback_control *wbc); | ||
| 2074 | extern int write_inode_now(struct inode *, int); | 2080 | extern int write_inode_now(struct inode *, int); |
| 2075 | extern int filemap_fdatawrite(struct address_space *); | 2081 | extern int filemap_fdatawrite(struct address_space *); |
| 2076 | extern int filemap_flush(struct address_space *); | 2082 | extern int filemap_flush(struct address_space *); |
| 2077 | extern int filemap_fdatawait(struct address_space *); | 2083 | extern int filemap_fdatawait(struct address_space *); |
| 2084 | extern int filemap_fdatawait_range(struct address_space *, loff_t lstart, | ||
| 2085 | loff_t lend); | ||
| 2078 | extern int filemap_write_and_wait(struct address_space *mapping); | 2086 | extern int filemap_write_and_wait(struct address_space *mapping); |
| 2079 | extern int filemap_write_and_wait_range(struct address_space *mapping, | 2087 | extern int filemap_write_and_wait_range(struct address_space *mapping, |
| 2080 | loff_t lstart, loff_t lend); | 2088 | loff_t lstart, loff_t lend); |
| @@ -2085,7 +2093,10 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
| 2085 | extern int filemap_fdatawrite_range(struct address_space *mapping, | 2093 | extern int filemap_fdatawrite_range(struct address_space *mapping, |
| 2086 | loff_t start, loff_t end); | 2094 | loff_t start, loff_t end); |
| 2087 | 2095 | ||
| 2096 | extern int vfs_fsync_range(struct file *file, struct dentry *dentry, | ||
| 2097 | loff_t start, loff_t end, int datasync); | ||
| 2088 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); | 2098 | extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); |
| 2099 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); | ||
| 2089 | extern void sync_supers(void); | 2100 | extern void sync_supers(void); |
| 2090 | extern void emergency_sync(void); | 2101 | extern void emergency_sync(void); |
| 2091 | extern void emergency_remount(void); | 2102 | extern void emergency_remount(void); |
| @@ -2122,7 +2133,7 @@ extern struct file *do_filp_open(int dfd, const char *pathname, | |||
| 2122 | int open_flag, int mode, int acc_mode); | 2133 | int open_flag, int mode, int acc_mode); |
| 2123 | extern int may_open(struct path *, int, int); | 2134 | extern int may_open(struct path *, int, int); |
| 2124 | 2135 | ||
| 2125 | extern int kernel_read(struct file *, unsigned long, char *, unsigned long); | 2136 | extern int kernel_read(struct file *, loff_t, char *, unsigned long); |
| 2126 | extern struct file * open_exec(const char *); | 2137 | extern struct file * open_exec(const char *); |
| 2127 | 2138 | ||
| 2128 | /* fs/dcache.c -- generic fs support functions */ | 2139 | /* fs/dcache.c -- generic fs support functions */ |
| @@ -2136,7 +2147,7 @@ extern loff_t default_llseek(struct file *file, loff_t offset, int origin); | |||
| 2136 | 2147 | ||
| 2137 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); | 2148 | extern loff_t vfs_llseek(struct file *file, loff_t offset, int origin); |
| 2138 | 2149 | ||
| 2139 | extern struct inode * inode_init_always(struct super_block *, struct inode *); | 2150 | extern int inode_init_always(struct super_block *, struct inode *); |
| 2140 | extern void inode_init_once(struct inode *); | 2151 | extern void inode_init_once(struct inode *); |
| 2141 | extern void inode_add_to_lists(struct super_block *, struct inode *); | 2152 | extern void inode_add_to_lists(struct super_block *, struct inode *); |
| 2142 | extern void iput(struct inode *); | 2153 | extern void iput(struct inode *); |
| @@ -2163,6 +2174,7 @@ extern void __iget(struct inode * inode); | |||
| 2163 | extern void iget_failed(struct inode *); | 2174 | extern void iget_failed(struct inode *); |
| 2164 | extern void clear_inode(struct inode *); | 2175 | extern void clear_inode(struct inode *); |
| 2165 | extern void destroy_inode(struct inode *); | 2176 | extern void destroy_inode(struct inode *); |
| 2177 | extern void __destroy_inode(struct inode *); | ||
| 2166 | extern struct inode *new_inode(struct super_block *); | 2178 | extern struct inode *new_inode(struct super_block *); |
| 2167 | extern int should_remove_suid(struct dentry *); | 2179 | extern int should_remove_suid(struct dentry *); |
| 2168 | extern int file_remove_suid(struct file *); | 2180 | extern int file_remove_suid(struct file *); |
| @@ -2184,16 +2196,15 @@ extern int bdev_read_only(struct block_device *); | |||
| 2184 | extern int set_blocksize(struct block_device *, int); | 2196 | extern int set_blocksize(struct block_device *, int); |
| 2185 | extern int sb_set_blocksize(struct super_block *, int); | 2197 | extern int sb_set_blocksize(struct super_block *, int); |
| 2186 | extern int sb_min_blocksize(struct super_block *, int); | 2198 | extern int sb_min_blocksize(struct super_block *, int); |
| 2187 | extern int sb_has_dirty_inodes(struct super_block *); | ||
| 2188 | 2199 | ||
| 2189 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); | 2200 | extern int generic_file_mmap(struct file *, struct vm_area_struct *); |
| 2190 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 2201 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
| 2191 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 2202 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
| 2192 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 2203 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
| 2193 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2204 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 2205 | extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, | ||
| 2206 | loff_t *); | ||
| 2194 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2207 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
| 2195 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | ||
| 2196 | unsigned long, loff_t); | ||
| 2197 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | 2208 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, |
| 2198 | unsigned long *, loff_t, loff_t *, size_t, size_t); | 2209 | unsigned long *, loff_t, loff_t *, size_t, size_t); |
| 2199 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | 2210 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, |
| @@ -2203,6 +2214,10 @@ extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t l | |||
| 2203 | extern int generic_segment_checks(const struct iovec *iov, | 2214 | extern int generic_segment_checks(const struct iovec *iov, |
| 2204 | unsigned long *nr_segs, size_t *count, int access_flags); | 2215 | unsigned long *nr_segs, size_t *count, int access_flags); |
| 2205 | 2216 | ||
| 2217 | /* fs/block_dev.c */ | ||
| 2218 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | ||
| 2219 | unsigned long nr_segs, loff_t pos); | ||
| 2220 | |||
| 2206 | /* fs/splice.c */ | 2221 | /* fs/splice.c */ |
| 2207 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, | 2222 | extern ssize_t generic_file_splice_read(struct file *, loff_t *, |
| 2208 | struct pipe_inode_info *, size_t, unsigned int); | 2223 | struct pipe_inode_info *, size_t, unsigned int); |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 6c3de999fb34..4d6f47b51189 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
| @@ -352,7 +352,7 @@ extern void fsnotify_unmount_inodes(struct list_head *list); | |||
| 352 | /* put here because inotify does some weird stuff when destroying watches */ | 352 | /* put here because inotify does some weird stuff when destroying watches */ |
| 353 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, | 353 | extern struct fsnotify_event *fsnotify_create_event(struct inode *to_tell, __u32 mask, |
| 354 | void *data, int data_is, const char *name, | 354 | void *data, int data_is, const char *name, |
| 355 | u32 cookie); | 355 | u32 cookie, gfp_t gfp); |
| 356 | 356 | ||
| 357 | #else | 357 | #else |
| 358 | 358 | ||
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 5c093ffc655b..23f7179bf74e 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -89,18 +89,26 @@ enum print_line_t { | |||
| 89 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ | 89 | TRACE_TYPE_NO_CONSUME = 3 /* Handled but ask to not consume */ |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | 92 | void tracing_generic_entry_update(struct trace_entry *entry, | |
| 93 | unsigned long flags, | ||
| 94 | int pc); | ||
| 93 | struct ring_buffer_event * | 95 | struct ring_buffer_event * |
| 94 | trace_current_buffer_lock_reserve(int type, unsigned long len, | 96 | trace_current_buffer_lock_reserve(struct ring_buffer **current_buffer, |
| 97 | int type, unsigned long len, | ||
| 95 | unsigned long flags, int pc); | 98 | unsigned long flags, int pc); |
| 96 | void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, | 99 | void trace_current_buffer_unlock_commit(struct ring_buffer *buffer, |
| 100 | struct ring_buffer_event *event, | ||
| 97 | unsigned long flags, int pc); | 101 | unsigned long flags, int pc); |
| 98 | void trace_nowake_buffer_unlock_commit(struct ring_buffer_event *event, | 102 | void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, |
| 103 | struct ring_buffer_event *event, | ||
| 99 | unsigned long flags, int pc); | 104 | unsigned long flags, int pc); |
| 100 | void trace_current_buffer_discard_commit(struct ring_buffer_event *event); | 105 | void trace_current_buffer_discard_commit(struct ring_buffer *buffer, |
| 106 | struct ring_buffer_event *event); | ||
| 101 | 107 | ||
| 102 | void tracing_record_cmdline(struct task_struct *tsk); | 108 | void tracing_record_cmdline(struct task_struct *tsk); |
| 103 | 109 | ||
| 110 | struct event_filter; | ||
| 111 | |||
| 104 | struct ftrace_event_call { | 112 | struct ftrace_event_call { |
| 105 | struct list_head list; | 113 | struct list_head list; |
| 106 | char *name; | 114 | char *name; |
| @@ -108,36 +116,46 @@ struct ftrace_event_call { | |||
| 108 | struct dentry *dir; | 116 | struct dentry *dir; |
| 109 | struct trace_event *event; | 117 | struct trace_event *event; |
| 110 | int enabled; | 118 | int enabled; |
| 111 | int (*regfunc)(void); | 119 | int (*regfunc)(void *); |
| 112 | void (*unregfunc)(void); | 120 | void (*unregfunc)(void *); |
| 113 | int id; | 121 | int id; |
| 114 | int (*raw_init)(void); | 122 | int (*raw_init)(void); |
| 115 | int (*show_format)(struct trace_seq *s); | 123 | int (*show_format)(struct ftrace_event_call *call, |
| 116 | int (*define_fields)(void); | 124 | struct trace_seq *s); |
| 125 | int (*define_fields)(struct ftrace_event_call *); | ||
| 117 | struct list_head fields; | 126 | struct list_head fields; |
| 118 | int filter_active; | 127 | int filter_active; |
| 119 | void *filter; | 128 | struct event_filter *filter; |
| 120 | void *mod; | 129 | void *mod; |
| 130 | void *data; | ||
| 121 | 131 | ||
| 122 | #ifdef CONFIG_EVENT_PROFILE | 132 | atomic_t profile_count; |
| 123 | atomic_t profile_count; | 133 | int (*profile_enable)(struct ftrace_event_call *); |
| 124 | int (*profile_enable)(struct ftrace_event_call *); | 134 | void (*profile_disable)(struct ftrace_event_call *); |
| 125 | void (*profile_disable)(struct ftrace_event_call *); | ||
| 126 | #endif | ||
| 127 | }; | 135 | }; |
| 128 | 136 | ||
| 129 | #define MAX_FILTER_PRED 32 | 137 | #define MAX_FILTER_PRED 32 |
| 130 | #define MAX_FILTER_STR_VAL 128 | 138 | #define MAX_FILTER_STR_VAL 128 |
| 131 | 139 | ||
| 132 | extern int init_preds(struct ftrace_event_call *call); | ||
| 133 | extern void destroy_preds(struct ftrace_event_call *call); | 140 | extern void destroy_preds(struct ftrace_event_call *call); |
| 134 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | 141 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); |
| 135 | extern int filter_current_check_discard(struct ftrace_event_call *call, | 142 | extern int filter_current_check_discard(struct ring_buffer *buffer, |
| 143 | struct ftrace_event_call *call, | ||
| 136 | void *rec, | 144 | void *rec, |
| 137 | struct ring_buffer_event *event); | 145 | struct ring_buffer_event *event); |
| 138 | 146 | ||
| 139 | extern int trace_define_field(struct ftrace_event_call *call, char *type, | 147 | enum { |
| 140 | char *name, int offset, int size, int is_signed); | 148 | FILTER_OTHER = 0, |
| 149 | FILTER_STATIC_STRING, | ||
| 150 | FILTER_DYN_STRING, | ||
| 151 | FILTER_PTR_STRING, | ||
| 152 | }; | ||
| 153 | |||
| 154 | extern int trace_define_field(struct ftrace_event_call *call, | ||
| 155 | const char *type, const char *name, | ||
| 156 | int offset, int size, int is_signed, | ||
| 157 | int filter_type); | ||
| 158 | extern int trace_define_common_fields(struct ftrace_event_call *call); | ||
| 141 | 159 | ||
| 142 | #define is_signed_type(type) (((type)(-1)) < 0) | 160 | #define is_signed_type(type) (((type)(-1)) < 0) |
| 143 | 161 | ||
| @@ -162,11 +180,4 @@ do { \ | |||
| 162 | __trace_printk(ip, fmt, ##args); \ | 180 | __trace_printk(ip, fmt, ##args); \ |
| 163 | } while (0) | 181 | } while (0) |
| 164 | 182 | ||
| 165 | #define __common_field(type, item, is_signed) \ | ||
| 166 | ret = trace_define_field(event_call, #type, "common_" #item, \ | ||
| 167 | offsetof(typeof(field.ent), item), \ | ||
| 168 | sizeof(field.ent.item), is_signed); \ | ||
| 169 | if (ret) \ | ||
| 170 | return ret; | ||
| 171 | |||
| 172 | #endif /* _LINUX_FTRACE_EVENT_H */ | 183 | #endif /* _LINUX_FTRACE_EVENT_H */ |
diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h index 0ffa41df0ee8..710e901085d0 100644 --- a/include/linux/gen_stats.h +++ b/include/linux/gen_stats.h | |||
| @@ -22,6 +22,11 @@ struct gnet_stats_basic | |||
| 22 | { | 22 | { |
| 23 | __u64 bytes; | 23 | __u64 bytes; |
| 24 | __u32 packets; | 24 | __u32 packets; |
| 25 | }; | ||
| 26 | struct gnet_stats_basic_packed | ||
| 27 | { | ||
| 28 | __u64 bytes; | ||
| 29 | __u32 packets; | ||
| 25 | } __attribute__ ((packed)); | 30 | } __attribute__ ((packed)); |
| 26 | 31 | ||
| 27 | /** | 32 | /** |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 45fc320a53c6..44263cb27121 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -98,7 +98,7 @@ struct hd_struct { | |||
| 98 | int make_it_fail; | 98 | int make_it_fail; |
| 99 | #endif | 99 | #endif |
| 100 | unsigned long stamp; | 100 | unsigned long stamp; |
| 101 | int in_flight; | 101 | int in_flight[2]; |
| 102 | #ifdef CONFIG_SMP | 102 | #ifdef CONFIG_SMP |
| 103 | struct disk_stats *dkstats; | 103 | struct disk_stats *dkstats; |
| 104 | #else | 104 | #else |
| @@ -322,18 +322,23 @@ static inline void free_part_stats(struct hd_struct *part) | |||
| 322 | #define part_stat_sub(cpu, gendiskp, field, subnd) \ | 322 | #define part_stat_sub(cpu, gendiskp, field, subnd) \ |
| 323 | part_stat_add(cpu, gendiskp, field, -subnd) | 323 | part_stat_add(cpu, gendiskp, field, -subnd) |
| 324 | 324 | ||
| 325 | static inline void part_inc_in_flight(struct hd_struct *part) | 325 | static inline void part_inc_in_flight(struct hd_struct *part, int rw) |
| 326 | { | 326 | { |
| 327 | part->in_flight++; | 327 | part->in_flight[rw]++; |
| 328 | if (part->partno) | 328 | if (part->partno) |
| 329 | part_to_disk(part)->part0.in_flight++; | 329 | part_to_disk(part)->part0.in_flight[rw]++; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | static inline void part_dec_in_flight(struct hd_struct *part) | 332 | static inline void part_dec_in_flight(struct hd_struct *part, int rw) |
| 333 | { | 333 | { |
| 334 | part->in_flight--; | 334 | part->in_flight[rw]--; |
| 335 | if (part->partno) | 335 | if (part->partno) |
| 336 | part_to_disk(part)->part0.in_flight--; | 336 | part_to_disk(part)->part0.in_flight[rw]--; |
| 337 | } | ||
| 338 | |||
| 339 | static inline int part_in_flight(struct hd_struct *part) | ||
| 340 | { | ||
| 341 | return part->in_flight[0] + part->in_flight[1]; | ||
| 337 | } | 342 | } |
| 338 | 343 | ||
| 339 | /* block/blk-core.c */ | 344 | /* block/blk-core.c */ |
| @@ -546,6 +551,8 @@ extern ssize_t part_size_show(struct device *dev, | |||
| 546 | struct device_attribute *attr, char *buf); | 551 | struct device_attribute *attr, char *buf); |
| 547 | extern ssize_t part_stat_show(struct device *dev, | 552 | extern ssize_t part_stat_show(struct device *dev, |
| 548 | struct device_attribute *attr, char *buf); | 553 | struct device_attribute *attr, char *buf); |
| 554 | extern ssize_t part_inflight_show(struct device *dev, | ||
| 555 | struct device_attribute *attr, char *buf); | ||
| 549 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 556 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
| 550 | extern ssize_t part_fail_show(struct device *dev, | 557 | extern ssize_t part_fail_show(struct device *dev, |
| 551 | struct device_attribute *attr, char *buf); | 558 | struct device_attribute *attr, char *buf); |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index c56b4bce56d0..b80c88dedbbb 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
| @@ -333,6 +333,28 @@ struct gfs2_leaf { | |||
| 333 | 333 | ||
| 334 | /* | 334 | /* |
| 335 | * Extended attribute header format | 335 | * Extended attribute header format |
| 336 | * | ||
| 337 | * This works in a similar way to dirents. There is a fixed size header | ||
| 338 | * followed by a variable length section made up of the name and the | ||
| 339 | * associated data. In the case of a "stuffed" entry, the value is | ||
| 340 | * inline directly after the name, the ea_num_ptrs entry will be | ||
| 341 | * zero in that case. For non-"stuffed" entries, there will be | ||
| 342 | * a set of pointers (aligned to 8 byte boundary) to the block(s) | ||
| 343 | * containing the value. | ||
| 344 | * | ||
| 345 | * The blocks containing the values and the blocks containing the | ||
| 346 | * extended attribute headers themselves all start with the common | ||
| 347 | * metadata header. Each inode, if it has extended attributes, will | ||
| 348 | * have either a single block containing the extended attribute headers | ||
| 349 | * or a single indirect block pointing to blocks containing the | ||
| 350 | * extended attribure headers. | ||
| 351 | * | ||
| 352 | * The maximim size of the data part of an extended attribute is 64k | ||
| 353 | * so the number of blocks required depends upon block size. Since the | ||
| 354 | * block size also determines the number of pointers in an indirect | ||
| 355 | * block, its a fairly complicated calculation to work out the maximum | ||
| 356 | * number of blocks that an inode may have relating to extended attributes. | ||
| 357 | * | ||
| 336 | */ | 358 | */ |
| 337 | 359 | ||
| 338 | #define GFS2_EA_MAX_NAME_LEN 255 | 360 | #define GFS2_EA_MAX_NAME_LEN 255 |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 8246c697863d..6d527ee82b2b 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
| @@ -64,6 +64,12 @@ | |||
| 64 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) | 64 | #define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) |
| 65 | #define NMI_OFFSET (1UL << NMI_SHIFT) | 65 | #define NMI_OFFSET (1UL << NMI_SHIFT) |
| 66 | 66 | ||
| 67 | #ifndef PREEMPT_ACTIVE | ||
| 68 | #define PREEMPT_ACTIVE_BITS 1 | ||
| 69 | #define PREEMPT_ACTIVE_SHIFT (NMI_SHIFT + NMI_BITS) | ||
| 70 | #define PREEMPT_ACTIVE (__IRQ_MASK(PREEMPT_ACTIVE_BITS) << PREEMPT_ACTIVE_SHIFT) | ||
| 71 | #endif | ||
| 72 | |||
| 67 | #if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS)) | 73 | #if PREEMPT_ACTIVE < (1 << (NMI_SHIFT + NMI_BITS)) |
| 68 | #error PREEMPT_ACTIVE is too low! | 74 | #error PREEMPT_ACTIVE is too low! |
| 69 | #endif | 75 | #endif |
| @@ -132,7 +138,7 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
| 132 | } | 138 | } |
| 133 | #endif | 139 | #endif |
| 134 | 140 | ||
| 135 | #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) | 141 | #if defined(CONFIG_NO_HZ) |
| 136 | extern void rcu_irq_enter(void); | 142 | extern void rcu_irq_enter(void); |
| 137 | extern void rcu_irq_exit(void); | 143 | extern void rcu_irq_exit(void); |
| 138 | extern void rcu_nmi_enter(void); | 144 | extern void rcu_nmi_enter(void); |
| @@ -142,7 +148,7 @@ extern void rcu_nmi_exit(void); | |||
| 142 | # define rcu_irq_exit() do { } while (0) | 148 | # define rcu_irq_exit() do { } while (0) |
| 143 | # define rcu_nmi_enter() do { } while (0) | 149 | # define rcu_nmi_enter() do { } while (0) |
| 144 | # define rcu_nmi_exit() do { } while (0) | 150 | # define rcu_nmi_exit() do { } while (0) |
| 145 | #endif /* #if defined(CONFIG_NO_HZ) && !defined(CONFIG_CLASSIC_RCU) */ | 151 | #endif /* #if defined(CONFIG_NO_HZ) */ |
| 146 | 152 | ||
| 147 | /* | 153 | /* |
| 148 | * It is safe to do non-atomic ops on ->hardirq_context, | 154 | * It is safe to do non-atomic ops on ->hardirq_context, |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index 6a6e701f1631..ee275c8b3df1 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
| @@ -38,7 +38,7 @@ struct hdlc_proto { | |||
| 38 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); | 38 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); |
| 39 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); | 39 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); |
| 40 | int (*netif_rx)(struct sk_buff *skb); | 40 | int (*netif_rx)(struct sk_buff *skb); |
| 41 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); | 41 | netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev); |
| 42 | struct module *module; | 42 | struct module *module; |
| 43 | struct hdlc_proto *next; /* next protocol in the list */ | 43 | struct hdlc_proto *next; /* next protocol in the list */ |
| 44 | }; | 44 | }; |
| @@ -51,7 +51,7 @@ typedef struct hdlc_device { | |||
| 51 | unsigned short encoding, unsigned short parity); | 51 | unsigned short encoding, unsigned short parity); |
| 52 | 52 | ||
| 53 | /* hardware driver must handle this instead of dev->hard_start_xmit */ | 53 | /* hardware driver must handle this instead of dev->hard_start_xmit */ |
| 54 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); | 54 | netdev_tx_t (*xmit)(struct sk_buff *skb, struct net_device *dev); |
| 55 | 55 | ||
| 56 | /* Things below are for HDLC layer internal use only */ | 56 | /* Things below are for HDLC layer internal use only */ |
| 57 | const struct hdlc_proto *proto; | 57 | const struct hdlc_proto *proto; |
| @@ -60,7 +60,7 @@ typedef struct hdlc_device { | |||
| 60 | spinlock_t state_lock; | 60 | spinlock_t state_lock; |
| 61 | void *state; | 61 | void *state; |
| 62 | void *priv; | 62 | void *priv; |
| 63 | }hdlc_device; | 63 | } hdlc_device; |
| 64 | 64 | ||
| 65 | 65 | ||
| 66 | 66 | ||
| @@ -106,7 +106,7 @@ void hdlc_close(struct net_device *dev); | |||
| 106 | /* May be used by hardware driver */ | 106 | /* May be used by hardware driver */ |
| 107 | int hdlc_change_mtu(struct net_device *dev, int new_mtu); | 107 | int hdlc_change_mtu(struct net_device *dev, int new_mtu); |
| 108 | /* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */ | 108 | /* Must be pointed to by hw driver's dev->netdev_ops->ndo_start_xmit */ |
| 109 | int hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev); | 109 | netdev_tx_t hdlc_start_xmit(struct sk_buff *skb, struct net_device *dev); |
| 110 | 110 | ||
| 111 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | 111 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, |
| 112 | size_t size); | 112 | size_t size); |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 2723513a5651..5cbc620bdfe0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <asm/tlbflush.h> | 10 | #include <asm/tlbflush.h> |
| 11 | 11 | ||
| 12 | struct ctl_table; | 12 | struct ctl_table; |
| 13 | struct user_struct; | ||
| 13 | 14 | ||
| 14 | int PageHuge(struct page *page); | 15 | int PageHuge(struct page *page); |
| 15 | 16 | ||
| @@ -146,7 +147,8 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
| 146 | 147 | ||
| 147 | extern const struct file_operations hugetlbfs_file_operations; | 148 | extern const struct file_operations hugetlbfs_file_operations; |
| 148 | extern struct vm_operations_struct hugetlb_vm_ops; | 149 | extern struct vm_operations_struct hugetlb_vm_ops; |
| 149 | struct file *hugetlb_file_setup(const char *name, size_t, int); | 150 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, |
| 151 | struct user_struct **user); | ||
| 150 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 152 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
| 151 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 153 | void hugetlb_put_quota(struct address_space *mapping, long delta); |
| 152 | 154 | ||
| @@ -168,7 +170,7 @@ static inline void set_file_hugepages(struct file *file) | |||
| 168 | 170 | ||
| 169 | #define is_file_hugepages(file) 0 | 171 | #define is_file_hugepages(file) 0 |
| 170 | #define set_file_hugepages(file) BUG() | 172 | #define set_file_hugepages(file) BUG() |
| 171 | #define hugetlb_file_setup(name,size,acctflag) ERR_PTR(-ENOSYS) | 173 | #define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS) |
| 172 | 174 | ||
| 173 | #endif /* !CONFIG_HUGETLBFS */ | 175 | #endif /* !CONFIG_HUGETLBFS */ |
| 174 | 176 | ||
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index b6a85183c333..c0d8357917e2 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
| @@ -171,8 +171,6 @@ struct icmp6_filter { | |||
| 171 | #ifdef __KERNEL__ | 171 | #ifdef __KERNEL__ |
| 172 | 172 | ||
| 173 | #include <linux/netdevice.h> | 173 | #include <linux/netdevice.h> |
| 174 | #include <linux/skbuff.h> | ||
| 175 | |||
| 176 | 174 | ||
| 177 | extern void icmpv6_send(struct sk_buff *skb, | 175 | extern void icmpv6_send(struct sk_buff *skb, |
| 178 | u8 type, u8 code, | 176 | u8 type, u8 code, |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index a9173d5434d1..52e15e079c61 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -115,7 +115,7 @@ | |||
| 115 | #define IEEE80211_MAX_SSID_LEN 32 | 115 | #define IEEE80211_MAX_SSID_LEN 32 |
| 116 | 116 | ||
| 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
| 118 | #define IEEE80211_MESH_CONFIG_LEN 19 | 118 | #define IEEE80211_MESH_CONFIG_LEN 24 |
| 119 | 119 | ||
| 120 | #define IEEE80211_QOS_CTL_LEN 2 | 120 | #define IEEE80211_QOS_CTL_LEN 2 |
| 121 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 121 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
| @@ -802,6 +802,31 @@ struct ieee80211_ht_cap { | |||
| 802 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | 802 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 |
| 803 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | 803 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C |
| 804 | 804 | ||
| 805 | /* | ||
| 806 | * Maximum length of AMPDU that the STA can receive. | ||
| 807 | * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets) | ||
| 808 | */ | ||
| 809 | enum ieee80211_max_ampdu_length_exp { | ||
| 810 | IEEE80211_HT_MAX_AMPDU_8K = 0, | ||
| 811 | IEEE80211_HT_MAX_AMPDU_16K = 1, | ||
| 812 | IEEE80211_HT_MAX_AMPDU_32K = 2, | ||
| 813 | IEEE80211_HT_MAX_AMPDU_64K = 3 | ||
| 814 | }; | ||
| 815 | |||
| 816 | #define IEEE80211_HT_MAX_AMPDU_FACTOR 13 | ||
| 817 | |||
| 818 | /* Minimum MPDU start spacing */ | ||
| 819 | enum ieee80211_min_mpdu_spacing { | ||
| 820 | IEEE80211_HT_MPDU_DENSITY_NONE = 0, /* No restriction */ | ||
| 821 | IEEE80211_HT_MPDU_DENSITY_0_25 = 1, /* 1/4 usec */ | ||
| 822 | IEEE80211_HT_MPDU_DENSITY_0_5 = 2, /* 1/2 usec */ | ||
| 823 | IEEE80211_HT_MPDU_DENSITY_1 = 3, /* 1 usec */ | ||
| 824 | IEEE80211_HT_MPDU_DENSITY_2 = 4, /* 2 usec */ | ||
| 825 | IEEE80211_HT_MPDU_DENSITY_4 = 5, /* 4 usec */ | ||
| 826 | IEEE80211_HT_MPDU_DENSITY_8 = 6, /* 8 usec */ | ||
| 827 | IEEE80211_HT_MPDU_DENSITY_16 = 7 /* 16 usec */ | ||
| 828 | }; | ||
| 829 | |||
| 805 | /** | 830 | /** |
| 806 | * struct ieee80211_ht_info - HT information | 831 | * struct ieee80211_ht_info - HT information |
| 807 | * | 832 | * |
| @@ -1196,6 +1221,10 @@ enum ieee80211_sa_query_action { | |||
| 1196 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 | 1221 | #define WLAN_CIPHER_SUITE_WEP104 0x000FAC05 |
| 1197 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 | 1222 | #define WLAN_CIPHER_SUITE_AES_CMAC 0x000FAC06 |
| 1198 | 1223 | ||
| 1224 | /* AKM suite selectors */ | ||
| 1225 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 | ||
| 1226 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 | ||
| 1227 | |||
| 1199 | #define WLAN_MAX_KEY_LEN 32 | 1228 | #define WLAN_MAX_KEY_LEN 32 |
| 1200 | 1229 | ||
| 1201 | /** | 1230 | /** |
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index a60c821be44c..fd9740466757 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h | |||
| @@ -41,6 +41,7 @@ enum | |||
| 41 | 41 | ||
| 42 | #define IFA_F_NODAD 0x02 | 42 | #define IFA_F_NODAD 0x02 |
| 43 | #define IFA_F_OPTIMISTIC 0x04 | 43 | #define IFA_F_OPTIMISTIC 0x04 |
| 44 | #define IFA_F_DADFAILED 0x08 | ||
| 44 | #define IFA_F_HOMEADDRESS 0x10 | 45 | #define IFA_F_HOMEADDRESS 0x10 |
| 45 | #define IFA_F_DEPRECATED 0x20 | 46 | #define IFA_F_DEPRECATED 0x20 |
| 46 | #define IFA_F_TENTATIVE 0x40 | 47 | #define IFA_F_TENTATIVE 0x40 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index b554300ef8bf..282eb37e2dec 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
| @@ -87,7 +87,6 @@ | |||
| 87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
| 88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | 88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ |
| 89 | #define ARPHRD_IEEE802154 804 | 89 | #define ARPHRD_IEEE802154 804 |
| 90 | #define ARPHRD_IEEE802154_PHY 805 | ||
| 91 | 90 | ||
| 92 | #define ARPHRD_PHONET 820 /* PhoNet media type */ | 91 | #define ARPHRD_PHONET 820 /* PhoNet media type */ |
| 93 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ | 92 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 70fdba2bbf71..580b6004d00e 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -139,10 +139,10 @@ extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | |||
| 139 | /* | 139 | /* |
| 140 | * Display a 6 byte device address (MAC) in a readable format. | 140 | * Display a 6 byte device address (MAC) in a readable format. |
| 141 | */ | 141 | */ |
| 142 | extern char *print_mac(char *buf, const unsigned char *addr); | 142 | extern char *print_mac(char *buf, const unsigned char *addr) __deprecated; |
| 143 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 143 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
| 144 | #define MAC_BUF_SIZE 18 | 144 | #define MAC_BUF_SIZE 18 |
| 145 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused | 145 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] |
| 146 | 146 | ||
| 147 | #endif | 147 | #endif |
| 148 | 148 | ||
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 673f2209453d..80b3a1056a5f 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
| @@ -69,11 +69,6 @@ struct dlci_conf { | |||
| 69 | 69 | ||
| 70 | #define DLCI_VALID_FLAGS 0x000B | 70 | #define DLCI_VALID_FLAGS 0x000B |
| 71 | 71 | ||
| 72 | /* FRAD driver uses these to indicate what it did with packet */ | ||
| 73 | #define DLCI_RET_OK 0x00 | ||
| 74 | #define DLCI_RET_ERR 0x01 | ||
| 75 | #define DLCI_RET_DROP 0x02 | ||
| 76 | |||
| 77 | /* defines for the actual Frame Relay hardware */ | 72 | /* defines for the actual Frame Relay hardware */ |
| 78 | #define FRAD_GET_CONF (SIOCDEVPRIVATE) | 73 | #define FRAD_GET_CONF (SIOCDEVPRIVATE) |
| 79 | #define FRAD_SET_CONF (SIOCDEVPRIVATE + 1) | 74 | #define FRAD_SET_CONF (SIOCDEVPRIVATE + 1) |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 915ba5789f0e..3f5fd523b49d 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
| @@ -62,6 +62,7 @@ | |||
| 62 | #define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */ | 62 | #define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */ |
| 63 | #define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ | 63 | #define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */ |
| 64 | #define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ | 64 | #define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */ |
| 65 | #define TUN_F_UFO 0x10 /* I can handle UFO packets */ | ||
| 65 | 66 | ||
| 66 | /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ | 67 | /* Protocol info prepended to the packets (when IFF_NO_PI is not set) */ |
| 67 | #define TUN_PKT_STRIP 0x0001 | 68 | #define TUN_PKT_STRIP 0x0001 |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index acef2a770b6b..ad27c7da8798 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -82,7 +82,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
| 82 | 82 | ||
| 83 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 83 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
| 84 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) | 84 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
| 85 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_ANDCONF((in_dev), RP_FILTER) | 85 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) |
| 86 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 86 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
| 87 | ACCEPT_SOURCE_ROUTE) | 87 | ACCEPT_SOURCE_ROUTE) |
| 88 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) | 88 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) |
diff --git a/include/linux/init.h b/include/linux/init.h index 13b633ed695e..400adbb45414 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
| @@ -103,8 +103,8 @@ | |||
| 103 | #define __INIT .section ".init.text","ax" | 103 | #define __INIT .section ".init.text","ax" |
| 104 | #define __FINIT .previous | 104 | #define __FINIT .previous |
| 105 | 105 | ||
| 106 | #define __INITDATA .section ".init.data","aw" | 106 | #define __INITDATA .section ".init.data","aw",%progbits |
| 107 | #define __INITRODATA .section ".init.rodata","a" | 107 | #define __INITRODATA .section ".init.rodata","a",%progbits |
| 108 | #define __FINITDATA .previous | 108 | #define __FINITDATA .previous |
| 109 | 109 | ||
| 110 | #define __DEVINIT .section ".devinit.text", "ax" | 110 | #define __DEVINIT .section ".devinit.text", "ax" |
| @@ -305,9 +305,17 @@ void __init parse_early_options(char *cmdline); | |||
| 305 | #ifdef CONFIG_MODULES | 305 | #ifdef CONFIG_MODULES |
| 306 | #define __init_or_module | 306 | #define __init_or_module |
| 307 | #define __initdata_or_module | 307 | #define __initdata_or_module |
| 308 | #define __initconst_or_module | ||
| 309 | #define __INIT_OR_MODULE .text | ||
| 310 | #define __INITDATA_OR_MODULE .data | ||
| 311 | #define __INITRODATA_OR_MODULE .section ".rodata","a",%progbits | ||
| 308 | #else | 312 | #else |
| 309 | #define __init_or_module __init | 313 | #define __init_or_module __init |
| 310 | #define __initdata_or_module __initdata | 314 | #define __initdata_or_module __initdata |
| 315 | #define __initconst_or_module __initconst | ||
| 316 | #define __INIT_OR_MODULE __INIT | ||
| 317 | #define __INITDATA_OR_MODULE __INITDATA | ||
| 318 | #define __INITRODATA_OR_MODULE __INITRODATA | ||
| 311 | #endif /*CONFIG_MODULES*/ | 319 | #endif /*CONFIG_MODULES*/ |
| 312 | 320 | ||
| 313 | /* Functions marked as __devexit may be discarded at kernel link time, depending | 321 | /* Functions marked as __devexit may be discarded at kernel link time, depending |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 7fc01b13be43..9e7f2e8fc66e 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
| @@ -94,6 +94,16 @@ extern struct group_info init_groups; | |||
| 94 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | 94 | # define CAP_INIT_BSET CAP_INIT_EFF_SET |
| 95 | #endif | 95 | #endif |
| 96 | 96 | ||
| 97 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
| 98 | #define INIT_TASK_RCU_PREEMPT(tsk) \ | ||
| 99 | .rcu_read_lock_nesting = 0, \ | ||
| 100 | .rcu_read_unlock_special = 0, \ | ||
| 101 | .rcu_blocked_node = NULL, \ | ||
| 102 | .rcu_node_entry = LIST_HEAD_INIT(tsk.rcu_node_entry), | ||
| 103 | #else | ||
| 104 | #define INIT_TASK_RCU_PREEMPT(tsk) | ||
| 105 | #endif | ||
| 106 | |||
| 97 | extern struct cred init_cred; | 107 | extern struct cred init_cred; |
| 98 | 108 | ||
| 99 | #ifdef CONFIG_PERF_COUNTERS | 109 | #ifdef CONFIG_PERF_COUNTERS |
| @@ -173,6 +183,7 @@ extern struct cred init_cred; | |||
| 173 | INIT_LOCKDEP \ | 183 | INIT_LOCKDEP \ |
| 174 | INIT_FTRACE_GRAPH \ | 184 | INIT_FTRACE_GRAPH \ |
| 175 | INIT_TRACE_RECURSION \ | 185 | INIT_TRACE_RECURSION \ |
| 186 | INIT_TASK_RCU_PREEMPT(tsk) \ | ||
| 176 | } | 187 | } |
| 177 | 188 | ||
| 178 | 189 | ||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index 7964516c6954..15d5903af2dd 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
| @@ -15,12 +15,13 @@ | |||
| 15 | #define KEY_COL(k) (((k) >> 16) & 0xff) | 15 | #define KEY_COL(k) (((k) >> 16) & 0xff) |
| 16 | #define KEY_VAL(k) ((k) & 0xffff) | 16 | #define KEY_VAL(k) ((k) & 0xffff) |
| 17 | 17 | ||
| 18 | #define MATRIX_SCAN_CODE(row, col, row_shift) (((row) << (row_shift)) + (col)) | ||
| 19 | |||
| 18 | /** | 20 | /** |
| 19 | * struct matrix_keymap_data - keymap for matrix keyboards | 21 | * struct matrix_keymap_data - keymap for matrix keyboards |
| 20 | * @keymap: pointer to array of uint32 values encoded with KEY() macro | 22 | * @keymap: pointer to array of uint32 values encoded with KEY() macro |
| 21 | * representing keymap | 23 | * representing keymap |
| 22 | * @keymap_size: number of entries (initialized) in this keymap | 24 | * @keymap_size: number of entries (initialized) in this keymap |
| 23 | * @max_keymap_size: maximum size of keymap supported by the device | ||
| 24 | * | 25 | * |
| 25 | * This structure is supposed to be used by platform code to supply | 26 | * This structure is supposed to be used by platform code to supply |
| 26 | * keymaps to drivers that implement matrix-like keypads/keyboards. | 27 | * keymaps to drivers that implement matrix-like keypads/keyboards. |
| @@ -28,14 +29,13 @@ | |||
| 28 | struct matrix_keymap_data { | 29 | struct matrix_keymap_data { |
| 29 | const uint32_t *keymap; | 30 | const uint32_t *keymap; |
| 30 | unsigned int keymap_size; | 31 | unsigned int keymap_size; |
| 31 | unsigned int max_keymap_size; | ||
| 32 | }; | 32 | }; |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * struct matrix_keypad_platform_data - platform-dependent keypad data | 35 | * struct matrix_keypad_platform_data - platform-dependent keypad data |
| 36 | * @keymap_data: pointer to &matrix_keymap_data | 36 | * @keymap_data: pointer to &matrix_keymap_data |
| 37 | * @row_gpios: array of gpio numbers reporesenting rows | 37 | * @row_gpios: pointer to array of gpio numbers representing rows |
| 38 | * @col_gpios: array of gpio numbers reporesenting colums | 38 | * @col_gpios: pointer to array of gpio numbers reporesenting colums |
| 39 | * @num_row_gpios: actual number of row gpios used by device | 39 | * @num_row_gpios: actual number of row gpios used by device |
| 40 | * @num_col_gpios: actual number of col gpios used by device | 40 | * @num_col_gpios: actual number of col gpios used by device |
| 41 | * @col_scan_delay_us: delay, measured in microseconds, that is | 41 | * @col_scan_delay_us: delay, measured in microseconds, that is |
| @@ -48,8 +48,9 @@ struct matrix_keymap_data { | |||
| 48 | struct matrix_keypad_platform_data { | 48 | struct matrix_keypad_platform_data { |
| 49 | const struct matrix_keymap_data *keymap_data; | 49 | const struct matrix_keymap_data *keymap_data; |
| 50 | 50 | ||
| 51 | unsigned int row_gpios[MATRIX_MAX_ROWS]; | 51 | const unsigned int *row_gpios; |
| 52 | unsigned int col_gpios[MATRIX_MAX_COLS]; | 52 | const unsigned int *col_gpios; |
| 53 | |||
| 53 | unsigned int num_row_gpios; | 54 | unsigned int num_row_gpios; |
| 54 | unsigned int num_col_gpios; | 55 | unsigned int num_col_gpios; |
| 55 | 56 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 35e7df1e9f30..8e9e151f811e 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
| @@ -50,6 +50,9 @@ | |||
| 50 | * IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is | 50 | * IRQF_IRQPOLL - Interrupt is used for polling (only the interrupt that is |
| 51 | * registered first in an shared interrupt is considered for | 51 | * registered first in an shared interrupt is considered for |
| 52 | * performance reasons) | 52 | * performance reasons) |
| 53 | * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. | ||
| 54 | * Used by threaded interrupts which need to keep the | ||
| 55 | * irq line disabled until the threaded handler has been run. | ||
| 53 | */ | 56 | */ |
| 54 | #define IRQF_DISABLED 0x00000020 | 57 | #define IRQF_DISABLED 0x00000020 |
| 55 | #define IRQF_SAMPLE_RANDOM 0x00000040 | 58 | #define IRQF_SAMPLE_RANDOM 0x00000040 |
| @@ -59,6 +62,7 @@ | |||
| 59 | #define IRQF_PERCPU 0x00000400 | 62 | #define IRQF_PERCPU 0x00000400 |
| 60 | #define IRQF_NOBALANCING 0x00000800 | 63 | #define IRQF_NOBALANCING 0x00000800 |
| 61 | #define IRQF_IRQPOLL 0x00001000 | 64 | #define IRQF_IRQPOLL 0x00001000 |
| 65 | #define IRQF_ONESHOT 0x00002000 | ||
| 62 | 66 | ||
| 63 | /* | 67 | /* |
| 64 | * Bits used by threaded handlers: | 68 | * Bits used by threaded handlers: |
| @@ -344,6 +348,7 @@ enum | |||
| 344 | NET_TX_SOFTIRQ, | 348 | NET_TX_SOFTIRQ, |
| 345 | NET_RX_SOFTIRQ, | 349 | NET_RX_SOFTIRQ, |
| 346 | BLOCK_SOFTIRQ, | 350 | BLOCK_SOFTIRQ, |
| 351 | BLOCK_IOPOLL_SOFTIRQ, | ||
| 347 | TASKLET_SOFTIRQ, | 352 | TASKLET_SOFTIRQ, |
| 348 | SCHED_SOFTIRQ, | 353 | SCHED_SOFTIRQ, |
| 349 | HRTIMER_SOFTIRQ, | 354 | HRTIMER_SOFTIRQ, |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index dd05434fa45f..4da4a75c3f1e 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
| @@ -92,7 +92,7 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc) | |||
| 92 | * a race). | 92 | * a race). |
| 93 | */ | 93 | */ |
| 94 | if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { | 94 | if (ioc && atomic_long_inc_not_zero(&ioc->refcount)) { |
| 95 | atomic_long_inc(&ioc->refcount); | 95 | atomic_inc(&ioc->nr_tasks); |
| 96 | return ioc; | 96 | return ioc; |
| 97 | } | 97 | } |
| 98 | 98 | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index cb2e77a3f7f7..ae9653dbcd78 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -69,6 +69,8 @@ typedef void (*irq_flow_handler_t)(unsigned int irq, | |||
| 69 | #define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ | 69 | #define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ |
| 70 | #define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/ | 70 | #define IRQ_AFFINITY_SET 0x02000000 /* IRQ affinity was set from userspace*/ |
| 71 | #define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */ | 71 | #define IRQ_SUSPENDED 0x04000000 /* IRQ has gone through suspend sequence */ |
| 72 | #define IRQ_ONESHOT 0x08000000 /* IRQ is not unmasked after hardirq */ | ||
| 73 | #define IRQ_NESTED_THREAD 0x10000000 /* IRQ is nested into another, no own handler thread */ | ||
| 72 | 74 | ||
| 73 | #ifdef CONFIG_IRQ_PER_CPU | 75 | #ifdef CONFIG_IRQ_PER_CPU |
| 74 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | 76 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) |
| @@ -100,6 +102,9 @@ struct msi_desc; | |||
| 100 | * @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ | 102 | * @set_type: set the flow type (IRQ_TYPE_LEVEL/etc.) of an IRQ |
| 101 | * @set_wake: enable/disable power-management wake-on of an IRQ | 103 | * @set_wake: enable/disable power-management wake-on of an IRQ |
| 102 | * | 104 | * |
| 105 | * @bus_lock: function to lock access to slow bus (i2c) chips | ||
| 106 | * @bus_sync_unlock: function to sync and unlock slow bus (i2c) chips | ||
| 107 | * | ||
| 103 | * @release: release function solely used by UML | 108 | * @release: release function solely used by UML |
| 104 | * @typename: obsoleted by name, kept as migration helper | 109 | * @typename: obsoleted by name, kept as migration helper |
| 105 | */ | 110 | */ |
| @@ -123,6 +128,9 @@ struct irq_chip { | |||
| 123 | int (*set_type)(unsigned int irq, unsigned int flow_type); | 128 | int (*set_type)(unsigned int irq, unsigned int flow_type); |
| 124 | int (*set_wake)(unsigned int irq, unsigned int on); | 129 | int (*set_wake)(unsigned int irq, unsigned int on); |
| 125 | 130 | ||
| 131 | void (*bus_lock)(unsigned int irq); | ||
| 132 | void (*bus_sync_unlock)(unsigned int irq); | ||
| 133 | |||
| 126 | /* Currently used only by UML, might disappear one day.*/ | 134 | /* Currently used only by UML, might disappear one day.*/ |
| 127 | #ifdef CONFIG_IRQ_RELEASE_METHOD | 135 | #ifdef CONFIG_IRQ_RELEASE_METHOD |
| 128 | void (*release)(unsigned int irq, void *dev_id); | 136 | void (*release)(unsigned int irq, void *dev_id); |
| @@ -220,13 +228,6 @@ static inline struct irq_desc *move_irq_desc(struct irq_desc *desc, int node) | |||
| 220 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); | 228 | extern struct irq_desc *irq_to_desc_alloc_node(unsigned int irq, int node); |
| 221 | 229 | ||
| 222 | /* | 230 | /* |
| 223 | * Migration helpers for obsolete names, they will go away: | ||
| 224 | */ | ||
| 225 | #define hw_interrupt_type irq_chip | ||
| 226 | #define no_irq_type no_irq_chip | ||
| 227 | typedef struct irq_desc irq_desc_t; | ||
| 228 | |||
| 229 | /* | ||
| 230 | * Pick up the arch-dependent methods: | 231 | * Pick up the arch-dependent methods: |
| 231 | */ | 232 | */ |
| 232 | #include <asm/hw_irq.h> | 233 | #include <asm/hw_irq.h> |
| @@ -289,6 +290,7 @@ extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc); | |||
| 289 | extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); | 290 | extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); |
| 290 | extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); | 291 | extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); |
| 291 | extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); | 292 | extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); |
| 293 | extern void handle_nested_irq(unsigned int irq); | ||
| 292 | 294 | ||
| 293 | /* | 295 | /* |
| 294 | * Monolithic do_IRQ implementation. | 296 | * Monolithic do_IRQ implementation. |
| @@ -379,6 +381,8 @@ set_irq_chained_handler(unsigned int irq, | |||
| 379 | __set_irq_handler(irq, handle, 1, NULL); | 381 | __set_irq_handler(irq, handle, 1, NULL); |
| 380 | } | 382 | } |
| 381 | 383 | ||
| 384 | extern void set_irq_nested_thread(unsigned int irq, int nest); | ||
| 385 | |||
| 382 | extern void set_irq_noprobe(unsigned int irq); | 386 | extern void set_irq_noprobe(unsigned int irq); |
| 383 | extern void set_irq_probe(unsigned int irq); | 387 | extern void set_irq_probe(unsigned int irq); |
| 384 | 388 | ||
diff --git a/include/linux/irqnr.h b/include/linux/irqnr.h index ec87b212ff7d..7bf89bc8cbca 100644 --- a/include/linux/irqnr.h +++ b/include/linux/irqnr.h | |||
| @@ -41,6 +41,12 @@ extern struct irq_desc *irq_to_desc(unsigned int irq); | |||
| 41 | ; \ | 41 | ; \ |
| 42 | else | 42 | else |
| 43 | 43 | ||
| 44 | #ifdef CONFIG_SMP | ||
| 45 | #define irq_node(irq) (irq_to_desc(irq)->node) | ||
| 46 | #else | ||
| 47 | #define irq_node(irq) 0 | ||
| 48 | #endif | ||
| 49 | |||
| 44 | #endif /* CONFIG_GENERIC_HARDIRQS */ | 50 | #endif /* CONFIG_GENERIC_HARDIRQS */ |
| 45 | 51 | ||
| 46 | #define for_each_irq_nr(irq) \ | 52 | #define for_each_irq_nr(irq) \ |
diff --git a/include/linux/isdn/hdlc.h b/include/linux/isdn/hdlc.h new file mode 100644 index 000000000000..4b3ecc40889a --- /dev/null +++ b/include/linux/isdn/hdlc.h | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* | ||
| 2 | * hdlc.h -- General purpose ISDN HDLC decoder. | ||
| 3 | * | ||
| 4 | * Implementation of a HDLC decoder/encoder in software. | ||
| 5 | * Neccessary because some ISDN devices don't have HDLC | ||
| 6 | * controllers. | ||
| 7 | * | ||
| 8 | * Copyright (C) | ||
| 9 | * 2009 Karsten Keil <keil@b1-systems.de> | ||
| 10 | * 2002 Wolfgang Mües <wolfgang@iksw-muees.de> | ||
| 11 | * 2001 Frode Isaksen <fisaksen@bewan.com> | ||
| 12 | * 2001 Kai Germaschewski <kai.germaschewski@gmx.de> | ||
| 13 | * | ||
| 14 | * This program is free software; you can redistribute it and/or modify | ||
| 15 | * it under the terms of the GNU General Public License as published by | ||
| 16 | * the Free Software Foundation; either version 2 of the License, or | ||
| 17 | * (at your option) any later version. | ||
| 18 | * | ||
| 19 | * This program is distributed in the hope that it will be useful, | ||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 22 | * GNU General Public License for more details. | ||
| 23 | * | ||
| 24 | * You should have received a copy of the GNU General Public License | ||
| 25 | * along with this program; if not, write to the Free Software | ||
| 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 27 | */ | ||
| 28 | |||
| 29 | #ifndef __ISDNHDLC_H__ | ||
| 30 | #define __ISDNHDLC_H__ | ||
| 31 | |||
| 32 | struct isdnhdlc_vars { | ||
| 33 | int bit_shift; | ||
| 34 | int hdlc_bits1; | ||
| 35 | int data_bits; | ||
| 36 | int ffbit_shift; /* encoding only */ | ||
| 37 | int state; | ||
| 38 | int dstpos; | ||
| 39 | |||
| 40 | u16 crc; | ||
| 41 | |||
| 42 | u8 cbin; | ||
| 43 | u8 shift_reg; | ||
| 44 | u8 ffvalue; | ||
| 45 | |||
| 46 | /* set if transferring data */ | ||
| 47 | u32 data_received:1; | ||
| 48 | /* set if D channel (send idle instead of flags) */ | ||
| 49 | u32 dchannel:1; | ||
| 50 | /* set if 56K adaptation */ | ||
| 51 | u32 do_adapt56:1; | ||
| 52 | /* set if in closing phase (need to send CRC + flag) */ | ||
| 53 | u32 do_closing:1; | ||
| 54 | /* set if data is bitreverse */ | ||
| 55 | u32 do_bitreverse:1; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /* Feature Flags */ | ||
| 59 | #define HDLC_56KBIT 0x01 | ||
| 60 | #define HDLC_DCHANNEL 0x02 | ||
| 61 | #define HDLC_BITREVERSE 0x04 | ||
| 62 | |||
| 63 | /* | ||
| 64 | The return value from isdnhdlc_decode is | ||
| 65 | the frame length, 0 if no complete frame was decoded, | ||
| 66 | or a negative error number | ||
| 67 | */ | ||
| 68 | #define HDLC_FRAMING_ERROR 1 | ||
| 69 | #define HDLC_CRC_ERROR 2 | ||
| 70 | #define HDLC_LENGTH_ERROR 3 | ||
| 71 | |||
| 72 | extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features); | ||
| 73 | |||
| 74 | extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src, | ||
| 75 | int slen, int *count, u8 *dst, int dsize); | ||
| 76 | |||
| 77 | extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features); | ||
| 78 | |||
| 79 | extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src, | ||
| 80 | u16 slen, int *count, u8 *dst, int dsize); | ||
| 81 | |||
| 82 | #endif /* __ISDNHDLC_H__ */ | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d6320a3e8def..2b5b1e0899a8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -125,7 +125,7 @@ extern int _cond_resched(void); | |||
| 125 | #endif | 125 | #endif |
| 126 | 126 | ||
| 127 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | 127 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP |
| 128 | void __might_sleep(char *file, int line); | 128 | void __might_sleep(char *file, int line, int preempt_offset); |
| 129 | /** | 129 | /** |
| 130 | * might_sleep - annotation for functions that can sleep | 130 | * might_sleep - annotation for functions that can sleep |
| 131 | * | 131 | * |
| @@ -137,8 +137,9 @@ extern int _cond_resched(void); | |||
| 137 | * supposed to. | 137 | * supposed to. |
| 138 | */ | 138 | */ |
| 139 | # define might_sleep() \ | 139 | # define might_sleep() \ |
| 140 | do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) | 140 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) |
| 141 | #else | 141 | #else |
| 142 | static inline void __might_sleep(char *file, int line, int preempt_offset) { } | ||
| 142 | # define might_sleep() do { might_resched(); } while (0) | 143 | # define might_sleep() do { might_resched(); } while (0) |
| 143 | #endif | 144 | #endif |
| 144 | 145 | ||
diff --git a/include/linux/key.h b/include/linux/key.h index e544f466d69a..cd50dfa1d4c2 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
| @@ -129,7 +129,10 @@ struct key { | |||
| 129 | struct rw_semaphore sem; /* change vs change sem */ | 129 | struct rw_semaphore sem; /* change vs change sem */ |
| 130 | struct key_user *user; /* owner of this key */ | 130 | struct key_user *user; /* owner of this key */ |
| 131 | void *security; /* security data for this key */ | 131 | void *security; /* security data for this key */ |
| 132 | time_t expiry; /* time at which key expires (or 0) */ | 132 | union { |
| 133 | time_t expiry; /* time at which key expires (or 0) */ | ||
| 134 | time_t revoked_at; /* time at which key was revoked */ | ||
| 135 | }; | ||
| 133 | uid_t uid; | 136 | uid_t uid; |
| 134 | gid_t gid; | 137 | gid_t gid; |
| 135 | key_perm_t perm; /* access permissions */ | 138 | key_perm_t perm; /* access permissions */ |
| @@ -275,6 +278,8 @@ static inline key_serial_t key_serial(struct key *key) | |||
| 275 | extern ctl_table key_sysctls[]; | 278 | extern ctl_table key_sysctls[]; |
| 276 | #endif | 279 | #endif |
| 277 | 280 | ||
| 281 | extern void key_replace_session_keyring(void); | ||
| 282 | |||
| 278 | /* | 283 | /* |
| 279 | * the userspace interface | 284 | * the userspace interface |
| 280 | */ | 285 | */ |
| @@ -297,6 +302,7 @@ extern void key_init(void); | |||
| 297 | #define key_fsuid_changed(t) do { } while(0) | 302 | #define key_fsuid_changed(t) do { } while(0) |
| 298 | #define key_fsgid_changed(t) do { } while(0) | 303 | #define key_fsgid_changed(t) do { } while(0) |
| 299 | #define key_init() do { } while(0) | 304 | #define key_init() do { } while(0) |
| 305 | #define key_replace_session_keyring() do { } while(0) | ||
| 300 | 306 | ||
| 301 | #endif /* CONFIG_KEYS */ | 307 | #endif /* CONFIG_KEYS */ |
| 302 | #endif /* __KERNEL__ */ | 308 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/keyctl.h b/include/linux/keyctl.h index c0688eb72093..bd383f1944fb 100644 --- a/include/linux/keyctl.h +++ b/include/linux/keyctl.h | |||
| @@ -52,5 +52,6 @@ | |||
| 52 | #define KEYCTL_SET_TIMEOUT 15 /* set key timeout */ | 52 | #define KEYCTL_SET_TIMEOUT 15 /* set key timeout */ |
| 53 | #define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */ | 53 | #define KEYCTL_ASSUME_AUTHORITY 16 /* assume request_key() authorisation */ |
| 54 | #define KEYCTL_GET_SECURITY 17 /* get key security label */ | 54 | #define KEYCTL_GET_SECURITY 17 /* get key security label */ |
| 55 | #define KEYCTL_SESSION_TO_PARENT 18 /* apply session keyring to parent process */ | ||
| 55 | 56 | ||
| 56 | #endif /* _LINUX_KEYCTL_H */ | 57 | #endif /* _LINUX_KEYCTL_H */ |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index 47b39b7c7e84..dc2fd545db00 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
| @@ -34,6 +34,8 @@ void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n); | |||
| 34 | int kmemcheck_show_addr(unsigned long address); | 34 | int kmemcheck_show_addr(unsigned long address); |
| 35 | int kmemcheck_hide_addr(unsigned long address); | 35 | int kmemcheck_hide_addr(unsigned long address); |
| 36 | 36 | ||
| 37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | ||
| 38 | |||
| 37 | #else | 39 | #else |
| 38 | #define kmemcheck_enabled 0 | 40 | #define kmemcheck_enabled 0 |
| 39 | 41 | ||
| @@ -99,6 +101,11 @@ static inline void kmemcheck_mark_initialized_pages(struct page *p, | |||
| 99 | { | 101 | { |
| 100 | } | 102 | } |
| 101 | 103 | ||
| 104 | static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | ||
| 105 | { | ||
| 106 | return true; | ||
| 107 | } | ||
| 108 | |||
| 102 | #endif /* CONFIG_KMEMCHECK */ | 109 | #endif /* CONFIG_KMEMCHECK */ |
| 103 | 110 | ||
| 104 | /* | 111 | /* |
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 6a63807f714e..3c7497d46ee9 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
| @@ -23,18 +23,18 @@ | |||
| 23 | 23 | ||
| 24 | #ifdef CONFIG_DEBUG_KMEMLEAK | 24 | #ifdef CONFIG_DEBUG_KMEMLEAK |
| 25 | 25 | ||
| 26 | extern void kmemleak_init(void); | 26 | extern void kmemleak_init(void) __ref; |
| 27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, | 27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, |
| 28 | gfp_t gfp); | 28 | gfp_t gfp) __ref; |
| 29 | extern void kmemleak_free(const void *ptr); | 29 | extern void kmemleak_free(const void *ptr) __ref; |
| 30 | extern void kmemleak_free_part(const void *ptr, size_t size); | 30 | extern void kmemleak_free_part(const void *ptr, size_t size) __ref; |
| 31 | extern void kmemleak_padding(const void *ptr, unsigned long offset, | 31 | extern void kmemleak_padding(const void *ptr, unsigned long offset, |
| 32 | size_t size); | 32 | size_t size) __ref; |
| 33 | extern void kmemleak_not_leak(const void *ptr); | 33 | extern void kmemleak_not_leak(const void *ptr) __ref; |
| 34 | extern void kmemleak_ignore(const void *ptr); | 34 | extern void kmemleak_ignore(const void *ptr) __ref; |
| 35 | extern void kmemleak_scan_area(const void *ptr, unsigned long offset, | 35 | extern void kmemleak_scan_area(const void *ptr, unsigned long offset, |
| 36 | size_t length, gfp_t gfp); | 36 | size_t length, gfp_t gfp) __ref; |
| 37 | extern void kmemleak_no_scan(const void *ptr); | 37 | extern void kmemleak_no_scan(const void *ptr) __ref; |
| 38 | 38 | ||
| 39 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | 39 | static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, |
| 40 | int min_count, unsigned long flags, | 40 | int min_count, unsigned long flags, |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 3db5d8d37485..f8f8900fc5ec 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
| @@ -14,7 +14,7 @@ | |||
| 14 | 14 | ||
| 15 | #define KVM_API_VERSION 12 | 15 | #define KVM_API_VERSION 12 |
| 16 | 16 | ||
| 17 | /* for KVM_TRACE_ENABLE */ | 17 | /* for KVM_TRACE_ENABLE, deprecated */ |
| 18 | struct kvm_user_trace_setup { | 18 | struct kvm_user_trace_setup { |
| 19 | __u32 buf_size; /* sub_buffer size of each per-cpu */ | 19 | __u32 buf_size; /* sub_buffer size of each per-cpu */ |
| 20 | __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ | 20 | __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ |
| @@ -70,6 +70,14 @@ struct kvm_irqchip { | |||
| 70 | } chip; | 70 | } chip; |
| 71 | }; | 71 | }; |
| 72 | 72 | ||
| 73 | /* for KVM_CREATE_PIT2 */ | ||
| 74 | struct kvm_pit_config { | ||
| 75 | __u32 flags; | ||
| 76 | __u32 pad[15]; | ||
| 77 | }; | ||
| 78 | |||
| 79 | #define KVM_PIT_SPEAKER_DUMMY 1 | ||
| 80 | |||
| 73 | #define KVM_EXIT_UNKNOWN 0 | 81 | #define KVM_EXIT_UNKNOWN 0 |
| 74 | #define KVM_EXIT_EXCEPTION 1 | 82 | #define KVM_EXIT_EXCEPTION 1 |
| 75 | #define KVM_EXIT_IO 2 | 83 | #define KVM_EXIT_IO 2 |
| @@ -87,6 +95,10 @@ struct kvm_irqchip { | |||
| 87 | #define KVM_EXIT_S390_RESET 14 | 95 | #define KVM_EXIT_S390_RESET 14 |
| 88 | #define KVM_EXIT_DCR 15 | 96 | #define KVM_EXIT_DCR 15 |
| 89 | #define KVM_EXIT_NMI 16 | 97 | #define KVM_EXIT_NMI 16 |
| 98 | #define KVM_EXIT_INTERNAL_ERROR 17 | ||
| 99 | |||
| 100 | /* For KVM_EXIT_INTERNAL_ERROR */ | ||
| 101 | #define KVM_INTERNAL_ERROR_EMULATION 1 | ||
| 90 | 102 | ||
| 91 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 103 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
| 92 | struct kvm_run { | 104 | struct kvm_run { |
| @@ -173,6 +185,9 @@ struct kvm_run { | |||
| 173 | __u32 data; | 185 | __u32 data; |
| 174 | __u8 is_write; | 186 | __u8 is_write; |
| 175 | } dcr; | 187 | } dcr; |
| 188 | struct { | ||
| 189 | __u32 suberror; | ||
| 190 | } internal; | ||
| 176 | /* Fix the size of the union. */ | 191 | /* Fix the size of the union. */ |
| 177 | char padding[256]; | 192 | char padding[256]; |
| 178 | }; | 193 | }; |
| @@ -292,6 +307,28 @@ struct kvm_guest_debug { | |||
| 292 | struct kvm_guest_debug_arch arch; | 307 | struct kvm_guest_debug_arch arch; |
| 293 | }; | 308 | }; |
| 294 | 309 | ||
| 310 | enum { | ||
| 311 | kvm_ioeventfd_flag_nr_datamatch, | ||
| 312 | kvm_ioeventfd_flag_nr_pio, | ||
| 313 | kvm_ioeventfd_flag_nr_deassign, | ||
| 314 | kvm_ioeventfd_flag_nr_max, | ||
| 315 | }; | ||
| 316 | |||
| 317 | #define KVM_IOEVENTFD_FLAG_DATAMATCH (1 << kvm_ioeventfd_flag_nr_datamatch) | ||
| 318 | #define KVM_IOEVENTFD_FLAG_PIO (1 << kvm_ioeventfd_flag_nr_pio) | ||
| 319 | #define KVM_IOEVENTFD_FLAG_DEASSIGN (1 << kvm_ioeventfd_flag_nr_deassign) | ||
| 320 | |||
| 321 | #define KVM_IOEVENTFD_VALID_FLAG_MASK ((1 << kvm_ioeventfd_flag_nr_max) - 1) | ||
| 322 | |||
| 323 | struct kvm_ioeventfd { | ||
| 324 | __u64 datamatch; | ||
| 325 | __u64 addr; /* legal pio/mmio address */ | ||
| 326 | __u32 len; /* 1, 2, 4, or 8 bytes */ | ||
| 327 | __s32 fd; | ||
| 328 | __u32 flags; | ||
| 329 | __u8 pad[36]; | ||
| 330 | }; | ||
| 331 | |||
| 295 | #define KVM_TRC_SHIFT 16 | 332 | #define KVM_TRC_SHIFT 16 |
| 296 | /* | 333 | /* |
| 297 | * kvm trace categories | 334 | * kvm trace categories |
| @@ -310,35 +347,6 @@ struct kvm_guest_debug { | |||
| 310 | #define KVM_TRC_CYCLE_SIZE 8 | 347 | #define KVM_TRC_CYCLE_SIZE 8 |
| 311 | #define KVM_TRC_EXTRA_MAX 7 | 348 | #define KVM_TRC_EXTRA_MAX 7 |
| 312 | 349 | ||
| 313 | /* This structure represents a single trace buffer record. */ | ||
| 314 | struct kvm_trace_rec { | ||
| 315 | /* variable rec_val | ||
| 316 | * is split into: | ||
| 317 | * bits 0 - 27 -> event id | ||
| 318 | * bits 28 -30 -> number of extra data args of size u32 | ||
| 319 | * bits 31 -> binary indicator for if tsc is in record | ||
| 320 | */ | ||
| 321 | __u32 rec_val; | ||
| 322 | __u32 pid; | ||
| 323 | __u32 vcpu_id; | ||
| 324 | union { | ||
| 325 | struct { | ||
| 326 | __u64 timestamp; | ||
| 327 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | ||
| 328 | } __attribute__((packed)) timestamp; | ||
| 329 | struct { | ||
| 330 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | ||
| 331 | } notimestamp; | ||
| 332 | } u; | ||
| 333 | }; | ||
| 334 | |||
| 335 | #define TRACE_REC_EVENT_ID(val) \ | ||
| 336 | (0x0fffffff & (val)) | ||
| 337 | #define TRACE_REC_NUM_DATA_ARGS(val) \ | ||
| 338 | (0x70000000 & ((val) << 28)) | ||
| 339 | #define TRACE_REC_TCS(val) \ | ||
| 340 | (0x80000000 & ((val) << 31)) | ||
| 341 | |||
| 342 | #define KVMIO 0xAE | 350 | #define KVMIO 0xAE |
| 343 | 351 | ||
| 344 | /* | 352 | /* |
| @@ -415,6 +423,19 @@ struct kvm_trace_rec { | |||
| 415 | #define KVM_CAP_ASSIGN_DEV_IRQ 29 | 423 | #define KVM_CAP_ASSIGN_DEV_IRQ 29 |
| 416 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ | 424 | /* Another bug in KVM_SET_USER_MEMORY_REGION fixed: */ |
| 417 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 | 425 | #define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 |
| 426 | #ifdef __KVM_HAVE_MCE | ||
| 427 | #define KVM_CAP_MCE 31 | ||
| 428 | #endif | ||
| 429 | #define KVM_CAP_IRQFD 32 | ||
| 430 | #ifdef __KVM_HAVE_PIT | ||
| 431 | #define KVM_CAP_PIT2 33 | ||
| 432 | #endif | ||
| 433 | #define KVM_CAP_SET_BOOT_CPU_ID 34 | ||
| 434 | #ifdef __KVM_HAVE_PIT_STATE2 | ||
| 435 | #define KVM_CAP_PIT_STATE2 35 | ||
| 436 | #endif | ||
| 437 | #define KVM_CAP_IOEVENTFD 36 | ||
| 438 | #define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 | ||
| 418 | 439 | ||
| 419 | #ifdef KVM_CAP_IRQ_ROUTING | 440 | #ifdef KVM_CAP_IRQ_ROUTING |
| 420 | 441 | ||
| @@ -454,15 +475,32 @@ struct kvm_irq_routing { | |||
| 454 | 475 | ||
| 455 | #endif | 476 | #endif |
| 456 | 477 | ||
| 478 | #ifdef KVM_CAP_MCE | ||
| 479 | /* x86 MCE */ | ||
| 480 | struct kvm_x86_mce { | ||
| 481 | __u64 status; | ||
| 482 | __u64 addr; | ||
| 483 | __u64 misc; | ||
| 484 | __u64 mcg_status; | ||
| 485 | __u8 bank; | ||
| 486 | __u8 pad1[7]; | ||
| 487 | __u64 pad2[3]; | ||
| 488 | }; | ||
| 489 | #endif | ||
| 490 | |||
| 491 | #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) | ||
| 492 | |||
| 493 | struct kvm_irqfd { | ||
| 494 | __u32 fd; | ||
| 495 | __u32 gsi; | ||
| 496 | __u32 flags; | ||
| 497 | __u8 pad[20]; | ||
| 498 | }; | ||
| 499 | |||
| 457 | /* | 500 | /* |
| 458 | * ioctls for VM fds | 501 | * ioctls for VM fds |
| 459 | */ | 502 | */ |
| 460 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) | 503 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) |
| 461 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) | ||
| 462 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) | ||
| 463 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ | ||
| 464 | struct kvm_userspace_memory_region) | ||
| 465 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) | ||
| 466 | /* | 504 | /* |
| 467 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns | 505 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns |
| 468 | * a vcpu fd. | 506 | * a vcpu fd. |
| @@ -470,6 +508,12 @@ struct kvm_irq_routing { | |||
| 470 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) | 508 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) |
| 471 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) | 509 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) |
| 472 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) | 510 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) |
| 511 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) | ||
| 512 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) | ||
| 513 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ | ||
| 514 | struct kvm_userspace_memory_region) | ||
| 515 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) | ||
| 516 | #define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) | ||
| 473 | /* Device model IOC */ | 517 | /* Device model IOC */ |
| 474 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) | 518 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) |
| 475 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) | 519 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) |
| @@ -498,6 +542,10 @@ struct kvm_irq_routing { | |||
| 498 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ | 542 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ |
| 499 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) | 543 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) |
| 500 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) | 544 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) |
| 545 | #define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) | ||
| 546 | #define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) | ||
| 547 | #define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) | ||
| 548 | #define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) | ||
| 501 | 549 | ||
| 502 | /* | 550 | /* |
| 503 | * ioctls for vcpu fds | 551 | * ioctls for vcpu fds |
| @@ -541,6 +589,10 @@ struct kvm_irq_routing { | |||
| 541 | #define KVM_NMI _IO(KVMIO, 0x9a) | 589 | #define KVM_NMI _IO(KVMIO, 0x9a) |
| 542 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ | 590 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ |
| 543 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) | 591 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) |
| 592 | /* MCE for x86 */ | ||
| 593 | #define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) | ||
| 594 | #define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) | ||
| 595 | #define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) | ||
| 544 | 596 | ||
| 545 | /* | 597 | /* |
| 546 | * Deprecated interfaces | 598 | * Deprecated interfaces |
| @@ -563,6 +615,9 @@ struct kvm_debug_guest { | |||
| 563 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) | 615 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) |
| 564 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) | 616 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) |
| 565 | 617 | ||
| 618 | #define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) | ||
| 619 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) | ||
| 620 | |||
| 566 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | 621 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) |
| 567 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | 622 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) |
| 568 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | 623 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) |
| @@ -633,7 +688,7 @@ struct kvm_assigned_msix_nr { | |||
| 633 | __u16 padding; | 688 | __u16 padding; |
| 634 | }; | 689 | }; |
| 635 | 690 | ||
| 636 | #define KVM_MAX_MSIX_PER_DEV 512 | 691 | #define KVM_MAX_MSIX_PER_DEV 256 |
| 637 | struct kvm_assigned_msix_entry { | 692 | struct kvm_assigned_msix_entry { |
| 638 | __u32 assigned_dev_id; | 693 | __u32 assigned_dev_id; |
| 639 | __u32 gsi; | 694 | __u32 gsi; |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 16713dc672e4..4af56036a6bf 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
| @@ -42,6 +42,7 @@ | |||
| 42 | 42 | ||
| 43 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 | 43 | #define KVM_USERSPACE_IRQ_SOURCE_ID 0 |
| 44 | 44 | ||
| 45 | struct kvm; | ||
| 45 | struct kvm_vcpu; | 46 | struct kvm_vcpu; |
| 46 | extern struct kmem_cache *kvm_vcpu_cache; | 47 | extern struct kmem_cache *kvm_vcpu_cache; |
| 47 | 48 | ||
| @@ -59,10 +60,18 @@ struct kvm_io_bus { | |||
| 59 | 60 | ||
| 60 | void kvm_io_bus_init(struct kvm_io_bus *bus); | 61 | void kvm_io_bus_init(struct kvm_io_bus *bus); |
| 61 | void kvm_io_bus_destroy(struct kvm_io_bus *bus); | 62 | void kvm_io_bus_destroy(struct kvm_io_bus *bus); |
| 62 | struct kvm_io_device *kvm_io_bus_find_dev(struct kvm_io_bus *bus, | 63 | int kvm_io_bus_write(struct kvm_io_bus *bus, gpa_t addr, int len, |
| 63 | gpa_t addr, int len, int is_write); | 64 | const void *val); |
| 64 | void kvm_io_bus_register_dev(struct kvm_io_bus *bus, | 65 | int kvm_io_bus_read(struct kvm_io_bus *bus, gpa_t addr, int len, |
| 65 | struct kvm_io_device *dev); | 66 | void *val); |
| 67 | int __kvm_io_bus_register_dev(struct kvm_io_bus *bus, | ||
| 68 | struct kvm_io_device *dev); | ||
| 69 | int kvm_io_bus_register_dev(struct kvm *kvm, struct kvm_io_bus *bus, | ||
| 70 | struct kvm_io_device *dev); | ||
| 71 | void __kvm_io_bus_unregister_dev(struct kvm_io_bus *bus, | ||
| 72 | struct kvm_io_device *dev); | ||
| 73 | void kvm_io_bus_unregister_dev(struct kvm *kvm, struct kvm_io_bus *bus, | ||
| 74 | struct kvm_io_device *dev); | ||
| 66 | 75 | ||
| 67 | struct kvm_vcpu { | 76 | struct kvm_vcpu { |
| 68 | struct kvm *kvm; | 77 | struct kvm *kvm; |
| @@ -103,13 +112,14 @@ struct kvm_memory_slot { | |||
| 103 | struct { | 112 | struct { |
| 104 | unsigned long rmap_pde; | 113 | unsigned long rmap_pde; |
| 105 | int write_count; | 114 | int write_count; |
| 106 | } *lpage_info; | 115 | } *lpage_info[KVM_NR_PAGE_SIZES - 1]; |
| 107 | unsigned long userspace_addr; | 116 | unsigned long userspace_addr; |
| 108 | int user_alloc; | 117 | int user_alloc; |
| 109 | }; | 118 | }; |
| 110 | 119 | ||
| 111 | struct kvm_kernel_irq_routing_entry { | 120 | struct kvm_kernel_irq_routing_entry { |
| 112 | u32 gsi; | 121 | u32 gsi; |
| 122 | u32 type; | ||
| 113 | int (*set)(struct kvm_kernel_irq_routing_entry *e, | 123 | int (*set)(struct kvm_kernel_irq_routing_entry *e, |
| 114 | struct kvm *kvm, int level); | 124 | struct kvm *kvm, int level); |
| 115 | union { | 125 | union { |
| @@ -123,7 +133,6 @@ struct kvm_kernel_irq_routing_entry { | |||
| 123 | }; | 133 | }; |
| 124 | 134 | ||
| 125 | struct kvm { | 135 | struct kvm { |
| 126 | struct mutex lock; /* protects the vcpus array and APIC accesses */ | ||
| 127 | spinlock_t mmu_lock; | 136 | spinlock_t mmu_lock; |
| 128 | spinlock_t requests_lock; | 137 | spinlock_t requests_lock; |
| 129 | struct rw_semaphore slots_lock; | 138 | struct rw_semaphore slots_lock; |
| @@ -131,10 +140,23 @@ struct kvm { | |||
| 131 | int nmemslots; | 140 | int nmemslots; |
| 132 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + | 141 | struct kvm_memory_slot memslots[KVM_MEMORY_SLOTS + |
| 133 | KVM_PRIVATE_MEM_SLOTS]; | 142 | KVM_PRIVATE_MEM_SLOTS]; |
| 143 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | ||
| 144 | u32 bsp_vcpu_id; | ||
| 145 | struct kvm_vcpu *bsp_vcpu; | ||
| 146 | #endif | ||
| 134 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; | 147 | struct kvm_vcpu *vcpus[KVM_MAX_VCPUS]; |
| 148 | atomic_t online_vcpus; | ||
| 135 | struct list_head vm_list; | 149 | struct list_head vm_list; |
| 150 | struct mutex lock; | ||
| 136 | struct kvm_io_bus mmio_bus; | 151 | struct kvm_io_bus mmio_bus; |
| 137 | struct kvm_io_bus pio_bus; | 152 | struct kvm_io_bus pio_bus; |
| 153 | #ifdef CONFIG_HAVE_KVM_EVENTFD | ||
| 154 | struct { | ||
| 155 | spinlock_t lock; | ||
| 156 | struct list_head items; | ||
| 157 | } irqfds; | ||
| 158 | struct list_head ioeventfds; | ||
| 159 | #endif | ||
| 138 | struct kvm_vm_stat stat; | 160 | struct kvm_vm_stat stat; |
| 139 | struct kvm_arch arch; | 161 | struct kvm_arch arch; |
| 140 | atomic_t users_count; | 162 | atomic_t users_count; |
| @@ -143,6 +165,7 @@ struct kvm { | |||
| 143 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; | 165 | struct kvm_coalesced_mmio_ring *coalesced_mmio_ring; |
| 144 | #endif | 166 | #endif |
| 145 | 167 | ||
| 168 | struct mutex irq_lock; | ||
| 146 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 169 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
| 147 | struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ | 170 | struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ |
| 148 | struct hlist_head mask_notifier_list; | 171 | struct hlist_head mask_notifier_list; |
| @@ -166,6 +189,17 @@ struct kvm { | |||
| 166 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) | 189 | #define kvm_printf(kvm, fmt ...) printk(KERN_DEBUG fmt) |
| 167 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) | 190 | #define vcpu_printf(vcpu, fmt...) kvm_printf(vcpu->kvm, fmt) |
| 168 | 191 | ||
| 192 | static inline struct kvm_vcpu *kvm_get_vcpu(struct kvm *kvm, int i) | ||
| 193 | { | ||
| 194 | smp_rmb(); | ||
| 195 | return kvm->vcpus[i]; | ||
| 196 | } | ||
| 197 | |||
| 198 | #define kvm_for_each_vcpu(idx, vcpup, kvm) \ | ||
| 199 | for (idx = 0, vcpup = kvm_get_vcpu(kvm, idx); \ | ||
| 200 | idx < atomic_read(&kvm->online_vcpus) && vcpup; \ | ||
| 201 | vcpup = kvm_get_vcpu(kvm, ++idx)) | ||
| 202 | |||
| 169 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); | 203 | int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id); |
| 170 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); | 204 | void kvm_vcpu_uninit(struct kvm_vcpu *vcpu); |
| 171 | 205 | ||
| @@ -200,6 +234,7 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
| 200 | struct kvm_userspace_memory_region *mem, | 234 | struct kvm_userspace_memory_region *mem, |
| 201 | struct kvm_memory_slot old, | 235 | struct kvm_memory_slot old, |
| 202 | int user_alloc); | 236 | int user_alloc); |
| 237 | void kvm_disable_largepages(void); | ||
| 203 | void kvm_arch_flush_shadow(struct kvm *kvm); | 238 | void kvm_arch_flush_shadow(struct kvm *kvm); |
| 204 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); | 239 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn); |
| 205 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); | 240 | struct page *gfn_to_page(struct kvm *kvm, gfn_t gfn); |
| @@ -242,8 +277,6 @@ long kvm_arch_dev_ioctl(struct file *filp, | |||
| 242 | unsigned int ioctl, unsigned long arg); | 277 | unsigned int ioctl, unsigned long arg); |
| 243 | long kvm_arch_vcpu_ioctl(struct file *filp, | 278 | long kvm_arch_vcpu_ioctl(struct file *filp, |
| 244 | unsigned int ioctl, unsigned long arg); | 279 | unsigned int ioctl, unsigned long arg); |
| 245 | void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu); | ||
| 246 | void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu); | ||
| 247 | 280 | ||
| 248 | int kvm_dev_ioctl_check_extension(long ext); | 281 | int kvm_dev_ioctl_check_extension(long ext); |
| 249 | 282 | ||
| @@ -299,7 +332,6 @@ int kvm_arch_hardware_setup(void); | |||
| 299 | void kvm_arch_hardware_unsetup(void); | 332 | void kvm_arch_hardware_unsetup(void); |
| 300 | void kvm_arch_check_processor_compat(void *rtn); | 333 | void kvm_arch_check_processor_compat(void *rtn); |
| 301 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); | 334 | int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu); |
| 302 | int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); | ||
| 303 | 335 | ||
| 304 | void kvm_free_physmem(struct kvm *kvm); | 336 | void kvm_free_physmem(struct kvm *kvm); |
| 305 | 337 | ||
| @@ -308,8 +340,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm); | |||
| 308 | void kvm_free_all_assigned_devices(struct kvm *kvm); | 340 | void kvm_free_all_assigned_devices(struct kvm *kvm); |
| 309 | void kvm_arch_sync_events(struct kvm *kvm); | 341 | void kvm_arch_sync_events(struct kvm *kvm); |
| 310 | 342 | ||
| 311 | int kvm_cpu_get_interrupt(struct kvm_vcpu *v); | ||
| 312 | int kvm_cpu_has_interrupt(struct kvm_vcpu *v); | ||
| 313 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); | 343 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu); |
| 314 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 344 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
| 315 | 345 | ||
| @@ -365,7 +395,8 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | |||
| 365 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 395 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
| 366 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 396 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
| 367 | struct kvm_irq_ack_notifier *kian); | 397 | struct kvm_irq_ack_notifier *kian); |
| 368 | void kvm_unregister_irq_ack_notifier(struct kvm_irq_ack_notifier *kian); | 398 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, |
| 399 | struct kvm_irq_ack_notifier *kian); | ||
| 369 | int kvm_request_irq_source_id(struct kvm *kvm); | 400 | int kvm_request_irq_source_id(struct kvm *kvm); |
| 370 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | 401 | void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); |
| 371 | 402 | ||
| @@ -458,37 +489,6 @@ struct kvm_stats_debugfs_item { | |||
| 458 | extern struct kvm_stats_debugfs_item debugfs_entries[]; | 489 | extern struct kvm_stats_debugfs_item debugfs_entries[]; |
| 459 | extern struct dentry *kvm_debugfs_dir; | 490 | extern struct dentry *kvm_debugfs_dir; |
| 460 | 491 | ||
| 461 | #define KVMTRACE_5D(evt, vcpu, d1, d2, d3, d4, d5, name) \ | ||
| 462 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 463 | vcpu, 5, d1, d2, d3, d4, d5) | ||
| 464 | #define KVMTRACE_4D(evt, vcpu, d1, d2, d3, d4, name) \ | ||
| 465 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 466 | vcpu, 4, d1, d2, d3, d4, 0) | ||
| 467 | #define KVMTRACE_3D(evt, vcpu, d1, d2, d3, name) \ | ||
| 468 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 469 | vcpu, 3, d1, d2, d3, 0, 0) | ||
| 470 | #define KVMTRACE_2D(evt, vcpu, d1, d2, name) \ | ||
| 471 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 472 | vcpu, 2, d1, d2, 0, 0, 0) | ||
| 473 | #define KVMTRACE_1D(evt, vcpu, d1, name) \ | ||
| 474 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 475 | vcpu, 1, d1, 0, 0, 0, 0) | ||
| 476 | #define KVMTRACE_0D(evt, vcpu, name) \ | ||
| 477 | trace_mark(kvm_trace_##name, "%u %p %u %u %u %u %u %u", KVM_TRC_##evt, \ | ||
| 478 | vcpu, 0, 0, 0, 0, 0, 0) | ||
| 479 | |||
| 480 | #ifdef CONFIG_KVM_TRACE | ||
| 481 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg); | ||
| 482 | void kvm_trace_cleanup(void); | ||
| 483 | #else | ||
| 484 | static inline | ||
| 485 | int kvm_trace_ioctl(unsigned int ioctl, unsigned long arg) | ||
| 486 | { | ||
| 487 | return -EINVAL; | ||
| 488 | } | ||
| 489 | #define kvm_trace_cleanup() ((void)0) | ||
| 490 | #endif | ||
| 491 | |||
| 492 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | 492 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER |
| 493 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) | 493 | static inline int mmu_notifier_retry(struct kvm_vcpu *vcpu, unsigned long mmu_seq) |
| 494 | { | 494 | { |
| @@ -524,4 +524,33 @@ static inline void kvm_free_irq_routing(struct kvm *kvm) {} | |||
| 524 | 524 | ||
| 525 | #endif | 525 | #endif |
| 526 | 526 | ||
| 527 | #ifdef CONFIG_HAVE_KVM_EVENTFD | ||
| 528 | |||
| 529 | void kvm_eventfd_init(struct kvm *kvm); | ||
| 530 | int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags); | ||
| 531 | void kvm_irqfd_release(struct kvm *kvm); | ||
| 532 | int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args); | ||
| 533 | |||
| 534 | #else | ||
| 535 | |||
| 536 | static inline void kvm_eventfd_init(struct kvm *kvm) {} | ||
| 537 | static inline int kvm_irqfd(struct kvm *kvm, int fd, int gsi, int flags) | ||
| 538 | { | ||
| 539 | return -EINVAL; | ||
| 540 | } | ||
| 541 | |||
| 542 | static inline void kvm_irqfd_release(struct kvm *kvm) {} | ||
| 543 | static inline int kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | ||
| 544 | { | ||
| 545 | return -ENOSYS; | ||
| 546 | } | ||
| 547 | |||
| 548 | #endif /* CONFIG_HAVE_KVM_EVENTFD */ | ||
| 549 | |||
| 550 | #ifdef CONFIG_KVM_APIC_ARCHITECTURE | ||
| 551 | static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) | ||
| 552 | { | ||
| 553 | return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; | ||
| 554 | } | ||
| 555 | #endif | ||
| 527 | #endif | 556 | #endif |
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h index 3ddce03766ca..d73109243fda 100644 --- a/include/linux/kvm_para.h +++ b/include/linux/kvm_para.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #define KVM_ENOSYS 1000 | 13 | #define KVM_ENOSYS 1000 |
| 14 | #define KVM_EFAULT EFAULT | 14 | #define KVM_EFAULT EFAULT |
| 15 | #define KVM_E2BIG E2BIG | 15 | #define KVM_E2BIG E2BIG |
| 16 | #define KVM_EPERM EPERM | ||
| 16 | 17 | ||
| 17 | #define KVM_HC_VAPIC_POLL_IRQ 1 | 18 | #define KVM_HC_VAPIC_POLL_IRQ 1 |
| 18 | #define KVM_HC_MMU_OP 2 | 19 | #define KVM_HC_MMU_OP 2 |
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index dbf2479e808e..2fb1dcbcb5aa 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | /* Things the lguest guest needs to know. Note: like all lguest interfaces, | 1 | /* |
| 2 | * this is subject to wild and random change between versions. */ | 2 | * Things the lguest guest needs to know. Note: like all lguest interfaces, |
| 3 | * this is subject to wild and random change between versions. | ||
| 4 | */ | ||
| 3 | #ifndef _LINUX_LGUEST_H | 5 | #ifndef _LINUX_LGUEST_H |
| 4 | #define _LINUX_LGUEST_H | 6 | #define _LINUX_LGUEST_H |
| 5 | 7 | ||
| @@ -11,32 +13,41 @@ | |||
| 11 | #define LG_CLOCK_MIN_DELTA 100UL | 13 | #define LG_CLOCK_MIN_DELTA 100UL |
| 12 | #define LG_CLOCK_MAX_DELTA ULONG_MAX | 14 | #define LG_CLOCK_MAX_DELTA ULONG_MAX |
| 13 | 15 | ||
| 14 | /*G:031 The second method of communicating with the Host is to via "struct | 16 | /*G:031 |
| 17 | * The second method of communicating with the Host is to via "struct | ||
| 15 | * lguest_data". Once the Guest's initialization hypercall tells the Host where | 18 | * lguest_data". Once the Guest's initialization hypercall tells the Host where |
| 16 | * this is, the Guest and Host both publish information in it. :*/ | 19 | * this is, the Guest and Host both publish information in it. |
| 17 | struct lguest_data | 20 | :*/ |
| 18 | { | 21 | struct lguest_data { |
| 19 | /* 512 == enabled (same as eflags in normal hardware). The Guest | 22 | /* |
| 20 | * changes interrupts so often that a hypercall is too slow. */ | 23 | * 512 == enabled (same as eflags in normal hardware). The Guest |
| 24 | * changes interrupts so often that a hypercall is too slow. | ||
| 25 | */ | ||
| 21 | unsigned int irq_enabled; | 26 | unsigned int irq_enabled; |
| 22 | /* Fine-grained interrupt disabling by the Guest */ | 27 | /* Fine-grained interrupt disabling by the Guest */ |
| 23 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); | 28 | DECLARE_BITMAP(blocked_interrupts, LGUEST_IRQS); |
| 24 | 29 | ||
| 25 | /* The Host writes the virtual address of the last page fault here, | 30 | /* |
| 31 | * The Host writes the virtual address of the last page fault here, | ||
| 26 | * which saves the Guest a hypercall. CR2 is the native register where | 32 | * which saves the Guest a hypercall. CR2 is the native register where |
| 27 | * this address would normally be found. */ | 33 | * this address would normally be found. |
| 34 | */ | ||
| 28 | unsigned long cr2; | 35 | unsigned long cr2; |
| 29 | 36 | ||
| 30 | /* Wallclock time set by the Host. */ | 37 | /* Wallclock time set by the Host. */ |
| 31 | struct timespec time; | 38 | struct timespec time; |
| 32 | 39 | ||
| 33 | /* Interrupt pending set by the Host. The Guest should do a hypercall | 40 | /* |
| 34 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). */ | 41 | * Interrupt pending set by the Host. The Guest should do a hypercall |
| 42 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). | ||
| 43 | */ | ||
| 35 | int irq_pending; | 44 | int irq_pending; |
| 36 | 45 | ||
| 37 | /* Async hypercall ring. Instead of directly making hypercalls, we can | 46 | /* |
| 47 | * Async hypercall ring. Instead of directly making hypercalls, we can | ||
| 38 | * place them in here for processing the next time the Host wants. | 48 | * place them in here for processing the next time the Host wants. |
| 39 | * This batching can be quite efficient. */ | 49 | * This batching can be quite efficient. |
| 50 | */ | ||
| 40 | 51 | ||
| 41 | /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ | 52 | /* 0xFF == done (set by Host), 0 == pending (set by Guest). */ |
| 42 | u8 hcall_status[LHCALL_RING_SIZE]; | 53 | u8 hcall_status[LHCALL_RING_SIZE]; |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index bfefbdf7498a..495203ff221c 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
| @@ -29,8 +29,10 @@ struct lguest_device_desc { | |||
| 29 | __u8 type; | 29 | __u8 type; |
| 30 | /* The number of virtqueues (first in config array) */ | 30 | /* The number of virtqueues (first in config array) */ |
| 31 | __u8 num_vq; | 31 | __u8 num_vq; |
| 32 | /* The number of bytes of feature bits. Multiply by 2: one for host | 32 | /* |
| 33 | * features and one for Guest acknowledgements. */ | 33 | * The number of bytes of feature bits. Multiply by 2: one for host |
| 34 | * features and one for Guest acknowledgements. | ||
| 35 | */ | ||
| 34 | __u8 feature_len; | 36 | __u8 feature_len; |
| 35 | /* The number of bytes of the config array after virtqueues. */ | 37 | /* The number of bytes of the config array after virtqueues. */ |
| 36 | __u8 config_len; | 38 | __u8 config_len; |
| @@ -39,8 +41,10 @@ struct lguest_device_desc { | |||
| 39 | __u8 config[0]; | 41 | __u8 config[0]; |
| 40 | }; | 42 | }; |
| 41 | 43 | ||
| 42 | /*D:135 This is how we expect the device configuration field for a virtqueue | 44 | /*D:135 |
| 43 | * to be laid out in config space. */ | 45 | * This is how we expect the device configuration field for a virtqueue |
| 46 | * to be laid out in config space. | ||
| 47 | */ | ||
| 44 | struct lguest_vqconfig { | 48 | struct lguest_vqconfig { |
| 45 | /* The number of entries in the virtio_ring */ | 49 | /* The number of entries in the virtio_ring */ |
| 46 | __u16 num; | 50 | __u16 num; |
| @@ -61,7 +65,9 @@ enum lguest_req | |||
| 61 | LHREQ_EVENTFD, /* + address, fd. */ | 65 | LHREQ_EVENTFD, /* + address, fd. */ |
| 62 | }; | 66 | }; |
| 63 | 67 | ||
| 64 | /* The alignment to use between consumer and producer parts of vring. | 68 | /* |
| 65 | * x86 pagesize for historical reasons. */ | 69 | * The alignment to use between consumer and producer parts of vring. |
| 70 | * x86 pagesize for historical reasons. | ||
| 71 | */ | ||
| 66 | #define LGUEST_VRING_ALIGN 4096 | 72 | #define LGUEST_VRING_ALIGN 4096 |
| 67 | #endif /* _LINUX_LGUEST_LAUNCHER */ | 73 | #endif /* _LINUX_LGUEST_LAUNCHER */ |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 79b6d7fd4ac2..76319bf03e37 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -143,7 +143,6 @@ enum { | |||
| 143 | 143 | ||
| 144 | ATA_DFLAG_PIO = (1 << 12), /* device limited to PIO mode */ | 144 | ATA_DFLAG_PIO = (1 << 12), /* device limited to PIO mode */ |
| 145 | ATA_DFLAG_NCQ_OFF = (1 << 13), /* device limited to non-NCQ mode */ | 145 | ATA_DFLAG_NCQ_OFF = (1 << 13), /* device limited to non-NCQ mode */ |
| 146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ | ||
| 147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ | 146 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ |
| 148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ | 147 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ |
| 149 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ | 148 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ |
| @@ -190,6 +189,7 @@ enum { | |||
| 190 | ATA_FLAG_NO_POWEROFF_SPINDOWN = (1 << 11), /* don't spindown before poweroff */ | 189 | ATA_FLAG_NO_POWEROFF_SPINDOWN = (1 << 11), /* don't spindown before poweroff */ |
| 191 | ATA_FLAG_NO_HIBERNATE_SPINDOWN = (1 << 12), /* don't spindown before hibernation */ | 190 | ATA_FLAG_NO_HIBERNATE_SPINDOWN = (1 << 12), /* don't spindown before hibernation */ |
| 192 | ATA_FLAG_DEBUGMSG = (1 << 13), | 191 | ATA_FLAG_DEBUGMSG = (1 << 13), |
| 192 | ATA_FLAG_FPDMA_AA = (1 << 14), /* driver supports Auto-Activate */ | ||
| 193 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ | 193 | ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ |
| 194 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ | 194 | ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ |
| 195 | ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ | 195 | ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ |
| @@ -386,6 +386,7 @@ enum { | |||
| 386 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ | 386 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ |
| 387 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ | 387 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ |
| 388 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ | 388 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ |
| 389 | ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ | ||
| 389 | 390 | ||
| 390 | /* DMA mask for user DMA control: User visible values; DO NOT | 391 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 391 | renumber */ | 392 | renumber */ |
| @@ -589,6 +590,7 @@ struct ata_device { | |||
| 589 | #endif | 590 | #endif |
| 590 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ | 591 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ |
| 591 | u64 n_sectors; /* size of device, if ATA */ | 592 | u64 n_sectors; /* size of device, if ATA */ |
| 593 | u64 n_native_sectors; /* native size, if ATA */ | ||
| 592 | unsigned int class; /* ATA_DEV_xxx */ | 594 | unsigned int class; /* ATA_DEV_xxx */ |
| 593 | unsigned long unpark_deadline; | 595 | unsigned long unpark_deadline; |
| 594 | 596 | ||
diff --git a/include/linux/lmb.h b/include/linux/lmb.h index c46c89505dac..2442e3f3d033 100644 --- a/include/linux/lmb.h +++ b/include/linux/lmb.h | |||
| @@ -51,7 +51,7 @@ extern u64 __init lmb_alloc_base(u64 size, | |||
| 51 | extern u64 __init __lmb_alloc_base(u64 size, | 51 | extern u64 __init __lmb_alloc_base(u64 size, |
| 52 | u64 align, u64 max_addr); | 52 | u64 align, u64 max_addr); |
| 53 | extern u64 __init lmb_phys_mem_size(void); | 53 | extern u64 __init lmb_phys_mem_size(void); |
| 54 | extern u64 __init lmb_end_of_DRAM(void); | 54 | extern u64 lmb_end_of_DRAM(void); |
| 55 | extern void __init lmb_enforce_memory_limit(u64 memory_limit); | 55 | extern void __init lmb_enforce_memory_limit(u64 memory_limit); |
| 56 | extern int __init lmb_is_reserved(u64 addr); | 56 | extern int __init lmb_is_reserved(u64 addr); |
| 57 | extern int lmb_find(struct lmb_property *res); | 57 | extern int lmb_find(struct lmb_property *res); |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index b25d1b53df0d..9ccf0e286b2a 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -149,6 +149,12 @@ struct lock_list { | |||
| 149 | struct lock_class *class; | 149 | struct lock_class *class; |
| 150 | struct stack_trace trace; | 150 | struct stack_trace trace; |
| 151 | int distance; | 151 | int distance; |
| 152 | |||
| 153 | /* | ||
| 154 | * The parent field is used to implement breadth-first search, and the | ||
| 155 | * bit 0 is reused to indicate if the lock has been accessed in BFS. | ||
| 156 | */ | ||
| 157 | struct lock_list *parent; | ||
| 152 | }; | 158 | }; |
| 153 | 159 | ||
| 154 | /* | 160 | /* |
| @@ -208,10 +214,12 @@ struct held_lock { | |||
| 208 | * interrupt context: | 214 | * interrupt context: |
| 209 | */ | 215 | */ |
| 210 | unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */ | 216 | unsigned int irq_context:2; /* bit 0 - soft, bit 1 - hard */ |
| 211 | unsigned int trylock:1; | 217 | unsigned int trylock:1; /* 16 bits */ |
| 218 | |||
| 212 | unsigned int read:2; /* see lock_acquire() comment */ | 219 | unsigned int read:2; /* see lock_acquire() comment */ |
| 213 | unsigned int check:2; /* see lock_acquire() comment */ | 220 | unsigned int check:2; /* see lock_acquire() comment */ |
| 214 | unsigned int hardirqs_off:1; | 221 | unsigned int hardirqs_off:1; |
| 222 | unsigned int references:11; /* 32 bits */ | ||
| 215 | }; | 223 | }; |
| 216 | 224 | ||
| 217 | /* | 225 | /* |
| @@ -291,6 +299,10 @@ extern void lock_acquire(struct lockdep_map *lock, unsigned int subclass, | |||
| 291 | extern void lock_release(struct lockdep_map *lock, int nested, | 299 | extern void lock_release(struct lockdep_map *lock, int nested, |
| 292 | unsigned long ip); | 300 | unsigned long ip); |
| 293 | 301 | ||
| 302 | #define lockdep_is_held(lock) lock_is_held(&(lock)->dep_map) | ||
| 303 | |||
| 304 | extern int lock_is_held(struct lockdep_map *lock); | ||
| 305 | |||
| 294 | extern void lock_set_class(struct lockdep_map *lock, const char *name, | 306 | extern void lock_set_class(struct lockdep_map *lock, const char *name, |
| 295 | struct lock_class_key *key, unsigned int subclass, | 307 | struct lock_class_key *key, unsigned int subclass, |
| 296 | unsigned long ip); | 308 | unsigned long ip); |
| @@ -309,6 +321,8 @@ extern void lockdep_trace_alloc(gfp_t mask); | |||
| 309 | 321 | ||
| 310 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) | 322 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
| 311 | 323 | ||
| 324 | #define lockdep_assert_held(l) WARN_ON(debug_locks && !lockdep_is_held(l)) | ||
| 325 | |||
| 312 | #else /* !LOCKDEP */ | 326 | #else /* !LOCKDEP */ |
| 313 | 327 | ||
| 314 | static inline void lockdep_off(void) | 328 | static inline void lockdep_off(void) |
| @@ -353,6 +367,8 @@ struct lock_class_key { }; | |||
| 353 | 367 | ||
| 354 | #define lockdep_depth(tsk) (0) | 368 | #define lockdep_depth(tsk) (0) |
| 355 | 369 | ||
| 370 | #define lockdep_assert_held(l) do { } while (0) | ||
| 371 | |||
| 356 | #endif /* !LOCKDEP */ | 372 | #endif /* !LOCKDEP */ |
| 357 | 373 | ||
| 358 | #ifdef CONFIG_LOCK_STAT | 374 | #ifdef CONFIG_LOCK_STAT |
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index e461b2c3d711..190c37854870 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
| @@ -33,6 +33,7 @@ struct common_audit_data { | |||
| 33 | #define LSM_AUDIT_DATA_IPC 4 | 33 | #define LSM_AUDIT_DATA_IPC 4 |
| 34 | #define LSM_AUDIT_DATA_TASK 5 | 34 | #define LSM_AUDIT_DATA_TASK 5 |
| 35 | #define LSM_AUDIT_DATA_KEY 6 | 35 | #define LSM_AUDIT_DATA_KEY 6 |
| 36 | #define LSM_AUDIT_NO_AUDIT 7 | ||
| 36 | struct task_struct *tsk; | 37 | struct task_struct *tsk; |
| 37 | union { | 38 | union { |
| 38 | struct { | 39 | struct { |
| @@ -66,16 +67,19 @@ struct common_audit_data { | |||
| 66 | } key_struct; | 67 | } key_struct; |
| 67 | #endif | 68 | #endif |
| 68 | } u; | 69 | } u; |
| 69 | const char *function; | ||
| 70 | /* this union contains LSM specific data */ | 70 | /* this union contains LSM specific data */ |
| 71 | union { | 71 | union { |
| 72 | #ifdef CONFIG_SECURITY_SMACK | ||
| 72 | /* SMACK data */ | 73 | /* SMACK data */ |
| 73 | struct smack_audit_data { | 74 | struct smack_audit_data { |
| 75 | const char *function; | ||
| 74 | char *subject; | 76 | char *subject; |
| 75 | char *object; | 77 | char *object; |
| 76 | char *request; | 78 | char *request; |
| 77 | int result; | 79 | int result; |
| 78 | } smack_audit_data; | 80 | } smack_audit_data; |
| 81 | #endif | ||
| 82 | #ifdef CONFIG_SECURITY_SELINUX | ||
| 79 | /* SELinux data */ | 83 | /* SELinux data */ |
| 80 | struct { | 84 | struct { |
| 81 | u32 ssid; | 85 | u32 ssid; |
| @@ -83,10 +87,12 @@ struct common_audit_data { | |||
| 83 | u16 tclass; | 87 | u16 tclass; |
| 84 | u32 requested; | 88 | u32 requested; |
| 85 | u32 audited; | 89 | u32 audited; |
| 90 | u32 denied; | ||
| 86 | struct av_decision *avd; | 91 | struct av_decision *avd; |
| 87 | int result; | 92 | int result; |
| 88 | } selinux_audit_data; | 93 | } selinux_audit_data; |
| 89 | } lsm_priv; | 94 | #endif |
| 95 | }; | ||
| 90 | /* these callback will be implemented by a specific LSM */ | 96 | /* these callback will be implemented by a specific LSM */ |
| 91 | void (*lsm_pre_audit)(struct audit_buffer *, void *); | 97 | void (*lsm_pre_audit)(struct audit_buffer *, void *); |
| 92 | void (*lsm_post_audit)(struct audit_buffer *, void *); | 98 | void (*lsm_post_audit)(struct audit_buffer *, void *); |
| @@ -104,7 +110,7 @@ int ipv6_skb_to_auditdata(struct sk_buff *skb, | |||
| 104 | /* Initialize an LSM audit data structure. */ | 110 | /* Initialize an LSM audit data structure. */ |
| 105 | #define COMMON_AUDIT_DATA_INIT(_d, _t) \ | 111 | #define COMMON_AUDIT_DATA_INIT(_d, _t) \ |
| 106 | { memset((_d), 0, sizeof(struct common_audit_data)); \ | 112 | { memset((_d), 0, sizeof(struct common_audit_data)); \ |
| 107 | (_d)->type = LSM_AUDIT_DATA_##_t; (_d)->function = __func__; } | 113 | (_d)->type = LSM_AUDIT_DATA_##_t; } |
| 108 | 114 | ||
| 109 | void common_lsm_audit(struct common_audit_data *a); | 115 | void common_lsm_audit(struct common_audit_data *a); |
| 110 | 116 | ||
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h index 7f9831da847f..4af841408fb5 100644 --- a/include/linux/mISDNhw.h +++ b/include/linux/mISDNhw.h | |||
| @@ -168,6 +168,7 @@ struct bchannel { | |||
| 168 | extern int mISDN_initdchannel(struct dchannel *, int, void *); | 168 | extern int mISDN_initdchannel(struct dchannel *, int, void *); |
| 169 | extern int mISDN_initbchannel(struct bchannel *, int); | 169 | extern int mISDN_initbchannel(struct bchannel *, int); |
| 170 | extern int mISDN_freedchannel(struct dchannel *); | 170 | extern int mISDN_freedchannel(struct dchannel *); |
| 171 | extern void mISDN_clear_bchannel(struct bchannel *); | ||
| 171 | extern int mISDN_freebchannel(struct bchannel *); | 172 | extern int mISDN_freebchannel(struct bchannel *); |
| 172 | extern void queue_ch_frame(struct mISDNchannel *, u_int, | 173 | extern void queue_ch_frame(struct mISDNchannel *, u_int, |
| 173 | int, struct sk_buff *); | 174 | int, struct sk_buff *); |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 45100b39a7cf..536ca12442ca 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | */ | 37 | */ |
| 38 | #define MISDN_MAJOR_VERSION 1 | 38 | #define MISDN_MAJOR_VERSION 1 |
| 39 | #define MISDN_MINOR_VERSION 1 | 39 | #define MISDN_MINOR_VERSION 1 |
| 40 | #define MISDN_RELEASE 20 | 40 | #define MISDN_RELEASE 21 |
| 41 | 41 | ||
| 42 | /* primitives for information exchange | 42 | /* primitives for information exchange |
| 43 | * generell format | 43 | * generell format |
| @@ -153,6 +153,18 @@ | |||
| 153 | #define HFC_VOL_CHANGE_RX 0x2602 | 153 | #define HFC_VOL_CHANGE_RX 0x2602 |
| 154 | #define HFC_SPL_LOOP_ON 0x2603 | 154 | #define HFC_SPL_LOOP_ON 0x2603 |
| 155 | #define HFC_SPL_LOOP_OFF 0x2604 | 155 | #define HFC_SPL_LOOP_OFF 0x2604 |
| 156 | /* for T30 FAX and analog modem */ | ||
| 157 | #define HW_MOD_FRM 0x4000 | ||
| 158 | #define HW_MOD_FRH 0x4001 | ||
| 159 | #define HW_MOD_FTM 0x4002 | ||
| 160 | #define HW_MOD_FTH 0x4003 | ||
| 161 | #define HW_MOD_FTS 0x4004 | ||
| 162 | #define HW_MOD_CONNECT 0x4010 | ||
| 163 | #define HW_MOD_OK 0x4011 | ||
| 164 | #define HW_MOD_NOCARR 0x4012 | ||
| 165 | #define HW_MOD_FCERROR 0x4013 | ||
| 166 | #define HW_MOD_READY 0x4014 | ||
| 167 | #define HW_MOD_LASTDATA 0x4015 | ||
| 156 | 168 | ||
| 157 | /* DSP_TONE_PATT_ON parameter */ | 169 | /* DSP_TONE_PATT_ON parameter */ |
| 158 | #define TONE_OFF 0x0000 | 170 | #define TONE_OFF 0x0000 |
| @@ -224,6 +236,8 @@ | |||
| 224 | #define ISDN_P_B_L2DTMF 0x24 | 236 | #define ISDN_P_B_L2DTMF 0x24 |
| 225 | #define ISDN_P_B_L2DSP 0x25 | 237 | #define ISDN_P_B_L2DSP 0x25 |
| 226 | #define ISDN_P_B_L2DSPHDLC 0x26 | 238 | #define ISDN_P_B_L2DSPHDLC 0x26 |
| 239 | #define ISDN_P_B_T30_FAX 0x27 | ||
| 240 | #define ISDN_P_B_MODEM_ASYNC 0x28 | ||
| 227 | 241 | ||
| 228 | #define OPTION_L2_PMX 1 | 242 | #define OPTION_L2_PMX 1 |
| 229 | #define OPTION_L2_PTP 2 | 243 | #define OPTION_L2_PTP 2 |
diff --git a/include/linux/mdio.h b/include/linux/mdio.h index cfdf1df2875e..c779b49a1fda 100644 --- a/include/linux/mdio.h +++ b/include/linux/mdio.h | |||
| @@ -304,7 +304,7 @@ static inline __u16 mdio_phy_id_devad(int phy_id) | |||
| 304 | */ | 304 | */ |
| 305 | struct mdio_if_info { | 305 | struct mdio_if_info { |
| 306 | int prtad; | 306 | int prtad; |
| 307 | u32 __bitwise mmds; | 307 | u32 mmds; |
| 308 | unsigned mode_support; | 308 | unsigned mode_support; |
| 309 | 309 | ||
| 310 | struct net_device *dev; | 310 | struct net_device *dev; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index ba3a7cb1eaa0..9a72cc78e6b8 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -34,8 +34,6 @@ extern int sysctl_legacy_va_layout; | |||
| 34 | #define sysctl_legacy_va_layout 0 | 34 | #define sysctl_legacy_va_layout 0 |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | extern unsigned long mmap_min_addr; | ||
| 38 | |||
| 39 | #include <asm/page.h> | 37 | #include <asm/page.h> |
| 40 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
| 41 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
| @@ -575,19 +573,6 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
| 575 | } | 573 | } |
| 576 | 574 | ||
| 577 | /* | 575 | /* |
| 578 | * If a hint addr is less than mmap_min_addr change hint to be as | ||
| 579 | * low as possible but still greater than mmap_min_addr | ||
| 580 | */ | ||
| 581 | static inline unsigned long round_hint_to_min(unsigned long hint) | ||
| 582 | { | ||
| 583 | hint &= PAGE_MASK; | ||
| 584 | if (((void *)hint != NULL) && | ||
| 585 | (hint < mmap_min_addr)) | ||
| 586 | return PAGE_ALIGN(mmap_min_addr); | ||
| 587 | return hint; | ||
| 588 | } | ||
| 589 | |||
| 590 | /* | ||
| 591 | * Some inline functions in vmstat.h depend on page_zone() | 576 | * Some inline functions in vmstat.h depend on page_zone() |
| 592 | */ | 577 | */ |
| 593 | #include <linux/vmstat.h> | 578 | #include <linux/vmstat.h> |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7acc8439d9b3..0042090a4d70 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -240,8 +240,6 @@ struct mm_struct { | |||
| 240 | 240 | ||
| 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
| 242 | 242 | ||
| 243 | s8 oom_adj; /* OOM kill score adjustment (bit shift) */ | ||
| 244 | |||
| 245 | cpumask_t cpu_vm_mask; | 243 | cpumask_t cpu_vm_mask; |
| 246 | 244 | ||
| 247 | /* Architecture-specific MM context */ | 245 | /* Architecture-specific MM context */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 39751c8cde9c..2dbfb5a05994 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -22,6 +22,12 @@ | |||
| 22 | /* | 22 | /* |
| 23 | * Vendors and devices. Sort key: vendor first, device next. | 23 | * Vendors and devices. Sort key: vendor first, device next. |
| 24 | */ | 24 | */ |
| 25 | #define SDIO_VENDOR_ID_INTEL 0x0089 | ||
| 26 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 | ||
| 27 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIFI 0x1403 | ||
| 28 | #define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404 | ||
| 29 | #define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 | ||
| 30 | #define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 | ||
| 25 | 31 | ||
| 26 | #define SDIO_VENDOR_ID_MARVELL 0x02df | 32 | #define SDIO_VENDOR_ID_MARVELL 0x02df |
| 27 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 | 33 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 |
diff --git a/include/linux/module.h b/include/linux/module.h index 098bdb7bfacf..f8f92d015efe 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
| @@ -17,10 +17,12 @@ | |||
| 17 | #include <linux/moduleparam.h> | 17 | #include <linux/moduleparam.h> |
| 18 | #include <linux/marker.h> | 18 | #include <linux/marker.h> |
| 19 | #include <linux/tracepoint.h> | 19 | #include <linux/tracepoint.h> |
| 20 | #include <asm/local.h> | ||
| 21 | 20 | ||
| 21 | #include <asm/local.h> | ||
| 22 | #include <asm/module.h> | 22 | #include <asm/module.h> |
| 23 | 23 | ||
| 24 | #include <trace/events/module.h> | ||
| 25 | |||
| 24 | /* Not Yet Implemented */ | 26 | /* Not Yet Implemented */ |
| 25 | #define MODULE_SUPPORTED_DEVICE(name) | 27 | #define MODULE_SUPPORTED_DEVICE(name) |
| 26 | 28 | ||
| @@ -462,7 +464,10 @@ static inline local_t *__module_ref_addr(struct module *mod, int cpu) | |||
| 462 | static inline void __module_get(struct module *module) | 464 | static inline void __module_get(struct module *module) |
| 463 | { | 465 | { |
| 464 | if (module) { | 466 | if (module) { |
| 465 | local_inc(__module_ref_addr(module, get_cpu())); | 467 | unsigned int cpu = get_cpu(); |
| 468 | local_inc(__module_ref_addr(module, cpu)); | ||
| 469 | trace_module_get(module, _THIS_IP_, | ||
| 470 | local_read(__module_ref_addr(module, cpu))); | ||
| 466 | put_cpu(); | 471 | put_cpu(); |
| 467 | } | 472 | } |
| 468 | } | 473 | } |
| @@ -473,8 +478,11 @@ static inline int try_module_get(struct module *module) | |||
| 473 | 478 | ||
| 474 | if (module) { | 479 | if (module) { |
| 475 | unsigned int cpu = get_cpu(); | 480 | unsigned int cpu = get_cpu(); |
| 476 | if (likely(module_is_live(module))) | 481 | if (likely(module_is_live(module))) { |
| 477 | local_inc(__module_ref_addr(module, cpu)); | 482 | local_inc(__module_ref_addr(module, cpu)); |
| 483 | trace_module_get(module, _THIS_IP_, | ||
| 484 | local_read(__module_ref_addr(module, cpu))); | ||
| 485 | } | ||
| 478 | else | 486 | else |
| 479 | ret = 0; | 487 | ret = 0; |
| 480 | put_cpu(); | 488 | put_cpu(); |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 5675b63a0631..0f32a9b6ff55 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -251,7 +251,7 @@ struct mtd_info { | |||
| 251 | 251 | ||
| 252 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 252 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 253 | { | 253 | { |
| 254 | return dev ? container_of(dev, struct mtd_info, dev) : NULL; | 254 | return dev ? dev_get_drvdata(dev) : NULL; |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) | 257 | static inline uint32_t mtd_div_by_eb(uint64_t sz, struct mtd_info *mtd) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index af6dcb992bc3..b70313d33ff8 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
| @@ -47,6 +47,8 @@ struct mtd_partition { | |||
| 47 | #define MTDPART_SIZ_FULL (0) | 47 | #define MTDPART_SIZ_FULL (0) |
| 48 | 48 | ||
| 49 | 49 | ||
| 50 | struct mtd_info; | ||
| 51 | |||
| 50 | int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); | 52 | int add_mtd_partitions(struct mtd_info *, const struct mtd_partition *, int); |
| 51 | int del_mtd_partitions(struct mtd_info *); | 53 | int del_mtd_partitions(struct mtd_info *); |
| 52 | 54 | ||
diff --git a/include/linux/net_dropmon.h b/include/linux/net_dropmon.h index 3ceb0cc1bc78..2a739462caeb 100644 --- a/include/linux/net_dropmon.h +++ b/include/linux/net_dropmon.h | |||
| @@ -3,7 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
| 6 | #include <linux/types.h> | ||
| 7 | 6 | ||
| 8 | struct net_dm_drop_point { | 7 | struct net_dm_drop_point { |
| 9 | __u8 pc[8]; | 8 | __u8 pc[8]; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d4a4d9867794..65ee1929b2b1 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -72,10 +72,6 @@ struct wireless_dev; | |||
| 72 | /* Backlog congestion levels */ | 72 | /* Backlog congestion levels */ |
| 73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
| 74 | #define NET_RX_DROP 1 /* packet dropped */ | 74 | #define NET_RX_DROP 1 /* packet dropped */ |
| 75 | #define NET_RX_CN_LOW 2 /* storm alert, just in case */ | ||
| 76 | #define NET_RX_CN_MOD 3 /* Storm on its way! */ | ||
| 77 | #define NET_RX_CN_HIGH 4 /* The storm is here */ | ||
| 78 | #define NET_RX_BAD 5 /* packet dropped due to kernel error */ | ||
| 79 | 75 | ||
| 80 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | 76 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It |
| 81 | * indicates that the device will soon be dropping packets, or already drops | 77 | * indicates that the device will soon be dropping packets, or already drops |
| @@ -83,17 +79,19 @@ struct wireless_dev; | |||
| 83 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | 79 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) |
| 84 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 80 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
| 85 | 81 | ||
| 82 | /* Driver transmit return codes */ | ||
| 83 | enum netdev_tx { | ||
| 84 | NETDEV_TX_OK = 0, /* driver took care of packet */ | ||
| 85 | NETDEV_TX_BUSY, /* driver tx path was busy*/ | ||
| 86 | NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ | ||
| 87 | }; | ||
| 88 | typedef enum netdev_tx netdev_tx_t; | ||
| 89 | |||
| 86 | #endif | 90 | #endif |
| 87 | 91 | ||
| 88 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ | 92 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ |
| 89 | 93 | ||
| 90 | /* Driver transmit return codes */ | ||
| 91 | #define NETDEV_TX_OK 0 /* driver took care of packet */ | ||
| 92 | #define NETDEV_TX_BUSY 1 /* driver tx path was busy*/ | ||
| 93 | #define NETDEV_TX_LOCKED -1 /* driver tx lock was already taken */ | ||
| 94 | |||
| 95 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
| 96 | |||
| 97 | /* | 95 | /* |
| 98 | * Compute the worst case header length according to the protocols | 96 | * Compute the worst case header length according to the protocols |
| 99 | * used. | 97 | * used. |
| @@ -511,9 +509,11 @@ struct netdev_queue { | |||
| 511 | * This function is called when network device transistions to the down | 509 | * This function is called when network device transistions to the down |
| 512 | * state. | 510 | * state. |
| 513 | * | 511 | * |
| 514 | * int (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev); | 512 | * netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, |
| 513 | * struct net_device *dev); | ||
| 515 | * Called when a packet needs to be transmitted. | 514 | * Called when a packet needs to be transmitted. |
| 516 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY, or NETDEV_TX_LOCKED, | 515 | * Must return NETDEV_TX_OK , NETDEV_TX_BUSY. |
| 516 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) | ||
| 517 | * Required can not be NULL. | 517 | * Required can not be NULL. |
| 518 | * | 518 | * |
| 519 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | 519 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); |
| @@ -584,7 +584,7 @@ struct net_device_ops { | |||
| 584 | void (*ndo_uninit)(struct net_device *dev); | 584 | void (*ndo_uninit)(struct net_device *dev); |
| 585 | int (*ndo_open)(struct net_device *dev); | 585 | int (*ndo_open)(struct net_device *dev); |
| 586 | int (*ndo_stop)(struct net_device *dev); | 586 | int (*ndo_stop)(struct net_device *dev); |
| 587 | int (*ndo_start_xmit) (struct sk_buff *skb, | 587 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, |
| 588 | struct net_device *dev); | 588 | struct net_device *dev); |
| 589 | u16 (*ndo_select_queue)(struct net_device *dev, | 589 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 590 | struct sk_buff *skb); | 590 | struct sk_buff *skb); |
| @@ -627,6 +627,8 @@ struct net_device_ops { | |||
| 627 | void (*ndo_poll_controller)(struct net_device *dev); | 627 | void (*ndo_poll_controller)(struct net_device *dev); |
| 628 | #endif | 628 | #endif |
| 629 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 629 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
| 630 | int (*ndo_fcoe_enable)(struct net_device *dev); | ||
| 631 | int (*ndo_fcoe_disable)(struct net_device *dev); | ||
| 630 | int (*ndo_fcoe_ddp_setup)(struct net_device *dev, | 632 | int (*ndo_fcoe_ddp_setup)(struct net_device *dev, |
| 631 | u16 xid, | 633 | u16 xid, |
| 632 | struct scatterlist *sgl, | 634 | struct scatterlist *sgl, |
| @@ -705,6 +707,7 @@ struct net_device | |||
| 705 | /* the GSO_MASK reserves bits 16 through 23 */ | 707 | /* the GSO_MASK reserves bits 16 through 23 */ |
| 706 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ | 708 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ |
| 707 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | 709 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ |
| 710 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ | ||
| 708 | 711 | ||
| 709 | /* Segmentation offload features */ | 712 | /* Segmentation offload features */ |
| 710 | #define NETIF_F_GSO_SHIFT 16 | 713 | #define NETIF_F_GSO_SHIFT 16 |
| @@ -829,6 +832,9 @@ struct net_device | |||
| 829 | /* Number of TX queues currently active in device */ | 832 | /* Number of TX queues currently active in device */ |
| 830 | unsigned int real_num_tx_queues; | 833 | unsigned int real_num_tx_queues; |
| 831 | 834 | ||
| 835 | /* root qdisc from userspace point of view */ | ||
| 836 | struct Qdisc *qdisc; | ||
| 837 | |||
| 832 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 838 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
| 833 | spinlock_t tx_global_lock; | 839 | spinlock_t tx_global_lock; |
| 834 | /* | 840 | /* |
| @@ -992,6 +998,12 @@ static inline void *netdev_priv(const struct net_device *dev) | |||
| 992 | */ | 998 | */ |
| 993 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) | 999 | #define SET_NETDEV_DEV(net, pdev) ((net)->dev.parent = (pdev)) |
| 994 | 1000 | ||
| 1001 | /* Set the sysfs device type for the network logical device to allow | ||
| 1002 | * fin grained indentification of different network device types. For | ||
| 1003 | * example Ethernet, Wirelss LAN, Bluetooth, WiMAX etc. | ||
| 1004 | */ | ||
| 1005 | #define SET_NETDEV_DEVTYPE(net, devtype) ((net)->dev.type = (devtype)) | ||
| 1006 | |||
| 995 | /** | 1007 | /** |
| 996 | * netif_napi_add - initialize a napi context | 1008 | * netif_napi_add - initialize a napi context |
| 997 | * @dev: network device | 1009 | * @dev: network device |
| @@ -1260,7 +1272,7 @@ static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue) | |||
| 1260 | { | 1272 | { |
| 1261 | #ifdef CONFIG_NETPOLL_TRAP | 1273 | #ifdef CONFIG_NETPOLL_TRAP |
| 1262 | if (netpoll_trap()) { | 1274 | if (netpoll_trap()) { |
| 1263 | clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state); | 1275 | netif_tx_start_queue(dev_queue); |
| 1264 | return; | 1276 | return; |
| 1265 | } | 1277 | } |
| 1266 | #endif | 1278 | #endif |
| @@ -1366,7 +1378,8 @@ static inline int netif_running(const struct net_device *dev) | |||
| 1366 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) | 1378 | static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) |
| 1367 | { | 1379 | { |
| 1368 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); | 1380 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
| 1369 | clear_bit(__QUEUE_STATE_XOFF, &txq->state); | 1381 | |
| 1382 | netif_tx_start_queue(txq); | ||
| 1370 | } | 1383 | } |
| 1371 | 1384 | ||
| 1372 | /** | 1385 | /** |
| @@ -1383,7 +1396,7 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) | |||
| 1383 | if (netpoll_trap()) | 1396 | if (netpoll_trap()) |
| 1384 | return; | 1397 | return; |
| 1385 | #endif | 1398 | #endif |
| 1386 | set_bit(__QUEUE_STATE_XOFF, &txq->state); | 1399 | netif_tx_stop_queue(txq); |
| 1387 | } | 1400 | } |
| 1388 | 1401 | ||
| 1389 | /** | 1402 | /** |
| @@ -1397,7 +1410,8 @@ static inline int __netif_subqueue_stopped(const struct net_device *dev, | |||
| 1397 | u16 queue_index) | 1410 | u16 queue_index) |
| 1398 | { | 1411 | { |
| 1399 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); | 1412 | struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index); |
| 1400 | return test_bit(__QUEUE_STATE_XOFF, &txq->state); | 1413 | |
| 1414 | return netif_tx_queue_stopped(txq); | ||
| 1401 | } | 1415 | } |
| 1402 | 1416 | ||
| 1403 | static inline int netif_subqueue_stopped(const struct net_device *dev, | 1417 | static inline int netif_subqueue_stopped(const struct net_device *dev, |
| @@ -1749,8 +1763,7 @@ static inline void netif_tx_unlock(struct net_device *dev) | |||
| 1749 | * force a schedule. | 1763 | * force a schedule. |
| 1750 | */ | 1764 | */ |
| 1751 | clear_bit(__QUEUE_STATE_FROZEN, &txq->state); | 1765 | clear_bit(__QUEUE_STATE_FROZEN, &txq->state); |
| 1752 | if (!test_bit(__QUEUE_STATE_XOFF, &txq->state)) | 1766 | netif_schedule_queue(txq); |
| 1753 | __netif_schedule(txq->qdisc); | ||
| 1754 | } | 1767 | } |
| 1755 | spin_unlock(&dev->tx_global_lock); | 1768 | spin_unlock(&dev->tx_global_lock); |
| 1756 | } | 1769 | } |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index bff4d5741d98..9f00da287f2c 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -58,7 +58,8 @@ struct nfgenmsg { | |||
| 58 | struct nfnl_callback | 58 | struct nfnl_callback |
| 59 | { | 59 | { |
| 60 | int (*call)(struct sock *nl, struct sk_buff *skb, | 60 | int (*call)(struct sock *nl, struct sk_buff *skb, |
| 61 | struct nlmsghdr *nlh, struct nlattr *cda[]); | 61 | const struct nlmsghdr *nlh, |
| 62 | const struct nlattr * const cda[]); | ||
| 62 | const struct nla_policy *policy; /* netlink attribute policy */ | 63 | const struct nla_policy *policy; /* netlink attribute policy */ |
| 63 | const u_int16_t attr_count; /* number of nlattr's */ | 64 | const u_int16_t attr_count; /* number of nlattr's */ |
| 64 | }; | 65 | }; |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 1030b7593898..812cb153cabb 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -238,9 +238,9 @@ struct xt_mtdtor_param { | |||
| 238 | */ | 238 | */ |
| 239 | struct xt_target_param { | 239 | struct xt_target_param { |
| 240 | const struct net_device *in, *out; | 240 | const struct net_device *in, *out; |
| 241 | unsigned int hooknum; | ||
| 242 | const struct xt_target *target; | 241 | const struct xt_target *target; |
| 243 | const void *targinfo; | 242 | const void *targinfo; |
| 243 | unsigned int hooknum; | ||
| 244 | u_int8_t family; | 244 | u_int8_t family; |
| 245 | }; | 245 | }; |
| 246 | 246 | ||
| @@ -407,7 +407,7 @@ extern int xt_check_target(struct xt_tgchk_param *, | |||
| 407 | unsigned int size, u_int8_t proto, bool inv_proto); | 407 | unsigned int size, u_int8_t proto, bool inv_proto); |
| 408 | 408 | ||
| 409 | extern struct xt_table *xt_register_table(struct net *net, | 409 | extern struct xt_table *xt_register_table(struct net *net, |
| 410 | struct xt_table *table, | 410 | const struct xt_table *table, |
| 411 | struct xt_table_info *bootstrap, | 411 | struct xt_table_info *bootstrap, |
| 412 | struct xt_table_info *newinfo); | 412 | struct xt_table_info *newinfo); |
| 413 | extern void *xt_unregister_table(struct xt_table *table); | 413 | extern void *xt_unregister_table(struct xt_table *table); |
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h index 7635c8ffdadb..0a8545866752 100644 --- a/include/linux/netfilter/xt_CONNMARK.h +++ b/include/linux/netfilter/xt_CONNMARK.h | |||
| @@ -18,12 +18,6 @@ enum { | |||
| 18 | XT_CONNMARK_RESTORE | 18 | XT_CONNMARK_RESTORE |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | struct xt_connmark_target_info { | ||
| 22 | unsigned long mark; | ||
| 23 | unsigned long mask; | ||
| 24 | __u8 mode; | ||
| 25 | }; | ||
| 26 | |||
| 27 | struct xt_connmark_tginfo1 { | 21 | struct xt_connmark_tginfo1 { |
| 28 | __u32 ctmark, ctmask, nfmask; | 22 | __u32 ctmark, ctmask, nfmask; |
| 29 | __u8 mode; | 23 | __u8 mode; |
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h index 028304bcc0b1..bc9561bdef79 100644 --- a/include/linux/netfilter/xt_MARK.h +++ b/include/linux/netfilter/xt_MARK.h | |||
| @@ -3,23 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | /* Version 0 */ | ||
| 7 | struct xt_mark_target_info { | ||
| 8 | unsigned long mark; | ||
| 9 | }; | ||
| 10 | |||
| 11 | /* Version 1 */ | ||
| 12 | enum { | ||
| 13 | XT_MARK_SET=0, | ||
| 14 | XT_MARK_AND, | ||
| 15 | XT_MARK_OR, | ||
| 16 | }; | ||
| 17 | |||
| 18 | struct xt_mark_target_info_v1 { | ||
| 19 | unsigned long mark; | ||
| 20 | __u8 mode; | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct xt_mark_tginfo2 { | 6 | struct xt_mark_tginfo2 { |
| 24 | __u32 mark, mask; | 7 | __u32 mark, mask; |
| 25 | }; | 8 | }; |
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h index 571e266d004c..619e47cde01a 100644 --- a/include/linux/netfilter/xt_connmark.h +++ b/include/linux/netfilter/xt_connmark.h | |||
| @@ -12,11 +12,6 @@ | |||
| 12 | * (at your option) any later version. | 12 | * (at your option) any later version. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | struct xt_connmark_info { | ||
| 16 | unsigned long mark, mask; | ||
| 17 | __u8 invert; | ||
| 18 | }; | ||
| 19 | |||
| 20 | struct xt_connmark_mtinfo1 { | 15 | struct xt_connmark_mtinfo1 { |
| 21 | __u32 mark, mask; | 16 | __u32 mark, mask; |
| 22 | __u8 invert; | 17 | __u8 invert; |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 7ae05338e94c..54f47a2f6152 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
| @@ -32,42 +32,6 @@ enum { | |||
| 32 | XT_CONNTRACK_DIRECTION = 1 << 12, | 32 | XT_CONNTRACK_DIRECTION = 1 << 12, |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | /* This is exposed to userspace, so remains frozen in time. */ | ||
| 36 | struct ip_conntrack_old_tuple | ||
| 37 | { | ||
| 38 | struct { | ||
| 39 | __be32 ip; | ||
| 40 | union { | ||
| 41 | __u16 all; | ||
| 42 | } u; | ||
| 43 | } src; | ||
| 44 | |||
| 45 | struct { | ||
| 46 | __be32 ip; | ||
| 47 | union { | ||
| 48 | __u16 all; | ||
| 49 | } u; | ||
| 50 | |||
| 51 | /* The protocol. */ | ||
| 52 | __u16 protonum; | ||
| 53 | } dst; | ||
| 54 | }; | ||
| 55 | |||
| 56 | struct xt_conntrack_info | ||
| 57 | { | ||
| 58 | unsigned int statemask, statusmask; | ||
| 59 | |||
| 60 | struct ip_conntrack_old_tuple tuple[IP_CT_DIR_MAX]; | ||
| 61 | struct in_addr sipmsk[IP_CT_DIR_MAX], dipmsk[IP_CT_DIR_MAX]; | ||
| 62 | |||
| 63 | unsigned long expires_min, expires_max; | ||
| 64 | |||
| 65 | /* Flags word */ | ||
| 66 | __u8 flags; | ||
| 67 | /* Inverse flags */ | ||
| 68 | __u8 invflags; | ||
| 69 | }; | ||
| 70 | |||
| 71 | struct xt_conntrack_mtinfo1 { | 35 | struct xt_conntrack_mtinfo1 { |
| 72 | union nf_inet_addr origsrc_addr, origsrc_mask; | 36 | union nf_inet_addr origsrc_addr, origsrc_mask; |
| 73 | union nf_inet_addr origdst_addr, origdst_mask; | 37 | union nf_inet_addr origdst_addr, origdst_mask; |
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h index 6fa460a3cc29..6607c8f38ea5 100644 --- a/include/linux/netfilter/xt_mark.h +++ b/include/linux/netfilter/xt_mark.h | |||
| @@ -3,11 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | 5 | ||
| 6 | struct xt_mark_info { | ||
| 7 | unsigned long mark, mask; | ||
| 8 | __u8 invert; | ||
| 9 | }; | ||
| 10 | |||
| 11 | struct xt_mark_mtinfo1 { | 6 | struct xt_mark_mtinfo1 { |
| 12 | __u32 mark, mask; | 7 | __u32 mark, mask; |
| 13 | __u8 invert; | 8 | __u8 invert; |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 590ac3d6d5d6..6fe3e6aa10db 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -265,7 +265,7 @@ struct arpt_error | |||
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | extern struct xt_table *arpt_register_table(struct net *net, | 267 | extern struct xt_table *arpt_register_table(struct net *net, |
| 268 | struct xt_table *table, | 268 | const struct xt_table *table, |
| 269 | const struct arpt_replace *repl); | 269 | const struct arpt_replace *repl); |
| 270 | extern void arpt_unregister_table(struct xt_table *table); | 270 | extern void arpt_unregister_table(struct xt_table *table); |
| 271 | extern unsigned int arpt_do_table(struct sk_buff *skb, | 271 | extern unsigned int arpt_do_table(struct sk_buff *skb, |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index e40ddb94b1af..ea281e6a2048 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
| @@ -301,7 +301,7 @@ struct ebt_table | |||
| 301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ | 301 | #define EBT_ALIGN(s) (((s) + (__alignof__(struct ebt_replace)-1)) & \ |
| 302 | ~(__alignof__(struct ebt_replace)-1)) | 302 | ~(__alignof__(struct ebt_replace)-1)) |
| 303 | extern struct ebt_table *ebt_register_table(struct net *net, | 303 | extern struct ebt_table *ebt_register_table(struct net *net, |
| 304 | struct ebt_table *table); | 304 | const struct ebt_table *table); |
| 305 | extern void ebt_unregister_table(struct ebt_table *table); | 305 | extern void ebt_unregister_table(struct ebt_table *table); |
| 306 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 306 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
| 307 | const struct net_device *in, const struct net_device *out, | 307 | const struct net_device *in, const struct net_device *out, |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 3a7105bb8f33..431b40761920 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
| @@ -1,46 +1,14 @@ | |||
| 1 | header-y += ipt_CLASSIFY.h | ||
| 2 | header-y += ipt_CLUSTERIP.h | 1 | header-y += ipt_CLUSTERIP.h |
| 3 | header-y += ipt_CONNMARK.h | ||
| 4 | header-y += ipt_DSCP.h | ||
| 5 | header-y += ipt_ECN.h | 2 | header-y += ipt_ECN.h |
| 6 | header-y += ipt_LOG.h | 3 | header-y += ipt_LOG.h |
| 7 | header-y += ipt_MARK.h | ||
| 8 | header-y += ipt_NFQUEUE.h | ||
| 9 | header-y += ipt_REJECT.h | 4 | header-y += ipt_REJECT.h |
| 10 | header-y += ipt_SAME.h | 5 | header-y += ipt_SAME.h |
| 11 | header-y += ipt_TCPMSS.h | ||
| 12 | header-y += ipt_TOS.h | ||
| 13 | header-y += ipt_TTL.h | 6 | header-y += ipt_TTL.h |
| 14 | header-y += ipt_ULOG.h | 7 | header-y += ipt_ULOG.h |
| 15 | header-y += ipt_addrtype.h | 8 | header-y += ipt_addrtype.h |
| 16 | header-y += ipt_ah.h | 9 | header-y += ipt_ah.h |
| 17 | header-y += ipt_comment.h | ||
| 18 | header-y += ipt_connbytes.h | ||
| 19 | header-y += ipt_connmark.h | ||
| 20 | header-y += ipt_conntrack.h | ||
| 21 | header-y += ipt_dccp.h | ||
| 22 | header-y += ipt_dscp.h | ||
| 23 | header-y += ipt_ecn.h | 10 | header-y += ipt_ecn.h |
| 24 | header-y += ipt_esp.h | ||
| 25 | header-y += ipt_hashlimit.h | ||
| 26 | header-y += ipt_helper.h | ||
| 27 | header-y += ipt_iprange.h | ||
| 28 | header-y += ipt_length.h | ||
| 29 | header-y += ipt_limit.h | ||
| 30 | header-y += ipt_mac.h | ||
| 31 | header-y += ipt_mark.h | ||
| 32 | header-y += ipt_multiport.h | ||
| 33 | header-y += ipt_owner.h | ||
| 34 | header-y += ipt_physdev.h | ||
| 35 | header-y += ipt_pkttype.h | ||
| 36 | header-y += ipt_policy.h | ||
| 37 | header-y += ipt_realm.h | 11 | header-y += ipt_realm.h |
| 38 | header-y += ipt_recent.h | ||
| 39 | header-y += ipt_sctp.h | ||
| 40 | header-y += ipt_state.h | ||
| 41 | header-y += ipt_string.h | ||
| 42 | header-y += ipt_tcpmss.h | ||
| 43 | header-y += ipt_tos.h | ||
| 44 | header-y += ipt_ttl.h | 12 | header-y += ipt_ttl.h |
| 45 | 13 | ||
| 46 | unifdef-y += ip_queue.h | 14 | unifdef-y += ip_queue.h |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 092bd50581a9..61fafc868a7b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -245,7 +245,7 @@ ipt_get_target(struct ipt_entry *e) | |||
| 245 | extern void ipt_init(void) __init; | 245 | extern void ipt_init(void) __init; |
| 246 | 246 | ||
| 247 | extern struct xt_table *ipt_register_table(struct net *net, | 247 | extern struct xt_table *ipt_register_table(struct net *net, |
| 248 | struct xt_table *table, | 248 | const struct xt_table *table, |
| 249 | const struct ipt_replace *repl); | 249 | const struct ipt_replace *repl); |
| 250 | extern void ipt_unregister_table(struct xt_table *table); | 250 | extern void ipt_unregister_table(struct xt_table *table); |
| 251 | 251 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h b/include/linux/netfilter_ipv4/ipt_CLASSIFY.h deleted file mode 100644 index a46d511b5c36..000000000000 --- a/include/linux/netfilter_ipv4/ipt_CLASSIFY.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_CLASSIFY_H | ||
| 2 | #define _IPT_CLASSIFY_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_CLASSIFY.h> | ||
| 5 | #define ipt_classify_target_info xt_classify_target_info | ||
| 6 | |||
| 7 | #endif /*_IPT_CLASSIFY_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_CONNMARK.h b/include/linux/netfilter_ipv4/ipt_CONNMARK.h deleted file mode 100644 index 9ecfee0a9e33..000000000000 --- a/include/linux/netfilter_ipv4/ipt_CONNMARK.h +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | #ifndef _IPT_CONNMARK_H_target | ||
| 2 | #define _IPT_CONNMARK_H_target | ||
| 3 | |||
| 4 | /* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com> | ||
| 5 | * by Henrik Nordstrom <hno@marasystems.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | */ | ||
| 12 | #include <linux/netfilter/xt_CONNMARK.h> | ||
| 13 | #define IPT_CONNMARK_SET XT_CONNMARK_SET | ||
| 14 | #define IPT_CONNMARK_SAVE XT_CONNMARK_SAVE | ||
| 15 | #define IPT_CONNMARK_RESTORE XT_CONNMARK_RESTORE | ||
| 16 | |||
| 17 | #define ipt_connmark_target_info xt_connmark_target_info | ||
| 18 | |||
| 19 | #endif /*_IPT_CONNMARK_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_DSCP.h b/include/linux/netfilter_ipv4/ipt_DSCP.h deleted file mode 100644 index 3491e524d5ea..000000000000 --- a/include/linux/netfilter_ipv4/ipt_DSCP.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | /* iptables module for setting the IPv4 DSCP field | ||
| 2 | * | ||
| 3 | * (C) 2002 Harald Welte <laforge@gnumonks.org> | ||
| 4 | * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com> | ||
| 5 | * This software is distributed under GNU GPL v2, 1991 | ||
| 6 | * | ||
| 7 | * See RFC2474 for a description of the DSCP field within the IP Header. | ||
| 8 | * | ||
| 9 | * ipt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp | ||
| 10 | */ | ||
| 11 | #ifndef _IPT_DSCP_TARGET_H | ||
| 12 | #define _IPT_DSCP_TARGET_H | ||
| 13 | #include <linux/netfilter_ipv4/ipt_dscp.h> | ||
| 14 | #include <linux/netfilter/xt_DSCP.h> | ||
| 15 | |||
| 16 | #define ipt_DSCP_info xt_DSCP_info | ||
| 17 | |||
| 18 | #endif /* _IPT_DSCP_TARGET_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_ECN.h b/include/linux/netfilter_ipv4/ipt_ECN.h index 94e0d9866469..7ca45918ab8e 100644 --- a/include/linux/netfilter_ipv4/ipt_ECN.h +++ b/include/linux/netfilter_ipv4/ipt_ECN.h | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | */ | 8 | */ |
| 9 | #ifndef _IPT_ECN_TARGET_H | 9 | #ifndef _IPT_ECN_TARGET_H |
| 10 | #define _IPT_ECN_TARGET_H | 10 | #define _IPT_ECN_TARGET_H |
| 11 | #include <linux/netfilter_ipv4/ipt_DSCP.h> | 11 | #include <linux/netfilter/xt_DSCP.h> |
| 12 | 12 | ||
| 13 | #define IPT_ECN_IP_MASK (~IPT_DSCP_MASK) | 13 | #define IPT_ECN_IP_MASK (~XT_DSCP_MASK) |
| 14 | 14 | ||
| 15 | #define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */ | 15 | #define IPT_ECN_OP_SET_IP 0x01 /* set ECN bits of IPv4 header */ |
| 16 | #define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */ | 16 | #define IPT_ECN_OP_SET_ECE 0x10 /* set ECE bit of TCP header */ |
diff --git a/include/linux/netfilter_ipv4/ipt_MARK.h b/include/linux/netfilter_ipv4/ipt_MARK.h deleted file mode 100644 index 697a486a96d3..000000000000 --- a/include/linux/netfilter_ipv4/ipt_MARK.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _IPT_MARK_H_target | ||
| 2 | #define _IPT_MARK_H_target | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_MARK.h> | ||
| 7 | |||
| 8 | /* Version 0 */ | ||
| 9 | #define ipt_mark_target_info xt_mark_target_info | ||
| 10 | |||
| 11 | /* Version 1 */ | ||
| 12 | #define IPT_MARK_SET XT_MARK_SET | ||
| 13 | #define IPT_MARK_AND XT_MARK_AND | ||
| 14 | #define IPT_MARK_OR XT_MARK_OR | ||
| 15 | |||
| 16 | #define ipt_mark_target_info_v1 xt_mark_target_info_v1 | ||
| 17 | |||
| 18 | #endif /*_IPT_MARK_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/include/linux/netfilter_ipv4/ipt_NFQUEUE.h deleted file mode 100644 index 97a2a7557cb9..000000000000 --- a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h +++ /dev/null | |||
| @@ -1,16 +0,0 @@ | |||
| 1 | /* iptables module for using NFQUEUE mechanism | ||
| 2 | * | ||
| 3 | * (C) 2005 Harald Welte <laforge@netfilter.org> | ||
| 4 | * | ||
| 5 | * This software is distributed under GNU GPL v2, 1991 | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | #ifndef _IPT_NFQ_TARGET_H | ||
| 9 | #define _IPT_NFQ_TARGET_H | ||
| 10 | |||
| 11 | /* Backwards compatibility for old userspace */ | ||
| 12 | #include <linux/netfilter/xt_NFQUEUE.h> | ||
| 13 | |||
| 14 | #define ipt_NFQ_info xt_NFQ_info | ||
| 15 | |||
| 16 | #endif /* _IPT_DSCP_TARGET_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_TCPMSS.h b/include/linux/netfilter_ipv4/ipt_TCPMSS.h deleted file mode 100644 index 7a850f945824..000000000000 --- a/include/linux/netfilter_ipv4/ipt_TCPMSS.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IPT_TCPMSS_H | ||
| 2 | #define _IPT_TCPMSS_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_TCPMSS.h> | ||
| 5 | |||
| 6 | #define ipt_tcpmss_info xt_tcpmss_info | ||
| 7 | #define IPT_TCPMSS_CLAMP_PMTU XT_TCPMSS_CLAMP_PMTU | ||
| 8 | |||
| 9 | #endif /*_IPT_TCPMSS_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_TOS.h b/include/linux/netfilter_ipv4/ipt_TOS.h deleted file mode 100644 index 6bf9e1fdfd88..000000000000 --- a/include/linux/netfilter_ipv4/ipt_TOS.h +++ /dev/null | |||
| @@ -1,12 +0,0 @@ | |||
| 1 | #ifndef _IPT_TOS_H_target | ||
| 2 | #define _IPT_TOS_H_target | ||
| 3 | |||
| 4 | #ifndef IPTOS_NORMALSVC | ||
| 5 | #define IPTOS_NORMALSVC 0 | ||
| 6 | #endif | ||
| 7 | |||
| 8 | struct ipt_tos_target_info { | ||
| 9 | u_int8_t tos; | ||
| 10 | }; | ||
| 11 | |||
| 12 | #endif /*_IPT_TOS_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_comment.h b/include/linux/netfilter_ipv4/ipt_comment.h deleted file mode 100644 index ae2afc2f7481..000000000000 --- a/include/linux/netfilter_ipv4/ipt_comment.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IPT_COMMENT_H | ||
| 2 | #define _IPT_COMMENT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_comment.h> | ||
| 5 | |||
| 6 | #define IPT_MAX_COMMENT_LEN XT_MAX_COMMENT_LEN | ||
| 7 | |||
| 8 | #define ipt_comment_info xt_comment_info | ||
| 9 | |||
| 10 | #endif /* _IPT_COMMENT_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h deleted file mode 100644 index f63e6ee91113..000000000000 --- a/include/linux/netfilter_ipv4/ipt_connbytes.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _IPT_CONNBYTES_H | ||
| 2 | #define _IPT_CONNBYTES_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_connbytes.h> | ||
| 5 | #define ipt_connbytes_what xt_connbytes_what | ||
| 6 | |||
| 7 | #define IPT_CONNBYTES_PKTS XT_CONNBYTES_PKTS | ||
| 8 | #define IPT_CONNBYTES_BYTES XT_CONNBYTES_BYTES | ||
| 9 | #define IPT_CONNBYTES_AVGPKT XT_CONNBYTES_AVGPKT | ||
| 10 | |||
| 11 | #define ipt_connbytes_direction xt_connbytes_direction | ||
| 12 | #define IPT_CONNBYTES_DIR_ORIGINAL XT_CONNBYTES_DIR_ORIGINAL | ||
| 13 | #define IPT_CONNBYTES_DIR_REPLY XT_CONNBYTES_DIR_REPLY | ||
| 14 | #define IPT_CONNBYTES_DIR_BOTH XT_CONNBYTES_DIR_BOTH | ||
| 15 | |||
| 16 | #define ipt_connbytes_info xt_connbytes_info | ||
| 17 | |||
| 18 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ipt_connmark.h b/include/linux/netfilter_ipv4/ipt_connmark.h deleted file mode 100644 index c7ba6560d44c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_connmark.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_CONNMARK_H | ||
| 2 | #define _IPT_CONNMARK_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_connmark.h> | ||
| 5 | #define ipt_connmark_info xt_connmark_info | ||
| 6 | |||
| 7 | #endif /*_IPT_CONNMARK_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_conntrack.h b/include/linux/netfilter_ipv4/ipt_conntrack.h deleted file mode 100644 index cde6762949c5..000000000000 --- a/include/linux/netfilter_ipv4/ipt_conntrack.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | /* Header file for kernel module to match connection tracking information. | ||
| 2 | * GPL (C) 2001 Marc Boucher (marc@mbsi.ca). | ||
| 3 | */ | ||
| 4 | |||
| 5 | #ifndef _IPT_CONNTRACK_H | ||
| 6 | #define _IPT_CONNTRACK_H | ||
| 7 | |||
| 8 | #include <linux/netfilter/xt_conntrack.h> | ||
| 9 | |||
| 10 | #define IPT_CONNTRACK_STATE_BIT(ctinfo) XT_CONNTRACK_STATE_BIT(ctinfo) | ||
| 11 | #define IPT_CONNTRACK_STATE_INVALID XT_CONNTRACK_STATE_INVALID | ||
| 12 | |||
| 13 | #define IPT_CONNTRACK_STATE_SNAT XT_CONNTRACK_STATE_SNAT | ||
| 14 | #define IPT_CONNTRACK_STATE_DNAT XT_CONNTRACK_STATE_DNAT | ||
| 15 | #define IPT_CONNTRACK_STATE_UNTRACKED XT_CONNTRACK_STATE_UNTRACKED | ||
| 16 | |||
| 17 | /* flags, invflags: */ | ||
| 18 | #define IPT_CONNTRACK_STATE XT_CONNTRACK_STATE | ||
| 19 | #define IPT_CONNTRACK_PROTO XT_CONNTRACK_PROTO | ||
| 20 | #define IPT_CONNTRACK_ORIGSRC XT_CONNTRACK_ORIGSRC | ||
| 21 | #define IPT_CONNTRACK_ORIGDST XT_CONNTRACK_ORIGDST | ||
| 22 | #define IPT_CONNTRACK_REPLSRC XT_CONNTRACK_REPLSRC | ||
| 23 | #define IPT_CONNTRACK_REPLDST XT_CONNTRACK_REPLDST | ||
| 24 | #define IPT_CONNTRACK_STATUS XT_CONNTRACK_STATUS | ||
| 25 | #define IPT_CONNTRACK_EXPIRES XT_CONNTRACK_EXPIRES | ||
| 26 | |||
| 27 | #define ipt_conntrack_info xt_conntrack_info | ||
| 28 | #endif /*_IPT_CONNTRACK_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_dccp.h b/include/linux/netfilter_ipv4/ipt_dccp.h deleted file mode 100644 index e70d11e1f53c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_dccp.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _IPT_DCCP_H_ | ||
| 2 | #define _IPT_DCCP_H_ | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_dccp.h> | ||
| 5 | #define IPT_DCCP_SRC_PORTS XT_DCCP_SRC_PORTS | ||
| 6 | #define IPT_DCCP_DEST_PORTS XT_DCCP_DEST_PORTS | ||
| 7 | #define IPT_DCCP_TYPE XT_DCCP_TYPE | ||
| 8 | #define IPT_DCCP_OPTION XT_DCCP_OPTION | ||
| 9 | |||
| 10 | #define IPT_DCCP_VALID_FLAGS XT_DCCP_VALID_FLAGS | ||
| 11 | |||
| 12 | #define ipt_dccp_info xt_dccp_info | ||
| 13 | |||
| 14 | #endif /* _IPT_DCCP_H_ */ | ||
| 15 | |||
diff --git a/include/linux/netfilter_ipv4/ipt_dscp.h b/include/linux/netfilter_ipv4/ipt_dscp.h deleted file mode 100644 index 4b82ca912b0e..000000000000 --- a/include/linux/netfilter_ipv4/ipt_dscp.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | /* iptables module for matching the IPv4 DSCP field | ||
| 2 | * | ||
| 3 | * (C) 2002 Harald Welte <laforge@gnumonks.org> | ||
| 4 | * This software is distributed under GNU GPL v2, 1991 | ||
| 5 | * | ||
| 6 | * See RFC2474 for a description of the DSCP field within the IP Header. | ||
| 7 | * | ||
| 8 | * ipt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp | ||
| 9 | */ | ||
| 10 | #ifndef _IPT_DSCP_H | ||
| 11 | #define _IPT_DSCP_H | ||
| 12 | |||
| 13 | #include <linux/netfilter/xt_dscp.h> | ||
| 14 | |||
| 15 | #define IPT_DSCP_MASK XT_DSCP_MASK | ||
| 16 | #define IPT_DSCP_SHIFT XT_DSCP_SHIFT | ||
| 17 | #define IPT_DSCP_MAX XT_DSCP_MAX | ||
| 18 | |||
| 19 | #define ipt_dscp_info xt_dscp_info | ||
| 20 | |||
| 21 | #endif /* _IPT_DSCP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_ecn.h b/include/linux/netfilter_ipv4/ipt_ecn.h index 1f0d9a4d3378..9945baa4ccd7 100644 --- a/include/linux/netfilter_ipv4/ipt_ecn.h +++ b/include/linux/netfilter_ipv4/ipt_ecn.h | |||
| @@ -8,9 +8,9 @@ | |||
| 8 | */ | 8 | */ |
| 9 | #ifndef _IPT_ECN_H | 9 | #ifndef _IPT_ECN_H |
| 10 | #define _IPT_ECN_H | 10 | #define _IPT_ECN_H |
| 11 | #include <linux/netfilter_ipv4/ipt_dscp.h> | 11 | #include <linux/netfilter/xt_dscp.h> |
| 12 | 12 | ||
| 13 | #define IPT_ECN_IP_MASK (~IPT_DSCP_MASK) | 13 | #define IPT_ECN_IP_MASK (~XT_DSCP_MASK) |
| 14 | 14 | ||
| 15 | #define IPT_ECN_OP_MATCH_IP 0x01 | 15 | #define IPT_ECN_OP_MATCH_IP 0x01 |
| 16 | #define IPT_ECN_OP_MATCH_ECE 0x10 | 16 | #define IPT_ECN_OP_MATCH_ECE 0x10 |
diff --git a/include/linux/netfilter_ipv4/ipt_esp.h b/include/linux/netfilter_ipv4/ipt_esp.h deleted file mode 100644 index 78296e7eeff9..000000000000 --- a/include/linux/netfilter_ipv4/ipt_esp.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IPT_ESP_H | ||
| 2 | #define _IPT_ESP_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_esp.h> | ||
| 5 | |||
| 6 | #define ipt_esp xt_esp | ||
| 7 | #define IPT_ESP_INV_SPI XT_ESP_INV_SPI | ||
| 8 | #define IPT_ESP_INV_MASK XT_ESP_INV_MASK | ||
| 9 | |||
| 10 | #endif /*_IPT_ESP_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_hashlimit.h b/include/linux/netfilter_ipv4/ipt_hashlimit.h deleted file mode 100644 index 5662120a3d7b..000000000000 --- a/include/linux/netfilter_ipv4/ipt_hashlimit.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef _IPT_HASHLIMIT_H | ||
| 2 | #define _IPT_HASHLIMIT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_hashlimit.h> | ||
| 5 | |||
| 6 | #define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE | ||
| 7 | #define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP | ||
| 8 | #define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT | ||
| 9 | #define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP | ||
| 10 | #define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT | ||
| 11 | |||
| 12 | #define ipt_hashlimit_info xt_hashlimit_info | ||
| 13 | |||
| 14 | #endif /* _IPT_HASHLIMIT_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_helper.h b/include/linux/netfilter_ipv4/ipt_helper.h deleted file mode 100644 index 80452c218551..000000000000 --- a/include/linux/netfilter_ipv4/ipt_helper.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_HELPER_H | ||
| 2 | #define _IPT_HELPER_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_helper.h> | ||
| 5 | #define ipt_helper_info xt_helper_info | ||
| 6 | |||
| 7 | #endif /* _IPT_HELPER_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h deleted file mode 100644 index 5f1aebde4d2f..000000000000 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #ifndef _IPT_IPRANGE_H | ||
| 2 | #define _IPT_IPRANGE_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | #include <linux/netfilter/xt_iprange.h> | ||
| 6 | |||
| 7 | struct ipt_iprange { | ||
| 8 | /* Inclusive: network order. */ | ||
| 9 | __be32 min_ip, max_ip; | ||
| 10 | }; | ||
| 11 | |||
| 12 | struct ipt_iprange_info | ||
| 13 | { | ||
| 14 | struct ipt_iprange src; | ||
| 15 | struct ipt_iprange dst; | ||
| 16 | |||
| 17 | /* Flags from above */ | ||
| 18 | u_int8_t flags; | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif /* _IPT_IPRANGE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_length.h b/include/linux/netfilter_ipv4/ipt_length.h deleted file mode 100644 index 9b45206ffcef..000000000000 --- a/include/linux/netfilter_ipv4/ipt_length.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_LENGTH_H | ||
| 2 | #define _IPT_LENGTH_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_length.h> | ||
| 5 | #define ipt_length_info xt_length_info | ||
| 6 | |||
| 7 | #endif /*_IPT_LENGTH_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_limit.h b/include/linux/netfilter_ipv4/ipt_limit.h deleted file mode 100644 index 92f5cd07bbc4..000000000000 --- a/include/linux/netfilter_ipv4/ipt_limit.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _IPT_RATE_H | ||
| 2 | #define _IPT_RATE_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_limit.h> | ||
| 5 | #define IPT_LIMIT_SCALE XT_LIMIT_SCALE | ||
| 6 | #define ipt_rateinfo xt_rateinfo | ||
| 7 | |||
| 8 | #endif /*_IPT_RATE_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_mac.h b/include/linux/netfilter_ipv4/ipt_mac.h deleted file mode 100644 index b186008a3c47..000000000000 --- a/include/linux/netfilter_ipv4/ipt_mac.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_MAC_H | ||
| 2 | #define _IPT_MAC_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_mac.h> | ||
| 5 | #define ipt_mac_info xt_mac_info | ||
| 6 | |||
| 7 | #endif /*_IPT_MAC_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_mark.h b/include/linux/netfilter_ipv4/ipt_mark.h deleted file mode 100644 index bfde67c61224..000000000000 --- a/include/linux/netfilter_ipv4/ipt_mark.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IPT_MARK_H | ||
| 2 | #define _IPT_MARK_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | #include <linux/netfilter/xt_mark.h> | ||
| 6 | |||
| 7 | #define ipt_mark_info xt_mark_info | ||
| 8 | |||
| 9 | #endif /*_IPT_MARK_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_multiport.h b/include/linux/netfilter_ipv4/ipt_multiport.h deleted file mode 100644 index 55fe85eca88c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_multiport.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _IPT_MULTIPORT_H | ||
| 2 | #define _IPT_MULTIPORT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_multiport.h> | ||
| 5 | |||
| 6 | #define IPT_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE | ||
| 7 | #define IPT_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION | ||
| 8 | #define IPT_MULTIPORT_EITHER XT_MULTIPORT_EITHER | ||
| 9 | |||
| 10 | #define IPT_MULTI_PORTS XT_MULTI_PORTS | ||
| 11 | |||
| 12 | #define ipt_multiport xt_multiport | ||
| 13 | #define ipt_multiport_v1 xt_multiport_v1 | ||
| 14 | |||
| 15 | #endif /*_IPT_MULTIPORT_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_owner.h b/include/linux/netfilter_ipv4/ipt_owner.h deleted file mode 100644 index a78445be9992..000000000000 --- a/include/linux/netfilter_ipv4/ipt_owner.h +++ /dev/null | |||
| @@ -1,20 +0,0 @@ | |||
| 1 | #ifndef _IPT_OWNER_H | ||
| 2 | #define _IPT_OWNER_H | ||
| 3 | |||
| 4 | /* match and invert flags */ | ||
| 5 | #define IPT_OWNER_UID 0x01 | ||
| 6 | #define IPT_OWNER_GID 0x02 | ||
| 7 | #define IPT_OWNER_PID 0x04 | ||
| 8 | #define IPT_OWNER_SID 0x08 | ||
| 9 | #define IPT_OWNER_COMM 0x10 | ||
| 10 | |||
| 11 | struct ipt_owner_info { | ||
| 12 | __kernel_uid32_t uid; | ||
| 13 | __kernel_gid32_t gid; | ||
| 14 | __kernel_pid_t pid; | ||
| 15 | __kernel_pid_t sid; | ||
| 16 | char comm[16]; | ||
| 17 | u_int8_t match, invert; /* flags */ | ||
| 18 | }; | ||
| 19 | |||
| 20 | #endif /*_IPT_OWNER_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_physdev.h b/include/linux/netfilter_ipv4/ipt_physdev.h deleted file mode 100644 index 2400e7140f26..000000000000 --- a/include/linux/netfilter_ipv4/ipt_physdev.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef _IPT_PHYSDEV_H | ||
| 2 | #define _IPT_PHYSDEV_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_physdev.h> | ||
| 7 | |||
| 8 | #define IPT_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN | ||
| 9 | #define IPT_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT | ||
| 10 | #define IPT_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED | ||
| 11 | #define IPT_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN | ||
| 12 | #define IPT_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT | ||
| 13 | #define IPT_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK | ||
| 14 | |||
| 15 | #define ipt_physdev_info xt_physdev_info | ||
| 16 | |||
| 17 | #endif /*_IPT_PHYSDEV_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_pkttype.h b/include/linux/netfilter_ipv4/ipt_pkttype.h deleted file mode 100644 index ff1fbc949a0c..000000000000 --- a/include/linux/netfilter_ipv4/ipt_pkttype.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_PKTTYPE_H | ||
| 2 | #define _IPT_PKTTYPE_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_pkttype.h> | ||
| 5 | #define ipt_pkttype_info xt_pkttype_info | ||
| 6 | |||
| 7 | #endif /*_IPT_PKTTYPE_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h deleted file mode 100644 index 1037fb2cd206..000000000000 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #ifndef _IPT_POLICY_H | ||
| 2 | #define _IPT_POLICY_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_policy.h> | ||
| 5 | |||
| 6 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | ||
| 7 | |||
| 8 | /* ipt_policy_flags */ | ||
| 9 | #define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN | ||
| 10 | #define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT | ||
| 11 | #define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE | ||
| 12 | #define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT | ||
| 13 | |||
| 14 | /* ipt_policy_modes */ | ||
| 15 | #define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | ||
| 16 | #define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL | ||
| 17 | |||
| 18 | #define ipt_policy_spec xt_policy_spec | ||
| 19 | #define ipt_policy_addr xt_policy_addr | ||
| 20 | #define ipt_policy_elem xt_policy_elem | ||
| 21 | #define ipt_policy_info xt_policy_info | ||
| 22 | |||
| 23 | #endif /* _IPT_POLICY_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_recent.h b/include/linux/netfilter_ipv4/ipt_recent.h deleted file mode 100644 index d636cca133c2..000000000000 --- a/include/linux/netfilter_ipv4/ipt_recent.h +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | #ifndef _IPT_RECENT_H | ||
| 2 | #define _IPT_RECENT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_recent.h> | ||
| 5 | |||
| 6 | #define ipt_recent_info xt_recent_mtinfo | ||
| 7 | |||
| 8 | enum { | ||
| 9 | IPT_RECENT_CHECK = XT_RECENT_CHECK, | ||
| 10 | IPT_RECENT_SET = XT_RECENT_SET, | ||
| 11 | IPT_RECENT_UPDATE = XT_RECENT_UPDATE, | ||
| 12 | IPT_RECENT_REMOVE = XT_RECENT_REMOVE, | ||
| 13 | IPT_RECENT_TTL = XT_RECENT_TTL, | ||
| 14 | |||
| 15 | IPT_RECENT_SOURCE = XT_RECENT_SOURCE, | ||
| 16 | IPT_RECENT_DEST = XT_RECENT_DEST, | ||
| 17 | |||
| 18 | IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN, | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif /*_IPT_RECENT_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_sctp.h b/include/linux/netfilter_ipv4/ipt_sctp.h deleted file mode 100644 index 80b3dbacd193..000000000000 --- a/include/linux/netfilter_ipv4/ipt_sctp.h +++ /dev/null | |||
| @@ -1,105 +0,0 @@ | |||
| 1 | #ifndef _IPT_SCTP_H_ | ||
| 2 | #define _IPT_SCTP_H_ | ||
| 3 | |||
| 4 | #define IPT_SCTP_SRC_PORTS 0x01 | ||
| 5 | #define IPT_SCTP_DEST_PORTS 0x02 | ||
| 6 | #define IPT_SCTP_CHUNK_TYPES 0x04 | ||
| 7 | |||
| 8 | #define IPT_SCTP_VALID_FLAGS 0x07 | ||
| 9 | |||
| 10 | |||
| 11 | struct ipt_sctp_flag_info { | ||
| 12 | u_int8_t chunktype; | ||
| 13 | u_int8_t flag; | ||
| 14 | u_int8_t flag_mask; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #define IPT_NUM_SCTP_FLAGS 4 | ||
| 18 | |||
| 19 | struct ipt_sctp_info { | ||
| 20 | u_int16_t dpts[2]; /* Min, Max */ | ||
| 21 | u_int16_t spts[2]; /* Min, Max */ | ||
| 22 | |||
| 23 | u_int32_t chunkmap[256 / sizeof (u_int32_t)]; /* Bit mask of chunks to be matched according to RFC 2960 */ | ||
| 24 | |||
| 25 | #define SCTP_CHUNK_MATCH_ANY 0x01 /* Match if any of the chunk types are present */ | ||
| 26 | #define SCTP_CHUNK_MATCH_ALL 0x02 /* Match if all of the chunk types are present */ | ||
| 27 | #define SCTP_CHUNK_MATCH_ONLY 0x04 /* Match if these are the only chunk types present */ | ||
| 28 | |||
| 29 | u_int32_t chunk_match_type; | ||
| 30 | struct ipt_sctp_flag_info flag_info[IPT_NUM_SCTP_FLAGS]; | ||
| 31 | int flag_count; | ||
| 32 | |||
| 33 | u_int32_t flags; | ||
| 34 | u_int32_t invflags; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define bytes(type) (sizeof(type) * 8) | ||
| 38 | |||
| 39 | #define SCTP_CHUNKMAP_SET(chunkmap, type) \ | ||
| 40 | do { \ | ||
| 41 | chunkmap[type / bytes(u_int32_t)] |= \ | ||
| 42 | 1 << (type % bytes(u_int32_t)); \ | ||
| 43 | } while (0) | ||
| 44 | |||
| 45 | #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ | ||
| 46 | do { \ | ||
| 47 | chunkmap[type / bytes(u_int32_t)] &= \ | ||
| 48 | ~(1 << (type % bytes(u_int32_t))); \ | ||
| 49 | } while (0) | ||
| 50 | |||
| 51 | #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ | ||
| 52 | ({ \ | ||
| 53 | (chunkmap[type / bytes (u_int32_t)] & \ | ||
| 54 | (1 << (type % bytes (u_int32_t)))) ? 1: 0; \ | ||
| 55 | }) | ||
| 56 | |||
| 57 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ | ||
| 58 | do { \ | ||
| 59 | int i; \ | ||
| 60 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | ||
| 61 | chunkmap[i] = 0; \ | ||
| 62 | } while (0) | ||
| 63 | |||
| 64 | #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ | ||
| 65 | do { \ | ||
| 66 | int i; \ | ||
| 67 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | ||
| 68 | chunkmap[i] = ~0; \ | ||
| 69 | } while (0) | ||
| 70 | |||
| 71 | #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ | ||
| 72 | do { \ | ||
| 73 | int i; \ | ||
| 74 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | ||
| 75 | destmap[i] = srcmap[i]; \ | ||
| 76 | } while (0) | ||
| 77 | |||
| 78 | #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \ | ||
| 79 | ({ \ | ||
| 80 | int i; \ | ||
| 81 | int flag = 1; \ | ||
| 82 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ | ||
| 83 | if (chunkmap[i]) { \ | ||
| 84 | flag = 0; \ | ||
| 85 | break; \ | ||
| 86 | } \ | ||
| 87 | } \ | ||
| 88 | flag; \ | ||
| 89 | }) | ||
| 90 | |||
| 91 | #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \ | ||
| 92 | ({ \ | ||
| 93 | int i; \ | ||
| 94 | int flag = 1; \ | ||
| 95 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ | ||
| 96 | if (chunkmap[i] != ~0) { \ | ||
| 97 | flag = 0; \ | ||
| 98 | break; \ | ||
| 99 | } \ | ||
| 100 | } \ | ||
| 101 | flag; \ | ||
| 102 | }) | ||
| 103 | |||
| 104 | #endif /* _IPT_SCTP_H_ */ | ||
| 105 | |||
diff --git a/include/linux/netfilter_ipv4/ipt_state.h b/include/linux/netfilter_ipv4/ipt_state.h deleted file mode 100644 index a44a99cc28cc..000000000000 --- a/include/linux/netfilter_ipv4/ipt_state.h +++ /dev/null | |||
| @@ -1,15 +0,0 @@ | |||
| 1 | #ifndef _IPT_STATE_H | ||
| 2 | #define _IPT_STATE_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_state.h> | ||
| 7 | |||
| 8 | #define IPT_STATE_BIT XT_STATE_BIT | ||
| 9 | #define IPT_STATE_INVALID XT_STATE_INVALID | ||
| 10 | |||
| 11 | #define IPT_STATE_UNTRACKED XT_STATE_UNTRACKED | ||
| 12 | |||
| 13 | #define ipt_state_info xt_state_info | ||
| 14 | |||
| 15 | #endif /*_IPT_STATE_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_string.h b/include/linux/netfilter_ipv4/ipt_string.h deleted file mode 100644 index c26de3059903..000000000000 --- a/include/linux/netfilter_ipv4/ipt_string.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IPT_STRING_H | ||
| 2 | #define _IPT_STRING_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_string.h> | ||
| 5 | |||
| 6 | #define IPT_STRING_MAX_PATTERN_SIZE XT_STRING_MAX_PATTERN_SIZE | ||
| 7 | #define IPT_STRING_MAX_ALGO_NAME_SIZE XT_STRING_MAX_ALGO_NAME_SIZE | ||
| 8 | #define ipt_string_info xt_string_info | ||
| 9 | |||
| 10 | #endif /*_IPT_STRING_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_tcpmss.h b/include/linux/netfilter_ipv4/ipt_tcpmss.h deleted file mode 100644 index 18bbc8e8e009..000000000000 --- a/include/linux/netfilter_ipv4/ipt_tcpmss.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IPT_TCPMSS_MATCH_H | ||
| 2 | #define _IPT_TCPMSS_MATCH_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_tcpmss.h> | ||
| 5 | #define ipt_tcpmss_match_info xt_tcpmss_match_info | ||
| 6 | |||
| 7 | #endif /*_IPT_TCPMSS_MATCH_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_tos.h b/include/linux/netfilter_ipv4/ipt_tos.h deleted file mode 100644 index a21f5df23c50..000000000000 --- a/include/linux/netfilter_ipv4/ipt_tos.h +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | #ifndef _IPT_TOS_H | ||
| 2 | #define _IPT_TOS_H | ||
| 3 | |||
| 4 | struct ipt_tos_info { | ||
| 5 | u_int8_t tos; | ||
| 6 | u_int8_t invert; | ||
| 7 | }; | ||
| 8 | |||
| 9 | #ifndef IPTOS_NORMALSVC | ||
| 10 | #define IPTOS_NORMALSVC 0 | ||
| 11 | #endif | ||
| 12 | |||
| 13 | #endif /*_IPT_TOS_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild index aca4bd1f6d7c..e864eaee9e5e 100644 --- a/include/linux/netfilter_ipv6/Kbuild +++ b/include/linux/netfilter_ipv6/Kbuild | |||
| @@ -1,22 +1,12 @@ | |||
| 1 | header-y += ip6t_HL.h | 1 | header-y += ip6t_HL.h |
| 2 | header-y += ip6t_LOG.h | 2 | header-y += ip6t_LOG.h |
| 3 | header-y += ip6t_MARK.h | ||
| 4 | header-y += ip6t_REJECT.h | 3 | header-y += ip6t_REJECT.h |
| 5 | header-y += ip6t_ah.h | 4 | header-y += ip6t_ah.h |
| 6 | header-y += ip6t_esp.h | ||
| 7 | header-y += ip6t_frag.h | 5 | header-y += ip6t_frag.h |
| 8 | header-y += ip6t_hl.h | ||
| 9 | header-y += ip6t_ipv6header.h | 6 | header-y += ip6t_ipv6header.h |
| 10 | header-y += ip6t_length.h | 7 | header-y += ip6t_hl.h |
| 11 | header-y += ip6t_limit.h | ||
| 12 | header-y += ip6t_mac.h | ||
| 13 | header-y += ip6t_mark.h | ||
| 14 | header-y += ip6t_mh.h | 8 | header-y += ip6t_mh.h |
| 15 | header-y += ip6t_multiport.h | ||
| 16 | header-y += ip6t_opts.h | 9 | header-y += ip6t_opts.h |
| 17 | header-y += ip6t_owner.h | ||
| 18 | header-y += ip6t_physdev.h | ||
| 19 | header-y += ip6t_policy.h | ||
| 20 | header-y += ip6t_rt.h | 10 | header-y += ip6t_rt.h |
| 21 | 11 | ||
| 22 | unifdef-y += ip6_tables.h | 12 | unifdef-y += ip6_tables.h |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 1089e33cf633..a64e1451ac38 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -306,7 +306,7 @@ ip6t_get_target(struct ip6t_entry *e) | |||
| 306 | extern void ip6t_init(void) __init; | 306 | extern void ip6t_init(void) __init; |
| 307 | 307 | ||
| 308 | extern struct xt_table *ip6t_register_table(struct net *net, | 308 | extern struct xt_table *ip6t_register_table(struct net *net, |
| 309 | struct xt_table *table, | 309 | const struct xt_table *table, |
| 310 | const struct ip6t_replace *repl); | 310 | const struct ip6t_replace *repl); |
| 311 | extern void ip6t_unregister_table(struct xt_table *table); | 311 | extern void ip6t_unregister_table(struct xt_table *table); |
| 312 | extern unsigned int ip6t_do_table(struct sk_buff *skb, | 312 | extern unsigned int ip6t_do_table(struct sk_buff *skb, |
diff --git a/include/linux/netfilter_ipv6/ip6t_MARK.h b/include/linux/netfilter_ipv6/ip6t_MARK.h deleted file mode 100644 index 7cf629a8ab92..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_MARK.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MARK_H_target | ||
| 2 | #define _IP6T_MARK_H_target | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | #include <linux/netfilter/xt_MARK.h> | ||
| 6 | |||
| 7 | #define ip6t_mark_target_info xt_mark_target_info | ||
| 8 | |||
| 9 | #endif /*_IP6T_MARK_H_target*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_esp.h b/include/linux/netfilter_ipv6/ip6t_esp.h deleted file mode 100644 index f62eaf53c16c..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_esp.h +++ /dev/null | |||
| @@ -1,10 +0,0 @@ | |||
| 1 | #ifndef _IP6T_ESP_H | ||
| 2 | #define _IP6T_ESP_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_esp.h> | ||
| 5 | |||
| 6 | #define ip6t_esp xt_esp | ||
| 7 | #define IP6T_ESP_INV_SPI XT_ESP_INV_SPI | ||
| 8 | #define IP6T_ESP_INV_MASK XT_ESP_INV_MASK | ||
| 9 | |||
| 10 | #endif /*_IP6T_ESP_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_length.h b/include/linux/netfilter_ipv6/ip6t_length.h deleted file mode 100644 index 9e9689d03ed7..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_length.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _IP6T_LENGTH_H | ||
| 2 | #define _IP6T_LENGTH_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_length.h> | ||
| 5 | #define ip6t_length_info xt_length_info | ||
| 6 | |||
| 7 | #endif /*_IP6T_LENGTH_H*/ | ||
| 8 | |||
diff --git a/include/linux/netfilter_ipv6/ip6t_limit.h b/include/linux/netfilter_ipv6/ip6t_limit.h deleted file mode 100644 index 487e5ea342c6..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_limit.h +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | #ifndef _IP6T_RATE_H | ||
| 2 | #define _IP6T_RATE_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_limit.h> | ||
| 5 | #define IP6T_LIMIT_SCALE XT_LIMIT_SCALE | ||
| 6 | #define ip6t_rateinfo xt_rateinfo | ||
| 7 | |||
| 8 | #endif /*_IP6T_RATE_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_mac.h b/include/linux/netfilter_ipv6/ip6t_mac.h deleted file mode 100644 index ac58e83e9423..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_mac.h +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MAC_H | ||
| 2 | #define _IP6T_MAC_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_mac.h> | ||
| 5 | #define ip6t_mac_info xt_mac_info | ||
| 6 | |||
| 7 | #endif /*_IP6T_MAC_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_mark.h b/include/linux/netfilter_ipv6/ip6t_mark.h deleted file mode 100644 index ff204951ddc3..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_mark.h +++ /dev/null | |||
| @@ -1,9 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MARK_H | ||
| 2 | #define _IP6T_MARK_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | #include <linux/netfilter/xt_mark.h> | ||
| 6 | |||
| 7 | #define ip6t_mark_info xt_mark_info | ||
| 8 | |||
| 9 | #endif /*_IPT_MARK_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_multiport.h b/include/linux/netfilter_ipv6/ip6t_multiport.h deleted file mode 100644 index 042c92661cee..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_multiport.h +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 1 | #ifndef _IP6T_MULTIPORT_H | ||
| 2 | #define _IP6T_MULTIPORT_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_multiport.h> | ||
| 5 | |||
| 6 | #define IP6T_MULTIPORT_SOURCE XT_MULTIPORT_SOURCE | ||
| 7 | #define IP6T_MULTIPORT_DESTINATION XT_MULTIPORT_DESTINATION | ||
| 8 | #define IP6T_MULTIPORT_EITHER XT_MULTIPORT_EITHER | ||
| 9 | |||
| 10 | #define IP6T_MULTI_PORTS XT_MULTI_PORTS | ||
| 11 | |||
| 12 | #define ip6t_multiport xt_multiport | ||
| 13 | |||
| 14 | #endif /*_IP6T_MULTIPORT_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_owner.h b/include/linux/netfilter_ipv6/ip6t_owner.h deleted file mode 100644 index ec5cc7a38c42..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_owner.h +++ /dev/null | |||
| @@ -1,18 +0,0 @@ | |||
| 1 | #ifndef _IP6T_OWNER_H | ||
| 2 | #define _IP6T_OWNER_H | ||
| 3 | |||
| 4 | /* match and invert flags */ | ||
| 5 | #define IP6T_OWNER_UID 0x01 | ||
| 6 | #define IP6T_OWNER_GID 0x02 | ||
| 7 | #define IP6T_OWNER_PID 0x04 | ||
| 8 | #define IP6T_OWNER_SID 0x08 | ||
| 9 | |||
| 10 | struct ip6t_owner_info { | ||
| 11 | __kernel_uid32_t uid; | ||
| 12 | __kernel_gid32_t gid; | ||
| 13 | __kernel_pid_t pid; | ||
| 14 | __kernel_pid_t sid; | ||
| 15 | u_int8_t match, invert; /* flags */ | ||
| 16 | }; | ||
| 17 | |||
| 18 | #endif /*_IPT_OWNER_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_physdev.h b/include/linux/netfilter_ipv6/ip6t_physdev.h deleted file mode 100644 index c161c0a81b55..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_physdev.h +++ /dev/null | |||
| @@ -1,17 +0,0 @@ | |||
| 1 | #ifndef _IP6T_PHYSDEV_H | ||
| 2 | #define _IP6T_PHYSDEV_H | ||
| 3 | |||
| 4 | /* Backwards compatibility for old userspace */ | ||
| 5 | |||
| 6 | #include <linux/netfilter/xt_physdev.h> | ||
| 7 | |||
| 8 | #define IP6T_PHYSDEV_OP_IN XT_PHYSDEV_OP_IN | ||
| 9 | #define IP6T_PHYSDEV_OP_OUT XT_PHYSDEV_OP_OUT | ||
| 10 | #define IP6T_PHYSDEV_OP_BRIDGED XT_PHYSDEV_OP_BRIDGED | ||
| 11 | #define IP6T_PHYSDEV_OP_ISIN XT_PHYSDEV_OP_ISIN | ||
| 12 | #define IP6T_PHYSDEV_OP_ISOUT XT_PHYSDEV_OP_ISOUT | ||
| 13 | #define IP6T_PHYSDEV_OP_MASK XT_PHYSDEV_OP_MASK | ||
| 14 | |||
| 15 | #define ip6t_physdev_info xt_physdev_info | ||
| 16 | |||
| 17 | #endif /*_IP6T_PHYSDEV_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h deleted file mode 100644 index b1c449d7ec89..000000000000 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ /dev/null | |||
| @@ -1,23 +0,0 @@ | |||
| 1 | #ifndef _IP6T_POLICY_H | ||
| 2 | #define _IP6T_POLICY_H | ||
| 3 | |||
| 4 | #include <linux/netfilter/xt_policy.h> | ||
| 5 | |||
| 6 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM | ||
| 7 | |||
| 8 | /* ip6t_policy_flags */ | ||
| 9 | #define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN | ||
| 10 | #define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT | ||
| 11 | #define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE | ||
| 12 | #define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT | ||
| 13 | |||
| 14 | /* ip6t_policy_modes */ | ||
| 15 | #define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | ||
| 16 | #define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL | ||
| 17 | |||
| 18 | #define ip6t_policy_spec xt_policy_spec | ||
| 19 | #define ip6t_policy_addr xt_policy_addr | ||
| 20 | #define ip6t_policy_elem xt_policy_elem | ||
| 21 | #define ip6t_policy_info xt_policy_info | ||
| 22 | |||
| 23 | #endif /* _IP6T_POLICY_H */ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 5ba398e90304..0fbecbbe8e9e 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -217,12 +217,13 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb); | |||
| 217 | 217 | ||
| 218 | struct netlink_callback | 218 | struct netlink_callback |
| 219 | { | 219 | { |
| 220 | struct sk_buff *skb; | 220 | struct sk_buff *skb; |
| 221 | struct nlmsghdr *nlh; | 221 | const struct nlmsghdr *nlh; |
| 222 | int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); | 222 | int (*dump)(struct sk_buff * skb, |
| 223 | int (*done)(struct netlink_callback *cb); | 223 | struct netlink_callback *cb); |
| 224 | int family; | 224 | int (*done)(struct netlink_callback *cb); |
| 225 | long args[6]; | 225 | int family; |
| 226 | long args[6]; | ||
| 226 | }; | 227 | }; |
| 227 | 228 | ||
| 228 | struct netlink_notify | 229 | struct netlink_notify |
| @@ -258,7 +259,7 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |||
| 258 | NLMSG_NEW(skb, pid, seq, type, len, 0) | 259 | NLMSG_NEW(skb, pid, seq, type, len, 0) |
| 259 | 260 | ||
| 260 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 261 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
| 261 | struct nlmsghdr *nlh, | 262 | const struct nlmsghdr *nlh, |
| 262 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), | 263 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), |
| 263 | int (*done)(struct netlink_callback*)); | 264 | int (*done)(struct netlink_callback*)); |
| 264 | 265 | ||
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index bd2eba530667..33b283601f62 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -472,6 +472,7 @@ enum lock_type4 { | |||
| 472 | 472 | ||
| 473 | #define NFSPROC4_NULL 0 | 473 | #define NFSPROC4_NULL 0 |
| 474 | #define NFSPROC4_COMPOUND 1 | 474 | #define NFSPROC4_COMPOUND 1 |
| 475 | #define NFS4_VERSION 4 | ||
| 475 | #define NFS4_MINOR_VERSION 0 | 476 | #define NFS4_MINOR_VERSION 0 |
| 476 | 477 | ||
| 477 | #if defined(CONFIG_NFS_V4_1) | 478 | #if defined(CONFIG_NFS_V4_1) |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index fdffb413b192..f6b90240dd41 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -473,7 +473,6 @@ extern int nfs_writepages(struct address_space *, struct writeback_control *); | |||
| 473 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 473 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
| 474 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); | 474 | extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); |
| 475 | extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); | 475 | extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); |
| 476 | extern void nfs_writedata_release(void *); | ||
| 477 | 476 | ||
| 478 | /* | 477 | /* |
| 479 | * Try to write back everything synchronously (but check the | 478 | * Try to write back everything synchronously (but check the |
| @@ -488,7 +487,6 @@ extern int nfs_wb_page_cancel(struct inode *inode, struct page* page); | |||
| 488 | extern int nfs_commit_inode(struct inode *, int); | 487 | extern int nfs_commit_inode(struct inode *, int); |
| 489 | extern struct nfs_write_data *nfs_commitdata_alloc(void); | 488 | extern struct nfs_write_data *nfs_commitdata_alloc(void); |
| 490 | extern void nfs_commit_free(struct nfs_write_data *wdata); | 489 | extern void nfs_commit_free(struct nfs_write_data *wdata); |
| 491 | extern void nfs_commitdata_release(void *wdata); | ||
| 492 | #else | 490 | #else |
| 493 | static inline int | 491 | static inline int |
| 494 | nfs_commit_inode(struct inode *inode, int how) | 492 | nfs_commit_inode(struct inode *inode, int how) |
| @@ -507,6 +505,7 @@ nfs_have_writebacks(struct inode *inode) | |||
| 507 | * Allocate nfs_write_data structures | 505 | * Allocate nfs_write_data structures |
| 508 | */ | 506 | */ |
| 509 | extern struct nfs_write_data *nfs_writedata_alloc(unsigned int npages); | 507 | extern struct nfs_write_data *nfs_writedata_alloc(unsigned int npages); |
| 508 | extern void nfs_writedata_free(struct nfs_write_data *); | ||
| 510 | 509 | ||
| 511 | /* | 510 | /* |
| 512 | * linux/fs/nfs/read.c | 511 | * linux/fs/nfs/read.c |
| @@ -515,7 +514,6 @@ extern int nfs_readpage(struct file *, struct page *); | |||
| 515 | extern int nfs_readpages(struct file *, struct address_space *, | 514 | extern int nfs_readpages(struct file *, struct address_space *, |
| 516 | struct list_head *, unsigned); | 515 | struct list_head *, unsigned); |
| 517 | extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); | 516 | extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); |
| 518 | extern void nfs_readdata_release(void *data); | ||
| 519 | extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, | 517 | extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, |
| 520 | struct page *); | 518 | struct page *); |
| 521 | 519 | ||
| @@ -523,6 +521,7 @@ extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, | |||
| 523 | * Allocate nfs_read_data structures | 521 | * Allocate nfs_read_data structures |
| 524 | */ | 522 | */ |
| 525 | extern struct nfs_read_data *nfs_readdata_alloc(unsigned int npages); | 523 | extern struct nfs_read_data *nfs_readdata_alloc(unsigned int npages); |
| 524 | extern void nfs_readdata_free(struct nfs_read_data *); | ||
| 526 | 525 | ||
| 527 | /* | 526 | /* |
| 528 | * linux/fs/nfs3proc.c | 527 | * linux/fs/nfs3proc.c |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 19fe15d12042..320569eabe3b 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -167,6 +167,15 @@ struct nfs_server { | |||
| 167 | #define NFS_CAP_SYMLINKS (1U << 2) | 167 | #define NFS_CAP_SYMLINKS (1U << 2) |
| 168 | #define NFS_CAP_ACLS (1U << 3) | 168 | #define NFS_CAP_ACLS (1U << 3) |
| 169 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) | 169 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) |
| 170 | #define NFS_CAP_CHANGE_ATTR (1U << 5) | ||
| 171 | #define NFS_CAP_FILEID (1U << 6) | ||
| 172 | #define NFS_CAP_MODE (1U << 7) | ||
| 173 | #define NFS_CAP_NLINK (1U << 8) | ||
| 174 | #define NFS_CAP_OWNER (1U << 9) | ||
| 175 | #define NFS_CAP_OWNER_GROUP (1U << 10) | ||
| 176 | #define NFS_CAP_ATIME (1U << 11) | ||
| 177 | #define NFS_CAP_CTIME (1U << 12) | ||
| 178 | #define NFS_CAP_MTIME (1U << 13) | ||
| 170 | 179 | ||
| 171 | 180 | ||
| 172 | /* maximum number of slots to use */ | 181 | /* maximum number of slots to use */ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index dbea93b694e5..a8d71ed43a0e 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -242,6 +242,29 @@ | |||
| 242 | * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is | 242 | * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is |
| 243 | * determined by the network interface. | 243 | * determined by the network interface. |
| 244 | * | 244 | * |
| 245 | * @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute | ||
| 246 | * to identify the device, and the TESTDATA blob attribute to pass through | ||
| 247 | * to the driver. | ||
| 248 | * | ||
| 249 | * @NL80211_CMD_CONNECT: connection request and notification; this command | ||
| 250 | * requests to connect to a specified network but without separating | ||
| 251 | * auth and assoc steps. For this, you need to specify the SSID in a | ||
| 252 | * %NL80211_ATTR_SSID attribute, and can optionally specify the association | ||
| 253 | * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, | ||
| 254 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. | ||
| 255 | * It is also sent as an event, with the BSSID and response IEs when the | ||
| 256 | * connection is established or failed to be established. This can be | ||
| 257 | * determined by the STATUS_CODE attribute. | ||
| 258 | * @NL80211_CMD_ROAM: request that the card roam (currently not implemented), | ||
| 259 | * sent as an event when the card/driver roamed by itself. | ||
| 260 | * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify | ||
| 261 | * userspace that a connection was dropped by the AP or due to other | ||
| 262 | * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and | ||
| 263 | * %NL80211_ATTR_REASON_CODE attributes are used. | ||
| 264 | * | ||
| 265 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices | ||
| 266 | * associated with this wiphy must be down and will follow. | ||
| 267 | * | ||
| 245 | * @NL80211_CMD_MAX: highest used command number | 268 | * @NL80211_CMD_MAX: highest used command number |
| 246 | * @__NL80211_CMD_AFTER_LAST: internal use | 269 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 247 | */ | 270 | */ |
| @@ -310,6 +333,14 @@ enum nl80211_commands { | |||
| 310 | NL80211_CMD_JOIN_IBSS, | 333 | NL80211_CMD_JOIN_IBSS, |
| 311 | NL80211_CMD_LEAVE_IBSS, | 334 | NL80211_CMD_LEAVE_IBSS, |
| 312 | 335 | ||
| 336 | NL80211_CMD_TESTMODE, | ||
| 337 | |||
| 338 | NL80211_CMD_CONNECT, | ||
| 339 | NL80211_CMD_ROAM, | ||
| 340 | NL80211_CMD_DISCONNECT, | ||
| 341 | |||
| 342 | NL80211_CMD_SET_WIPHY_NETNS, | ||
| 343 | |||
| 313 | /* add new commands above here */ | 344 | /* add new commands above here */ |
| 314 | 345 | ||
| 315 | /* used to define NL80211_CMD_MAX below */ | 346 | /* used to define NL80211_CMD_MAX below */ |
| @@ -449,10 +480,6 @@ enum nl80211_commands { | |||
| 449 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 480 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
| 450 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 481 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
| 451 | * scanning and include a zero-length SSID (wildcard) for wildcard scan | 482 | * scanning and include a zero-length SSID (wildcard) for wildcard scan |
| 452 | * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the | ||
| 453 | * scan result list changes (BSS expired or added) so that applications | ||
| 454 | * can verify that they got a single, consistent snapshot (when all dump | ||
| 455 | * messages carried the same generation number) | ||
| 456 | * @NL80211_ATTR_BSS: scan result BSS | 483 | * @NL80211_ATTR_BSS: scan result BSS |
| 457 | * | 484 | * |
| 458 | * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain | 485 | * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain |
| @@ -511,6 +538,52 @@ enum nl80211_commands { | |||
| 511 | * authorized by user space. Otherwise, port is marked authorized by | 538 | * authorized by user space. Otherwise, port is marked authorized by |
| 512 | * default in station mode. | 539 | * default in station mode. |
| 513 | * | 540 | * |
| 541 | * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. | ||
| 542 | * We recommend using nested, driver-specific attributes within this. | ||
| 543 | * | ||
| 544 | * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT | ||
| 545 | * event was due to the AP disconnecting the station, and not due to | ||
| 546 | * a local disconnect request. | ||
| 547 | * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT | ||
| 548 | * event (u16) | ||
| 549 | * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating | ||
| 550 | * that protected APs should be used. | ||
| 551 | * | ||
| 552 | * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to | ||
| 553 | * indicate which unicast key ciphers will be used with the connection | ||
| 554 | * (an array of u32). | ||
| 555 | * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate | ||
| 556 | * which group key cipher will be used with the connection (a u32). | ||
| 557 | * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate | ||
| 558 | * which WPA version(s) the AP we want to associate with is using | ||
| 559 | * (a u32 with flags from &enum nl80211_wpa_versions). | ||
| 560 | * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate | ||
| 561 | * which key management algorithm(s) to use (an array of u32). | ||
| 562 | * | ||
| 563 | * @NL80211_ATTR_REQ_IE: (Re)association request information elements as | ||
| 564 | * sent out by the card, for ROAM and successful CONNECT events. | ||
| 565 | * @NL80211_ATTR_RESP_IE: (Re)association response information elements as | ||
| 566 | * sent by peer, for ROAM and successful CONNECT events. | ||
| 567 | * | ||
| 568 | * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE | ||
| 569 | * commands to specify using a reassociate frame | ||
| 570 | * | ||
| 571 | * @NL80211_ATTR_KEY: key information in a nested attribute with | ||
| 572 | * %NL80211_KEY_* sub-attributes | ||
| 573 | * @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect() | ||
| 574 | * and join_ibss(), key information is in a nested attribute each | ||
| 575 | * with %NL80211_KEY_* sub-attributes | ||
| 576 | * | ||
| 577 | * @NL80211_ATTR_PID: Process ID of a network namespace. | ||
| 578 | * | ||
| 579 | * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for | ||
| 580 | * dumps. This number increases whenever the object list being | ||
| 581 | * dumped changes, and as such userspace can verify that it has | ||
| 582 | * obtained a complete and consistent snapshot by verifying that | ||
| 583 | * all dump messages contain the same generation number. If it | ||
| 584 | * changed then the list changed and the dump should be repeated | ||
| 585 | * completely from scratch. | ||
| 586 | * | ||
| 514 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 587 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 515 | * @__NL80211_ATTR_AFTER_LAST: internal use | 588 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 516 | */ | 589 | */ |
| @@ -582,7 +655,7 @@ enum nl80211_attrs { | |||
| 582 | 655 | ||
| 583 | NL80211_ATTR_SCAN_FREQUENCIES, | 656 | NL80211_ATTR_SCAN_FREQUENCIES, |
| 584 | NL80211_ATTR_SCAN_SSIDS, | 657 | NL80211_ATTR_SCAN_SSIDS, |
| 585 | NL80211_ATTR_SCAN_GENERATION, | 658 | NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */ |
| 586 | NL80211_ATTR_BSS, | 659 | NL80211_ATTR_BSS, |
| 587 | 660 | ||
| 588 | NL80211_ATTR_REG_INITIATOR, | 661 | NL80211_ATTR_REG_INITIATOR, |
| @@ -619,16 +692,42 @@ enum nl80211_attrs { | |||
| 619 | 692 | ||
| 620 | NL80211_ATTR_CONTROL_PORT, | 693 | NL80211_ATTR_CONTROL_PORT, |
| 621 | 694 | ||
| 695 | NL80211_ATTR_TESTDATA, | ||
| 696 | |||
| 697 | NL80211_ATTR_PRIVACY, | ||
| 698 | |||
| 699 | NL80211_ATTR_DISCONNECTED_BY_AP, | ||
| 700 | NL80211_ATTR_STATUS_CODE, | ||
| 701 | |||
| 702 | NL80211_ATTR_CIPHER_SUITES_PAIRWISE, | ||
| 703 | NL80211_ATTR_CIPHER_SUITE_GROUP, | ||
| 704 | NL80211_ATTR_WPA_VERSIONS, | ||
| 705 | NL80211_ATTR_AKM_SUITES, | ||
| 706 | |||
| 707 | NL80211_ATTR_REQ_IE, | ||
| 708 | NL80211_ATTR_RESP_IE, | ||
| 709 | |||
| 710 | NL80211_ATTR_PREV_BSSID, | ||
| 711 | |||
| 712 | NL80211_ATTR_KEY, | ||
| 713 | NL80211_ATTR_KEYS, | ||
| 714 | |||
| 715 | NL80211_ATTR_PID, | ||
| 716 | |||
| 622 | /* add attributes here, update the policy in nl80211.c */ | 717 | /* add attributes here, update the policy in nl80211.c */ |
| 623 | 718 | ||
| 624 | __NL80211_ATTR_AFTER_LAST, | 719 | __NL80211_ATTR_AFTER_LAST, |
| 625 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 720 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
| 626 | }; | 721 | }; |
| 627 | 722 | ||
| 723 | /* source-level API compatibility */ | ||
| 724 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION | ||
| 725 | |||
| 628 | /* | 726 | /* |
| 629 | * Allow user space programs to use #ifdef on new attributes by defining them | 727 | * Allow user space programs to use #ifdef on new attributes by defining them |
| 630 | * here | 728 | * here |
| 631 | */ | 729 | */ |
| 730 | #define NL80211_CMD_CONNECT NL80211_CMD_CONNECT | ||
| 632 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY | 731 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY |
| 633 | #define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES | 732 | #define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES |
| 634 | #define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS | 733 | #define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS |
| @@ -642,6 +741,12 @@ enum nl80211_attrs { | |||
| 642 | #define NL80211_ATTR_SSID NL80211_ATTR_SSID | 741 | #define NL80211_ATTR_SSID NL80211_ATTR_SSID |
| 643 | #define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE | 742 | #define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE |
| 644 | #define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE | 743 | #define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE |
| 744 | #define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE | ||
| 745 | #define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP | ||
| 746 | #define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS | ||
| 747 | #define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES | ||
| 748 | #define NL80211_ATTR_KEY NL80211_ATTR_KEY | ||
| 749 | #define NL80211_ATTR_KEYS NL80211_ATTR_KEYS | ||
| 645 | 750 | ||
| 646 | #define NL80211_MAX_SUPP_RATES 32 | 751 | #define NL80211_MAX_SUPP_RATES 32 |
| 647 | #define NL80211_MAX_SUPP_REG_RULES 32 | 752 | #define NL80211_MAX_SUPP_REG_RULES 32 |
| @@ -650,6 +755,9 @@ enum nl80211_attrs { | |||
| 650 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 755 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
| 651 | #define NL80211_HT_CAPABILITY_LEN 26 | 756 | #define NL80211_HT_CAPABILITY_LEN 26 |
| 652 | 757 | ||
| 758 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | ||
| 759 | #define NL80211_MAX_NR_AKM_SUITES 2 | ||
| 760 | |||
| 653 | /** | 761 | /** |
| 654 | * enum nl80211_iftype - (virtual) interface types | 762 | * enum nl80211_iftype - (virtual) interface types |
| 655 | * | 763 | * |
| @@ -1168,6 +1276,7 @@ enum nl80211_channel_type { | |||
| 1168 | * in mBm (100 * dBm) (s32) | 1276 | * in mBm (100 * dBm) (s32) |
| 1169 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon | 1277 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon |
| 1170 | * in unspecified units, scaled to 0..100 (u8) | 1278 | * in unspecified units, scaled to 0..100 (u8) |
| 1279 | * @NL80211_BSS_STATUS: status, if this BSS is "used" | ||
| 1171 | * @__NL80211_BSS_AFTER_LAST: internal | 1280 | * @__NL80211_BSS_AFTER_LAST: internal |
| 1172 | * @NL80211_BSS_MAX: highest BSS attribute | 1281 | * @NL80211_BSS_MAX: highest BSS attribute |
| 1173 | */ | 1282 | */ |
| @@ -1181,6 +1290,7 @@ enum nl80211_bss { | |||
| 1181 | NL80211_BSS_INFORMATION_ELEMENTS, | 1290 | NL80211_BSS_INFORMATION_ELEMENTS, |
| 1182 | NL80211_BSS_SIGNAL_MBM, | 1291 | NL80211_BSS_SIGNAL_MBM, |
| 1183 | NL80211_BSS_SIGNAL_UNSPEC, | 1292 | NL80211_BSS_SIGNAL_UNSPEC, |
| 1293 | NL80211_BSS_STATUS, | ||
| 1184 | 1294 | ||
| 1185 | /* keep last */ | 1295 | /* keep last */ |
| 1186 | __NL80211_BSS_AFTER_LAST, | 1296 | __NL80211_BSS_AFTER_LAST, |
| @@ -1188,18 +1298,37 @@ enum nl80211_bss { | |||
| 1188 | }; | 1298 | }; |
| 1189 | 1299 | ||
| 1190 | /** | 1300 | /** |
| 1301 | * enum nl80211_bss_status - BSS "status" | ||
| 1302 | */ | ||
| 1303 | enum nl80211_bss_status { | ||
| 1304 | NL80211_BSS_STATUS_AUTHENTICATED, | ||
| 1305 | NL80211_BSS_STATUS_ASSOCIATED, | ||
| 1306 | NL80211_BSS_STATUS_IBSS_JOINED, | ||
| 1307 | }; | ||
| 1308 | |||
| 1309 | /** | ||
| 1191 | * enum nl80211_auth_type - AuthenticationType | 1310 | * enum nl80211_auth_type - AuthenticationType |
| 1192 | * | 1311 | * |
| 1193 | * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication | 1312 | * @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication |
| 1194 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) | 1313 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) |
| 1195 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) | 1314 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) |
| 1196 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) | 1315 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) |
| 1316 | * @__NL80211_AUTHTYPE_NUM: internal | ||
| 1317 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm | ||
| 1318 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by | ||
| 1319 | * trying multiple times); this is invalid in netlink -- leave out | ||
| 1320 | * the attribute for this on CONNECT commands. | ||
| 1197 | */ | 1321 | */ |
| 1198 | enum nl80211_auth_type { | 1322 | enum nl80211_auth_type { |
| 1199 | NL80211_AUTHTYPE_OPEN_SYSTEM, | 1323 | NL80211_AUTHTYPE_OPEN_SYSTEM, |
| 1200 | NL80211_AUTHTYPE_SHARED_KEY, | 1324 | NL80211_AUTHTYPE_SHARED_KEY, |
| 1201 | NL80211_AUTHTYPE_FT, | 1325 | NL80211_AUTHTYPE_FT, |
| 1202 | NL80211_AUTHTYPE_NETWORK_EAP, | 1326 | NL80211_AUTHTYPE_NETWORK_EAP, |
| 1327 | |||
| 1328 | /* keep last */ | ||
| 1329 | __NL80211_AUTHTYPE_NUM, | ||
| 1330 | NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1, | ||
| 1331 | NL80211_AUTHTYPE_AUTOMATIC | ||
| 1203 | }; | 1332 | }; |
| 1204 | 1333 | ||
| 1205 | /** | 1334 | /** |
| @@ -1224,4 +1353,39 @@ enum nl80211_mfp { | |||
| 1224 | NL80211_MFP_REQUIRED, | 1353 | NL80211_MFP_REQUIRED, |
| 1225 | }; | 1354 | }; |
| 1226 | 1355 | ||
| 1356 | enum nl80211_wpa_versions { | ||
| 1357 | NL80211_WPA_VERSION_1 = 1 << 0, | ||
| 1358 | NL80211_WPA_VERSION_2 = 1 << 1, | ||
| 1359 | }; | ||
| 1360 | |||
| 1361 | /** | ||
| 1362 | * enum nl80211_key_attributes - key attributes | ||
| 1363 | * @__NL80211_KEY_INVALID: invalid | ||
| 1364 | * @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of | ||
| 1365 | * 16 bytes encryption key followed by 8 bytes each for TX and RX MIC | ||
| 1366 | * keys | ||
| 1367 | * @NL80211_KEY_IDX: key ID (u8, 0-3) | ||
| 1368 | * @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11 | ||
| 1369 | * section 7.3.2.25.1, e.g. 0x000FAC04) | ||
| 1370 | * @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and | ||
| 1371 | * CCMP keys, each six bytes in little endian | ||
| 1372 | * @NL80211_KEY_DEFAULT: flag indicating default key | ||
| 1373 | * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key | ||
| 1374 | * @__NL80211_KEY_AFTER_LAST: internal | ||
| 1375 | * @NL80211_KEY_MAX: highest key attribute | ||
| 1376 | */ | ||
| 1377 | enum nl80211_key_attributes { | ||
| 1378 | __NL80211_KEY_INVALID, | ||
| 1379 | NL80211_KEY_DATA, | ||
| 1380 | NL80211_KEY_IDX, | ||
| 1381 | NL80211_KEY_CIPHER, | ||
| 1382 | NL80211_KEY_SEQ, | ||
| 1383 | NL80211_KEY_DEFAULT, | ||
| 1384 | NL80211_KEY_DEFAULT_MGMT, | ||
| 1385 | |||
| 1386 | /* keep last */ | ||
| 1387 | __NL80211_KEY_AFTER_LAST, | ||
| 1388 | NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 | ||
| 1389 | }; | ||
| 1390 | |||
| 1227 | #endif /* __LINUX_NL80211_H */ | 1391 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h index 2cda00ccfcca..b7d9435d5a9f 100644 --- a/include/linux/nl802154.h +++ b/include/linux/nl802154.h | |||
| @@ -64,12 +64,14 @@ enum { | |||
| 64 | IEEE802154_ATTR_COORD_REALIGN, | 64 | IEEE802154_ATTR_COORD_REALIGN, |
| 65 | IEEE802154_ATTR_SEC, | 65 | IEEE802154_ATTR_SEC, |
| 66 | 66 | ||
| 67 | IEEE802154_ATTR_PAGE, | ||
| 68 | |||
| 67 | __IEEE802154_ATTR_MAX, | 69 | __IEEE802154_ATTR_MAX, |
| 68 | }; | 70 | }; |
| 69 | 71 | ||
| 70 | #define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1) | 72 | #define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1) |
| 71 | 73 | ||
| 72 | extern struct nla_policy ieee802154_policy[]; | 74 | extern const struct nla_policy ieee802154_policy[]; |
| 73 | 75 | ||
| 74 | /* commands */ | 76 | /* commands */ |
| 75 | /* REQ should be responded with CONF | 77 | /* REQ should be responded with CONF |
| @@ -111,6 +113,8 @@ enum { | |||
| 111 | IEEE802154_RX_ENABLE_REQ, /* Not supported yet */ | 113 | IEEE802154_RX_ENABLE_REQ, /* Not supported yet */ |
| 112 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ | 114 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ |
| 113 | 115 | ||
| 116 | IEEE802154_LIST_IFACE, | ||
| 117 | |||
| 114 | __IEEE802154_CMD_MAX, | 118 | __IEEE802154_CMD_MAX, |
| 115 | }; | 119 | }; |
| 116 | 120 | ||
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index 29af2d5df097..b752e807adde 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
| @@ -28,8 +28,23 @@ static inline void acpi_nmi_disable(void) { } | |||
| 28 | static inline void acpi_nmi_enable(void) { } | 28 | static inline void acpi_nmi_enable(void) { } |
| 29 | #endif | 29 | #endif |
| 30 | 30 | ||
| 31 | #ifndef trigger_all_cpu_backtrace | 31 | /* |
| 32 | #define trigger_all_cpu_backtrace() do { } while (0) | 32 | * Create trigger_all_cpu_backtrace() out of the arch-provided |
| 33 | * base function. Return whether such support was available, | ||
| 34 | * to allow calling code to fall back to some other mechanism: | ||
| 35 | */ | ||
| 36 | #ifdef arch_trigger_all_cpu_backtrace | ||
| 37 | static inline bool trigger_all_cpu_backtrace(void) | ||
| 38 | { | ||
| 39 | arch_trigger_all_cpu_backtrace(); | ||
| 40 | |||
| 41 | return true; | ||
| 42 | } | ||
| 43 | #else | ||
| 44 | static inline bool trigger_all_cpu_backtrace(void) | ||
| 45 | { | ||
| 46 | return false; | ||
| 47 | } | ||
| 33 | #endif | 48 | #endif |
| 34 | 49 | ||
| 35 | #endif | 50 | #endif |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 829b94b156f2..b359c4a9ec9e 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
| @@ -82,6 +82,12 @@ | |||
| 82 | * to generate slightly worse code. So use a simple one-line #define | 82 | * to generate slightly worse code. So use a simple one-line #define |
| 83 | * for node_isset(), instead of wrapping an inline inside a macro, the | 83 | * for node_isset(), instead of wrapping an inline inside a macro, the |
| 84 | * way we do the other calls. | 84 | * way we do the other calls. |
| 85 | * | ||
| 86 | * NODEMASK_SCRATCH | ||
| 87 | * When doing above logical AND, OR, XOR, Remap operations the callers tend to | ||
| 88 | * need temporary nodemask_t's on the stack. But if NODES_SHIFT is large, | ||
| 89 | * nodemask_t's consume too much stack space. NODEMASK_SCRATCH is a helper | ||
| 90 | * for such situations. See below and CPUMASK_ALLOC also. | ||
| 85 | */ | 91 | */ |
| 86 | 92 | ||
| 87 | #include <linux/kernel.h> | 93 | #include <linux/kernel.h> |
| @@ -473,4 +479,26 @@ static inline int num_node_state(enum node_states state) | |||
| 473 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) | 479 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) |
| 474 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) | 480 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) |
| 475 | 481 | ||
| 482 | /* | ||
| 483 | * For nodemask scrach area.(See CPUMASK_ALLOC() in cpumask.h) | ||
| 484 | */ | ||
| 485 | |||
| 486 | #if NODES_SHIFT > 8 /* nodemask_t > 64 bytes */ | ||
| 487 | #define NODEMASK_ALLOC(x, m) struct x *m = kmalloc(sizeof(*m), GFP_KERNEL) | ||
| 488 | #define NODEMASK_FREE(m) kfree(m) | ||
| 489 | #else | ||
| 490 | #define NODEMASK_ALLOC(x, m) struct x _m, *m = &_m | ||
| 491 | #define NODEMASK_FREE(m) | ||
| 492 | #endif | ||
| 493 | |||
| 494 | /* A example struture for using NODEMASK_ALLOC, used in mempolicy. */ | ||
| 495 | struct nodemask_scratch { | ||
| 496 | nodemask_t mask1; | ||
| 497 | nodemask_t mask2; | ||
| 498 | }; | ||
| 499 | |||
| 500 | #define NODEMASK_SCRATCH(x) NODEMASK_ALLOC(nodemask_scratch, x) | ||
| 501 | #define NODEMASK_SCRATCH_FREE(x) NODEMASK_FREE(x) | ||
| 502 | |||
| 503 | |||
| 476 | #endif /* __LINUX_NODEMASK_H */ | 504 | #endif /* __LINUX_NODEMASK_H */ |
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index c9663c690303..53b94e025c7c 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
| @@ -18,5 +18,8 @@ extern struct phy_device *of_phy_connect(struct net_device *dev, | |||
| 18 | struct device_node *phy_np, | 18 | struct device_node *phy_np, |
| 19 | void (*hndlr)(struct net_device *), | 19 | void (*hndlr)(struct net_device *), |
| 20 | u32 flags, phy_interface_t iface); | 20 | u32 flags, phy_interface_t iface); |
| 21 | extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | ||
| 22 | void (*hndlr)(struct net_device *), | ||
| 23 | phy_interface_t iface); | ||
| 21 | 24 | ||
| 22 | #endif /* __LINUX_OF_MDIO_H */ | 25 | #endif /* __LINUX_OF_MDIO_H */ |
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h index 1d9518bc4c58..5171639ecf0f 100644 --- a/include/linux/oprofile.h +++ b/include/linux/oprofile.h | |||
| @@ -67,6 +67,9 @@ struct oprofile_operations { | |||
| 67 | 67 | ||
| 68 | /* Initiate a stack backtrace. Optional. */ | 68 | /* Initiate a stack backtrace. Optional. */ |
| 69 | void (*backtrace)(struct pt_regs * const regs, unsigned int depth); | 69 | void (*backtrace)(struct pt_regs * const regs, unsigned int depth); |
| 70 | |||
| 71 | /* Multiplex between different events. Optional. */ | ||
| 72 | int (*switch_events)(void); | ||
| 70 | /* CPU identification string. */ | 73 | /* CPU identification string. */ |
| 71 | char * cpu_type; | 74 | char * cpu_type; |
| 72 | }; | 75 | }; |
| @@ -171,7 +174,6 @@ struct op_sample; | |||
| 171 | struct op_entry { | 174 | struct op_entry { |
| 172 | struct ring_buffer_event *event; | 175 | struct ring_buffer_event *event; |
| 173 | struct op_sample *sample; | 176 | struct op_sample *sample; |
| 174 | unsigned long irq_flags; | ||
| 175 | unsigned long size; | 177 | unsigned long size; |
| 176 | unsigned long *data; | 178 | unsigned long *data; |
| 177 | }; | 179 | }; |
| @@ -180,6 +182,7 @@ void oprofile_write_reserve(struct op_entry *entry, | |||
| 180 | struct pt_regs * const regs, | 182 | struct pt_regs * const regs, |
| 181 | unsigned long pc, int code, int size); | 183 | unsigned long pc, int code, int size); |
| 182 | int oprofile_add_data(struct op_entry *entry, unsigned long val); | 184 | int oprofile_add_data(struct op_entry *entry, unsigned long val); |
| 185 | int oprofile_add_data64(struct op_entry *entry, u64 val); | ||
| 183 | int oprofile_write_commit(struct op_entry *entry); | 186 | int oprofile_write_commit(struct op_entry *entry); |
| 184 | 187 | ||
| 185 | #endif /* OPROFILE_H */ | 188 | #endif /* OPROFILE_H */ |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index aec3252afcf5..ed5d7501e181 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -132,7 +132,7 @@ static inline int page_cache_get_speculative(struct page *page) | |||
| 132 | { | 132 | { |
| 133 | VM_BUG_ON(in_interrupt()); | 133 | VM_BUG_ON(in_interrupt()); |
| 134 | 134 | ||
| 135 | #if !defined(CONFIG_SMP) && defined(CONFIG_CLASSIC_RCU) | 135 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) |
| 136 | # ifdef CONFIG_PREEMPT | 136 | # ifdef CONFIG_PREEMPT |
| 137 | VM_BUG_ON(!in_atomic()); | 137 | VM_BUG_ON(!in_atomic()); |
| 138 | # endif | 138 | # endif |
| @@ -170,7 +170,7 @@ static inline int page_cache_add_speculative(struct page *page, int count) | |||
| 170 | { | 170 | { |
| 171 | VM_BUG_ON(in_interrupt()); | 171 | VM_BUG_ON(in_interrupt()); |
| 172 | 172 | ||
| 173 | #if !defined(CONFIG_SMP) && defined(CONFIG_CLASSIC_RCU) | 173 | #if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) |
| 174 | # ifdef CONFIG_PREEMPT | 174 | # ifdef CONFIG_PREEMPT |
| 175 | VM_BUG_ON(!in_atomic()); | 175 | VM_BUG_ON(!in_atomic()); |
| 176 | # endif | 176 | # endif |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 73b46b6b904f..555a8262fbc2 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -376,6 +376,9 @@ | |||
| 376 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c | 376 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c |
| 377 | #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 | 377 | #define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 |
| 378 | #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c | 378 | #define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c |
| 379 | /* AMD SB Chipset */ | ||
| 380 | #define PCI_DEVICE_ID_AMD_SB900_IDE 0x780c | ||
| 381 | #define PCI_DEVICE_ID_AMD_SB900_SATA_IDE 0x7800 | ||
| 379 | 382 | ||
| 380 | #define PCI_VENDOR_ID_VLSI 0x1004 | 383 | #define PCI_VENDOR_ID_VLSI 0x1004 |
| 381 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 | 384 | #define PCI_DEVICE_ID_VLSI_82C592 0x0005 |
| @@ -537,6 +540,7 @@ | |||
| 537 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 540 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
| 538 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 541 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
| 539 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | 542 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 |
| 543 | #define PCI_DEVICE_ID_AMD_CS5535_IDE 0x208F | ||
| 540 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 544 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
| 541 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 545 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
| 542 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 | 546 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 |
| @@ -1984,6 +1988,8 @@ | |||
| 1984 | 1988 | ||
| 1985 | #define PCI_VENDOR_ID_SAMSUNG 0x144d | 1989 | #define PCI_VENDOR_ID_SAMSUNG 0x144d |
| 1986 | 1990 | ||
| 1991 | #define PCI_VENDOR_ID_GIGABYTE 0x1458 | ||
| 1992 | |||
| 1987 | #define PCI_VENDOR_ID_AMBIT 0x1468 | 1993 | #define PCI_VENDOR_ID_AMBIT 0x1468 |
| 1988 | 1994 | ||
| 1989 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 | 1995 | #define PCI_VENDOR_ID_MYRICOM 0x14c1 |
| @@ -2062,7 +2068,6 @@ | |||
| 2062 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 | 2068 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 |
| 2063 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 | 2069 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 |
| 2064 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 | 2070 | #define PCI_DEVICE_ID_TIGON3_5784 0x1698 |
| 2065 | #define PCI_DEVICE_ID_TIGON3_5785 0x1699 | ||
| 2066 | #define PCI_DEVICE_ID_TIGON3_5786 0x169a | 2071 | #define PCI_DEVICE_ID_TIGON3_5786 0x169a |
| 2067 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b | 2072 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b |
| 2068 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c | 2073 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 68438e18fff4..0761491b3eec 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
| @@ -66,14 +66,24 @@ | |||
| 66 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ | 66 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_SHARED_ALIGNED_SECTION) \ |
| 67 | ____cacheline_aligned_in_smp | 67 | ____cacheline_aligned_in_smp |
| 68 | 68 | ||
| 69 | #define DECLARE_PER_CPU_ALIGNED(type, name) \ | ||
| 70 | DECLARE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \ | ||
| 71 | ____cacheline_aligned | ||
| 72 | |||
| 73 | #define DEFINE_PER_CPU_ALIGNED(type, name) \ | ||
| 74 | DEFINE_PER_CPU_SECTION(type, name, PER_CPU_ALIGNED_SECTION) \ | ||
| 75 | ____cacheline_aligned | ||
| 76 | |||
| 69 | /* | 77 | /* |
| 70 | * Declaration/definition used for per-CPU variables that must be page aligned. | 78 | * Declaration/definition used for per-CPU variables that must be page aligned. |
| 71 | */ | 79 | */ |
| 72 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ | 80 | #define DECLARE_PER_CPU_PAGE_ALIGNED(type, name) \ |
| 73 | DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") | 81 | DECLARE_PER_CPU_SECTION(type, name, ".page_aligned") \ |
| 82 | __aligned(PAGE_SIZE) | ||
| 74 | 83 | ||
| 75 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | 84 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ |
| 76 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") | 85 | DEFINE_PER_CPU_SECTION(type, name, ".page_aligned") \ |
| 86 | __aligned(PAGE_SIZE) | ||
| 77 | 87 | ||
| 78 | /* | 88 | /* |
| 79 | * Intermodule exports for per-CPU variables. | 89 | * Intermodule exports for per-CPU variables. |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index bd15d7a5f5ce..972f90d7a32f 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
| @@ -115,27 +115,44 @@ enum perf_counter_sample_format { | |||
| 115 | PERF_SAMPLE_TID = 1U << 1, | 115 | PERF_SAMPLE_TID = 1U << 1, |
| 116 | PERF_SAMPLE_TIME = 1U << 2, | 116 | PERF_SAMPLE_TIME = 1U << 2, |
| 117 | PERF_SAMPLE_ADDR = 1U << 3, | 117 | PERF_SAMPLE_ADDR = 1U << 3, |
| 118 | PERF_SAMPLE_GROUP = 1U << 4, | 118 | PERF_SAMPLE_READ = 1U << 4, |
| 119 | PERF_SAMPLE_CALLCHAIN = 1U << 5, | 119 | PERF_SAMPLE_CALLCHAIN = 1U << 5, |
| 120 | PERF_SAMPLE_ID = 1U << 6, | 120 | PERF_SAMPLE_ID = 1U << 6, |
| 121 | PERF_SAMPLE_CPU = 1U << 7, | 121 | PERF_SAMPLE_CPU = 1U << 7, |
| 122 | PERF_SAMPLE_PERIOD = 1U << 8, | 122 | PERF_SAMPLE_PERIOD = 1U << 8, |
| 123 | PERF_SAMPLE_STREAM_ID = 1U << 9, | 123 | PERF_SAMPLE_STREAM_ID = 1U << 9, |
| 124 | PERF_SAMPLE_RAW = 1U << 10, | ||
| 124 | 125 | ||
| 125 | PERF_SAMPLE_MAX = 1U << 10, /* non-ABI */ | 126 | PERF_SAMPLE_MAX = 1U << 11, /* non-ABI */ |
| 126 | }; | 127 | }; |
| 127 | 128 | ||
| 128 | /* | 129 | /* |
| 129 | * Bits that can be set in attr.read_format to request that | 130 | * The format of the data returned by read() on a perf counter fd, |
| 130 | * reads on the counter should return the indicated quantities, | 131 | * as specified by attr.read_format: |
| 131 | * in increasing order of bit value, after the counter value. | 132 | * |
| 133 | * struct read_format { | ||
| 134 | * { u64 value; | ||
| 135 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
| 136 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
| 137 | * { u64 id; } && PERF_FORMAT_ID | ||
| 138 | * } && !PERF_FORMAT_GROUP | ||
| 139 | * | ||
| 140 | * { u64 nr; | ||
| 141 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
| 142 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
| 143 | * { u64 value; | ||
| 144 | * { u64 id; } && PERF_FORMAT_ID | ||
| 145 | * } cntr[nr]; | ||
| 146 | * } && PERF_FORMAT_GROUP | ||
| 147 | * }; | ||
| 132 | */ | 148 | */ |
| 133 | enum perf_counter_read_format { | 149 | enum perf_counter_read_format { |
| 134 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, | 150 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, |
| 135 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, | 151 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, |
| 136 | PERF_FORMAT_ID = 1U << 2, | 152 | PERF_FORMAT_ID = 1U << 2, |
| 153 | PERF_FORMAT_GROUP = 1U << 3, | ||
| 137 | 154 | ||
| 138 | PERF_FORMAT_MAX = 1U << 3, /* non-ABI */ | 155 | PERF_FORMAT_MAX = 1U << 4, /* non-ABI */ |
| 139 | }; | 156 | }; |
| 140 | 157 | ||
| 141 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | 158 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ |
| @@ -181,8 +198,9 @@ struct perf_counter_attr { | |||
| 181 | freq : 1, /* use freq, not period */ | 198 | freq : 1, /* use freq, not period */ |
| 182 | inherit_stat : 1, /* per task counts */ | 199 | inherit_stat : 1, /* per task counts */ |
| 183 | enable_on_exec : 1, /* next exec enables */ | 200 | enable_on_exec : 1, /* next exec enables */ |
| 201 | task : 1, /* trace fork/exit */ | ||
| 184 | 202 | ||
| 185 | __reserved_1 : 51; | 203 | __reserved_1 : 50; |
| 186 | 204 | ||
| 187 | __u32 wakeup_events; /* wakeup every n events */ | 205 | __u32 wakeup_events; /* wakeup every n events */ |
| 188 | __u32 __reserved_2; | 206 | __u32 __reserved_2; |
| @@ -198,6 +216,7 @@ struct perf_counter_attr { | |||
| 198 | #define PERF_COUNTER_IOC_REFRESH _IO ('$', 2) | 216 | #define PERF_COUNTER_IOC_REFRESH _IO ('$', 2) |
| 199 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) | 217 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) |
| 200 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) | 218 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) |
| 219 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) | ||
| 201 | 220 | ||
| 202 | enum perf_counter_ioc_flags { | 221 | enum perf_counter_ioc_flags { |
| 203 | PERF_IOC_FLAG_GROUP = 1U << 0, | 222 | PERF_IOC_FLAG_GROUP = 1U << 0, |
| @@ -311,6 +330,15 @@ enum perf_event_type { | |||
| 311 | /* | 330 | /* |
| 312 | * struct { | 331 | * struct { |
| 313 | * struct perf_event_header header; | 332 | * struct perf_event_header header; |
| 333 | * u32 pid, ppid; | ||
| 334 | * u32 tid, ptid; | ||
| 335 | * }; | ||
| 336 | */ | ||
| 337 | PERF_EVENT_EXIT = 4, | ||
| 338 | |||
| 339 | /* | ||
| 340 | * struct { | ||
| 341 | * struct perf_event_header header; | ||
| 314 | * u64 time; | 342 | * u64 time; |
| 315 | * u64 id; | 343 | * u64 id; |
| 316 | * u64 stream_id; | 344 | * u64 stream_id; |
| @@ -323,6 +351,7 @@ enum perf_event_type { | |||
| 323 | * struct { | 351 | * struct { |
| 324 | * struct perf_event_header header; | 352 | * struct perf_event_header header; |
| 325 | * u32 pid, ppid; | 353 | * u32 pid, ppid; |
| 354 | * u32 tid, ptid; | ||
| 326 | * }; | 355 | * }; |
| 327 | */ | 356 | */ |
| 328 | PERF_EVENT_FORK = 7, | 357 | PERF_EVENT_FORK = 7, |
| @@ -331,10 +360,8 @@ enum perf_event_type { | |||
| 331 | * struct { | 360 | * struct { |
| 332 | * struct perf_event_header header; | 361 | * struct perf_event_header header; |
| 333 | * u32 pid, tid; | 362 | * u32 pid, tid; |
| 334 | * u64 value; | 363 | * |
| 335 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | 364 | * struct read_format values; |
| 336 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
| 337 | * { u64 parent_id; } && PERF_FORMAT_ID | ||
| 338 | * }; | 365 | * }; |
| 339 | */ | 366 | */ |
| 340 | PERF_EVENT_READ = 8, | 367 | PERF_EVENT_READ = 8, |
| @@ -352,11 +379,24 @@ enum perf_event_type { | |||
| 352 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | 379 | * { u32 cpu, res; } && PERF_SAMPLE_CPU |
| 353 | * { u64 period; } && PERF_SAMPLE_PERIOD | 380 | * { u64 period; } && PERF_SAMPLE_PERIOD |
| 354 | * | 381 | * |
| 355 | * { u64 nr; | 382 | * { struct read_format values; } && PERF_SAMPLE_READ |
| 356 | * { u64 id, val; } cnt[nr]; } && PERF_SAMPLE_GROUP | ||
| 357 | * | 383 | * |
| 358 | * { u64 nr, | 384 | * { u64 nr, |
| 359 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN | 385 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN |
| 386 | * | ||
| 387 | * # | ||
| 388 | * # The RAW record below is opaque data wrt the ABI | ||
| 389 | * # | ||
| 390 | * # That is, the ABI doesn't make any promises wrt to | ||
| 391 | * # the stability of its content, it may vary depending | ||
| 392 | * # on event, hardware, kernel version and phase of | ||
| 393 | * # the moon. | ||
| 394 | * # | ||
| 395 | * # In other words, PERF_SAMPLE_RAW contents are not an ABI. | ||
| 396 | * # | ||
| 397 | * | ||
| 398 | * { u32 size; | ||
| 399 | * char data[size];}&& PERF_SAMPLE_RAW | ||
| 360 | * }; | 400 | * }; |
| 361 | */ | 401 | */ |
| 362 | PERF_EVENT_SAMPLE = 9, | 402 | PERF_EVENT_SAMPLE = 9, |
| @@ -376,6 +416,9 @@ enum perf_callchain_context { | |||
| 376 | PERF_CONTEXT_MAX = (__u64)-4095, | 416 | PERF_CONTEXT_MAX = (__u64)-4095, |
| 377 | }; | 417 | }; |
| 378 | 418 | ||
| 419 | #define PERF_FLAG_FD_NO_GROUP (1U << 0) | ||
| 420 | #define PERF_FLAG_FD_OUTPUT (1U << 1) | ||
| 421 | |||
| 379 | #ifdef __KERNEL__ | 422 | #ifdef __KERNEL__ |
| 380 | /* | 423 | /* |
| 381 | * Kernel-internal data types and definitions: | 424 | * Kernel-internal data types and definitions: |
| @@ -402,6 +445,11 @@ struct perf_callchain_entry { | |||
| 402 | __u64 ip[PERF_MAX_STACK_DEPTH]; | 445 | __u64 ip[PERF_MAX_STACK_DEPTH]; |
| 403 | }; | 446 | }; |
| 404 | 447 | ||
| 448 | struct perf_raw_record { | ||
| 449 | u32 size; | ||
| 450 | void *data; | ||
| 451 | }; | ||
| 452 | |||
| 405 | struct task_struct; | 453 | struct task_struct; |
| 406 | 454 | ||
| 407 | /** | 455 | /** |
| @@ -492,6 +540,7 @@ struct perf_counter { | |||
| 492 | struct list_head sibling_list; | 540 | struct list_head sibling_list; |
| 493 | int nr_siblings; | 541 | int nr_siblings; |
| 494 | struct perf_counter *group_leader; | 542 | struct perf_counter *group_leader; |
| 543 | struct perf_counter *output; | ||
| 495 | const struct pmu *pmu; | 544 | const struct pmu *pmu; |
| 496 | 545 | ||
| 497 | enum perf_counter_active_state state; | 546 | enum perf_counter_active_state state; |
| @@ -670,10 +719,13 @@ struct perf_sample_data { | |||
| 670 | struct pt_regs *regs; | 719 | struct pt_regs *regs; |
| 671 | u64 addr; | 720 | u64 addr; |
| 672 | u64 period; | 721 | u64 period; |
| 722 | struct perf_raw_record *raw; | ||
| 673 | }; | 723 | }; |
| 674 | 724 | ||
| 675 | extern int perf_counter_overflow(struct perf_counter *counter, int nmi, | 725 | extern int perf_counter_overflow(struct perf_counter *counter, int nmi, |
| 676 | struct perf_sample_data *data); | 726 | struct perf_sample_data *data); |
| 727 | extern void perf_counter_output(struct perf_counter *counter, int nmi, | ||
| 728 | struct perf_sample_data *data); | ||
| 677 | 729 | ||
| 678 | /* | 730 | /* |
| 679 | * Return 1 for a software counter, 0 for a hardware counter | 731 | * Return 1 for a software counter, 0 for a hardware counter |
| @@ -714,6 +766,8 @@ extern int sysctl_perf_counter_mlock; | |||
| 714 | extern int sysctl_perf_counter_sample_rate; | 766 | extern int sysctl_perf_counter_sample_rate; |
| 715 | 767 | ||
| 716 | extern void perf_counter_init(void); | 768 | extern void perf_counter_init(void); |
| 769 | extern void perf_tpcounter_event(int event_id, u64 addr, u64 count, | ||
| 770 | void *record, int entry_size); | ||
| 717 | 771 | ||
| 718 | #ifndef perf_misc_flags | 772 | #ifndef perf_misc_flags |
| 719 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_EVENT_MISC_USER : \ | 773 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_EVENT_MISC_USER : \ |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index ee5e3c9e2bca..1ef5a0781831 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
| @@ -99,6 +99,9 @@ struct sockaddr_pn { | |||
| 99 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | 99 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; |
| 100 | } __attribute__ ((packed)); | 100 | } __attribute__ ((packed)); |
| 101 | 101 | ||
| 102 | /* Well known address */ | ||
| 103 | #define PN_DEV_PC 0x10 | ||
| 104 | |||
| 102 | static inline __u16 pn_object(__u8 addr, __u16 port) | 105 | static inline __u16 pn_object(__u8 addr, __u16 port) |
| 103 | { | 106 | { |
| 104 | return (addr << 8) | (port & 0x3ff); | 107 | return (addr << 8) | (port & 0x3ff); |
| @@ -170,4 +173,21 @@ static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn) | |||
| 170 | return spn->spn_resource; | 173 | return spn->spn_resource; |
| 171 | } | 174 | } |
| 172 | 175 | ||
| 176 | /* Phonet device ioctl requests */ | ||
| 177 | #ifdef __KERNEL__ | ||
| 178 | #define SIOCPNGAUTOCONF (SIOCDEVPRIVATE + 0) | ||
| 179 | |||
| 180 | struct if_phonet_autoconf { | ||
| 181 | uint8_t device; | ||
| 182 | }; | ||
| 183 | |||
| 184 | struct if_phonet_req { | ||
| 185 | char ifr_phonet_name[16]; | ||
| 186 | union { | ||
| 187 | struct if_phonet_autoconf ifru_phonet_autoconf; | ||
| 188 | } ifr_ifru; | ||
| 189 | }; | ||
| 190 | #define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf | ||
| 191 | #endif /* __KERNEL__ */ | ||
| 192 | |||
| 173 | #endif | 193 | #endif |
diff --git a/include/linux/pps.h b/include/linux/pps.h index cfe5c7214ec6..0194ab06177b 100644 --- a/include/linux/pps.h +++ b/include/linux/pps.h | |||
| @@ -22,6 +22,8 @@ | |||
| 22 | #ifndef _PPS_H_ | 22 | #ifndef _PPS_H_ |
| 23 | #define _PPS_H_ | 23 | #define _PPS_H_ |
| 24 | 24 | ||
| 25 | #include <linux/types.h> | ||
| 26 | |||
| 25 | #define PPS_VERSION "5.3.6" | 27 | #define PPS_VERSION "5.3.6" |
| 26 | #define PPS_MAX_SOURCES 16 /* should be enough... */ | 28 | #define PPS_MAX_SOURCES 16 /* should be enough... */ |
| 27 | 29 | ||
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h deleted file mode 100644 index bfd92e1e5d2c..000000000000 --- a/include/linux/rcuclassic.h +++ /dev/null | |||
| @@ -1,178 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Read-Copy Update mechanism for mutual exclusion (classic version) | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | * | ||
| 18 | * Copyright IBM Corporation, 2001 | ||
| 19 | * | ||
| 20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> | ||
| 21 | * | ||
| 22 | * Based on the original work by Paul McKenney <paulmck@us.ibm.com> | ||
| 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | ||
| 24 | * Papers: | ||
| 25 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf | ||
| 26 | * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001) | ||
| 27 | * | ||
| 28 | * For detailed explanation of Read-Copy Update mechanism see - | ||
| 29 | * Documentation/RCU | ||
| 30 | * | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __LINUX_RCUCLASSIC_H | ||
| 34 | #define __LINUX_RCUCLASSIC_H | ||
| 35 | |||
| 36 | #include <linux/cache.h> | ||
| 37 | #include <linux/spinlock.h> | ||
| 38 | #include <linux/threads.h> | ||
| 39 | #include <linux/cpumask.h> | ||
| 40 | #include <linux/seqlock.h> | ||
| 41 | |||
| 42 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
| 43 | #define RCU_SECONDS_TILL_STALL_CHECK (10 * HZ) /* for rcp->jiffies_stall */ | ||
| 44 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rcp->jiffies_stall */ | ||
| 45 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
| 46 | |||
| 47 | /* Global control variables for rcupdate callback mechanism. */ | ||
| 48 | struct rcu_ctrlblk { | ||
| 49 | long cur; /* Current batch number. */ | ||
| 50 | long completed; /* Number of the last completed batch */ | ||
| 51 | long pending; /* Number of the last pending batch */ | ||
| 52 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
| 53 | unsigned long gp_start; /* Time at which GP started in jiffies. */ | ||
| 54 | unsigned long jiffies_stall; | ||
| 55 | /* Time at which to check for CPU stalls. */ | ||
| 56 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
| 57 | |||
| 58 | int signaled; | ||
| 59 | |||
| 60 | spinlock_t lock ____cacheline_internodealigned_in_smp; | ||
| 61 | DECLARE_BITMAP(cpumask, NR_CPUS); /* CPUs that need to switch for */ | ||
| 62 | /* current batch to proceed. */ | ||
| 63 | } ____cacheline_internodealigned_in_smp; | ||
| 64 | |||
| 65 | /* Is batch a before batch b ? */ | ||
| 66 | static inline int rcu_batch_before(long a, long b) | ||
| 67 | { | ||
| 68 | return (a - b) < 0; | ||
| 69 | } | ||
| 70 | |||
| 71 | /* Is batch a after batch b ? */ | ||
| 72 | static inline int rcu_batch_after(long a, long b) | ||
| 73 | { | ||
| 74 | return (a - b) > 0; | ||
| 75 | } | ||
| 76 | |||
| 77 | /* Per-CPU data for Read-Copy UPdate. */ | ||
| 78 | struct rcu_data { | ||
| 79 | /* 1) quiescent state handling : */ | ||
| 80 | long quiescbatch; /* Batch # for grace period */ | ||
| 81 | int passed_quiesc; /* User-mode/idle loop etc. */ | ||
| 82 | int qs_pending; /* core waits for quiesc state */ | ||
| 83 | |||
| 84 | /* 2) batch handling */ | ||
| 85 | /* | ||
| 86 | * if nxtlist is not NULL, then: | ||
| 87 | * batch: | ||
| 88 | * The batch # for the last entry of nxtlist | ||
| 89 | * [*nxttail[1], NULL = *nxttail[2]): | ||
| 90 | * Entries that batch # <= batch | ||
| 91 | * [*nxttail[0], *nxttail[1]): | ||
| 92 | * Entries that batch # <= batch - 1 | ||
| 93 | * [nxtlist, *nxttail[0]): | ||
| 94 | * Entries that batch # <= batch - 2 | ||
| 95 | * The grace period for these entries has completed, and | ||
| 96 | * the other grace-period-completed entries may be moved | ||
| 97 | * here temporarily in rcu_process_callbacks(). | ||
| 98 | */ | ||
| 99 | long batch; | ||
| 100 | struct rcu_head *nxtlist; | ||
| 101 | struct rcu_head **nxttail[3]; | ||
| 102 | long qlen; /* # of queued callbacks */ | ||
| 103 | struct rcu_head *donelist; | ||
| 104 | struct rcu_head **donetail; | ||
| 105 | long blimit; /* Upper limit on a processed batch */ | ||
| 106 | int cpu; | ||
| 107 | struct rcu_head barrier; | ||
| 108 | }; | ||
| 109 | |||
| 110 | /* | ||
| 111 | * Increment the quiescent state counter. | ||
| 112 | * The counter is a bit degenerated: We do not need to know | ||
| 113 | * how many quiescent states passed, just if there was at least | ||
| 114 | * one since the start of the grace period. Thus just a flag. | ||
| 115 | */ | ||
| 116 | extern void rcu_qsctr_inc(int cpu); | ||
| 117 | extern void rcu_bh_qsctr_inc(int cpu); | ||
| 118 | |||
| 119 | extern int rcu_pending(int cpu); | ||
| 120 | extern int rcu_needs_cpu(int cpu); | ||
| 121 | |||
| 122 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 123 | extern struct lockdep_map rcu_lock_map; | ||
| 124 | # define rcu_read_acquire() \ | ||
| 125 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
| 126 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | ||
| 127 | #else | ||
| 128 | # define rcu_read_acquire() do { } while (0) | ||
| 129 | # define rcu_read_release() do { } while (0) | ||
| 130 | #endif | ||
| 131 | |||
| 132 | #define __rcu_read_lock() \ | ||
| 133 | do { \ | ||
| 134 | preempt_disable(); \ | ||
| 135 | __acquire(RCU); \ | ||
| 136 | rcu_read_acquire(); \ | ||
| 137 | } while (0) | ||
| 138 | #define __rcu_read_unlock() \ | ||
| 139 | do { \ | ||
| 140 | rcu_read_release(); \ | ||
| 141 | __release(RCU); \ | ||
| 142 | preempt_enable(); \ | ||
| 143 | } while (0) | ||
| 144 | #define __rcu_read_lock_bh() \ | ||
| 145 | do { \ | ||
| 146 | local_bh_disable(); \ | ||
| 147 | __acquire(RCU_BH); \ | ||
| 148 | rcu_read_acquire(); \ | ||
| 149 | } while (0) | ||
| 150 | #define __rcu_read_unlock_bh() \ | ||
| 151 | do { \ | ||
| 152 | rcu_read_release(); \ | ||
| 153 | __release(RCU_BH); \ | ||
| 154 | local_bh_enable(); \ | ||
| 155 | } while (0) | ||
| 156 | |||
| 157 | #define __synchronize_sched() synchronize_rcu() | ||
| 158 | |||
| 159 | #define call_rcu_sched(head, func) call_rcu(head, func) | ||
| 160 | |||
| 161 | extern void __rcu_init(void); | ||
| 162 | #define rcu_init_sched() do { } while (0) | ||
| 163 | extern void rcu_check_callbacks(int cpu, int user); | ||
| 164 | extern void rcu_restart_cpu(int cpu); | ||
| 165 | |||
| 166 | extern long rcu_batches_completed(void); | ||
| 167 | extern long rcu_batches_completed_bh(void); | ||
| 168 | |||
| 169 | #define rcu_enter_nohz() do { } while (0) | ||
| 170 | #define rcu_exit_nohz() do { } while (0) | ||
| 171 | |||
| 172 | /* A context switch is a grace period for rcuclassic. */ | ||
| 173 | static inline int rcu_blocking_is_gp(void) | ||
| 174 | { | ||
| 175 | return num_online_cpus() == 1; | ||
| 176 | } | ||
| 177 | |||
| 178 | #endif /* __LINUX_RCUCLASSIC_H */ | ||
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 15fbb3ca634d..95e0615f4d75 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -51,18 +51,26 @@ struct rcu_head { | |||
| 51 | void (*func)(struct rcu_head *head); | 51 | void (*func)(struct rcu_head *head); |
| 52 | }; | 52 | }; |
| 53 | 53 | ||
| 54 | /* Internal to kernel, but needed by rcupreempt.h. */ | 54 | /* Exported common interfaces */ |
| 55 | extern void synchronize_rcu(void); | ||
| 56 | extern void synchronize_rcu_bh(void); | ||
| 57 | extern void rcu_barrier(void); | ||
| 58 | extern void rcu_barrier_bh(void); | ||
| 59 | extern void rcu_barrier_sched(void); | ||
| 60 | extern void synchronize_sched_expedited(void); | ||
| 61 | extern int sched_expedited_torture_stats(char *page); | ||
| 62 | |||
| 63 | /* Internal to kernel */ | ||
| 64 | extern void rcu_init(void); | ||
| 65 | extern void rcu_scheduler_starting(void); | ||
| 66 | extern int rcu_needs_cpu(int cpu); | ||
| 55 | extern int rcu_scheduler_active; | 67 | extern int rcu_scheduler_active; |
| 56 | 68 | ||
| 57 | #if defined(CONFIG_CLASSIC_RCU) | 69 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 58 | #include <linux/rcuclassic.h> | ||
| 59 | #elif defined(CONFIG_TREE_RCU) | ||
| 60 | #include <linux/rcutree.h> | 70 | #include <linux/rcutree.h> |
| 61 | #elif defined(CONFIG_PREEMPT_RCU) | ||
| 62 | #include <linux/rcupreempt.h> | ||
| 63 | #else | 71 | #else |
| 64 | #error "Unknown RCU implementation specified to kernel configuration" | 72 | #error "Unknown RCU implementation specified to kernel configuration" |
| 65 | #endif /* #else #if defined(CONFIG_CLASSIC_RCU) */ | 73 | #endif |
| 66 | 74 | ||
| 67 | #define RCU_HEAD_INIT { .next = NULL, .func = NULL } | 75 | #define RCU_HEAD_INIT { .next = NULL, .func = NULL } |
| 68 | #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT | 76 | #define RCU_HEAD(head) struct rcu_head head = RCU_HEAD_INIT |
| @@ -70,6 +78,16 @@ extern int rcu_scheduler_active; | |||
| 70 | (ptr)->next = NULL; (ptr)->func = NULL; \ | 78 | (ptr)->next = NULL; (ptr)->func = NULL; \ |
| 71 | } while (0) | 79 | } while (0) |
| 72 | 80 | ||
| 81 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 82 | extern struct lockdep_map rcu_lock_map; | ||
| 83 | # define rcu_read_acquire() \ | ||
| 84 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
| 85 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | ||
| 86 | #else | ||
| 87 | # define rcu_read_acquire() do { } while (0) | ||
| 88 | # define rcu_read_release() do { } while (0) | ||
| 89 | #endif | ||
| 90 | |||
| 73 | /** | 91 | /** |
| 74 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 92 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
| 75 | * | 93 | * |
| @@ -99,7 +117,12 @@ extern int rcu_scheduler_active; | |||
| 99 | * | 117 | * |
| 100 | * It is illegal to block while in an RCU read-side critical section. | 118 | * It is illegal to block while in an RCU read-side critical section. |
| 101 | */ | 119 | */ |
| 102 | #define rcu_read_lock() __rcu_read_lock() | 120 | static inline void rcu_read_lock(void) |
| 121 | { | ||
| 122 | __rcu_read_lock(); | ||
| 123 | __acquire(RCU); | ||
| 124 | rcu_read_acquire(); | ||
| 125 | } | ||
| 103 | 126 | ||
| 104 | /** | 127 | /** |
| 105 | * rcu_read_unlock - marks the end of an RCU read-side critical section. | 128 | * rcu_read_unlock - marks the end of an RCU read-side critical section. |
| @@ -116,7 +139,12 @@ extern int rcu_scheduler_active; | |||
| 116 | * used as well. RCU does not care how the writers keep out of each | 139 | * used as well. RCU does not care how the writers keep out of each |
| 117 | * others' way, as long as they do so. | 140 | * others' way, as long as they do so. |
| 118 | */ | 141 | */ |
| 119 | #define rcu_read_unlock() __rcu_read_unlock() | 142 | static inline void rcu_read_unlock(void) |
| 143 | { | ||
| 144 | rcu_read_release(); | ||
| 145 | __release(RCU); | ||
| 146 | __rcu_read_unlock(); | ||
| 147 | } | ||
| 120 | 148 | ||
| 121 | /** | 149 | /** |
| 122 | * rcu_read_lock_bh - mark the beginning of a softirq-only RCU critical section | 150 | * rcu_read_lock_bh - mark the beginning of a softirq-only RCU critical section |
| @@ -129,14 +157,24 @@ extern int rcu_scheduler_active; | |||
| 129 | * can use just rcu_read_lock(). | 157 | * can use just rcu_read_lock(). |
| 130 | * | 158 | * |
| 131 | */ | 159 | */ |
| 132 | #define rcu_read_lock_bh() __rcu_read_lock_bh() | 160 | static inline void rcu_read_lock_bh(void) |
| 161 | { | ||
| 162 | __rcu_read_lock_bh(); | ||
| 163 | __acquire(RCU_BH); | ||
| 164 | rcu_read_acquire(); | ||
| 165 | } | ||
| 133 | 166 | ||
| 134 | /* | 167 | /* |
| 135 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section | 168 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section |
| 136 | * | 169 | * |
| 137 | * See rcu_read_lock_bh() for more information. | 170 | * See rcu_read_lock_bh() for more information. |
| 138 | */ | 171 | */ |
| 139 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() | 172 | static inline void rcu_read_unlock_bh(void) |
| 173 | { | ||
| 174 | rcu_read_release(); | ||
| 175 | __release(RCU_BH); | ||
| 176 | __rcu_read_unlock_bh(); | ||
| 177 | } | ||
| 140 | 178 | ||
| 141 | /** | 179 | /** |
| 142 | * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section | 180 | * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section |
| @@ -147,17 +185,34 @@ extern int rcu_scheduler_active; | |||
| 147 | * - call_rcu_sched() and rcu_barrier_sched() | 185 | * - call_rcu_sched() and rcu_barrier_sched() |
| 148 | * on the write-side to insure proper synchronization. | 186 | * on the write-side to insure proper synchronization. |
| 149 | */ | 187 | */ |
| 150 | #define rcu_read_lock_sched() preempt_disable() | 188 | static inline void rcu_read_lock_sched(void) |
| 151 | #define rcu_read_lock_sched_notrace() preempt_disable_notrace() | 189 | { |
| 190 | preempt_disable(); | ||
| 191 | __acquire(RCU_SCHED); | ||
| 192 | rcu_read_acquire(); | ||
| 193 | } | ||
| 194 | static inline notrace void rcu_read_lock_sched_notrace(void) | ||
| 195 | { | ||
| 196 | preempt_disable_notrace(); | ||
| 197 | __acquire(RCU_SCHED); | ||
| 198 | } | ||
| 152 | 199 | ||
| 153 | /* | 200 | /* |
| 154 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section | 201 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section |
| 155 | * | 202 | * |
| 156 | * See rcu_read_lock_sched for more information. | 203 | * See rcu_read_lock_sched for more information. |
| 157 | */ | 204 | */ |
| 158 | #define rcu_read_unlock_sched() preempt_enable() | 205 | static inline void rcu_read_unlock_sched(void) |
| 159 | #define rcu_read_unlock_sched_notrace() preempt_enable_notrace() | 206 | { |
| 160 | 207 | rcu_read_release(); | |
| 208 | __release(RCU_SCHED); | ||
| 209 | preempt_enable(); | ||
| 210 | } | ||
| 211 | static inline notrace void rcu_read_unlock_sched_notrace(void) | ||
| 212 | { | ||
| 213 | __release(RCU_SCHED); | ||
| 214 | preempt_enable_notrace(); | ||
| 215 | } | ||
| 161 | 216 | ||
| 162 | 217 | ||
| 163 | /** | 218 | /** |
| @@ -259,15 +314,4 @@ extern void call_rcu(struct rcu_head *head, | |||
| 259 | extern void call_rcu_bh(struct rcu_head *head, | 314 | extern void call_rcu_bh(struct rcu_head *head, |
| 260 | void (*func)(struct rcu_head *head)); | 315 | void (*func)(struct rcu_head *head)); |
| 261 | 316 | ||
| 262 | /* Exported common interfaces */ | ||
| 263 | extern void synchronize_rcu(void); | ||
| 264 | extern void rcu_barrier(void); | ||
| 265 | extern void rcu_barrier_bh(void); | ||
| 266 | extern void rcu_barrier_sched(void); | ||
| 267 | |||
| 268 | /* Internal to kernel */ | ||
| 269 | extern void rcu_init(void); | ||
| 270 | extern void rcu_scheduler_starting(void); | ||
| 271 | extern int rcu_needs_cpu(int cpu); | ||
| 272 | |||
| 273 | #endif /* __LINUX_RCUPDATE_H */ | 317 | #endif /* __LINUX_RCUPDATE_H */ |
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h deleted file mode 100644 index fce522782ffa..000000000000 --- a/include/linux/rcupreempt.h +++ /dev/null | |||
| @@ -1,127 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Read-Copy Update mechanism for mutual exclusion (RT implementation) | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | * | ||
| 18 | * Copyright (C) IBM Corporation, 2006 | ||
| 19 | * | ||
| 20 | * Author: Paul McKenney <paulmck@us.ibm.com> | ||
| 21 | * | ||
| 22 | * Based on the original work by Paul McKenney <paul.mckenney@us.ibm.com> | ||
| 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | ||
| 24 | * Papers: | ||
| 25 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf | ||
| 26 | * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001) | ||
| 27 | * | ||
| 28 | * For detailed explanation of Read-Copy Update mechanism see - | ||
| 29 | * Documentation/RCU | ||
| 30 | * | ||
| 31 | */ | ||
| 32 | |||
| 33 | #ifndef __LINUX_RCUPREEMPT_H | ||
| 34 | #define __LINUX_RCUPREEMPT_H | ||
| 35 | |||
| 36 | #include <linux/cache.h> | ||
| 37 | #include <linux/spinlock.h> | ||
| 38 | #include <linux/threads.h> | ||
| 39 | #include <linux/smp.h> | ||
| 40 | #include <linux/cpumask.h> | ||
| 41 | #include <linux/seqlock.h> | ||
| 42 | |||
| 43 | extern void rcu_qsctr_inc(int cpu); | ||
| 44 | static inline void rcu_bh_qsctr_inc(int cpu) { } | ||
| 45 | |||
| 46 | /* | ||
| 47 | * Someone might want to pass call_rcu_bh as a function pointer. | ||
| 48 | * So this needs to just be a rename and not a macro function. | ||
| 49 | * (no parentheses) | ||
| 50 | */ | ||
| 51 | #define call_rcu_bh call_rcu | ||
| 52 | |||
| 53 | /** | ||
| 54 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. | ||
| 55 | * @head: structure to be used for queueing the RCU updates. | ||
| 56 | * @func: actual update function to be invoked after the grace period | ||
| 57 | * | ||
| 58 | * The update function will be invoked some time after a full | ||
| 59 | * synchronize_sched()-style grace period elapses, in other words after | ||
| 60 | * all currently executing preempt-disabled sections of code (including | ||
| 61 | * hardirq handlers, NMI handlers, and local_irq_save() blocks) have | ||
| 62 | * completed. | ||
| 63 | */ | ||
| 64 | extern void call_rcu_sched(struct rcu_head *head, | ||
| 65 | void (*func)(struct rcu_head *head)); | ||
| 66 | |||
| 67 | extern void __rcu_read_lock(void) __acquires(RCU); | ||
| 68 | extern void __rcu_read_unlock(void) __releases(RCU); | ||
| 69 | extern int rcu_pending(int cpu); | ||
| 70 | extern int rcu_needs_cpu(int cpu); | ||
| 71 | |||
| 72 | #define __rcu_read_lock_bh() { rcu_read_lock(); local_bh_disable(); } | ||
| 73 | #define __rcu_read_unlock_bh() { local_bh_enable(); rcu_read_unlock(); } | ||
| 74 | |||
| 75 | extern void __synchronize_sched(void); | ||
| 76 | |||
| 77 | extern void __rcu_init(void); | ||
| 78 | extern void rcu_init_sched(void); | ||
| 79 | extern void rcu_check_callbacks(int cpu, int user); | ||
| 80 | extern void rcu_restart_cpu(int cpu); | ||
| 81 | extern long rcu_batches_completed(void); | ||
| 82 | |||
| 83 | /* | ||
| 84 | * Return the number of RCU batches processed thus far. Useful for debug | ||
| 85 | * and statistic. The _bh variant is identifcal to straight RCU | ||
| 86 | */ | ||
| 87 | static inline long rcu_batches_completed_bh(void) | ||
| 88 | { | ||
| 89 | return rcu_batches_completed(); | ||
| 90 | } | ||
| 91 | |||
| 92 | #ifdef CONFIG_RCU_TRACE | ||
| 93 | struct rcupreempt_trace; | ||
| 94 | extern long *rcupreempt_flipctr(int cpu); | ||
| 95 | extern long rcupreempt_data_completed(void); | ||
| 96 | extern int rcupreempt_flip_flag(int cpu); | ||
| 97 | extern int rcupreempt_mb_flag(int cpu); | ||
| 98 | extern char *rcupreempt_try_flip_state_name(void); | ||
| 99 | extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); | ||
| 100 | #endif | ||
| 101 | |||
| 102 | struct softirq_action; | ||
| 103 | |||
| 104 | #ifdef CONFIG_NO_HZ | ||
| 105 | extern void rcu_enter_nohz(void); | ||
| 106 | extern void rcu_exit_nohz(void); | ||
| 107 | #else | ||
| 108 | # define rcu_enter_nohz() do { } while (0) | ||
| 109 | # define rcu_exit_nohz() do { } while (0) | ||
| 110 | #endif | ||
| 111 | |||
| 112 | /* | ||
| 113 | * A context switch is a grace period for rcupreempt synchronize_rcu() | ||
| 114 | * only during early boot, before the scheduler has been initialized. | ||
| 115 | * So, how the heck do we get a context switch? Well, if the caller | ||
| 116 | * invokes synchronize_rcu(), they are willing to accept a context | ||
| 117 | * switch, so we simply pretend that one happened. | ||
| 118 | * | ||
| 119 | * After boot, there might be a blocked or preempted task in an RCU | ||
| 120 | * read-side critical section, so we cannot then take the fastpath. | ||
| 121 | */ | ||
| 122 | static inline int rcu_blocking_is_gp(void) | ||
| 123 | { | ||
| 124 | return num_online_cpus() == 1 && !rcu_scheduler_active; | ||
| 125 | } | ||
| 126 | |||
| 127 | #endif /* __LINUX_RCUPREEMPT_H */ | ||
diff --git a/include/linux/rcupreempt_trace.h b/include/linux/rcupreempt_trace.h deleted file mode 100644 index b99ae073192a..000000000000 --- a/include/linux/rcupreempt_trace.h +++ /dev/null | |||
| @@ -1,97 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * Read-Copy Update mechanism for mutual exclusion (RT implementation) | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License, or | ||
| 7 | * (at your option) any later version. | ||
| 8 | * | ||
| 9 | * This program is distributed in the hope that it will be useful, | ||
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | * GNU General Public License for more details. | ||
| 13 | * | ||
| 14 | * You should have received a copy of the GNU General Public License | ||
| 15 | * along with this program; if not, write to the Free Software | ||
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 17 | * | ||
| 18 | * Copyright (C) IBM Corporation, 2006 | ||
| 19 | * | ||
| 20 | * Author: Paul McKenney <paulmck@us.ibm.com> | ||
| 21 | * | ||
| 22 | * Based on the original work by Paul McKenney <paul.mckenney@us.ibm.com> | ||
| 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | ||
| 24 | * Papers: | ||
| 25 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf | ||
| 26 | * http://lse.sourceforge.net/locking/rclock_OLS.2001.05.01c.sc.pdf (OLS2001) | ||
| 27 | * | ||
| 28 | * For detailed explanation of the Preemptible Read-Copy Update mechanism see - | ||
| 29 | * http://lwn.net/Articles/253651/ | ||
| 30 | */ | ||
| 31 | |||
| 32 | #ifndef __LINUX_RCUPREEMPT_TRACE_H | ||
| 33 | #define __LINUX_RCUPREEMPT_TRACE_H | ||
| 34 | |||
| 35 | #include <linux/types.h> | ||
| 36 | #include <linux/kernel.h> | ||
| 37 | |||
| 38 | #include <asm/atomic.h> | ||
| 39 | |||
| 40 | /* | ||
| 41 | * PREEMPT_RCU data structures. | ||
| 42 | */ | ||
| 43 | |||
| 44 | struct rcupreempt_trace { | ||
| 45 | long next_length; | ||
| 46 | long next_add; | ||
| 47 | long wait_length; | ||
| 48 | long wait_add; | ||
| 49 | long done_length; | ||
| 50 | long done_add; | ||
| 51 | long done_remove; | ||
| 52 | atomic_t done_invoked; | ||
| 53 | long rcu_check_callbacks; | ||
| 54 | atomic_t rcu_try_flip_1; | ||
| 55 | atomic_t rcu_try_flip_e1; | ||
| 56 | long rcu_try_flip_i1; | ||
| 57 | long rcu_try_flip_ie1; | ||
| 58 | long rcu_try_flip_g1; | ||
| 59 | long rcu_try_flip_a1; | ||
| 60 | long rcu_try_flip_ae1; | ||
| 61 | long rcu_try_flip_a2; | ||
| 62 | long rcu_try_flip_z1; | ||
| 63 | long rcu_try_flip_ze1; | ||
| 64 | long rcu_try_flip_z2; | ||
| 65 | long rcu_try_flip_m1; | ||
| 66 | long rcu_try_flip_me1; | ||
| 67 | long rcu_try_flip_m2; | ||
| 68 | }; | ||
| 69 | |||
| 70 | #ifdef CONFIG_RCU_TRACE | ||
| 71 | #define RCU_TRACE(fn, arg) fn(arg); | ||
| 72 | #else | ||
| 73 | #define RCU_TRACE(fn, arg) | ||
| 74 | #endif | ||
| 75 | |||
| 76 | extern void rcupreempt_trace_move2done(struct rcupreempt_trace *trace); | ||
| 77 | extern void rcupreempt_trace_move2wait(struct rcupreempt_trace *trace); | ||
| 78 | extern void rcupreempt_trace_try_flip_1(struct rcupreempt_trace *trace); | ||
| 79 | extern void rcupreempt_trace_try_flip_e1(struct rcupreempt_trace *trace); | ||
| 80 | extern void rcupreempt_trace_try_flip_i1(struct rcupreempt_trace *trace); | ||
| 81 | extern void rcupreempt_trace_try_flip_ie1(struct rcupreempt_trace *trace); | ||
| 82 | extern void rcupreempt_trace_try_flip_g1(struct rcupreempt_trace *trace); | ||
| 83 | extern void rcupreempt_trace_try_flip_a1(struct rcupreempt_trace *trace); | ||
| 84 | extern void rcupreempt_trace_try_flip_ae1(struct rcupreempt_trace *trace); | ||
| 85 | extern void rcupreempt_trace_try_flip_a2(struct rcupreempt_trace *trace); | ||
| 86 | extern void rcupreempt_trace_try_flip_z1(struct rcupreempt_trace *trace); | ||
| 87 | extern void rcupreempt_trace_try_flip_ze1(struct rcupreempt_trace *trace); | ||
| 88 | extern void rcupreempt_trace_try_flip_z2(struct rcupreempt_trace *trace); | ||
| 89 | extern void rcupreempt_trace_try_flip_m1(struct rcupreempt_trace *trace); | ||
| 90 | extern void rcupreempt_trace_try_flip_me1(struct rcupreempt_trace *trace); | ||
| 91 | extern void rcupreempt_trace_try_flip_m2(struct rcupreempt_trace *trace); | ||
| 92 | extern void rcupreempt_trace_check_callbacks(struct rcupreempt_trace *trace); | ||
| 93 | extern void rcupreempt_trace_done_remove(struct rcupreempt_trace *trace); | ||
| 94 | extern void rcupreempt_trace_invoke(struct rcupreempt_trace *trace); | ||
| 95 | extern void rcupreempt_trace_next_add(struct rcupreempt_trace *trace); | ||
| 96 | |||
| 97 | #endif /* __LINUX_RCUPREEMPT_TRACE_H */ | ||
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 5a5153806c42..a89307717825 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -30,264 +30,57 @@ | |||
| 30 | #ifndef __LINUX_RCUTREE_H | 30 | #ifndef __LINUX_RCUTREE_H |
| 31 | #define __LINUX_RCUTREE_H | 31 | #define __LINUX_RCUTREE_H |
| 32 | 32 | ||
| 33 | #include <linux/cache.h> | 33 | extern void rcu_sched_qs(int cpu); |
| 34 | #include <linux/spinlock.h> | 34 | extern void rcu_bh_qs(int cpu); |
| 35 | #include <linux/threads.h> | ||
| 36 | #include <linux/cpumask.h> | ||
| 37 | #include <linux/seqlock.h> | ||
| 38 | 35 | ||
| 39 | /* | 36 | extern int rcu_needs_cpu(int cpu); |
| 40 | * Define shape of hierarchy based on NR_CPUS and CONFIG_RCU_FANOUT. | ||
| 41 | * In theory, it should be possible to add more levels straightforwardly. | ||
| 42 | * In practice, this has not been tested, so there is probably some | ||
| 43 | * bug somewhere. | ||
| 44 | */ | ||
| 45 | #define MAX_RCU_LVLS 3 | ||
| 46 | #define RCU_FANOUT (CONFIG_RCU_FANOUT) | ||
| 47 | #define RCU_FANOUT_SQ (RCU_FANOUT * RCU_FANOUT) | ||
| 48 | #define RCU_FANOUT_CUBE (RCU_FANOUT_SQ * RCU_FANOUT) | ||
| 49 | |||
| 50 | #if NR_CPUS <= RCU_FANOUT | ||
| 51 | # define NUM_RCU_LVLS 1 | ||
| 52 | # define NUM_RCU_LVL_0 1 | ||
| 53 | # define NUM_RCU_LVL_1 (NR_CPUS) | ||
| 54 | # define NUM_RCU_LVL_2 0 | ||
| 55 | # define NUM_RCU_LVL_3 0 | ||
| 56 | #elif NR_CPUS <= RCU_FANOUT_SQ | ||
| 57 | # define NUM_RCU_LVLS 2 | ||
| 58 | # define NUM_RCU_LVL_0 1 | ||
| 59 | # define NUM_RCU_LVL_1 (((NR_CPUS) + RCU_FANOUT - 1) / RCU_FANOUT) | ||
| 60 | # define NUM_RCU_LVL_2 (NR_CPUS) | ||
| 61 | # define NUM_RCU_LVL_3 0 | ||
| 62 | #elif NR_CPUS <= RCU_FANOUT_CUBE | ||
| 63 | # define NUM_RCU_LVLS 3 | ||
| 64 | # define NUM_RCU_LVL_0 1 | ||
| 65 | # define NUM_RCU_LVL_1 (((NR_CPUS) + RCU_FANOUT_SQ - 1) / RCU_FANOUT_SQ) | ||
| 66 | # define NUM_RCU_LVL_2 (((NR_CPUS) + (RCU_FANOUT) - 1) / (RCU_FANOUT)) | ||
| 67 | # define NUM_RCU_LVL_3 NR_CPUS | ||
| 68 | #else | ||
| 69 | # error "CONFIG_RCU_FANOUT insufficient for NR_CPUS" | ||
| 70 | #endif /* #if (NR_CPUS) <= RCU_FANOUT */ | ||
| 71 | |||
| 72 | #define RCU_SUM (NUM_RCU_LVL_0 + NUM_RCU_LVL_1 + NUM_RCU_LVL_2 + NUM_RCU_LVL_3) | ||
| 73 | #define NUM_RCU_NODES (RCU_SUM - NR_CPUS) | ||
| 74 | |||
| 75 | /* | ||
| 76 | * Dynticks per-CPU state. | ||
| 77 | */ | ||
| 78 | struct rcu_dynticks { | ||
| 79 | int dynticks_nesting; /* Track nesting level, sort of. */ | ||
| 80 | int dynticks; /* Even value for dynticks-idle, else odd. */ | ||
| 81 | int dynticks_nmi; /* Even value for either dynticks-idle or */ | ||
| 82 | /* not in nmi handler, else odd. So this */ | ||
| 83 | /* remains even for nmi from irq handler. */ | ||
| 84 | }; | ||
| 85 | |||
| 86 | /* | ||
| 87 | * Definition for node within the RCU grace-period-detection hierarchy. | ||
| 88 | */ | ||
| 89 | struct rcu_node { | ||
| 90 | spinlock_t lock; | ||
| 91 | unsigned long qsmask; /* CPUs or groups that need to switch in */ | ||
| 92 | /* order for current grace period to proceed.*/ | ||
| 93 | unsigned long qsmaskinit; | ||
| 94 | /* Per-GP initialization for qsmask. */ | ||
| 95 | unsigned long grpmask; /* Mask to apply to parent qsmask. */ | ||
| 96 | int grplo; /* lowest-numbered CPU or group here. */ | ||
| 97 | int grphi; /* highest-numbered CPU or group here. */ | ||
| 98 | u8 grpnum; /* CPU/group number for next level up. */ | ||
| 99 | u8 level; /* root is at level 0. */ | ||
| 100 | struct rcu_node *parent; | ||
| 101 | } ____cacheline_internodealigned_in_smp; | ||
| 102 | |||
| 103 | /* Index values for nxttail array in struct rcu_data. */ | ||
| 104 | #define RCU_DONE_TAIL 0 /* Also RCU_WAIT head. */ | ||
| 105 | #define RCU_WAIT_TAIL 1 /* Also RCU_NEXT_READY head. */ | ||
| 106 | #define RCU_NEXT_READY_TAIL 2 /* Also RCU_NEXT head. */ | ||
| 107 | #define RCU_NEXT_TAIL 3 | ||
| 108 | #define RCU_NEXT_SIZE 4 | ||
| 109 | |||
| 110 | /* Per-CPU data for read-copy update. */ | ||
| 111 | struct rcu_data { | ||
| 112 | /* 1) quiescent-state and grace-period handling : */ | ||
| 113 | long completed; /* Track rsp->completed gp number */ | ||
| 114 | /* in order to detect GP end. */ | ||
| 115 | long gpnum; /* Highest gp number that this CPU */ | ||
| 116 | /* is aware of having started. */ | ||
| 117 | long passed_quiesc_completed; | ||
| 118 | /* Value of completed at time of qs. */ | ||
| 119 | bool passed_quiesc; /* User-mode/idle loop etc. */ | ||
| 120 | bool qs_pending; /* Core waits for quiesc state. */ | ||
| 121 | bool beenonline; /* CPU online at least once. */ | ||
| 122 | struct rcu_node *mynode; /* This CPU's leaf of hierarchy */ | ||
| 123 | unsigned long grpmask; /* Mask to apply to leaf qsmask. */ | ||
| 124 | |||
| 125 | /* 2) batch handling */ | ||
| 126 | /* | ||
| 127 | * If nxtlist is not NULL, it is partitioned as follows. | ||
| 128 | * Any of the partitions might be empty, in which case the | ||
| 129 | * pointer to that partition will be equal to the pointer for | ||
| 130 | * the following partition. When the list is empty, all of | ||
| 131 | * the nxttail elements point to nxtlist, which is NULL. | ||
| 132 | * | ||
| 133 | * [*nxttail[RCU_NEXT_READY_TAIL], NULL = *nxttail[RCU_NEXT_TAIL]): | ||
| 134 | * Entries that might have arrived after current GP ended | ||
| 135 | * [*nxttail[RCU_WAIT_TAIL], *nxttail[RCU_NEXT_READY_TAIL]): | ||
| 136 | * Entries known to have arrived before current GP ended | ||
| 137 | * [*nxttail[RCU_DONE_TAIL], *nxttail[RCU_WAIT_TAIL]): | ||
| 138 | * Entries that batch # <= ->completed - 1: waiting for current GP | ||
| 139 | * [nxtlist, *nxttail[RCU_DONE_TAIL]): | ||
| 140 | * Entries that batch # <= ->completed | ||
| 141 | * The grace period for these entries has completed, and | ||
| 142 | * the other grace-period-completed entries may be moved | ||
| 143 | * here temporarily in rcu_process_callbacks(). | ||
| 144 | */ | ||
| 145 | struct rcu_head *nxtlist; | ||
| 146 | struct rcu_head **nxttail[RCU_NEXT_SIZE]; | ||
| 147 | long qlen; /* # of queued callbacks */ | ||
| 148 | long blimit; /* Upper limit on a processed batch */ | ||
| 149 | |||
| 150 | #ifdef CONFIG_NO_HZ | ||
| 151 | /* 3) dynticks interface. */ | ||
| 152 | struct rcu_dynticks *dynticks; /* Shared per-CPU dynticks state. */ | ||
| 153 | int dynticks_snap; /* Per-GP tracking for dynticks. */ | ||
| 154 | int dynticks_nmi_snap; /* Per-GP tracking for dynticks_nmi. */ | ||
| 155 | #endif /* #ifdef CONFIG_NO_HZ */ | ||
| 156 | |||
| 157 | /* 4) reasons this CPU needed to be kicked by force_quiescent_state */ | ||
| 158 | #ifdef CONFIG_NO_HZ | ||
| 159 | unsigned long dynticks_fqs; /* Kicked due to dynticks idle. */ | ||
| 160 | #endif /* #ifdef CONFIG_NO_HZ */ | ||
| 161 | unsigned long offline_fqs; /* Kicked due to being offline. */ | ||
| 162 | unsigned long resched_ipi; /* Sent a resched IPI. */ | ||
| 163 | |||
| 164 | /* 5) __rcu_pending() statistics. */ | ||
| 165 | long n_rcu_pending; /* rcu_pending() calls since boot. */ | ||
| 166 | long n_rp_qs_pending; | ||
| 167 | long n_rp_cb_ready; | ||
| 168 | long n_rp_cpu_needs_gp; | ||
| 169 | long n_rp_gp_completed; | ||
| 170 | long n_rp_gp_started; | ||
| 171 | long n_rp_need_fqs; | ||
| 172 | long n_rp_need_nothing; | ||
| 173 | |||
| 174 | int cpu; | ||
| 175 | }; | ||
| 176 | |||
| 177 | /* Values for signaled field in struct rcu_state. */ | ||
| 178 | #define RCU_GP_INIT 0 /* Grace period being initialized. */ | ||
| 179 | #define RCU_SAVE_DYNTICK 1 /* Need to scan dyntick state. */ | ||
| 180 | #define RCU_FORCE_QS 2 /* Need to force quiescent state. */ | ||
| 181 | #ifdef CONFIG_NO_HZ | ||
| 182 | #define RCU_SIGNAL_INIT RCU_SAVE_DYNTICK | ||
| 183 | #else /* #ifdef CONFIG_NO_HZ */ | ||
| 184 | #define RCU_SIGNAL_INIT RCU_FORCE_QS | ||
| 185 | #endif /* #else #ifdef CONFIG_NO_HZ */ | ||
| 186 | |||
| 187 | #define RCU_JIFFIES_TILL_FORCE_QS 3 /* for rsp->jiffies_force_qs */ | ||
| 188 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
| 189 | #define RCU_SECONDS_TILL_STALL_CHECK (10 * HZ) /* for rsp->jiffies_stall */ | ||
| 190 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rsp->jiffies_stall */ | ||
| 191 | #define RCU_STALL_RAT_DELAY 2 /* Allow other CPUs time */ | ||
| 192 | /* to take at least one */ | ||
| 193 | /* scheduling clock irq */ | ||
| 194 | /* before ratting on them. */ | ||
| 195 | |||
| 196 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
| 197 | |||
| 198 | /* | ||
| 199 | * RCU global state, including node hierarchy. This hierarchy is | ||
| 200 | * represented in "heap" form in a dense array. The root (first level) | ||
| 201 | * of the hierarchy is in ->node[0] (referenced by ->level[0]), the second | ||
| 202 | * level in ->node[1] through ->node[m] (->node[1] referenced by ->level[1]), | ||
| 203 | * and the third level in ->node[m+1] and following (->node[m+1] referenced | ||
| 204 | * by ->level[2]). The number of levels is determined by the number of | ||
| 205 | * CPUs and by CONFIG_RCU_FANOUT. Small systems will have a "hierarchy" | ||
| 206 | * consisting of a single rcu_node. | ||
| 207 | */ | ||
| 208 | struct rcu_state { | ||
| 209 | struct rcu_node node[NUM_RCU_NODES]; /* Hierarchy. */ | ||
| 210 | struct rcu_node *level[NUM_RCU_LVLS]; /* Hierarchy levels. */ | ||
| 211 | u32 levelcnt[MAX_RCU_LVLS + 1]; /* # nodes in each level. */ | ||
| 212 | u8 levelspread[NUM_RCU_LVLS]; /* kids/node in each level. */ | ||
| 213 | struct rcu_data *rda[NR_CPUS]; /* array of rdp pointers. */ | ||
| 214 | |||
| 215 | /* The following fields are guarded by the root rcu_node's lock. */ | ||
| 216 | |||
| 217 | u8 signaled ____cacheline_internodealigned_in_smp; | ||
| 218 | /* Force QS state. */ | ||
| 219 | long gpnum; /* Current gp number. */ | ||
| 220 | long completed; /* # of last completed gp. */ | ||
| 221 | spinlock_t onofflock; /* exclude on/offline and */ | ||
| 222 | /* starting new GP. */ | ||
| 223 | spinlock_t fqslock; /* Only one task forcing */ | ||
| 224 | /* quiescent states. */ | ||
| 225 | unsigned long jiffies_force_qs; /* Time at which to invoke */ | ||
| 226 | /* force_quiescent_state(). */ | ||
| 227 | unsigned long n_force_qs; /* Number of calls to */ | ||
| 228 | /* force_quiescent_state(). */ | ||
| 229 | unsigned long n_force_qs_lh; /* ~Number of calls leaving */ | ||
| 230 | /* due to lock unavailable. */ | ||
| 231 | unsigned long n_force_qs_ngp; /* Number of calls leaving */ | ||
| 232 | /* due to no GP active. */ | ||
| 233 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
| 234 | unsigned long gp_start; /* Time at which GP started, */ | ||
| 235 | /* but in jiffies. */ | ||
| 236 | unsigned long jiffies_stall; /* Time at which to check */ | ||
| 237 | /* for CPU stalls. */ | ||
| 238 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
| 239 | #ifdef CONFIG_NO_HZ | ||
| 240 | long dynticks_completed; /* Value of completed @ snap. */ | ||
| 241 | #endif /* #ifdef CONFIG_NO_HZ */ | ||
| 242 | }; | ||
| 243 | 37 | ||
| 244 | extern void rcu_qsctr_inc(int cpu); | 38 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 245 | extern void rcu_bh_qsctr_inc(int cpu); | ||
| 246 | 39 | ||
| 247 | extern int rcu_pending(int cpu); | 40 | extern void __rcu_read_lock(void); |
| 248 | extern int rcu_needs_cpu(int cpu); | 41 | extern void __rcu_read_unlock(void); |
| 42 | extern void exit_rcu(void); | ||
| 249 | 43 | ||
| 250 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 44 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
| 251 | extern struct lockdep_map rcu_lock_map; | ||
| 252 | # define rcu_read_acquire() \ | ||
| 253 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
| 254 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | ||
| 255 | #else | ||
| 256 | # define rcu_read_acquire() do { } while (0) | ||
| 257 | # define rcu_read_release() do { } while (0) | ||
| 258 | #endif | ||
| 259 | 45 | ||
| 260 | static inline void __rcu_read_lock(void) | 46 | static inline void __rcu_read_lock(void) |
| 261 | { | 47 | { |
| 262 | preempt_disable(); | 48 | preempt_disable(); |
| 263 | __acquire(RCU); | ||
| 264 | rcu_read_acquire(); | ||
| 265 | } | 49 | } |
| 50 | |||
| 266 | static inline void __rcu_read_unlock(void) | 51 | static inline void __rcu_read_unlock(void) |
| 267 | { | 52 | { |
| 268 | rcu_read_release(); | ||
| 269 | __release(RCU); | ||
| 270 | preempt_enable(); | 53 | preempt_enable(); |
| 271 | } | 54 | } |
| 55 | |||
| 56 | static inline void exit_rcu(void) | ||
| 57 | { | ||
| 58 | } | ||
| 59 | |||
| 60 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
| 61 | |||
| 272 | static inline void __rcu_read_lock_bh(void) | 62 | static inline void __rcu_read_lock_bh(void) |
| 273 | { | 63 | { |
| 274 | local_bh_disable(); | 64 | local_bh_disable(); |
| 275 | __acquire(RCU_BH); | ||
| 276 | rcu_read_acquire(); | ||
| 277 | } | 65 | } |
| 278 | static inline void __rcu_read_unlock_bh(void) | 66 | static inline void __rcu_read_unlock_bh(void) |
| 279 | { | 67 | { |
| 280 | rcu_read_release(); | ||
| 281 | __release(RCU_BH); | ||
| 282 | local_bh_enable(); | 68 | local_bh_enable(); |
| 283 | } | 69 | } |
| 284 | 70 | ||
| 285 | #define __synchronize_sched() synchronize_rcu() | 71 | #define __synchronize_sched() synchronize_rcu() |
| 286 | 72 | ||
| 287 | #define call_rcu_sched(head, func) call_rcu(head, func) | 73 | extern void call_rcu_sched(struct rcu_head *head, |
| 74 | void (*func)(struct rcu_head *rcu)); | ||
| 288 | 75 | ||
| 289 | static inline void rcu_init_sched(void) | 76 | static inline void synchronize_rcu_expedited(void) |
| 290 | { | 77 | { |
| 78 | synchronize_sched_expedited(); | ||
| 79 | } | ||
| 80 | |||
| 81 | static inline void synchronize_rcu_bh_expedited(void) | ||
| 82 | { | ||
| 83 | synchronize_sched_expedited(); | ||
| 291 | } | 84 | } |
| 292 | 85 | ||
| 293 | extern void __rcu_init(void); | 86 | extern void __rcu_init(void); |
| @@ -296,6 +89,11 @@ extern void rcu_restart_cpu(int cpu); | |||
| 296 | 89 | ||
| 297 | extern long rcu_batches_completed(void); | 90 | extern long rcu_batches_completed(void); |
| 298 | extern long rcu_batches_completed_bh(void); | 91 | extern long rcu_batches_completed_bh(void); |
| 92 | extern long rcu_batches_completed_sched(void); | ||
| 93 | |||
| 94 | static inline void rcu_init_sched(void) | ||
| 95 | { | ||
| 96 | } | ||
| 299 | 97 | ||
| 300 | #ifdef CONFIG_NO_HZ | 98 | #ifdef CONFIG_NO_HZ |
| 301 | void rcu_enter_nohz(void); | 99 | void rcu_enter_nohz(void); |
diff --git a/include/linux/rds.h b/include/linux/rds.h index d91dc91f5443..89d46e1afbb1 100644 --- a/include/linux/rds.h +++ b/include/linux/rds.h | |||
| @@ -147,6 +147,18 @@ struct rds_info_socket { | |||
| 147 | u_int64_t inum; | 147 | u_int64_t inum; |
| 148 | } __attribute__((packed)); | 148 | } __attribute__((packed)); |
| 149 | 149 | ||
| 150 | struct rds_info_tcp_socket { | ||
| 151 | __be32 local_addr; | ||
| 152 | __be16 local_port; | ||
| 153 | __be32 peer_addr; | ||
| 154 | __be16 peer_port; | ||
| 155 | u_int64_t hdr_rem; | ||
| 156 | u_int64_t data_rem; | ||
| 157 | u_int32_t last_sent_nxt; | ||
| 158 | u_int32_t last_expected_una; | ||
| 159 | u_int32_t last_seen_una; | ||
| 160 | } __attribute__((packed)); | ||
| 161 | |||
| 150 | #define RDS_IB_GID_LEN 16 | 162 | #define RDS_IB_GID_LEN 16 |
| 151 | struct rds_info_rdma_connection { | 163 | struct rds_info_rdma_connection { |
| 152 | __be32 src_addr; | 164 | __be32 src_addr; |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 2ce29831feb6..3392c59d2706 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
| @@ -6,20 +6,17 @@ | |||
| 6 | * Copyright (C) 2007 Dmitry Torokhov | 6 | * Copyright (C) 2007 Dmitry Torokhov |
| 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> | 7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> |
| 8 | * | 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify | 9 | * Permission to use, copy, modify, and/or distribute this software for any |
| 10 | * it under the terms of the GNU General Public License as published by | 10 | * purpose with or without fee is hereby granted, provided that the above |
| 11 | * the Free Software Foundation; either version 2 of the License, or | 11 | * copyright notice and this permission notice appear in all copies. |
| 12 | * (at your option) any later version. | ||
| 13 | * | 12 | * |
| 14 | * This program is distributed in the hope that it will be useful, | 13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
| 17 | * GNU General Public License for more details. | 16 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
| 18 | * | 17 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 19 | * You should have received a copy of the GNU General Public License | 18 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 20 | * along with this program; if not, write to the | 19 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 21 | * Free Software Foundation, Inc., | ||
| 22 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
| 23 | */ | 20 | */ |
| 24 | 21 | ||
| 25 | #include <linux/types.h> | 22 | #include <linux/types.h> |
| @@ -47,6 +44,7 @@ enum rfkill_type { | |||
| 47 | RFKILL_TYPE_UWB, | 44 | RFKILL_TYPE_UWB, |
| 48 | RFKILL_TYPE_WIMAX, | 45 | RFKILL_TYPE_WIMAX, |
| 49 | RFKILL_TYPE_WWAN, | 46 | RFKILL_TYPE_WWAN, |
| 47 | RFKILL_TYPE_GPS, | ||
| 50 | NUM_RFKILL_TYPES, | 48 | NUM_RFKILL_TYPES, |
| 51 | }; | 49 | }; |
| 52 | 50 | ||
| @@ -82,6 +80,20 @@ struct rfkill_event { | |||
| 82 | __u8 soft, hard; | 80 | __u8 soft, hard; |
| 83 | } __packed; | 81 | } __packed; |
| 84 | 82 | ||
| 83 | /* | ||
| 84 | * We are planning to be backward and forward compatible with changes | ||
| 85 | * to the event struct, by adding new, optional, members at the end. | ||
| 86 | * When reading an event (whether the kernel from userspace or vice | ||
| 87 | * versa) we need to accept anything that's at least as large as the | ||
| 88 | * version 1 event size, but might be able to accept other sizes in | ||
| 89 | * the future. | ||
| 90 | * | ||
| 91 | * One exception is the kernel -- we already have two event sizes in | ||
| 92 | * that we've made the 'hard' member optional since our only option | ||
| 93 | * is to ignore it anyway. | ||
| 94 | */ | ||
| 95 | #define RFKILL_EVENT_SIZE_V1 8 | ||
| 96 | |||
| 85 | /* ioctl for turning off rfkill-input (if present) */ | 97 | /* ioctl for turning off rfkill-input (if present) */ |
| 86 | #define RFKILL_IOC_MAGIC 'R' | 98 | #define RFKILL_IOC_MAGIC 'R' |
| 87 | #define RFKILL_IOC_NOINPUT 1 | 99 | #define RFKILL_IOC_NOINPUT 1 |
| @@ -224,7 +236,7 @@ void rfkill_destroy(struct rfkill *rfkill); | |||
| 224 | * should be blocked) so that drivers need not keep track of the soft | 236 | * should be blocked) so that drivers need not keep track of the soft |
| 225 | * block state -- which they might not be able to. | 237 | * block state -- which they might not be able to. |
| 226 | */ | 238 | */ |
| 227 | bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); | 239 | bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); |
| 228 | 240 | ||
| 229 | /** | 241 | /** |
| 230 | * rfkill_set_sw_state - Set the internal rfkill software block state | 242 | * rfkill_set_sw_state - Set the internal rfkill software block state |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 29f8599e6bea..5fcc31ed5771 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
| @@ -75,20 +75,6 @@ ring_buffer_event_time_delta(struct ring_buffer_event *event) | |||
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | /* | 77 | /* |
| 78 | * ring_buffer_event_discard can discard any event in the ring buffer. | ||
| 79 | * it is up to the caller to protect against a reader from | ||
| 80 | * consuming it or a writer from wrapping and replacing it. | ||
| 81 | * | ||
| 82 | * No external protection is needed if this is called before | ||
| 83 | * the event is commited. But in that case it would be better to | ||
| 84 | * use ring_buffer_discard_commit. | ||
| 85 | * | ||
| 86 | * Note, if an event that has not been committed is discarded | ||
| 87 | * with ring_buffer_event_discard, it must still be committed. | ||
| 88 | */ | ||
| 89 | void ring_buffer_event_discard(struct ring_buffer_event *event); | ||
| 90 | |||
| 91 | /* | ||
| 92 | * ring_buffer_discard_commit will remove an event that has not | 78 | * ring_buffer_discard_commit will remove an event that has not |
| 93 | * ben committed yet. If this is used, then ring_buffer_unlock_commit | 79 | * ben committed yet. If this is used, then ring_buffer_unlock_commit |
| 94 | * must not be called on the discarded event. This function | 80 | * must not be called on the discarded event. This function |
| @@ -154,8 +140,17 @@ unsigned long ring_buffer_size(struct ring_buffer *buffer); | |||
| 154 | void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu); | 140 | void ring_buffer_reset_cpu(struct ring_buffer *buffer, int cpu); |
| 155 | void ring_buffer_reset(struct ring_buffer *buffer); | 141 | void ring_buffer_reset(struct ring_buffer *buffer); |
| 156 | 142 | ||
| 143 | #ifdef CONFIG_RING_BUFFER_ALLOW_SWAP | ||
| 157 | int ring_buffer_swap_cpu(struct ring_buffer *buffer_a, | 144 | int ring_buffer_swap_cpu(struct ring_buffer *buffer_a, |
| 158 | struct ring_buffer *buffer_b, int cpu); | 145 | struct ring_buffer *buffer_b, int cpu); |
| 146 | #else | ||
| 147 | static inline int | ||
| 148 | ring_buffer_swap_cpu(struct ring_buffer *buffer_a, | ||
| 149 | struct ring_buffer *buffer_b, int cpu) | ||
| 150 | { | ||
| 151 | return -ENODEV; | ||
| 152 | } | ||
| 153 | #endif | ||
| 159 | 154 | ||
| 160 | int ring_buffer_empty(struct ring_buffer *buffer); | 155 | int ring_buffer_empty(struct ring_buffer *buffer); |
| 161 | int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu); | 156 | int ring_buffer_empty_cpu(struct ring_buffer *buffer, int cpu); |
| @@ -170,7 +165,6 @@ unsigned long ring_buffer_overruns(struct ring_buffer *buffer); | |||
| 170 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); | 165 | unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); |
| 171 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); | 166 | unsigned long ring_buffer_overrun_cpu(struct ring_buffer *buffer, int cpu); |
| 172 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); | 167 | unsigned long ring_buffer_commit_overrun_cpu(struct ring_buffer *buffer, int cpu); |
| 173 | unsigned long ring_buffer_nmi_dropped_cpu(struct ring_buffer *buffer, int cpu); | ||
| 174 | 168 | ||
| 175 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); | 169 | u64 ring_buffer_time_stamp(struct ring_buffer *buffer, int cpu); |
| 176 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, | 170 | void ring_buffer_normalize_time_stamp(struct ring_buffer *buffer, |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ba3254ecf7fb..adf2068d12b5 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -104,7 +104,7 @@ enum { | |||
| 104 | RTM_NEWADDRLABEL = 72, | 104 | RTM_NEWADDRLABEL = 72, |
| 105 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | 105 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL |
| 106 | RTM_DELADDRLABEL, | 106 | RTM_DELADDRLABEL, |
| 107 | #define RTM_NEWADDRLABEL RTM_NEWADDRLABEL | 107 | #define RTM_DELADDRLABEL RTM_DELADDRLABEL |
| 108 | RTM_GETADDRLABEL, | 108 | RTM_GETADDRLABEL, |
| 109 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL | 109 | #define RTM_GETADDRLABEL RTM_GETADDRLABEL |
| 110 | 110 | ||
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h index e5996984ddd0..9aaf5bfdad1a 100644 --- a/include/linux/scatterlist.h +++ b/include/linux/scatterlist.h | |||
| @@ -242,6 +242,8 @@ size_t sg_copy_to_buffer(struct scatterlist *sgl, unsigned int nents, | |||
| 242 | */ | 242 | */ |
| 243 | 243 | ||
| 244 | #define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ | 244 | #define SG_MITER_ATOMIC (1 << 0) /* use kmap_atomic */ |
| 245 | #define SG_MITER_TO_SG (1 << 1) /* flush back to phys on unmap */ | ||
| 246 | #define SG_MITER_FROM_SG (1 << 2) /* nop */ | ||
| 245 | 247 | ||
| 246 | struct sg_mapping_iter { | 248 | struct sg_mapping_iter { |
| 247 | /* the following three fields can be accessed directly */ | 249 | /* the following three fields can be accessed directly */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 3ab08e4bb6b8..f3d74bd04d18 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | #define SCHED_BATCH 3 | 38 | #define SCHED_BATCH 3 |
| 39 | /* SCHED_ISO: reserved but not implemented yet */ | 39 | /* SCHED_ISO: reserved but not implemented yet */ |
| 40 | #define SCHED_IDLE 5 | 40 | #define SCHED_IDLE 5 |
| 41 | /* Can be ORed in to make sure the process is reverted back to SCHED_NORMAL on fork */ | ||
| 42 | #define SCHED_RESET_ON_FORK 0x40000000 | ||
| 41 | 43 | ||
| 42 | #ifdef __KERNEL__ | 44 | #ifdef __KERNEL__ |
| 43 | 45 | ||
| @@ -796,18 +798,19 @@ enum cpu_idle_type { | |||
| 796 | #define SCHED_LOAD_SCALE_FUZZ SCHED_LOAD_SCALE | 798 | #define SCHED_LOAD_SCALE_FUZZ SCHED_LOAD_SCALE |
| 797 | 799 | ||
| 798 | #ifdef CONFIG_SMP | 800 | #ifdef CONFIG_SMP |
| 799 | #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ | 801 | #define SD_LOAD_BALANCE 0x0001 /* Do load balancing on this domain. */ |
| 800 | #define SD_BALANCE_NEWIDLE 2 /* Balance when about to become idle */ | 802 | #define SD_BALANCE_NEWIDLE 0x0002 /* Balance when about to become idle */ |
| 801 | #define SD_BALANCE_EXEC 4 /* Balance on exec */ | 803 | #define SD_BALANCE_EXEC 0x0004 /* Balance on exec */ |
| 802 | #define SD_BALANCE_FORK 8 /* Balance on fork, clone */ | 804 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
| 803 | #define SD_WAKE_IDLE 16 /* Wake to idle CPU on task wakeup */ | 805 | #define SD_WAKE_IDLE 0x0010 /* Wake to idle CPU on task wakeup */ |
| 804 | #define SD_WAKE_AFFINE 32 /* Wake task to waking CPU */ | 806 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
| 805 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ | 807 | #define SD_WAKE_BALANCE 0x0040 /* Perform balancing at task wakeup */ |
| 806 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ | 808 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ |
| 807 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ | 809 | #define SD_POWERSAVINGS_BALANCE 0x0100 /* Balance for power savings */ |
| 808 | #define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ | 810 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
| 809 | #define SD_SERIALIZE 1024 /* Only a single load balancing instance */ | 811 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
| 810 | #define SD_WAKE_IDLE_FAR 2048 /* Gain latency sacrificing cache hit */ | 812 | #define SD_WAKE_IDLE_FAR 0x0800 /* Gain latency sacrificing cache hit */ |
| 813 | #define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ | ||
| 811 | 814 | ||
| 812 | enum powersavings_balance_level { | 815 | enum powersavings_balance_level { |
| 813 | POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ | 816 | POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ |
| @@ -827,7 +830,7 @@ static inline int sd_balance_for_mc_power(void) | |||
| 827 | if (sched_smt_power_savings) | 830 | if (sched_smt_power_savings) |
| 828 | return SD_POWERSAVINGS_BALANCE; | 831 | return SD_POWERSAVINGS_BALANCE; |
| 829 | 832 | ||
| 830 | return 0; | 833 | return SD_PREFER_SIBLING; |
| 831 | } | 834 | } |
| 832 | 835 | ||
| 833 | static inline int sd_balance_for_package_power(void) | 836 | static inline int sd_balance_for_package_power(void) |
| @@ -835,7 +838,7 @@ static inline int sd_balance_for_package_power(void) | |||
| 835 | if (sched_mc_power_savings | sched_smt_power_savings) | 838 | if (sched_mc_power_savings | sched_smt_power_savings) |
| 836 | return SD_POWERSAVINGS_BALANCE; | 839 | return SD_POWERSAVINGS_BALANCE; |
| 837 | 840 | ||
| 838 | return 0; | 841 | return SD_PREFER_SIBLING; |
| 839 | } | 842 | } |
| 840 | 843 | ||
| 841 | /* | 844 | /* |
| @@ -857,15 +860,9 @@ struct sched_group { | |||
| 857 | 860 | ||
| 858 | /* | 861 | /* |
| 859 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a | 862 | * CPU power of this group, SCHED_LOAD_SCALE being max power for a |
| 860 | * single CPU. This is read only (except for setup, hotplug CPU). | 863 | * single CPU. |
| 861 | * Note : Never change cpu_power without recompute its reciprocal | ||
| 862 | */ | 864 | */ |
| 863 | unsigned int __cpu_power; | 865 | unsigned int cpu_power; |
| 864 | /* | ||
| 865 | * reciprocal value of cpu_power to avoid expensive divides | ||
| 866 | * (see include/linux/reciprocal_div.h) | ||
| 867 | */ | ||
| 868 | u32 reciprocal_cpu_power; | ||
| 869 | 866 | ||
| 870 | /* | 867 | /* |
| 871 | * The CPUs this group covers. | 868 | * The CPUs this group covers. |
| @@ -918,6 +915,7 @@ struct sched_domain { | |||
| 918 | unsigned int newidle_idx; | 915 | unsigned int newidle_idx; |
| 919 | unsigned int wake_idx; | 916 | unsigned int wake_idx; |
| 920 | unsigned int forkexec_idx; | 917 | unsigned int forkexec_idx; |
| 918 | unsigned int smt_gain; | ||
| 921 | int flags; /* See SD_* */ | 919 | int flags; /* See SD_* */ |
| 922 | enum sched_domain_level level; | 920 | enum sched_domain_level level; |
| 923 | 921 | ||
| @@ -1045,7 +1043,6 @@ struct sched_class { | |||
| 1045 | struct rq *busiest, struct sched_domain *sd, | 1043 | struct rq *busiest, struct sched_domain *sd, |
| 1046 | enum cpu_idle_type idle); | 1044 | enum cpu_idle_type idle); |
| 1047 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1045 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
| 1048 | int (*needs_post_schedule) (struct rq *this_rq); | ||
| 1049 | void (*post_schedule) (struct rq *this_rq); | 1046 | void (*post_schedule) (struct rq *this_rq); |
| 1050 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); | 1047 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); |
| 1051 | 1048 | ||
| @@ -1110,6 +1107,8 @@ struct sched_entity { | |||
| 1110 | u64 wait_max; | 1107 | u64 wait_max; |
| 1111 | u64 wait_count; | 1108 | u64 wait_count; |
| 1112 | u64 wait_sum; | 1109 | u64 wait_sum; |
| 1110 | u64 iowait_count; | ||
| 1111 | u64 iowait_sum; | ||
| 1113 | 1112 | ||
| 1114 | u64 sleep_start; | 1113 | u64 sleep_start; |
| 1115 | u64 sleep_max; | 1114 | u64 sleep_max; |
| @@ -1163,6 +1162,8 @@ struct sched_rt_entity { | |||
| 1163 | #endif | 1162 | #endif |
| 1164 | }; | 1163 | }; |
| 1165 | 1164 | ||
| 1165 | struct rcu_node; | ||
| 1166 | |||
| 1166 | struct task_struct { | 1167 | struct task_struct { |
| 1167 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ | 1168 | volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ |
| 1168 | void *stack; | 1169 | void *stack; |
| @@ -1198,6 +1199,7 @@ struct task_struct { | |||
| 1198 | * a short time | 1199 | * a short time |
| 1199 | */ | 1200 | */ |
| 1200 | unsigned char fpu_counter; | 1201 | unsigned char fpu_counter; |
| 1202 | s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ | ||
| 1201 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1203 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
| 1202 | unsigned int btrace_seq; | 1204 | unsigned int btrace_seq; |
| 1203 | #endif | 1205 | #endif |
| @@ -1205,10 +1207,12 @@ struct task_struct { | |||
| 1205 | unsigned int policy; | 1207 | unsigned int policy; |
| 1206 | cpumask_t cpus_allowed; | 1208 | cpumask_t cpus_allowed; |
| 1207 | 1209 | ||
| 1208 | #ifdef CONFIG_PREEMPT_RCU | 1210 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| 1209 | int rcu_read_lock_nesting; | 1211 | int rcu_read_lock_nesting; |
| 1210 | int rcu_flipctr_idx; | 1212 | char rcu_read_unlock_special; |
| 1211 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | 1213 | struct rcu_node *rcu_blocked_node; |
| 1214 | struct list_head rcu_node_entry; | ||
| 1215 | #endif /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
| 1212 | 1216 | ||
| 1213 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) | 1217 | #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) |
| 1214 | struct sched_info sched_info; | 1218 | struct sched_info sched_info; |
| @@ -1229,11 +1233,19 @@ struct task_struct { | |||
| 1229 | unsigned did_exec:1; | 1233 | unsigned did_exec:1; |
| 1230 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an | 1234 | unsigned in_execve:1; /* Tell the LSMs that the process is doing an |
| 1231 | * execve */ | 1235 | * execve */ |
| 1236 | unsigned in_iowait:1; | ||
| 1237 | |||
| 1238 | |||
| 1239 | /* Revert to default priority/policy when forking */ | ||
| 1240 | unsigned sched_reset_on_fork:1; | ||
| 1241 | |||
| 1232 | pid_t pid; | 1242 | pid_t pid; |
| 1233 | pid_t tgid; | 1243 | pid_t tgid; |
| 1234 | 1244 | ||
| 1245 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
| 1235 | /* Canary value for the -fstack-protector gcc feature */ | 1246 | /* Canary value for the -fstack-protector gcc feature */ |
| 1236 | unsigned long stack_canary; | 1247 | unsigned long stack_canary; |
| 1248 | #endif | ||
| 1237 | 1249 | ||
| 1238 | /* | 1250 | /* |
| 1239 | * pointers to (original) parent process, youngest child, younger sibling, | 1251 | * pointers to (original) parent process, youngest child, younger sibling, |
| @@ -1291,6 +1303,7 @@ struct task_struct { | |||
| 1291 | struct mutex cred_guard_mutex; /* guard against foreign influences on | 1303 | struct mutex cred_guard_mutex; /* guard against foreign influences on |
| 1292 | * credential calculations | 1304 | * credential calculations |
| 1293 | * (notably. ptrace) */ | 1305 | * (notably. ptrace) */ |
| 1306 | struct cred *replacement_session_keyring; /* for KEYCTL_SESSION_TO_PARENT */ | ||
| 1294 | 1307 | ||
| 1295 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1308 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
| 1296 | - access with [gs]et_task_comm (which lock | 1309 | - access with [gs]et_task_comm (which lock |
| @@ -1723,6 +1736,28 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
| 1723 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) | 1736 | #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) |
| 1724 | #define used_math() tsk_used_math(current) | 1737 | #define used_math() tsk_used_math(current) |
| 1725 | 1738 | ||
| 1739 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
| 1740 | |||
| 1741 | #define RCU_READ_UNLOCK_BLOCKED (1 << 0) /* blocked while in RCU read-side. */ | ||
| 1742 | #define RCU_READ_UNLOCK_NEED_QS (1 << 1) /* RCU core needs CPU response. */ | ||
| 1743 | #define RCU_READ_UNLOCK_GOT_QS (1 << 2) /* CPU has responded to RCU core. */ | ||
| 1744 | |||
| 1745 | static inline void rcu_copy_process(struct task_struct *p) | ||
| 1746 | { | ||
| 1747 | p->rcu_read_lock_nesting = 0; | ||
| 1748 | p->rcu_read_unlock_special = 0; | ||
| 1749 | p->rcu_blocked_node = NULL; | ||
| 1750 | INIT_LIST_HEAD(&p->rcu_node_entry); | ||
| 1751 | } | ||
| 1752 | |||
| 1753 | #else | ||
| 1754 | |||
| 1755 | static inline void rcu_copy_process(struct task_struct *p) | ||
| 1756 | { | ||
| 1757 | } | ||
| 1758 | |||
| 1759 | #endif | ||
| 1760 | |||
| 1726 | #ifdef CONFIG_SMP | 1761 | #ifdef CONFIG_SMP |
| 1727 | extern int set_cpus_allowed_ptr(struct task_struct *p, | 1762 | extern int set_cpus_allowed_ptr(struct task_struct *p, |
| 1728 | const struct cpumask *new_mask); | 1763 | const struct cpumask *new_mask); |
| @@ -1812,11 +1847,12 @@ extern unsigned int sysctl_sched_min_granularity; | |||
| 1812 | extern unsigned int sysctl_sched_wakeup_granularity; | 1847 | extern unsigned int sysctl_sched_wakeup_granularity; |
| 1813 | extern unsigned int sysctl_sched_shares_ratelimit; | 1848 | extern unsigned int sysctl_sched_shares_ratelimit; |
| 1814 | extern unsigned int sysctl_sched_shares_thresh; | 1849 | extern unsigned int sysctl_sched_shares_thresh; |
| 1815 | #ifdef CONFIG_SCHED_DEBUG | ||
| 1816 | extern unsigned int sysctl_sched_child_runs_first; | 1850 | extern unsigned int sysctl_sched_child_runs_first; |
| 1851 | #ifdef CONFIG_SCHED_DEBUG | ||
| 1817 | extern unsigned int sysctl_sched_features; | 1852 | extern unsigned int sysctl_sched_features; |
| 1818 | extern unsigned int sysctl_sched_migration_cost; | 1853 | extern unsigned int sysctl_sched_migration_cost; |
| 1819 | extern unsigned int sysctl_sched_nr_migrate; | 1854 | extern unsigned int sysctl_sched_nr_migrate; |
| 1855 | extern unsigned int sysctl_sched_time_avg; | ||
| 1820 | extern unsigned int sysctl_timer_migration; | 1856 | extern unsigned int sysctl_timer_migration; |
| 1821 | 1857 | ||
| 1822 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1858 | int sched_nr_latency_handler(struct ctl_table *table, int write, |
| @@ -2076,7 +2112,7 @@ static inline unsigned long wait_task_inactive(struct task_struct *p, | |||
| 2076 | #define for_each_process(p) \ | 2112 | #define for_each_process(p) \ |
| 2077 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) | 2113 | for (p = &init_task ; (p = next_task(p)) != &init_task ; ) |
| 2078 | 2114 | ||
| 2079 | extern bool is_single_threaded(struct task_struct *); | 2115 | extern bool current_is_single_threaded(void); |
| 2080 | 2116 | ||
| 2081 | /* | 2117 | /* |
| 2082 | * Careful: do_each_thread/while_each_thread is a double loop so | 2118 | * Careful: do_each_thread/while_each_thread is a double loop so |
| @@ -2280,23 +2316,31 @@ static inline int need_resched(void) | |||
| 2280 | * cond_resched_softirq() will enable bhs before scheduling. | 2316 | * cond_resched_softirq() will enable bhs before scheduling. |
| 2281 | */ | 2317 | */ |
| 2282 | extern int _cond_resched(void); | 2318 | extern int _cond_resched(void); |
| 2283 | #ifdef CONFIG_PREEMPT_BKL | 2319 | |
| 2284 | static inline int cond_resched(void) | 2320 | #define cond_resched() ({ \ |
| 2285 | { | 2321 | __might_sleep(__FILE__, __LINE__, 0); \ |
| 2286 | return 0; | 2322 | _cond_resched(); \ |
| 2287 | } | 2323 | }) |
| 2324 | |||
| 2325 | extern int __cond_resched_lock(spinlock_t *lock); | ||
| 2326 | |||
| 2327 | #ifdef CONFIG_PREEMPT | ||
| 2328 | #define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET | ||
| 2288 | #else | 2329 | #else |
| 2289 | static inline int cond_resched(void) | 2330 | #define PREEMPT_LOCK_OFFSET 0 |
| 2290 | { | ||
| 2291 | return _cond_resched(); | ||
| 2292 | } | ||
| 2293 | #endif | 2331 | #endif |
| 2294 | extern int cond_resched_lock(spinlock_t * lock); | 2332 | |
| 2295 | extern int cond_resched_softirq(void); | 2333 | #define cond_resched_lock(lock) ({ \ |
| 2296 | static inline int cond_resched_bkl(void) | 2334 | __might_sleep(__FILE__, __LINE__, PREEMPT_LOCK_OFFSET); \ |
| 2297 | { | 2335 | __cond_resched_lock(lock); \ |
| 2298 | return _cond_resched(); | 2336 | }) |
| 2299 | } | 2337 | |
| 2338 | extern int __cond_resched_softirq(void); | ||
| 2339 | |||
| 2340 | #define cond_resched_softirq() ({ \ | ||
| 2341 | __might_sleep(__FILE__, __LINE__, SOFTIRQ_OFFSET); \ | ||
| 2342 | __cond_resched_softirq(); \ | ||
| 2343 | }) | ||
| 2300 | 2344 | ||
| 2301 | /* | 2345 | /* |
| 2302 | * Does a critical section need to be broken due to another | 2346 | * Does a critical section need to be broken due to another |
diff --git a/include/linux/security.h b/include/linux/security.h index 5eff459b3833..d050b66ab9ef 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/resource.h> | 28 | #include <linux/resource.h> |
| 29 | #include <linux/sem.h> | 29 | #include <linux/sem.h> |
| 30 | #include <linux/shm.h> | 30 | #include <linux/shm.h> |
| 31 | #include <linux/mm.h> /* PAGE_ALIGN */ | ||
| 31 | #include <linux/msg.h> | 32 | #include <linux/msg.h> |
| 32 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
| 33 | #include <linux/key.h> | 34 | #include <linux/key.h> |
| @@ -52,7 +53,7 @@ struct audit_krule; | |||
| 52 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, | 53 | extern int cap_capable(struct task_struct *tsk, const struct cred *cred, |
| 53 | int cap, int audit); | 54 | int cap, int audit); |
| 54 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 55 | extern int cap_settime(struct timespec *ts, struct timezone *tz); |
| 55 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); | 56 | extern int cap_ptrace_access_check(struct task_struct *child, unsigned int mode); |
| 56 | extern int cap_ptrace_traceme(struct task_struct *parent); | 57 | extern int cap_ptrace_traceme(struct task_struct *parent); |
| 57 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 58 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
| 58 | extern int cap_capset(struct cred *new, const struct cred *old, | 59 | extern int cap_capset(struct cred *new, const struct cred *old, |
| @@ -66,6 +67,9 @@ extern int cap_inode_setxattr(struct dentry *dentry, const char *name, | |||
| 66 | extern int cap_inode_removexattr(struct dentry *dentry, const char *name); | 67 | extern int cap_inode_removexattr(struct dentry *dentry, const char *name); |
| 67 | extern int cap_inode_need_killpriv(struct dentry *dentry); | 68 | extern int cap_inode_need_killpriv(struct dentry *dentry); |
| 68 | extern int cap_inode_killpriv(struct dentry *dentry); | 69 | extern int cap_inode_killpriv(struct dentry *dentry); |
| 70 | extern int cap_file_mmap(struct file *file, unsigned long reqprot, | ||
| 71 | unsigned long prot, unsigned long flags, | ||
| 72 | unsigned long addr, unsigned long addr_only); | ||
| 69 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); | 73 | extern int cap_task_fix_setuid(struct cred *new, const struct cred *old, int flags); |
| 70 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, | 74 | extern int cap_task_prctl(int option, unsigned long arg2, unsigned long arg3, |
| 71 | unsigned long arg4, unsigned long arg5); | 75 | unsigned long arg4, unsigned long arg5); |
| @@ -92,6 +96,7 @@ extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); | |||
| 92 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); | 96 | extern int cap_netlink_recv(struct sk_buff *skb, int cap); |
| 93 | 97 | ||
| 94 | extern unsigned long mmap_min_addr; | 98 | extern unsigned long mmap_min_addr; |
| 99 | extern unsigned long dac_mmap_min_addr; | ||
| 95 | /* | 100 | /* |
| 96 | * Values used in the task_security_ops calls | 101 | * Values used in the task_security_ops calls |
| 97 | */ | 102 | */ |
| @@ -116,6 +121,21 @@ struct request_sock; | |||
| 116 | #define LSM_UNSAFE_PTRACE 2 | 121 | #define LSM_UNSAFE_PTRACE 2 |
| 117 | #define LSM_UNSAFE_PTRACE_CAP 4 | 122 | #define LSM_UNSAFE_PTRACE_CAP 4 |
| 118 | 123 | ||
| 124 | /* | ||
| 125 | * If a hint addr is less than mmap_min_addr change hint to be as | ||
| 126 | * low as possible but still greater than mmap_min_addr | ||
| 127 | */ | ||
| 128 | static inline unsigned long round_hint_to_min(unsigned long hint) | ||
| 129 | { | ||
| 130 | hint &= PAGE_MASK; | ||
| 131 | if (((void *)hint != NULL) && | ||
| 132 | (hint < mmap_min_addr)) | ||
| 133 | return PAGE_ALIGN(mmap_min_addr); | ||
| 134 | return hint; | ||
| 135 | } | ||
| 136 | extern int mmap_min_addr_handler(struct ctl_table *table, int write, struct file *filp, | ||
| 137 | void __user *buffer, size_t *lenp, loff_t *ppos); | ||
| 138 | |||
| 119 | #ifdef CONFIG_SECURITY | 139 | #ifdef CONFIG_SECURITY |
| 120 | 140 | ||
| 121 | struct security_mnt_opts { | 141 | struct security_mnt_opts { |
| @@ -633,6 +653,11 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 633 | * manual page for definitions of the @clone_flags. | 653 | * manual page for definitions of the @clone_flags. |
| 634 | * @clone_flags contains the flags indicating what should be shared. | 654 | * @clone_flags contains the flags indicating what should be shared. |
| 635 | * Return 0 if permission is granted. | 655 | * Return 0 if permission is granted. |
| 656 | * @cred_alloc_blank: | ||
| 657 | * @cred points to the credentials. | ||
| 658 | * @gfp indicates the atomicity of any memory allocations. | ||
| 659 | * Only allocate sufficient memory and attach to @cred such that | ||
| 660 | * cred_transfer() will not get ENOMEM. | ||
| 636 | * @cred_free: | 661 | * @cred_free: |
| 637 | * @cred points to the credentials. | 662 | * @cred points to the credentials. |
| 638 | * Deallocate and clear the cred->security field in a set of credentials. | 663 | * Deallocate and clear the cred->security field in a set of credentials. |
| @@ -645,6 +670,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 645 | * @new points to the new credentials. | 670 | * @new points to the new credentials. |
| 646 | * @old points to the original credentials. | 671 | * @old points to the original credentials. |
| 647 | * Install a new set of credentials. | 672 | * Install a new set of credentials. |
| 673 | * @cred_transfer: | ||
| 674 | * @new points to the new credentials. | ||
| 675 | * @old points to the original credentials. | ||
| 676 | * Transfer data from original creds to new creds | ||
| 648 | * @kernel_act_as: | 677 | * @kernel_act_as: |
| 649 | * Set the credentials for a kernel service to act as (subjective context). | 678 | * Set the credentials for a kernel service to act as (subjective context). |
| 650 | * @new points to the credentials to be modified. | 679 | * @new points to the credentials to be modified. |
| @@ -658,6 +687,10 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 658 | * @inode points to the inode to use as a reference. | 687 | * @inode points to the inode to use as a reference. |
| 659 | * The current task must be the one that nominated @inode. | 688 | * The current task must be the one that nominated @inode. |
| 660 | * Return 0 if successful. | 689 | * Return 0 if successful. |
| 690 | * @kernel_module_request: | ||
| 691 | * Ability to trigger the kernel to automatically upcall to userspace for | ||
| 692 | * userspace to load a kernel module with the given name. | ||
| 693 | * Return 0 if successful. | ||
| 661 | * @task_setuid: | 694 | * @task_setuid: |
| 662 | * Check permission before setting one or more of the user identity | 695 | * Check permission before setting one or more of the user identity |
| 663 | * attributes of the current process. The @flags parameter indicates | 696 | * attributes of the current process. The @flags parameter indicates |
| @@ -974,6 +1007,17 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 974 | * Sets the connection's peersid to the secmark on skb. | 1007 | * Sets the connection's peersid to the secmark on skb. |
| 975 | * @req_classify_flow: | 1008 | * @req_classify_flow: |
| 976 | * Sets the flow's sid to the openreq sid. | 1009 | * Sets the flow's sid to the openreq sid. |
| 1010 | * @tun_dev_create: | ||
| 1011 | * Check permissions prior to creating a new TUN device. | ||
| 1012 | * @tun_dev_post_create: | ||
| 1013 | * This hook allows a module to update or allocate a per-socket security | ||
| 1014 | * structure. | ||
| 1015 | * @sk contains the newly created sock structure. | ||
| 1016 | * @tun_dev_attach: | ||
| 1017 | * Check permissions prior to attaching to a persistent TUN device. This | ||
| 1018 | * hook can also be used by the module to update any security state | ||
| 1019 | * associated with the TUN device's sock structure. | ||
| 1020 | * @sk contains the existing sock structure. | ||
| 977 | * | 1021 | * |
| 978 | * Security hooks for XFRM operations. | 1022 | * Security hooks for XFRM operations. |
| 979 | * | 1023 | * |
| @@ -1068,6 +1112,13 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1068 | * Return the length of the string (including terminating NUL) or -ve if | 1112 | * Return the length of the string (including terminating NUL) or -ve if |
| 1069 | * an error. | 1113 | * an error. |
| 1070 | * May also return 0 (and a NULL buffer pointer) if there is no label. | 1114 | * May also return 0 (and a NULL buffer pointer) if there is no label. |
| 1115 | * @key_session_to_parent: | ||
| 1116 | * Forcibly assign the session keyring from a process to its parent | ||
| 1117 | * process. | ||
| 1118 | * @cred: Pointer to process's credentials | ||
| 1119 | * @parent_cred: Pointer to parent process's credentials | ||
| 1120 | * @keyring: Proposed new session keyring | ||
| 1121 | * Return 0 if permission is granted, -ve error otherwise. | ||
| 1071 | * | 1122 | * |
| 1072 | * Security hooks affecting all System V IPC operations. | 1123 | * Security hooks affecting all System V IPC operations. |
| 1073 | * | 1124 | * |
| @@ -1209,7 +1260,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1209 | * @alter contains the flag indicating whether changes are to be made. | 1260 | * @alter contains the flag indicating whether changes are to be made. |
| 1210 | * Return 0 if permission is granted. | 1261 | * Return 0 if permission is granted. |
| 1211 | * | 1262 | * |
| 1212 | * @ptrace_may_access: | 1263 | * @ptrace_access_check: |
| 1213 | * Check permission before allowing the current process to trace the | 1264 | * Check permission before allowing the current process to trace the |
| 1214 | * @child process. | 1265 | * @child process. |
| 1215 | * Security modules may also want to perform a process tracing check | 1266 | * Security modules may also want to perform a process tracing check |
| @@ -1224,7 +1275,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1224 | * Check that the @parent process has sufficient permission to trace the | 1275 | * Check that the @parent process has sufficient permission to trace the |
| 1225 | * current process before allowing the current process to present itself | 1276 | * current process before allowing the current process to present itself |
| 1226 | * to the @parent process for tracing. | 1277 | * to the @parent process for tracing. |
| 1227 | * The parent process will still have to undergo the ptrace_may_access | 1278 | * The parent process will still have to undergo the ptrace_access_check |
| 1228 | * checks before it is allowed to trace this one. | 1279 | * checks before it is allowed to trace this one. |
| 1229 | * @parent contains the task_struct structure for debugger process. | 1280 | * @parent contains the task_struct structure for debugger process. |
| 1230 | * Return 0 if permission is granted. | 1281 | * Return 0 if permission is granted. |
| @@ -1331,12 +1382,47 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
| 1331 | * audit_rule_init. | 1382 | * audit_rule_init. |
| 1332 | * @rule contains the allocated rule | 1383 | * @rule contains the allocated rule |
| 1333 | * | 1384 | * |
| 1385 | * @inode_notifysecctx: | ||
| 1386 | * Notify the security module of what the security context of an inode | ||
| 1387 | * should be. Initializes the incore security context managed by the | ||
| 1388 | * security module for this inode. Example usage: NFS client invokes | ||
| 1389 | * this hook to initialize the security context in its incore inode to the | ||
| 1390 | * value provided by the server for the file when the server returned the | ||
| 1391 | * file's attributes to the client. | ||
| 1392 | * | ||
| 1393 | * Must be called with inode->i_mutex locked. | ||
| 1394 | * | ||
| 1395 | * @inode we wish to set the security context of. | ||
| 1396 | * @ctx contains the string which we wish to set in the inode. | ||
| 1397 | * @ctxlen contains the length of @ctx. | ||
| 1398 | * | ||
| 1399 | * @inode_setsecctx: | ||
| 1400 | * Change the security context of an inode. Updates the | ||
| 1401 | * incore security context managed by the security module and invokes the | ||
| 1402 | * fs code as needed (via __vfs_setxattr_noperm) to update any backing | ||
| 1403 | * xattrs that represent the context. Example usage: NFS server invokes | ||
| 1404 | * this hook to change the security context in its incore inode and on the | ||
| 1405 | * backing filesystem to a value provided by the client on a SETATTR | ||
| 1406 | * operation. | ||
| 1407 | * | ||
| 1408 | * Must be called with inode->i_mutex locked. | ||
| 1409 | * | ||
| 1410 | * @dentry contains the inode we wish to set the security context of. | ||
| 1411 | * @ctx contains the string which we wish to set in the inode. | ||
| 1412 | * @ctxlen contains the length of @ctx. | ||
| 1413 | * | ||
| 1414 | * @inode_getsecctx: | ||
| 1415 | * Returns a string containing all relavent security context information | ||
| 1416 | * | ||
| 1417 | * @inode we wish to set the security context of. | ||
| 1418 | * @ctx is a pointer in which to place the allocated security context. | ||
| 1419 | * @ctxlen points to the place to put the length of @ctx. | ||
| 1334 | * This is the main security structure. | 1420 | * This is the main security structure. |
| 1335 | */ | 1421 | */ |
| 1336 | struct security_operations { | 1422 | struct security_operations { |
| 1337 | char name[SECURITY_NAME_MAX + 1]; | 1423 | char name[SECURITY_NAME_MAX + 1]; |
| 1338 | 1424 | ||
| 1339 | int (*ptrace_may_access) (struct task_struct *child, unsigned int mode); | 1425 | int (*ptrace_access_check) (struct task_struct *child, unsigned int mode); |
| 1340 | int (*ptrace_traceme) (struct task_struct *parent); | 1426 | int (*ptrace_traceme) (struct task_struct *parent); |
| 1341 | int (*capget) (struct task_struct *target, | 1427 | int (*capget) (struct task_struct *target, |
| 1342 | kernel_cap_t *effective, | 1428 | kernel_cap_t *effective, |
| @@ -1463,12 +1549,15 @@ struct security_operations { | |||
| 1463 | int (*dentry_open) (struct file *file, const struct cred *cred); | 1549 | int (*dentry_open) (struct file *file, const struct cred *cred); |
| 1464 | 1550 | ||
| 1465 | int (*task_create) (unsigned long clone_flags); | 1551 | int (*task_create) (unsigned long clone_flags); |
| 1552 | int (*cred_alloc_blank) (struct cred *cred, gfp_t gfp); | ||
| 1466 | void (*cred_free) (struct cred *cred); | 1553 | void (*cred_free) (struct cred *cred); |
| 1467 | int (*cred_prepare)(struct cred *new, const struct cred *old, | 1554 | int (*cred_prepare)(struct cred *new, const struct cred *old, |
| 1468 | gfp_t gfp); | 1555 | gfp_t gfp); |
| 1469 | void (*cred_commit)(struct cred *new, const struct cred *old); | 1556 | void (*cred_commit)(struct cred *new, const struct cred *old); |
| 1557 | void (*cred_transfer)(struct cred *new, const struct cred *old); | ||
| 1470 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1558 | int (*kernel_act_as)(struct cred *new, u32 secid); |
| 1471 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1559 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
| 1560 | int (*kernel_module_request)(void); | ||
| 1472 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | 1561 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); |
| 1473 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1562 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
| 1474 | int flags); | 1563 | int flags); |
| @@ -1536,6 +1625,10 @@ struct security_operations { | |||
| 1536 | int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); | 1625 | int (*secctx_to_secid) (const char *secdata, u32 seclen, u32 *secid); |
| 1537 | void (*release_secctx) (char *secdata, u32 seclen); | 1626 | void (*release_secctx) (char *secdata, u32 seclen); |
| 1538 | 1627 | ||
| 1628 | int (*inode_notifysecctx)(struct inode *inode, void *ctx, u32 ctxlen); | ||
| 1629 | int (*inode_setsecctx)(struct dentry *dentry, void *ctx, u32 ctxlen); | ||
| 1630 | int (*inode_getsecctx)(struct inode *inode, void **ctx, u32 *ctxlen); | ||
| 1631 | |||
| 1539 | #ifdef CONFIG_SECURITY_NETWORK | 1632 | #ifdef CONFIG_SECURITY_NETWORK |
| 1540 | int (*unix_stream_connect) (struct socket *sock, | 1633 | int (*unix_stream_connect) (struct socket *sock, |
| 1541 | struct socket *other, struct sock *newsk); | 1634 | struct socket *other, struct sock *newsk); |
| @@ -1572,6 +1665,9 @@ struct security_operations { | |||
| 1572 | void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); | 1665 | void (*inet_csk_clone) (struct sock *newsk, const struct request_sock *req); |
| 1573 | void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); | 1666 | void (*inet_conn_established) (struct sock *sk, struct sk_buff *skb); |
| 1574 | void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); | 1667 | void (*req_classify_flow) (const struct request_sock *req, struct flowi *fl); |
| 1668 | int (*tun_dev_create)(void); | ||
| 1669 | void (*tun_dev_post_create)(struct sock *sk); | ||
| 1670 | int (*tun_dev_attach)(struct sock *sk); | ||
| 1575 | #endif /* CONFIG_SECURITY_NETWORK */ | 1671 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 1576 | 1672 | ||
| 1577 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1673 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| @@ -1600,6 +1696,9 @@ struct security_operations { | |||
| 1600 | const struct cred *cred, | 1696 | const struct cred *cred, |
| 1601 | key_perm_t perm); | 1697 | key_perm_t perm); |
| 1602 | int (*key_getsecurity)(struct key *key, char **_buffer); | 1698 | int (*key_getsecurity)(struct key *key, char **_buffer); |
| 1699 | int (*key_session_to_parent)(const struct cred *cred, | ||
| 1700 | const struct cred *parent_cred, | ||
| 1701 | struct key *key); | ||
| 1603 | #endif /* CONFIG_KEYS */ | 1702 | #endif /* CONFIG_KEYS */ |
| 1604 | 1703 | ||
| 1605 | #ifdef CONFIG_AUDIT | 1704 | #ifdef CONFIG_AUDIT |
| @@ -1617,7 +1716,7 @@ extern int security_module_enable(struct security_operations *ops); | |||
| 1617 | extern int register_security(struct security_operations *ops); | 1716 | extern int register_security(struct security_operations *ops); |
| 1618 | 1717 | ||
| 1619 | /* Security operations */ | 1718 | /* Security operations */ |
| 1620 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); | 1719 | int security_ptrace_access_check(struct task_struct *child, unsigned int mode); |
| 1621 | int security_ptrace_traceme(struct task_struct *parent); | 1720 | int security_ptrace_traceme(struct task_struct *parent); |
| 1622 | int security_capget(struct task_struct *target, | 1721 | int security_capget(struct task_struct *target, |
| 1623 | kernel_cap_t *effective, | 1722 | kernel_cap_t *effective, |
| @@ -1716,11 +1815,14 @@ int security_file_send_sigiotask(struct task_struct *tsk, | |||
| 1716 | int security_file_receive(struct file *file); | 1815 | int security_file_receive(struct file *file); |
| 1717 | int security_dentry_open(struct file *file, const struct cred *cred); | 1816 | int security_dentry_open(struct file *file, const struct cred *cred); |
| 1718 | int security_task_create(unsigned long clone_flags); | 1817 | int security_task_create(unsigned long clone_flags); |
| 1818 | int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); | ||
| 1719 | void security_cred_free(struct cred *cred); | 1819 | void security_cred_free(struct cred *cred); |
| 1720 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); | 1820 | int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); |
| 1721 | void security_commit_creds(struct cred *new, const struct cred *old); | 1821 | void security_commit_creds(struct cred *new, const struct cred *old); |
| 1822 | void security_transfer_creds(struct cred *new, const struct cred *old); | ||
| 1722 | int security_kernel_act_as(struct cred *new, u32 secid); | 1823 | int security_kernel_act_as(struct cred *new, u32 secid); |
| 1723 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1824 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
| 1825 | int security_kernel_module_request(void); | ||
| 1724 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | 1826 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); |
| 1725 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1827 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
| 1726 | int flags); | 1828 | int flags); |
| @@ -1776,6 +1878,9 @@ int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen); | |||
| 1776 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); | 1878 | int security_secctx_to_secid(const char *secdata, u32 seclen, u32 *secid); |
| 1777 | void security_release_secctx(char *secdata, u32 seclen); | 1879 | void security_release_secctx(char *secdata, u32 seclen); |
| 1778 | 1880 | ||
| 1881 | int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen); | ||
| 1882 | int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen); | ||
| 1883 | int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen); | ||
| 1779 | #else /* CONFIG_SECURITY */ | 1884 | #else /* CONFIG_SECURITY */ |
| 1780 | struct security_mnt_opts { | 1885 | struct security_mnt_opts { |
| 1781 | }; | 1886 | }; |
| @@ -1798,10 +1903,10 @@ static inline int security_init(void) | |||
| 1798 | return 0; | 1903 | return 0; |
| 1799 | } | 1904 | } |
| 1800 | 1905 | ||
| 1801 | static inline int security_ptrace_may_access(struct task_struct *child, | 1906 | static inline int security_ptrace_access_check(struct task_struct *child, |
| 1802 | unsigned int mode) | 1907 | unsigned int mode) |
| 1803 | { | 1908 | { |
| 1804 | return cap_ptrace_may_access(child, mode); | 1909 | return cap_ptrace_access_check(child, mode); |
| 1805 | } | 1910 | } |
| 1806 | 1911 | ||
| 1807 | static inline int security_ptrace_traceme(struct task_struct *parent) | 1912 | static inline int security_ptrace_traceme(struct task_struct *parent) |
| @@ -2197,9 +2302,7 @@ static inline int security_file_mmap(struct file *file, unsigned long reqprot, | |||
| 2197 | unsigned long addr, | 2302 | unsigned long addr, |
| 2198 | unsigned long addr_only) | 2303 | unsigned long addr_only) |
| 2199 | { | 2304 | { |
| 2200 | if ((addr < mmap_min_addr) && !capable(CAP_SYS_RAWIO)) | 2305 | return cap_file_mmap(file, reqprot, prot, flags, addr, addr_only); |
| 2201 | return -EACCES; | ||
| 2202 | return 0; | ||
| 2203 | } | 2306 | } |
| 2204 | 2307 | ||
| 2205 | static inline int security_file_mprotect(struct vm_area_struct *vma, | 2308 | static inline int security_file_mprotect(struct vm_area_struct *vma, |
| @@ -2248,6 +2351,11 @@ static inline int security_task_create(unsigned long clone_flags) | |||
| 2248 | return 0; | 2351 | return 0; |
| 2249 | } | 2352 | } |
| 2250 | 2353 | ||
| 2354 | static inline int security_cred_alloc_blank(struct cred *cred, gfp_t gfp) | ||
| 2355 | { | ||
| 2356 | return 0; | ||
| 2357 | } | ||
| 2358 | |||
| 2251 | static inline void security_cred_free(struct cred *cred) | 2359 | static inline void security_cred_free(struct cred *cred) |
| 2252 | { } | 2360 | { } |
| 2253 | 2361 | ||
| @@ -2263,6 +2371,11 @@ static inline void security_commit_creds(struct cred *new, | |||
| 2263 | { | 2371 | { |
| 2264 | } | 2372 | } |
| 2265 | 2373 | ||
| 2374 | static inline void security_transfer_creds(struct cred *new, | ||
| 2375 | const struct cred *old) | ||
| 2376 | { | ||
| 2377 | } | ||
| 2378 | |||
| 2266 | static inline int security_kernel_act_as(struct cred *cred, u32 secid) | 2379 | static inline int security_kernel_act_as(struct cred *cred, u32 secid) |
| 2267 | { | 2380 | { |
| 2268 | return 0; | 2381 | return 0; |
| @@ -2274,6 +2387,11 @@ static inline int security_kernel_create_files_as(struct cred *cred, | |||
| 2274 | return 0; | 2387 | return 0; |
| 2275 | } | 2388 | } |
| 2276 | 2389 | ||
| 2390 | static inline int security_kernel_module_request(void) | ||
| 2391 | { | ||
| 2392 | return 0; | ||
| 2393 | } | ||
| 2394 | |||
| 2277 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, | 2395 | static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, |
| 2278 | int flags) | 2396 | int flags) |
| 2279 | { | 2397 | { |
| @@ -2519,6 +2637,19 @@ static inline int security_secctx_to_secid(const char *secdata, | |||
| 2519 | static inline void security_release_secctx(char *secdata, u32 seclen) | 2637 | static inline void security_release_secctx(char *secdata, u32 seclen) |
| 2520 | { | 2638 | { |
| 2521 | } | 2639 | } |
| 2640 | |||
| 2641 | static inline int security_inode_notifysecctx(struct inode *inode, void *ctx, u32 ctxlen) | ||
| 2642 | { | ||
| 2643 | return -EOPNOTSUPP; | ||
| 2644 | } | ||
| 2645 | static inline int security_inode_setsecctx(struct dentry *dentry, void *ctx, u32 ctxlen) | ||
| 2646 | { | ||
| 2647 | return -EOPNOTSUPP; | ||
| 2648 | } | ||
| 2649 | static inline int security_inode_getsecctx(struct inode *inode, void **ctx, u32 *ctxlen) | ||
| 2650 | { | ||
| 2651 | return -EOPNOTSUPP; | ||
| 2652 | } | ||
| 2522 | #endif /* CONFIG_SECURITY */ | 2653 | #endif /* CONFIG_SECURITY */ |
| 2523 | 2654 | ||
| 2524 | #ifdef CONFIG_SECURITY_NETWORK | 2655 | #ifdef CONFIG_SECURITY_NETWORK |
| @@ -2557,6 +2688,9 @@ void security_inet_csk_clone(struct sock *newsk, | |||
| 2557 | const struct request_sock *req); | 2688 | const struct request_sock *req); |
| 2558 | void security_inet_conn_established(struct sock *sk, | 2689 | void security_inet_conn_established(struct sock *sk, |
| 2559 | struct sk_buff *skb); | 2690 | struct sk_buff *skb); |
| 2691 | int security_tun_dev_create(void); | ||
| 2692 | void security_tun_dev_post_create(struct sock *sk); | ||
| 2693 | int security_tun_dev_attach(struct sock *sk); | ||
| 2560 | 2694 | ||
| 2561 | #else /* CONFIG_SECURITY_NETWORK */ | 2695 | #else /* CONFIG_SECURITY_NETWORK */ |
| 2562 | static inline int security_unix_stream_connect(struct socket *sock, | 2696 | static inline int security_unix_stream_connect(struct socket *sock, |
| @@ -2707,6 +2841,20 @@ static inline void security_inet_conn_established(struct sock *sk, | |||
| 2707 | struct sk_buff *skb) | 2841 | struct sk_buff *skb) |
| 2708 | { | 2842 | { |
| 2709 | } | 2843 | } |
| 2844 | |||
| 2845 | static inline int security_tun_dev_create(void) | ||
| 2846 | { | ||
| 2847 | return 0; | ||
| 2848 | } | ||
| 2849 | |||
| 2850 | static inline void security_tun_dev_post_create(struct sock *sk) | ||
| 2851 | { | ||
| 2852 | } | ||
| 2853 | |||
| 2854 | static inline int security_tun_dev_attach(struct sock *sk) | ||
| 2855 | { | ||
| 2856 | return 0; | ||
| 2857 | } | ||
| 2710 | #endif /* CONFIG_SECURITY_NETWORK */ | 2858 | #endif /* CONFIG_SECURITY_NETWORK */ |
| 2711 | 2859 | ||
| 2712 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 2860 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
| @@ -2863,6 +3011,9 @@ void security_key_free(struct key *key); | |||
| 2863 | int security_key_permission(key_ref_t key_ref, | 3011 | int security_key_permission(key_ref_t key_ref, |
| 2864 | const struct cred *cred, key_perm_t perm); | 3012 | const struct cred *cred, key_perm_t perm); |
| 2865 | int security_key_getsecurity(struct key *key, char **_buffer); | 3013 | int security_key_getsecurity(struct key *key, char **_buffer); |
| 3014 | int security_key_session_to_parent(const struct cred *cred, | ||
| 3015 | const struct cred *parent_cred, | ||
| 3016 | struct key *key); | ||
| 2866 | 3017 | ||
| 2867 | #else | 3018 | #else |
| 2868 | 3019 | ||
| @@ -2890,6 +3041,13 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer) | |||
| 2890 | return 0; | 3041 | return 0; |
| 2891 | } | 3042 | } |
| 2892 | 3043 | ||
| 3044 | static inline int security_key_session_to_parent(const struct cred *cred, | ||
| 3045 | const struct cred *parent_cred, | ||
| 3046 | struct key *key) | ||
| 3047 | { | ||
| 3048 | return 0; | ||
| 3049 | } | ||
| 3050 | |||
| 2893 | #endif | 3051 | #endif |
| 2894 | #endif /* CONFIG_KEYS */ | 3052 | #endif /* CONFIG_KEYS */ |
| 2895 | 3053 | ||
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index abff6c9b413c..6d3f2f449ead 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
| @@ -39,7 +39,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | #ifdef CONFIG_TMPFS_POSIX_ACL | 41 | #ifdef CONFIG_TMPFS_POSIX_ACL |
| 42 | int shmem_permission(struct inode *, int); | 42 | int shmem_check_acl(struct inode *, int); |
| 43 | int shmem_acl_init(struct inode *, struct inode *); | 43 | int shmem_acl_init(struct inode *, struct inode *); |
| 44 | 44 | ||
| 45 | extern struct xattr_handler shmem_xattr_acl_access_handler; | 45 | extern struct xattr_handler shmem_xattr_acl_access_handler; |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f2c69a2cca17..df7b23ac66e6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -304,7 +304,6 @@ typedef unsigned char *sk_buff_data_t; | |||
| 304 | * @tc_index: Traffic control index | 304 | * @tc_index: Traffic control index |
| 305 | * @tc_verd: traffic control verdict | 305 | * @tc_verd: traffic control verdict |
| 306 | * @ndisc_nodetype: router type (from link layer) | 306 | * @ndisc_nodetype: router type (from link layer) |
| 307 | * @do_not_encrypt: set to prevent encryption of this frame | ||
| 308 | * @dma_cookie: a cookie to one of several possible DMA operations | 307 | * @dma_cookie: a cookie to one of several possible DMA operations |
| 309 | * done by skb DMA functions | 308 | * done by skb DMA functions |
| 310 | * @secmark: security marking | 309 | * @secmark: security marking |
| @@ -380,12 +379,9 @@ struct sk_buff { | |||
| 380 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 379 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
| 381 | __u8 ndisc_nodetype:2; | 380 | __u8 ndisc_nodetype:2; |
| 382 | #endif | 381 | #endif |
| 383 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) | ||
| 384 | __u8 do_not_encrypt:1; | ||
| 385 | #endif | ||
| 386 | kmemcheck_bitfield_end(flags2); | 382 | kmemcheck_bitfield_end(flags2); |
| 387 | 383 | ||
| 388 | /* 0/13/14 bit hole */ | 384 | /* 0/14 bit hole */ |
| 389 | 385 | ||
| 390 | #ifdef CONFIG_NET_DMA | 386 | #ifdef CONFIG_NET_DMA |
| 391 | dma_cookie_t dma_cookie; | 387 | dma_cookie_t dma_cookie; |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index bb5368df4be8..0ec00b39d006 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
| @@ -34,9 +34,4 @@ static __always_inline void *__kmalloc(size_t size, gfp_t flags) | |||
| 34 | return kmalloc(size, flags); | 34 | return kmalloc(size, flags); |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | static inline void kmem_cache_init_late(void) | ||
| 38 | { | ||
| 39 | /* Nothing to do */ | ||
| 40 | } | ||
| 41 | |||
| 42 | #endif /* __LINUX_SLOB_DEF_H */ | 37 | #endif /* __LINUX_SLOB_DEF_H */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index c1c862b1d01a..5ad70a60fd74 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
| @@ -153,12 +153,10 @@ static __always_inline int kmalloc_index(size_t size) | |||
| 153 | if (size <= KMALLOC_MIN_SIZE) | 153 | if (size <= KMALLOC_MIN_SIZE) |
| 154 | return KMALLOC_SHIFT_LOW; | 154 | return KMALLOC_SHIFT_LOW; |
| 155 | 155 | ||
| 156 | #if KMALLOC_MIN_SIZE <= 64 | 156 | if (KMALLOC_MIN_SIZE <= 32 && size > 64 && size <= 96) |
| 157 | if (size > 64 && size <= 96) | ||
| 158 | return 1; | 157 | return 1; |
| 159 | if (size > 128 && size <= 192) | 158 | if (KMALLOC_MIN_SIZE <= 64 && size > 128 && size <= 192) |
| 160 | return 2; | 159 | return 2; |
| 161 | #endif | ||
| 162 | if (size <= 8) return 3; | 160 | if (size <= 8) return 3; |
| 163 | if (size <= 16) return 4; | 161 | if (size <= 16) return 4; |
| 164 | if (size <= 32) return 5; | 162 | if (size <= 32) return 5; |
| @@ -304,6 +302,4 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
| 304 | } | 302 | } |
| 305 | #endif | 303 | #endif |
| 306 | 304 | ||
| 307 | void __init kmem_cache_init_late(void); | ||
| 308 | |||
| 309 | #endif /* _LINUX_SLUB_DEF_H */ | 305 | #endif /* _LINUX_SLUB_DEF_H */ |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 4be57ab03478..f0ca7a7a1757 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -143,15 +143,6 @@ static inline void smp_mb__after_lock(void) { smp_mb(); } | |||
| 143 | */ | 143 | */ |
| 144 | #define spin_unlock_wait(lock) __raw_spin_unlock_wait(&(lock)->raw_lock) | 144 | #define spin_unlock_wait(lock) __raw_spin_unlock_wait(&(lock)->raw_lock) |
| 145 | 145 | ||
| 146 | /* | ||
| 147 | * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: | ||
| 148 | */ | ||
| 149 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
| 150 | # include <linux/spinlock_api_smp.h> | ||
| 151 | #else | ||
| 152 | # include <linux/spinlock_api_up.h> | ||
| 153 | #endif | ||
| 154 | |||
| 155 | #ifdef CONFIG_DEBUG_SPINLOCK | 146 | #ifdef CONFIG_DEBUG_SPINLOCK |
| 156 | extern void _raw_spin_lock(spinlock_t *lock); | 147 | extern void _raw_spin_lock(spinlock_t *lock); |
| 157 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) | 148 | #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock) |
| @@ -268,50 +259,16 @@ static inline void smp_mb__after_lock(void) { smp_mb(); } | |||
| 268 | 259 | ||
| 269 | #define spin_lock_irq(lock) _spin_lock_irq(lock) | 260 | #define spin_lock_irq(lock) _spin_lock_irq(lock) |
| 270 | #define spin_lock_bh(lock) _spin_lock_bh(lock) | 261 | #define spin_lock_bh(lock) _spin_lock_bh(lock) |
| 271 | |||
| 272 | #define read_lock_irq(lock) _read_lock_irq(lock) | 262 | #define read_lock_irq(lock) _read_lock_irq(lock) |
| 273 | #define read_lock_bh(lock) _read_lock_bh(lock) | 263 | #define read_lock_bh(lock) _read_lock_bh(lock) |
| 274 | |||
| 275 | #define write_lock_irq(lock) _write_lock_irq(lock) | 264 | #define write_lock_irq(lock) _write_lock_irq(lock) |
| 276 | #define write_lock_bh(lock) _write_lock_bh(lock) | 265 | #define write_lock_bh(lock) _write_lock_bh(lock) |
| 277 | 266 | #define spin_unlock(lock) _spin_unlock(lock) | |
| 278 | /* | 267 | #define read_unlock(lock) _read_unlock(lock) |
| 279 | * We inline the unlock functions in the nondebug case: | 268 | #define write_unlock(lock) _write_unlock(lock) |
| 280 | */ | 269 | #define spin_unlock_irq(lock) _spin_unlock_irq(lock) |
| 281 | #if defined(CONFIG_DEBUG_SPINLOCK) || defined(CONFIG_PREEMPT) || \ | 270 | #define read_unlock_irq(lock) _read_unlock_irq(lock) |
| 282 | !defined(CONFIG_SMP) | 271 | #define write_unlock_irq(lock) _write_unlock_irq(lock) |
| 283 | # define spin_unlock(lock) _spin_unlock(lock) | ||
| 284 | # define read_unlock(lock) _read_unlock(lock) | ||
| 285 | # define write_unlock(lock) _write_unlock(lock) | ||
| 286 | # define spin_unlock_irq(lock) _spin_unlock_irq(lock) | ||
| 287 | # define read_unlock_irq(lock) _read_unlock_irq(lock) | ||
| 288 | # define write_unlock_irq(lock) _write_unlock_irq(lock) | ||
| 289 | #else | ||
| 290 | # define spin_unlock(lock) \ | ||
| 291 | do {__raw_spin_unlock(&(lock)->raw_lock); __release(lock); } while (0) | ||
| 292 | # define read_unlock(lock) \ | ||
| 293 | do {__raw_read_unlock(&(lock)->raw_lock); __release(lock); } while (0) | ||
| 294 | # define write_unlock(lock) \ | ||
| 295 | do {__raw_write_unlock(&(lock)->raw_lock); __release(lock); } while (0) | ||
| 296 | # define spin_unlock_irq(lock) \ | ||
| 297 | do { \ | ||
| 298 | __raw_spin_unlock(&(lock)->raw_lock); \ | ||
| 299 | __release(lock); \ | ||
| 300 | local_irq_enable(); \ | ||
| 301 | } while (0) | ||
| 302 | # define read_unlock_irq(lock) \ | ||
| 303 | do { \ | ||
| 304 | __raw_read_unlock(&(lock)->raw_lock); \ | ||
| 305 | __release(lock); \ | ||
| 306 | local_irq_enable(); \ | ||
| 307 | } while (0) | ||
| 308 | # define write_unlock_irq(lock) \ | ||
| 309 | do { \ | ||
| 310 | __raw_write_unlock(&(lock)->raw_lock); \ | ||
| 311 | __release(lock); \ | ||
| 312 | local_irq_enable(); \ | ||
| 313 | } while (0) | ||
| 314 | #endif | ||
| 315 | 272 | ||
| 316 | #define spin_unlock_irqrestore(lock, flags) \ | 273 | #define spin_unlock_irqrestore(lock, flags) \ |
| 317 | do { \ | 274 | do { \ |
| @@ -380,4 +337,13 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); | |||
| 380 | */ | 337 | */ |
| 381 | #define spin_can_lock(lock) (!spin_is_locked(lock)) | 338 | #define spin_can_lock(lock) (!spin_is_locked(lock)) |
| 382 | 339 | ||
| 340 | /* | ||
| 341 | * Pull the _spin_*()/_read_*()/_write_*() functions/declarations: | ||
| 342 | */ | ||
| 343 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) | ||
| 344 | # include <linux/spinlock_api_smp.h> | ||
| 345 | #else | ||
| 346 | # include <linux/spinlock_api_up.h> | ||
| 347 | #endif | ||
| 348 | |||
| 383 | #endif /* __LINUX_SPINLOCK_H */ | 349 | #endif /* __LINUX_SPINLOCK_H */ |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index d79845d034b5..7a7e18fc2415 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
| @@ -60,4 +60,398 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
| 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
| 61 | __releases(lock); | 61 | __releases(lock); |
| 62 | 62 | ||
| 63 | /* | ||
| 64 | * We inline the unlock functions in the nondebug case: | ||
| 65 | */ | ||
| 66 | #if !defined(CONFIG_DEBUG_SPINLOCK) && !defined(CONFIG_PREEMPT) | ||
| 67 | #define __always_inline__spin_unlock | ||
| 68 | #define __always_inline__read_unlock | ||
| 69 | #define __always_inline__write_unlock | ||
| 70 | #define __always_inline__spin_unlock_irq | ||
| 71 | #define __always_inline__read_unlock_irq | ||
| 72 | #define __always_inline__write_unlock_irq | ||
| 73 | #endif | ||
| 74 | |||
| 75 | #ifndef CONFIG_DEBUG_SPINLOCK | ||
| 76 | #ifndef CONFIG_GENERIC_LOCKBREAK | ||
| 77 | |||
| 78 | #ifdef __always_inline__spin_lock | ||
| 79 | #define _spin_lock(lock) __spin_lock(lock) | ||
| 80 | #endif | ||
| 81 | |||
| 82 | #ifdef __always_inline__read_lock | ||
| 83 | #define _read_lock(lock) __read_lock(lock) | ||
| 84 | #endif | ||
| 85 | |||
| 86 | #ifdef __always_inline__write_lock | ||
| 87 | #define _write_lock(lock) __write_lock(lock) | ||
| 88 | #endif | ||
| 89 | |||
| 90 | #ifdef __always_inline__spin_lock_bh | ||
| 91 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) | ||
| 92 | #endif | ||
| 93 | |||
| 94 | #ifdef __always_inline__read_lock_bh | ||
| 95 | #define _read_lock_bh(lock) __read_lock_bh(lock) | ||
| 96 | #endif | ||
| 97 | |||
| 98 | #ifdef __always_inline__write_lock_bh | ||
| 99 | #define _write_lock_bh(lock) __write_lock_bh(lock) | ||
| 100 | #endif | ||
| 101 | |||
| 102 | #ifdef __always_inline__spin_lock_irq | ||
| 103 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) | ||
| 104 | #endif | ||
| 105 | |||
| 106 | #ifdef __always_inline__read_lock_irq | ||
| 107 | #define _read_lock_irq(lock) __read_lock_irq(lock) | ||
| 108 | #endif | ||
| 109 | |||
| 110 | #ifdef __always_inline__write_lock_irq | ||
| 111 | #define _write_lock_irq(lock) __write_lock_irq(lock) | ||
| 112 | #endif | ||
| 113 | |||
| 114 | #ifdef __always_inline__spin_lock_irqsave | ||
| 115 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) | ||
| 116 | #endif | ||
| 117 | |||
| 118 | #ifdef __always_inline__read_lock_irqsave | ||
| 119 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) | ||
| 120 | #endif | ||
| 121 | |||
| 122 | #ifdef __always_inline__write_lock_irqsave | ||
| 123 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) | ||
| 124 | #endif | ||
| 125 | |||
| 126 | #endif /* !CONFIG_GENERIC_LOCKBREAK */ | ||
| 127 | |||
| 128 | #ifdef __always_inline__spin_trylock | ||
| 129 | #define _spin_trylock(lock) __spin_trylock(lock) | ||
| 130 | #endif | ||
| 131 | |||
| 132 | #ifdef __always_inline__read_trylock | ||
| 133 | #define _read_trylock(lock) __read_trylock(lock) | ||
| 134 | #endif | ||
| 135 | |||
| 136 | #ifdef __always_inline__write_trylock | ||
| 137 | #define _write_trylock(lock) __write_trylock(lock) | ||
| 138 | #endif | ||
| 139 | |||
| 140 | #ifdef __always_inline__spin_trylock_bh | ||
| 141 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) | ||
| 142 | #endif | ||
| 143 | |||
| 144 | #ifdef __always_inline__spin_unlock | ||
| 145 | #define _spin_unlock(lock) __spin_unlock(lock) | ||
| 146 | #endif | ||
| 147 | |||
| 148 | #ifdef __always_inline__read_unlock | ||
| 149 | #define _read_unlock(lock) __read_unlock(lock) | ||
| 150 | #endif | ||
| 151 | |||
| 152 | #ifdef __always_inline__write_unlock | ||
| 153 | #define _write_unlock(lock) __write_unlock(lock) | ||
| 154 | #endif | ||
| 155 | |||
| 156 | #ifdef __always_inline__spin_unlock_bh | ||
| 157 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) | ||
| 158 | #endif | ||
| 159 | |||
| 160 | #ifdef __always_inline__read_unlock_bh | ||
| 161 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) | ||
| 162 | #endif | ||
| 163 | |||
| 164 | #ifdef __always_inline__write_unlock_bh | ||
| 165 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) | ||
| 166 | #endif | ||
| 167 | |||
| 168 | #ifdef __always_inline__spin_unlock_irq | ||
| 169 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) | ||
| 170 | #endif | ||
| 171 | |||
| 172 | #ifdef __always_inline__read_unlock_irq | ||
| 173 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) | ||
| 174 | #endif | ||
| 175 | |||
| 176 | #ifdef __always_inline__write_unlock_irq | ||
| 177 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) | ||
| 178 | #endif | ||
| 179 | |||
| 180 | #ifdef __always_inline__spin_unlock_irqrestore | ||
| 181 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) | ||
| 182 | #endif | ||
| 183 | |||
| 184 | #ifdef __always_inline__read_unlock_irqrestore | ||
| 185 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) | ||
| 186 | #endif | ||
| 187 | |||
| 188 | #ifdef __always_inline__write_unlock_irqrestore | ||
| 189 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) | ||
| 190 | #endif | ||
| 191 | |||
| 192 | #endif /* CONFIG_DEBUG_SPINLOCK */ | ||
| 193 | |||
| 194 | static inline int __spin_trylock(spinlock_t *lock) | ||
| 195 | { | ||
| 196 | preempt_disable(); | ||
| 197 | if (_raw_spin_trylock(lock)) { | ||
| 198 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 199 | return 1; | ||
| 200 | } | ||
| 201 | preempt_enable(); | ||
| 202 | return 0; | ||
| 203 | } | ||
| 204 | |||
| 205 | static inline int __read_trylock(rwlock_t *lock) | ||
| 206 | { | ||
| 207 | preempt_disable(); | ||
| 208 | if (_raw_read_trylock(lock)) { | ||
| 209 | rwlock_acquire_read(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 210 | return 1; | ||
| 211 | } | ||
| 212 | preempt_enable(); | ||
| 213 | return 0; | ||
| 214 | } | ||
| 215 | |||
| 216 | static inline int __write_trylock(rwlock_t *lock) | ||
| 217 | { | ||
| 218 | preempt_disable(); | ||
| 219 | if (_raw_write_trylock(lock)) { | ||
| 220 | rwlock_acquire(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 221 | return 1; | ||
| 222 | } | ||
| 223 | preempt_enable(); | ||
| 224 | return 0; | ||
| 225 | } | ||
| 226 | |||
| 227 | /* | ||
| 228 | * If lockdep is enabled then we use the non-preemption spin-ops | ||
| 229 | * even on CONFIG_PREEMPT, because lockdep assumes that interrupts are | ||
| 230 | * not re-enabled during lock-acquire (which the preempt-spin-ops do): | ||
| 231 | */ | ||
| 232 | #if !defined(CONFIG_GENERIC_LOCKBREAK) || defined(CONFIG_DEBUG_LOCK_ALLOC) | ||
| 233 | |||
| 234 | static inline void __read_lock(rwlock_t *lock) | ||
| 235 | { | ||
| 236 | preempt_disable(); | ||
| 237 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 238 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); | ||
| 239 | } | ||
| 240 | |||
| 241 | static inline unsigned long __spin_lock_irqsave(spinlock_t *lock) | ||
| 242 | { | ||
| 243 | unsigned long flags; | ||
| 244 | |||
| 245 | local_irq_save(flags); | ||
| 246 | preempt_disable(); | ||
| 247 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 248 | /* | ||
| 249 | * On lockdep we dont want the hand-coded irq-enable of | ||
| 250 | * _raw_spin_lock_flags() code, because lockdep assumes | ||
| 251 | * that interrupts are not re-enabled during lock-acquire: | ||
| 252 | */ | ||
| 253 | #ifdef CONFIG_LOCKDEP | ||
| 254 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | ||
| 255 | #else | ||
| 256 | _raw_spin_lock_flags(lock, &flags); | ||
| 257 | #endif | ||
| 258 | return flags; | ||
| 259 | } | ||
| 260 | |||
| 261 | static inline void __spin_lock_irq(spinlock_t *lock) | ||
| 262 | { | ||
| 263 | local_irq_disable(); | ||
| 264 | preempt_disable(); | ||
| 265 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 266 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | ||
| 267 | } | ||
| 268 | |||
| 269 | static inline void __spin_lock_bh(spinlock_t *lock) | ||
| 270 | { | ||
| 271 | local_bh_disable(); | ||
| 272 | preempt_disable(); | ||
| 273 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 274 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | ||
| 275 | } | ||
| 276 | |||
| 277 | static inline unsigned long __read_lock_irqsave(rwlock_t *lock) | ||
| 278 | { | ||
| 279 | unsigned long flags; | ||
| 280 | |||
| 281 | local_irq_save(flags); | ||
| 282 | preempt_disable(); | ||
| 283 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 284 | LOCK_CONTENDED_FLAGS(lock, _raw_read_trylock, _raw_read_lock, | ||
| 285 | _raw_read_lock_flags, &flags); | ||
| 286 | return flags; | ||
| 287 | } | ||
| 288 | |||
| 289 | static inline void __read_lock_irq(rwlock_t *lock) | ||
| 290 | { | ||
| 291 | local_irq_disable(); | ||
| 292 | preempt_disable(); | ||
| 293 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 294 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); | ||
| 295 | } | ||
| 296 | |||
| 297 | static inline void __read_lock_bh(rwlock_t *lock) | ||
| 298 | { | ||
| 299 | local_bh_disable(); | ||
| 300 | preempt_disable(); | ||
| 301 | rwlock_acquire_read(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 302 | LOCK_CONTENDED(lock, _raw_read_trylock, _raw_read_lock); | ||
| 303 | } | ||
| 304 | |||
| 305 | static inline unsigned long __write_lock_irqsave(rwlock_t *lock) | ||
| 306 | { | ||
| 307 | unsigned long flags; | ||
| 308 | |||
| 309 | local_irq_save(flags); | ||
| 310 | preempt_disable(); | ||
| 311 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 312 | LOCK_CONTENDED_FLAGS(lock, _raw_write_trylock, _raw_write_lock, | ||
| 313 | _raw_write_lock_flags, &flags); | ||
| 314 | return flags; | ||
| 315 | } | ||
| 316 | |||
| 317 | static inline void __write_lock_irq(rwlock_t *lock) | ||
| 318 | { | ||
| 319 | local_irq_disable(); | ||
| 320 | preempt_disable(); | ||
| 321 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 322 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); | ||
| 323 | } | ||
| 324 | |||
| 325 | static inline void __write_lock_bh(rwlock_t *lock) | ||
| 326 | { | ||
| 327 | local_bh_disable(); | ||
| 328 | preempt_disable(); | ||
| 329 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 330 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); | ||
| 331 | } | ||
| 332 | |||
| 333 | static inline void __spin_lock(spinlock_t *lock) | ||
| 334 | { | ||
| 335 | preempt_disable(); | ||
| 336 | spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 337 | LOCK_CONTENDED(lock, _raw_spin_trylock, _raw_spin_lock); | ||
| 338 | } | ||
| 339 | |||
| 340 | static inline void __write_lock(rwlock_t *lock) | ||
| 341 | { | ||
| 342 | preempt_disable(); | ||
| 343 | rwlock_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 344 | LOCK_CONTENDED(lock, _raw_write_trylock, _raw_write_lock); | ||
| 345 | } | ||
| 346 | |||
| 347 | #endif /* CONFIG_PREEMPT */ | ||
| 348 | |||
| 349 | static inline void __spin_unlock(spinlock_t *lock) | ||
| 350 | { | ||
| 351 | spin_release(&lock->dep_map, 1, _RET_IP_); | ||
| 352 | _raw_spin_unlock(lock); | ||
| 353 | preempt_enable(); | ||
| 354 | } | ||
| 355 | |||
| 356 | static inline void __write_unlock(rwlock_t *lock) | ||
| 357 | { | ||
| 358 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 359 | _raw_write_unlock(lock); | ||
| 360 | preempt_enable(); | ||
| 361 | } | ||
| 362 | |||
| 363 | static inline void __read_unlock(rwlock_t *lock) | ||
| 364 | { | ||
| 365 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 366 | _raw_read_unlock(lock); | ||
| 367 | preempt_enable(); | ||
| 368 | } | ||
| 369 | |||
| 370 | static inline void __spin_unlock_irqrestore(spinlock_t *lock, | ||
| 371 | unsigned long flags) | ||
| 372 | { | ||
| 373 | spin_release(&lock->dep_map, 1, _RET_IP_); | ||
| 374 | _raw_spin_unlock(lock); | ||
| 375 | local_irq_restore(flags); | ||
| 376 | preempt_enable(); | ||
| 377 | } | ||
| 378 | |||
| 379 | static inline void __spin_unlock_irq(spinlock_t *lock) | ||
| 380 | { | ||
| 381 | spin_release(&lock->dep_map, 1, _RET_IP_); | ||
| 382 | _raw_spin_unlock(lock); | ||
| 383 | local_irq_enable(); | ||
| 384 | preempt_enable(); | ||
| 385 | } | ||
| 386 | |||
| 387 | static inline void __spin_unlock_bh(spinlock_t *lock) | ||
| 388 | { | ||
| 389 | spin_release(&lock->dep_map, 1, _RET_IP_); | ||
| 390 | _raw_spin_unlock(lock); | ||
| 391 | preempt_enable_no_resched(); | ||
| 392 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 393 | } | ||
| 394 | |||
| 395 | static inline void __read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | ||
| 396 | { | ||
| 397 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 398 | _raw_read_unlock(lock); | ||
| 399 | local_irq_restore(flags); | ||
| 400 | preempt_enable(); | ||
| 401 | } | ||
| 402 | |||
| 403 | static inline void __read_unlock_irq(rwlock_t *lock) | ||
| 404 | { | ||
| 405 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 406 | _raw_read_unlock(lock); | ||
| 407 | local_irq_enable(); | ||
| 408 | preempt_enable(); | ||
| 409 | } | ||
| 410 | |||
| 411 | static inline void __read_unlock_bh(rwlock_t *lock) | ||
| 412 | { | ||
| 413 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 414 | _raw_read_unlock(lock); | ||
| 415 | preempt_enable_no_resched(); | ||
| 416 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 417 | } | ||
| 418 | |||
| 419 | static inline void __write_unlock_irqrestore(rwlock_t *lock, | ||
| 420 | unsigned long flags) | ||
| 421 | { | ||
| 422 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 423 | _raw_write_unlock(lock); | ||
| 424 | local_irq_restore(flags); | ||
| 425 | preempt_enable(); | ||
| 426 | } | ||
| 427 | |||
| 428 | static inline void __write_unlock_irq(rwlock_t *lock) | ||
| 429 | { | ||
| 430 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 431 | _raw_write_unlock(lock); | ||
| 432 | local_irq_enable(); | ||
| 433 | preempt_enable(); | ||
| 434 | } | ||
| 435 | |||
| 436 | static inline void __write_unlock_bh(rwlock_t *lock) | ||
| 437 | { | ||
| 438 | rwlock_release(&lock->dep_map, 1, _RET_IP_); | ||
| 439 | _raw_write_unlock(lock); | ||
| 440 | preempt_enable_no_resched(); | ||
| 441 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 442 | } | ||
| 443 | |||
| 444 | static inline int __spin_trylock_bh(spinlock_t *lock) | ||
| 445 | { | ||
| 446 | local_bh_disable(); | ||
| 447 | preempt_disable(); | ||
| 448 | if (_raw_spin_trylock(lock)) { | ||
| 449 | spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); | ||
| 450 | return 1; | ||
| 451 | } | ||
| 452 | preempt_enable_no_resched(); | ||
| 453 | local_bh_enable_ip((unsigned long)__builtin_return_address(0)); | ||
| 454 | return 0; | ||
| 455 | } | ||
| 456 | |||
| 63 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ | 457 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 5ae8fa22d331..3d0a9ff24f01 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -27,24 +27,54 @@ struct ssb_sprom { | |||
| 27 | u8 et1mdcport; /* MDIO for enet1 */ | 27 | u8 et1mdcport; /* MDIO for enet1 */ |
| 28 | u8 board_rev; /* Board revision number from SPROM. */ | 28 | u8 board_rev; /* Board revision number from SPROM. */ |
| 29 | u8 country_code; /* Country Code */ | 29 | u8 country_code; /* Country Code */ |
| 30 | u8 ant_available_a; /* A-PHY antenna available bits (up to 4) */ | 30 | u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ |
| 31 | u8 ant_available_bg; /* B/G-PHY antenna available bits (up to 4) */ | 31 | u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ |
| 32 | u16 pa0b0; | 32 | u16 pa0b0; |
| 33 | u16 pa0b1; | 33 | u16 pa0b1; |
| 34 | u16 pa0b2; | 34 | u16 pa0b2; |
| 35 | u16 pa1b0; | 35 | u16 pa1b0; |
| 36 | u16 pa1b1; | 36 | u16 pa1b1; |
| 37 | u16 pa1b2; | 37 | u16 pa1b2; |
| 38 | u16 pa1lob0; | ||
| 39 | u16 pa1lob1; | ||
| 40 | u16 pa1lob2; | ||
| 41 | u16 pa1hib0; | ||
| 42 | u16 pa1hib1; | ||
| 43 | u16 pa1hib2; | ||
| 38 | u8 gpio0; /* GPIO pin 0 */ | 44 | u8 gpio0; /* GPIO pin 0 */ |
| 39 | u8 gpio1; /* GPIO pin 1 */ | 45 | u8 gpio1; /* GPIO pin 1 */ |
| 40 | u8 gpio2; /* GPIO pin 2 */ | 46 | u8 gpio2; /* GPIO pin 2 */ |
| 41 | u8 gpio3; /* GPIO pin 3 */ | 47 | u8 gpio3; /* GPIO pin 3 */ |
| 42 | u16 maxpwr_a; /* A-PHY Amplifier Max Power (in dBm Q5.2) */ | 48 | u16 maxpwr_bg; /* 2.4GHz Amplifier Max Power (in dBm Q5.2) */ |
| 43 | u16 maxpwr_bg; /* B/G-PHY Amplifier Max Power (in dBm Q5.2) */ | 49 | u16 maxpwr_al; /* 5.2GHz Amplifier Max Power (in dBm Q5.2) */ |
| 50 | u16 maxpwr_a; /* 5.3GHz Amplifier Max Power (in dBm Q5.2) */ | ||
| 51 | u16 maxpwr_ah; /* 5.8GHz Amplifier Max Power (in dBm Q5.2) */ | ||
| 44 | u8 itssi_a; /* Idle TSSI Target for A-PHY */ | 52 | u8 itssi_a; /* Idle TSSI Target for A-PHY */ |
| 45 | u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ | 53 | u8 itssi_bg; /* Idle TSSI Target for B/G-PHY */ |
| 46 | u16 boardflags_lo; /* Boardflags (low 16 bits) */ | 54 | u8 tri2g; /* 2.4GHz TX isolation */ |
| 47 | u16 boardflags_hi; /* Boardflags (high 16 bits) */ | 55 | u8 tri5gl; /* 5.2GHz TX isolation */ |
| 56 | u8 tri5g; /* 5.3GHz TX isolation */ | ||
| 57 | u8 tri5gh; /* 5.8GHz TX isolation */ | ||
| 58 | u8 rxpo2g; /* 2GHz RX power offset */ | ||
| 59 | u8 rxpo5g; /* 5GHz RX power offset */ | ||
| 60 | u8 rssisav2g; /* 2GHz RSSI params */ | ||
| 61 | u8 rssismc2g; | ||
| 62 | u8 rssismf2g; | ||
| 63 | u8 bxa2g; /* 2GHz BX arch */ | ||
| 64 | u8 rssisav5g; /* 5GHz RSSI params */ | ||
| 65 | u8 rssismc5g; | ||
| 66 | u8 rssismf5g; | ||
| 67 | u8 bxa5g; /* 5GHz BX arch */ | ||
| 68 | u16 cck2gpo; /* CCK power offset */ | ||
| 69 | u32 ofdm2gpo; /* 2.4GHz OFDM power offset */ | ||
| 70 | u32 ofdm5glpo; /* 5.2GHz OFDM power offset */ | ||
| 71 | u32 ofdm5gpo; /* 5.3GHz OFDM power offset */ | ||
| 72 | u32 ofdm5ghpo; /* 5.8GHz OFDM power offset */ | ||
| 73 | u16 boardflags_lo; /* Board flags (bits 0-15) */ | ||
| 74 | u16 boardflags_hi; /* Board flags (bits 16-31) */ | ||
| 75 | u16 boardflags2_lo; /* Board flags (bits 32-47) */ | ||
| 76 | u16 boardflags2_hi; /* Board flags (bits 48-63) */ | ||
| 77 | /* TODO store board flags in a single u64 */ | ||
| 48 | 78 | ||
| 49 | /* Antenna gain values for up to 4 antennas | 79 | /* Antenna gain values for up to 4 antennas |
| 50 | * on each band. Values in dBm/4 (Q5.2). Negative gain means the | 80 | * on each band. Values in dBm/4 (Q5.2). Negative gain means the |
| @@ -58,7 +88,7 @@ struct ssb_sprom { | |||
| 58 | } ghz5; /* 5GHz band */ | 88 | } ghz5; /* 5GHz band */ |
| 59 | } antenna_gain; | 89 | } antenna_gain; |
| 60 | 90 | ||
| 61 | /* TODO - add any parameters needed from rev 2, 3, or 4 SPROMs */ | 91 | /* TODO - add any parameters needed from rev 2, 3, 4, 5 or 8 SPROMs */ |
| 62 | }; | 92 | }; |
| 63 | 93 | ||
| 64 | /* Information about the PCB the circuitry is soldered on. */ | 94 | /* Information about the PCB the circuitry is soldered on. */ |
| @@ -208,6 +238,7 @@ enum ssb_bustype { | |||
| 208 | SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */ | 238 | SSB_BUSTYPE_SSB, /* This SSB bus is the system bus */ |
| 209 | SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */ | 239 | SSB_BUSTYPE_PCI, /* SSB is connected to PCI bus */ |
| 210 | SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */ | 240 | SSB_BUSTYPE_PCMCIA, /* SSB is connected to PCMCIA bus */ |
| 241 | SSB_BUSTYPE_SDIO, /* SSB is connected to SDIO bus */ | ||
| 211 | }; | 242 | }; |
| 212 | 243 | ||
| 213 | /* board_vendor */ | 244 | /* board_vendor */ |
| @@ -240,8 +271,12 @@ struct ssb_bus { | |||
| 240 | 271 | ||
| 241 | /* The core in the basic address register window. (PCI bus only) */ | 272 | /* The core in the basic address register window. (PCI bus only) */ |
| 242 | struct ssb_device *mapped_device; | 273 | struct ssb_device *mapped_device; |
| 243 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ | 274 | union { |
| 244 | u8 mapped_pcmcia_seg; | 275 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ |
| 276 | u8 mapped_pcmcia_seg; | ||
| 277 | /* Current SSB base address window for SDIO. */ | ||
| 278 | u32 sdio_sbaddr; | ||
| 279 | }; | ||
| 245 | /* Lock for core and segment switching. | 280 | /* Lock for core and segment switching. |
| 246 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ | 281 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ |
| 247 | spinlock_t bar_lock; | 282 | spinlock_t bar_lock; |
| @@ -252,6 +287,11 @@ struct ssb_bus { | |||
| 252 | struct pci_dev *host_pci; | 287 | struct pci_dev *host_pci; |
| 253 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ | 288 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ |
| 254 | struct pcmcia_device *host_pcmcia; | 289 | struct pcmcia_device *host_pcmcia; |
| 290 | /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ | ||
| 291 | struct sdio_func *host_sdio; | ||
| 292 | |||
| 293 | /* See enum ssb_quirks */ | ||
| 294 | unsigned int quirks; | ||
| 255 | 295 | ||
| 256 | #ifdef CONFIG_SSB_SPROM | 296 | #ifdef CONFIG_SSB_SPROM |
| 257 | /* Mutex to protect the SPROM writing. */ | 297 | /* Mutex to protect the SPROM writing. */ |
| @@ -306,6 +346,11 @@ struct ssb_bus { | |||
| 306 | #endif /* DEBUG */ | 346 | #endif /* DEBUG */ |
| 307 | }; | 347 | }; |
| 308 | 348 | ||
| 349 | enum ssb_quirks { | ||
| 350 | /* SDIO connected card requires performing a read after writing a 32-bit value */ | ||
| 351 | SSB_QUIRK_SDIO_READ_AFTER_WRITE32 = (1 << 0), | ||
| 352 | }; | ||
| 353 | |||
| 309 | /* The initialization-invariants. */ | 354 | /* The initialization-invariants. */ |
| 310 | struct ssb_init_invariants { | 355 | struct ssb_init_invariants { |
| 311 | /* Versioning information about the PCB. */ | 356 | /* Versioning information about the PCB. */ |
| @@ -336,6 +381,12 @@ extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus, | |||
| 336 | struct pcmcia_device *pcmcia_dev, | 381 | struct pcmcia_device *pcmcia_dev, |
| 337 | unsigned long baseaddr); | 382 | unsigned long baseaddr); |
| 338 | #endif /* CONFIG_SSB_PCMCIAHOST */ | 383 | #endif /* CONFIG_SSB_PCMCIAHOST */ |
| 384 | #ifdef CONFIG_SSB_SDIOHOST | ||
| 385 | extern int ssb_bus_sdiobus_register(struct ssb_bus *bus, | ||
| 386 | struct sdio_func *sdio_func, | ||
| 387 | unsigned int quirks); | ||
| 388 | #endif /* CONFIG_SSB_SDIOHOST */ | ||
| 389 | |||
| 339 | 390 | ||
| 340 | extern void ssb_bus_unregister(struct ssb_bus *bus); | 391 | extern void ssb_bus_unregister(struct ssb_bus *bus); |
| 341 | 392 | ||
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index d3b1d18922f2..4e27acf0a92f 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
| @@ -629,5 +629,15 @@ extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | |||
| 629 | /* PMU support */ | 629 | /* PMU support */ |
| 630 | extern void ssb_pmu_init(struct ssb_chipcommon *cc); | 630 | extern void ssb_pmu_init(struct ssb_chipcommon *cc); |
| 631 | 631 | ||
| 632 | enum ssb_pmu_ldo_volt_id { | ||
| 633 | LDO_PAREF = 0, | ||
| 634 | LDO_VOLT1, | ||
| 635 | LDO_VOLT2, | ||
| 636 | LDO_VOLT3, | ||
| 637 | }; | ||
| 638 | |||
| 639 | void ssb_pmu_set_ldo_voltage(struct ssb_chipcommon *cc, | ||
| 640 | enum ssb_pmu_ldo_volt_id id, u32 voltage); | ||
| 641 | void ssb_pmu_set_ldo_paref(struct ssb_chipcommon *cc, bool on); | ||
| 632 | 642 | ||
| 633 | #endif /* LINUX_SSB_CHIPCO_H_ */ | 643 | #endif /* LINUX_SSB_CHIPCO_H_ */ |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index a01b982b5783..9ae9082eaeb4 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -162,7 +162,7 @@ | |||
| 162 | 162 | ||
| 163 | /* SPROM shadow area. If not otherwise noted, fields are | 163 | /* SPROM shadow area. If not otherwise noted, fields are |
| 164 | * two bytes wide. Note that the SPROM can _only_ be read | 164 | * two bytes wide. Note that the SPROM can _only_ be read |
| 165 | * in two-byte quantinies. | 165 | * in two-byte quantities. |
| 166 | */ | 166 | */ |
| 167 | #define SSB_SPROMSIZE_WORDS 64 | 167 | #define SSB_SPROMSIZE_WORDS 64 |
| 168 | #define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) | 168 | #define SSB_SPROMSIZE_BYTES (SSB_SPROMSIZE_WORDS * sizeof(u16)) |
| @@ -327,8 +327,11 @@ | |||
| 327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 | 327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 |
| 328 | 328 | ||
| 329 | /* SPROM Revision 8 */ | 329 | /* SPROM Revision 8 */ |
| 330 | #define SSB_SPROM8_BFLLO 0x1084 /* Boardflags (low 16 bits) */ | 330 | #define SSB_SPROM8_BOARDREV 0x1082 /* Board revision */ |
| 331 | #define SSB_SPROM8_BFLHI 0x1086 /* Boardflags Hi */ | 331 | #define SSB_SPROM8_BFLLO 0x1084 /* Board flags (bits 0-15) */ |
| 332 | #define SSB_SPROM8_BFLHI 0x1086 /* Board flags (bits 16-31) */ | ||
| 333 | #define SSB_SPROM8_BFL2LO 0x1088 /* Board flags (bits 32-47) */ | ||
| 334 | #define SSB_SPROM8_BFL2HI 0x108A /* Board flags (bits 48-63) */ | ||
| 332 | #define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */ | 335 | #define SSB_SPROM8_IL0MAC 0x108C /* 6 byte MAC address */ |
| 333 | #define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */ | 336 | #define SSB_SPROM8_CCODE 0x1092 /* 2 byte country code */ |
| 334 | #define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/ | 337 | #define SSB_SPROM8_ANTAVAIL 0x109C /* Antenna available bitfields*/ |
| @@ -354,14 +357,63 @@ | |||
| 354 | #define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ | 357 | #define SSB_SPROM8_GPIOB_P2 0x00FF /* Pin 2 */ |
| 355 | #define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ | 358 | #define SSB_SPROM8_GPIOB_P3 0xFF00 /* Pin 3 */ |
| 356 | #define SSB_SPROM8_GPIOB_P3_SHIFT 8 | 359 | #define SSB_SPROM8_GPIOB_P3_SHIFT 8 |
| 357 | #define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power BG in path 1 */ | 360 | #define SSB_SPROM8_RSSIPARM2G 0x10A4 /* RSSI params for 2GHz */ |
| 358 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power BG */ | 361 | #define SSB_SPROM8_RSSISMF2G 0x000F |
| 362 | #define SSB_SPROM8_RSSISMC2G 0x00F0 | ||
| 363 | #define SSB_SPROM8_RSSISMC2G_SHIFT 4 | ||
| 364 | #define SSB_SPROM8_RSSISAV2G 0x0700 | ||
| 365 | #define SSB_SPROM8_RSSISAV2G_SHIFT 8 | ||
| 366 | #define SSB_SPROM8_BXA2G 0x1800 | ||
| 367 | #define SSB_SPROM8_BXA2G_SHIFT 11 | ||
| 368 | #define SSB_SPROM8_RSSIPARM5G 0x10A6 /* RSSI params for 5GHz */ | ||
| 369 | #define SSB_SPROM8_RSSISMF5G 0x000F | ||
| 370 | #define SSB_SPROM8_RSSISMC5G 0x00F0 | ||
| 371 | #define SSB_SPROM8_RSSISMC5G_SHIFT 4 | ||
| 372 | #define SSB_SPROM8_RSSISAV5G 0x0700 | ||
| 373 | #define SSB_SPROM8_RSSISAV5G_SHIFT 8 | ||
| 374 | #define SSB_SPROM8_BXA5G 0x1800 | ||
| 375 | #define SSB_SPROM8_BXA5G_SHIFT 11 | ||
| 376 | #define SSB_SPROM8_TRI25G 0x10A8 /* TX isolation 2.4&5.3GHz */ | ||
| 377 | #define SSB_SPROM8_TRI2G 0x00FF /* TX isolation 2.4GHz */ | ||
| 378 | #define SSB_SPROM8_TRI5G 0xFF00 /* TX isolation 5.3GHz */ | ||
| 379 | #define SSB_SPROM8_TRI5G_SHIFT 8 | ||
| 380 | #define SSB_SPROM8_TRI5GHL 0x10AA /* TX isolation 5.2/5.8GHz */ | ||
| 381 | #define SSB_SPROM8_TRI5GL 0x00FF /* TX isolation 5.2GHz */ | ||
| 382 | #define SSB_SPROM8_TRI5GH 0xFF00 /* TX isolation 5.8GHz */ | ||
| 383 | #define SSB_SPROM8_TRI5GH_SHIFT 8 | ||
| 384 | #define SSB_SPROM8_RXPO 0x10AC /* RX power offsets */ | ||
| 385 | #define SSB_SPROM8_RXPO2G 0x00FF /* 2GHz RX power offset */ | ||
| 386 | #define SSB_SPROM8_RXPO5G 0xFF00 /* 5GHz RX power offset */ | ||
| 387 | #define SSB_SPROM8_RXPO5G_SHIFT 8 | ||
| 388 | #define SSB_SPROM8_MAXP_BG 0x10C0 /* Max Power 2GHz in path 1 */ | ||
| 389 | #define SSB_SPROM8_MAXP_BG_MASK 0x00FF /* Mask for Max Power 2GHz */ | ||
| 359 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ | 390 | #define SSB_SPROM8_ITSSI_BG 0xFF00 /* Mask for path 1 itssi_bg */ |
| 360 | #define SSB_SPROM8_ITSSI_BG_SHIFT 8 | 391 | #define SSB_SPROM8_ITSSI_BG_SHIFT 8 |
| 361 | #define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power A in path 1 */ | 392 | #define SSB_SPROM8_PA0B0 0x10C2 /* 2GHz power amp settings */ |
| 362 | #define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power A */ | 393 | #define SSB_SPROM8_PA0B1 0x10C4 |
| 394 | #define SSB_SPROM8_PA0B2 0x10C6 | ||
| 395 | #define SSB_SPROM8_MAXP_A 0x10C8 /* Max Power 5.3GHz */ | ||
| 396 | #define SSB_SPROM8_MAXP_A_MASK 0x00FF /* Mask for Max Power 5.3GHz */ | ||
| 363 | #define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ | 397 | #define SSB_SPROM8_ITSSI_A 0xFF00 /* Mask for path 1 itssi_a */ |
| 364 | #define SSB_SPROM8_ITSSI_A_SHIFT 8 | 398 | #define SSB_SPROM8_ITSSI_A_SHIFT 8 |
| 399 | #define SSB_SPROM8_MAXP_AHL 0x10CA /* Max Power 5.2/5.8GHz */ | ||
| 400 | #define SSB_SPROM8_MAXP_AH_MASK 0x00FF /* Mask for Max Power 5.8GHz */ | ||
| 401 | #define SSB_SPROM8_MAXP_AL_MASK 0xFF00 /* Mask for Max Power 5.2GHz */ | ||
| 402 | #define SSB_SPROM8_MAXP_AL_SHIFT 8 | ||
| 403 | #define SSB_SPROM8_PA1B0 0x10CC /* 5.3GHz power amp settings */ | ||
| 404 | #define SSB_SPROM8_PA1B1 0x10CE | ||
| 405 | #define SSB_SPROM8_PA1B2 0x10D0 | ||
| 406 | #define SSB_SPROM8_PA1LOB0 0x10D2 /* 5.2GHz power amp settings */ | ||
| 407 | #define SSB_SPROM8_PA1LOB1 0x10D4 | ||
| 408 | #define SSB_SPROM8_PA1LOB2 0x10D6 | ||
| 409 | #define SSB_SPROM8_PA1HIB0 0x10D8 /* 5.8GHz power amp settings */ | ||
| 410 | #define SSB_SPROM8_PA1HIB1 0x10DA | ||
| 411 | #define SSB_SPROM8_PA1HIB2 0x10DC | ||
| 412 | #define SSB_SPROM8_CCK2GPO 0x1140 /* CCK power offset */ | ||
| 413 | #define SSB_SPROM8_OFDM2GPO 0x1142 /* 2.4GHz OFDM power offset */ | ||
| 414 | #define SSB_SPROM8_OFDM5GPO 0x1146 /* 5.3GHz OFDM power offset */ | ||
| 415 | #define SSB_SPROM8_OFDM5GLPO 0x114A /* 5.2GHz OFDM power offset */ | ||
| 416 | #define SSB_SPROM8_OFDM5GHPO 0x114E /* 5.8GHz OFDM power offset */ | ||
| 365 | 417 | ||
| 366 | /* Values for SSB_SPROM1_BINF_CCODE */ | 418 | /* Values for SSB_SPROM1_BINF_CCODE */ |
| 367 | enum { | 419 | enum { |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 2d8b211b9324..6f52b4d7c447 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -59,6 +59,15 @@ struct cache_head { | |||
| 59 | 59 | ||
| 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ | 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ |
| 61 | 61 | ||
| 62 | struct cache_detail_procfs { | ||
| 63 | struct proc_dir_entry *proc_ent; | ||
| 64 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct cache_detail_pipefs { | ||
| 68 | struct dentry *dir; | ||
| 69 | }; | ||
| 70 | |||
| 62 | struct cache_detail { | 71 | struct cache_detail { |
| 63 | struct module * owner; | 72 | struct module * owner; |
| 64 | int hash_size; | 73 | int hash_size; |
| @@ -70,15 +79,17 @@ struct cache_detail { | |||
| 70 | char *name; | 79 | char *name; |
| 71 | void (*cache_put)(struct kref *); | 80 | void (*cache_put)(struct kref *); |
| 72 | 81 | ||
| 73 | void (*cache_request)(struct cache_detail *cd, | 82 | int (*cache_upcall)(struct cache_detail *, |
| 74 | struct cache_head *h, | 83 | struct cache_head *); |
| 75 | char **bpp, int *blen); | 84 | |
| 76 | int (*cache_parse)(struct cache_detail *, | 85 | int (*cache_parse)(struct cache_detail *, |
| 77 | char *buf, int len); | 86 | char *buf, int len); |
| 78 | 87 | ||
| 79 | int (*cache_show)(struct seq_file *m, | 88 | int (*cache_show)(struct seq_file *m, |
| 80 | struct cache_detail *cd, | 89 | struct cache_detail *cd, |
| 81 | struct cache_head *h); | 90 | struct cache_head *h); |
| 91 | void (*warn_no_listener)(struct cache_detail *cd, | ||
| 92 | int has_died); | ||
| 82 | 93 | ||
| 83 | struct cache_head * (*alloc)(void); | 94 | struct cache_head * (*alloc)(void); |
| 84 | int (*match)(struct cache_head *orig, struct cache_head *new); | 95 | int (*match)(struct cache_head *orig, struct cache_head *new); |
| @@ -96,13 +107,15 @@ struct cache_detail { | |||
| 96 | 107 | ||
| 97 | /* fields for communication over channel */ | 108 | /* fields for communication over channel */ |
| 98 | struct list_head queue; | 109 | struct list_head queue; |
| 99 | struct proc_dir_entry *proc_ent; | ||
| 100 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; | ||
| 101 | 110 | ||
| 102 | atomic_t readers; /* how many time is /chennel open */ | 111 | atomic_t readers; /* how many time is /chennel open */ |
| 103 | time_t last_close; /* if no readers, when did last close */ | 112 | time_t last_close; /* if no readers, when did last close */ |
| 104 | time_t last_warn; /* when we last warned about no readers */ | 113 | time_t last_warn; /* when we last warned about no readers */ |
| 105 | void (*warn_no_listener)(struct cache_detail *cd); | 114 | |
| 115 | union { | ||
| 116 | struct cache_detail_procfs procfs; | ||
| 117 | struct cache_detail_pipefs pipefs; | ||
| 118 | } u; | ||
| 106 | }; | 119 | }; |
| 107 | 120 | ||
| 108 | 121 | ||
| @@ -127,6 +140,10 @@ struct cache_deferred_req { | |||
| 127 | }; | 140 | }; |
| 128 | 141 | ||
| 129 | 142 | ||
| 143 | extern const struct file_operations cache_file_operations_pipefs; | ||
| 144 | extern const struct file_operations content_file_operations_pipefs; | ||
| 145 | extern const struct file_operations cache_flush_operations_pipefs; | ||
| 146 | |||
| 130 | extern struct cache_head * | 147 | extern struct cache_head * |
| 131 | sunrpc_cache_lookup(struct cache_detail *detail, | 148 | sunrpc_cache_lookup(struct cache_detail *detail, |
| 132 | struct cache_head *key, int hash); | 149 | struct cache_head *key, int hash); |
| @@ -134,6 +151,13 @@ extern struct cache_head * | |||
| 134 | sunrpc_cache_update(struct cache_detail *detail, | 151 | sunrpc_cache_update(struct cache_detail *detail, |
| 135 | struct cache_head *new, struct cache_head *old, int hash); | 152 | struct cache_head *new, struct cache_head *old, int hash); |
| 136 | 153 | ||
| 154 | extern int | ||
| 155 | sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h, | ||
| 156 | void (*cache_request)(struct cache_detail *, | ||
| 157 | struct cache_head *, | ||
| 158 | char **, | ||
| 159 | int *)); | ||
| 160 | |||
| 137 | 161 | ||
| 138 | extern void cache_clean_deferred(void *owner); | 162 | extern void cache_clean_deferred(void *owner); |
| 139 | 163 | ||
| @@ -171,6 +195,10 @@ extern void cache_purge(struct cache_detail *detail); | |||
| 171 | extern int cache_register(struct cache_detail *cd); | 195 | extern int cache_register(struct cache_detail *cd); |
| 172 | extern void cache_unregister(struct cache_detail *cd); | 196 | extern void cache_unregister(struct cache_detail *cd); |
| 173 | 197 | ||
| 198 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, | ||
| 199 | mode_t, struct cache_detail *); | ||
| 200 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); | ||
| 201 | |||
| 174 | extern void qword_add(char **bpp, int *lp, char *str); | 202 | extern void qword_add(char **bpp, int *lp, char *str); |
| 175 | extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); | 203 | extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); |
| 176 | extern int qword_get(char **bpp, char *dest, int bufsize); | 204 | extern int qword_get(char **bpp, char *dest, int bufsize); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 37881f1a0bd7..ab3f6e90caa5 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -9,6 +9,10 @@ | |||
| 9 | #ifndef _LINUX_SUNRPC_CLNT_H | 9 | #ifndef _LINUX_SUNRPC_CLNT_H |
| 10 | #define _LINUX_SUNRPC_CLNT_H | 10 | #define _LINUX_SUNRPC_CLNT_H |
| 11 | 11 | ||
| 12 | #include <linux/socket.h> | ||
| 13 | #include <linux/in.h> | ||
| 14 | #include <linux/in6.h> | ||
| 15 | |||
| 12 | #include <linux/sunrpc/msg_prot.h> | 16 | #include <linux/sunrpc/msg_prot.h> |
| 13 | #include <linux/sunrpc/sched.h> | 17 | #include <linux/sunrpc/sched.h> |
| 14 | #include <linux/sunrpc/xprt.h> | 18 | #include <linux/sunrpc/xprt.h> |
| @@ -17,6 +21,7 @@ | |||
| 17 | #include <linux/sunrpc/xdr.h> | 21 | #include <linux/sunrpc/xdr.h> |
| 18 | #include <linux/sunrpc/timer.h> | 22 | #include <linux/sunrpc/timer.h> |
| 19 | #include <asm/signal.h> | 23 | #include <asm/signal.h> |
| 24 | #include <linux/path.h> | ||
| 20 | 25 | ||
| 21 | struct rpc_inode; | 26 | struct rpc_inode; |
| 22 | 27 | ||
| @@ -50,9 +55,7 @@ struct rpc_clnt { | |||
| 50 | 55 | ||
| 51 | int cl_nodelen; /* nodename length */ | 56 | int cl_nodelen; /* nodename length */ |
| 52 | char cl_nodename[UNX_MAXNODENAME]; | 57 | char cl_nodename[UNX_MAXNODENAME]; |
| 53 | char cl_pathname[30];/* Path in rpc_pipe_fs */ | 58 | struct path cl_path; |
| 54 | struct vfsmount * cl_vfsmnt; | ||
| 55 | struct dentry * cl_dentry; /* inode */ | ||
| 56 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 59 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 57 | struct rpc_rtt cl_rtt_default; | 60 | struct rpc_rtt cl_rtt_default; |
| 58 | struct rpc_timeout cl_timeout_default; | 61 | struct rpc_timeout cl_timeout_default; |
| @@ -151,5 +154,39 @@ void rpc_force_rebind(struct rpc_clnt *); | |||
| 151 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 154 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 152 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 155 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
| 153 | 156 | ||
| 157 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | ||
| 158 | size_t rpc_pton(const char *, const size_t, | ||
| 159 | struct sockaddr *, const size_t); | ||
| 160 | char * rpc_sockaddr2uaddr(const struct sockaddr *); | ||
| 161 | size_t rpc_uaddr2sockaddr(const char *, const size_t, | ||
| 162 | struct sockaddr *, const size_t); | ||
| 163 | |||
| 164 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | ||
| 165 | { | ||
| 166 | switch (sap->sa_family) { | ||
| 167 | case AF_INET: | ||
| 168 | return ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 169 | case AF_INET6: | ||
| 170 | return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); | ||
| 171 | } | ||
| 172 | return 0; | ||
| 173 | } | ||
| 174 | |||
| 175 | static inline void rpc_set_port(struct sockaddr *sap, | ||
| 176 | const unsigned short port) | ||
| 177 | { | ||
| 178 | switch (sap->sa_family) { | ||
| 179 | case AF_INET: | ||
| 180 | ((struct sockaddr_in *)sap)->sin_port = htons(port); | ||
| 181 | break; | ||
| 182 | case AF_INET6: | ||
| 183 | ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); | ||
| 184 | break; | ||
| 185 | } | ||
| 186 | } | ||
| 187 | |||
| 188 | #define IPV6_SCOPE_DELIMITER '%' | ||
| 189 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | ||
| 190 | |||
| 154 | #endif /* __KERNEL__ */ | 191 | #endif /* __KERNEL__ */ |
| 155 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 192 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 70df4f1d8847..77e624883393 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
| @@ -189,7 +189,22 @@ typedef __be32 rpc_fraghdr; | |||
| 189 | * Additionally, the two alternative forms specified in Section 2.2 of | 189 | * Additionally, the two alternative forms specified in Section 2.2 of |
| 190 | * [RFC2373] are also acceptable. | 190 | * [RFC2373] are also acceptable. |
| 191 | */ | 191 | */ |
| 192 | #define RPCBIND_MAXUADDRLEN (56u) | 192 | |
| 193 | #include <linux/inet.h> | ||
| 194 | |||
| 195 | /* Maximum size of the port number part of a universal address */ | ||
| 196 | #define RPCBIND_MAXUADDRPLEN sizeof(".255.255") | ||
| 197 | |||
| 198 | /* Maximum size of an IPv4 universal address */ | ||
| 199 | #define RPCBIND_MAXUADDR4LEN \ | ||
| 200 | (INET_ADDRSTRLEN + RPCBIND_MAXUADDRPLEN) | ||
| 201 | |||
| 202 | /* Maximum size of an IPv6 universal address */ | ||
| 203 | #define RPCBIND_MAXUADDR6LEN \ | ||
| 204 | (INET6_ADDRSTRLEN + RPCBIND_MAXUADDRPLEN) | ||
| 205 | |||
| 206 | /* Assume INET6_ADDRSTRLEN will always be larger than INET_ADDRSTRLEN... */ | ||
| 207 | #define RPCBIND_MAXUADDRLEN RPCBIND_MAXUADDR6LEN | ||
| 193 | 208 | ||
| 194 | #endif /* __KERNEL__ */ | 209 | #endif /* __KERNEL__ */ |
| 195 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 210 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index cea764c2359f..cf14db975da0 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
| 5 | 5 | ||
| 6 | #include <linux/workqueue.h> | ||
| 7 | |||
| 6 | struct rpc_pipe_msg { | 8 | struct rpc_pipe_msg { |
| 7 | struct list_head list; | 9 | struct list_head list; |
| 8 | void *data; | 10 | void *data; |
| @@ -32,8 +34,8 @@ struct rpc_inode { | |||
| 32 | wait_queue_head_t waitq; | 34 | wait_queue_head_t waitq; |
| 33 | #define RPC_PIPE_WAIT_FOR_OPEN 1 | 35 | #define RPC_PIPE_WAIT_FOR_OPEN 1 |
| 34 | int flags; | 36 | int flags; |
| 35 | struct rpc_pipe_ops *ops; | ||
| 36 | struct delayed_work queue_timeout; | 37 | struct delayed_work queue_timeout; |
| 38 | const struct rpc_pipe_ops *ops; | ||
| 37 | }; | 39 | }; |
| 38 | 40 | ||
| 39 | static inline struct rpc_inode * | 41 | static inline struct rpc_inode * |
| @@ -44,9 +46,19 @@ RPC_I(struct inode *inode) | |||
| 44 | 46 | ||
| 45 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | 47 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); |
| 46 | 48 | ||
| 47 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); | 49 | struct rpc_clnt; |
| 48 | extern int rpc_rmdir(struct dentry *); | 50 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); |
| 49 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags); | 51 | extern int rpc_remove_client_dir(struct dentry *); |
| 52 | |||
| 53 | struct cache_detail; | ||
| 54 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | ||
| 55 | struct qstr *, | ||
| 56 | mode_t umode, | ||
| 57 | struct cache_detail *); | ||
| 58 | extern void rpc_remove_cache_dir(struct dentry *); | ||
| 59 | |||
| 60 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, | ||
| 61 | const struct rpc_pipe_ops *, int flags); | ||
| 50 | extern int rpc_unlink(struct dentry *); | 62 | extern int rpc_unlink(struct dentry *); |
| 51 | extern struct vfsmount *rpc_get_mount(void); | 63 | extern struct vfsmount *rpc_get_mount(void); |
| 52 | extern void rpc_put_mount(void); | 64 | extern void rpc_put_mount(void); |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index b99c625fddfe..7da466ba4b0d 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -117,17 +117,15 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le | |||
| 117 | static inline __be32 * | 117 | static inline __be32 * |
| 118 | xdr_encode_hyper(__be32 *p, __u64 val) | 118 | xdr_encode_hyper(__be32 *p, __u64 val) |
| 119 | { | 119 | { |
| 120 | *p++ = htonl(val >> 32); | 120 | *(__be64 *)p = cpu_to_be64(val); |
| 121 | *p++ = htonl(val & 0xFFFFFFFF); | 121 | return p + 2; |
| 122 | return p; | ||
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | static inline __be32 * | 124 | static inline __be32 * |
| 126 | xdr_decode_hyper(__be32 *p, __u64 *valp) | 125 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
| 127 | { | 126 | { |
| 128 | *valp = ((__u64) ntohl(*p++)) << 32; | 127 | *valp = be64_to_cpup((__be64 *)p); |
| 129 | *valp |= ntohl(*p++); | 128 | return p + 2; |
| 130 | return p; | ||
| 131 | } | 129 | } |
| 132 | 130 | ||
| 133 | /* | 131 | /* |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 1175d58efc2e..c090df442572 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -38,10 +38,8 @@ enum rpc_display_format_t { | |||
| 38 | RPC_DISPLAY_ADDR = 0, | 38 | RPC_DISPLAY_ADDR = 0, |
| 39 | RPC_DISPLAY_PORT, | 39 | RPC_DISPLAY_PORT, |
| 40 | RPC_DISPLAY_PROTO, | 40 | RPC_DISPLAY_PROTO, |
| 41 | RPC_DISPLAY_ALL, | ||
| 42 | RPC_DISPLAY_HEX_ADDR, | 41 | RPC_DISPLAY_HEX_ADDR, |
| 43 | RPC_DISPLAY_HEX_PORT, | 42 | RPC_DISPLAY_HEX_PORT, |
| 44 | RPC_DISPLAY_UNIVERSAL_ADDR, | ||
| 45 | RPC_DISPLAY_NETID, | 43 | RPC_DISPLAY_NETID, |
| 46 | RPC_DISPLAY_MAX, | 44 | RPC_DISPLAY_MAX, |
| 47 | }; | 45 | }; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index cb1a6631b8f4..73b1f1cec423 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
| @@ -14,7 +14,6 @@ struct scatterlist; | |||
| 14 | */ | 14 | */ |
| 15 | #define IO_TLB_SEGSIZE 128 | 15 | #define IO_TLB_SEGSIZE 128 |
| 16 | 16 | ||
| 17 | |||
| 18 | /* | 17 | /* |
| 19 | * log of the size of each IO TLB slab. The number of slabs is command line | 18 | * log of the size of each IO TLB slab. The number of slabs is command line |
| 20 | * controllable. | 19 | * controllable. |
| @@ -24,16 +23,6 @@ struct scatterlist; | |||
| 24 | extern void | 23 | extern void |
| 25 | swiotlb_init(void); | 24 | swiotlb_init(void); |
| 26 | 25 | ||
| 27 | extern void *swiotlb_alloc_boot(size_t bytes, unsigned long nslabs); | ||
| 28 | extern void *swiotlb_alloc(unsigned order, unsigned long nslabs); | ||
| 29 | |||
| 30 | extern dma_addr_t swiotlb_phys_to_bus(struct device *hwdev, | ||
| 31 | phys_addr_t address); | ||
| 32 | extern phys_addr_t swiotlb_bus_to_phys(struct device *hwdev, | ||
| 33 | dma_addr_t address); | ||
| 34 | |||
| 35 | extern int swiotlb_arch_range_needs_mapping(phys_addr_t paddr, size_t size); | ||
| 36 | |||
| 37 | extern void | 26 | extern void |
| 38 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 27 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
| 39 | dma_addr_t *dma_handle, gfp_t flags); | 28 | dma_addr_t *dma_handle, gfp_t flags); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 80de7003d8c2..a8e37821cc60 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -64,6 +64,7 @@ struct perf_counter_attr; | |||
| 64 | #include <linux/sem.h> | 64 | #include <linux/sem.h> |
| 65 | #include <asm/siginfo.h> | 65 | #include <asm/siginfo.h> |
| 66 | #include <asm/signal.h> | 66 | #include <asm/signal.h> |
| 67 | #include <linux/unistd.h> | ||
| 67 | #include <linux/quota.h> | 68 | #include <linux/quota.h> |
| 68 | #include <linux/key.h> | 69 | #include <linux/key.h> |
| 69 | #include <trace/syscall.h> | 70 | #include <trace/syscall.h> |
| @@ -97,6 +98,53 @@ struct perf_counter_attr; | |||
| 97 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | 98 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) |
| 98 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 99 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
| 99 | 100 | ||
| 101 | #ifdef CONFIG_EVENT_PROFILE | ||
| 102 | #define TRACE_SYS_ENTER_PROFILE(sname) \ | ||
| 103 | static int prof_sysenter_enable_##sname(struct ftrace_event_call *event_call) \ | ||
| 104 | { \ | ||
| 105 | int ret = 0; \ | ||
| 106 | if (!atomic_inc_return(&event_enter_##sname.profile_count)) \ | ||
| 107 | ret = reg_prof_syscall_enter("sys"#sname); \ | ||
| 108 | return ret; \ | ||
| 109 | } \ | ||
| 110 | \ | ||
| 111 | static void prof_sysenter_disable_##sname(struct ftrace_event_call *event_call)\ | ||
| 112 | { \ | ||
| 113 | if (atomic_add_negative(-1, &event_enter_##sname.profile_count)) \ | ||
| 114 | unreg_prof_syscall_enter("sys"#sname); \ | ||
| 115 | } | ||
| 116 | |||
| 117 | #define TRACE_SYS_EXIT_PROFILE(sname) \ | ||
| 118 | static int prof_sysexit_enable_##sname(struct ftrace_event_call *event_call) \ | ||
| 119 | { \ | ||
| 120 | int ret = 0; \ | ||
| 121 | if (!atomic_inc_return(&event_exit_##sname.profile_count)) \ | ||
| 122 | ret = reg_prof_syscall_exit("sys"#sname); \ | ||
| 123 | return ret; \ | ||
| 124 | } \ | ||
| 125 | \ | ||
| 126 | static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \ | ||
| 127 | { \ | ||
| 128 | if (atomic_add_negative(-1, &event_exit_##sname.profile_count)) \ | ||
| 129 | unreg_prof_syscall_exit("sys"#sname); \ | ||
| 130 | } | ||
| 131 | |||
| 132 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | ||
| 133 | .profile_count = ATOMIC_INIT(-1), \ | ||
| 134 | .profile_enable = prof_sysenter_enable_##sname, \ | ||
| 135 | .profile_disable = prof_sysenter_disable_##sname, | ||
| 136 | |||
| 137 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | ||
| 138 | .profile_count = ATOMIC_INIT(-1), \ | ||
| 139 | .profile_enable = prof_sysexit_enable_##sname, \ | ||
| 140 | .profile_disable = prof_sysexit_disable_##sname, | ||
| 141 | #else | ||
| 142 | #define TRACE_SYS_ENTER_PROFILE(sname) | ||
| 143 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | ||
| 144 | #define TRACE_SYS_EXIT_PROFILE(sname) | ||
| 145 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) | ||
| 146 | #endif | ||
| 147 | |||
| 100 | #ifdef CONFIG_FTRACE_SYSCALLS | 148 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 101 | #define __SC_STR_ADECL1(t, a) #a | 149 | #define __SC_STR_ADECL1(t, a) #a |
| 102 | #define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__) | 150 | #define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__) |
| @@ -112,7 +160,81 @@ struct perf_counter_attr; | |||
| 112 | #define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) | 160 | #define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) |
| 113 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) | 161 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) |
| 114 | 162 | ||
| 163 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | ||
| 164 | static struct ftrace_event_call event_enter_##sname; \ | ||
| 165 | struct trace_event enter_syscall_print_##sname = { \ | ||
| 166 | .trace = print_syscall_enter, \ | ||
| 167 | }; \ | ||
| 168 | static int init_enter_##sname(void) \ | ||
| 169 | { \ | ||
| 170 | int num, id; \ | ||
| 171 | num = syscall_name_to_nr("sys"#sname); \ | ||
| 172 | if (num < 0) \ | ||
| 173 | return -ENOSYS; \ | ||
| 174 | id = register_ftrace_event(&enter_syscall_print_##sname);\ | ||
| 175 | if (!id) \ | ||
| 176 | return -ENODEV; \ | ||
| 177 | event_enter_##sname.id = id; \ | ||
| 178 | set_syscall_enter_id(num, id); \ | ||
| 179 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ | ||
| 180 | return 0; \ | ||
| 181 | } \ | ||
| 182 | TRACE_SYS_ENTER_PROFILE(sname); \ | ||
| 183 | static struct ftrace_event_call __used \ | ||
| 184 | __attribute__((__aligned__(4))) \ | ||
| 185 | __attribute__((section("_ftrace_events"))) \ | ||
| 186 | event_enter_##sname = { \ | ||
| 187 | .name = "sys_enter"#sname, \ | ||
| 188 | .system = "syscalls", \ | ||
| 189 | .event = &event_syscall_enter, \ | ||
| 190 | .raw_init = init_enter_##sname, \ | ||
| 191 | .show_format = syscall_enter_format, \ | ||
| 192 | .define_fields = syscall_enter_define_fields, \ | ||
| 193 | .regfunc = reg_event_syscall_enter, \ | ||
| 194 | .unregfunc = unreg_event_syscall_enter, \ | ||
| 195 | .data = "sys"#sname, \ | ||
| 196 | TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | ||
| 197 | } | ||
| 198 | |||
| 199 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | ||
| 200 | static struct ftrace_event_call event_exit_##sname; \ | ||
| 201 | struct trace_event exit_syscall_print_##sname = { \ | ||
| 202 | .trace = print_syscall_exit, \ | ||
| 203 | }; \ | ||
| 204 | static int init_exit_##sname(void) \ | ||
| 205 | { \ | ||
| 206 | int num, id; \ | ||
| 207 | num = syscall_name_to_nr("sys"#sname); \ | ||
| 208 | if (num < 0) \ | ||
| 209 | return -ENOSYS; \ | ||
| 210 | id = register_ftrace_event(&exit_syscall_print_##sname);\ | ||
| 211 | if (!id) \ | ||
| 212 | return -ENODEV; \ | ||
| 213 | event_exit_##sname.id = id; \ | ||
| 214 | set_syscall_exit_id(num, id); \ | ||
| 215 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ | ||
| 216 | return 0; \ | ||
| 217 | } \ | ||
| 218 | TRACE_SYS_EXIT_PROFILE(sname); \ | ||
| 219 | static struct ftrace_event_call __used \ | ||
| 220 | __attribute__((__aligned__(4))) \ | ||
| 221 | __attribute__((section("_ftrace_events"))) \ | ||
| 222 | event_exit_##sname = { \ | ||
| 223 | .name = "sys_exit"#sname, \ | ||
| 224 | .system = "syscalls", \ | ||
| 225 | .event = &event_syscall_exit, \ | ||
| 226 | .raw_init = init_exit_##sname, \ | ||
| 227 | .show_format = syscall_exit_format, \ | ||
| 228 | .define_fields = syscall_exit_define_fields, \ | ||
| 229 | .regfunc = reg_event_syscall_exit, \ | ||
| 230 | .unregfunc = unreg_event_syscall_exit, \ | ||
| 231 | .data = "sys"#sname, \ | ||
| 232 | TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | ||
| 233 | } | ||
| 234 | |||
| 115 | #define SYSCALL_METADATA(sname, nb) \ | 235 | #define SYSCALL_METADATA(sname, nb) \ |
| 236 | SYSCALL_TRACE_ENTER_EVENT(sname); \ | ||
| 237 | SYSCALL_TRACE_EXIT_EVENT(sname); \ | ||
| 116 | static const struct syscall_metadata __used \ | 238 | static const struct syscall_metadata __used \ |
| 117 | __attribute__((__aligned__(4))) \ | 239 | __attribute__((__aligned__(4))) \ |
| 118 | __attribute__((section("__syscalls_metadata"))) \ | 240 | __attribute__((section("__syscalls_metadata"))) \ |
| @@ -121,18 +243,23 @@ struct perf_counter_attr; | |||
| 121 | .nb_args = nb, \ | 243 | .nb_args = nb, \ |
| 122 | .types = types_##sname, \ | 244 | .types = types_##sname, \ |
| 123 | .args = args_##sname, \ | 245 | .args = args_##sname, \ |
| 124 | } | 246 | .enter_event = &event_enter_##sname, \ |
| 247 | .exit_event = &event_exit_##sname, \ | ||
| 248 | }; | ||
| 125 | 249 | ||
| 126 | #define SYSCALL_DEFINE0(sname) \ | 250 | #define SYSCALL_DEFINE0(sname) \ |
| 251 | SYSCALL_TRACE_ENTER_EVENT(_##sname); \ | ||
| 252 | SYSCALL_TRACE_EXIT_EVENT(_##sname); \ | ||
| 127 | static const struct syscall_metadata __used \ | 253 | static const struct syscall_metadata __used \ |
| 128 | __attribute__((__aligned__(4))) \ | 254 | __attribute__((__aligned__(4))) \ |
| 129 | __attribute__((section("__syscalls_metadata"))) \ | 255 | __attribute__((section("__syscalls_metadata"))) \ |
| 130 | __syscall_meta_##sname = { \ | 256 | __syscall_meta_##sname = { \ |
| 131 | .name = "sys_"#sname, \ | 257 | .name = "sys_"#sname, \ |
| 132 | .nb_args = 0, \ | 258 | .nb_args = 0, \ |
| 259 | .enter_event = &event_enter__##sname, \ | ||
| 260 | .exit_event = &event_exit__##sname, \ | ||
| 133 | }; \ | 261 | }; \ |
| 134 | asmlinkage long sys_##sname(void) | 262 | asmlinkage long sys_##sname(void) |
| 135 | |||
| 136 | #else | 263 | #else |
| 137 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) | 264 | #define SYSCALL_DEFINE0(name) asmlinkage long sys_##name(void) |
| 138 | #endif | 265 | #endif |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8afac76cd748..61723a7c21fe 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -233,7 +233,7 @@ struct tcp_request_sock { | |||
| 233 | struct inet_request_sock req; | 233 | struct inet_request_sock req; |
| 234 | #ifdef CONFIG_TCP_MD5SIG | 234 | #ifdef CONFIG_TCP_MD5SIG |
| 235 | /* Only used by TCP MD5 Signature so far. */ | 235 | /* Only used by TCP MD5 Signature so far. */ |
| 236 | struct tcp_request_sock_ops *af_specific; | 236 | const struct tcp_request_sock_ops *af_specific; |
| 237 | #endif | 237 | #endif |
| 238 | u32 rcv_isn; | 238 | u32 rcv_isn; |
| 239 | u32 snt_isn; | 239 | u32 snt_isn; |
| @@ -401,9 +401,9 @@ struct tcp_sock { | |||
| 401 | 401 | ||
| 402 | #ifdef CONFIG_TCP_MD5SIG | 402 | #ifdef CONFIG_TCP_MD5SIG |
| 403 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ | 403 | /* TCP AF-Specific parts; only used by MD5 Signature support so far */ |
| 404 | struct tcp_sock_af_ops *af_specific; | 404 | const struct tcp_sock_af_ops *af_specific; |
| 405 | 405 | ||
| 406 | /* TCP MD5 Signagure Option information */ | 406 | /* TCP MD5 Signature Option information */ |
| 407 | struct tcp_md5sig_info *md5sig_info; | 407 | struct tcp_md5sig_info *md5sig_info; |
| 408 | #endif | 408 | #endif |
| 409 | }; | 409 | }; |
diff --git a/include/linux/tipc.h b/include/linux/tipc.h index bea469455a0c..3d92396639de 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
| @@ -209,5 +209,7 @@ struct sockaddr_tipc { | |||
| 209 | #define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ | 209 | #define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ |
| 210 | #define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ | 210 | #define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ |
| 211 | #define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ | 211 | #define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ |
| 212 | #define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ | ||
| 213 | #define TIPC_SOCK_RECVQ_DEPTH 132 /* Default: none (read only) */ | ||
| 212 | 214 | ||
| 213 | #endif | 215 | #endif |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 7402c1a27c4f..85e8cf7d393c 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -85,20 +85,29 @@ int arch_update_cpu_topology(void); | |||
| 85 | #define ARCH_HAS_SCHED_WAKE_IDLE | 85 | #define ARCH_HAS_SCHED_WAKE_IDLE |
| 86 | /* Common values for SMT siblings */ | 86 | /* Common values for SMT siblings */ |
| 87 | #ifndef SD_SIBLING_INIT | 87 | #ifndef SD_SIBLING_INIT |
| 88 | #define SD_SIBLING_INIT (struct sched_domain) { \ | 88 | #define SD_SIBLING_INIT (struct sched_domain) { \ |
| 89 | .min_interval = 1, \ | 89 | .min_interval = 1, \ |
| 90 | .max_interval = 2, \ | 90 | .max_interval = 2, \ |
| 91 | .busy_factor = 64, \ | 91 | .busy_factor = 64, \ |
| 92 | .imbalance_pct = 110, \ | 92 | .imbalance_pct = 110, \ |
| 93 | .flags = SD_LOAD_BALANCE \ | 93 | \ |
| 94 | | SD_BALANCE_NEWIDLE \ | 94 | .flags = 1*SD_LOAD_BALANCE \ |
| 95 | | SD_BALANCE_FORK \ | 95 | | 1*SD_BALANCE_NEWIDLE \ |
| 96 | | SD_BALANCE_EXEC \ | 96 | | 1*SD_BALANCE_EXEC \ |
| 97 | | SD_WAKE_AFFINE \ | 97 | | 1*SD_BALANCE_FORK \ |
| 98 | | SD_WAKE_BALANCE \ | 98 | | 0*SD_WAKE_IDLE \ |
| 99 | | SD_SHARE_CPUPOWER, \ | 99 | | 1*SD_WAKE_AFFINE \ |
| 100 | .last_balance = jiffies, \ | 100 | | 1*SD_WAKE_BALANCE \ |
| 101 | .balance_interval = 1, \ | 101 | | 1*SD_SHARE_CPUPOWER \ |
| 102 | | 0*SD_POWERSAVINGS_BALANCE \ | ||
| 103 | | 0*SD_SHARE_PKG_RESOURCES \ | ||
| 104 | | 0*SD_SERIALIZE \ | ||
| 105 | | 0*SD_WAKE_IDLE_FAR \ | ||
| 106 | | 0*SD_PREFER_SIBLING \ | ||
| 107 | , \ | ||
| 108 | .last_balance = jiffies, \ | ||
| 109 | .balance_interval = 1, \ | ||
| 110 | .smt_gain = 1178, /* 15% */ \ | ||
| 102 | } | 111 | } |
| 103 | #endif | 112 | #endif |
| 104 | #endif /* CONFIG_SCHED_SMT */ | 113 | #endif /* CONFIG_SCHED_SMT */ |
| @@ -106,69 +115,94 @@ int arch_update_cpu_topology(void); | |||
| 106 | #ifdef CONFIG_SCHED_MC | 115 | #ifdef CONFIG_SCHED_MC |
| 107 | /* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ | 116 | /* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ |
| 108 | #ifndef SD_MC_INIT | 117 | #ifndef SD_MC_INIT |
| 109 | #define SD_MC_INIT (struct sched_domain) { \ | 118 | #define SD_MC_INIT (struct sched_domain) { \ |
| 110 | .min_interval = 1, \ | 119 | .min_interval = 1, \ |
| 111 | .max_interval = 4, \ | 120 | .max_interval = 4, \ |
| 112 | .busy_factor = 64, \ | 121 | .busy_factor = 64, \ |
| 113 | .imbalance_pct = 125, \ | 122 | .imbalance_pct = 125, \ |
| 114 | .cache_nice_tries = 1, \ | 123 | .cache_nice_tries = 1, \ |
| 115 | .busy_idx = 2, \ | 124 | .busy_idx = 2, \ |
| 116 | .wake_idx = 1, \ | 125 | .wake_idx = 1, \ |
| 117 | .forkexec_idx = 1, \ | 126 | .forkexec_idx = 1, \ |
| 118 | .flags = SD_LOAD_BALANCE \ | 127 | \ |
| 119 | | SD_BALANCE_FORK \ | 128 | .flags = 1*SD_LOAD_BALANCE \ |
| 120 | | SD_BALANCE_EXEC \ | 129 | | 1*SD_BALANCE_NEWIDLE \ |
| 121 | | SD_WAKE_AFFINE \ | 130 | | 1*SD_BALANCE_EXEC \ |
| 122 | | SD_WAKE_BALANCE \ | 131 | | 1*SD_BALANCE_FORK \ |
| 123 | | SD_SHARE_PKG_RESOURCES\ | 132 | | 1*SD_WAKE_IDLE \ |
| 124 | | sd_balance_for_mc_power()\ | 133 | | 1*SD_WAKE_AFFINE \ |
| 125 | | sd_power_saving_flags(),\ | 134 | | 1*SD_WAKE_BALANCE \ |
| 126 | .last_balance = jiffies, \ | 135 | | 0*SD_SHARE_CPUPOWER \ |
| 127 | .balance_interval = 1, \ | 136 | | 1*SD_SHARE_PKG_RESOURCES \ |
| 137 | | 0*SD_SERIALIZE \ | ||
| 138 | | 0*SD_WAKE_IDLE_FAR \ | ||
| 139 | | sd_balance_for_mc_power() \ | ||
| 140 | | sd_power_saving_flags() \ | ||
| 141 | , \ | ||
| 142 | .last_balance = jiffies, \ | ||
| 143 | .balance_interval = 1, \ | ||
| 128 | } | 144 | } |
| 129 | #endif | 145 | #endif |
| 130 | #endif /* CONFIG_SCHED_MC */ | 146 | #endif /* CONFIG_SCHED_MC */ |
| 131 | 147 | ||
| 132 | /* Common values for CPUs */ | 148 | /* Common values for CPUs */ |
| 133 | #ifndef SD_CPU_INIT | 149 | #ifndef SD_CPU_INIT |
| 134 | #define SD_CPU_INIT (struct sched_domain) { \ | 150 | #define SD_CPU_INIT (struct sched_domain) { \ |
| 135 | .min_interval = 1, \ | 151 | .min_interval = 1, \ |
| 136 | .max_interval = 4, \ | 152 | .max_interval = 4, \ |
| 137 | .busy_factor = 64, \ | 153 | .busy_factor = 64, \ |
| 138 | .imbalance_pct = 125, \ | 154 | .imbalance_pct = 125, \ |
| 139 | .cache_nice_tries = 1, \ | 155 | .cache_nice_tries = 1, \ |
| 140 | .busy_idx = 2, \ | 156 | .busy_idx = 2, \ |
| 141 | .idle_idx = 1, \ | 157 | .idle_idx = 1, \ |
| 142 | .newidle_idx = 2, \ | 158 | .newidle_idx = 2, \ |
| 143 | .wake_idx = 1, \ | 159 | .wake_idx = 1, \ |
| 144 | .forkexec_idx = 1, \ | 160 | .forkexec_idx = 1, \ |
| 145 | .flags = SD_LOAD_BALANCE \ | 161 | \ |
| 146 | | SD_BALANCE_EXEC \ | 162 | .flags = 1*SD_LOAD_BALANCE \ |
| 147 | | SD_BALANCE_FORK \ | 163 | | 1*SD_BALANCE_NEWIDLE \ |
| 148 | | SD_WAKE_AFFINE \ | 164 | | 1*SD_BALANCE_EXEC \ |
| 149 | | SD_WAKE_BALANCE \ | 165 | | 1*SD_BALANCE_FORK \ |
| 150 | | sd_balance_for_package_power()\ | 166 | | 1*SD_WAKE_IDLE \ |
| 151 | | sd_power_saving_flags(),\ | 167 | | 0*SD_WAKE_AFFINE \ |
| 152 | .last_balance = jiffies, \ | 168 | | 1*SD_WAKE_BALANCE \ |
| 153 | .balance_interval = 1, \ | 169 | | 0*SD_SHARE_CPUPOWER \ |
| 170 | | 0*SD_SHARE_PKG_RESOURCES \ | ||
| 171 | | 0*SD_SERIALIZE \ | ||
| 172 | | 0*SD_WAKE_IDLE_FAR \ | ||
| 173 | | sd_balance_for_package_power() \ | ||
| 174 | | sd_power_saving_flags() \ | ||
| 175 | , \ | ||
| 176 | .last_balance = jiffies, \ | ||
| 177 | .balance_interval = 1, \ | ||
| 154 | } | 178 | } |
| 155 | #endif | 179 | #endif |
| 156 | 180 | ||
| 157 | /* sched_domains SD_ALLNODES_INIT for NUMA machines */ | 181 | /* sched_domains SD_ALLNODES_INIT for NUMA machines */ |
| 158 | #define SD_ALLNODES_INIT (struct sched_domain) { \ | 182 | #define SD_ALLNODES_INIT (struct sched_domain) { \ |
| 159 | .min_interval = 64, \ | 183 | .min_interval = 64, \ |
| 160 | .max_interval = 64*num_online_cpus(), \ | 184 | .max_interval = 64*num_online_cpus(), \ |
| 161 | .busy_factor = 128, \ | 185 | .busy_factor = 128, \ |
| 162 | .imbalance_pct = 133, \ | 186 | .imbalance_pct = 133, \ |
| 163 | .cache_nice_tries = 1, \ | 187 | .cache_nice_tries = 1, \ |
| 164 | .busy_idx = 3, \ | 188 | .busy_idx = 3, \ |
| 165 | .idle_idx = 3, \ | 189 | .idle_idx = 3, \ |
| 166 | .flags = SD_LOAD_BALANCE \ | 190 | .flags = 1*SD_LOAD_BALANCE \ |
| 167 | | SD_BALANCE_NEWIDLE \ | 191 | | 1*SD_BALANCE_NEWIDLE \ |
| 168 | | SD_WAKE_AFFINE \ | 192 | | 0*SD_BALANCE_EXEC \ |
| 169 | | SD_SERIALIZE, \ | 193 | | 0*SD_BALANCE_FORK \ |
| 170 | .last_balance = jiffies, \ | 194 | | 0*SD_WAKE_IDLE \ |
| 171 | .balance_interval = 64, \ | 195 | | 1*SD_WAKE_AFFINE \ |
| 196 | | 0*SD_WAKE_BALANCE \ | ||
| 197 | | 0*SD_SHARE_CPUPOWER \ | ||
| 198 | | 0*SD_POWERSAVINGS_BALANCE \ | ||
| 199 | | 0*SD_SHARE_PKG_RESOURCES \ | ||
| 200 | | 1*SD_SERIALIZE \ | ||
| 201 | | 1*SD_WAKE_IDLE_FAR \ | ||
| 202 | | 0*SD_PREFER_SIBLING \ | ||
| 203 | , \ | ||
| 204 | .last_balance = jiffies, \ | ||
| 205 | .balance_interval = 64, \ | ||
| 172 | } | 206 | } |
| 173 | 207 | ||
| 174 | #ifdef CONFIG_NUMA | 208 | #ifdef CONFIG_NUMA |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index b9dc4ca0246f..63a3f7a80580 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
| @@ -23,6 +23,8 @@ struct tracepoint; | |||
| 23 | struct tracepoint { | 23 | struct tracepoint { |
| 24 | const char *name; /* Tracepoint name */ | 24 | const char *name; /* Tracepoint name */ |
| 25 | int state; /* State. */ | 25 | int state; /* State. */ |
| 26 | void (*regfunc)(void); | ||
| 27 | void (*unregfunc)(void); | ||
| 26 | void **funcs; | 28 | void **funcs; |
| 27 | } __attribute__((aligned(32))); /* | 29 | } __attribute__((aligned(32))); /* |
| 28 | * Aligned on 32 bytes because it is | 30 | * Aligned on 32 bytes because it is |
| @@ -78,12 +80,16 @@ struct tracepoint { | |||
| 78 | return tracepoint_probe_unregister(#name, (void *)probe);\ | 80 | return tracepoint_probe_unregister(#name, (void *)probe);\ |
| 79 | } | 81 | } |
| 80 | 82 | ||
| 81 | #define DEFINE_TRACE(name) \ | 83 | |
| 84 | #define DEFINE_TRACE_FN(name, reg, unreg) \ | ||
| 82 | static const char __tpstrtab_##name[] \ | 85 | static const char __tpstrtab_##name[] \ |
| 83 | __attribute__((section("__tracepoints_strings"))) = #name; \ | 86 | __attribute__((section("__tracepoints_strings"))) = #name; \ |
| 84 | struct tracepoint __tracepoint_##name \ | 87 | struct tracepoint __tracepoint_##name \ |
| 85 | __attribute__((section("__tracepoints"), aligned(32))) = \ | 88 | __attribute__((section("__tracepoints"), aligned(32))) = \ |
| 86 | { __tpstrtab_##name, 0, NULL } | 89 | { __tpstrtab_##name, 0, reg, unreg, NULL } |
| 90 | |||
| 91 | #define DEFINE_TRACE(name) \ | ||
| 92 | DEFINE_TRACE_FN(name, NULL, NULL); | ||
| 87 | 93 | ||
| 88 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) \ | 94 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) \ |
| 89 | EXPORT_SYMBOL_GPL(__tracepoint_##name) | 95 | EXPORT_SYMBOL_GPL(__tracepoint_##name) |
| @@ -108,6 +114,7 @@ extern void tracepoint_update_probe_range(struct tracepoint *begin, | |||
| 108 | return -ENOSYS; \ | 114 | return -ENOSYS; \ |
| 109 | } | 115 | } |
| 110 | 116 | ||
| 117 | #define DEFINE_TRACE_FN(name, reg, unreg) | ||
| 111 | #define DEFINE_TRACE(name) | 118 | #define DEFINE_TRACE(name) |
| 112 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) | 119 | #define EXPORT_TRACEPOINT_SYMBOL_GPL(name) |
| 113 | #define EXPORT_TRACEPOINT_SYMBOL(name) | 120 | #define EXPORT_TRACEPOINT_SYMBOL(name) |
| @@ -158,6 +165,15 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 158 | 165 | ||
| 159 | #define PARAMS(args...) args | 166 | #define PARAMS(args...) args |
| 160 | 167 | ||
| 168 | #endif /* _LINUX_TRACEPOINT_H */ | ||
| 169 | |||
| 170 | /* | ||
| 171 | * Note: we keep the TRACE_EVENT outside the include file ifdef protection. | ||
| 172 | * This is due to the way trace events work. If a file includes two | ||
| 173 | * trace event headers under one "CREATE_TRACE_POINTS" the first include | ||
| 174 | * will override the TRACE_EVENT and break the second include. | ||
| 175 | */ | ||
| 176 | |||
| 161 | #ifndef TRACE_EVENT | 177 | #ifndef TRACE_EVENT |
| 162 | /* | 178 | /* |
| 163 | * For use with the TRACE_EVENT macro: | 179 | * For use with the TRACE_EVENT macro: |
| @@ -259,10 +275,15 @@ static inline void tracepoint_synchronize_unregister(void) | |||
| 259 | * can also by used by generic instrumentation like SystemTap), and | 275 | * can also by used by generic instrumentation like SystemTap), and |
| 260 | * it is also used to expose a structured trace record in | 276 | * it is also used to expose a structured trace record in |
| 261 | * /sys/kernel/debug/tracing/events/. | 277 | * /sys/kernel/debug/tracing/events/. |
| 278 | * | ||
| 279 | * A set of (un)registration functions can be passed to the variant | ||
| 280 | * TRACE_EVENT_FN to perform any (un)registration work. | ||
| 262 | */ | 281 | */ |
| 263 | 282 | ||
| 264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 283 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
| 265 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 284 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
| 266 | #endif | 285 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
| 286 | assign, print, reg, unreg) \ | ||
| 287 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
| 267 | 288 | ||
| 268 | #endif | 289 | #endif /* ifdef TRACE_EVENT (see note above) */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 1488d8c81aac..a916a318004e 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ | 24 | #define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ |
| 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ | 25 | #define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ |
| 26 | #define NR_LDISCS 19 | 26 | #define NR_LDISCS 20 |
| 27 | 27 | ||
| 28 | /* line disciplines */ | 28 | /* line disciplines */ |
| 29 | #define N_TTY 0 | 29 | #define N_TTY 0 |
| @@ -47,6 +47,8 @@ | |||
| 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ | 47 | #define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */ |
| 48 | #define N_PPS 18 /* Pulse per Second */ | 48 | #define N_PPS 18 /* Pulse per Second */ |
| 49 | 49 | ||
| 50 | #define N_V253 19 /* Codec control over voice modem */ | ||
| 51 | |||
| 50 | /* | 52 | /* |
| 51 | * This character is the same as _POSIX_VDISABLE: it cannot be used as | 53 | * This character is the same as _POSIX_VDISABLE: it cannot be used as |
| 52 | * a c_cc[] character, but indicates that a particular special character | 54 | * a c_cc[] character, but indicates that a particular special character |
| @@ -394,6 +396,7 @@ extern void __do_SAK(struct tty_struct *tty); | |||
| 394 | extern void disassociate_ctty(int priv); | 396 | extern void disassociate_ctty(int priv); |
| 395 | extern void no_tty(void); | 397 | extern void no_tty(void); |
| 396 | extern void tty_flip_buffer_push(struct tty_struct *tty); | 398 | extern void tty_flip_buffer_push(struct tty_struct *tty); |
| 399 | extern void tty_flush_to_ldisc(struct tty_struct *tty); | ||
| 397 | extern void tty_buffer_free_all(struct tty_struct *tty); | 400 | extern void tty_buffer_free_all(struct tty_struct *tty); |
| 398 | extern void tty_buffer_flush(struct tty_struct *tty); | 401 | extern void tty_buffer_flush(struct tty_struct *tty); |
| 399 | extern void tty_buffer_init(struct tty_struct *tty); | 402 | extern void tty_buffer_init(struct tty_struct *tty); |
| @@ -516,10 +519,6 @@ extern void serial_console_init(void); | |||
| 516 | 519 | ||
| 517 | extern int pcxe_open(struct tty_struct *tty, struct file *filp); | 520 | extern int pcxe_open(struct tty_struct *tty, struct file *filp); |
| 518 | 521 | ||
| 519 | /* printk.c */ | ||
| 520 | |||
| 521 | extern void console_print(const char *); | ||
| 522 | |||
| 523 | /* vt.c */ | 522 | /* vt.c */ |
| 524 | 523 | ||
| 525 | extern int vt_ioctl(struct tty_struct *tty, struct file *file, | 524 | extern int vt_ioctl(struct tty_struct *tty, struct file *file, |
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h index 40f38d896777..0c4ee9b88f85 100644 --- a/include/linux/tty_ldisc.h +++ b/include/linux/tty_ldisc.h | |||
| @@ -144,7 +144,7 @@ struct tty_ldisc_ops { | |||
| 144 | 144 | ||
| 145 | struct tty_ldisc { | 145 | struct tty_ldisc { |
| 146 | struct tty_ldisc_ops *ops; | 146 | struct tty_ldisc_ops *ops; |
| 147 | int refcount; | 147 | atomic_t users; |
| 148 | }; | 148 | }; |
| 149 | 149 | ||
| 150 | #define TTY_LDISC_MAGIC 0x5403 | 150 | #define TTY_LDISC_MAGIC 0x5403 |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index ed889f4168f3..ae779bb8cc0f 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
| @@ -73,6 +73,10 @@ | |||
| 73 | 73 | ||
| 74 | #define UCB_ADC_DATA 0x68 | 74 | #define UCB_ADC_DATA 0x68 |
| 75 | #define UCB_ADC_DAT_VALID (1 << 15) | 75 | #define UCB_ADC_DAT_VALID (1 << 15) |
| 76 | |||
| 77 | #define UCB_FCSR 0x6c | ||
| 78 | #define UCB_FCSR_AVE (1 << 12) | ||
| 79 | |||
| 76 | #define UCB_ADC_DAT_MASK 0x3ff | 80 | #define UCB_ADC_DAT_MASK 0x3ff |
| 77 | 81 | ||
| 78 | #define UCB_ID 0x7e | 82 | #define UCB_ID 0x7e |
diff --git a/include/linux/uio.h b/include/linux/uio.h index b7fe13883bdb..98c114323a8b 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
| @@ -19,15 +19,6 @@ struct iovec | |||
| 19 | __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ | 19 | __kernel_size_t iov_len; /* Must be size_t (1003.1g) */ |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | #ifdef __KERNEL__ | ||
| 23 | |||
| 24 | struct kvec { | ||
| 25 | void *iov_base; /* and that should *never* hold a userland pointer */ | ||
| 26 | size_t iov_len; | ||
| 27 | }; | ||
| 28 | |||
| 29 | #endif | ||
| 30 | |||
| 31 | /* | 22 | /* |
| 32 | * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) | 23 | * UIO_MAXIOV shall be at least 16 1003.1g (5.4.1.1) |
| 33 | */ | 24 | */ |
| @@ -35,6 +26,13 @@ struct kvec { | |||
| 35 | #define UIO_FASTIOV 8 | 26 | #define UIO_FASTIOV 8 |
| 36 | #define UIO_MAXIOV 1024 | 27 | #define UIO_MAXIOV 1024 |
| 37 | 28 | ||
| 29 | #ifdef __KERNEL__ | ||
| 30 | |||
| 31 | struct kvec { | ||
| 32 | void *iov_base; /* and that should *never* hold a userland pointer */ | ||
| 33 | size_t iov_len; | ||
| 34 | }; | ||
| 35 | |||
| 38 | /* | 36 | /* |
| 39 | * Total number of bytes covered by an iovec. | 37 | * Total number of bytes covered by an iovec. |
| 40 | * | 38 | * |
| @@ -53,5 +51,6 @@ static inline size_t iov_length(const struct iovec *iov, unsigned long nr_segs) | |||
| 53 | } | 51 | } |
| 54 | 52 | ||
| 55 | unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); | 53 | unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); |
| 54 | #endif | ||
| 56 | 55 | ||
| 57 | #endif | 56 | #endif |
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h index 37836b937d97..1ef1ebc2b04f 100644 --- a/include/linux/usb/rndis_host.h +++ b/include/linux/usb/rndis_host.h | |||
| @@ -70,12 +70,13 @@ struct rndis_msg_hdr { | |||
| 70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) | 70 | #define RNDIS_MSG_KEEPALIVE_C (RNDIS_MSG_KEEPALIVE|RNDIS_MSG_COMPLETION) |
| 71 | 71 | ||
| 72 | /* codes for "status" field of completion messages */ | 72 | /* codes for "status" field of completion messages */ |
| 73 | #define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000) | 73 | #define RNDIS_STATUS_SUCCESS cpu_to_le32(0x00000000) |
| 74 | #define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001) | 74 | #define RNDIS_STATUS_FAILURE cpu_to_le32(0xc0000001) |
| 75 | #define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015) | 75 | #define RNDIS_STATUS_INVALID_DATA cpu_to_le32(0xc0010015) |
| 76 | #define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb) | 76 | #define RNDIS_STATUS_NOT_SUPPORTED cpu_to_le32(0xc00000bb) |
| 77 | #define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b) | 77 | #define RNDIS_STATUS_MEDIA_CONNECT cpu_to_le32(0x4001000b) |
| 78 | #define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c) | 78 | #define RNDIS_STATUS_MEDIA_DISCONNECT cpu_to_le32(0x4001000c) |
| 79 | #define RNDIS_STATUS_MEDIA_SPECIFIC_INDICATION cpu_to_le32(0x40010012) | ||
| 79 | 80 | ||
| 80 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ | 81 | /* codes for OID_GEN_PHYSICAL_MEDIUM */ |
| 81 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000) | 82 | #define RNDIS_PHYSICAL_MEDIUM_UNSPECIFIED cpu_to_le32(0x00000000) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 310e18a880ff..bb69e256cd16 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -53,6 +53,7 @@ struct usbnet { | |||
| 53 | struct sk_buff_head rxq; | 53 | struct sk_buff_head rxq; |
| 54 | struct sk_buff_head txq; | 54 | struct sk_buff_head txq; |
| 55 | struct sk_buff_head done; | 55 | struct sk_buff_head done; |
| 56 | struct sk_buff_head rxq_pause; | ||
| 56 | struct urb *interrupt; | 57 | struct urb *interrupt; |
| 57 | struct tasklet_struct bh; | 58 | struct tasklet_struct bh; |
| 58 | 59 | ||
| @@ -63,6 +64,7 @@ struct usbnet { | |||
| 63 | # define EVENT_RX_MEMORY 2 | 64 | # define EVENT_RX_MEMORY 2 |
| 64 | # define EVENT_STS_SPLIT 3 | 65 | # define EVENT_STS_SPLIT 3 |
| 65 | # define EVENT_LINK_RESET 4 | 66 | # define EVENT_LINK_RESET 4 |
| 67 | # define EVENT_RX_PAUSED 5 | ||
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 70 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
| @@ -86,6 +88,7 @@ struct driver_info { | |||
| 86 | 88 | ||
| 87 | #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ | 89 | #define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ |
| 88 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ | 90 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ |
| 91 | #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ | ||
| 89 | 92 | ||
| 90 | 93 | ||
| 91 | /* init device ... can sleep, or cause probe() failure */ | 94 | /* init device ... can sleep, or cause probe() failure */ |
| @@ -97,6 +100,9 @@ struct driver_info { | |||
| 97 | /* reset device ... can sleep */ | 100 | /* reset device ... can sleep */ |
| 98 | int (*reset)(struct usbnet *); | 101 | int (*reset)(struct usbnet *); |
| 99 | 102 | ||
| 103 | /* stop device ... can sleep */ | ||
| 104 | int (*stop)(struct usbnet *); | ||
| 105 | |||
| 100 | /* see if peer is connected ... can sleep */ | 106 | /* see if peer is connected ... can sleep */ |
| 101 | int (*check_connect)(struct usbnet *); | 107 | int (*check_connect)(struct usbnet *); |
| 102 | 108 | ||
| @@ -118,9 +124,8 @@ struct driver_info { | |||
| 118 | * right after minidriver have initialized hardware. */ | 124 | * right after minidriver have initialized hardware. */ |
| 119 | int (*early_init)(struct usbnet *dev); | 125 | int (*early_init)(struct usbnet *dev); |
| 120 | 126 | ||
| 121 | /* called by minidriver when link state changes, state: 0=disconnect, | 127 | /* called by minidriver when receiving indication */ |
| 122 | * 1=connect */ | 128 | void (*indication)(struct usbnet *dev, void *ind, int indlen); |
| 123 | void (*link_change)(struct usbnet *dev, int state); | ||
| 124 | 129 | ||
| 125 | /* for new devices, use the descriptor-reading code instead */ | 130 | /* for new devices, use the descriptor-reading code instead */ |
| 126 | int in; /* rx endpoint */ | 131 | int in; /* rx endpoint */ |
| @@ -177,7 +182,8 @@ struct skb_data { /* skb->cb is one of these */ | |||
| 177 | 182 | ||
| 178 | extern int usbnet_open (struct net_device *net); | 183 | extern int usbnet_open (struct net_device *net); |
| 179 | extern int usbnet_stop (struct net_device *net); | 184 | extern int usbnet_stop (struct net_device *net); |
| 180 | extern int usbnet_start_xmit (struct sk_buff *skb, struct net_device *net); | 185 | extern netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, |
| 186 | struct net_device *net); | ||
| 181 | extern void usbnet_tx_timeout (struct net_device *net); | 187 | extern void usbnet_tx_timeout (struct net_device *net); |
| 182 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); | 188 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); |
| 183 | 189 | ||
| @@ -187,6 +193,10 @@ extern void usbnet_defer_kevent (struct usbnet *, int); | |||
| 187 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); | 193 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); |
| 188 | extern void usbnet_unlink_rx_urbs(struct usbnet *); | 194 | extern void usbnet_unlink_rx_urbs(struct usbnet *); |
| 189 | 195 | ||
| 196 | extern void usbnet_pause_rx(struct usbnet *); | ||
| 197 | extern void usbnet_resume_rx(struct usbnet *); | ||
| 198 | extern void usbnet_purge_paused_rxq(struct usbnet *); | ||
| 199 | |||
| 190 | extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); | 200 | extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); |
| 191 | extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); | 201 | extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); |
| 192 | extern u32 usbnet_get_link (struct net_device *net); | 202 | extern u32 usbnet_get_link (struct net_device *net); |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 95846d988011..74f16876f38d 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -338,6 +338,7 @@ struct v4l2_pix_format { | |||
| 338 | /* Vendor-specific formats */ | 338 | /* Vendor-specific formats */ |
| 339 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ | 339 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
| 340 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ | 340 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
| 341 | #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ | ||
| 341 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ | 342 | #define V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */ |
| 342 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ | 343 | #define V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */ |
| 343 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ | 344 | #define V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */ |
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index be7d255fc7cf..8dab9f2b8832 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
| @@ -20,8 +20,7 @@ | |||
| 20 | 20 | ||
| 21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ | 21 | #define VIRTIO_BLK_ID_BYTES (sizeof(__u16[256])) /* IDENTIFY DATA */ |
| 22 | 22 | ||
| 23 | struct virtio_blk_config | 23 | struct virtio_blk_config { |
| 24 | { | ||
| 25 | /* The capacity (in 512-byte sectors). */ | 24 | /* The capacity (in 512-byte sectors). */ |
| 26 | __u64 capacity; | 25 | __u64 capacity; |
| 27 | /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ | 26 | /* The maximum segment size (if VIRTIO_BLK_F_SIZE_MAX) */ |
| @@ -50,8 +49,7 @@ struct virtio_blk_config | |||
| 50 | #define VIRTIO_BLK_T_BARRIER 0x80000000 | 49 | #define VIRTIO_BLK_T_BARRIER 0x80000000 |
| 51 | 50 | ||
| 52 | /* This is the first element of the read scatter-gather list. */ | 51 | /* This is the first element of the read scatter-gather list. */ |
| 53 | struct virtio_blk_outhdr | 52 | struct virtio_blk_outhdr { |
| 54 | { | ||
| 55 | /* VIRTIO_BLK_T* */ | 53 | /* VIRTIO_BLK_T* */ |
| 56 | __u32 type; | 54 | __u32 type; |
| 57 | /* io priority. */ | 55 | /* io priority. */ |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index 99f514575f6a..e547e3c8ee9a 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
| @@ -79,8 +79,7 @@ | |||
| 79 | * the dev->feature bits if it wants. | 79 | * the dev->feature bits if it wants. |
| 80 | */ | 80 | */ |
| 81 | typedef void vq_callback_t(struct virtqueue *); | 81 | typedef void vq_callback_t(struct virtqueue *); |
| 82 | struct virtio_config_ops | 82 | struct virtio_config_ops { |
| 83 | { | ||
| 84 | void (*get)(struct virtio_device *vdev, unsigned offset, | 83 | void (*get)(struct virtio_device *vdev, unsigned offset, |
| 85 | void *buf, unsigned len); | 84 | void *buf, unsigned len); |
| 86 | void (*set)(struct virtio_device *vdev, unsigned offset, | 85 | void (*set)(struct virtio_device *vdev, unsigned offset, |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index 9c543d6ac535..d8dd539c9f48 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
| @@ -31,8 +31,7 @@ | |||
| 31 | 31 | ||
| 32 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 32 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
| 33 | 33 | ||
| 34 | struct virtio_net_config | 34 | struct virtio_net_config { |
| 35 | { | ||
| 36 | /* The config defining mac address (if VIRTIO_NET_F_MAC) */ | 35 | /* The config defining mac address (if VIRTIO_NET_F_MAC) */ |
| 37 | __u8 mac[6]; | 36 | __u8 mac[6]; |
| 38 | /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ | 37 | /* See VIRTIO_NET_F_STATUS and VIRTIO_NET_S_* above */ |
| @@ -41,8 +40,7 @@ struct virtio_net_config | |||
| 41 | 40 | ||
| 42 | /* This is the first element of the scatter-gather list. If you don't | 41 | /* This is the first element of the scatter-gather list. If you don't |
| 43 | * specify GSO or CSUM features, you can simply ignore the header. */ | 42 | * specify GSO or CSUM features, you can simply ignore the header. */ |
| 44 | struct virtio_net_hdr | 43 | struct virtio_net_hdr { |
| 45 | { | ||
| 46 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset | 44 | #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset |
| 47 | __u8 flags; | 45 | __u8 flags; |
| 48 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame | 46 | #define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 693e0ec5afa6..e4d144b132b5 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
| @@ -30,8 +30,7 @@ | |||
| 30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 | 30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 |
| 31 | 31 | ||
| 32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ | 32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ |
| 33 | struct vring_desc | 33 | struct vring_desc { |
| 34 | { | ||
| 35 | /* Address (guest-physical). */ | 34 | /* Address (guest-physical). */ |
| 36 | __u64 addr; | 35 | __u64 addr; |
| 37 | /* Length. */ | 36 | /* Length. */ |
| @@ -42,24 +41,21 @@ struct vring_desc | |||
| 42 | __u16 next; | 41 | __u16 next; |
| 43 | }; | 42 | }; |
| 44 | 43 | ||
| 45 | struct vring_avail | 44 | struct vring_avail { |
| 46 | { | ||
| 47 | __u16 flags; | 45 | __u16 flags; |
| 48 | __u16 idx; | 46 | __u16 idx; |
| 49 | __u16 ring[]; | 47 | __u16 ring[]; |
| 50 | }; | 48 | }; |
| 51 | 49 | ||
| 52 | /* u32 is used here for ids for padding reasons. */ | 50 | /* u32 is used here for ids for padding reasons. */ |
| 53 | struct vring_used_elem | 51 | struct vring_used_elem { |
| 54 | { | ||
| 55 | /* Index of start of used descriptor chain. */ | 52 | /* Index of start of used descriptor chain. */ |
| 56 | __u32 id; | 53 | __u32 id; |
| 57 | /* Total length of the descriptor chain which was used (written to) */ | 54 | /* Total length of the descriptor chain which was used (written to) */ |
| 58 | __u32 len; | 55 | __u32 len; |
| 59 | }; | 56 | }; |
| 60 | 57 | ||
| 61 | struct vring_used | 58 | struct vring_used { |
| 62 | { | ||
| 63 | __u16 flags; | 59 | __u16 flags; |
| 64 | __u16 idx; | 60 | __u16 idx; |
| 65 | struct vring_used_elem ring[]; | 61 | struct vring_used_elem ring[]; |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 6788e1a4d4ca..cf3c2f5dba51 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -77,7 +77,14 @@ struct task_struct; | |||
| 77 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ | 77 | #define __WAIT_BIT_KEY_INITIALIZER(word, bit) \ |
| 78 | { .flags = word, .bit_nr = bit, } | 78 | { .flags = word, .bit_nr = bit, } |
| 79 | 79 | ||
| 80 | extern void init_waitqueue_head(wait_queue_head_t *q); | 80 | extern void __init_waitqueue_head(wait_queue_head_t *q, struct lock_class_key *); |
| 81 | |||
| 82 | #define init_waitqueue_head(q) \ | ||
| 83 | do { \ | ||
| 84 | static struct lock_class_key __key; \ | ||
| 85 | \ | ||
| 86 | __init_waitqueue_head((q), &__key); \ | ||
| 87 | } while (0) | ||
| 81 | 88 | ||
| 82 | #ifdef CONFIG_LOCKDEP | 89 | #ifdef CONFIG_LOCKDEP |
| 83 | # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ | 90 | # define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index cb24204851f7..5b4c6c772a9b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
| @@ -1132,6 +1132,14 @@ struct __compat_iw_event { | |||
| 1132 | }; | 1132 | }; |
| 1133 | #define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) | 1133 | #define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer) |
| 1134 | #define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) | 1134 | #define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length) |
| 1135 | |||
| 1136 | /* Size of the various events for compat */ | ||
| 1137 | #define IW_EV_COMPAT_CHAR_LEN (IW_EV_COMPAT_LCP_LEN + IFNAMSIZ) | ||
| 1138 | #define IW_EV_COMPAT_UINT_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(__u32)) | ||
| 1139 | #define IW_EV_COMPAT_FREQ_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_freq)) | ||
| 1140 | #define IW_EV_COMPAT_PARAM_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_param)) | ||
| 1141 | #define IW_EV_COMPAT_ADDR_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct sockaddr)) | ||
| 1142 | #define IW_EV_COMPAT_QUAL_LEN (IW_EV_COMPAT_LCP_LEN + sizeof(struct iw_quality)) | ||
| 1135 | #define IW_EV_COMPAT_POINT_LEN \ | 1143 | #define IW_EV_COMPAT_POINT_LEN \ |
| 1136 | (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ | 1144 | (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \ |
| 1137 | IW_EV_COMPAT_POINT_OFF) | 1145 | IW_EV_COMPAT_POINT_OFF) |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 13e1adf55c4c..6273fa97b527 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
| @@ -240,6 +240,21 @@ static inline int cancel_delayed_work(struct delayed_work *work) | |||
| 240 | return ret; | 240 | return ret; |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | /* | ||
| 244 | * Like above, but uses del_timer() instead of del_timer_sync(). This means, | ||
| 245 | * if it returns 0 the timer function may be running and the queueing is in | ||
| 246 | * progress. | ||
| 247 | */ | ||
| 248 | static inline int __cancel_delayed_work(struct delayed_work *work) | ||
| 249 | { | ||
| 250 | int ret; | ||
| 251 | |||
| 252 | ret = del_timer(&work->timer); | ||
| 253 | if (ret) | ||
| 254 | work_clear_pending(&work->work); | ||
| 255 | return ret; | ||
| 256 | } | ||
| 257 | |||
| 243 | extern int cancel_delayed_work_sync(struct delayed_work *work); | 258 | extern int cancel_delayed_work_sync(struct delayed_work *work); |
| 244 | 259 | ||
| 245 | /* Obsolete. use cancel_delayed_work_sync() */ | 260 | /* Obsolete. use cancel_delayed_work_sync() */ |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 3224820c8514..d347632f1861 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -14,17 +14,6 @@ extern struct list_head inode_in_use; | |||
| 14 | extern struct list_head inode_unused; | 14 | extern struct list_head inode_unused; |
| 15 | 15 | ||
| 16 | /* | 16 | /* |
| 17 | * Yes, writeback.h requires sched.h | ||
| 18 | * No, sched.h is not included from here. | ||
| 19 | */ | ||
| 20 | static inline int task_is_pdflush(struct task_struct *task) | ||
| 21 | { | ||
| 22 | return task->flags & PF_FLUSHER; | ||
| 23 | } | ||
| 24 | |||
| 25 | #define current_is_pdflush() task_is_pdflush(current) | ||
| 26 | |||
| 27 | /* | ||
| 28 | * fs/fs-writeback.c | 17 | * fs/fs-writeback.c |
| 29 | */ | 18 | */ |
| 30 | enum writeback_sync_modes { | 19 | enum writeback_sync_modes { |
| @@ -40,6 +29,8 @@ enum writeback_sync_modes { | |||
| 40 | struct writeback_control { | 29 | struct writeback_control { |
| 41 | struct backing_dev_info *bdi; /* If !NULL, only write back this | 30 | struct backing_dev_info *bdi; /* If !NULL, only write back this |
| 42 | queue */ | 31 | queue */ |
| 32 | struct super_block *sb; /* if !NULL, only write inodes from | ||
| 33 | this super_block */ | ||
| 43 | enum writeback_sync_modes sync_mode; | 34 | enum writeback_sync_modes sync_mode; |
| 44 | unsigned long *older_than_this; /* If !NULL, only write back inodes | 35 | unsigned long *older_than_this; /* If !NULL, only write back inodes |
| 45 | older than this */ | 36 | older than this */ |
| @@ -76,9 +67,13 @@ struct writeback_control { | |||
| 76 | /* | 67 | /* |
| 77 | * fs/fs-writeback.c | 68 | * fs/fs-writeback.c |
| 78 | */ | 69 | */ |
| 79 | void writeback_inodes(struct writeback_control *wbc); | 70 | struct bdi_writeback; |
| 80 | int inode_wait(void *); | 71 | int inode_wait(void *); |
| 81 | void sync_inodes_sb(struct super_block *, int wait); | 72 | long writeback_inodes_sb(struct super_block *); |
| 73 | long sync_inodes_sb(struct super_block *); | ||
| 74 | void writeback_inodes_wbc(struct writeback_control *wbc); | ||
| 75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | ||
| 76 | void wakeup_flusher_threads(long nr_pages); | ||
| 82 | 77 | ||
| 83 | /* writeback.h requires fs.h; it, too, is not included from here. */ | 78 | /* writeback.h requires fs.h; it, too, is not included from here. */ |
| 84 | static inline void wait_on_inode(struct inode *inode) | 79 | static inline void wait_on_inode(struct inode *inode) |
| @@ -98,7 +93,6 @@ static inline void inode_sync_wait(struct inode *inode) | |||
| 98 | /* | 93 | /* |
| 99 | * mm/page-writeback.c | 94 | * mm/page-writeback.c |
| 100 | */ | 95 | */ |
| 101 | int wakeup_pdflush(long nr_pages); | ||
| 102 | void laptop_io_completion(void); | 96 | void laptop_io_completion(void); |
| 103 | void laptop_sync_completion(void); | 97 | void laptop_sync_completion(void); |
| 104 | void throttle_vm_writeout(gfp_t gfp_mask); | 98 | void throttle_vm_writeout(gfp_t gfp_mask); |
| @@ -150,17 +144,12 @@ balance_dirty_pages_ratelimited(struct address_space *mapping) | |||
| 150 | typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, | 144 | typedef int (*writepage_t)(struct page *page, struct writeback_control *wbc, |
| 151 | void *data); | 145 | void *data); |
| 152 | 146 | ||
| 153 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | ||
| 154 | int generic_writepages(struct address_space *mapping, | 147 | int generic_writepages(struct address_space *mapping, |
| 155 | struct writeback_control *wbc); | 148 | struct writeback_control *wbc); |
| 156 | int write_cache_pages(struct address_space *mapping, | 149 | int write_cache_pages(struct address_space *mapping, |
| 157 | struct writeback_control *wbc, writepage_t writepage, | 150 | struct writeback_control *wbc, writepage_t writepage, |
| 158 | void *data); | 151 | void *data); |
| 159 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 152 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
| 160 | int sync_page_range(struct inode *inode, struct address_space *mapping, | ||
| 161 | loff_t pos, loff_t count); | ||
| 162 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, | ||
| 163 | loff_t pos, loff_t count); | ||
| 164 | void set_page_dirty_balance(struct page *page, int page_mkwrite); | 153 | void set_page_dirty_balance(struct page *page, int page_mkwrite); |
| 165 | void writeback_set_ratelimit(void); | 154 | void writeback_set_ratelimit(void); |
| 166 | 155 | ||
diff --git a/include/linux/xattr.h b/include/linux/xattr.h index d131e352cfe1..5c84af8c5f6f 100644 --- a/include/linux/xattr.h +++ b/include/linux/xattr.h | |||
| @@ -49,6 +49,7 @@ struct xattr_handler { | |||
| 49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); | 49 | ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); |
| 50 | ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); | 50 | ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); |
| 51 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); | 51 | ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); |
| 52 | int __vfs_setxattr_noperm(struct dentry *, const char *, const void *, size_t, int); | ||
| 52 | int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int); | 53 | int vfs_setxattr(struct dentry *, const char *, const void *, size_t, int); |
| 53 | int vfs_removexattr(struct dentry *, const char *); | 54 | int vfs_removexattr(struct dentry *, const char *); |
| 54 | 55 | ||
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index 11a4a2d3e364..94e908c0d7a0 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
| @@ -60,6 +60,10 @@ enum { | |||
| 60 | V4L2_IDENT_OV7670 = 250, | 60 | V4L2_IDENT_OV7670 = 250, |
| 61 | V4L2_IDENT_OV7720 = 251, | 61 | V4L2_IDENT_OV7720 = 251, |
| 62 | V4L2_IDENT_OV7725 = 252, | 62 | V4L2_IDENT_OV7725 = 252, |
| 63 | V4L2_IDENT_OV7660 = 253, | ||
| 64 | V4L2_IDENT_OV9650 = 254, | ||
| 65 | V4L2_IDENT_OV9655 = 255, | ||
| 66 | V4L2_IDENT_SOI968 = 256, | ||
| 63 | 67 | ||
| 64 | /* module saa7146: reserved range 300-309 */ | 68 | /* module saa7146: reserved range 300-309 */ |
| 65 | V4L2_IDENT_SAA7146 = 300, | 69 | V4L2_IDENT_SAA7146 = 300, |
| @@ -161,6 +165,9 @@ enum { | |||
| 161 | /* module tw9910: just ident 9910 */ | 165 | /* module tw9910: just ident 9910 */ |
| 162 | V4L2_IDENT_TW9910 = 9910, | 166 | V4L2_IDENT_TW9910 = 9910, |
| 163 | 167 | ||
| 168 | /* module sn9c20x: just ident 10000 */ | ||
| 169 | V4L2_IDENT_SN9C20X = 10000, | ||
| 170 | |||
| 164 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 171 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ |
| 165 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only | 172 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only |
| 166 | use internally (tveeprom.c). */ | 173 | use internally (tveeprom.c). */ |
| @@ -237,6 +244,11 @@ enum { | |||
| 237 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ | 244 | V4L2_IDENT_MT9V022IX7ATC = 45010, /* No way to detect "normal" I77ATx */ |
| 238 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ | 245 | V4L2_IDENT_MT9V022IX7ATM = 45015, /* and "lead free" IA7ATx chips */ |
| 239 | V4L2_IDENT_MT9T031 = 45020, | 246 | V4L2_IDENT_MT9T031 = 45020, |
| 247 | V4L2_IDENT_MT9V111 = 45031, | ||
| 248 | V4L2_IDENT_MT9V112 = 45032, | ||
| 249 | |||
| 250 | /* HV7131R CMOS sensor: just ident 46000 */ | ||
| 251 | V4L2_IDENT_HV7131R = 46000, | ||
| 240 | 252 | ||
| 241 | /* module cs53132a: just ident 53132 */ | 253 | /* module cs53132a: just ident 53132 */ |
| 242 | V4L2_IDENT_CS53l32A = 53132, | 254 | V4L2_IDENT_CS53l32A = 53132, |
diff --git a/include/net/act_api.h b/include/net/act_api.h index 565eed8fe496..c05fd717c588 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h | |||
| @@ -16,7 +16,7 @@ struct tcf_common { | |||
| 16 | u32 tcfc_capab; | 16 | u32 tcfc_capab; |
| 17 | int tcfc_action; | 17 | int tcfc_action; |
| 18 | struct tcf_t tcfc_tm; | 18 | struct tcf_t tcfc_tm; |
| 19 | struct gnet_stats_basic tcfc_bstats; | 19 | struct gnet_stats_basic_packed tcfc_bstats; |
| 20 | struct gnet_stats_queue tcfc_qstats; | 20 | struct gnet_stats_queue tcfc_qstats; |
| 21 | struct gnet_stats_rate_est tcfc_rate_est; | 21 | struct gnet_stats_rate_est tcfc_rate_est; |
| 22 | spinlock_t tcfc_lock; | 22 | spinlock_t tcfc_lock; |
diff --git a/include/net/ieee802154/af_ieee802154.h b/include/net/af_ieee802154.h index 0d78605fb1a6..75e64c7a2960 100644 --- a/include/net/ieee802154/af_ieee802154.h +++ b/include/net/af_ieee802154.h | |||
| @@ -54,7 +54,9 @@ struct sockaddr_ieee802154 { | |||
| 54 | struct ieee802154_addr addr; | 54 | struct ieee802154_addr addr; |
| 55 | }; | 55 | }; |
| 56 | 56 | ||
| 57 | /* master device */ | 57 | /* get/setsockopt */ |
| 58 | #define IEEE802154_SIOC_ADD_SLAVE (SIOCDEVPRIVATE + 0) | 58 | #define SOL_IEEE802154 0 |
| 59 | |||
| 60 | #define WPAN_WANTACK 0 | ||
| 59 | 61 | ||
| 60 | #endif | 62 | #endif |
diff --git a/include/net/arp.h b/include/net/arp.h index c236270ec95e..716f43c5c98e 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
| @@ -26,6 +26,6 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |||
| 26 | const unsigned char *target_hw); | 26 | const unsigned char *target_hw); |
| 27 | extern void arp_xmit(struct sk_buff *skb); | 27 | extern void arp_xmit(struct sk_buff *skb); |
| 28 | 28 | ||
| 29 | extern struct neigh_ops arp_broken_ops; | 29 | extern const struct neigh_ops arp_broken_ops; |
| 30 | 30 | ||
| 31 | #endif /* _ARP_H */ | 31 | #endif /* _ARP_H */ |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 968166a45f86..718394e2c01e 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -138,8 +138,11 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
| 138 | struct bt_skb_cb { | 138 | struct bt_skb_cb { |
| 139 | __u8 pkt_type; | 139 | __u8 pkt_type; |
| 140 | __u8 incoming; | 140 | __u8 incoming; |
| 141 | __u8 tx_seq; | ||
| 142 | __u8 retries; | ||
| 143 | __u8 sar; | ||
| 141 | }; | 144 | }; |
| 142 | #define bt_cb(skb) ((struct bt_skb_cb *)(skb->cb)) | 145 | #define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) |
| 143 | 146 | ||
| 144 | static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) | 147 | static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) |
| 145 | { | 148 | { |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index c4ca4228b083..7b640aeddb64 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -117,7 +117,7 @@ struct hci_dev { | |||
| 117 | struct sk_buff *sent_cmd; | 117 | struct sk_buff *sent_cmd; |
| 118 | struct sk_buff *reassembly[3]; | 118 | struct sk_buff *reassembly[3]; |
| 119 | 119 | ||
| 120 | struct semaphore req_lock; | 120 | struct mutex req_lock; |
| 121 | wait_queue_head_t req_wait_q; | 121 | wait_queue_head_t req_wait_q; |
| 122 | __u32 req_status; | 122 | __u32 req_status; |
| 123 | __u32 req_result; | 123 | __u32 req_result; |
| @@ -187,6 +187,7 @@ struct hci_conn { | |||
| 187 | struct work_struct work_del; | 187 | struct work_struct work_del; |
| 188 | 188 | ||
| 189 | struct device dev; | 189 | struct device dev; |
| 190 | atomic_t devref; | ||
| 190 | 191 | ||
| 191 | struct hci_dev *hdev; | 192 | struct hci_dev *hdev; |
| 192 | void *l2cap_data; | 193 | void *l2cap_data; |
| @@ -339,6 +340,9 @@ int hci_conn_switch_role(struct hci_conn *conn, __u8 role); | |||
| 339 | void hci_conn_enter_active_mode(struct hci_conn *conn); | 340 | void hci_conn_enter_active_mode(struct hci_conn *conn); |
| 340 | void hci_conn_enter_sniff_mode(struct hci_conn *conn); | 341 | void hci_conn_enter_sniff_mode(struct hci_conn *conn); |
| 341 | 342 | ||
| 343 | void hci_conn_hold_device(struct hci_conn *conn); | ||
| 344 | void hci_conn_put_device(struct hci_conn *conn); | ||
| 345 | |||
| 342 | static inline void hci_conn_hold(struct hci_conn *conn) | 346 | static inline void hci_conn_hold(struct hci_conn *conn) |
| 343 | { | 347 | { |
| 344 | atomic_inc(&conn->refcnt); | 348 | atomic_inc(&conn->refcnt); |
| @@ -700,8 +704,8 @@ struct hci_sec_filter { | |||
| 700 | #define HCI_REQ_PEND 1 | 704 | #define HCI_REQ_PEND 1 |
| 701 | #define HCI_REQ_CANCELED 2 | 705 | #define HCI_REQ_CANCELED 2 |
| 702 | 706 | ||
| 703 | #define hci_req_lock(d) down(&d->req_lock) | 707 | #define hci_req_lock(d) mutex_lock(&d->req_lock) |
| 704 | #define hci_req_unlock(d) up(&d->req_lock) | 708 | #define hci_req_unlock(d) mutex_unlock(&d->req_lock) |
| 705 | 709 | ||
| 706 | void hci_req_complete(struct hci_dev *hdev, int result); | 710 | void hci_req_complete(struct hci_dev *hdev, int result); |
| 707 | 711 | ||
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index e919fca1072a..9516f4b4a3c2 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -27,12 +27,14 @@ | |||
| 27 | 27 | ||
| 28 | /* L2CAP defaults */ | 28 | /* L2CAP defaults */ |
| 29 | #define L2CAP_DEFAULT_MTU 672 | 29 | #define L2CAP_DEFAULT_MTU 672 |
| 30 | #define L2CAP_DEFAULT_MIN_MTU 48 | ||
| 30 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 31 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff |
| 31 | #define L2CAP_DEFAULT_RX_WINDOW 1 | 32 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
| 32 | #define L2CAP_DEFAULT_MAX_RECEIVE 1 | 33 | #define L2CAP_DEFAULT_NUM_TO_ACK (L2CAP_DEFAULT_TX_WINDOW/5) |
| 33 | #define L2CAP_DEFAULT_RETRANS_TO 300 /* 300 milliseconds */ | 34 | #define L2CAP_DEFAULT_MAX_TX 3 |
| 34 | #define L2CAP_DEFAULT_MONITOR_TO 1000 /* 1 second */ | 35 | #define L2CAP_DEFAULT_RETRANS_TO 1000 /* 1 second */ |
| 35 | #define L2CAP_DEFAULT_MAX_RX_APDU 0xfff7 | 36 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
| 37 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 672 | ||
| 36 | 38 | ||
| 37 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ | 39 | #define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ |
| 38 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ | 40 | #define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ |
| @@ -52,6 +54,7 @@ struct l2cap_options { | |||
| 52 | __u16 imtu; | 54 | __u16 imtu; |
| 53 | __u16 flush_to; | 55 | __u16 flush_to; |
| 54 | __u8 mode; | 56 | __u8 mode; |
| 57 | __u8 fcs; | ||
| 55 | }; | 58 | }; |
| 56 | 59 | ||
| 57 | #define L2CAP_CONNINFO 0x02 | 60 | #define L2CAP_CONNINFO 0x02 |
| @@ -93,6 +96,32 @@ struct l2cap_conninfo { | |||
| 93 | #define L2CAP_FCS_NONE 0x00 | 96 | #define L2CAP_FCS_NONE 0x00 |
| 94 | #define L2CAP_FCS_CRC16 0x01 | 97 | #define L2CAP_FCS_CRC16 0x01 |
| 95 | 98 | ||
| 99 | /* L2CAP Control Field bit masks */ | ||
| 100 | #define L2CAP_CTRL_SAR 0xC000 | ||
| 101 | #define L2CAP_CTRL_REQSEQ 0x3F00 | ||
| 102 | #define L2CAP_CTRL_TXSEQ 0x007E | ||
| 103 | #define L2CAP_CTRL_RETRANS 0x0080 | ||
| 104 | #define L2CAP_CTRL_FINAL 0x0080 | ||
| 105 | #define L2CAP_CTRL_POLL 0x0010 | ||
| 106 | #define L2CAP_CTRL_SUPERVISE 0x000C | ||
| 107 | #define L2CAP_CTRL_FRAME_TYPE 0x0001 /* I- or S-Frame */ | ||
| 108 | |||
| 109 | #define L2CAP_CTRL_TXSEQ_SHIFT 1 | ||
| 110 | #define L2CAP_CTRL_REQSEQ_SHIFT 8 | ||
| 111 | #define L2CAP_CTRL_SAR_SHIFT 14 | ||
| 112 | |||
| 113 | /* L2CAP Supervisory Function */ | ||
| 114 | #define L2CAP_SUPER_RCV_READY 0x0000 | ||
| 115 | #define L2CAP_SUPER_REJECT 0x0004 | ||
| 116 | #define L2CAP_SUPER_RCV_NOT_READY 0x0008 | ||
| 117 | #define L2CAP_SUPER_SELECT_REJECT 0x000C | ||
| 118 | |||
| 119 | /* L2CAP Segmentation and Reassembly */ | ||
| 120 | #define L2CAP_SDU_UNSEGMENTED 0x0000 | ||
| 121 | #define L2CAP_SDU_START 0x4000 | ||
| 122 | #define L2CAP_SDU_END 0x8000 | ||
| 123 | #define L2CAP_SDU_CONTINUE 0xC000 | ||
| 124 | |||
| 96 | /* L2CAP structures */ | 125 | /* L2CAP structures */ |
| 97 | struct l2cap_hdr { | 126 | struct l2cap_hdr { |
| 98 | __le16 len; | 127 | __le16 len; |
| @@ -190,7 +219,7 @@ struct l2cap_conf_rfc { | |||
| 190 | #define L2CAP_MODE_RETRANS 0x01 | 219 | #define L2CAP_MODE_RETRANS 0x01 |
| 191 | #define L2CAP_MODE_FLOWCTL 0x02 | 220 | #define L2CAP_MODE_FLOWCTL 0x02 |
| 192 | #define L2CAP_MODE_ERTM 0x03 | 221 | #define L2CAP_MODE_ERTM 0x03 |
| 193 | #define L2CAP_MODE_STREAM 0x04 | 222 | #define L2CAP_MODE_STREAMING 0x04 |
| 194 | 223 | ||
| 195 | struct l2cap_disconn_req { | 224 | struct l2cap_disconn_req { |
| 196 | __le16 dcid; | 225 | __le16 dcid; |
| @@ -261,6 +290,14 @@ struct l2cap_conn { | |||
| 261 | 290 | ||
| 262 | /* ----- L2CAP channel and socket info ----- */ | 291 | /* ----- L2CAP channel and socket info ----- */ |
| 263 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 292 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
| 293 | #define TX_QUEUE(sk) (&l2cap_pi(sk)->tx_queue) | ||
| 294 | #define SREJ_QUEUE(sk) (&l2cap_pi(sk)->srej_queue) | ||
| 295 | #define SREJ_LIST(sk) (&l2cap_pi(sk)->srej_l.list) | ||
| 296 | |||
| 297 | struct srej_list { | ||
| 298 | __u8 tx_seq; | ||
| 299 | struct list_head list; | ||
| 300 | }; | ||
| 264 | 301 | ||
| 265 | struct l2cap_pinfo { | 302 | struct l2cap_pinfo { |
| 266 | struct bt_sock bt; | 303 | struct bt_sock bt; |
| @@ -271,30 +308,97 @@ struct l2cap_pinfo { | |||
| 271 | __u16 imtu; | 308 | __u16 imtu; |
| 272 | __u16 omtu; | 309 | __u16 omtu; |
| 273 | __u16 flush_to; | 310 | __u16 flush_to; |
| 274 | __u8 sec_level; | 311 | __u8 mode; |
| 312 | __u8 num_conf_req; | ||
| 313 | __u8 num_conf_rsp; | ||
| 314 | |||
| 315 | __u8 fcs; | ||
| 316 | __u8 sec_level; | ||
| 275 | __u8 role_switch; | 317 | __u8 role_switch; |
| 276 | __u8 force_reliable; | 318 | __u8 force_reliable; |
| 277 | 319 | ||
| 278 | __u8 conf_req[64]; | 320 | __u8 conf_req[64]; |
| 279 | __u8 conf_len; | 321 | __u8 conf_len; |
| 280 | __u8 conf_state; | 322 | __u8 conf_state; |
| 281 | __u8 conf_retry; | 323 | __u8 conn_state; |
| 324 | |||
| 325 | __u8 next_tx_seq; | ||
| 326 | __u8 expected_ack_seq; | ||
| 327 | __u8 req_seq; | ||
| 328 | __u8 expected_tx_seq; | ||
| 329 | __u8 buffer_seq; | ||
| 330 | __u8 buffer_seq_srej; | ||
| 331 | __u8 srej_save_reqseq; | ||
| 332 | __u8 unacked_frames; | ||
| 333 | __u8 retry_count; | ||
| 334 | __u8 num_to_ack; | ||
| 335 | __u16 sdu_len; | ||
| 336 | __u16 partial_sdu_len; | ||
| 337 | struct sk_buff *sdu; | ||
| 282 | 338 | ||
| 283 | __u8 ident; | 339 | __u8 ident; |
| 284 | 340 | ||
| 341 | __u8 remote_tx_win; | ||
| 342 | __u8 remote_max_tx; | ||
| 343 | __u16 retrans_timeout; | ||
| 344 | __u16 monitor_timeout; | ||
| 345 | __u16 max_pdu_size; | ||
| 346 | |||
| 285 | __le16 sport; | 347 | __le16 sport; |
| 286 | 348 | ||
| 349 | struct timer_list retrans_timer; | ||
| 350 | struct timer_list monitor_timer; | ||
| 351 | struct sk_buff_head tx_queue; | ||
| 352 | struct sk_buff_head srej_queue; | ||
| 353 | struct srej_list srej_l; | ||
| 287 | struct l2cap_conn *conn; | 354 | struct l2cap_conn *conn; |
| 288 | struct sock *next_c; | 355 | struct sock *next_c; |
| 289 | struct sock *prev_c; | 356 | struct sock *prev_c; |
| 290 | }; | 357 | }; |
| 291 | 358 | ||
| 292 | #define L2CAP_CONF_REQ_SENT 0x01 | 359 | #define L2CAP_CONF_REQ_SENT 0x01 |
| 293 | #define L2CAP_CONF_INPUT_DONE 0x02 | 360 | #define L2CAP_CONF_INPUT_DONE 0x02 |
| 294 | #define L2CAP_CONF_OUTPUT_DONE 0x04 | 361 | #define L2CAP_CONF_OUTPUT_DONE 0x04 |
| 295 | #define L2CAP_CONF_CONNECT_PEND 0x80 | 362 | #define L2CAP_CONF_MTU_DONE 0x08 |
| 296 | 363 | #define L2CAP_CONF_MODE_DONE 0x10 | |
| 297 | #define L2CAP_CONF_MAX_RETRIES 2 | 364 | #define L2CAP_CONF_CONNECT_PEND 0x20 |
| 365 | #define L2CAP_CONF_NO_FCS_RECV 0x40 | ||
| 366 | #define L2CAP_CONF_STATE2_DEVICE 0x80 | ||
| 367 | |||
| 368 | #define L2CAP_CONF_MAX_CONF_REQ 2 | ||
| 369 | #define L2CAP_CONF_MAX_CONF_RSP 2 | ||
| 370 | |||
| 371 | #define L2CAP_CONN_SAR_SDU 0x01 | ||
| 372 | #define L2CAP_CONN_SREJ_SENT 0x02 | ||
| 373 | #define L2CAP_CONN_WAIT_F 0x04 | ||
| 374 | #define L2CAP_CONN_SREJ_ACT 0x08 | ||
| 375 | #define L2CAP_CONN_SEND_PBIT 0x10 | ||
| 376 | #define L2CAP_CONN_REMOTE_BUSY 0x20 | ||
| 377 | #define L2CAP_CONN_LOCAL_BUSY 0x40 | ||
| 378 | |||
| 379 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | ||
| 380 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | ||
| 381 | #define __mod_monitor_timer() mod_timer(&l2cap_pi(sk)->monitor_timer, \ | ||
| 382 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | ||
| 383 | |||
| 384 | static inline int l2cap_tx_window_full(struct sock *sk) | ||
| 385 | { | ||
| 386 | struct l2cap_pinfo *pi = l2cap_pi(sk); | ||
| 387 | int sub; | ||
| 388 | |||
| 389 | sub = (pi->next_tx_seq - pi->expected_ack_seq) % 64; | ||
| 390 | |||
| 391 | if (sub < 0) | ||
| 392 | sub += 64; | ||
| 393 | |||
| 394 | return (sub == pi->remote_tx_win); | ||
| 395 | } | ||
| 396 | |||
| 397 | #define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 | ||
| 398 | #define __get_reqseq(ctrl) ((ctrl) & L2CAP_CTRL_REQSEQ) >> 8 | ||
| 399 | #define __is_iframe(ctrl) !((ctrl) & L2CAP_CTRL_FRAME_TYPE) | ||
| 400 | #define __is_sframe(ctrl) (ctrl) & L2CAP_CTRL_FRAME_TYPE | ||
| 401 | #define __is_sar_start(ctrl) ((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START | ||
| 298 | 402 | ||
| 299 | void l2cap_load(void); | 403 | void l2cap_load(void); |
| 300 | 404 | ||
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 80072611d26a..921d7b3c7f8d 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #define RFCOMM_CONN_TIMEOUT (HZ * 30) | 29 | #define RFCOMM_CONN_TIMEOUT (HZ * 30) |
| 30 | #define RFCOMM_DISC_TIMEOUT (HZ * 20) | 30 | #define RFCOMM_DISC_TIMEOUT (HZ * 20) |
| 31 | #define RFCOMM_AUTH_TIMEOUT (HZ * 25) | 31 | #define RFCOMM_AUTH_TIMEOUT (HZ * 25) |
| 32 | #define RFCOMM_IDLE_TIMEOUT (HZ * 2) | ||
| 32 | 33 | ||
| 33 | #define RFCOMM_DEFAULT_MTU 127 | 34 | #define RFCOMM_DEFAULT_MTU 127 |
| 34 | #define RFCOMM_DEFAULT_CREDITS 7 | 35 | #define RFCOMM_DEFAULT_CREDITS 7 |
| @@ -154,6 +155,7 @@ struct rfcomm_msc { | |||
| 154 | struct rfcomm_session { | 155 | struct rfcomm_session { |
| 155 | struct list_head list; | 156 | struct list_head list; |
| 156 | struct socket *sock; | 157 | struct socket *sock; |
| 158 | struct timer_list timer; | ||
| 157 | unsigned long state; | 159 | unsigned long state; |
| 158 | unsigned long flags; | 160 | unsigned long flags; |
| 159 | atomic_t refcnt; | 161 | atomic_t refcnt; |
| @@ -355,7 +357,17 @@ struct rfcomm_dev_list_req { | |||
| 355 | }; | 357 | }; |
| 356 | 358 | ||
| 357 | int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); | 359 | int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); |
| 360 | |||
| 361 | #ifdef CONFIG_BT_RFCOMM_TTY | ||
| 358 | int rfcomm_init_ttys(void); | 362 | int rfcomm_init_ttys(void); |
| 359 | void rfcomm_cleanup_ttys(void); | 363 | void rfcomm_cleanup_ttys(void); |
| 360 | 364 | #else | |
| 365 | static inline int rfcomm_init_ttys(void) | ||
| 366 | { | ||
| 367 | return 0; | ||
| 368 | } | ||
| 369 | static inline void rfcomm_cleanup_ttys(void) | ||
| 370 | { | ||
| 371 | } | ||
| 372 | #endif | ||
| 361 | #endif /* __RFCOMM_H */ | 373 | #endif /* __RFCOMM_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1a21895b732b..3d874c620219 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -80,7 +80,6 @@ enum ieee80211_channel_flags { | |||
| 80 | * with cfg80211. | 80 | * with cfg80211. |
| 81 | * | 81 | * |
| 82 | * @center_freq: center frequency in MHz | 82 | * @center_freq: center frequency in MHz |
| 83 | * @max_bandwidth: maximum allowed bandwidth for this channel, in MHz | ||
| 84 | * @hw_value: hardware-specific value for the channel | 83 | * @hw_value: hardware-specific value for the channel |
| 85 | * @flags: channel flags from &enum ieee80211_channel_flags. | 84 | * @flags: channel flags from &enum ieee80211_channel_flags. |
| 86 | * @orig_flags: channel flags at registration time, used by regulatory | 85 | * @orig_flags: channel flags at registration time, used by regulatory |
| @@ -97,7 +96,6 @@ enum ieee80211_channel_flags { | |||
| 97 | struct ieee80211_channel { | 96 | struct ieee80211_channel { |
| 98 | enum ieee80211_band band; | 97 | enum ieee80211_band band; |
| 99 | u16 center_freq; | 98 | u16 center_freq; |
| 100 | u8 max_bandwidth; | ||
| 101 | u16 hw_value; | 99 | u16 hw_value; |
| 102 | u32 flags; | 100 | u32 flags; |
| 103 | int max_antenna_gain; | 101 | int max_antenna_gain; |
| @@ -372,6 +370,10 @@ struct rate_info { | |||
| 372 | * @txrate: current unicast bitrate to this station | 370 | * @txrate: current unicast bitrate to this station |
| 373 | * @rx_packets: packets received from this station | 371 | * @rx_packets: packets received from this station |
| 374 | * @tx_packets: packets transmitted to this station | 372 | * @tx_packets: packets transmitted to this station |
| 373 | * @generation: generation number for nl80211 dumps. | ||
| 374 | * This number should increase every time the list of stations | ||
| 375 | * changes, i.e. when a station is added or removed, so that | ||
| 376 | * userspace can tell whether it got a consistent snapshot. | ||
| 375 | */ | 377 | */ |
| 376 | struct station_info { | 378 | struct station_info { |
| 377 | u32 filled; | 379 | u32 filled; |
| @@ -385,6 +387,8 @@ struct station_info { | |||
| 385 | struct rate_info txrate; | 387 | struct rate_info txrate; |
| 386 | u32 rx_packets; | 388 | u32 rx_packets; |
| 387 | u32 tx_packets; | 389 | u32 tx_packets; |
| 390 | |||
| 391 | int generation; | ||
| 388 | }; | 392 | }; |
| 389 | 393 | ||
| 390 | /** | 394 | /** |
| @@ -444,6 +448,10 @@ enum mpath_info_flags { | |||
| 444 | * @flags: mesh path flags | 448 | * @flags: mesh path flags |
| 445 | * @discovery_timeout: total mesh path discovery timeout, in msecs | 449 | * @discovery_timeout: total mesh path discovery timeout, in msecs |
| 446 | * @discovery_retries: mesh path discovery retries | 450 | * @discovery_retries: mesh path discovery retries |
| 451 | * @generation: generation number for nl80211 dumps. | ||
| 452 | * This number should increase every time the list of mesh paths | ||
| 453 | * changes, i.e. when a station is added or removed, so that | ||
| 454 | * userspace can tell whether it got a consistent snapshot. | ||
| 447 | */ | 455 | */ |
| 448 | struct mpath_info { | 456 | struct mpath_info { |
| 449 | u32 filled; | 457 | u32 filled; |
| @@ -454,6 +462,8 @@ struct mpath_info { | |||
| 454 | u32 discovery_timeout; | 462 | u32 discovery_timeout; |
| 455 | u8 discovery_retries; | 463 | u8 discovery_retries; |
| 456 | u8 flags; | 464 | u8 flags; |
| 465 | |||
| 466 | int generation; | ||
| 457 | }; | 467 | }; |
| 458 | 468 | ||
| 459 | /** | 469 | /** |
| @@ -538,23 +548,26 @@ struct cfg80211_ssid { | |||
| 538 | * @ssids: SSIDs to scan for (active scan only) | 548 | * @ssids: SSIDs to scan for (active scan only) |
| 539 | * @n_ssids: number of SSIDs | 549 | * @n_ssids: number of SSIDs |
| 540 | * @channels: channels to scan on. | 550 | * @channels: channels to scan on. |
| 541 | * @n_channels: number of channels for each band | 551 | * @n_channels: total number of channels to scan |
| 542 | * @ie: optional information element(s) to add into Probe Request or %NULL | 552 | * @ie: optional information element(s) to add into Probe Request or %NULL |
| 543 | * @ie_len: length of ie in octets | 553 | * @ie_len: length of ie in octets |
| 544 | * @wiphy: the wiphy this was for | 554 | * @wiphy: the wiphy this was for |
| 545 | * @ifidx: the interface index | 555 | * @dev: the interface |
| 546 | */ | 556 | */ |
| 547 | struct cfg80211_scan_request { | 557 | struct cfg80211_scan_request { |
| 548 | struct cfg80211_ssid *ssids; | 558 | struct cfg80211_ssid *ssids; |
| 549 | int n_ssids; | 559 | int n_ssids; |
| 550 | struct ieee80211_channel **channels; | ||
| 551 | u32 n_channels; | 560 | u32 n_channels; |
| 552 | const u8 *ie; | 561 | const u8 *ie; |
| 553 | size_t ie_len; | 562 | size_t ie_len; |
| 554 | 563 | ||
| 555 | /* internal */ | 564 | /* internal */ |
| 556 | struct wiphy *wiphy; | 565 | struct wiphy *wiphy; |
| 557 | int ifidx; | 566 | struct net_device *dev; |
| 567 | bool aborted; | ||
| 568 | |||
| 569 | /* keep last */ | ||
| 570 | struct ieee80211_channel *channels[0]; | ||
| 558 | }; | 571 | }; |
| 559 | 572 | ||
| 560 | /** | 573 | /** |
| @@ -584,7 +597,6 @@ enum cfg80211_signal_type { | |||
| 584 | * is no guarantee that these are well-formed!) | 597 | * is no guarantee that these are well-formed!) |
| 585 | * @len_information_elements: total length of the information elements | 598 | * @len_information_elements: total length of the information elements |
| 586 | * @signal: signal strength value (type depends on the wiphy's signal_type) | 599 | * @signal: signal strength value (type depends on the wiphy's signal_type) |
| 587 | * @hold: BSS should not expire | ||
| 588 | * @free_priv: function pointer to free private data | 600 | * @free_priv: function pointer to free private data |
| 589 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes | 601 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes |
| 590 | */ | 602 | */ |
| @@ -605,37 +617,59 @@ struct cfg80211_bss { | |||
| 605 | }; | 617 | }; |
| 606 | 618 | ||
| 607 | /** | 619 | /** |
| 620 | * ieee80211_bss_get_ie - find IE with given ID | ||
| 621 | * @bss: the bss to search | ||
| 622 | * @ie: the IE ID | ||
| 623 | * Returns %NULL if not found. | ||
| 624 | */ | ||
| 625 | const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | ||
| 626 | |||
| 627 | |||
| 628 | /** | ||
| 629 | * struct cfg80211_crypto_settings - Crypto settings | ||
| 630 | * @wpa_versions: indicates which, if any, WPA versions are enabled | ||
| 631 | * (from enum nl80211_wpa_versions) | ||
| 632 | * @cipher_group: group key cipher suite (or 0 if unset) | ||
| 633 | * @n_ciphers_pairwise: number of AP supported unicast ciphers | ||
| 634 | * @ciphers_pairwise: unicast key cipher suites | ||
| 635 | * @n_akm_suites: number of AKM suites | ||
| 636 | * @akm_suites: AKM suites | ||
| 637 | * @control_port: Whether user space controls IEEE 802.1X port, i.e., | ||
| 638 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is | ||
| 639 | * required to assume that the port is unauthorized until authorized by | ||
| 640 | * user space. Otherwise, port is marked authorized by default. | ||
| 641 | */ | ||
| 642 | struct cfg80211_crypto_settings { | ||
| 643 | u32 wpa_versions; | ||
| 644 | u32 cipher_group; | ||
| 645 | int n_ciphers_pairwise; | ||
| 646 | u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES]; | ||
| 647 | int n_akm_suites; | ||
| 648 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; | ||
| 649 | bool control_port; | ||
| 650 | }; | ||
| 651 | |||
| 652 | /** | ||
| 608 | * struct cfg80211_auth_request - Authentication request data | 653 | * struct cfg80211_auth_request - Authentication request data |
| 609 | * | 654 | * |
| 610 | * This structure provides information needed to complete IEEE 802.11 | 655 | * This structure provides information needed to complete IEEE 802.11 |
| 611 | * authentication. | 656 | * authentication. |
| 612 | * NOTE: This structure will likely change when more code from mac80211 is | 657 | * |
| 613 | * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. | 658 | * @bss: The BSS to authenticate with. |
| 614 | * Before using this in a driver that does not use mac80211, it would be better | ||
| 615 | * to check the status of that work and better yet, volunteer to work on it. | ||
| 616 | * | ||
| 617 | * @chan: The channel to use or %NULL if not specified (auto-select based on | ||
| 618 | * scan results) | ||
| 619 | * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case); | ||
| 620 | * this field is required to be present; if the driver wants to help with | ||
| 621 | * BSS selection, it should use (yet to be added) MLME event to allow user | ||
| 622 | * space SME to be notified of roaming candidate, so that the SME can then | ||
| 623 | * use the authentication request with the recommended BSSID and whatever | ||
| 624 | * other data may be needed for authentication/association | ||
| 625 | * @ssid: SSID or %NULL if not yet available | ||
| 626 | * @ssid_len: Length of ssid in octets | ||
| 627 | * @auth_type: Authentication type (algorithm) | 659 | * @auth_type: Authentication type (algorithm) |
| 628 | * @ie: Extra IEs to add to Authentication frame or %NULL | 660 | * @ie: Extra IEs to add to Authentication frame or %NULL |
| 629 | * @ie_len: Length of ie buffer in octets | 661 | * @ie_len: Length of ie buffer in octets |
| 662 | * @key_len: length of WEP key for shared key authentication | ||
| 663 | * @key_idx: index of WEP key for shared key authentication | ||
| 664 | * @key: WEP key for shared key authentication | ||
| 630 | */ | 665 | */ |
| 631 | struct cfg80211_auth_request { | 666 | struct cfg80211_auth_request { |
| 632 | struct ieee80211_channel *chan; | 667 | struct cfg80211_bss *bss; |
| 633 | u8 *peer_addr; | ||
| 634 | const u8 *ssid; | ||
| 635 | size_t ssid_len; | ||
| 636 | enum nl80211_auth_type auth_type; | ||
| 637 | const u8 *ie; | 668 | const u8 *ie; |
| 638 | size_t ie_len; | 669 | size_t ie_len; |
| 670 | enum nl80211_auth_type auth_type; | ||
| 671 | const u8 *key; | ||
| 672 | u8 key_len, key_idx; | ||
| 639 | }; | 673 | }; |
| 640 | 674 | ||
| 641 | /** | 675 | /** |
| @@ -643,35 +677,19 @@ struct cfg80211_auth_request { | |||
| 643 | * | 677 | * |
| 644 | * This structure provides information needed to complete IEEE 802.11 | 678 | * This structure provides information needed to complete IEEE 802.11 |
| 645 | * (re)association. | 679 | * (re)association. |
| 646 | * NOTE: This structure will likely change when more code from mac80211 is | 680 | * @bss: The BSS to associate with. |
| 647 | * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. | ||
| 648 | * Before using this in a driver that does not use mac80211, it would be better | ||
| 649 | * to check the status of that work and better yet, volunteer to work on it. | ||
| 650 | * | ||
| 651 | * @chan: The channel to use or %NULL if not specified (auto-select based on | ||
| 652 | * scan results) | ||
| 653 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required | ||
| 654 | * to be present and the STA must be in State 2 (authenticated) with the | ||
| 655 | * peer STA | ||
| 656 | * @ssid: SSID | ||
| 657 | * @ssid_len: Length of ssid in octets | ||
| 658 | * @ie: Extra IEs to add to (Re)Association Request frame or %NULL | 681 | * @ie: Extra IEs to add to (Re)Association Request frame or %NULL |
| 659 | * @ie_len: Length of ie buffer in octets | 682 | * @ie_len: Length of ie buffer in octets |
| 660 | * @use_mfp: Use management frame protection (IEEE 802.11w) in this association | 683 | * @use_mfp: Use management frame protection (IEEE 802.11w) in this association |
| 661 | * @control_port: Whether user space controls IEEE 802.1X port, i.e., | 684 | * @crypto: crypto settings |
| 662 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is | 685 | * @prev_bssid: previous BSSID, if not %NULL use reassociate frame |
| 663 | * required to assume that the port is unauthorized until authorized by | ||
| 664 | * user space. Otherwise, port is marked authorized by default. | ||
| 665 | */ | 686 | */ |
| 666 | struct cfg80211_assoc_request { | 687 | struct cfg80211_assoc_request { |
| 667 | struct ieee80211_channel *chan; | 688 | struct cfg80211_bss *bss; |
| 668 | u8 *peer_addr; | 689 | const u8 *ie, *prev_bssid; |
| 669 | const u8 *ssid; | ||
| 670 | size_t ssid_len; | ||
| 671 | const u8 *ie; | ||
| 672 | size_t ie_len; | 690 | size_t ie_len; |
| 691 | struct cfg80211_crypto_settings crypto; | ||
| 673 | bool use_mfp; | 692 | bool use_mfp; |
| 674 | bool control_port; | ||
| 675 | }; | 693 | }; |
| 676 | 694 | ||
| 677 | /** | 695 | /** |
| @@ -680,16 +698,16 @@ struct cfg80211_assoc_request { | |||
| 680 | * This structure provides information needed to complete IEEE 802.11 | 698 | * This structure provides information needed to complete IEEE 802.11 |
| 681 | * deauthentication. | 699 | * deauthentication. |
| 682 | * | 700 | * |
| 683 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required | 701 | * @bss: the BSS to deauthenticate from |
| 684 | * to be present and the STA must be authenticated with the peer STA | ||
| 685 | * @ie: Extra IEs to add to Deauthentication frame or %NULL | 702 | * @ie: Extra IEs to add to Deauthentication frame or %NULL |
| 686 | * @ie_len: Length of ie buffer in octets | 703 | * @ie_len: Length of ie buffer in octets |
| 704 | * @reason_code: The reason code for the deauthentication | ||
| 687 | */ | 705 | */ |
| 688 | struct cfg80211_deauth_request { | 706 | struct cfg80211_deauth_request { |
| 689 | u8 *peer_addr; | 707 | struct cfg80211_bss *bss; |
| 690 | u16 reason_code; | ||
| 691 | const u8 *ie; | 708 | const u8 *ie; |
| 692 | size_t ie_len; | 709 | size_t ie_len; |
| 710 | u16 reason_code; | ||
| 693 | }; | 711 | }; |
| 694 | 712 | ||
| 695 | /** | 713 | /** |
| @@ -698,16 +716,16 @@ struct cfg80211_deauth_request { | |||
| 698 | * This structure provides information needed to complete IEEE 802.11 | 716 | * This structure provides information needed to complete IEEE 802.11 |
| 699 | * disassocation. | 717 | * disassocation. |
| 700 | * | 718 | * |
| 701 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required | 719 | * @bss: the BSS to disassociate from |
| 702 | * to be present and the STA must be associated with the peer STA | ||
| 703 | * @ie: Extra IEs to add to Disassociation frame or %NULL | 720 | * @ie: Extra IEs to add to Disassociation frame or %NULL |
| 704 | * @ie_len: Length of ie buffer in octets | 721 | * @ie_len: Length of ie buffer in octets |
| 722 | * @reason_code: The reason code for the disassociation | ||
| 705 | */ | 723 | */ |
| 706 | struct cfg80211_disassoc_request { | 724 | struct cfg80211_disassoc_request { |
| 707 | u8 *peer_addr; | 725 | struct cfg80211_bss *bss; |
| 708 | u16 reason_code; | ||
| 709 | const u8 *ie; | 726 | const u8 *ie; |
| 710 | size_t ie_len; | 727 | size_t ie_len; |
| 728 | u16 reason_code; | ||
| 711 | }; | 729 | }; |
| 712 | 730 | ||
| 713 | /** | 731 | /** |
| @@ -726,6 +744,8 @@ struct cfg80211_disassoc_request { | |||
| 726 | * @ie: information element(s) to include in the beacon | 744 | * @ie: information element(s) to include in the beacon |
| 727 | * @ie_len: length of that | 745 | * @ie_len: length of that |
| 728 | * @beacon_interval: beacon interval to use | 746 | * @beacon_interval: beacon interval to use |
| 747 | * @privacy: this is a protected network, keys will be configured | ||
| 748 | * after joining | ||
| 729 | */ | 749 | */ |
| 730 | struct cfg80211_ibss_params { | 750 | struct cfg80211_ibss_params { |
| 731 | u8 *ssid; | 751 | u8 *ssid; |
| @@ -735,6 +755,42 @@ struct cfg80211_ibss_params { | |||
| 735 | u8 ssid_len, ie_len; | 755 | u8 ssid_len, ie_len; |
| 736 | u16 beacon_interval; | 756 | u16 beacon_interval; |
| 737 | bool channel_fixed; | 757 | bool channel_fixed; |
| 758 | bool privacy; | ||
| 759 | }; | ||
| 760 | |||
| 761 | /** | ||
| 762 | * struct cfg80211_connect_params - Connection parameters | ||
| 763 | * | ||
| 764 | * This structure provides information needed to complete IEEE 802.11 | ||
| 765 | * authentication and association. | ||
| 766 | * | ||
| 767 | * @channel: The channel to use or %NULL if not specified (auto-select based | ||
| 768 | * on scan results) | ||
| 769 | * @bssid: The AP BSSID or %NULL if not specified (auto-select based on scan | ||
| 770 | * results) | ||
| 771 | * @ssid: SSID | ||
| 772 | * @ssid_len: Length of ssid in octets | ||
| 773 | * @auth_type: Authentication type (algorithm) | ||
| 774 | * @assoc_ie: IEs for association request | ||
| 775 | * @assoc_ie_len: Length of assoc_ie in octets | ||
| 776 | * @privacy: indicates whether privacy-enabled APs should be used | ||
| 777 | * @crypto: crypto settings | ||
| 778 | * @key_len: length of WEP key for shared key authentication | ||
| 779 | * @key_idx: index of WEP key for shared key authentication | ||
| 780 | * @key: WEP key for shared key authentication | ||
| 781 | */ | ||
| 782 | struct cfg80211_connect_params { | ||
| 783 | struct ieee80211_channel *channel; | ||
| 784 | u8 *bssid; | ||
| 785 | u8 *ssid; | ||
| 786 | size_t ssid_len; | ||
| 787 | enum nl80211_auth_type auth_type; | ||
| 788 | u8 *ie; | ||
| 789 | size_t ie_len; | ||
| 790 | bool privacy; | ||
| 791 | struct cfg80211_crypto_settings crypto; | ||
| 792 | const u8 *key; | ||
| 793 | u8 key_len, key_idx; | ||
| 738 | }; | 794 | }; |
| 739 | 795 | ||
| 740 | /** | 796 | /** |
| @@ -764,6 +820,26 @@ enum tx_power_setting { | |||
| 764 | TX_POWER_FIXED, | 820 | TX_POWER_FIXED, |
| 765 | }; | 821 | }; |
| 766 | 822 | ||
| 823 | /* | ||
| 824 | * cfg80211_bitrate_mask - masks for bitrate control | ||
| 825 | */ | ||
| 826 | struct cfg80211_bitrate_mask { | ||
| 827 | /* | ||
| 828 | * As discussed in Berlin, this struct really | ||
| 829 | * should look like this: | ||
| 830 | |||
| 831 | struct { | ||
| 832 | u32 legacy; | ||
| 833 | u8 mcs[IEEE80211_HT_MCS_MASK_LEN]; | ||
| 834 | } control[IEEE80211_NUM_BANDS]; | ||
| 835 | |||
| 836 | * Since we can always fix in-kernel users, let's keep | ||
| 837 | * it simpler for now: | ||
| 838 | */ | ||
| 839 | u32 fixed; /* fixed bitrate, 0 == not fixed */ | ||
| 840 | u32 maxrate; /* in kbps, 0 == no limit */ | ||
| 841 | }; | ||
| 842 | |||
| 767 | /** | 843 | /** |
| 768 | * struct cfg80211_ops - backend description for wireless configuration | 844 | * struct cfg80211_ops - backend description for wireless configuration |
| 769 | * | 845 | * |
| @@ -781,7 +857,8 @@ enum tx_power_setting { | |||
| 781 | * @resume: wiphy device needs to be resumed | 857 | * @resume: wiphy device needs to be resumed |
| 782 | * | 858 | * |
| 783 | * @add_virtual_intf: create a new virtual interface with the given name, | 859 | * @add_virtual_intf: create a new virtual interface with the given name, |
| 784 | * must set the struct wireless_dev's iftype. | 860 | * must set the struct wireless_dev's iftype. Beware: You must create |
| 861 | * the new netdev in the wiphy's network namespace! | ||
| 785 | * | 862 | * |
| 786 | * @del_virtual_intf: remove the virtual interface determined by ifindex. | 863 | * @del_virtual_intf: remove the virtual interface determined by ifindex. |
| 787 | * | 864 | * |
| @@ -841,6 +918,12 @@ enum tx_power_setting { | |||
| 841 | * @deauth: Request to deauthenticate from the specified peer | 918 | * @deauth: Request to deauthenticate from the specified peer |
| 842 | * @disassoc: Request to disassociate from the specified peer | 919 | * @disassoc: Request to disassociate from the specified peer |
| 843 | * | 920 | * |
| 921 | * @connect: Connect to the ESS with the specified parameters. When connected, | ||
| 922 | * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS. | ||
| 923 | * If the connection fails for some reason, call cfg80211_connect_result() | ||
| 924 | * with the status from the AP. | ||
| 925 | * @disconnect: Disconnect from the BSS/ESS. | ||
| 926 | * | ||
| 844 | * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call | 927 | * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call |
| 845 | * cfg80211_ibss_joined(), also call that function when changing BSSID due | 928 | * cfg80211_ibss_joined(), also call that function when changing BSSID due |
| 846 | * to a merge. | 929 | * to a merge. |
| @@ -857,6 +940,8 @@ enum tx_power_setting { | |||
| 857 | * | 940 | * |
| 858 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting | 941 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting |
| 859 | * functions to adjust rfkill hw state | 942 | * functions to adjust rfkill hw state |
| 943 | * | ||
| 944 | * @testmode_cmd: run a test mode command | ||
| 860 | */ | 945 | */ |
| 861 | struct cfg80211_ops { | 946 | struct cfg80211_ops { |
| 862 | int (*suspend)(struct wiphy *wiphy); | 947 | int (*suspend)(struct wiphy *wiphy); |
| @@ -865,8 +950,9 @@ struct cfg80211_ops { | |||
| 865 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, | 950 | int (*add_virtual_intf)(struct wiphy *wiphy, char *name, |
| 866 | enum nl80211_iftype type, u32 *flags, | 951 | enum nl80211_iftype type, u32 *flags, |
| 867 | struct vif_params *params); | 952 | struct vif_params *params); |
| 868 | int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); | 953 | int (*del_virtual_intf)(struct wiphy *wiphy, struct net_device *dev); |
| 869 | int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, | 954 | int (*change_virtual_intf)(struct wiphy *wiphy, |
| 955 | struct net_device *dev, | ||
| 870 | enum nl80211_iftype type, u32 *flags, | 956 | enum nl80211_iftype type, u32 *flags, |
| 871 | struct vif_params *params); | 957 | struct vif_params *params); |
| 872 | 958 | ||
| @@ -939,9 +1025,16 @@ struct cfg80211_ops { | |||
| 939 | int (*assoc)(struct wiphy *wiphy, struct net_device *dev, | 1025 | int (*assoc)(struct wiphy *wiphy, struct net_device *dev, |
| 940 | struct cfg80211_assoc_request *req); | 1026 | struct cfg80211_assoc_request *req); |
| 941 | int (*deauth)(struct wiphy *wiphy, struct net_device *dev, | 1027 | int (*deauth)(struct wiphy *wiphy, struct net_device *dev, |
| 942 | struct cfg80211_deauth_request *req); | 1028 | struct cfg80211_deauth_request *req, |
| 1029 | void *cookie); | ||
| 943 | int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, | 1030 | int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, |
| 944 | struct cfg80211_disassoc_request *req); | 1031 | struct cfg80211_disassoc_request *req, |
| 1032 | void *cookie); | ||
| 1033 | |||
| 1034 | int (*connect)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1035 | struct cfg80211_connect_params *sme); | ||
| 1036 | int (*disconnect)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1037 | u16 reason_code); | ||
| 945 | 1038 | ||
| 946 | int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev, | 1039 | int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev, |
| 947 | struct cfg80211_ibss_params *params); | 1040 | struct cfg80211_ibss_params *params); |
| @@ -953,7 +1046,23 @@ struct cfg80211_ops { | |||
| 953 | enum tx_power_setting type, int dbm); | 1046 | enum tx_power_setting type, int dbm); |
| 954 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1047 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); |
| 955 | 1048 | ||
| 1049 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1050 | u8 *addr); | ||
| 1051 | |||
| 956 | void (*rfkill_poll)(struct wiphy *wiphy); | 1052 | void (*rfkill_poll)(struct wiphy *wiphy); |
| 1053 | |||
| 1054 | #ifdef CONFIG_NL80211_TESTMODE | ||
| 1055 | int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); | ||
| 1056 | #endif | ||
| 1057 | |||
| 1058 | int (*set_bitrate_mask)(struct wiphy *wiphy, | ||
| 1059 | struct net_device *dev, | ||
| 1060 | const u8 *peer, | ||
| 1061 | const struct cfg80211_bitrate_mask *mask); | ||
| 1062 | |||
| 1063 | /* some temporary stuff to finish wext */ | ||
| 1064 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1065 | bool enabled, int timeout); | ||
| 957 | }; | 1066 | }; |
| 958 | 1067 | ||
| 959 | /* | 1068 | /* |
| @@ -979,6 +1088,10 @@ struct cfg80211_ops { | |||
| 979 | * channels at a later time. This can be used for devices which do not | 1088 | * channels at a later time. This can be used for devices which do not |
| 980 | * have calibration information gauranteed for frequencies or settings | 1089 | * have calibration information gauranteed for frequencies or settings |
| 981 | * outside of its regulatory domain. | 1090 | * outside of its regulatory domain. |
| 1091 | * @disable_beacon_hints: enable this if your driver needs to ensure that | ||
| 1092 | * passive scan flags and beaconing flags may not be lifted by cfg80211 | ||
| 1093 | * due to regulatory beacon hints. For more information on beacon | ||
| 1094 | * hints read the documenation for regulatory_hint_found_beacon() | ||
| 982 | * @reg_notifier: the driver's regulatory notification callback | 1095 | * @reg_notifier: the driver's regulatory notification callback |
| 983 | * @regd: the driver's regulatory domain, if one was requested via | 1096 | * @regd: the driver's regulatory domain, if one was requested via |
| 984 | * the regulatory_hint() API. This can be used by the driver | 1097 | * the regulatory_hint() API. This can be used by the driver |
| @@ -992,6 +1105,12 @@ struct cfg80211_ops { | |||
| 992 | * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); | 1105 | * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); |
| 993 | * -1 = fragmentation disabled, only odd values >= 256 used | 1106 | * -1 = fragmentation disabled, only odd values >= 256 used |
| 994 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled | 1107 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled |
| 1108 | * @net: the network namespace this wiphy currently lives in | ||
| 1109 | * @netnsok: if set to false, do not allow changing the netns of this | ||
| 1110 | * wiphy at all | ||
| 1111 | * @ps_default: default for powersave, will be set depending on the | ||
| 1112 | * kernel's default on wiphy_new(), but can be changed by the | ||
| 1113 | * driver if it has a good reason to override the default | ||
| 995 | */ | 1114 | */ |
| 996 | struct wiphy { | 1115 | struct wiphy { |
| 997 | /* assign these fields before you register the wiphy */ | 1116 | /* assign these fields before you register the wiphy */ |
| @@ -1004,6 +1123,10 @@ struct wiphy { | |||
| 1004 | 1123 | ||
| 1005 | bool custom_regulatory; | 1124 | bool custom_regulatory; |
| 1006 | bool strict_regulatory; | 1125 | bool strict_regulatory; |
| 1126 | bool disable_beacon_hints; | ||
| 1127 | |||
| 1128 | bool netnsok; | ||
| 1129 | bool ps_default; | ||
| 1007 | 1130 | ||
| 1008 | enum cfg80211_signal_type signal_type; | 1131 | enum cfg80211_signal_type signal_type; |
| 1009 | 1132 | ||
| @@ -1043,9 +1166,35 @@ struct wiphy { | |||
| 1043 | /* dir in debugfs: ieee80211/<wiphyname> */ | 1166 | /* dir in debugfs: ieee80211/<wiphyname> */ |
| 1044 | struct dentry *debugfsdir; | 1167 | struct dentry *debugfsdir; |
| 1045 | 1168 | ||
| 1169 | #ifdef CONFIG_NET_NS | ||
| 1170 | /* the network namespace this phy lives in currently */ | ||
| 1171 | struct net *_net; | ||
| 1172 | #endif | ||
| 1173 | |||
| 1046 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 1174 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
| 1047 | }; | 1175 | }; |
| 1048 | 1176 | ||
| 1177 | #ifdef CONFIG_NET_NS | ||
| 1178 | static inline struct net *wiphy_net(struct wiphy *wiphy) | ||
| 1179 | { | ||
| 1180 | return wiphy->_net; | ||
| 1181 | } | ||
| 1182 | |||
| 1183 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | ||
| 1184 | { | ||
| 1185 | wiphy->_net = net; | ||
| 1186 | } | ||
| 1187 | #else | ||
| 1188 | static inline struct net *wiphy_net(struct wiphy *wiphy) | ||
| 1189 | { | ||
| 1190 | return &init_net; | ||
| 1191 | } | ||
| 1192 | |||
| 1193 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | ||
| 1194 | { | ||
| 1195 | } | ||
| 1196 | #endif | ||
| 1197 | |||
| 1049 | /** | 1198 | /** |
| 1050 | * wiphy_priv - return priv from wiphy | 1199 | * wiphy_priv - return priv from wiphy |
| 1051 | * | 1200 | * |
| @@ -1058,6 +1207,17 @@ static inline void *wiphy_priv(struct wiphy *wiphy) | |||
| 1058 | } | 1207 | } |
| 1059 | 1208 | ||
| 1060 | /** | 1209 | /** |
| 1210 | * priv_to_wiphy - return the wiphy containing the priv | ||
| 1211 | * | ||
| 1212 | * @priv: a pointer previously returned by wiphy_priv | ||
| 1213 | */ | ||
| 1214 | static inline struct wiphy *priv_to_wiphy(void *priv) | ||
| 1215 | { | ||
| 1216 | BUG_ON(!priv); | ||
| 1217 | return container_of(priv, struct wiphy, priv); | ||
| 1218 | } | ||
| 1219 | |||
| 1220 | /** | ||
| 1061 | * set_wiphy_dev - set device pointer for wiphy | 1221 | * set_wiphy_dev - set device pointer for wiphy |
| 1062 | * | 1222 | * |
| 1063 | * @wiphy: The wiphy whose device to bind | 1223 | * @wiphy: The wiphy whose device to bind |
| @@ -1129,6 +1289,13 @@ extern void wiphy_unregister(struct wiphy *wiphy); | |||
| 1129 | */ | 1289 | */ |
| 1130 | extern void wiphy_free(struct wiphy *wiphy); | 1290 | extern void wiphy_free(struct wiphy *wiphy); |
| 1131 | 1291 | ||
| 1292 | /* internal structs */ | ||
| 1293 | struct cfg80211_conn; | ||
| 1294 | struct cfg80211_internal_bss; | ||
| 1295 | struct cfg80211_cached_keys; | ||
| 1296 | |||
| 1297 | #define MAX_AUTH_BSSES 4 | ||
| 1298 | |||
| 1132 | /** | 1299 | /** |
| 1133 | * struct wireless_dev - wireless per-netdev state | 1300 | * struct wireless_dev - wireless per-netdev state |
| 1134 | * | 1301 | * |
| @@ -1152,22 +1319,45 @@ struct wireless_dev { | |||
| 1152 | struct wiphy *wiphy; | 1319 | struct wiphy *wiphy; |
| 1153 | enum nl80211_iftype iftype; | 1320 | enum nl80211_iftype iftype; |
| 1154 | 1321 | ||
| 1155 | /* private to the generic wireless code */ | 1322 | /* the remainder of this struct should be private to cfg80211 */ |
| 1156 | struct list_head list; | 1323 | struct list_head list; |
| 1157 | struct net_device *netdev; | 1324 | struct net_device *netdev; |
| 1158 | 1325 | ||
| 1159 | /* currently used for IBSS - might be rearranged in the future */ | 1326 | struct mutex mtx; |
| 1160 | struct cfg80211_bss *current_bss; | 1327 | |
| 1161 | u8 bssid[ETH_ALEN]; | 1328 | struct work_struct cleanup_work; |
| 1329 | |||
| 1330 | /* currently used for IBSS and SME - might be rearranged later */ | ||
| 1162 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1331 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
| 1163 | u8 ssid_len; | 1332 | u8 ssid_len; |
| 1333 | enum { | ||
| 1334 | CFG80211_SME_IDLE, | ||
| 1335 | CFG80211_SME_CONNECTING, | ||
| 1336 | CFG80211_SME_CONNECTED, | ||
| 1337 | } sme_state; | ||
| 1338 | struct cfg80211_conn *conn; | ||
| 1339 | struct cfg80211_cached_keys *connect_keys; | ||
| 1340 | |||
| 1341 | struct list_head event_list; | ||
| 1342 | spinlock_t event_lock; | ||
| 1343 | |||
| 1344 | struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES]; | ||
| 1345 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; | ||
| 1346 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | ||
| 1164 | 1347 | ||
| 1165 | #ifdef CONFIG_WIRELESS_EXT | 1348 | #ifdef CONFIG_WIRELESS_EXT |
| 1166 | /* wext data */ | 1349 | /* wext data */ |
| 1167 | struct { | 1350 | struct { |
| 1168 | struct cfg80211_ibss_params ibss; | 1351 | struct cfg80211_ibss_params ibss; |
| 1169 | u8 bssid[ETH_ALEN]; | 1352 | struct cfg80211_connect_params connect; |
| 1353 | struct cfg80211_cached_keys *keys; | ||
| 1354 | u8 *ie; | ||
| 1355 | size_t ie_len; | ||
| 1356 | u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; | ||
| 1357 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
| 1170 | s8 default_key, default_mgmt_key; | 1358 | s8 default_key, default_mgmt_key; |
| 1359 | bool ps, prev_bssid_valid; | ||
| 1360 | int ps_timeout; | ||
| 1171 | } wext; | 1361 | } wext; |
| 1172 | #endif | 1362 | #endif |
| 1173 | }; | 1363 | }; |
| @@ -1347,20 +1537,6 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb); | |||
| 1347 | extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); | 1537 | extern int regulatory_hint(struct wiphy *wiphy, const char *alpha2); |
| 1348 | 1538 | ||
| 1349 | /** | 1539 | /** |
| 1350 | * regulatory_hint_11d - hints a country IE as a regulatory domain | ||
| 1351 | * @wiphy: the wireless device giving the hint (used only for reporting | ||
| 1352 | * conflicts) | ||
| 1353 | * @country_ie: pointer to the country IE | ||
| 1354 | * @country_ie_len: length of the country IE | ||
| 1355 | * | ||
| 1356 | * We will intersect the rd with the what CRDA tells us should apply | ||
| 1357 | * for the alpha2 this country IE belongs to, this prevents APs from | ||
| 1358 | * sending us incorrect or outdated information against a country. | ||
| 1359 | */ | ||
| 1360 | extern void regulatory_hint_11d(struct wiphy *wiphy, | ||
| 1361 | u8 *country_ie, | ||
| 1362 | u8 country_ie_len); | ||
| 1363 | /** | ||
| 1364 | * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain | 1540 | * wiphy_apply_custom_regulatory - apply a custom driver regulatory domain |
| 1365 | * @wiphy: the wireless device we want to process the regulatory domain on | 1541 | * @wiphy: the wireless device we want to process the regulatory domain on |
| 1366 | * @regd: the custom regulatory domain to use for this wiphy | 1542 | * @regd: the custom regulatory domain to use for this wiphy |
| @@ -1428,27 +1604,34 @@ int cfg80211_wext_siwmlme(struct net_device *dev, | |||
| 1428 | int cfg80211_wext_giwrange(struct net_device *dev, | 1604 | int cfg80211_wext_giwrange(struct net_device *dev, |
| 1429 | struct iw_request_info *info, | 1605 | struct iw_request_info *info, |
| 1430 | struct iw_point *data, char *extra); | 1606 | struct iw_point *data, char *extra); |
| 1431 | int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | 1607 | int cfg80211_wext_siwgenie(struct net_device *dev, |
| 1432 | struct iw_request_info *info, | 1608 | struct iw_request_info *info, |
| 1433 | struct iw_freq *freq, char *extra); | 1609 | struct iw_point *data, char *extra); |
| 1434 | int cfg80211_ibss_wext_giwfreq(struct net_device *dev, | 1610 | int cfg80211_wext_siwauth(struct net_device *dev, |
| 1435 | struct iw_request_info *info, | 1611 | struct iw_request_info *info, |
| 1436 | struct iw_freq *freq, char *extra); | 1612 | struct iw_param *data, char *extra); |
| 1437 | int cfg80211_ibss_wext_siwessid(struct net_device *dev, | 1613 | int cfg80211_wext_giwauth(struct net_device *dev, |
| 1438 | struct iw_request_info *info, | 1614 | struct iw_request_info *info, |
| 1439 | struct iw_point *data, char *ssid); | 1615 | struct iw_param *data, char *extra); |
| 1440 | int cfg80211_ibss_wext_giwessid(struct net_device *dev, | ||
| 1441 | struct iw_request_info *info, | ||
| 1442 | struct iw_point *data, char *ssid); | ||
| 1443 | int cfg80211_ibss_wext_siwap(struct net_device *dev, | ||
| 1444 | struct iw_request_info *info, | ||
| 1445 | struct sockaddr *ap_addr, char *extra); | ||
| 1446 | int cfg80211_ibss_wext_giwap(struct net_device *dev, | ||
| 1447 | struct iw_request_info *info, | ||
| 1448 | struct sockaddr *ap_addr, char *extra); | ||
| 1449 | 1616 | ||
| 1450 | struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy, | 1617 | int cfg80211_wext_siwfreq(struct net_device *dev, |
| 1451 | struct iw_freq *freq); | 1618 | struct iw_request_info *info, |
| 1619 | struct iw_freq *freq, char *extra); | ||
| 1620 | int cfg80211_wext_giwfreq(struct net_device *dev, | ||
| 1621 | struct iw_request_info *info, | ||
| 1622 | struct iw_freq *freq, char *extra); | ||
| 1623 | int cfg80211_wext_siwessid(struct net_device *dev, | ||
| 1624 | struct iw_request_info *info, | ||
| 1625 | struct iw_point *data, char *ssid); | ||
| 1626 | int cfg80211_wext_giwessid(struct net_device *dev, | ||
| 1627 | struct iw_request_info *info, | ||
| 1628 | struct iw_point *data, char *ssid); | ||
| 1629 | int cfg80211_wext_siwrate(struct net_device *dev, | ||
| 1630 | struct iw_request_info *info, | ||
| 1631 | struct iw_param *rate, char *extra); | ||
| 1632 | int cfg80211_wext_giwrate(struct net_device *dev, | ||
| 1633 | struct iw_request_info *info, | ||
| 1634 | struct iw_param *rate, char *extra); | ||
| 1452 | 1635 | ||
| 1453 | int cfg80211_wext_siwrts(struct net_device *dev, | 1636 | int cfg80211_wext_siwrts(struct net_device *dev, |
| 1454 | struct iw_request_info *info, | 1637 | struct iw_request_info *info, |
| @@ -1483,6 +1666,21 @@ int cfg80211_wext_siwtxpower(struct net_device *dev, | |||
| 1483 | int cfg80211_wext_giwtxpower(struct net_device *dev, | 1666 | int cfg80211_wext_giwtxpower(struct net_device *dev, |
| 1484 | struct iw_request_info *info, | 1667 | struct iw_request_info *info, |
| 1485 | union iwreq_data *data, char *keybuf); | 1668 | union iwreq_data *data, char *keybuf); |
| 1669 | struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev); | ||
| 1670 | |||
| 1671 | int cfg80211_wext_siwpower(struct net_device *dev, | ||
| 1672 | struct iw_request_info *info, | ||
| 1673 | struct iw_param *wrq, char *extra); | ||
| 1674 | int cfg80211_wext_giwpower(struct net_device *dev, | ||
| 1675 | struct iw_request_info *info, | ||
| 1676 | struct iw_param *wrq, char *extra); | ||
| 1677 | |||
| 1678 | int cfg80211_wext_siwap(struct net_device *dev, | ||
| 1679 | struct iw_request_info *info, | ||
| 1680 | struct sockaddr *ap_addr, char *extra); | ||
| 1681 | int cfg80211_wext_giwap(struct net_device *dev, | ||
| 1682 | struct iw_request_info *info, | ||
| 1683 | struct sockaddr *ap_addr, char *extra); | ||
| 1486 | 1684 | ||
| 1487 | /* | 1685 | /* |
| 1488 | * callbacks for asynchronous cfg80211 methods, notification | 1686 | * callbacks for asynchronous cfg80211 methods, notification |
| @@ -1564,7 +1762,7 @@ void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss); | |||
| 1564 | * This function is called whenever an authentication has been processed in | 1762 | * This function is called whenever an authentication has been processed in |
| 1565 | * station mode. The driver is required to call either this function or | 1763 | * station mode. The driver is required to call either this function or |
| 1566 | * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() | 1764 | * cfg80211_send_auth_timeout() to indicate the result of cfg80211_ops::auth() |
| 1567 | * call. | 1765 | * call. This function may sleep. |
| 1568 | */ | 1766 | */ |
| 1569 | void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); | 1767 | void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); |
| 1570 | 1768 | ||
| @@ -1572,6 +1770,8 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); | |||
| 1572 | * cfg80211_send_auth_timeout - notification of timed out authentication | 1770 | * cfg80211_send_auth_timeout - notification of timed out authentication |
| 1573 | * @dev: network device | 1771 | * @dev: network device |
| 1574 | * @addr: The MAC address of the device with which the authentication timed out | 1772 | * @addr: The MAC address of the device with which the authentication timed out |
| 1773 | * | ||
| 1774 | * This function may sleep. | ||
| 1575 | */ | 1775 | */ |
| 1576 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); | 1776 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); |
| 1577 | 1777 | ||
| @@ -1584,7 +1784,7 @@ void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); | |||
| 1584 | * This function is called whenever a (re)association response has been | 1784 | * This function is called whenever a (re)association response has been |
| 1585 | * processed in station mode. The driver is required to call either this | 1785 | * processed in station mode. The driver is required to call either this |
| 1586 | * function or cfg80211_send_assoc_timeout() to indicate the result of | 1786 | * function or cfg80211_send_assoc_timeout() to indicate the result of |
| 1587 | * cfg80211_ops::assoc() call. | 1787 | * cfg80211_ops::assoc() call. This function may sleep. |
| 1588 | */ | 1788 | */ |
| 1589 | void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); | 1789 | void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); |
| 1590 | 1790 | ||
| @@ -1592,6 +1792,8 @@ void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); | |||
| 1592 | * cfg80211_send_assoc_timeout - notification of timed out association | 1792 | * cfg80211_send_assoc_timeout - notification of timed out association |
| 1593 | * @dev: network device | 1793 | * @dev: network device |
| 1594 | * @addr: The MAC address of the device with which the association timed out | 1794 | * @addr: The MAC address of the device with which the association timed out |
| 1795 | * | ||
| 1796 | * This function may sleep. | ||
| 1595 | */ | 1797 | */ |
| 1596 | void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); | 1798 | void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); |
| 1597 | 1799 | ||
| @@ -1600,41 +1802,30 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); | |||
| 1600 | * @dev: network device | 1802 | * @dev: network device |
| 1601 | * @buf: deauthentication frame (header + body) | 1803 | * @buf: deauthentication frame (header + body) |
| 1602 | * @len: length of the frame data | 1804 | * @len: length of the frame data |
| 1805 | * @cookie: cookie from ->deauth if called within that callback, | ||
| 1806 | * %NULL otherwise | ||
| 1603 | * | 1807 | * |
| 1604 | * This function is called whenever deauthentication has been processed in | 1808 | * This function is called whenever deauthentication has been processed in |
| 1605 | * station mode. This includes both received deauthentication frames and | 1809 | * station mode. This includes both received deauthentication frames and |
| 1606 | * locally generated ones. | 1810 | * locally generated ones. This function may sleep. |
| 1607 | */ | 1811 | */ |
| 1608 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); | 1812 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, |
| 1813 | void *cookie); | ||
| 1609 | 1814 | ||
| 1610 | /** | 1815 | /** |
| 1611 | * cfg80211_send_disassoc - notification of processed disassociation | 1816 | * cfg80211_send_disassoc - notification of processed disassociation |
| 1612 | * @dev: network device | 1817 | * @dev: network device |
| 1613 | * @buf: disassociation response frame (header + body) | 1818 | * @buf: disassociation response frame (header + body) |
| 1614 | * @len: length of the frame data | 1819 | * @len: length of the frame data |
| 1820 | * @cookie: cookie from ->disassoc if called within that callback, | ||
| 1821 | * %NULL otherwise | ||
| 1615 | * | 1822 | * |
| 1616 | * This function is called whenever disassociation has been processed in | 1823 | * This function is called whenever disassociation has been processed in |
| 1617 | * station mode. This includes both received disassociation frames and locally | 1824 | * station mode. This includes both received disassociation frames and locally |
| 1618 | * generated ones. | 1825 | * generated ones. This function may sleep. |
| 1619 | */ | ||
| 1620 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); | ||
| 1621 | |||
| 1622 | /** | ||
| 1623 | * cfg80211_hold_bss - exclude bss from expiration | ||
| 1624 | * @bss: bss which should not expire | ||
| 1625 | * | ||
| 1626 | * In a case when the BSS is not updated but it shouldn't expire this | ||
| 1627 | * function can be used to mark the BSS to be excluded from expiration. | ||
| 1628 | */ | ||
| 1629 | void cfg80211_hold_bss(struct cfg80211_bss *bss); | ||
| 1630 | |||
| 1631 | /** | ||
| 1632 | * cfg80211_unhold_bss - remove expiration exception from the BSS | ||
| 1633 | * @bss: bss which can expire again | ||
| 1634 | * | ||
| 1635 | * This function marks the BSS to be expirable again. | ||
| 1636 | */ | 1826 | */ |
| 1637 | void cfg80211_unhold_bss(struct cfg80211_bss *bss); | 1827 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, |
| 1828 | void *cookie); | ||
| 1638 | 1829 | ||
| 1639 | /** | 1830 | /** |
| 1640 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 1831 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
| @@ -1643,6 +1834,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss); | |||
| 1643 | * @key_type: The key type that the received frame used | 1834 | * @key_type: The key type that the received frame used |
| 1644 | * @key_id: Key identifier (0..3) | 1835 | * @key_id: Key identifier (0..3) |
| 1645 | * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) | 1836 | * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) |
| 1837 | * @gfp: allocation flags | ||
| 1646 | * | 1838 | * |
| 1647 | * This function is called whenever the local MAC detects a MIC failure in a | 1839 | * This function is called whenever the local MAC detects a MIC failure in a |
| 1648 | * received frame. This matches with MLME-MICHAELMICFAILURE.indication() | 1840 | * received frame. This matches with MLME-MICHAELMICFAILURE.indication() |
| @@ -1650,7 +1842,7 @@ void cfg80211_unhold_bss(struct cfg80211_bss *bss); | |||
| 1650 | */ | 1842 | */ |
| 1651 | void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | 1843 | void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, |
| 1652 | enum nl80211_key_type key_type, int key_id, | 1844 | enum nl80211_key_type key_type, int key_id, |
| 1653 | const u8 *tsc); | 1845 | const u8 *tsc, gfp_t gfp); |
| 1654 | 1846 | ||
| 1655 | /** | 1847 | /** |
| 1656 | * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS | 1848 | * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS |
| @@ -1687,4 +1879,137 @@ void wiphy_rfkill_start_polling(struct wiphy *wiphy); | |||
| 1687 | */ | 1879 | */ |
| 1688 | void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | 1880 | void wiphy_rfkill_stop_polling(struct wiphy *wiphy); |
| 1689 | 1881 | ||
| 1882 | #ifdef CONFIG_NL80211_TESTMODE | ||
| 1883 | /** | ||
| 1884 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply | ||
| 1885 | * @wiphy: the wiphy | ||
| 1886 | * @approxlen: an upper bound of the length of the data that will | ||
| 1887 | * be put into the skb | ||
| 1888 | * | ||
| 1889 | * This function allocates and pre-fills an skb for a reply to | ||
| 1890 | * the testmode command. Since it is intended for a reply, calling | ||
| 1891 | * it outside of the @testmode_cmd operation is invalid. | ||
| 1892 | * | ||
| 1893 | * The returned skb (or %NULL if any errors happen) is pre-filled | ||
| 1894 | * with the wiphy index and set up in a way that any data that is | ||
| 1895 | * put into the skb (with skb_put(), nla_put() or similar) will end | ||
| 1896 | * up being within the %NL80211_ATTR_TESTDATA attribute, so all that | ||
| 1897 | * needs to be done with the skb is adding data for the corresponding | ||
| 1898 | * userspace tool which can then read that data out of the testdata | ||
| 1899 | * attribute. You must not modify the skb in any other way. | ||
| 1900 | * | ||
| 1901 | * When done, call cfg80211_testmode_reply() with the skb and return | ||
| 1902 | * its error code as the result of the @testmode_cmd operation. | ||
| 1903 | */ | ||
| 1904 | struct sk_buff *cfg80211_testmode_alloc_reply_skb(struct wiphy *wiphy, | ||
| 1905 | int approxlen); | ||
| 1906 | |||
| 1907 | /** | ||
| 1908 | * cfg80211_testmode_reply - send the reply skb | ||
| 1909 | * @skb: The skb, must have been allocated with | ||
| 1910 | * cfg80211_testmode_alloc_reply_skb() | ||
| 1911 | * | ||
| 1912 | * Returns an error code or 0 on success, since calling this | ||
| 1913 | * function will usually be the last thing before returning | ||
| 1914 | * from the @testmode_cmd you should return the error code. | ||
| 1915 | * Note that this function consumes the skb regardless of the | ||
| 1916 | * return value. | ||
| 1917 | */ | ||
| 1918 | int cfg80211_testmode_reply(struct sk_buff *skb); | ||
| 1919 | |||
| 1920 | /** | ||
| 1921 | * cfg80211_testmode_alloc_event_skb - allocate testmode event | ||
| 1922 | * @wiphy: the wiphy | ||
| 1923 | * @approxlen: an upper bound of the length of the data that will | ||
| 1924 | * be put into the skb | ||
| 1925 | * @gfp: allocation flags | ||
| 1926 | * | ||
| 1927 | * This function allocates and pre-fills an skb for an event on the | ||
| 1928 | * testmode multicast group. | ||
| 1929 | * | ||
| 1930 | * The returned skb (or %NULL if any errors happen) is set up in the | ||
| 1931 | * same way as with cfg80211_testmode_alloc_reply_skb() but prepared | ||
| 1932 | * for an event. As there, you should simply add data to it that will | ||
| 1933 | * then end up in the %NL80211_ATTR_TESTDATA attribute. Again, you must | ||
| 1934 | * not modify the skb in any other way. | ||
| 1935 | * | ||
| 1936 | * When done filling the skb, call cfg80211_testmode_event() with the | ||
| 1937 | * skb to send the event. | ||
| 1938 | */ | ||
| 1939 | struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, | ||
| 1940 | int approxlen, gfp_t gfp); | ||
| 1941 | |||
| 1942 | /** | ||
| 1943 | * cfg80211_testmode_event - send the event | ||
| 1944 | * @skb: The skb, must have been allocated with | ||
| 1945 | * cfg80211_testmode_alloc_event_skb() | ||
| 1946 | * @gfp: allocation flags | ||
| 1947 | * | ||
| 1948 | * This function sends the given @skb, which must have been allocated | ||
| 1949 | * by cfg80211_testmode_alloc_event_skb(), as an event. It always | ||
| 1950 | * consumes it. | ||
| 1951 | */ | ||
| 1952 | void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); | ||
| 1953 | |||
| 1954 | #define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), | ||
| 1955 | #else | ||
| 1956 | #define CFG80211_TESTMODE_CMD(cmd) | ||
| 1957 | #endif | ||
| 1958 | |||
| 1959 | /** | ||
| 1960 | * cfg80211_connect_result - notify cfg80211 of connection result | ||
| 1961 | * | ||
| 1962 | * @dev: network device | ||
| 1963 | * @bssid: the BSSID of the AP | ||
| 1964 | * @req_ie: association request IEs (maybe be %NULL) | ||
| 1965 | * @req_ie_len: association request IEs length | ||
| 1966 | * @resp_ie: association response IEs (may be %NULL) | ||
| 1967 | * @resp_ie_len: assoc response IEs length | ||
| 1968 | * @status: status code, 0 for successful connection, use | ||
| 1969 | * %WLAN_STATUS_UNSPECIFIED_FAILURE if your device cannot give you | ||
| 1970 | * the real status code for failures. | ||
| 1971 | * @gfp: allocation flags | ||
| 1972 | * | ||
| 1973 | * It should be called by the underlying driver whenever connect() has | ||
| 1974 | * succeeded. | ||
| 1975 | */ | ||
| 1976 | void cfg80211_connect_result(struct net_device *dev, const u8 *bssid, | ||
| 1977 | const u8 *req_ie, size_t req_ie_len, | ||
| 1978 | const u8 *resp_ie, size_t resp_ie_len, | ||
| 1979 | u16 status, gfp_t gfp); | ||
| 1980 | |||
| 1981 | /** | ||
| 1982 | * cfg80211_roamed - notify cfg80211 of roaming | ||
| 1983 | * | ||
| 1984 | * @dev: network device | ||
| 1985 | * @bssid: the BSSID of the new AP | ||
| 1986 | * @req_ie: association request IEs (maybe be %NULL) | ||
| 1987 | * @req_ie_len: association request IEs length | ||
| 1988 | * @resp_ie: association response IEs (may be %NULL) | ||
| 1989 | * @resp_ie_len: assoc response IEs length | ||
| 1990 | * @gfp: allocation flags | ||
| 1991 | * | ||
| 1992 | * It should be called by the underlying driver whenever it roamed | ||
| 1993 | * from one AP to another while connected. | ||
| 1994 | */ | ||
| 1995 | void cfg80211_roamed(struct net_device *dev, const u8 *bssid, | ||
| 1996 | const u8 *req_ie, size_t req_ie_len, | ||
| 1997 | const u8 *resp_ie, size_t resp_ie_len, gfp_t gfp); | ||
| 1998 | |||
| 1999 | /** | ||
| 2000 | * cfg80211_disconnected - notify cfg80211 that connection was dropped | ||
| 2001 | * | ||
| 2002 | * @dev: network device | ||
| 2003 | * @ie: information elements of the deauth/disassoc frame (may be %NULL) | ||
| 2004 | * @ie_len: length of IEs | ||
| 2005 | * @reason: reason code for the disconnection, set it to 0 if unknown | ||
| 2006 | * @gfp: allocation flags | ||
| 2007 | * | ||
| 2008 | * After it calls this function, the driver should enter an idle state | ||
| 2009 | * and not try to connect to any AP any more. | ||
| 2010 | */ | ||
| 2011 | void cfg80211_disconnected(struct net_device *dev, u16 reason, | ||
| 2012 | u8 *ie, size_t ie_len, gfp_t gfp); | ||
| 2013 | |||
| 2014 | |||
| 1690 | #endif /* __NET_CFG80211_H */ | 2015 | #endif /* __NET_CFG80211_H */ |
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index 775cfc8055be..b36ac7e0914d 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
| @@ -48,6 +48,8 @@ struct dcbnl_rtnl_ops { | |||
| 48 | void (*setbcncfg)(struct net_device *, int, u32); | 48 | void (*setbcncfg)(struct net_device *, int, u32); |
| 49 | void (*getbcnrp)(struct net_device *, int, u8 *); | 49 | void (*getbcnrp)(struct net_device *, int, u8 *); |
| 50 | void (*setbcnrp)(struct net_device *, int, u8); | 50 | void (*setbcnrp)(struct net_device *, int, u8); |
| 51 | u8 (*setapp)(struct net_device *, u8, u16, u8); | ||
| 52 | u8 (*getapp)(struct net_device *, u8, u16); | ||
| 51 | }; | 53 | }; |
| 52 | 54 | ||
| 53 | #endif /* __NET_DCBNL_H__ */ | 55 | #endif /* __NET_DCBNL_H__ */ |
diff --git a/include/net/dst.h b/include/net/dst.h index 7fc409c19b37..5a900ddcf10d 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #ifndef _NET_DST_H | 8 | #ifndef _NET_DST_H |
| 9 | #define _NET_DST_H | 9 | #define _NET_DST_H |
| 10 | 10 | ||
| 11 | #include <net/dst_ops.h> | ||
| 11 | #include <linux/netdevice.h> | 12 | #include <linux/netdevice.h> |
| 12 | #include <linux/rtnetlink.h> | 13 | #include <linux/rtnetlink.h> |
| 13 | #include <linux/rcupdate.h> | 14 | #include <linux/rcupdate.h> |
| @@ -102,28 +103,6 @@ struct dst_entry | |||
| 102 | }; | 103 | }; |
| 103 | }; | 104 | }; |
| 104 | 105 | ||
| 105 | |||
| 106 | struct dst_ops | ||
| 107 | { | ||
| 108 | unsigned short family; | ||
| 109 | __be16 protocol; | ||
| 110 | unsigned gc_thresh; | ||
| 111 | |||
| 112 | int (*gc)(struct dst_ops *ops); | ||
| 113 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | ||
| 114 | void (*destroy)(struct dst_entry *); | ||
| 115 | void (*ifdown)(struct dst_entry *, | ||
| 116 | struct net_device *dev, int how); | ||
| 117 | struct dst_entry * (*negative_advice)(struct dst_entry *); | ||
| 118 | void (*link_failure)(struct sk_buff *); | ||
| 119 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); | ||
| 120 | int (*local_out)(struct sk_buff *skb); | ||
| 121 | |||
| 122 | atomic_t entries; | ||
| 123 | struct kmem_cache *kmem_cachep; | ||
| 124 | struct net *dst_net; | ||
| 125 | }; | ||
| 126 | |||
| 127 | #ifdef __KERNEL__ | 106 | #ifdef __KERNEL__ |
| 128 | 107 | ||
| 129 | static inline u32 | 108 | static inline u32 |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h new file mode 100644 index 000000000000..d1ff9b7e99b8 --- /dev/null +++ b/include/net/dst_ops.h | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | #ifndef _NET_DST_OPS_H | ||
| 2 | #define _NET_DST_OPS_H | ||
| 3 | #include <linux/types.h> | ||
| 4 | |||
| 5 | struct dst_entry; | ||
| 6 | struct kmem_cachep; | ||
| 7 | struct net_device; | ||
| 8 | struct sk_buff; | ||
| 9 | |||
| 10 | struct dst_ops { | ||
| 11 | unsigned short family; | ||
| 12 | __be16 protocol; | ||
| 13 | unsigned gc_thresh; | ||
| 14 | |||
| 15 | int (*gc)(struct dst_ops *ops); | ||
| 16 | struct dst_entry * (*check)(struct dst_entry *, __u32 cookie); | ||
| 17 | void (*destroy)(struct dst_entry *); | ||
| 18 | void (*ifdown)(struct dst_entry *, | ||
| 19 | struct net_device *dev, int how); | ||
| 20 | struct dst_entry * (*negative_advice)(struct dst_entry *); | ||
| 21 | void (*link_failure)(struct sk_buff *); | ||
| 22 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); | ||
| 23 | int (*local_out)(struct sk_buff *skb); | ||
| 24 | |||
| 25 | atomic_t entries; | ||
| 26 | struct kmem_cache *kmem_cachep; | ||
| 27 | }; | ||
| 28 | #endif | ||
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index d136b5240ef2..c1488553e349 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
| @@ -28,7 +28,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | |||
| 28 | spinlock_t *lock, struct gnet_dump *d); | 28 | spinlock_t *lock, struct gnet_dump *d); |
| 29 | 29 | ||
| 30 | extern int gnet_stats_copy_basic(struct gnet_dump *d, | 30 | extern int gnet_stats_copy_basic(struct gnet_dump *d, |
| 31 | struct gnet_stats_basic *b); | 31 | struct gnet_stats_basic_packed *b); |
| 32 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, | 32 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, |
| 33 | struct gnet_stats_rate_est *r); | 33 | struct gnet_stats_rate_est *r); |
| 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, | 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, |
| @@ -37,14 +37,14 @@ extern int gnet_stats_copy_app(struct gnet_dump *d, void *st, int len); | |||
| 37 | 37 | ||
| 38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); | 38 | extern int gnet_stats_finish_copy(struct gnet_dump *d); |
| 39 | 39 | ||
| 40 | extern int gen_new_estimator(struct gnet_stats_basic *bstats, | 40 | extern int gen_new_estimator(struct gnet_stats_basic_packed *bstats, |
| 41 | struct gnet_stats_rate_est *rate_est, | 41 | struct gnet_stats_rate_est *rate_est, |
| 42 | spinlock_t *stats_lock, struct nlattr *opt); | 42 | spinlock_t *stats_lock, struct nlattr *opt); |
| 43 | extern void gen_kill_estimator(struct gnet_stats_basic *bstats, | 43 | extern void gen_kill_estimator(struct gnet_stats_basic_packed *bstats, |
| 44 | struct gnet_stats_rate_est *rate_est); | 44 | struct gnet_stats_rate_est *rate_est); |
| 45 | extern int gen_replace_estimator(struct gnet_stats_basic *bstats, | 45 | extern int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, |
| 46 | struct gnet_stats_rate_est *rate_est, | 46 | struct gnet_stats_rate_est *rate_est, |
| 47 | spinlock_t *stats_lock, struct nlattr *opt); | 47 | spinlock_t *stats_lock, struct nlattr *opt); |
| 48 | extern bool gen_estimator_active(const struct gnet_stats_basic *bstats, | 48 | extern bool gen_estimator_active(const struct gnet_stats_basic_packed *bstats, |
| 49 | const struct gnet_stats_rate_est *rate_est); | 49 | const struct gnet_stats_rate_est *rate_est); |
| 50 | #endif | 50 | #endif |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 1b0e3ee4ddd8..2a1c06874c42 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/genetlink.h> | 4 | #include <linux/genetlink.h> |
| 5 | #include <net/netlink.h> | 5 | #include <net/netlink.h> |
| 6 | #include <net/net_namespace.h> | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * struct genl_multicast_group - generic netlink multicast group | 9 | * struct genl_multicast_group - generic netlink multicast group |
| @@ -27,6 +28,8 @@ struct genl_multicast_group | |||
| 27 | * @name: name of family | 28 | * @name: name of family |
| 28 | * @version: protocol version | 29 | * @version: protocol version |
| 29 | * @maxattr: maximum number of attributes supported | 30 | * @maxattr: maximum number of attributes supported |
| 31 | * @netnsok: set to true if the family can handle network | ||
| 32 | * namespaces and should be presented in all of them | ||
| 30 | * @attrbuf: buffer to store parsed attributes | 33 | * @attrbuf: buffer to store parsed attributes |
| 31 | * @ops_list: list of all assigned operations | 34 | * @ops_list: list of all assigned operations |
| 32 | * @family_list: family list | 35 | * @family_list: family list |
| @@ -39,6 +42,7 @@ struct genl_family | |||
| 39 | char name[GENL_NAMSIZ]; | 42 | char name[GENL_NAMSIZ]; |
| 40 | unsigned int version; | 43 | unsigned int version; |
| 41 | unsigned int maxattr; | 44 | unsigned int maxattr; |
| 45 | bool netnsok; | ||
| 42 | struct nlattr ** attrbuf; /* private */ | 46 | struct nlattr ** attrbuf; /* private */ |
| 43 | struct list_head ops_list; /* private */ | 47 | struct list_head ops_list; /* private */ |
| 44 | struct list_head family_list; /* private */ | 48 | struct list_head family_list; /* private */ |
| @@ -62,8 +66,32 @@ struct genl_info | |||
| 62 | struct genlmsghdr * genlhdr; | 66 | struct genlmsghdr * genlhdr; |
| 63 | void * userhdr; | 67 | void * userhdr; |
| 64 | struct nlattr ** attrs; | 68 | struct nlattr ** attrs; |
| 69 | #ifdef CONFIG_NET_NS | ||
| 70 | struct net * _net; | ||
| 71 | #endif | ||
| 65 | }; | 72 | }; |
| 66 | 73 | ||
| 74 | #ifdef CONFIG_NET_NS | ||
| 75 | static inline struct net *genl_info_net(struct genl_info *info) | ||
| 76 | { | ||
| 77 | return info->_net; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) | ||
| 81 | { | ||
| 82 | info->_net = net; | ||
| 83 | } | ||
| 84 | #else | ||
| 85 | static inline struct net *genl_info_net(struct genl_info *info) | ||
| 86 | { | ||
| 87 | return &init_net; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void genl_info_net_set(struct genl_info *info, struct net *net) | ||
| 91 | { | ||
| 92 | } | ||
| 93 | #endif | ||
| 94 | |||
| 67 | /** | 95 | /** |
| 68 | * struct genl_ops - generic netlink operations | 96 | * struct genl_ops - generic netlink operations |
| 69 | * @cmd: command identifier | 97 | * @cmd: command identifier |
| @@ -98,8 +126,6 @@ extern int genl_register_mc_group(struct genl_family *family, | |||
| 98 | extern void genl_unregister_mc_group(struct genl_family *family, | 126 | extern void genl_unregister_mc_group(struct genl_family *family, |
| 99 | struct genl_multicast_group *grp); | 127 | struct genl_multicast_group *grp); |
| 100 | 128 | ||
| 101 | extern struct sock *genl_sock; | ||
| 102 | |||
| 103 | /** | 129 | /** |
| 104 | * genlmsg_put - Add generic netlink header to netlink message | 130 | * genlmsg_put - Add generic netlink header to netlink message |
| 105 | * @skb: socket buffer holding the message | 131 | * @skb: socket buffer holding the message |
| @@ -170,7 +196,21 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | |||
| 170 | } | 196 | } |
| 171 | 197 | ||
| 172 | /** | 198 | /** |
| 173 | * genlmsg_multicast - multicast a netlink message | 199 | * genlmsg_multicast_netns - multicast a netlink message to a specific netns |
| 200 | * @net: the net namespace | ||
| 201 | * @skb: netlink message as socket buffer | ||
| 202 | * @pid: own netlink pid to avoid sending to yourself | ||
| 203 | * @group: multicast group id | ||
| 204 | * @flags: allocation flags | ||
| 205 | */ | ||
| 206 | static inline int genlmsg_multicast_netns(struct net *net, struct sk_buff *skb, | ||
| 207 | u32 pid, unsigned int group, gfp_t flags) | ||
| 208 | { | ||
| 209 | return nlmsg_multicast(net->genl_sock, skb, pid, group, flags); | ||
| 210 | } | ||
| 211 | |||
| 212 | /** | ||
| 213 | * genlmsg_multicast - multicast a netlink message to the default netns | ||
| 174 | * @skb: netlink message as socket buffer | 214 | * @skb: netlink message as socket buffer |
| 175 | * @pid: own netlink pid to avoid sending to yourself | 215 | * @pid: own netlink pid to avoid sending to yourself |
| 176 | * @group: multicast group id | 216 | * @group: multicast group id |
| @@ -179,17 +219,29 @@ static inline void genlmsg_cancel(struct sk_buff *skb, void *hdr) | |||
| 179 | static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid, | 219 | static inline int genlmsg_multicast(struct sk_buff *skb, u32 pid, |
| 180 | unsigned int group, gfp_t flags) | 220 | unsigned int group, gfp_t flags) |
| 181 | { | 221 | { |
| 182 | return nlmsg_multicast(genl_sock, skb, pid, group, flags); | 222 | return genlmsg_multicast_netns(&init_net, skb, pid, group, flags); |
| 183 | } | 223 | } |
| 184 | 224 | ||
| 185 | /** | 225 | /** |
| 226 | * genlmsg_multicast_allns - multicast a netlink message to all net namespaces | ||
| 227 | * @skb: netlink message as socket buffer | ||
| 228 | * @pid: own netlink pid to avoid sending to yourself | ||
| 229 | * @group: multicast group id | ||
| 230 | * @flags: allocation flags | ||
| 231 | * | ||
| 232 | * This function must hold the RTNL or rcu_read_lock(). | ||
| 233 | */ | ||
| 234 | int genlmsg_multicast_allns(struct sk_buff *skb, u32 pid, | ||
| 235 | unsigned int group, gfp_t flags); | ||
| 236 | |||
| 237 | /** | ||
| 186 | * genlmsg_unicast - unicast a netlink message | 238 | * genlmsg_unicast - unicast a netlink message |
| 187 | * @skb: netlink message as socket buffer | 239 | * @skb: netlink message as socket buffer |
| 188 | * @pid: netlink pid of the destination socket | 240 | * @pid: netlink pid of the destination socket |
| 189 | */ | 241 | */ |
| 190 | static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) | 242 | static inline int genlmsg_unicast(struct net *net, struct sk_buff *skb, u32 pid) |
| 191 | { | 243 | { |
| 192 | return nlmsg_unicast(genl_sock, skb, pid); | 244 | return nlmsg_unicast(net->genl_sock, skb, pid); |
| 193 | } | 245 | } |
| 194 | 246 | ||
| 195 | /** | 247 | /** |
| @@ -199,7 +251,7 @@ static inline int genlmsg_unicast(struct sk_buff *skb, u32 pid) | |||
| 199 | */ | 251 | */ |
| 200 | static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) | 252 | static inline int genlmsg_reply(struct sk_buff *skb, struct genl_info *info) |
| 201 | { | 253 | { |
| 202 | return genlmsg_unicast(skb, info->snd_pid); | 254 | return genlmsg_unicast(genl_info_net(info), skb, info->snd_pid); |
| 203 | } | 255 | } |
| 204 | 256 | ||
| 205 | /** | 257 | /** |
diff --git a/include/net/ieee802154/mac_def.h b/include/net/ieee802154.h index 8cb684635650..d52685defb11 100644 --- a/include/net/ieee802154/mac_def.h +++ b/include/net/ieee802154.h | |||
| @@ -23,8 +23,8 @@ | |||
| 23 | * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 23 | * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> |
| 24 | */ | 24 | */ |
| 25 | 25 | ||
| 26 | #ifndef IEEE802154_MAC_DEF_H | 26 | #ifndef NET_IEEE802154_H |
| 27 | #define IEEE802154_MAC_DEF_H | 27 | #define NET_IEEE802154_H |
| 28 | 28 | ||
| 29 | #define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */ | 29 | #define IEEE802154_FC_TYPE_BEACON 0x0 /* Frame is beacon */ |
| 30 | #define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */ | 30 | #define IEEE802154_FC_TYPE_DATA 0x1 /* Frame is data */ |
diff --git a/include/net/ieee802154/nl802154.h b/include/net/ieee802154/nl802154.h deleted file mode 100644 index 78efcdf52b59..000000000000 --- a/include/net/ieee802154/nl802154.h +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * nl802154.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2007, 2008, 2009 Siemens AG | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 | ||
| 8 | * as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License along | ||
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef IEEE802154_NL_H | ||
| 22 | #define IEEE802154_NL_H | ||
| 23 | |||
| 24 | struct net_device; | ||
| 25 | struct ieee802154_addr; | ||
| 26 | |||
| 27 | int ieee802154_nl_assoc_indic(struct net_device *dev, | ||
| 28 | struct ieee802154_addr *addr, u8 cap); | ||
| 29 | int ieee802154_nl_assoc_confirm(struct net_device *dev, | ||
| 30 | u16 short_addr, u8 status); | ||
| 31 | int ieee802154_nl_disassoc_indic(struct net_device *dev, | ||
| 32 | struct ieee802154_addr *addr, u8 reason); | ||
| 33 | int ieee802154_nl_disassoc_confirm(struct net_device *dev, | ||
| 34 | u8 status); | ||
| 35 | int ieee802154_nl_scan_confirm(struct net_device *dev, | ||
| 36 | u8 status, u8 scan_type, u32 unscanned, | ||
| 37 | u8 *edl/*, struct list_head *pan_desc_list */); | ||
| 38 | int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid, | ||
| 39 | u16 coord_addr); | ||
| 40 | |||
| 41 | #endif | ||
diff --git a/include/net/ieee802154/netdevice.h b/include/net/ieee802154_netdev.h index e2506af3e7c8..5dc6a61952de 100644 --- a/include/net/ieee802154/netdevice.h +++ b/include/net/ieee802154_netdev.h | |||
| @@ -80,7 +80,7 @@ static inline int mac_cb_type(struct sk_buff *skb) | |||
| 80 | struct ieee802154_mlme_ops { | 80 | struct ieee802154_mlme_ops { |
| 81 | int (*assoc_req)(struct net_device *dev, | 81 | int (*assoc_req)(struct net_device *dev, |
| 82 | struct ieee802154_addr *addr, | 82 | struct ieee802154_addr *addr, |
| 83 | u8 channel, u8 cap); | 83 | u8 channel, u8 page, u8 cap); |
| 84 | int (*assoc_resp)(struct net_device *dev, | 84 | int (*assoc_resp)(struct net_device *dev, |
| 85 | struct ieee802154_addr *addr, | 85 | struct ieee802154_addr *addr, |
| 86 | u16 short_addr, u8 status); | 86 | u16 short_addr, u8 status); |
| @@ -89,10 +89,10 @@ struct ieee802154_mlme_ops { | |||
| 89 | u8 reason); | 89 | u8 reason); |
| 90 | int (*start_req)(struct net_device *dev, | 90 | int (*start_req)(struct net_device *dev, |
| 91 | struct ieee802154_addr *addr, | 91 | struct ieee802154_addr *addr, |
| 92 | u8 channel, u8 bcn_ord, u8 sf_ord, | 92 | u8 channel, u8 page, u8 bcn_ord, u8 sf_ord, |
| 93 | u8 pan_coord, u8 blx, u8 coord_realign); | 93 | u8 pan_coord, u8 blx, u8 coord_realign); |
| 94 | int (*scan_req)(struct net_device *dev, | 94 | int (*scan_req)(struct net_device *dev, |
| 95 | u8 type, u32 channels, u8 duration); | 95 | u8 type, u32 channels, u8 page, u8 duration); |
| 96 | 96 | ||
| 97 | /* | 97 | /* |
| 98 | * FIXME: these should become the part of PIB/MIB interface. | 98 | * FIXME: these should become the part of PIB/MIB interface. |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 7c5c0f79168a..15b492a9aa79 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
| @@ -22,6 +22,12 @@ | |||
| 22 | #include <net/flow.h> | 22 | #include <net/flow.h> |
| 23 | #include <net/netlink.h> | 23 | #include <net/netlink.h> |
| 24 | 24 | ||
| 25 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | ||
| 26 | #define FIB6_TABLE_HASHSZ 256 | ||
| 27 | #else | ||
| 28 | #define FIB6_TABLE_HASHSZ 1 | ||
| 29 | #endif | ||
| 30 | |||
| 25 | struct rt6_info; | 31 | struct rt6_info; |
| 26 | 32 | ||
| 27 | struct fib6_config | 33 | struct fib6_config |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index bbae1e87efcd..98978e73f666 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -99,47 +99,47 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
| 99 | return &buf[*idx - len]; | 99 | return &buf[*idx - len]; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | #define IP_VS_DBG_BUF(level, msg...) \ | 102 | #define IP_VS_DBG_BUF(level, msg, ...) \ |
| 103 | do { \ | 103 | do { \ |
| 104 | char ip_vs_dbg_buf[160]; \ | 104 | char ip_vs_dbg_buf[160]; \ |
| 105 | int ip_vs_dbg_idx = 0; \ | 105 | int ip_vs_dbg_idx = 0; \ |
| 106 | if (level <= ip_vs_get_debug_level()) \ | 106 | if (level <= ip_vs_get_debug_level()) \ |
| 107 | printk(KERN_DEBUG "IPVS: " msg); \ | 107 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
| 108 | } while (0) | 108 | } while (0) |
| 109 | #define IP_VS_ERR_BUF(msg...) \ | 109 | #define IP_VS_ERR_BUF(msg...) \ |
| 110 | do { \ | 110 | do { \ |
| 111 | char ip_vs_dbg_buf[160]; \ | 111 | char ip_vs_dbg_buf[160]; \ |
| 112 | int ip_vs_dbg_idx = 0; \ | 112 | int ip_vs_dbg_idx = 0; \ |
| 113 | printk(KERN_ERR "IPVS: " msg); \ | 113 | pr_err(msg); \ |
| 114 | } while (0) | 114 | } while (0) |
| 115 | 115 | ||
| 116 | /* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ | 116 | /* Only use from within IP_VS_DBG_BUF() or IP_VS_ERR_BUF macros */ |
| 117 | #define IP_VS_DBG_ADDR(af, addr) \ | 117 | #define IP_VS_DBG_ADDR(af, addr) \ |
| 118 | ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ | 118 | ip_vs_dbg_addr(af, ip_vs_dbg_buf, \ |
| 119 | sizeof(ip_vs_dbg_buf), addr, \ | 119 | sizeof(ip_vs_dbg_buf), addr, \ |
| 120 | &ip_vs_dbg_idx) | 120 | &ip_vs_dbg_idx) |
| 121 | 121 | ||
| 122 | #define IP_VS_DBG(level, msg...) \ | 122 | #define IP_VS_DBG(level, msg, ...) \ |
| 123 | do { \ | 123 | do { \ |
| 124 | if (level <= ip_vs_get_debug_level()) \ | 124 | if (level <= ip_vs_get_debug_level()) \ |
| 125 | printk(KERN_DEBUG "IPVS: " msg); \ | 125 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
| 126 | } while (0) | 126 | } while (0) |
| 127 | #define IP_VS_DBG_RL(msg...) \ | 127 | #define IP_VS_DBG_RL(msg, ...) \ |
| 128 | do { \ | 128 | do { \ |
| 129 | if (net_ratelimit()) \ | 129 | if (net_ratelimit()) \ |
| 130 | printk(KERN_DEBUG "IPVS: " msg); \ | 130 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
| 131 | } while (0) | 131 | } while (0) |
| 132 | #define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ | 132 | #define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ |
| 133 | do { \ | 133 | do { \ |
| 134 | if (level <= ip_vs_get_debug_level()) \ | 134 | if (level <= ip_vs_get_debug_level()) \ |
| 135 | pp->debug_packet(pp, skb, ofs, msg); \ | 135 | pp->debug_packet(pp, skb, ofs, msg); \ |
| 136 | } while (0) | 136 | } while (0) |
| 137 | #define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ | 137 | #define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ |
| 138 | do { \ | 138 | do { \ |
| 139 | if (level <= ip_vs_get_debug_level() && \ | 139 | if (level <= ip_vs_get_debug_level() && \ |
| 140 | net_ratelimit()) \ | 140 | net_ratelimit()) \ |
| 141 | pp->debug_packet(pp, skb, ofs, msg); \ | 141 | pp->debug_packet(pp, skb, ofs, msg); \ |
| 142 | } while (0) | 142 | } while (0) |
| 143 | #else /* NO DEBUGGING at ALL */ | 143 | #else /* NO DEBUGGING at ALL */ |
| 144 | #define IP_VS_DBG_BUF(level, msg...) do {} while (0) | 144 | #define IP_VS_DBG_BUF(level, msg...) do {} while (0) |
| 145 | #define IP_VS_ERR_BUF(msg...) do {} while (0) | 145 | #define IP_VS_ERR_BUF(msg...) do {} while (0) |
| @@ -150,29 +150,27 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
| 150 | #endif | 150 | #endif |
| 151 | 151 | ||
| 152 | #define IP_VS_BUG() BUG() | 152 | #define IP_VS_BUG() BUG() |
| 153 | #define IP_VS_ERR(msg...) printk(KERN_ERR "IPVS: " msg) | 153 | #define IP_VS_ERR_RL(msg, ...) \ |
| 154 | #define IP_VS_INFO(msg...) printk(KERN_INFO "IPVS: " msg) | 154 | do { \ |
| 155 | #define IP_VS_WARNING(msg...) \ | 155 | if (net_ratelimit()) \ |
| 156 | printk(KERN_WARNING "IPVS: " msg) | 156 | pr_err(msg, ##__VA_ARGS__); \ |
| 157 | #define IP_VS_ERR_RL(msg...) \ | 157 | } while (0) |
| 158 | do { \ | ||
| 159 | if (net_ratelimit()) \ | ||
| 160 | printk(KERN_ERR "IPVS: " msg); \ | ||
| 161 | } while (0) | ||
| 162 | 158 | ||
| 163 | #ifdef CONFIG_IP_VS_DEBUG | 159 | #ifdef CONFIG_IP_VS_DEBUG |
| 164 | #define EnterFunction(level) \ | 160 | #define EnterFunction(level) \ |
| 165 | do { \ | 161 | do { \ |
| 166 | if (level <= ip_vs_get_debug_level()) \ | 162 | if (level <= ip_vs_get_debug_level()) \ |
| 167 | printk(KERN_DEBUG "Enter: %s, %s line %i\n", \ | 163 | printk(KERN_DEBUG \ |
| 168 | __func__, __FILE__, __LINE__); \ | 164 | pr_fmt("Enter: %s, %s line %i\n"), \ |
| 169 | } while (0) | 165 | __func__, __FILE__, __LINE__); \ |
| 170 | #define LeaveFunction(level) \ | 166 | } while (0) |
| 171 | do { \ | 167 | #define LeaveFunction(level) \ |
| 172 | if (level <= ip_vs_get_debug_level()) \ | 168 | do { \ |
| 173 | printk(KERN_DEBUG "Leave: %s, %s line %i\n", \ | 169 | if (level <= ip_vs_get_debug_level()) \ |
| 174 | __func__, __FILE__, __LINE__); \ | 170 | printk(KERN_DEBUG \ |
| 175 | } while (0) | 171 | pr_fmt("Leave: %s, %s line %i\n"), \ |
| 172 | __func__, __FILE__, __LINE__); \ | ||
| 173 | } while (0) | ||
| 176 | #else | 174 | #else |
| 177 | #define EnterFunction(level) do {} while (0) | 175 | #define EnterFunction(level) do {} while (0) |
| 178 | #define LeaveFunction(level) do {} while (0) | 176 | #define LeaveFunction(level) do {} while (0) |
| @@ -740,7 +738,8 @@ extern void ip_vs_protocol_cleanup(void); | |||
| 740 | extern void ip_vs_protocol_timeout_change(int flags); | 738 | extern void ip_vs_protocol_timeout_change(int flags); |
| 741 | extern int *ip_vs_create_timeout_table(int *table, int size); | 739 | extern int *ip_vs_create_timeout_table(int *table, int size); |
| 742 | extern int | 740 | extern int |
| 743 | ip_vs_set_state_timeout(int *table, int num, char **names, char *name, int to); | 741 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
| 742 | const char *name, int to); | ||
| 744 | extern void | 743 | extern void |
| 745 | ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, | 744 | ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, |
| 746 | int offset, const char *msg); | 745 | int offset, const char *msg); |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index f27fd83d67d8..ad9a51130254 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
| @@ -441,6 +441,18 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add | |||
| 441 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); | 441 | return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); |
| 442 | } | 442 | } |
| 443 | 443 | ||
| 444 | static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr) | ||
| 445 | { | ||
| 446 | static u32 ipv6_fragmentation_id = 1; | ||
| 447 | static DEFINE_SPINLOCK(ip6_id_lock); | ||
| 448 | |||
| 449 | spin_lock_bh(&ip6_id_lock); | ||
| 450 | fhdr->identification = htonl(ipv6_fragmentation_id); | ||
| 451 | if (++ipv6_fragmentation_id == 0) | ||
| 452 | ipv6_fragmentation_id = 1; | ||
| 453 | spin_unlock_bh(&ip6_id_lock); | ||
| 454 | } | ||
| 455 | |||
| 444 | /* | 456 | /* |
| 445 | * Prototypes exported by ipv6 | 457 | * Prototypes exported by ipv6 |
| 446 | */ | 458 | */ |
diff --git a/include/net/irda/ircomm_event.h b/include/net/irda/ircomm_event.h index c290447872d1..bc0c6f31f1c6 100644 --- a/include/net/irda/ircomm_event.h +++ b/include/net/irda/ircomm_event.h | |||
| @@ -74,7 +74,7 @@ struct ircomm_info { | |||
| 74 | struct qos_info *qos; | 74 | struct qos_info *qos; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | extern char *ircomm_state[]; | 77 | extern const char *const ircomm_state[]; |
| 78 | 78 | ||
| 79 | struct ircomm_cb; /* Forward decl. */ | 79 | struct ircomm_cb; /* Forward decl. */ |
| 80 | 80 | ||
diff --git a/include/net/irda/ircomm_tty_attach.h b/include/net/irda/ircomm_tty_attach.h index f91a5695aa44..0a63bbb972d7 100644 --- a/include/net/irda/ircomm_tty_attach.h +++ b/include/net/irda/ircomm_tty_attach.h | |||
| @@ -66,8 +66,8 @@ struct ircomm_tty_info { | |||
| 66 | __u8 dlsap_sel; | 66 | __u8 dlsap_sel; |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | extern char *ircomm_state[]; | 69 | extern const char *const ircomm_state[]; |
| 70 | extern char *ircomm_tty_state[]; | 70 | extern const char *const ircomm_tty_state[]; |
| 71 | 71 | ||
| 72 | int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, | 72 | int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, |
| 73 | struct sk_buff *skb, struct ircomm_tty_info *info); | 73 | struct sk_buff *skb, struct ircomm_tty_info *info); |
diff --git a/include/net/irda/irlap_event.h b/include/net/irda/irlap_event.h index 2ae2e119ef4b..4c90824c50fb 100644 --- a/include/net/irda/irlap_event.h +++ b/include/net/irda/irlap_event.h | |||
| @@ -120,7 +120,7 @@ typedef enum { /* FIXME check the two first reason codes */ | |||
| 120 | LAP_PRIMARY_CONFLICT, | 120 | LAP_PRIMARY_CONFLICT, |
| 121 | } LAP_REASON; | 121 | } LAP_REASON; |
| 122 | 122 | ||
| 123 | extern const char *irlap_state[]; | 123 | extern const char *const irlap_state[]; |
| 124 | 124 | ||
| 125 | void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, | 125 | void irlap_do_event(struct irlap_cb *self, IRLAP_EVENT event, |
| 126 | struct sk_buff *skb, struct irlap_info *info); | 126 | struct sk_buff *skb, struct irlap_info *info); |
diff --git a/include/net/irda/irlmp_event.h b/include/net/irda/irlmp_event.h index e03ae4ae3963..9e4ec17a7449 100644 --- a/include/net/irda/irlmp_event.h +++ b/include/net/irda/irlmp_event.h | |||
| @@ -79,8 +79,8 @@ typedef enum { | |||
| 79 | LM_LAP_IDLE_TIMEOUT, | 79 | LM_LAP_IDLE_TIMEOUT, |
| 80 | } IRLMP_EVENT; | 80 | } IRLMP_EVENT; |
| 81 | 81 | ||
| 82 | extern const char *irlmp_state[]; | 82 | extern const char *const irlmp_state[]; |
| 83 | extern const char *irlsap_state[]; | 83 | extern const char *const irlsap_state[]; |
| 84 | 84 | ||
| 85 | void irlmp_watchdog_timer_expired(void *data); | 85 | void irlmp_watchdog_timer_expired(void *data); |
| 86 | void irlmp_discovery_timer_expired(void *data); | 86 | void irlmp_discovery_timer_expired(void *data); |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index 51b9a37de991..e9054a283fde 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
| @@ -416,13 +416,13 @@ struct iw_spy_data | |||
| 416 | * data (i.e. valid as long as struct net_device exist, same locking rules). | 416 | * data (i.e. valid as long as struct net_device exist, same locking rules). |
| 417 | */ | 417 | */ |
| 418 | /* Forward declaration */ | 418 | /* Forward declaration */ |
| 419 | struct ieee80211_device; | 419 | struct libipw_device; |
| 420 | /* The struct */ | 420 | /* The struct */ |
| 421 | struct iw_public_data { | 421 | struct iw_public_data { |
| 422 | /* Driver enhanced spy support */ | 422 | /* Driver enhanced spy support */ |
| 423 | struct iw_spy_data * spy_data; | 423 | struct iw_spy_data * spy_data; |
| 424 | /* Structure managed by the in-kernel IEEE 802.11 layer */ | 424 | /* Legacy structure managed by the ipw2x00-specific IEEE 802.11 layer */ |
| 425 | struct ieee80211_device * ieee80211; | 425 | struct libipw_device * libipw; |
| 426 | }; | 426 | }; |
| 427 | 427 | ||
| 428 | /**************************** PROTOTYPES ****************************/ | 428 | /**************************** PROTOTYPES ****************************/ |
| @@ -443,7 +443,7 @@ extern int dev_get_wireless_info(char * buffer, char **start, off_t offset, | |||
| 443 | extern void wireless_send_event(struct net_device * dev, | 443 | extern void wireless_send_event(struct net_device * dev, |
| 444 | unsigned int cmd, | 444 | unsigned int cmd, |
| 445 | union iwreq_data * wrqu, | 445 | union iwreq_data * wrqu, |
| 446 | char * extra); | 446 | const char * extra); |
| 447 | 447 | ||
| 448 | /* We may need a function to send a stream of events to user space. | 448 | /* We may need a function to send a stream of events to user space. |
| 449 | * More on that later... */ | 449 | * More on that later... */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index c06104476973..466859b285e1 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -73,6 +73,21 @@ | |||
| 73 | */ | 73 | */ |
| 74 | 74 | ||
| 75 | /** | 75 | /** |
| 76 | * DOC: mac80211 workqueue | ||
| 77 | * | ||
| 78 | * mac80211 provides its own workqueue for drivers and internal mac80211 use. | ||
| 79 | * The workqueue is a single threaded workqueue and can only be accessed by | ||
| 80 | * helpers for sanity checking. Drivers must ensure all work added onto the | ||
| 81 | * mac80211 workqueue should be cancelled on the driver stop() callback. | ||
| 82 | * | ||
| 83 | * mac80211 will flushed the workqueue upon interface removal and during | ||
| 84 | * suspend. | ||
| 85 | * | ||
| 86 | * All work performed on the mac80211 workqueue must not acquire the RTNL lock. | ||
| 87 | * | ||
| 88 | */ | ||
| 89 | |||
| 90 | /** | ||
| 76 | * enum ieee80211_max_queues - maximum number of queues | 91 | * enum ieee80211_max_queues - maximum number of queues |
| 77 | * | 92 | * |
| 78 | * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. | 93 | * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues. |
| @@ -224,7 +239,14 @@ struct ieee80211_bss_conf { | |||
| 224 | * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU | 239 | * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU |
| 225 | * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211. | 240 | * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211. |
| 226 | * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted | 241 | * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted |
| 227 | * because the destination STA was in powersave mode. | 242 | * because the destination STA was in powersave mode. Note that to |
| 243 | * avoid race conditions, the filter must be set by the hardware or | ||
| 244 | * firmware upon receiving a frame that indicates that the station | ||
| 245 | * went to sleep (must be done on device to filter frames already on | ||
| 246 | * the queue) and may only be unset after mac80211 gives the OK for | ||
| 247 | * that by setting the IEEE80211_TX_CTL_CLEAR_PS_FILT (see above), | ||
| 248 | * since only then is it guaranteed that no more frames are in the | ||
| 249 | * hardware queue. | ||
| 228 | * @IEEE80211_TX_STAT_ACK: Frame was acknowledged | 250 | * @IEEE80211_TX_STAT_ACK: Frame was acknowledged |
| 229 | * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status | 251 | * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status |
| 230 | * is for the whole aggregation. | 252 | * is for the whole aggregation. |
| @@ -241,6 +263,15 @@ struct ieee80211_bss_conf { | |||
| 241 | * it can be sent out. | 263 | * it can be sent out. |
| 242 | * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, | 264 | * @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211, |
| 243 | * used to indicate that a frame was already retried due to PS | 265 | * used to indicate that a frame was already retried due to PS |
| 266 | * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, | ||
| 267 | * used to indicate frame should not be encrypted | ||
| 268 | * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?) | ||
| 269 | * This frame is a response to a PS-poll frame and should be sent | ||
| 270 | * although the station is in powersave mode. | ||
| 271 | * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the | ||
| 272 | * transmit function after the current frame, this can be used | ||
| 273 | * by drivers to kick the DMA queue only if unset or when the | ||
| 274 | * queue gets full. | ||
| 244 | */ | 275 | */ |
| 245 | enum mac80211_tx_control_flags { | 276 | enum mac80211_tx_control_flags { |
| 246 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 277 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
| @@ -259,6 +290,9 @@ enum mac80211_tx_control_flags { | |||
| 259 | IEEE80211_TX_INTFL_RCALGO = BIT(13), | 290 | IEEE80211_TX_INTFL_RCALGO = BIT(13), |
| 260 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), | 291 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), |
| 261 | IEEE80211_TX_INTFL_RETRIED = BIT(15), | 292 | IEEE80211_TX_INTFL_RETRIED = BIT(15), |
| 293 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), | ||
| 294 | IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), | ||
| 295 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), | ||
| 262 | }; | 296 | }; |
| 263 | 297 | ||
| 264 | /** | 298 | /** |
| @@ -316,6 +350,21 @@ enum mac80211_rate_control_flags { | |||
| 316 | * | 350 | * |
| 317 | * When used for transmit status reporting, the driver should | 351 | * When used for transmit status reporting, the driver should |
| 318 | * always report the rate along with the flags it used. | 352 | * always report the rate along with the flags it used. |
| 353 | * | ||
| 354 | * &struct ieee80211_tx_info contains an array of these structs | ||
| 355 | * in the control information, and it will be filled by the rate | ||
| 356 | * control algorithm according to what should be sent. For example, | ||
| 357 | * if this array contains, in the format { <idx>, <count> } the | ||
| 358 | * information | ||
| 359 | * { 3, 2 }, { 2, 2 }, { 1, 4 }, { -1, 0 }, { -1, 0 } | ||
| 360 | * then this means that the frame should be transmitted | ||
| 361 | * up to twice at rate 3, up to twice at rate 2, and up to four | ||
| 362 | * times at rate 1 if it doesn't get acknowledged. Say it gets | ||
| 363 | * acknowledged by the peer after the fifth attempt, the status | ||
| 364 | * information should then contain | ||
| 365 | * { 3, 2 }, { 2, 2 }, { 1, 1 }, { -1, 0 } ... | ||
| 366 | * since it was transmitted twice at rate 3, twice at rate 2 | ||
| 367 | * and once at rate 1 after which we received an acknowledgement. | ||
| 319 | */ | 368 | */ |
| 320 | struct ieee80211_tx_rate { | 369 | struct ieee80211_tx_rate { |
| 321 | s8 idx; | 370 | s8 idx; |
| @@ -397,6 +446,11 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb) | |||
| 397 | return (struct ieee80211_tx_info *)skb->cb; | 446 | return (struct ieee80211_tx_info *)skb->cb; |
| 398 | } | 447 | } |
| 399 | 448 | ||
| 449 | static inline struct ieee80211_rx_status *IEEE80211_SKB_RXCB(struct sk_buff *skb) | ||
| 450 | { | ||
| 451 | return (struct ieee80211_rx_status *)skb->cb; | ||
| 452 | } | ||
| 453 | |||
| 400 | /** | 454 | /** |
| 401 | * ieee80211_tx_info_clear_status - clear TX status | 455 | * ieee80211_tx_info_clear_status - clear TX status |
| 402 | * | 456 | * |
| @@ -478,7 +532,7 @@ enum mac80211_rx_flags { | |||
| 478 | * | 532 | * |
| 479 | * The low-level driver should provide this information (the subset | 533 | * The low-level driver should provide this information (the subset |
| 480 | * supported by hardware) to the 802.11 code with each received | 534 | * supported by hardware) to the 802.11 code with each received |
| 481 | * frame. | 535 | * frame, in the skb's control buffer (cb). |
| 482 | * | 536 | * |
| 483 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function | 537 | * @mactime: value in microseconds of the 64-bit Time Synchronization Function |
| 484 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. | 538 | * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. |
| @@ -529,7 +583,6 @@ enum ieee80211_conf_flags { | |||
| 529 | /** | 583 | /** |
| 530 | * enum ieee80211_conf_changed - denotes which configuration changed | 584 | * enum ieee80211_conf_changed - denotes which configuration changed |
| 531 | * | 585 | * |
| 532 | * @_IEEE80211_CONF_CHANGE_RADIO_ENABLED: DEPRECATED | ||
| 533 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed | 586 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed |
| 534 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed | 587 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed |
| 535 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed | 588 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed |
| @@ -539,7 +592,6 @@ enum ieee80211_conf_flags { | |||
| 539 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 592 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
| 540 | */ | 593 | */ |
| 541 | enum ieee80211_conf_changed { | 594 | enum ieee80211_conf_changed { |
| 542 | _IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0), | ||
| 543 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), | 595 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), |
| 544 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), | 596 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), |
| 545 | IEEE80211_CONF_CHANGE_PS = BIT(4), | 597 | IEEE80211_CONF_CHANGE_PS = BIT(4), |
| @@ -549,14 +601,6 @@ enum ieee80211_conf_changed { | |||
| 549 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), | 601 | IEEE80211_CONF_CHANGE_IDLE = BIT(8), |
| 550 | }; | 602 | }; |
| 551 | 603 | ||
| 552 | static inline __deprecated enum ieee80211_conf_changed | ||
| 553 | __IEEE80211_CONF_CHANGE_RADIO_ENABLED(void) | ||
| 554 | { | ||
| 555 | return _IEEE80211_CONF_CHANGE_RADIO_ENABLED; | ||
| 556 | } | ||
| 557 | #define IEEE80211_CONF_CHANGE_RADIO_ENABLED \ | ||
| 558 | __IEEE80211_CONF_CHANGE_RADIO_ENABLED() | ||
| 559 | |||
| 560 | /** | 604 | /** |
| 561 | * struct ieee80211_conf - configuration of the device | 605 | * struct ieee80211_conf - configuration of the device |
| 562 | * | 606 | * |
| @@ -564,9 +608,6 @@ __IEEE80211_CONF_CHANGE_RADIO_ENABLED(void) | |||
| 564 | * | 608 | * |
| 565 | * @flags: configuration flags defined above | 609 | * @flags: configuration flags defined above |
| 566 | * | 610 | * |
| 567 | * @radio_enabled: when zero, driver is required to switch off the radio. | ||
| 568 | * @beacon_int: DEPRECATED, DO NOT USE | ||
| 569 | * | ||
| 570 | * @listen_interval: listen interval in units of beacon interval | 611 | * @listen_interval: listen interval in units of beacon interval |
| 571 | * @max_sleep_period: the maximum number of beacon intervals to sleep for | 612 | * @max_sleep_period: the maximum number of beacon intervals to sleep for |
| 572 | * before checking the beacon for a TIM bit (managed mode only); this | 613 | * before checking the beacon for a TIM bit (managed mode only); this |
| @@ -590,13 +631,11 @@ __IEEE80211_CONF_CHANGE_RADIO_ENABLED(void) | |||
| 590 | * number of transmissions not the number of retries | 631 | * number of transmissions not the number of retries |
| 591 | */ | 632 | */ |
| 592 | struct ieee80211_conf { | 633 | struct ieee80211_conf { |
| 593 | int __deprecated beacon_int; | ||
| 594 | u32 flags; | 634 | u32 flags; |
| 595 | int power_level, dynamic_ps_timeout; | 635 | int power_level, dynamic_ps_timeout; |
| 596 | int max_sleep_period; | 636 | int max_sleep_period; |
| 597 | 637 | ||
| 598 | u16 listen_interval; | 638 | u16 listen_interval; |
| 599 | bool __deprecated radio_enabled; | ||
| 600 | 639 | ||
| 601 | u8 long_frame_max_tx_count, short_frame_max_tx_count; | 640 | u8 long_frame_max_tx_count, short_frame_max_tx_count; |
| 602 | 641 | ||
| @@ -901,12 +940,6 @@ enum ieee80211_hw_flags { | |||
| 901 | * | 940 | * |
| 902 | * @conf: &struct ieee80211_conf, device configuration, don't use. | 941 | * @conf: &struct ieee80211_conf, device configuration, don't use. |
| 903 | * | 942 | * |
| 904 | * @workqueue: single threaded workqueue available for driver use, | ||
| 905 | * allocated by mac80211 on registration and flushed when an | ||
| 906 | * interface is removed. | ||
| 907 | * NOTICE: All work performed on this workqueue must not | ||
| 908 | * acquire the RTNL lock. | ||
| 909 | * | ||
| 910 | * @priv: pointer to private area that was allocated for driver use | 943 | * @priv: pointer to private area that was allocated for driver use |
| 911 | * along with this structure. | 944 | * along with this structure. |
| 912 | * | 945 | * |
| @@ -942,7 +975,6 @@ enum ieee80211_hw_flags { | |||
| 942 | struct ieee80211_hw { | 975 | struct ieee80211_hw { |
| 943 | struct ieee80211_conf conf; | 976 | struct ieee80211_conf conf; |
| 944 | struct wiphy *wiphy; | 977 | struct wiphy *wiphy; |
| 945 | struct workqueue_struct *workqueue; | ||
| 946 | const char *rate_control_algorithm; | 978 | const char *rate_control_algorithm; |
| 947 | void *priv; | 979 | void *priv; |
| 948 | u32 flags; | 980 | u32 flags; |
| @@ -1172,10 +1204,13 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1172 | * the driver's configure_filter() function which frames should be | 1204 | * the driver's configure_filter() function which frames should be |
| 1173 | * passed to mac80211 and which should be filtered out. | 1205 | * passed to mac80211 and which should be filtered out. |
| 1174 | * | 1206 | * |
| 1175 | * The configure_filter() callback is invoked with the parameters | 1207 | * Before configure_filter() is invoked, the prepare_multicast() |
| 1176 | * @mc_count and @mc_list for the combined multicast address list | 1208 | * callback is invoked with the parameters @mc_count and @mc_list |
| 1177 | * of all virtual interfaces, @changed_flags telling which flags | 1209 | * for the combined multicast address list of all virtual interfaces. |
| 1178 | * were changed and @total_flags with the new flag states. | 1210 | * It's use is optional, and it returns a u64 that is passed to |
| 1211 | * configure_filter(). Additionally, configure_filter() has the | ||
| 1212 | * arguments @changed_flags telling which flags were changed and | ||
| 1213 | * @total_flags with the new flag states. | ||
| 1179 | * | 1214 | * |
| 1180 | * If your device has no multicast address filters your driver will | 1215 | * If your device has no multicast address filters your driver will |
| 1181 | * need to check both the %FIF_ALLMULTI flag and the @mc_count | 1216 | * need to check both the %FIF_ALLMULTI flag and the @mc_count |
| @@ -1224,10 +1259,13 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1224 | * mac80211 needs to do and the amount of CPU wakeups, so you should | 1259 | * mac80211 needs to do and the amount of CPU wakeups, so you should |
| 1225 | * honour this flag if possible. | 1260 | * honour this flag if possible. |
| 1226 | * | 1261 | * |
| 1227 | * @FIF_CONTROL: pass control frames, if PROMISC_IN_BSS is not set then | 1262 | * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS |
| 1228 | * only those addressed to this station | 1263 | * is not set then only those addressed to this station. |
| 1229 | * | 1264 | * |
| 1230 | * @FIF_OTHER_BSS: pass frames destined to other BSSes | 1265 | * @FIF_OTHER_BSS: pass frames destined to other BSSes |
| 1266 | * | ||
| 1267 | * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only | ||
| 1268 | * those addressed to this station. | ||
| 1231 | */ | 1269 | */ |
| 1232 | enum ieee80211_filter_flags { | 1270 | enum ieee80211_filter_flags { |
| 1233 | FIF_PROMISC_IN_BSS = 1<<0, | 1271 | FIF_PROMISC_IN_BSS = 1<<0, |
| @@ -1237,6 +1275,7 @@ enum ieee80211_filter_flags { | |||
| 1237 | FIF_BCN_PRBRESP_PROMISC = 1<<4, | 1275 | FIF_BCN_PRBRESP_PROMISC = 1<<4, |
| 1238 | FIF_CONTROL = 1<<5, | 1276 | FIF_CONTROL = 1<<5, |
| 1239 | FIF_OTHER_BSS = 1<<6, | 1277 | FIF_OTHER_BSS = 1<<6, |
| 1278 | FIF_PSPOLL = 1<<7, | ||
| 1240 | }; | 1279 | }; |
| 1241 | 1280 | ||
| 1242 | /** | 1281 | /** |
| @@ -1289,7 +1328,8 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1289 | * is disabled. This should turn off the hardware (at least | 1328 | * is disabled. This should turn off the hardware (at least |
| 1290 | * it must turn off frame reception.) | 1329 | * it must turn off frame reception.) |
| 1291 | * May be called right after add_interface if that rejects | 1330 | * May be called right after add_interface if that rejects |
| 1292 | * an interface. | 1331 | * an interface. If you added any work onto the mac80211 workqueue |
| 1332 | * you should ensure to cancel it on this callback. | ||
| 1293 | * Must be implemented. | 1333 | * Must be implemented. |
| 1294 | * | 1334 | * |
| 1295 | * @add_interface: Called when a netdevice attached to the hardware is | 1335 | * @add_interface: Called when a netdevice attached to the hardware is |
| @@ -1323,9 +1363,13 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1323 | * for association indication. The @changed parameter indicates which | 1363 | * for association indication. The @changed parameter indicates which |
| 1324 | * of the bss parameters has changed when a call is made. | 1364 | * of the bss parameters has changed when a call is made. |
| 1325 | * | 1365 | * |
| 1366 | * @prepare_multicast: Prepare for multicast filter configuration. | ||
| 1367 | * This callback is optional, and its return value is passed | ||
| 1368 | * to configure_filter(). This callback must be atomic. | ||
| 1369 | * | ||
| 1326 | * @configure_filter: Configure the device's RX filter. | 1370 | * @configure_filter: Configure the device's RX filter. |
| 1327 | * See the section "Frame filtering" for more information. | 1371 | * See the section "Frame filtering" for more information. |
| 1328 | * This callback must be implemented and atomic. | 1372 | * This callback must be implemented. |
| 1329 | * | 1373 | * |
| 1330 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit | 1374 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
| 1331 | * must be set or cleared for a given STA. Must be atomic. | 1375 | * must be set or cleared for a given STA. Must be atomic. |
| @@ -1411,6 +1455,8 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1411 | * @rfkill_poll: Poll rfkill hardware state. If you need this, you also | 1455 | * @rfkill_poll: Poll rfkill hardware state. If you need this, you also |
| 1412 | * need to set wiphy->rfkill_poll to %true before registration, | 1456 | * need to set wiphy->rfkill_poll to %true before registration, |
| 1413 | * and need to call wiphy_rfkill_set_hw_state() in the callback. | 1457 | * and need to call wiphy_rfkill_set_hw_state() in the callback. |
| 1458 | * | ||
| 1459 | * @testmode_cmd: Implement a cfg80211 test mode command. | ||
| 1414 | */ | 1460 | */ |
| 1415 | struct ieee80211_ops { | 1461 | struct ieee80211_ops { |
| 1416 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1462 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| @@ -1425,10 +1471,12 @@ struct ieee80211_ops { | |||
| 1425 | struct ieee80211_vif *vif, | 1471 | struct ieee80211_vif *vif, |
| 1426 | struct ieee80211_bss_conf *info, | 1472 | struct ieee80211_bss_conf *info, |
| 1427 | u32 changed); | 1473 | u32 changed); |
| 1474 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | ||
| 1475 | int mc_count, struct dev_addr_list *mc_list); | ||
| 1428 | void (*configure_filter)(struct ieee80211_hw *hw, | 1476 | void (*configure_filter)(struct ieee80211_hw *hw, |
| 1429 | unsigned int changed_flags, | 1477 | unsigned int changed_flags, |
| 1430 | unsigned int *total_flags, | 1478 | unsigned int *total_flags, |
| 1431 | int mc_count, struct dev_addr_list *mc_list); | 1479 | u64 multicast); |
| 1432 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, | 1480 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
| 1433 | bool set); | 1481 | bool set); |
| 1434 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 1482 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
| @@ -1461,6 +1509,9 @@ struct ieee80211_ops { | |||
| 1461 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1509 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
| 1462 | 1510 | ||
| 1463 | void (*rfkill_poll)(struct ieee80211_hw *hw); | 1511 | void (*rfkill_poll)(struct ieee80211_hw *hw); |
| 1512 | #ifdef CONFIG_NL80211_TESTMODE | ||
| 1513 | int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); | ||
| 1514 | #endif | ||
| 1464 | }; | 1515 | }; |
| 1465 | 1516 | ||
| 1466 | /** | 1517 | /** |
| @@ -1606,10 +1657,6 @@ void ieee80211_free_hw(struct ieee80211_hw *hw); | |||
| 1606 | */ | 1657 | */ |
| 1607 | void ieee80211_restart_hw(struct ieee80211_hw *hw); | 1658 | void ieee80211_restart_hw(struct ieee80211_hw *hw); |
| 1608 | 1659 | ||
| 1609 | /* trick to avoid symbol clashes with the ieee80211 subsystem */ | ||
| 1610 | void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | ||
| 1611 | struct ieee80211_rx_status *status); | ||
| 1612 | |||
| 1613 | /** | 1660 | /** |
| 1614 | * ieee80211_rx - receive frame | 1661 | * ieee80211_rx - receive frame |
| 1615 | * | 1662 | * |
| @@ -1624,14 +1671,8 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
| 1624 | * | 1671 | * |
| 1625 | * @hw: the hardware this frame came in on | 1672 | * @hw: the hardware this frame came in on |
| 1626 | * @skb: the buffer to receive, owned by mac80211 after this call | 1673 | * @skb: the buffer to receive, owned by mac80211 after this call |
| 1627 | * @status: status of this frame; the status pointer need not be valid | ||
| 1628 | * after this function returns | ||
| 1629 | */ | 1674 | */ |
| 1630 | static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | 1675 | void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); |
| 1631 | struct ieee80211_rx_status *status) | ||
| 1632 | { | ||
| 1633 | __ieee80211_rx(hw, skb, status); | ||
| 1634 | } | ||
| 1635 | 1676 | ||
| 1636 | /** | 1677 | /** |
| 1637 | * ieee80211_rx_irqsafe - receive frame | 1678 | * ieee80211_rx_irqsafe - receive frame |
| @@ -1644,13 +1685,8 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
| 1644 | * | 1685 | * |
| 1645 | * @hw: the hardware this frame came in on | 1686 | * @hw: the hardware this frame came in on |
| 1646 | * @skb: the buffer to receive, owned by mac80211 after this call | 1687 | * @skb: the buffer to receive, owned by mac80211 after this call |
| 1647 | * @status: status of this frame; the status pointer need not be valid | ||
| 1648 | * after this function returns and is not freed by mac80211, | ||
| 1649 | * it is recommended that it points to a stack area | ||
| 1650 | */ | 1688 | */ |
| 1651 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, | 1689 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); |
| 1652 | struct sk_buff *skb, | ||
| 1653 | struct ieee80211_rx_status *status); | ||
| 1654 | 1690 | ||
| 1655 | /** | 1691 | /** |
| 1656 | * ieee80211_tx_status - transmit status callback | 1692 | * ieee80211_tx_status - transmit status callback |
| @@ -1917,6 +1953,31 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | |||
| 1917 | void *data); | 1953 | void *data); |
| 1918 | 1954 | ||
| 1919 | /** | 1955 | /** |
| 1956 | * ieee80211_queue_work - add work onto the mac80211 workqueue | ||
| 1957 | * | ||
| 1958 | * Drivers and mac80211 use this to add work onto the mac80211 workqueue. | ||
| 1959 | * This helper ensures drivers are not queueing work when they should not be. | ||
| 1960 | * | ||
| 1961 | * @hw: the hardware struct for the interface we are adding work for | ||
| 1962 | * @work: the work we want to add onto the mac80211 workqueue | ||
| 1963 | */ | ||
| 1964 | void ieee80211_queue_work(struct ieee80211_hw *hw, struct work_struct *work); | ||
| 1965 | |||
| 1966 | /** | ||
| 1967 | * ieee80211_queue_delayed_work - add work onto the mac80211 workqueue | ||
| 1968 | * | ||
| 1969 | * Drivers and mac80211 use this to queue delayed work onto the mac80211 | ||
| 1970 | * workqueue. | ||
| 1971 | * | ||
| 1972 | * @hw: the hardware struct for the interface we are adding work for | ||
| 1973 | * @dwork: delayable work to queue onto the mac80211 workqueue | ||
| 1974 | * @delay: number of jiffies to wait before queueing | ||
| 1975 | */ | ||
| 1976 | void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | ||
| 1977 | struct delayed_work *dwork, | ||
| 1978 | unsigned long delay); | ||
| 1979 | |||
| 1980 | /** | ||
| 1920 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 1981 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
| 1921 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 1982 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
| 1922 | * @ra: receiver address of the BA session recipient | 1983 | * @ra: receiver address of the BA session recipient |
| @@ -2090,6 +2151,29 @@ static inline int rate_supported(struct ieee80211_sta *sta, | |||
| 2090 | return (sta == NULL || sta->supp_rates[band] & BIT(index)); | 2151 | return (sta == NULL || sta->supp_rates[band] & BIT(index)); |
| 2091 | } | 2152 | } |
| 2092 | 2153 | ||
| 2154 | /** | ||
| 2155 | * rate_control_send_low - helper for drivers for management/no-ack frames | ||
| 2156 | * | ||
| 2157 | * Rate control algorithms that agree to use the lowest rate to | ||
| 2158 | * send management frames and NO_ACK data with the respective hw | ||
| 2159 | * retries should use this in the beginning of their mac80211 get_rate | ||
| 2160 | * callback. If true is returned the rate control can simply return. | ||
| 2161 | * If false is returned we guarantee that sta and sta and priv_sta is | ||
| 2162 | * not null. | ||
| 2163 | * | ||
| 2164 | * Rate control algorithms wishing to do more intelligent selection of | ||
| 2165 | * rate for multicast/broadcast frames may choose to not use this. | ||
| 2166 | * | ||
| 2167 | * @sta: &struct ieee80211_sta pointer to the target destination. Note | ||
| 2168 | * that this may be null. | ||
| 2169 | * @priv_sta: private rate control structure. This may be null. | ||
| 2170 | * @txrc: rate control information we sholud populate for mac80211. | ||
| 2171 | */ | ||
| 2172 | bool rate_control_send_low(struct ieee80211_sta *sta, | ||
| 2173 | void *priv_sta, | ||
| 2174 | struct ieee80211_tx_rate_control *txrc); | ||
| 2175 | |||
| 2176 | |||
| 2093 | static inline s8 | 2177 | static inline s8 |
| 2094 | rate_lowest_index(struct ieee80211_supported_band *sband, | 2178 | rate_lowest_index(struct ieee80211_supported_band *sband, |
| 2095 | struct ieee80211_sta *sta) | 2179 | struct ieee80211_sta *sta) |
| @@ -2106,6 +2190,17 @@ rate_lowest_index(struct ieee80211_supported_band *sband, | |||
| 2106 | return 0; | 2190 | return 0; |
| 2107 | } | 2191 | } |
| 2108 | 2192 | ||
| 2193 | static inline | ||
| 2194 | bool rate_usable_index_exists(struct ieee80211_supported_band *sband, | ||
| 2195 | struct ieee80211_sta *sta) | ||
| 2196 | { | ||
| 2197 | unsigned int i; | ||
| 2198 | |||
| 2199 | for (i = 0; i < sband->n_bitrates; i++) | ||
| 2200 | if (rate_supported(sta, sband->band, i)) | ||
| 2201 | return true; | ||
| 2202 | return false; | ||
| 2203 | } | ||
| 2109 | 2204 | ||
| 2110 | int ieee80211_rate_control_register(struct rate_control_ops *ops); | 2205 | int ieee80211_rate_control_register(struct rate_control_ops *ops); |
| 2111 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); | 2206 | void ieee80211_rate_control_unregister(struct rate_control_ops *ops); |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index d8d790e56d3d..3817fda82a80 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/err.h> | 25 | #include <linux/err.h> |
| 26 | #include <linux/sysctl.h> | 26 | #include <linux/sysctl.h> |
| 27 | #include <linux/workqueue.h> | ||
| 27 | #include <net/rtnetlink.h> | 28 | #include <net/rtnetlink.h> |
| 28 | 29 | ||
| 29 | /* | 30 | /* |
| @@ -117,7 +118,7 @@ struct neighbour | |||
| 117 | int (*output)(struct sk_buff *skb); | 118 | int (*output)(struct sk_buff *skb); |
| 118 | struct sk_buff_head arp_queue; | 119 | struct sk_buff_head arp_queue; |
| 119 | struct timer_list timer; | 120 | struct timer_list timer; |
| 120 | struct neigh_ops *ops; | 121 | const struct neigh_ops *ops; |
| 121 | u8 primary_key[0]; | 122 | u8 primary_key[0]; |
| 122 | }; | 123 | }; |
| 123 | 124 | ||
| @@ -167,7 +168,7 @@ struct neigh_table | |||
| 167 | int gc_thresh2; | 168 | int gc_thresh2; |
| 168 | int gc_thresh3; | 169 | int gc_thresh3; |
| 169 | unsigned long last_flush; | 170 | unsigned long last_flush; |
| 170 | struct timer_list gc_timer; | 171 | struct delayed_work gc_work; |
| 171 | struct timer_list proxy_timer; | 172 | struct timer_list proxy_timer; |
| 172 | struct sk_buff_head proxy_queue; | 173 | struct sk_buff_head proxy_queue; |
| 173 | atomic_t entries; | 174 | atomic_t entries; |
| @@ -178,7 +179,6 @@ struct neigh_table | |||
| 178 | struct neighbour **hash_buckets; | 179 | struct neighbour **hash_buckets; |
| 179 | unsigned int hash_mask; | 180 | unsigned int hash_mask; |
| 180 | __u32 hash_rnd; | 181 | __u32 hash_rnd; |
| 181 | unsigned int hash_chain_gc; | ||
| 182 | struct pneigh_entry **phash_buckets; | 182 | struct pneigh_entry **phash_buckets; |
| 183 | }; | 183 | }; |
| 184 | 184 | ||
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index ded434b032a4..a1202841aadd 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -26,6 +26,7 @@ struct net_device; | |||
| 26 | struct sock; | 26 | struct sock; |
| 27 | struct ctl_table_header; | 27 | struct ctl_table_header; |
| 28 | struct net_generic; | 28 | struct net_generic; |
| 29 | struct sock; | ||
| 29 | 30 | ||
| 30 | struct net { | 31 | struct net { |
| 31 | atomic_t count; /* To decided when the network | 32 | atomic_t count; /* To decided when the network |
| @@ -57,6 +58,7 @@ struct net { | |||
| 57 | spinlock_t rules_mod_lock; | 58 | spinlock_t rules_mod_lock; |
| 58 | 59 | ||
| 59 | struct sock *rtnl; /* rtnetlink socket */ | 60 | struct sock *rtnl; /* rtnetlink socket */ |
| 61 | struct sock *genl_sock; | ||
| 60 | 62 | ||
| 61 | struct netns_core core; | 63 | struct netns_core core; |
| 62 | struct netns_mib mib; | 64 | struct netns_mib mib; |
| @@ -78,6 +80,9 @@ struct net { | |||
| 78 | #ifdef CONFIG_XFRM | 80 | #ifdef CONFIG_XFRM |
| 79 | struct netns_xfrm xfrm; | 81 | struct netns_xfrm xfrm; |
| 80 | #endif | 82 | #endif |
| 83 | #ifdef CONFIG_WIRELESS_EXT | ||
| 84 | struct sk_buff_head wext_nlevents; | ||
| 85 | #endif | ||
| 81 | struct net_generic *gen; | 86 | struct net_generic *gen; |
| 82 | }; | 87 | }; |
| 83 | 88 | ||
| @@ -106,6 +111,8 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | |||
| 106 | 111 | ||
| 107 | extern struct list_head net_namespace_list; | 112 | extern struct list_head net_namespace_list; |
| 108 | 113 | ||
| 114 | extern struct net *get_net_ns_by_pid(pid_t pid); | ||
| 115 | |||
| 109 | #ifdef CONFIG_NET_NS | 116 | #ifdef CONFIG_NET_NS |
| 110 | extern void __put_net(struct net *net); | 117 | extern void __put_net(struct net *net); |
| 111 | 118 | ||
| @@ -208,6 +215,9 @@ static inline struct net *read_pnet(struct net * const *pnet) | |||
| 208 | #define for_each_net(VAR) \ | 215 | #define for_each_net(VAR) \ |
| 209 | list_for_each_entry(VAR, &net_namespace_list, list) | 216 | list_for_each_entry(VAR, &net_namespace_list, list) |
| 210 | 217 | ||
| 218 | #define for_each_net_rcu(VAR) \ | ||
| 219 | list_for_each_entry_rcu(VAR, &net_namespace_list, list) | ||
| 220 | |||
| 211 | #ifdef CONFIG_NET_NS | 221 | #ifdef CONFIG_NET_NS |
| 212 | #define __net_init | 222 | #define __net_init |
| 213 | #define __net_exit | 223 | #define __net_exit |
| @@ -229,13 +239,15 @@ struct pernet_operations { | |||
| 229 | * needs per network namespace operations use device pernet operations, | 239 | * needs per network namespace operations use device pernet operations, |
| 230 | * otherwise use pernet subsys operations. | 240 | * otherwise use pernet subsys operations. |
| 231 | * | 241 | * |
| 232 | * This is critically important. Most of the network code cleanup | 242 | * Network interfaces need to be removed from a dying netns _before_ |
| 233 | * runs with the assumption that dev_remove_pack has been called so no | 243 | * subsys notifiers can be called, as most of the network code cleanup |
| 234 | * new packets will arrive during and after the cleanup functions have | 244 | * (which is done from subsys notifiers) runs with the assumption that |
| 235 | * been called. dev_remove_pack is not per namespace so instead the | 245 | * dev_remove_pack has been called so no new packets will arrive during |
| 236 | * guarantee of no more packets arriving in a network namespace is | 246 | * and after the cleanup functions have been called. dev_remove_pack |
| 237 | * provided by ensuring that all network devices and all sockets have | 247 | * is not per namespace so instead the guarantee of no more packets |
| 238 | * left the network namespace before the cleanup methods are called. | 248 | * arriving in a network namespace is provided by ensuring that all |
| 249 | * network devices and all sockets have left the network namespace | ||
| 250 | * before the cleanup methods are called. | ||
| 239 | * | 251 | * |
| 240 | * For the longest time the ipv4 icmp code was registered as a pernet | 252 | * For the longest time the ipv4 icmp code was registered as a pernet |
| 241 | * device which caused kernel oops, and panics during network | 253 | * device which caused kernel oops, and panics during network |
diff --git a/include/net/netfilter/nf_nat_core.h b/include/net/netfilter/nf_nat_core.h index 58684066388c..33602ab66190 100644 --- a/include/net/netfilter/nf_nat_core.h +++ b/include/net/netfilter/nf_nat_core.h | |||
| @@ -31,6 +31,6 @@ struct nlattr; | |||
| 31 | extern int | 31 | extern int |
| 32 | (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, | 32 | (*nfnetlink_parse_nat_setup_hook)(struct nf_conn *ct, |
| 33 | enum nf_nat_manip_type manip, | 33 | enum nf_nat_manip_type manip, |
| 34 | struct nlattr *attr); | 34 | const struct nlattr *attr); |
| 35 | 35 | ||
| 36 | #endif /* _NF_NAT_CORE_H */ | 36 | #endif /* _NF_NAT_CORE_H */ |
diff --git a/include/net/netfilter/xt_rateest.h b/include/net/netfilter/xt_rateest.h index 65d594dffbff..ddbf37e19616 100644 --- a/include/net/netfilter/xt_rateest.h +++ b/include/net/netfilter/xt_rateest.h | |||
| @@ -8,7 +8,7 @@ struct xt_rateest { | |||
| 8 | spinlock_t lock; | 8 | spinlock_t lock; |
| 9 | struct gnet_estimator params; | 9 | struct gnet_estimator params; |
| 10 | struct gnet_stats_rate_est rstats; | 10 | struct gnet_stats_rate_est rstats; |
| 11 | struct gnet_stats_basic bstats; | 11 | struct gnet_stats_basic_packed bstats; |
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | extern struct xt_rateest *xt_rateest_lookup(const char *name); | 14 | extern struct xt_rateest *xt_rateest_lookup(const char *name); |
diff --git a/include/net/netlink.h b/include/net/netlink.h index 007bdb07dabb..a63b2192ac1c 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
| @@ -365,7 +365,7 @@ static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) | |||
| 365 | * | 365 | * |
| 366 | * See nla_parse() | 366 | * See nla_parse() |
| 367 | */ | 367 | */ |
| 368 | static inline int nlmsg_parse(struct nlmsghdr *nlh, int hdrlen, | 368 | static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, |
| 369 | struct nlattr *tb[], int maxtype, | 369 | struct nlattr *tb[], int maxtype, |
| 370 | const struct nla_policy *policy) | 370 | const struct nla_policy *policy) |
| 371 | { | 371 | { |
| @@ -414,7 +414,7 @@ static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, | |||
| 414 | * | 414 | * |
| 415 | * Returns 1 if a report back to the application is requested. | 415 | * Returns 1 if a report back to the application is requested. |
| 416 | */ | 416 | */ |
| 417 | static inline int nlmsg_report(struct nlmsghdr *nlh) | 417 | static inline int nlmsg_report(const struct nlmsghdr *nlh) |
| 418 | { | 418 | { |
| 419 | return !!(nlh->nlmsg_flags & NLM_F_ECHO); | 419 | return !!(nlh->nlmsg_flags & NLM_F_ECHO); |
| 420 | } | 420 | } |
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h index afab4e4cbac7..dfeb2d7c425b 100644 --- a/include/net/netns/ipv6.h +++ b/include/net/netns/ipv6.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #ifndef __NETNS_IPV6_H__ | 7 | #ifndef __NETNS_IPV6_H__ |
| 8 | #define __NETNS_IPV6_H__ | 8 | #define __NETNS_IPV6_H__ |
| 9 | #include <net/dst_ops.h> | ||
| 9 | 10 | ||
| 10 | struct ctl_table_header; | 11 | struct ctl_table_header; |
| 11 | 12 | ||
| @@ -42,7 +43,7 @@ struct netns_ipv6 { | |||
| 42 | struct timer_list ip6_fib_timer; | 43 | struct timer_list ip6_fib_timer; |
| 43 | struct hlist_head *fib_table_hash; | 44 | struct hlist_head *fib_table_hash; |
| 44 | struct fib6_table *fib6_main_tbl; | 45 | struct fib6_table *fib6_main_tbl; |
| 45 | struct dst_ops *ip6_dst_ops; | 46 | struct dst_ops ip6_dst_ops; |
| 46 | unsigned int ip6_rt_gc_expire; | 47 | unsigned int ip6_rt_gc_expire; |
| 47 | unsigned long ip6_rt_last_gc; | 48 | unsigned long ip6_rt_last_gc; |
| 48 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES | 49 | #ifdef CONFIG_IPV6_MULTIPLE_TABLES |
diff --git a/include/net/netns/x_tables.h b/include/net/netns/x_tables.h index 9554a644a8f8..591db7d657a3 100644 --- a/include/net/netns/x_tables.h +++ b/include/net/netns/x_tables.h | |||
| @@ -8,8 +8,11 @@ struct ebt_table; | |||
| 8 | 8 | ||
| 9 | struct netns_xt { | 9 | struct netns_xt { |
| 10 | struct list_head tables[NFPROTO_NUMPROTO]; | 10 | struct list_head tables[NFPROTO_NUMPROTO]; |
| 11 | #if defined(CONFIG_BRIDGE_NF_EBTABLES) || \ | ||
| 12 | defined(CONFIG_BRIDGE_NF_EBTABLES_MODULE) | ||
| 11 | struct ebt_table *broute_table; | 13 | struct ebt_table *broute_table; |
| 12 | struct ebt_table *frame_filter; | 14 | struct ebt_table *frame_filter; |
| 13 | struct ebt_table *frame_nat; | 15 | struct ebt_table *frame_nat; |
| 16 | #endif | ||
| 14 | }; | 17 | }; |
| 15 | #endif | 18 | #endif |
diff --git a/include/net/nl802154.h b/include/net/nl802154.h new file mode 100644 index 000000000000..99d2ba1c7e03 --- /dev/null +++ b/include/net/nl802154.h | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | /* | ||
| 2 | * nl802154.h | ||
| 3 | * | ||
| 4 | * Copyright (C) 2007, 2008, 2009 Siemens AG | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 | ||
| 8 | * as published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, | ||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | * GNU General Public License for more details. | ||
| 14 | * | ||
| 15 | * You should have received a copy of the GNU General Public License along | ||
| 16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 18 | * | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef IEEE802154_NL_H | ||
| 22 | #define IEEE802154_NL_H | ||
| 23 | |||
| 24 | struct net_device; | ||
| 25 | struct ieee802154_addr; | ||
| 26 | |||
| 27 | /** | ||
| 28 | * ieee802154_nl_assoc_indic - Notify userland of an association request. | ||
| 29 | * @dev: The network device on which this association request was | ||
| 30 | * received. | ||
| 31 | * @addr: The address of the device requesting association. | ||
| 32 | * @cap: The capability information field from the device. | ||
| 33 | * | ||
| 34 | * This informs a userland coordinator of a device requesting to | ||
| 35 | * associate with the PAN controlled by the coordinator. | ||
| 36 | * | ||
| 37 | * Note: This is in section 7.3.1 of the IEEE 802.15.4-2006 document. | ||
| 38 | */ | ||
| 39 | int ieee802154_nl_assoc_indic(struct net_device *dev, | ||
| 40 | struct ieee802154_addr *addr, u8 cap); | ||
| 41 | |||
| 42 | /** | ||
| 43 | * ieee802154_nl_assoc_confirm - Notify userland of association. | ||
| 44 | * @dev: The device which has completed association. | ||
| 45 | * @short_addr: The short address assigned to the device. | ||
| 46 | * @status: The status of the association. | ||
| 47 | * | ||
| 48 | * Inform userland of the result of an association request. If the | ||
| 49 | * association request included asking the coordinator to allocate | ||
| 50 | * a short address then it is returned in @short_addr. | ||
| 51 | * | ||
| 52 | * Note: This is in section 7.3.2 of the IEEE 802.15.4 document. | ||
| 53 | */ | ||
| 54 | int ieee802154_nl_assoc_confirm(struct net_device *dev, | ||
| 55 | u16 short_addr, u8 status); | ||
| 56 | |||
| 57 | /** | ||
| 58 | * ieee802154_nl_disassoc_indic - Notify userland of disassociation. | ||
| 59 | * @dev: The device on which disassociation was indicated. | ||
| 60 | * @addr: The device which is disassociating. | ||
| 61 | * @reason: The reason for the disassociation. | ||
| 62 | * | ||
| 63 | * Inform userland that a device has disassociated from the network. | ||
| 64 | * | ||
| 65 | * Note: This is in section 7.3.3 of the IEEE 802.15.4 document. | ||
| 66 | */ | ||
| 67 | int ieee802154_nl_disassoc_indic(struct net_device *dev, | ||
| 68 | struct ieee802154_addr *addr, u8 reason); | ||
| 69 | |||
| 70 | /** | ||
| 71 | * ieee802154_nl_disassoc_confirm - Notify userland of disassociation | ||
| 72 | * completion. | ||
| 73 | * @dev: The device on which disassociation was ordered. | ||
| 74 | * @status: The result of the disassociation. | ||
| 75 | * | ||
| 76 | * Inform userland of the result of requesting that a device | ||
| 77 | * disassociate, or the result of requesting that we disassociate from | ||
| 78 | * a PAN managed by another coordinator. | ||
| 79 | * | ||
| 80 | * Note: This is in section 7.1.4.3 of the IEEE 802.15.4 document. | ||
| 81 | */ | ||
| 82 | int ieee802154_nl_disassoc_confirm(struct net_device *dev, | ||
| 83 | u8 status); | ||
| 84 | |||
| 85 | /** | ||
| 86 | * ieee802154_nl_scan_confirm - Notify userland of completion of scan. | ||
| 87 | * @dev: The device which was instructed to scan. | ||
| 88 | * @status: The status of the scan operation. | ||
| 89 | * @scan_type: What type of scan was performed. | ||
| 90 | * @unscanned: Any channels that the device was unable to scan. | ||
| 91 | * @edl: The energy levels (if a passive scan). | ||
| 92 | * | ||
| 93 | * | ||
| 94 | * Note: This is in section 7.1.11 of the IEEE 802.15.4 document. | ||
| 95 | * Note: This API does not permit the return of an active scan result. | ||
| 96 | */ | ||
| 97 | int ieee802154_nl_scan_confirm(struct net_device *dev, | ||
| 98 | u8 status, u8 scan_type, u32 unscanned, u8 page, | ||
| 99 | u8 *edl/*, struct list_head *pan_desc_list */); | ||
| 100 | |||
| 101 | /** | ||
| 102 | * ieee802154_nl_beacon_indic - Notify userland of a received beacon. | ||
| 103 | * @dev: The device on which a beacon was received. | ||
| 104 | * @panid: The PAN of the coordinator. | ||
| 105 | * @coord_addr: The short address of the coordinator on that PAN. | ||
| 106 | * | ||
| 107 | * Note: This is in section 7.1.5 of the IEEE 802.15.4 document. | ||
| 108 | * Note: This API does not provide extended information such as what | ||
| 109 | * channel the PAN is on or what the LQI of the beacon frame was on | ||
| 110 | * receipt. | ||
| 111 | * Note: This API cannot indicate a beacon frame for a coordinator | ||
| 112 | * operating in long addressing mode. | ||
| 113 | */ | ||
| 114 | int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid, | ||
| 115 | u16 coord_addr); | ||
| 116 | |||
| 117 | /** | ||
| 118 | * ieee802154_nl_start_confirm - Notify userland of completion of start. | ||
| 119 | * @dev: The device which was instructed to scan. | ||
| 120 | * @status: The status of the scan operation. | ||
| 121 | * | ||
| 122 | * Note: This is in section 7.1.14 of the IEEE 802.15.4 document. | ||
| 123 | */ | ||
| 124 | int ieee802154_nl_start_confirm(struct net_device *dev, u8 status); | ||
| 125 | |||
| 126 | #endif | ||
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 29d126736611..44c923c9e21d 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
| @@ -49,4 +49,6 @@ void phonet_address_notify(int event, struct net_device *dev, u8 addr); | |||
| 49 | 49 | ||
| 50 | #define PN_NO_ADDR 0xff | 50 | #define PN_NO_ADDR 0xff |
| 51 | 51 | ||
| 52 | extern const struct file_operations pn_sock_seq_fops; | ||
| 53 | |||
| 52 | #endif | 54 | #endif |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index 82a3191375f5..f911ec7598ef 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
| @@ -87,6 +87,9 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, | |||
| 87 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); | 87 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); |
| 88 | extern void qdisc_put_stab(struct qdisc_size_table *tab); | 88 | extern void qdisc_put_stab(struct qdisc_size_table *tab); |
| 89 | extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); | 89 | extern void qdisc_warn_nonwc(char *txt, struct Qdisc *qdisc); |
| 90 | extern int sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q, | ||
| 91 | struct net_device *dev, struct netdev_queue *txq, | ||
| 92 | spinlock_t *root_lock); | ||
| 90 | 93 | ||
| 91 | extern void __qdisc_run(struct Qdisc *q); | 94 | extern void __qdisc_run(struct Qdisc *q); |
| 92 | 95 | ||
diff --git a/include/net/rose.h b/include/net/rose.h index cbd5364b2c8a..5ba9f02731eb 100644 --- a/include/net/rose.h +++ b/include/net/rose.h | |||
| @@ -156,7 +156,7 @@ extern int sysctl_rose_maximum_vcs; | |||
| 156 | extern int sysctl_rose_window_size; | 156 | extern int sysctl_rose_window_size; |
| 157 | extern int rosecmp(rose_address *, rose_address *); | 157 | extern int rosecmp(rose_address *, rose_address *); |
| 158 | extern int rosecmpm(rose_address *, rose_address *, unsigned short); | 158 | extern int rosecmpm(rose_address *, rose_address *, unsigned short); |
| 159 | extern const char *rose2asc(const rose_address *); | 159 | extern char *rose2asc(char *buf, const rose_address *); |
| 160 | extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); | 160 | extern struct sock *rose_find_socket(unsigned int, struct rose_neigh *); |
| 161 | extern void rose_kill_by_neigh(struct rose_neigh *); | 161 | extern void rose_kill_by_neigh(struct rose_neigh *); |
| 162 | extern unsigned int rose_new_lci(struct rose_neigh *); | 162 | extern unsigned int rose_new_lci(struct rose_neigh *); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index 3c1895e54b7f..c3aa044d3fc3 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -14,7 +14,7 @@ extern void rtnl_register(int protocol, int msgtype, | |||
| 14 | extern int rtnl_unregister(int protocol, int msgtype); | 14 | extern int rtnl_unregister(int protocol, int msgtype); |
| 15 | extern void rtnl_unregister_all(int protocol); | 15 | extern void rtnl_unregister_all(int protocol); |
| 16 | 16 | ||
| 17 | static inline int rtnl_msg_family(struct nlmsghdr *nlh) | 17 | static inline int rtnl_msg_family(const struct nlmsghdr *nlh) |
| 18 | { | 18 | { |
| 19 | if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) | 19 | if (nlmsg_len(nlh) >= sizeof(struct rtgenmsg)) |
| 20 | return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family; | 20 | return ((struct rtgenmsg *) nlmsg_data(nlh))->rtgen_family; |
| @@ -70,6 +70,9 @@ struct rtnl_link_ops { | |||
| 70 | size_t (*get_xstats_size)(const struct net_device *dev); | 70 | size_t (*get_xstats_size)(const struct net_device *dev); |
| 71 | int (*fill_xstats)(struct sk_buff *skb, | 71 | int (*fill_xstats)(struct sk_buff *skb, |
| 72 | const struct net_device *dev); | 72 | const struct net_device *dev); |
| 73 | int (*get_tx_queues)(struct net *net, struct nlattr *tb[], | ||
| 74 | unsigned int *tx_queues, | ||
| 75 | unsigned int *real_tx_queues); | ||
| 73 | }; | 76 | }; |
| 74 | 77 | ||
| 75 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); | 78 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 964ffa0d8815..88eb9de095de 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -45,6 +45,8 @@ struct Qdisc | |||
| 45 | #define TCQ_F_BUILTIN 1 | 45 | #define TCQ_F_BUILTIN 1 |
| 46 | #define TCQ_F_THROTTLED 2 | 46 | #define TCQ_F_THROTTLED 2 |
| 47 | #define TCQ_F_INGRESS 4 | 47 | #define TCQ_F_INGRESS 4 |
| 48 | #define TCQ_F_CAN_BYPASS 8 | ||
| 49 | #define TCQ_F_MQROOT 16 | ||
| 48 | #define TCQ_F_WARN_NONWC (1 << 16) | 50 | #define TCQ_F_WARN_NONWC (1 << 16) |
| 49 | int padded; | 51 | int padded; |
| 50 | struct Qdisc_ops *ops; | 52 | struct Qdisc_ops *ops; |
| @@ -72,13 +74,14 @@ struct Qdisc | |||
| 72 | */ | 74 | */ |
| 73 | unsigned long state; | 75 | unsigned long state; |
| 74 | struct sk_buff_head q; | 76 | struct sk_buff_head q; |
| 75 | struct gnet_stats_basic bstats; | 77 | struct gnet_stats_basic_packed bstats; |
| 76 | struct gnet_stats_queue qstats; | 78 | struct gnet_stats_queue qstats; |
| 77 | }; | 79 | }; |
| 78 | 80 | ||
| 79 | struct Qdisc_class_ops | 81 | struct Qdisc_class_ops |
| 80 | { | 82 | { |
| 81 | /* Child qdisc manipulation */ | 83 | /* Child qdisc manipulation */ |
| 84 | unsigned int (*select_queue)(struct Qdisc *, struct tcmsg *); | ||
| 82 | int (*graft)(struct Qdisc *, unsigned long cl, | 85 | int (*graft)(struct Qdisc *, unsigned long cl, |
| 83 | struct Qdisc *, struct Qdisc **); | 86 | struct Qdisc *, struct Qdisc **); |
| 84 | struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); | 87 | struct Qdisc * (*leaf)(struct Qdisc *, unsigned long cl); |
| @@ -121,6 +124,7 @@ struct Qdisc_ops | |||
| 121 | void (*reset)(struct Qdisc *); | 124 | void (*reset)(struct Qdisc *); |
| 122 | void (*destroy)(struct Qdisc *); | 125 | void (*destroy)(struct Qdisc *); |
| 123 | int (*change)(struct Qdisc *, struct nlattr *arg); | 126 | int (*change)(struct Qdisc *, struct nlattr *arg); |
| 127 | void (*attach)(struct Qdisc *); | ||
| 124 | 128 | ||
| 125 | int (*dump)(struct Qdisc *, struct sk_buff *); | 129 | int (*dump)(struct Qdisc *, struct sk_buff *); |
| 126 | int (*dump_stats)(struct Qdisc *, struct gnet_dump *); | 130 | int (*dump_stats)(struct Qdisc *, struct gnet_dump *); |
| @@ -182,6 +186,11 @@ struct qdisc_skb_cb { | |||
| 182 | char data[]; | 186 | char data[]; |
| 183 | }; | 187 | }; |
| 184 | 188 | ||
| 189 | static inline int qdisc_qlen(struct Qdisc *q) | ||
| 190 | { | ||
| 191 | return q->q.qlen; | ||
| 192 | } | ||
| 193 | |||
| 185 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) | 194 | static inline struct qdisc_skb_cb *qdisc_skb_cb(struct sk_buff *skb) |
| 186 | { | 195 | { |
| 187 | return (struct qdisc_skb_cb *)skb->cb; | 196 | return (struct qdisc_skb_cb *)skb->cb; |
| @@ -249,6 +258,8 @@ static inline void sch_tree_unlock(struct Qdisc *q) | |||
| 249 | 258 | ||
| 250 | extern struct Qdisc noop_qdisc; | 259 | extern struct Qdisc noop_qdisc; |
| 251 | extern struct Qdisc_ops noop_qdisc_ops; | 260 | extern struct Qdisc_ops noop_qdisc_ops; |
| 261 | extern struct Qdisc_ops pfifo_fast_ops; | ||
| 262 | extern struct Qdisc_ops mq_qdisc_ops; | ||
| 252 | 263 | ||
| 253 | struct Qdisc_class_common | 264 | struct Qdisc_class_common |
| 254 | { | 265 | { |
| @@ -296,6 +307,8 @@ extern void dev_init_scheduler(struct net_device *dev); | |||
| 296 | extern void dev_shutdown(struct net_device *dev); | 307 | extern void dev_shutdown(struct net_device *dev); |
| 297 | extern void dev_activate(struct net_device *dev); | 308 | extern void dev_activate(struct net_device *dev); |
| 298 | extern void dev_deactivate(struct net_device *dev); | 309 | extern void dev_deactivate(struct net_device *dev); |
| 310 | extern struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue, | ||
| 311 | struct Qdisc *qdisc); | ||
| 299 | extern void qdisc_reset(struct Qdisc *qdisc); | 312 | extern void qdisc_reset(struct Qdisc *qdisc); |
| 300 | extern void qdisc_destroy(struct Qdisc *qdisc); | 313 | extern void qdisc_destroy(struct Qdisc *qdisc); |
| 301 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); | 314 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); |
| @@ -387,13 +400,18 @@ static inline int qdisc_enqueue_root(struct sk_buff *skb, struct Qdisc *sch) | |||
| 387 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; | 400 | return qdisc_enqueue(skb, sch) & NET_XMIT_MASK; |
| 388 | } | 401 | } |
| 389 | 402 | ||
| 403 | static inline void __qdisc_update_bstats(struct Qdisc *sch, unsigned int len) | ||
| 404 | { | ||
| 405 | sch->bstats.bytes += len; | ||
| 406 | sch->bstats.packets++; | ||
| 407 | } | ||
| 408 | |||
| 390 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, | 409 | static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, |
| 391 | struct sk_buff_head *list) | 410 | struct sk_buff_head *list) |
| 392 | { | 411 | { |
| 393 | __skb_queue_tail(list, skb); | 412 | __skb_queue_tail(list, skb); |
| 394 | sch->qstats.backlog += qdisc_pkt_len(skb); | 413 | sch->qstats.backlog += qdisc_pkt_len(skb); |
| 395 | sch->bstats.bytes += qdisc_pkt_len(skb); | 414 | __qdisc_update_bstats(sch, qdisc_pkt_len(skb)); |
| 396 | sch->bstats.packets++; | ||
| 397 | 415 | ||
| 398 | return NET_XMIT_SUCCESS; | 416 | return NET_XMIT_SUCCESS; |
| 399 | } | 417 | } |
diff --git a/include/net/scm.h b/include/net/scm.h index f45bb6eca7d4..cf48c800e926 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
| @@ -26,7 +26,6 @@ struct scm_cookie | |||
| 26 | #ifdef CONFIG_SECURITY_NETWORK | 26 | #ifdef CONFIG_SECURITY_NETWORK |
| 27 | u32 secid; /* Passed security ID */ | 27 | u32 secid; /* Passed security ID */ |
| 28 | #endif | 28 | #endif |
| 29 | unsigned long seq; /* Connection seqno */ | ||
| 30 | }; | 29 | }; |
| 31 | 30 | ||
| 32 | extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm); | 31 | extern void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm); |
| @@ -59,7 +58,6 @@ static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | |||
| 59 | scm->creds.gid = current_gid(); | 58 | scm->creds.gid = current_gid(); |
| 60 | scm->creds.pid = task_tgid_vnr(p); | 59 | scm->creds.pid = task_tgid_vnr(p); |
| 61 | scm->fp = NULL; | 60 | scm->fp = NULL; |
| 62 | scm->seq = 0; | ||
| 63 | unix_get_peersec_dgram(sock, scm); | 61 | unix_get_peersec_dgram(sock, scm); |
| 64 | if (msg->msg_controllen <= 0) | 62 | if (msg->msg_controllen <= 0) |
| 65 | return 0; | 63 | return 0; |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 3b966802e05d..8be5135ff7aa 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
| @@ -106,6 +106,7 @@ typedef enum { | |||
| 106 | SCTP_CMD_ASSOC_SHKEY, /* generate the association shared keys */ | 106 | SCTP_CMD_ASSOC_SHKEY, /* generate the association shared keys */ |
| 107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ | 107 | SCTP_CMD_T1_RETRAN, /* Mark for retransmission after T1 timeout */ |
| 108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ | 108 | SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ |
| 109 | SCTP_CMD_SEND_MSG, /* Send the whole use message */ | ||
| 109 | SCTP_CMD_LAST | 110 | SCTP_CMD_LAST |
| 110 | } sctp_verb_t; | 111 | } sctp_verb_t; |
| 111 | 112 | ||
| @@ -139,6 +140,7 @@ typedef union { | |||
| 139 | struct sctp_ulpevent *ulpevent; | 140 | struct sctp_ulpevent *ulpevent; |
| 140 | struct sctp_packet *packet; | 141 | struct sctp_packet *packet; |
| 141 | sctp_sackhdr_t *sackh; | 142 | sctp_sackhdr_t *sackh; |
| 143 | struct sctp_datamsg *msg; | ||
| 142 | } sctp_arg_t; | 144 | } sctp_arg_t; |
| 143 | 145 | ||
| 144 | /* We are simulating ML type constructors here. | 146 | /* We are simulating ML type constructors here. |
| @@ -188,6 +190,7 @@ SCTP_ARG_CONSTRUCTOR(PEER_INIT, sctp_init_chunk_t *, init) | |||
| 188 | SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) | 190 | SCTP_ARG_CONSTRUCTOR(ULPEVENT, struct sctp_ulpevent *, ulpevent) |
| 189 | SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) | 191 | SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) |
| 190 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) | 192 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) |
| 193 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) | ||
| 191 | 194 | ||
| 192 | typedef struct { | 195 | typedef struct { |
| 193 | sctp_arg_t obj; | 196 | sctp_arg_t obj; |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index b05b0557211f..58f714a3b670 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
| @@ -231,7 +231,7 @@ typedef enum { | |||
| 231 | SCTP_SS_LISTENING = TCP_LISTEN, | 231 | SCTP_SS_LISTENING = TCP_LISTEN, |
| 232 | SCTP_SS_ESTABLISHING = TCP_SYN_SENT, | 232 | SCTP_SS_ESTABLISHING = TCP_SYN_SENT, |
| 233 | SCTP_SS_ESTABLISHED = TCP_ESTABLISHED, | 233 | SCTP_SS_ESTABLISHED = TCP_ESTABLISHED, |
| 234 | SCTP_SS_DISCONNECTING = TCP_CLOSING, | 234 | SCTP_SS_CLOSING = TCP_CLOSING, |
| 235 | } sctp_sock_state_t; | 235 | } sctp_sock_state_t; |
| 236 | 236 | ||
| 237 | /* These functions map various type to printable names. */ | 237 | /* These functions map various type to printable names. */ |
| @@ -241,7 +241,9 @@ const char *sctp_tname(const sctp_subtype_t); /* timeouts */ | |||
| 241 | const char *sctp_pname(const sctp_subtype_t); /* primitives */ | 241 | const char *sctp_pname(const sctp_subtype_t); /* primitives */ |
| 242 | 242 | ||
| 243 | /* This is a table of printable names of sctp_state_t's. */ | 243 | /* This is a table of printable names of sctp_state_t's. */ |
| 244 | extern const char *sctp_state_tbl[], *sctp_evttype_tbl[], *sctp_status_tbl[]; | 244 | extern const char *const sctp_state_tbl[]; |
| 245 | extern const char *const sctp_evttype_tbl[]; | ||
| 246 | extern const char *const sctp_status_tbl[]; | ||
| 245 | 247 | ||
| 246 | /* Maximum chunk length considering padding requirements. */ | 248 | /* Maximum chunk length considering padding requirements. */ |
| 247 | enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; | 249 | enum { SCTP_MAX_CHUNK_LEN = ((1<<16) - sizeof(__u32)) }; |
| @@ -361,6 +363,13 @@ typedef enum { | |||
| 361 | SCTP_SCOPE_UNUSABLE, /* IPv4 unusable addresses */ | 363 | SCTP_SCOPE_UNUSABLE, /* IPv4 unusable addresses */ |
| 362 | } sctp_scope_t; | 364 | } sctp_scope_t; |
| 363 | 365 | ||
| 366 | typedef enum { | ||
| 367 | SCTP_SCOPE_POLICY_DISABLE, /* Disable IPv4 address scoping */ | ||
| 368 | SCTP_SCOPE_POLICY_ENABLE, /* Enable IPv4 address scoping */ | ||
| 369 | SCTP_SCOPE_POLICY_PRIVATE, /* Follow draft but allow IPv4 private addresses */ | ||
| 370 | SCTP_SCOPE_POLICY_LINK, /* Follow draft but allow IPv4 link local addresses */ | ||
| 371 | } sctp_scope_policy_t; | ||
| 372 | |||
| 364 | /* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>, | 373 | /* Based on IPv4 scoping <draft-stewart-tsvwg-sctp-ipv4-00.txt>, |
| 365 | * SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24, | 374 | * SCTP IPv4 unusable addresses: 0.0.0.0/8, 224.0.0.0/4, 198.18.0.0/24, |
| 366 | * 192.88.99.0/24. | 375 | * 192.88.99.0/24. |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index d16a304cbed4..8a6d5297de16 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
| @@ -486,15 +486,16 @@ static inline __s32 sctp_jitter(__u32 rto) | |||
| 486 | } | 486 | } |
| 487 | 487 | ||
| 488 | /* Break down data chunks at this point. */ | 488 | /* Break down data chunks at this point. */ |
| 489 | static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu) | 489 | static inline int sctp_frag_point(const struct sctp_association *asoc, int pmtu) |
| 490 | { | 490 | { |
| 491 | struct sctp_sock *sp = sctp_sk(asoc->base.sk); | ||
| 491 | int frag = pmtu; | 492 | int frag = pmtu; |
| 492 | 493 | ||
| 493 | frag -= sp->pf->af->net_header_len; | 494 | frag -= sp->pf->af->net_header_len; |
| 494 | frag -= sizeof(struct sctphdr) + sizeof(struct sctp_data_chunk); | 495 | frag -= sizeof(struct sctphdr) + sizeof(struct sctp_data_chunk); |
| 495 | 496 | ||
| 496 | if (sp->user_frag) | 497 | if (asoc->user_frag) |
| 497 | frag = min_t(int, frag, sp->user_frag); | 498 | frag = min_t(int, frag, asoc->user_frag); |
| 498 | 499 | ||
| 499 | frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN); | 500 | frag = min_t(int, frag, SCTP_MAX_CHUNK_LEN); |
| 500 | 501 | ||
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index edfcacf3250e..42d00ced5eb8 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -219,6 +219,15 @@ extern struct sctp_globals { | |||
| 219 | /* Flag to idicate if SCTP-AUTH is enabled */ | 219 | /* Flag to idicate if SCTP-AUTH is enabled */ |
| 220 | int auth_enable; | 220 | int auth_enable; |
| 221 | 221 | ||
| 222 | /* | ||
| 223 | * Policy to control SCTP IPv4 address scoping | ||
| 224 | * 0 - Disable IPv4 address scoping | ||
| 225 | * 1 - Enable IPv4 address scoping | ||
| 226 | * 2 - Selectively allow only IPv4 private addresses | ||
| 227 | * 3 - Selectively allow only IPv4 link local address | ||
| 228 | */ | ||
| 229 | int ipv4_scope_policy; | ||
| 230 | |||
| 222 | /* Flag to indicate whether computing and verifying checksum | 231 | /* Flag to indicate whether computing and verifying checksum |
| 223 | * is disabled. */ | 232 | * is disabled. */ |
| 224 | int checksum_disable; | 233 | int checksum_disable; |
| @@ -252,6 +261,7 @@ extern struct sctp_globals { | |||
| 252 | #define sctp_port_hashtable (sctp_globals.port_hashtable) | 261 | #define sctp_port_hashtable (sctp_globals.port_hashtable) |
| 253 | #define sctp_local_addr_list (sctp_globals.local_addr_list) | 262 | #define sctp_local_addr_list (sctp_globals.local_addr_list) |
| 254 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) | 263 | #define sctp_local_addr_lock (sctp_globals.addr_list_lock) |
| 264 | #define sctp_scope_policy (sctp_globals.ipv4_scope_policy) | ||
| 255 | #define sctp_addip_enable (sctp_globals.addip_enable) | 265 | #define sctp_addip_enable (sctp_globals.addip_enable) |
| 256 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) | 266 | #define sctp_addip_noauth (sctp_globals.addip_noauth_enable) |
| 257 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 267 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
| @@ -628,7 +638,7 @@ struct sctp_datamsg { | |||
| 628 | /* Chunks waiting to be submitted to lower layer. */ | 638 | /* Chunks waiting to be submitted to lower layer. */ |
| 629 | struct list_head chunks; | 639 | struct list_head chunks; |
| 630 | /* Chunks that have been transmitted. */ | 640 | /* Chunks that have been transmitted. */ |
| 631 | struct list_head track; | 641 | size_t msg_size; |
| 632 | /* Reference counting. */ | 642 | /* Reference counting. */ |
| 633 | atomic_t refcnt; | 643 | atomic_t refcnt; |
| 634 | /* When is this message no longer interesting to the peer? */ | 644 | /* When is this message no longer interesting to the peer? */ |
| @@ -643,6 +653,7 @@ struct sctp_datamsg { | |||
| 643 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, | 653 | struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *, |
| 644 | struct sctp_sndrcvinfo *, | 654 | struct sctp_sndrcvinfo *, |
| 645 | struct msghdr *, int len); | 655 | struct msghdr *, int len); |
| 656 | void sctp_datamsg_free(struct sctp_datamsg *); | ||
| 646 | void sctp_datamsg_put(struct sctp_datamsg *); | 657 | void sctp_datamsg_put(struct sctp_datamsg *); |
| 647 | void sctp_chunk_fail(struct sctp_chunk *, int error); | 658 | void sctp_chunk_fail(struct sctp_chunk *, int error); |
| 648 | int sctp_chunk_abandoned(struct sctp_chunk *); | 659 | int sctp_chunk_abandoned(struct sctp_chunk *); |
| @@ -811,22 +822,12 @@ struct sctp_packet { | |||
| 811 | /* pointer to the auth chunk for this packet */ | 822 | /* pointer to the auth chunk for this packet */ |
| 812 | struct sctp_chunk *auth; | 823 | struct sctp_chunk *auth; |
| 813 | 824 | ||
| 814 | /* This packet contains a COOKIE-ECHO chunk. */ | 825 | u8 has_cookie_echo:1, /* This packet contains a COOKIE-ECHO chunk. */ |
| 815 | __u8 has_cookie_echo; | 826 | has_sack:1, /* This packet contains a SACK chunk. */ |
| 816 | 827 | has_auth:1, /* This packet contains an AUTH chunk */ | |
| 817 | /* This packet contains a SACK chunk. */ | 828 | has_data:1, /* This packet contains at least 1 DATA chunk */ |
| 818 | __u8 has_sack; | 829 | ipfragok:1, /* So let ip fragment this packet */ |
| 819 | 830 | malloced:1; /* Is it malloced? */ | |
| 820 | /* This packet contains an AUTH chunk */ | ||
| 821 | __u8 has_auth; | ||
| 822 | |||
| 823 | /* This packet contains at least 1 DATA chunk */ | ||
| 824 | __u8 has_data; | ||
| 825 | |||
| 826 | /* SCTP cannot fragment this packet. So let ip fragment it. */ | ||
| 827 | __u8 ipfragok; | ||
| 828 | |||
| 829 | __u8 malloced; | ||
| 830 | }; | 831 | }; |
| 831 | 832 | ||
| 832 | struct sctp_packet *sctp_packet_init(struct sctp_packet *, | 833 | struct sctp_packet *sctp_packet_init(struct sctp_packet *, |
| @@ -1567,13 +1568,13 @@ struct sctp_association { | |||
| 1567 | __u32 sack_cnt; | 1568 | __u32 sack_cnt; |
| 1568 | 1569 | ||
| 1569 | /* These are capabilities which our peer advertised. */ | 1570 | /* These are capabilities which our peer advertised. */ |
| 1570 | __u8 ecn_capable; /* Can peer do ECN? */ | 1571 | __u8 ecn_capable:1, /* Can peer do ECN? */ |
| 1571 | __u8 ipv4_address; /* Peer understands IPv4 addresses? */ | 1572 | ipv4_address:1, /* Peer understands IPv4 addresses? */ |
| 1572 | __u8 ipv6_address; /* Peer understands IPv6 addresses? */ | 1573 | ipv6_address:1, /* Peer understands IPv6 addresses? */ |
| 1573 | __u8 hostname_address;/* Peer understands DNS addresses? */ | 1574 | hostname_address:1, /* Peer understands DNS addresses? */ |
| 1574 | __u8 asconf_capable; /* Does peer support ADDIP? */ | 1575 | asconf_capable:1, /* Does peer support ADDIP? */ |
| 1575 | __u8 prsctp_capable; /* Can peer do PR-SCTP? */ | 1576 | prsctp_capable:1, /* Can peer do PR-SCTP? */ |
| 1576 | __u8 auth_capable; /* Is peer doing SCTP-AUTH? */ | 1577 | auth_capable:1; /* Is peer doing SCTP-AUTH? */ |
| 1577 | 1578 | ||
| 1578 | __u32 adaptation_ind; /* Adaptation Code point. */ | 1579 | __u32 adaptation_ind; /* Adaptation Code point. */ |
| 1579 | 1580 | ||
| @@ -1738,6 +1739,12 @@ struct sctp_association { | |||
| 1738 | */ | 1739 | */ |
| 1739 | __u32 rwnd_over; | 1740 | __u32 rwnd_over; |
| 1740 | 1741 | ||
| 1742 | /* Keeps treack of rwnd pressure. This happens when we have | ||
| 1743 | * a window, but not recevie buffer (i.e small packets). This one | ||
| 1744 | * is releases slowly (1 PMTU at a time ). | ||
| 1745 | */ | ||
| 1746 | __u32 rwnd_press; | ||
| 1747 | |||
| 1741 | /* This is the sndbuf size in use for the association. | 1748 | /* This is the sndbuf size in use for the association. |
| 1742 | * This corresponds to the sndbuf size for the association, | 1749 | * This corresponds to the sndbuf size for the association, |
| 1743 | * as specified in the sk->sndbuf. | 1750 | * as specified in the sk->sndbuf. |
| @@ -1756,6 +1763,7 @@ struct sctp_association { | |||
| 1756 | 1763 | ||
| 1757 | /* The message size at which SCTP fragmentation will occur. */ | 1764 | /* The message size at which SCTP fragmentation will occur. */ |
| 1758 | __u32 frag_point; | 1765 | __u32 frag_point; |
| 1766 | __u32 user_frag; | ||
| 1759 | 1767 | ||
| 1760 | /* Counter used to count INIT errors. */ | 1768 | /* Counter used to count INIT errors. */ |
| 1761 | int init_err_counter; | 1769 | int init_err_counter; |
| @@ -1905,11 +1913,8 @@ struct sctp_association { | |||
| 1905 | 1913 | ||
| 1906 | __u16 active_key_id; | 1914 | __u16 active_key_id; |
| 1907 | 1915 | ||
| 1908 | /* Need to send an ECNE Chunk? */ | 1916 | __u8 need_ecne:1, /* Need to send an ECNE Chunk? */ |
| 1909 | char need_ecne; | 1917 | temp:1; /* Is it a temporary association? */ |
| 1910 | |||
| 1911 | /* Is it a temporary association? */ | ||
| 1912 | char temp; | ||
| 1913 | }; | 1918 | }; |
| 1914 | 1919 | ||
| 1915 | 1920 | ||
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index 1580c04f68bc..be2334aaf52e 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
| @@ -210,12 +210,6 @@ enum sctp_sinfo_flags { | |||
| 210 | }; | 210 | }; |
| 211 | 211 | ||
| 212 | 212 | ||
| 213 | typedef union { | ||
| 214 | __u8 raw; | ||
| 215 | struct sctp_initmsg init; | ||
| 216 | struct sctp_sndrcvinfo sndrcv; | ||
| 217 | } sctp_cmsg_data_t; | ||
| 218 | |||
| 219 | /* These are cmsg_types. */ | 213 | /* These are cmsg_types. */ |
| 220 | typedef enum sctp_cmsg_type { | 214 | typedef enum sctp_cmsg_type { |
| 221 | SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */ | 215 | SCTP_INIT, /* 5.2.1 SCTP Initiation Structure */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 88af84306471..b71a446d58f6 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -469,6 +469,7 @@ extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, | |||
| 469 | int nonagle); | 469 | int nonagle); |
| 470 | extern int tcp_may_send_now(struct sock *sk); | 470 | extern int tcp_may_send_now(struct sock *sk); |
| 471 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); | 471 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); |
| 472 | extern void tcp_retransmit_timer(struct sock *sk); | ||
| 472 | extern void tcp_xmit_retransmit_queue(struct sock *); | 473 | extern void tcp_xmit_retransmit_queue(struct sock *); |
| 473 | extern void tcp_simple_retransmit(struct sock *); | 474 | extern void tcp_simple_retransmit(struct sock *); |
| 474 | extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); | 475 | extern int tcp_trim_head(struct sock *, struct sk_buff *, u32); |
| @@ -521,6 +522,17 @@ extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | |||
| 521 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | 522 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); |
| 522 | extern void tcp_mtup_init(struct sock *sk); | 523 | extern void tcp_mtup_init(struct sock *sk); |
| 523 | 524 | ||
| 525 | static inline void tcp_bound_rto(const struct sock *sk) | ||
| 526 | { | ||
| 527 | if (inet_csk(sk)->icsk_rto > TCP_RTO_MAX) | ||
| 528 | inet_csk(sk)->icsk_rto = TCP_RTO_MAX; | ||
| 529 | } | ||
| 530 | |||
| 531 | static inline u32 __tcp_set_rto(const struct tcp_sock *tp) | ||
| 532 | { | ||
| 533 | return (tp->srtt >> 3) + tp->rttvar; | ||
| 534 | } | ||
| 535 | |||
| 524 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) | 536 | static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) |
| 525 | { | 537 | { |
| 526 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | | 538 | tp->pred_flags = htonl((tp->tcp_header_len << 26) | |
| @@ -1007,6 +1019,11 @@ static inline int keepalive_time_when(const struct tcp_sock *tp) | |||
| 1007 | return tp->keepalive_time ? : sysctl_tcp_keepalive_time; | 1019 | return tp->keepalive_time ? : sysctl_tcp_keepalive_time; |
| 1008 | } | 1020 | } |
| 1009 | 1021 | ||
| 1022 | static inline int keepalive_probes(const struct tcp_sock *tp) | ||
| 1023 | { | ||
| 1024 | return tp->keepalive_probes ? : sysctl_tcp_keepalive_probes; | ||
| 1025 | } | ||
| 1026 | |||
| 1010 | static inline int tcp_fin_time(const struct sock *sk) | 1027 | static inline int tcp_fin_time(const struct sock *sk) |
| 1011 | { | 1028 | { |
| 1012 | int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; | 1029 | int fin_timeout = tcp_sk(sk)->linger2 ? : sysctl_tcp_fin_timeout; |
| @@ -1169,7 +1186,7 @@ extern int tcp_v4_md5_do_del(struct sock *sk, | |||
| 1169 | #define tcp_twsk_md5_key(twsk) NULL | 1186 | #define tcp_twsk_md5_key(twsk) NULL |
| 1170 | #endif | 1187 | #endif |
| 1171 | 1188 | ||
| 1172 | extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); | 1189 | extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(struct sock *); |
| 1173 | extern void tcp_free_md5sig_pool(void); | 1190 | extern void tcp_free_md5sig_pool(void); |
| 1174 | 1191 | ||
| 1175 | extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); | 1192 | extern struct tcp_md5sig_pool *__tcp_get_md5sig_pool(int cpu); |
| @@ -1235,6 +1252,29 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu | |||
| 1235 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ | 1252 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ |
| 1236 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) | 1253 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) |
| 1237 | 1254 | ||
| 1255 | /* This function calculates a "timeout" which is equivalent to the timeout of a | ||
| 1256 | * TCP connection after "boundary" unsucessful, exponentially backed-off | ||
| 1257 | * retransmissions with an initial RTO of TCP_RTO_MIN. | ||
| 1258 | */ | ||
| 1259 | static inline bool retransmits_timed_out(const struct sock *sk, | ||
| 1260 | unsigned int boundary) | ||
| 1261 | { | ||
| 1262 | unsigned int timeout, linear_backoff_thresh; | ||
| 1263 | |||
| 1264 | if (!inet_csk(sk)->icsk_retransmits) | ||
| 1265 | return false; | ||
| 1266 | |||
| 1267 | linear_backoff_thresh = ilog2(TCP_RTO_MAX/TCP_RTO_MIN); | ||
| 1268 | |||
| 1269 | if (boundary <= linear_backoff_thresh) | ||
| 1270 | timeout = ((2 << boundary) - 1) * TCP_RTO_MIN; | ||
| 1271 | else | ||
| 1272 | timeout = ((2 << linear_backoff_thresh) - 1) * TCP_RTO_MIN + | ||
| 1273 | (boundary - linear_backoff_thresh) * TCP_RTO_MAX; | ||
| 1274 | |||
| 1275 | return (tcp_time_stamp - tcp_sk(sk)->retrans_stamp) >= timeout; | ||
| 1276 | } | ||
| 1277 | |||
| 1238 | static inline struct sk_buff *tcp_send_head(struct sock *sk) | 1278 | static inline struct sk_buff *tcp_send_head(struct sock *sk) |
| 1239 | { | 1279 | { |
| 1240 | return sk->sk_send_head; | 1280 | return sk->sk_send_head; |
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h index bfb240c6cf79..d65381cad0fc 100644 --- a/include/net/transp_v6.h +++ b/include/net/transp_v6.h | |||
| @@ -51,7 +51,7 @@ extern int datagram_send_ctl(struct net *net, | |||
| 51 | /* | 51 | /* |
| 52 | * address family specific functions | 52 | * address family specific functions |
| 53 | */ | 53 | */ |
| 54 | extern struct inet_connection_sock_af_ops ipv4_specific; | 54 | extern const struct inet_connection_sock_af_ops ipv4_specific; |
| 55 | 55 | ||
| 56 | extern void inet6_destroy_sock(struct sock *sk); | 56 | extern void inet6_destroy_sock(struct sock *sk); |
| 57 | 57 | ||
diff --git a/include/net/udp.h b/include/net/udp.h index 90e6ce56be65..5fb029f817a3 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -207,4 +207,7 @@ extern void udp4_proc_exit(void); | |||
| 207 | #endif | 207 | #endif |
| 208 | 208 | ||
| 209 | extern void udp_init(void); | 209 | extern void udp_init(void); |
| 210 | |||
| 211 | extern int udp4_ufo_send_check(struct sk_buff *skb); | ||
| 212 | extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features); | ||
| 210 | #endif /* _UDP_H */ | 213 | #endif /* _UDP_H */ |
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h new file mode 100644 index 000000000000..547b1e271ac9 --- /dev/null +++ b/include/net/wpan-phy.h | |||
| @@ -0,0 +1,63 @@ | |||
| 1 | /* | ||
| 2 | * Copyright (C) 2007, 2008, 2009 Siemens AG | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 | ||
| 6 | * as published by the Free Software Foundation. | ||
| 7 | * | ||
| 8 | * This program is distributed in the hope that it will be useful, | ||
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 11 | * GNU General Public License for more details. | ||
| 12 | * | ||
| 13 | * You should have received a copy of the GNU General Public License along | ||
| 14 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
| 15 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 16 | * | ||
| 17 | * Written by: | ||
| 18 | * Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef WPAN_PHY_H | ||
| 22 | #define WPAN_PHY_H | ||
| 23 | |||
| 24 | #include <linux/netdevice.h> | ||
| 25 | #include <linux/mutex.h> | ||
| 26 | |||
| 27 | struct wpan_phy { | ||
| 28 | struct mutex pib_lock; | ||
| 29 | |||
| 30 | /* | ||
| 31 | * This is a PIB acording to 802.15.4-2006. | ||
| 32 | * We do not provide timing-related variables, as they | ||
| 33 | * aren't used outside of driver | ||
| 34 | */ | ||
| 35 | u8 current_channel; | ||
| 36 | u8 current_page; | ||
| 37 | u32 channels_supported; | ||
| 38 | u8 transmit_power; | ||
| 39 | u8 cca_mode; | ||
| 40 | |||
| 41 | struct device dev; | ||
| 42 | int idx; | ||
| 43 | |||
| 44 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | ||
| 45 | }; | ||
| 46 | |||
| 47 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); | ||
| 48 | int wpan_phy_register(struct device *parent, struct wpan_phy *phy); | ||
| 49 | void wpan_phy_unregister(struct wpan_phy *phy); | ||
| 50 | void wpan_phy_free(struct wpan_phy *phy); | ||
| 51 | |||
| 52 | static inline void *wpan_phy_priv(struct wpan_phy *phy) | ||
| 53 | { | ||
| 54 | BUG_ON(!phy); | ||
| 55 | return &phy->priv; | ||
| 56 | } | ||
| 57 | |||
| 58 | struct wpan_phy *wpan_phy_find(const char *str); | ||
| 59 | static inline const char *wpan_phy_name(struct wpan_phy *phy) | ||
| 60 | { | ||
| 61 | return dev_name(&phy->dev); | ||
| 62 | } | ||
| 63 | #endif | ||
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 9e3a3f4c1f60..223e90a44824 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -1280,7 +1280,7 @@ struct xfrm6_tunnel { | |||
| 1280 | }; | 1280 | }; |
| 1281 | 1281 | ||
| 1282 | extern void xfrm_init(void); | 1282 | extern void xfrm_init(void); |
| 1283 | extern void xfrm4_init(void); | 1283 | extern void xfrm4_init(int rt_hash_size); |
| 1284 | extern int xfrm_state_init(struct net *net); | 1284 | extern int xfrm_state_init(struct net *net); |
| 1285 | extern void xfrm_state_fini(struct net *net); | 1285 | extern void xfrm_state_fini(struct net *net); |
| 1286 | extern void xfrm4_state_init(void); | 1286 | extern void xfrm4_state_init(void); |
diff --git a/include/scsi/fc/fc_gs.h b/include/scsi/fc/fc_gs.h index ffab0272c65a..324dd0e3c622 100644 --- a/include/scsi/fc/fc_gs.h +++ b/include/scsi/fc/fc_gs.h | |||
| @@ -87,6 +87,7 @@ enum fc_ct_explan { | |||
| 87 | FC_FS_EXP_PNAM = 0x02, /* port name not registered */ | 87 | FC_FS_EXP_PNAM = 0x02, /* port name not registered */ |
| 88 | FC_FS_EXP_NNAM = 0x03, /* node name not registered */ | 88 | FC_FS_EXP_NNAM = 0x03, /* node name not registered */ |
| 89 | FC_FS_EXP_COS = 0x04, /* class of service not registered */ | 89 | FC_FS_EXP_COS = 0x04, /* class of service not registered */ |
| 90 | FC_FS_EXP_FTNR = 0x07, /* FC-4 types not registered */ | ||
| 90 | /* definitions not complete */ | 91 | /* definitions not complete */ |
| 91 | }; | 92 | }; |
| 92 | 93 | ||
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index a0ff61c3e935..27dad703824f 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
| @@ -32,6 +32,7 @@ struct fc_ct_req { | |||
| 32 | struct fc_ns_gid_ft gid; | 32 | struct fc_ns_gid_ft gid; |
| 33 | struct fc_ns_rn_id rn; | 33 | struct fc_ns_rn_id rn; |
| 34 | struct fc_ns_rft rft; | 34 | struct fc_ns_rft rft; |
| 35 | struct fc_ns_fid fid; | ||
| 35 | } payload; | 36 | } payload; |
| 36 | }; | 37 | }; |
| 37 | 38 | ||
| @@ -57,6 +58,23 @@ static inline void fc_fill_fc_hdr(struct fc_frame *fp, enum fc_rctl r_ctl, | |||
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | /** | 60 | /** |
| 61 | * fc_adisc_fill() - Fill in adisc request frame | ||
| 62 | * @lport: local port. | ||
| 63 | * @fp: fc frame where payload will be placed. | ||
| 64 | */ | ||
| 65 | static inline void fc_adisc_fill(struct fc_lport *lport, struct fc_frame *fp) | ||
| 66 | { | ||
| 67 | struct fc_els_adisc *adisc; | ||
| 68 | |||
| 69 | adisc = fc_frame_payload_get(fp, sizeof(*adisc)); | ||
| 70 | memset(adisc, 0, sizeof(*adisc)); | ||
| 71 | adisc->adisc_cmd = ELS_ADISC; | ||
| 72 | put_unaligned_be64(lport->wwpn, &adisc->adisc_wwpn); | ||
| 73 | put_unaligned_be64(lport->wwnn, &adisc->adisc_wwnn); | ||
| 74 | hton24(adisc->adisc_port_id, fc_host_port_id(lport->host)); | ||
| 75 | } | ||
| 76 | |||
| 77 | /** | ||
| 60 | * fc_ct_hdr_fill- fills ct header and reset ct payload | 78 | * fc_ct_hdr_fill- fills ct header and reset ct payload |
| 61 | * returns pointer to ct request. | 79 | * returns pointer to ct request. |
| 62 | */ | 80 | */ |
| @@ -77,10 +95,17 @@ static inline struct fc_ct_req *fc_ct_hdr_fill(const struct fc_frame *fp, | |||
| 77 | } | 95 | } |
| 78 | 96 | ||
| 79 | /** | 97 | /** |
| 80 | * fc_ct_fill - Fill in a name service request frame | 98 | * fc_ct_fill() - Fill in a name service request frame |
| 99 | * @lport: local port. | ||
| 100 | * @fc_id: FC_ID of non-destination rport for GPN_ID and similar inquiries. | ||
| 101 | * @fp: frame to contain payload. | ||
| 102 | * @op: CT opcode. | ||
| 103 | * @r_ctl: pointer to FC header R_CTL. | ||
| 104 | * @fh_type: pointer to FC-4 type. | ||
| 81 | */ | 105 | */ |
| 82 | static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | 106 | static inline int fc_ct_fill(struct fc_lport *lport, |
| 83 | unsigned int op, enum fc_rctl *r_ctl, u32 *did, | 107 | u32 fc_id, struct fc_frame *fp, |
| 108 | unsigned int op, enum fc_rctl *r_ctl, | ||
| 84 | enum fc_fh_type *fh_type) | 109 | enum fc_fh_type *fh_type) |
| 85 | { | 110 | { |
| 86 | struct fc_ct_req *ct; | 111 | struct fc_ct_req *ct; |
| @@ -91,6 +116,11 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | |||
| 91 | ct->payload.gid.fn_fc4_type = FC_TYPE_FCP; | 116 | ct->payload.gid.fn_fc4_type = FC_TYPE_FCP; |
| 92 | break; | 117 | break; |
| 93 | 118 | ||
| 119 | case FC_NS_GPN_ID: | ||
| 120 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_fid)); | ||
| 121 | hton24(ct->payload.fid.fp_fid, fc_id); | ||
| 122 | break; | ||
| 123 | |||
| 94 | case FC_NS_RFT_ID: | 124 | case FC_NS_RFT_ID: |
| 95 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); | 125 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rft)); |
| 96 | hton24(ct->payload.rft.fid.fp_fid, | 126 | hton24(ct->payload.rft.fid.fp_fid, |
| @@ -110,7 +140,6 @@ static inline int fc_ct_fill(struct fc_lport *lport, struct fc_frame *fp, | |||
| 110 | return -EINVAL; | 140 | return -EINVAL; |
| 111 | } | 141 | } |
| 112 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; | 142 | *r_ctl = FC_RCTL_DD_UNSOL_CTL; |
| 113 | *did = FC_FID_DIR_SERV; | ||
| 114 | *fh_type = FC_TYPE_CT; | 143 | *fh_type = FC_TYPE_CT; |
| 115 | return 0; | 144 | return 0; |
| 116 | } | 145 | } |
| @@ -249,51 +278,42 @@ static inline void fc_scr_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
| 249 | /** | 278 | /** |
| 250 | * fc_els_fill - Fill in an ELS request frame | 279 | * fc_els_fill - Fill in an ELS request frame |
| 251 | */ | 280 | */ |
| 252 | static inline int fc_els_fill(struct fc_lport *lport, struct fc_rport *rport, | 281 | static inline int fc_els_fill(struct fc_lport *lport, |
| 282 | u32 did, | ||
| 253 | struct fc_frame *fp, unsigned int op, | 283 | struct fc_frame *fp, unsigned int op, |
| 254 | enum fc_rctl *r_ctl, u32 *did, enum fc_fh_type *fh_type) | 284 | enum fc_rctl *r_ctl, enum fc_fh_type *fh_type) |
| 255 | { | 285 | { |
| 256 | switch (op) { | 286 | switch (op) { |
| 287 | case ELS_ADISC: | ||
| 288 | fc_adisc_fill(lport, fp); | ||
| 289 | break; | ||
| 290 | |||
| 257 | case ELS_PLOGI: | 291 | case ELS_PLOGI: |
| 258 | fc_plogi_fill(lport, fp, ELS_PLOGI); | 292 | fc_plogi_fill(lport, fp, ELS_PLOGI); |
| 259 | *did = rport->port_id; | ||
| 260 | break; | 293 | break; |
| 261 | 294 | ||
| 262 | case ELS_FLOGI: | 295 | case ELS_FLOGI: |
| 263 | fc_flogi_fill(lport, fp); | 296 | fc_flogi_fill(lport, fp); |
| 264 | *did = FC_FID_FLOGI; | ||
| 265 | break; | 297 | break; |
| 266 | 298 | ||
| 267 | case ELS_LOGO: | 299 | case ELS_LOGO: |
| 268 | fc_logo_fill(lport, fp); | 300 | fc_logo_fill(lport, fp); |
| 269 | *did = FC_FID_FLOGI; | ||
| 270 | /* | ||
| 271 | * if rport is valid then it | ||
| 272 | * is port logo, therefore | ||
| 273 | * set did to rport id. | ||
| 274 | */ | ||
| 275 | if (rport) | ||
| 276 | *did = rport->port_id; | ||
| 277 | break; | 301 | break; |
| 278 | 302 | ||
| 279 | case ELS_RTV: | 303 | case ELS_RTV: |
| 280 | fc_rtv_fill(lport, fp); | 304 | fc_rtv_fill(lport, fp); |
| 281 | *did = rport->port_id; | ||
| 282 | break; | 305 | break; |
| 283 | 306 | ||
| 284 | case ELS_REC: | 307 | case ELS_REC: |
| 285 | fc_rec_fill(lport, fp); | 308 | fc_rec_fill(lport, fp); |
| 286 | *did = rport->port_id; | ||
| 287 | break; | 309 | break; |
| 288 | 310 | ||
| 289 | case ELS_PRLI: | 311 | case ELS_PRLI: |
| 290 | fc_prli_fill(lport, fp); | 312 | fc_prli_fill(lport, fp); |
| 291 | *did = rport->port_id; | ||
| 292 | break; | 313 | break; |
| 293 | 314 | ||
| 294 | case ELS_SCR: | 315 | case ELS_SCR: |
| 295 | fc_scr_fill(lport, fp); | 316 | fc_scr_fill(lport, fp); |
| 296 | *did = FC_FID_FCTRL; | ||
| 297 | break; | 317 | break; |
| 298 | 318 | ||
| 299 | default: | 319 | default: |
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h index 59511057cee0..c35d2383cc26 100644 --- a/include/scsi/fc_frame.h +++ b/include/scsi/fc_frame.h | |||
| @@ -37,13 +37,6 @@ | |||
| 37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ | 37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ |
| 38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ | 38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ |
| 39 | 39 | ||
| 40 | /* | ||
| 41 | * Information about an individual fibre channel frame received or to be sent. | ||
| 42 | * The buffer may be in up to 4 additional non-contiguous sections, | ||
| 43 | * but the linear section must hold the frame header. | ||
| 44 | */ | ||
| 45 | #define FC_FRAME_SG_LEN 4 /* scatter/gather list maximum length */ | ||
| 46 | |||
| 47 | #define fp_skb(fp) (&((fp)->skb)) | 40 | #define fp_skb(fp) (&((fp)->skb)) |
| 48 | #define fr_hdr(fp) ((fp)->skb.data) | 41 | #define fr_hdr(fp) ((fp)->skb.data) |
| 49 | #define fr_len(fp) ((fp)->skb.len) | 42 | #define fr_len(fp) ((fp)->skb.len) |
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index 4426f00da5ff..d67dda2b6aa0 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -262,6 +262,7 @@ enum iscsi_err { | |||
| 262 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, | 262 | ISCSI_ERR_NO_SCSI_CMD = ISCSI_ERR_BASE + 17, |
| 263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, | 263 | ISCSI_ERR_INVALID_HOST = ISCSI_ERR_BASE + 18, |
| 264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, | 264 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, |
| 265 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, | ||
| 265 | }; | 266 | }; |
| 266 | 267 | ||
| 267 | /* | 268 | /* |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index b92584a8843a..65dc9aacbf70 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
| @@ -51,55 +51,49 @@ do { \ | |||
| 51 | do { \ | 51 | do { \ |
| 52 | CMD; \ | 52 | CMD; \ |
| 53 | } while (0); \ | 53 | } while (0); \ |
| 54 | } while (0); | 54 | } while (0) |
| 55 | 55 | ||
| 56 | #define FC_LIBFC_DBG(fmt, args...) \ | 56 | #define FC_LIBFC_DBG(fmt, args...) \ |
| 57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ | 57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ |
| 58 | printk(KERN_INFO "libfc: " fmt, ##args);) | 58 | printk(KERN_INFO "libfc: " fmt, ##args)) |
| 59 | 59 | ||
| 60 | #define FC_LPORT_DBG(lport, fmt, args...) \ | 60 | #define FC_LPORT_DBG(lport, fmt, args...) \ |
| 61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ | 61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ |
| 62 | printk(KERN_INFO "lport: %6x: " fmt, \ | 62 | printk(KERN_INFO "host%u: lport %6x: " fmt, \ |
| 63 | fc_host_port_id(lport->host), ##args);) | 63 | (lport)->host->host_no, \ |
| 64 | fc_host_port_id((lport)->host), ##args)) | ||
| 64 | 65 | ||
| 65 | #define FC_DISC_DBG(disc, fmt, args...) \ | 66 | #define FC_DISC_DBG(disc, fmt, args...) \ |
| 66 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ | 67 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ |
| 67 | printk(KERN_INFO "disc: %6x: " fmt, \ | 68 | printk(KERN_INFO "host%u: disc: " fmt, \ |
| 68 | fc_host_port_id(disc->lport->host), \ | 69 | (disc)->lport->host->host_no, \ |
| 69 | ##args);) | 70 | ##args)) |
| 70 | 71 | ||
| 71 | #define FC_RPORT_DBG(rport, fmt, args...) \ | 72 | #define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \ |
| 72 | do { \ | ||
| 73 | struct fc_rport_libfc_priv *rdata = rport->dd_data; \ | ||
| 74 | struct fc_lport *lport = rdata->local_port; \ | ||
| 75 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ | 73 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ |
| 76 | printk(KERN_INFO "rport: %6x: %6x: " fmt, \ | 74 | printk(KERN_INFO "host%u: rport %6x: " fmt, \ |
| 77 | fc_host_port_id(lport->host), \ | 75 | (lport)->host->host_no, \ |
| 78 | rport->port_id, ##args);) \ | 76 | (port_id), ##args)) |
| 79 | } while (0); | 77 | |
| 78 | #define FC_RPORT_DBG(rdata, fmt, args...) \ | ||
| 79 | FC_RPORT_ID_DBG((rdata)->local_port, (rdata)->ids.port_id, fmt, ##args) | ||
| 80 | 80 | ||
| 81 | #define FC_FCP_DBG(pkt, fmt, args...) \ | 81 | #define FC_FCP_DBG(pkt, fmt, args...) \ |
| 82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ | 82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ |
| 83 | printk(KERN_INFO "fcp: %6x: %6x: " fmt, \ | 83 | printk(KERN_INFO "host%u: fcp: %6x: " fmt, \ |
| 84 | fc_host_port_id(pkt->lp->host), \ | 84 | (pkt)->lp->host->host_no, \ |
| 85 | pkt->rport->port_id, ##args);) | 85 | pkt->rport->port_id, ##args)) |
| 86 | |||
| 87 | #define FC_EM_DBG(em, fmt, args...) \ | ||
| 88 | FC_CHECK_LOGGING(FC_EM_LOGGING, \ | ||
| 89 | printk(KERN_INFO "em: %6x: " fmt, \ | ||
| 90 | fc_host_port_id(em->lp->host), \ | ||
| 91 | ##args);) | ||
| 92 | 86 | ||
| 93 | #define FC_EXCH_DBG(exch, fmt, args...) \ | 87 | #define FC_EXCH_DBG(exch, fmt, args...) \ |
| 94 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ | 88 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ |
| 95 | printk(KERN_INFO "exch: %6x: %4x: " fmt, \ | 89 | printk(KERN_INFO "host%u: xid %4x: " fmt, \ |
| 96 | fc_host_port_id(exch->lp->host), \ | 90 | (exch)->lp->host->host_no, \ |
| 97 | exch->xid, ##args);) | 91 | exch->xid, ##args)) |
| 98 | 92 | ||
| 99 | #define FC_SCSI_DBG(lport, fmt, args...) \ | 93 | #define FC_SCSI_DBG(lport, fmt, args...) \ |
| 100 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ | 94 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ |
| 101 | printk(KERN_INFO "scsi: %6x: " fmt, \ | 95 | printk(KERN_INFO "host%u: scsi: " fmt, \ |
| 102 | fc_host_port_id(lport->host), ##args);) | 96 | (lport)->host->host_no, ##args)) |
| 103 | 97 | ||
| 104 | /* | 98 | /* |
| 105 | * libfc error codes | 99 | * libfc error codes |
| @@ -125,7 +119,7 @@ do { \ | |||
| 125 | * FC HBA status | 119 | * FC HBA status |
| 126 | */ | 120 | */ |
| 127 | enum fc_lport_state { | 121 | enum fc_lport_state { |
| 128 | LPORT_ST_NONE = 0, | 122 | LPORT_ST_DISABLED = 0, |
| 129 | LPORT_ST_FLOGI, | 123 | LPORT_ST_FLOGI, |
| 130 | LPORT_ST_DNS, | 124 | LPORT_ST_DNS, |
| 131 | LPORT_ST_RPN_ID, | 125 | LPORT_ST_RPN_ID, |
| @@ -143,53 +137,74 @@ enum fc_disc_event { | |||
| 143 | }; | 137 | }; |
| 144 | 138 | ||
| 145 | enum fc_rport_state { | 139 | enum fc_rport_state { |
| 146 | RPORT_ST_NONE = 0, | ||
| 147 | RPORT_ST_INIT, /* initialized */ | 140 | RPORT_ST_INIT, /* initialized */ |
| 148 | RPORT_ST_PLOGI, /* waiting for PLOGI completion */ | 141 | RPORT_ST_PLOGI, /* waiting for PLOGI completion */ |
| 149 | RPORT_ST_PRLI, /* waiting for PRLI completion */ | 142 | RPORT_ST_PRLI, /* waiting for PRLI completion */ |
| 150 | RPORT_ST_RTV, /* waiting for RTV completion */ | 143 | RPORT_ST_RTV, /* waiting for RTV completion */ |
| 151 | RPORT_ST_READY, /* ready for use */ | 144 | RPORT_ST_READY, /* ready for use */ |
| 152 | RPORT_ST_LOGO, /* port logout sent */ | 145 | RPORT_ST_LOGO, /* port logout sent */ |
| 153 | }; | 146 | RPORT_ST_ADISC, /* Discover Address sent */ |
| 154 | 147 | RPORT_ST_DELETE, /* port being deleted */ | |
| 155 | enum fc_rport_trans_state { | ||
| 156 | FC_PORTSTATE_ROGUE, | ||
| 157 | FC_PORTSTATE_REAL, | ||
| 158 | }; | 148 | }; |
| 159 | 149 | ||
| 160 | /** | 150 | /** |
| 161 | * struct fc_disc_port - temporary discovery port to hold rport identifiers | 151 | * struct fc_disc_port - temporary discovery port to hold rport identifiers |
| 162 | * @lp: Fibre Channel host port instance | 152 | * @lp: Fibre Channel host port instance |
| 163 | * @peers: node for list management during discovery and RSCN processing | 153 | * @peers: Node for list management during discovery and RSCN processing |
| 164 | * @ids: identifiers structure to pass to fc_remote_port_add() | 154 | * @rport_work: Work struct for starting the rport state machine |
| 165 | * @rport_work: work struct for starting the rport state machine | 155 | * @port_id: Port ID of the discovered port |
| 166 | */ | 156 | */ |
| 167 | struct fc_disc_port { | 157 | struct fc_disc_port { |
| 168 | struct fc_lport *lp; | 158 | struct fc_lport *lp; |
| 169 | struct list_head peers; | 159 | struct list_head peers; |
| 170 | struct fc_rport_identifiers ids; | ||
| 171 | struct work_struct rport_work; | 160 | struct work_struct rport_work; |
| 161 | u32 port_id; | ||
| 172 | }; | 162 | }; |
| 173 | 163 | ||
| 174 | enum fc_rport_event { | 164 | enum fc_rport_event { |
| 175 | RPORT_EV_NONE = 0, | 165 | RPORT_EV_NONE = 0, |
| 176 | RPORT_EV_CREATED, | 166 | RPORT_EV_READY, |
| 177 | RPORT_EV_FAILED, | 167 | RPORT_EV_FAILED, |
| 178 | RPORT_EV_STOP, | 168 | RPORT_EV_STOP, |
| 179 | RPORT_EV_LOGO | 169 | RPORT_EV_LOGO |
| 180 | }; | 170 | }; |
| 181 | 171 | ||
| 172 | struct fc_rport_priv; | ||
| 173 | |||
| 182 | struct fc_rport_operations { | 174 | struct fc_rport_operations { |
| 183 | void (*event_callback)(struct fc_lport *, struct fc_rport *, | 175 | void (*event_callback)(struct fc_lport *, struct fc_rport_priv *, |
| 184 | enum fc_rport_event); | 176 | enum fc_rport_event); |
| 185 | }; | 177 | }; |
| 186 | 178 | ||
| 187 | /** | 179 | /** |
| 188 | * struct fc_rport_libfc_priv - libfc internal information about a remote port | 180 | * struct fc_rport_libfc_priv - libfc internal information about a remote port |
| 189 | * @local_port: Fibre Channel host port instance | 181 | * @local_port: Fibre Channel host port instance |
| 182 | * @rp_state: indicates READY for I/O or DELETE when blocked. | ||
| 183 | * @flags: REC and RETRY supported flags | ||
| 184 | * @e_d_tov: error detect timeout value (in msec) | ||
| 185 | * @r_a_tov: resource allocation timeout value (in msec) | ||
| 186 | */ | ||
| 187 | struct fc_rport_libfc_priv { | ||
| 188 | struct fc_lport *local_port; | ||
| 189 | enum fc_rport_state rp_state; | ||
| 190 | u16 flags; | ||
| 191 | #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) | ||
| 192 | #define FC_RP_FLAGS_RETRY (1 << 1) | ||
| 193 | unsigned int e_d_tov; | ||
| 194 | unsigned int r_a_tov; | ||
| 195 | }; | ||
| 196 | |||
| 197 | /** | ||
| 198 | * struct fc_rport_priv - libfc rport and discovery info about a remote port | ||
| 199 | * @local_port: Fibre Channel host port instance | ||
| 200 | * @rport: transport remote port | ||
| 201 | * @kref: reference counter | ||
| 190 | * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges | 202 | * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges |
| 203 | * @ids: remote port identifiers and roles | ||
| 191 | * @flags: REC and RETRY supported flags | 204 | * @flags: REC and RETRY supported flags |
| 192 | * @max_seq: maximum number of concurrent sequences | 205 | * @max_seq: maximum number of concurrent sequences |
| 206 | * @disc_id: discovery identifier | ||
| 207 | * @maxframe_size: maximum frame size | ||
| 193 | * @retries: retry count in current state | 208 | * @retries: retry count in current state |
| 194 | * @e_d_tov: error detect timeout value (in msec) | 209 | * @e_d_tov: error detect timeout value (in msec) |
| 195 | * @r_a_tov: resource allocation timeout value (in msec) | 210 | * @r_a_tov: resource allocation timeout value (in msec) |
| @@ -197,38 +212,28 @@ struct fc_rport_operations { | |||
| 197 | * @retry_work: | 212 | * @retry_work: |
| 198 | * @event_callback: Callback for rport READY, FAILED or LOGO | 213 | * @event_callback: Callback for rport READY, FAILED or LOGO |
| 199 | */ | 214 | */ |
| 200 | struct fc_rport_libfc_priv { | 215 | struct fc_rport_priv { |
| 201 | struct fc_lport *local_port; | 216 | struct fc_lport *local_port; |
| 217 | struct fc_rport *rport; | ||
| 218 | struct kref kref; | ||
| 202 | enum fc_rport_state rp_state; | 219 | enum fc_rport_state rp_state; |
| 220 | struct fc_rport_identifiers ids; | ||
| 203 | u16 flags; | 221 | u16 flags; |
| 204 | #define FC_RP_FLAGS_REC_SUPPORTED (1 << 0) | ||
| 205 | #define FC_RP_FLAGS_RETRY (1 << 1) | ||
| 206 | u16 max_seq; | 222 | u16 max_seq; |
| 223 | u16 disc_id; | ||
| 224 | u16 maxframe_size; | ||
| 207 | unsigned int retries; | 225 | unsigned int retries; |
| 208 | unsigned int e_d_tov; | 226 | unsigned int e_d_tov; |
| 209 | unsigned int r_a_tov; | 227 | unsigned int r_a_tov; |
| 210 | enum fc_rport_trans_state trans_state; | ||
| 211 | struct mutex rp_mutex; | 228 | struct mutex rp_mutex; |
| 212 | struct delayed_work retry_work; | 229 | struct delayed_work retry_work; |
| 213 | enum fc_rport_event event; | 230 | enum fc_rport_event event; |
| 214 | struct fc_rport_operations *ops; | 231 | struct fc_rport_operations *ops; |
| 215 | struct list_head peers; | 232 | struct list_head peers; |
| 216 | struct work_struct event_work; | 233 | struct work_struct event_work; |
| 234 | u32 supported_classes; | ||
| 217 | }; | 235 | }; |
| 218 | 236 | ||
| 219 | #define PRIV_TO_RPORT(x) \ | ||
| 220 | (struct fc_rport *)((void *)x - sizeof(struct fc_rport)); | ||
| 221 | #define RPORT_TO_PRIV(x) \ | ||
| 222 | (struct fc_rport_libfc_priv *)((void *)x + sizeof(struct fc_rport)); | ||
| 223 | |||
| 224 | struct fc_rport *fc_rport_rogue_create(struct fc_disc_port *); | ||
| 225 | |||
| 226 | static inline void fc_rport_set_name(struct fc_rport *rport, u64 wwpn, u64 wwnn) | ||
| 227 | { | ||
| 228 | rport->node_name = wwnn; | ||
| 229 | rport->port_name = wwpn; | ||
| 230 | } | ||
| 231 | |||
| 232 | /* | 237 | /* |
| 233 | * fcoe stats structure | 238 | * fcoe stats structure |
| 234 | */ | 239 | */ |
| @@ -344,6 +349,8 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp) | |||
| 344 | */ | 349 | */ |
| 345 | 350 | ||
| 346 | struct fc_exch_mgr; | 351 | struct fc_exch_mgr; |
| 352 | struct fc_exch_mgr_anchor; | ||
| 353 | extern u16 fc_cpu_mask; /* cpu mask for possible cpus */ | ||
| 347 | 354 | ||
| 348 | /* | 355 | /* |
| 349 | * Sequence. | 356 | * Sequence. |
| @@ -368,6 +375,7 @@ struct fc_seq { | |||
| 368 | */ | 375 | */ |
| 369 | struct fc_exch { | 376 | struct fc_exch { |
| 370 | struct fc_exch_mgr *em; /* exchange manager */ | 377 | struct fc_exch_mgr *em; /* exchange manager */ |
| 378 | struct fc_exch_pool *pool; /* per cpu exches pool */ | ||
| 371 | u32 state; /* internal driver state */ | 379 | u32 state; /* internal driver state */ |
| 372 | u16 xid; /* our exchange ID */ | 380 | u16 xid; /* our exchange ID */ |
| 373 | struct list_head ex_list; /* free or busy list linkage */ | 381 | struct list_head ex_list; /* free or busy list linkage */ |
| @@ -415,7 +423,7 @@ struct libfc_function_template { | |||
| 415 | * STATUS: OPTIONAL | 423 | * STATUS: OPTIONAL |
| 416 | */ | 424 | */ |
| 417 | struct fc_seq *(*elsct_send)(struct fc_lport *lport, | 425 | struct fc_seq *(*elsct_send)(struct fc_lport *lport, |
| 418 | struct fc_rport *rport, | 426 | u32 did, |
| 419 | struct fc_frame *fp, | 427 | struct fc_frame *fp, |
| 420 | unsigned int op, | 428 | unsigned int op, |
| 421 | void (*resp)(struct fc_seq *, | 429 | void (*resp)(struct fc_seq *, |
| @@ -519,25 +527,6 @@ struct libfc_function_template { | |||
| 519 | void (*exch_done)(struct fc_seq *sp); | 527 | void (*exch_done)(struct fc_seq *sp); |
| 520 | 528 | ||
| 521 | /* | 529 | /* |
| 522 | * Assigns a EM and a free XID for an new exchange and then | ||
| 523 | * allocates a new exchange and sequence pair. | ||
| 524 | * The fp can be used to determine free XID. | ||
| 525 | * | ||
| 526 | * STATUS: OPTIONAL | ||
| 527 | */ | ||
| 528 | struct fc_exch *(*exch_get)(struct fc_lport *lp, struct fc_frame *fp); | ||
| 529 | |||
| 530 | /* | ||
| 531 | * Release previously assigned XID by exch_get API. | ||
| 532 | * The LLD may implement this if XID is assigned by LLD | ||
| 533 | * in exch_get(). | ||
| 534 | * | ||
| 535 | * STATUS: OPTIONAL | ||
| 536 | */ | ||
| 537 | void (*exch_put)(struct fc_lport *lp, struct fc_exch_mgr *mp, | ||
| 538 | u16 ex_id); | ||
| 539 | |||
| 540 | /* | ||
| 541 | * Start a new sequence on the same exchange/sequence tuple. | 530 | * Start a new sequence on the same exchange/sequence tuple. |
| 542 | * | 531 | * |
| 543 | * STATUS: OPTIONAL | 532 | * STATUS: OPTIONAL |
| @@ -577,9 +566,11 @@ struct libfc_function_template { | |||
| 577 | int (*lport_reset)(struct fc_lport *); | 566 | int (*lport_reset)(struct fc_lport *); |
| 578 | 567 | ||
| 579 | /* | 568 | /* |
| 580 | * Create a remote port | 569 | * Create a remote port with a given port ID |
| 570 | * | ||
| 571 | * STATUS: OPTIONAL | ||
| 581 | */ | 572 | */ |
| 582 | struct fc_rport *(*rport_create)(struct fc_disc_port *); | 573 | struct fc_rport_priv *(*rport_create)(struct fc_lport *, u32); |
| 583 | 574 | ||
| 584 | /* | 575 | /* |
| 585 | * Initiates the RP state machine. It is called from the LP module. | 576 | * Initiates the RP state machine. It is called from the LP module. |
| @@ -592,7 +583,7 @@ struct libfc_function_template { | |||
| 592 | * | 583 | * |
| 593 | * STATUS: OPTIONAL | 584 | * STATUS: OPTIONAL |
| 594 | */ | 585 | */ |
| 595 | int (*rport_login)(struct fc_rport *rport); | 586 | int (*rport_login)(struct fc_rport_priv *); |
| 596 | 587 | ||
| 597 | /* | 588 | /* |
| 598 | * Logoff, and remove the rport from the transport if | 589 | * Logoff, and remove the rport from the transport if |
| @@ -600,7 +591,7 @@ struct libfc_function_template { | |||
| 600 | * | 591 | * |
| 601 | * STATUS: OPTIONAL | 592 | * STATUS: OPTIONAL |
| 602 | */ | 593 | */ |
| 603 | int (*rport_logoff)(struct fc_rport *rport); | 594 | int (*rport_logoff)(struct fc_rport_priv *); |
| 604 | 595 | ||
| 605 | /* | 596 | /* |
| 606 | * Recieve a request from a remote port. | 597 | * Recieve a request from a remote port. |
| @@ -608,14 +599,20 @@ struct libfc_function_template { | |||
| 608 | * STATUS: OPTIONAL | 599 | * STATUS: OPTIONAL |
| 609 | */ | 600 | */ |
| 610 | void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, | 601 | void (*rport_recv_req)(struct fc_seq *, struct fc_frame *, |
| 611 | struct fc_rport *); | 602 | struct fc_lport *); |
| 612 | 603 | ||
| 613 | /* | 604 | /* |
| 614 | * lookup an rport by it's port ID. | 605 | * lookup an rport by it's port ID. |
| 615 | * | 606 | * |
| 616 | * STATUS: OPTIONAL | 607 | * STATUS: OPTIONAL |
| 617 | */ | 608 | */ |
| 618 | struct fc_rport *(*rport_lookup)(const struct fc_lport *, u32); | 609 | struct fc_rport_priv *(*rport_lookup)(const struct fc_lport *, u32); |
| 610 | |||
| 611 | /* | ||
| 612 | * Destroy an rport after final kref_put(). | ||
| 613 | * The argument is a pointer to the kref inside the fc_rport_priv. | ||
| 614 | */ | ||
| 615 | void (*rport_destroy)(struct kref *); | ||
| 619 | 616 | ||
| 620 | /* | 617 | /* |
| 621 | * Send a fcp cmd from fsp pkt. | 618 | * Send a fcp cmd from fsp pkt. |
| @@ -681,18 +678,16 @@ struct libfc_function_template { | |||
| 681 | /* information used by the discovery layer */ | 678 | /* information used by the discovery layer */ |
| 682 | struct fc_disc { | 679 | struct fc_disc { |
| 683 | unsigned char retry_count; | 680 | unsigned char retry_count; |
| 684 | unsigned char delay; | ||
| 685 | unsigned char pending; | 681 | unsigned char pending; |
| 686 | unsigned char requested; | 682 | unsigned char requested; |
| 687 | unsigned short seq_count; | 683 | unsigned short seq_count; |
| 688 | unsigned char buf_len; | 684 | unsigned char buf_len; |
| 689 | enum fc_disc_event event; | 685 | u16 disc_id; |
| 690 | 686 | ||
| 691 | void (*disc_callback)(struct fc_lport *, | 687 | void (*disc_callback)(struct fc_lport *, |
| 692 | enum fc_disc_event); | 688 | enum fc_disc_event); |
| 693 | 689 | ||
| 694 | struct list_head rports; | 690 | struct list_head rports; |
| 695 | struct list_head rogue_rports; | ||
| 696 | struct fc_lport *lport; | 691 | struct fc_lport *lport; |
| 697 | struct mutex disc_mutex; | 692 | struct mutex disc_mutex; |
| 698 | struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ | 693 | struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ |
| @@ -704,9 +699,9 @@ struct fc_lport { | |||
| 704 | 699 | ||
| 705 | /* Associations */ | 700 | /* Associations */ |
| 706 | struct Scsi_Host *host; | 701 | struct Scsi_Host *host; |
| 707 | struct fc_exch_mgr *emp; | 702 | struct list_head ema_list; |
| 708 | struct fc_rport *dns_rp; | 703 | struct fc_rport_priv *dns_rp; |
| 709 | struct fc_rport *ptp_rp; | 704 | struct fc_rport_priv *ptp_rp; |
| 710 | void *scsi_priv; | 705 | void *scsi_priv; |
| 711 | struct fc_disc disc; | 706 | struct fc_disc disc; |
| 712 | 707 | ||
| @@ -960,6 +955,28 @@ int fc_elsct_init(struct fc_lport *lp); | |||
| 960 | int fc_exch_init(struct fc_lport *lp); | 955 | int fc_exch_init(struct fc_lport *lp); |
| 961 | 956 | ||
| 962 | /* | 957 | /* |
| 958 | * Adds Exchange Manager (EM) mp to lport. | ||
| 959 | * | ||
| 960 | * Adds specified mp to lport using struct fc_exch_mgr_anchor, | ||
| 961 | * the struct fc_exch_mgr_anchor allows same EM sharing by | ||
| 962 | * more than one lport with their specified match function, | ||
| 963 | * the match function is used in allocating exchange from | ||
| 964 | * added mp. | ||
| 965 | */ | ||
| 966 | struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport, | ||
| 967 | struct fc_exch_mgr *mp, | ||
| 968 | bool (*match)(struct fc_frame *)); | ||
| 969 | |||
| 970 | /* | ||
| 971 | * Deletes Exchange Manager (EM) from lport by removing | ||
| 972 | * its anchor ema from lport. | ||
| 973 | * | ||
| 974 | * If removed anchor ema was the last user of its associated EM | ||
| 975 | * then also destroys associated EM. | ||
| 976 | */ | ||
| 977 | void fc_exch_mgr_del(struct fc_exch_mgr_anchor *ema); | ||
| 978 | |||
| 979 | /* | ||
| 963 | * Allocates an Exchange Manager (EM). | 980 | * Allocates an Exchange Manager (EM). |
| 964 | * | 981 | * |
| 965 | * The EM manages exchanges for their allocation and | 982 | * The EM manages exchanges for their allocation and |
| @@ -974,27 +991,25 @@ int fc_exch_init(struct fc_lport *lp); | |||
| 974 | * a new exchange. | 991 | * a new exchange. |
| 975 | * The LLD may choose to have multiple EMs, | 992 | * The LLD may choose to have multiple EMs, |
| 976 | * e.g. one EM instance per CPU receive thread in LLD. | 993 | * e.g. one EM instance per CPU receive thread in LLD. |
| 977 | * The LLD can use exch_get() of struct libfc_function_template | ||
| 978 | * to specify XID for a new exchange within | ||
| 979 | * a specified EM instance. | ||
| 980 | * | 994 | * |
| 981 | * The em_idx to uniquely identify an EM instance. | 995 | * Specified match function is used in allocating exchanges |
| 996 | * from newly allocated EM. | ||
| 982 | */ | 997 | */ |
| 983 | struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, | 998 | struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, |
| 984 | enum fc_class class, | 999 | enum fc_class class, |
| 985 | u16 min_xid, | 1000 | u16 min_xid, |
| 986 | u16 max_xid); | 1001 | u16 max_xid, |
| 1002 | bool (*match)(struct fc_frame *)); | ||
| 987 | 1003 | ||
| 988 | /* | 1004 | /* |
| 989 | * Free an exchange manager. | 1005 | * Free all exchange managers of a lport. |
| 990 | */ | 1006 | */ |
| 991 | void fc_exch_mgr_free(struct fc_exch_mgr *mp); | 1007 | void fc_exch_mgr_free(struct fc_lport *lport); |
| 992 | 1008 | ||
| 993 | /* | 1009 | /* |
| 994 | * Receive a frame on specified local port and exchange manager. | 1010 | * Receive a frame on specified local port and exchange manager. |
| 995 | */ | 1011 | */ |
| 996 | void fc_exch_recv(struct fc_lport *lp, struct fc_exch_mgr *mp, | 1012 | void fc_exch_recv(struct fc_lport *lp, struct fc_frame *fp); |
| 997 | struct fc_frame *fp); | ||
| 998 | 1013 | ||
| 999 | /* | 1014 | /* |
| 1000 | * This function is for exch_seq_send function pointer in | 1015 | * This function is for exch_seq_send function pointer in |
| @@ -1036,28 +1051,20 @@ int fc_seq_exch_abort(const struct fc_seq *req_sp, unsigned int timer_msec); | |||
| 1036 | void fc_exch_done(struct fc_seq *sp); | 1051 | void fc_exch_done(struct fc_seq *sp); |
| 1037 | 1052 | ||
| 1038 | /* | 1053 | /* |
| 1039 | * Assigns a EM and XID for a frame and then allocates | ||
| 1040 | * a new exchange and sequence pair. | ||
| 1041 | * The fp can be used to determine free XID. | ||
| 1042 | */ | ||
| 1043 | struct fc_exch *fc_exch_get(struct fc_lport *lp, struct fc_frame *fp); | ||
| 1044 | |||
| 1045 | /* | ||
| 1046 | * Allocate a new exchange and sequence pair. | 1054 | * Allocate a new exchange and sequence pair. |
| 1047 | * if ex_id is zero then next free exchange id | ||
| 1048 | * from specified exchange manger mp will be assigned. | ||
| 1049 | */ | 1055 | */ |
| 1050 | struct fc_exch *fc_exch_alloc(struct fc_exch_mgr *mp, | 1056 | struct fc_exch *fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp); |
| 1051 | struct fc_frame *fp, u16 ex_id); | ||
| 1052 | /* | 1057 | /* |
| 1053 | * Start a new sequence on the same exchange as the supplied sequence. | 1058 | * Start a new sequence on the same exchange as the supplied sequence. |
| 1054 | */ | 1059 | */ |
| 1055 | struct fc_seq *fc_seq_start_next(struct fc_seq *sp); | 1060 | struct fc_seq *fc_seq_start_next(struct fc_seq *sp); |
| 1056 | 1061 | ||
| 1062 | |||
| 1057 | /* | 1063 | /* |
| 1058 | * Reset an exchange manager, completing all sequences and exchanges. | 1064 | * Reset all EMs of a lport, releasing its all sequences and |
| 1059 | * If s_id is non-zero, reset only exchanges originating from that FID. | 1065 | * exchanges. If sid is non-zero, then reset only exchanges |
| 1060 | * If d_id is non-zero, reset only exchanges sending to that FID. | 1066 | * we sourced from that FID. If did is non-zero, reset only |
| 1067 | * exchanges destined to that FID. | ||
| 1061 | */ | 1068 | */ |
| 1062 | void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); | 1069 | void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); |
| 1063 | 1070 | ||
| @@ -1078,4 +1085,9 @@ void fc_destroy_exch_mgr(void); | |||
| 1078 | int fc_setup_rport(void); | 1085 | int fc_setup_rport(void); |
| 1079 | void fc_destroy_rport(void); | 1086 | void fc_destroy_rport(void); |
| 1080 | 1087 | ||
| 1088 | /* | ||
| 1089 | * Internal libfc functions. | ||
| 1090 | */ | ||
| 1091 | const char *fc_els_resp_type(struct fc_frame *); | ||
| 1092 | |||
| 1081 | #endif /* _LIBFC_H_ */ | 1093 | #endif /* _LIBFC_H_ */ |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index 61afeb59a836..887e57e3e223 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
| @@ -390,6 +390,7 @@ extern void iscsi_session_failure(struct iscsi_session *session, | |||
| 390 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, | 390 | extern int iscsi_conn_get_param(struct iscsi_cls_conn *cls_conn, |
| 391 | enum iscsi_param param, char *buf); | 391 | enum iscsi_param param, char *buf); |
| 392 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); | 392 | extern void iscsi_suspend_tx(struct iscsi_conn *conn); |
| 393 | extern void iscsi_suspend_queue(struct iscsi_conn *conn); | ||
| 393 | extern void iscsi_conn_queue_work(struct iscsi_conn *conn); | 394 | extern void iscsi_conn_queue_work(struct iscsi_conn *conn); |
| 394 | 395 | ||
| 395 | #define iscsi_conn_printk(prefix, _c, fmt, a...) \ | 396 | #define iscsi_conn_printk(prefix, _c, fmt, a...) \ |
| @@ -415,6 +416,8 @@ extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t); | |||
| 415 | extern void iscsi_requeue_task(struct iscsi_task *task); | 416 | extern void iscsi_requeue_task(struct iscsi_task *task); |
| 416 | extern void iscsi_put_task(struct iscsi_task *task); | 417 | extern void iscsi_put_task(struct iscsi_task *task); |
| 417 | extern void __iscsi_get_task(struct iscsi_task *task); | 418 | extern void __iscsi_get_task(struct iscsi_task *task); |
| 419 | extern void iscsi_complete_scsi_task(struct iscsi_task *task, | ||
| 420 | uint32_t exp_cmdsn, uint32_t max_cmdsn); | ||
| 418 | 421 | ||
| 419 | /* | 422 | /* |
| 420 | * generic helpers | 423 | * generic helpers |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 3f566af3f101..9af48cbf0036 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
| @@ -187,10 +187,13 @@ struct scsi_device_handler { | |||
| 187 | void (*detach)(struct scsi_device *); | 187 | void (*detach)(struct scsi_device *); |
| 188 | int (*activate)(struct scsi_device *); | 188 | int (*activate)(struct scsi_device *); |
| 189 | int (*prep_fn)(struct scsi_device *, struct request *); | 189 | int (*prep_fn)(struct scsi_device *, struct request *); |
| 190 | int (*set_params)(struct scsi_device *, const char *); | ||
| 190 | }; | 191 | }; |
| 191 | 192 | ||
| 192 | struct scsi_dh_data { | 193 | struct scsi_dh_data { |
| 193 | struct scsi_device_handler *scsi_dh; | 194 | struct scsi_device_handler *scsi_dh; |
| 195 | struct scsi_device *sdev; | ||
| 196 | struct kref kref; | ||
| 194 | char buf[0]; | 197 | char buf[0]; |
| 195 | }; | 198 | }; |
| 196 | 199 | ||
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index 33efce20c26c..ff2407405b42 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h | |||
| @@ -60,6 +60,7 @@ extern int scsi_dh_activate(struct request_queue *); | |||
| 60 | extern int scsi_dh_handler_exist(const char *); | 60 | extern int scsi_dh_handler_exist(const char *); |
| 61 | extern int scsi_dh_attach(struct request_queue *, const char *); | 61 | extern int scsi_dh_attach(struct request_queue *, const char *); |
| 62 | extern void scsi_dh_detach(struct request_queue *); | 62 | extern void scsi_dh_detach(struct request_queue *); |
| 63 | extern int scsi_dh_set_params(struct request_queue *, const char *); | ||
| 63 | #else | 64 | #else |
| 64 | static inline int scsi_dh_activate(struct request_queue *req) | 65 | static inline int scsi_dh_activate(struct request_queue *req) |
| 65 | { | 66 | { |
| @@ -77,4 +78,8 @@ static inline void scsi_dh_detach(struct request_queue *q) | |||
| 77 | { | 78 | { |
| 78 | return; | 79 | return; |
| 79 | } | 80 | } |
| 81 | static inline int scsi_dh_set_params(struct request_queue *req, const char *params) | ||
| 82 | { | ||
| 83 | return -SCSI_DH_NOSYS; | ||
| 84 | } | ||
| 80 | #endif | 85 | #endif |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 251fc1cd5002..3dae3f799b9b 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
| @@ -32,6 +32,9 @@ | |||
| 32 | #include "control.h" | 32 | #include "control.h" |
| 33 | #include "info.h" | 33 | #include "info.h" |
| 34 | 34 | ||
| 35 | /* maximum number of devices on the AC97 bus */ | ||
| 36 | #define AC97_BUS_MAX_DEVICES 4 | ||
| 37 | |||
| 35 | /* | 38 | /* |
| 36 | * AC'97 codec registers | 39 | * AC'97 codec registers |
| 37 | */ | 40 | */ |
| @@ -642,4 +645,10 @@ int snd_ac97_pcm_double_rate_rules(struct snd_pcm_runtime *runtime); | |||
| 642 | /* ad hoc AC97 device driver access */ | 645 | /* ad hoc AC97 device driver access */ |
| 643 | extern struct bus_type ac97_bus_type; | 646 | extern struct bus_type ac97_bus_type; |
| 644 | 647 | ||
| 648 | /* AC97 platform_data adding function */ | ||
| 649 | static inline void snd_ac97_dev_add_pdata(struct snd_ac97 *ac97, void *data) | ||
| 650 | { | ||
| 651 | ac97->dev.platform_data = data; | ||
| 652 | } | ||
| 653 | |||
| 645 | #endif /* __SOUND_AC97_CODEC_H */ | 654 | #endif /* __SOUND_AC97_CODEC_H */ |
diff --git a/include/sound/asound.h b/include/sound/asound.h index 82aed3f47534..1f57bb92eb5a 100644 --- a/include/sound/asound.h +++ b/include/sound/asound.h | |||
| @@ -138,7 +138,7 @@ struct snd_hwdep_dsp_image { | |||
| 138 | * * | 138 | * * |
| 139 | *****************************************************************************/ | 139 | *****************************************************************************/ |
| 140 | 140 | ||
| 141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 9) | 141 | #define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 10) |
| 142 | 142 | ||
| 143 | typedef unsigned long snd_pcm_uframes_t; | 143 | typedef unsigned long snd_pcm_uframes_t; |
| 144 | typedef signed long snd_pcm_sframes_t; | 144 | typedef signed long snd_pcm_sframes_t; |
diff --git a/include/sound/core.h b/include/sound/core.h index 309cb9659a05..a61499c22b0b 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
| @@ -93,15 +93,6 @@ struct snd_device { | |||
| 93 | 93 | ||
| 94 | #define snd_device(n) list_entry(n, struct snd_device, list) | 94 | #define snd_device(n) list_entry(n, struct snd_device, list) |
| 95 | 95 | ||
| 96 | /* monitor files for graceful shutdown (hotplug) */ | ||
| 97 | |||
| 98 | struct snd_monitor_file { | ||
| 99 | struct file *file; | ||
| 100 | const struct file_operations *disconnected_f_op; | ||
| 101 | struct list_head shutdown_list; /* still need to shutdown */ | ||
| 102 | struct list_head list; /* link of monitor files */ | ||
| 103 | }; | ||
| 104 | |||
| 105 | /* main structure for soundcard */ | 96 | /* main structure for soundcard */ |
| 106 | 97 | ||
| 107 | struct snd_card { | 98 | struct snd_card { |
| @@ -311,9 +302,7 @@ int snd_component_add(struct snd_card *card, const char *component); | |||
| 311 | int snd_card_file_add(struct snd_card *card, struct file *file); | 302 | int snd_card_file_add(struct snd_card *card, struct file *file); |
| 312 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 303 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
| 313 | 304 | ||
| 314 | #ifndef snd_card_set_dev | ||
| 315 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) | 305 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) |
| 316 | #endif | ||
| 317 | 306 | ||
| 318 | /* device.c */ | 307 | /* device.c */ |
| 319 | 308 | ||
| @@ -340,18 +329,17 @@ unsigned int snd_dma_pointer(unsigned long dma, unsigned int size); | |||
| 340 | struct resource; | 329 | struct resource; |
| 341 | void release_and_free_resource(struct resource *res); | 330 | void release_and_free_resource(struct resource *res); |
| 342 | 331 | ||
| 343 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
| 344 | void snd_verbose_printk(const char *file, int line, const char *format, ...) | ||
| 345 | __attribute__ ((format (printf, 3, 4))); | ||
| 346 | #endif | ||
| 347 | #if defined(CONFIG_SND_DEBUG) && defined(CONFIG_SND_VERBOSE_PRINTK) | ||
| 348 | void snd_verbose_printd(const char *file, int line, const char *format, ...) | ||
| 349 | __attribute__ ((format (printf, 3, 4))); | ||
| 350 | #endif | ||
| 351 | |||
| 352 | /* --- */ | 332 | /* --- */ |
| 353 | 333 | ||
| 354 | #ifdef CONFIG_SND_VERBOSE_PRINTK | 334 | #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK) |
| 335 | void __snd_printk(unsigned int level, const char *file, int line, | ||
| 336 | const char *format, ...) | ||
| 337 | __attribute__ ((format (printf, 4, 5))); | ||
| 338 | #else | ||
| 339 | #define __snd_printk(level, file, line, format, args...) \ | ||
| 340 | printk(format, ##args) | ||
| 341 | #endif | ||
| 342 | |||
| 355 | /** | 343 | /** |
| 356 | * snd_printk - printk wrapper | 344 | * snd_printk - printk wrapper |
| 357 | * @fmt: format string | 345 | * @fmt: format string |
| @@ -360,15 +348,9 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
| 360 | * when configured with CONFIG_SND_VERBOSE_PRINTK. | 348 | * when configured with CONFIG_SND_VERBOSE_PRINTK. |
| 361 | */ | 349 | */ |
| 362 | #define snd_printk(fmt, args...) \ | 350 | #define snd_printk(fmt, args...) \ |
| 363 | snd_verbose_printk(__FILE__, __LINE__, fmt ,##args) | 351 | __snd_printk(0, __FILE__, __LINE__, fmt, ##args) |
| 364 | #else | ||
| 365 | #define snd_printk(fmt, args...) \ | ||
| 366 | printk(fmt ,##args) | ||
| 367 | #endif | ||
| 368 | 352 | ||
| 369 | #ifdef CONFIG_SND_DEBUG | 353 | #ifdef CONFIG_SND_DEBUG |
| 370 | |||
| 371 | #ifdef CONFIG_SND_VERBOSE_PRINTK | ||
| 372 | /** | 354 | /** |
| 373 | * snd_printd - debug printk | 355 | * snd_printd - debug printk |
| 374 | * @fmt: format string | 356 | * @fmt: format string |
| @@ -377,11 +359,7 @@ void snd_verbose_printd(const char *file, int line, const char *format, ...) | |||
| 377 | * Ignored when CONFIG_SND_DEBUG is not set. | 359 | * Ignored when CONFIG_SND_DEBUG is not set. |
| 378 | */ | 360 | */ |
| 379 | #define snd_printd(fmt, args...) \ | 361 | #define snd_printd(fmt, args...) \ |
| 380 | snd_verbose_printd(__FILE__, __LINE__, fmt ,##args) | 362 | __snd_printk(1, __FILE__, __LINE__, fmt, ##args) |
| 381 | #else | ||
| 382 | #define snd_printd(fmt, args...) \ | ||
| 383 | printk(fmt ,##args) | ||
| 384 | #endif | ||
| 385 | 363 | ||
| 386 | /** | 364 | /** |
| 387 | * snd_BUG - give a BUG warning message and stack trace | 365 | * snd_BUG - give a BUG warning message and stack trace |
| @@ -428,9 +406,10 @@ static inline int __snd_bug_on(int cond) | |||
| 428 | * Works like snd_printk() for debugging purposes. | 406 | * Works like snd_printk() for debugging purposes. |
| 429 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. | 407 | * Ignored when CONFIG_SND_DEBUG_VERBOSE is not set. |
| 430 | */ | 408 | */ |
| 431 | #define snd_printdd(format, args...) snd_printk(format, ##args) | 409 | #define snd_printdd(format, args...) \ |
| 410 | __snd_printk(2, __FILE__, __LINE__, format, ##args) | ||
| 432 | #else | 411 | #else |
| 433 | #define snd_printdd(format, args...) /* nothing */ | 412 | #define snd_printdd(format, args...) do { } while (0) |
| 434 | #endif | 413 | #endif |
| 435 | 414 | ||
| 436 | 415 | ||
| @@ -438,12 +417,10 @@ static inline int __snd_bug_on(int cond) | |||
| 438 | 417 | ||
| 439 | /* for easier backward-porting */ | 418 | /* for easier backward-porting */ |
| 440 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) | 419 | #if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE) |
| 441 | #ifndef gameport_set_dev_parent | ||
| 442 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) | 420 | #define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev)) |
| 443 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) | 421 | #define gameport_set_port_data(gp,r) ((gp)->port_data = (r)) |
| 444 | #define gameport_get_port_data(gp) (gp)->port_data | 422 | #define gameport_get_port_data(gp) (gp)->port_data |
| 445 | #endif | 423 | #endif |
| 446 | #endif | ||
| 447 | 424 | ||
| 448 | /* PCI quirk list helper */ | 425 | /* PCI quirk list helper */ |
| 449 | struct snd_pci_quirk { | 426 | struct snd_pci_quirk { |
diff --git a/include/sound/info.h b/include/sound/info.h index 7c2ee1a21b00..112e8949e1a7 100644 --- a/include/sound/info.h +++ b/include/sound/info.h | |||
| @@ -110,13 +110,13 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer); | |||
| 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} | 110 | static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {} |
| 111 | #endif | 111 | #endif |
| 112 | 112 | ||
| 113 | int snd_iprintf(struct snd_info_buffer *buffer, char *fmt, ...) \ | 113 | int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \ |
| 114 | __attribute__ ((format (printf, 2, 3))); | 114 | __attribute__ ((format (printf, 2, 3))); |
| 115 | int snd_info_init(void); | 115 | int snd_info_init(void); |
| 116 | int snd_info_done(void); | 116 | int snd_info_done(void); |
| 117 | 117 | ||
| 118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); | 118 | int snd_info_get_line(struct snd_info_buffer *buffer, char *line, int len); |
| 119 | char *snd_info_get_str(char *dest, char *src, int len); | 119 | const char *snd_info_get_str(char *dest, const char *src, int len); |
| 120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, | 120 | struct snd_info_entry *snd_info_create_module_entry(struct module *module, |
| 121 | const char *name, | 121 | const char *name, |
| 122 | struct snd_info_entry *parent); | 122 | struct snd_info_entry *parent); |
diff --git a/include/sound/memalloc.h b/include/sound/memalloc.h index 7ccce94a5255..c42506212649 100644 --- a/include/sound/memalloc.h +++ b/include/sound/memalloc.h | |||
| @@ -47,7 +47,11 @@ struct snd_dma_device { | |||
| 47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ | 47 | #define SNDRV_DMA_TYPE_UNKNOWN 0 /* not defined */ |
| 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ | 48 | #define SNDRV_DMA_TYPE_CONTINUOUS 1 /* continuous no-DMA memory */ |
| 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ | 49 | #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ |
| 50 | #ifdef CONFIG_SND_DMA_SGBUF | ||
| 50 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ | 51 | #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ |
| 52 | #else | ||
| 53 | #define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV /* no SG-buf support */ | ||
| 54 | #endif | ||
| 51 | 55 | ||
| 52 | /* | 56 | /* |
| 53 | * info for buffer allocation | 57 | * info for buffer allocation |
| @@ -60,6 +64,7 @@ struct snd_dma_buffer { | |||
| 60 | void *private_data; /* private for allocator; don't touch */ | 64 | void *private_data; /* private for allocator; don't touch */ |
| 61 | }; | 65 | }; |
| 62 | 66 | ||
| 67 | #ifdef CONFIG_SND_DMA_SGBUF | ||
| 63 | /* | 68 | /* |
| 64 | * Scatter-Gather generic device pages | 69 | * Scatter-Gather generic device pages |
| 65 | */ | 70 | */ |
| @@ -107,6 +112,7 @@ static inline void *snd_sgbuf_get_ptr(struct snd_sg_buf *sgbuf, size_t offset) | |||
| 107 | { | 112 | { |
| 108 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; | 113 | return sgbuf->table[offset >> PAGE_SHIFT].buf + offset % PAGE_SIZE; |
| 109 | } | 114 | } |
| 115 | #endif /* CONFIG_SND_DMA_SGBUF */ | ||
| 110 | 116 | ||
| 111 | /* allocate/release a buffer */ | 117 | /* allocate/release a buffer */ |
| 112 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, | 118 | int snd_dma_alloc_pages(int type, struct device *dev, size_t size, |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 23893523dc8c..de6d981de5d6 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
| @@ -902,6 +902,7 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm, | |||
| 902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); | 902 | int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); |
| 903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); | 903 | int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); |
| 904 | 904 | ||
| 905 | #ifdef CONFIG_SND_DMA_SGBUF | ||
| 905 | /* | 906 | /* |
| 906 | * SG-buffer handling | 907 | * SG-buffer handling |
| 907 | */ | 908 | */ |
| @@ -927,6 +928,28 @@ struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, | |||
| 927 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, | 928 | unsigned int snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream, |
| 928 | unsigned int ofs, unsigned int size); | 929 | unsigned int ofs, unsigned int size); |
| 929 | 930 | ||
| 931 | #else /* !SND_DMA_SGBUF */ | ||
| 932 | /* | ||
| 933 | * fake using a continuous buffer | ||
| 934 | */ | ||
| 935 | static inline dma_addr_t | ||
| 936 | snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
| 937 | { | ||
| 938 | return substream->runtime->dma_addr + ofs; | ||
| 939 | } | ||
| 940 | |||
| 941 | static inline void * | ||
| 942 | snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs) | ||
| 943 | { | ||
| 944 | return substream->runtime->dma_area + ofs; | ||
| 945 | } | ||
| 946 | |||
| 947 | #define snd_pcm_sgbuf_ops_page NULL | ||
| 948 | |||
| 949 | #define snd_pcm_sgbuf_get_chunk_size(subs, ofs, size) (size) | ||
| 950 | |||
| 951 | #endif /* SND_DMA_SGBUF */ | ||
| 952 | |||
| 930 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ | 953 | /* handle mmap counter - PCM mmap callback should handle this counter properly */ |
| 931 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) | 954 | static inline void snd_pcm_mmap_data_open(struct vm_area_struct *area) |
| 932 | { | 955 | { |
| @@ -965,4 +988,6 @@ static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) | |||
| 965 | 988 | ||
| 966 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) | 989 | #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime) |
| 967 | 990 | ||
| 991 | const char *snd_pcm_format_name(snd_pcm_format_t format); | ||
| 992 | |||
| 968 | #endif /* __SOUND_PCM_H */ | 993 | #endif /* __SOUND_PCM_H */ |
diff --git a/include/sound/sh_fsi.h b/include/sound/sh_fsi.h new file mode 100644 index 000000000000..c0227361a876 --- /dev/null +++ b/include/sound/sh_fsi.h | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | #ifndef __SOUND_FSI_H | ||
| 2 | #define __SOUND_FSI_H | ||
| 3 | |||
| 4 | /* | ||
| 5 | * Fifo-attached Serial Interface (FSI) support for SH7724 | ||
| 6 | * | ||
| 7 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
| 8 | * Kuninori Morimoto <morimoto.kuninori@renesas.com> | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License version 2 as | ||
| 12 | * published by the Free Software Foundation. | ||
| 13 | */ | ||
| 14 | |||
| 15 | /* flags format | ||
| 16 | |||
| 17 | * 0xABCDEEFF | ||
| 18 | * | ||
| 19 | * A: channel size for TDM (input) | ||
| 20 | * B: channel size for TDM (ooutput) | ||
| 21 | * C: inversion | ||
| 22 | * D: mode | ||
| 23 | * E: input format | ||
| 24 | * F: output format | ||
| 25 | */ | ||
| 26 | |||
| 27 | #include <linux/clk.h> | ||
| 28 | #include <sound/soc.h> | ||
| 29 | |||
| 30 | /* TDM channel */ | ||
| 31 | #define SH_FSI_SET_CH_I(x) ((x & 0xF) << 28) | ||
| 32 | #define SH_FSI_SET_CH_O(x) ((x & 0xF) << 24) | ||
| 33 | |||
| 34 | #define SH_FSI_CH_IMASK 0xF0000000 | ||
| 35 | #define SH_FSI_CH_OMASK 0x0F000000 | ||
| 36 | #define SH_FSI_GET_CH_I(x) ((x & SH_FSI_CH_IMASK) >> 28) | ||
| 37 | #define SH_FSI_GET_CH_O(x) ((x & SH_FSI_CH_OMASK) >> 24) | ||
| 38 | |||
| 39 | /* clock inversion */ | ||
| 40 | #define SH_FSI_INVERSION_MASK 0x00F00000 | ||
| 41 | #define SH_FSI_LRM_INV (1 << 20) | ||
| 42 | #define SH_FSI_BRM_INV (1 << 21) | ||
| 43 | #define SH_FSI_LRS_INV (1 << 22) | ||
| 44 | #define SH_FSI_BRS_INV (1 << 23) | ||
| 45 | |||
| 46 | /* mode */ | ||
| 47 | #define SH_FSI_MODE_MASK 0x000F0000 | ||
| 48 | #define SH_FSI_IN_SLAVE_MODE (1 << 16) /* default master mode */ | ||
| 49 | #define SH_FSI_OUT_SLAVE_MODE (1 << 17) /* default master mode */ | ||
| 50 | |||
| 51 | /* DI format */ | ||
| 52 | #define SH_FSI_FMT_MASK 0x000000FF | ||
| 53 | #define SH_FSI_IFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 8) | ||
| 54 | #define SH_FSI_OFMT(x) (((SH_FSI_FMT_ ## x) & SH_FSI_FMT_MASK) << 0) | ||
| 55 | #define SH_FSI_GET_IFMT(x) ((x >> 8) & SH_FSI_FMT_MASK) | ||
| 56 | #define SH_FSI_GET_OFMT(x) ((x >> 0) & SH_FSI_FMT_MASK) | ||
| 57 | |||
| 58 | #define SH_FSI_FMT_MONO (1 << 0) | ||
| 59 | #define SH_FSI_FMT_MONO_DELAY (1 << 1) | ||
| 60 | #define SH_FSI_FMT_PCM (1 << 2) | ||
| 61 | #define SH_FSI_FMT_I2S (1 << 3) | ||
| 62 | #define SH_FSI_FMT_TDM (1 << 4) | ||
| 63 | #define SH_FSI_FMT_TDM_DELAY (1 << 5) | ||
| 64 | |||
| 65 | #define SH_FSI_IFMT_TDM_CH(x) \ | ||
| 66 | (SH_FSI_IFMT(TDM) | SH_FSI_SET_CH_I(x)) | ||
| 67 | #define SH_FSI_IFMT_TDM_DELAY_CH(x) \ | ||
| 68 | (SH_FSI_IFMT(TDM_DELAY) | SH_FSI_SET_CH_I(x)) | ||
| 69 | |||
| 70 | #define SH_FSI_OFMT_TDM_CH(x) \ | ||
| 71 | (SH_FSI_OFMT(TDM) | SH_FSI_SET_CH_O(x)) | ||
| 72 | #define SH_FSI_OFMT_TDM_DELAY_CH(x) \ | ||
| 73 | (SH_FSI_OFMT(TDM_DELAY) | SH_FSI_SET_CH_O(x)) | ||
| 74 | |||
| 75 | struct sh_fsi_platform_info { | ||
| 76 | unsigned long porta_flags; | ||
| 77 | unsigned long portb_flags; | ||
| 78 | }; | ||
| 79 | |||
| 80 | extern struct snd_soc_dai fsi_soc_dai[2]; | ||
| 81 | extern struct snd_soc_platform fsi_soc_platform; | ||
| 82 | |||
| 83 | #endif /* __SOUND_FSI_H */ | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 352d7eee9b6d..97ca9af414dc 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
| @@ -27,8 +27,8 @@ struct snd_pcm_substream; | |||
| 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ | 27 | #define SND_SOC_DAIFMT_I2S 0 /* I2S mode */ |
| 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ | 28 | #define SND_SOC_DAIFMT_RIGHT_J 1 /* Right Justified mode */ |
| 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ | 29 | #define SND_SOC_DAIFMT_LEFT_J 2 /* Left Justified mode */ |
| 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data msb after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ |
| 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data msb during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
| 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
| 33 | 33 | ||
| 34 | /* left and right justified also known as MSB and LSB respectively */ | 34 | /* left and right justified also known as MSB and LSB respectively */ |
| @@ -38,7 +38,7 @@ struct snd_pcm_substream; | |||
| 38 | /* | 38 | /* |
| 39 | * DAI Clock gating. | 39 | * DAI Clock gating. |
| 40 | * | 40 | * |
| 41 | * DAI bit clocks can be be gated (disabled) when not the DAI is not | 41 | * DAI bit clocks can be be gated (disabled) when the DAI is not |
| 42 | * sending or receiving PCM data in a frame. This can be used to save power. | 42 | * sending or receiving PCM data in a frame. This can be used to save power. |
| 43 | */ | 43 | */ |
| 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ | 44 | #define SND_SOC_DAIFMT_CONT (0 << 4) /* continuous clock */ |
| @@ -51,21 +51,21 @@ struct snd_pcm_substream; | |||
| 51 | * format. | 51 | * format. |
| 52 | */ | 52 | */ |
| 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ | 53 | #define SND_SOC_DAIFMT_NB_NF (0 << 8) /* normal bit clock + frame */ |
| 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal bclk + inv frm */ | 54 | #define SND_SOC_DAIFMT_NB_IF (1 << 8) /* normal BCLK + inv FRM */ |
| 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert bclk + nor frm */ | 55 | #define SND_SOC_DAIFMT_IB_NF (2 << 8) /* invert BCLK + nor FRM */ |
| 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert bclk + frm */ | 56 | #define SND_SOC_DAIFMT_IB_IF (3 << 8) /* invert BCLK + FRM */ |
| 57 | 57 | ||
| 58 | /* | 58 | /* |
| 59 | * DAI hardware clock masters. | 59 | * DAI hardware clock masters. |
| 60 | * | 60 | * |
| 61 | * This is wrt the codec, the inverse is true for the interface | 61 | * This is wrt the codec, the inverse is true for the interface |
| 62 | * i.e. if the codec is clk and frm master then the interface is | 62 | * i.e. if the codec is clk and FRM master then the interface is |
| 63 | * clk and frame slave. | 63 | * clk and frame slave. |
| 64 | */ | 64 | */ |
| 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & frm master */ | 65 | #define SND_SOC_DAIFMT_CBM_CFM (0 << 12) /* codec clk & FRM master */ |
| 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & frm master */ | 66 | #define SND_SOC_DAIFMT_CBS_CFM (1 << 12) /* codec clk slave & FRM master */ |
| 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ | 67 | #define SND_SOC_DAIFMT_CBM_CFS (2 << 12) /* codec clk master & frame slave */ |
| 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & frm slave */ | 68 | #define SND_SOC_DAIFMT_CBS_CFS (3 << 12) /* codec clk & FRM slave */ |
| 69 | 69 | ||
| 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f | 70 | #define SND_SOC_DAIFMT_FORMAT_MASK 0x000f |
| 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 | 71 | #define SND_SOC_DAIFMT_CLOCK_MASK 0x00f0 |
| @@ -78,7 +78,13 @@ struct snd_pcm_substream; | |||
| 78 | #define SND_SOC_CLOCK_IN 0 | 78 | #define SND_SOC_CLOCK_IN 0 |
| 79 | #define SND_SOC_CLOCK_OUT 1 | 79 | #define SND_SOC_CLOCK_OUT 1 |
| 80 | 80 | ||
| 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S16_LE |\ | 81 | #define SND_SOC_STD_AC97_FMTS (SNDRV_PCM_FMTBIT_S8 |\ |
| 82 | SNDRV_PCM_FMTBIT_S16_LE |\ | ||
| 83 | SNDRV_PCM_FMTBIT_S16_BE |\ | ||
| 84 | SNDRV_PCM_FMTBIT_S20_3LE |\ | ||
| 85 | SNDRV_PCM_FMTBIT_S20_3BE |\ | ||
| 86 | SNDRV_PCM_FMTBIT_S24_3LE |\ | ||
| 87 | SNDRV_PCM_FMTBIT_S24_3BE |\ | ||
| 82 | SNDRV_PCM_FMTBIT_S32_LE |\ | 88 | SNDRV_PCM_FMTBIT_S32_LE |\ |
| 83 | SNDRV_PCM_FMTBIT_S32_BE) | 89 | SNDRV_PCM_FMTBIT_S32_BE) |
| 84 | 90 | ||
| @@ -106,7 +112,7 @@ int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | |||
| 106 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
| 107 | 113 | ||
| 108 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
| 109 | unsigned int mask, int slots); | 115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
| 110 | 116 | ||
| 111 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
| 112 | 118 | ||
| @@ -116,12 +122,12 @@ int snd_soc_dai_digital_mute(struct snd_soc_dai *dai, int mute); | |||
| 116 | /* | 122 | /* |
| 117 | * Digital Audio Interface. | 123 | * Digital Audio Interface. |
| 118 | * | 124 | * |
| 119 | * Describes the Digital Audio Interface in terms of it's ALSA, DAI and AC97 | 125 | * Describes the Digital Audio Interface in terms of its ALSA, DAI and AC97 |
| 120 | * operations an capabilities. Codec and platfom drivers will register a this | 126 | * operations and capabilities. Codec and platform drivers will register this |
| 121 | * structure for every DAI they have. | 127 | * structure for every DAI they have. |
| 122 | * | 128 | * |
| 123 | * This structure covers the clocking, formating and ALSA operations for each | 129 | * This structure covers the clocking, formating and ALSA operations for each |
| 124 | * interface a | 130 | * interface. |
| 125 | */ | 131 | */ |
| 126 | struct snd_soc_dai_ops { | 132 | struct snd_soc_dai_ops { |
| 127 | /* | 133 | /* |
| @@ -140,7 +146,8 @@ struct snd_soc_dai_ops { | |||
| 140 | */ | 146 | */ |
| 141 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); | 147 | int (*set_fmt)(struct snd_soc_dai *dai, unsigned int fmt); |
| 142 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
| 143 | unsigned int mask, int slots); | 149 | unsigned int tx_mask, unsigned int rx_mask, |
| 150 | int slots, int slot_width); | ||
| 144 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
| 145 | 152 | ||
| 146 | /* | 153 | /* |
| @@ -179,6 +186,7 @@ struct snd_soc_dai { | |||
| 179 | int ac97_control; | 186 | int ac97_control; |
| 180 | 187 | ||
| 181 | struct device *dev; | 188 | struct device *dev; |
| 189 | void *ac97_pdata; /* platform_data for the ac97 codec */ | ||
| 182 | 190 | ||
| 183 | /* DAI callbacks */ | 191 | /* DAI callbacks */ |
| 184 | int (*probe)(struct platform_device *pdev, | 192 | int (*probe)(struct platform_device *pdev, |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index ec8a45f9a069..c1410e3191e3 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
| @@ -137,6 +137,12 @@ | |||
| 137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} | 137 | .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} |
| 138 | 138 | ||
| 139 | /* stream domain */ | 139 | /* stream domain */ |
| 140 | #define SND_SOC_DAPM_AIF_IN(wname, stname, wslot, wreg, wshift, winvert) \ | ||
| 141 | { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ | ||
| 142 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
| 143 | #define SND_SOC_DAPM_AIF_OUT(wname, stname, wslot, wreg, wshift, winvert) \ | ||
| 144 | { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ | ||
| 145 | .reg = wreg, .shift = wshift, .invert = winvert } | ||
| 140 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ | 146 | #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ |
| 141 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ | 147 | { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ |
| 142 | .shift = wshift, .invert = winvert} | 148 | .shift = wshift, .invert = winvert} |
| @@ -279,9 +285,11 @@ int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | |||
| 279 | /* dapm events */ | 285 | /* dapm events */ |
| 280 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 286 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
| 281 | int event); | 287 | int event); |
| 288 | void snd_soc_dapm_shutdown(struct snd_soc_device *socdev); | ||
| 282 | 289 | ||
| 283 | /* dapm sys fs - used by the core */ | 290 | /* dapm sys fs - used by the core */ |
| 284 | int snd_soc_dapm_sys_add(struct device *dev); | 291 | int snd_soc_dapm_sys_add(struct device *dev); |
| 292 | void snd_soc_dapm_debugfs_init(struct snd_soc_codec *codec); | ||
| 285 | 293 | ||
| 286 | /* dapm audio pin control and status */ | 294 | /* dapm audio pin control and status */ |
| 287 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); | 295 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, const char *pin); |
| @@ -311,6 +319,8 @@ enum snd_soc_dapm_type { | |||
| 311 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ | 319 | snd_soc_dapm_pre, /* machine specific pre widget - exec first */ |
| 312 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 320 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
| 313 | snd_soc_dapm_supply, /* power/clock supply */ | 321 | snd_soc_dapm_supply, /* power/clock supply */ |
| 322 | snd_soc_dapm_aif_in, /* audio interface input */ | ||
| 323 | snd_soc_dapm_aif_out, /* audio interface output */ | ||
| 314 | }; | 324 | }; |
| 315 | 325 | ||
| 316 | /* | 326 | /* |
diff --git a/include/sound/soc.h b/include/sound/soc.h index cf6111d72b17..475cb7ed6bec 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
| @@ -135,6 +135,28 @@ | |||
| 135 | .info = snd_soc_info_volsw, \ | 135 | .info = snd_soc_info_volsw, \ |
| 136 | .get = xhandler_get, .put = xhandler_put, \ | 136 | .get = xhandler_get, .put = xhandler_put, \ |
| 137 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } | 137 | .private_value = SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) } |
| 138 | #define SOC_DOUBLE_EXT_TLV(xname, xreg, shift_left, shift_right, xmax, xinvert,\ | ||
| 139 | xhandler_get, xhandler_put, tlv_array) \ | ||
| 140 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
| 141 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
| 142 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
| 143 | .tlv.p = (tlv_array), \ | ||
| 144 | .info = snd_soc_info_volsw, \ | ||
| 145 | .get = xhandler_get, .put = xhandler_put, \ | ||
| 146 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
| 147 | {.reg = xreg, .shift = shift_left, .rshift = shift_right, \ | ||
| 148 | .max = xmax, .invert = xinvert} } | ||
| 149 | #define SOC_DOUBLE_R_EXT_TLV(xname, reg_left, reg_right, xshift, xmax, xinvert,\ | ||
| 150 | xhandler_get, xhandler_put, tlv_array) \ | ||
| 151 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ | ||
| 152 | .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | \ | ||
| 153 | SNDRV_CTL_ELEM_ACCESS_READWRITE, \ | ||
| 154 | .tlv.p = (tlv_array), \ | ||
| 155 | .info = snd_soc_info_volsw_2r, \ | ||
| 156 | .get = xhandler_get, .put = xhandler_put, \ | ||
| 157 | .private_value = (unsigned long)&(struct soc_mixer_control) \ | ||
| 158 | {.reg = reg_left, .rreg = reg_right, .shift = xshift, \ | ||
| 159 | .max = xmax, .invert = xinvert} } | ||
| 138 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ | 160 | #define SOC_SINGLE_BOOL_EXT(xname, xdata, xhandler_get, xhandler_put) \ |
| 139 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 161 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
| 140 | .info = snd_soc_info_bool_ext, \ | 162 | .info = snd_soc_info_bool_ext, \ |
| @@ -183,14 +205,28 @@ struct snd_soc_jack_gpio; | |||
| 183 | #endif | 205 | #endif |
| 184 | 206 | ||
| 185 | typedef int (*hw_write_t)(void *,const char* ,int); | 207 | typedef int (*hw_write_t)(void *,const char* ,int); |
| 186 | typedef int (*hw_read_t)(void *,char* ,int); | ||
| 187 | 208 | ||
| 188 | extern struct snd_ac97_bus_ops soc_ac97_ops; | 209 | extern struct snd_ac97_bus_ops soc_ac97_ops; |
| 189 | 210 | ||
| 211 | enum snd_soc_control_type { | ||
| 212 | SND_SOC_CUSTOM, | ||
| 213 | SND_SOC_I2C, | ||
| 214 | SND_SOC_SPI, | ||
| 215 | }; | ||
| 216 | |||
| 190 | int snd_soc_register_platform(struct snd_soc_platform *platform); | 217 | int snd_soc_register_platform(struct snd_soc_platform *platform); |
| 191 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); | 218 | void snd_soc_unregister_platform(struct snd_soc_platform *platform); |
| 192 | int snd_soc_register_codec(struct snd_soc_codec *codec); | 219 | int snd_soc_register_codec(struct snd_soc_codec *codec); |
| 193 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); | 220 | void snd_soc_unregister_codec(struct snd_soc_codec *codec); |
| 221 | int snd_soc_codec_volatile_register(struct snd_soc_codec *codec, int reg); | ||
| 222 | int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | ||
| 223 | int addr_bits, int data_bits, | ||
| 224 | enum snd_soc_control_type control); | ||
| 225 | |||
| 226 | #ifdef CONFIG_PM | ||
| 227 | int snd_soc_suspend_device(struct device *dev); | ||
| 228 | int snd_soc_resume_device(struct device *dev); | ||
| 229 | #endif | ||
| 194 | 230 | ||
| 195 | /* pcm <-> DAI connect */ | 231 | /* pcm <-> DAI connect */ |
| 196 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 232 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
| @@ -216,9 +252,9 @@ void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, | |||
| 216 | 252 | ||
| 217 | /* codec register bit access */ | 253 | /* codec register bit access */ |
| 218 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, | 254 | int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 219 | unsigned short mask, unsigned short value); | 255 | unsigned int mask, unsigned int value); |
| 220 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, | 256 | int snd_soc_test_bits(struct snd_soc_codec *codec, unsigned short reg, |
| 221 | unsigned short mask, unsigned short value); | 257 | unsigned int mask, unsigned int value); |
| 222 | 258 | ||
| 223 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, | 259 | int snd_soc_new_ac97_codec(struct snd_soc_codec *codec, |
| 224 | struct snd_ac97_bus_ops *ops, int num); | 260 | struct snd_ac97_bus_ops *ops, int num); |
| @@ -356,8 +392,10 @@ struct snd_soc_codec { | |||
| 356 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); | 392 | int (*write)(struct snd_soc_codec *, unsigned int, unsigned int); |
| 357 | int (*display_register)(struct snd_soc_codec *, char *, | 393 | int (*display_register)(struct snd_soc_codec *, char *, |
| 358 | size_t, unsigned int); | 394 | size_t, unsigned int); |
| 395 | int (*volatile_register)(unsigned int); | ||
| 396 | int (*readable_register)(unsigned int); | ||
| 359 | hw_write_t hw_write; | 397 | hw_write_t hw_write; |
| 360 | hw_read_t hw_read; | 398 | unsigned int (*hw_read)(struct snd_soc_codec *, unsigned int); |
| 361 | void *reg_cache; | 399 | void *reg_cache; |
| 362 | short reg_cache_size; | 400 | short reg_cache_size; |
| 363 | short reg_cache_step; | 401 | short reg_cache_step; |
| @@ -369,8 +407,6 @@ struct snd_soc_codec { | |||
| 369 | enum snd_soc_bias_level bias_level; | 407 | enum snd_soc_bias_level bias_level; |
| 370 | enum snd_soc_bias_level suspend_bias_level; | 408 | enum snd_soc_bias_level suspend_bias_level; |
| 371 | struct delayed_work delayed_work; | 409 | struct delayed_work delayed_work; |
| 372 | struct list_head up_list; | ||
| 373 | struct list_head down_list; | ||
| 374 | 410 | ||
| 375 | /* codec DAI's */ | 411 | /* codec DAI's */ |
| 376 | struct snd_soc_dai *dai; | 412 | struct snd_soc_dai *dai; |
| @@ -379,6 +415,7 @@ struct snd_soc_codec { | |||
| 379 | #ifdef CONFIG_DEBUG_FS | 415 | #ifdef CONFIG_DEBUG_FS |
| 380 | struct dentry *debugfs_reg; | 416 | struct dentry *debugfs_reg; |
| 381 | struct dentry *debugfs_pop_time; | 417 | struct dentry *debugfs_pop_time; |
| 418 | struct dentry *debugfs_dapm; | ||
| 382 | #endif | 419 | #endif |
| 383 | }; | 420 | }; |
| 384 | 421 | ||
diff --git a/include/sound/tlv.h b/include/sound/tlv.h index d136ea2181ed..9fd5b19ccf5c 100644 --- a/include/sound/tlv.h +++ b/include/sound/tlv.h | |||
| @@ -35,6 +35,8 @@ | |||
| 35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ | 35 | #define SNDRV_CTL_TLVT_DB_SCALE 1 /* dB scale */ |
| 36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ | 36 | #define SNDRV_CTL_TLVT_DB_LINEAR 2 /* linear volume */ |
| 37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ | 37 | #define SNDRV_CTL_TLVT_DB_RANGE 3 /* dB range container */ |
| 38 | #define SNDRV_CTL_TLVT_DB_MINMAX 4 /* dB scale with min/max */ | ||
| 39 | #define SNDRV_CTL_TLVT_DB_MINMAX_MUTE 5 /* dB scale with min/max with mute */ | ||
| 38 | 40 | ||
| 39 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ | 41 | #define TLV_DB_SCALE_ITEM(min, step, mute) \ |
| 40 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ | 42 | SNDRV_CTL_TLVT_DB_SCALE, 2 * sizeof(unsigned int), \ |
| @@ -42,6 +44,18 @@ | |||
| 42 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ | 44 | #define DECLARE_TLV_DB_SCALE(name, min, step, mute) \ |
| 43 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } | 45 | unsigned int name[] = { TLV_DB_SCALE_ITEM(min, step, mute) } |
| 44 | 46 | ||
| 47 | /* dB scale specified with min/max values instead of step */ | ||
| 48 | #define TLV_DB_MINMAX_ITEM(min_dB, max_dB) \ | ||
| 49 | SNDRV_CTL_TLVT_DB_MINMAX, 2 * sizeof(unsigned int), \ | ||
| 50 | (min_dB), (max_dB) | ||
| 51 | #define TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) \ | ||
| 52 | SNDRV_CTL_TLVT_DB_MINMAX_MUTE, 2 * sizeof(unsigned int), \ | ||
| 53 | (min_dB), (max_dB) | ||
| 54 | #define DECLARE_TLV_DB_MINMAX(name, min_dB, max_dB) \ | ||
| 55 | unsigned int name[] = { TLV_DB_MINMAX_ITEM(min_dB, max_dB) } | ||
| 56 | #define DECLARE_TLV_DB_MINMAX_MUTE(name, min_dB, max_dB) \ | ||
| 57 | unsigned int name[] = { TLV_DB_MINMAX_MUTE_ITEM(min_dB, max_dB) } | ||
| 58 | |||
| 45 | /* linear volume between min_dB and max_dB (.01dB unit) */ | 59 | /* linear volume between min_dB and max_dB (.01dB unit) */ |
| 46 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ | 60 | #define TLV_DB_LINEAR_ITEM(min_dB, max_dB) \ |
| 47 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ | 61 | SNDRV_CTL_TLVT_DB_LINEAR, 2 * sizeof(unsigned int), \ |
diff --git a/include/sound/uda1380.h b/include/sound/uda1380.h new file mode 100644 index 000000000000..381319c7000c --- /dev/null +++ b/include/sound/uda1380.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | /* | ||
| 2 | * UDA1380 ALSA SoC Codec driver | ||
| 3 | * | ||
| 4 | * Copyright 2009 Philipp Zabel | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __UDA1380_H | ||
| 12 | #define __UDA1380_H | ||
| 13 | |||
| 14 | struct uda1380_platform_data { | ||
| 15 | int gpio_power; | ||
| 16 | int gpio_reset; | ||
| 17 | int dac_clk; | ||
| 18 | #define UDA1380_DAC_CLK_SYSCLK 0 | ||
| 19 | #define UDA1380_DAC_CLK_WSPLL 1 | ||
| 20 | }; | ||
| 21 | |||
| 22 | #endif /* __UDA1380_H */ | ||
diff --git a/include/sound/version.h b/include/sound/version.h index 456f1359e1c0..22939142dd23 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
| @@ -1,3 +1,3 @@ | |||
| 1 | /* include/version.h */ | 1 | /* include/version.h */ |
| 2 | #define CONFIG_SND_VERSION "1.0.20" | 2 | #define CONFIG_SND_VERSION "1.0.21" |
| 3 | #define CONFIG_SND_DATE "" | 3 | #define CONFIG_SND_DATE "" |
diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h new file mode 100644 index 000000000000..9c661f2f8cda --- /dev/null +++ b/include/sound/wm8993.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * linux/sound/wm8993.h -- Platform data for WM8993 | ||
| 3 | * | ||
| 4 | * Copyright 2009 Wolfson Microelectronics. PLC. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License version 2 as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #ifndef __LINUX_SND_WM8993_H | ||
| 12 | #define __LINUX_SND_WM8993_H | ||
| 13 | |||
| 14 | /* Note that EQ1 only contains the enable/disable bit so will be | ||
| 15 | ignored but is included for simplicity. | ||
| 16 | */ | ||
| 17 | struct wm8993_retune_mobile_setting { | ||
| 18 | const char *name; | ||
| 19 | unsigned int rate; | ||
| 20 | u16 config[24]; | ||
| 21 | }; | ||
| 22 | |||
| 23 | struct wm8993_platform_data { | ||
| 24 | struct wm8993_retune_mobile_setting *retune_configs; | ||
| 25 | int num_retune_configs; | ||
| 26 | |||
| 27 | /* LINEOUT can be differential or single ended */ | ||
| 28 | unsigned int lineout1_diff:1; | ||
| 29 | unsigned int lineout2_diff:1; | ||
| 30 | |||
| 31 | /* Common mode feedback */ | ||
| 32 | unsigned int lineout1fb:1; | ||
| 33 | unsigned int lineout2fb:1; | ||
| 34 | |||
| 35 | /* Microphone biases: 0=0.9*AVDD1 1=0.65*AVVD1 */ | ||
| 36 | unsigned int micbias1_lvl:1; | ||
| 37 | unsigned int micbias2_lvl:1; | ||
| 38 | |||
| 39 | /* Jack detect threashold levels, see datasheet for values */ | ||
| 40 | unsigned int jd_scthr:2; | ||
| 41 | unsigned int jd_thr:2; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif | ||
diff --git a/include/sound/ymfpci.h b/include/sound/ymfpci.h index 05ead6698434..444cd6ba0ba7 100644 --- a/include/sound/ymfpci.h +++ b/include/sound/ymfpci.h | |||
| @@ -331,6 +331,7 @@ struct snd_ymfpci { | |||
| 331 | struct snd_ac97 *ac97; | 331 | struct snd_ac97 *ac97; |
| 332 | struct snd_rawmidi *rawmidi; | 332 | struct snd_rawmidi *rawmidi; |
| 333 | struct snd_timer *timer; | 333 | struct snd_timer *timer; |
| 334 | unsigned int timer_ticks; | ||
| 334 | 335 | ||
| 335 | struct pci_dev *pci; | 336 | struct pci_dev *pci; |
| 336 | struct snd_card *card; | 337 | struct snd_card *card; |
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index f7a7ae1e8f90..2a4b3bf74033 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
| @@ -26,6 +26,11 @@ | |||
| 26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | 26 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ |
| 27 | DEFINE_TRACE(name) | 27 | DEFINE_TRACE(name) |
| 28 | 28 | ||
| 29 | #undef TRACE_EVENT_FN | ||
| 30 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ | ||
| 31 | assign, print, reg, unreg) \ | ||
| 32 | DEFINE_TRACE_FN(name, reg, unreg) | ||
| 33 | |||
| 29 | #undef DECLARE_TRACE | 34 | #undef DECLARE_TRACE |
| 30 | #define DECLARE_TRACE(name, proto, args) \ | 35 | #define DECLARE_TRACE(name, proto, args) \ |
| 31 | DEFINE_TRACE(name) | 36 | DEFINE_TRACE(name) |
| @@ -56,6 +61,8 @@ | |||
| 56 | #include <trace/ftrace.h> | 61 | #include <trace/ftrace.h> |
| 57 | #endif | 62 | #endif |
| 58 | 63 | ||
| 64 | #undef TRACE_EVENT | ||
| 65 | #undef TRACE_EVENT_FN | ||
| 59 | #undef TRACE_HEADER_MULTI_READ | 66 | #undef TRACE_HEADER_MULTI_READ |
| 60 | 67 | ||
| 61 | /* Only undef what we defined in this file */ | 68 | /* Only undef what we defined in this file */ |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h new file mode 100644 index 000000000000..dbe108455275 --- /dev/null +++ b/include/trace/events/kvm.h | |||
| @@ -0,0 +1,151 @@ | |||
| 1 | #if !defined(_TRACE_KVM_MAIN_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 2 | #define _TRACE_KVM_MAIN_H | ||
| 3 | |||
| 4 | #include <linux/tracepoint.h> | ||
| 5 | |||
| 6 | #undef TRACE_SYSTEM | ||
| 7 | #define TRACE_SYSTEM kvm | ||
| 8 | #define TRACE_INCLUDE_FILE kvm | ||
| 9 | |||
| 10 | #if defined(__KVM_HAVE_IOAPIC) | ||
| 11 | TRACE_EVENT(kvm_set_irq, | ||
| 12 | TP_PROTO(unsigned int gsi, int level, int irq_source_id), | ||
| 13 | TP_ARGS(gsi, level, irq_source_id), | ||
| 14 | |||
| 15 | TP_STRUCT__entry( | ||
| 16 | __field( unsigned int, gsi ) | ||
| 17 | __field( int, level ) | ||
| 18 | __field( int, irq_source_id ) | ||
| 19 | ), | ||
| 20 | |||
| 21 | TP_fast_assign( | ||
| 22 | __entry->gsi = gsi; | ||
| 23 | __entry->level = level; | ||
| 24 | __entry->irq_source_id = irq_source_id; | ||
| 25 | ), | ||
| 26 | |||
| 27 | TP_printk("gsi %u level %d source %d", | ||
| 28 | __entry->gsi, __entry->level, __entry->irq_source_id) | ||
| 29 | ); | ||
| 30 | |||
| 31 | #define kvm_deliver_mode \ | ||
| 32 | {0x0, "Fixed"}, \ | ||
| 33 | {0x1, "LowPrio"}, \ | ||
| 34 | {0x2, "SMI"}, \ | ||
| 35 | {0x3, "Res3"}, \ | ||
| 36 | {0x4, "NMI"}, \ | ||
| 37 | {0x5, "INIT"}, \ | ||
| 38 | {0x6, "SIPI"}, \ | ||
| 39 | {0x7, "ExtINT"} | ||
| 40 | |||
| 41 | TRACE_EVENT(kvm_ioapic_set_irq, | ||
| 42 | TP_PROTO(__u64 e, int pin, bool coalesced), | ||
| 43 | TP_ARGS(e, pin, coalesced), | ||
| 44 | |||
| 45 | TP_STRUCT__entry( | ||
| 46 | __field( __u64, e ) | ||
| 47 | __field( int, pin ) | ||
| 48 | __field( bool, coalesced ) | ||
| 49 | ), | ||
| 50 | |||
| 51 | TP_fast_assign( | ||
| 52 | __entry->e = e; | ||
| 53 | __entry->pin = pin; | ||
| 54 | __entry->coalesced = coalesced; | ||
| 55 | ), | ||
| 56 | |||
| 57 | TP_printk("pin %u dst %x vec=%u (%s|%s|%s%s)%s", | ||
| 58 | __entry->pin, (u8)(__entry->e >> 56), (u8)__entry->e, | ||
| 59 | __print_symbolic((__entry->e >> 8 & 0x7), kvm_deliver_mode), | ||
| 60 | (__entry->e & (1<<11)) ? "logical" : "physical", | ||
| 61 | (__entry->e & (1<<15)) ? "level" : "edge", | ||
| 62 | (__entry->e & (1<<16)) ? "|masked" : "", | ||
| 63 | __entry->coalesced ? " (coalesced)" : "") | ||
| 64 | ); | ||
| 65 | |||
| 66 | TRACE_EVENT(kvm_msi_set_irq, | ||
| 67 | TP_PROTO(__u64 address, __u64 data), | ||
| 68 | TP_ARGS(address, data), | ||
| 69 | |||
| 70 | TP_STRUCT__entry( | ||
| 71 | __field( __u64, address ) | ||
| 72 | __field( __u64, data ) | ||
| 73 | ), | ||
| 74 | |||
| 75 | TP_fast_assign( | ||
| 76 | __entry->address = address; | ||
| 77 | __entry->data = data; | ||
| 78 | ), | ||
| 79 | |||
| 80 | TP_printk("dst %u vec %x (%s|%s|%s%s)", | ||
| 81 | (u8)(__entry->address >> 12), (u8)__entry->data, | ||
| 82 | __print_symbolic((__entry->data >> 8 & 0x7), kvm_deliver_mode), | ||
| 83 | (__entry->address & (1<<2)) ? "logical" : "physical", | ||
| 84 | (__entry->data & (1<<15)) ? "level" : "edge", | ||
| 85 | (__entry->address & (1<<3)) ? "|rh" : "") | ||
| 86 | ); | ||
| 87 | |||
| 88 | #define kvm_irqchips \ | ||
| 89 | {KVM_IRQCHIP_PIC_MASTER, "PIC master"}, \ | ||
| 90 | {KVM_IRQCHIP_PIC_SLAVE, "PIC slave"}, \ | ||
| 91 | {KVM_IRQCHIP_IOAPIC, "IOAPIC"} | ||
| 92 | |||
| 93 | TRACE_EVENT(kvm_ack_irq, | ||
| 94 | TP_PROTO(unsigned int irqchip, unsigned int pin), | ||
| 95 | TP_ARGS(irqchip, pin), | ||
| 96 | |||
| 97 | TP_STRUCT__entry( | ||
| 98 | __field( unsigned int, irqchip ) | ||
| 99 | __field( unsigned int, pin ) | ||
| 100 | ), | ||
| 101 | |||
| 102 | TP_fast_assign( | ||
| 103 | __entry->irqchip = irqchip; | ||
| 104 | __entry->pin = pin; | ||
| 105 | ), | ||
| 106 | |||
| 107 | TP_printk("irqchip %s pin %u", | ||
| 108 | __print_symbolic(__entry->irqchip, kvm_irqchips), | ||
| 109 | __entry->pin) | ||
| 110 | ); | ||
| 111 | |||
| 112 | |||
| 113 | |||
| 114 | #endif /* defined(__KVM_HAVE_IOAPIC) */ | ||
| 115 | |||
| 116 | #define KVM_TRACE_MMIO_READ_UNSATISFIED 0 | ||
| 117 | #define KVM_TRACE_MMIO_READ 1 | ||
| 118 | #define KVM_TRACE_MMIO_WRITE 2 | ||
| 119 | |||
| 120 | #define kvm_trace_symbol_mmio \ | ||
| 121 | { KVM_TRACE_MMIO_READ_UNSATISFIED, "unsatisfied-read" }, \ | ||
| 122 | { KVM_TRACE_MMIO_READ, "read" }, \ | ||
| 123 | { KVM_TRACE_MMIO_WRITE, "write" } | ||
| 124 | |||
| 125 | TRACE_EVENT(kvm_mmio, | ||
| 126 | TP_PROTO(int type, int len, u64 gpa, u64 val), | ||
| 127 | TP_ARGS(type, len, gpa, val), | ||
| 128 | |||
| 129 | TP_STRUCT__entry( | ||
| 130 | __field( u32, type ) | ||
| 131 | __field( u32, len ) | ||
| 132 | __field( u64, gpa ) | ||
| 133 | __field( u64, val ) | ||
| 134 | ), | ||
| 135 | |||
| 136 | TP_fast_assign( | ||
| 137 | __entry->type = type; | ||
| 138 | __entry->len = len; | ||
| 139 | __entry->gpa = gpa; | ||
| 140 | __entry->val = val; | ||
| 141 | ), | ||
| 142 | |||
| 143 | TP_printk("mmio %s len %u gpa 0x%llx val 0x%llx", | ||
| 144 | __print_symbolic(__entry->type, kvm_trace_symbol_mmio), | ||
| 145 | __entry->len, __entry->gpa, __entry->val) | ||
| 146 | ); | ||
| 147 | |||
| 148 | #endif /* _TRACE_KVM_MAIN_H */ | ||
| 149 | |||
| 150 | /* This part must be outside protection */ | ||
| 151 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/module.h b/include/trace/events/module.h new file mode 100644 index 000000000000..84160fb18478 --- /dev/null +++ b/include/trace/events/module.h | |||
| @@ -0,0 +1,126 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM module | ||
| 3 | |||
| 4 | #if !defined(_TRACE_MODULE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_MODULE_H | ||
| 6 | |||
| 7 | #include <linux/tracepoint.h> | ||
| 8 | |||
| 9 | #ifdef CONFIG_MODULES | ||
| 10 | |||
| 11 | struct module; | ||
| 12 | |||
| 13 | #define show_module_flags(flags) __print_flags(flags, "", \ | ||
| 14 | { (1UL << TAINT_PROPRIETARY_MODULE), "P" }, \ | ||
| 15 | { (1UL << TAINT_FORCED_MODULE), "F" }, \ | ||
| 16 | { (1UL << TAINT_CRAP), "C" }) | ||
| 17 | |||
| 18 | TRACE_EVENT(module_load, | ||
| 19 | |||
| 20 | TP_PROTO(struct module *mod), | ||
| 21 | |||
| 22 | TP_ARGS(mod), | ||
| 23 | |||
| 24 | TP_STRUCT__entry( | ||
| 25 | __field( unsigned int, taints ) | ||
| 26 | __string( name, mod->name ) | ||
| 27 | ), | ||
| 28 | |||
| 29 | TP_fast_assign( | ||
| 30 | __entry->taints = mod->taints; | ||
| 31 | __assign_str(name, mod->name); | ||
| 32 | ), | ||
| 33 | |||
| 34 | TP_printk("%s %s", __get_str(name), show_module_flags(__entry->taints)) | ||
| 35 | ); | ||
| 36 | |||
| 37 | TRACE_EVENT(module_free, | ||
| 38 | |||
| 39 | TP_PROTO(struct module *mod), | ||
| 40 | |||
| 41 | TP_ARGS(mod), | ||
| 42 | |||
| 43 | TP_STRUCT__entry( | ||
| 44 | __string( name, mod->name ) | ||
| 45 | ), | ||
| 46 | |||
| 47 | TP_fast_assign( | ||
| 48 | __assign_str(name, mod->name); | ||
| 49 | ), | ||
| 50 | |||
| 51 | TP_printk("%s", __get_str(name)) | ||
| 52 | ); | ||
| 53 | |||
| 54 | TRACE_EVENT(module_get, | ||
| 55 | |||
| 56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | ||
| 57 | |||
| 58 | TP_ARGS(mod, ip, refcnt), | ||
| 59 | |||
| 60 | TP_STRUCT__entry( | ||
| 61 | __field( unsigned long, ip ) | ||
| 62 | __field( int, refcnt ) | ||
| 63 | __string( name, mod->name ) | ||
| 64 | ), | ||
| 65 | |||
| 66 | TP_fast_assign( | ||
| 67 | __entry->ip = ip; | ||
| 68 | __entry->refcnt = refcnt; | ||
| 69 | __assign_str(name, mod->name); | ||
| 70 | ), | ||
| 71 | |||
| 72 | TP_printk("%s call_site=%pf refcnt=%d", | ||
| 73 | __get_str(name), (void *)__entry->ip, __entry->refcnt) | ||
| 74 | ); | ||
| 75 | |||
| 76 | TRACE_EVENT(module_put, | ||
| 77 | |||
| 78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | ||
| 79 | |||
| 80 | TP_ARGS(mod, ip, refcnt), | ||
| 81 | |||
| 82 | TP_STRUCT__entry( | ||
| 83 | __field( unsigned long, ip ) | ||
| 84 | __field( int, refcnt ) | ||
| 85 | __string( name, mod->name ) | ||
| 86 | ), | ||
| 87 | |||
| 88 | TP_fast_assign( | ||
| 89 | __entry->ip = ip; | ||
| 90 | __entry->refcnt = refcnt; | ||
| 91 | __assign_str(name, mod->name); | ||
| 92 | ), | ||
| 93 | |||
| 94 | TP_printk("%s call_site=%pf refcnt=%d", | ||
| 95 | __get_str(name), (void *)__entry->ip, __entry->refcnt) | ||
| 96 | ); | ||
| 97 | |||
| 98 | TRACE_EVENT(module_request, | ||
| 99 | |||
| 100 | TP_PROTO(char *name, bool wait, unsigned long ip), | ||
| 101 | |||
| 102 | TP_ARGS(name, wait, ip), | ||
| 103 | |||
| 104 | TP_STRUCT__entry( | ||
| 105 | __field( bool, wait ) | ||
| 106 | __field( unsigned long, ip ) | ||
| 107 | __string( name, name ) | ||
| 108 | ), | ||
| 109 | |||
| 110 | TP_fast_assign( | ||
| 111 | __entry->wait = wait; | ||
| 112 | __entry->ip = ip; | ||
| 113 | __assign_str(name, name); | ||
| 114 | ), | ||
| 115 | |||
| 116 | TP_printk("%s wait=%d call_site=%pf", | ||
| 117 | __get_str(name), (int)__entry->wait, (void *)__entry->ip) | ||
| 118 | ); | ||
| 119 | |||
| 120 | #endif /* CONFIG_MODULES */ | ||
| 121 | |||
| 122 | #endif /* _TRACE_MODULE_H */ | ||
| 123 | |||
| 124 | /* This part must be outside protection */ | ||
| 125 | #include <trace/define_trace.h> | ||
| 126 | |||
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 8949bb7eb082..b48f1ad7c946 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
| @@ -94,6 +94,7 @@ TRACE_EVENT(sched_wakeup, | |||
| 94 | __field( pid_t, pid ) | 94 | __field( pid_t, pid ) |
| 95 | __field( int, prio ) | 95 | __field( int, prio ) |
| 96 | __field( int, success ) | 96 | __field( int, success ) |
| 97 | __field( int, cpu ) | ||
| 97 | ), | 98 | ), |
| 98 | 99 | ||
| 99 | TP_fast_assign( | 100 | TP_fast_assign( |
| @@ -101,11 +102,12 @@ TRACE_EVENT(sched_wakeup, | |||
| 101 | __entry->pid = p->pid; | 102 | __entry->pid = p->pid; |
| 102 | __entry->prio = p->prio; | 103 | __entry->prio = p->prio; |
| 103 | __entry->success = success; | 104 | __entry->success = success; |
| 105 | __entry->cpu = task_cpu(p); | ||
| 104 | ), | 106 | ), |
| 105 | 107 | ||
| 106 | TP_printk("task %s:%d [%d] success=%d", | 108 | TP_printk("task %s:%d [%d] success=%d [%03d]", |
| 107 | __entry->comm, __entry->pid, __entry->prio, | 109 | __entry->comm, __entry->pid, __entry->prio, |
| 108 | __entry->success) | 110 | __entry->success, __entry->cpu) |
| 109 | ); | 111 | ); |
| 110 | 112 | ||
| 111 | /* | 113 | /* |
| @@ -125,6 +127,7 @@ TRACE_EVENT(sched_wakeup_new, | |||
| 125 | __field( pid_t, pid ) | 127 | __field( pid_t, pid ) |
| 126 | __field( int, prio ) | 128 | __field( int, prio ) |
| 127 | __field( int, success ) | 129 | __field( int, success ) |
| 130 | __field( int, cpu ) | ||
| 128 | ), | 131 | ), |
| 129 | 132 | ||
| 130 | TP_fast_assign( | 133 | TP_fast_assign( |
| @@ -132,11 +135,12 @@ TRACE_EVENT(sched_wakeup_new, | |||
| 132 | __entry->pid = p->pid; | 135 | __entry->pid = p->pid; |
| 133 | __entry->prio = p->prio; | 136 | __entry->prio = p->prio; |
| 134 | __entry->success = success; | 137 | __entry->success = success; |
| 138 | __entry->cpu = task_cpu(p); | ||
| 135 | ), | 139 | ), |
| 136 | 140 | ||
| 137 | TP_printk("task %s:%d [%d] success=%d", | 141 | TP_printk("task %s:%d [%d] success=%d [%03d]", |
| 138 | __entry->comm, __entry->pid, __entry->prio, | 142 | __entry->comm, __entry->pid, __entry->prio, |
| 139 | __entry->success) | 143 | __entry->success, __entry->cpu) |
| 140 | ); | 144 | ); |
| 141 | 145 | ||
| 142 | /* | 146 | /* |
| @@ -340,6 +344,101 @@ TRACE_EVENT(sched_signal_send, | |||
| 340 | __entry->sig, __entry->comm, __entry->pid) | 344 | __entry->sig, __entry->comm, __entry->pid) |
| 341 | ); | 345 | ); |
| 342 | 346 | ||
| 347 | /* | ||
| 348 | * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE | ||
| 349 | * adding sched_stat support to SCHED_FIFO/RR would be welcome. | ||
| 350 | */ | ||
| 351 | |||
| 352 | /* | ||
| 353 | * Tracepoint for accounting wait time (time the task is runnable | ||
| 354 | * but not actually running due to scheduler contention). | ||
| 355 | */ | ||
| 356 | TRACE_EVENT(sched_stat_wait, | ||
| 357 | |||
| 358 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
| 359 | |||
| 360 | TP_ARGS(tsk, delay), | ||
| 361 | |||
| 362 | TP_STRUCT__entry( | ||
| 363 | __array( char, comm, TASK_COMM_LEN ) | ||
| 364 | __field( pid_t, pid ) | ||
| 365 | __field( u64, delay ) | ||
| 366 | ), | ||
| 367 | |||
| 368 | TP_fast_assign( | ||
| 369 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
| 370 | __entry->pid = tsk->pid; | ||
| 371 | __entry->delay = delay; | ||
| 372 | ) | ||
| 373 | TP_perf_assign( | ||
| 374 | __perf_count(delay); | ||
| 375 | ), | ||
| 376 | |||
| 377 | TP_printk("task: %s:%d wait: %Lu [ns]", | ||
| 378 | __entry->comm, __entry->pid, | ||
| 379 | (unsigned long long)__entry->delay) | ||
| 380 | ); | ||
| 381 | |||
| 382 | /* | ||
| 383 | * Tracepoint for accounting sleep time (time the task is not runnable, | ||
| 384 | * including iowait, see below). | ||
| 385 | */ | ||
| 386 | TRACE_EVENT(sched_stat_sleep, | ||
| 387 | |||
| 388 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
| 389 | |||
| 390 | TP_ARGS(tsk, delay), | ||
| 391 | |||
| 392 | TP_STRUCT__entry( | ||
| 393 | __array( char, comm, TASK_COMM_LEN ) | ||
| 394 | __field( pid_t, pid ) | ||
| 395 | __field( u64, delay ) | ||
| 396 | ), | ||
| 397 | |||
| 398 | TP_fast_assign( | ||
| 399 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
| 400 | __entry->pid = tsk->pid; | ||
| 401 | __entry->delay = delay; | ||
| 402 | ) | ||
| 403 | TP_perf_assign( | ||
| 404 | __perf_count(delay); | ||
| 405 | ), | ||
| 406 | |||
| 407 | TP_printk("task: %s:%d sleep: %Lu [ns]", | ||
| 408 | __entry->comm, __entry->pid, | ||
| 409 | (unsigned long long)__entry->delay) | ||
| 410 | ); | ||
| 411 | |||
| 412 | /* | ||
| 413 | * Tracepoint for accounting iowait time (time the task is not runnable | ||
| 414 | * due to waiting on IO to complete). | ||
| 415 | */ | ||
| 416 | TRACE_EVENT(sched_stat_iowait, | ||
| 417 | |||
| 418 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
| 419 | |||
| 420 | TP_ARGS(tsk, delay), | ||
| 421 | |||
| 422 | TP_STRUCT__entry( | ||
| 423 | __array( char, comm, TASK_COMM_LEN ) | ||
| 424 | __field( pid_t, pid ) | ||
| 425 | __field( u64, delay ) | ||
| 426 | ), | ||
| 427 | |||
| 428 | TP_fast_assign( | ||
| 429 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
| 430 | __entry->pid = tsk->pid; | ||
| 431 | __entry->delay = delay; | ||
| 432 | ) | ||
| 433 | TP_perf_assign( | ||
| 434 | __perf_count(delay); | ||
| 435 | ), | ||
| 436 | |||
| 437 | TP_printk("task: %s:%d iowait: %Lu [ns]", | ||
| 438 | __entry->comm, __entry->pid, | ||
| 439 | (unsigned long long)__entry->delay) | ||
| 440 | ); | ||
| 441 | |||
| 343 | #endif /* _TRACE_SCHED_H */ | 442 | #endif /* _TRACE_SCHED_H */ |
| 344 | 443 | ||
| 345 | /* This part must be outside protection */ | 444 | /* This part must be outside protection */ |
diff --git a/include/trace/events/skb.h b/include/trace/events/skb.h index e499863b9669..4b2be6dc76f0 100644 --- a/include/trace/events/skb.h +++ b/include/trace/events/skb.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #define _TRACE_SKB_H | 5 | #define _TRACE_SKB_H |
| 6 | 6 | ||
| 7 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
| 8 | #include <linux/netdevice.h> | ||
| 8 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
| 9 | 10 | ||
| 10 | /* | 11 | /* |
| @@ -34,6 +35,25 @@ TRACE_EVENT(kfree_skb, | |||
| 34 | __entry->skbaddr, __entry->protocol, __entry->location) | 35 | __entry->skbaddr, __entry->protocol, __entry->location) |
| 35 | ); | 36 | ); |
| 36 | 37 | ||
| 38 | TRACE_EVENT(skb_copy_datagram_iovec, | ||
| 39 | |||
| 40 | TP_PROTO(const struct sk_buff *skb, int len), | ||
| 41 | |||
| 42 | TP_ARGS(skb, len), | ||
| 43 | |||
| 44 | TP_STRUCT__entry( | ||
| 45 | __field( const void *, skbaddr ) | ||
| 46 | __field( int, len ) | ||
| 47 | ), | ||
| 48 | |||
| 49 | TP_fast_assign( | ||
| 50 | __entry->skbaddr = skb; | ||
| 51 | __entry->len = len; | ||
| 52 | ), | ||
| 53 | |||
| 54 | TP_printk("skbaddr=%p len=%d", __entry->skbaddr, __entry->len) | ||
| 55 | ); | ||
| 56 | |||
| 37 | #endif /* _TRACE_SKB_H */ | 57 | #endif /* _TRACE_SKB_H */ |
| 38 | 58 | ||
| 39 | /* This part must be outside protection */ | 59 | /* This part must be outside protection */ |
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h new file mode 100644 index 000000000000..397dff2dbd5a --- /dev/null +++ b/include/trace/events/syscalls.h | |||
| @@ -0,0 +1,70 @@ | |||
| 1 | #undef TRACE_SYSTEM | ||
| 2 | #define TRACE_SYSTEM syscalls | ||
| 3 | |||
| 4 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) | ||
| 5 | #define _TRACE_EVENTS_SYSCALLS_H | ||
| 6 | |||
| 7 | #include <linux/tracepoint.h> | ||
| 8 | |||
| 9 | #include <asm/ptrace.h> | ||
| 10 | #include <asm/syscall.h> | ||
| 11 | |||
| 12 | |||
| 13 | #ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS | ||
| 14 | |||
| 15 | extern void syscall_regfunc(void); | ||
| 16 | extern void syscall_unregfunc(void); | ||
| 17 | |||
| 18 | TRACE_EVENT_FN(sys_enter, | ||
| 19 | |||
| 20 | TP_PROTO(struct pt_regs *regs, long id), | ||
| 21 | |||
| 22 | TP_ARGS(regs, id), | ||
| 23 | |||
| 24 | TP_STRUCT__entry( | ||
| 25 | __field( long, id ) | ||
| 26 | __array( unsigned long, args, 6 ) | ||
| 27 | ), | ||
| 28 | |||
| 29 | TP_fast_assign( | ||
| 30 | __entry->id = id; | ||
| 31 | syscall_get_arguments(current, regs, 0, 6, __entry->args); | ||
| 32 | ), | ||
| 33 | |||
| 34 | TP_printk("NR %ld (%lx, %lx, %lx, %lx, %lx, %lx)", | ||
| 35 | __entry->id, | ||
| 36 | __entry->args[0], __entry->args[1], __entry->args[2], | ||
| 37 | __entry->args[3], __entry->args[4], __entry->args[5]), | ||
| 38 | |||
| 39 | syscall_regfunc, syscall_unregfunc | ||
| 40 | ); | ||
| 41 | |||
| 42 | TRACE_EVENT_FN(sys_exit, | ||
| 43 | |||
| 44 | TP_PROTO(struct pt_regs *regs, long ret), | ||
| 45 | |||
| 46 | TP_ARGS(regs, ret), | ||
| 47 | |||
| 48 | TP_STRUCT__entry( | ||
| 49 | __field( long, id ) | ||
| 50 | __field( long, ret ) | ||
| 51 | ), | ||
| 52 | |||
| 53 | TP_fast_assign( | ||
| 54 | __entry->id = syscall_get_nr(current, regs); | ||
| 55 | __entry->ret = ret; | ||
| 56 | ), | ||
| 57 | |||
| 58 | TP_printk("NR %ld = %ld", | ||
| 59 | __entry->id, __entry->ret), | ||
| 60 | |||
| 61 | syscall_regfunc, syscall_unregfunc | ||
| 62 | ); | ||
| 63 | |||
| 64 | #endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */ | ||
| 65 | |||
| 66 | #endif /* _TRACE_EVENTS_SYSCALLS_H */ | ||
| 67 | |||
| 68 | /* This part must be outside protection */ | ||
| 69 | #include <trace/define_trace.h> | ||
| 70 | |||
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 1867553c61e5..308bafd93325 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
| @@ -21,11 +21,14 @@ | |||
| 21 | #undef __field | 21 | #undef __field |
| 22 | #define __field(type, item) type item; | 22 | #define __field(type, item) type item; |
| 23 | 23 | ||
| 24 | #undef __field_ext | ||
| 25 | #define __field_ext(type, item, filter_type) type item; | ||
| 26 | |||
| 24 | #undef __array | 27 | #undef __array |
| 25 | #define __array(type, item, len) type item[len]; | 28 | #define __array(type, item, len) type item[len]; |
| 26 | 29 | ||
| 27 | #undef __dynamic_array | 30 | #undef __dynamic_array |
| 28 | #define __dynamic_array(type, item, len) unsigned short __data_loc_##item; | 31 | #define __dynamic_array(type, item, len) u32 __data_loc_##item; |
| 29 | 32 | ||
| 30 | #undef __string | 33 | #undef __string |
| 31 | #define __string(item, src) __dynamic_array(char, item, -1) | 34 | #define __string(item, src) __dynamic_array(char, item, -1) |
| @@ -42,6 +45,16 @@ | |||
| 42 | }; \ | 45 | }; \ |
| 43 | static struct ftrace_event_call event_##name | 46 | static struct ftrace_event_call event_##name |
| 44 | 47 | ||
| 48 | #undef __cpparg | ||
| 49 | #define __cpparg(arg...) arg | ||
| 50 | |||
| 51 | /* Callbacks are meaningless to ftrace. */ | ||
| 52 | #undef TRACE_EVENT_FN | ||
| 53 | #define TRACE_EVENT_FN(name, proto, args, tstruct, \ | ||
| 54 | assign, print, reg, unreg) \ | ||
| 55 | TRACE_EVENT(name, __cpparg(proto), __cpparg(args), \ | ||
| 56 | __cpparg(tstruct), __cpparg(assign), __cpparg(print)) \ | ||
| 57 | |||
| 45 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 58 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 46 | 59 | ||
| 47 | 60 | ||
| @@ -51,23 +64,27 @@ | |||
| 51 | * Include the following: | 64 | * Include the following: |
| 52 | * | 65 | * |
| 53 | * struct ftrace_data_offsets_<call> { | 66 | * struct ftrace_data_offsets_<call> { |
| 54 | * int <item1>; | 67 | * u32 <item1>; |
| 55 | * int <item2>; | 68 | * u32 <item2>; |
| 56 | * [...] | 69 | * [...] |
| 57 | * }; | 70 | * }; |
| 58 | * | 71 | * |
| 59 | * The __dynamic_array() macro will create each int <item>, this is | 72 | * The __dynamic_array() macro will create each u32 <item>, this is |
| 60 | * to keep the offset of each array from the beginning of the event. | 73 | * to keep the offset of each array from the beginning of the event. |
| 74 | * The size of an array is also encoded, in the higher 16 bits of <item>. | ||
| 61 | */ | 75 | */ |
| 62 | 76 | ||
| 63 | #undef __field | 77 | #undef __field |
| 64 | #define __field(type, item); | 78 | #define __field(type, item) |
| 79 | |||
| 80 | #undef __field_ext | ||
| 81 | #define __field_ext(type, item, filter_type) | ||
| 65 | 82 | ||
| 66 | #undef __array | 83 | #undef __array |
| 67 | #define __array(type, item, len) | 84 | #define __array(type, item, len) |
| 68 | 85 | ||
| 69 | #undef __dynamic_array | 86 | #undef __dynamic_array |
| 70 | #define __dynamic_array(type, item, len) int item; | 87 | #define __dynamic_array(type, item, len) u32 item; |
| 71 | 88 | ||
| 72 | #undef __string | 89 | #undef __string |
| 73 | #define __string(item, src) __dynamic_array(char, item, -1) | 90 | #define __string(item, src) __dynamic_array(char, item, -1) |
| @@ -109,6 +126,9 @@ | |||
| 109 | if (!ret) \ | 126 | if (!ret) \ |
| 110 | return 0; | 127 | return 0; |
| 111 | 128 | ||
| 129 | #undef __field_ext | ||
| 130 | #define __field_ext(type, item, filter_type) __field(type, item) | ||
| 131 | |||
| 112 | #undef __array | 132 | #undef __array |
| 113 | #define __array(type, item, len) \ | 133 | #define __array(type, item, len) \ |
| 114 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ | 134 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ |
| @@ -120,7 +140,7 @@ | |||
| 120 | 140 | ||
| 121 | #undef __dynamic_array | 141 | #undef __dynamic_array |
| 122 | #define __dynamic_array(type, item, len) \ | 142 | #define __dynamic_array(type, item, len) \ |
| 123 | ret = trace_seq_printf(s, "\tfield:__data_loc " #item ";\t" \ | 143 | ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ |
| 124 | "offset:%u;\tsize:%u;\n", \ | 144 | "offset:%u;\tsize:%u;\n", \ |
| 125 | (unsigned int)offsetof(typeof(field), \ | 145 | (unsigned int)offsetof(typeof(field), \ |
| 126 | __data_loc_##item), \ | 146 | __data_loc_##item), \ |
| @@ -144,10 +164,14 @@ | |||
| 144 | #undef TP_fast_assign | 164 | #undef TP_fast_assign |
| 145 | #define TP_fast_assign(args...) args | 165 | #define TP_fast_assign(args...) args |
| 146 | 166 | ||
| 167 | #undef TP_perf_assign | ||
| 168 | #define TP_perf_assign(args...) | ||
| 169 | |||
| 147 | #undef TRACE_EVENT | 170 | #undef TRACE_EVENT |
| 148 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | 171 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ |
| 149 | static int \ | 172 | static int \ |
| 150 | ftrace_format_##call(struct trace_seq *s) \ | 173 | ftrace_format_##call(struct ftrace_event_call *unused, \ |
| 174 | struct trace_seq *s) \ | ||
| 151 | { \ | 175 | { \ |
| 152 | struct ftrace_raw_##call field __attribute__((unused)); \ | 176 | struct ftrace_raw_##call field __attribute__((unused)); \ |
| 153 | int ret = 0; \ | 177 | int ret = 0; \ |
| @@ -207,7 +231,7 @@ ftrace_format_##call(struct trace_seq *s) \ | |||
| 207 | 231 | ||
| 208 | #undef __get_dynamic_array | 232 | #undef __get_dynamic_array |
| 209 | #define __get_dynamic_array(field) \ | 233 | #define __get_dynamic_array(field) \ |
| 210 | ((void *)__entry + __entry->__data_loc_##field) | 234 | ((void *)__entry + (__entry->__data_loc_##field & 0xffff)) |
| 211 | 235 | ||
| 212 | #undef __get_str | 236 | #undef __get_str |
| 213 | #define __get_str(field) (char *)__get_dynamic_array(field) | 237 | #define __get_str(field) (char *)__get_dynamic_array(field) |
| @@ -260,28 +284,33 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
| 260 | 284 | ||
| 261 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 285 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 262 | 286 | ||
| 263 | #undef __field | 287 | #undef __field_ext |
| 264 | #define __field(type, item) \ | 288 | #define __field_ext(type, item, filter_type) \ |
| 265 | ret = trace_define_field(event_call, #type, #item, \ | 289 | ret = trace_define_field(event_call, #type, #item, \ |
| 266 | offsetof(typeof(field), item), \ | 290 | offsetof(typeof(field), item), \ |
| 267 | sizeof(field.item), is_signed_type(type)); \ | 291 | sizeof(field.item), \ |
| 292 | is_signed_type(type), filter_type); \ | ||
| 268 | if (ret) \ | 293 | if (ret) \ |
| 269 | return ret; | 294 | return ret; |
| 270 | 295 | ||
| 296 | #undef __field | ||
| 297 | #define __field(type, item) __field_ext(type, item, FILTER_OTHER) | ||
| 298 | |||
| 271 | #undef __array | 299 | #undef __array |
| 272 | #define __array(type, item, len) \ | 300 | #define __array(type, item, len) \ |
| 273 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ | 301 | BUILD_BUG_ON(len > MAX_FILTER_STR_VAL); \ |
| 274 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ | 302 | ret = trace_define_field(event_call, #type "[" #len "]", #item, \ |
| 275 | offsetof(typeof(field), item), \ | 303 | offsetof(typeof(field), item), \ |
| 276 | sizeof(field.item), 0); \ | 304 | sizeof(field.item), 0, FILTER_OTHER); \ |
| 277 | if (ret) \ | 305 | if (ret) \ |
| 278 | return ret; | 306 | return ret; |
| 279 | 307 | ||
| 280 | #undef __dynamic_array | 308 | #undef __dynamic_array |
| 281 | #define __dynamic_array(type, item, len) \ | 309 | #define __dynamic_array(type, item, len) \ |
| 282 | ret = trace_define_field(event_call, "__data_loc" "[" #type "]", #item,\ | 310 | ret = trace_define_field(event_call, "__data_loc " #type "[]", #item, \ |
| 283 | offsetof(typeof(field), __data_loc_##item), \ | 311 | offsetof(typeof(field), __data_loc_##item), \ |
| 284 | sizeof(field.__data_loc_##item), 0); | 312 | sizeof(field.__data_loc_##item), 0, \ |
| 313 | FILTER_OTHER); | ||
| 285 | 314 | ||
| 286 | #undef __string | 315 | #undef __string |
| 287 | #define __string(item, src) __dynamic_array(char, item, -1) | 316 | #define __string(item, src) __dynamic_array(char, item, -1) |
| @@ -289,17 +318,14 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
| 289 | #undef TRACE_EVENT | 318 | #undef TRACE_EVENT |
| 290 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | 319 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ |
| 291 | int \ | 320 | int \ |
| 292 | ftrace_define_fields_##call(void) \ | 321 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ |
| 293 | { \ | 322 | { \ |
| 294 | struct ftrace_raw_##call field; \ | 323 | struct ftrace_raw_##call field; \ |
| 295 | struct ftrace_event_call *event_call = &event_##call; \ | ||
| 296 | int ret; \ | 324 | int ret; \ |
| 297 | \ | 325 | \ |
| 298 | __common_field(int, type, 1); \ | 326 | ret = trace_define_common_fields(event_call); \ |
| 299 | __common_field(unsigned char, flags, 0); \ | 327 | if (ret) \ |
| 300 | __common_field(unsigned char, preempt_count, 0); \ | 328 | return ret; \ |
| 301 | __common_field(int, pid, 1); \ | ||
| 302 | __common_field(int, tgid, 1); \ | ||
| 303 | \ | 329 | \ |
| 304 | tstruct; \ | 330 | tstruct; \ |
| 305 | \ | 331 | \ |
| @@ -318,6 +344,9 @@ ftrace_define_fields_##call(void) \ | |||
| 318 | #undef __field | 344 | #undef __field |
| 319 | #define __field(type, item) | 345 | #define __field(type, item) |
| 320 | 346 | ||
| 347 | #undef __field_ext | ||
| 348 | #define __field_ext(type, item, filter_type) | ||
| 349 | |||
| 321 | #undef __array | 350 | #undef __array |
| 322 | #define __array(type, item, len) | 351 | #define __array(type, item, len) |
| 323 | 352 | ||
| @@ -325,6 +354,7 @@ ftrace_define_fields_##call(void) \ | |||
| 325 | #define __dynamic_array(type, item, len) \ | 354 | #define __dynamic_array(type, item, len) \ |
| 326 | __data_offsets->item = __data_size + \ | 355 | __data_offsets->item = __data_size + \ |
| 327 | offsetof(typeof(*entry), __data); \ | 356 | offsetof(typeof(*entry), __data); \ |
| 357 | __data_offsets->item |= (len * sizeof(type)) << 16; \ | ||
| 328 | __data_size += (len) * sizeof(type); | 358 | __data_size += (len) * sizeof(type); |
| 329 | 359 | ||
| 330 | #undef __string | 360 | #undef __string |
| @@ -345,6 +375,56 @@ static inline int ftrace_get_offsets_##call( \ | |||
| 345 | 375 | ||
| 346 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 376 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 347 | 377 | ||
| 378 | #ifdef CONFIG_EVENT_PROFILE | ||
| 379 | |||
| 380 | /* | ||
| 381 | * Generate the functions needed for tracepoint perf_counter support. | ||
| 382 | * | ||
| 383 | * NOTE: The insertion profile callback (ftrace_profile_<call>) is defined later | ||
| 384 | * | ||
| 385 | * static int ftrace_profile_enable_<call>(struct ftrace_event_call *event_call) | ||
| 386 | * { | ||
| 387 | * int ret = 0; | ||
| 388 | * | ||
| 389 | * if (!atomic_inc_return(&event_call->profile_count)) | ||
| 390 | * ret = register_trace_<call>(ftrace_profile_<call>); | ||
| 391 | * | ||
| 392 | * return ret; | ||
| 393 | * } | ||
| 394 | * | ||
| 395 | * static void ftrace_profile_disable_<call>(struct ftrace_event_call *event_call) | ||
| 396 | * { | ||
| 397 | * if (atomic_add_negative(-1, &event->call->profile_count)) | ||
| 398 | * unregister_trace_<call>(ftrace_profile_<call>); | ||
| 399 | * } | ||
| 400 | * | ||
| 401 | */ | ||
| 402 | |||
| 403 | #undef TRACE_EVENT | ||
| 404 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
| 405 | \ | ||
| 406 | static void ftrace_profile_##call(proto); \ | ||
| 407 | \ | ||
| 408 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | ||
| 409 | { \ | ||
| 410 | int ret = 0; \ | ||
| 411 | \ | ||
| 412 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
| 413 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
| 414 | \ | ||
| 415 | return ret; \ | ||
| 416 | } \ | ||
| 417 | \ | ||
| 418 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | ||
| 419 | { \ | ||
| 420 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | ||
| 421 | unregister_trace_##call(ftrace_profile_##call); \ | ||
| 422 | } | ||
| 423 | |||
| 424 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
| 425 | |||
| 426 | #endif | ||
| 427 | |||
| 348 | /* | 428 | /* |
| 349 | * Stage 4 of the trace events. | 429 | * Stage 4 of the trace events. |
| 350 | * | 430 | * |
| @@ -380,13 +460,15 @@ static inline int ftrace_get_offsets_##call( \ | |||
| 380 | * { | 460 | * { |
| 381 | * struct ring_buffer_event *event; | 461 | * struct ring_buffer_event *event; |
| 382 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | 462 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 |
| 463 | * struct ring_buffer *buffer; | ||
| 383 | * unsigned long irq_flags; | 464 | * unsigned long irq_flags; |
| 384 | * int pc; | 465 | * int pc; |
| 385 | * | 466 | * |
| 386 | * local_save_flags(irq_flags); | 467 | * local_save_flags(irq_flags); |
| 387 | * pc = preempt_count(); | 468 | * pc = preempt_count(); |
| 388 | * | 469 | * |
| 389 | * event = trace_current_buffer_lock_reserve(event_<call>.id, | 470 | * event = trace_current_buffer_lock_reserve(&buffer, |
| 471 | * event_<call>.id, | ||
| 390 | * sizeof(struct ftrace_raw_<call>), | 472 | * sizeof(struct ftrace_raw_<call>), |
| 391 | * irq_flags, pc); | 473 | * irq_flags, pc); |
| 392 | * if (!event) | 474 | * if (!event) |
| @@ -396,7 +478,7 @@ static inline int ftrace_get_offsets_##call( \ | |||
| 396 | * <assign>; <-- Here we assign the entries by the __field and | 478 | * <assign>; <-- Here we assign the entries by the __field and |
| 397 | * __array macros. | 479 | * __array macros. |
| 398 | * | 480 | * |
| 399 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); | 481 | * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); |
| 400 | * } | 482 | * } |
| 401 | * | 483 | * |
| 402 | * static int ftrace_raw_reg_event_<call>(void) | 484 | * static int ftrace_raw_reg_event_<call>(void) |
| @@ -447,28 +529,6 @@ static inline int ftrace_get_offsets_##call( \ | |||
| 447 | #define TP_FMT(fmt, args...) fmt "\n", ##args | 529 | #define TP_FMT(fmt, args...) fmt "\n", ##args |
| 448 | 530 | ||
| 449 | #ifdef CONFIG_EVENT_PROFILE | 531 | #ifdef CONFIG_EVENT_PROFILE |
| 450 | #define _TRACE_PROFILE(call, proto, args) \ | ||
| 451 | static void ftrace_profile_##call(proto) \ | ||
| 452 | { \ | ||
| 453 | extern void perf_tpcounter_event(int); \ | ||
| 454 | perf_tpcounter_event(event_##call.id); \ | ||
| 455 | } \ | ||
| 456 | \ | ||
| 457 | static int ftrace_profile_enable_##call(struct ftrace_event_call *event_call) \ | ||
| 458 | { \ | ||
| 459 | int ret = 0; \ | ||
| 460 | \ | ||
| 461 | if (!atomic_inc_return(&event_call->profile_count)) \ | ||
| 462 | ret = register_trace_##call(ftrace_profile_##call); \ | ||
| 463 | \ | ||
| 464 | return ret; \ | ||
| 465 | } \ | ||
| 466 | \ | ||
| 467 | static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | ||
| 468 | { \ | ||
| 469 | if (atomic_add_negative(-1, &event_call->profile_count)) \ | ||
| 470 | unregister_trace_##call(ftrace_profile_##call); \ | ||
| 471 | } | ||
| 472 | 532 | ||
| 473 | #define _TRACE_PROFILE_INIT(call) \ | 533 | #define _TRACE_PROFILE_INIT(call) \ |
| 474 | .profile_count = ATOMIC_INIT(-1), \ | 534 | .profile_count = ATOMIC_INIT(-1), \ |
| @@ -476,7 +536,6 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
| 476 | .profile_disable = ftrace_profile_disable_##call, | 536 | .profile_disable = ftrace_profile_disable_##call, |
| 477 | 537 | ||
| 478 | #else | 538 | #else |
| 479 | #define _TRACE_PROFILE(call, proto, args) | ||
| 480 | #define _TRACE_PROFILE_INIT(call) | 539 | #define _TRACE_PROFILE_INIT(call) |
| 481 | #endif | 540 | #endif |
| 482 | 541 | ||
| @@ -502,7 +561,6 @@ static void ftrace_profile_disable_##call(struct ftrace_event_call *event_call)\ | |||
| 502 | 561 | ||
| 503 | #undef TRACE_EVENT | 562 | #undef TRACE_EVENT |
| 504 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 563 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ |
| 505 | _TRACE_PROFILE(call, PARAMS(proto), PARAMS(args)) \ | ||
| 506 | \ | 564 | \ |
| 507 | static struct ftrace_event_call event_##call; \ | 565 | static struct ftrace_event_call event_##call; \ |
| 508 | \ | 566 | \ |
| @@ -512,6 +570,7 @@ static void ftrace_raw_event_##call(proto) \ | |||
| 512 | struct ftrace_event_call *event_call = &event_##call; \ | 570 | struct ftrace_event_call *event_call = &event_##call; \ |
| 513 | struct ring_buffer_event *event; \ | 571 | struct ring_buffer_event *event; \ |
| 514 | struct ftrace_raw_##call *entry; \ | 572 | struct ftrace_raw_##call *entry; \ |
| 573 | struct ring_buffer *buffer; \ | ||
| 515 | unsigned long irq_flags; \ | 574 | unsigned long irq_flags; \ |
| 516 | int __data_size; \ | 575 | int __data_size; \ |
| 517 | int pc; \ | 576 | int pc; \ |
| @@ -521,7 +580,8 @@ static void ftrace_raw_event_##call(proto) \ | |||
| 521 | \ | 580 | \ |
| 522 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 581 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
| 523 | \ | 582 | \ |
| 524 | event = trace_current_buffer_lock_reserve(event_##call.id, \ | 583 | event = trace_current_buffer_lock_reserve(&buffer, \ |
| 584 | event_##call.id, \ | ||
| 525 | sizeof(*entry) + __data_size, \ | 585 | sizeof(*entry) + __data_size, \ |
| 526 | irq_flags, pc); \ | 586 | irq_flags, pc); \ |
| 527 | if (!event) \ | 587 | if (!event) \ |
| @@ -533,11 +593,12 @@ static void ftrace_raw_event_##call(proto) \ | |||
| 533 | \ | 593 | \ |
| 534 | { assign; } \ | 594 | { assign; } \ |
| 535 | \ | 595 | \ |
| 536 | if (!filter_current_check_discard(event_call, entry, event)) \ | 596 | if (!filter_current_check_discard(buffer, event_call, entry, event)) \ |
| 537 | trace_nowake_buffer_unlock_commit(event, irq_flags, pc); \ | 597 | trace_nowake_buffer_unlock_commit(buffer, \ |
| 598 | event, irq_flags, pc); \ | ||
| 538 | } \ | 599 | } \ |
| 539 | \ | 600 | \ |
| 540 | static int ftrace_raw_reg_event_##call(void) \ | 601 | static int ftrace_raw_reg_event_##call(void *ptr) \ |
| 541 | { \ | 602 | { \ |
| 542 | int ret; \ | 603 | int ret; \ |
| 543 | \ | 604 | \ |
| @@ -548,7 +609,7 @@ static int ftrace_raw_reg_event_##call(void) \ | |||
| 548 | return ret; \ | 609 | return ret; \ |
| 549 | } \ | 610 | } \ |
| 550 | \ | 611 | \ |
| 551 | static void ftrace_raw_unreg_event_##call(void) \ | 612 | static void ftrace_raw_unreg_event_##call(void *ptr) \ |
| 552 | { \ | 613 | { \ |
| 553 | unregister_trace_##call(ftrace_raw_event_##call); \ | 614 | unregister_trace_##call(ftrace_raw_event_##call); \ |
| 554 | } \ | 615 | } \ |
| @@ -566,7 +627,6 @@ static int ftrace_raw_init_event_##call(void) \ | |||
| 566 | return -ENODEV; \ | 627 | return -ENODEV; \ |
| 567 | event_##call.id = id; \ | 628 | event_##call.id = id; \ |
| 568 | INIT_LIST_HEAD(&event_##call.fields); \ | 629 | INIT_LIST_HEAD(&event_##call.fields); \ |
| 569 | init_preds(&event_##call); \ | ||
| 570 | return 0; \ | 630 | return 0; \ |
| 571 | } \ | 631 | } \ |
| 572 | \ | 632 | \ |
| @@ -586,6 +646,110 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
| 586 | 646 | ||
| 587 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 647 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
| 588 | 648 | ||
| 589 | #undef _TRACE_PROFILE | 649 | /* |
| 650 | * Define the insertion callback to profile events | ||
| 651 | * | ||
| 652 | * The job is very similar to ftrace_raw_event_<call> except that we don't | ||
| 653 | * insert in the ring buffer but in a perf counter. | ||
| 654 | * | ||
| 655 | * static void ftrace_profile_<call>(proto) | ||
| 656 | * { | ||
| 657 | * struct ftrace_data_offsets_<call> __maybe_unused __data_offsets; | ||
| 658 | * struct ftrace_event_call *event_call = &event_<call>; | ||
| 659 | * extern void perf_tpcounter_event(int, u64, u64, void *, int); | ||
| 660 | * struct ftrace_raw_##call *entry; | ||
| 661 | * u64 __addr = 0, __count = 1; | ||
| 662 | * unsigned long irq_flags; | ||
| 663 | * int __entry_size; | ||
| 664 | * int __data_size; | ||
| 665 | * int pc; | ||
| 666 | * | ||
| 667 | * local_save_flags(irq_flags); | ||
| 668 | * pc = preempt_count(); | ||
| 669 | * | ||
| 670 | * __data_size = ftrace_get_offsets_<call>(&__data_offsets, args); | ||
| 671 | * | ||
| 672 | * // Below we want to get the aligned size by taking into account | ||
| 673 | * // the u32 field that will later store the buffer size | ||
| 674 | * __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32), | ||
| 675 | * sizeof(u64)); | ||
| 676 | * __entry_size -= sizeof(u32); | ||
| 677 | * | ||
| 678 | * do { | ||
| 679 | * char raw_data[__entry_size]; <- allocate our sample in the stack | ||
| 680 | * struct trace_entry *ent; | ||
| 681 | * | ||
| 682 | * zero dead bytes from alignment to avoid stack leak to userspace: | ||
| 683 | * | ||
| 684 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; | ||
| 685 | * entry = (struct ftrace_raw_<call> *)raw_data; | ||
| 686 | * ent = &entry->ent; | ||
| 687 | * tracing_generic_entry_update(ent, irq_flags, pc); | ||
| 688 | * ent->type = event_call->id; | ||
| 689 | * | ||
| 690 | * <tstruct> <- do some jobs with dynamic arrays | ||
| 691 | * | ||
| 692 | * <assign> <- affect our values | ||
| 693 | * | ||
| 694 | * perf_tpcounter_event(event_call->id, __addr, __count, entry, | ||
| 695 | * __entry_size); <- submit them to perf counter | ||
| 696 | * } while (0); | ||
| 697 | * | ||
| 698 | * } | ||
| 699 | */ | ||
| 700 | |||
| 701 | #ifdef CONFIG_EVENT_PROFILE | ||
| 702 | |||
| 703 | #undef __perf_addr | ||
| 704 | #define __perf_addr(a) __addr = (a) | ||
| 705 | |||
| 706 | #undef __perf_count | ||
| 707 | #define __perf_count(c) __count = (c) | ||
| 708 | |||
| 709 | #undef TRACE_EVENT | ||
| 710 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | ||
| 711 | static void ftrace_profile_##call(proto) \ | ||
| 712 | { \ | ||
| 713 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | ||
| 714 | struct ftrace_event_call *event_call = &event_##call; \ | ||
| 715 | extern void perf_tpcounter_event(int, u64, u64, void *, int); \ | ||
| 716 | struct ftrace_raw_##call *entry; \ | ||
| 717 | u64 __addr = 0, __count = 1; \ | ||
| 718 | unsigned long irq_flags; \ | ||
| 719 | int __entry_size; \ | ||
| 720 | int __data_size; \ | ||
| 721 | int pc; \ | ||
| 722 | \ | ||
| 723 | local_save_flags(irq_flags); \ | ||
| 724 | pc = preempt_count(); \ | ||
| 725 | \ | ||
| 726 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | ||
| 727 | __entry_size = ALIGN(__data_size + sizeof(*entry) + sizeof(u32),\ | ||
| 728 | sizeof(u64)); \ | ||
| 729 | __entry_size -= sizeof(u32); \ | ||
| 730 | \ | ||
| 731 | do { \ | ||
| 732 | char raw_data[__entry_size]; \ | ||
| 733 | struct trace_entry *ent; \ | ||
| 734 | \ | ||
| 735 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ | ||
| 736 | entry = (struct ftrace_raw_##call *)raw_data; \ | ||
| 737 | ent = &entry->ent; \ | ||
| 738 | tracing_generic_entry_update(ent, irq_flags, pc); \ | ||
| 739 | ent->type = event_call->id; \ | ||
| 740 | \ | ||
| 741 | tstruct \ | ||
| 742 | \ | ||
| 743 | { assign; } \ | ||
| 744 | \ | ||
| 745 | perf_tpcounter_event(event_call->id, __addr, __count, entry,\ | ||
| 746 | __entry_size); \ | ||
| 747 | } while (0); \ | ||
| 748 | \ | ||
| 749 | } | ||
| 750 | |||
| 751 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
| 752 | #endif /* CONFIG_EVENT_PROFILE */ | ||
| 753 | |||
| 590 | #undef _TRACE_PROFILE_INIT | 754 | #undef _TRACE_PROFILE_INIT |
| 591 | 755 | ||
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 8cfe515cbc47..5dc283ba5ae0 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
| @@ -1,8 +1,13 @@ | |||
| 1 | #ifndef _TRACE_SYSCALL_H | 1 | #ifndef _TRACE_SYSCALL_H |
| 2 | #define _TRACE_SYSCALL_H | 2 | #define _TRACE_SYSCALL_H |
| 3 | 3 | ||
| 4 | #include <linux/tracepoint.h> | ||
| 5 | #include <linux/unistd.h> | ||
| 6 | #include <linux/ftrace_event.h> | ||
| 7 | |||
| 4 | #include <asm/ptrace.h> | 8 | #include <asm/ptrace.h> |
| 5 | 9 | ||
| 10 | |||
| 6 | /* | 11 | /* |
| 7 | * A syscall entry in the ftrace syscalls array. | 12 | * A syscall entry in the ftrace syscalls array. |
| 8 | * | 13 | * |
| @@ -10,26 +15,49 @@ | |||
| 10 | * @nb_args: number of parameters it takes | 15 | * @nb_args: number of parameters it takes |
| 11 | * @types: list of types as strings | 16 | * @types: list of types as strings |
| 12 | * @args: list of args as strings (args[i] matches types[i]) | 17 | * @args: list of args as strings (args[i] matches types[i]) |
| 18 | * @enter_id: associated ftrace enter event id | ||
| 19 | * @exit_id: associated ftrace exit event id | ||
| 20 | * @enter_event: associated syscall_enter trace event | ||
| 21 | * @exit_event: associated syscall_exit trace event | ||
| 13 | */ | 22 | */ |
| 14 | struct syscall_metadata { | 23 | struct syscall_metadata { |
| 15 | const char *name; | 24 | const char *name; |
| 16 | int nb_args; | 25 | int nb_args; |
| 17 | const char **types; | 26 | const char **types; |
| 18 | const char **args; | 27 | const char **args; |
| 28 | int enter_id; | ||
| 29 | int exit_id; | ||
| 30 | |||
| 31 | struct ftrace_event_call *enter_event; | ||
| 32 | struct ftrace_event_call *exit_event; | ||
| 19 | }; | 33 | }; |
| 20 | 34 | ||
| 21 | #ifdef CONFIG_FTRACE_SYSCALLS | 35 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 22 | extern void arch_init_ftrace_syscalls(void); | ||
| 23 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); | 36 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); |
| 24 | extern void start_ftrace_syscalls(void); | 37 | extern int syscall_name_to_nr(char *name); |
| 25 | extern void stop_ftrace_syscalls(void); | 38 | void set_syscall_enter_id(int num, int id); |
| 26 | extern void ftrace_syscall_enter(struct pt_regs *regs); | 39 | void set_syscall_exit_id(int num, int id); |
| 27 | extern void ftrace_syscall_exit(struct pt_regs *regs); | 40 | extern struct trace_event event_syscall_enter; |
| 28 | #else | 41 | extern struct trace_event event_syscall_exit; |
| 29 | static inline void start_ftrace_syscalls(void) { } | 42 | extern int reg_event_syscall_enter(void *ptr); |
| 30 | static inline void stop_ftrace_syscalls(void) { } | 43 | extern void unreg_event_syscall_enter(void *ptr); |
| 31 | static inline void ftrace_syscall_enter(struct pt_regs *regs) { } | 44 | extern int reg_event_syscall_exit(void *ptr); |
| 32 | static inline void ftrace_syscall_exit(struct pt_regs *regs) { } | 45 | extern void unreg_event_syscall_exit(void *ptr); |
| 46 | extern int syscall_enter_format(struct ftrace_event_call *call, | ||
| 47 | struct trace_seq *s); | ||
| 48 | extern int syscall_exit_format(struct ftrace_event_call *call, | ||
| 49 | struct trace_seq *s); | ||
| 50 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); | ||
| 51 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); | ||
| 52 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); | ||
| 53 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | ||
| 54 | #endif | ||
| 55 | #ifdef CONFIG_EVENT_PROFILE | ||
| 56 | int reg_prof_syscall_enter(char *name); | ||
| 57 | void unreg_prof_syscall_enter(char *name); | ||
| 58 | int reg_prof_syscall_exit(char *name); | ||
| 59 | void unreg_prof_syscall_exit(char *name); | ||
| 60 | |||
| 33 | #endif | 61 | #endif |
| 34 | 62 | ||
| 35 | #endif /* _TRACE_SYSCALL_H */ | 63 | #endif /* _TRACE_SYSCALL_H */ |
