diff options
Diffstat (limited to 'include')
186 files changed, 4676 insertions, 3070 deletions
diff --git a/include/Kbuild b/include/Kbuild index 8d226bfa2696..83256b64166a 100644 --- a/include/Kbuild +++ b/include/Kbuild | |||
@@ -1,12 +1,8 @@ | |||
1 | # Top-level Makefile calls into asm-$(ARCH) | 1 | # Top-level Makefile calls into asm-$(ARCH) |
2 | # List only non-arch directories below | 2 | # List only non-arch directories below |
3 | 3 | ||
4 | header-y += asm-generic/ | ||
5 | header-y += linux/ | 4 | header-y += linux/ |
6 | header-y += sound/ | 5 | header-y += sound/ |
7 | header-y += mtd/ | ||
8 | header-y += rdma/ | 6 | header-y += rdma/ |
9 | header-y += video/ | 7 | header-y += video/ |
10 | header-y += drm/ | ||
11 | header-y += xen/ | ||
12 | header-y += scsi/ | 8 | header-y += scsi/ |
diff --git a/include/asm-generic/Kbuild b/include/asm-generic/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/asm-generic/Kbuild +++ /dev/null | |||
diff --git a/include/drm/Kbuild b/include/drm/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/drm/Kbuild +++ /dev/null | |||
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h index c78bb997e2c6..c5c35e629426 100644 --- a/include/drm/drm_pciids.h +++ b/include/drm/drm_pciids.h | |||
@@ -205,9 +205,12 @@ | |||
205 | {0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 205 | {0x1002, 0x6788, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
206 | {0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 206 | {0x1002, 0x678A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
207 | {0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 207 | {0x1002, 0x6790, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
208 | {0x1002, 0x6791, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | ||
209 | {0x1002, 0x6792, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | ||
208 | {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 210 | {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
209 | {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 211 | {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
210 | {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 212 | {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
213 | {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | ||
211 | {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 214 | {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
212 | {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ | 215 | {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \ |
213 | {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ | 216 | {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ |
@@ -217,6 +220,7 @@ | |||
217 | {0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | 220 | {0x1002, 0x6808, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
218 | {0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | 221 | {0x1002, 0x6809, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
219 | {0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | 222 | {0x1002, 0x6810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
223 | {0x1002, 0x6811, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | ||
220 | {0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | 224 | {0x1002, 0x6816, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
221 | {0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | 225 | {0x1002, 0x6817, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
222 | {0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ | 226 | {0x1002, 0x6818, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_NEW_MEMMAP}, \ |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 5b57367e28db..7fe2dae251e5 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -1,31 +1,5 @@ | |||
1 | header-y += byteorder/ | ||
2 | header-y += can/ | ||
3 | header-y += caif/ | ||
4 | header-y += dvb/ | 1 | header-y += dvb/ |
5 | header-y += hdlc/ | 2 | header-y += hdlc/ |
6 | header-y += hsi/ | 3 | header-y += hsi/ |
7 | header-y += isdn/ | ||
8 | header-y += mmc/ | ||
9 | header-y += nfsd/ | ||
10 | header-y += raid/ | 4 | header-y += raid/ |
11 | header-y += spi/ | ||
12 | header-y += sunrpc/ | ||
13 | header-y += tc_act/ | ||
14 | header-y += tc_ematch/ | ||
15 | header-y += netfilter/ | ||
16 | header-y += netfilter_arp/ | ||
17 | header-y += netfilter_bridge/ | ||
18 | header-y += netfilter_ipv4/ | ||
19 | header-y += netfilter_ipv6/ | ||
20 | header-y += usb/ | 5 | header-y += usb/ |
21 | header-y += wimax/ | ||
22 | |||
23 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ | ||
24 | $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),) | ||
25 | endif | ||
26 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ | ||
27 | $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),) | ||
28 | endif | ||
29 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \ | ||
30 | $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),) | ||
31 | endif | ||
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 4180eb78d575..93b1e091b1e9 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -157,6 +157,7 @@ struct bcma_host_ops { | |||
157 | 157 | ||
158 | /* Chip IDs of SoCs */ | 158 | /* Chip IDs of SoCs */ |
159 | #define BCMA_CHIP_ID_BCM4706 0x5300 | 159 | #define BCMA_CHIP_ID_BCM4706 0x5300 |
160 | #define BCMA_PKG_ID_BCM4706L 1 | ||
160 | #define BCMA_CHIP_ID_BCM4716 0x4716 | 161 | #define BCMA_CHIP_ID_BCM4716 0x4716 |
161 | #define BCMA_PKG_ID_BCM4716 8 | 162 | #define BCMA_PKG_ID_BCM4716 8 |
162 | #define BCMA_PKG_ID_BCM4717 9 | 163 | #define BCMA_PKG_ID_BCM4717 9 |
@@ -166,7 +167,11 @@ struct bcma_host_ops { | |||
166 | #define BCMA_CHIP_ID_BCM4749 0x4749 | 167 | #define BCMA_CHIP_ID_BCM4749 0x4749 |
167 | #define BCMA_CHIP_ID_BCM5356 0x5356 | 168 | #define BCMA_CHIP_ID_BCM5356 0x5356 |
168 | #define BCMA_CHIP_ID_BCM5357 0x5357 | 169 | #define BCMA_CHIP_ID_BCM5357 0x5357 |
170 | #define BCMA_PKG_ID_BCM5358 9 | ||
171 | #define BCMA_PKG_ID_BCM47186 10 | ||
172 | #define BCMA_PKG_ID_BCM5357 11 | ||
169 | #define BCMA_CHIP_ID_BCM53572 53572 | 173 | #define BCMA_CHIP_ID_BCM53572 53572 |
174 | #define BCMA_PKG_ID_BCM47188 9 | ||
170 | 175 | ||
171 | struct bcma_device { | 176 | struct bcma_device { |
172 | struct bcma_bus *bus; | 177 | struct bcma_bus *bus; |
@@ -251,7 +256,7 @@ struct bcma_bus { | |||
251 | u8 num; | 256 | u8 num; |
252 | 257 | ||
253 | struct bcma_drv_cc drv_cc; | 258 | struct bcma_drv_cc drv_cc; |
254 | struct bcma_drv_pci drv_pci; | 259 | struct bcma_drv_pci drv_pci[2]; |
255 | struct bcma_drv_mips drv_mips; | 260 | struct bcma_drv_mips drv_mips; |
256 | struct bcma_drv_gmac_cmn drv_gmac_cmn; | 261 | struct bcma_drv_gmac_cmn drv_gmac_cmn; |
257 | 262 | ||
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 1cf1749440ac..145f3c56227f 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -510,6 +510,7 @@ struct bcma_chipcommon_pmu { | |||
510 | 510 | ||
511 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 511 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
512 | struct bcma_pflash { | 512 | struct bcma_pflash { |
513 | bool present; | ||
513 | u8 buswidth; | 514 | u8 buswidth; |
514 | u32 window; | 515 | u32 window; |
515 | u32 window_size; | 516 | u32 window_size; |
@@ -532,6 +533,7 @@ struct mtd_info; | |||
532 | 533 | ||
533 | struct bcma_nflash { | 534 | struct bcma_nflash { |
534 | bool present; | 535 | bool present; |
536 | bool boot; /* This is the flash the SoC boots from */ | ||
535 | 537 | ||
536 | struct mtd_info *mtd; | 538 | struct mtd_info *mtd; |
537 | }; | 539 | }; |
@@ -552,6 +554,7 @@ struct bcma_drv_cc { | |||
552 | u32 capabilities; | 554 | u32 capabilities; |
553 | u32 capabilities_ext; | 555 | u32 capabilities_ext; |
554 | u8 setup_done:1; | 556 | u8 setup_done:1; |
557 | u8 early_setup_done:1; | ||
555 | /* Fast Powerup Delay constant */ | 558 | /* Fast Powerup Delay constant */ |
556 | u16 fast_pwrup_delay; | 559 | u16 fast_pwrup_delay; |
557 | struct bcma_chipcommon_pmu pmu; | 560 | struct bcma_chipcommon_pmu pmu; |
@@ -583,6 +586,7 @@ struct bcma_drv_cc { | |||
583 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) | 586 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) |
584 | 587 | ||
585 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); | 588 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); |
589 | extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); | ||
586 | 590 | ||
587 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); | 591 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); |
588 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); | 592 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); |
@@ -606,6 +610,7 @@ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); | |||
606 | 610 | ||
607 | /* PMU support */ | 611 | /* PMU support */ |
608 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); | 612 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); |
613 | extern void bcma_pmu_early_init(struct bcma_drv_cc *cc); | ||
609 | 614 | ||
610 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, | 615 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, |
611 | u32 value); | 616 | u32 value); |
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h index c0043645cdcb..0baf8a56b794 100644 --- a/include/linux/bcma/bcma_driver_mips.h +++ b/include/linux/bcma/bcma_driver_mips.h | |||
@@ -35,13 +35,16 @@ struct bcma_device; | |||
35 | struct bcma_drv_mips { | 35 | struct bcma_drv_mips { |
36 | struct bcma_device *core; | 36 | struct bcma_device *core; |
37 | u8 setup_done:1; | 37 | u8 setup_done:1; |
38 | u8 early_setup_done:1; | ||
38 | unsigned int assigned_irqs; | 39 | unsigned int assigned_irqs; |
39 | }; | 40 | }; |
40 | 41 | ||
41 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 42 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
42 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); | 43 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); |
44 | extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore); | ||
43 | #else | 45 | #else |
44 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } | 46 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } |
47 | static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { } | ||
45 | #endif | 48 | #endif |
46 | 49 | ||
47 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); | 50 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index 6c9cb93ae3de..7e8104bb7a7e 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -85,6 +85,9 @@ | |||
85 | * (2 ZettaBytes), high 32 bits | 85 | * (2 ZettaBytes), high 32 bits |
86 | */ | 86 | */ |
87 | 87 | ||
88 | #define BCMA_SFLASH 0x1c000000 | 88 | #define BCMA_SOC_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */ |
89 | #define BCMA_SOC_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */ | ||
90 | #define BCMA_SOC_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */ | ||
91 | #define BCMA_SOC_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */ | ||
89 | 92 | ||
90 | #endif /* LINUX_BCMA_REGS_H_ */ | 93 | #endif /* LINUX_BCMA_REGS_H_ */ |
diff --git a/include/linux/bug.h b/include/linux/bug.h index aaac4bba6f5c..b1cf40de847e 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
@@ -15,6 +15,7 @@ struct pt_regs; | |||
15 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) | 15 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) |
16 | #define BUILD_BUG_ON_ZERO(e) (0) | 16 | #define BUILD_BUG_ON_ZERO(e) (0) |
17 | #define BUILD_BUG_ON_NULL(e) ((void*)0) | 17 | #define BUILD_BUG_ON_NULL(e) ((void*)0) |
18 | #define BUILD_BUG_ON_INVALID(e) (0) | ||
18 | #define BUILD_BUG_ON(condition) | 19 | #define BUILD_BUG_ON(condition) |
19 | #define BUILD_BUG() (0) | 20 | #define BUILD_BUG() (0) |
20 | #else /* __CHECKER__ */ | 21 | #else /* __CHECKER__ */ |
diff --git a/include/linux/byteorder/Kbuild b/include/linux/byteorder/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/byteorder/Kbuild +++ /dev/null | |||
diff --git a/include/linux/caif/Kbuild b/include/linux/caif/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/caif/Kbuild +++ /dev/null | |||
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/can/Kbuild +++ /dev/null | |||
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index c12731582920..f9f5e9eeb9dd 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h | |||
@@ -335,8 +335,8 @@ const char *__clk_get_name(struct clk *clk); | |||
335 | struct clk_hw *__clk_get_hw(struct clk *clk); | 335 | struct clk_hw *__clk_get_hw(struct clk *clk); |
336 | u8 __clk_get_num_parents(struct clk *clk); | 336 | u8 __clk_get_num_parents(struct clk *clk); |
337 | struct clk *__clk_get_parent(struct clk *clk); | 337 | struct clk *__clk_get_parent(struct clk *clk); |
338 | inline int __clk_get_enable_count(struct clk *clk); | 338 | int __clk_get_enable_count(struct clk *clk); |
339 | inline int __clk_get_prepare_count(struct clk *clk); | 339 | int __clk_get_prepare_count(struct clk *clk); |
340 | unsigned long __clk_get_rate(struct clk *clk); | 340 | unsigned long __clk_get_rate(struct clk *clk); |
341 | unsigned long __clk_get_flags(struct clk *clk); | 341 | unsigned long __clk_get_flags(struct clk *clk); |
342 | int __clk_is_enabled(struct clk *clk); | 342 | int __clk_is_enabled(struct clk *clk); |
diff --git a/include/linux/coredump.h b/include/linux/coredump.h index 1775eb8acc03..1d7399314a89 100644 --- a/include/linux/coredump.h +++ b/include/linux/coredump.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
6 | #include <linux/fs.h> | 6 | #include <linux/fs.h> |
7 | #include <asm/siginfo.h> | ||
7 | 8 | ||
8 | /* | 9 | /* |
9 | * These are the only things you should do on a core-file: use only these | 10 | * These are the only things you should do on a core-file: use only these |
diff --git a/include/linux/dvb/Kbuild b/include/linux/dvb/Kbuild index f4dba8637f98..e69de29bb2d1 100644 --- a/include/linux/dvb/Kbuild +++ b/include/linux/dvb/Kbuild | |||
@@ -1,8 +0,0 @@ | |||
1 | header-y += audio.h | ||
2 | header-y += ca.h | ||
3 | header-y += dmx.h | ||
4 | header-y += frontend.h | ||
5 | header-y += net.h | ||
6 | header-y += osd.h | ||
7 | header-y += version.h | ||
8 | header-y += video.h | ||
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h index f078f3ac82d4..0be6d8f2b52b 100644 --- a/include/linux/dvb/dmx.h +++ b/include/linux/dvb/dmx.h | |||
@@ -20,138 +20,10 @@ | |||
20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | |||
24 | #ifndef _DVBDMX_H_ | 23 | #ifndef _DVBDMX_H_ |
25 | #define _DVBDMX_H_ | 24 | #define _DVBDMX_H_ |
26 | 25 | ||
27 | #include <linux/types.h> | ||
28 | #ifdef __KERNEL__ | ||
29 | #include <linux/time.h> | 26 | #include <linux/time.h> |
30 | #else | 27 | #include <uapi/linux/dvb/dmx.h> |
31 | #include <time.h> | ||
32 | #endif | ||
33 | |||
34 | |||
35 | #define DMX_FILTER_SIZE 16 | ||
36 | |||
37 | typedef enum | ||
38 | { | ||
39 | DMX_OUT_DECODER, /* Streaming directly to decoder. */ | ||
40 | DMX_OUT_TAP, /* Output going to a memory buffer */ | ||
41 | /* (to be retrieved via the read command).*/ | ||
42 | DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */ | ||
43 | /* (to be retrieved by reading from the */ | ||
44 | /* logical DVR device). */ | ||
45 | DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */ | ||
46 | } dmx_output_t; | ||
47 | |||
48 | |||
49 | typedef enum | ||
50 | { | ||
51 | DMX_IN_FRONTEND, /* Input from a front-end device. */ | ||
52 | DMX_IN_DVR /* Input from the logical DVR device. */ | ||
53 | } dmx_input_t; | ||
54 | |||
55 | |||
56 | typedef enum | ||
57 | { | ||
58 | DMX_PES_AUDIO0, | ||
59 | DMX_PES_VIDEO0, | ||
60 | DMX_PES_TELETEXT0, | ||
61 | DMX_PES_SUBTITLE0, | ||
62 | DMX_PES_PCR0, | ||
63 | |||
64 | DMX_PES_AUDIO1, | ||
65 | DMX_PES_VIDEO1, | ||
66 | DMX_PES_TELETEXT1, | ||
67 | DMX_PES_SUBTITLE1, | ||
68 | DMX_PES_PCR1, | ||
69 | |||
70 | DMX_PES_AUDIO2, | ||
71 | DMX_PES_VIDEO2, | ||
72 | DMX_PES_TELETEXT2, | ||
73 | DMX_PES_SUBTITLE2, | ||
74 | DMX_PES_PCR2, | ||
75 | |||
76 | DMX_PES_AUDIO3, | ||
77 | DMX_PES_VIDEO3, | ||
78 | DMX_PES_TELETEXT3, | ||
79 | DMX_PES_SUBTITLE3, | ||
80 | DMX_PES_PCR3, | ||
81 | |||
82 | DMX_PES_OTHER | ||
83 | } dmx_pes_type_t; | ||
84 | |||
85 | #define DMX_PES_AUDIO DMX_PES_AUDIO0 | ||
86 | #define DMX_PES_VIDEO DMX_PES_VIDEO0 | ||
87 | #define DMX_PES_TELETEXT DMX_PES_TELETEXT0 | ||
88 | #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0 | ||
89 | #define DMX_PES_PCR DMX_PES_PCR0 | ||
90 | |||
91 | |||
92 | typedef struct dmx_filter | ||
93 | { | ||
94 | __u8 filter[DMX_FILTER_SIZE]; | ||
95 | __u8 mask[DMX_FILTER_SIZE]; | ||
96 | __u8 mode[DMX_FILTER_SIZE]; | ||
97 | } dmx_filter_t; | ||
98 | |||
99 | |||
100 | struct dmx_sct_filter_params | ||
101 | { | ||
102 | __u16 pid; | ||
103 | dmx_filter_t filter; | ||
104 | __u32 timeout; | ||
105 | __u32 flags; | ||
106 | #define DMX_CHECK_CRC 1 | ||
107 | #define DMX_ONESHOT 2 | ||
108 | #define DMX_IMMEDIATE_START 4 | ||
109 | #define DMX_KERNEL_CLIENT 0x8000 | ||
110 | }; | ||
111 | |||
112 | |||
113 | struct dmx_pes_filter_params | ||
114 | { | ||
115 | __u16 pid; | ||
116 | dmx_input_t input; | ||
117 | dmx_output_t output; | ||
118 | dmx_pes_type_t pes_type; | ||
119 | __u32 flags; | ||
120 | }; | ||
121 | |||
122 | typedef struct dmx_caps { | ||
123 | __u32 caps; | ||
124 | int num_decoders; | ||
125 | } dmx_caps_t; | ||
126 | |||
127 | typedef enum { | ||
128 | DMX_SOURCE_FRONT0 = 0, | ||
129 | DMX_SOURCE_FRONT1, | ||
130 | DMX_SOURCE_FRONT2, | ||
131 | DMX_SOURCE_FRONT3, | ||
132 | DMX_SOURCE_DVR0 = 16, | ||
133 | DMX_SOURCE_DVR1, | ||
134 | DMX_SOURCE_DVR2, | ||
135 | DMX_SOURCE_DVR3 | ||
136 | } dmx_source_t; | ||
137 | |||
138 | struct dmx_stc { | ||
139 | unsigned int num; /* input : which STC? 0..N */ | ||
140 | unsigned int base; /* output: divisor for stc to get 90 kHz clock */ | ||
141 | __u64 stc; /* output: stc in 'base'*90 kHz units */ | ||
142 | }; | ||
143 | |||
144 | |||
145 | #define DMX_START _IO('o', 41) | ||
146 | #define DMX_STOP _IO('o', 42) | ||
147 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) | ||
148 | #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) | ||
149 | #define DMX_SET_BUFFER_SIZE _IO('o', 45) | ||
150 | #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) | ||
151 | #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) | ||
152 | #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) | ||
153 | #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) | ||
154 | #define DMX_ADD_PID _IOW('o', 51, __u16) | ||
155 | #define DMX_REMOVE_PID _IOW('o', 52, __u16) | ||
156 | 28 | ||
157 | #endif /*_DVBDMX_H_*/ | 29 | #endif /*_DVBDMX_H_*/ |
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h index 1d750c0fd86e..85c20d925696 100644 --- a/include/linux/dvb/video.h +++ b/include/linux/dvb/video.h | |||
@@ -20,257 +20,10 @@ | |||
20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 | * | 21 | * |
22 | */ | 22 | */ |
23 | |||
24 | #ifndef _DVBVIDEO_H_ | 23 | #ifndef _DVBVIDEO_H_ |
25 | #define _DVBVIDEO_H_ | 24 | #define _DVBVIDEO_H_ |
26 | 25 | ||
27 | #include <linux/types.h> | ||
28 | #ifdef __KERNEL__ | ||
29 | #include <linux/compiler.h> | 26 | #include <linux/compiler.h> |
30 | #else | 27 | #include <uapi/linux/dvb/video.h> |
31 | #include <stdint.h> | ||
32 | #include <time.h> | ||
33 | #endif | ||
34 | |||
35 | typedef enum { | ||
36 | VIDEO_FORMAT_4_3, /* Select 4:3 format */ | ||
37 | VIDEO_FORMAT_16_9, /* Select 16:9 format. */ | ||
38 | VIDEO_FORMAT_221_1 /* 2.21:1 */ | ||
39 | } video_format_t; | ||
40 | |||
41 | |||
42 | typedef enum { | ||
43 | VIDEO_SYSTEM_PAL, | ||
44 | VIDEO_SYSTEM_NTSC, | ||
45 | VIDEO_SYSTEM_PALN, | ||
46 | VIDEO_SYSTEM_PALNc, | ||
47 | VIDEO_SYSTEM_PALM, | ||
48 | VIDEO_SYSTEM_NTSC60, | ||
49 | VIDEO_SYSTEM_PAL60, | ||
50 | VIDEO_SYSTEM_PALM60 | ||
51 | } video_system_t; | ||
52 | |||
53 | |||
54 | typedef enum { | ||
55 | VIDEO_PAN_SCAN, /* use pan and scan format */ | ||
56 | VIDEO_LETTER_BOX, /* use letterbox format */ | ||
57 | VIDEO_CENTER_CUT_OUT /* use center cut out format */ | ||
58 | } video_displayformat_t; | ||
59 | |||
60 | typedef struct { | ||
61 | int w; | ||
62 | int h; | ||
63 | video_format_t aspect_ratio; | ||
64 | } video_size_t; | ||
65 | |||
66 | typedef enum { | ||
67 | VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ | ||
68 | VIDEO_SOURCE_MEMORY /* If this source is selected, the stream | ||
69 | comes from the user through the write | ||
70 | system call */ | ||
71 | } video_stream_source_t; | ||
72 | |||
73 | |||
74 | typedef enum { | ||
75 | VIDEO_STOPPED, /* Video is stopped */ | ||
76 | VIDEO_PLAYING, /* Video is currently playing */ | ||
77 | VIDEO_FREEZED /* Video is freezed */ | ||
78 | } video_play_state_t; | ||
79 | |||
80 | |||
81 | /* Decoder commands */ | ||
82 | #define VIDEO_CMD_PLAY (0) | ||
83 | #define VIDEO_CMD_STOP (1) | ||
84 | #define VIDEO_CMD_FREEZE (2) | ||
85 | #define VIDEO_CMD_CONTINUE (3) | ||
86 | |||
87 | /* Flags for VIDEO_CMD_FREEZE */ | ||
88 | #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) | ||
89 | |||
90 | /* Flags for VIDEO_CMD_STOP */ | ||
91 | #define VIDEO_CMD_STOP_TO_BLACK (1 << 0) | ||
92 | #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) | ||
93 | |||
94 | /* Play input formats: */ | ||
95 | /* The decoder has no special format requirements */ | ||
96 | #define VIDEO_PLAY_FMT_NONE (0) | ||
97 | /* The decoder requires full GOPs */ | ||
98 | #define VIDEO_PLAY_FMT_GOP (1) | ||
99 | |||
100 | /* The structure must be zeroed before use by the application | ||
101 | This ensures it can be extended safely in the future. */ | ||
102 | struct video_command { | ||
103 | __u32 cmd; | ||
104 | __u32 flags; | ||
105 | union { | ||
106 | struct { | ||
107 | __u64 pts; | ||
108 | } stop; | ||
109 | |||
110 | struct { | ||
111 | /* 0 or 1000 specifies normal speed, | ||
112 | 1 specifies forward single stepping, | ||
113 | -1 specifies backward single stepping, | ||
114 | >1: playback at speed/1000 of the normal speed, | ||
115 | <-1: reverse playback at (-speed/1000) of the normal speed. */ | ||
116 | __s32 speed; | ||
117 | __u32 format; | ||
118 | } play; | ||
119 | |||
120 | struct { | ||
121 | __u32 data[16]; | ||
122 | } raw; | ||
123 | }; | ||
124 | }; | ||
125 | |||
126 | /* FIELD_UNKNOWN can be used if the hardware does not know whether | ||
127 | the Vsync is for an odd, even or progressive (i.e. non-interlaced) | ||
128 | field. */ | ||
129 | #define VIDEO_VSYNC_FIELD_UNKNOWN (0) | ||
130 | #define VIDEO_VSYNC_FIELD_ODD (1) | ||
131 | #define VIDEO_VSYNC_FIELD_EVEN (2) | ||
132 | #define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) | ||
133 | |||
134 | struct video_event { | ||
135 | __s32 type; | ||
136 | #define VIDEO_EVENT_SIZE_CHANGED 1 | ||
137 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 | ||
138 | #define VIDEO_EVENT_DECODER_STOPPED 3 | ||
139 | #define VIDEO_EVENT_VSYNC 4 | ||
140 | __kernel_time_t timestamp; | ||
141 | union { | ||
142 | video_size_t size; | ||
143 | unsigned int frame_rate; /* in frames per 1000sec */ | ||
144 | unsigned char vsync_field; /* unknown/odd/even/progressive */ | ||
145 | } u; | ||
146 | }; | ||
147 | |||
148 | |||
149 | struct video_status { | ||
150 | int video_blank; /* blank video on freeze? */ | ||
151 | video_play_state_t play_state; /* current state of playback */ | ||
152 | video_stream_source_t stream_source; /* current source (demux/memory) */ | ||
153 | video_format_t video_format; /* current aspect ratio of stream*/ | ||
154 | video_displayformat_t display_format;/* selected cropping mode */ | ||
155 | }; | ||
156 | |||
157 | |||
158 | struct video_still_picture { | ||
159 | char __user *iFrame; /* pointer to a single iframe in memory */ | ||
160 | __s32 size; | ||
161 | }; | ||
162 | |||
163 | |||
164 | typedef | ||
165 | struct video_highlight { | ||
166 | int active; /* 1=show highlight, 0=hide highlight */ | ||
167 | __u8 contrast1; /* 7- 4 Pattern pixel contrast */ | ||
168 | /* 3- 0 Background pixel contrast */ | ||
169 | __u8 contrast2; /* 7- 4 Emphasis pixel-2 contrast */ | ||
170 | /* 3- 0 Emphasis pixel-1 contrast */ | ||
171 | __u8 color1; /* 7- 4 Pattern pixel color */ | ||
172 | /* 3- 0 Background pixel color */ | ||
173 | __u8 color2; /* 7- 4 Emphasis pixel-2 color */ | ||
174 | /* 3- 0 Emphasis pixel-1 color */ | ||
175 | __u32 ypos; /* 23-22 auto action mode */ | ||
176 | /* 21-12 start y */ | ||
177 | /* 9- 0 end y */ | ||
178 | __u32 xpos; /* 23-22 button color number */ | ||
179 | /* 21-12 start x */ | ||
180 | /* 9- 0 end x */ | ||
181 | } video_highlight_t; | ||
182 | |||
183 | |||
184 | typedef struct video_spu { | ||
185 | int active; | ||
186 | int stream_id; | ||
187 | } video_spu_t; | ||
188 | |||
189 | |||
190 | typedef struct video_spu_palette { /* SPU Palette information */ | ||
191 | int length; | ||
192 | __u8 __user *palette; | ||
193 | } video_spu_palette_t; | ||
194 | |||
195 | |||
196 | typedef struct video_navi_pack { | ||
197 | int length; /* 0 ... 1024 */ | ||
198 | __u8 data[1024]; | ||
199 | } video_navi_pack_t; | ||
200 | |||
201 | |||
202 | typedef __u16 video_attributes_t; | ||
203 | /* bits: descr. */ | ||
204 | /* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ | ||
205 | /* 13-12 TV system (0=525/60, 1=625/50) */ | ||
206 | /* 11-10 Aspect ratio (0=4:3, 3=16:9) */ | ||
207 | /* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ | ||
208 | /* 7 line 21-1 data present in GOP (1=yes, 0=no) */ | ||
209 | /* 6 line 21-2 data present in GOP (1=yes, 0=no) */ | ||
210 | /* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ | ||
211 | /* 2 source letterboxed (1=yes, 0=no) */ | ||
212 | /* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ | ||
213 | |||
214 | |||
215 | /* bit definitions for capabilities: */ | ||
216 | /* can the hardware decode MPEG1 and/or MPEG2? */ | ||
217 | #define VIDEO_CAP_MPEG1 1 | ||
218 | #define VIDEO_CAP_MPEG2 2 | ||
219 | /* can you send a system and/or program stream to video device? | ||
220 | (you still have to open the video and the audio device but only | ||
221 | send the stream to the video device) */ | ||
222 | #define VIDEO_CAP_SYS 4 | ||
223 | #define VIDEO_CAP_PROG 8 | ||
224 | /* can the driver also handle SPU, NAVI and CSS encoded data? | ||
225 | (CSS API is not present yet) */ | ||
226 | #define VIDEO_CAP_SPU 16 | ||
227 | #define VIDEO_CAP_NAVI 32 | ||
228 | #define VIDEO_CAP_CSS 64 | ||
229 | |||
230 | |||
231 | #define VIDEO_STOP _IO('o', 21) | ||
232 | #define VIDEO_PLAY _IO('o', 22) | ||
233 | #define VIDEO_FREEZE _IO('o', 23) | ||
234 | #define VIDEO_CONTINUE _IO('o', 24) | ||
235 | #define VIDEO_SELECT_SOURCE _IO('o', 25) | ||
236 | #define VIDEO_SET_BLANK _IO('o', 26) | ||
237 | #define VIDEO_GET_STATUS _IOR('o', 27, struct video_status) | ||
238 | #define VIDEO_GET_EVENT _IOR('o', 28, struct video_event) | ||
239 | #define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29) | ||
240 | #define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture) | ||
241 | #define VIDEO_FAST_FORWARD _IO('o', 31) | ||
242 | #define VIDEO_SLOWMOTION _IO('o', 32) | ||
243 | #define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int) | ||
244 | #define VIDEO_CLEAR_BUFFER _IO('o', 34) | ||
245 | #define VIDEO_SET_ID _IO('o', 35) | ||
246 | #define VIDEO_SET_STREAMTYPE _IO('o', 36) | ||
247 | #define VIDEO_SET_FORMAT _IO('o', 37) | ||
248 | #define VIDEO_SET_SYSTEM _IO('o', 38) | ||
249 | #define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t) | ||
250 | #define VIDEO_SET_SPU _IOW('o', 50, video_spu_t) | ||
251 | #define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t) | ||
252 | #define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t) | ||
253 | #define VIDEO_SET_ATTRIBUTES _IO('o', 53) | ||
254 | #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) | ||
255 | #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) | ||
256 | |||
257 | /** | ||
258 | * VIDEO_GET_PTS | ||
259 | * | ||
260 | * Read the 33 bit presentation time stamp as defined | ||
261 | * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
262 | * | ||
263 | * The PTS should belong to the currently played | ||
264 | * frame if possible, but may also be a value close to it | ||
265 | * like the PTS of the last decoded frame or the last PTS | ||
266 | * extracted by the PES parser. | ||
267 | */ | ||
268 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | ||
269 | |||
270 | /* Read the number of displayed frames since the decoder was started */ | ||
271 | #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) | ||
272 | |||
273 | #define VIDEO_COMMAND _IOWR('o', 59, struct video_command) | ||
274 | #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) | ||
275 | 28 | ||
276 | #endif /*_DVBVIDEO_H_*/ | 29 | #endif /*_DVBVIDEO_H_*/ |
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index c18257b0fa72..6dd4787a798a 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h | |||
@@ -61,7 +61,7 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor, | |||
61 | const char *fmt, ...); | 61 | const char *fmt, ...); |
62 | 62 | ||
63 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ | 63 | #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \ |
64 | static struct _ddebug __used __aligned(8) \ | 64 | static struct _ddebug __aligned(8) \ |
65 | __attribute__((section("__verbose"))) name = { \ | 65 | __attribute__((section("__verbose"))) name = { \ |
66 | .modname = KBUILD_MODNAME, \ | 66 | .modname = KBUILD_MODNAME, \ |
67 | .function = __func__, \ | 67 | .function = __func__, \ |
diff --git a/include/linux/elf-fdpic.h b/include/linux/elf-fdpic.h new file mode 100644 index 000000000000..386440317b0c --- /dev/null +++ b/include/linux/elf-fdpic.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* FDPIC ELF load map | ||
2 | * | ||
3 | * Copyright (C) 2003 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_ELF_FDPIC_H | ||
13 | #define _LINUX_ELF_FDPIC_H | ||
14 | |||
15 | #include <uapi/linux/elf-fdpic.h> | ||
16 | |||
17 | /* | ||
18 | * binfmt binary parameters structure | ||
19 | */ | ||
20 | struct elf_fdpic_params { | ||
21 | struct elfhdr hdr; /* ref copy of ELF header */ | ||
22 | struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */ | ||
23 | struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */ | ||
24 | unsigned long elfhdr_addr; /* mapped ELF header user address */ | ||
25 | unsigned long ph_addr; /* mapped PT_PHDR user address */ | ||
26 | unsigned long map_addr; /* mapped loadmap user address */ | ||
27 | unsigned long entry_addr; /* mapped entry user address */ | ||
28 | unsigned long stack_size; /* stack size requested (PT_GNU_STACK) */ | ||
29 | unsigned long dynamic_addr; /* mapped PT_DYNAMIC user address */ | ||
30 | unsigned long load_addr; /* user address at which to map binary */ | ||
31 | unsigned long flags; | ||
32 | #define ELF_FDPIC_FLAG_ARRANGEMENT 0x0000000f /* PT_LOAD arrangement flags */ | ||
33 | #define ELF_FDPIC_FLAG_INDEPENDENT 0x00000000 /* PT_LOADs can be put anywhere */ | ||
34 | #define ELF_FDPIC_FLAG_HONOURVADDR 0x00000001 /* PT_LOAD.vaddr must be honoured */ | ||
35 | #define ELF_FDPIC_FLAG_CONSTDISP 0x00000002 /* PT_LOADs require constant | ||
36 | * displacement */ | ||
37 | #define ELF_FDPIC_FLAG_CONTIGUOUS 0x00000003 /* PT_LOADs should be contiguous */ | ||
38 | #define ELF_FDPIC_FLAG_EXEC_STACK 0x00000010 /* T if stack to be executable */ | ||
39 | #define ELF_FDPIC_FLAG_NOEXEC_STACK 0x00000020 /* T if stack not to be executable */ | ||
40 | #define ELF_FDPIC_FLAG_EXECUTABLE 0x00000040 /* T if this object is the executable */ | ||
41 | #define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */ | ||
42 | }; | ||
43 | |||
44 | #ifdef CONFIG_MMU | ||
45 | extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params, | ||
46 | struct elf_fdpic_params *interp_params, | ||
47 | unsigned long *start_stack, | ||
48 | unsigned long *start_brk); | ||
49 | #endif | ||
50 | |||
51 | #endif /* _LINUX_ELF_FDPIC_H */ | ||
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index b006ba0a9f42..243eea1e33d8 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -51,6 +51,26 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, | |||
51 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) | 51 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
52 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) | 52 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) |
53 | 53 | ||
54 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ | ||
55 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = | ||
56 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; | ||
57 | |||
58 | /** | ||
59 | * is_link_local_ether_addr - Determine if given Ethernet address is link-local | ||
60 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
61 | * | ||
62 | * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per | ||
63 | * IEEE 802.1Q 8.6.3 Frame filtering. | ||
64 | */ | ||
65 | static inline bool is_link_local_ether_addr(const u8 *addr) | ||
66 | { | ||
67 | __be16 *a = (__be16 *)addr; | ||
68 | static const __be16 *b = (const __be16 *)eth_reserved_addr_base; | ||
69 | static const __be16 m = cpu_to_be16(0xfff0); | ||
70 | |||
71 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; | ||
72 | } | ||
73 | |||
54 | /** | 74 | /** |
55 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. | 75 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. |
56 | * @addr: Pointer to a six-byte array containing the Ethernet address | 76 | * @addr: Pointer to a six-byte array containing the Ethernet address |
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 7443a560c9d0..2c26c14cd710 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
@@ -68,7 +68,7 @@ enum extcon_cable_name { | |||
68 | EXTCON_VIDEO_OUT, | 68 | EXTCON_VIDEO_OUT, |
69 | EXTCON_MECHANICAL, | 69 | EXTCON_MECHANICAL, |
70 | }; | 70 | }; |
71 | extern const char *extcon_cable_name[]; | 71 | extern const char extcon_cable_name[][CABLE_NAME_MAX + 1]; |
72 | 72 | ||
73 | struct extcon_cable; | 73 | struct extcon_cable; |
74 | 74 | ||
diff --git a/include/linux/filter.h b/include/linux/filter.h index 24d251f3bab0..c45eabc135e1 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -45,6 +45,7 @@ extern void sk_unattached_filter_destroy(struct sk_filter *fp); | |||
45 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 45 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
46 | extern int sk_detach_filter(struct sock *sk); | 46 | extern int sk_detach_filter(struct sock *sk); |
47 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); | 47 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); |
48 | extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len); | ||
48 | 49 | ||
49 | #ifdef CONFIG_BPF_JIT | 50 | #ifdef CONFIG_BPF_JIT |
50 | extern void bpf_jit_compile(struct sk_filter *fp); | 51 | extern void bpf_jit_compile(struct sk_filter *fp); |
@@ -123,6 +124,8 @@ enum { | |||
123 | BPF_S_ANC_CPU, | 124 | BPF_S_ANC_CPU, |
124 | BPF_S_ANC_ALU_XOR_X, | 125 | BPF_S_ANC_ALU_XOR_X, |
125 | BPF_S_ANC_SECCOMP_LD_W, | 126 | BPF_S_ANC_SECCOMP_LD_W, |
127 | BPF_S_ANC_VLAN_TAG, | ||
128 | BPF_S_ANC_VLAN_TAG_PRESENT, | ||
126 | }; | 129 | }; |
127 | 130 | ||
128 | #endif /* __LINUX_FILTER_H__ */ | 131 | #endif /* __LINUX_FILTER_H__ */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 001c7cff2d48..b33cfc97b9ca 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -64,6 +64,73 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
64 | ssize_t bytes, void *private, int ret, | 64 | ssize_t bytes, void *private, int ret, |
65 | bool is_async); | 65 | bool is_async); |
66 | 66 | ||
67 | #define MAY_EXEC 0x00000001 | ||
68 | #define MAY_WRITE 0x00000002 | ||
69 | #define MAY_READ 0x00000004 | ||
70 | #define MAY_APPEND 0x00000008 | ||
71 | #define MAY_ACCESS 0x00000010 | ||
72 | #define MAY_OPEN 0x00000020 | ||
73 | #define MAY_CHDIR 0x00000040 | ||
74 | /* called from RCU mode, don't block */ | ||
75 | #define MAY_NOT_BLOCK 0x00000080 | ||
76 | |||
77 | /* | ||
78 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | ||
79 | * to O_WRONLY and O_RDWR via the strange trick in __dentry_open() | ||
80 | */ | ||
81 | |||
82 | /* file is open for reading */ | ||
83 | #define FMODE_READ ((__force fmode_t)0x1) | ||
84 | /* file is open for writing */ | ||
85 | #define FMODE_WRITE ((__force fmode_t)0x2) | ||
86 | /* file is seekable */ | ||
87 | #define FMODE_LSEEK ((__force fmode_t)0x4) | ||
88 | /* file can be accessed using pread */ | ||
89 | #define FMODE_PREAD ((__force fmode_t)0x8) | ||
90 | /* file can be accessed using pwrite */ | ||
91 | #define FMODE_PWRITE ((__force fmode_t)0x10) | ||
92 | /* File is opened for execution with sys_execve / sys_uselib */ | ||
93 | #define FMODE_EXEC ((__force fmode_t)0x20) | ||
94 | /* File is opened with O_NDELAY (only set for block devices) */ | ||
95 | #define FMODE_NDELAY ((__force fmode_t)0x40) | ||
96 | /* File is opened with O_EXCL (only set for block devices) */ | ||
97 | #define FMODE_EXCL ((__force fmode_t)0x80) | ||
98 | /* File is opened using open(.., 3, ..) and is writeable only for ioctls | ||
99 | (specialy hack for floppy.c) */ | ||
100 | #define FMODE_WRITE_IOCTL ((__force fmode_t)0x100) | ||
101 | /* 32bit hashes as llseek() offset (for directories) */ | ||
102 | #define FMODE_32BITHASH ((__force fmode_t)0x200) | ||
103 | /* 64bit hashes as llseek() offset (for directories) */ | ||
104 | #define FMODE_64BITHASH ((__force fmode_t)0x400) | ||
105 | |||
106 | /* | ||
107 | * Don't update ctime and mtime. | ||
108 | * | ||
109 | * Currently a special hack for the XFS open_by_handle ioctl, but we'll | ||
110 | * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon. | ||
111 | */ | ||
112 | #define FMODE_NOCMTIME ((__force fmode_t)0x800) | ||
113 | |||
114 | /* Expect random access pattern */ | ||
115 | #define FMODE_RANDOM ((__force fmode_t)0x1000) | ||
116 | |||
117 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ | ||
118 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) | ||
119 | |||
120 | /* File is opened with O_PATH; almost nothing can be done with it */ | ||
121 | #define FMODE_PATH ((__force fmode_t)0x4000) | ||
122 | |||
123 | /* File was opened by fanotify and shouldn't generate fanotify events */ | ||
124 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | ||
125 | |||
126 | /* | ||
127 | * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector | ||
128 | * that indicates that they should check the contents of the iovec are | ||
129 | * valid, but not check the memory that the iovec elements | ||
130 | * points too. | ||
131 | */ | ||
132 | #define CHECK_IOVEC_ONLY -1 | ||
133 | |||
67 | /* | 134 | /* |
68 | * The below are the various read and write types that we support. Some of | 135 | * The below are the various read and write types that we support. Some of |
69 | * them include behavioral modifiers that send information down to the | 136 | * them include behavioral modifiers that send information down to the |
@@ -1557,6 +1624,60 @@ struct super_operations { | |||
1557 | }; | 1624 | }; |
1558 | 1625 | ||
1559 | /* | 1626 | /* |
1627 | * Inode flags - they have no relation to superblock flags now | ||
1628 | */ | ||
1629 | #define S_SYNC 1 /* Writes are synced at once */ | ||
1630 | #define S_NOATIME 2 /* Do not update access times */ | ||
1631 | #define S_APPEND 4 /* Append-only file */ | ||
1632 | #define S_IMMUTABLE 8 /* Immutable file */ | ||
1633 | #define S_DEAD 16 /* removed, but still open directory */ | ||
1634 | #define S_NOQUOTA 32 /* Inode is not counted to quota */ | ||
1635 | #define S_DIRSYNC 64 /* Directory modifications are synchronous */ | ||
1636 | #define S_NOCMTIME 128 /* Do not update file c/mtime */ | ||
1637 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ | ||
1638 | #define S_PRIVATE 512 /* Inode is fs-internal */ | ||
1639 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | ||
1640 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | ||
1641 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ | ||
1642 | |||
1643 | /* | ||
1644 | * Note that nosuid etc flags are inode-specific: setting some file-system | ||
1645 | * flags just means all the inodes inherit those flags by default. It might be | ||
1646 | * possible to override it selectively if you really wanted to with some | ||
1647 | * ioctl() that is not currently implemented. | ||
1648 | * | ||
1649 | * Exception: MS_RDONLY is always applied to the entire file system. | ||
1650 | * | ||
1651 | * Unfortunately, it is possible to change a filesystems flags with it mounted | ||
1652 | * with files in use. This means that all of the inodes will not have their | ||
1653 | * i_flags updated. Hence, i_flags no longer inherit the superblock mount | ||
1654 | * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org | ||
1655 | */ | ||
1656 | #define __IS_FLG(inode, flg) ((inode)->i_sb->s_flags & (flg)) | ||
1657 | |||
1658 | #define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY) | ||
1659 | #define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \ | ||
1660 | ((inode)->i_flags & S_SYNC)) | ||
1661 | #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ | ||
1662 | ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) | ||
1663 | #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) | ||
1664 | #define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME) | ||
1665 | #define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION) | ||
1666 | |||
1667 | #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) | ||
1668 | #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) | ||
1669 | #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) | ||
1670 | #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) | ||
1671 | |||
1672 | #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) | ||
1673 | #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) | ||
1674 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) | ||
1675 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | ||
1676 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | ||
1677 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | ||
1678 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) | ||
1679 | |||
1680 | /* | ||
1560 | * Inode state bits. Protected by inode->i_lock | 1681 | * Inode state bits. Protected by inode->i_lock |
1561 | * | 1682 | * |
1562 | * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, | 1683 | * Three bits determine the dirty state of the inode, I_DIRTY_SYNC, |
@@ -1688,6 +1809,11 @@ int sync_inode_metadata(struct inode *inode, int wait); | |||
1688 | struct file_system_type { | 1809 | struct file_system_type { |
1689 | const char *name; | 1810 | const char *name; |
1690 | int fs_flags; | 1811 | int fs_flags; |
1812 | #define FS_REQUIRES_DEV 1 | ||
1813 | #define FS_BINARY_MOUNTDATA 2 | ||
1814 | #define FS_HAS_SUBTYPE 4 | ||
1815 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ | ||
1816 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ | ||
1691 | struct dentry *(*mount) (struct file_system_type *, int, | 1817 | struct dentry *(*mount) (struct file_system_type *, int, |
1692 | const char *, void *); | 1818 | const char *, void *); |
1693 | void (*kill_sb) (struct super_block *); | 1819 | void (*kill_sb) (struct super_block *); |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 02c1c9710be0..d0a79678f169 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -31,6 +31,7 @@ struct vm_area_struct; | |||
31 | #define ___GFP_THISNODE 0x40000u | 31 | #define ___GFP_THISNODE 0x40000u |
32 | #define ___GFP_RECLAIMABLE 0x80000u | 32 | #define ___GFP_RECLAIMABLE 0x80000u |
33 | #define ___GFP_NOTRACK 0x200000u | 33 | #define ___GFP_NOTRACK 0x200000u |
34 | #define ___GFP_NO_KSWAPD 0x400000u | ||
34 | #define ___GFP_OTHER_NODE 0x800000u | 35 | #define ___GFP_OTHER_NODE 0x800000u |
35 | #define ___GFP_WRITE 0x1000000u | 36 | #define ___GFP_WRITE 0x1000000u |
36 | 37 | ||
@@ -85,6 +86,7 @@ struct vm_area_struct; | |||
85 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ | 86 | #define __GFP_RECLAIMABLE ((__force gfp_t)___GFP_RECLAIMABLE) /* Page is reclaimable */ |
86 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ | 87 | #define __GFP_NOTRACK ((__force gfp_t)___GFP_NOTRACK) /* Don't track with kmemcheck */ |
87 | 88 | ||
89 | #define __GFP_NO_KSWAPD ((__force gfp_t)___GFP_NO_KSWAPD) | ||
88 | #define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ | 90 | #define __GFP_OTHER_NODE ((__force gfp_t)___GFP_OTHER_NODE) /* On behalf of other node */ |
89 | #define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ | 91 | #define __GFP_WRITE ((__force gfp_t)___GFP_WRITE) /* Allocator intends to dirty page */ |
90 | 92 | ||
@@ -114,7 +116,8 @@ struct vm_area_struct; | |||
114 | __GFP_MOVABLE) | 116 | __GFP_MOVABLE) |
115 | #define GFP_IOFS (__GFP_IO | __GFP_FS) | 117 | #define GFP_IOFS (__GFP_IO | __GFP_FS) |
116 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ | 118 | #define GFP_TRANSHUGE (GFP_HIGHUSER_MOVABLE | __GFP_COMP | \ |
117 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN) | 119 | __GFP_NOMEMALLOC | __GFP_NORETRY | __GFP_NOWARN | \ |
120 | __GFP_NO_KSWAPD) | ||
118 | 121 | ||
119 | #ifdef CONFIG_NUMA | 122 | #ifdef CONFIG_NUMA |
120 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 123 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
diff --git a/include/linux/hashtable.h b/include/linux/hashtable.h new file mode 100644 index 000000000000..227c62424f3c --- /dev/null +++ b/include/linux/hashtable.h | |||
@@ -0,0 +1,192 @@ | |||
1 | /* | ||
2 | * Statically sized hash table implementation | ||
3 | * (C) 2012 Sasha Levin <levinsasha928@gmail.com> | ||
4 | */ | ||
5 | |||
6 | #ifndef _LINUX_HASHTABLE_H | ||
7 | #define _LINUX_HASHTABLE_H | ||
8 | |||
9 | #include <linux/list.h> | ||
10 | #include <linux/types.h> | ||
11 | #include <linux/kernel.h> | ||
12 | #include <linux/hash.h> | ||
13 | #include <linux/rculist.h> | ||
14 | |||
15 | #define DEFINE_HASHTABLE(name, bits) \ | ||
16 | struct hlist_head name[1 << (bits)] = \ | ||
17 | { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT } | ||
18 | |||
19 | #define DECLARE_HASHTABLE(name, bits) \ | ||
20 | struct hlist_head name[1 << (bits)] | ||
21 | |||
22 | #define HASH_SIZE(name) (ARRAY_SIZE(name)) | ||
23 | #define HASH_BITS(name) ilog2(HASH_SIZE(name)) | ||
24 | |||
25 | /* Use hash_32 when possible to allow for fast 32bit hashing in 64bit kernels. */ | ||
26 | #define hash_min(val, bits) \ | ||
27 | (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits)) | ||
28 | |||
29 | static inline void __hash_init(struct hlist_head *ht, unsigned int sz) | ||
30 | { | ||
31 | unsigned int i; | ||
32 | |||
33 | for (i = 0; i < sz; i++) | ||
34 | INIT_HLIST_HEAD(&ht[i]); | ||
35 | } | ||
36 | |||
37 | /** | ||
38 | * hash_init - initialize a hash table | ||
39 | * @hashtable: hashtable to be initialized | ||
40 | * | ||
41 | * Calculates the size of the hashtable from the given parameter, otherwise | ||
42 | * same as hash_init_size. | ||
43 | * | ||
44 | * This has to be a macro since HASH_BITS() will not work on pointers since | ||
45 | * it calculates the size during preprocessing. | ||
46 | */ | ||
47 | #define hash_init(hashtable) __hash_init(hashtable, HASH_SIZE(hashtable)) | ||
48 | |||
49 | /** | ||
50 | * hash_add - add an object to a hashtable | ||
51 | * @hashtable: hashtable to add to | ||
52 | * @node: the &struct hlist_node of the object to be added | ||
53 | * @key: the key of the object to be added | ||
54 | */ | ||
55 | #define hash_add(hashtable, node, key) \ | ||
56 | hlist_add_head(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) | ||
57 | |||
58 | /** | ||
59 | * hash_add_rcu - add an object to a rcu enabled hashtable | ||
60 | * @hashtable: hashtable to add to | ||
61 | * @node: the &struct hlist_node of the object to be added | ||
62 | * @key: the key of the object to be added | ||
63 | */ | ||
64 | #define hash_add_rcu(hashtable, node, key) \ | ||
65 | hlist_add_head_rcu(node, &hashtable[hash_min(key, HASH_BITS(hashtable))]) | ||
66 | |||
67 | /** | ||
68 | * hash_hashed - check whether an object is in any hashtable | ||
69 | * @node: the &struct hlist_node of the object to be checked | ||
70 | */ | ||
71 | static inline bool hash_hashed(struct hlist_node *node) | ||
72 | { | ||
73 | return !hlist_unhashed(node); | ||
74 | } | ||
75 | |||
76 | static inline bool __hash_empty(struct hlist_head *ht, unsigned int sz) | ||
77 | { | ||
78 | unsigned int i; | ||
79 | |||
80 | for (i = 0; i < sz; i++) | ||
81 | if (!hlist_empty(&ht[i])) | ||
82 | return false; | ||
83 | |||
84 | return true; | ||
85 | } | ||
86 | |||
87 | /** | ||
88 | * hash_empty - check whether a hashtable is empty | ||
89 | * @hashtable: hashtable to check | ||
90 | * | ||
91 | * This has to be a macro since HASH_BITS() will not work on pointers since | ||
92 | * it calculates the size during preprocessing. | ||
93 | */ | ||
94 | #define hash_empty(hashtable) __hash_empty(hashtable, HASH_SIZE(hashtable)) | ||
95 | |||
96 | /** | ||
97 | * hash_del - remove an object from a hashtable | ||
98 | * @node: &struct hlist_node of the object to remove | ||
99 | */ | ||
100 | static inline void hash_del(struct hlist_node *node) | ||
101 | { | ||
102 | hlist_del_init(node); | ||
103 | } | ||
104 | |||
105 | /** | ||
106 | * hash_del_rcu - remove an object from a rcu enabled hashtable | ||
107 | * @node: &struct hlist_node of the object to remove | ||
108 | */ | ||
109 | static inline void hash_del_rcu(struct hlist_node *node) | ||
110 | { | ||
111 | hlist_del_init_rcu(node); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * hash_for_each - iterate over a hashtable | ||
116 | * @name: hashtable to iterate | ||
117 | * @bkt: integer to use as bucket loop cursor | ||
118 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
119 | * @obj: the type * to use as a loop cursor for each entry | ||
120 | * @member: the name of the hlist_node within the struct | ||
121 | */ | ||
122 | #define hash_for_each(name, bkt, node, obj, member) \ | ||
123 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | ||
124 | hlist_for_each_entry(obj, node, &name[bkt], member) | ||
125 | |||
126 | /** | ||
127 | * hash_for_each_rcu - iterate over a rcu enabled hashtable | ||
128 | * @name: hashtable to iterate | ||
129 | * @bkt: integer to use as bucket loop cursor | ||
130 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
131 | * @obj: the type * to use as a loop cursor for each entry | ||
132 | * @member: the name of the hlist_node within the struct | ||
133 | */ | ||
134 | #define hash_for_each_rcu(name, bkt, node, obj, member) \ | ||
135 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | ||
136 | hlist_for_each_entry_rcu(obj, node, &name[bkt], member) | ||
137 | |||
138 | /** | ||
139 | * hash_for_each_safe - iterate over a hashtable safe against removal of | ||
140 | * hash entry | ||
141 | * @name: hashtable to iterate | ||
142 | * @bkt: integer to use as bucket loop cursor | ||
143 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
144 | * @tmp: a &struct used for temporary storage | ||
145 | * @obj: the type * to use as a loop cursor for each entry | ||
146 | * @member: the name of the hlist_node within the struct | ||
147 | */ | ||
148 | #define hash_for_each_safe(name, bkt, node, tmp, obj, member) \ | ||
149 | for ((bkt) = 0, node = NULL; node == NULL && (bkt) < HASH_SIZE(name); (bkt)++)\ | ||
150 | hlist_for_each_entry_safe(obj, node, tmp, &name[bkt], member) | ||
151 | |||
152 | /** | ||
153 | * hash_for_each_possible - iterate over all possible objects hashing to the | ||
154 | * same bucket | ||
155 | * @name: hashtable to iterate | ||
156 | * @obj: the type * to use as a loop cursor for each entry | ||
157 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
158 | * @member: the name of the hlist_node within the struct | ||
159 | * @key: the key of the objects to iterate over | ||
160 | */ | ||
161 | #define hash_for_each_possible(name, obj, node, member, key) \ | ||
162 | hlist_for_each_entry(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | ||
163 | |||
164 | /** | ||
165 | * hash_for_each_possible_rcu - iterate over all possible objects hashing to the | ||
166 | * same bucket in an rcu enabled hashtable | ||
167 | * in a rcu enabled hashtable | ||
168 | * @name: hashtable to iterate | ||
169 | * @obj: the type * to use as a loop cursor for each entry | ||
170 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
171 | * @member: the name of the hlist_node within the struct | ||
172 | * @key: the key of the objects to iterate over | ||
173 | */ | ||
174 | #define hash_for_each_possible_rcu(name, obj, node, member, key) \ | ||
175 | hlist_for_each_entry_rcu(obj, node, &name[hash_min(key, HASH_BITS(name))], member) | ||
176 | |||
177 | /** | ||
178 | * hash_for_each_possible_safe - iterate over all possible objects hashing to the | ||
179 | * same bucket safe against removals | ||
180 | * @name: hashtable to iterate | ||
181 | * @obj: the type * to use as a loop cursor for each entry | ||
182 | * @node: the &struct list_head to use as a loop cursor for each entry | ||
183 | * @tmp: a &struct used for temporary storage | ||
184 | * @member: the name of the hlist_node within the struct | ||
185 | * @key: the key of the objects to iterate over | ||
186 | */ | ||
187 | #define hash_for_each_possible_safe(name, obj, node, tmp, member, key) \ | ||
188 | hlist_for_each_entry_safe(obj, node, tmp, \ | ||
189 | &name[hash_min(key, HASH_BITS(name))], member) | ||
190 | |||
191 | |||
192 | #endif | ||
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild index 1fb26448faa9..e69de29bb2d1 100644 --- a/include/linux/hdlc/Kbuild +++ b/include/linux/hdlc/Kbuild | |||
@@ -1 +0,0 @@ | |||
1 | header-y += ioctl.h | ||
diff --git a/include/linux/hsi/Kbuild b/include/linux/hsi/Kbuild index 271a770b4784..e69de29bb2d1 100644 --- a/include/linux/hsi/Kbuild +++ b/include/linux/hsi/Kbuild | |||
@@ -1 +0,0 @@ | |||
1 | header-y += hsi_char.h | ||
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h index df804ba73e0b..92a0dc75bc74 100644 --- a/include/linux/i2c-omap.h +++ b/include/linux/i2c-omap.h | |||
@@ -34,6 +34,7 @@ struct omap_i2c_bus_platform_data { | |||
34 | u32 clkrate; | 34 | u32 clkrate; |
35 | u32 rev; | 35 | u32 rev; |
36 | u32 flags; | 36 | u32 flags; |
37 | void (*set_mpu_wkup_lat)(struct device *dev, long set); | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | #endif | 40 | #endif |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 2385119f8bb0..f9c5a787d350 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -131,6 +131,8 @@ | |||
131 | 131 | ||
132 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 132 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
133 | 133 | ||
134 | #define IEEE80211_NUM_TIDS 16 | ||
135 | |||
134 | #define IEEE80211_QOS_CTL_LEN 2 | 136 | #define IEEE80211_QOS_CTL_LEN 2 |
135 | /* 1d tag mask */ | 137 | /* 1d tag mask */ |
136 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 138 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
@@ -666,6 +668,21 @@ struct ieee80211_meshconf_ie { | |||
666 | } __attribute__ ((packed)); | 668 | } __attribute__ ((packed)); |
667 | 669 | ||
668 | /** | 670 | /** |
671 | * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags | ||
672 | * | ||
673 | * @IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS: STA is willing to establish | ||
674 | * additional mesh peerings with other mesh STAs | ||
675 | * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs | ||
676 | * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure | ||
677 | * is ongoing | ||
678 | */ | ||
679 | enum mesh_config_capab_flags { | ||
680 | IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01, | ||
681 | IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08, | ||
682 | IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20, | ||
683 | }; | ||
684 | |||
685 | /** | ||
669 | * struct ieee80211_rann_ie | 686 | * struct ieee80211_rann_ie |
670 | * | 687 | * |
671 | * This structure refers to "Root Announcement information element" | 688 | * This structure refers to "Root Announcement information element" |
@@ -905,6 +922,38 @@ struct ieee80211_tdls_data { | |||
905 | } u; | 922 | } u; |
906 | } __packed; | 923 | } __packed; |
907 | 924 | ||
925 | /* | ||
926 | * Peer-to-Peer IE attribute related definitions. | ||
927 | */ | ||
928 | /** | ||
929 | * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute. | ||
930 | */ | ||
931 | enum ieee80211_p2p_attr_id { | ||
932 | IEEE80211_P2P_ATTR_STATUS = 0, | ||
933 | IEEE80211_P2P_ATTR_MINOR_REASON, | ||
934 | IEEE80211_P2P_ATTR_CAPABILITY, | ||
935 | IEEE80211_P2P_ATTR_DEVICE_ID, | ||
936 | IEEE80211_P2P_ATTR_GO_INTENT, | ||
937 | IEEE80211_P2P_ATTR_GO_CONFIG_TIMEOUT, | ||
938 | IEEE80211_P2P_ATTR_LISTEN_CHANNEL, | ||
939 | IEEE80211_P2P_ATTR_GROUP_BSSID, | ||
940 | IEEE80211_P2P_ATTR_EXT_LISTEN_TIMING, | ||
941 | IEEE80211_P2P_ATTR_INTENDED_IFACE_ADDR, | ||
942 | IEEE80211_P2P_ATTR_MANAGABILITY, | ||
943 | IEEE80211_P2P_ATTR_CHANNEL_LIST, | ||
944 | IEEE80211_P2P_ATTR_ABSENCE_NOTICE, | ||
945 | IEEE80211_P2P_ATTR_DEVICE_INFO, | ||
946 | IEEE80211_P2P_ATTR_GROUP_INFO, | ||
947 | IEEE80211_P2P_ATTR_GROUP_ID, | ||
948 | IEEE80211_P2P_ATTR_INTERFACE, | ||
949 | IEEE80211_P2P_ATTR_OPER_CHANNEL, | ||
950 | IEEE80211_P2P_ATTR_INVITE_FLAGS, | ||
951 | /* 19 - 220: Reserved */ | ||
952 | IEEE80211_P2P_ATTR_VENDOR_SPECIFIC = 221, | ||
953 | |||
954 | IEEE80211_P2P_ATTR_MAX | ||
955 | }; | ||
956 | |||
908 | /** | 957 | /** |
909 | * struct ieee80211_bar - HT Block Ack Request | 958 | * struct ieee80211_bar - HT Block Ack Request |
910 | * | 959 | * |
@@ -1107,20 +1156,6 @@ struct ieee80211_ht_operation { | |||
1107 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 | 1156 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 |
1108 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 | 1157 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 |
1109 | 1158 | ||
1110 | #define VHT_MCS_SUPPORTED_SET_SIZE 8 | ||
1111 | |||
1112 | struct ieee80211_vht_capabilities { | ||
1113 | __le32 vht_capabilities_info; | ||
1114 | u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE]; | ||
1115 | } __packed; | ||
1116 | |||
1117 | struct ieee80211_vht_operation { | ||
1118 | u8 vht_op_info_chwidth; | ||
1119 | u8 vht_op_info_chan_center_freq_seg1_idx; | ||
1120 | u8 vht_op_info_chan_center_freq_seg2_idx; | ||
1121 | __le16 vht_basic_mcs_set; | ||
1122 | } __packed; | ||
1123 | |||
1124 | /** | 1159 | /** |
1125 | * struct ieee80211_vht_mcs_info - VHT MCS information | 1160 | * struct ieee80211_vht_mcs_info - VHT MCS information |
1126 | * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams | 1161 | * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams |
@@ -1128,11 +1163,13 @@ struct ieee80211_vht_operation { | |||
1128 | * STA can receive. Rate expressed in units of 1 Mbps. | 1163 | * STA can receive. Rate expressed in units of 1 Mbps. |
1129 | * If this field is 0 this value should not be used to | 1164 | * If this field is 0 this value should not be used to |
1130 | * consider the highest RX data rate supported. | 1165 | * consider the highest RX data rate supported. |
1166 | * The top 3 bits of this field are reserved. | ||
1131 | * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams | 1167 | * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams |
1132 | * @tx_highest: Indicates highest long GI VHT PPDU data rate | 1168 | * @tx_highest: Indicates highest long GI VHT PPDU data rate |
1133 | * STA can transmit. Rate expressed in units of 1 Mbps. | 1169 | * STA can transmit. Rate expressed in units of 1 Mbps. |
1134 | * If this field is 0 this value should not be used to | 1170 | * If this field is 0 this value should not be used to |
1135 | * consider the highest TX data rate supported. | 1171 | * consider the highest TX data rate supported. |
1172 | * The top 3 bits of this field are reserved. | ||
1136 | */ | 1173 | */ |
1137 | struct ieee80211_vht_mcs_info { | 1174 | struct ieee80211_vht_mcs_info { |
1138 | __le16 rx_mcs_map; | 1175 | __le16 rx_mcs_map; |
@@ -1141,6 +1178,58 @@ struct ieee80211_vht_mcs_info { | |||
1141 | __le16 tx_highest; | 1178 | __le16 tx_highest; |
1142 | } __packed; | 1179 | } __packed; |
1143 | 1180 | ||
1181 | /** | ||
1182 | * enum ieee80211_vht_mcs_support - VHT MCS support definitions | ||
1183 | * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the | ||
1184 | * number of streams | ||
1185 | * @IEEE80211_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported | ||
1186 | * @IEEE80211_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported | ||
1187 | * @IEEE80211_VHT_MCS_NOT_SUPPORTED: This number of streams isn't supported | ||
1188 | * | ||
1189 | * These definitions are used in each 2-bit subfield of the @rx_mcs_map | ||
1190 | * and @tx_mcs_map fields of &struct ieee80211_vht_mcs_info, which are | ||
1191 | * both split into 8 subfields by number of streams. These values indicate | ||
1192 | * which MCSes are supported for the number of streams the value appears | ||
1193 | * for. | ||
1194 | */ | ||
1195 | enum ieee80211_vht_mcs_support { | ||
1196 | IEEE80211_VHT_MCS_SUPPORT_0_7 = 0, | ||
1197 | IEEE80211_VHT_MCS_SUPPORT_0_8 = 1, | ||
1198 | IEEE80211_VHT_MCS_SUPPORT_0_9 = 2, | ||
1199 | IEEE80211_VHT_MCS_NOT_SUPPORTED = 3, | ||
1200 | }; | ||
1201 | |||
1202 | /** | ||
1203 | * struct ieee80211_vht_cap - VHT capabilities | ||
1204 | * | ||
1205 | * This structure is the "VHT capabilities element" as | ||
1206 | * described in 802.11ac D3.0 8.4.2.160 | ||
1207 | * @vht_cap_info: VHT capability info | ||
1208 | * @supp_mcs: VHT MCS supported rates | ||
1209 | */ | ||
1210 | struct ieee80211_vht_cap { | ||
1211 | __le32 vht_cap_info; | ||
1212 | struct ieee80211_vht_mcs_info supp_mcs; | ||
1213 | } __packed; | ||
1214 | |||
1215 | /** | ||
1216 | * struct ieee80211_vht_operation - VHT operation IE | ||
1217 | * | ||
1218 | * This structure is the "VHT operation element" as | ||
1219 | * described in 802.11ac D3.0 8.4.2.161 | ||
1220 | * @chan_width: Operating channel width | ||
1221 | * @center_freq_seg1_idx: center freq segment 1 index | ||
1222 | * @center_freq_seg2_idx: center freq segment 2 index | ||
1223 | * @basic_mcs_set: VHT Basic MCS rate set | ||
1224 | */ | ||
1225 | struct ieee80211_vht_operation { | ||
1226 | u8 chan_width; | ||
1227 | u8 center_freq_seg1_idx; | ||
1228 | u8 center_freq_seg2_idx; | ||
1229 | __le16 basic_mcs_set; | ||
1230 | } __packed; | ||
1231 | |||
1232 | |||
1144 | #define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 | 1233 | #define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 |
1145 | #define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 | 1234 | #define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 |
1146 | #define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 | 1235 | #define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 |
@@ -1440,8 +1529,6 @@ enum ieee80211_eid { | |||
1440 | 1529 | ||
1441 | WLAN_EID_RSN = 48, | 1530 | WLAN_EID_RSN = 48, |
1442 | WLAN_EID_MMIE = 76, | 1531 | WLAN_EID_MMIE = 76, |
1443 | WLAN_EID_WPA = 221, | ||
1444 | WLAN_EID_GENERIC = 221, | ||
1445 | WLAN_EID_VENDOR_SPECIFIC = 221, | 1532 | WLAN_EID_VENDOR_SPECIFIC = 221, |
1446 | WLAN_EID_QOS_PARAMETER = 222, | 1533 | WLAN_EID_QOS_PARAMETER = 222, |
1447 | 1534 | ||
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 1cc595a67cc9..f4e56ecd0b1a 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -4,5 +4,22 @@ | |||
4 | #include <linux/ip.h> | 4 | #include <linux/ip.h> |
5 | #include <linux/in6.h> | 5 | #include <linux/in6.h> |
6 | #include <uapi/linux/if_tunnel.h> | 6 | #include <uapi/linux/if_tunnel.h> |
7 | #include <linux/u64_stats_sync.h> | ||
8 | |||
9 | /* | ||
10 | * Locking : hash tables are protected by RCU and RTNL | ||
11 | */ | ||
12 | |||
13 | #define for_each_ip_tunnel_rcu(pos, start) \ | ||
14 | for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) | ||
15 | |||
16 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | ||
17 | struct pcpu_tstats { | ||
18 | u64 rx_packets; | ||
19 | u64 rx_bytes; | ||
20 | u64 tx_packets; | ||
21 | u64 tx_bytes; | ||
22 | struct u64_stats_sync syncp; | ||
23 | }; | ||
7 | 24 | ||
8 | #endif /* _IF_TUNNEL_H_ */ | 25 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index c0ae76ac4e0b..7806c24e5bc8 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h | |||
@@ -618,4 +618,20 @@ static inline struct dentry *iio_get_debugfs_dentry(struct iio_dev *indio_dev) | |||
618 | }; | 618 | }; |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | /** | ||
622 | * IIO_DEGREE_TO_RAD() - Convert degree to rad | ||
623 | * @deg: A value in degree | ||
624 | * | ||
625 | * Returns the given value converted from degree to rad | ||
626 | */ | ||
627 | #define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL) | ||
628 | |||
629 | /** | ||
630 | * IIO_G_TO_M_S_2() - Convert g to meter / second**2 | ||
631 | * @g: A value in g | ||
632 | * | ||
633 | * Returns the given value converted from g to meter / second**2 | ||
634 | */ | ||
635 | #define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL) | ||
636 | |||
621 | #endif /* _INDUSTRIAL_IO_H_ */ | 637 | #endif /* _INDUSTRIAL_IO_H_ */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index bcba48a97868..5e11905a4f01 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -47,6 +47,7 @@ struct ipv6_devconf { | |||
47 | __s32 disable_ipv6; | 47 | __s32 disable_ipv6; |
48 | __s32 accept_dad; | 48 | __s32 accept_dad; |
49 | __s32 force_tllao; | 49 | __s32 force_tllao; |
50 | __s32 ndisc_notify; | ||
50 | void *sysctl; | 51 | void *sysctl; |
51 | }; | 52 | }; |
52 | 53 | ||
diff --git a/include/linux/isdn/Kbuild b/include/linux/isdn/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/isdn/Kbuild +++ /dev/null | |||
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 06177ba10a16..e83512f63df5 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -282,6 +282,25 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) | |||
282 | return cmp1.tv64 == cmp2.tv64; | 282 | return cmp1.tv64 == cmp2.tv64; |
283 | } | 283 | } |
284 | 284 | ||
285 | /** | ||
286 | * ktime_compare - Compares two ktime_t variables for less, greater or equal | ||
287 | * @cmp1: comparable1 | ||
288 | * @cmp2: comparable2 | ||
289 | * | ||
290 | * Returns ... | ||
291 | * cmp1 < cmp2: return <0 | ||
292 | * cmp1 == cmp2: return 0 | ||
293 | * cmp1 > cmp2: return >0 | ||
294 | */ | ||
295 | static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) | ||
296 | { | ||
297 | if (cmp1.tv64 < cmp2.tv64) | ||
298 | return -1; | ||
299 | if (cmp1.tv64 > cmp2.tv64) | ||
300 | return 1; | ||
301 | return 0; | ||
302 | } | ||
303 | |||
285 | static inline s64 ktime_to_us(const ktime_t kt) | 304 | static inline s64 ktime_to_us(const ktime_t kt) |
286 | { | 305 | { |
287 | struct timeval tv = ktime_to_timeval(kt); | 306 | struct timeval tv = ktime_to_timeval(kt); |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 93bfc9f9815c..ecc554374e44 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -42,19 +42,8 @@ | |||
42 | */ | 42 | */ |
43 | #define KVM_MEMSLOT_INVALID (1UL << 16) | 43 | #define KVM_MEMSLOT_INVALID (1UL << 16) |
44 | 44 | ||
45 | /* | 45 | /* Two fragments for cross MMIO pages. */ |
46 | * If we support unaligned MMIO, at most one fragment will be split into two: | 46 | #define KVM_MAX_MMIO_FRAGMENTS 2 |
47 | */ | ||
48 | #ifdef KVM_UNALIGNED_MMIO | ||
49 | # define KVM_EXTRA_MMIO_FRAGMENTS 1 | ||
50 | #else | ||
51 | # define KVM_EXTRA_MMIO_FRAGMENTS 0 | ||
52 | #endif | ||
53 | |||
54 | #define KVM_USER_MMIO_SIZE 8 | ||
55 | |||
56 | #define KVM_MAX_MMIO_FRAGMENTS \ | ||
57 | (KVM_MMIO_SIZE / KVM_USER_MMIO_SIZE + KVM_EXTRA_MMIO_FRAGMENTS) | ||
58 | 47 | ||
59 | /* | 48 | /* |
60 | * For the normal pfn, the highest 12 bits should be zero, | 49 | * For the normal pfn, the highest 12 bits should be zero, |
diff --git a/include/linux/memblock.h b/include/linux/memblock.h index 569d67d4243e..d452ee191066 100644 --- a/include/linux/memblock.h +++ b/include/linux/memblock.h | |||
@@ -57,6 +57,7 @@ int memblock_add(phys_addr_t base, phys_addr_t size); | |||
57 | int memblock_remove(phys_addr_t base, phys_addr_t size); | 57 | int memblock_remove(phys_addr_t base, phys_addr_t size); |
58 | int memblock_free(phys_addr_t base, phys_addr_t size); | 58 | int memblock_free(phys_addr_t base, phys_addr_t size); |
59 | int memblock_reserve(phys_addr_t base, phys_addr_t size); | 59 | int memblock_reserve(phys_addr_t base, phys_addr_t size); |
60 | void memblock_trim_memory(phys_addr_t align); | ||
60 | 61 | ||
61 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP | 62 | #ifdef CONFIG_HAVE_MEMBLOCK_NODE_MAP |
62 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, | 63 | void __next_mem_pfn_range(int *idx, int nid, unsigned long *out_start_pfn, |
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h index 1d28ae90384e..fe03b2d35d4f 100644 --- a/include/linux/mfd/max77693.h +++ b/include/linux/mfd/max77693.h | |||
@@ -30,7 +30,20 @@ | |||
30 | #ifndef __LINUX_MFD_MAX77693_H | 30 | #ifndef __LINUX_MFD_MAX77693_H |
31 | #define __LINUX_MFD_MAX77693_H | 31 | #define __LINUX_MFD_MAX77693_H |
32 | 32 | ||
33 | struct max77693_reg_data { | ||
34 | u8 addr; | ||
35 | u8 data; | ||
36 | }; | ||
37 | |||
38 | struct max77693_muic_platform_data { | ||
39 | struct max77693_reg_data *init_data; | ||
40 | int num_init_data; | ||
41 | }; | ||
42 | |||
33 | struct max77693_platform_data { | 43 | struct max77693_platform_data { |
34 | int wakeup; | 44 | int wakeup; |
45 | |||
46 | /* muic data */ | ||
47 | struct max77693_muic_platform_data *muic_data; | ||
35 | }; | 48 | }; |
36 | #endif /* __LINUX_MFD_MAX77693_H */ | 49 | #endif /* __LINUX_MFD_MAX77693_H */ |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index de201203bc7c..adfe8c058f29 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #define MICREL_PHY_ID_MASK 0x00fffff0 | 16 | #define MICREL_PHY_ID_MASK 0x00fffff0 |
17 | 17 | ||
18 | #define PHY_ID_KSZ8873MLL 0x000e7237 | ||
18 | #define PHY_ID_KSZ9021 0x00221610 | 19 | #define PHY_ID_KSZ9021 0x00221610 |
19 | #define PHY_ID_KS8737 0x00221720 | 20 | #define PHY_ID_KS8737 0x00221720 |
20 | #define PHY_ID_KSZ8021 0x00221555 | 21 | #define PHY_ID_KSZ8021 0x00221555 |
diff --git a/include/linux/mm.h b/include/linux/mm.h index fa0680402738..bcaab4e6fe91 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1684,9 +1684,5 @@ static inline unsigned int debug_guardpage_minorder(void) { return 0; } | |||
1684 | static inline bool page_is_guard(struct page *page) { return false; } | 1684 | static inline bool page_is_guard(struct page *page) { return false; } |
1685 | #endif /* CONFIG_DEBUG_PAGEALLOC */ | 1685 | #endif /* CONFIG_DEBUG_PAGEALLOC */ |
1686 | 1686 | ||
1687 | extern void reset_zone_present_pages(void); | ||
1688 | extern void fixup_zone_present_pages(int nid, unsigned long start_pfn, | ||
1689 | unsigned long end_pfn); | ||
1690 | |||
1691 | #endif /* __KERNEL__ */ | 1687 | #endif /* __KERNEL__ */ |
1692 | #endif /* _LINUX_MM_H */ | 1688 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mmc/Kbuild b/include/linux/mmc/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/mmc/Kbuild +++ /dev/null | |||
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 7c6a1139d8fa..96531664a061 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -137,7 +137,7 @@ struct dw_mci { | |||
137 | 137 | ||
138 | dma_addr_t sg_dma; | 138 | dma_addr_t sg_dma; |
139 | void *sg_cpu; | 139 | void *sg_cpu; |
140 | struct dw_mci_dma_ops *dma_ops; | 140 | const struct dw_mci_dma_ops *dma_ops; |
141 | #ifdef CONFIG_MMC_DW_IDMAC | 141 | #ifdef CONFIG_MMC_DW_IDMAC |
142 | unsigned int ring_size; | 142 | unsigned int ring_size; |
143 | #else | 143 | #else |
@@ -162,7 +162,7 @@ struct dw_mci { | |||
162 | u16 data_offset; | 162 | u16 data_offset; |
163 | struct device *dev; | 163 | struct device *dev; |
164 | struct dw_mci_board *pdata; | 164 | struct dw_mci_board *pdata; |
165 | struct dw_mci_drv_data *drv_data; | 165 | const struct dw_mci_drv_data *drv_data; |
166 | void *priv; | 166 | void *priv; |
167 | struct clk *biu_clk; | 167 | struct clk *biu_clk; |
168 | struct clk *ciu_clk; | 168 | struct clk *ciu_clk; |
@@ -186,7 +186,7 @@ struct dw_mci { | |||
186 | 186 | ||
187 | struct regulator *vmmc; /* Power regulator */ | 187 | struct regulator *vmmc; /* Power regulator */ |
188 | unsigned long irq_flags; /* IRQ flags */ | 188 | unsigned long irq_flags; /* IRQ flags */ |
189 | unsigned int irq; | 189 | int irq; |
190 | }; | 190 | }; |
191 | 191 | ||
192 | /* DMA ops for Internal/External DMAC interface */ | 192 | /* DMA ops for Internal/External DMAC interface */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index fa8529a859b8..1edcb4dad8c4 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
@@ -91,6 +91,7 @@ struct sdhci_host { | |||
91 | unsigned int quirks2; /* More deviations from spec. */ | 91 | unsigned int quirks2; /* More deviations from spec. */ |
92 | 92 | ||
93 | #define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) | 93 | #define SDHCI_QUIRK2_HOST_OFF_CARD_ON (1<<0) |
94 | #define SDHCI_QUIRK2_HOST_NO_CMD23 (1<<1) | ||
94 | 95 | ||
95 | int irq; /* Device IRQ */ | 96 | int irq; /* Device IRQ */ |
96 | void __iomem *ioaddr; /* Mapped address */ | 97 | void __iomem *ioaddr; /* Mapped address */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 50aaca81f63d..a23923ba8263 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -752,7 +752,7 @@ extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, | |||
752 | unsigned long size, | 752 | unsigned long size, |
753 | enum memmap_context context); | 753 | enum memmap_context context); |
754 | 754 | ||
755 | extern void lruvec_init(struct lruvec *lruvec, struct zone *zone); | 755 | extern void lruvec_init(struct lruvec *lruvec); |
756 | 756 | ||
757 | static inline struct zone *lruvec_zone(struct lruvec *lruvec) | 757 | static inline struct zone *lruvec_zone(struct lruvec *lruvec) |
758 | { | 758 | { |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f8eda0276f03..18c5dc98f6dc 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -887,6 +887,10 @@ struct netdev_fcoe_hbainfo { | |||
887 | * struct net_device *dev, int idx) | 887 | * struct net_device *dev, int idx) |
888 | * Used to add FDB entries to dump requests. Implementers should add | 888 | * Used to add FDB entries to dump requests. Implementers should add |
889 | * entries to skb and update idx with the number of entries. | 889 | * entries to skb and update idx with the number of entries. |
890 | * | ||
891 | * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) | ||
892 | * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, | ||
893 | * struct net_device *dev) | ||
890 | */ | 894 | */ |
891 | struct net_device_ops { | 895 | struct net_device_ops { |
892 | int (*ndo_init)(struct net_device *dev); | 896 | int (*ndo_init)(struct net_device *dev); |
@@ -998,6 +1002,12 @@ struct net_device_ops { | |||
998 | struct netlink_callback *cb, | 1002 | struct netlink_callback *cb, |
999 | struct net_device *dev, | 1003 | struct net_device *dev, |
1000 | int idx); | 1004 | int idx); |
1005 | |||
1006 | int (*ndo_bridge_setlink)(struct net_device *dev, | ||
1007 | struct nlmsghdr *nlh); | ||
1008 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | ||
1009 | u32 pid, u32 seq, | ||
1010 | struct net_device *dev); | ||
1001 | }; | 1011 | }; |
1002 | 1012 | ||
1003 | /* | 1013 | /* |
@@ -1499,16 +1509,25 @@ struct packet_type { | |||
1499 | struct net_device *, | 1509 | struct net_device *, |
1500 | struct packet_type *, | 1510 | struct packet_type *, |
1501 | struct net_device *); | 1511 | struct net_device *); |
1512 | bool (*id_match)(struct packet_type *ptype, | ||
1513 | struct sock *sk); | ||
1514 | void *af_packet_priv; | ||
1515 | struct list_head list; | ||
1516 | }; | ||
1517 | |||
1518 | struct offload_callbacks { | ||
1502 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1519 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
1503 | netdev_features_t features); | 1520 | netdev_features_t features); |
1504 | int (*gso_send_check)(struct sk_buff *skb); | 1521 | int (*gso_send_check)(struct sk_buff *skb); |
1505 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1522 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
1506 | struct sk_buff *skb); | 1523 | struct sk_buff *skb); |
1507 | int (*gro_complete)(struct sk_buff *skb); | 1524 | int (*gro_complete)(struct sk_buff *skb); |
1508 | bool (*id_match)(struct packet_type *ptype, | 1525 | }; |
1509 | struct sock *sk); | 1526 | |
1510 | void *af_packet_priv; | 1527 | struct packet_offload { |
1511 | struct list_head list; | 1528 | __be16 type; /* This is really htons(ether_type). */ |
1529 | struct offload_callbacks callbacks; | ||
1530 | struct list_head list; | ||
1512 | }; | 1531 | }; |
1513 | 1532 | ||
1514 | #include <linux/notifier.h> | 1533 | #include <linux/notifier.h> |
@@ -1548,6 +1567,8 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | |||
1548 | 1567 | ||
1549 | extern rwlock_t dev_base_lock; /* Device list lock */ | 1568 | extern rwlock_t dev_base_lock; /* Device list lock */ |
1550 | 1569 | ||
1570 | extern seqlock_t devnet_rename_seq; /* Device rename lock */ | ||
1571 | |||
1551 | 1572 | ||
1552 | #define for_each_netdev(net, d) \ | 1573 | #define for_each_netdev(net, d) \ |
1553 | list_for_each_entry(d, &(net)->dev_base_head, dev_list) | 1574 | list_for_each_entry(d, &(net)->dev_base_head, dev_list) |
@@ -1605,6 +1626,9 @@ extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short | |||
1605 | extern void dev_add_pack(struct packet_type *pt); | 1626 | extern void dev_add_pack(struct packet_type *pt); |
1606 | extern void dev_remove_pack(struct packet_type *pt); | 1627 | extern void dev_remove_pack(struct packet_type *pt); |
1607 | extern void __dev_remove_pack(struct packet_type *pt); | 1628 | extern void __dev_remove_pack(struct packet_type *pt); |
1629 | extern void dev_add_offload(struct packet_offload *po); | ||
1630 | extern void dev_remove_offload(struct packet_offload *po); | ||
1631 | extern void __dev_remove_offload(struct packet_offload *po); | ||
1608 | 1632 | ||
1609 | extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, | 1633 | extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, |
1610 | unsigned short mask); | 1634 | unsigned short mask); |
@@ -2129,16 +2153,10 @@ extern void dev_kfree_skb_any(struct sk_buff *skb); | |||
2129 | extern int netif_rx(struct sk_buff *skb); | 2153 | extern int netif_rx(struct sk_buff *skb); |
2130 | extern int netif_rx_ni(struct sk_buff *skb); | 2154 | extern int netif_rx_ni(struct sk_buff *skb); |
2131 | extern int netif_receive_skb(struct sk_buff *skb); | 2155 | extern int netif_receive_skb(struct sk_buff *skb); |
2132 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, | ||
2133 | struct sk_buff *skb); | ||
2134 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); | ||
2135 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, | 2156 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, |
2136 | struct sk_buff *skb); | 2157 | struct sk_buff *skb); |
2137 | extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); | 2158 | extern void napi_gro_flush(struct napi_struct *napi, bool flush_old); |
2138 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); | 2159 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); |
2139 | extern gro_result_t napi_frags_finish(struct napi_struct *napi, | ||
2140 | struct sk_buff *skb, | ||
2141 | gro_result_t ret); | ||
2142 | extern gro_result_t napi_gro_frags(struct napi_struct *napi); | 2160 | extern gro_result_t napi_gro_frags(struct napi_struct *napi); |
2143 | 2161 | ||
2144 | static inline void napi_free_frags(struct napi_struct *napi) | 2162 | static inline void napi_free_frags(struct napi_struct *napi) |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild deleted file mode 100644 index b3322023e9a5..000000000000 --- a/include/linux/netfilter/Kbuild +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | header-y += ipset/ | ||
diff --git a/include/linux/netfilter/ipset/Kbuild b/include/linux/netfilter/ipset/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/netfilter/ipset/Kbuild +++ /dev/null | |||
diff --git a/include/linux/netfilter_arp/Kbuild b/include/linux/netfilter_arp/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/netfilter_arp/Kbuild +++ /dev/null | |||
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/netfilter_bridge/Kbuild +++ /dev/null | |||
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/netfilter_ipv4/Kbuild +++ /dev/null | |||
diff --git a/include/linux/netfilter_ipv6/Kbuild b/include/linux/netfilter_ipv6/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/netfilter_ipv6/Kbuild +++ /dev/null | |||
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h deleted file mode 100644 index 9890bbaf4328..000000000000 --- a/include/linux/nfc/pn544.h +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | #define PN544_DRIVER_NAME "pn544" | ||
29 | #define PN544_MAXWINDOW_SIZE 7 | ||
30 | #define PN544_WINDOW_SIZE 4 | ||
31 | #define PN544_RETRIES 10 | ||
32 | #define PN544_MAX_I2C_TRANSFER 0x0400 | ||
33 | #define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */ | ||
34 | |||
35 | /* ioctl */ | ||
36 | #define PN544_CHAR_BASE 'P' | ||
37 | #define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype) | ||
38 | #define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype) | ||
39 | #define PN544_GET_FW_MODE PN544_IOW(1, unsigned int) | ||
40 | #define PN544_SET_FW_MODE PN544_IOW(2, unsigned int) | ||
41 | #define PN544_GET_DEBUG PN544_IOW(3, unsigned int) | ||
42 | #define PN544_SET_DEBUG PN544_IOW(4, unsigned int) | ||
43 | |||
44 | /* Timing restrictions (ms) */ | ||
45 | #define PN544_RESETVEN_TIME 30 /* 7 */ | ||
46 | #define PN544_PVDDVEN_TIME 0 | ||
47 | #define PN544_VBATVEN_TIME 0 | ||
48 | #define PN544_GPIO4VEN_TIME 0 | ||
49 | #define PN544_WAKEUP_ACK 5 | ||
50 | #define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1) | ||
51 | #define PN544_INACTIVITY_TIME 1000 | ||
52 | #define PN544_INTERFRAME_DELAY 200 /* us */ | ||
53 | #define PN544_BAUDRATE_CHANGE 150 /* us */ | ||
54 | |||
55 | /* Debug bits */ | ||
56 | #define PN544_DEBUG_BUF 0x01 | ||
57 | #define PN544_DEBUG_READ 0x02 | ||
58 | #define PN544_DEBUG_WRITE 0x04 | ||
59 | #define PN544_DEBUG_IRQ 0x08 | ||
60 | #define PN544_DEBUG_CALLS 0x10 | ||
61 | #define PN544_DEBUG_MODE 0x20 | ||
62 | |||
63 | /* Normal (HCI) mode */ | ||
64 | #define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */ | ||
65 | #define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */ | ||
66 | #define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2) | ||
67 | #define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2) | ||
68 | |||
69 | struct pn544_llc_packet { | ||
70 | unsigned char length; /* of rest of packet */ | ||
71 | unsigned char header; | ||
72 | unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */ | ||
73 | }; | ||
74 | |||
75 | /* Firmware upgrade mode */ | ||
76 | #define PN544_FW_HEADER_SIZE 3 | ||
77 | /* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */ | ||
78 | #define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE) | ||
79 | |||
80 | struct pn544_fw_packet { | ||
81 | unsigned char command; /* status in answer */ | ||
82 | unsigned char length[2]; /* big-endian order (msf) */ | ||
83 | unsigned char data[PN544_MAX_FW_DATA]; | ||
84 | }; | ||
85 | |||
86 | #ifdef __KERNEL__ | ||
87 | enum { | ||
88 | NFC_GPIO_ENABLE, | ||
89 | NFC_GPIO_FW_RESET, | ||
90 | NFC_GPIO_IRQ | ||
91 | }; | ||
92 | |||
93 | /* board config */ | ||
94 | struct pn544_nfc_platform_data { | ||
95 | int (*request_resources) (struct i2c_client *client); | ||
96 | void (*free_resources) (void); | ||
97 | void (*enable) (int fw); | ||
98 | int (*test) (void); | ||
99 | void (*disable) (void); | ||
100 | int (*get_gpio)(int type); | ||
101 | }; | ||
102 | #endif /* __KERNEL__ */ | ||
103 | |||
104 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/nfsd/Kbuild +++ /dev/null | |||
diff --git a/include/linux/of.h b/include/linux/of.h index 72843b72a2b2..b4e50d56fc74 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -331,6 +331,13 @@ static inline bool of_have_populated_dt(void) | |||
331 | #define for_each_child_of_node(parent, child) \ | 331 | #define for_each_child_of_node(parent, child) \ |
332 | while (0) | 332 | while (0) |
333 | 333 | ||
334 | static inline struct device_node *of_get_child_by_name( | ||
335 | const struct device_node *node, | ||
336 | const char *name) | ||
337 | { | ||
338 | return NULL; | ||
339 | } | ||
340 | |||
334 | static inline int of_get_child_count(const struct device_node *np) | 341 | static inline int of_get_child_count(const struct device_node *np) |
335 | { | 342 | { |
336 | return 0; | 343 | return 0; |
diff --git a/include/linux/of_address.h b/include/linux/of_address.h index c3cdc1025c30..0506eb53519b 100644 --- a/include/linux/of_address.h +++ b/include/linux/of_address.h | |||
@@ -19,7 +19,7 @@ extern void __iomem *of_iomap(struct device_node *device, int index); | |||
19 | * the address space flags too. The PCI version uses a BAR number | 19 | * the address space flags too. The PCI version uses a BAR number |
20 | * instead of an absolute index | 20 | * instead of an absolute index |
21 | */ | 21 | */ |
22 | extern const u32 *of_get_address(struct device_node *dev, int index, | 22 | extern const __be32 *of_get_address(struct device_node *dev, int index, |
23 | u64 *size, unsigned int *flags); | 23 | u64 *size, unsigned int *flags); |
24 | 24 | ||
25 | #ifndef pci_address_to_pio | 25 | #ifndef pci_address_to_pio |
@@ -28,11 +28,13 @@ static inline unsigned long pci_address_to_pio(phys_addr_t addr) { return -1; } | |||
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #else /* CONFIG_OF_ADDRESS */ | 30 | #else /* CONFIG_OF_ADDRESS */ |
31 | #ifndef of_address_to_resource | ||
31 | static inline int of_address_to_resource(struct device_node *dev, int index, | 32 | static inline int of_address_to_resource(struct device_node *dev, int index, |
32 | struct resource *r) | 33 | struct resource *r) |
33 | { | 34 | { |
34 | return -EINVAL; | 35 | return -EINVAL; |
35 | } | 36 | } |
37 | #endif | ||
36 | static inline struct device_node *of_find_matching_node_by_address( | 38 | static inline struct device_node *of_find_matching_node_by_address( |
37 | struct device_node *from, | 39 | struct device_node *from, |
38 | const struct of_device_id *matches, | 40 | const struct of_device_id *matches, |
@@ -40,11 +42,13 @@ static inline struct device_node *of_find_matching_node_by_address( | |||
40 | { | 42 | { |
41 | return NULL; | 43 | return NULL; |
42 | } | 44 | } |
45 | #ifndef of_iomap | ||
43 | static inline void __iomem *of_iomap(struct device_node *device, int index) | 46 | static inline void __iomem *of_iomap(struct device_node *device, int index) |
44 | { | 47 | { |
45 | return NULL; | 48 | return NULL; |
46 | } | 49 | } |
47 | static inline const u32 *of_get_address(struct device_node *dev, int index, | 50 | #endif |
51 | static inline const __be32 *of_get_address(struct device_node *dev, int index, | ||
48 | u64 *size, unsigned int *flags) | 52 | u64 *size, unsigned int *flags) |
49 | { | 53 | { |
50 | return NULL; | 54 | return NULL; |
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h index b8e241125201..535cecf1e02f 100644 --- a/include/linux/of_irq.h +++ b/include/linux/of_irq.h | |||
@@ -58,8 +58,8 @@ static inline int of_irq_map_oldworld(struct device_node *device, int index, | |||
58 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ | 58 | #endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */ |
59 | 59 | ||
60 | 60 | ||
61 | extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec, | 61 | extern int of_irq_map_raw(struct device_node *parent, const __be32 *intspec, |
62 | u32 ointsize, const u32 *addr, | 62 | u32 ointsize, const __be32 *addr, |
63 | struct of_irq *out_irq); | 63 | struct of_irq *out_irq); |
64 | extern int of_irq_map_one(struct device_node *device, int index, | 64 | extern int of_irq_map_one(struct device_node *device, int index, |
65 | struct of_irq *out_irq); | 65 | struct of_irq *out_irq); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index ee2179546c63..9cbd6705d033 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -604,6 +604,20 @@ struct pci_driver { | |||
604 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID | 604 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID |
605 | 605 | ||
606 | /** | 606 | /** |
607 | * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem | ||
608 | * @vend: the 16 bit PCI Vendor ID | ||
609 | * @dev: the 16 bit PCI Device ID | ||
610 | * @subvend: the 16 bit PCI Subvendor ID | ||
611 | * @subdev: the 16 bit PCI Subdevice ID | ||
612 | * | ||
613 | * This macro is used to create a struct pci_device_id that matches a | ||
614 | * specific device with subsystem information. | ||
615 | */ | ||
616 | #define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \ | ||
617 | .vendor = (vend), .device = (dev), \ | ||
618 | .subvendor = (subvend), .subdevice = (subdev) | ||
619 | |||
620 | /** | ||
607 | * PCI_DEVICE_CLASS - macro used to describe a specific pci device class | 621 | * PCI_DEVICE_CLASS - macro used to describe a specific pci device class |
608 | * @dev_class: the class, subclass, prog-if triple for this device | 622 | * @dev_class: the class, subclass, prog-if triple for this device |
609 | * @dev_class_mask: the class mask for this device | 623 | * @dev_class_mask: the class mask for this device |
diff --git a/include/linux/percpu-rwsem.h b/include/linux/percpu-rwsem.h index cf80f7e5277f..bd1e86071e57 100644 --- a/include/linux/percpu-rwsem.h +++ b/include/linux/percpu-rwsem.h | |||
@@ -12,34 +12,27 @@ struct percpu_rw_semaphore { | |||
12 | struct mutex mtx; | 12 | struct mutex mtx; |
13 | }; | 13 | }; |
14 | 14 | ||
15 | #define light_mb() barrier() | ||
16 | #define heavy_mb() synchronize_sched_expedited() | ||
17 | |||
15 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) | 18 | static inline void percpu_down_read(struct percpu_rw_semaphore *p) |
16 | { | 19 | { |
17 | rcu_read_lock(); | 20 | rcu_read_lock_sched(); |
18 | if (unlikely(p->locked)) { | 21 | if (unlikely(p->locked)) { |
19 | rcu_read_unlock(); | 22 | rcu_read_unlock_sched(); |
20 | mutex_lock(&p->mtx); | 23 | mutex_lock(&p->mtx); |
21 | this_cpu_inc(*p->counters); | 24 | this_cpu_inc(*p->counters); |
22 | mutex_unlock(&p->mtx); | 25 | mutex_unlock(&p->mtx); |
23 | return; | 26 | return; |
24 | } | 27 | } |
25 | this_cpu_inc(*p->counters); | 28 | this_cpu_inc(*p->counters); |
26 | rcu_read_unlock(); | 29 | rcu_read_unlock_sched(); |
30 | light_mb(); /* A, between read of p->locked and read of data, paired with D */ | ||
27 | } | 31 | } |
28 | 32 | ||
29 | static inline void percpu_up_read(struct percpu_rw_semaphore *p) | 33 | static inline void percpu_up_read(struct percpu_rw_semaphore *p) |
30 | { | 34 | { |
31 | /* | 35 | light_mb(); /* B, between read of the data and write to p->counter, paired with C */ |
32 | * On X86, write operation in this_cpu_dec serves as a memory unlock | ||
33 | * barrier (i.e. memory accesses may be moved before the write, but | ||
34 | * no memory accesses are moved past the write). | ||
35 | * On other architectures this may not be the case, so we need smp_mb() | ||
36 | * there. | ||
37 | */ | ||
38 | #if defined(CONFIG_X86) && (!defined(CONFIG_X86_PPRO_FENCE) && !defined(CONFIG_X86_OOSTORE)) | ||
39 | barrier(); | ||
40 | #else | ||
41 | smp_mb(); | ||
42 | #endif | ||
43 | this_cpu_dec(*p->counters); | 36 | this_cpu_dec(*p->counters); |
44 | } | 37 | } |
45 | 38 | ||
@@ -58,14 +51,15 @@ static inline void percpu_down_write(struct percpu_rw_semaphore *p) | |||
58 | { | 51 | { |
59 | mutex_lock(&p->mtx); | 52 | mutex_lock(&p->mtx); |
60 | p->locked = true; | 53 | p->locked = true; |
61 | synchronize_rcu(); | 54 | synchronize_sched_expedited(); /* make sure that all readers exit the rcu_read_lock_sched region */ |
62 | while (__percpu_count(p->counters)) | 55 | while (__percpu_count(p->counters)) |
63 | msleep(1); | 56 | msleep(1); |
64 | smp_rmb(); /* paired with smp_mb() in percpu_sem_up_read() */ | 57 | heavy_mb(); /* C, between read of p->counter and write to data, paired with B */ |
65 | } | 58 | } |
66 | 59 | ||
67 | static inline void percpu_up_write(struct percpu_rw_semaphore *p) | 60 | static inline void percpu_up_write(struct percpu_rw_semaphore *p) |
68 | { | 61 | { |
62 | heavy_mb(); /* D, between write to data and write to p->locked, paired with A */ | ||
69 | p->locked = false; | 63 | p->locked = false; |
70 | mutex_unlock(&p->mtx); | 64 | mutex_unlock(&p->mtx); |
71 | } | 65 | } |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 2e902359aee5..6bfb2faa0b19 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -803,12 +803,16 @@ static inline void perf_event_task_tick(void) { } | |||
803 | do { \ | 803 | do { \ |
804 | static struct notifier_block fn##_nb __cpuinitdata = \ | 804 | static struct notifier_block fn##_nb __cpuinitdata = \ |
805 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ | 805 | { .notifier_call = fn, .priority = CPU_PRI_PERF }; \ |
806 | unsigned long cpu = smp_processor_id(); \ | ||
807 | unsigned long flags; \ | ||
806 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ | 808 | fn(&fn##_nb, (unsigned long)CPU_UP_PREPARE, \ |
807 | (void *)(unsigned long)smp_processor_id()); \ | 809 | (void *)(unsigned long)cpu); \ |
810 | local_irq_save(flags); \ | ||
808 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ | 811 | fn(&fn##_nb, (unsigned long)CPU_STARTING, \ |
809 | (void *)(unsigned long)smp_processor_id()); \ | 812 | (void *)(unsigned long)cpu); \ |
813 | local_irq_restore(flags); \ | ||
810 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ | 814 | fn(&fn##_nb, (unsigned long)CPU_ONLINE, \ |
811 | (void *)(unsigned long)smp_processor_id()); \ | 815 | (void *)(unsigned long)cpu); \ |
812 | register_cpu_notifier(&fn##_nb); \ | 816 | register_cpu_notifier(&fn##_nb); \ |
813 | } while (0) | 817 | } while (0) |
814 | 818 | ||
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h index 00474b047145..65e3e87eacc5 100644 --- a/include/linux/pid_namespace.h +++ b/include/linux/pid_namespace.h | |||
@@ -47,15 +47,9 @@ static inline struct pid_namespace *get_pid_ns(struct pid_namespace *ns) | |||
47 | } | 47 | } |
48 | 48 | ||
49 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); | 49 | extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns); |
50 | extern void free_pid_ns(struct kref *kref); | ||
51 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); | 50 | extern void zap_pid_ns_processes(struct pid_namespace *pid_ns); |
52 | extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd); | 51 | extern int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd); |
53 | 52 | extern void put_pid_ns(struct pid_namespace *ns); | |
54 | static inline void put_pid_ns(struct pid_namespace *ns) | ||
55 | { | ||
56 | if (ns != &init_pid_ns) | ||
57 | kref_put(&ns->kref, free_pid_ns); | ||
58 | } | ||
59 | 53 | ||
60 | #else /* !CONFIG_PID_NS */ | 54 | #else /* !CONFIG_PID_NS */ |
61 | #include <linux/err.h> | 55 | #include <linux/err.h> |
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h index c4e23d029498..24368a2e8b87 100644 --- a/include/linux/platform_data/cpsw.h +++ b/include/linux/platform_data/cpsw.h | |||
@@ -18,9 +18,7 @@ | |||
18 | #include <linux/if_ether.h> | 18 | #include <linux/if_ether.h> |
19 | 19 | ||
20 | struct cpsw_slave_data { | 20 | struct cpsw_slave_data { |
21 | u32 slave_reg_ofs; | 21 | char phy_id[MII_BUS_ID_SIZE]; |
22 | u32 sliver_reg_ofs; | ||
23 | const char *phy_id; | ||
24 | int phy_if; | 22 | int phy_if; |
25 | u8 mac_addr[ETH_ALEN]; | 23 | u8 mac_addr[ETH_ALEN]; |
26 | }; | 24 | }; |
@@ -28,27 +26,14 @@ struct cpsw_slave_data { | |||
28 | struct cpsw_platform_data { | 26 | struct cpsw_platform_data { |
29 | u32 ss_reg_ofs; /* Subsystem control register offset */ | 27 | u32 ss_reg_ofs; /* Subsystem control register offset */ |
30 | u32 channels; /* number of cpdma channels (symmetric) */ | 28 | u32 channels; /* number of cpdma channels (symmetric) */ |
31 | u32 cpdma_reg_ofs; /* cpdma register offset */ | ||
32 | u32 cpdma_sram_ofs; /* cpdma sram offset */ | ||
33 | |||
34 | u32 slaves; /* number of slave cpgmac ports */ | 29 | u32 slaves; /* number of slave cpgmac ports */ |
35 | struct cpsw_slave_data *slave_data; | 30 | struct cpsw_slave_data *slave_data; |
36 | 31 | u32 cpts_active_slave; /* time stamping slave */ | |
37 | u32 ale_reg_ofs; /* address lookup engine reg offset */ | 32 | u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */ |
33 | u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */ | ||
38 | u32 ale_entries; /* ale table size */ | 34 | u32 ale_entries; /* ale table size */ |
39 | |||
40 | u32 host_port_reg_ofs; /* cpsw cpdma host port registers */ | ||
41 | u32 host_port_num; /* The port number for the host port */ | ||
42 | |||
43 | u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */ | ||
44 | |||
45 | u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/ | ||
46 | u32 bd_ram_size; /*buffer descriptor ram size */ | 35 | u32 bd_ram_size; /*buffer descriptor ram size */ |
47 | u32 hw_ram_addr; /*if the HW address for BD RAM is different */ | ||
48 | bool no_bd_ram; /* no embedded BD ram*/ | ||
49 | |||
50 | u32 rx_descs; /* Number of Rx Descriptios */ | 36 | u32 rx_descs; /* Number of Rx Descriptios */ |
51 | |||
52 | u32 mac_control; /* Mac control register */ | 37 | u32 mac_control; /* Mac control register */ |
53 | }; | 38 | }; |
54 | 39 | ||
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h index b081c7245ec8..044a124bfbbc 100644 --- a/include/linux/platform_data/macb.h +++ b/include/linux/platform_data/macb.h | |||
@@ -12,6 +12,7 @@ struct macb_platform_data { | |||
12 | u32 phy_mask; | 12 | u32 phy_mask; |
13 | int phy_irq_pin; /* PHY IRQ */ | 13 | int phy_irq_pin; /* PHY IRQ */ |
14 | u8 is_rmii; /* using RMII interface? */ | 14 | u8 is_rmii; /* using RMII interface? */ |
15 | u8 rev_eth_addr; /* reverse Ethernet address byte order */ | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | #endif /* __MACB_PDATA_H__ */ | 18 | #endif /* __MACB_PDATA_H__ */ |
diff --git a/include/linux/platform_data/omap_ocp2scp.h b/include/linux/platform_data/omap_ocp2scp.h new file mode 100644 index 000000000000..5c6c3939355f --- /dev/null +++ b/include/linux/platform_data/omap_ocp2scp.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * omap_ocp2scp.h -- ocp2scp header file | ||
3 | * | ||
4 | * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * Author: Kishon Vijay Abraham I <kishon@ti.com> | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | */ | ||
18 | |||
19 | #ifndef __DRIVERS_OMAP_OCP2SCP_H | ||
20 | #define __DRIVERS_OMAP_OCP2SCP_H | ||
21 | |||
22 | struct omap_ocp2scp_dev { | ||
23 | const char *drv_name; | ||
24 | struct resource *res; | ||
25 | }; | ||
26 | |||
27 | struct omap_ocp2scp_platform_data { | ||
28 | int dev_cnt; | ||
29 | struct omap_ocp2scp_dev **devices; | ||
30 | }; | ||
31 | #endif /* __DRIVERS_OMAP_OCP2SCP_H */ | ||
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h new file mode 100644 index 000000000000..713bfd703342 --- /dev/null +++ b/include/linux/platform_data/pn544.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | enum { | ||
29 | NFC_GPIO_ENABLE, | ||
30 | NFC_GPIO_FW_RESET, | ||
31 | NFC_GPIO_IRQ | ||
32 | }; | ||
33 | |||
34 | /* board config */ | ||
35 | struct pn544_nfc_platform_data { | ||
36 | int (*request_resources) (struct i2c_client *client); | ||
37 | void (*free_resources) (void); | ||
38 | void (*enable) (int fw); | ||
39 | int (*test) (void); | ||
40 | void (*disable) (void); | ||
41 | int (*get_gpio)(int type); | ||
42 | }; | ||
43 | |||
44 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/ptp_clock_kernel.h b/include/linux/ptp_clock_kernel.h index f2dc6d8fc680..38a993508327 100644 --- a/include/linux/ptp_clock_kernel.h +++ b/include/linux/ptp_clock_kernel.h | |||
@@ -54,7 +54,8 @@ struct ptp_clock_request { | |||
54 | * clock operations | 54 | * clock operations |
55 | * | 55 | * |
56 | * @adjfreq: Adjusts the frequency of the hardware clock. | 56 | * @adjfreq: Adjusts the frequency of the hardware clock. |
57 | * parameter delta: Desired period change in parts per billion. | 57 | * parameter delta: Desired frequency offset from nominal frequency |
58 | * in parts per billion | ||
58 | * | 59 | * |
59 | * @adjtime: Shifts the time of the hardware clock. | 60 | * @adjtime: Shifts the time of the hardware clock. |
60 | * parameter delta: Desired change in nanoseconds. | 61 | * parameter delta: Desired change in nanoseconds. |
diff --git a/include/linux/raid/Kbuild b/include/linux/raid/Kbuild index 2415a64c5e51..e69de29bb2d1 100644 --- a/include/linux/raid/Kbuild +++ b/include/linux/raid/Kbuild | |||
@@ -1,2 +0,0 @@ | |||
1 | header-y += md_p.h | ||
2 | header-y += md_u.h | ||
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index fb1abb3367e9..358c04bfbe2a 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h | |||
@@ -11,149 +11,10 @@ | |||
11 | (for example /usr/src/linux/COPYING); if not, write to the Free | 11 | (for example /usr/src/linux/COPYING); if not, write to the Free |
12 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 12 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
13 | */ | 13 | */ |
14 | |||
15 | #ifndef _MD_U_H | 14 | #ifndef _MD_U_H |
16 | #define _MD_U_H | 15 | #define _MD_U_H |
17 | 16 | ||
18 | /* | 17 | #include <uapi/linux/raid/md_u.h> |
19 | * Different major versions are not compatible. | ||
20 | * Different minor versions are only downward compatible. | ||
21 | * Different patchlevel versions are downward and upward compatible. | ||
22 | */ | ||
23 | #define MD_MAJOR_VERSION 0 | ||
24 | #define MD_MINOR_VERSION 90 | ||
25 | /* | ||
26 | * MD_PATCHLEVEL_VERSION indicates kernel functionality. | ||
27 | * >=1 means different superblock formats are selectable using SET_ARRAY_INFO | ||
28 | * and major_version/minor_version accordingly | ||
29 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT | ||
30 | * in the super status byte | ||
31 | * >=3 means that bitmap superblock version 4 is supported, which uses | ||
32 | * little-ending representation rather than host-endian | ||
33 | */ | ||
34 | #define MD_PATCHLEVEL_VERSION 3 | ||
35 | |||
36 | /* ioctls */ | ||
37 | |||
38 | /* status */ | ||
39 | #define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t) | ||
40 | #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t) | ||
41 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) | ||
42 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) | ||
43 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) | ||
44 | #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t) | ||
45 | |||
46 | /* configuration */ | ||
47 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) | ||
48 | #define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t) | ||
49 | #define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22) | ||
50 | #define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t) | ||
51 | #define SET_DISK_INFO _IO (MD_MAJOR, 0x24) | ||
52 | #define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25) | ||
53 | #define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26) | ||
54 | #define PROTECT_ARRAY _IO (MD_MAJOR, 0x27) | ||
55 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) | ||
56 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) | ||
57 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) | ||
58 | #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int) | ||
59 | 18 | ||
60 | /* usage */ | ||
61 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | ||
62 | /* 0x31 was START_ARRAY */ | ||
63 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) | ||
64 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) | ||
65 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) | ||
66 | |||
67 | /* 63 partitions with the alternate major number (mdp) */ | ||
68 | #define MdpMinorShift 6 | ||
69 | #ifdef __KERNEL__ | ||
70 | extern int mdp_major; | 19 | extern int mdp_major; |
71 | #endif | ||
72 | |||
73 | typedef struct mdu_version_s { | ||
74 | int major; | ||
75 | int minor; | ||
76 | int patchlevel; | ||
77 | } mdu_version_t; | ||
78 | |||
79 | typedef struct mdu_array_info_s { | ||
80 | /* | ||
81 | * Generic constant information | ||
82 | */ | ||
83 | int major_version; | ||
84 | int minor_version; | ||
85 | int patch_version; | ||
86 | int ctime; | ||
87 | int level; | ||
88 | int size; | ||
89 | int nr_disks; | ||
90 | int raid_disks; | ||
91 | int md_minor; | ||
92 | int not_persistent; | ||
93 | |||
94 | /* | ||
95 | * Generic state information | ||
96 | */ | ||
97 | int utime; /* 0 Superblock update time */ | ||
98 | int state; /* 1 State bits (clean, ...) */ | ||
99 | int active_disks; /* 2 Number of currently active disks */ | ||
100 | int working_disks; /* 3 Number of working disks */ | ||
101 | int failed_disks; /* 4 Number of failed disks */ | ||
102 | int spare_disks; /* 5 Number of spare disks */ | ||
103 | |||
104 | /* | ||
105 | * Personality information | ||
106 | */ | ||
107 | int layout; /* 0 the array's physical layout */ | ||
108 | int chunk_size; /* 1 chunk size in bytes */ | ||
109 | |||
110 | } mdu_array_info_t; | ||
111 | |||
112 | /* non-obvious values for 'level' */ | ||
113 | #define LEVEL_MULTIPATH (-4) | ||
114 | #define LEVEL_LINEAR (-1) | ||
115 | #define LEVEL_FAULTY (-5) | ||
116 | |||
117 | /* we need a value for 'no level specified' and 0 | ||
118 | * means 'raid0', so we need something else. This is | ||
119 | * for internal use only | ||
120 | */ | ||
121 | #define LEVEL_NONE (-1000000) | ||
122 | |||
123 | typedef struct mdu_disk_info_s { | ||
124 | /* | ||
125 | * configuration/status of one particular disk | ||
126 | */ | ||
127 | int number; | ||
128 | int major; | ||
129 | int minor; | ||
130 | int raid_disk; | ||
131 | int state; | ||
132 | |||
133 | } mdu_disk_info_t; | ||
134 | |||
135 | typedef struct mdu_start_info_s { | ||
136 | /* | ||
137 | * configuration/status of one particular disk | ||
138 | */ | ||
139 | int major; | ||
140 | int minor; | ||
141 | int raid_disk; | ||
142 | int state; | ||
143 | |||
144 | } mdu_start_info_t; | ||
145 | |||
146 | typedef struct mdu_bitmap_file_s | ||
147 | { | ||
148 | char pathname[4096]; | ||
149 | } mdu_bitmap_file_t; | ||
150 | |||
151 | typedef struct mdu_param_s | ||
152 | { | ||
153 | int personality; /* 1,2,3,4 */ | ||
154 | int chunk_size; /* in bytes */ | ||
155 | int max_fault; /* unused for now */ | ||
156 | } mdu_param_t; | ||
157 | |||
158 | #endif | 20 | #endif |
159 | |||
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index e11ccb4cf48d..0a260d8a18bf 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
@@ -46,20 +46,17 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | |||
46 | #define WARN_ON_RATELIMIT(condition, state) \ | 46 | #define WARN_ON_RATELIMIT(condition, state) \ |
47 | WARN_ON((condition) && __ratelimit(state)) | 47 | WARN_ON((condition) && __ratelimit(state)) |
48 | 48 | ||
49 | #define __WARN_RATELIMIT(condition, state, format...) \ | 49 | #define WARN_RATELIMIT(condition, format, ...) \ |
50 | ({ \ | ||
51 | int rtn = 0; \ | ||
52 | if (unlikely(__ratelimit(state))) \ | ||
53 | rtn = WARN(condition, format); \ | ||
54 | rtn; \ | ||
55 | }) | ||
56 | |||
57 | #define WARN_RATELIMIT(condition, format...) \ | ||
58 | ({ \ | 50 | ({ \ |
59 | static DEFINE_RATELIMIT_STATE(_rs, \ | 51 | static DEFINE_RATELIMIT_STATE(_rs, \ |
60 | DEFAULT_RATELIMIT_INTERVAL, \ | 52 | DEFAULT_RATELIMIT_INTERVAL, \ |
61 | DEFAULT_RATELIMIT_BURST); \ | 53 | DEFAULT_RATELIMIT_BURST); \ |
62 | __WARN_RATELIMIT(condition, &_rs, format); \ | 54 | int rtn = !!(condition); \ |
55 | \ | ||
56 | if (unlikely(rtn && __ratelimit(&_rs))) \ | ||
57 | WARN(rtn, format, ##__VA_ARGS__); \ | ||
58 | \ | ||
59 | rtn; \ | ||
63 | }) | 60 | }) |
64 | 61 | ||
65 | #else | 62 | #else |
@@ -67,15 +64,9 @@ extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | |||
67 | #define WARN_ON_RATELIMIT(condition, state) \ | 64 | #define WARN_ON_RATELIMIT(condition, state) \ |
68 | WARN_ON(condition) | 65 | WARN_ON(condition) |
69 | 66 | ||
70 | #define __WARN_RATELIMIT(condition, state, format...) \ | 67 | #define WARN_RATELIMIT(condition, format, ...) \ |
71 | ({ \ | ||
72 | int rtn = WARN(condition, format); \ | ||
73 | rtn; \ | ||
74 | }) | ||
75 | |||
76 | #define WARN_RATELIMIT(condition, format...) \ | ||
77 | ({ \ | 68 | ({ \ |
78 | int rtn = WARN(condition, format); \ | 69 | int rtn = WARN(condition, format, ##__VA_ARGS__); \ |
79 | rtn; \ | 70 | rtn; \ |
80 | }) | 71 | }) |
81 | 72 | ||
diff --git a/include/linux/rbtree_augmented.h b/include/linux/rbtree_augmented.h index 214caa33433b..2ac60c9cf644 100644 --- a/include/linux/rbtree_augmented.h +++ b/include/linux/rbtree_augmented.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #ifndef _LINUX_RBTREE_AUGMENTED_H | 24 | #ifndef _LINUX_RBTREE_AUGMENTED_H |
25 | #define _LINUX_RBTREE_AUGMENTED_H | 25 | #define _LINUX_RBTREE_AUGMENTED_H |
26 | 26 | ||
27 | #include <linux/compiler.h> | ||
27 | #include <linux/rbtree.h> | 28 | #include <linux/rbtree.h> |
28 | 29 | ||
29 | /* | 30 | /* |
diff --git a/include/linux/rio.h b/include/linux/rio.h index 4187da511006..a3e784278667 100644 --- a/include/linux/rio.h +++ b/include/linux/rio.h | |||
@@ -275,9 +275,11 @@ struct rio_id_table { | |||
275 | * struct rio_net - RIO network info | 275 | * struct rio_net - RIO network info |
276 | * @node: Node in global list of RIO networks | 276 | * @node: Node in global list of RIO networks |
277 | * @devices: List of devices in this network | 277 | * @devices: List of devices in this network |
278 | * @switches: List of switches in this netowrk | ||
278 | * @mports: List of master ports accessing this network | 279 | * @mports: List of master ports accessing this network |
279 | * @hport: Default port for accessing this network | 280 | * @hport: Default port for accessing this network |
280 | * @id: RIO network ID | 281 | * @id: RIO network ID |
282 | * @destid_table: destID allocation table | ||
281 | */ | 283 | */ |
282 | struct rio_net { | 284 | struct rio_net { |
283 | struct list_head node; /* node in list of networks */ | 285 | struct list_head node; /* node in list of networks */ |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 7002bbfd5d4a..489dd7bb28ec 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -69,4 +69,7 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb, | |||
69 | struct netlink_callback *cb, | 69 | struct netlink_callback *cb, |
70 | struct net_device *dev, | 70 | struct net_device *dev, |
71 | int idx); | 71 | int idx); |
72 | |||
73 | extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | ||
74 | struct net_device *dev, u16 mode); | ||
72 | #endif /* __LINUX_RTNETLINK_H */ | 75 | #endif /* __LINUX_RTNETLINK_H */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6a2c34e6d962..f2af494330ab 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -235,11 +235,13 @@ enum { | |||
235 | /* | 235 | /* |
236 | * The callback notifies userspace to release buffers when skb DMA is done in | 236 | * The callback notifies userspace to release buffers when skb DMA is done in |
237 | * lower device, the skb last reference should be 0 when calling this. | 237 | * lower device, the skb last reference should be 0 when calling this. |
238 | * The zerocopy_success argument is true if zero copy transmit occurred, | ||
239 | * false on data copy or out of memory error caused by data copy attempt. | ||
238 | * The ctx field is used to track device context. | 240 | * The ctx field is used to track device context. |
239 | * The desc field is used to track userspace buffer index. | 241 | * The desc field is used to track userspace buffer index. |
240 | */ | 242 | */ |
241 | struct ubuf_info { | 243 | struct ubuf_info { |
242 | void (*callback)(struct ubuf_info *); | 244 | void (*callback)(struct ubuf_info *, bool zerocopy_success); |
243 | void *ctx; | 245 | void *ctx; |
244 | unsigned long desc; | 246 | unsigned long desc; |
245 | }; | 247 | }; |
@@ -566,6 +568,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb) | |||
566 | } | 568 | } |
567 | 569 | ||
568 | extern void kfree_skb(struct sk_buff *skb); | 570 | extern void kfree_skb(struct sk_buff *skb); |
571 | extern void skb_tx_error(struct sk_buff *skb); | ||
569 | extern void consume_skb(struct sk_buff *skb); | 572 | extern void consume_skb(struct sk_buff *skb); |
570 | extern void __kfree_skb(struct sk_buff *skb); | 573 | extern void __kfree_skb(struct sk_buff *skb); |
571 | extern struct kmem_cache *skbuff_head_cache; | 574 | extern struct kmem_cache *skbuff_head_cache; |
@@ -643,7 +646,7 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |||
643 | extern void __skb_get_rxhash(struct sk_buff *skb); | 646 | extern void __skb_get_rxhash(struct sk_buff *skb); |
644 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) | 647 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) |
645 | { | 648 | { |
646 | if (!skb->rxhash) | 649 | if (!skb->l4_rxhash) |
647 | __skb_get_rxhash(skb); | 650 | __skb_get_rxhash(skb); |
648 | 651 | ||
649 | return skb->rxhash; | 652 | return skb->rxhash; |
diff --git a/include/linux/spi/Kbuild b/include/linux/spi/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/spi/Kbuild +++ /dev/null | |||
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index c64de9dd7631..2f694f3846a9 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -46,8 +46,9 @@ struct ads7846_platform_data { | |||
46 | u16 debounce_rep; /* additional consecutive good readings | 46 | u16 debounce_rep; /* additional consecutive good readings |
47 | * required after the first two */ | 47 | * required after the first two */ |
48 | int gpio_pendown; /* the GPIO used to decide the pendown | 48 | int gpio_pendown; /* the GPIO used to decide the pendown |
49 | * state if get_pendown_state == NULL | 49 | * state if get_pendown_state == NULL */ |
50 | */ | 50 | int gpio_pendown_debounce; /* platform specific debounce time for |
51 | * the gpio_pendown */ | ||
51 | int (*get_pendown_state)(void); | 52 | int (*get_pendown_state)(void); |
52 | int (*filter_init) (const struct ads7846_platform_data *pdata, | 53 | int (*filter_init) (const struct ads7846_platform_data *pdata, |
53 | void **filter_data); | 54 | void **filter_data); |
diff --git a/include/linux/spi/tsc2005.h b/include/linux/spi/tsc2005.h index d9b0c84220c7..8f721e465e05 100644 --- a/include/linux/spi/tsc2005.h +++ b/include/linux/spi/tsc2005.h | |||
@@ -3,8 +3,6 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2009-2010 Nokia Corporation | 4 | * Copyright (C) 2009-2010 Nokia Corporation |
5 | * | 5 | * |
6 | * Contact: Aaro Koskinen <aaro.koskinen@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index 5f44e9740cd2..07a9c7a2e088 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -13,6 +13,12 @@ struct ssb_serial_port { | |||
13 | unsigned int reg_shift; | 13 | unsigned int reg_shift; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct ssb_pflash { | ||
17 | bool present; | ||
18 | u8 buswidth; | ||
19 | u32 window; | ||
20 | u32 window_size; | ||
21 | }; | ||
16 | 22 | ||
17 | struct ssb_mipscore { | 23 | struct ssb_mipscore { |
18 | struct ssb_device *dev; | 24 | struct ssb_device *dev; |
@@ -20,9 +26,7 @@ struct ssb_mipscore { | |||
20 | int nr_serial_ports; | 26 | int nr_serial_ports; |
21 | struct ssb_serial_port serial_ports[4]; | 27 | struct ssb_serial_port serial_ports[4]; |
22 | 28 | ||
23 | u8 flash_buswidth; | 29 | struct ssb_pflash pflash; |
24 | u32 flash_window; | ||
25 | u32 flash_window_size; | ||
26 | }; | 30 | }; |
27 | 31 | ||
28 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); | 32 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index a0525019e1d1..6ecfa02ddbac 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -485,7 +485,7 @@ | |||
485 | #define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 | 485 | #define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 |
486 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 | 486 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 |
487 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 | 487 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 |
488 | #define SSB_SPROM8_TEMPDELTA 0x00BA | 488 | #define SSB_SPROM8_TEMPDELTA 0x00BC |
489 | #define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff | 489 | #define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff |
490 | #define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 | 490 | #define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 |
491 | #define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 | 491 | #define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index a1547ea3920d..de5b2f8176ce 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -104,6 +104,7 @@ struct plat_stmmacenet_data { | |||
104 | int bugged_jumbo; | 104 | int bugged_jumbo; |
105 | int pmt; | 105 | int pmt; |
106 | int force_sf_dma_mode; | 106 | int force_sf_dma_mode; |
107 | int riwt_off; | ||
107 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 108 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
108 | void (*bus_setup)(void __iomem *ioaddr); | 109 | void (*bus_setup)(void __iomem *ioaddr); |
109 | int (*init)(struct platform_device *pdev); | 110 | int (*init)(struct platform_device *pdev); |
diff --git a/include/linux/sunrpc/Kbuild b/include/linux/sunrpc/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/sunrpc/Kbuild +++ /dev/null | |||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index cd844a6a8d5f..14a8ff2de11e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -158,8 +158,7 @@ struct ctl_table_root { | |||
158 | struct ctl_table_set default_set; | 158 | struct ctl_table_set default_set; |
159 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, | 159 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, |
160 | struct nsproxy *namespaces); | 160 | struct nsproxy *namespaces); |
161 | int (*permissions)(struct ctl_table_root *root, | 161 | int (*permissions)(struct ctl_table_header *head, struct ctl_table *table); |
162 | struct nsproxy *namespaces, struct ctl_table *table); | ||
163 | }; | 162 | }; |
164 | 163 | ||
165 | /* struct ctl_path describes where in the hierarchy a table is added */ | 164 | /* struct ctl_path describes where in the hierarchy a table is added */ |
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/tc_act/Kbuild +++ /dev/null | |||
diff --git a/include/linux/tc_ematch/Kbuild b/include/linux/tc_ematch/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/tc_ematch/Kbuild +++ /dev/null | |||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8a7fc4be2d75..60b7aac15e0e 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -191,7 +191,8 @@ struct tcp_sock { | |||
191 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ | 191 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ |
192 | early_retrans_delayed:1, /* Delayed ER timer installed */ | 192 | early_retrans_delayed:1, /* Delayed ER timer installed */ |
193 | syn_data:1, /* SYN includes data */ | 193 | syn_data:1, /* SYN includes data */ |
194 | syn_fastopen:1; /* SYN includes Fast Open option */ | 194 | syn_fastopen:1, /* SYN includes Fast Open option */ |
195 | syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ | ||
195 | 196 | ||
196 | /* RTT measurement */ | 197 | /* RTT measurement */ |
197 | u32 srtt; /* smoothed round trip time << 3 */ | 198 | u32 srtt; /* smoothed round trip time << 3 */ |
diff --git a/include/linux/timecompare.h b/include/linux/timecompare.h deleted file mode 100644 index 546e2234e4b3..000000000000 --- a/include/linux/timecompare.h +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | /* | ||
2 | * Utility code which helps transforming between two different time | ||
3 | * bases, called "source" and "target" time in this code. | ||
4 | * | ||
5 | * Source time has to be provided via the timecounter API while target | ||
6 | * time is accessed via a function callback whose prototype | ||
7 | * intentionally matches ktime_get() and ktime_get_real(). These | ||
8 | * interfaces where chosen like this so that the code serves its | ||
9 | * initial purpose without additional glue code. | ||
10 | * | ||
11 | * This purpose is synchronizing a hardware clock in a NIC with system | ||
12 | * time, in order to implement the Precision Time Protocol (PTP, | ||
13 | * IEEE1588) with more accurate hardware assisted time stamping. In | ||
14 | * that context only synchronization against system time (= | ||
15 | * ktime_get_real()) is currently needed. But this utility code might | ||
16 | * become useful in other situations, which is why it was written as | ||
17 | * general purpose utility code. | ||
18 | * | ||
19 | * The source timecounter is assumed to return monotonically | ||
20 | * increasing time (but this code does its best to compensate if that | ||
21 | * is not the case) whereas target time may jump. | ||
22 | * | ||
23 | * The target time corresponding to a source time is determined by | ||
24 | * reading target time, reading source time, reading target time | ||
25 | * again, then assuming that average target time corresponds to source | ||
26 | * time. In other words, the assumption is that reading the source | ||
27 | * time is slow and involves equal time for sending the request and | ||
28 | * receiving the reply, whereas reading target time is assumed to be | ||
29 | * fast. | ||
30 | * | ||
31 | * Copyright (C) 2009 Intel Corporation. | ||
32 | * Author: Patrick Ohly <patrick.ohly@intel.com> | ||
33 | * | ||
34 | * This program is free software; you can redistribute it and/or modify it | ||
35 | * under the terms and conditions of the GNU General Public License, | ||
36 | * version 2, as published by the Free Software Foundation. | ||
37 | * | ||
38 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
40 | * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for | ||
41 | * more details. | ||
42 | * | ||
43 | * You should have received a copy of the GNU General Public License along with | ||
44 | * this program; if not, write to the Free Software Foundation, Inc., | ||
45 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
46 | */ | ||
47 | #ifndef _LINUX_TIMECOMPARE_H | ||
48 | #define _LINUX_TIMECOMPARE_H | ||
49 | |||
50 | #include <linux/clocksource.h> | ||
51 | #include <linux/ktime.h> | ||
52 | |||
53 | /** | ||
54 | * struct timecompare - stores state and configuration for the two clocks | ||
55 | * | ||
56 | * Initialize to zero, then set source/target/num_samples. | ||
57 | * | ||
58 | * Transformation between source time and target time is done with: | ||
59 | * target_time = source_time + offset + | ||
60 | * (source_time - last_update) * skew / | ||
61 | * TIMECOMPARE_SKEW_RESOLUTION | ||
62 | * | ||
63 | * @source: used to get source time stamps via timecounter_read() | ||
64 | * @target: function returning target time (for example, ktime_get | ||
65 | * for monotonic time, or ktime_get_real for wall clock) | ||
66 | * @num_samples: number of times that source time and target time are to | ||
67 | * be compared when determining their offset | ||
68 | * @offset: (target time - source time) at the time of the last update | ||
69 | * @skew: average (target time - source time) / delta source time * | ||
70 | * TIMECOMPARE_SKEW_RESOLUTION | ||
71 | * @last_update: last source time stamp when time offset was measured | ||
72 | */ | ||
73 | struct timecompare { | ||
74 | struct timecounter *source; | ||
75 | ktime_t (*target)(void); | ||
76 | int num_samples; | ||
77 | |||
78 | s64 offset; | ||
79 | s64 skew; | ||
80 | u64 last_update; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * timecompare_transform - transform source time stamp into target time base | ||
85 | * @sync: context for time sync | ||
86 | * @source_tstamp: the result of timecounter_read() or | ||
87 | * timecounter_cyc2time() | ||
88 | */ | ||
89 | extern ktime_t timecompare_transform(struct timecompare *sync, | ||
90 | u64 source_tstamp); | ||
91 | |||
92 | /** | ||
93 | * timecompare_offset - measure current (target time - source time) offset | ||
94 | * @sync: context for time sync | ||
95 | * @offset: average offset during sample period returned here | ||
96 | * @source_tstamp: average source time during sample period returned here | ||
97 | * | ||
98 | * Returns number of samples used. Might be zero (= no result) in the | ||
99 | * unlikely case that target time was monotonically decreasing for all | ||
100 | * samples (= broken). | ||
101 | */ | ||
102 | extern int timecompare_offset(struct timecompare *sync, | ||
103 | s64 *offset, | ||
104 | u64 *source_tstamp); | ||
105 | |||
106 | extern void __timecompare_update(struct timecompare *sync, | ||
107 | u64 source_tstamp); | ||
108 | |||
109 | /** | ||
110 | * timecompare_update - update offset and skew by measuring current offset | ||
111 | * @sync: context for time sync | ||
112 | * @source_tstamp: the result of timecounter_read() or | ||
113 | * timecounter_cyc2time(), pass zero to force update | ||
114 | * | ||
115 | * Updates are only done at most once per second. | ||
116 | */ | ||
117 | static inline void timecompare_update(struct timecompare *sync, | ||
118 | u64 source_tstamp) | ||
119 | { | ||
120 | if (!source_tstamp || | ||
121 | (s64)(source_tstamp - sync->last_update) >= NSEC_PER_SEC) | ||
122 | __timecompare_update(sync, source_tstamp); | ||
123 | } | ||
124 | |||
125 | #endif /* _LINUX_TIMECOMPARE_H */ | ||
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index e6f0331e3d45..24594571c5a3 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -35,16 +35,6 @@ struct inode; | |||
35 | # include <asm/uprobes.h> | 35 | # include <asm/uprobes.h> |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | /* flags that denote/change uprobes behaviour */ | ||
39 | |||
40 | /* Have a copy of original instruction */ | ||
41 | #define UPROBE_COPY_INSN 0x1 | ||
42 | |||
43 | /* Dont run handlers when first register/ last unregister in progress*/ | ||
44 | #define UPROBE_RUN_HANDLER 0x2 | ||
45 | /* Can skip singlestep */ | ||
46 | #define UPROBE_SKIP_SSTEP 0x4 | ||
47 | |||
48 | struct uprobe_consumer { | 38 | struct uprobe_consumer { |
49 | int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); | 39 | int (*handler)(struct uprobe_consumer *self, struct pt_regs *regs); |
50 | /* | 40 | /* |
@@ -59,7 +49,6 @@ struct uprobe_consumer { | |||
59 | #ifdef CONFIG_UPROBES | 49 | #ifdef CONFIG_UPROBES |
60 | enum uprobe_task_state { | 50 | enum uprobe_task_state { |
61 | UTASK_RUNNING, | 51 | UTASK_RUNNING, |
62 | UTASK_BP_HIT, | ||
63 | UTASK_SSTEP, | 52 | UTASK_SSTEP, |
64 | UTASK_SSTEP_ACK, | 53 | UTASK_SSTEP_ACK, |
65 | UTASK_SSTEP_TRAPPED, | 54 | UTASK_SSTEP_TRAPPED, |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 07915a32fb9d..10278d18709c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1778,17 +1778,6 @@ static inline int usb_translate_errors(int error_code) | |||
1778 | extern void usb_register_notify(struct notifier_block *nb); | 1778 | extern void usb_register_notify(struct notifier_block *nb); |
1779 | extern void usb_unregister_notify(struct notifier_block *nb); | 1779 | extern void usb_unregister_notify(struct notifier_block *nb); |
1780 | 1780 | ||
1781 | #ifdef DEBUG | ||
1782 | #define dbg(format, arg...) \ | ||
1783 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg) | ||
1784 | #else | ||
1785 | #define dbg(format, arg...) \ | ||
1786 | do { \ | ||
1787 | if (0) \ | ||
1788 | printk(KERN_DEBUG "%s: " format "\n", __FILE__, ##arg); \ | ||
1789 | } while (0) | ||
1790 | #endif | ||
1791 | |||
1792 | /* debugfs stuff */ | 1781 | /* debugfs stuff */ |
1793 | extern struct dentry *usb_debug_root; | 1782 | extern struct dentry *usb_debug_root; |
1794 | 1783 | ||
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild index b607f3532e88..e69de29bb2d1 100644 --- a/include/linux/usb/Kbuild +++ b/include/linux/usb/Kbuild | |||
@@ -1,10 +0,0 @@ | |||
1 | header-y += audio.h | ||
2 | header-y += cdc.h | ||
3 | header-y += ch9.h | ||
4 | header-y += ch11.h | ||
5 | header-y += functionfs.h | ||
6 | header-y += gadgetfs.h | ||
7 | header-y += midi.h | ||
8 | header-y += g_printer.h | ||
9 | header-y += tmc.h | ||
10 | header-y += video.h | ||
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index a54b8255d75f..3d84619110a4 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -17,531 +17,11 @@ | |||
17 | * Types and defines in this file are either specific to version 1.0 of | 17 | * Types and defines in this file are either specific to version 1.0 of |
18 | * this standard or common for newer versions. | 18 | * this standard or common for newer versions. |
19 | */ | 19 | */ |
20 | |||
21 | #ifndef __LINUX_USB_AUDIO_H | 20 | #ifndef __LINUX_USB_AUDIO_H |
22 | #define __LINUX_USB_AUDIO_H | 21 | #define __LINUX_USB_AUDIO_H |
23 | 22 | ||
24 | #include <linux/types.h> | 23 | #include <uapi/linux/usb/audio.h> |
25 | |||
26 | /* bInterfaceProtocol values to denote the version of the standard used */ | ||
27 | #define UAC_VERSION_1 0x00 | ||
28 | #define UAC_VERSION_2 0x20 | ||
29 | |||
30 | /* A.2 Audio Interface Subclass Codes */ | ||
31 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | ||
32 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | ||
33 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | ||
34 | |||
35 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | ||
36 | #define UAC_HEADER 0x01 | ||
37 | #define UAC_INPUT_TERMINAL 0x02 | ||
38 | #define UAC_OUTPUT_TERMINAL 0x03 | ||
39 | #define UAC_MIXER_UNIT 0x04 | ||
40 | #define UAC_SELECTOR_UNIT 0x05 | ||
41 | #define UAC_FEATURE_UNIT 0x06 | ||
42 | #define UAC1_PROCESSING_UNIT 0x07 | ||
43 | #define UAC1_EXTENSION_UNIT 0x08 | ||
44 | |||
45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | ||
46 | #define UAC_AS_GENERAL 0x01 | ||
47 | #define UAC_FORMAT_TYPE 0x02 | ||
48 | #define UAC_FORMAT_SPECIFIC 0x03 | ||
49 | |||
50 | /* A.7 Processing Unit Process Types */ | ||
51 | #define UAC_PROCESS_UNDEFINED 0x00 | ||
52 | #define UAC_PROCESS_UP_DOWNMIX 0x01 | ||
53 | #define UAC_PROCESS_DOLBY_PROLOGIC 0x02 | ||
54 | #define UAC_PROCESS_STEREO_EXTENDER 0x03 | ||
55 | #define UAC_PROCESS_REVERB 0x04 | ||
56 | #define UAC_PROCESS_CHORUS 0x05 | ||
57 | #define UAC_PROCESS_DYN_RANGE_COMP 0x06 | ||
58 | |||
59 | /* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ | ||
60 | #define UAC_EP_GENERAL 0x01 | ||
61 | |||
62 | /* A.9 Audio Class-Specific Request Codes */ | ||
63 | #define UAC_SET_ 0x00 | ||
64 | #define UAC_GET_ 0x80 | ||
65 | |||
66 | #define UAC__CUR 0x1 | ||
67 | #define UAC__MIN 0x2 | ||
68 | #define UAC__MAX 0x3 | ||
69 | #define UAC__RES 0x4 | ||
70 | #define UAC__MEM 0x5 | ||
71 | |||
72 | #define UAC_SET_CUR (UAC_SET_ | UAC__CUR) | ||
73 | #define UAC_GET_CUR (UAC_GET_ | UAC__CUR) | ||
74 | #define UAC_SET_MIN (UAC_SET_ | UAC__MIN) | ||
75 | #define UAC_GET_MIN (UAC_GET_ | UAC__MIN) | ||
76 | #define UAC_SET_MAX (UAC_SET_ | UAC__MAX) | ||
77 | #define UAC_GET_MAX (UAC_GET_ | UAC__MAX) | ||
78 | #define UAC_SET_RES (UAC_SET_ | UAC__RES) | ||
79 | #define UAC_GET_RES (UAC_GET_ | UAC__RES) | ||
80 | #define UAC_SET_MEM (UAC_SET_ | UAC__MEM) | ||
81 | #define UAC_GET_MEM (UAC_GET_ | UAC__MEM) | ||
82 | |||
83 | #define UAC_GET_STAT 0xff | ||
84 | |||
85 | /* A.10 Control Selector Codes */ | ||
86 | |||
87 | /* A.10.1 Terminal Control Selectors */ | ||
88 | #define UAC_TERM_COPY_PROTECT 0x01 | ||
89 | |||
90 | /* A.10.2 Feature Unit Control Selectors */ | ||
91 | #define UAC_FU_MUTE 0x01 | ||
92 | #define UAC_FU_VOLUME 0x02 | ||
93 | #define UAC_FU_BASS 0x03 | ||
94 | #define UAC_FU_MID 0x04 | ||
95 | #define UAC_FU_TREBLE 0x05 | ||
96 | #define UAC_FU_GRAPHIC_EQUALIZER 0x06 | ||
97 | #define UAC_FU_AUTOMATIC_GAIN 0x07 | ||
98 | #define UAC_FU_DELAY 0x08 | ||
99 | #define UAC_FU_BASS_BOOST 0x09 | ||
100 | #define UAC_FU_LOUDNESS 0x0a | ||
101 | |||
102 | #define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1)) | ||
103 | |||
104 | /* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */ | ||
105 | #define UAC_UD_ENABLE 0x01 | ||
106 | #define UAC_UD_MODE_SELECT 0x02 | ||
107 | |||
108 | /* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */ | ||
109 | #define UAC_DP_ENABLE 0x01 | ||
110 | #define UAC_DP_MODE_SELECT 0x02 | ||
111 | |||
112 | /* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */ | ||
113 | #define UAC_3D_ENABLE 0x01 | ||
114 | #define UAC_3D_SPACE 0x02 | ||
115 | |||
116 | /* A.10.3.4 Reverberation Processing Unit Control Selectors */ | ||
117 | #define UAC_REVERB_ENABLE 0x01 | ||
118 | #define UAC_REVERB_LEVEL 0x02 | ||
119 | #define UAC_REVERB_TIME 0x03 | ||
120 | #define UAC_REVERB_FEEDBACK 0x04 | ||
121 | |||
122 | /* A.10.3.5 Chorus Processing Unit Control Selectors */ | ||
123 | #define UAC_CHORUS_ENABLE 0x01 | ||
124 | #define UAC_CHORUS_LEVEL 0x02 | ||
125 | #define UAC_CHORUS_RATE 0x03 | ||
126 | #define UAC_CHORUS_DEPTH 0x04 | ||
127 | |||
128 | /* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */ | ||
129 | #define UAC_DCR_ENABLE 0x01 | ||
130 | #define UAC_DCR_RATE 0x02 | ||
131 | #define UAC_DCR_MAXAMPL 0x03 | ||
132 | #define UAC_DCR_THRESHOLD 0x04 | ||
133 | #define UAC_DCR_ATTACK_TIME 0x05 | ||
134 | #define UAC_DCR_RELEASE_TIME 0x06 | ||
135 | |||
136 | /* A.10.4 Extension Unit Control Selectors */ | ||
137 | #define UAC_XU_ENABLE 0x01 | ||
138 | |||
139 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ | ||
140 | #define UAC_MS_HEADER 0x01 | ||
141 | #define UAC_MIDI_IN_JACK 0x02 | ||
142 | #define UAC_MIDI_OUT_JACK 0x03 | ||
143 | |||
144 | /* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */ | ||
145 | #define UAC_MS_GENERAL 0x01 | ||
146 | |||
147 | /* Terminals - 2.1 USB Terminal Types */ | ||
148 | #define UAC_TERMINAL_UNDEFINED 0x100 | ||
149 | #define UAC_TERMINAL_STREAMING 0x101 | ||
150 | #define UAC_TERMINAL_VENDOR_SPEC 0x1FF | ||
151 | |||
152 | /* Terminal Control Selectors */ | ||
153 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | ||
154 | struct uac1_ac_header_descriptor { | ||
155 | __u8 bLength; /* 8 + n */ | ||
156 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
157 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | ||
158 | __le16 bcdADC; /* 0x0100 */ | ||
159 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ | ||
160 | __u8 bInCollection; /* n */ | ||
161 | __u8 baInterfaceNr[]; /* [n] */ | ||
162 | } __attribute__ ((packed)); | ||
163 | |||
164 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) | ||
165 | |||
166 | /* As above, but more useful for defining your own descriptors: */ | ||
167 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | ||
168 | struct uac1_ac_header_descriptor_##n { \ | ||
169 | __u8 bLength; \ | ||
170 | __u8 bDescriptorType; \ | ||
171 | __u8 bDescriptorSubtype; \ | ||
172 | __le16 bcdADC; \ | ||
173 | __le16 wTotalLength; \ | ||
174 | __u8 bInCollection; \ | ||
175 | __u8 baInterfaceNr[n]; \ | ||
176 | } __attribute__ ((packed)) | ||
177 | |||
178 | /* 4.3.2.1 Input Terminal Descriptor */ | ||
179 | struct uac_input_terminal_descriptor { | ||
180 | __u8 bLength; /* in bytes: 12 */ | ||
181 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
182 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | ||
183 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
184 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
185 | __u8 bAssocTerminal; /* ID of the Output Terminal associated */ | ||
186 | __u8 bNrChannels; /* Number of logical output channels */ | ||
187 | __le16 wChannelConfig; | ||
188 | __u8 iChannelNames; | ||
189 | __u8 iTerminal; | ||
190 | } __attribute__ ((packed)); | ||
191 | |||
192 | #define UAC_DT_INPUT_TERMINAL_SIZE 12 | ||
193 | |||
194 | /* Terminals - 2.2 Input Terminal Types */ | ||
195 | #define UAC_INPUT_TERMINAL_UNDEFINED 0x200 | ||
196 | #define UAC_INPUT_TERMINAL_MICROPHONE 0x201 | ||
197 | #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | ||
198 | #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | ||
199 | #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | ||
200 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | ||
201 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
202 | |||
203 | /* Terminals - control selectors */ | ||
204 | |||
205 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | ||
206 | |||
207 | /* 4.3.2.2 Output Terminal Descriptor */ | ||
208 | struct uac1_output_terminal_descriptor { | ||
209 | __u8 bLength; /* in bytes: 9 */ | ||
210 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
211 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | ||
212 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
213 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
214 | __u8 bAssocTerminal; /* ID of the Input Terminal associated */ | ||
215 | __u8 bSourceID; /* ID of the connected Unit or Terminal*/ | ||
216 | __u8 iTerminal; | ||
217 | } __attribute__ ((packed)); | ||
218 | |||
219 | #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 | ||
220 | |||
221 | /* Terminals - 2.3 Output Terminal Types */ | ||
222 | #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 | ||
223 | #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 | ||
224 | #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 | ||
225 | #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | ||
226 | #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | ||
227 | #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | ||
228 | #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | ||
229 | #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
230 | |||
231 | /* Set bControlSize = 2 as default setting */ | ||
232 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | ||
233 | |||
234 | /* As above, but more useful for defining your own descriptors: */ | ||
235 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ | ||
236 | struct uac_feature_unit_descriptor_##ch { \ | ||
237 | __u8 bLength; \ | ||
238 | __u8 bDescriptorType; \ | ||
239 | __u8 bDescriptorSubtype; \ | ||
240 | __u8 bUnitID; \ | ||
241 | __u8 bSourceID; \ | ||
242 | __u8 bControlSize; \ | ||
243 | __le16 bmaControls[ch + 1]; \ | ||
244 | __u8 iFeature; \ | ||
245 | } __attribute__ ((packed)) | ||
246 | |||
247 | /* 4.3.2.3 Mixer Unit Descriptor */ | ||
248 | struct uac_mixer_unit_descriptor { | ||
249 | __u8 bLength; | ||
250 | __u8 bDescriptorType; | ||
251 | __u8 bDescriptorSubtype; | ||
252 | __u8 bUnitID; | ||
253 | __u8 bNrInPins; | ||
254 | __u8 baSourceID[]; | ||
255 | } __attribute__ ((packed)); | ||
256 | 24 | ||
257 | static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc) | ||
258 | { | ||
259 | return desc->baSourceID[desc->bNrInPins]; | ||
260 | } | ||
261 | |||
262 | static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc, | ||
263 | int protocol) | ||
264 | { | ||
265 | if (protocol == UAC_VERSION_1) | ||
266 | return (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
267 | desc->baSourceID[desc->bNrInPins + 1]; | ||
268 | else | ||
269 | return (desc->baSourceID[desc->bNrInPins + 4] << 24) | | ||
270 | (desc->baSourceID[desc->bNrInPins + 3] << 16) | | ||
271 | (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
272 | (desc->baSourceID[desc->bNrInPins + 1]); | ||
273 | } | ||
274 | |||
275 | static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc, | ||
276 | int protocol) | ||
277 | { | ||
278 | return (protocol == UAC_VERSION_1) ? | ||
279 | desc->baSourceID[desc->bNrInPins + 3] : | ||
280 | desc->baSourceID[desc->bNrInPins + 5]; | ||
281 | } | ||
282 | |||
283 | static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc, | ||
284 | int protocol) | ||
285 | { | ||
286 | return (protocol == UAC_VERSION_1) ? | ||
287 | &desc->baSourceID[desc->bNrInPins + 4] : | ||
288 | &desc->baSourceID[desc->bNrInPins + 6]; | ||
289 | } | ||
290 | |||
291 | static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc) | ||
292 | { | ||
293 | __u8 *raw = (__u8 *) desc; | ||
294 | return raw[desc->bLength - 1]; | ||
295 | } | ||
296 | |||
297 | /* 4.3.2.4 Selector Unit Descriptor */ | ||
298 | struct uac_selector_unit_descriptor { | ||
299 | __u8 bLength; | ||
300 | __u8 bDescriptorType; | ||
301 | __u8 bDescriptorSubtype; | ||
302 | __u8 bUintID; | ||
303 | __u8 bNrInPins; | ||
304 | __u8 baSourceID[]; | ||
305 | } __attribute__ ((packed)); | ||
306 | |||
307 | static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc) | ||
308 | { | ||
309 | __u8 *raw = (__u8 *) desc; | ||
310 | return raw[desc->bLength - 1]; | ||
311 | } | ||
312 | |||
313 | /* 4.3.2.5 Feature Unit Descriptor */ | ||
314 | struct uac_feature_unit_descriptor { | ||
315 | __u8 bLength; | ||
316 | __u8 bDescriptorType; | ||
317 | __u8 bDescriptorSubtype; | ||
318 | __u8 bUnitID; | ||
319 | __u8 bSourceID; | ||
320 | __u8 bControlSize; | ||
321 | __u8 bmaControls[0]; /* variable length */ | ||
322 | } __attribute__((packed)); | ||
323 | |||
324 | static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc) | ||
325 | { | ||
326 | __u8 *raw = (__u8 *) desc; | ||
327 | return raw[desc->bLength - 1]; | ||
328 | } | ||
329 | |||
330 | /* 4.3.2.6 Processing Unit Descriptors */ | ||
331 | struct uac_processing_unit_descriptor { | ||
332 | __u8 bLength; | ||
333 | __u8 bDescriptorType; | ||
334 | __u8 bDescriptorSubtype; | ||
335 | __u8 bUnitID; | ||
336 | __u16 wProcessType; | ||
337 | __u8 bNrInPins; | ||
338 | __u8 baSourceID[]; | ||
339 | } __attribute__ ((packed)); | ||
340 | |||
341 | static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc) | ||
342 | { | ||
343 | return desc->baSourceID[desc->bNrInPins]; | ||
344 | } | ||
345 | |||
346 | static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc, | ||
347 | int protocol) | ||
348 | { | ||
349 | if (protocol == UAC_VERSION_1) | ||
350 | return (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
351 | desc->baSourceID[desc->bNrInPins + 1]; | ||
352 | else | ||
353 | return (desc->baSourceID[desc->bNrInPins + 4] << 24) | | ||
354 | (desc->baSourceID[desc->bNrInPins + 3] << 16) | | ||
355 | (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
356 | (desc->baSourceID[desc->bNrInPins + 1]); | ||
357 | } | ||
358 | |||
359 | static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc, | ||
360 | int protocol) | ||
361 | { | ||
362 | return (protocol == UAC_VERSION_1) ? | ||
363 | desc->baSourceID[desc->bNrInPins + 3] : | ||
364 | desc->baSourceID[desc->bNrInPins + 5]; | ||
365 | } | ||
366 | |||
367 | static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc, | ||
368 | int protocol) | ||
369 | { | ||
370 | return (protocol == UAC_VERSION_1) ? | ||
371 | desc->baSourceID[desc->bNrInPins + 4] : | ||
372 | desc->baSourceID[desc->bNrInPins + 6]; | ||
373 | } | ||
374 | |||
375 | static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc, | ||
376 | int protocol) | ||
377 | { | ||
378 | return (protocol == UAC_VERSION_1) ? | ||
379 | &desc->baSourceID[desc->bNrInPins + 5] : | ||
380 | &desc->baSourceID[desc->bNrInPins + 7]; | ||
381 | } | ||
382 | |||
383 | static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc, | ||
384 | int protocol) | ||
385 | { | ||
386 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | ||
387 | return desc->baSourceID[desc->bNrInPins + control_size]; | ||
388 | } | ||
389 | |||
390 | static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc, | ||
391 | int protocol) | ||
392 | { | ||
393 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | ||
394 | return &desc->baSourceID[desc->bNrInPins + control_size + 1]; | ||
395 | } | ||
396 | |||
397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | ||
398 | struct uac1_as_header_descriptor { | ||
399 | __u8 bLength; /* in bytes: 7 */ | ||
400 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
401 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | ||
402 | __u8 bTerminalLink; /* Terminal ID of connected Terminal */ | ||
403 | __u8 bDelay; /* Delay introduced by the data path */ | ||
404 | __le16 wFormatTag; /* The Audio Data Format */ | ||
405 | } __attribute__ ((packed)); | ||
406 | |||
407 | #define UAC_DT_AS_HEADER_SIZE 7 | ||
408 | |||
409 | /* Formats - A.1.1 Audio Data Format Type I Codes */ | ||
410 | #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 | ||
411 | #define UAC_FORMAT_TYPE_I_PCM 0x1 | ||
412 | #define UAC_FORMAT_TYPE_I_PCM8 0x2 | ||
413 | #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | ||
414 | #define UAC_FORMAT_TYPE_I_ALAW 0x4 | ||
415 | #define UAC_FORMAT_TYPE_I_MULAW 0x5 | ||
416 | |||
417 | struct uac_format_type_i_continuous_descriptor { | ||
418 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
419 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
420 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
421 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
422 | __u8 bNrChannels; /* physical channels in the stream */ | ||
423 | __u8 bSubframeSize; /* */ | ||
424 | __u8 bBitResolution; | ||
425 | __u8 bSamFreqType; | ||
426 | __u8 tLowerSamFreq[3]; | ||
427 | __u8 tUpperSamFreq[3]; | ||
428 | } __attribute__ ((packed)); | ||
429 | |||
430 | #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | ||
431 | |||
432 | struct uac_format_type_i_discrete_descriptor { | ||
433 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
434 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
435 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
436 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
437 | __u8 bNrChannels; /* physical channels in the stream */ | ||
438 | __u8 bSubframeSize; /* */ | ||
439 | __u8 bBitResolution; | ||
440 | __u8 bSamFreqType; | ||
441 | __u8 tSamFreq[][3]; | ||
442 | } __attribute__ ((packed)); | ||
443 | |||
444 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | ||
445 | struct uac_format_type_i_discrete_descriptor_##n { \ | ||
446 | __u8 bLength; \ | ||
447 | __u8 bDescriptorType; \ | ||
448 | __u8 bDescriptorSubtype; \ | ||
449 | __u8 bFormatType; \ | ||
450 | __u8 bNrChannels; \ | ||
451 | __u8 bSubframeSize; \ | ||
452 | __u8 bBitResolution; \ | ||
453 | __u8 bSamFreqType; \ | ||
454 | __u8 tSamFreq[n][3]; \ | ||
455 | } __attribute__ ((packed)) | ||
456 | |||
457 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | ||
458 | |||
459 | struct uac_format_type_i_ext_descriptor { | ||
460 | __u8 bLength; | ||
461 | __u8 bDescriptorType; | ||
462 | __u8 bDescriptorSubtype; | ||
463 | __u8 bFormatType; | ||
464 | __u8 bSubslotSize; | ||
465 | __u8 bBitResolution; | ||
466 | __u8 bHeaderLength; | ||
467 | __u8 bControlSize; | ||
468 | __u8 bSideBandProtocol; | ||
469 | } __attribute__((packed)); | ||
470 | |||
471 | /* Formats - Audio Data Format Type I Codes */ | ||
472 | |||
473 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 | ||
474 | #define UAC_FORMAT_TYPE_II_AC3 0x1002 | ||
475 | |||
476 | struct uac_format_type_ii_discrete_descriptor { | ||
477 | __u8 bLength; | ||
478 | __u8 bDescriptorType; | ||
479 | __u8 bDescriptorSubtype; | ||
480 | __u8 bFormatType; | ||
481 | __le16 wMaxBitRate; | ||
482 | __le16 wSamplesPerFrame; | ||
483 | __u8 bSamFreqType; | ||
484 | __u8 tSamFreq[][3]; | ||
485 | } __attribute__((packed)); | ||
486 | |||
487 | struct uac_format_type_ii_ext_descriptor { | ||
488 | __u8 bLength; | ||
489 | __u8 bDescriptorType; | ||
490 | __u8 bDescriptorSubtype; | ||
491 | __u8 bFormatType; | ||
492 | __u16 wMaxBitRate; | ||
493 | __u16 wSamplesPerFrame; | ||
494 | __u8 bHeaderLength; | ||
495 | __u8 bSideBandProtocol; | ||
496 | } __attribute__((packed)); | ||
497 | |||
498 | /* type III */ | ||
499 | #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 | ||
500 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 | ||
501 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 | ||
502 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 | ||
503 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
504 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
505 | |||
506 | /* Formats - A.2 Format Type Codes */ | ||
507 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 | ||
508 | #define UAC_FORMAT_TYPE_I 0x1 | ||
509 | #define UAC_FORMAT_TYPE_II 0x2 | ||
510 | #define UAC_FORMAT_TYPE_III 0x3 | ||
511 | #define UAC_EXT_FORMAT_TYPE_I 0x81 | ||
512 | #define UAC_EXT_FORMAT_TYPE_II 0x82 | ||
513 | #define UAC_EXT_FORMAT_TYPE_III 0x83 | ||
514 | |||
515 | struct uac_iso_endpoint_descriptor { | ||
516 | __u8 bLength; /* in bytes: 7 */ | ||
517 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | ||
518 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | ||
519 | __u8 bmAttributes; | ||
520 | __u8 bLockDelayUnits; | ||
521 | __le16 wLockDelay; | ||
522 | } __attribute__((packed)); | ||
523 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 | ||
524 | |||
525 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 | ||
526 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 | ||
527 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 | ||
528 | |||
529 | /* status word format (3.7.1.1) */ | ||
530 | |||
531 | #define UAC1_STATUS_TYPE_ORIG_MASK 0x0f | ||
532 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0 | ||
533 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1 | ||
534 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2 | ||
535 | |||
536 | #define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7) | ||
537 | #define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6) | ||
538 | |||
539 | struct uac1_status_word { | ||
540 | __u8 bStatusType; | ||
541 | __u8 bOriginator; | ||
542 | } __attribute__((packed)); | ||
543 | |||
544 | #ifdef __KERNEL__ | ||
545 | 25 | ||
546 | struct usb_audio_control { | 26 | struct usb_audio_control { |
547 | struct list_head list; | 27 | struct list_head list; |
@@ -561,6 +41,4 @@ struct usb_audio_control_selector { | |||
561 | struct usb_descriptor_header *desc; | 41 | struct usb_descriptor_header *desc; |
562 | }; | 42 | }; |
563 | 43 | ||
564 | #endif /* __KERNEL__ */ | ||
565 | |||
566 | #endif /* __LINUX_USB_AUDIO_H */ | 44 | #endif /* __LINUX_USB_AUDIO_H */ |
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h new file mode 100644 index 000000000000..3b8f9d4fc3fe --- /dev/null +++ b/include/linux/usb/cdc_ncm.h | |||
@@ -0,0 +1,134 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson 2010-2012 | ||
3 | * Contact: Alexey Orishko <alexey.orishko@stericsson.com> | ||
4 | * Original author: Hans Petter Selasky <hans.petter.selasky@stericsson.com> | ||
5 | * | ||
6 | * USB Host Driver for Network Control Model (NCM) | ||
7 | * http://www.usb.org/developers/devclass_docs/NCM10.zip | ||
8 | * | ||
9 | * The NCM encoding, decoding and initialization logic | ||
10 | * derives from FreeBSD 8.x. if_cdce.c and if_cdcereg.h | ||
11 | * | ||
12 | * This software is available to you under a choice of one of two | ||
13 | * licenses. You may choose this file to be licensed under the terms | ||
14 | * of the GNU General Public License (GPL) Version 2 or the 2-clause | ||
15 | * BSD license listed below: | ||
16 | * | ||
17 | * Redistribution and use in source and binary forms, with or without | ||
18 | * modification, are permitted provided that the following conditions | ||
19 | * are met: | ||
20 | * 1. Redistributions of source code must retain the above copyright | ||
21 | * notice, this list of conditions and the following disclaimer. | ||
22 | * 2. Redistributions in binary form must reproduce the above copyright | ||
23 | * notice, this list of conditions and the following disclaimer in the | ||
24 | * documentation and/or other materials provided with the distribution. | ||
25 | * | ||
26 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
36 | * SUCH DAMAGE. | ||
37 | */ | ||
38 | |||
39 | #define CDC_NCM_COMM_ALTSETTING_NCM 0 | ||
40 | #define CDC_NCM_COMM_ALTSETTING_MBIM 1 | ||
41 | |||
42 | #define CDC_NCM_DATA_ALTSETTING_NCM 1 | ||
43 | #define CDC_NCM_DATA_ALTSETTING_MBIM 2 | ||
44 | |||
45 | /* CDC NCM subclass 3.2.1 */ | ||
46 | #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 | ||
47 | |||
48 | /* Maximum NTB length */ | ||
49 | #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ | ||
50 | #define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ | ||
51 | |||
52 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ | ||
53 | #define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ | ||
54 | |||
55 | /* Minimum value for MaxDatagramSize, ch. 8.1.3 */ | ||
56 | #define CDC_MBIM_MIN_DATAGRAM_SIZE 2048 /* bytes */ | ||
57 | |||
58 | #define CDC_NCM_MIN_TX_PKT 512 /* bytes */ | ||
59 | |||
60 | /* Default value for MaxDatagramSize */ | ||
61 | #define CDC_NCM_MAX_DATAGRAM_SIZE 8192 /* bytes */ | ||
62 | |||
63 | /* | ||
64 | * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting | ||
65 | * the last NULL entry. | ||
66 | */ | ||
67 | #define CDC_NCM_DPT_DATAGRAMS_MAX 40 | ||
68 | |||
69 | /* Restart the timer, if amount of datagrams is less than given value */ | ||
70 | #define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 | ||
71 | #define CDC_NCM_TIMER_PENDING_CNT 2 | ||
72 | #define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC) | ||
73 | |||
74 | /* The following macro defines the minimum header space */ | ||
75 | #define CDC_NCM_MIN_HDR_SIZE \ | ||
76 | (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
77 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
78 | |||
79 | #define CDC_NCM_NDP_SIZE \ | ||
80 | (sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
81 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
82 | |||
83 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ | ||
84 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) | ||
85 | #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) | ||
86 | |||
87 | struct cdc_ncm_ctx { | ||
88 | struct usb_cdc_ncm_ntb_parameters ncm_parm; | ||
89 | struct hrtimer tx_timer; | ||
90 | struct tasklet_struct bh; | ||
91 | |||
92 | const struct usb_cdc_ncm_desc *func_desc; | ||
93 | const struct usb_cdc_mbim_desc *mbim_desc; | ||
94 | const struct usb_cdc_header_desc *header_desc; | ||
95 | const struct usb_cdc_union_desc *union_desc; | ||
96 | const struct usb_cdc_ether_desc *ether_desc; | ||
97 | |||
98 | struct net_device *netdev; | ||
99 | struct usb_device *udev; | ||
100 | struct usb_host_endpoint *in_ep; | ||
101 | struct usb_host_endpoint *out_ep; | ||
102 | struct usb_host_endpoint *status_ep; | ||
103 | struct usb_interface *intf; | ||
104 | struct usb_interface *control; | ||
105 | struct usb_interface *data; | ||
106 | |||
107 | struct sk_buff *tx_curr_skb; | ||
108 | struct sk_buff *tx_rem_skb; | ||
109 | __le32 tx_rem_sign; | ||
110 | |||
111 | spinlock_t mtx; | ||
112 | atomic_t stop; | ||
113 | |||
114 | u32 tx_timer_pending; | ||
115 | u32 tx_curr_frame_num; | ||
116 | u32 rx_speed; | ||
117 | u32 tx_speed; | ||
118 | u32 rx_max; | ||
119 | u32 tx_max; | ||
120 | u32 max_datagram_size; | ||
121 | u16 tx_max_datagrams; | ||
122 | u16 tx_remainder; | ||
123 | u16 tx_modulus; | ||
124 | u16 tx_ndp_modulus; | ||
125 | u16 tx_seq; | ||
126 | u16 rx_seq; | ||
127 | u16 connected; | ||
128 | }; | ||
129 | |||
130 | extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); | ||
131 | extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); | ||
132 | extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); | ||
133 | extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); | ||
134 | extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); | ||
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index d1d732c2838d..9c210f2283df 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -29,887 +29,11 @@ | |||
29 | * someone that the two other points are non-issues for that | 29 | * someone that the two other points are non-issues for that |
30 | * particular descriptor type. | 30 | * particular descriptor type. |
31 | */ | 31 | */ |
32 | |||
33 | #ifndef __LINUX_USB_CH9_H | 32 | #ifndef __LINUX_USB_CH9_H |
34 | #define __LINUX_USB_CH9_H | 33 | #define __LINUX_USB_CH9_H |
35 | 34 | ||
36 | #include <linux/types.h> /* __u8 etc */ | 35 | #include <uapi/linux/usb/ch9.h> |
37 | #include <asm/byteorder.h> /* le16_to_cpu */ | ||
38 | |||
39 | /*-------------------------------------------------------------------------*/ | ||
40 | |||
41 | /* CONTROL REQUEST SUPPORT */ | ||
42 | |||
43 | /* | ||
44 | * USB directions | ||
45 | * | ||
46 | * This bit flag is used in endpoint descriptors' bEndpointAddress field. | ||
47 | * It's also one of three fields in control requests bRequestType. | ||
48 | */ | ||
49 | #define USB_DIR_OUT 0 /* to device */ | ||
50 | #define USB_DIR_IN 0x80 /* to host */ | ||
51 | |||
52 | /* | ||
53 | * USB types, the second of three bRequestType fields | ||
54 | */ | ||
55 | #define USB_TYPE_MASK (0x03 << 5) | ||
56 | #define USB_TYPE_STANDARD (0x00 << 5) | ||
57 | #define USB_TYPE_CLASS (0x01 << 5) | ||
58 | #define USB_TYPE_VENDOR (0x02 << 5) | ||
59 | #define USB_TYPE_RESERVED (0x03 << 5) | ||
60 | |||
61 | /* | ||
62 | * USB recipients, the third of three bRequestType fields | ||
63 | */ | ||
64 | #define USB_RECIP_MASK 0x1f | ||
65 | #define USB_RECIP_DEVICE 0x00 | ||
66 | #define USB_RECIP_INTERFACE 0x01 | ||
67 | #define USB_RECIP_ENDPOINT 0x02 | ||
68 | #define USB_RECIP_OTHER 0x03 | ||
69 | /* From Wireless USB 1.0 */ | ||
70 | #define USB_RECIP_PORT 0x04 | ||
71 | #define USB_RECIP_RPIPE 0x05 | ||
72 | |||
73 | /* | ||
74 | * Standard requests, for the bRequest field of a SETUP packet. | ||
75 | * | ||
76 | * These are qualified by the bRequestType field, so that for example | ||
77 | * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved | ||
78 | * by a GET_STATUS request. | ||
79 | */ | ||
80 | #define USB_REQ_GET_STATUS 0x00 | ||
81 | #define USB_REQ_CLEAR_FEATURE 0x01 | ||
82 | #define USB_REQ_SET_FEATURE 0x03 | ||
83 | #define USB_REQ_SET_ADDRESS 0x05 | ||
84 | #define USB_REQ_GET_DESCRIPTOR 0x06 | ||
85 | #define USB_REQ_SET_DESCRIPTOR 0x07 | ||
86 | #define USB_REQ_GET_CONFIGURATION 0x08 | ||
87 | #define USB_REQ_SET_CONFIGURATION 0x09 | ||
88 | #define USB_REQ_GET_INTERFACE 0x0A | ||
89 | #define USB_REQ_SET_INTERFACE 0x0B | ||
90 | #define USB_REQ_SYNCH_FRAME 0x0C | ||
91 | #define USB_REQ_SET_SEL 0x30 | ||
92 | #define USB_REQ_SET_ISOCH_DELAY 0x31 | ||
93 | |||
94 | #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ | ||
95 | #define USB_REQ_GET_ENCRYPTION 0x0E | ||
96 | #define USB_REQ_RPIPE_ABORT 0x0E | ||
97 | #define USB_REQ_SET_HANDSHAKE 0x0F | ||
98 | #define USB_REQ_RPIPE_RESET 0x0F | ||
99 | #define USB_REQ_GET_HANDSHAKE 0x10 | ||
100 | #define USB_REQ_SET_CONNECTION 0x11 | ||
101 | #define USB_REQ_SET_SECURITY_DATA 0x12 | ||
102 | #define USB_REQ_GET_SECURITY_DATA 0x13 | ||
103 | #define USB_REQ_SET_WUSB_DATA 0x14 | ||
104 | #define USB_REQ_LOOPBACK_DATA_WRITE 0x15 | ||
105 | #define USB_REQ_LOOPBACK_DATA_READ 0x16 | ||
106 | #define USB_REQ_SET_INTERFACE_DS 0x17 | ||
107 | |||
108 | /* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command, | ||
109 | * used by hubs to put ports into a new L1 suspend state, except that it | ||
110 | * forgot to define its number ... | ||
111 | */ | ||
112 | |||
113 | /* | ||
114 | * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and | ||
115 | * are read as a bit array returned by USB_REQ_GET_STATUS. (So there | ||
116 | * are at most sixteen features of each type.) Hubs may also support a | ||
117 | * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend. | ||
118 | */ | ||
119 | #define USB_DEVICE_SELF_POWERED 0 /* (read only) */ | ||
120 | #define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ | ||
121 | #define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */ | ||
122 | #define USB_DEVICE_BATTERY 2 /* (wireless) */ | ||
123 | #define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */ | ||
124 | #define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/ | ||
125 | #define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */ | ||
126 | #define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ | ||
127 | #define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ | ||
128 | |||
129 | /* | ||
130 | * Test Mode Selectors | ||
131 | * See USB 2.0 spec Table 9-7 | ||
132 | */ | ||
133 | #define TEST_J 1 | ||
134 | #define TEST_K 2 | ||
135 | #define TEST_SE0_NAK 3 | ||
136 | #define TEST_PACKET 4 | ||
137 | #define TEST_FORCE_EN 5 | ||
138 | |||
139 | /* | ||
140 | * New Feature Selectors as added by USB 3.0 | ||
141 | * See USB 3.0 spec Table 9-6 | ||
142 | */ | ||
143 | #define USB_DEVICE_U1_ENABLE 48 /* dev may initiate U1 transition */ | ||
144 | #define USB_DEVICE_U2_ENABLE 49 /* dev may initiate U2 transition */ | ||
145 | #define USB_DEVICE_LTM_ENABLE 50 /* dev may send LTM */ | ||
146 | #define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ | ||
147 | |||
148 | #define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 | ||
149 | /* | ||
150 | * Suspend Options, Table 9-7 USB 3.0 spec | ||
151 | */ | ||
152 | #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) | ||
153 | #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) | ||
154 | |||
155 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ | ||
156 | |||
157 | /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */ | ||
158 | #define USB_DEV_STAT_U1_ENABLED 2 /* transition into U1 state */ | ||
159 | #define USB_DEV_STAT_U2_ENABLED 3 /* transition into U2 state */ | ||
160 | #define USB_DEV_STAT_LTM_ENABLED 4 /* Latency tolerance messages */ | ||
161 | |||
162 | /** | ||
163 | * struct usb_ctrlrequest - SETUP data for a USB device control request | ||
164 | * @bRequestType: matches the USB bmRequestType field | ||
165 | * @bRequest: matches the USB bRequest field | ||
166 | * @wValue: matches the USB wValue field (le16 byte order) | ||
167 | * @wIndex: matches the USB wIndex field (le16 byte order) | ||
168 | * @wLength: matches the USB wLength field (le16 byte order) | ||
169 | * | ||
170 | * This structure is used to send control requests to a USB device. It matches | ||
171 | * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the | ||
172 | * USB spec for a fuller description of the different fields, and what they are | ||
173 | * used for. | ||
174 | * | ||
175 | * Note that the driver for any interface can issue control requests. | ||
176 | * For most devices, interfaces don't coordinate with each other, so | ||
177 | * such requests may be made at any time. | ||
178 | */ | ||
179 | struct usb_ctrlrequest { | ||
180 | __u8 bRequestType; | ||
181 | __u8 bRequest; | ||
182 | __le16 wValue; | ||
183 | __le16 wIndex; | ||
184 | __le16 wLength; | ||
185 | } __attribute__ ((packed)); | ||
186 | |||
187 | /*-------------------------------------------------------------------------*/ | ||
188 | |||
189 | /* | ||
190 | * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or | ||
191 | * (rarely) accepted by SET_DESCRIPTOR. | ||
192 | * | ||
193 | * Note that all multi-byte values here are encoded in little endian | ||
194 | * byte order "on the wire". Within the kernel and when exposed | ||
195 | * through the Linux-USB APIs, they are not converted to cpu byte | ||
196 | * order; it is the responsibility of the client code to do this. | ||
197 | * The single exception is when device and configuration descriptors (but | ||
198 | * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD); | ||
199 | * in this case the fields are converted to host endianness by the kernel. | ||
200 | */ | ||
201 | |||
202 | /* | ||
203 | * Descriptor types ... USB 2.0 spec table 9.5 | ||
204 | */ | ||
205 | #define USB_DT_DEVICE 0x01 | ||
206 | #define USB_DT_CONFIG 0x02 | ||
207 | #define USB_DT_STRING 0x03 | ||
208 | #define USB_DT_INTERFACE 0x04 | ||
209 | #define USB_DT_ENDPOINT 0x05 | ||
210 | #define USB_DT_DEVICE_QUALIFIER 0x06 | ||
211 | #define USB_DT_OTHER_SPEED_CONFIG 0x07 | ||
212 | #define USB_DT_INTERFACE_POWER 0x08 | ||
213 | /* these are from a minor usb 2.0 revision (ECN) */ | ||
214 | #define USB_DT_OTG 0x09 | ||
215 | #define USB_DT_DEBUG 0x0a | ||
216 | #define USB_DT_INTERFACE_ASSOCIATION 0x0b | ||
217 | /* these are from the Wireless USB spec */ | ||
218 | #define USB_DT_SECURITY 0x0c | ||
219 | #define USB_DT_KEY 0x0d | ||
220 | #define USB_DT_ENCRYPTION_TYPE 0x0e | ||
221 | #define USB_DT_BOS 0x0f | ||
222 | #define USB_DT_DEVICE_CAPABILITY 0x10 | ||
223 | #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 | ||
224 | #define USB_DT_WIRE_ADAPTER 0x21 | ||
225 | #define USB_DT_RPIPE 0x22 | ||
226 | #define USB_DT_CS_RADIO_CONTROL 0x23 | ||
227 | /* From the T10 UAS specification */ | ||
228 | #define USB_DT_PIPE_USAGE 0x24 | ||
229 | /* From the USB 3.0 spec */ | ||
230 | #define USB_DT_SS_ENDPOINT_COMP 0x30 | ||
231 | |||
232 | /* Conventional codes for class-specific descriptors. The convention is | ||
233 | * defined in the USB "Common Class" Spec (3.11). Individual class specs | ||
234 | * are authoritative for their usage, not the "common class" writeup. | ||
235 | */ | ||
236 | #define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE) | ||
237 | #define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG) | ||
238 | #define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING) | ||
239 | #define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE) | ||
240 | #define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT) | ||
241 | |||
242 | /* All standard descriptors have these 2 fields at the beginning */ | ||
243 | struct usb_descriptor_header { | ||
244 | __u8 bLength; | ||
245 | __u8 bDescriptorType; | ||
246 | } __attribute__ ((packed)); | ||
247 | |||
248 | |||
249 | /*-------------------------------------------------------------------------*/ | ||
250 | |||
251 | /* USB_DT_DEVICE: Device descriptor */ | ||
252 | struct usb_device_descriptor { | ||
253 | __u8 bLength; | ||
254 | __u8 bDescriptorType; | ||
255 | |||
256 | __le16 bcdUSB; | ||
257 | __u8 bDeviceClass; | ||
258 | __u8 bDeviceSubClass; | ||
259 | __u8 bDeviceProtocol; | ||
260 | __u8 bMaxPacketSize0; | ||
261 | __le16 idVendor; | ||
262 | __le16 idProduct; | ||
263 | __le16 bcdDevice; | ||
264 | __u8 iManufacturer; | ||
265 | __u8 iProduct; | ||
266 | __u8 iSerialNumber; | ||
267 | __u8 bNumConfigurations; | ||
268 | } __attribute__ ((packed)); | ||
269 | |||
270 | #define USB_DT_DEVICE_SIZE 18 | ||
271 | |||
272 | |||
273 | /* | ||
274 | * Device and/or Interface Class codes | ||
275 | * as found in bDeviceClass or bInterfaceClass | ||
276 | * and defined by www.usb.org documents | ||
277 | */ | ||
278 | #define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ | ||
279 | #define USB_CLASS_AUDIO 1 | ||
280 | #define USB_CLASS_COMM 2 | ||
281 | #define USB_CLASS_HID 3 | ||
282 | #define USB_CLASS_PHYSICAL 5 | ||
283 | #define USB_CLASS_STILL_IMAGE 6 | ||
284 | #define USB_CLASS_PRINTER 7 | ||
285 | #define USB_CLASS_MASS_STORAGE 8 | ||
286 | #define USB_CLASS_HUB 9 | ||
287 | #define USB_CLASS_CDC_DATA 0x0a | ||
288 | #define USB_CLASS_CSCID 0x0b /* chip+ smart card */ | ||
289 | #define USB_CLASS_CONTENT_SEC 0x0d /* content security */ | ||
290 | #define USB_CLASS_VIDEO 0x0e | ||
291 | #define USB_CLASS_WIRELESS_CONTROLLER 0xe0 | ||
292 | #define USB_CLASS_MISC 0xef | ||
293 | #define USB_CLASS_APP_SPEC 0xfe | ||
294 | #define USB_CLASS_VENDOR_SPEC 0xff | ||
295 | |||
296 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
297 | |||
298 | /*-------------------------------------------------------------------------*/ | ||
299 | |||
300 | /* USB_DT_CONFIG: Configuration descriptor information. | ||
301 | * | ||
302 | * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the | ||
303 | * descriptor type is different. Highspeed-capable devices can look | ||
304 | * different depending on what speed they're currently running. Only | ||
305 | * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG | ||
306 | * descriptors. | ||
307 | */ | ||
308 | struct usb_config_descriptor { | ||
309 | __u8 bLength; | ||
310 | __u8 bDescriptorType; | ||
311 | |||
312 | __le16 wTotalLength; | ||
313 | __u8 bNumInterfaces; | ||
314 | __u8 bConfigurationValue; | ||
315 | __u8 iConfiguration; | ||
316 | __u8 bmAttributes; | ||
317 | __u8 bMaxPower; | ||
318 | } __attribute__ ((packed)); | ||
319 | |||
320 | #define USB_DT_CONFIG_SIZE 9 | ||
321 | |||
322 | /* from config descriptor bmAttributes */ | ||
323 | #define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */ | ||
324 | #define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */ | ||
325 | #define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */ | ||
326 | #define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */ | ||
327 | |||
328 | /*-------------------------------------------------------------------------*/ | ||
329 | |||
330 | /* USB_DT_STRING: String descriptor */ | ||
331 | struct usb_string_descriptor { | ||
332 | __u8 bLength; | ||
333 | __u8 bDescriptorType; | ||
334 | |||
335 | __le16 wData[1]; /* UTF-16LE encoded */ | ||
336 | } __attribute__ ((packed)); | ||
337 | |||
338 | /* note that "string" zero is special, it holds language codes that | ||
339 | * the device supports, not Unicode characters. | ||
340 | */ | ||
341 | |||
342 | /*-------------------------------------------------------------------------*/ | ||
343 | |||
344 | /* USB_DT_INTERFACE: Interface descriptor */ | ||
345 | struct usb_interface_descriptor { | ||
346 | __u8 bLength; | ||
347 | __u8 bDescriptorType; | ||
348 | |||
349 | __u8 bInterfaceNumber; | ||
350 | __u8 bAlternateSetting; | ||
351 | __u8 bNumEndpoints; | ||
352 | __u8 bInterfaceClass; | ||
353 | __u8 bInterfaceSubClass; | ||
354 | __u8 bInterfaceProtocol; | ||
355 | __u8 iInterface; | ||
356 | } __attribute__ ((packed)); | ||
357 | |||
358 | #define USB_DT_INTERFACE_SIZE 9 | ||
359 | |||
360 | /*-------------------------------------------------------------------------*/ | ||
361 | |||
362 | /* USB_DT_ENDPOINT: Endpoint descriptor */ | ||
363 | struct usb_endpoint_descriptor { | ||
364 | __u8 bLength; | ||
365 | __u8 bDescriptorType; | ||
366 | |||
367 | __u8 bEndpointAddress; | ||
368 | __u8 bmAttributes; | ||
369 | __le16 wMaxPacketSize; | ||
370 | __u8 bInterval; | ||
371 | |||
372 | /* NOTE: these two are _only_ in audio endpoints. */ | ||
373 | /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */ | ||
374 | __u8 bRefresh; | ||
375 | __u8 bSynchAddress; | ||
376 | } __attribute__ ((packed)); | ||
377 | |||
378 | #define USB_DT_ENDPOINT_SIZE 7 | ||
379 | #define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ | ||
380 | |||
381 | |||
382 | /* | ||
383 | * Endpoints | ||
384 | */ | ||
385 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | ||
386 | #define USB_ENDPOINT_DIR_MASK 0x80 | ||
387 | |||
388 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | ||
389 | #define USB_ENDPOINT_XFER_CONTROL 0 | ||
390 | #define USB_ENDPOINT_XFER_ISOC 1 | ||
391 | #define USB_ENDPOINT_XFER_BULK 2 | ||
392 | #define USB_ENDPOINT_XFER_INT 3 | ||
393 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 | ||
394 | |||
395 | /* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */ | ||
396 | #define USB_ENDPOINT_INTRTYPE 0x30 | ||
397 | #define USB_ENDPOINT_INTR_PERIODIC (0 << 4) | ||
398 | #define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4) | ||
399 | |||
400 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
401 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
402 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
403 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
404 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
405 | |||
406 | #define USB_ENDPOINT_USAGE_MASK 0x30 | ||
407 | #define USB_ENDPOINT_USAGE_DATA 0x00 | ||
408 | #define USB_ENDPOINT_USAGE_FEEDBACK 0x10 | ||
409 | #define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20 /* Implicit feedback Data endpoint */ | ||
410 | |||
411 | /*-------------------------------------------------------------------------*/ | ||
412 | |||
413 | /** | ||
414 | * usb_endpoint_num - get the endpoint's number | ||
415 | * @epd: endpoint to be checked | ||
416 | * | ||
417 | * Returns @epd's number: 0 to 15. | ||
418 | */ | ||
419 | static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) | ||
420 | { | ||
421 | return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | ||
422 | } | ||
423 | |||
424 | /** | ||
425 | * usb_endpoint_type - get the endpoint's transfer type | ||
426 | * @epd: endpoint to be checked | ||
427 | * | ||
428 | * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according | ||
429 | * to @epd's transfer type. | ||
430 | */ | ||
431 | static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) | ||
432 | { | ||
433 | return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; | ||
434 | } | ||
435 | |||
436 | /** | ||
437 | * usb_endpoint_dir_in - check if the endpoint has IN direction | ||
438 | * @epd: endpoint to be checked | ||
439 | * | ||
440 | * Returns true if the endpoint is of type IN, otherwise it returns false. | ||
441 | */ | ||
442 | static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) | ||
443 | { | ||
444 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * usb_endpoint_dir_out - check if the endpoint has OUT direction | ||
449 | * @epd: endpoint to be checked | ||
450 | * | ||
451 | * Returns true if the endpoint is of type OUT, otherwise it returns false. | ||
452 | */ | ||
453 | static inline int usb_endpoint_dir_out( | ||
454 | const struct usb_endpoint_descriptor *epd) | ||
455 | { | ||
456 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); | ||
457 | } | ||
458 | |||
459 | /** | ||
460 | * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type | ||
461 | * @epd: endpoint to be checked | ||
462 | * | ||
463 | * Returns true if the endpoint is of type bulk, otherwise it returns false. | ||
464 | */ | ||
465 | static inline int usb_endpoint_xfer_bulk( | ||
466 | const struct usb_endpoint_descriptor *epd) | ||
467 | { | ||
468 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
469 | USB_ENDPOINT_XFER_BULK); | ||
470 | } | ||
471 | |||
472 | /** | ||
473 | * usb_endpoint_xfer_control - check if the endpoint has control transfer type | ||
474 | * @epd: endpoint to be checked | ||
475 | * | ||
476 | * Returns true if the endpoint is of type control, otherwise it returns false. | ||
477 | */ | ||
478 | static inline int usb_endpoint_xfer_control( | ||
479 | const struct usb_endpoint_descriptor *epd) | ||
480 | { | ||
481 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
482 | USB_ENDPOINT_XFER_CONTROL); | ||
483 | } | ||
484 | |||
485 | /** | ||
486 | * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type | ||
487 | * @epd: endpoint to be checked | ||
488 | * | ||
489 | * Returns true if the endpoint is of type interrupt, otherwise it returns | ||
490 | * false. | ||
491 | */ | ||
492 | static inline int usb_endpoint_xfer_int( | ||
493 | const struct usb_endpoint_descriptor *epd) | ||
494 | { | ||
495 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
496 | USB_ENDPOINT_XFER_INT); | ||
497 | } | ||
498 | |||
499 | /** | ||
500 | * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type | ||
501 | * @epd: endpoint to be checked | ||
502 | * | ||
503 | * Returns true if the endpoint is of type isochronous, otherwise it returns | ||
504 | * false. | ||
505 | */ | ||
506 | static inline int usb_endpoint_xfer_isoc( | ||
507 | const struct usb_endpoint_descriptor *epd) | ||
508 | { | ||
509 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
510 | USB_ENDPOINT_XFER_ISOC); | ||
511 | } | ||
512 | |||
513 | /** | ||
514 | * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN | ||
515 | * @epd: endpoint to be checked | ||
516 | * | ||
517 | * Returns true if the endpoint has bulk transfer type and IN direction, | ||
518 | * otherwise it returns false. | ||
519 | */ | ||
520 | static inline int usb_endpoint_is_bulk_in( | ||
521 | const struct usb_endpoint_descriptor *epd) | ||
522 | { | ||
523 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd); | ||
524 | } | ||
525 | |||
526 | /** | ||
527 | * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT | ||
528 | * @epd: endpoint to be checked | ||
529 | * | ||
530 | * Returns true if the endpoint has bulk transfer type and OUT direction, | ||
531 | * otherwise it returns false. | ||
532 | */ | ||
533 | static inline int usb_endpoint_is_bulk_out( | ||
534 | const struct usb_endpoint_descriptor *epd) | ||
535 | { | ||
536 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd); | ||
537 | } | ||
538 | |||
539 | /** | ||
540 | * usb_endpoint_is_int_in - check if the endpoint is interrupt IN | ||
541 | * @epd: endpoint to be checked | ||
542 | * | ||
543 | * Returns true if the endpoint has interrupt transfer type and IN direction, | ||
544 | * otherwise it returns false. | ||
545 | */ | ||
546 | static inline int usb_endpoint_is_int_in( | ||
547 | const struct usb_endpoint_descriptor *epd) | ||
548 | { | ||
549 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); | ||
550 | } | ||
551 | |||
552 | /** | ||
553 | * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT | ||
554 | * @epd: endpoint to be checked | ||
555 | * | ||
556 | * Returns true if the endpoint has interrupt transfer type and OUT direction, | ||
557 | * otherwise it returns false. | ||
558 | */ | ||
559 | static inline int usb_endpoint_is_int_out( | ||
560 | const struct usb_endpoint_descriptor *epd) | ||
561 | { | ||
562 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd); | ||
563 | } | ||
564 | |||
565 | /** | ||
566 | * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN | ||
567 | * @epd: endpoint to be checked | ||
568 | * | ||
569 | * Returns true if the endpoint has isochronous transfer type and IN direction, | ||
570 | * otherwise it returns false. | ||
571 | */ | ||
572 | static inline int usb_endpoint_is_isoc_in( | ||
573 | const struct usb_endpoint_descriptor *epd) | ||
574 | { | ||
575 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd); | ||
576 | } | ||
577 | |||
578 | /** | ||
579 | * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT | ||
580 | * @epd: endpoint to be checked | ||
581 | * | ||
582 | * Returns true if the endpoint has isochronous transfer type and OUT direction, | ||
583 | * otherwise it returns false. | ||
584 | */ | ||
585 | static inline int usb_endpoint_is_isoc_out( | ||
586 | const struct usb_endpoint_descriptor *epd) | ||
587 | { | ||
588 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); | ||
589 | } | ||
590 | |||
591 | /** | ||
592 | * usb_endpoint_maxp - get endpoint's max packet size | ||
593 | * @epd: endpoint to be checked | ||
594 | * | ||
595 | * Returns @epd's max packet | ||
596 | */ | ||
597 | static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) | ||
598 | { | ||
599 | return __le16_to_cpu(epd->wMaxPacketSize); | ||
600 | } | ||
601 | |||
602 | static inline int usb_endpoint_interrupt_type( | ||
603 | const struct usb_endpoint_descriptor *epd) | ||
604 | { | ||
605 | return epd->bmAttributes & USB_ENDPOINT_INTRTYPE; | ||
606 | } | ||
607 | |||
608 | /*-------------------------------------------------------------------------*/ | ||
609 | |||
610 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | ||
611 | struct usb_ss_ep_comp_descriptor { | ||
612 | __u8 bLength; | ||
613 | __u8 bDescriptorType; | ||
614 | |||
615 | __u8 bMaxBurst; | ||
616 | __u8 bmAttributes; | ||
617 | __le16 wBytesPerInterval; | ||
618 | } __attribute__ ((packed)); | ||
619 | |||
620 | #define USB_DT_SS_EP_COMP_SIZE 6 | ||
621 | |||
622 | /* Bits 4:0 of bmAttributes if this is a bulk endpoint */ | ||
623 | static inline int | ||
624 | usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp) | ||
625 | { | ||
626 | int max_streams; | ||
627 | |||
628 | if (!comp) | ||
629 | return 0; | ||
630 | |||
631 | max_streams = comp->bmAttributes & 0x1f; | ||
632 | |||
633 | if (!max_streams) | ||
634 | return 0; | ||
635 | |||
636 | max_streams = 1 << max_streams; | ||
637 | |||
638 | return max_streams; | ||
639 | } | ||
640 | |||
641 | /* Bits 1:0 of bmAttributes if this is an isoc endpoint */ | ||
642 | #define USB_SS_MULT(p) (1 + ((p) & 0x3)) | ||
643 | |||
644 | /*-------------------------------------------------------------------------*/ | ||
645 | |||
646 | /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ | ||
647 | struct usb_qualifier_descriptor { | ||
648 | __u8 bLength; | ||
649 | __u8 bDescriptorType; | ||
650 | |||
651 | __le16 bcdUSB; | ||
652 | __u8 bDeviceClass; | ||
653 | __u8 bDeviceSubClass; | ||
654 | __u8 bDeviceProtocol; | ||
655 | __u8 bMaxPacketSize0; | ||
656 | __u8 bNumConfigurations; | ||
657 | __u8 bRESERVED; | ||
658 | } __attribute__ ((packed)); | ||
659 | |||
660 | |||
661 | /*-------------------------------------------------------------------------*/ | ||
662 | |||
663 | /* USB_DT_OTG (from OTG 1.0a supplement) */ | ||
664 | struct usb_otg_descriptor { | ||
665 | __u8 bLength; | ||
666 | __u8 bDescriptorType; | ||
667 | |||
668 | __u8 bmAttributes; /* support for HNP, SRP, etc */ | ||
669 | } __attribute__ ((packed)); | ||
670 | |||
671 | /* from usb_otg_descriptor.bmAttributes */ | ||
672 | #define USB_OTG_SRP (1 << 0) | ||
673 | #define USB_OTG_HNP (1 << 1) /* swap host/device roles */ | ||
674 | |||
675 | /*-------------------------------------------------------------------------*/ | ||
676 | |||
677 | /* USB_DT_DEBUG: for special highspeed devices, replacing serial console */ | ||
678 | struct usb_debug_descriptor { | ||
679 | __u8 bLength; | ||
680 | __u8 bDescriptorType; | ||
681 | |||
682 | /* bulk endpoints with 8 byte maxpacket */ | ||
683 | __u8 bDebugInEndpoint; | ||
684 | __u8 bDebugOutEndpoint; | ||
685 | } __attribute__((packed)); | ||
686 | |||
687 | /*-------------------------------------------------------------------------*/ | ||
688 | |||
689 | /* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ | ||
690 | struct usb_interface_assoc_descriptor { | ||
691 | __u8 bLength; | ||
692 | __u8 bDescriptorType; | ||
693 | |||
694 | __u8 bFirstInterface; | ||
695 | __u8 bInterfaceCount; | ||
696 | __u8 bFunctionClass; | ||
697 | __u8 bFunctionSubClass; | ||
698 | __u8 bFunctionProtocol; | ||
699 | __u8 iFunction; | ||
700 | } __attribute__ ((packed)); | ||
701 | |||
702 | |||
703 | /*-------------------------------------------------------------------------*/ | ||
704 | |||
705 | /* USB_DT_SECURITY: group of wireless security descriptors, including | ||
706 | * encryption types available for setting up a CC/association. | ||
707 | */ | ||
708 | struct usb_security_descriptor { | ||
709 | __u8 bLength; | ||
710 | __u8 bDescriptorType; | ||
711 | |||
712 | __le16 wTotalLength; | ||
713 | __u8 bNumEncryptionTypes; | ||
714 | } __attribute__((packed)); | ||
715 | |||
716 | /*-------------------------------------------------------------------------*/ | ||
717 | |||
718 | /* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys | ||
719 | * may be retrieved. | ||
720 | */ | ||
721 | struct usb_key_descriptor { | ||
722 | __u8 bLength; | ||
723 | __u8 bDescriptorType; | ||
724 | |||
725 | __u8 tTKID[3]; | ||
726 | __u8 bReserved; | ||
727 | __u8 bKeyData[0]; | ||
728 | } __attribute__((packed)); | ||
729 | |||
730 | /*-------------------------------------------------------------------------*/ | ||
731 | |||
732 | /* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */ | ||
733 | struct usb_encryption_descriptor { | ||
734 | __u8 bLength; | ||
735 | __u8 bDescriptorType; | ||
736 | |||
737 | __u8 bEncryptionType; | ||
738 | #define USB_ENC_TYPE_UNSECURE 0 | ||
739 | #define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */ | ||
740 | #define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */ | ||
741 | #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ | ||
742 | __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ | ||
743 | __u8 bAuthKeyIndex; | ||
744 | } __attribute__((packed)); | ||
745 | |||
746 | |||
747 | /*-------------------------------------------------------------------------*/ | ||
748 | |||
749 | /* USB_DT_BOS: group of device-level capabilities */ | ||
750 | struct usb_bos_descriptor { | ||
751 | __u8 bLength; | ||
752 | __u8 bDescriptorType; | ||
753 | |||
754 | __le16 wTotalLength; | ||
755 | __u8 bNumDeviceCaps; | ||
756 | } __attribute__((packed)); | ||
757 | |||
758 | #define USB_DT_BOS_SIZE 5 | ||
759 | /*-------------------------------------------------------------------------*/ | ||
760 | |||
761 | /* USB_DT_DEVICE_CAPABILITY: grouped with BOS */ | ||
762 | struct usb_dev_cap_header { | ||
763 | __u8 bLength; | ||
764 | __u8 bDescriptorType; | ||
765 | __u8 bDevCapabilityType; | ||
766 | } __attribute__((packed)); | ||
767 | |||
768 | #define USB_CAP_TYPE_WIRELESS_USB 1 | ||
769 | |||
770 | struct usb_wireless_cap_descriptor { /* Ultra Wide Band */ | ||
771 | __u8 bLength; | ||
772 | __u8 bDescriptorType; | ||
773 | __u8 bDevCapabilityType; | ||
774 | |||
775 | __u8 bmAttributes; | ||
776 | #define USB_WIRELESS_P2P_DRD (1 << 1) | ||
777 | #define USB_WIRELESS_BEACON_MASK (3 << 2) | ||
778 | #define USB_WIRELESS_BEACON_SELF (1 << 2) | ||
779 | #define USB_WIRELESS_BEACON_DIRECTED (2 << 2) | ||
780 | #define USB_WIRELESS_BEACON_NONE (3 << 2) | ||
781 | __le16 wPHYRates; /* bit rates, Mbps */ | ||
782 | #define USB_WIRELESS_PHY_53 (1 << 0) /* always set */ | ||
783 | #define USB_WIRELESS_PHY_80 (1 << 1) | ||
784 | #define USB_WIRELESS_PHY_107 (1 << 2) /* always set */ | ||
785 | #define USB_WIRELESS_PHY_160 (1 << 3) | ||
786 | #define USB_WIRELESS_PHY_200 (1 << 4) /* always set */ | ||
787 | #define USB_WIRELESS_PHY_320 (1 << 5) | ||
788 | #define USB_WIRELESS_PHY_400 (1 << 6) | ||
789 | #define USB_WIRELESS_PHY_480 (1 << 7) | ||
790 | __u8 bmTFITXPowerInfo; /* TFI power levels */ | ||
791 | __u8 bmFFITXPowerInfo; /* FFI power levels */ | ||
792 | __le16 bmBandGroup; | ||
793 | __u8 bReserved; | ||
794 | } __attribute__((packed)); | ||
795 | |||
796 | /* USB 2.0 Extension descriptor */ | ||
797 | #define USB_CAP_TYPE_EXT 2 | ||
798 | |||
799 | struct usb_ext_cap_descriptor { /* Link Power Management */ | ||
800 | __u8 bLength; | ||
801 | __u8 bDescriptorType; | ||
802 | __u8 bDevCapabilityType; | ||
803 | __le32 bmAttributes; | ||
804 | #define USB_LPM_SUPPORT (1 << 1) /* supports LPM */ | ||
805 | #define USB_BESL_SUPPORT (1 << 2) /* supports BESL */ | ||
806 | #define USB_BESL_BASELINE_VALID (1 << 3) /* Baseline BESL valid*/ | ||
807 | #define USB_BESL_DEEP_VALID (1 << 4) /* Deep BESL valid */ | ||
808 | #define USB_GET_BESL_BASELINE(p) (((p) & (0xf << 8)) >> 8) | ||
809 | #define USB_GET_BESL_DEEP(p) (((p) & (0xf << 12)) >> 12) | ||
810 | } __attribute__((packed)); | ||
811 | |||
812 | #define USB_DT_USB_EXT_CAP_SIZE 7 | ||
813 | |||
814 | /* | ||
815 | * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB | ||
816 | * specific device level capabilities | ||
817 | */ | ||
818 | #define USB_SS_CAP_TYPE 3 | ||
819 | struct usb_ss_cap_descriptor { /* Link Power Management */ | ||
820 | __u8 bLength; | ||
821 | __u8 bDescriptorType; | ||
822 | __u8 bDevCapabilityType; | ||
823 | __u8 bmAttributes; | ||
824 | #define USB_LTM_SUPPORT (1 << 1) /* supports LTM */ | ||
825 | __le16 wSpeedSupported; | ||
826 | #define USB_LOW_SPEED_OPERATION (1) /* Low speed operation */ | ||
827 | #define USB_FULL_SPEED_OPERATION (1 << 1) /* Full speed operation */ | ||
828 | #define USB_HIGH_SPEED_OPERATION (1 << 2) /* High speed operation */ | ||
829 | #define USB_5GBPS_OPERATION (1 << 3) /* Operation at 5Gbps */ | ||
830 | __u8 bFunctionalitySupport; | ||
831 | __u8 bU1devExitLat; | ||
832 | __le16 bU2DevExitLat; | ||
833 | } __attribute__((packed)); | ||
834 | |||
835 | #define USB_DT_USB_SS_CAP_SIZE 10 | ||
836 | |||
837 | /* | ||
838 | * Container ID Capability descriptor: Defines the instance unique ID used to | ||
839 | * identify the instance across all operating modes | ||
840 | */ | ||
841 | #define CONTAINER_ID_TYPE 4 | ||
842 | struct usb_ss_container_id_descriptor { | ||
843 | __u8 bLength; | ||
844 | __u8 bDescriptorType; | ||
845 | __u8 bDevCapabilityType; | ||
846 | __u8 bReserved; | ||
847 | __u8 ContainerID[16]; /* 128-bit number */ | ||
848 | } __attribute__((packed)); | ||
849 | |||
850 | #define USB_DT_USB_SS_CONTN_ID_SIZE 20 | ||
851 | /*-------------------------------------------------------------------------*/ | ||
852 | |||
853 | /* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with | ||
854 | * each endpoint descriptor for a wireless device | ||
855 | */ | ||
856 | struct usb_wireless_ep_comp_descriptor { | ||
857 | __u8 bLength; | ||
858 | __u8 bDescriptorType; | ||
859 | |||
860 | __u8 bMaxBurst; | ||
861 | __u8 bMaxSequence; | ||
862 | __le16 wMaxStreamDelay; | ||
863 | __le16 wOverTheAirPacketSize; | ||
864 | __u8 bOverTheAirInterval; | ||
865 | __u8 bmCompAttributes; | ||
866 | #define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */ | ||
867 | #define USB_ENDPOINT_SWITCH_NO 0 | ||
868 | #define USB_ENDPOINT_SWITCH_SWITCH 1 | ||
869 | #define USB_ENDPOINT_SWITCH_SCALE 2 | ||
870 | } __attribute__((packed)); | ||
871 | |||
872 | /*-------------------------------------------------------------------------*/ | ||
873 | |||
874 | /* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless | ||
875 | * host and a device for connection set up, mutual authentication, and | ||
876 | * exchanging short lived session keys. The handshake depends on a CC. | ||
877 | */ | ||
878 | struct usb_handshake { | ||
879 | __u8 bMessageNumber; | ||
880 | __u8 bStatus; | ||
881 | __u8 tTKID[3]; | ||
882 | __u8 bReserved; | ||
883 | __u8 CDID[16]; | ||
884 | __u8 nonce[16]; | ||
885 | __u8 MIC[8]; | ||
886 | } __attribute__((packed)); | ||
887 | |||
888 | /*-------------------------------------------------------------------------*/ | ||
889 | |||
890 | /* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC). | ||
891 | * A CC may also be set up using non-wireless secure channels (including | ||
892 | * wired USB!), and some devices may support CCs with multiple hosts. | ||
893 | */ | ||
894 | struct usb_connection_context { | ||
895 | __u8 CHID[16]; /* persistent host id */ | ||
896 | __u8 CDID[16]; /* device id (unique w/in host context) */ | ||
897 | __u8 CK[16]; /* connection key */ | ||
898 | } __attribute__((packed)); | ||
899 | |||
900 | /*-------------------------------------------------------------------------*/ | ||
901 | 36 | ||
902 | /* USB 2.0 defines three speeds, here's how Linux identifies them */ | ||
903 | |||
904 | enum usb_device_speed { | ||
905 | USB_SPEED_UNKNOWN = 0, /* enumerating */ | ||
906 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | ||
907 | USB_SPEED_HIGH, /* usb 2.0 */ | ||
908 | USB_SPEED_WIRELESS, /* wireless (usb 2.5) */ | ||
909 | USB_SPEED_SUPER, /* usb 3.0 */ | ||
910 | }; | ||
911 | |||
912 | #ifdef __KERNEL__ | ||
913 | 37 | ||
914 | /** | 38 | /** |
915 | * usb_speed_string() - Returns human readable-name of the speed. | 39 | * usb_speed_string() - Returns human readable-name of the speed. |
@@ -919,86 +43,4 @@ enum usb_device_speed { | |||
919 | */ | 43 | */ |
920 | extern const char *usb_speed_string(enum usb_device_speed speed); | 44 | extern const char *usb_speed_string(enum usb_device_speed speed); |
921 | 45 | ||
922 | #endif | ||
923 | |||
924 | enum usb_device_state { | ||
925 | /* NOTATTACHED isn't in the USB spec, and this state acts | ||
926 | * the same as ATTACHED ... but it's clearer this way. | ||
927 | */ | ||
928 | USB_STATE_NOTATTACHED = 0, | ||
929 | |||
930 | /* chapter 9 and authentication (wireless) device states */ | ||
931 | USB_STATE_ATTACHED, | ||
932 | USB_STATE_POWERED, /* wired */ | ||
933 | USB_STATE_RECONNECTING, /* auth */ | ||
934 | USB_STATE_UNAUTHENTICATED, /* auth */ | ||
935 | USB_STATE_DEFAULT, /* limited function */ | ||
936 | USB_STATE_ADDRESS, | ||
937 | USB_STATE_CONFIGURED, /* most functions */ | ||
938 | |||
939 | USB_STATE_SUSPENDED | ||
940 | |||
941 | /* NOTE: there are actually four different SUSPENDED | ||
942 | * states, returning to POWERED, DEFAULT, ADDRESS, or | ||
943 | * CONFIGURED respectively when SOF tokens flow again. | ||
944 | * At this level there's no difference between L1 and L2 | ||
945 | * suspend states. (L2 being original USB 1.1 suspend.) | ||
946 | */ | ||
947 | }; | ||
948 | |||
949 | enum usb3_link_state { | ||
950 | USB3_LPM_U0 = 0, | ||
951 | USB3_LPM_U1, | ||
952 | USB3_LPM_U2, | ||
953 | USB3_LPM_U3 | ||
954 | }; | ||
955 | |||
956 | /* | ||
957 | * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1. | ||
958 | * 0xff means the parent hub will accept transitions to U1, but will not | ||
959 | * initiate a transition. | ||
960 | * | ||
961 | * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to | ||
962 | * U1 after that many microseconds. Timeouts of 0x80 to 0xFE are reserved | ||
963 | * values. | ||
964 | * | ||
965 | * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2. | ||
966 | * 0xff means the parent hub will accept transitions to U2, but will not | ||
967 | * initiate a transition. | ||
968 | * | ||
969 | * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to | ||
970 | * U2 after N*256 microseconds. Therefore a U2 timeout value of 0x1 means a U2 | ||
971 | * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means | ||
972 | * 65.024ms. | ||
973 | */ | ||
974 | #define USB3_LPM_DISABLED 0x0 | ||
975 | #define USB3_LPM_U1_MAX_TIMEOUT 0x7F | ||
976 | #define USB3_LPM_U2_MAX_TIMEOUT 0xFE | ||
977 | #define USB3_LPM_DEVICE_INITIATED 0xFF | ||
978 | |||
979 | struct usb_set_sel_req { | ||
980 | __u8 u1_sel; | ||
981 | __u8 u1_pel; | ||
982 | __le16 u2_sel; | ||
983 | __le16 u2_pel; | ||
984 | } __attribute__ ((packed)); | ||
985 | |||
986 | /* | ||
987 | * The Set System Exit Latency control transfer provides one byte each for | ||
988 | * U1 SEL and U1 PEL, so the max exit latency is 0xFF. U2 SEL and U2 PEL each | ||
989 | * are two bytes long. | ||
990 | */ | ||
991 | #define USB3_LPM_MAX_U1_SEL_PEL 0xFF | ||
992 | #define USB3_LPM_MAX_U2_SEL_PEL 0xFFFF | ||
993 | |||
994 | /*-------------------------------------------------------------------------*/ | ||
995 | |||
996 | /* | ||
997 | * As per USB compliance update, a device that is actively drawing | ||
998 | * more than 100mA from USB must report itself as bus-powered in | ||
999 | * the GetStatus(DEVICE) call. | ||
1000 | * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34 | ||
1001 | */ | ||
1002 | #define USB_SELF_POWER_VBUS_MAX_DRAW 100 | ||
1003 | |||
1004 | #endif /* __LINUX_USB_CH9_H */ | 46 | #endif /* __LINUX_USB_CH9_H */ |
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h index a843d0851364..65d0a88dbc67 100644 --- a/include/linux/usb/functionfs.h +++ b/include/linux/usb/functionfs.h | |||
@@ -1,171 +1,8 @@ | |||
1 | #ifndef __LINUX_FUNCTIONFS_H__ | 1 | #ifndef __LINUX_FUNCTIONFS_H__ |
2 | #define __LINUX_FUNCTIONFS_H__ 1 | 2 | #define __LINUX_FUNCTIONFS_H__ 1 |
3 | 3 | ||
4 | #include <uapi/linux/usb/functionfs.h> | ||
4 | 5 | ||
5 | #include <linux/types.h> | ||
6 | #include <linux/ioctl.h> | ||
7 | |||
8 | #include <linux/usb/ch9.h> | ||
9 | |||
10 | |||
11 | enum { | ||
12 | FUNCTIONFS_DESCRIPTORS_MAGIC = 1, | ||
13 | FUNCTIONFS_STRINGS_MAGIC = 2 | ||
14 | }; | ||
15 | |||
16 | |||
17 | #ifndef __KERNEL__ | ||
18 | |||
19 | /* Descriptor of an non-audio endpoint */ | ||
20 | struct usb_endpoint_descriptor_no_audio { | ||
21 | __u8 bLength; | ||
22 | __u8 bDescriptorType; | ||
23 | |||
24 | __u8 bEndpointAddress; | ||
25 | __u8 bmAttributes; | ||
26 | __le16 wMaxPacketSize; | ||
27 | __u8 bInterval; | ||
28 | } __attribute__((packed)); | ||
29 | |||
30 | |||
31 | /* | ||
32 | * All numbers must be in little endian order. | ||
33 | */ | ||
34 | |||
35 | struct usb_functionfs_descs_head { | ||
36 | __le32 magic; | ||
37 | __le32 length; | ||
38 | __le32 fs_count; | ||
39 | __le32 hs_count; | ||
40 | } __attribute__((packed)); | ||
41 | |||
42 | /* | ||
43 | * Descriptors format: | ||
44 | * | ||
45 | * | off | name | type | description | | ||
46 | * |-----+-----------+--------------+--------------------------------------| | ||
47 | * | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC | | ||
48 | * | 4 | length | LE32 | length of the whole data chunk | | ||
49 | * | 8 | fs_count | LE32 | number of full-speed descriptors | | ||
50 | * | 12 | hs_count | LE32 | number of high-speed descriptors | | ||
51 | * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors | | ||
52 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | | ||
53 | * | ||
54 | * descs are just valid USB descriptors and have the following format: | ||
55 | * | ||
56 | * | off | name | type | description | | ||
57 | * |-----+-----------------+------+--------------------------| | ||
58 | * | 0 | bLength | U8 | length of the descriptor | | ||
59 | * | 1 | bDescriptorType | U8 | descriptor type | | ||
60 | * | 2 | payload | | descriptor's payload | | ||
61 | */ | ||
62 | |||
63 | struct usb_functionfs_strings_head { | ||
64 | __le32 magic; | ||
65 | __le32 length; | ||
66 | __le32 str_count; | ||
67 | __le32 lang_count; | ||
68 | } __attribute__((packed)); | ||
69 | |||
70 | /* | ||
71 | * Strings format: | ||
72 | * | ||
73 | * | off | name | type | description | | ||
74 | * |-----+------------+-----------------------+----------------------------| | ||
75 | * | 0 | magic | LE32 | FUNCTIONFS_STRINGS_MAGIC | | ||
76 | * | 4 | length | LE32 | length of the data chunk | | ||
77 | * | 8 | str_count | LE32 | number of strings | | ||
78 | * | 12 | lang_count | LE32 | number of languages | | ||
79 | * | 16 | stringtab | StringTab[lang_count] | table of strings per lang | | ||
80 | * | ||
81 | * For each language there is one stringtab entry (ie. there are lang_count | ||
82 | * stringtab entires). Each StringTab has following format: | ||
83 | * | ||
84 | * | off | name | type | description | | ||
85 | * |-----+---------+-------------------+------------------------------------| | ||
86 | * | 0 | lang | LE16 | language code | | ||
87 | * | 2 | strings | String[str_count] | array of strings in given language | | ||
88 | * | ||
89 | * For each string there is one strings entry (ie. there are str_count | ||
90 | * string entries). Each String is a NUL terminated string encoded in | ||
91 | * UTF-8. | ||
92 | */ | ||
93 | |||
94 | #endif | ||
95 | |||
96 | |||
97 | /* | ||
98 | * Events are delivered on the ep0 file descriptor, when the user mode driver | ||
99 | * reads from this file descriptor after writing the descriptors. Don't | ||
100 | * stop polling this descriptor. | ||
101 | */ | ||
102 | |||
103 | enum usb_functionfs_event_type { | ||
104 | FUNCTIONFS_BIND, | ||
105 | FUNCTIONFS_UNBIND, | ||
106 | |||
107 | FUNCTIONFS_ENABLE, | ||
108 | FUNCTIONFS_DISABLE, | ||
109 | |||
110 | FUNCTIONFS_SETUP, | ||
111 | |||
112 | FUNCTIONFS_SUSPEND, | ||
113 | FUNCTIONFS_RESUME | ||
114 | }; | ||
115 | |||
116 | /* NOTE: this structure must stay the same size and layout on | ||
117 | * both 32-bit and 64-bit kernels. | ||
118 | */ | ||
119 | struct usb_functionfs_event { | ||
120 | union { | ||
121 | /* SETUP: packet; DATA phase i/o precedes next event | ||
122 | *(setup.bmRequestType & USB_DIR_IN) flags direction */ | ||
123 | struct usb_ctrlrequest setup; | ||
124 | } __attribute__((packed)) u; | ||
125 | |||
126 | /* enum usb_functionfs_event_type */ | ||
127 | __u8 type; | ||
128 | __u8 _pad[3]; | ||
129 | } __attribute__((packed)); | ||
130 | |||
131 | |||
132 | /* Endpoint ioctls */ | ||
133 | /* The same as in gadgetfs */ | ||
134 | |||
135 | /* IN transfers may be reported to the gadget driver as complete | ||
136 | * when the fifo is loaded, before the host reads the data; | ||
137 | * OUT transfers may be reported to the host's "client" driver as | ||
138 | * complete when they're sitting in the FIFO unread. | ||
139 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo | ||
140 | * (needed for precise fault handling, when the hardware allows it) | ||
141 | */ | ||
142 | #define FUNCTIONFS_FIFO_STATUS _IO('g', 1) | ||
143 | |||
144 | /* discards any unclaimed data in the fifo. */ | ||
145 | #define FUNCTIONFS_FIFO_FLUSH _IO('g', 2) | ||
146 | |||
147 | /* resets endpoint halt+toggle; used to implement set_interface. | ||
148 | * some hardware (like pxa2xx) can't support this. | ||
149 | */ | ||
150 | #define FUNCTIONFS_CLEAR_HALT _IO('g', 3) | ||
151 | |||
152 | /* Specific for functionfs */ | ||
153 | |||
154 | /* | ||
155 | * Returns reverse mapping of an interface. Called on EP0. If there | ||
156 | * is no such interface returns -EDOM. If function is not active | ||
157 | * returns -ENODEV. | ||
158 | */ | ||
159 | #define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128) | ||
160 | |||
161 | /* | ||
162 | * Returns real bEndpointAddress of an endpoint. If function is not | ||
163 | * active returns -ENODEV. | ||
164 | */ | ||
165 | #define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129) | ||
166 | |||
167 | |||
168 | #ifdef __KERNEL__ | ||
169 | 6 | ||
170 | struct ffs_data; | 7 | struct ffs_data; |
171 | struct usb_composite_dev; | 8 | struct usb_composite_dev; |
@@ -197,5 +34,3 @@ static void functionfs_release_dev_callback(struct ffs_data *ffs_data) | |||
197 | 34 | ||
198 | 35 | ||
199 | #endif | 36 | #endif |
200 | |||
201 | #endif | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index ddbbb7de894b..9bbeabf66c54 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -163,6 +163,16 @@ extern int usbnet_resume(struct usb_interface *); | |||
163 | extern void usbnet_disconnect(struct usb_interface *); | 163 | extern void usbnet_disconnect(struct usb_interface *); |
164 | extern void usbnet_device_suggests_idle(struct usbnet *dev); | 164 | extern void usbnet_device_suggests_idle(struct usbnet *dev); |
165 | 165 | ||
166 | extern int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
167 | u16 value, u16 index, void *data, u16 size); | ||
168 | extern int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
169 | u16 value, u16 index, const void *data, u16 size); | ||
170 | extern int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
171 | u16 value, u16 index, void *data, u16 size); | ||
172 | extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
173 | u16 value, u16 index, const void *data, u16 size); | ||
174 | extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
175 | u16 value, u16 index, const void *data, u16 size); | ||
166 | 176 | ||
167 | /* Drivers that reuse some of the standard USB CDC infrastructure | 177 | /* Drivers that reuse some of the standard USB CDC infrastructure |
168 | * (notably, using multiple interfaces according to the CDC | 178 | * (notably, using multiple interfaces according to the CDC |
diff --git a/include/linux/wimax/Kbuild b/include/linux/wimax/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/linux/wimax/Kbuild +++ /dev/null | |||
diff --git a/include/media/adv7604.h b/include/media/adv7604.h index 171b957db743..dc004bc926c9 100644 --- a/include/media/adv7604.h +++ b/include/media/adv7604.h | |||
@@ -40,14 +40,6 @@ enum adv7604_op_ch_sel { | |||
40 | ADV7604_OP_CH_SEL_RBG = 5, | 40 | ADV7604_OP_CH_SEL_RBG = 5, |
41 | }; | 41 | }; |
42 | 42 | ||
43 | /* Primary mode (IO register 0x01, [3:0]) */ | ||
44 | enum adv7604_prim_mode { | ||
45 | ADV7604_PRIM_MODE_COMP = 1, | ||
46 | ADV7604_PRIM_MODE_RGB = 2, | ||
47 | ADV7604_PRIM_MODE_HDMI_COMP = 5, | ||
48 | ADV7604_PRIM_MODE_HDMI_GR = 6, | ||
49 | }; | ||
50 | |||
51 | /* Input Color Space (IO register 0x02, [7:4]) */ | 43 | /* Input Color Space (IO register 0x02, [7:4]) */ |
52 | enum adv7604_inp_color_space { | 44 | enum adv7604_inp_color_space { |
53 | ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, | 45 | ADV7604_INP_COLOR_SPACE_LIM_RGB = 0, |
@@ -103,9 +95,6 @@ struct adv7604_platform_data { | |||
103 | /* Bus rotation and reordering */ | 95 | /* Bus rotation and reordering */ |
104 | enum adv7604_op_ch_sel op_ch_sel; | 96 | enum adv7604_op_ch_sel op_ch_sel; |
105 | 97 | ||
106 | /* Primary mode */ | ||
107 | enum adv7604_prim_mode prim_mode; | ||
108 | |||
109 | /* Select output format */ | 98 | /* Select output format */ |
110 | enum adv7604_op_format_sel op_format_sel; | 99 | enum adv7604_op_format_sel op_format_sel; |
111 | 100 | ||
@@ -142,6 +131,16 @@ struct adv7604_platform_data { | |||
142 | u8 i2c_vdp; | 131 | u8 i2c_vdp; |
143 | }; | 132 | }; |
144 | 133 | ||
134 | /* | ||
135 | * Mode of operation. | ||
136 | * This is used as the input argument of the s_routing video op. | ||
137 | */ | ||
138 | enum adv7604_mode { | ||
139 | ADV7604_MODE_COMP, | ||
140 | ADV7604_MODE_GR, | ||
141 | ADV7604_MODE_HDMI, | ||
142 | }; | ||
143 | |||
145 | #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) | 144 | #define V4L2_CID_ADV_RX_ANALOG_SAMPLING_PHASE (V4L2_CID_DV_CLASS_BASE + 0x1000) |
146 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) | 145 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR_MANUAL (V4L2_CID_DV_CLASS_BASE + 0x1001) |
147 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) | 146 | #define V4L2_CID_ADV_RX_FREE_RUN_COLOR (V4L2_CID_DV_CLASS_BASE + 0x1002) |
diff --git a/include/mtd/Kbuild b/include/mtd/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/mtd/Kbuild +++ /dev/null | |||
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index b5f8988e4283..0a996a3517ed 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -53,7 +53,6 @@ struct unix_sock { | |||
53 | struct path path; | 53 | struct path path; |
54 | struct mutex readlock; | 54 | struct mutex readlock; |
55 | struct sock *peer; | 55 | struct sock *peer; |
56 | struct sock *other; | ||
57 | struct list_head link; | 56 | struct list_head link; |
58 | atomic_long_t inflight; | 57 | atomic_long_t inflight; |
59 | spinlock_t lock; | 58 | spinlock_t lock; |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h index 6a76e0a0705e..42f21766c538 100644 --- a/include/net/bluetooth/a2mp.h +++ b/include/net/bluetooth/a2mp.h | |||
@@ -19,13 +19,25 @@ | |||
19 | 19 | ||
20 | #define A2MP_FEAT_EXT 0x8000 | 20 | #define A2MP_FEAT_EXT 0x8000 |
21 | 21 | ||
22 | enum amp_mgr_state { | ||
23 | READ_LOC_AMP_INFO, | ||
24 | READ_LOC_AMP_ASSOC, | ||
25 | READ_LOC_AMP_ASSOC_FINAL, | ||
26 | }; | ||
27 | |||
22 | struct amp_mgr { | 28 | struct amp_mgr { |
29 | struct list_head list; | ||
23 | struct l2cap_conn *l2cap_conn; | 30 | struct l2cap_conn *l2cap_conn; |
24 | struct l2cap_chan *a2mp_chan; | 31 | struct l2cap_chan *a2mp_chan; |
32 | struct l2cap_chan *bredr_chan; | ||
25 | struct kref kref; | 33 | struct kref kref; |
26 | __u8 ident; | 34 | __u8 ident; |
27 | __u8 handle; | 35 | __u8 handle; |
36 | enum amp_mgr_state state; | ||
28 | unsigned long flags; | 37 | unsigned long flags; |
38 | |||
39 | struct list_head amp_ctrls; | ||
40 | struct mutex amp_ctrls_lock; | ||
29 | }; | 41 | }; |
30 | 42 | ||
31 | struct a2mp_cmd { | 43 | struct a2mp_cmd { |
@@ -118,9 +130,19 @@ struct a2mp_physlink_rsp { | |||
118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | 130 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 |
119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | 131 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 |
120 | 132 | ||
121 | void amp_mgr_get(struct amp_mgr *mgr); | 133 | extern struct list_head amp_mgr_list; |
134 | extern struct mutex amp_mgr_list_lock; | ||
135 | |||
136 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); | ||
122 | int amp_mgr_put(struct amp_mgr *mgr); | 137 | int amp_mgr_put(struct amp_mgr *mgr); |
138 | u8 __next_ident(struct amp_mgr *mgr); | ||
123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | 139 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, |
124 | struct sk_buff *skb); | 140 | struct sk_buff *skb); |
141 | struct amp_mgr *amp_mgr_lookup_by_state(u8 state); | ||
142 | void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data); | ||
143 | void a2mp_discover_amp(struct l2cap_chan *chan); | ||
144 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | ||
145 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | ||
146 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | ||
125 | 147 | ||
126 | #endif /* __A2MP_H */ | 148 | #endif /* __A2MP_H */ |
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h new file mode 100644 index 000000000000..7ea3db77ba89 --- /dev/null +++ b/include/net/bluetooth/amp.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | Copyright (c) 2011,2012 Intel Corp. | ||
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 and | ||
6 | only version 2 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 | |||
14 | #ifndef __AMP_H | ||
15 | #define __AMP_H | ||
16 | |||
17 | struct amp_ctrl { | ||
18 | struct list_head list; | ||
19 | struct kref kref; | ||
20 | __u8 id; | ||
21 | __u16 assoc_len_so_far; | ||
22 | __u16 assoc_rem_len; | ||
23 | __u16 assoc_len; | ||
24 | __u8 *assoc; | ||
25 | }; | ||
26 | |||
27 | int amp_ctrl_put(struct amp_ctrl *ctrl); | ||
28 | void amp_ctrl_get(struct amp_ctrl *ctrl); | ||
29 | struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); | ||
30 | struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); | ||
31 | void amp_ctrl_list_flush(struct amp_mgr *mgr); | ||
32 | |||
33 | struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
34 | u8 remote_id, bool out); | ||
35 | |||
36 | int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); | ||
37 | |||
38 | void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
39 | void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); | ||
40 | void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
41 | void amp_read_loc_assoc_final_data(struct hci_dev *hdev, | ||
42 | struct hci_conn *hcon); | ||
43 | void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
44 | struct hci_conn *hcon); | ||
45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
46 | struct hci_conn *hcon); | ||
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | ||
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | ||
49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | ||
50 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
51 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
52 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
53 | |||
54 | #endif /* __AMP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index ede036977ae8..2554b3f5222a 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -180,7 +180,6 @@ static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) | |||
180 | } | 180 | } |
181 | 181 | ||
182 | void baswap(bdaddr_t *dst, bdaddr_t *src); | 182 | void baswap(bdaddr_t *dst, bdaddr_t *src); |
183 | char *batostr(bdaddr_t *ba); | ||
184 | 183 | ||
185 | /* Common socket structures and functions */ | 184 | /* Common socket structures and functions */ |
186 | 185 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 76b2b6bdcf36..45eee08157bb 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #define HCI_LINK_KEY_SIZE 16 | 33 | #define HCI_LINK_KEY_SIZE 16 |
34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | 34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) |
35 | 35 | ||
36 | #define HCI_MAX_AMP_ASSOC_SIZE 672 | ||
37 | |||
36 | /* HCI dev events */ | 38 | /* HCI dev events */ |
37 | #define HCI_DEV_REG 1 | 39 | #define HCI_DEV_REG 1 |
38 | #define HCI_DEV_UNREG 2 | 40 | #define HCI_DEV_UNREG 2 |
@@ -113,6 +115,7 @@ enum { | |||
113 | HCI_SSP_ENABLED, | 115 | HCI_SSP_ENABLED, |
114 | HCI_HS_ENABLED, | 116 | HCI_HS_ENABLED, |
115 | HCI_LE_ENABLED, | 117 | HCI_LE_ENABLED, |
118 | HCI_LE_PERIPHERAL, | ||
116 | HCI_CONNECTABLE, | 119 | HCI_CONNECTABLE, |
117 | HCI_DISCOVERABLE, | 120 | HCI_DISCOVERABLE, |
118 | HCI_LINK_SECURITY, | 121 | HCI_LINK_SECURITY, |
@@ -151,7 +154,7 @@ enum { | |||
151 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 154 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
152 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ | 155 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
153 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ | 156 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
154 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ | 157 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
155 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ | 158 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
156 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 159 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
157 | 160 | ||
@@ -196,6 +199,7 @@ enum { | |||
196 | #define ACL_START_NO_FLUSH 0x00 | 199 | #define ACL_START_NO_FLUSH 0x00 |
197 | #define ACL_CONT 0x01 | 200 | #define ACL_CONT 0x01 |
198 | #define ACL_START 0x02 | 201 | #define ACL_START 0x02 |
202 | #define ACL_COMPLETE 0x03 | ||
199 | #define ACL_ACTIVE_BCAST 0x04 | 203 | #define ACL_ACTIVE_BCAST 0x04 |
200 | #define ACL_PICO_BCAST 0x08 | 204 | #define ACL_PICO_BCAST 0x08 |
201 | 205 | ||
@@ -205,6 +209,7 @@ enum { | |||
205 | #define ESCO_LINK 0x02 | 209 | #define ESCO_LINK 0x02 |
206 | /* Low Energy links do not have defined link type. Use invented one */ | 210 | /* Low Energy links do not have defined link type. Use invented one */ |
207 | #define LE_LINK 0x80 | 211 | #define LE_LINK 0x80 |
212 | #define AMP_LINK 0x81 | ||
208 | 213 | ||
209 | /* LMP features */ | 214 | /* LMP features */ |
210 | #define LMP_3SLOT 0x01 | 215 | #define LMP_3SLOT 0x01 |
@@ -314,6 +319,9 @@ enum { | |||
314 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 | 319 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 |
315 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 | 320 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 |
316 | 321 | ||
322 | /* The core spec defines 127 as the "not available" value */ | ||
323 | #define HCI_TX_POWER_INVALID 127 | ||
324 | |||
317 | /* Extended Inquiry Response field types */ | 325 | /* Extended Inquiry Response field types */ |
318 | #define EIR_FLAGS 0x01 /* flags */ | 326 | #define EIR_FLAGS 0x01 /* flags */ |
319 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ | 327 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
@@ -330,6 +338,13 @@ enum { | |||
330 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ | 338 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ |
331 | #define EIR_DEVICE_ID 0x10 /* device ID */ | 339 | #define EIR_DEVICE_ID 0x10 /* device ID */ |
332 | 340 | ||
341 | /* Low Energy Advertising Flags */ | ||
342 | #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ | ||
343 | #define LE_AD_GENERAL 0x02 /* General Discoverable */ | ||
344 | #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ | ||
345 | #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ | ||
346 | #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ | ||
347 | |||
333 | /* ----- HCI Commands ---- */ | 348 | /* ----- HCI Commands ---- */ |
334 | #define HCI_OP_NOP 0x0000 | 349 | #define HCI_OP_NOP 0x0000 |
335 | 350 | ||
@@ -556,12 +571,46 @@ struct hci_cp_accept_phy_link { | |||
556 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | 571 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; |
557 | } __packed; | 572 | } __packed; |
558 | 573 | ||
559 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | 574 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 |
560 | struct hci_cp_disconn_phy_link { | 575 | struct hci_cp_disconn_phy_link { |
561 | __u8 phy_handle; | 576 | __u8 phy_handle; |
562 | __u8 reason; | 577 | __u8 reason; |
563 | } __packed; | 578 | } __packed; |
564 | 579 | ||
580 | struct ext_flow_spec { | ||
581 | __u8 id; | ||
582 | __u8 stype; | ||
583 | __le16 msdu; | ||
584 | __le32 sdu_itime; | ||
585 | __le32 acc_lat; | ||
586 | __le32 flush_to; | ||
587 | } __packed; | ||
588 | |||
589 | #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 | ||
590 | #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 | ||
591 | struct hci_cp_create_accept_logical_link { | ||
592 | __u8 phy_handle; | ||
593 | struct ext_flow_spec tx_flow_spec; | ||
594 | struct ext_flow_spec rx_flow_spec; | ||
595 | } __packed; | ||
596 | |||
597 | #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a | ||
598 | struct hci_cp_disconn_logical_link { | ||
599 | __le16 log_handle; | ||
600 | } __packed; | ||
601 | |||
602 | #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b | ||
603 | struct hci_cp_logical_link_cancel { | ||
604 | __u8 phy_handle; | ||
605 | __u8 flow_spec_id; | ||
606 | } __packed; | ||
607 | |||
608 | struct hci_rp_logical_link_cancel { | ||
609 | __u8 status; | ||
610 | __u8 phy_handle; | ||
611 | __u8 flow_spec_id; | ||
612 | } __packed; | ||
613 | |||
565 | #define HCI_OP_SNIFF_MODE 0x0803 | 614 | #define HCI_OP_SNIFF_MODE 0x0803 |
566 | struct hci_cp_sniff_mode { | 615 | struct hci_cp_sniff_mode { |
567 | __le16 handle; | 616 | __le16 handle; |
@@ -894,6 +943,22 @@ struct hci_rp_le_read_buffer_size { | |||
894 | __u8 le_max_pkt; | 943 | __u8 le_max_pkt; |
895 | } __packed; | 944 | } __packed; |
896 | 945 | ||
946 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | ||
947 | struct hci_rp_le_read_adv_tx_power { | ||
948 | __u8 status; | ||
949 | __s8 tx_power; | ||
950 | } __packed; | ||
951 | |||
952 | #define HCI_MAX_AD_LENGTH 31 | ||
953 | |||
954 | #define HCI_OP_LE_SET_ADV_DATA 0x2008 | ||
955 | struct hci_cp_le_set_adv_data { | ||
956 | __u8 length; | ||
957 | __u8 data[HCI_MAX_AD_LENGTH]; | ||
958 | } __packed; | ||
959 | |||
960 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a | ||
961 | |||
897 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 962 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
898 | struct hci_cp_le_set_scan_param { | 963 | struct hci_cp_le_set_scan_param { |
899 | __u8 type; | 964 | __u8 type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e7d454609881..ef5b85dac3f7 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -73,6 +73,7 @@ struct discovery_state { | |||
73 | struct hci_conn_hash { | 73 | struct hci_conn_hash { |
74 | struct list_head list; | 74 | struct list_head list; |
75 | unsigned int acl_num; | 75 | unsigned int acl_num; |
76 | unsigned int amp_num; | ||
76 | unsigned int sco_num; | 77 | unsigned int sco_num; |
77 | unsigned int le_num; | 78 | unsigned int le_num; |
78 | }; | 79 | }; |
@@ -124,6 +125,14 @@ struct le_scan_params { | |||
124 | 125 | ||
125 | #define HCI_MAX_SHORT_NAME_LENGTH 10 | 126 | #define HCI_MAX_SHORT_NAME_LENGTH 10 |
126 | 127 | ||
128 | struct amp_assoc { | ||
129 | __u16 len; | ||
130 | __u16 offset; | ||
131 | __u16 rem_len; | ||
132 | __u16 len_so_far; | ||
133 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; | ||
134 | }; | ||
135 | |||
127 | #define NUM_REASSEMBLY 4 | 136 | #define NUM_REASSEMBLY 4 |
128 | struct hci_dev { | 137 | struct hci_dev { |
129 | struct list_head list; | 138 | struct list_head list; |
@@ -177,6 +186,8 @@ struct hci_dev { | |||
177 | __u32 amp_max_flush_to; | 186 | __u32 amp_max_flush_to; |
178 | __u32 amp_be_flush_to; | 187 | __u32 amp_be_flush_to; |
179 | 188 | ||
189 | struct amp_assoc loc_assoc; | ||
190 | |||
180 | __u8 flow_ctl_mode; | 191 | __u8 flow_ctl_mode; |
181 | 192 | ||
182 | unsigned int auto_accept_delay; | 193 | unsigned int auto_accept_delay; |
@@ -252,8 +263,6 @@ struct hci_dev { | |||
252 | 263 | ||
253 | struct sk_buff_head driver_init; | 264 | struct sk_buff_head driver_init; |
254 | 265 | ||
255 | void *core_data; | ||
256 | |||
257 | atomic_t promisc; | 266 | atomic_t promisc; |
258 | 267 | ||
259 | struct dentry *debugfs; | 268 | struct dentry *debugfs; |
@@ -269,6 +278,10 @@ struct hci_dev { | |||
269 | struct work_struct le_scan; | 278 | struct work_struct le_scan; |
270 | struct le_scan_params le_scan_params; | 279 | struct le_scan_params le_scan_params; |
271 | 280 | ||
281 | __s8 adv_tx_power; | ||
282 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | ||
283 | __u8 adv_data_len; | ||
284 | |||
272 | int (*open)(struct hci_dev *hdev); | 285 | int (*open)(struct hci_dev *hdev); |
273 | int (*close)(struct hci_dev *hdev); | 286 | int (*close)(struct hci_dev *hdev); |
274 | int (*flush)(struct hci_dev *hdev); | 287 | int (*flush)(struct hci_dev *hdev); |
@@ -277,6 +290,8 @@ struct hci_dev { | |||
277 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); | 290 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); |
278 | }; | 291 | }; |
279 | 292 | ||
293 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) | ||
294 | |||
280 | struct hci_conn { | 295 | struct hci_conn { |
281 | struct list_head list; | 296 | struct list_head list; |
282 | 297 | ||
@@ -310,6 +325,7 @@ struct hci_conn { | |||
310 | 325 | ||
311 | __u8 remote_cap; | 326 | __u8 remote_cap; |
312 | __u8 remote_auth; | 327 | __u8 remote_auth; |
328 | __u8 remote_id; | ||
313 | bool flush_key; | 329 | bool flush_key; |
314 | 330 | ||
315 | unsigned int sent; | 331 | unsigned int sent; |
@@ -339,10 +355,11 @@ struct hci_conn { | |||
339 | 355 | ||
340 | struct hci_chan { | 356 | struct hci_chan { |
341 | struct list_head list; | 357 | struct list_head list; |
342 | 358 | __u16 handle; | |
343 | struct hci_conn *conn; | 359 | struct hci_conn *conn; |
344 | struct sk_buff_head data_q; | 360 | struct sk_buff_head data_q; |
345 | unsigned int sent; | 361 | unsigned int sent; |
362 | __u8 state; | ||
346 | }; | 363 | }; |
347 | 364 | ||
348 | extern struct list_head hci_dev_list; | 365 | extern struct list_head hci_dev_list; |
@@ -438,6 +455,9 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) | |||
438 | case ACL_LINK: | 455 | case ACL_LINK: |
439 | h->acl_num++; | 456 | h->acl_num++; |
440 | break; | 457 | break; |
458 | case AMP_LINK: | ||
459 | h->amp_num++; | ||
460 | break; | ||
441 | case LE_LINK: | 461 | case LE_LINK: |
442 | h->le_num++; | 462 | h->le_num++; |
443 | break; | 463 | break; |
@@ -459,6 +479,9 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) | |||
459 | case ACL_LINK: | 479 | case ACL_LINK: |
460 | h->acl_num--; | 480 | h->acl_num--; |
461 | break; | 481 | break; |
482 | case AMP_LINK: | ||
483 | h->amp_num--; | ||
484 | break; | ||
462 | case LE_LINK: | 485 | case LE_LINK: |
463 | h->le_num--; | 486 | h->le_num--; |
464 | break; | 487 | break; |
@@ -475,6 +498,8 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) | |||
475 | switch (type) { | 498 | switch (type) { |
476 | case ACL_LINK: | 499 | case ACL_LINK: |
477 | return h->acl_num; | 500 | return h->acl_num; |
501 | case AMP_LINK: | ||
502 | return h->amp_num; | ||
478 | case LE_LINK: | 503 | case LE_LINK: |
479 | return h->le_num; | 504 | return h->le_num; |
480 | case SCO_LINK: | 505 | case SCO_LINK: |
@@ -556,6 +581,7 @@ void hci_conn_check_pending(struct hci_dev *hdev); | |||
556 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 581 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
557 | void hci_chan_del(struct hci_chan *chan); | 582 | void hci_chan_del(struct hci_chan *chan); |
558 | void hci_chan_list_flush(struct hci_conn *conn); | 583 | void hci_chan_list_flush(struct hci_conn *conn); |
584 | struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); | ||
559 | 585 | ||
560 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 586 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
561 | __u8 dst_type, __u8 sec_level, __u8 auth_type); | 587 | __u8 dst_type, __u8 sec_level, __u8 auth_type); |
@@ -584,7 +610,10 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
584 | 610 | ||
585 | if (atomic_dec_and_test(&conn->refcnt)) { | 611 | if (atomic_dec_and_test(&conn->refcnt)) { |
586 | unsigned long timeo; | 612 | unsigned long timeo; |
587 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { | 613 | |
614 | switch (conn->type) { | ||
615 | case ACL_LINK: | ||
616 | case LE_LINK: | ||
588 | del_timer(&conn->idle_timer); | 617 | del_timer(&conn->idle_timer); |
589 | if (conn->state == BT_CONNECTED) { | 618 | if (conn->state == BT_CONNECTED) { |
590 | timeo = conn->disc_timeout; | 619 | timeo = conn->disc_timeout; |
@@ -593,12 +622,20 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
593 | } else { | 622 | } else { |
594 | timeo = msecs_to_jiffies(10); | 623 | timeo = msecs_to_jiffies(10); |
595 | } | 624 | } |
596 | } else { | 625 | break; |
626 | |||
627 | case AMP_LINK: | ||
628 | timeo = conn->disc_timeout; | ||
629 | break; | ||
630 | |||
631 | default: | ||
597 | timeo = msecs_to_jiffies(10); | 632 | timeo = msecs_to_jiffies(10); |
633 | break; | ||
598 | } | 634 | } |
635 | |||
599 | cancel_delayed_work(&conn->disc_work); | 636 | cancel_delayed_work(&conn->disc_work); |
600 | queue_delayed_work(conn->hdev->workqueue, | 637 | queue_delayed_work(conn->hdev->workqueue, |
601 | &conn->disc_work, timeo); | 638 | &conn->disc_work, timeo); |
602 | } | 639 | } |
603 | } | 640 | } |
604 | 641 | ||
@@ -650,7 +687,7 @@ static inline uint8_t __hci_num_ctrl(void) | |||
650 | } | 687 | } |
651 | 688 | ||
652 | struct hci_dev *hci_dev_get(int index); | 689 | struct hci_dev *hci_dev_get(int index); |
653 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 690 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); |
654 | 691 | ||
655 | struct hci_dev *hci_alloc_dev(void); | 692 | struct hci_dev *hci_alloc_dev(void); |
656 | void hci_free_dev(struct hci_dev *hdev); | 693 | void hci_free_dev(struct hci_dev *hdev); |
@@ -699,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | |||
699 | u8 *randomizer); | 736 | u8 *randomizer); |
700 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | 737 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); |
701 | 738 | ||
739 | int hci_update_ad(struct hci_dev *hdev); | ||
740 | |||
702 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 741 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
703 | 742 | ||
704 | int hci_recv_frame(struct sk_buff *skb); | 743 | int hci_recv_frame(struct sk_buff *skb); |
@@ -715,18 +754,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
715 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 754 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
716 | 755 | ||
717 | /* ----- LMP capabilities ----- */ | 756 | /* ----- LMP capabilities ----- */ |
718 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
719 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) | 757 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) |
758 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
759 | #define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD) | ||
720 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 760 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
721 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 761 | #define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK) |
762 | #define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ) | ||
722 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 763 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
764 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | ||
765 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | ||
766 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | ||
767 | #define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC) | ||
768 | #define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ) | ||
769 | #define lmp_le_br_capable(dev) ((dev)->features[6] & LMP_SIMUL_LE_BR) | ||
723 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 770 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) |
724 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | 771 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) |
725 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 772 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) |
726 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | 773 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR) |
774 | #define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES) | ||
727 | 775 | ||
728 | /* ----- Extended LMP capabilities ----- */ | 776 | /* ----- Extended LMP capabilities ----- */ |
777 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | ||
729 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) | 778 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) |
779 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) | ||
730 | 780 | ||
731 | /* ----- HCI protocols ----- */ | 781 | /* ----- HCI protocols ----- */ |
732 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | 782 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, |
@@ -789,6 +839,10 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason) | |||
789 | sco_disconn_cfm(conn, reason); | 839 | sco_disconn_cfm(conn, reason); |
790 | break; | 840 | break; |
791 | 841 | ||
842 | /* L2CAP would be handled for BREDR chan */ | ||
843 | case AMP_LINK: | ||
844 | break; | ||
845 | |||
792 | default: | 846 | default: |
793 | BT_ERR("unknown link type %d", conn->type); | 847 | BT_ERR("unknown link type %d", conn->type); |
794 | break; | 848 | break; |
@@ -841,7 +895,7 @@ struct hci_cb { | |||
841 | 895 | ||
842 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | 896 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) |
843 | { | 897 | { |
844 | struct list_head *p; | 898 | struct hci_cb *cb; |
845 | __u8 encrypt; | 899 | __u8 encrypt; |
846 | 900 | ||
847 | hci_proto_auth_cfm(conn, status); | 901 | hci_proto_auth_cfm(conn, status); |
@@ -852,8 +906,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
852 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 906 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; |
853 | 907 | ||
854 | read_lock(&hci_cb_list_lock); | 908 | read_lock(&hci_cb_list_lock); |
855 | list_for_each(p, &hci_cb_list) { | 909 | list_for_each_entry(cb, &hci_cb_list, list) { |
856 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
857 | if (cb->security_cfm) | 910 | if (cb->security_cfm) |
858 | cb->security_cfm(conn, status, encrypt); | 911 | cb->security_cfm(conn, status, encrypt); |
859 | } | 912 | } |
@@ -863,7 +916,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
863 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | 916 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, |
864 | __u8 encrypt) | 917 | __u8 encrypt) |
865 | { | 918 | { |
866 | struct list_head *p; | 919 | struct hci_cb *cb; |
867 | 920 | ||
868 | if (conn->sec_level == BT_SECURITY_SDP) | 921 | if (conn->sec_level == BT_SECURITY_SDP) |
869 | conn->sec_level = BT_SECURITY_LOW; | 922 | conn->sec_level = BT_SECURITY_LOW; |
@@ -874,8 +927,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
874 | hci_proto_encrypt_cfm(conn, status, encrypt); | 927 | hci_proto_encrypt_cfm(conn, status, encrypt); |
875 | 928 | ||
876 | read_lock(&hci_cb_list_lock); | 929 | read_lock(&hci_cb_list_lock); |
877 | list_for_each(p, &hci_cb_list) { | 930 | list_for_each_entry(cb, &hci_cb_list, list) { |
878 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
879 | if (cb->security_cfm) | 931 | if (cb->security_cfm) |
880 | cb->security_cfm(conn, status, encrypt); | 932 | cb->security_cfm(conn, status, encrypt); |
881 | } | 933 | } |
@@ -884,11 +936,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
884 | 936 | ||
885 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | 937 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) |
886 | { | 938 | { |
887 | struct list_head *p; | 939 | struct hci_cb *cb; |
888 | 940 | ||
889 | read_lock(&hci_cb_list_lock); | 941 | read_lock(&hci_cb_list_lock); |
890 | list_for_each(p, &hci_cb_list) { | 942 | list_for_each_entry(cb, &hci_cb_list, list) { |
891 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
892 | if (cb->key_change_cfm) | 943 | if (cb->key_change_cfm) |
893 | cb->key_change_cfm(conn, status); | 944 | cb->key_change_cfm(conn, status); |
894 | } | 945 | } |
@@ -898,11 +949,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | |||
898 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, | 949 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, |
899 | __u8 role) | 950 | __u8 role) |
900 | { | 951 | { |
901 | struct list_head *p; | 952 | struct hci_cb *cb; |
902 | 953 | ||
903 | read_lock(&hci_cb_list_lock); | 954 | read_lock(&hci_cb_list_lock); |
904 | list_for_each(p, &hci_cb_list) { | 955 | list_for_each_entry(cb, &hci_cb_list, list) { |
905 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
906 | if (cb->role_switch_cfm) | 956 | if (cb->role_switch_cfm) |
907 | cb->role_switch_cfm(conn, status, role); | 957 | cb->role_switch_cfm(conn, status, role); |
908 | } | 958 | } |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7ed8e356425a..f57fab04e7c5 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -32,13 +32,14 @@ | |||
32 | /* L2CAP defaults */ | 32 | /* L2CAP defaults */ |
33 | #define L2CAP_DEFAULT_MTU 672 | 33 | #define L2CAP_DEFAULT_MTU 672 |
34 | #define L2CAP_DEFAULT_MIN_MTU 48 | 34 | #define L2CAP_DEFAULT_MIN_MTU 48 |
35 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 35 | #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF |
36 | #define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF | ||
36 | #define L2CAP_DEFAULT_TX_WINDOW 63 | 37 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
37 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF | 38 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF |
38 | #define L2CAP_DEFAULT_MAX_TX 3 | 39 | #define L2CAP_DEFAULT_MAX_TX 3 |
39 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ | 40 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ |
40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 41 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 42 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */ |
42 | #define L2CAP_DEFAULT_ACK_TO 200 | 43 | #define L2CAP_DEFAULT_ACK_TO 200 |
43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
@@ -51,6 +52,8 @@ | |||
51 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) | 52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) |
52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
55 | #define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000) | ||
56 | #define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000) | ||
54 | 57 | ||
55 | #define L2CAP_A2MP_DEFAULT_MTU 670 | 58 | #define L2CAP_A2MP_DEFAULT_MTU 670 |
56 | 59 | ||
@@ -433,6 +436,8 @@ struct l2cap_chan { | |||
433 | struct sock *sk; | 436 | struct sock *sk; |
434 | 437 | ||
435 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
439 | struct hci_conn *hs_hcon; | ||
440 | struct hci_chan *hs_hchan; | ||
436 | struct kref kref; | 441 | struct kref kref; |
437 | 442 | ||
438 | __u8 state; | 443 | __u8 state; |
@@ -476,6 +481,12 @@ struct l2cap_chan { | |||
476 | unsigned long conn_state; | 481 | unsigned long conn_state; |
477 | unsigned long flags; | 482 | unsigned long flags; |
478 | 483 | ||
484 | __u8 remote_amp_id; | ||
485 | __u8 local_amp_id; | ||
486 | __u8 move_id; | ||
487 | __u8 move_state; | ||
488 | __u8 move_role; | ||
489 | |||
479 | __u16 next_tx_seq; | 490 | __u16 next_tx_seq; |
480 | __u16 expected_ack_seq; | 491 | __u16 expected_ack_seq; |
481 | __u16 expected_tx_seq; | 492 | __u16 expected_tx_seq; |
@@ -538,6 +549,7 @@ struct l2cap_ops { | |||
538 | void (*state_change) (struct l2cap_chan *chan, | 549 | void (*state_change) (struct l2cap_chan *chan, |
539 | int state); | 550 | int state); |
540 | void (*ready) (struct l2cap_chan *chan); | 551 | void (*ready) (struct l2cap_chan *chan); |
552 | void (*defer) (struct l2cap_chan *chan); | ||
541 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 553 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
542 | unsigned long len, int nb); | 554 | unsigned long len, int nb); |
543 | }; | 555 | }; |
@@ -640,6 +652,9 @@ enum { | |||
640 | enum { | 652 | enum { |
641 | L2CAP_RX_STATE_RECV, | 653 | L2CAP_RX_STATE_RECV, |
642 | L2CAP_RX_STATE_SREJ_SENT, | 654 | L2CAP_RX_STATE_SREJ_SENT, |
655 | L2CAP_RX_STATE_MOVE, | ||
656 | L2CAP_RX_STATE_WAIT_P, | ||
657 | L2CAP_RX_STATE_WAIT_F, | ||
643 | }; | 658 | }; |
644 | 659 | ||
645 | enum { | 660 | enum { |
@@ -670,6 +685,25 @@ enum { | |||
670 | L2CAP_EV_RECV_FRAME, | 685 | L2CAP_EV_RECV_FRAME, |
671 | }; | 686 | }; |
672 | 687 | ||
688 | enum { | ||
689 | L2CAP_MOVE_ROLE_NONE, | ||
690 | L2CAP_MOVE_ROLE_INITIATOR, | ||
691 | L2CAP_MOVE_ROLE_RESPONDER, | ||
692 | }; | ||
693 | |||
694 | enum { | ||
695 | L2CAP_MOVE_STABLE, | ||
696 | L2CAP_MOVE_WAIT_REQ, | ||
697 | L2CAP_MOVE_WAIT_RSP, | ||
698 | L2CAP_MOVE_WAIT_RSP_SUCCESS, | ||
699 | L2CAP_MOVE_WAIT_CONFIRM, | ||
700 | L2CAP_MOVE_WAIT_CONFIRM_RSP, | ||
701 | L2CAP_MOVE_WAIT_LOGICAL_COMP, | ||
702 | L2CAP_MOVE_WAIT_LOGICAL_CFM, | ||
703 | L2CAP_MOVE_WAIT_LOCAL_BUSY, | ||
704 | L2CAP_MOVE_WAIT_PREPARE, | ||
705 | }; | ||
706 | |||
673 | void l2cap_chan_hold(struct l2cap_chan *c); | 707 | void l2cap_chan_hold(struct l2cap_chan *c); |
674 | void l2cap_chan_put(struct l2cap_chan *c); | 708 | void l2cap_chan_put(struct l2cap_chan *c); |
675 | 709 | ||
@@ -745,6 +779,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) | |||
745 | { | 779 | { |
746 | } | 780 | } |
747 | 781 | ||
782 | static inline void l2cap_chan_no_defer(struct l2cap_chan *chan) | ||
783 | { | ||
784 | } | ||
785 | |||
748 | extern bool disable_ertm; | 786 | extern bool disable_ertm; |
749 | 787 | ||
750 | int l2cap_init_sockets(void); | 788 | int l2cap_init_sockets(void); |
@@ -767,6 +805,12 @@ int l2cap_chan_check_security(struct l2cap_chan *chan); | |||
767 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 805 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
768 | int l2cap_ertm_init(struct l2cap_chan *chan); | 806 | int l2cap_ertm_init(struct l2cap_chan *chan); |
769 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 807 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
808 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
770 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 809 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
810 | void l2cap_send_conn_req(struct l2cap_chan *chan); | ||
811 | void l2cap_move_start(struct l2cap_chan *chan); | ||
812 | void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | ||
813 | u8 status); | ||
814 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); | ||
771 | 815 | ||
772 | #endif /* __L2CAP_H */ | 816 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 1b4989082244..e78db2cf3d1b 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -306,6 +306,88 @@ struct key_params { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * struct cfg80211_chan_def - channel definition | ||
310 | * @chan: the (control) channel | ||
311 | * @width: channel width | ||
312 | * @center_freq1: center frequency of first segment | ||
313 | * @center_freq2: center frequency of second segment | ||
314 | * (only with 80+80 MHz) | ||
315 | */ | ||
316 | struct cfg80211_chan_def { | ||
317 | struct ieee80211_channel *chan; | ||
318 | enum nl80211_chan_width width; | ||
319 | u32 center_freq1; | ||
320 | u32 center_freq2; | ||
321 | }; | ||
322 | |||
323 | /** | ||
324 | * cfg80211_get_chandef_type - return old channel type from chandef | ||
325 | * @chandef: the channel definition | ||
326 | * | ||
327 | * Returns the old channel type (NOHT, HT20, HT40+/-) from a given | ||
328 | * chandef, which must have a bandwidth allowing this conversion. | ||
329 | */ | ||
330 | static inline enum nl80211_channel_type | ||
331 | cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef) | ||
332 | { | ||
333 | switch (chandef->width) { | ||
334 | case NL80211_CHAN_WIDTH_20_NOHT: | ||
335 | return NL80211_CHAN_NO_HT; | ||
336 | case NL80211_CHAN_WIDTH_20: | ||
337 | return NL80211_CHAN_HT20; | ||
338 | case NL80211_CHAN_WIDTH_40: | ||
339 | if (chandef->center_freq1 > chandef->chan->center_freq) | ||
340 | return NL80211_CHAN_HT40PLUS; | ||
341 | return NL80211_CHAN_HT40MINUS; | ||
342 | default: | ||
343 | WARN_ON(1); | ||
344 | return NL80211_CHAN_NO_HT; | ||
345 | } | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * cfg80211_chandef_create - create channel definition using channel type | ||
350 | * @chandef: the channel definition struct to fill | ||
351 | * @channel: the control channel | ||
352 | * @chantype: the channel type | ||
353 | * | ||
354 | * Given a channel type, create a channel definition. | ||
355 | */ | ||
356 | void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, | ||
357 | struct ieee80211_channel *channel, | ||
358 | enum nl80211_channel_type chantype); | ||
359 | |||
360 | /** | ||
361 | * cfg80211_chandef_identical - check if two channel definitions are identical | ||
362 | * @chandef1: first channel definition | ||
363 | * @chandef2: second channel definition | ||
364 | * | ||
365 | * Returns %true if the channels defined by the channel definitions are | ||
366 | * identical, %false otherwise. | ||
367 | */ | ||
368 | static inline bool | ||
369 | cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1, | ||
370 | const struct cfg80211_chan_def *chandef2) | ||
371 | { | ||
372 | return (chandef1->chan == chandef2->chan && | ||
373 | chandef1->width == chandef2->width && | ||
374 | chandef1->center_freq1 == chandef2->center_freq1 && | ||
375 | chandef1->center_freq2 == chandef2->center_freq2); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * cfg80211_chandef_compatible - check if two channel definitions are compatible | ||
380 | * @chandef1: first channel definition | ||
381 | * @chandef2: second channel definition | ||
382 | * | ||
383 | * Returns %NULL if the given channel definitions are incompatible, | ||
384 | * chandef1 or chandef2 otherwise. | ||
385 | */ | ||
386 | const struct cfg80211_chan_def * | ||
387 | cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, | ||
388 | const struct cfg80211_chan_def *chandef2); | ||
389 | |||
390 | /** | ||
309 | * enum survey_info_flags - survey information flags | 391 | * enum survey_info_flags - survey information flags |
310 | * | 392 | * |
311 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 393 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
@@ -426,8 +508,7 @@ struct cfg80211_beacon_data { | |||
426 | * | 508 | * |
427 | * Used to configure an AP interface. | 509 | * Used to configure an AP interface. |
428 | * | 510 | * |
429 | * @channel: the channel to start the AP on | 511 | * @chandef: defines the channel to use |
430 | * @channel_type: the channel type to use | ||
431 | * @beacon: beacon data | 512 | * @beacon: beacon data |
432 | * @beacon_interval: beacon interval | 513 | * @beacon_interval: beacon interval |
433 | * @dtim_period: DTIM period | 514 | * @dtim_period: DTIM period |
@@ -441,8 +522,7 @@ struct cfg80211_beacon_data { | |||
441 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 522 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
442 | */ | 523 | */ |
443 | struct cfg80211_ap_settings { | 524 | struct cfg80211_ap_settings { |
444 | struct ieee80211_channel *channel; | 525 | struct cfg80211_chan_def chandef; |
445 | enum nl80211_channel_type channel_type; | ||
446 | 526 | ||
447 | struct cfg80211_beacon_data beacon; | 527 | struct cfg80211_beacon_data beacon; |
448 | 528 | ||
@@ -498,6 +578,7 @@ enum station_parameters_apply_mask { | |||
498 | * @plink_action: plink action to take | 578 | * @plink_action: plink action to take |
499 | * @plink_state: set the peer link state for a station | 579 | * @plink_state: set the peer link state for a station |
500 | * @ht_capa: HT capabilities of station | 580 | * @ht_capa: HT capabilities of station |
581 | * @vht_capa: VHT capabilities of station | ||
501 | * @uapsd_queues: bitmap of queues configured for uapsd. same format | 582 | * @uapsd_queues: bitmap of queues configured for uapsd. same format |
502 | * as the AC bitmap in the QoS info field | 583 | * as the AC bitmap in the QoS info field |
503 | * @max_sp: max Service Period. same format as the MAX_SP in the | 584 | * @max_sp: max Service Period. same format as the MAX_SP in the |
@@ -517,6 +598,7 @@ struct station_parameters { | |||
517 | u8 plink_action; | 598 | u8 plink_action; |
518 | u8 plink_state; | 599 | u8 plink_state; |
519 | struct ieee80211_ht_cap *ht_capa; | 600 | struct ieee80211_ht_cap *ht_capa; |
601 | struct ieee80211_vht_cap *vht_capa; | ||
520 | u8 uapsd_queues; | 602 | u8 uapsd_queues; |
521 | u8 max_sp; | 603 | u8 max_sp; |
522 | }; | 604 | }; |
@@ -580,16 +662,24 @@ enum station_info_flags { | |||
580 | * Used by the driver to indicate the specific rate transmission | 662 | * Used by the driver to indicate the specific rate transmission |
581 | * type for 802.11n transmissions. | 663 | * type for 802.11n transmissions. |
582 | * | 664 | * |
583 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled | 665 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS |
584 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission | 666 | * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS |
667 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission | ||
668 | * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission | ||
669 | * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission | ||
670 | * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission | ||
585 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 671 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
586 | * @RATE_INFO_FLAGS_60G: 60gHz MCS | 672 | * @RATE_INFO_FLAGS_60G: 60GHz MCS |
587 | */ | 673 | */ |
588 | enum rate_info_flags { | 674 | enum rate_info_flags { |
589 | RATE_INFO_FLAGS_MCS = 1<<0, | 675 | RATE_INFO_FLAGS_MCS = BIT(0), |
590 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, | 676 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), |
591 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, | 677 | RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), |
592 | RATE_INFO_FLAGS_60G = 1<<3, | 678 | RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), |
679 | RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4), | ||
680 | RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5), | ||
681 | RATE_INFO_FLAGS_SHORT_GI = BIT(6), | ||
682 | RATE_INFO_FLAGS_60G = BIT(7), | ||
593 | }; | 683 | }; |
594 | 684 | ||
595 | /** | 685 | /** |
@@ -600,11 +690,13 @@ enum rate_info_flags { | |||
600 | * @flags: bitflag of flags from &enum rate_info_flags | 690 | * @flags: bitflag of flags from &enum rate_info_flags |
601 | * @mcs: mcs index if struct describes a 802.11n bitrate | 691 | * @mcs: mcs index if struct describes a 802.11n bitrate |
602 | * @legacy: bitrate in 100kbit/s for 802.11abg | 692 | * @legacy: bitrate in 100kbit/s for 802.11abg |
693 | * @nss: number of streams (VHT only) | ||
603 | */ | 694 | */ |
604 | struct rate_info { | 695 | struct rate_info { |
605 | u8 flags; | 696 | u8 flags; |
606 | u8 mcs; | 697 | u8 mcs; |
607 | u16 legacy; | 698 | u16 legacy; |
699 | u8 nss; | ||
608 | }; | 700 | }; |
609 | 701 | ||
610 | /** | 702 | /** |
@@ -907,8 +999,7 @@ struct mesh_config { | |||
907 | 999 | ||
908 | /** | 1000 | /** |
909 | * struct mesh_setup - 802.11s mesh setup configuration | 1001 | * struct mesh_setup - 802.11s mesh setup configuration |
910 | * @channel: the channel to start the mesh network on | 1002 | * @chandef: defines the channel to use |
911 | * @channel_type: the channel type to use | ||
912 | * @mesh_id: the mesh ID | 1003 | * @mesh_id: the mesh ID |
913 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 1004 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
914 | * @sync_method: which synchronization method to use | 1005 | * @sync_method: which synchronization method to use |
@@ -923,8 +1014,7 @@ struct mesh_config { | |||
923 | * These parameters are fixed when the mesh is created. | 1014 | * These parameters are fixed when the mesh is created. |
924 | */ | 1015 | */ |
925 | struct mesh_setup { | 1016 | struct mesh_setup { |
926 | struct ieee80211_channel *channel; | 1017 | struct cfg80211_chan_def chandef; |
927 | enum nl80211_channel_type channel_type; | ||
928 | const u8 *mesh_id; | 1018 | const u8 *mesh_id; |
929 | u8 mesh_id_len; | 1019 | u8 mesh_id_len; |
930 | u8 sync_method; | 1020 | u8 sync_method; |
@@ -1000,8 +1090,10 @@ struct cfg80211_ssid { | |||
1000 | * @n_channels: total number of channels to scan | 1090 | * @n_channels: total number of channels to scan |
1001 | * @ie: optional information element(s) to add into Probe Request or %NULL | 1091 | * @ie: optional information element(s) to add into Probe Request or %NULL |
1002 | * @ie_len: length of ie in octets | 1092 | * @ie_len: length of ie in octets |
1093 | * @flags: bit field of flags controlling operation | ||
1003 | * @rates: bitmap of rates to advertise for each band | 1094 | * @rates: bitmap of rates to advertise for each band |
1004 | * @wiphy: the wiphy this was for | 1095 | * @wiphy: the wiphy this was for |
1096 | * @scan_start: time (in jiffies) when the scan started | ||
1005 | * @wdev: the wireless device to scan for | 1097 | * @wdev: the wireless device to scan for |
1006 | * @aborted: (internal) scan request was notified as aborted | 1098 | * @aborted: (internal) scan request was notified as aborted |
1007 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band | 1099 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band |
@@ -1012,6 +1104,7 @@ struct cfg80211_scan_request { | |||
1012 | u32 n_channels; | 1104 | u32 n_channels; |
1013 | const u8 *ie; | 1105 | const u8 *ie; |
1014 | size_t ie_len; | 1106 | size_t ie_len; |
1107 | u32 flags; | ||
1015 | 1108 | ||
1016 | u32 rates[IEEE80211_NUM_BANDS]; | 1109 | u32 rates[IEEE80211_NUM_BANDS]; |
1017 | 1110 | ||
@@ -1019,6 +1112,7 @@ struct cfg80211_scan_request { | |||
1019 | 1112 | ||
1020 | /* internal */ | 1113 | /* internal */ |
1021 | struct wiphy *wiphy; | 1114 | struct wiphy *wiphy; |
1115 | unsigned long scan_start; | ||
1022 | bool aborted; | 1116 | bool aborted; |
1023 | bool no_cck; | 1117 | bool no_cck; |
1024 | 1118 | ||
@@ -1044,6 +1138,7 @@ struct cfg80211_match_set { | |||
1044 | * @interval: interval between each scheduled scan cycle | 1138 | * @interval: interval between each scheduled scan cycle |
1045 | * @ie: optional information element(s) to add into Probe Request or %NULL | 1139 | * @ie: optional information element(s) to add into Probe Request or %NULL |
1046 | * @ie_len: length of ie in octets | 1140 | * @ie_len: length of ie in octets |
1141 | * @flags: bit field of flags controlling operation | ||
1047 | * @match_sets: sets of parameters to be matched for a scan result | 1142 | * @match_sets: sets of parameters to be matched for a scan result |
1048 | * entry to be considered valid and to be passed to the host | 1143 | * entry to be considered valid and to be passed to the host |
1049 | * (others are filtered out). | 1144 | * (others are filtered out). |
@@ -1061,6 +1156,7 @@ struct cfg80211_sched_scan_request { | |||
1061 | u32 interval; | 1156 | u32 interval; |
1062 | const u8 *ie; | 1157 | const u8 *ie; |
1063 | size_t ie_len; | 1158 | size_t ie_len; |
1159 | u32 flags; | ||
1064 | struct cfg80211_match_set *match_sets; | 1160 | struct cfg80211_match_set *match_sets; |
1065 | int n_match_sets; | 1161 | int n_match_sets; |
1066 | s32 rssi_thold; | 1162 | s32 rssi_thold; |
@@ -1068,6 +1164,7 @@ struct cfg80211_sched_scan_request { | |||
1068 | /* internal */ | 1164 | /* internal */ |
1069 | struct wiphy *wiphy; | 1165 | struct wiphy *wiphy; |
1070 | struct net_device *dev; | 1166 | struct net_device *dev; |
1167 | unsigned long scan_start; | ||
1071 | 1168 | ||
1072 | /* keep last */ | 1169 | /* keep last */ |
1073 | struct ieee80211_channel *channels[0]; | 1170 | struct ieee80211_channel *channels[0]; |
@@ -1152,6 +1249,9 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | |||
1152 | * @key_len: length of WEP key for shared key authentication | 1249 | * @key_len: length of WEP key for shared key authentication |
1153 | * @key_idx: index of WEP key for shared key authentication | 1250 | * @key_idx: index of WEP key for shared key authentication |
1154 | * @key: WEP key for shared key authentication | 1251 | * @key: WEP key for shared key authentication |
1252 | * @sae_data: Non-IE data to use with SAE or %NULL. This starts with | ||
1253 | * Authentication transaction sequence number field. | ||
1254 | * @sae_data_len: Length of sae_data buffer in octets | ||
1155 | */ | 1255 | */ |
1156 | struct cfg80211_auth_request { | 1256 | struct cfg80211_auth_request { |
1157 | struct cfg80211_bss *bss; | 1257 | struct cfg80211_bss *bss; |
@@ -1160,6 +1260,8 @@ struct cfg80211_auth_request { | |||
1160 | enum nl80211_auth_type auth_type; | 1260 | enum nl80211_auth_type auth_type; |
1161 | const u8 *key; | 1261 | const u8 *key; |
1162 | u8 key_len, key_idx; | 1262 | u8 key_len, key_idx; |
1263 | const u8 *sae_data; | ||
1264 | size_t sae_data_len; | ||
1163 | }; | 1265 | }; |
1164 | 1266 | ||
1165 | /** | 1267 | /** |
@@ -1218,6 +1320,7 @@ struct cfg80211_deauth_request { | |||
1218 | const u8 *ie; | 1320 | const u8 *ie; |
1219 | size_t ie_len; | 1321 | size_t ie_len; |
1220 | u16 reason_code; | 1322 | u16 reason_code; |
1323 | bool local_state_change; | ||
1221 | }; | 1324 | }; |
1222 | 1325 | ||
1223 | /** | 1326 | /** |
@@ -1251,8 +1354,7 @@ struct cfg80211_disassoc_request { | |||
1251 | * @ssid_len: The length of the SSID, will always be non-zero. | 1354 | * @ssid_len: The length of the SSID, will always be non-zero. |
1252 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not | 1355 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not |
1253 | * search for IBSSs with a different BSSID. | 1356 | * search for IBSSs with a different BSSID. |
1254 | * @channel: The channel to use if no IBSS can be found to join. | 1357 | * @chandef: defines the channel to use if no other IBSS to join can be found |
1255 | * @channel_type: channel type (HT mode) | ||
1256 | * @channel_fixed: The channel should be fixed -- do not search for | 1358 | * @channel_fixed: The channel should be fixed -- do not search for |
1257 | * IBSSs to join on other channels. | 1359 | * IBSSs to join on other channels. |
1258 | * @ie: information element(s) to include in the beacon | 1360 | * @ie: information element(s) to include in the beacon |
@@ -1270,8 +1372,7 @@ struct cfg80211_disassoc_request { | |||
1270 | struct cfg80211_ibss_params { | 1372 | struct cfg80211_ibss_params { |
1271 | u8 *ssid; | 1373 | u8 *ssid; |
1272 | u8 *bssid; | 1374 | u8 *bssid; |
1273 | struct ieee80211_channel *channel; | 1375 | struct cfg80211_chan_def chandef; |
1274 | enum nl80211_channel_type channel_type; | ||
1275 | u8 *ie; | 1376 | u8 *ie; |
1276 | u8 ssid_len, ie_len; | 1377 | u8 ssid_len, ie_len; |
1277 | u16 beacon_interval; | 1378 | u16 beacon_interval; |
@@ -1530,13 +1631,19 @@ struct cfg80211_gtk_rekey_data { | |||
1530 | * to a merge. | 1631 | * to a merge. |
1531 | * @leave_ibss: Leave the IBSS. | 1632 | * @leave_ibss: Leave the IBSS. |
1532 | * | 1633 | * |
1634 | * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or | ||
1635 | * MESH mode) | ||
1636 | * | ||
1533 | * @set_wiphy_params: Notify that wiphy parameters have changed; | 1637 | * @set_wiphy_params: Notify that wiphy parameters have changed; |
1534 | * @changed bitfield (see &enum wiphy_params_flags) describes which values | 1638 | * @changed bitfield (see &enum wiphy_params_flags) describes which values |
1535 | * have changed. The actual parameter values are available in | 1639 | * have changed. The actual parameter values are available in |
1536 | * struct wiphy. If returning an error, no value should be changed. | 1640 | * struct wiphy. If returning an error, no value should be changed. |
1537 | * | 1641 | * |
1538 | * @set_tx_power: set the transmit power according to the parameters, | 1642 | * @set_tx_power: set the transmit power according to the parameters, |
1539 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). | 1643 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The |
1644 | * wdev may be %NULL if power was set for the wiphy, and will | ||
1645 | * always be %NULL unless the driver supports per-vif TX power | ||
1646 | * (as advertised by the nl80211 feature flag.) | ||
1540 | * @get_tx_power: store the current TX power into the dbm variable; | 1647 | * @get_tx_power: store the current TX power into the dbm variable; |
1541 | * return 0 if successful | 1648 | * return 0 if successful |
1542 | * | 1649 | * |
@@ -1707,8 +1814,7 @@ struct cfg80211_ops { | |||
1707 | struct ieee80211_channel *chan); | 1814 | struct ieee80211_channel *chan); |
1708 | 1815 | ||
1709 | int (*set_monitor_channel)(struct wiphy *wiphy, | 1816 | int (*set_monitor_channel)(struct wiphy *wiphy, |
1710 | struct ieee80211_channel *chan, | 1817 | struct cfg80211_chan_def *chandef); |
1711 | enum nl80211_channel_type channel_type); | ||
1712 | 1818 | ||
1713 | int (*scan)(struct wiphy *wiphy, | 1819 | int (*scan)(struct wiphy *wiphy, |
1714 | struct cfg80211_scan_request *request); | 1820 | struct cfg80211_scan_request *request); |
@@ -1731,11 +1837,15 @@ struct cfg80211_ops { | |||
1731 | struct cfg80211_ibss_params *params); | 1837 | struct cfg80211_ibss_params *params); |
1732 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | 1838 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); |
1733 | 1839 | ||
1840 | int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev, | ||
1841 | int rate[IEEE80211_NUM_BANDS]); | ||
1842 | |||
1734 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1843 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1735 | 1844 | ||
1736 | int (*set_tx_power)(struct wiphy *wiphy, | 1845 | int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1737 | enum nl80211_tx_power_setting type, int mbm); | 1846 | enum nl80211_tx_power_setting type, int mbm); |
1738 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1847 | int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1848 | int *dbm); | ||
1739 | 1849 | ||
1740 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1850 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
1741 | const u8 *addr); | 1851 | const u8 *addr); |
@@ -1766,7 +1876,6 @@ struct cfg80211_ops { | |||
1766 | int (*remain_on_channel)(struct wiphy *wiphy, | 1876 | int (*remain_on_channel)(struct wiphy *wiphy, |
1767 | struct wireless_dev *wdev, | 1877 | struct wireless_dev *wdev, |
1768 | struct ieee80211_channel *chan, | 1878 | struct ieee80211_channel *chan, |
1769 | enum nl80211_channel_type channel_type, | ||
1770 | unsigned int duration, | 1879 | unsigned int duration, |
1771 | u64 *cookie); | 1880 | u64 *cookie); |
1772 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1881 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
@@ -1775,10 +1884,8 @@ struct cfg80211_ops { | |||
1775 | 1884 | ||
1776 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 1885 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1777 | struct ieee80211_channel *chan, bool offchan, | 1886 | struct ieee80211_channel *chan, bool offchan, |
1778 | enum nl80211_channel_type channel_type, | 1887 | unsigned int wait, const u8 *buf, size_t len, |
1779 | bool channel_type_valid, unsigned int wait, | 1888 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); |
1780 | const u8 *buf, size_t len, bool no_cck, | ||
1781 | bool dont_wait_for_ack, u64 *cookie); | ||
1782 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1889 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1783 | struct wireless_dev *wdev, | 1890 | struct wireless_dev *wdev, |
1784 | u64 cookie); | 1891 | u64 cookie); |
@@ -1833,10 +1940,9 @@ struct cfg80211_ops { | |||
1833 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1940 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1834 | u32 sset, u8 *data); | 1941 | u32 sset, u8 *data); |
1835 | 1942 | ||
1836 | struct ieee80211_channel * | 1943 | int (*get_channel)(struct wiphy *wiphy, |
1837 | (*get_channel)(struct wiphy *wiphy, | ||
1838 | struct wireless_dev *wdev, | 1944 | struct wireless_dev *wdev, |
1839 | enum nl80211_channel_type *type); | 1945 | struct cfg80211_chan_def *chandef); |
1840 | 1946 | ||
1841 | int (*start_p2p_device)(struct wiphy *wiphy, | 1947 | int (*start_p2p_device)(struct wiphy *wiphy, |
1842 | struct wireless_dev *wdev); | 1948 | struct wireless_dev *wdev); |
@@ -2444,8 +2550,7 @@ struct wireless_dev { | |||
2444 | spinlock_t event_lock; | 2550 | spinlock_t event_lock; |
2445 | 2551 | ||
2446 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2552 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2447 | struct ieee80211_channel *preset_chan; | 2553 | struct cfg80211_chan_def preset_chandef; |
2448 | enum nl80211_channel_type preset_chantype; | ||
2449 | 2554 | ||
2450 | /* for AP and mesh channel tracking */ | 2555 | /* for AP and mesh channel tracking */ |
2451 | struct ieee80211_channel *channel; | 2556 | struct ieee80211_channel *channel; |
@@ -2651,6 +2756,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
2651 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); | 2756 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
2652 | 2757 | ||
2653 | /** | 2758 | /** |
2759 | * ieee80211_get_mesh_hdrlen - get mesh extension header length | ||
2760 | * @meshhdr: the mesh extension header, only the flags field | ||
2761 | * (first byte) will be accessed | ||
2762 | * Returns the length of the extension header, which is always at | ||
2763 | * least 6 bytes and at most 18 if address 5 and 6 are present. | ||
2764 | */ | ||
2765 | unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); | ||
2766 | |||
2767 | /** | ||
2654 | * DOC: Data path helpers | 2768 | * DOC: Data path helpers |
2655 | * | 2769 | * |
2656 | * In addition to generic utilities, cfg80211 also offers | 2770 | * In addition to generic utilities, cfg80211 also offers |
@@ -3316,14 +3430,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3316 | * @wdev: wireless device | 3430 | * @wdev: wireless device |
3317 | * @cookie: the request cookie | 3431 | * @cookie: the request cookie |
3318 | * @chan: The current channel (from remain_on_channel request) | 3432 | * @chan: The current channel (from remain_on_channel request) |
3319 | * @channel_type: Channel type | ||
3320 | * @duration: Duration in milliseconds that the driver intents to remain on the | 3433 | * @duration: Duration in milliseconds that the driver intents to remain on the |
3321 | * channel | 3434 | * channel |
3322 | * @gfp: allocation flags | 3435 | * @gfp: allocation flags |
3323 | */ | 3436 | */ |
3324 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | 3437 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3325 | struct ieee80211_channel *chan, | 3438 | struct ieee80211_channel *chan, |
3326 | enum nl80211_channel_type channel_type, | ||
3327 | unsigned int duration, gfp_t gfp); | 3439 | unsigned int duration, gfp_t gfp); |
3328 | 3440 | ||
3329 | /** | 3441 | /** |
@@ -3331,12 +3443,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
3331 | * @wdev: wireless device | 3443 | * @wdev: wireless device |
3332 | * @cookie: the request cookie | 3444 | * @cookie: the request cookie |
3333 | * @chan: The current channel (from remain_on_channel request) | 3445 | * @chan: The current channel (from remain_on_channel request) |
3334 | * @channel_type: Channel type | ||
3335 | * @gfp: allocation flags | 3446 | * @gfp: allocation flags |
3336 | */ | 3447 | */ |
3337 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, | 3448 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
3338 | struct ieee80211_channel *chan, | 3449 | struct ieee80211_channel *chan, |
3339 | enum nl80211_channel_type channel_type, | ||
3340 | gfp_t gfp); | 3450 | gfp_t gfp); |
3341 | 3451 | ||
3342 | 3452 | ||
@@ -3526,7 +3636,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3526 | * @len: length of the frame | 3636 | * @len: length of the frame |
3527 | * @freq: frequency the frame was received on | 3637 | * @freq: frequency the frame was received on |
3528 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3638 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
3529 | * @gfp: allocation flags | ||
3530 | * | 3639 | * |
3531 | * Use this function to report to userspace when a beacon was | 3640 | * Use this function to report to userspace when a beacon was |
3532 | * received. It is not useful to call this when there is no | 3641 | * received. It is not useful to call this when there is no |
@@ -3534,31 +3643,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3534 | */ | 3643 | */ |
3535 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 3644 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
3536 | const u8 *frame, size_t len, | 3645 | const u8 *frame, size_t len, |
3537 | int freq, int sig_dbm, gfp_t gfp); | 3646 | int freq, int sig_dbm); |
3538 | 3647 | ||
3539 | /** | 3648 | /** |
3540 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3649 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
3541 | * @wiphy: the wiphy | 3650 | * @wiphy: the wiphy |
3542 | * @chan: main channel | 3651 | * @chandef: the channel definition |
3543 | * @channel_type: HT mode | ||
3544 | * | 3652 | * |
3545 | * This function returns true if there is no secondary channel or the secondary | 3653 | * This function returns true if there is no secondary channel or the secondary |
3546 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | 3654 | * channel(s) can be used for beaconing (i.e. is not a radar channel etc.) |
3547 | */ | 3655 | */ |
3548 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3656 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3549 | struct ieee80211_channel *chan, | 3657 | struct cfg80211_chan_def *chandef); |
3550 | enum nl80211_channel_type channel_type); | ||
3551 | 3658 | ||
3552 | /* | 3659 | /* |
3553 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | 3660 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace |
3554 | * @dev: the device which switched channels | 3661 | * @dev: the device which switched channels |
3555 | * @freq: new channel frequency (in MHz) | 3662 | * @chandef: the new channel definition |
3556 | * @type: channel type | ||
3557 | * | 3663 | * |
3558 | * Acquires wdev_lock, so must only be called from sleepable driver context! | 3664 | * Acquires wdev_lock, so must only be called from sleepable driver context! |
3559 | */ | 3665 | */ |
3560 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | 3666 | void cfg80211_ch_switch_notify(struct net_device *dev, |
3561 | enum nl80211_channel_type type); | 3667 | struct cfg80211_chan_def *chandef); |
3668 | |||
3669 | /* | ||
3670 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | ||
3671 | * @dev: the device on which the operation is requested | ||
3672 | * @peer: the MAC address of the peer device | ||
3673 | * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or | ||
3674 | * NL80211_TDLS_TEARDOWN) | ||
3675 | * @reason_code: the reason code for teardown request | ||
3676 | * @gfp: allocation flags | ||
3677 | * | ||
3678 | * This function is used to request userspace to perform TDLS operation that | ||
3679 | * requires knowledge of keys, i.e., link setup or teardown when the AP | ||
3680 | * connection uses encryption. This is optional mechanism for the driver to use | ||
3681 | * if it can automatically determine when a TDLS link could be useful (e.g., | ||
3682 | * based on traffic and signal strength for a peer). | ||
3683 | */ | ||
3684 | void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | ||
3685 | enum nl80211_tdls_operation oper, | ||
3686 | u16 reason_code, gfp_t gfp); | ||
3562 | 3687 | ||
3563 | /* | 3688 | /* |
3564 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) | 3689 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) |
@@ -3584,6 +3709,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate); | |||
3584 | */ | 3709 | */ |
3585 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); | 3710 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); |
3586 | 3711 | ||
3712 | /** | ||
3713 | * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer | ||
3714 | * @ies: the input IE buffer | ||
3715 | * @len: the input length | ||
3716 | * @attr: the attribute ID to find | ||
3717 | * @buf: output buffer, can be %NULL if the data isn't needed, e.g. | ||
3718 | * if the function is only called to get the needed buffer size | ||
3719 | * @bufsize: size of the output buffer | ||
3720 | * | ||
3721 | * The function finds a given P2P attribute in the (vendor) IEs and | ||
3722 | * copies its contents to the given buffer. | ||
3723 | * | ||
3724 | * The return value is a negative error code (-%EILSEQ or -%ENOENT) if | ||
3725 | * the data is malformed or the attribute can't be found (respectively), | ||
3726 | * or the length of the found attribute (which can be zero). | ||
3727 | */ | ||
3728 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | ||
3729 | enum ieee80211_p2p_attr_id attr, | ||
3730 | u8 *buf, unsigned int bufsize); | ||
3731 | |||
3587 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3732 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3588 | 3733 | ||
3589 | /* wiphy_printk helpers, similar to dev_printk */ | 3734 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index b6a6eeb3905f..2581638f4a3d 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h | |||
@@ -24,12 +24,12 @@ struct cgroup_cls_state | |||
24 | u32 classid; | 24 | u32 classid; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | extern void sock_update_classid(struct sock *sk); | 27 | extern void sock_update_classid(struct sock *sk, struct task_struct *task); |
28 | 28 | ||
29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) | 29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) |
30 | static inline u32 task_cls_classid(struct task_struct *p) | 30 | static inline u32 task_cls_classid(struct task_struct *p) |
31 | { | 31 | { |
32 | int classid; | 32 | u32 classid; |
33 | 33 | ||
34 | if (in_interrupt()) | 34 | if (in_interrupt()) |
35 | return 0; | 35 | return 0; |
@@ -61,7 +61,7 @@ static inline u32 task_cls_classid(struct task_struct *p) | |||
61 | } | 61 | } |
62 | #endif | 62 | #endif |
63 | #else /* !CGROUP_NET_CLS_CGROUP */ | 63 | #else /* !CGROUP_NET_CLS_CGROUP */ |
64 | static inline void sock_update_classid(struct sock *sk) | 64 | static inline void sock_update_classid(struct sock *sk, struct task_struct *task) |
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index bc1b0fda2b04..652d3d309357 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <net/ip.h> | 31 | #include <net/ip.h> |
32 | #include <asm/checksum.h> | 32 | #include <asm/checksum.h> |
33 | #include <linux/in6.h> | 33 | #include <linux/in6.h> |
34 | #include <linux/tcp.h> | ||
35 | #include <linux/ipv6.h> | ||
34 | 36 | ||
35 | #ifndef _HAVE_ARCH_IPV6_CSUM | 37 | #ifndef _HAVE_ARCH_IPV6_CSUM |
36 | 38 | ||
@@ -91,4 +93,37 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
91 | } | 93 | } |
92 | 94 | ||
93 | #endif | 95 | #endif |
96 | |||
97 | static __inline__ __sum16 tcp_v6_check(int len, | ||
98 | const struct in6_addr *saddr, | ||
99 | const struct in6_addr *daddr, | ||
100 | __wsum base) | ||
101 | { | ||
102 | return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base); | ||
103 | } | ||
104 | |||
105 | static inline void __tcp_v6_send_check(struct sk_buff *skb, | ||
106 | const struct in6_addr *saddr, | ||
107 | const struct in6_addr *daddr) | ||
108 | { | ||
109 | struct tcphdr *th = tcp_hdr(skb); | ||
110 | |||
111 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | ||
112 | th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0); | ||
113 | skb->csum_start = skb_transport_header(skb) - skb->head; | ||
114 | skb->csum_offset = offsetof(struct tcphdr, check); | ||
115 | } else { | ||
116 | th->check = tcp_v6_check(skb->len, saddr, daddr, | ||
117 | csum_partial(th, th->doff << 2, | ||
118 | skb->csum)); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb) | ||
123 | { | ||
124 | struct ipv6_pinfo *np = inet6_sk(sk); | ||
125 | |||
126 | __tcp_v6_send_check(skb, &np->saddr, &np->daddr); | ||
127 | } | ||
128 | |||
94 | #endif | 129 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 8a2a203eb15d..fdc48a94a063 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -47,6 +47,8 @@ struct fib6_config { | |||
47 | unsigned long fc_expires; | 47 | unsigned long fc_expires; |
48 | struct nlattr *fc_mx; | 48 | struct nlattr *fc_mx; |
49 | int fc_mx_len; | 49 | int fc_mx_len; |
50 | int fc_mp_len; | ||
51 | struct nlattr *fc_mp; | ||
50 | 52 | ||
51 | struct nl_info fc_nlinfo; | 53 | struct nl_info fc_nlinfo; |
52 | }; | 54 | }; |
@@ -99,6 +101,14 @@ struct rt6_info { | |||
99 | 101 | ||
100 | struct in6_addr rt6i_gateway; | 102 | struct in6_addr rt6i_gateway; |
101 | 103 | ||
104 | /* Multipath routes: | ||
105 | * siblings is a list of rt6_info that have the the same metric/weight, | ||
106 | * destination, but not the same gateway. nsiblings is just a cache | ||
107 | * to speed up lookup. | ||
108 | */ | ||
109 | struct list_head rt6i_siblings; | ||
110 | unsigned int rt6i_nsiblings; | ||
111 | |||
102 | atomic_t rt6i_ref; | 112 | atomic_t rt6i_ref; |
103 | 113 | ||
104 | /* These are in a separate cache line. */ | 114 | /* These are in a separate cache line. */ |
@@ -107,7 +117,6 @@ struct rt6_info { | |||
107 | struct rt6key rt6i_src; | 117 | struct rt6key rt6i_src; |
108 | struct rt6key rt6i_prefsrc; | 118 | struct rt6key rt6i_prefsrc; |
109 | u32 rt6i_metric; | 119 | u32 rt6i_metric; |
110 | u32 rt6i_peer_genid; | ||
111 | 120 | ||
112 | struct inet6_dev *rt6i_idev; | 121 | struct inet6_dev *rt6i_idev; |
113 | unsigned long _rt6i_peer; | 122 | unsigned long _rt6i_peer; |
@@ -203,6 +212,15 @@ static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) | |||
203 | dst_hold(new); | 212 | dst_hold(new); |
204 | } | 213 | } |
205 | 214 | ||
215 | static inline void ip6_rt_put(struct rt6_info *rt) | ||
216 | { | ||
217 | /* dst_release() accepts a NULL parameter. | ||
218 | * We rely on dst being first structure in struct rt6_info | ||
219 | */ | ||
220 | BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0); | ||
221 | dst_release(&rt->dst); | ||
222 | } | ||
223 | |||
206 | struct fib6_walker_t { | 224 | struct fib6_walker_t { |
207 | struct list_head lh; | 225 | struct list_head lh; |
208 | struct fib6_node *root, *node; | 226 | struct fib6_node *root, *node; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 5fa2af00634a..27d83183e615 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef _NET_IP6_ROUTE_H | 1 | #ifndef _NET_IP6_ROUTE_H |
2 | #define _NET_IP6_ROUTE_H | 2 | #define _NET_IP6_ROUTE_H |
3 | 3 | ||
4 | #define IP6_RT_PRIO_USER 1024 | ||
5 | #define IP6_RT_PRIO_ADDRCONF 256 | ||
6 | |||
7 | struct route_info { | 4 | struct route_info { |
8 | __u8 type; | 5 | __u8 type; |
9 | __u8 length; | 6 | __u8 length; |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index ee75ccdf5188..68c69d54d392 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -22,7 +22,10 @@ | |||
22 | #include <linux/ip.h> | 22 | #include <linux/ip.h> |
23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ | 23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ |
24 | #include <net/ipv6.h> | 24 | #include <net/ipv6.h> |
25 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 25 | #if IS_ENABLED(CONFIG_IP_VS_IPV6) |
26 | #include <linux/netfilter_ipv6/ip6_tables.h> | ||
27 | #endif | ||
28 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) | ||
26 | #include <net/netfilter/nf_conntrack.h> | 29 | #include <net/netfilter/nf_conntrack.h> |
27 | #endif | 30 | #endif |
28 | #include <net/net_namespace.h> /* Netw namespace */ | 31 | #include <net/net_namespace.h> /* Netw namespace */ |
@@ -103,30 +106,117 @@ static inline struct net *seq_file_single_net(struct seq_file *seq) | |||
103 | /* Connections' size value needed by ip_vs_ctl.c */ | 106 | /* Connections' size value needed by ip_vs_ctl.c */ |
104 | extern int ip_vs_conn_tab_size; | 107 | extern int ip_vs_conn_tab_size; |
105 | 108 | ||
106 | |||
107 | struct ip_vs_iphdr { | 109 | struct ip_vs_iphdr { |
108 | int len; | 110 | __u32 len; /* IPv4 simply where L4 starts |
109 | __u8 protocol; | 111 | IPv6 where L4 Transport Header starts */ |
112 | __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */ | ||
113 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ | ||
114 | __s16 protocol; | ||
115 | __s32 flags; | ||
110 | union nf_inet_addr saddr; | 116 | union nf_inet_addr saddr; |
111 | union nf_inet_addr daddr; | 117 | union nf_inet_addr daddr; |
112 | }; | 118 | }; |
113 | 119 | ||
120 | /* Dependency to module: nf_defrag_ipv6 */ | ||
121 | #if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
122 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
123 | { | ||
124 | return skb->nfct_reasm; | ||
125 | } | ||
126 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
127 | int len, void *buffer, | ||
128 | const struct ip_vs_iphdr *ipvsh) | ||
129 | { | ||
130 | if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb))) | ||
131 | return skb_header_pointer(skb_nfct_reasm(skb), | ||
132 | ipvsh->thoff_reasm, len, buffer); | ||
133 | |||
134 | return skb_header_pointer(skb, offset, len, buffer); | ||
135 | } | ||
136 | #else | ||
137 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
138 | { | ||
139 | return NULL; | ||
140 | } | ||
141 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
142 | int len, void *buffer, | ||
143 | const struct ip_vs_iphdr *ipvsh) | ||
144 | { | ||
145 | return skb_header_pointer(skb, offset, len, buffer); | ||
146 | } | ||
147 | #endif | ||
148 | |||
114 | static inline void | 149 | static inline void |
115 | ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr) | 150 | ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) |
151 | { | ||
152 | const struct iphdr *iph = nh; | ||
153 | |||
154 | iphdr->len = iph->ihl * 4; | ||
155 | iphdr->fragoffs = 0; | ||
156 | iphdr->protocol = iph->protocol; | ||
157 | iphdr->saddr.ip = iph->saddr; | ||
158 | iphdr->daddr.ip = iph->daddr; | ||
159 | } | ||
160 | |||
161 | /* This function handles filling *ip_vs_iphdr, both for IPv4 and IPv6. | ||
162 | * IPv6 requires some extra work, as finding proper header position, | ||
163 | * depend on the IPv6 extension headers. | ||
164 | */ | ||
165 | static inline void | ||
166 | ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr) | ||
116 | { | 167 | { |
117 | #ifdef CONFIG_IP_VS_IPV6 | 168 | #ifdef CONFIG_IP_VS_IPV6 |
118 | if (af == AF_INET6) { | 169 | if (af == AF_INET6) { |
119 | const struct ipv6hdr *iph = nh; | 170 | const struct ipv6hdr *iph = |
120 | iphdr->len = sizeof(struct ipv6hdr); | 171 | (struct ipv6hdr *)skb_network_header(skb); |
121 | iphdr->protocol = iph->nexthdr; | ||
122 | iphdr->saddr.in6 = iph->saddr; | 172 | iphdr->saddr.in6 = iph->saddr; |
123 | iphdr->daddr.in6 = iph->daddr; | 173 | iphdr->daddr.in6 = iph->daddr; |
174 | /* ipv6_find_hdr() updates len, flags, thoff_reasm */ | ||
175 | iphdr->thoff_reasm = 0; | ||
176 | iphdr->len = 0; | ||
177 | iphdr->flags = 0; | ||
178 | iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, | ||
179 | &iphdr->fragoffs, | ||
180 | &iphdr->flags); | ||
181 | /* get proto from re-assembled packet and it's offset */ | ||
182 | if (skb_nfct_reasm(skb)) | ||
183 | iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb), | ||
184 | &iphdr->thoff_reasm, | ||
185 | -1, NULL, NULL); | ||
186 | |||
124 | } else | 187 | } else |
125 | #endif | 188 | #endif |
126 | { | 189 | { |
127 | const struct iphdr *iph = nh; | 190 | const struct iphdr *iph = |
128 | iphdr->len = iph->ihl * 4; | 191 | (struct iphdr *)skb_network_header(skb); |
129 | iphdr->protocol = iph->protocol; | 192 | iphdr->len = iph->ihl * 4; |
193 | iphdr->fragoffs = 0; | ||
194 | iphdr->protocol = iph->protocol; | ||
195 | iphdr->saddr.ip = iph->saddr; | ||
196 | iphdr->daddr.ip = iph->daddr; | ||
197 | } | ||
198 | } | ||
199 | |||
200 | /* This function is a faster version of ip_vs_fill_iph_skb(). | ||
201 | * Where we only populate {s,d}addr (and avoid calling ipv6_find_hdr()). | ||
202 | * This is used by the some of the ip_vs_*_schedule() functions. | ||
203 | * (Mostly done to avoid ABI breakage of external schedulers) | ||
204 | */ | ||
205 | static inline void | ||
206 | ip_vs_fill_iph_addr_only(int af, const struct sk_buff *skb, | ||
207 | struct ip_vs_iphdr *iphdr) | ||
208 | { | ||
209 | #ifdef CONFIG_IP_VS_IPV6 | ||
210 | if (af == AF_INET6) { | ||
211 | const struct ipv6hdr *iph = | ||
212 | (struct ipv6hdr *)skb_network_header(skb); | ||
213 | iphdr->saddr.in6 = iph->saddr; | ||
214 | iphdr->daddr.in6 = iph->daddr; | ||
215 | } else | ||
216 | #endif | ||
217 | { | ||
218 | const struct iphdr *iph = | ||
219 | (struct iphdr *)skb_network_header(skb); | ||
130 | iphdr->saddr.ip = iph->saddr; | 220 | iphdr->saddr.ip = iph->saddr; |
131 | iphdr->daddr.ip = iph->daddr; | 221 | iphdr->daddr.ip = iph->daddr; |
132 | } | 222 | } |
@@ -165,7 +255,7 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
165 | int len; | 255 | int len; |
166 | #ifdef CONFIG_IP_VS_IPV6 | 256 | #ifdef CONFIG_IP_VS_IPV6 |
167 | if (af == AF_INET6) | 257 | if (af == AF_INET6) |
168 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", | 258 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]", |
169 | &addr->in6) + 1; | 259 | &addr->in6) + 1; |
170 | else | 260 | else |
171 | #endif | 261 | #endif |
@@ -398,27 +488,26 @@ struct ip_vs_protocol { | |||
398 | 488 | ||
399 | int (*conn_schedule)(int af, struct sk_buff *skb, | 489 | int (*conn_schedule)(int af, struct sk_buff *skb, |
400 | struct ip_vs_proto_data *pd, | 490 | struct ip_vs_proto_data *pd, |
401 | int *verdict, struct ip_vs_conn **cpp); | 491 | int *verdict, struct ip_vs_conn **cpp, |
492 | struct ip_vs_iphdr *iph); | ||
402 | 493 | ||
403 | struct ip_vs_conn * | 494 | struct ip_vs_conn * |
404 | (*conn_in_get)(int af, | 495 | (*conn_in_get)(int af, |
405 | const struct sk_buff *skb, | 496 | const struct sk_buff *skb, |
406 | const struct ip_vs_iphdr *iph, | 497 | const struct ip_vs_iphdr *iph, |
407 | unsigned int proto_off, | ||
408 | int inverse); | 498 | int inverse); |
409 | 499 | ||
410 | struct ip_vs_conn * | 500 | struct ip_vs_conn * |
411 | (*conn_out_get)(int af, | 501 | (*conn_out_get)(int af, |
412 | const struct sk_buff *skb, | 502 | const struct sk_buff *skb, |
413 | const struct ip_vs_iphdr *iph, | 503 | const struct ip_vs_iphdr *iph, |
414 | unsigned int proto_off, | ||
415 | int inverse); | 504 | int inverse); |
416 | 505 | ||
417 | int (*snat_handler)(struct sk_buff *skb, | 506 | int (*snat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp, |
418 | struct ip_vs_protocol *pp, struct ip_vs_conn *cp); | 507 | struct ip_vs_conn *cp, struct ip_vs_iphdr *iph); |
419 | 508 | ||
420 | int (*dnat_handler)(struct sk_buff *skb, | 509 | int (*dnat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp, |
421 | struct ip_vs_protocol *pp, struct ip_vs_conn *cp); | 510 | struct ip_vs_conn *cp, struct ip_vs_iphdr *iph); |
422 | 511 | ||
423 | int (*csum_check)(int af, struct sk_buff *skb, | 512 | int (*csum_check)(int af, struct sk_buff *skb, |
424 | struct ip_vs_protocol *pp); | 513 | struct ip_vs_protocol *pp); |
@@ -518,7 +607,7 @@ struct ip_vs_conn { | |||
518 | NF_ACCEPT can be returned when destination is local. | 607 | NF_ACCEPT can be returned when destination is local. |
519 | */ | 608 | */ |
520 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, | 609 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, |
521 | struct ip_vs_protocol *pp); | 610 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
522 | 611 | ||
523 | /* Note: we can group the following members into a structure, | 612 | /* Note: we can group the following members into a structure, |
524 | in order to save more space, and the following members are | 613 | in order to save more space, and the following members are |
@@ -769,13 +858,11 @@ struct ip_vs_app { | |||
769 | 858 | ||
770 | struct ip_vs_conn * | 859 | struct ip_vs_conn * |
771 | (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, | 860 | (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, |
772 | const struct iphdr *iph, unsigned int proto_off, | 861 | const struct iphdr *iph, int inverse); |
773 | int inverse); | ||
774 | 862 | ||
775 | struct ip_vs_conn * | 863 | struct ip_vs_conn * |
776 | (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, | 864 | (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, |
777 | const struct iphdr *iph, unsigned int proto_off, | 865 | const struct iphdr *iph, int inverse); |
778 | int inverse); | ||
779 | 866 | ||
780 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 867 | int (*state_transition)(struct ip_vs_conn *cp, int direction, |
781 | const struct sk_buff *skb, | 868 | const struct sk_buff *skb, |
@@ -1074,14 +1161,12 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); | |||
1074 | 1161 | ||
1075 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 1162 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
1076 | const struct ip_vs_iphdr *iph, | 1163 | const struct ip_vs_iphdr *iph, |
1077 | unsigned int proto_off, | ||
1078 | int inverse); | 1164 | int inverse); |
1079 | 1165 | ||
1080 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); | 1166 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
1081 | 1167 | ||
1082 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 1168 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
1083 | const struct ip_vs_iphdr *iph, | 1169 | const struct ip_vs_iphdr *iph, |
1084 | unsigned int proto_off, | ||
1085 | int inverse); | 1170 | int inverse); |
1086 | 1171 | ||
1087 | /* put back the conn without restarting its timer */ | 1172 | /* put back the conn without restarting its timer */ |
@@ -1254,9 +1339,10 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | |||
1254 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 1339 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
1255 | extern struct ip_vs_conn * | 1340 | extern struct ip_vs_conn * |
1256 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | 1341 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
1257 | struct ip_vs_proto_data *pd, int *ignored); | 1342 | struct ip_vs_proto_data *pd, int *ignored, |
1343 | struct ip_vs_iphdr *iph); | ||
1258 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 1344 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
1259 | struct ip_vs_proto_data *pd); | 1345 | struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph); |
1260 | 1346 | ||
1261 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | 1347 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); |
1262 | 1348 | ||
@@ -1315,33 +1401,38 @@ extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst, | |||
1315 | /* | 1401 | /* |
1316 | * Various IPVS packet transmitters (from ip_vs_xmit.c) | 1402 | * Various IPVS packet transmitters (from ip_vs_xmit.c) |
1317 | */ | 1403 | */ |
1318 | extern int ip_vs_null_xmit | 1404 | extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1319 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1405 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1320 | extern int ip_vs_bypass_xmit | 1406 | extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1321 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1407 | struct ip_vs_protocol *pp, |
1322 | extern int ip_vs_nat_xmit | 1408 | struct ip_vs_iphdr *iph); |
1323 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1409 | extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1324 | extern int ip_vs_tunnel_xmit | 1410 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1325 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1411 | extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1326 | extern int ip_vs_dr_xmit | 1412 | struct ip_vs_protocol *pp, |
1327 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1413 | struct ip_vs_iphdr *iph); |
1328 | extern int ip_vs_icmp_xmit | 1414 | extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1329 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1415 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1330 | int offset, unsigned int hooknum); | 1416 | extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1417 | struct ip_vs_protocol *pp, int offset, | ||
1418 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
1331 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); | 1419 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); |
1332 | 1420 | ||
1333 | #ifdef CONFIG_IP_VS_IPV6 | 1421 | #ifdef CONFIG_IP_VS_IPV6 |
1334 | extern int ip_vs_bypass_xmit_v6 | 1422 | extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1335 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1423 | struct ip_vs_protocol *pp, |
1336 | extern int ip_vs_nat_xmit_v6 | 1424 | struct ip_vs_iphdr *iph); |
1337 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1425 | extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1338 | extern int ip_vs_tunnel_xmit_v6 | 1426 | struct ip_vs_protocol *pp, |
1339 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1427 | struct ip_vs_iphdr *iph); |
1340 | extern int ip_vs_dr_xmit_v6 | 1428 | extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1341 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1429 | struct ip_vs_protocol *pp, |
1342 | extern int ip_vs_icmp_xmit_v6 | 1430 | struct ip_vs_iphdr *iph); |
1343 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1431 | extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1344 | int offset, unsigned int hooknum); | 1432 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1433 | extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | ||
1434 | struct ip_vs_protocol *pp, int offset, | ||
1435 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
1345 | #endif | 1436 | #endif |
1346 | 1437 | ||
1347 | #ifdef CONFIG_SYSCTL | 1438 | #ifdef CONFIG_SYSCTL |
diff --git a/include/net/ipip.h b/include/net/ipip.h index ddc077c51f32..21947cf4fa46 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry { | |||
48 | struct rcu_head rcu_head; | 48 | struct rcu_head rcu_head; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #define __IPTUNNEL_XMIT(stats1, stats2) do { \ | 51 | static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev) |
52 | int err; \ | 52 | { |
53 | int pkt_len = skb->len - skb_transport_offset(skb); \ | 53 | int err; |
54 | \ | 54 | struct iphdr *iph = ip_hdr(skb); |
55 | skb->ip_summed = CHECKSUM_NONE; \ | 55 | int pkt_len = skb->len - skb_transport_offset(skb); |
56 | ip_select_ident(iph, &rt->dst, NULL); \ | 56 | struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); |
57 | \ | ||
58 | err = ip_local_out(skb); \ | ||
59 | if (likely(net_xmit_eval(err) == 0)) { \ | ||
60 | u64_stats_update_begin(&(stats1)->syncp); \ | ||
61 | (stats1)->tx_bytes += pkt_len; \ | ||
62 | (stats1)->tx_packets++; \ | ||
63 | u64_stats_update_end(&(stats1)->syncp); \ | ||
64 | } else { \ | ||
65 | (stats2)->tx_errors++; \ | ||
66 | (stats2)->tx_aborted_errors++; \ | ||
67 | } \ | ||
68 | } while (0) | ||
69 | 57 | ||
70 | #define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) | 58 | nf_reset(skb); |
59 | skb->ip_summed = CHECKSUM_NONE; | ||
60 | ip_select_ident(iph, skb_dst(skb), NULL); | ||
61 | |||
62 | err = ip_local_out(skb); | ||
63 | if (likely(net_xmit_eval(err) == 0)) { | ||
64 | u64_stats_update_begin(&tstats->syncp); | ||
65 | tstats->tx_bytes += pkt_len; | ||
66 | tstats->tx_packets++; | ||
67 | u64_stats_update_end(&tstats->syncp); | ||
68 | } else { | ||
69 | dev->stats.tx_errors++; | ||
70 | dev->stats.tx_aborted_errors++; | ||
71 | } | ||
72 | } | ||
71 | 73 | ||
72 | #endif | 74 | #endif |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 82558c8decf8..db7680acd0da 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -144,6 +144,39 @@ struct ieee80211_low_level_stats { | |||
144 | }; | 144 | }; |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * enum ieee80211_chanctx_change - change flag for channel context | ||
148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed | ||
149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed | ||
150 | */ | ||
151 | enum ieee80211_chanctx_change { | ||
152 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), | ||
153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | ||
154 | }; | ||
155 | |||
156 | /** | ||
157 | * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to | ||
158 | * | ||
159 | * This is the driver-visible part. The ieee80211_chanctx | ||
160 | * that contains it is visible in mac80211 only. | ||
161 | * | ||
162 | * @def: the channel definition | ||
163 | * @rx_chains_static: The number of RX chains that must always be | ||
164 | * active on the channel to receive MIMO transmissions | ||
165 | * @rx_chains_dynamic: The number of RX chains that must be enabled | ||
166 | * after RTS/CTS handshake to receive SMPS MIMO transmissions; | ||
167 | * this will always be >= @rx_chains_always. | ||
168 | * @drv_priv: data area for driver use, will always be aligned to | ||
169 | * sizeof(void *), size is determined in hw information. | ||
170 | */ | ||
171 | struct ieee80211_chanctx_conf { | ||
172 | struct cfg80211_chan_def def; | ||
173 | |||
174 | u8 rx_chains_static, rx_chains_dynamic; | ||
175 | |||
176 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
177 | }; | ||
178 | |||
179 | /** | ||
147 | * enum ieee80211_bss_change - BSS change notification flags | 180 | * enum ieee80211_bss_change - BSS change notification flags |
148 | * | 181 | * |
149 | * These flags are used with the bss_info_changed() callback | 182 | * These flags are used with the bss_info_changed() callback |
@@ -172,6 +205,9 @@ struct ieee80211_low_level_stats { | |||
172 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 205 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) |
173 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 206 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
174 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | 207 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) |
208 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | ||
209 | * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) | ||
210 | * changed (currently only in P2P client mode, GO mode will be later) | ||
175 | */ | 211 | */ |
176 | enum ieee80211_bss_change { | 212 | enum ieee80211_bss_change { |
177 | BSS_CHANGED_ASSOC = 1<<0, | 213 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -192,6 +228,8 @@ enum ieee80211_bss_change { | |||
192 | BSS_CHANGED_SSID = 1<<15, | 228 | BSS_CHANGED_SSID = 1<<15, |
193 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, | 229 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, |
194 | BSS_CHANGED_PS = 1<<17, | 230 | BSS_CHANGED_PS = 1<<17, |
231 | BSS_CHANGED_TXPOWER = 1<<18, | ||
232 | BSS_CHANGED_P2P_PS = 1<<19, | ||
195 | 233 | ||
196 | /* when adding here, make sure to change ieee80211_reconfig */ | 234 | /* when adding here, make sure to change ieee80211_reconfig */ |
197 | }; | 235 | }; |
@@ -223,6 +261,7 @@ enum ieee80211_rssi_event { | |||
223 | * @assoc: association status | 261 | * @assoc: association status |
224 | * @ibss_joined: indicates whether this station is part of an IBSS | 262 | * @ibss_joined: indicates whether this station is part of an IBSS |
225 | * or not | 263 | * or not |
264 | * @ibss_creator: indicates if a new IBSS network is being created | ||
226 | * @aid: association ID number, valid only when @assoc is true | 265 | * @aid: association ID number, valid only when @assoc is true |
227 | * @use_cts_prot: use CTS protection | 266 | * @use_cts_prot: use CTS protection |
228 | * @use_short_preamble: use 802.11b short preamble; | 267 | * @use_short_preamble: use 802.11b short preamble; |
@@ -247,9 +286,8 @@ enum ieee80211_rssi_event { | |||
247 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 286 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
248 | * @bssid: The BSSID for this BSS | 287 | * @bssid: The BSSID for this BSS |
249 | * @enable_beacon: whether beaconing should be enabled or not | 288 | * @enable_beacon: whether beaconing should be enabled or not |
250 | * @channel_type: Channel type for this BSS -- the hardware might be | 289 | * @chandef: Channel definition for this BSS -- the hardware might be |
251 | * configured for HT40+ while this BSS only uses no-HT, for | 290 | * configured a higher bandwidth than this BSS uses, for example. |
252 | * example. | ||
253 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. | 291 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. |
254 | * This field is only valid when the channel type is one of the HT types. | 292 | * This field is only valid when the channel type is one of the HT types. |
255 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 293 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
@@ -273,11 +311,15 @@ enum ieee80211_rssi_event { | |||
273 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 311 | * @ssid: The SSID of the current vif. Only valid in AP-mode. |
274 | * @ssid_len: Length of SSID given in @ssid. | 312 | * @ssid_len: Length of SSID given in @ssid. |
275 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 313 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
314 | * @txpower: TX power in dBm | ||
315 | * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces | ||
316 | * @p2p_oppps: P2P opportunistic PS is enabled | ||
276 | */ | 317 | */ |
277 | struct ieee80211_bss_conf { | 318 | struct ieee80211_bss_conf { |
278 | const u8 *bssid; | 319 | const u8 *bssid; |
279 | /* association related data */ | 320 | /* association related data */ |
280 | bool assoc, ibss_joined; | 321 | bool assoc, ibss_joined; |
322 | bool ibss_creator; | ||
281 | u16 aid; | 323 | u16 aid; |
282 | /* erp related data */ | 324 | /* erp related data */ |
283 | bool use_cts_prot; | 325 | bool use_cts_prot; |
@@ -294,7 +336,7 @@ struct ieee80211_bss_conf { | |||
294 | u16 ht_operation_mode; | 336 | u16 ht_operation_mode; |
295 | s32 cqm_rssi_thold; | 337 | s32 cqm_rssi_thold; |
296 | u32 cqm_rssi_hyst; | 338 | u32 cqm_rssi_hyst; |
297 | enum nl80211_channel_type channel_type; | 339 | struct cfg80211_chan_def chandef; |
298 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
299 | u8 arp_addr_cnt; | 341 | u8 arp_addr_cnt; |
300 | bool arp_filter_enabled; | 342 | bool arp_filter_enabled; |
@@ -304,6 +346,9 @@ struct ieee80211_bss_conf { | |||
304 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 346 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
305 | size_t ssid_len; | 347 | size_t ssid_len; |
306 | bool hidden_ssid; | 348 | bool hidden_ssid; |
349 | int txpower; | ||
350 | u8 p2p_ctwindow; | ||
351 | bool p2p_oppps; | ||
307 | }; | 352 | }; |
308 | 353 | ||
309 | /** | 354 | /** |
@@ -454,9 +499,14 @@ enum mac80211_tx_control_flags { | |||
454 | * This is set if the current BSS requires ERP protection. | 499 | * This is set if the current BSS requires ERP protection. |
455 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | 500 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. |
456 | * @IEEE80211_TX_RC_MCS: HT rate. | 501 | * @IEEE80211_TX_RC_MCS: HT rate. |
502 | * @IEEE80211_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is split | ||
503 | * into a higher 4 bits (Nss) and lower 4 bits (MCS number) | ||
457 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in | 504 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in |
458 | * Greenfield mode. | 505 | * Greenfield mode. |
459 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. | 506 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. |
507 | * @IEEE80211_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission | ||
508 | * @IEEE80211_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission | ||
509 | * (80+80 isn't supported yet) | ||
460 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the | 510 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the |
461 | * adjacent 20 MHz channels, if the current channel type is | 511 | * adjacent 20 MHz channels, if the current channel type is |
462 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | 512 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. |
@@ -467,12 +517,15 @@ enum mac80211_rate_control_flags { | |||
467 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 517 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
468 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), | 518 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), |
469 | 519 | ||
470 | /* rate index is an MCS rate number instead of an index */ | 520 | /* rate index is an HT/VHT MCS instead of an index */ |
471 | IEEE80211_TX_RC_MCS = BIT(3), | 521 | IEEE80211_TX_RC_MCS = BIT(3), |
472 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), | 522 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), |
473 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), | 523 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), |
474 | IEEE80211_TX_RC_DUP_DATA = BIT(6), | 524 | IEEE80211_TX_RC_DUP_DATA = BIT(6), |
475 | IEEE80211_TX_RC_SHORT_GI = BIT(7), | 525 | IEEE80211_TX_RC_SHORT_GI = BIT(7), |
526 | IEEE80211_TX_RC_VHT_MCS = BIT(8), | ||
527 | IEEE80211_TX_RC_80_MHZ_WIDTH = BIT(9), | ||
528 | IEEE80211_TX_RC_160_MHZ_WIDTH = BIT(10), | ||
476 | }; | 529 | }; |
477 | 530 | ||
478 | 531 | ||
@@ -515,10 +568,32 @@ enum mac80211_rate_control_flags { | |||
515 | */ | 568 | */ |
516 | struct ieee80211_tx_rate { | 569 | struct ieee80211_tx_rate { |
517 | s8 idx; | 570 | s8 idx; |
518 | u8 count; | 571 | u16 count:5, |
519 | u8 flags; | 572 | flags:11; |
520 | } __packed; | 573 | } __packed; |
521 | 574 | ||
575 | #define IEEE80211_MAX_TX_RETRY 31 | ||
576 | |||
577 | static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate, | ||
578 | u8 mcs, u8 nss) | ||
579 | { | ||
580 | WARN_ON(mcs & ~0xF); | ||
581 | WARN_ON(nss & ~0x7); | ||
582 | rate->idx = (nss << 4) | mcs; | ||
583 | } | ||
584 | |||
585 | static inline u8 | ||
586 | ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate) | ||
587 | { | ||
588 | return rate->idx & 0xF; | ||
589 | } | ||
590 | |||
591 | static inline u8 | ||
592 | ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) | ||
593 | { | ||
594 | return rate->idx >> 4; | ||
595 | } | ||
596 | |||
522 | /** | 597 | /** |
523 | * struct ieee80211_tx_info - skb transmit information | 598 | * struct ieee80211_tx_info - skb transmit information |
524 | * | 599 | * |
@@ -663,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
663 | * the frame. | 738 | * the frame. |
664 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on | 739 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on |
665 | * the frame. | 740 | * the frame. |
666 | * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime | 741 | * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime |
667 | * field) is valid and contains the time the first symbol of the MPDU | 742 | * field) is valid and contains the time the first symbol of the MPDU |
668 | * was received. This is useful in monitor mode and for proper IBSS | 743 | * was received. This is useful in monitor mode and for proper IBSS |
669 | * merging. | 744 | * merging. |
745 | * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime | ||
746 | * field) is valid and contains the time the last symbol of the MPDU | ||
747 | * (including FCS) was received. | ||
670 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 748 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
671 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 749 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
750 | * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index | ||
672 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 751 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
752 | * @RX_FLAG_80MHZ: 80 MHz was used | ||
753 | * @RX_FLAG_80P80MHZ: 80+80 MHz was used | ||
754 | * @RX_FLAG_160MHZ: 160 MHz was used | ||
673 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 755 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
674 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. | 756 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. |
675 | * Valid only for data frames (mainly A-MPDU) | 757 | * Valid only for data frames (mainly A-MPDU) |
@@ -697,7 +779,7 @@ enum mac80211_rx_flags { | |||
697 | RX_FLAG_IV_STRIPPED = BIT(4), | 779 | RX_FLAG_IV_STRIPPED = BIT(4), |
698 | RX_FLAG_FAILED_FCS_CRC = BIT(5), | 780 | RX_FLAG_FAILED_FCS_CRC = BIT(5), |
699 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), | 781 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), |
700 | RX_FLAG_MACTIME_MPDU = BIT(7), | 782 | RX_FLAG_MACTIME_START = BIT(7), |
701 | RX_FLAG_SHORTPRE = BIT(8), | 783 | RX_FLAG_SHORTPRE = BIT(8), |
702 | RX_FLAG_HT = BIT(9), | 784 | RX_FLAG_HT = BIT(9), |
703 | RX_FLAG_40MHZ = BIT(10), | 785 | RX_FLAG_40MHZ = BIT(10), |
@@ -711,6 +793,11 @@ enum mac80211_rx_flags { | |||
711 | RX_FLAG_AMPDU_IS_LAST = BIT(18), | 793 | RX_FLAG_AMPDU_IS_LAST = BIT(18), |
712 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | 794 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), |
713 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | 795 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), |
796 | RX_FLAG_MACTIME_END = BIT(21), | ||
797 | RX_FLAG_VHT = BIT(22), | ||
798 | RX_FLAG_80MHZ = BIT(23), | ||
799 | RX_FLAG_80P80MHZ = BIT(24), | ||
800 | RX_FLAG_160MHZ = BIT(25), | ||
714 | }; | 801 | }; |
715 | 802 | ||
716 | /** | 803 | /** |
@@ -731,25 +818,39 @@ enum mac80211_rx_flags { | |||
731 | * @IEEE80211_HW_SIGNAL_* | 818 | * @IEEE80211_HW_SIGNAL_* |
732 | * @antenna: antenna used | 819 | * @antenna: antenna used |
733 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 820 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
734 | * HT rates are use (RX_FLAG_HT) | 821 | * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT) |
822 | * @vht_nss: number of streams (VHT only) | ||
735 | * @flag: %RX_FLAG_* | 823 | * @flag: %RX_FLAG_* |
736 | * @rx_flags: internal RX flags for mac80211 | 824 | * @rx_flags: internal RX flags for mac80211 |
737 | * @ampdu_reference: A-MPDU reference number, must be a different value for | 825 | * @ampdu_reference: A-MPDU reference number, must be a different value for |
738 | * each A-MPDU but the same for each subframe within one A-MPDU | 826 | * each A-MPDU but the same for each subframe within one A-MPDU |
739 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC | 827 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC |
828 | * @vendor_radiotap_bitmap: radiotap vendor namespace presence bitmap | ||
829 | * @vendor_radiotap_len: radiotap vendor namespace length | ||
830 | * @vendor_radiotap_align: radiotap vendor namespace alignment. Note | ||
831 | * that the actual data must be at the start of the SKB data | ||
832 | * already. | ||
833 | * @vendor_radiotap_oui: radiotap vendor namespace OUI | ||
834 | * @vendor_radiotap_subns: radiotap vendor sub namespace | ||
740 | */ | 835 | */ |
741 | struct ieee80211_rx_status { | 836 | struct ieee80211_rx_status { |
742 | u64 mactime; | 837 | u64 mactime; |
743 | u32 device_timestamp; | 838 | u32 device_timestamp; |
744 | u32 ampdu_reference; | 839 | u32 ampdu_reference; |
745 | u32 flag; | 840 | u32 flag; |
841 | u32 vendor_radiotap_bitmap; | ||
842 | u16 vendor_radiotap_len; | ||
746 | u16 freq; | 843 | u16 freq; |
747 | u8 rate_idx; | 844 | u8 rate_idx; |
845 | u8 vht_nss; | ||
748 | u8 rx_flags; | 846 | u8 rx_flags; |
749 | u8 band; | 847 | u8 band; |
750 | u8 antenna; | 848 | u8 antenna; |
751 | s8 signal; | 849 | s8 signal; |
752 | u8 ampdu_delimiter_crc; | 850 | u8 ampdu_delimiter_crc; |
851 | u8 vendor_radiotap_align; | ||
852 | u8 vendor_radiotap_oui[3]; | ||
853 | u8 vendor_radiotap_subns; | ||
753 | }; | 854 | }; |
754 | 855 | ||
755 | /** | 856 | /** |
@@ -794,6 +895,8 @@ enum ieee80211_conf_flags { | |||
794 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 895 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
795 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 896 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
796 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | 897 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed |
898 | * Note that this is only valid if channel contexts are not used, | ||
899 | * otherwise each channel context has the number of chains listed. | ||
797 | */ | 900 | */ |
798 | enum ieee80211_conf_changed { | 901 | enum ieee80211_conf_changed { |
799 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | 902 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), |
@@ -845,7 +948,8 @@ enum ieee80211_smps_mode { | |||
845 | * powersave documentation below. This variable is valid only when | 948 | * powersave documentation below. This variable is valid only when |
846 | * the CONF_PS flag is set. | 949 | * the CONF_PS flag is set. |
847 | * | 950 | * |
848 | * @power_level: requested transmit power (in dBm) | 951 | * @power_level: requested transmit power (in dBm), backward compatibility |
952 | * value only that is set to the minimum of all interfaces | ||
849 | * | 953 | * |
850 | * @channel: the channel to tune to | 954 | * @channel: the channel to tune to |
851 | * @channel_type: the channel (HT) type | 955 | * @channel_type: the channel (HT) type |
@@ -859,7 +963,9 @@ enum ieee80211_smps_mode { | |||
859 | * | 963 | * |
860 | * @smps_mode: spatial multiplexing powersave mode; note that | 964 | * @smps_mode: spatial multiplexing powersave mode; note that |
861 | * %IEEE80211_SMPS_STATIC is used when the device is not | 965 | * %IEEE80211_SMPS_STATIC is used when the device is not |
862 | * configured for an HT channel | 966 | * configured for an HT channel. |
967 | * Note that this is only valid if channel contexts are not used, | ||
968 | * otherwise each channel context has the number of chains listed. | ||
863 | */ | 969 | */ |
864 | struct ieee80211_conf { | 970 | struct ieee80211_conf { |
865 | u32 flags; | 971 | u32 flags; |
@@ -931,6 +1037,11 @@ enum ieee80211_vif_flags { | |||
931 | * at runtime, mac80211 will never touch this field | 1037 | * at runtime, mac80211 will never touch this field |
932 | * @hw_queue: hardware queue for each AC | 1038 | * @hw_queue: hardware queue for each AC |
933 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only | 1039 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only |
1040 | * @chanctx_conf: The channel context this interface is assigned to, or %NULL | ||
1041 | * when it is not assigned. This pointer is RCU-protected due to the TX | ||
1042 | * path needing to access it; even though the netdev carrier will always | ||
1043 | * be off when it is %NULL there can still be races and packets could be | ||
1044 | * processed after it switches back to %NULL. | ||
934 | * @drv_priv: data area for driver use, will always be aligned to | 1045 | * @drv_priv: data area for driver use, will always be aligned to |
935 | * sizeof(void *). | 1046 | * sizeof(void *). |
936 | */ | 1047 | */ |
@@ -943,6 +1054,8 @@ struct ieee80211_vif { | |||
943 | u8 cab_queue; | 1054 | u8 cab_queue; |
944 | u8 hw_queue[IEEE80211_NUM_ACS]; | 1055 | u8 hw_queue[IEEE80211_NUM_ACS]; |
945 | 1056 | ||
1057 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; | ||
1058 | |||
946 | u32 driver_flags; | 1059 | u32 driver_flags; |
947 | 1060 | ||
948 | /* must be last */ | 1061 | /* must be last */ |
@@ -1076,6 +1189,8 @@ enum ieee80211_sta_state { | |||
1076 | * @aid: AID we assigned to the station if we're an AP | 1189 | * @aid: AID we assigned to the station if we're an AP |
1077 | * @supp_rates: Bitmap of supported rates (per band) | 1190 | * @supp_rates: Bitmap of supported rates (per band) |
1078 | * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities | 1191 | * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities |
1192 | * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities | ||
1193 | * of remote STA. Taking as is. | ||
1079 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. | 1194 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. |
1080 | * @drv_priv: data area for driver use, will always be aligned to | 1195 | * @drv_priv: data area for driver use, will always be aligned to |
1081 | * sizeof(void *), size is determined in hw information. | 1196 | * sizeof(void *), size is determined in hw information. |
@@ -1088,6 +1203,7 @@ struct ieee80211_sta { | |||
1088 | u8 addr[ETH_ALEN]; | 1203 | u8 addr[ETH_ALEN]; |
1089 | u16 aid; | 1204 | u16 aid; |
1090 | struct ieee80211_sta_ht_cap ht_cap; | 1205 | struct ieee80211_sta_ht_cap ht_cap; |
1206 | struct ieee80211_sta_vht_cap vht_cap; | ||
1091 | bool wme; | 1207 | bool wme; |
1092 | u8 uapsd_queues; | 1208 | u8 uapsd_queues; |
1093 | u8 max_sp; | 1209 | u8 max_sp; |
@@ -1325,6 +1441,8 @@ enum ieee80211_hw_flags { | |||
1325 | * within &struct ieee80211_vif. | 1441 | * within &struct ieee80211_vif. |
1326 | * @sta_data_size: size (in bytes) of the drv_priv data area | 1442 | * @sta_data_size: size (in bytes) of the drv_priv data area |
1327 | * within &struct ieee80211_sta. | 1443 | * within &struct ieee80211_sta. |
1444 | * @chanctx_data_size: size (in bytes) of the drv_priv data area | ||
1445 | * within &struct ieee80211_chanctx_conf. | ||
1328 | * | 1446 | * |
1329 | * @max_rates: maximum number of alternate rate retry stages the hw | 1447 | * @max_rates: maximum number of alternate rate retry stages the hw |
1330 | * can handle. | 1448 | * can handle. |
@@ -1369,6 +1487,7 @@ struct ieee80211_hw { | |||
1369 | int channel_change_time; | 1487 | int channel_change_time; |
1370 | int vif_data_size; | 1488 | int vif_data_size; |
1371 | int sta_data_size; | 1489 | int sta_data_size; |
1490 | int chanctx_data_size; | ||
1372 | int napi_weight; | 1491 | int napi_weight; |
1373 | u16 queues; | 1492 | u16 queues; |
1374 | u16 max_listen_interval; | 1493 | u16 max_listen_interval; |
@@ -2126,6 +2245,14 @@ enum ieee80211_rate_control_changed { | |||
2126 | * @sta_remove: Notifies low level driver about removal of an associated | 2245 | * @sta_remove: Notifies low level driver about removal of an associated |
2127 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2246 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
2128 | * | 2247 | * |
2248 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files | ||
2249 | * when a station is added to mac80211's station list. This callback | ||
2250 | * and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS | ||
2251 | * conditional. This callback can sleep. | ||
2252 | * | ||
2253 | * @sta_remove_debugfs: Remove the debugfs files which were added using | ||
2254 | * @sta_add_debugfs. This callback can sleep. | ||
2255 | * | ||
2129 | * @sta_notify: Notifies low level driver about power state transition of an | 2256 | * @sta_notify: Notifies low level driver about power state transition of an |
2130 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating | 2257 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating |
2131 | * in AP mode, this callback will not be called when the flag | 2258 | * in AP mode, this callback will not be called when the flag |
@@ -2317,6 +2444,27 @@ enum ieee80211_rate_control_changed { | |||
2317 | * The callback will be called before each transmission and upon return | 2444 | * The callback will be called before each transmission and upon return |
2318 | * mac80211 will transmit the frame right away. | 2445 | * mac80211 will transmit the frame right away. |
2319 | * The callback is optional and can (should!) sleep. | 2446 | * The callback is optional and can (should!) sleep. |
2447 | * | ||
2448 | * @add_chanctx: Notifies device driver about new channel context creation. | ||
2449 | * @remove_chanctx: Notifies device driver about channel context destruction. | ||
2450 | * @change_chanctx: Notifies device driver about channel context changes that | ||
2451 | * may happen when combining different virtual interfaces on the same | ||
2452 | * channel context with different settings | ||
2453 | * @assign_vif_chanctx: Notifies device driver about channel context being bound | ||
2454 | * to vif. Possible use is for hw queue remapping. | ||
2455 | * @unassign_vif_chanctx: Notifies device driver about channel context being | ||
2456 | * unbound from vif. | ||
2457 | * @start_ap: Start operation on the AP interface, this is called after all the | ||
2458 | * information in bss_conf is set and beacon can be retrieved. A channel | ||
2459 | * context is bound before this is called. Note that if the driver uses | ||
2460 | * software scan or ROC, this (and @stop_ap) isn't called when the AP is | ||
2461 | * just "paused" for scanning/ROC, which is indicated by the beacon being | ||
2462 | * disabled/enabled via @bss_info_changed. | ||
2463 | * @stop_ap: Stop operation on the AP interface. | ||
2464 | * | ||
2465 | * @restart_complete: Called after a call to ieee80211_restart_hw(), when the | ||
2466 | * reconfiguration has completed. This can help the driver implement the | ||
2467 | * reconfiguration step. This callback may sleep. | ||
2320 | */ | 2468 | */ |
2321 | struct ieee80211_ops { | 2469 | struct ieee80211_ops { |
2322 | void (*tx)(struct ieee80211_hw *hw, | 2470 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2342,6 +2490,9 @@ struct ieee80211_ops { | |||
2342 | struct ieee80211_bss_conf *info, | 2490 | struct ieee80211_bss_conf *info, |
2343 | u32 changed); | 2491 | u32 changed); |
2344 | 2492 | ||
2493 | int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2494 | void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2495 | |||
2345 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 2496 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
2346 | struct netdev_hw_addr_list *mc_list); | 2497 | struct netdev_hw_addr_list *mc_list); |
2347 | void (*configure_filter)(struct ieee80211_hw *hw, | 2498 | void (*configure_filter)(struct ieee80211_hw *hw, |
@@ -2383,6 +2534,16 @@ struct ieee80211_ops { | |||
2383 | struct ieee80211_sta *sta); | 2534 | struct ieee80211_sta *sta); |
2384 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2535 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2385 | struct ieee80211_sta *sta); | 2536 | struct ieee80211_sta *sta); |
2537 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
2538 | void (*sta_add_debugfs)(struct ieee80211_hw *hw, | ||
2539 | struct ieee80211_vif *vif, | ||
2540 | struct ieee80211_sta *sta, | ||
2541 | struct dentry *dir); | ||
2542 | void (*sta_remove_debugfs)(struct ieee80211_hw *hw, | ||
2543 | struct ieee80211_vif *vif, | ||
2544 | struct ieee80211_sta *sta, | ||
2545 | struct dentry *dir); | ||
2546 | #endif | ||
2386 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2547 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2387 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2548 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
2388 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2549 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
@@ -2424,8 +2585,8 @@ struct ieee80211_ops { | |||
2424 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | 2585 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); |
2425 | 2586 | ||
2426 | int (*remain_on_channel)(struct ieee80211_hw *hw, | 2587 | int (*remain_on_channel)(struct ieee80211_hw *hw, |
2588 | struct ieee80211_vif *vif, | ||
2427 | struct ieee80211_channel *chan, | 2589 | struct ieee80211_channel *chan, |
2428 | enum nl80211_channel_type channel_type, | ||
2429 | int duration); | 2590 | int duration); |
2430 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2591 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
2431 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2592 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
@@ -2461,6 +2622,22 @@ struct ieee80211_ops { | |||
2461 | 2622 | ||
2462 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, | 2623 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, |
2463 | struct ieee80211_vif *vif); | 2624 | struct ieee80211_vif *vif); |
2625 | |||
2626 | int (*add_chanctx)(struct ieee80211_hw *hw, | ||
2627 | struct ieee80211_chanctx_conf *ctx); | ||
2628 | void (*remove_chanctx)(struct ieee80211_hw *hw, | ||
2629 | struct ieee80211_chanctx_conf *ctx); | ||
2630 | void (*change_chanctx)(struct ieee80211_hw *hw, | ||
2631 | struct ieee80211_chanctx_conf *ctx, | ||
2632 | u32 changed); | ||
2633 | int (*assign_vif_chanctx)(struct ieee80211_hw *hw, | ||
2634 | struct ieee80211_vif *vif, | ||
2635 | struct ieee80211_chanctx_conf *ctx); | ||
2636 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, | ||
2637 | struct ieee80211_vif *vif, | ||
2638 | struct ieee80211_chanctx_conf *ctx); | ||
2639 | |||
2640 | void (*restart_complete)(struct ieee80211_hw *hw); | ||
2464 | }; | 2641 | }; |
2465 | 2642 | ||
2466 | /** | 2643 | /** |
@@ -3145,6 +3322,19 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, | |||
3145 | struct sk_buff *skb, u8 *p2k); | 3322 | struct sk_buff *skb, u8 *p2k); |
3146 | 3323 | ||
3147 | /** | 3324 | /** |
3325 | * ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys | ||
3326 | * | ||
3327 | * This function computes the two AES-CMAC sub-keys, based on the | ||
3328 | * previously installed master key. | ||
3329 | * | ||
3330 | * @keyconf: the parameter passed with the set key | ||
3331 | * @k1: a buffer to be filled with the 1st sub-key | ||
3332 | * @k2: a buffer to be filled with the 2nd sub-key | ||
3333 | */ | ||
3334 | void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf, | ||
3335 | u8 *k1, u8 *k2); | ||
3336 | |||
3337 | /** | ||
3148 | * struct ieee80211_key_seq - key sequence counter | 3338 | * struct ieee80211_key_seq - key sequence counter |
3149 | * | 3339 | * |
3150 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order | 3340 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order |
@@ -3294,6 +3484,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | |||
3294 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | 3484 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); |
3295 | 3485 | ||
3296 | /** | 3486 | /** |
3487 | * enum ieee80211_interface_iteration_flags - interface iteration flags | ||
3488 | * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have | ||
3489 | * been added to the driver; However, note that during hardware | ||
3490 | * reconfiguration (after restart_hw) it will iterate over a new | ||
3491 | * interface and over all the existing interfaces even if they | ||
3492 | * haven't been re-added to the driver yet. | ||
3493 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | ||
3494 | * interfaces, even if they haven't been re-added to the driver yet. | ||
3495 | */ | ||
3496 | enum ieee80211_interface_iteration_flags { | ||
3497 | IEEE80211_IFACE_ITER_NORMAL = 0, | ||
3498 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | ||
3499 | }; | ||
3500 | |||
3501 | /** | ||
3297 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 3502 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
3298 | * | 3503 | * |
3299 | * This function iterates over the interfaces associated with a given | 3504 | * This function iterates over the interfaces associated with a given |
@@ -3301,13 +3506,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
3301 | * This function allows the iterator function to sleep, when the iterator | 3506 | * This function allows the iterator function to sleep, when the iterator |
3302 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 3507 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
3303 | * be used. | 3508 | * be used. |
3304 | * Does not iterate over a new interface during add_interface() | 3509 | * Does not iterate over a new interface during add_interface(). |
3305 | * | 3510 | * |
3306 | * @hw: the hardware struct of which the interfaces should be iterated over | 3511 | * @hw: the hardware struct of which the interfaces should be iterated over |
3512 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3307 | * @iterator: the iterator function to call | 3513 | * @iterator: the iterator function to call |
3308 | * @data: first argument of the iterator function | 3514 | * @data: first argument of the iterator function |
3309 | */ | 3515 | */ |
3310 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 3516 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, |
3517 | u32 iter_flags, | ||
3311 | void (*iterator)(void *data, u8 *mac, | 3518 | void (*iterator)(void *data, u8 *mac, |
3312 | struct ieee80211_vif *vif), | 3519 | struct ieee80211_vif *vif), |
3313 | void *data); | 3520 | void *data); |
@@ -3319,13 +3526,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
3319 | * hardware that are currently active and calls the callback for them. | 3526 | * hardware that are currently active and calls the callback for them. |
3320 | * This function requires the iterator callback function to be atomic, | 3527 | * This function requires the iterator callback function to be atomic, |
3321 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 3528 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
3322 | * Does not iterate over a new interface during add_interface() | 3529 | * Does not iterate over a new interface during add_interface(). |
3323 | * | 3530 | * |
3324 | * @hw: the hardware struct of which the interfaces should be iterated over | 3531 | * @hw: the hardware struct of which the interfaces should be iterated over |
3532 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3325 | * @iterator: the iterator function to call, cannot sleep | 3533 | * @iterator: the iterator function to call, cannot sleep |
3326 | * @data: first argument of the iterator function | 3534 | * @data: first argument of the iterator function |
3327 | */ | 3535 | */ |
3328 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | 3536 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, |
3537 | u32 iter_flags, | ||
3329 | void (*iterator)(void *data, | 3538 | void (*iterator)(void *data, |
3330 | u8 *mac, | 3539 | u8 *mac, |
3331 | struct ieee80211_vif *vif), | 3540 | struct ieee80211_vif *vif), |
@@ -3524,6 +3733,27 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw, | |||
3524 | void *iter_data); | 3733 | void *iter_data); |
3525 | 3734 | ||
3526 | /** | 3735 | /** |
3736 | * ieee80211_iter_chan_contexts_atomic - iterate channel contexts | ||
3737 | * @hw: pointre obtained from ieee80211_alloc_hw(). | ||
3738 | * @iter: iterator function | ||
3739 | * @iter_data: data passed to iterator function | ||
3740 | * | ||
3741 | * Iterate all active channel contexts. This function is atomic and | ||
3742 | * doesn't acquire any locks internally that might be held in other | ||
3743 | * places while calling into the driver. | ||
3744 | * | ||
3745 | * The iterator will not find a context that's being added (during | ||
3746 | * the driver callback to add it) but will find it while it's being | ||
3747 | * removed. | ||
3748 | */ | ||
3749 | void ieee80211_iter_chan_contexts_atomic( | ||
3750 | struct ieee80211_hw *hw, | ||
3751 | void (*iter)(struct ieee80211_hw *hw, | ||
3752 | struct ieee80211_chanctx_conf *chanctx_conf, | ||
3753 | void *data), | ||
3754 | void *iter_data); | ||
3755 | |||
3756 | /** | ||
3527 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | 3757 | * ieee80211_ap_probereq_get - retrieve a Probe Request template |
3528 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 3758 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
3529 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3759 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 95e646641184..c5a43f56b796 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #endif | 23 | #endif |
24 | #include <net/netns/xfrm.h> | 24 | #include <net/netns/xfrm.h> |
25 | 25 | ||
26 | struct user_namespace; | ||
26 | struct proc_dir_entry; | 27 | struct proc_dir_entry; |
27 | struct net_device; | 28 | struct net_device; |
28 | struct sock; | 29 | struct sock; |
@@ -53,6 +54,8 @@ struct net { | |||
53 | struct list_head cleanup_list; /* namespaces on death row */ | 54 | struct list_head cleanup_list; /* namespaces on death row */ |
54 | struct list_head exit_list; /* Use only net_mutex */ | 55 | struct list_head exit_list; /* Use only net_mutex */ |
55 | 56 | ||
57 | struct user_namespace *user_ns; /* Owning user namespace */ | ||
58 | |||
56 | struct proc_dir_entry *proc_net; | 59 | struct proc_dir_entry *proc_net; |
57 | struct proc_dir_entry *proc_net_stat; | 60 | struct proc_dir_entry *proc_net_stat; |
58 | 61 | ||
@@ -126,16 +129,21 @@ struct net { | |||
126 | /* Init's network namespace */ | 129 | /* Init's network namespace */ |
127 | extern struct net init_net; | 130 | extern struct net init_net; |
128 | 131 | ||
129 | #ifdef CONFIG_NET | 132 | #ifdef CONFIG_NET_NS |
130 | extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); | 133 | extern struct net *copy_net_ns(unsigned long flags, |
131 | 134 | struct user_namespace *user_ns, struct net *old_net); | |
132 | #else /* CONFIG_NET */ | 135 | |
133 | static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | 136 | #else /* CONFIG_NET_NS */ |
137 | #include <linux/sched.h> | ||
138 | #include <linux/nsproxy.h> | ||
139 | static inline struct net *copy_net_ns(unsigned long flags, | ||
140 | struct user_namespace *user_ns, struct net *old_net) | ||
134 | { | 141 | { |
135 | /* There is nothing to copy so this is a noop */ | 142 | if (flags & CLONE_NEWNET) |
136 | return net_ns; | 143 | return ERR_PTR(-EINVAL); |
144 | return old_net; | ||
137 | } | 145 | } |
138 | #endif /* CONFIG_NET */ | 146 | #endif /* CONFIG_NET_NS */ |
139 | 147 | ||
140 | 148 | ||
141 | extern struct list_head net_namespace_list; | 149 | extern struct list_head net_namespace_list; |
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h index 5e5eb1f9f14b..3573a81815ad 100644 --- a/include/net/netns/sctp.h +++ b/include/net/netns/sctp.h | |||
@@ -62,6 +62,9 @@ struct netns_sctp { | |||
62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ | 62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ |
63 | int cookie_preserve_enable; | 63 | int cookie_preserve_enable; |
64 | 64 | ||
65 | /* The namespace default hmac alg */ | ||
66 | char *sctp_hmac_alg; | ||
67 | |||
65 | /* Valid.Cookie.Life - 60 seconds */ | 68 | /* Valid.Cookie.Life - 60 seconds */ |
66 | unsigned int valid_cookie_life; | 69 | unsigned int valid_cookie_life; |
67 | 70 | ||
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index e900072950cb..671953e11575 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -24,6 +24,12 @@ | |||
24 | 24 | ||
25 | #include <net/nfc/nfc.h> | 25 | #include <net/nfc/nfc.h> |
26 | 26 | ||
27 | struct nfc_phy_ops { | ||
28 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
29 | int (*enable)(void *dev_id); | ||
30 | void (*disable)(void *dev_id); | ||
31 | }; | ||
32 | |||
27 | struct nfc_hci_dev; | 33 | struct nfc_hci_dev; |
28 | 34 | ||
29 | struct nfc_hci_ops { | 35 | struct nfc_hci_ops { |
@@ -38,15 +44,21 @@ struct nfc_hci_ops { | |||
38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 44 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
39 | int (*start_poll) (struct nfc_hci_dev *hdev, | 45 | int (*start_poll) (struct nfc_hci_dev *hdev, |
40 | u32 im_protocols, u32 tm_protocols); | 46 | u32 im_protocols, u32 tm_protocols); |
47 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, | ||
48 | u8 comm_mode, u8 *gb, size_t gb_len); | ||
49 | int (*dep_link_down)(struct nfc_hci_dev *hdev); | ||
41 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 50 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
42 | struct nfc_target *target); | 51 | struct nfc_target *target); |
43 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 52 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
44 | struct nfc_target *target); | 53 | struct nfc_target *target); |
45 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 54 | int (*im_transceive) (struct nfc_hci_dev *hdev, |
46 | struct nfc_target *target, struct sk_buff *skb, | 55 | struct nfc_target *target, struct sk_buff *skb, |
47 | data_exchange_cb_t cb, void *cb_context); | 56 | data_exchange_cb_t cb, void *cb_context); |
57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
48 | int (*check_presence)(struct nfc_hci_dev *hdev, | 58 | int (*check_presence)(struct nfc_hci_dev *hdev, |
49 | struct nfc_target *target); | 59 | struct nfc_target *target); |
60 | void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | ||
61 | struct sk_buff *skb); | ||
50 | }; | 62 | }; |
51 | 63 | ||
52 | /* Pipes */ | 64 | /* Pipes */ |
@@ -114,6 +126,9 @@ struct nfc_hci_dev { | |||
114 | int async_cb_type; | 126 | int async_cb_type; |
115 | data_exchange_cb_t async_cb; | 127 | data_exchange_cb_t async_cb; |
116 | void *async_cb_context; | 128 | void *async_cb_context; |
129 | |||
130 | u8 *gb; | ||
131 | size_t gb_len; | ||
117 | }; | 132 | }; |
118 | 133 | ||
119 | /* hci device allocation */ | 134 | /* hci device allocation */ |
@@ -134,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
134 | 149 | ||
135 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | 150 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); |
136 | 151 | ||
152 | int nfc_hci_result_to_errno(u8 result); | ||
153 | |||
137 | /* Host IDs */ | 154 | /* Host IDs */ |
138 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 155 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
139 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | 156 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 |
@@ -219,5 +236,7 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
219 | const u8 *param, size_t param_len); | 236 | const u8 *param, size_t param_len); |
220 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 237 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
221 | const u8 *param, size_t param_len); | 238 | const u8 *param, size_t param_len); |
239 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | ||
240 | u32 nfc_hci_sak_to_protocol(u8 sak); | ||
222 | 241 | ||
223 | #endif /* __NET_HCI_H */ | 242 | #endif /* __NET_HCI_H */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f05b10682c9d..fce80b2f9be7 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -95,7 +95,7 @@ struct nfc_genl_data { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct nfc_dev { | 97 | struct nfc_dev { |
98 | unsigned int idx; | 98 | int idx; |
99 | u32 target_next_idx; | 99 | u32 target_next_idx; |
100 | struct nfc_target *targets; | 100 | struct nfc_target *targets; |
101 | int n_targets; | 101 | int n_targets; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 929528c73fe8..047c0476c0a0 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -25,9 +25,11 @@ | |||
25 | #define _PROTOCOL_H | 25 | #define _PROTOCOL_H |
26 | 26 | ||
27 | #include <linux/in6.h> | 27 | #include <linux/in6.h> |
28 | #include <linux/skbuff.h> | ||
28 | #if IS_ENABLED(CONFIG_IPV6) | 29 | #if IS_ENABLED(CONFIG_IPV6) |
29 | #include <linux/ipv6.h> | 30 | #include <linux/ipv6.h> |
30 | #endif | 31 | #endif |
32 | #include <linux/netdevice.h> | ||
31 | 33 | ||
32 | /* This is one larger than the largest protocol value that can be | 34 | /* This is one larger than the largest protocol value that can be |
33 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | 35 | * found in an ipv4 or ipv6 header. Since in both cases the protocol |
@@ -40,12 +42,6 @@ struct net_protocol { | |||
40 | void (*early_demux)(struct sk_buff *skb); | 42 | void (*early_demux)(struct sk_buff *skb); |
41 | int (*handler)(struct sk_buff *skb); | 43 | int (*handler)(struct sk_buff *skb); |
42 | void (*err_handler)(struct sk_buff *skb, u32 info); | 44 | void (*err_handler)(struct sk_buff *skb, u32 info); |
43 | int (*gso_send_check)(struct sk_buff *skb); | ||
44 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
45 | netdev_features_t features); | ||
46 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
47 | struct sk_buff *skb); | ||
48 | int (*gro_complete)(struct sk_buff *skb); | ||
49 | unsigned int no_policy:1, | 45 | unsigned int no_policy:1, |
50 | netns_ok:1; | 46 | netns_ok:1; |
51 | }; | 47 | }; |
@@ -60,23 +56,20 @@ struct inet6_protocol { | |||
60 | struct inet6_skb_parm *opt, | 56 | struct inet6_skb_parm *opt, |
61 | u8 type, u8 code, int offset, | 57 | u8 type, u8 code, int offset, |
62 | __be32 info); | 58 | __be32 info); |
63 | |||
64 | int (*gso_send_check)(struct sk_buff *skb); | ||
65 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
66 | netdev_features_t features); | ||
67 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
68 | struct sk_buff *skb); | ||
69 | int (*gro_complete)(struct sk_buff *skb); | ||
70 | |||
71 | unsigned int flags; /* INET6_PROTO_xxx */ | 59 | unsigned int flags; /* INET6_PROTO_xxx */ |
72 | }; | 60 | }; |
73 | 61 | ||
74 | #define INET6_PROTO_NOPOLICY 0x1 | 62 | #define INET6_PROTO_NOPOLICY 0x1 |
75 | #define INET6_PROTO_FINAL 0x2 | 63 | #define INET6_PROTO_FINAL 0x2 |
76 | /* This should be set for any extension header which is compatible with GSO. */ | ||
77 | #define INET6_PROTO_GSO_EXTHDR 0x4 | ||
78 | #endif | 64 | #endif |
79 | 65 | ||
66 | struct net_offload { | ||
67 | struct offload_callbacks callbacks; | ||
68 | unsigned int flags; /* Flags used by IPv6 for now */ | ||
69 | }; | ||
70 | /* This should be set for any extension header which is compatible with GSO. */ | ||
71 | #define INET6_PROTO_GSO_EXTHDR 0x1 | ||
72 | |||
80 | /* This is used to register socket interfaces for IP protocols. */ | 73 | /* This is used to register socket interfaces for IP protocols. */ |
81 | struct inet_protosw { | 74 | struct inet_protosw { |
82 | struct list_head list; | 75 | struct list_head list; |
@@ -96,6 +89,8 @@ struct inet_protosw { | |||
96 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ | 89 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ |
97 | 90 | ||
98 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; | 91 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; |
92 | extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS]; | ||
93 | extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS]; | ||
99 | 94 | ||
100 | #if IS_ENABLED(CONFIG_IPV6) | 95 | #if IS_ENABLED(CONFIG_IPV6) |
101 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | 96 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; |
@@ -103,6 +98,8 @@ extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | |||
103 | 98 | ||
104 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); | 99 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); |
105 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); | 100 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); |
101 | extern int inet_add_offload(const struct net_offload *prot, unsigned char num); | ||
102 | extern int inet_del_offload(const struct net_offload *prot, unsigned char num); | ||
106 | extern void inet_register_protosw(struct inet_protosw *p); | 103 | extern void inet_register_protosw(struct inet_protosw *p); |
107 | extern void inet_unregister_protosw(struct inet_protosw *p); | 104 | extern void inet_unregister_protosw(struct inet_protosw *p); |
108 | 105 | ||
@@ -112,5 +109,7 @@ extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char n | |||
112 | extern int inet6_register_protosw(struct inet_protosw *p); | 109 | extern int inet6_register_protosw(struct inet_protosw *p); |
113 | extern void inet6_unregister_protosw(struct inet_protosw *p); | 110 | extern void inet6_unregister_protosw(struct inet_protosw *p); |
114 | #endif | 111 | #endif |
112 | extern int inet6_add_offload(const struct net_offload *prot, unsigned char num); | ||
113 | extern int inet6_del_offload(const struct net_offload *prot, unsigned char num); | ||
115 | 114 | ||
116 | #endif /* _PROTOCOL_H */ | 115 | #endif /* _PROTOCOL_H */ |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index b01d8dd9ee7c..a51dbd17c2de 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -49,13 +49,16 @@ struct request_sock_ops { | |||
49 | struct request_sock *req); | 49 | struct request_sock *req); |
50 | }; | 50 | }; |
51 | 51 | ||
52 | extern int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); | ||
53 | |||
52 | /* struct request_sock - mini sock to represent a connection request | 54 | /* struct request_sock - mini sock to represent a connection request |
53 | */ | 55 | */ |
54 | struct request_sock { | 56 | struct request_sock { |
55 | struct request_sock *dl_next; /* Must be first member! */ | 57 | struct request_sock *dl_next; /* Must be first member! */ |
56 | u16 mss; | 58 | u16 mss; |
57 | u8 retrans; | 59 | u8 num_retrans; /* number of retransmits */ |
58 | u8 cookie_ts; /* syncookie: encode tcpopts in timestamp */ | 60 | u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */ |
61 | u8 num_timeout:7; /* number of timeouts */ | ||
59 | /* The following two fields can be easily recomputed I think -AK */ | 62 | /* The following two fields can be easily recomputed I think -AK */ |
60 | u32 window_clamp; /* window clamp at creation time */ | 63 | u32 window_clamp; /* window clamp at creation time */ |
61 | u32 rcv_wnd; /* rcv_wnd offered first time */ | 64 | u32 rcv_wnd; /* rcv_wnd offered first time */ |
@@ -231,7 +234,7 @@ static inline int reqsk_queue_removed(struct request_sock_queue *queue, | |||
231 | { | 234 | { |
232 | struct listen_sock *lopt = queue->listen_opt; | 235 | struct listen_sock *lopt = queue->listen_opt; |
233 | 236 | ||
234 | if (req->retrans == 0) | 237 | if (req->num_timeout == 0) |
235 | --lopt->qlen_young; | 238 | --lopt->qlen_young; |
236 | 239 | ||
237 | return --lopt->qlen; | 240 | return --lopt->qlen; |
@@ -269,7 +272,8 @@ static inline void reqsk_queue_hash_req(struct request_sock_queue *queue, | |||
269 | struct listen_sock *lopt = queue->listen_opt; | 272 | struct listen_sock *lopt = queue->listen_opt; |
270 | 273 | ||
271 | req->expires = jiffies + timeout; | 274 | req->expires = jiffies + timeout; |
272 | req->retrans = 0; | 275 | req->num_retrans = 0; |
276 | req->num_timeout = 0; | ||
273 | req->sk = NULL; | 277 | req->sk = NULL; |
274 | req->dl_next = lopt->syn_table[hash]; | 278 | req->dl_next = lopt->syn_table[hash]; |
275 | 279 | ||
diff --git a/include/net/route.h b/include/net/route.h index bc40b633a5c4..2ea40c1b5e00 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -198,10 +198,13 @@ struct in_ifaddr; | |||
198 | extern void fib_add_ifaddr(struct in_ifaddr *); | 198 | extern void fib_add_ifaddr(struct in_ifaddr *); |
199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); | 199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); |
200 | 200 | ||
201 | static inline void ip_rt_put(struct rtable * rt) | 201 | static inline void ip_rt_put(struct rtable *rt) |
202 | { | 202 | { |
203 | if (rt) | 203 | /* dst_release() accepts a NULL parameter. |
204 | dst_release(&rt->dst); | 204 | * We rely on dst being first structure in struct rtable |
205 | */ | ||
206 | BUILD_BUG_ON(offsetof(struct rtable, dst) != 0); | ||
207 | dst_release(&rt->dst); | ||
205 | } | 208 | } |
206 | 209 | ||
207 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) | 210 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 712b3bebeda7..35247271e557 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -130,8 +130,6 @@ typedef union { | |||
130 | __be16 err; | 130 | __be16 err; |
131 | sctp_state_t state; | 131 | sctp_state_t state; |
132 | sctp_event_timeout_t to; | 132 | sctp_event_timeout_t to; |
133 | unsigned long zero; | ||
134 | void *ptr; | ||
135 | struct sctp_chunk *chunk; | 133 | struct sctp_chunk *chunk; |
136 | struct sctp_association *asoc; | 134 | struct sctp_association *asoc; |
137 | struct sctp_transport *transport; | 135 | struct sctp_transport *transport; |
@@ -154,23 +152,15 @@ typedef union { | |||
154 | * which takes an __s32 and returns a sctp_arg_t containing the | 152 | * which takes an __s32 and returns a sctp_arg_t containing the |
155 | * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. | 153 | * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. |
156 | */ | 154 | */ |
157 | static inline sctp_arg_t SCTP_NULL(void) | ||
158 | { | ||
159 | sctp_arg_t retval; retval.ptr = NULL; return retval; | ||
160 | } | ||
161 | static inline sctp_arg_t SCTP_NOFORCE(void) | ||
162 | { | ||
163 | sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval; | ||
164 | } | ||
165 | static inline sctp_arg_t SCTP_FORCE(void) | ||
166 | { | ||
167 | sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval; | ||
168 | } | ||
169 | 155 | ||
170 | #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ | 156 | #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ |
171 | static inline sctp_arg_t \ | 157 | static inline sctp_arg_t \ |
172 | SCTP_## name (type arg) \ | 158 | SCTP_## name (type arg) \ |
173 | { sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; } | 159 | { sctp_arg_t retval;\ |
160 | memset(&retval, 0, sizeof(sctp_arg_t));\ | ||
161 | retval.elt = arg;\ | ||
162 | return retval;\ | ||
163 | } | ||
174 | 164 | ||
175 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) | 165 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) |
176 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) | 166 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) |
@@ -181,7 +171,6 @@ SCTP_ARG_CONSTRUCTOR(ERROR, int, error) | |||
181 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ | 171 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ |
182 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) | 172 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) |
183 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) | 173 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) |
184 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) | ||
185 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) | 174 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) |
186 | SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) | 175 | SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) |
187 | SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) | 176 | SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) |
@@ -192,6 +181,23 @@ SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) | |||
192 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) | 181 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) |
193 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) | 182 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) |
194 | 183 | ||
184 | static inline sctp_arg_t SCTP_FORCE(void) | ||
185 | { | ||
186 | return SCTP_I32(1); | ||
187 | } | ||
188 | |||
189 | static inline sctp_arg_t SCTP_NOFORCE(void) | ||
190 | { | ||
191 | return SCTP_I32(0); | ||
192 | } | ||
193 | |||
194 | static inline sctp_arg_t SCTP_NULL(void) | ||
195 | { | ||
196 | sctp_arg_t retval; | ||
197 | memset(&retval, 0, sizeof(sctp_arg_t)); | ||
198 | return retval; | ||
199 | } | ||
200 | |||
195 | typedef struct { | 201 | typedef struct { |
196 | sctp_arg_t obj; | 202 | sctp_arg_t obj; |
197 | sctp_verb_t verb; | 203 | sctp_verb_t verb; |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index d053d2e99876..c29707d654c0 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -312,14 +312,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
312 | * functions simpler to write. | 312 | * functions simpler to write. |
313 | */ | 313 | */ |
314 | 314 | ||
315 | #if defined (CONFIG_SCTP_HMAC_MD5) | ||
316 | #define SCTP_COOKIE_HMAC_ALG "hmac(md5)" | ||
317 | #elif defined (CONFIG_SCTP_HMAC_SHA1) | ||
318 | #define SCTP_COOKIE_HMAC_ALG "hmac(sha1)" | ||
319 | #else | ||
320 | #define SCTP_COOKIE_HMAC_ALG NULL | ||
321 | #endif | ||
322 | |||
323 | /* These return values describe the success or failure of a number of | 315 | /* These return values describe the success or failure of a number of |
324 | * routines which form the lower interface to SCTP_outqueue. | 316 | * routines which form the lower interface to SCTP_outqueue. |
325 | */ | 317 | */ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index b5887e1677e4..2a82d1384706 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -234,6 +234,8 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, | |||
234 | struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, | 234 | struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, |
235 | const struct sctp_chunk *, | 235 | const struct sctp_chunk *, |
236 | struct sctp_paramhdr *); | 236 | struct sctp_paramhdr *); |
237 | struct sctp_chunk *sctp_make_violation_max_retrans(const struct sctp_association *, | ||
238 | const struct sctp_chunk *); | ||
237 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, | 239 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, |
238 | const struct sctp_transport *); | 240 | const struct sctp_transport *); |
239 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, | 241 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 64158aa1bb5f..2b2f61dd4036 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -177,6 +177,7 @@ struct sctp_sock { | |||
177 | 177 | ||
178 | /* Access to HMAC transform. */ | 178 | /* Access to HMAC transform. */ |
179 | struct crypto_hash *hmac; | 179 | struct crypto_hash *hmac; |
180 | char *sctp_hmac_alg; | ||
180 | 181 | ||
181 | /* What is our base endpointer? */ | 182 | /* What is our base endpointer? */ |
182 | struct sctp_endpoint *ep; | 183 | struct sctp_endpoint *ep; |
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index 2e5ee0d8458d..ff1b8ba73ab1 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h | |||
@@ -72,7 +72,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); | |||
72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); | 72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); |
73 | 73 | ||
74 | /* Perform partial delivery. */ | 74 | /* Perform partial delivery. */ |
75 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); | 75 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t); |
76 | 76 | ||
77 | /* Abort the partial delivery. */ | 77 | /* Abort the partial delivery. */ |
78 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); | 78 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6feeccd83dd7..3202bde2a741 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -369,7 +369,6 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
369 | extern void tcp_v4_early_demux(struct sk_buff *skb); | 369 | extern void tcp_v4_early_demux(struct sk_buff *skb); |
370 | extern int tcp_v4_rcv(struct sk_buff *skb); | 370 | extern int tcp_v4_rcv(struct sk_buff *skb); |
371 | 371 | ||
372 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk); | ||
373 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 372 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
374 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 373 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
375 | size_t size); | 374 | size_t size); |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 6f0ba01afe73..63445ede48bb 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -1351,7 +1351,7 @@ struct xfrm6_tunnel { | |||
1351 | }; | 1351 | }; |
1352 | 1352 | ||
1353 | extern void xfrm_init(void); | 1353 | extern void xfrm_init(void); |
1354 | extern void xfrm4_init(int rt_hash_size); | 1354 | extern void xfrm4_init(void); |
1355 | extern int xfrm_state_init(struct net *net); | 1355 | extern int xfrm_state_init(struct net *net); |
1356 | extern void xfrm_state_fini(struct net *net); | 1356 | extern void xfrm_state_fini(struct net *net); |
1357 | extern void xfrm4_state_init(void); | 1357 | extern void xfrm4_state_init(void); |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 88fae8d20154..55367b04dc94 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -135,6 +135,8 @@ struct scsi_device { | |||
135 | * because we did a bus reset. */ | 135 | * because we did a bus reset. */ |
136 | unsigned use_10_for_rw:1; /* first try 10-byte read / write */ | 136 | unsigned use_10_for_rw:1; /* first try 10-byte read / write */ |
137 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ | 137 | unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */ |
138 | unsigned no_report_opcodes:1; /* no REPORT SUPPORTED OPERATION CODES */ | ||
139 | unsigned no_write_same:1; /* no WRITE SAME command */ | ||
138 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ | 140 | unsigned skip_ms_page_8:1; /* do not use MODE SENSE page 0x08 */ |
139 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ | 141 | unsigned skip_ms_page_3f:1; /* do not use MODE SENSE page 0x3f */ |
140 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ | 142 | unsigned skip_vpd_pages:1; /* do not read VPD pages */ |
@@ -362,6 +364,8 @@ extern int scsi_test_unit_ready(struct scsi_device *sdev, int timeout, | |||
362 | int retries, struct scsi_sense_hdr *sshdr); | 364 | int retries, struct scsi_sense_hdr *sshdr); |
363 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, | 365 | extern int scsi_get_vpd_page(struct scsi_device *, u8 page, unsigned char *buf, |
364 | int buf_len); | 366 | int buf_len); |
367 | extern int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, | ||
368 | unsigned int len, unsigned char opcode); | ||
365 | extern int scsi_device_set_state(struct scsi_device *sdev, | 369 | extern int scsi_device_set_state(struct scsi_device *sdev, |
366 | enum scsi_device_state state); | 370 | enum scsi_device_state state); |
367 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, | 371 | extern struct scsi_event *sdev_evt_alloc(enum scsi_device_event evt_type, |
diff --git a/include/sound/core.h b/include/sound/core.h index bc056687f647..93896ad1fcdd 100644 --- a/include/sound/core.h +++ b/include/sound/core.h | |||
@@ -132,6 +132,7 @@ struct snd_card { | |||
132 | int shutdown; /* this card is going down */ | 132 | int shutdown; /* this card is going down */ |
133 | int free_on_last_close; /* free in context of file_release */ | 133 | int free_on_last_close; /* free in context of file_release */ |
134 | wait_queue_head_t shutdown_sleep; | 134 | wait_queue_head_t shutdown_sleep; |
135 | atomic_t refcount; /* refcount for disconnection */ | ||
135 | struct device *dev; /* device assigned to this card */ | 136 | struct device *dev; /* device assigned to this card */ |
136 | struct device *card_dev; /* cardX object for sysfs */ | 137 | struct device *card_dev; /* cardX object for sysfs */ |
137 | 138 | ||
@@ -189,6 +190,7 @@ struct snd_minor { | |||
189 | const struct file_operations *f_ops; /* file operations */ | 190 | const struct file_operations *f_ops; /* file operations */ |
190 | void *private_data; /* private data for f_ops->open */ | 191 | void *private_data; /* private data for f_ops->open */ |
191 | struct device *dev; /* device for sysfs */ | 192 | struct device *dev; /* device for sysfs */ |
193 | struct snd_card *card_ptr; /* assigned card instance */ | ||
192 | }; | 194 | }; |
193 | 195 | ||
194 | /* return a device pointer linked to each sound device as a parent */ | 196 | /* return a device pointer linked to each sound device as a parent */ |
@@ -295,6 +297,7 @@ int snd_card_info_done(void); | |||
295 | int snd_component_add(struct snd_card *card, const char *component); | 297 | int snd_component_add(struct snd_card *card, const char *component); |
296 | int snd_card_file_add(struct snd_card *card, struct file *file); | 298 | int snd_card_file_add(struct snd_card *card, struct file *file); |
297 | int snd_card_file_remove(struct snd_card *card, struct file *file); | 299 | int snd_card_file_remove(struct snd_card *card, struct file *file); |
300 | void snd_card_unref(struct snd_card *card); | ||
298 | 301 | ||
299 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) | 302 | #define snd_card_set_dev(card, devptr) ((card)->dev = (devptr)) |
300 | 303 | ||
diff --git a/include/trace/events/gfpflags.h b/include/trace/events/gfpflags.h index 9391706e9254..d6fd8e5b14b7 100644 --- a/include/trace/events/gfpflags.h +++ b/include/trace/events/gfpflags.h | |||
@@ -36,6 +36,7 @@ | |||
36 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ | 36 | {(unsigned long)__GFP_RECLAIMABLE, "GFP_RECLAIMABLE"}, \ |
37 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ | 37 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"}, \ |
38 | {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ | 38 | {(unsigned long)__GFP_NOTRACK, "GFP_NOTRACK"}, \ |
39 | {(unsigned long)__GFP_NO_KSWAPD, "GFP_NO_KSWAPD"}, \ | ||
39 | {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ | 40 | {(unsigned long)__GFP_OTHER_NODE, "GFP_OTHER_NODE"} \ |
40 | ) : "GFP_NOWAIT" | 41 | ) : "GFP_NOWAIT" |
41 | 42 | ||
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h index 15ba03bdd7c6..d06b6da5c1e3 100644 --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h | |||
@@ -377,6 +377,14 @@ DECLARE_EVENT_CLASS(xen_mmu_pgd, | |||
377 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); | 377 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); |
378 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); | 378 | DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); |
379 | 379 | ||
380 | TRACE_EVENT(xen_mmu_flush_tlb_all, | ||
381 | TP_PROTO(int x), | ||
382 | TP_ARGS(x), | ||
383 | TP_STRUCT__entry(__array(char, x, 0)), | ||
384 | TP_fast_assign((void)x), | ||
385 | TP_printk("%s", "") | ||
386 | ); | ||
387 | |||
380 | TRACE_EVENT(xen_mmu_flush_tlb, | 388 | TRACE_EVENT(xen_mmu_flush_tlb, |
381 | TP_PROTO(int x), | 389 | TP_PROTO(int x), |
382 | TP_ARGS(x), | 390 | TP_ARGS(x), |
diff --git a/include/uapi/asm-generic/kvm_para.h b/include/uapi/asm-generic/kvm_para.h index e69de29bb2d1..486f0af73c39 100644 --- a/include/uapi/asm-generic/kvm_para.h +++ b/include/uapi/asm-generic/kvm_para.h | |||
@@ -0,0 +1,4 @@ | |||
1 | /* | ||
2 | * There isn't anything here, but the file must not be empty or patch | ||
3 | * will delete it. | ||
4 | */ | ||
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index b1bea03274d5..2d32d073a6f9 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
@@ -43,6 +43,7 @@ | |||
43 | /* Socket filtering */ | 43 | /* Socket filtering */ |
44 | #define SO_ATTACH_FILTER 26 | 44 | #define SO_ATTACH_FILTER 26 |
45 | #define SO_DETACH_FILTER 27 | 45 | #define SO_DETACH_FILTER 27 |
46 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
46 | 47 | ||
47 | #define SO_PEERNAME 28 | 48 | #define SO_PEERNAME 28 |
48 | #define SO_TIMESTAMP 29 | 49 | #define SO_TIMESTAMP 29 |
diff --git a/include/uapi/linux/dvb/Kbuild b/include/uapi/linux/dvb/Kbuild index aafaa5aa54d4..d40942cfc627 100644 --- a/include/uapi/linux/dvb/Kbuild +++ b/include/uapi/linux/dvb/Kbuild | |||
@@ -1 +1,9 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += audio.h | ||
3 | header-y += ca.h | ||
4 | header-y += dmx.h | ||
5 | header-y += frontend.h | ||
6 | header-y += net.h | ||
7 | header-y += osd.h | ||
8 | header-y += version.h | ||
9 | header-y += video.h | ||
diff --git a/include/linux/dvb/audio.h b/include/uapi/linux/dvb/audio.h index d47bccd604e4..d47bccd604e4 100644 --- a/include/linux/dvb/audio.h +++ b/include/uapi/linux/dvb/audio.h | |||
diff --git a/include/linux/dvb/ca.h b/include/uapi/linux/dvb/ca.h index c18537f3e449..c18537f3e449 100644 --- a/include/linux/dvb/ca.h +++ b/include/uapi/linux/dvb/ca.h | |||
diff --git a/include/uapi/linux/dvb/dmx.h b/include/uapi/linux/dvb/dmx.h new file mode 100644 index 000000000000..b2a9ad8cafdc --- /dev/null +++ b/include/uapi/linux/dvb/dmx.h | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | * dmx.h | ||
3 | * | ||
4 | * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> | ||
5 | * & Ralph Metzler <ralph@convergence.de> | ||
6 | * for convergence integrated media GmbH | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public License | ||
10 | * as published by the Free Software Foundation; either version 2.1 | ||
11 | * of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _UAPI_DVBDMX_H_ | ||
25 | #define _UAPI_DVBDMX_H_ | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #ifndef __KERNEL__ | ||
29 | #include <time.h> | ||
30 | #endif | ||
31 | |||
32 | |||
33 | #define DMX_FILTER_SIZE 16 | ||
34 | |||
35 | typedef enum | ||
36 | { | ||
37 | DMX_OUT_DECODER, /* Streaming directly to decoder. */ | ||
38 | DMX_OUT_TAP, /* Output going to a memory buffer */ | ||
39 | /* (to be retrieved via the read command).*/ | ||
40 | DMX_OUT_TS_TAP, /* Output multiplexed into a new TS */ | ||
41 | /* (to be retrieved by reading from the */ | ||
42 | /* logical DVR device). */ | ||
43 | DMX_OUT_TSDEMUX_TAP /* Like TS_TAP but retrieved from the DMX device */ | ||
44 | } dmx_output_t; | ||
45 | |||
46 | |||
47 | typedef enum | ||
48 | { | ||
49 | DMX_IN_FRONTEND, /* Input from a front-end device. */ | ||
50 | DMX_IN_DVR /* Input from the logical DVR device. */ | ||
51 | } dmx_input_t; | ||
52 | |||
53 | |||
54 | typedef enum | ||
55 | { | ||
56 | DMX_PES_AUDIO0, | ||
57 | DMX_PES_VIDEO0, | ||
58 | DMX_PES_TELETEXT0, | ||
59 | DMX_PES_SUBTITLE0, | ||
60 | DMX_PES_PCR0, | ||
61 | |||
62 | DMX_PES_AUDIO1, | ||
63 | DMX_PES_VIDEO1, | ||
64 | DMX_PES_TELETEXT1, | ||
65 | DMX_PES_SUBTITLE1, | ||
66 | DMX_PES_PCR1, | ||
67 | |||
68 | DMX_PES_AUDIO2, | ||
69 | DMX_PES_VIDEO2, | ||
70 | DMX_PES_TELETEXT2, | ||
71 | DMX_PES_SUBTITLE2, | ||
72 | DMX_PES_PCR2, | ||
73 | |||
74 | DMX_PES_AUDIO3, | ||
75 | DMX_PES_VIDEO3, | ||
76 | DMX_PES_TELETEXT3, | ||
77 | DMX_PES_SUBTITLE3, | ||
78 | DMX_PES_PCR3, | ||
79 | |||
80 | DMX_PES_OTHER | ||
81 | } dmx_pes_type_t; | ||
82 | |||
83 | #define DMX_PES_AUDIO DMX_PES_AUDIO0 | ||
84 | #define DMX_PES_VIDEO DMX_PES_VIDEO0 | ||
85 | #define DMX_PES_TELETEXT DMX_PES_TELETEXT0 | ||
86 | #define DMX_PES_SUBTITLE DMX_PES_SUBTITLE0 | ||
87 | #define DMX_PES_PCR DMX_PES_PCR0 | ||
88 | |||
89 | |||
90 | typedef struct dmx_filter | ||
91 | { | ||
92 | __u8 filter[DMX_FILTER_SIZE]; | ||
93 | __u8 mask[DMX_FILTER_SIZE]; | ||
94 | __u8 mode[DMX_FILTER_SIZE]; | ||
95 | } dmx_filter_t; | ||
96 | |||
97 | |||
98 | struct dmx_sct_filter_params | ||
99 | { | ||
100 | __u16 pid; | ||
101 | dmx_filter_t filter; | ||
102 | __u32 timeout; | ||
103 | __u32 flags; | ||
104 | #define DMX_CHECK_CRC 1 | ||
105 | #define DMX_ONESHOT 2 | ||
106 | #define DMX_IMMEDIATE_START 4 | ||
107 | #define DMX_KERNEL_CLIENT 0x8000 | ||
108 | }; | ||
109 | |||
110 | |||
111 | struct dmx_pes_filter_params | ||
112 | { | ||
113 | __u16 pid; | ||
114 | dmx_input_t input; | ||
115 | dmx_output_t output; | ||
116 | dmx_pes_type_t pes_type; | ||
117 | __u32 flags; | ||
118 | }; | ||
119 | |||
120 | typedef struct dmx_caps { | ||
121 | __u32 caps; | ||
122 | int num_decoders; | ||
123 | } dmx_caps_t; | ||
124 | |||
125 | typedef enum { | ||
126 | DMX_SOURCE_FRONT0 = 0, | ||
127 | DMX_SOURCE_FRONT1, | ||
128 | DMX_SOURCE_FRONT2, | ||
129 | DMX_SOURCE_FRONT3, | ||
130 | DMX_SOURCE_DVR0 = 16, | ||
131 | DMX_SOURCE_DVR1, | ||
132 | DMX_SOURCE_DVR2, | ||
133 | DMX_SOURCE_DVR3 | ||
134 | } dmx_source_t; | ||
135 | |||
136 | struct dmx_stc { | ||
137 | unsigned int num; /* input : which STC? 0..N */ | ||
138 | unsigned int base; /* output: divisor for stc to get 90 kHz clock */ | ||
139 | __u64 stc; /* output: stc in 'base'*90 kHz units */ | ||
140 | }; | ||
141 | |||
142 | |||
143 | #define DMX_START _IO('o', 41) | ||
144 | #define DMX_STOP _IO('o', 42) | ||
145 | #define DMX_SET_FILTER _IOW('o', 43, struct dmx_sct_filter_params) | ||
146 | #define DMX_SET_PES_FILTER _IOW('o', 44, struct dmx_pes_filter_params) | ||
147 | #define DMX_SET_BUFFER_SIZE _IO('o', 45) | ||
148 | #define DMX_GET_PES_PIDS _IOR('o', 47, __u16[5]) | ||
149 | #define DMX_GET_CAPS _IOR('o', 48, dmx_caps_t) | ||
150 | #define DMX_SET_SOURCE _IOW('o', 49, dmx_source_t) | ||
151 | #define DMX_GET_STC _IOWR('o', 50, struct dmx_stc) | ||
152 | #define DMX_ADD_PID _IOW('o', 51, __u16) | ||
153 | #define DMX_REMOVE_PID _IOW('o', 52, __u16) | ||
154 | |||
155 | #endif /* _UAPI_DVBDMX_H_ */ | ||
diff --git a/include/linux/dvb/frontend.h b/include/uapi/linux/dvb/frontend.h index c12d452cb40d..c12d452cb40d 100644 --- a/include/linux/dvb/frontend.h +++ b/include/uapi/linux/dvb/frontend.h | |||
diff --git a/include/linux/dvb/net.h b/include/uapi/linux/dvb/net.h index f451e7eb0b0b..f451e7eb0b0b 100644 --- a/include/linux/dvb/net.h +++ b/include/uapi/linux/dvb/net.h | |||
diff --git a/include/linux/dvb/osd.h b/include/uapi/linux/dvb/osd.h index 880e68435832..880e68435832 100644 --- a/include/linux/dvb/osd.h +++ b/include/uapi/linux/dvb/osd.h | |||
diff --git a/include/linux/dvb/version.h b/include/uapi/linux/dvb/version.h index 827cce7e33e3..827cce7e33e3 100644 --- a/include/linux/dvb/version.h +++ b/include/uapi/linux/dvb/version.h | |||
diff --git a/include/uapi/linux/dvb/video.h b/include/uapi/linux/dvb/video.h new file mode 100644 index 000000000000..d3d14a59d2d5 --- /dev/null +++ b/include/uapi/linux/dvb/video.h | |||
@@ -0,0 +1,274 @@ | |||
1 | /* | ||
2 | * video.h | ||
3 | * | ||
4 | * Copyright (C) 2000 Marcus Metzler <marcus@convergence.de> | ||
5 | * & Ralph Metzler <ralph@convergence.de> | ||
6 | * for convergence integrated media GmbH | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU Lesser General Public License | ||
10 | * as published by the Free Software Foundation; either version 2.1 | ||
11 | * of the License, or (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU Lesser General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _UAPI_DVBVIDEO_H_ | ||
25 | #define _UAPI_DVBVIDEO_H_ | ||
26 | |||
27 | #include <linux/types.h> | ||
28 | #ifndef __KERNEL__ | ||
29 | #include <stdint.h> | ||
30 | #include <time.h> | ||
31 | #endif | ||
32 | |||
33 | typedef enum { | ||
34 | VIDEO_FORMAT_4_3, /* Select 4:3 format */ | ||
35 | VIDEO_FORMAT_16_9, /* Select 16:9 format. */ | ||
36 | VIDEO_FORMAT_221_1 /* 2.21:1 */ | ||
37 | } video_format_t; | ||
38 | |||
39 | |||
40 | typedef enum { | ||
41 | VIDEO_SYSTEM_PAL, | ||
42 | VIDEO_SYSTEM_NTSC, | ||
43 | VIDEO_SYSTEM_PALN, | ||
44 | VIDEO_SYSTEM_PALNc, | ||
45 | VIDEO_SYSTEM_PALM, | ||
46 | VIDEO_SYSTEM_NTSC60, | ||
47 | VIDEO_SYSTEM_PAL60, | ||
48 | VIDEO_SYSTEM_PALM60 | ||
49 | } video_system_t; | ||
50 | |||
51 | |||
52 | typedef enum { | ||
53 | VIDEO_PAN_SCAN, /* use pan and scan format */ | ||
54 | VIDEO_LETTER_BOX, /* use letterbox format */ | ||
55 | VIDEO_CENTER_CUT_OUT /* use center cut out format */ | ||
56 | } video_displayformat_t; | ||
57 | |||
58 | typedef struct { | ||
59 | int w; | ||
60 | int h; | ||
61 | video_format_t aspect_ratio; | ||
62 | } video_size_t; | ||
63 | |||
64 | typedef enum { | ||
65 | VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ | ||
66 | VIDEO_SOURCE_MEMORY /* If this source is selected, the stream | ||
67 | comes from the user through the write | ||
68 | system call */ | ||
69 | } video_stream_source_t; | ||
70 | |||
71 | |||
72 | typedef enum { | ||
73 | VIDEO_STOPPED, /* Video is stopped */ | ||
74 | VIDEO_PLAYING, /* Video is currently playing */ | ||
75 | VIDEO_FREEZED /* Video is freezed */ | ||
76 | } video_play_state_t; | ||
77 | |||
78 | |||
79 | /* Decoder commands */ | ||
80 | #define VIDEO_CMD_PLAY (0) | ||
81 | #define VIDEO_CMD_STOP (1) | ||
82 | #define VIDEO_CMD_FREEZE (2) | ||
83 | #define VIDEO_CMD_CONTINUE (3) | ||
84 | |||
85 | /* Flags for VIDEO_CMD_FREEZE */ | ||
86 | #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) | ||
87 | |||
88 | /* Flags for VIDEO_CMD_STOP */ | ||
89 | #define VIDEO_CMD_STOP_TO_BLACK (1 << 0) | ||
90 | #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) | ||
91 | |||
92 | /* Play input formats: */ | ||
93 | /* The decoder has no special format requirements */ | ||
94 | #define VIDEO_PLAY_FMT_NONE (0) | ||
95 | /* The decoder requires full GOPs */ | ||
96 | #define VIDEO_PLAY_FMT_GOP (1) | ||
97 | |||
98 | /* The structure must be zeroed before use by the application | ||
99 | This ensures it can be extended safely in the future. */ | ||
100 | struct video_command { | ||
101 | __u32 cmd; | ||
102 | __u32 flags; | ||
103 | union { | ||
104 | struct { | ||
105 | __u64 pts; | ||
106 | } stop; | ||
107 | |||
108 | struct { | ||
109 | /* 0 or 1000 specifies normal speed, | ||
110 | 1 specifies forward single stepping, | ||
111 | -1 specifies backward single stepping, | ||
112 | >1: playback at speed/1000 of the normal speed, | ||
113 | <-1: reverse playback at (-speed/1000) of the normal speed. */ | ||
114 | __s32 speed; | ||
115 | __u32 format; | ||
116 | } play; | ||
117 | |||
118 | struct { | ||
119 | __u32 data[16]; | ||
120 | } raw; | ||
121 | }; | ||
122 | }; | ||
123 | |||
124 | /* FIELD_UNKNOWN can be used if the hardware does not know whether | ||
125 | the Vsync is for an odd, even or progressive (i.e. non-interlaced) | ||
126 | field. */ | ||
127 | #define VIDEO_VSYNC_FIELD_UNKNOWN (0) | ||
128 | #define VIDEO_VSYNC_FIELD_ODD (1) | ||
129 | #define VIDEO_VSYNC_FIELD_EVEN (2) | ||
130 | #define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) | ||
131 | |||
132 | struct video_event { | ||
133 | __s32 type; | ||
134 | #define VIDEO_EVENT_SIZE_CHANGED 1 | ||
135 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 | ||
136 | #define VIDEO_EVENT_DECODER_STOPPED 3 | ||
137 | #define VIDEO_EVENT_VSYNC 4 | ||
138 | __kernel_time_t timestamp; | ||
139 | union { | ||
140 | video_size_t size; | ||
141 | unsigned int frame_rate; /* in frames per 1000sec */ | ||
142 | unsigned char vsync_field; /* unknown/odd/even/progressive */ | ||
143 | } u; | ||
144 | }; | ||
145 | |||
146 | |||
147 | struct video_status { | ||
148 | int video_blank; /* blank video on freeze? */ | ||
149 | video_play_state_t play_state; /* current state of playback */ | ||
150 | video_stream_source_t stream_source; /* current source (demux/memory) */ | ||
151 | video_format_t video_format; /* current aspect ratio of stream*/ | ||
152 | video_displayformat_t display_format;/* selected cropping mode */ | ||
153 | }; | ||
154 | |||
155 | |||
156 | struct video_still_picture { | ||
157 | char __user *iFrame; /* pointer to a single iframe in memory */ | ||
158 | __s32 size; | ||
159 | }; | ||
160 | |||
161 | |||
162 | typedef | ||
163 | struct video_highlight { | ||
164 | int active; /* 1=show highlight, 0=hide highlight */ | ||
165 | __u8 contrast1; /* 7- 4 Pattern pixel contrast */ | ||
166 | /* 3- 0 Background pixel contrast */ | ||
167 | __u8 contrast2; /* 7- 4 Emphasis pixel-2 contrast */ | ||
168 | /* 3- 0 Emphasis pixel-1 contrast */ | ||
169 | __u8 color1; /* 7- 4 Pattern pixel color */ | ||
170 | /* 3- 0 Background pixel color */ | ||
171 | __u8 color2; /* 7- 4 Emphasis pixel-2 color */ | ||
172 | /* 3- 0 Emphasis pixel-1 color */ | ||
173 | __u32 ypos; /* 23-22 auto action mode */ | ||
174 | /* 21-12 start y */ | ||
175 | /* 9- 0 end y */ | ||
176 | __u32 xpos; /* 23-22 button color number */ | ||
177 | /* 21-12 start x */ | ||
178 | /* 9- 0 end x */ | ||
179 | } video_highlight_t; | ||
180 | |||
181 | |||
182 | typedef struct video_spu { | ||
183 | int active; | ||
184 | int stream_id; | ||
185 | } video_spu_t; | ||
186 | |||
187 | |||
188 | typedef struct video_spu_palette { /* SPU Palette information */ | ||
189 | int length; | ||
190 | __u8 __user *palette; | ||
191 | } video_spu_palette_t; | ||
192 | |||
193 | |||
194 | typedef struct video_navi_pack { | ||
195 | int length; /* 0 ... 1024 */ | ||
196 | __u8 data[1024]; | ||
197 | } video_navi_pack_t; | ||
198 | |||
199 | |||
200 | typedef __u16 video_attributes_t; | ||
201 | /* bits: descr. */ | ||
202 | /* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ | ||
203 | /* 13-12 TV system (0=525/60, 1=625/50) */ | ||
204 | /* 11-10 Aspect ratio (0=4:3, 3=16:9) */ | ||
205 | /* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ | ||
206 | /* 7 line 21-1 data present in GOP (1=yes, 0=no) */ | ||
207 | /* 6 line 21-2 data present in GOP (1=yes, 0=no) */ | ||
208 | /* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ | ||
209 | /* 2 source letterboxed (1=yes, 0=no) */ | ||
210 | /* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ | ||
211 | |||
212 | |||
213 | /* bit definitions for capabilities: */ | ||
214 | /* can the hardware decode MPEG1 and/or MPEG2? */ | ||
215 | #define VIDEO_CAP_MPEG1 1 | ||
216 | #define VIDEO_CAP_MPEG2 2 | ||
217 | /* can you send a system and/or program stream to video device? | ||
218 | (you still have to open the video and the audio device but only | ||
219 | send the stream to the video device) */ | ||
220 | #define VIDEO_CAP_SYS 4 | ||
221 | #define VIDEO_CAP_PROG 8 | ||
222 | /* can the driver also handle SPU, NAVI and CSS encoded data? | ||
223 | (CSS API is not present yet) */ | ||
224 | #define VIDEO_CAP_SPU 16 | ||
225 | #define VIDEO_CAP_NAVI 32 | ||
226 | #define VIDEO_CAP_CSS 64 | ||
227 | |||
228 | |||
229 | #define VIDEO_STOP _IO('o', 21) | ||
230 | #define VIDEO_PLAY _IO('o', 22) | ||
231 | #define VIDEO_FREEZE _IO('o', 23) | ||
232 | #define VIDEO_CONTINUE _IO('o', 24) | ||
233 | #define VIDEO_SELECT_SOURCE _IO('o', 25) | ||
234 | #define VIDEO_SET_BLANK _IO('o', 26) | ||
235 | #define VIDEO_GET_STATUS _IOR('o', 27, struct video_status) | ||
236 | #define VIDEO_GET_EVENT _IOR('o', 28, struct video_event) | ||
237 | #define VIDEO_SET_DISPLAY_FORMAT _IO('o', 29) | ||
238 | #define VIDEO_STILLPICTURE _IOW('o', 30, struct video_still_picture) | ||
239 | #define VIDEO_FAST_FORWARD _IO('o', 31) | ||
240 | #define VIDEO_SLOWMOTION _IO('o', 32) | ||
241 | #define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int) | ||
242 | #define VIDEO_CLEAR_BUFFER _IO('o', 34) | ||
243 | #define VIDEO_SET_ID _IO('o', 35) | ||
244 | #define VIDEO_SET_STREAMTYPE _IO('o', 36) | ||
245 | #define VIDEO_SET_FORMAT _IO('o', 37) | ||
246 | #define VIDEO_SET_SYSTEM _IO('o', 38) | ||
247 | #define VIDEO_SET_HIGHLIGHT _IOW('o', 39, video_highlight_t) | ||
248 | #define VIDEO_SET_SPU _IOW('o', 50, video_spu_t) | ||
249 | #define VIDEO_SET_SPU_PALETTE _IOW('o', 51, video_spu_palette_t) | ||
250 | #define VIDEO_GET_NAVI _IOR('o', 52, video_navi_pack_t) | ||
251 | #define VIDEO_SET_ATTRIBUTES _IO('o', 53) | ||
252 | #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) | ||
253 | #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) | ||
254 | |||
255 | /** | ||
256 | * VIDEO_GET_PTS | ||
257 | * | ||
258 | * Read the 33 bit presentation time stamp as defined | ||
259 | * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
260 | * | ||
261 | * The PTS should belong to the currently played | ||
262 | * frame if possible, but may also be a value close to it | ||
263 | * like the PTS of the last decoded frame or the last PTS | ||
264 | * extracted by the PES parser. | ||
265 | */ | ||
266 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | ||
267 | |||
268 | /* Read the number of displayed frames since the decoder was started */ | ||
269 | #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) | ||
270 | |||
271 | #define VIDEO_COMMAND _IOWR('o', 59, struct video_command) | ||
272 | #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) | ||
273 | |||
274 | #endif /* _UAPI_DVBVIDEO_H_ */ | ||
diff --git a/include/uapi/linux/elf-fdpic.h b/include/uapi/linux/elf-fdpic.h index 1065078938f9..3921e33aec8e 100644 --- a/include/uapi/linux/elf-fdpic.h +++ b/include/uapi/linux/elf-fdpic.h | |||
@@ -9,8 +9,8 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef _LINUX_ELF_FDPIC_H | 12 | #ifndef _UAPI_LINUX_ELF_FDPIC_H |
13 | #define _LINUX_ELF_FDPIC_H | 13 | #define _UAPI_LINUX_ELF_FDPIC_H |
14 | 14 | ||
15 | #include <linux/elf.h> | 15 | #include <linux/elf.h> |
16 | 16 | ||
@@ -31,40 +31,4 @@ struct elf32_fdpic_loadmap { | |||
31 | 31 | ||
32 | #define ELF32_FDPIC_LOADMAP_VERSION 0x0000 | 32 | #define ELF32_FDPIC_LOADMAP_VERSION 0x0000 |
33 | 33 | ||
34 | #ifndef __KERNEL__ | 34 | #endif /* _UAPI_LINUX_ELF_FDPIC_H */ |
35 | /* | ||
36 | * binfmt binary parameters structure | ||
37 | */ | ||
38 | struct elf_fdpic_params { | ||
39 | struct elfhdr hdr; /* ref copy of ELF header */ | ||
40 | struct elf_phdr *phdrs; /* ref copy of PT_PHDR table */ | ||
41 | struct elf32_fdpic_loadmap *loadmap; /* loadmap to be passed to userspace */ | ||
42 | unsigned long elfhdr_addr; /* mapped ELF header user address */ | ||
43 | unsigned long ph_addr; /* mapped PT_PHDR user address */ | ||
44 | unsigned long map_addr; /* mapped loadmap user address */ | ||
45 | unsigned long entry_addr; /* mapped entry user address */ | ||
46 | unsigned long stack_size; /* stack size requested (PT_GNU_STACK) */ | ||
47 | unsigned long dynamic_addr; /* mapped PT_DYNAMIC user address */ | ||
48 | unsigned long load_addr; /* user address at which to map binary */ | ||
49 | unsigned long flags; | ||
50 | #define ELF_FDPIC_FLAG_ARRANGEMENT 0x0000000f /* PT_LOAD arrangement flags */ | ||
51 | #define ELF_FDPIC_FLAG_INDEPENDENT 0x00000000 /* PT_LOADs can be put anywhere */ | ||
52 | #define ELF_FDPIC_FLAG_HONOURVADDR 0x00000001 /* PT_LOAD.vaddr must be honoured */ | ||
53 | #define ELF_FDPIC_FLAG_CONSTDISP 0x00000002 /* PT_LOADs require constant | ||
54 | * displacement */ | ||
55 | #define ELF_FDPIC_FLAG_CONTIGUOUS 0x00000003 /* PT_LOADs should be contiguous */ | ||
56 | #define ELF_FDPIC_FLAG_EXEC_STACK 0x00000010 /* T if stack to be executable */ | ||
57 | #define ELF_FDPIC_FLAG_NOEXEC_STACK 0x00000020 /* T if stack not to be executable */ | ||
58 | #define ELF_FDPIC_FLAG_EXECUTABLE 0x00000040 /* T if this object is the executable */ | ||
59 | #define ELF_FDPIC_FLAG_PRESENT 0x80000000 /* T if this object is present */ | ||
60 | }; | ||
61 | |||
62 | #ifdef CONFIG_MMU | ||
63 | extern void elf_fdpic_arch_lay_out_mm(struct elf_fdpic_params *exec_params, | ||
64 | struct elf_fdpic_params *interp_params, | ||
65 | unsigned long *start_stack, | ||
66 | unsigned long *start_brk); | ||
67 | #endif | ||
68 | #endif /* __KERNEL__ */ | ||
69 | |||
70 | #endif /* _LINUX_ELF_FDPIC_H */ | ||
diff --git a/include/uapi/linux/eventpoll.h b/include/uapi/linux/eventpoll.h index 8c99ce7202c5..2c267bcbb85c 100644 --- a/include/uapi/linux/eventpoll.h +++ b/include/uapi/linux/eventpoll.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #define EPOLL_CTL_ADD 1 | 25 | #define EPOLL_CTL_ADD 1 |
26 | #define EPOLL_CTL_DEL 2 | 26 | #define EPOLL_CTL_DEL 2 |
27 | #define EPOLL_CTL_MOD 3 | 27 | #define EPOLL_CTL_MOD 3 |
28 | #define EPOLL_CTL_DISABLE 4 | ||
29 | 28 | ||
30 | /* | 29 | /* |
31 | * Request the handling of system wakeup events so as to prevent system suspends | 30 | * Request the handling of system wakeup events so as to prevent system suspends |
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h index 3d7922433aba..9cfde6941099 100644 --- a/include/uapi/linux/filter.h +++ b/include/uapi/linux/filter.h | |||
@@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
127 | #define SKF_AD_RXHASH 32 | 127 | #define SKF_AD_RXHASH 32 |
128 | #define SKF_AD_CPU 36 | 128 | #define SKF_AD_CPU 36 |
129 | #define SKF_AD_ALU_XOR_X 40 | 129 | #define SKF_AD_ALU_XOR_X 40 |
130 | #define SKF_AD_MAX 44 | 130 | #define SKF_AD_VLAN_TAG 44 |
131 | #define SKF_AD_VLAN_TAG_PRESENT 48 | ||
132 | #define SKF_AD_MAX 52 | ||
131 | #define SKF_NET_OFF (-0x100000) | 133 | #define SKF_NET_OFF (-0x100000) |
132 | #define SKF_LL_OFF (-0x200000) | 134 | #define SKF_LL_OFF (-0x200000) |
133 | 135 | ||
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 9fcc880d4be2..780d4c6093eb 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h | |||
@@ -57,85 +57,6 @@ struct inodes_stat_t { | |||
57 | 57 | ||
58 | #define NR_FILE 8192 /* this can well be larger on a larger system */ | 58 | #define NR_FILE 8192 /* this can well be larger on a larger system */ |
59 | 59 | ||
60 | #define MAY_EXEC 0x00000001 | ||
61 | #define MAY_WRITE 0x00000002 | ||
62 | #define MAY_READ 0x00000004 | ||
63 | #define MAY_APPEND 0x00000008 | ||
64 | #define MAY_ACCESS 0x00000010 | ||
65 | #define MAY_OPEN 0x00000020 | ||
66 | #define MAY_CHDIR 0x00000040 | ||
67 | /* called from RCU mode, don't block */ | ||
68 | #define MAY_NOT_BLOCK 0x00000080 | ||
69 | |||
70 | /* | ||
71 | * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond | ||
72 | * to O_WRONLY and O_RDWR via the strange trick in __dentry_open() | ||
73 | */ | ||
74 | |||
75 | /* file is open for reading */ | ||
76 | #define FMODE_READ ((__force fmode_t)0x1) | ||
77 | /* file is open for writing */ | ||
78 | #define FMODE_WRITE ((__force fmode_t)0x2) | ||
79 | /* file is seekable */ | ||
80 | #define FMODE_LSEEK ((__force fmode_t)0x4) | ||
81 | /* file can be accessed using pread */ | ||
82 | #define FMODE_PREAD ((__force fmode_t)0x8) | ||
83 | /* file can be accessed using pwrite */ | ||
84 | #define FMODE_PWRITE ((__force fmode_t)0x10) | ||
85 | /* File is opened for execution with sys_execve / sys_uselib */ | ||
86 | #define FMODE_EXEC ((__force fmode_t)0x20) | ||
87 | /* File is opened with O_NDELAY (only set for block devices) */ | ||
88 | #define FMODE_NDELAY ((__force fmode_t)0x40) | ||
89 | /* File is opened with O_EXCL (only set for block devices) */ | ||
90 | #define FMODE_EXCL ((__force fmode_t)0x80) | ||
91 | /* File is opened using open(.., 3, ..) and is writeable only for ioctls | ||
92 | (specialy hack for floppy.c) */ | ||
93 | #define FMODE_WRITE_IOCTL ((__force fmode_t)0x100) | ||
94 | /* 32bit hashes as llseek() offset (for directories) */ | ||
95 | #define FMODE_32BITHASH ((__force fmode_t)0x200) | ||
96 | /* 64bit hashes as llseek() offset (for directories) */ | ||
97 | #define FMODE_64BITHASH ((__force fmode_t)0x400) | ||
98 | |||
99 | /* | ||
100 | * Don't update ctime and mtime. | ||
101 | * | ||
102 | * Currently a special hack for the XFS open_by_handle ioctl, but we'll | ||
103 | * hopefully graduate it to a proper O_CMTIME flag supported by open(2) soon. | ||
104 | */ | ||
105 | #define FMODE_NOCMTIME ((__force fmode_t)0x800) | ||
106 | |||
107 | /* Expect random access pattern */ | ||
108 | #define FMODE_RANDOM ((__force fmode_t)0x1000) | ||
109 | |||
110 | /* File is huge (eg. /dev/kmem): treat loff_t as unsigned */ | ||
111 | #define FMODE_UNSIGNED_OFFSET ((__force fmode_t)0x2000) | ||
112 | |||
113 | /* File is opened with O_PATH; almost nothing can be done with it */ | ||
114 | #define FMODE_PATH ((__force fmode_t)0x4000) | ||
115 | |||
116 | /* File was opened by fanotify and shouldn't generate fanotify events */ | ||
117 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | ||
118 | |||
119 | /* | ||
120 | * Flag for rw_copy_check_uvector and compat_rw_copy_check_uvector | ||
121 | * that indicates that they should check the contents of the iovec are | ||
122 | * valid, but not check the memory that the iovec elements | ||
123 | * points too. | ||
124 | */ | ||
125 | #define CHECK_IOVEC_ONLY -1 | ||
126 | |||
127 | #define SEL_IN 1 | ||
128 | #define SEL_OUT 2 | ||
129 | #define SEL_EX 4 | ||
130 | |||
131 | /* public flags for file_system_type */ | ||
132 | #define FS_REQUIRES_DEV 1 | ||
133 | #define FS_BINARY_MOUNTDATA 2 | ||
134 | #define FS_HAS_SUBTYPE 4 | ||
135 | #define FS_REVAL_DOT 16384 /* Check the paths ".", ".." for staleness */ | ||
136 | #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() | ||
137 | * during rename() internally. | ||
138 | */ | ||
139 | 60 | ||
140 | /* | 61 | /* |
141 | * These are the fs-independent mount-flags: up to 32 flags are supported | 62 | * These are the fs-independent mount-flags: up to 32 flags are supported |
@@ -181,59 +102,6 @@ struct inodes_stat_t { | |||
181 | #define MS_MGC_VAL 0xC0ED0000 | 102 | #define MS_MGC_VAL 0xC0ED0000 |
182 | #define MS_MGC_MSK 0xffff0000 | 103 | #define MS_MGC_MSK 0xffff0000 |
183 | 104 | ||
184 | /* Inode flags - they have nothing to superblock flags now */ | ||
185 | |||
186 | #define S_SYNC 1 /* Writes are synced at once */ | ||
187 | #define S_NOATIME 2 /* Do not update access times */ | ||
188 | #define S_APPEND 4 /* Append-only file */ | ||
189 | #define S_IMMUTABLE 8 /* Immutable file */ | ||
190 | #define S_DEAD 16 /* removed, but still open directory */ | ||
191 | #define S_NOQUOTA 32 /* Inode is not counted to quota */ | ||
192 | #define S_DIRSYNC 64 /* Directory modifications are synchronous */ | ||
193 | #define S_NOCMTIME 128 /* Do not update file c/mtime */ | ||
194 | #define S_SWAPFILE 256 /* Do not truncate: swapon got its bmaps */ | ||
195 | #define S_PRIVATE 512 /* Inode is fs-internal */ | ||
196 | #define S_IMA 1024 /* Inode has an associated IMA struct */ | ||
197 | #define S_AUTOMOUNT 2048 /* Automount/referral quasi-directory */ | ||
198 | #define S_NOSEC 4096 /* no suid or xattr security attributes */ | ||
199 | |||
200 | /* | ||
201 | * Note that nosuid etc flags are inode-specific: setting some file-system | ||
202 | * flags just means all the inodes inherit those flags by default. It might be | ||
203 | * possible to override it selectively if you really wanted to with some | ||
204 | * ioctl() that is not currently implemented. | ||
205 | * | ||
206 | * Exception: MS_RDONLY is always applied to the entire file system. | ||
207 | * | ||
208 | * Unfortunately, it is possible to change a filesystems flags with it mounted | ||
209 | * with files in use. This means that all of the inodes will not have their | ||
210 | * i_flags updated. Hence, i_flags no longer inherit the superblock mount | ||
211 | * flags, so these have to be checked separately. -- rmk@arm.uk.linux.org | ||
212 | */ | ||
213 | #define __IS_FLG(inode,flg) ((inode)->i_sb->s_flags & (flg)) | ||
214 | |||
215 | #define IS_RDONLY(inode) ((inode)->i_sb->s_flags & MS_RDONLY) | ||
216 | #define IS_SYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS) || \ | ||
217 | ((inode)->i_flags & S_SYNC)) | ||
218 | #define IS_DIRSYNC(inode) (__IS_FLG(inode, MS_SYNCHRONOUS|MS_DIRSYNC) || \ | ||
219 | ((inode)->i_flags & (S_SYNC|S_DIRSYNC))) | ||
220 | #define IS_MANDLOCK(inode) __IS_FLG(inode, MS_MANDLOCK) | ||
221 | #define IS_NOATIME(inode) __IS_FLG(inode, MS_RDONLY|MS_NOATIME) | ||
222 | #define IS_I_VERSION(inode) __IS_FLG(inode, MS_I_VERSION) | ||
223 | |||
224 | #define IS_NOQUOTA(inode) ((inode)->i_flags & S_NOQUOTA) | ||
225 | #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND) | ||
226 | #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE) | ||
227 | #define IS_POSIXACL(inode) __IS_FLG(inode, MS_POSIXACL) | ||
228 | |||
229 | #define IS_DEADDIR(inode) ((inode)->i_flags & S_DEAD) | ||
230 | #define IS_NOCMTIME(inode) ((inode)->i_flags & S_NOCMTIME) | ||
231 | #define IS_SWAPFILE(inode) ((inode)->i_flags & S_SWAPFILE) | ||
232 | #define IS_PRIVATE(inode) ((inode)->i_flags & S_PRIVATE) | ||
233 | #define IS_IMA(inode) ((inode)->i_flags & S_IMA) | ||
234 | #define IS_AUTOMOUNT(inode) ((inode)->i_flags & S_AUTOMOUNT) | ||
235 | #define IS_NOSEC(inode) ((inode)->i_flags & S_NOSEC) | ||
236 | |||
237 | /* the read-only stuff doesn't really belong here, but any other place is | 105 | /* the read-only stuff doesn't really belong here, but any other place is |
238 | probably as bad and I don't want to create yet another include file. */ | 106 | probably as bad and I don't want to create yet another include file. */ |
239 | 107 | ||
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild index aafaa5aa54d4..8c1d2cb75e33 100644 --- a/include/uapi/linux/hdlc/Kbuild +++ b/include/uapi/linux/hdlc/Kbuild | |||
@@ -1 +1,2 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += ioctl.h | ||
diff --git a/include/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h index 583972364357..04bc0274a189 100644 --- a/include/linux/hdlc/ioctl.h +++ b/include/uapi/linux/hdlc/ioctl.h | |||
@@ -34,13 +34,15 @@ | |||
34 | #define LMI_CCITT 3 /* ITU-T Annex A */ | 34 | #define LMI_CCITT 3 /* ITU-T Annex A */ |
35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | 35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ |
36 | 36 | ||
37 | typedef struct { | 37 | #ifndef __ASSEMBLY__ |
38 | |||
39 | typedef struct { | ||
38 | unsigned int clock_rate; /* bits per second */ | 40 | unsigned int clock_rate; /* bits per second */ |
39 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | 41 | unsigned int clock_type; /* internal, external, TX-internal etc. */ |
40 | unsigned short loopback; | 42 | unsigned short loopback; |
41 | } sync_serial_settings; /* V.35, V.24, X.21 */ | 43 | } sync_serial_settings; /* V.35, V.24, X.21 */ |
42 | 44 | ||
43 | typedef struct { | 45 | typedef struct { |
44 | unsigned int clock_rate; /* bits per second */ | 46 | unsigned int clock_rate; /* bits per second */ |
45 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | 47 | unsigned int clock_type; /* internal, external, TX-internal etc. */ |
46 | unsigned short loopback; | 48 | unsigned short loopback; |
@@ -78,4 +80,5 @@ typedef struct { | |||
78 | 80 | ||
79 | /* PPP doesn't need any info now - supply length = 0 to ioctl */ | 81 | /* PPP doesn't need any info now - supply length = 0 to ioctl */ |
80 | 82 | ||
83 | #endif /* __ASSEMBLY__ */ | ||
81 | #endif /* __HDLC_IOCTL_H__ */ | 84 | #endif /* __HDLC_IOCTL_H__ */ |
diff --git a/include/uapi/linux/hsi/Kbuild b/include/uapi/linux/hsi/Kbuild index aafaa5aa54d4..30ab3cd3b8a5 100644 --- a/include/uapi/linux/hsi/Kbuild +++ b/include/uapi/linux/hsi/Kbuild | |||
@@ -1 +1,2 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += hsi_char.h | ||
diff --git a/include/linux/hsi/hsi_char.h b/include/uapi/linux/hsi/hsi_char.h index 76160b4f455d..76160b4f455d 100644 --- a/include/linux/hsi/hsi_char.h +++ b/include/uapi/linux/hsi/hsi_char.h | |||
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index a8fe9549ddbc..b3885791e11e 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h | |||
@@ -97,5 +97,23 @@ struct __fdb_entry { | |||
97 | __u16 unused; | 97 | __u16 unused; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | /* Bridge Flags */ | ||
101 | #define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */ | ||
102 | #define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */ | ||
100 | 103 | ||
104 | #define BRIDGE_MODE_VEB 0 /* Default loopback mode */ | ||
105 | #define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */ | ||
106 | |||
107 | /* Bridge management nested attributes | ||
108 | * [IFLA_AF_SPEC] = { | ||
109 | * [IFLA_BRIDGE_FLAGS] | ||
110 | * [IFLA_BRIDGE_MODE] | ||
111 | * } | ||
112 | */ | ||
113 | enum { | ||
114 | IFLA_BRIDGE_FLAGS, | ||
115 | IFLA_BRIDGE_MODE, | ||
116 | __IFLA_BRIDGE_MAX, | ||
117 | }; | ||
118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | ||
101 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ | 119 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ |
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index 0343e1f0582c..67fb87ca1094 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ | 48 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ |
49 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ | 49 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ |
50 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ | 50 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ |
51 | #define ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
51 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ | 52 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ |
52 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ | 53 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ |
53 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ | 54 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 5c80cb11518b..bb58aeb7f34d 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -205,6 +205,23 @@ enum { | |||
205 | 205 | ||
206 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | 206 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) |
207 | 207 | ||
208 | enum { | ||
209 | BRIDGE_MODE_UNSPEC, | ||
210 | BRIDGE_MODE_HAIRPIN, | ||
211 | }; | ||
212 | |||
213 | enum { | ||
214 | IFLA_BRPORT_UNSPEC, | ||
215 | IFLA_BRPORT_STATE, /* Spanning tree state */ | ||
216 | IFLA_BRPORT_PRIORITY, /* " priority */ | ||
217 | IFLA_BRPORT_COST, /* " cost */ | ||
218 | IFLA_BRPORT_MODE, /* mode (hairpin) */ | ||
219 | IFLA_BRPORT_GUARD, /* bpdu guard */ | ||
220 | IFLA_BRPORT_PROTECT, /* root port protection */ | ||
221 | __IFLA_BRPORT_MAX | ||
222 | }; | ||
223 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) | ||
224 | |||
208 | struct ifla_cacheinfo { | 225 | struct ifla_cacheinfo { |
209 | __u32 max_reasm_len; | 226 | __u32 max_reasm_len; |
210 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | 227 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ |
@@ -285,6 +302,10 @@ enum { | |||
285 | IFLA_VXLAN_AGEING, | 302 | IFLA_VXLAN_AGEING, |
286 | IFLA_VXLAN_LIMIT, | 303 | IFLA_VXLAN_LIMIT, |
287 | IFLA_VXLAN_PORT_RANGE, | 304 | IFLA_VXLAN_PORT_RANGE, |
305 | IFLA_VXLAN_PROXY, | ||
306 | IFLA_VXLAN_RSC, | ||
307 | IFLA_VXLAN_L2MISS, | ||
308 | IFLA_VXLAN_L3MISS, | ||
288 | __IFLA_VXLAN_MAX | 309 | __IFLA_VXLAN_MAX |
289 | }; | 310 | }; |
290 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | 311 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index f3799295d231..f9a60375f0d0 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h | |||
@@ -50,6 +50,7 @@ struct sockaddr_ll { | |||
50 | #define PACKET_TX_TIMESTAMP 16 | 50 | #define PACKET_TX_TIMESTAMP 16 |
51 | #define PACKET_TIMESTAMP 17 | 51 | #define PACKET_TIMESTAMP 17 |
52 | #define PACKET_FANOUT 18 | 52 | #define PACKET_FANOUT 18 |
53 | #define PACKET_TX_HAS_OFF 19 | ||
53 | 54 | ||
54 | #define PACKET_FANOUT_HASH 0 | 55 | #define PACKET_FANOUT_HASH 0 |
55 | #define PACKET_FANOUT_LB 1 | 56 | #define PACKET_FANOUT_LB 1 |
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index 25a585ce23e6..958497ad5bb5 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define TUN_ONE_QUEUE 0x0080 | 34 | #define TUN_ONE_QUEUE 0x0080 |
35 | #define TUN_PERSIST 0x0100 | 35 | #define TUN_PERSIST 0x0100 |
36 | #define TUN_VNET_HDR 0x0200 | 36 | #define TUN_VNET_HDR 0x0200 |
37 | #define TUN_TAP_MQ 0x0400 | ||
37 | 38 | ||
38 | /* Ioctl defines */ | 39 | /* Ioctl defines */ |
39 | #define TUNSETNOCSUM _IOW('T', 200, int) | 40 | #define TUNSETNOCSUM _IOW('T', 200, int) |
@@ -53,6 +54,7 @@ | |||
53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) | 54 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) |
54 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) | 55 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) |
55 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) | 56 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) |
57 | #define TUNSETQUEUE _IOW('T', 217, int) | ||
56 | 58 | ||
57 | /* TUNSETIFF ifr flags */ | 59 | /* TUNSETIFF ifr flags */ |
58 | #define IFF_TUN 0x0001 | 60 | #define IFF_TUN 0x0001 |
@@ -61,6 +63,9 @@ | |||
61 | #define IFF_ONE_QUEUE 0x2000 | 63 | #define IFF_ONE_QUEUE 0x2000 |
62 | #define IFF_VNET_HDR 0x4000 | 64 | #define IFF_VNET_HDR 0x4000 |
63 | #define IFF_TUN_EXCL 0x8000 | 65 | #define IFF_TUN_EXCL 0x8000 |
66 | #define IFF_MULTI_QUEUE 0x0100 | ||
67 | #define IFF_ATTACH_QUEUE 0x0200 | ||
68 | #define IFF_DETACH_QUEUE 0x0400 | ||
64 | 69 | ||
65 | /* Features for GSO (TUNSETOFFLOAD). */ | 70 | /* Features for GSO (TUNSETOFFLOAD). */ |
66 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ | 71 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ |
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h index 5db5942575fe..aee73d0611fb 100644 --- a/include/uapi/linux/if_tunnel.h +++ b/include/uapi/linux/if_tunnel.h | |||
@@ -37,6 +37,26 @@ struct ip_tunnel_parm { | |||
37 | struct iphdr iph; | 37 | struct iphdr iph; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | enum { | ||
41 | IFLA_IPTUN_UNSPEC, | ||
42 | IFLA_IPTUN_LINK, | ||
43 | IFLA_IPTUN_LOCAL, | ||
44 | IFLA_IPTUN_REMOTE, | ||
45 | IFLA_IPTUN_TTL, | ||
46 | IFLA_IPTUN_TOS, | ||
47 | IFLA_IPTUN_ENCAP_LIMIT, | ||
48 | IFLA_IPTUN_FLOWINFO, | ||
49 | IFLA_IPTUN_FLAGS, | ||
50 | IFLA_IPTUN_PROTO, | ||
51 | IFLA_IPTUN_PMTUDISC, | ||
52 | IFLA_IPTUN_6RD_PREFIX, | ||
53 | IFLA_IPTUN_6RD_RELAY_PREFIX, | ||
54 | IFLA_IPTUN_6RD_PREFIXLEN, | ||
55 | IFLA_IPTUN_6RD_RELAY_PREFIXLEN, | ||
56 | __IFLA_IPTUN_MAX, | ||
57 | }; | ||
58 | #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) | ||
59 | |||
40 | /* SIT-mode i_flags */ | 60 | /* SIT-mode i_flags */ |
41 | #define SIT_ISATAP 0x0001 | 61 | #define SIT_ISATAP 0x0001 |
42 | 62 | ||
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index 1e3159989958..f79c3721da6e 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
@@ -240,6 +240,7 @@ struct in6_flowlabel_req { | |||
240 | * | 240 | * |
241 | * IP6T_SO_GET_REVISION_MATCH 68 | 241 | * IP6T_SO_GET_REVISION_MATCH 68 |
242 | * IP6T_SO_GET_REVISION_TARGET 69 | 242 | * IP6T_SO_GET_REVISION_TARGET 69 |
243 | * IP6T_SO_ORIGINAL_DST 80 | ||
243 | */ | 244 | */ |
244 | 245 | ||
245 | /* RFC5014: Source address selection */ | 246 | /* RFC5014: Source address selection */ |
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h index 8c469af939aa..bbde90fa5838 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h | |||
@@ -109,9 +109,10 @@ enum { | |||
109 | INET_DIAG_TOS, | 109 | INET_DIAG_TOS, |
110 | INET_DIAG_TCLASS, | 110 | INET_DIAG_TCLASS, |
111 | INET_DIAG_SKMEMINFO, | 111 | INET_DIAG_SKMEMINFO, |
112 | INET_DIAG_SHUTDOWN, | ||
112 | }; | 113 | }; |
113 | 114 | ||
114 | #define INET_DIAG_MAX INET_DIAG_SKMEMINFO | 115 | #define INET_DIAG_MAX INET_DIAG_SHUTDOWN |
115 | 116 | ||
116 | 117 | ||
117 | /* INET_DIAG_MEM */ | 118 | /* INET_DIAG_MEM */ |
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index a6d7d1c536c3..5a2991cf0251 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h | |||
@@ -157,6 +157,7 @@ enum { | |||
157 | DEVCONF_DISABLE_IPV6, | 157 | DEVCONF_DISABLE_IPV6, |
158 | DEVCONF_ACCEPT_DAD, | 158 | DEVCONF_ACCEPT_DAD, |
159 | DEVCONF_FORCE_TLLAO, | 159 | DEVCONF_FORCE_TLLAO, |
160 | DEVCONF_NDISC_NOTIFY, | ||
160 | DEVCONF_MAX | 161 | DEVCONF_MAX |
161 | }; | 162 | }; |
162 | 163 | ||
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h index 0459664c2636..2be7bd174751 100644 --- a/include/uapi/linux/ipv6_route.h +++ b/include/uapi/linux/ipv6_route.h | |||
@@ -55,4 +55,7 @@ struct in6_rtmsg { | |||
55 | #define RTMSG_NEWROUTE 0x21 | 55 | #define RTMSG_NEWROUTE 0x21 |
56 | #define RTMSG_DELROUTE 0x22 | 56 | #define RTMSG_DELROUTE 0x22 |
57 | 57 | ||
58 | #define IP6_RT_PRIO_USER 1024 | ||
59 | #define IP6_RT_PRIO_ADDRCONF 256 | ||
60 | |||
58 | #endif /* _UAPI_LINUX_IPV6_ROUTE_H */ | 61 | #endif /* _UAPI_LINUX_IPV6_ROUTE_H */ |
diff --git a/include/uapi/linux/irqnr.h b/include/uapi/linux/irqnr.h index e69de29bb2d1..ae5704fa77ad 100644 --- a/include/uapi/linux/irqnr.h +++ b/include/uapi/linux/irqnr.h | |||
@@ -0,0 +1,4 @@ | |||
1 | /* | ||
2 | * There isn't anything here anymore, but the file must not be empty or patch | ||
3 | * will delete it. | ||
4 | */ | ||
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h new file mode 100644 index 000000000000..75dcbc587fb5 --- /dev/null +++ b/include/uapi/linux/netconf.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _UAPI_LINUX_NETCONF_H_ | ||
2 | #define _UAPI_LINUX_NETCONF_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/netlink.h> | ||
6 | |||
7 | struct netconfmsg { | ||
8 | __u8 ncm_family; | ||
9 | }; | ||
10 | |||
11 | enum { | ||
12 | NETCONFA_UNSPEC, | ||
13 | NETCONFA_IFINDEX, | ||
14 | NETCONFA_FORWARDING, | ||
15 | NETCONFA_RP_FILTER, | ||
16 | __NETCONFA_MAX | ||
17 | }; | ||
18 | #define NETCONFA_MAX (__NETCONFA_MAX - 1) | ||
19 | |||
20 | #define NETCONFA_IFINDEX_ALL -1 | ||
21 | #define NETCONFA_IFINDEX_DEFAULT -2 | ||
22 | |||
23 | #endif /* _UAPI_LINUX_NETCONF_H_ */ | ||
diff --git a/include/uapi/linux/netfilter_ipv6/ip6_tables.h b/include/uapi/linux/netfilter_ipv6/ip6_tables.h index bf1ef65cc582..649c68062dca 100644 --- a/include/uapi/linux/netfilter_ipv6/ip6_tables.h +++ b/include/uapi/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -178,6 +178,9 @@ struct ip6t_error { | |||
178 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) | 178 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) |
179 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET | 179 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET |
180 | 180 | ||
181 | /* obtain original address if REDIRECT'd connection */ | ||
182 | #define IP6T_SO_ORIGINAL_DST 80 | ||
183 | |||
181 | /* ICMP matching stuff */ | 184 | /* ICMP matching stuff */ |
182 | struct ip6t_icmp { | 185 | struct ip6t_icmp { |
183 | __u8 type; /* type to match */ | 186 | __u8 type; /* type to match */ |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index d908d17da56d..0e63cee8d810 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
@@ -60,6 +60,13 @@ | |||
60 | * target mode. | 60 | * target mode. |
61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated |
62 | * from target mode. | 62 | * from target mode. |
63 | * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device | ||
64 | * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for | ||
65 | * a device. LTO must be set before the link is up otherwise -EINPROGRESS | ||
66 | * is returned. RW and MIUX can be set at anytime and will be passed in | ||
67 | * subsequent CONNECT and CC messages. | ||
68 | * If one of the passed parameters is wrong none is set and -EINVAL is | ||
69 | * returned. | ||
63 | */ | 70 | */ |
64 | enum nfc_commands { | 71 | enum nfc_commands { |
65 | NFC_CMD_UNSPEC, | 72 | NFC_CMD_UNSPEC, |
@@ -77,6 +84,8 @@ enum nfc_commands { | |||
77 | NFC_EVENT_TARGET_LOST, | 84 | NFC_EVENT_TARGET_LOST, |
78 | NFC_EVENT_TM_ACTIVATED, | 85 | NFC_EVENT_TM_ACTIVATED, |
79 | NFC_EVENT_TM_DEACTIVATED, | 86 | NFC_EVENT_TM_DEACTIVATED, |
87 | NFC_CMD_LLC_GET_PARAMS, | ||
88 | NFC_CMD_LLC_SET_PARAMS, | ||
80 | /* private: internal use only */ | 89 | /* private: internal use only */ |
81 | __NFC_CMD_AFTER_LAST | 90 | __NFC_CMD_AFTER_LAST |
82 | }; | 91 | }; |
@@ -102,6 +111,9 @@ enum nfc_commands { | |||
102 | * @NFC_ATTR_RF_MODE: Initiator or target | 111 | * @NFC_ATTR_RF_MODE: Initiator or target |
103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | 112 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for |
104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | 113 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for |
114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | ||
115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | ||
116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | ||
105 | */ | 117 | */ |
106 | enum nfc_attrs { | 118 | enum nfc_attrs { |
107 | NFC_ATTR_UNSPEC, | 119 | NFC_ATTR_UNSPEC, |
@@ -119,6 +131,9 @@ enum nfc_attrs { | |||
119 | NFC_ATTR_DEVICE_POWERED, | 131 | NFC_ATTR_DEVICE_POWERED, |
120 | NFC_ATTR_IM_PROTOCOLS, | 132 | NFC_ATTR_IM_PROTOCOLS, |
121 | NFC_ATTR_TM_PROTOCOLS, | 133 | NFC_ATTR_TM_PROTOCOLS, |
134 | NFC_ATTR_LLC_PARAM_LTO, | ||
135 | NFC_ATTR_LLC_PARAM_RW, | ||
136 | NFC_ATTR_LLC_PARAM_MIUX, | ||
122 | /* private: internal use only */ | 137 | /* private: internal use only */ |
123 | __NFC_ATTR_AFTER_LAST | 138 | __NFC_ATTR_AFTER_LAST |
124 | }; | 139 | }; |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 7df9b500c804..33a417481ad8 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -118,8 +118,9 @@ | |||
118 | * to get a list of all present wiphys. | 118 | * to get a list of all present wiphys. |
119 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or | 119 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
120 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, | 120 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, |
121 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, | 121 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the |
122 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, | 122 | * attributes determining the channel width; this is used for setting |
123 | * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, | ||
123 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | 124 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, |
124 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. | 125 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. |
125 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL | 126 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL |
@@ -171,7 +172,7 @@ | |||
171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 172 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 173 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. |
173 | * The channel to use can be set on the interface or be given using the | 174 | * The channel to use can be set on the interface or be given using the |
174 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. | 175 | * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. |
175 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 176 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
176 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface | 177 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
177 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP | 178 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
@@ -401,8 +402,7 @@ | |||
401 | * a response while being associated to an AP on another channel. | 402 | * a response while being associated to an AP on another channel. |
402 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus | 403 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus |
403 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the | 404 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the |
404 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be | 405 | * frequency for the operation. |
405 | * optionally used to specify additional channel parameters. | ||
406 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds | 406 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds |
407 | * to remain on the channel. This command is also used as an event to | 407 | * to remain on the channel. This command is also used as an event to |
408 | * notify when the requested duration starts (it may take a while for the | 408 | * notify when the requested duration starts (it may take a while for the |
@@ -440,12 +440,11 @@ | |||
440 | * as an event indicating reception of a frame that was not processed in | 440 | * as an event indicating reception of a frame that was not processed in |
441 | * kernel code, but is for us (i.e., which may need to be processed in a | 441 | * kernel code, but is for us (i.e., which may need to be processed in a |
442 | * user space application). %NL80211_ATTR_FRAME is used to specify the | 442 | * user space application). %NL80211_ATTR_FRAME is used to specify the |
443 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | 443 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used |
444 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | 444 | * to indicate on which channel the frame is to be transmitted or was |
445 | * which channel the frame is to be transmitted or was received. If this | 445 | * received. If this channel is not the current channel (remain-on-channel |
446 | * channel is not the current channel (remain-on-channel or the | 446 | * or the operational channel) the device will switch to the given channel |
447 | * operational channel) the device will switch to the given channel and | 447 | * and transmit the frame, optionally waiting for a response for the time |
448 | * transmit the frame, optionally waiting for a response for the time | ||
449 | * specified using %NL80211_ATTR_DURATION. When called, this operation | 448 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
450 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | 449 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the |
451 | * TX status event pertaining to the TX request. | 450 | * TX status event pertaining to the TX request. |
@@ -473,8 +472,8 @@ | |||
473 | * command is used as an event to indicate the that a trigger level was | 472 | * command is used as an event to indicate the that a trigger level was |
474 | * reached. | 473 | * reached. |
475 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ | 474 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ |
476 | * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed | 475 | * and the attributes determining channel width) the given interface |
477 | * by %NL80211_ATTR_IFINDEX) shall operate on. | 476 | * (identifed by %NL80211_ATTR_IFINDEX) shall operate on. |
478 | * In case multiple channels are supported by the device, the mechanism | 477 | * In case multiple channels are supported by the device, the mechanism |
479 | * with which it switches channels is implementation-defined. | 478 | * with which it switches channels is implementation-defined. |
480 | * When a monitor interface is given, it can only switch channel while | 479 | * When a monitor interface is given, it can only switch channel while |
@@ -526,6 +525,12 @@ | |||
526 | * of PMKSA caching dandidates. | 525 | * of PMKSA caching dandidates. |
527 | * | 526 | * |
528 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). | 527 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). |
528 | * In addition, this can be used as an event to request userspace to take | ||
529 | * actions on TDLS links (set up a new link or tear down an existing one). | ||
530 | * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested | ||
531 | * operation, %NL80211_ATTR_MAC contains the peer MAC address, and | ||
532 | * %NL80211_ATTR_REASON_CODE the reason code to be used (only with | ||
533 | * %NL80211_TDLS_TEARDOWN). | ||
529 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. | 534 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. |
530 | * | 535 | * |
531 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP | 536 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP |
@@ -562,8 +567,8 @@ | |||
562 | * | 567 | * |
563 | * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels | 568 | * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels |
564 | * independently of the userspace SME, send this event indicating | 569 | * independently of the userspace SME, send this event indicating |
565 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with | 570 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the |
566 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. | 571 | * attributes determining channel width. |
567 | * | 572 | * |
568 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by | 573 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by |
569 | * its %NL80211_ATTR_WDEV identifier. It must have been created with | 574 | * its %NL80211_ATTR_WDEV identifier. It must have been created with |
@@ -578,6 +583,9 @@ | |||
578 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON | 583 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON |
579 | * is used for this. | 584 | * is used for this. |
580 | * | 585 | * |
586 | * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames | ||
587 | * for IBSS or MESH vif. | ||
588 | * | ||
581 | * @NL80211_CMD_MAX: highest used command number | 589 | * @NL80211_CMD_MAX: highest used command number |
582 | * @__NL80211_CMD_AFTER_LAST: internal use | 590 | * @__NL80211_CMD_AFTER_LAST: internal use |
583 | */ | 591 | */ |
@@ -726,6 +734,8 @@ enum nl80211_commands { | |||
726 | 734 | ||
727 | NL80211_CMD_CONN_FAILED, | 735 | NL80211_CMD_CONN_FAILED, |
728 | 736 | ||
737 | NL80211_CMD_SET_MCAST_RATE, | ||
738 | |||
729 | /* add new commands above here */ | 739 | /* add new commands above here */ |
730 | 740 | ||
731 | /* used to define NL80211_CMD_MAX below */ | 741 | /* used to define NL80211_CMD_MAX below */ |
@@ -762,14 +772,26 @@ enum nl80211_commands { | |||
762 | * /sys/class/ieee80211/<phyname>/index | 772 | * /sys/class/ieee80211/<phyname>/index |
763 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) | 773 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) |
764 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters | 774 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters |
765 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz | 775 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz, |
776 | * defines the channel together with the (deprecated) | ||
777 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes | ||
778 | * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 | ||
779 | * and %NL80211_ATTR_CENTER_FREQ2 | ||
780 | * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values | ||
781 | * of &enum nl80211_chan_width, describing the channel width. See the | ||
782 | * documentation of the enum for more information. | ||
783 | * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the | ||
784 | * channel, used for anything but 20 MHz bandwidth | ||
785 | * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the | ||
786 | * channel, used only for 80+80 MHz bandwidth | ||
766 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ | 787 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ |
767 | * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included): | 788 | * if HT20 or HT40 are to be used (i.e., HT disabled if not included): |
768 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including | 789 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including |
769 | * this attribute) | 790 | * this attribute) |
770 | * NL80211_CHAN_HT20 = HT20 only | 791 | * NL80211_CHAN_HT20 = HT20 only |
771 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel | 792 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel |
772 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel | 793 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel |
794 | * This attribute is now deprecated. | ||
773 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is | 795 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is |
774 | * less than or equal to the RTS threshold; allowed range: 1..255; | 796 | * less than or equal to the RTS threshold; allowed range: 1..255; |
775 | * dot11ShortRetryLimit; u8 | 797 | * dot11ShortRetryLimit; u8 |
@@ -1273,6 +1295,14 @@ enum nl80211_commands { | |||
1273 | * the connection request from a station. nl80211_connect_failed_reason | 1295 | * the connection request from a station. nl80211_connect_failed_reason |
1274 | * enum has different reasons of connection failure. | 1296 | * enum has different reasons of connection failure. |
1275 | * | 1297 | * |
1298 | * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts | ||
1299 | * with the Authentication transaction sequence number field. | ||
1300 | * | ||
1301 | * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from | ||
1302 | * association request when used with NL80211_CMD_NEW_STATION) | ||
1303 | * | ||
1304 | * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32) | ||
1305 | * | ||
1276 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1306 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1277 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1307 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1278 | */ | 1308 | */ |
@@ -1530,6 +1560,16 @@ enum nl80211_attrs { | |||
1530 | 1560 | ||
1531 | NL80211_ATTR_CONN_FAILED_REASON, | 1561 | NL80211_ATTR_CONN_FAILED_REASON, |
1532 | 1562 | ||
1563 | NL80211_ATTR_SAE_DATA, | ||
1564 | |||
1565 | NL80211_ATTR_VHT_CAPABILITY, | ||
1566 | |||
1567 | NL80211_ATTR_SCAN_FLAGS, | ||
1568 | |||
1569 | NL80211_ATTR_CHANNEL_WIDTH, | ||
1570 | NL80211_ATTR_CENTER_FREQ1, | ||
1571 | NL80211_ATTR_CENTER_FREQ2, | ||
1572 | |||
1533 | /* add attributes here, update the policy in nl80211.c */ | 1573 | /* add attributes here, update the policy in nl80211.c */ |
1534 | 1574 | ||
1535 | __NL80211_ATTR_AFTER_LAST, | 1575 | __NL80211_ATTR_AFTER_LAST, |
@@ -1573,6 +1613,7 @@ enum nl80211_attrs { | |||
1573 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | 1613 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 |
1574 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 1614 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
1575 | #define NL80211_HT_CAPABILITY_LEN 26 | 1615 | #define NL80211_HT_CAPABILITY_LEN 26 |
1616 | #define NL80211_VHT_CAPABILITY_LEN 12 | ||
1576 | 1617 | ||
1577 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | 1618 | #define NL80211_MAX_NR_CIPHER_SUITES 5 |
1578 | #define NL80211_MAX_NR_AKM_SUITES 2 | 1619 | #define NL80211_MAX_NR_AKM_SUITES 2 |
@@ -1693,10 +1734,15 @@ struct nl80211_sta_flag_update { | |||
1693 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved | 1734 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved |
1694 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) | 1735 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) |
1695 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) | 1736 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) |
1696 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate | 1737 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate |
1697 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval | 1738 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval |
1698 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) | 1739 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) |
1699 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined | 1740 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined |
1741 | * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) | ||
1742 | * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) | ||
1743 | * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate | ||
1744 | * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate | ||
1745 | * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate | ||
1700 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | 1746 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use |
1701 | */ | 1747 | */ |
1702 | enum nl80211_rate_info { | 1748 | enum nl80211_rate_info { |
@@ -1706,6 +1752,11 @@ enum nl80211_rate_info { | |||
1706 | NL80211_RATE_INFO_40_MHZ_WIDTH, | 1752 | NL80211_RATE_INFO_40_MHZ_WIDTH, |
1707 | NL80211_RATE_INFO_SHORT_GI, | 1753 | NL80211_RATE_INFO_SHORT_GI, |
1708 | NL80211_RATE_INFO_BITRATE32, | 1754 | NL80211_RATE_INFO_BITRATE32, |
1755 | NL80211_RATE_INFO_VHT_MCS, | ||
1756 | NL80211_RATE_INFO_VHT_NSS, | ||
1757 | NL80211_RATE_INFO_80_MHZ_WIDTH, | ||
1758 | NL80211_RATE_INFO_80P80_MHZ_WIDTH, | ||
1759 | NL80211_RATE_INFO_160_MHZ_WIDTH, | ||
1709 | 1760 | ||
1710 | /* keep last */ | 1761 | /* keep last */ |
1711 | __NL80211_RATE_INFO_AFTER_LAST, | 1762 | __NL80211_RATE_INFO_AFTER_LAST, |
@@ -2414,6 +2465,15 @@ enum nl80211_ac { | |||
2414 | #define NL80211_TXQ_Q_BE NL80211_AC_BE | 2465 | #define NL80211_TXQ_Q_BE NL80211_AC_BE |
2415 | #define NL80211_TXQ_Q_BK NL80211_AC_BK | 2466 | #define NL80211_TXQ_Q_BK NL80211_AC_BK |
2416 | 2467 | ||
2468 | /** | ||
2469 | * enum nl80211_channel_type - channel type | ||
2470 | * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel | ||
2471 | * @NL80211_CHAN_HT20: 20 MHz HT channel | ||
2472 | * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel | ||
2473 | * below the control channel | ||
2474 | * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel | ||
2475 | * above the control channel | ||
2476 | */ | ||
2417 | enum nl80211_channel_type { | 2477 | enum nl80211_channel_type { |
2418 | NL80211_CHAN_NO_HT, | 2478 | NL80211_CHAN_NO_HT, |
2419 | NL80211_CHAN_HT20, | 2479 | NL80211_CHAN_HT20, |
@@ -2422,6 +2482,32 @@ enum nl80211_channel_type { | |||
2422 | }; | 2482 | }; |
2423 | 2483 | ||
2424 | /** | 2484 | /** |
2485 | * enum nl80211_chan_width - channel width definitions | ||
2486 | * | ||
2487 | * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH | ||
2488 | * attribute. | ||
2489 | * | ||
2490 | * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel | ||
2491 | * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel | ||
2492 | * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2493 | * attribute must be provided as well | ||
2494 | * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2495 | * attribute must be provided as well | ||
2496 | * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2497 | * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well | ||
2498 | * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2499 | * attribute must be provided as well | ||
2500 | */ | ||
2501 | enum nl80211_chan_width { | ||
2502 | NL80211_CHAN_WIDTH_20_NOHT, | ||
2503 | NL80211_CHAN_WIDTH_20, | ||
2504 | NL80211_CHAN_WIDTH_40, | ||
2505 | NL80211_CHAN_WIDTH_80, | ||
2506 | NL80211_CHAN_WIDTH_80P80, | ||
2507 | NL80211_CHAN_WIDTH_160, | ||
2508 | }; | ||
2509 | |||
2510 | /** | ||
2425 | * enum nl80211_bss - netlink attributes for a BSS | 2511 | * enum nl80211_bss - netlink attributes for a BSS |
2426 | * | 2512 | * |
2427 | * @__NL80211_BSS_INVALID: invalid | 2513 | * @__NL80211_BSS_INVALID: invalid |
@@ -2489,6 +2575,7 @@ enum nl80211_bss_status { | |||
2489 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) | 2575 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) |
2490 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) | 2576 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) |
2491 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) | 2577 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) |
2578 | * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals | ||
2492 | * @__NL80211_AUTHTYPE_NUM: internal | 2579 | * @__NL80211_AUTHTYPE_NUM: internal |
2493 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm | 2580 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm |
2494 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by | 2581 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by |
@@ -2500,6 +2587,7 @@ enum nl80211_auth_type { | |||
2500 | NL80211_AUTHTYPE_SHARED_KEY, | 2587 | NL80211_AUTHTYPE_SHARED_KEY, |
2501 | NL80211_AUTHTYPE_FT, | 2588 | NL80211_AUTHTYPE_FT, |
2502 | NL80211_AUTHTYPE_NETWORK_EAP, | 2589 | NL80211_AUTHTYPE_NETWORK_EAP, |
2590 | NL80211_AUTHTYPE_SAE, | ||
2503 | 2591 | ||
2504 | /* keep last */ | 2592 | /* keep last */ |
2505 | __NL80211_AUTHTYPE_NUM, | 2593 | __NL80211_AUTHTYPE_NUM, |
@@ -3028,6 +3116,16 @@ enum nl80211_ap_sme_features { | |||
3028 | * in the interface combinations, even when it's only used for scan | 3116 | * in the interface combinations, even when it's only used for scan |
3029 | * and remain-on-channel. This could be due to, for example, the | 3117 | * and remain-on-channel. This could be due to, for example, the |
3030 | * remain-on-channel implementation requiring a channel context. | 3118 | * remain-on-channel implementation requiring a channel context. |
3119 | * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of | ||
3120 | * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station | ||
3121 | * mode | ||
3122 | * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan | ||
3123 | * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported | ||
3124 | * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif | ||
3125 | * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting | ||
3126 | * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform | ||
3127 | * OBSS scans and generate 20/40 BSS coex reports. This flag is used only | ||
3128 | * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied. | ||
3031 | */ | 3129 | */ |
3032 | enum nl80211_feature_flags { | 3130 | enum nl80211_feature_flags { |
3033 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 3131 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
@@ -3035,6 +3133,12 @@ enum nl80211_feature_flags { | |||
3035 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, | 3133 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, |
3036 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, | 3134 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, |
3037 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, | 3135 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, |
3136 | NL80211_FEATURE_SAE = 1 << 5, | ||
3137 | NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, | ||
3138 | NL80211_FEATURE_SCAN_FLUSH = 1 << 7, | ||
3139 | NL80211_FEATURE_AP_SCAN = 1 << 8, | ||
3140 | NL80211_FEATURE_VIF_TXPOWER = 1 << 9, | ||
3141 | NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, | ||
3038 | }; | 3142 | }; |
3039 | 3143 | ||
3040 | /** | 3144 | /** |
@@ -3069,4 +3173,25 @@ enum nl80211_connect_failed_reason { | |||
3069 | NL80211_CONN_FAIL_BLOCKED_CLIENT, | 3173 | NL80211_CONN_FAIL_BLOCKED_CLIENT, |
3070 | }; | 3174 | }; |
3071 | 3175 | ||
3176 | /** | ||
3177 | * enum nl80211_scan_flags - scan request control flags | ||
3178 | * | ||
3179 | * Scan request control flags are used to control the handling | ||
3180 | * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN | ||
3181 | * requests. | ||
3182 | * | ||
3183 | * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority | ||
3184 | * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning | ||
3185 | * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured | ||
3186 | * as AP and the beaconing has already been configured. This attribute is | ||
3187 | * dangerous because will destroy stations performance as a lot of frames | ||
3188 | * will be lost while scanning off-channel, therefore it must be used only | ||
3189 | * when really needed | ||
3190 | */ | ||
3191 | enum nl80211_scan_flags { | ||
3192 | NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, | ||
3193 | NL80211_SCAN_FLAG_FLUSH = 1<<1, | ||
3194 | NL80211_SCAN_FLAG_AP = 1<<2, | ||
3195 | }; | ||
3196 | |||
3072 | #endif /* __LINUX_NL80211_H */ | 3197 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/uapi/linux/oom.h b/include/uapi/linux/oom.h index a49c4afc7060..b29272d621ce 100644 --- a/include/uapi/linux/oom.h +++ b/include/uapi/linux/oom.h | |||
@@ -8,4 +8,13 @@ | |||
8 | #define OOM_SCORE_ADJ_MIN (-1000) | 8 | #define OOM_SCORE_ADJ_MIN (-1000) |
9 | #define OOM_SCORE_ADJ_MAX 1000 | 9 | #define OOM_SCORE_ADJ_MAX 1000 |
10 | 10 | ||
11 | /* | ||
12 | * /proc/<pid>/oom_adj set to -17 protects from the oom killer for legacy | ||
13 | * purposes. | ||
14 | */ | ||
15 | #define OOM_DISABLE (-17) | ||
16 | /* inclusive */ | ||
17 | #define OOM_ADJUST_MIN (-16) | ||
18 | #define OOM_ADJUST_MAX 15 | ||
19 | |||
11 | #endif /* _UAPI__INCLUDE_LINUX_OOM_H */ | 20 | #endif /* _UAPI__INCLUDE_LINUX_OOM_H */ |
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h index 94e981f810a2..b65c834f83e9 100644 --- a/include/uapi/linux/ptp_clock.h +++ b/include/uapi/linux/ptp_clock.h | |||
@@ -67,12 +67,26 @@ struct ptp_perout_request { | |||
67 | unsigned int rsv[4]; /* Reserved for future use. */ | 67 | unsigned int rsv[4]; /* Reserved for future use. */ |
68 | }; | 68 | }; |
69 | 69 | ||
70 | #define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */ | ||
71 | |||
72 | struct ptp_sys_offset { | ||
73 | unsigned int n_samples; /* Desired number of measurements. */ | ||
74 | unsigned int rsv[3]; /* Reserved for future use. */ | ||
75 | /* | ||
76 | * Array of interleaved system/phc time stamps. The kernel | ||
77 | * will provide 2*n_samples + 1 time stamps, with the last | ||
78 | * one as a system time stamp. | ||
79 | */ | ||
80 | struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; | ||
81 | }; | ||
82 | |||
70 | #define PTP_CLK_MAGIC '=' | 83 | #define PTP_CLK_MAGIC '=' |
71 | 84 | ||
72 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) | 85 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) |
73 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) | 86 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) |
74 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) | 87 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) |
75 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) | 88 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) |
89 | #define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset) | ||
76 | 90 | ||
77 | struct ptp_extts_event { | 91 | struct ptp_extts_event { |
78 | struct ptp_clock_time t; /* Time event occured. */ | 92 | struct ptp_clock_time t; /* Time event occured. */ |
diff --git a/include/uapi/linux/raid/Kbuild b/include/uapi/linux/raid/Kbuild index aafaa5aa54d4..e2c3d25405d7 100644 --- a/include/uapi/linux/raid/Kbuild +++ b/include/uapi/linux/raid/Kbuild | |||
@@ -1 +1,3 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += md_p.h | ||
3 | header-y += md_u.h | ||
diff --git a/include/linux/raid/md_p.h b/include/uapi/linux/raid/md_p.h index ee753536ab70..ee753536ab70 100644 --- a/include/linux/raid/md_p.h +++ b/include/uapi/linux/raid/md_p.h | |||
diff --git a/include/uapi/linux/raid/md_u.h b/include/uapi/linux/raid/md_u.h new file mode 100644 index 000000000000..4133e744e4e6 --- /dev/null +++ b/include/uapi/linux/raid/md_u.h | |||
@@ -0,0 +1,155 @@ | |||
1 | /* | ||
2 | md_u.h : user <=> kernel API between Linux raidtools and RAID drivers | ||
3 | Copyright (C) 1998 Ingo Molnar | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation; either version 2, or (at your option) | ||
8 | any later version. | ||
9 | |||
10 | You should have received a copy of the GNU General Public License | ||
11 | (for example /usr/src/linux/COPYING); if not, write to the Free | ||
12 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
13 | */ | ||
14 | |||
15 | #ifndef _UAPI_MD_U_H | ||
16 | #define _UAPI_MD_U_H | ||
17 | |||
18 | /* | ||
19 | * Different major versions are not compatible. | ||
20 | * Different minor versions are only downward compatible. | ||
21 | * Different patchlevel versions are downward and upward compatible. | ||
22 | */ | ||
23 | #define MD_MAJOR_VERSION 0 | ||
24 | #define MD_MINOR_VERSION 90 | ||
25 | /* | ||
26 | * MD_PATCHLEVEL_VERSION indicates kernel functionality. | ||
27 | * >=1 means different superblock formats are selectable using SET_ARRAY_INFO | ||
28 | * and major_version/minor_version accordingly | ||
29 | * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT | ||
30 | * in the super status byte | ||
31 | * >=3 means that bitmap superblock version 4 is supported, which uses | ||
32 | * little-ending representation rather than host-endian | ||
33 | */ | ||
34 | #define MD_PATCHLEVEL_VERSION 3 | ||
35 | |||
36 | /* ioctls */ | ||
37 | |||
38 | /* status */ | ||
39 | #define RAID_VERSION _IOR (MD_MAJOR, 0x10, mdu_version_t) | ||
40 | #define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, mdu_array_info_t) | ||
41 | #define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) | ||
42 | #define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) | ||
43 | #define RAID_AUTORUN _IO (MD_MAJOR, 0x14) | ||
44 | #define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t) | ||
45 | |||
46 | /* configuration */ | ||
47 | #define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) | ||
48 | #define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, mdu_disk_info_t) | ||
49 | #define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22) | ||
50 | #define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, mdu_array_info_t) | ||
51 | #define SET_DISK_INFO _IO (MD_MAJOR, 0x24) | ||
52 | #define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25) | ||
53 | #define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26) | ||
54 | #define PROTECT_ARRAY _IO (MD_MAJOR, 0x27) | ||
55 | #define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) | ||
56 | #define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) | ||
57 | #define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) | ||
58 | #define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int) | ||
59 | |||
60 | /* usage */ | ||
61 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | ||
62 | /* 0x31 was START_ARRAY */ | ||
63 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) | ||
64 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) | ||
65 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) | ||
66 | |||
67 | /* 63 partitions with the alternate major number (mdp) */ | ||
68 | #define MdpMinorShift 6 | ||
69 | |||
70 | typedef struct mdu_version_s { | ||
71 | int major; | ||
72 | int minor; | ||
73 | int patchlevel; | ||
74 | } mdu_version_t; | ||
75 | |||
76 | typedef struct mdu_array_info_s { | ||
77 | /* | ||
78 | * Generic constant information | ||
79 | */ | ||
80 | int major_version; | ||
81 | int minor_version; | ||
82 | int patch_version; | ||
83 | int ctime; | ||
84 | int level; | ||
85 | int size; | ||
86 | int nr_disks; | ||
87 | int raid_disks; | ||
88 | int md_minor; | ||
89 | int not_persistent; | ||
90 | |||
91 | /* | ||
92 | * Generic state information | ||
93 | */ | ||
94 | int utime; /* 0 Superblock update time */ | ||
95 | int state; /* 1 State bits (clean, ...) */ | ||
96 | int active_disks; /* 2 Number of currently active disks */ | ||
97 | int working_disks; /* 3 Number of working disks */ | ||
98 | int failed_disks; /* 4 Number of failed disks */ | ||
99 | int spare_disks; /* 5 Number of spare disks */ | ||
100 | |||
101 | /* | ||
102 | * Personality information | ||
103 | */ | ||
104 | int layout; /* 0 the array's physical layout */ | ||
105 | int chunk_size; /* 1 chunk size in bytes */ | ||
106 | |||
107 | } mdu_array_info_t; | ||
108 | |||
109 | /* non-obvious values for 'level' */ | ||
110 | #define LEVEL_MULTIPATH (-4) | ||
111 | #define LEVEL_LINEAR (-1) | ||
112 | #define LEVEL_FAULTY (-5) | ||
113 | |||
114 | /* we need a value for 'no level specified' and 0 | ||
115 | * means 'raid0', so we need something else. This is | ||
116 | * for internal use only | ||
117 | */ | ||
118 | #define LEVEL_NONE (-1000000) | ||
119 | |||
120 | typedef struct mdu_disk_info_s { | ||
121 | /* | ||
122 | * configuration/status of one particular disk | ||
123 | */ | ||
124 | int number; | ||
125 | int major; | ||
126 | int minor; | ||
127 | int raid_disk; | ||
128 | int state; | ||
129 | |||
130 | } mdu_disk_info_t; | ||
131 | |||
132 | typedef struct mdu_start_info_s { | ||
133 | /* | ||
134 | * configuration/status of one particular disk | ||
135 | */ | ||
136 | int major; | ||
137 | int minor; | ||
138 | int raid_disk; | ||
139 | int state; | ||
140 | |||
141 | } mdu_start_info_t; | ||
142 | |||
143 | typedef struct mdu_bitmap_file_s | ||
144 | { | ||
145 | char pathname[4096]; | ||
146 | } mdu_bitmap_file_t; | ||
147 | |||
148 | typedef struct mdu_param_s | ||
149 | { | ||
150 | int personality; /* 1,2,3,4 */ | ||
151 | int chunk_size; /* in bytes */ | ||
152 | int max_fault; /* unused for now */ | ||
153 | } mdu_param_t; | ||
154 | |||
155 | #endif /* _UAPI_MD_U_H */ | ||
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index fcd768b09f6e..3dee071770d5 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
@@ -120,6 +120,11 @@ enum { | |||
120 | RTM_SETDCB, | 120 | RTM_SETDCB, |
121 | #define RTM_SETDCB RTM_SETDCB | 121 | #define RTM_SETDCB RTM_SETDCB |
122 | 122 | ||
123 | RTM_NEWNETCONF = 80, | ||
124 | #define RTM_NEWNETCONF RTM_NEWNETCONF | ||
125 | RTM_GETNETCONF = 82, | ||
126 | #define RTM_GETNETCONF RTM_GETNETCONF | ||
127 | |||
123 | __RTM_MAX, | 128 | __RTM_MAX, |
124 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 129 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
125 | }; | 130 | }; |
@@ -587,6 +592,10 @@ enum rtnetlink_groups { | |||
587 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | 592 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE |
588 | RTNLGRP_DCB, | 593 | RTNLGRP_DCB, |
589 | #define RTNLGRP_DCB RTNLGRP_DCB | 594 | #define RTNLGRP_DCB RTNLGRP_DCB |
595 | RTNLGRP_IPV4_NETCONF, | ||
596 | #define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF | ||
597 | RTNLGRP_IPV6_NETCONF, | ||
598 | #define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF | ||
590 | __RTNLGRP_MAX | 599 | __RTNLGRP_MAX |
591 | }; | 600 | }; |
592 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 601 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h index c4b89a5cb7df..e962faa5ab0d 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h | |||
@@ -130,6 +130,7 @@ enum { | |||
130 | #define TCPI_OPT_WSCALE 4 | 130 | #define TCPI_OPT_WSCALE 4 |
131 | #define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ | 131 | #define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ |
132 | #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ | 132 | #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ |
133 | #define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ | ||
133 | 134 | ||
134 | enum tcp_ca_state { | 135 | enum tcp_ca_state { |
135 | TCP_CA_Open = 0, | 136 | TCP_CA_Open = 0, |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b1d2bf16b33c..b8a24941db21 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
@@ -37,6 +37,7 @@ enum { | |||
37 | UNIX_DIAG_ICONS, | 37 | UNIX_DIAG_ICONS, |
38 | UNIX_DIAG_RQLEN, | 38 | UNIX_DIAG_RQLEN, |
39 | UNIX_DIAG_MEMINFO, | 39 | UNIX_DIAG_MEMINFO, |
40 | UNIX_DIAG_SHUTDOWN, | ||
40 | 41 | ||
41 | UNIX_DIAG_MAX, | 42 | UNIX_DIAG_MAX, |
42 | }; | 43 | }; |
diff --git a/include/uapi/linux/usb/Kbuild b/include/uapi/linux/usb/Kbuild index aafaa5aa54d4..6cb4ea826834 100644 --- a/include/uapi/linux/usb/Kbuild +++ b/include/uapi/linux/usb/Kbuild | |||
@@ -1 +1,11 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += audio.h | ||
3 | header-y += cdc.h | ||
4 | header-y += ch11.h | ||
5 | header-y += ch9.h | ||
6 | header-y += functionfs.h | ||
7 | header-y += g_printer.h | ||
8 | header-y += gadgetfs.h | ||
9 | header-y += midi.h | ||
10 | header-y += tmc.h | ||
11 | header-y += video.h | ||
diff --git a/include/uapi/linux/usb/audio.h b/include/uapi/linux/usb/audio.h new file mode 100644 index 000000000000..ac90037894d9 --- /dev/null +++ b/include/uapi/linux/usb/audio.h | |||
@@ -0,0 +1,545 @@ | |||
1 | /* | ||
2 | * <linux/usb/audio.h> -- USB Audio definitions. | ||
3 | * | ||
4 | * Copyright (C) 2006 Thumtronics Pty Ltd. | ||
5 | * Developed for Thumtronics by Grey Innovation | ||
6 | * Ben Williamson <ben.williamson@greyinnovation.com> | ||
7 | * | ||
8 | * This software is distributed under the terms of the GNU General Public | ||
9 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This file holds USB constants and structures defined | ||
12 | * by the USB Device Class Definition for Audio Devices. | ||
13 | * Comments below reference relevant sections of that document: | ||
14 | * | ||
15 | * http://www.usb.org/developers/devclass_docs/audio10.pdf | ||
16 | * | ||
17 | * Types and defines in this file are either specific to version 1.0 of | ||
18 | * this standard or common for newer versions. | ||
19 | */ | ||
20 | |||
21 | #ifndef _UAPI__LINUX_USB_AUDIO_H | ||
22 | #define _UAPI__LINUX_USB_AUDIO_H | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | |||
26 | /* bInterfaceProtocol values to denote the version of the standard used */ | ||
27 | #define UAC_VERSION_1 0x00 | ||
28 | #define UAC_VERSION_2 0x20 | ||
29 | |||
30 | /* A.2 Audio Interface Subclass Codes */ | ||
31 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | ||
32 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | ||
33 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | ||
34 | |||
35 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | ||
36 | #define UAC_HEADER 0x01 | ||
37 | #define UAC_INPUT_TERMINAL 0x02 | ||
38 | #define UAC_OUTPUT_TERMINAL 0x03 | ||
39 | #define UAC_MIXER_UNIT 0x04 | ||
40 | #define UAC_SELECTOR_UNIT 0x05 | ||
41 | #define UAC_FEATURE_UNIT 0x06 | ||
42 | #define UAC1_PROCESSING_UNIT 0x07 | ||
43 | #define UAC1_EXTENSION_UNIT 0x08 | ||
44 | |||
45 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | ||
46 | #define UAC_AS_GENERAL 0x01 | ||
47 | #define UAC_FORMAT_TYPE 0x02 | ||
48 | #define UAC_FORMAT_SPECIFIC 0x03 | ||
49 | |||
50 | /* A.7 Processing Unit Process Types */ | ||
51 | #define UAC_PROCESS_UNDEFINED 0x00 | ||
52 | #define UAC_PROCESS_UP_DOWNMIX 0x01 | ||
53 | #define UAC_PROCESS_DOLBY_PROLOGIC 0x02 | ||
54 | #define UAC_PROCESS_STEREO_EXTENDER 0x03 | ||
55 | #define UAC_PROCESS_REVERB 0x04 | ||
56 | #define UAC_PROCESS_CHORUS 0x05 | ||
57 | #define UAC_PROCESS_DYN_RANGE_COMP 0x06 | ||
58 | |||
59 | /* A.8 Audio Class-Specific Endpoint Descriptor Subtypes */ | ||
60 | #define UAC_EP_GENERAL 0x01 | ||
61 | |||
62 | /* A.9 Audio Class-Specific Request Codes */ | ||
63 | #define UAC_SET_ 0x00 | ||
64 | #define UAC_GET_ 0x80 | ||
65 | |||
66 | #define UAC__CUR 0x1 | ||
67 | #define UAC__MIN 0x2 | ||
68 | #define UAC__MAX 0x3 | ||
69 | #define UAC__RES 0x4 | ||
70 | #define UAC__MEM 0x5 | ||
71 | |||
72 | #define UAC_SET_CUR (UAC_SET_ | UAC__CUR) | ||
73 | #define UAC_GET_CUR (UAC_GET_ | UAC__CUR) | ||
74 | #define UAC_SET_MIN (UAC_SET_ | UAC__MIN) | ||
75 | #define UAC_GET_MIN (UAC_GET_ | UAC__MIN) | ||
76 | #define UAC_SET_MAX (UAC_SET_ | UAC__MAX) | ||
77 | #define UAC_GET_MAX (UAC_GET_ | UAC__MAX) | ||
78 | #define UAC_SET_RES (UAC_SET_ | UAC__RES) | ||
79 | #define UAC_GET_RES (UAC_GET_ | UAC__RES) | ||
80 | #define UAC_SET_MEM (UAC_SET_ | UAC__MEM) | ||
81 | #define UAC_GET_MEM (UAC_GET_ | UAC__MEM) | ||
82 | |||
83 | #define UAC_GET_STAT 0xff | ||
84 | |||
85 | /* A.10 Control Selector Codes */ | ||
86 | |||
87 | /* A.10.1 Terminal Control Selectors */ | ||
88 | #define UAC_TERM_COPY_PROTECT 0x01 | ||
89 | |||
90 | /* A.10.2 Feature Unit Control Selectors */ | ||
91 | #define UAC_FU_MUTE 0x01 | ||
92 | #define UAC_FU_VOLUME 0x02 | ||
93 | #define UAC_FU_BASS 0x03 | ||
94 | #define UAC_FU_MID 0x04 | ||
95 | #define UAC_FU_TREBLE 0x05 | ||
96 | #define UAC_FU_GRAPHIC_EQUALIZER 0x06 | ||
97 | #define UAC_FU_AUTOMATIC_GAIN 0x07 | ||
98 | #define UAC_FU_DELAY 0x08 | ||
99 | #define UAC_FU_BASS_BOOST 0x09 | ||
100 | #define UAC_FU_LOUDNESS 0x0a | ||
101 | |||
102 | #define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1)) | ||
103 | |||
104 | /* A.10.3.1 Up/Down-mix Processing Unit Controls Selectors */ | ||
105 | #define UAC_UD_ENABLE 0x01 | ||
106 | #define UAC_UD_MODE_SELECT 0x02 | ||
107 | |||
108 | /* A.10.3.2 Dolby Prologic (tm) Processing Unit Controls Selectors */ | ||
109 | #define UAC_DP_ENABLE 0x01 | ||
110 | #define UAC_DP_MODE_SELECT 0x02 | ||
111 | |||
112 | /* A.10.3.3 3D Stereo Extender Processing Unit Control Selectors */ | ||
113 | #define UAC_3D_ENABLE 0x01 | ||
114 | #define UAC_3D_SPACE 0x02 | ||
115 | |||
116 | /* A.10.3.4 Reverberation Processing Unit Control Selectors */ | ||
117 | #define UAC_REVERB_ENABLE 0x01 | ||
118 | #define UAC_REVERB_LEVEL 0x02 | ||
119 | #define UAC_REVERB_TIME 0x03 | ||
120 | #define UAC_REVERB_FEEDBACK 0x04 | ||
121 | |||
122 | /* A.10.3.5 Chorus Processing Unit Control Selectors */ | ||
123 | #define UAC_CHORUS_ENABLE 0x01 | ||
124 | #define UAC_CHORUS_LEVEL 0x02 | ||
125 | #define UAC_CHORUS_RATE 0x03 | ||
126 | #define UAC_CHORUS_DEPTH 0x04 | ||
127 | |||
128 | /* A.10.3.6 Dynamic Range Compressor Unit Control Selectors */ | ||
129 | #define UAC_DCR_ENABLE 0x01 | ||
130 | #define UAC_DCR_RATE 0x02 | ||
131 | #define UAC_DCR_MAXAMPL 0x03 | ||
132 | #define UAC_DCR_THRESHOLD 0x04 | ||
133 | #define UAC_DCR_ATTACK_TIME 0x05 | ||
134 | #define UAC_DCR_RELEASE_TIME 0x06 | ||
135 | |||
136 | /* A.10.4 Extension Unit Control Selectors */ | ||
137 | #define UAC_XU_ENABLE 0x01 | ||
138 | |||
139 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ | ||
140 | #define UAC_MS_HEADER 0x01 | ||
141 | #define UAC_MIDI_IN_JACK 0x02 | ||
142 | #define UAC_MIDI_OUT_JACK 0x03 | ||
143 | |||
144 | /* MIDI - A.1 MS Class-Specific Endpoint Descriptor Subtypes */ | ||
145 | #define UAC_MS_GENERAL 0x01 | ||
146 | |||
147 | /* Terminals - 2.1 USB Terminal Types */ | ||
148 | #define UAC_TERMINAL_UNDEFINED 0x100 | ||
149 | #define UAC_TERMINAL_STREAMING 0x101 | ||
150 | #define UAC_TERMINAL_VENDOR_SPEC 0x1FF | ||
151 | |||
152 | /* Terminal Control Selectors */ | ||
153 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | ||
154 | struct uac1_ac_header_descriptor { | ||
155 | __u8 bLength; /* 8 + n */ | ||
156 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
157 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | ||
158 | __le16 bcdADC; /* 0x0100 */ | ||
159 | __le16 wTotalLength; /* includes Unit and Terminal desc. */ | ||
160 | __u8 bInCollection; /* n */ | ||
161 | __u8 baInterfaceNr[]; /* [n] */ | ||
162 | } __attribute__ ((packed)); | ||
163 | |||
164 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) | ||
165 | |||
166 | /* As above, but more useful for defining your own descriptors: */ | ||
167 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | ||
168 | struct uac1_ac_header_descriptor_##n { \ | ||
169 | __u8 bLength; \ | ||
170 | __u8 bDescriptorType; \ | ||
171 | __u8 bDescriptorSubtype; \ | ||
172 | __le16 bcdADC; \ | ||
173 | __le16 wTotalLength; \ | ||
174 | __u8 bInCollection; \ | ||
175 | __u8 baInterfaceNr[n]; \ | ||
176 | } __attribute__ ((packed)) | ||
177 | |||
178 | /* 4.3.2.1 Input Terminal Descriptor */ | ||
179 | struct uac_input_terminal_descriptor { | ||
180 | __u8 bLength; /* in bytes: 12 */ | ||
181 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
182 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | ||
183 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
184 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
185 | __u8 bAssocTerminal; /* ID of the Output Terminal associated */ | ||
186 | __u8 bNrChannels; /* Number of logical output channels */ | ||
187 | __le16 wChannelConfig; | ||
188 | __u8 iChannelNames; | ||
189 | __u8 iTerminal; | ||
190 | } __attribute__ ((packed)); | ||
191 | |||
192 | #define UAC_DT_INPUT_TERMINAL_SIZE 12 | ||
193 | |||
194 | /* Terminals - 2.2 Input Terminal Types */ | ||
195 | #define UAC_INPUT_TERMINAL_UNDEFINED 0x200 | ||
196 | #define UAC_INPUT_TERMINAL_MICROPHONE 0x201 | ||
197 | #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | ||
198 | #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | ||
199 | #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | ||
200 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | ||
201 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
202 | |||
203 | /* Terminals - control selectors */ | ||
204 | |||
205 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | ||
206 | |||
207 | /* 4.3.2.2 Output Terminal Descriptor */ | ||
208 | struct uac1_output_terminal_descriptor { | ||
209 | __u8 bLength; /* in bytes: 9 */ | ||
210 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
211 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | ||
212 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
213 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
214 | __u8 bAssocTerminal; /* ID of the Input Terminal associated */ | ||
215 | __u8 bSourceID; /* ID of the connected Unit or Terminal*/ | ||
216 | __u8 iTerminal; | ||
217 | } __attribute__ ((packed)); | ||
218 | |||
219 | #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 | ||
220 | |||
221 | /* Terminals - 2.3 Output Terminal Types */ | ||
222 | #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 | ||
223 | #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 | ||
224 | #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 | ||
225 | #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | ||
226 | #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | ||
227 | #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | ||
228 | #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | ||
229 | #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
230 | |||
231 | /* Set bControlSize = 2 as default setting */ | ||
232 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | ||
233 | |||
234 | /* As above, but more useful for defining your own descriptors: */ | ||
235 | #define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ | ||
236 | struct uac_feature_unit_descriptor_##ch { \ | ||
237 | __u8 bLength; \ | ||
238 | __u8 bDescriptorType; \ | ||
239 | __u8 bDescriptorSubtype; \ | ||
240 | __u8 bUnitID; \ | ||
241 | __u8 bSourceID; \ | ||
242 | __u8 bControlSize; \ | ||
243 | __le16 bmaControls[ch + 1]; \ | ||
244 | __u8 iFeature; \ | ||
245 | } __attribute__ ((packed)) | ||
246 | |||
247 | /* 4.3.2.3 Mixer Unit Descriptor */ | ||
248 | struct uac_mixer_unit_descriptor { | ||
249 | __u8 bLength; | ||
250 | __u8 bDescriptorType; | ||
251 | __u8 bDescriptorSubtype; | ||
252 | __u8 bUnitID; | ||
253 | __u8 bNrInPins; | ||
254 | __u8 baSourceID[]; | ||
255 | } __attribute__ ((packed)); | ||
256 | |||
257 | static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc) | ||
258 | { | ||
259 | return desc->baSourceID[desc->bNrInPins]; | ||
260 | } | ||
261 | |||
262 | static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc, | ||
263 | int protocol) | ||
264 | { | ||
265 | if (protocol == UAC_VERSION_1) | ||
266 | return (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
267 | desc->baSourceID[desc->bNrInPins + 1]; | ||
268 | else | ||
269 | return (desc->baSourceID[desc->bNrInPins + 4] << 24) | | ||
270 | (desc->baSourceID[desc->bNrInPins + 3] << 16) | | ||
271 | (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
272 | (desc->baSourceID[desc->bNrInPins + 1]); | ||
273 | } | ||
274 | |||
275 | static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc, | ||
276 | int protocol) | ||
277 | { | ||
278 | return (protocol == UAC_VERSION_1) ? | ||
279 | desc->baSourceID[desc->bNrInPins + 3] : | ||
280 | desc->baSourceID[desc->bNrInPins + 5]; | ||
281 | } | ||
282 | |||
283 | static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc, | ||
284 | int protocol) | ||
285 | { | ||
286 | return (protocol == UAC_VERSION_1) ? | ||
287 | &desc->baSourceID[desc->bNrInPins + 4] : | ||
288 | &desc->baSourceID[desc->bNrInPins + 6]; | ||
289 | } | ||
290 | |||
291 | static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc) | ||
292 | { | ||
293 | __u8 *raw = (__u8 *) desc; | ||
294 | return raw[desc->bLength - 1]; | ||
295 | } | ||
296 | |||
297 | /* 4.3.2.4 Selector Unit Descriptor */ | ||
298 | struct uac_selector_unit_descriptor { | ||
299 | __u8 bLength; | ||
300 | __u8 bDescriptorType; | ||
301 | __u8 bDescriptorSubtype; | ||
302 | __u8 bUintID; | ||
303 | __u8 bNrInPins; | ||
304 | __u8 baSourceID[]; | ||
305 | } __attribute__ ((packed)); | ||
306 | |||
307 | static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc) | ||
308 | { | ||
309 | __u8 *raw = (__u8 *) desc; | ||
310 | return raw[desc->bLength - 1]; | ||
311 | } | ||
312 | |||
313 | /* 4.3.2.5 Feature Unit Descriptor */ | ||
314 | struct uac_feature_unit_descriptor { | ||
315 | __u8 bLength; | ||
316 | __u8 bDescriptorType; | ||
317 | __u8 bDescriptorSubtype; | ||
318 | __u8 bUnitID; | ||
319 | __u8 bSourceID; | ||
320 | __u8 bControlSize; | ||
321 | __u8 bmaControls[0]; /* variable length */ | ||
322 | } __attribute__((packed)); | ||
323 | |||
324 | static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc) | ||
325 | { | ||
326 | __u8 *raw = (__u8 *) desc; | ||
327 | return raw[desc->bLength - 1]; | ||
328 | } | ||
329 | |||
330 | /* 4.3.2.6 Processing Unit Descriptors */ | ||
331 | struct uac_processing_unit_descriptor { | ||
332 | __u8 bLength; | ||
333 | __u8 bDescriptorType; | ||
334 | __u8 bDescriptorSubtype; | ||
335 | __u8 bUnitID; | ||
336 | __u16 wProcessType; | ||
337 | __u8 bNrInPins; | ||
338 | __u8 baSourceID[]; | ||
339 | } __attribute__ ((packed)); | ||
340 | |||
341 | static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc) | ||
342 | { | ||
343 | return desc->baSourceID[desc->bNrInPins]; | ||
344 | } | ||
345 | |||
346 | static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc, | ||
347 | int protocol) | ||
348 | { | ||
349 | if (protocol == UAC_VERSION_1) | ||
350 | return (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
351 | desc->baSourceID[desc->bNrInPins + 1]; | ||
352 | else | ||
353 | return (desc->baSourceID[desc->bNrInPins + 4] << 24) | | ||
354 | (desc->baSourceID[desc->bNrInPins + 3] << 16) | | ||
355 | (desc->baSourceID[desc->bNrInPins + 2] << 8) | | ||
356 | (desc->baSourceID[desc->bNrInPins + 1]); | ||
357 | } | ||
358 | |||
359 | static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc, | ||
360 | int protocol) | ||
361 | { | ||
362 | return (protocol == UAC_VERSION_1) ? | ||
363 | desc->baSourceID[desc->bNrInPins + 3] : | ||
364 | desc->baSourceID[desc->bNrInPins + 5]; | ||
365 | } | ||
366 | |||
367 | static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc, | ||
368 | int protocol) | ||
369 | { | ||
370 | return (protocol == UAC_VERSION_1) ? | ||
371 | desc->baSourceID[desc->bNrInPins + 4] : | ||
372 | desc->baSourceID[desc->bNrInPins + 6]; | ||
373 | } | ||
374 | |||
375 | static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc, | ||
376 | int protocol) | ||
377 | { | ||
378 | return (protocol == UAC_VERSION_1) ? | ||
379 | &desc->baSourceID[desc->bNrInPins + 5] : | ||
380 | &desc->baSourceID[desc->bNrInPins + 7]; | ||
381 | } | ||
382 | |||
383 | static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc, | ||
384 | int protocol) | ||
385 | { | ||
386 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | ||
387 | return desc->baSourceID[desc->bNrInPins + control_size]; | ||
388 | } | ||
389 | |||
390 | static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc, | ||
391 | int protocol) | ||
392 | { | ||
393 | __u8 control_size = uac_processing_unit_bControlSize(desc, protocol); | ||
394 | return &desc->baSourceID[desc->bNrInPins + control_size + 1]; | ||
395 | } | ||
396 | |||
397 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | ||
398 | struct uac1_as_header_descriptor { | ||
399 | __u8 bLength; /* in bytes: 7 */ | ||
400 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
401 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | ||
402 | __u8 bTerminalLink; /* Terminal ID of connected Terminal */ | ||
403 | __u8 bDelay; /* Delay introduced by the data path */ | ||
404 | __le16 wFormatTag; /* The Audio Data Format */ | ||
405 | } __attribute__ ((packed)); | ||
406 | |||
407 | #define UAC_DT_AS_HEADER_SIZE 7 | ||
408 | |||
409 | /* Formats - A.1.1 Audio Data Format Type I Codes */ | ||
410 | #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 | ||
411 | #define UAC_FORMAT_TYPE_I_PCM 0x1 | ||
412 | #define UAC_FORMAT_TYPE_I_PCM8 0x2 | ||
413 | #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | ||
414 | #define UAC_FORMAT_TYPE_I_ALAW 0x4 | ||
415 | #define UAC_FORMAT_TYPE_I_MULAW 0x5 | ||
416 | |||
417 | struct uac_format_type_i_continuous_descriptor { | ||
418 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
419 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
420 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
421 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
422 | __u8 bNrChannels; /* physical channels in the stream */ | ||
423 | __u8 bSubframeSize; /* */ | ||
424 | __u8 bBitResolution; | ||
425 | __u8 bSamFreqType; | ||
426 | __u8 tLowerSamFreq[3]; | ||
427 | __u8 tUpperSamFreq[3]; | ||
428 | } __attribute__ ((packed)); | ||
429 | |||
430 | #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | ||
431 | |||
432 | struct uac_format_type_i_discrete_descriptor { | ||
433 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
434 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
435 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
436 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
437 | __u8 bNrChannels; /* physical channels in the stream */ | ||
438 | __u8 bSubframeSize; /* */ | ||
439 | __u8 bBitResolution; | ||
440 | __u8 bSamFreqType; | ||
441 | __u8 tSamFreq[][3]; | ||
442 | } __attribute__ ((packed)); | ||
443 | |||
444 | #define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | ||
445 | struct uac_format_type_i_discrete_descriptor_##n { \ | ||
446 | __u8 bLength; \ | ||
447 | __u8 bDescriptorType; \ | ||
448 | __u8 bDescriptorSubtype; \ | ||
449 | __u8 bFormatType; \ | ||
450 | __u8 bNrChannels; \ | ||
451 | __u8 bSubframeSize; \ | ||
452 | __u8 bBitResolution; \ | ||
453 | __u8 bSamFreqType; \ | ||
454 | __u8 tSamFreq[n][3]; \ | ||
455 | } __attribute__ ((packed)) | ||
456 | |||
457 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | ||
458 | |||
459 | struct uac_format_type_i_ext_descriptor { | ||
460 | __u8 bLength; | ||
461 | __u8 bDescriptorType; | ||
462 | __u8 bDescriptorSubtype; | ||
463 | __u8 bFormatType; | ||
464 | __u8 bSubslotSize; | ||
465 | __u8 bBitResolution; | ||
466 | __u8 bHeaderLength; | ||
467 | __u8 bControlSize; | ||
468 | __u8 bSideBandProtocol; | ||
469 | } __attribute__((packed)); | ||
470 | |||
471 | /* Formats - Audio Data Format Type I Codes */ | ||
472 | |||
473 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 | ||
474 | #define UAC_FORMAT_TYPE_II_AC3 0x1002 | ||
475 | |||
476 | struct uac_format_type_ii_discrete_descriptor { | ||
477 | __u8 bLength; | ||
478 | __u8 bDescriptorType; | ||
479 | __u8 bDescriptorSubtype; | ||
480 | __u8 bFormatType; | ||
481 | __le16 wMaxBitRate; | ||
482 | __le16 wSamplesPerFrame; | ||
483 | __u8 bSamFreqType; | ||
484 | __u8 tSamFreq[][3]; | ||
485 | } __attribute__((packed)); | ||
486 | |||
487 | struct uac_format_type_ii_ext_descriptor { | ||
488 | __u8 bLength; | ||
489 | __u8 bDescriptorType; | ||
490 | __u8 bDescriptorSubtype; | ||
491 | __u8 bFormatType; | ||
492 | __u16 wMaxBitRate; | ||
493 | __u16 wSamplesPerFrame; | ||
494 | __u8 bHeaderLength; | ||
495 | __u8 bSideBandProtocol; | ||
496 | } __attribute__((packed)); | ||
497 | |||
498 | /* type III */ | ||
499 | #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 | ||
500 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 | ||
501 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 | ||
502 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 | ||
503 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
504 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
505 | |||
506 | /* Formats - A.2 Format Type Codes */ | ||
507 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 | ||
508 | #define UAC_FORMAT_TYPE_I 0x1 | ||
509 | #define UAC_FORMAT_TYPE_II 0x2 | ||
510 | #define UAC_FORMAT_TYPE_III 0x3 | ||
511 | #define UAC_EXT_FORMAT_TYPE_I 0x81 | ||
512 | #define UAC_EXT_FORMAT_TYPE_II 0x82 | ||
513 | #define UAC_EXT_FORMAT_TYPE_III 0x83 | ||
514 | |||
515 | struct uac_iso_endpoint_descriptor { | ||
516 | __u8 bLength; /* in bytes: 7 */ | ||
517 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | ||
518 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | ||
519 | __u8 bmAttributes; | ||
520 | __u8 bLockDelayUnits; | ||
521 | __le16 wLockDelay; | ||
522 | } __attribute__((packed)); | ||
523 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 | ||
524 | |||
525 | #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 | ||
526 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 | ||
527 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 | ||
528 | |||
529 | /* status word format (3.7.1.1) */ | ||
530 | |||
531 | #define UAC1_STATUS_TYPE_ORIG_MASK 0x0f | ||
532 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0 | ||
533 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1 | ||
534 | #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2 | ||
535 | |||
536 | #define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7) | ||
537 | #define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6) | ||
538 | |||
539 | struct uac1_status_word { | ||
540 | __u8 bStatusType; | ||
541 | __u8 bOriginator; | ||
542 | } __attribute__((packed)); | ||
543 | |||
544 | |||
545 | #endif /* _UAPI__LINUX_USB_AUDIO_H */ | ||
diff --git a/include/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h index 81a927930bfd..f35aa0a338c7 100644 --- a/include/linux/usb/cdc.h +++ b/include/uapi/linux/usb/cdc.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define USB_CDC_SUBCLASS_OBEX 0x0b | 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b |
20 | #define USB_CDC_SUBCLASS_EEM 0x0c | 20 | #define USB_CDC_SUBCLASS_EEM 0x0c |
21 | #define USB_CDC_SUBCLASS_NCM 0x0d | 21 | #define USB_CDC_SUBCLASS_NCM 0x0d |
22 | #define USB_CDC_SUBCLASS_MBIM 0x0e | ||
22 | 23 | ||
23 | #define USB_CDC_PROTO_NONE 0 | 24 | #define USB_CDC_PROTO_NONE 0 |
24 | 25 | ||
@@ -33,6 +34,7 @@ | |||
33 | #define USB_CDC_PROTO_EEM 7 | 34 | #define USB_CDC_PROTO_EEM 7 |
34 | 35 | ||
35 | #define USB_CDC_NCM_PROTO_NTB 1 | 36 | #define USB_CDC_NCM_PROTO_NTB 1 |
37 | #define USB_CDC_MBIM_PROTO_NTB 2 | ||
36 | 38 | ||
37 | /*-------------------------------------------------------------------------*/ | 39 | /*-------------------------------------------------------------------------*/ |
38 | 40 | ||
@@ -53,6 +55,7 @@ | |||
53 | #define USB_CDC_DMM_TYPE 0x14 | 55 | #define USB_CDC_DMM_TYPE 0x14 |
54 | #define USB_CDC_OBEX_TYPE 0x15 | 56 | #define USB_CDC_OBEX_TYPE 0x15 |
55 | #define USB_CDC_NCM_TYPE 0x1a | 57 | #define USB_CDC_NCM_TYPE 0x1a |
58 | #define USB_CDC_MBIM_TYPE 0x1b | ||
56 | 59 | ||
57 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ | 60 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ |
58 | struct usb_cdc_header_desc { | 61 | struct usb_cdc_header_desc { |
@@ -187,6 +190,21 @@ struct usb_cdc_ncm_desc { | |||
187 | __le16 bcdNcmVersion; | 190 | __le16 bcdNcmVersion; |
188 | __u8 bmNetworkCapabilities; | 191 | __u8 bmNetworkCapabilities; |
189 | } __attribute__ ((packed)); | 192 | } __attribute__ ((packed)); |
193 | |||
194 | /* "MBIM Control Model Functional Descriptor" */ | ||
195 | struct usb_cdc_mbim_desc { | ||
196 | __u8 bLength; | ||
197 | __u8 bDescriptorType; | ||
198 | __u8 bDescriptorSubType; | ||
199 | |||
200 | __le16 bcdMBIMVersion; | ||
201 | __le16 wMaxControlMessage; | ||
202 | __u8 bNumberFilters; | ||
203 | __u8 bMaxFilterSize; | ||
204 | __le16 wMaxSegmentSize; | ||
205 | __u8 bmNetworkCapabilities; | ||
206 | } __attribute__ ((packed)); | ||
207 | |||
190 | /*-------------------------------------------------------------------------*/ | 208 | /*-------------------------------------------------------------------------*/ |
191 | 209 | ||
192 | /* | 210 | /* |
@@ -332,6 +350,11 @@ struct usb_cdc_ncm_nth32 { | |||
332 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ | 350 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ |
333 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ | 351 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ |
334 | 352 | ||
353 | #define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049 /* IPS<sessionID> : IPS0 for now */ | ||
354 | #define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069 /* ips<sessionID> : ips0 for now */ | ||
355 | #define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344 /* DSS<sessionID> */ | ||
356 | #define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364 /* dss<sessionID> */ | ||
357 | |||
335 | /* 16-bit NCM Datagram Pointer Entry */ | 358 | /* 16-bit NCM Datagram Pointer Entry */ |
336 | struct usb_cdc_ncm_dpe16 { | 359 | struct usb_cdc_ncm_dpe16 { |
337 | __le16 wDatagramIndex; | 360 | __le16 wDatagramIndex; |
diff --git a/include/linux/usb/ch11.h b/include/uapi/linux/usb/ch11.h index 7692dc69ccf7..7692dc69ccf7 100644 --- a/include/linux/usb/ch11.h +++ b/include/uapi/linux/usb/ch11.h | |||
diff --git a/include/uapi/linux/usb/ch9.h b/include/uapi/linux/usb/ch9.h new file mode 100644 index 000000000000..50598472dc41 --- /dev/null +++ b/include/uapi/linux/usb/ch9.h | |||
@@ -0,0 +1,993 @@ | |||
1 | /* | ||
2 | * This file holds USB constants and structures that are needed for | ||
3 | * USB device APIs. These are used by the USB device model, which is | ||
4 | * defined in chapter 9 of the USB 2.0 specification and in the | ||
5 | * Wireless USB 1.0 (spread around). Linux has several APIs in C that | ||
6 | * need these: | ||
7 | * | ||
8 | * - the master/host side Linux-USB kernel driver API; | ||
9 | * - the "usbfs" user space API; and | ||
10 | * - the Linux "gadget" slave/device/peripheral side driver API. | ||
11 | * | ||
12 | * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems | ||
13 | * act either as a USB master/host or as a USB slave/device. That means | ||
14 | * the master and slave side APIs benefit from working well together. | ||
15 | * | ||
16 | * There's also "Wireless USB", using low power short range radios for | ||
17 | * peripheral interconnection but otherwise building on the USB framework. | ||
18 | * | ||
19 | * Note all descriptors are declared '__attribute__((packed))' so that: | ||
20 | * | ||
21 | * [a] they never get padded, either internally (USB spec writers | ||
22 | * probably handled that) or externally; | ||
23 | * | ||
24 | * [b] so that accessing bigger-than-a-bytes fields will never | ||
25 | * generate bus errors on any platform, even when the location of | ||
26 | * its descriptor inside a bundle isn't "naturally aligned", and | ||
27 | * | ||
28 | * [c] for consistency, removing all doubt even when it appears to | ||
29 | * someone that the two other points are non-issues for that | ||
30 | * particular descriptor type. | ||
31 | */ | ||
32 | |||
33 | #ifndef _UAPI__LINUX_USB_CH9_H | ||
34 | #define _UAPI__LINUX_USB_CH9_H | ||
35 | |||
36 | #include <linux/types.h> /* __u8 etc */ | ||
37 | #include <asm/byteorder.h> /* le16_to_cpu */ | ||
38 | |||
39 | /*-------------------------------------------------------------------------*/ | ||
40 | |||
41 | /* CONTROL REQUEST SUPPORT */ | ||
42 | |||
43 | /* | ||
44 | * USB directions | ||
45 | * | ||
46 | * This bit flag is used in endpoint descriptors' bEndpointAddress field. | ||
47 | * It's also one of three fields in control requests bRequestType. | ||
48 | */ | ||
49 | #define USB_DIR_OUT 0 /* to device */ | ||
50 | #define USB_DIR_IN 0x80 /* to host */ | ||
51 | |||
52 | /* | ||
53 | * USB types, the second of three bRequestType fields | ||
54 | */ | ||
55 | #define USB_TYPE_MASK (0x03 << 5) | ||
56 | #define USB_TYPE_STANDARD (0x00 << 5) | ||
57 | #define USB_TYPE_CLASS (0x01 << 5) | ||
58 | #define USB_TYPE_VENDOR (0x02 << 5) | ||
59 | #define USB_TYPE_RESERVED (0x03 << 5) | ||
60 | |||
61 | /* | ||
62 | * USB recipients, the third of three bRequestType fields | ||
63 | */ | ||
64 | #define USB_RECIP_MASK 0x1f | ||
65 | #define USB_RECIP_DEVICE 0x00 | ||
66 | #define USB_RECIP_INTERFACE 0x01 | ||
67 | #define USB_RECIP_ENDPOINT 0x02 | ||
68 | #define USB_RECIP_OTHER 0x03 | ||
69 | /* From Wireless USB 1.0 */ | ||
70 | #define USB_RECIP_PORT 0x04 | ||
71 | #define USB_RECIP_RPIPE 0x05 | ||
72 | |||
73 | /* | ||
74 | * Standard requests, for the bRequest field of a SETUP packet. | ||
75 | * | ||
76 | * These are qualified by the bRequestType field, so that for example | ||
77 | * TYPE_CLASS or TYPE_VENDOR specific feature flags could be retrieved | ||
78 | * by a GET_STATUS request. | ||
79 | */ | ||
80 | #define USB_REQ_GET_STATUS 0x00 | ||
81 | #define USB_REQ_CLEAR_FEATURE 0x01 | ||
82 | #define USB_REQ_SET_FEATURE 0x03 | ||
83 | #define USB_REQ_SET_ADDRESS 0x05 | ||
84 | #define USB_REQ_GET_DESCRIPTOR 0x06 | ||
85 | #define USB_REQ_SET_DESCRIPTOR 0x07 | ||
86 | #define USB_REQ_GET_CONFIGURATION 0x08 | ||
87 | #define USB_REQ_SET_CONFIGURATION 0x09 | ||
88 | #define USB_REQ_GET_INTERFACE 0x0A | ||
89 | #define USB_REQ_SET_INTERFACE 0x0B | ||
90 | #define USB_REQ_SYNCH_FRAME 0x0C | ||
91 | #define USB_REQ_SET_SEL 0x30 | ||
92 | #define USB_REQ_SET_ISOCH_DELAY 0x31 | ||
93 | |||
94 | #define USB_REQ_SET_ENCRYPTION 0x0D /* Wireless USB */ | ||
95 | #define USB_REQ_GET_ENCRYPTION 0x0E | ||
96 | #define USB_REQ_RPIPE_ABORT 0x0E | ||
97 | #define USB_REQ_SET_HANDSHAKE 0x0F | ||
98 | #define USB_REQ_RPIPE_RESET 0x0F | ||
99 | #define USB_REQ_GET_HANDSHAKE 0x10 | ||
100 | #define USB_REQ_SET_CONNECTION 0x11 | ||
101 | #define USB_REQ_SET_SECURITY_DATA 0x12 | ||
102 | #define USB_REQ_GET_SECURITY_DATA 0x13 | ||
103 | #define USB_REQ_SET_WUSB_DATA 0x14 | ||
104 | #define USB_REQ_LOOPBACK_DATA_WRITE 0x15 | ||
105 | #define USB_REQ_LOOPBACK_DATA_READ 0x16 | ||
106 | #define USB_REQ_SET_INTERFACE_DS 0x17 | ||
107 | |||
108 | /* The Link Power Management (LPM) ECN defines USB_REQ_TEST_AND_SET command, | ||
109 | * used by hubs to put ports into a new L1 suspend state, except that it | ||
110 | * forgot to define its number ... | ||
111 | */ | ||
112 | |||
113 | /* | ||
114 | * USB feature flags are written using USB_REQ_{CLEAR,SET}_FEATURE, and | ||
115 | * are read as a bit array returned by USB_REQ_GET_STATUS. (So there | ||
116 | * are at most sixteen features of each type.) Hubs may also support a | ||
117 | * new USB_REQ_TEST_AND_SET_FEATURE to put ports into L1 suspend. | ||
118 | */ | ||
119 | #define USB_DEVICE_SELF_POWERED 0 /* (read only) */ | ||
120 | #define USB_DEVICE_REMOTE_WAKEUP 1 /* dev may initiate wakeup */ | ||
121 | #define USB_DEVICE_TEST_MODE 2 /* (wired high speed only) */ | ||
122 | #define USB_DEVICE_BATTERY 2 /* (wireless) */ | ||
123 | #define USB_DEVICE_B_HNP_ENABLE 3 /* (otg) dev may initiate HNP */ | ||
124 | #define USB_DEVICE_WUSB_DEVICE 3 /* (wireless)*/ | ||
125 | #define USB_DEVICE_A_HNP_SUPPORT 4 /* (otg) RH port supports HNP */ | ||
126 | #define USB_DEVICE_A_ALT_HNP_SUPPORT 5 /* (otg) other RH port does */ | ||
127 | #define USB_DEVICE_DEBUG_MODE 6 /* (special devices only) */ | ||
128 | |||
129 | /* | ||
130 | * Test Mode Selectors | ||
131 | * See USB 2.0 spec Table 9-7 | ||
132 | */ | ||
133 | #define TEST_J 1 | ||
134 | #define TEST_K 2 | ||
135 | #define TEST_SE0_NAK 3 | ||
136 | #define TEST_PACKET 4 | ||
137 | #define TEST_FORCE_EN 5 | ||
138 | |||
139 | /* | ||
140 | * New Feature Selectors as added by USB 3.0 | ||
141 | * See USB 3.0 spec Table 9-6 | ||
142 | */ | ||
143 | #define USB_DEVICE_U1_ENABLE 48 /* dev may initiate U1 transition */ | ||
144 | #define USB_DEVICE_U2_ENABLE 49 /* dev may initiate U2 transition */ | ||
145 | #define USB_DEVICE_LTM_ENABLE 50 /* dev may send LTM */ | ||
146 | #define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ | ||
147 | |||
148 | #define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 | ||
149 | /* | ||
150 | * Suspend Options, Table 9-7 USB 3.0 spec | ||
151 | */ | ||
152 | #define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0)) | ||
153 | #define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1)) | ||
154 | |||
155 | #define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ | ||
156 | |||
157 | /* Bit array elements as returned by the USB_REQ_GET_STATUS request. */ | ||
158 | #define USB_DEV_STAT_U1_ENABLED 2 /* transition into U1 state */ | ||
159 | #define USB_DEV_STAT_U2_ENABLED 3 /* transition into U2 state */ | ||
160 | #define USB_DEV_STAT_LTM_ENABLED 4 /* Latency tolerance messages */ | ||
161 | |||
162 | /** | ||
163 | * struct usb_ctrlrequest - SETUP data for a USB device control request | ||
164 | * @bRequestType: matches the USB bmRequestType field | ||
165 | * @bRequest: matches the USB bRequest field | ||
166 | * @wValue: matches the USB wValue field (le16 byte order) | ||
167 | * @wIndex: matches the USB wIndex field (le16 byte order) | ||
168 | * @wLength: matches the USB wLength field (le16 byte order) | ||
169 | * | ||
170 | * This structure is used to send control requests to a USB device. It matches | ||
171 | * the different fields of the USB 2.0 Spec section 9.3, table 9-2. See the | ||
172 | * USB spec for a fuller description of the different fields, and what they are | ||
173 | * used for. | ||
174 | * | ||
175 | * Note that the driver for any interface can issue control requests. | ||
176 | * For most devices, interfaces don't coordinate with each other, so | ||
177 | * such requests may be made at any time. | ||
178 | */ | ||
179 | struct usb_ctrlrequest { | ||
180 | __u8 bRequestType; | ||
181 | __u8 bRequest; | ||
182 | __le16 wValue; | ||
183 | __le16 wIndex; | ||
184 | __le16 wLength; | ||
185 | } __attribute__ ((packed)); | ||
186 | |||
187 | /*-------------------------------------------------------------------------*/ | ||
188 | |||
189 | /* | ||
190 | * STANDARD DESCRIPTORS ... as returned by GET_DESCRIPTOR, or | ||
191 | * (rarely) accepted by SET_DESCRIPTOR. | ||
192 | * | ||
193 | * Note that all multi-byte values here are encoded in little endian | ||
194 | * byte order "on the wire". Within the kernel and when exposed | ||
195 | * through the Linux-USB APIs, they are not converted to cpu byte | ||
196 | * order; it is the responsibility of the client code to do this. | ||
197 | * The single exception is when device and configuration descriptors (but | ||
198 | * not other descriptors) are read from usbfs (i.e. /proc/bus/usb/BBB/DDD); | ||
199 | * in this case the fields are converted to host endianness by the kernel. | ||
200 | */ | ||
201 | |||
202 | /* | ||
203 | * Descriptor types ... USB 2.0 spec table 9.5 | ||
204 | */ | ||
205 | #define USB_DT_DEVICE 0x01 | ||
206 | #define USB_DT_CONFIG 0x02 | ||
207 | #define USB_DT_STRING 0x03 | ||
208 | #define USB_DT_INTERFACE 0x04 | ||
209 | #define USB_DT_ENDPOINT 0x05 | ||
210 | #define USB_DT_DEVICE_QUALIFIER 0x06 | ||
211 | #define USB_DT_OTHER_SPEED_CONFIG 0x07 | ||
212 | #define USB_DT_INTERFACE_POWER 0x08 | ||
213 | /* these are from a minor usb 2.0 revision (ECN) */ | ||
214 | #define USB_DT_OTG 0x09 | ||
215 | #define USB_DT_DEBUG 0x0a | ||
216 | #define USB_DT_INTERFACE_ASSOCIATION 0x0b | ||
217 | /* these are from the Wireless USB spec */ | ||
218 | #define USB_DT_SECURITY 0x0c | ||
219 | #define USB_DT_KEY 0x0d | ||
220 | #define USB_DT_ENCRYPTION_TYPE 0x0e | ||
221 | #define USB_DT_BOS 0x0f | ||
222 | #define USB_DT_DEVICE_CAPABILITY 0x10 | ||
223 | #define USB_DT_WIRELESS_ENDPOINT_COMP 0x11 | ||
224 | #define USB_DT_WIRE_ADAPTER 0x21 | ||
225 | #define USB_DT_RPIPE 0x22 | ||
226 | #define USB_DT_CS_RADIO_CONTROL 0x23 | ||
227 | /* From the T10 UAS specification */ | ||
228 | #define USB_DT_PIPE_USAGE 0x24 | ||
229 | /* From the USB 3.0 spec */ | ||
230 | #define USB_DT_SS_ENDPOINT_COMP 0x30 | ||
231 | |||
232 | /* Conventional codes for class-specific descriptors. The convention is | ||
233 | * defined in the USB "Common Class" Spec (3.11). Individual class specs | ||
234 | * are authoritative for their usage, not the "common class" writeup. | ||
235 | */ | ||
236 | #define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE) | ||
237 | #define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG) | ||
238 | #define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING) | ||
239 | #define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE) | ||
240 | #define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT) | ||
241 | |||
242 | /* All standard descriptors have these 2 fields at the beginning */ | ||
243 | struct usb_descriptor_header { | ||
244 | __u8 bLength; | ||
245 | __u8 bDescriptorType; | ||
246 | } __attribute__ ((packed)); | ||
247 | |||
248 | |||
249 | /*-------------------------------------------------------------------------*/ | ||
250 | |||
251 | /* USB_DT_DEVICE: Device descriptor */ | ||
252 | struct usb_device_descriptor { | ||
253 | __u8 bLength; | ||
254 | __u8 bDescriptorType; | ||
255 | |||
256 | __le16 bcdUSB; | ||
257 | __u8 bDeviceClass; | ||
258 | __u8 bDeviceSubClass; | ||
259 | __u8 bDeviceProtocol; | ||
260 | __u8 bMaxPacketSize0; | ||
261 | __le16 idVendor; | ||
262 | __le16 idProduct; | ||
263 | __le16 bcdDevice; | ||
264 | __u8 iManufacturer; | ||
265 | __u8 iProduct; | ||
266 | __u8 iSerialNumber; | ||
267 | __u8 bNumConfigurations; | ||
268 | } __attribute__ ((packed)); | ||
269 | |||
270 | #define USB_DT_DEVICE_SIZE 18 | ||
271 | |||
272 | |||
273 | /* | ||
274 | * Device and/or Interface Class codes | ||
275 | * as found in bDeviceClass or bInterfaceClass | ||
276 | * and defined by www.usb.org documents | ||
277 | */ | ||
278 | #define USB_CLASS_PER_INTERFACE 0 /* for DeviceClass */ | ||
279 | #define USB_CLASS_AUDIO 1 | ||
280 | #define USB_CLASS_COMM 2 | ||
281 | #define USB_CLASS_HID 3 | ||
282 | #define USB_CLASS_PHYSICAL 5 | ||
283 | #define USB_CLASS_STILL_IMAGE 6 | ||
284 | #define USB_CLASS_PRINTER 7 | ||
285 | #define USB_CLASS_MASS_STORAGE 8 | ||
286 | #define USB_CLASS_HUB 9 | ||
287 | #define USB_CLASS_CDC_DATA 0x0a | ||
288 | #define USB_CLASS_CSCID 0x0b /* chip+ smart card */ | ||
289 | #define USB_CLASS_CONTENT_SEC 0x0d /* content security */ | ||
290 | #define USB_CLASS_VIDEO 0x0e | ||
291 | #define USB_CLASS_WIRELESS_CONTROLLER 0xe0 | ||
292 | #define USB_CLASS_MISC 0xef | ||
293 | #define USB_CLASS_APP_SPEC 0xfe | ||
294 | #define USB_CLASS_VENDOR_SPEC 0xff | ||
295 | |||
296 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
297 | |||
298 | /*-------------------------------------------------------------------------*/ | ||
299 | |||
300 | /* USB_DT_CONFIG: Configuration descriptor information. | ||
301 | * | ||
302 | * USB_DT_OTHER_SPEED_CONFIG is the same descriptor, except that the | ||
303 | * descriptor type is different. Highspeed-capable devices can look | ||
304 | * different depending on what speed they're currently running. Only | ||
305 | * devices with a USB_DT_DEVICE_QUALIFIER have any OTHER_SPEED_CONFIG | ||
306 | * descriptors. | ||
307 | */ | ||
308 | struct usb_config_descriptor { | ||
309 | __u8 bLength; | ||
310 | __u8 bDescriptorType; | ||
311 | |||
312 | __le16 wTotalLength; | ||
313 | __u8 bNumInterfaces; | ||
314 | __u8 bConfigurationValue; | ||
315 | __u8 iConfiguration; | ||
316 | __u8 bmAttributes; | ||
317 | __u8 bMaxPower; | ||
318 | } __attribute__ ((packed)); | ||
319 | |||
320 | #define USB_DT_CONFIG_SIZE 9 | ||
321 | |||
322 | /* from config descriptor bmAttributes */ | ||
323 | #define USB_CONFIG_ATT_ONE (1 << 7) /* must be set */ | ||
324 | #define USB_CONFIG_ATT_SELFPOWER (1 << 6) /* self powered */ | ||
325 | #define USB_CONFIG_ATT_WAKEUP (1 << 5) /* can wakeup */ | ||
326 | #define USB_CONFIG_ATT_BATTERY (1 << 4) /* battery powered */ | ||
327 | |||
328 | /*-------------------------------------------------------------------------*/ | ||
329 | |||
330 | /* USB_DT_STRING: String descriptor */ | ||
331 | struct usb_string_descriptor { | ||
332 | __u8 bLength; | ||
333 | __u8 bDescriptorType; | ||
334 | |||
335 | __le16 wData[1]; /* UTF-16LE encoded */ | ||
336 | } __attribute__ ((packed)); | ||
337 | |||
338 | /* note that "string" zero is special, it holds language codes that | ||
339 | * the device supports, not Unicode characters. | ||
340 | */ | ||
341 | |||
342 | /*-------------------------------------------------------------------------*/ | ||
343 | |||
344 | /* USB_DT_INTERFACE: Interface descriptor */ | ||
345 | struct usb_interface_descriptor { | ||
346 | __u8 bLength; | ||
347 | __u8 bDescriptorType; | ||
348 | |||
349 | __u8 bInterfaceNumber; | ||
350 | __u8 bAlternateSetting; | ||
351 | __u8 bNumEndpoints; | ||
352 | __u8 bInterfaceClass; | ||
353 | __u8 bInterfaceSubClass; | ||
354 | __u8 bInterfaceProtocol; | ||
355 | __u8 iInterface; | ||
356 | } __attribute__ ((packed)); | ||
357 | |||
358 | #define USB_DT_INTERFACE_SIZE 9 | ||
359 | |||
360 | /*-------------------------------------------------------------------------*/ | ||
361 | |||
362 | /* USB_DT_ENDPOINT: Endpoint descriptor */ | ||
363 | struct usb_endpoint_descriptor { | ||
364 | __u8 bLength; | ||
365 | __u8 bDescriptorType; | ||
366 | |||
367 | __u8 bEndpointAddress; | ||
368 | __u8 bmAttributes; | ||
369 | __le16 wMaxPacketSize; | ||
370 | __u8 bInterval; | ||
371 | |||
372 | /* NOTE: these two are _only_ in audio endpoints. */ | ||
373 | /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */ | ||
374 | __u8 bRefresh; | ||
375 | __u8 bSynchAddress; | ||
376 | } __attribute__ ((packed)); | ||
377 | |||
378 | #define USB_DT_ENDPOINT_SIZE 7 | ||
379 | #define USB_DT_ENDPOINT_AUDIO_SIZE 9 /* Audio extension */ | ||
380 | |||
381 | |||
382 | /* | ||
383 | * Endpoints | ||
384 | */ | ||
385 | #define USB_ENDPOINT_NUMBER_MASK 0x0f /* in bEndpointAddress */ | ||
386 | #define USB_ENDPOINT_DIR_MASK 0x80 | ||
387 | |||
388 | #define USB_ENDPOINT_XFERTYPE_MASK 0x03 /* in bmAttributes */ | ||
389 | #define USB_ENDPOINT_XFER_CONTROL 0 | ||
390 | #define USB_ENDPOINT_XFER_ISOC 1 | ||
391 | #define USB_ENDPOINT_XFER_BULK 2 | ||
392 | #define USB_ENDPOINT_XFER_INT 3 | ||
393 | #define USB_ENDPOINT_MAX_ADJUSTABLE 0x80 | ||
394 | |||
395 | /* The USB 3.0 spec redefines bits 5:4 of bmAttributes as interrupt ep type. */ | ||
396 | #define USB_ENDPOINT_INTRTYPE 0x30 | ||
397 | #define USB_ENDPOINT_INTR_PERIODIC (0 << 4) | ||
398 | #define USB_ENDPOINT_INTR_NOTIFICATION (1 << 4) | ||
399 | |||
400 | #define USB_ENDPOINT_SYNCTYPE 0x0c | ||
401 | #define USB_ENDPOINT_SYNC_NONE (0 << 2) | ||
402 | #define USB_ENDPOINT_SYNC_ASYNC (1 << 2) | ||
403 | #define USB_ENDPOINT_SYNC_ADAPTIVE (2 << 2) | ||
404 | #define USB_ENDPOINT_SYNC_SYNC (3 << 2) | ||
405 | |||
406 | #define USB_ENDPOINT_USAGE_MASK 0x30 | ||
407 | #define USB_ENDPOINT_USAGE_DATA 0x00 | ||
408 | #define USB_ENDPOINT_USAGE_FEEDBACK 0x10 | ||
409 | #define USB_ENDPOINT_USAGE_IMPLICIT_FB 0x20 /* Implicit feedback Data endpoint */ | ||
410 | |||
411 | /*-------------------------------------------------------------------------*/ | ||
412 | |||
413 | /** | ||
414 | * usb_endpoint_num - get the endpoint's number | ||
415 | * @epd: endpoint to be checked | ||
416 | * | ||
417 | * Returns @epd's number: 0 to 15. | ||
418 | */ | ||
419 | static inline int usb_endpoint_num(const struct usb_endpoint_descriptor *epd) | ||
420 | { | ||
421 | return epd->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; | ||
422 | } | ||
423 | |||
424 | /** | ||
425 | * usb_endpoint_type - get the endpoint's transfer type | ||
426 | * @epd: endpoint to be checked | ||
427 | * | ||
428 | * Returns one of USB_ENDPOINT_XFER_{CONTROL, ISOC, BULK, INT} according | ||
429 | * to @epd's transfer type. | ||
430 | */ | ||
431 | static inline int usb_endpoint_type(const struct usb_endpoint_descriptor *epd) | ||
432 | { | ||
433 | return epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK; | ||
434 | } | ||
435 | |||
436 | /** | ||
437 | * usb_endpoint_dir_in - check if the endpoint has IN direction | ||
438 | * @epd: endpoint to be checked | ||
439 | * | ||
440 | * Returns true if the endpoint is of type IN, otherwise it returns false. | ||
441 | */ | ||
442 | static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd) | ||
443 | { | ||
444 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * usb_endpoint_dir_out - check if the endpoint has OUT direction | ||
449 | * @epd: endpoint to be checked | ||
450 | * | ||
451 | * Returns true if the endpoint is of type OUT, otherwise it returns false. | ||
452 | */ | ||
453 | static inline int usb_endpoint_dir_out( | ||
454 | const struct usb_endpoint_descriptor *epd) | ||
455 | { | ||
456 | return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT); | ||
457 | } | ||
458 | |||
459 | /** | ||
460 | * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type | ||
461 | * @epd: endpoint to be checked | ||
462 | * | ||
463 | * Returns true if the endpoint is of type bulk, otherwise it returns false. | ||
464 | */ | ||
465 | static inline int usb_endpoint_xfer_bulk( | ||
466 | const struct usb_endpoint_descriptor *epd) | ||
467 | { | ||
468 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
469 | USB_ENDPOINT_XFER_BULK); | ||
470 | } | ||
471 | |||
472 | /** | ||
473 | * usb_endpoint_xfer_control - check if the endpoint has control transfer type | ||
474 | * @epd: endpoint to be checked | ||
475 | * | ||
476 | * Returns true if the endpoint is of type control, otherwise it returns false. | ||
477 | */ | ||
478 | static inline int usb_endpoint_xfer_control( | ||
479 | const struct usb_endpoint_descriptor *epd) | ||
480 | { | ||
481 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
482 | USB_ENDPOINT_XFER_CONTROL); | ||
483 | } | ||
484 | |||
485 | /** | ||
486 | * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type | ||
487 | * @epd: endpoint to be checked | ||
488 | * | ||
489 | * Returns true if the endpoint is of type interrupt, otherwise it returns | ||
490 | * false. | ||
491 | */ | ||
492 | static inline int usb_endpoint_xfer_int( | ||
493 | const struct usb_endpoint_descriptor *epd) | ||
494 | { | ||
495 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
496 | USB_ENDPOINT_XFER_INT); | ||
497 | } | ||
498 | |||
499 | /** | ||
500 | * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type | ||
501 | * @epd: endpoint to be checked | ||
502 | * | ||
503 | * Returns true if the endpoint is of type isochronous, otherwise it returns | ||
504 | * false. | ||
505 | */ | ||
506 | static inline int usb_endpoint_xfer_isoc( | ||
507 | const struct usb_endpoint_descriptor *epd) | ||
508 | { | ||
509 | return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) == | ||
510 | USB_ENDPOINT_XFER_ISOC); | ||
511 | } | ||
512 | |||
513 | /** | ||
514 | * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN | ||
515 | * @epd: endpoint to be checked | ||
516 | * | ||
517 | * Returns true if the endpoint has bulk transfer type and IN direction, | ||
518 | * otherwise it returns false. | ||
519 | */ | ||
520 | static inline int usb_endpoint_is_bulk_in( | ||
521 | const struct usb_endpoint_descriptor *epd) | ||
522 | { | ||
523 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd); | ||
524 | } | ||
525 | |||
526 | /** | ||
527 | * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT | ||
528 | * @epd: endpoint to be checked | ||
529 | * | ||
530 | * Returns true if the endpoint has bulk transfer type and OUT direction, | ||
531 | * otherwise it returns false. | ||
532 | */ | ||
533 | static inline int usb_endpoint_is_bulk_out( | ||
534 | const struct usb_endpoint_descriptor *epd) | ||
535 | { | ||
536 | return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd); | ||
537 | } | ||
538 | |||
539 | /** | ||
540 | * usb_endpoint_is_int_in - check if the endpoint is interrupt IN | ||
541 | * @epd: endpoint to be checked | ||
542 | * | ||
543 | * Returns true if the endpoint has interrupt transfer type and IN direction, | ||
544 | * otherwise it returns false. | ||
545 | */ | ||
546 | static inline int usb_endpoint_is_int_in( | ||
547 | const struct usb_endpoint_descriptor *epd) | ||
548 | { | ||
549 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd); | ||
550 | } | ||
551 | |||
552 | /** | ||
553 | * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT | ||
554 | * @epd: endpoint to be checked | ||
555 | * | ||
556 | * Returns true if the endpoint has interrupt transfer type and OUT direction, | ||
557 | * otherwise it returns false. | ||
558 | */ | ||
559 | static inline int usb_endpoint_is_int_out( | ||
560 | const struct usb_endpoint_descriptor *epd) | ||
561 | { | ||
562 | return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd); | ||
563 | } | ||
564 | |||
565 | /** | ||
566 | * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN | ||
567 | * @epd: endpoint to be checked | ||
568 | * | ||
569 | * Returns true if the endpoint has isochronous transfer type and IN direction, | ||
570 | * otherwise it returns false. | ||
571 | */ | ||
572 | static inline int usb_endpoint_is_isoc_in( | ||
573 | const struct usb_endpoint_descriptor *epd) | ||
574 | { | ||
575 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd); | ||
576 | } | ||
577 | |||
578 | /** | ||
579 | * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT | ||
580 | * @epd: endpoint to be checked | ||
581 | * | ||
582 | * Returns true if the endpoint has isochronous transfer type and OUT direction, | ||
583 | * otherwise it returns false. | ||
584 | */ | ||
585 | static inline int usb_endpoint_is_isoc_out( | ||
586 | const struct usb_endpoint_descriptor *epd) | ||
587 | { | ||
588 | return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); | ||
589 | } | ||
590 | |||
591 | /** | ||
592 | * usb_endpoint_maxp - get endpoint's max packet size | ||
593 | * @epd: endpoint to be checked | ||
594 | * | ||
595 | * Returns @epd's max packet | ||
596 | */ | ||
597 | static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd) | ||
598 | { | ||
599 | return __le16_to_cpu(epd->wMaxPacketSize); | ||
600 | } | ||
601 | |||
602 | static inline int usb_endpoint_interrupt_type( | ||
603 | const struct usb_endpoint_descriptor *epd) | ||
604 | { | ||
605 | return epd->bmAttributes & USB_ENDPOINT_INTRTYPE; | ||
606 | } | ||
607 | |||
608 | /*-------------------------------------------------------------------------*/ | ||
609 | |||
610 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | ||
611 | struct usb_ss_ep_comp_descriptor { | ||
612 | __u8 bLength; | ||
613 | __u8 bDescriptorType; | ||
614 | |||
615 | __u8 bMaxBurst; | ||
616 | __u8 bmAttributes; | ||
617 | __le16 wBytesPerInterval; | ||
618 | } __attribute__ ((packed)); | ||
619 | |||
620 | #define USB_DT_SS_EP_COMP_SIZE 6 | ||
621 | |||
622 | /* Bits 4:0 of bmAttributes if this is a bulk endpoint */ | ||
623 | static inline int | ||
624 | usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp) | ||
625 | { | ||
626 | int max_streams; | ||
627 | |||
628 | if (!comp) | ||
629 | return 0; | ||
630 | |||
631 | max_streams = comp->bmAttributes & 0x1f; | ||
632 | |||
633 | if (!max_streams) | ||
634 | return 0; | ||
635 | |||
636 | max_streams = 1 << max_streams; | ||
637 | |||
638 | return max_streams; | ||
639 | } | ||
640 | |||
641 | /* Bits 1:0 of bmAttributes if this is an isoc endpoint */ | ||
642 | #define USB_SS_MULT(p) (1 + ((p) & 0x3)) | ||
643 | |||
644 | /*-------------------------------------------------------------------------*/ | ||
645 | |||
646 | /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ | ||
647 | struct usb_qualifier_descriptor { | ||
648 | __u8 bLength; | ||
649 | __u8 bDescriptorType; | ||
650 | |||
651 | __le16 bcdUSB; | ||
652 | __u8 bDeviceClass; | ||
653 | __u8 bDeviceSubClass; | ||
654 | __u8 bDeviceProtocol; | ||
655 | __u8 bMaxPacketSize0; | ||
656 | __u8 bNumConfigurations; | ||
657 | __u8 bRESERVED; | ||
658 | } __attribute__ ((packed)); | ||
659 | |||
660 | |||
661 | /*-------------------------------------------------------------------------*/ | ||
662 | |||
663 | /* USB_DT_OTG (from OTG 1.0a supplement) */ | ||
664 | struct usb_otg_descriptor { | ||
665 | __u8 bLength; | ||
666 | __u8 bDescriptorType; | ||
667 | |||
668 | __u8 bmAttributes; /* support for HNP, SRP, etc */ | ||
669 | } __attribute__ ((packed)); | ||
670 | |||
671 | /* from usb_otg_descriptor.bmAttributes */ | ||
672 | #define USB_OTG_SRP (1 << 0) | ||
673 | #define USB_OTG_HNP (1 << 1) /* swap host/device roles */ | ||
674 | |||
675 | /*-------------------------------------------------------------------------*/ | ||
676 | |||
677 | /* USB_DT_DEBUG: for special highspeed devices, replacing serial console */ | ||
678 | struct usb_debug_descriptor { | ||
679 | __u8 bLength; | ||
680 | __u8 bDescriptorType; | ||
681 | |||
682 | /* bulk endpoints with 8 byte maxpacket */ | ||
683 | __u8 bDebugInEndpoint; | ||
684 | __u8 bDebugOutEndpoint; | ||
685 | } __attribute__((packed)); | ||
686 | |||
687 | /*-------------------------------------------------------------------------*/ | ||
688 | |||
689 | /* USB_DT_INTERFACE_ASSOCIATION: groups interfaces */ | ||
690 | struct usb_interface_assoc_descriptor { | ||
691 | __u8 bLength; | ||
692 | __u8 bDescriptorType; | ||
693 | |||
694 | __u8 bFirstInterface; | ||
695 | __u8 bInterfaceCount; | ||
696 | __u8 bFunctionClass; | ||
697 | __u8 bFunctionSubClass; | ||
698 | __u8 bFunctionProtocol; | ||
699 | __u8 iFunction; | ||
700 | } __attribute__ ((packed)); | ||
701 | |||
702 | |||
703 | /*-------------------------------------------------------------------------*/ | ||
704 | |||
705 | /* USB_DT_SECURITY: group of wireless security descriptors, including | ||
706 | * encryption types available for setting up a CC/association. | ||
707 | */ | ||
708 | struct usb_security_descriptor { | ||
709 | __u8 bLength; | ||
710 | __u8 bDescriptorType; | ||
711 | |||
712 | __le16 wTotalLength; | ||
713 | __u8 bNumEncryptionTypes; | ||
714 | } __attribute__((packed)); | ||
715 | |||
716 | /*-------------------------------------------------------------------------*/ | ||
717 | |||
718 | /* USB_DT_KEY: used with {GET,SET}_SECURITY_DATA; only public keys | ||
719 | * may be retrieved. | ||
720 | */ | ||
721 | struct usb_key_descriptor { | ||
722 | __u8 bLength; | ||
723 | __u8 bDescriptorType; | ||
724 | |||
725 | __u8 tTKID[3]; | ||
726 | __u8 bReserved; | ||
727 | __u8 bKeyData[0]; | ||
728 | } __attribute__((packed)); | ||
729 | |||
730 | /*-------------------------------------------------------------------------*/ | ||
731 | |||
732 | /* USB_DT_ENCRYPTION_TYPE: bundled in DT_SECURITY groups */ | ||
733 | struct usb_encryption_descriptor { | ||
734 | __u8 bLength; | ||
735 | __u8 bDescriptorType; | ||
736 | |||
737 | __u8 bEncryptionType; | ||
738 | #define USB_ENC_TYPE_UNSECURE 0 | ||
739 | #define USB_ENC_TYPE_WIRED 1 /* non-wireless mode */ | ||
740 | #define USB_ENC_TYPE_CCM_1 2 /* aes128/cbc session */ | ||
741 | #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ | ||
742 | __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ | ||
743 | __u8 bAuthKeyIndex; | ||
744 | } __attribute__((packed)); | ||
745 | |||
746 | |||
747 | /*-------------------------------------------------------------------------*/ | ||
748 | |||
749 | /* USB_DT_BOS: group of device-level capabilities */ | ||
750 | struct usb_bos_descriptor { | ||
751 | __u8 bLength; | ||
752 | __u8 bDescriptorType; | ||
753 | |||
754 | __le16 wTotalLength; | ||
755 | __u8 bNumDeviceCaps; | ||
756 | } __attribute__((packed)); | ||
757 | |||
758 | #define USB_DT_BOS_SIZE 5 | ||
759 | /*-------------------------------------------------------------------------*/ | ||
760 | |||
761 | /* USB_DT_DEVICE_CAPABILITY: grouped with BOS */ | ||
762 | struct usb_dev_cap_header { | ||
763 | __u8 bLength; | ||
764 | __u8 bDescriptorType; | ||
765 | __u8 bDevCapabilityType; | ||
766 | } __attribute__((packed)); | ||
767 | |||
768 | #define USB_CAP_TYPE_WIRELESS_USB 1 | ||
769 | |||
770 | struct usb_wireless_cap_descriptor { /* Ultra Wide Band */ | ||
771 | __u8 bLength; | ||
772 | __u8 bDescriptorType; | ||
773 | __u8 bDevCapabilityType; | ||
774 | |||
775 | __u8 bmAttributes; | ||
776 | #define USB_WIRELESS_P2P_DRD (1 << 1) | ||
777 | #define USB_WIRELESS_BEACON_MASK (3 << 2) | ||
778 | #define USB_WIRELESS_BEACON_SELF (1 << 2) | ||
779 | #define USB_WIRELESS_BEACON_DIRECTED (2 << 2) | ||
780 | #define USB_WIRELESS_BEACON_NONE (3 << 2) | ||
781 | __le16 wPHYRates; /* bit rates, Mbps */ | ||
782 | #define USB_WIRELESS_PHY_53 (1 << 0) /* always set */ | ||
783 | #define USB_WIRELESS_PHY_80 (1 << 1) | ||
784 | #define USB_WIRELESS_PHY_107 (1 << 2) /* always set */ | ||
785 | #define USB_WIRELESS_PHY_160 (1 << 3) | ||
786 | #define USB_WIRELESS_PHY_200 (1 << 4) /* always set */ | ||
787 | #define USB_WIRELESS_PHY_320 (1 << 5) | ||
788 | #define USB_WIRELESS_PHY_400 (1 << 6) | ||
789 | #define USB_WIRELESS_PHY_480 (1 << 7) | ||
790 | __u8 bmTFITXPowerInfo; /* TFI power levels */ | ||
791 | __u8 bmFFITXPowerInfo; /* FFI power levels */ | ||
792 | __le16 bmBandGroup; | ||
793 | __u8 bReserved; | ||
794 | } __attribute__((packed)); | ||
795 | |||
796 | /* USB 2.0 Extension descriptor */ | ||
797 | #define USB_CAP_TYPE_EXT 2 | ||
798 | |||
799 | struct usb_ext_cap_descriptor { /* Link Power Management */ | ||
800 | __u8 bLength; | ||
801 | __u8 bDescriptorType; | ||
802 | __u8 bDevCapabilityType; | ||
803 | __le32 bmAttributes; | ||
804 | #define USB_LPM_SUPPORT (1 << 1) /* supports LPM */ | ||
805 | #define USB_BESL_SUPPORT (1 << 2) /* supports BESL */ | ||
806 | #define USB_BESL_BASELINE_VALID (1 << 3) /* Baseline BESL valid*/ | ||
807 | #define USB_BESL_DEEP_VALID (1 << 4) /* Deep BESL valid */ | ||
808 | #define USB_GET_BESL_BASELINE(p) (((p) & (0xf << 8)) >> 8) | ||
809 | #define USB_GET_BESL_DEEP(p) (((p) & (0xf << 12)) >> 12) | ||
810 | } __attribute__((packed)); | ||
811 | |||
812 | #define USB_DT_USB_EXT_CAP_SIZE 7 | ||
813 | |||
814 | /* | ||
815 | * SuperSpeed USB Capability descriptor: Defines the set of SuperSpeed USB | ||
816 | * specific device level capabilities | ||
817 | */ | ||
818 | #define USB_SS_CAP_TYPE 3 | ||
819 | struct usb_ss_cap_descriptor { /* Link Power Management */ | ||
820 | __u8 bLength; | ||
821 | __u8 bDescriptorType; | ||
822 | __u8 bDevCapabilityType; | ||
823 | __u8 bmAttributes; | ||
824 | #define USB_LTM_SUPPORT (1 << 1) /* supports LTM */ | ||
825 | __le16 wSpeedSupported; | ||
826 | #define USB_LOW_SPEED_OPERATION (1) /* Low speed operation */ | ||
827 | #define USB_FULL_SPEED_OPERATION (1 << 1) /* Full speed operation */ | ||
828 | #define USB_HIGH_SPEED_OPERATION (1 << 2) /* High speed operation */ | ||
829 | #define USB_5GBPS_OPERATION (1 << 3) /* Operation at 5Gbps */ | ||
830 | __u8 bFunctionalitySupport; | ||
831 | __u8 bU1devExitLat; | ||
832 | __le16 bU2DevExitLat; | ||
833 | } __attribute__((packed)); | ||
834 | |||
835 | #define USB_DT_USB_SS_CAP_SIZE 10 | ||
836 | |||
837 | /* | ||
838 | * Container ID Capability descriptor: Defines the instance unique ID used to | ||
839 | * identify the instance across all operating modes | ||
840 | */ | ||
841 | #define CONTAINER_ID_TYPE 4 | ||
842 | struct usb_ss_container_id_descriptor { | ||
843 | __u8 bLength; | ||
844 | __u8 bDescriptorType; | ||
845 | __u8 bDevCapabilityType; | ||
846 | __u8 bReserved; | ||
847 | __u8 ContainerID[16]; /* 128-bit number */ | ||
848 | } __attribute__((packed)); | ||
849 | |||
850 | #define USB_DT_USB_SS_CONTN_ID_SIZE 20 | ||
851 | /*-------------------------------------------------------------------------*/ | ||
852 | |||
853 | /* USB_DT_WIRELESS_ENDPOINT_COMP: companion descriptor associated with | ||
854 | * each endpoint descriptor for a wireless device | ||
855 | */ | ||
856 | struct usb_wireless_ep_comp_descriptor { | ||
857 | __u8 bLength; | ||
858 | __u8 bDescriptorType; | ||
859 | |||
860 | __u8 bMaxBurst; | ||
861 | __u8 bMaxSequence; | ||
862 | __le16 wMaxStreamDelay; | ||
863 | __le16 wOverTheAirPacketSize; | ||
864 | __u8 bOverTheAirInterval; | ||
865 | __u8 bmCompAttributes; | ||
866 | #define USB_ENDPOINT_SWITCH_MASK 0x03 /* in bmCompAttributes */ | ||
867 | #define USB_ENDPOINT_SWITCH_NO 0 | ||
868 | #define USB_ENDPOINT_SWITCH_SWITCH 1 | ||
869 | #define USB_ENDPOINT_SWITCH_SCALE 2 | ||
870 | } __attribute__((packed)); | ||
871 | |||
872 | /*-------------------------------------------------------------------------*/ | ||
873 | |||
874 | /* USB_REQ_SET_HANDSHAKE is a four-way handshake used between a wireless | ||
875 | * host and a device for connection set up, mutual authentication, and | ||
876 | * exchanging short lived session keys. The handshake depends on a CC. | ||
877 | */ | ||
878 | struct usb_handshake { | ||
879 | __u8 bMessageNumber; | ||
880 | __u8 bStatus; | ||
881 | __u8 tTKID[3]; | ||
882 | __u8 bReserved; | ||
883 | __u8 CDID[16]; | ||
884 | __u8 nonce[16]; | ||
885 | __u8 MIC[8]; | ||
886 | } __attribute__((packed)); | ||
887 | |||
888 | /*-------------------------------------------------------------------------*/ | ||
889 | |||
890 | /* USB_REQ_SET_CONNECTION modifies or revokes a connection context (CC). | ||
891 | * A CC may also be set up using non-wireless secure channels (including | ||
892 | * wired USB!), and some devices may support CCs with multiple hosts. | ||
893 | */ | ||
894 | struct usb_connection_context { | ||
895 | __u8 CHID[16]; /* persistent host id */ | ||
896 | __u8 CDID[16]; /* device id (unique w/in host context) */ | ||
897 | __u8 CK[16]; /* connection key */ | ||
898 | } __attribute__((packed)); | ||
899 | |||
900 | /*-------------------------------------------------------------------------*/ | ||
901 | |||
902 | /* USB 2.0 defines three speeds, here's how Linux identifies them */ | ||
903 | |||
904 | enum usb_device_speed { | ||
905 | USB_SPEED_UNKNOWN = 0, /* enumerating */ | ||
906 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | ||
907 | USB_SPEED_HIGH, /* usb 2.0 */ | ||
908 | USB_SPEED_WIRELESS, /* wireless (usb 2.5) */ | ||
909 | USB_SPEED_SUPER, /* usb 3.0 */ | ||
910 | }; | ||
911 | |||
912 | |||
913 | enum usb_device_state { | ||
914 | /* NOTATTACHED isn't in the USB spec, and this state acts | ||
915 | * the same as ATTACHED ... but it's clearer this way. | ||
916 | */ | ||
917 | USB_STATE_NOTATTACHED = 0, | ||
918 | |||
919 | /* chapter 9 and authentication (wireless) device states */ | ||
920 | USB_STATE_ATTACHED, | ||
921 | USB_STATE_POWERED, /* wired */ | ||
922 | USB_STATE_RECONNECTING, /* auth */ | ||
923 | USB_STATE_UNAUTHENTICATED, /* auth */ | ||
924 | USB_STATE_DEFAULT, /* limited function */ | ||
925 | USB_STATE_ADDRESS, | ||
926 | USB_STATE_CONFIGURED, /* most functions */ | ||
927 | |||
928 | USB_STATE_SUSPENDED | ||
929 | |||
930 | /* NOTE: there are actually four different SUSPENDED | ||
931 | * states, returning to POWERED, DEFAULT, ADDRESS, or | ||
932 | * CONFIGURED respectively when SOF tokens flow again. | ||
933 | * At this level there's no difference between L1 and L2 | ||
934 | * suspend states. (L2 being original USB 1.1 suspend.) | ||
935 | */ | ||
936 | }; | ||
937 | |||
938 | enum usb3_link_state { | ||
939 | USB3_LPM_U0 = 0, | ||
940 | USB3_LPM_U1, | ||
941 | USB3_LPM_U2, | ||
942 | USB3_LPM_U3 | ||
943 | }; | ||
944 | |||
945 | /* | ||
946 | * A U1 timeout of 0x0 means the parent hub will reject any transitions to U1. | ||
947 | * 0xff means the parent hub will accept transitions to U1, but will not | ||
948 | * initiate a transition. | ||
949 | * | ||
950 | * A U1 timeout of 0x1 to 0x7F also causes the hub to initiate a transition to | ||
951 | * U1 after that many microseconds. Timeouts of 0x80 to 0xFE are reserved | ||
952 | * values. | ||
953 | * | ||
954 | * A U2 timeout of 0x0 means the parent hub will reject any transitions to U2. | ||
955 | * 0xff means the parent hub will accept transitions to U2, but will not | ||
956 | * initiate a transition. | ||
957 | * | ||
958 | * A U2 timeout of 0x1 to 0xFE also causes the hub to initiate a transition to | ||
959 | * U2 after N*256 microseconds. Therefore a U2 timeout value of 0x1 means a U2 | ||
960 | * idle timer of 256 microseconds, 0x2 means 512 microseconds, 0xFE means | ||
961 | * 65.024ms. | ||
962 | */ | ||
963 | #define USB3_LPM_DISABLED 0x0 | ||
964 | #define USB3_LPM_U1_MAX_TIMEOUT 0x7F | ||
965 | #define USB3_LPM_U2_MAX_TIMEOUT 0xFE | ||
966 | #define USB3_LPM_DEVICE_INITIATED 0xFF | ||
967 | |||
968 | struct usb_set_sel_req { | ||
969 | __u8 u1_sel; | ||
970 | __u8 u1_pel; | ||
971 | __le16 u2_sel; | ||
972 | __le16 u2_pel; | ||
973 | } __attribute__ ((packed)); | ||
974 | |||
975 | /* | ||
976 | * The Set System Exit Latency control transfer provides one byte each for | ||
977 | * U1 SEL and U1 PEL, so the max exit latency is 0xFF. U2 SEL and U2 PEL each | ||
978 | * are two bytes long. | ||
979 | */ | ||
980 | #define USB3_LPM_MAX_U1_SEL_PEL 0xFF | ||
981 | #define USB3_LPM_MAX_U2_SEL_PEL 0xFFFF | ||
982 | |||
983 | /*-------------------------------------------------------------------------*/ | ||
984 | |||
985 | /* | ||
986 | * As per USB compliance update, a device that is actively drawing | ||
987 | * more than 100mA from USB must report itself as bus-powered in | ||
988 | * the GetStatus(DEVICE) call. | ||
989 | * http://compliance.usb.org/index.asp?UpdateFile=Electrical&Format=Standard#34 | ||
990 | */ | ||
991 | #define USB_SELF_POWER_VBUS_MAX_DRAW 100 | ||
992 | |||
993 | #endif /* _UAPI__LINUX_USB_CH9_H */ | ||
diff --git a/include/uapi/linux/usb/functionfs.h b/include/uapi/linux/usb/functionfs.h new file mode 100644 index 000000000000..d6b01283f85c --- /dev/null +++ b/include/uapi/linux/usb/functionfs.h | |||
@@ -0,0 +1,169 @@ | |||
1 | #ifndef _UAPI__LINUX_FUNCTIONFS_H__ | ||
2 | #define _UAPI__LINUX_FUNCTIONFS_H__ | ||
3 | |||
4 | |||
5 | #include <linux/types.h> | ||
6 | #include <linux/ioctl.h> | ||
7 | |||
8 | #include <linux/usb/ch9.h> | ||
9 | |||
10 | |||
11 | enum { | ||
12 | FUNCTIONFS_DESCRIPTORS_MAGIC = 1, | ||
13 | FUNCTIONFS_STRINGS_MAGIC = 2 | ||
14 | }; | ||
15 | |||
16 | |||
17 | #ifndef __KERNEL__ | ||
18 | |||
19 | /* Descriptor of an non-audio endpoint */ | ||
20 | struct usb_endpoint_descriptor_no_audio { | ||
21 | __u8 bLength; | ||
22 | __u8 bDescriptorType; | ||
23 | |||
24 | __u8 bEndpointAddress; | ||
25 | __u8 bmAttributes; | ||
26 | __le16 wMaxPacketSize; | ||
27 | __u8 bInterval; | ||
28 | } __attribute__((packed)); | ||
29 | |||
30 | |||
31 | /* | ||
32 | * All numbers must be in little endian order. | ||
33 | */ | ||
34 | |||
35 | struct usb_functionfs_descs_head { | ||
36 | __le32 magic; | ||
37 | __le32 length; | ||
38 | __le32 fs_count; | ||
39 | __le32 hs_count; | ||
40 | } __attribute__((packed)); | ||
41 | |||
42 | /* | ||
43 | * Descriptors format: | ||
44 | * | ||
45 | * | off | name | type | description | | ||
46 | * |-----+-----------+--------------+--------------------------------------| | ||
47 | * | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC | | ||
48 | * | 4 | length | LE32 | length of the whole data chunk | | ||
49 | * | 8 | fs_count | LE32 | number of full-speed descriptors | | ||
50 | * | 12 | hs_count | LE32 | number of high-speed descriptors | | ||
51 | * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors | | ||
52 | * | | hs_descrs | Descriptor[] | list of high-speed descriptors | | ||
53 | * | ||
54 | * descs are just valid USB descriptors and have the following format: | ||
55 | * | ||
56 | * | off | name | type | description | | ||
57 | * |-----+-----------------+------+--------------------------| | ||
58 | * | 0 | bLength | U8 | length of the descriptor | | ||
59 | * | 1 | bDescriptorType | U8 | descriptor type | | ||
60 | * | 2 | payload | | descriptor's payload | | ||
61 | */ | ||
62 | |||
63 | struct usb_functionfs_strings_head { | ||
64 | __le32 magic; | ||
65 | __le32 length; | ||
66 | __le32 str_count; | ||
67 | __le32 lang_count; | ||
68 | } __attribute__((packed)); | ||
69 | |||
70 | /* | ||
71 | * Strings format: | ||
72 | * | ||
73 | * | off | name | type | description | | ||
74 | * |-----+------------+-----------------------+----------------------------| | ||
75 | * | 0 | magic | LE32 | FUNCTIONFS_STRINGS_MAGIC | | ||
76 | * | 4 | length | LE32 | length of the data chunk | | ||
77 | * | 8 | str_count | LE32 | number of strings | | ||
78 | * | 12 | lang_count | LE32 | number of languages | | ||
79 | * | 16 | stringtab | StringTab[lang_count] | table of strings per lang | | ||
80 | * | ||
81 | * For each language there is one stringtab entry (ie. there are lang_count | ||
82 | * stringtab entires). Each StringTab has following format: | ||
83 | * | ||
84 | * | off | name | type | description | | ||
85 | * |-----+---------+-------------------+------------------------------------| | ||
86 | * | 0 | lang | LE16 | language code | | ||
87 | * | 2 | strings | String[str_count] | array of strings in given language | | ||
88 | * | ||
89 | * For each string there is one strings entry (ie. there are str_count | ||
90 | * string entries). Each String is a NUL terminated string encoded in | ||
91 | * UTF-8. | ||
92 | */ | ||
93 | |||
94 | #endif | ||
95 | |||
96 | |||
97 | /* | ||
98 | * Events are delivered on the ep0 file descriptor, when the user mode driver | ||
99 | * reads from this file descriptor after writing the descriptors. Don't | ||
100 | * stop polling this descriptor. | ||
101 | */ | ||
102 | |||
103 | enum usb_functionfs_event_type { | ||
104 | FUNCTIONFS_BIND, | ||
105 | FUNCTIONFS_UNBIND, | ||
106 | |||
107 | FUNCTIONFS_ENABLE, | ||
108 | FUNCTIONFS_DISABLE, | ||
109 | |||
110 | FUNCTIONFS_SETUP, | ||
111 | |||
112 | FUNCTIONFS_SUSPEND, | ||
113 | FUNCTIONFS_RESUME | ||
114 | }; | ||
115 | |||
116 | /* NOTE: this structure must stay the same size and layout on | ||
117 | * both 32-bit and 64-bit kernels. | ||
118 | */ | ||
119 | struct usb_functionfs_event { | ||
120 | union { | ||
121 | /* SETUP: packet; DATA phase i/o precedes next event | ||
122 | *(setup.bmRequestType & USB_DIR_IN) flags direction */ | ||
123 | struct usb_ctrlrequest setup; | ||
124 | } __attribute__((packed)) u; | ||
125 | |||
126 | /* enum usb_functionfs_event_type */ | ||
127 | __u8 type; | ||
128 | __u8 _pad[3]; | ||
129 | } __attribute__((packed)); | ||
130 | |||
131 | |||
132 | /* Endpoint ioctls */ | ||
133 | /* The same as in gadgetfs */ | ||
134 | |||
135 | /* IN transfers may be reported to the gadget driver as complete | ||
136 | * when the fifo is loaded, before the host reads the data; | ||
137 | * OUT transfers may be reported to the host's "client" driver as | ||
138 | * complete when they're sitting in the FIFO unread. | ||
139 | * THIS returns how many bytes are "unclaimed" in the endpoint fifo | ||
140 | * (needed for precise fault handling, when the hardware allows it) | ||
141 | */ | ||
142 | #define FUNCTIONFS_FIFO_STATUS _IO('g', 1) | ||
143 | |||
144 | /* discards any unclaimed data in the fifo. */ | ||
145 | #define FUNCTIONFS_FIFO_FLUSH _IO('g', 2) | ||
146 | |||
147 | /* resets endpoint halt+toggle; used to implement set_interface. | ||
148 | * some hardware (like pxa2xx) can't support this. | ||
149 | */ | ||
150 | #define FUNCTIONFS_CLEAR_HALT _IO('g', 3) | ||
151 | |||
152 | /* Specific for functionfs */ | ||
153 | |||
154 | /* | ||
155 | * Returns reverse mapping of an interface. Called on EP0. If there | ||
156 | * is no such interface returns -EDOM. If function is not active | ||
157 | * returns -ENODEV. | ||
158 | */ | ||
159 | #define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128) | ||
160 | |||
161 | /* | ||
162 | * Returns real bEndpointAddress of an endpoint. If function is not | ||
163 | * active returns -ENODEV. | ||
164 | */ | ||
165 | #define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129) | ||
166 | |||
167 | |||
168 | |||
169 | #endif /* _UAPI__LINUX_FUNCTIONFS_H__ */ | ||
diff --git a/include/linux/usb/g_printer.h b/include/uapi/linux/usb/g_printer.h index 6178fde50f74..6178fde50f74 100644 --- a/include/linux/usb/g_printer.h +++ b/include/uapi/linux/usb/g_printer.h | |||
diff --git a/include/linux/usb/gadgetfs.h b/include/uapi/linux/usb/gadgetfs.h index 0bb12e0d4f8f..0bb12e0d4f8f 100644 --- a/include/linux/usb/gadgetfs.h +++ b/include/uapi/linux/usb/gadgetfs.h | |||
diff --git a/include/linux/usb/midi.h b/include/uapi/linux/usb/midi.h index c8c52e3c91de..c8c52e3c91de 100644 --- a/include/linux/usb/midi.h +++ b/include/uapi/linux/usb/midi.h | |||
diff --git a/include/linux/usb/tmc.h b/include/uapi/linux/usb/tmc.h index c045ae12556c..c045ae12556c 100644 --- a/include/linux/usb/tmc.h +++ b/include/uapi/linux/usb/tmc.h | |||
diff --git a/include/linux/usb/video.h b/include/uapi/linux/usb/video.h index 3b3b95e01f71..3b3b95e01f71 100644 --- a/include/linux/usb/video.h +++ b/include/uapi/linux/usb/video.h | |||
diff --git a/include/xen/Kbuild b/include/xen/Kbuild deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/include/xen/Kbuild +++ /dev/null | |||
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h index aecee9d112cb..694dcaf266e6 100644 --- a/include/xen/grant_table.h +++ b/include/xen/grant_table.h | |||
@@ -170,7 +170,7 @@ gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, phys_addr_t addr, | |||
170 | unmap->dev_bus_addr = 0; | 170 | unmap->dev_bus_addr = 0; |
171 | } | 171 | } |
172 | 172 | ||
173 | int arch_gnttab_map_shared(unsigned long *frames, unsigned long nr_gframes, | 173 | int arch_gnttab_map_shared(xen_pfn_t *frames, unsigned long nr_gframes, |
174 | unsigned long max_nr_gframes, | 174 | unsigned long max_nr_gframes, |
175 | void **__shared); | 175 | void **__shared); |
176 | int arch_gnttab_map_status(uint64_t *frames, unsigned long nr_gframes, | 176 | int arch_gnttab_map_status(uint64_t *frames, unsigned long nr_gframes, |
diff --git a/include/xen/hvm.h b/include/xen/hvm.h index b193fa2f9fdd..13e43e41637d 100644 --- a/include/xen/hvm.h +++ b/include/xen/hvm.h | |||
@@ -5,6 +5,36 @@ | |||
5 | #include <xen/interface/hvm/params.h> | 5 | #include <xen/interface/hvm/params.h> |
6 | #include <asm/xen/hypercall.h> | 6 | #include <asm/xen/hypercall.h> |
7 | 7 | ||
8 | static const char *param_name(int op) | ||
9 | { | ||
10 | #define PARAM(x) [HVM_PARAM_##x] = #x | ||
11 | static const char *const names[] = { | ||
12 | PARAM(CALLBACK_IRQ), | ||
13 | PARAM(STORE_PFN), | ||
14 | PARAM(STORE_EVTCHN), | ||
15 | PARAM(PAE_ENABLED), | ||
16 | PARAM(IOREQ_PFN), | ||
17 | PARAM(BUFIOREQ_PFN), | ||
18 | PARAM(TIMER_MODE), | ||
19 | PARAM(HPET_ENABLED), | ||
20 | PARAM(IDENT_PT), | ||
21 | PARAM(DM_DOMAIN), | ||
22 | PARAM(ACPI_S_STATE), | ||
23 | PARAM(VM86_TSS), | ||
24 | PARAM(VPT_ALIGN), | ||
25 | PARAM(CONSOLE_PFN), | ||
26 | PARAM(CONSOLE_EVTCHN), | ||
27 | }; | ||
28 | #undef PARAM | ||
29 | |||
30 | if (op >= ARRAY_SIZE(names)) | ||
31 | return "unknown"; | ||
32 | |||
33 | if (!names[op]) | ||
34 | return "reserved"; | ||
35 | |||
36 | return names[op]; | ||
37 | } | ||
8 | static inline int hvm_get_parameter(int idx, uint64_t *value) | 38 | static inline int hvm_get_parameter(int idx, uint64_t *value) |
9 | { | 39 | { |
10 | struct xen_hvm_param xhv; | 40 | struct xen_hvm_param xhv; |
@@ -14,8 +44,8 @@ static inline int hvm_get_parameter(int idx, uint64_t *value) | |||
14 | xhv.index = idx; | 44 | xhv.index = idx; |
15 | r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); | 45 | r = HYPERVISOR_hvm_op(HVMOP_get_param, &xhv); |
16 | if (r < 0) { | 46 | if (r < 0) { |
17 | printk(KERN_ERR "Cannot get hvm parameter %d: %d!\n", | 47 | printk(KERN_ERR "Cannot get hvm parameter %s (%d): %d!\n", |
18 | idx, r); | 48 | param_name(idx), idx, r); |
19 | return r; | 49 | return r; |
20 | } | 50 | } |
21 | *value = xhv.value; | 51 | *value = xhv.value; |
diff --git a/include/xen/interface/grant_table.h b/include/xen/interface/grant_table.h index f9f8b975ae74..e40fae9bf11a 100644 --- a/include/xen/interface/grant_table.h +++ b/include/xen/interface/grant_table.h | |||
@@ -310,7 +310,7 @@ struct gnttab_setup_table { | |||
310 | uint32_t nr_frames; | 310 | uint32_t nr_frames; |
311 | /* OUT parameters. */ | 311 | /* OUT parameters. */ |
312 | int16_t status; /* GNTST_* */ | 312 | int16_t status; /* GNTST_* */ |
313 | GUEST_HANDLE(ulong) frame_list; | 313 | GUEST_HANDLE(xen_pfn_t) frame_list; |
314 | }; | 314 | }; |
315 | DEFINE_GUEST_HANDLE_STRUCT(gnttab_setup_table); | 315 | DEFINE_GUEST_HANDLE_STRUCT(gnttab_setup_table); |
316 | 316 | ||
diff --git a/include/xen/interface/memory.h b/include/xen/interface/memory.h index b66d04ce6957..90712e2072d5 100644 --- a/include/xen/interface/memory.h +++ b/include/xen/interface/memory.h | |||
@@ -179,28 +179,8 @@ struct xen_add_to_physmap { | |||
179 | }; | 179 | }; |
180 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); | 180 | DEFINE_GUEST_HANDLE_STRUCT(xen_add_to_physmap); |
181 | 181 | ||
182 | /* | 182 | /*** REMOVED ***/ |
183 | * Translates a list of domain-specific GPFNs into MFNs. Returns a -ve error | 183 | /*#define XENMEM_translate_gpfn_list 8*/ |
184 | * code on failure. This call only works for auto-translated guests. | ||
185 | */ | ||
186 | #define XENMEM_translate_gpfn_list 8 | ||
187 | struct xen_translate_gpfn_list { | ||
188 | /* Which domain to translate for? */ | ||
189 | domid_t domid; | ||
190 | |||
191 | /* Length of list. */ | ||
192 | xen_ulong_t nr_gpfns; | ||
193 | |||
194 | /* List of GPFNs to translate. */ | ||
195 | GUEST_HANDLE(ulong) gpfn_list; | ||
196 | |||
197 | /* | ||
198 | * Output list to contain MFN translations. May be the same as the input | ||
199 | * list (in which case each input GPFN is overwritten with the output MFN). | ||
200 | */ | ||
201 | GUEST_HANDLE(ulong) mfn_list; | ||
202 | }; | ||
203 | DEFINE_GUEST_HANDLE_STRUCT(xen_translate_gpfn_list); | ||
204 | 184 | ||
205 | /* | 185 | /* |
206 | * Returns the pseudo-physical memory map as it was when the domain | 186 | * Returns the pseudo-physical memory map as it was when the domain |