diff options
Diffstat (limited to 'include')
105 files changed, 3013 insertions, 608 deletions
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index d34c187432ed..f57c36881c48 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <asm/byteorder.h> | 5 | #include <asm/byteorder.h> |
| 6 | #include <linux/socket.h> | ||
| 6 | 7 | ||
| 7 | /* | 8 | /* |
| 8 | * AppleTalk networking structures | 9 | * AppleTalk networking structures |
| @@ -28,7 +29,7 @@ struct atalk_addr { | |||
| 28 | }; | 29 | }; |
| 29 | 30 | ||
| 30 | struct sockaddr_at { | 31 | struct sockaddr_at { |
| 31 | sa_family_t sat_family; | 32 | __kernel_sa_family_t sat_family; |
| 32 | __u8 sat_port; | 33 | __u8 sat_port; |
| 33 | struct atalk_addr sat_addr; | 34 | struct atalk_addr sat_addr; |
| 34 | char sat_zero[8]; | 35 | char sat_zero[8]; |
diff --git a/include/linux/ax25.h b/include/linux/ax25.h index 56c11f0dbd80..74c89a41732d 100644 --- a/include/linux/ax25.h +++ b/include/linux/ax25.h | |||
| @@ -47,7 +47,7 @@ typedef struct { | |||
| 47 | } ax25_address; | 47 | } ax25_address; |
| 48 | 48 | ||
| 49 | struct sockaddr_ax25 { | 49 | struct sockaddr_ax25 { |
| 50 | sa_family_t sax25_family; | 50 | __kernel_sa_family_t sax25_family; |
| 51 | ax25_address sax25_call; | 51 | ax25_address sax25_call; |
| 52 | int sax25_ndigis; | 52 | int sax25_ndigis; |
| 53 | /* Digipeater ax25_address sets follow */ | 53 | /* Digipeater ax25_address sets follow */ |
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 8c96654bef16..5dbd7055cb86 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/bcma/bcma_driver_chipcommon.h> | 7 | #include <linux/bcma/bcma_driver_chipcommon.h> |
| 8 | #include <linux/bcma/bcma_driver_pci.h> | 8 | #include <linux/bcma/bcma_driver_pci.h> |
| 9 | #include <linux/bcma/bcma_driver_mips.h> | ||
| 9 | #include <linux/ssb/ssb.h> /* SPROM sharing */ | 10 | #include <linux/ssb/ssb.h> /* SPROM sharing */ |
| 10 | 11 | ||
| 11 | #include "bcma_regs.h" | 12 | #include "bcma_regs.h" |
| @@ -14,9 +15,9 @@ struct bcma_device; | |||
| 14 | struct bcma_bus; | 15 | struct bcma_bus; |
| 15 | 16 | ||
| 16 | enum bcma_hosttype { | 17 | enum bcma_hosttype { |
| 17 | BCMA_HOSTTYPE_NONE, | ||
| 18 | BCMA_HOSTTYPE_PCI, | 18 | BCMA_HOSTTYPE_PCI, |
| 19 | BCMA_HOSTTYPE_SDIO, | 19 | BCMA_HOSTTYPE_SDIO, |
| 20 | BCMA_HOSTTYPE_SOC, | ||
| 20 | }; | 21 | }; |
| 21 | 22 | ||
| 22 | struct bcma_chipinfo { | 23 | struct bcma_chipinfo { |
| @@ -130,6 +131,7 @@ struct bcma_device { | |||
| 130 | 131 | ||
| 131 | struct device dev; | 132 | struct device dev; |
| 132 | struct device *dma_dev; | 133 | struct device *dma_dev; |
| 134 | |||
| 133 | unsigned int irq; | 135 | unsigned int irq; |
| 134 | bool dev_registered; | 136 | bool dev_registered; |
| 135 | 137 | ||
| @@ -138,6 +140,9 @@ struct bcma_device { | |||
| 138 | u32 addr; | 140 | u32 addr; |
| 139 | u32 wrap; | 141 | u32 wrap; |
| 140 | 142 | ||
| 143 | void __iomem *io_addr; | ||
| 144 | void __iomem *io_wrap; | ||
| 145 | |||
| 141 | void *drvdata; | 146 | void *drvdata; |
| 142 | struct list_head list; | 147 | struct list_head list; |
| 143 | }; | 148 | }; |
| @@ -190,9 +195,11 @@ struct bcma_bus { | |||
| 190 | struct bcma_device *mapped_core; | 195 | struct bcma_device *mapped_core; |
| 191 | struct list_head cores; | 196 | struct list_head cores; |
| 192 | u8 nr_cores; | 197 | u8 nr_cores; |
| 198 | u8 init_done:1; | ||
| 193 | 199 | ||
| 194 | struct bcma_drv_cc drv_cc; | 200 | struct bcma_drv_cc drv_cc; |
| 195 | struct bcma_drv_pci drv_pci; | 201 | struct bcma_drv_pci drv_pci; |
| 202 | struct bcma_drv_mips drv_mips; | ||
| 196 | 203 | ||
| 197 | /* We decided to share SPROM struct with SSB as long as we do not need | 204 | /* We decided to share SPROM struct with SSB as long as we do not need |
| 198 | * any hacks for BCMA. This simplifies drivers code. */ | 205 | * any hacks for BCMA. This simplifies drivers code. */ |
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index a0f684615ae5..1526d965ed06 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ | 24 | #define BCMA_CC_FLASHT_NONE 0x00000000 /* No flash */ |
| 25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ | 25 | #define BCMA_CC_FLASHT_STSER 0x00000100 /* ST serial flash */ |
| 26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ | 26 | #define BCMA_CC_FLASHT_ATSER 0x00000200 /* Atmel serial flash */ |
| 27 | #define BCMA_CC_FLASHT_NFLASH 0x00000200 | ||
| 27 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ | 28 | #define BCMA_CC_FLASHT_PARA 0x00000700 /* Parallel flash */ |
| 28 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ | 29 | #define BCMA_CC_CAP_PLLT 0x00038000 /* PLL Type */ |
| 29 | #define BCMA_PLLTYPE_NONE 0x00000000 | 30 | #define BCMA_PLLTYPE_NONE 0x00000000 |
| @@ -178,6 +179,7 @@ | |||
| 178 | #define BCMA_CC_PROG_CFG 0x0120 | 179 | #define BCMA_CC_PROG_CFG 0x0120 |
| 179 | #define BCMA_CC_PROG_WAITCNT 0x0124 | 180 | #define BCMA_CC_PROG_WAITCNT 0x0124 |
| 180 | #define BCMA_CC_FLASH_CFG 0x0128 | 181 | #define BCMA_CC_FLASH_CFG 0x0128 |
| 182 | #define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */ | ||
| 181 | #define BCMA_CC_FLASH_WAITCNT 0x012C | 183 | #define BCMA_CC_FLASH_WAITCNT 0x012C |
| 182 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ | 184 | /* 0x1E0 is defined as shared BCMA_CLKCTLST */ |
| 183 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ | 185 | #define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ |
| @@ -239,6 +241,64 @@ | |||
| 239 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ | 241 | #define BCMA_CC_SPROM 0x0800 /* SPROM beginning */ |
| 240 | #define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */ | 242 | #define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */ |
| 241 | 243 | ||
| 244 | /* Divider allocation in 4716/47162/5356 */ | ||
| 245 | #define BCMA_CC_PMU5_MAINPLL_CPU 1 | ||
| 246 | #define BCMA_CC_PMU5_MAINPLL_MEM 2 | ||
| 247 | #define BCMA_CC_PMU5_MAINPLL_SSB 3 | ||
| 248 | |||
| 249 | /* PLL usage in 4716/47162 */ | ||
| 250 | #define BCMA_CC_PMU4716_MAINPLL_PLL0 12 | ||
| 251 | |||
| 252 | /* PLL usage in 5356/5357 */ | ||
| 253 | #define BCMA_CC_PMU5356_MAINPLL_PLL0 0 | ||
| 254 | #define BCMA_CC_PMU5357_MAINPLL_PLL0 0 | ||
| 255 | |||
| 256 | /* 4706 PMU */ | ||
| 257 | #define BCMA_CC_PMU4706_MAINPLL_PLL0 0 | ||
| 258 | |||
| 259 | /* ALP clock on pre-PMU chips */ | ||
| 260 | #define BCMA_CC_PMU_ALP_CLOCK 20000000 | ||
| 261 | /* HT clock for systems with PMU-enabled chipcommon */ | ||
| 262 | #define BCMA_CC_PMU_HT_CLOCK 80000000 | ||
| 263 | |||
| 264 | /* PMU rev 5 (& 6) */ | ||
| 265 | #define BCMA_CC_PPL_P1P2_OFF 0 | ||
| 266 | #define BCMA_CC_PPL_P1_MASK 0x0f000000 | ||
| 267 | #define BCMA_CC_PPL_P1_SHIFT 24 | ||
| 268 | #define BCMA_CC_PPL_P2_MASK 0x00f00000 | ||
| 269 | #define BCMA_CC_PPL_P2_SHIFT 20 | ||
| 270 | #define BCMA_CC_PPL_M14_OFF 1 | ||
| 271 | #define BCMA_CC_PPL_MDIV_MASK 0x000000ff | ||
| 272 | #define BCMA_CC_PPL_MDIV_WIDTH 8 | ||
| 273 | #define BCMA_CC_PPL_NM5_OFF 2 | ||
| 274 | #define BCMA_CC_PPL_NDIV_MASK 0xfff00000 | ||
| 275 | #define BCMA_CC_PPL_NDIV_SHIFT 20 | ||
| 276 | #define BCMA_CC_PPL_FMAB_OFF 3 | ||
| 277 | #define BCMA_CC_PPL_MRAT_MASK 0xf0000000 | ||
| 278 | #define BCMA_CC_PPL_MRAT_SHIFT 28 | ||
| 279 | #define BCMA_CC_PPL_ABRAT_MASK 0x08000000 | ||
| 280 | #define BCMA_CC_PPL_ABRAT_SHIFT 27 | ||
| 281 | #define BCMA_CC_PPL_FDIV_MASK 0x07ffffff | ||
| 282 | #define BCMA_CC_PPL_PLLCTL_OFF 4 | ||
| 283 | #define BCMA_CC_PPL_PCHI_OFF 5 | ||
| 284 | #define BCMA_CC_PPL_PCHI_MASK 0x0000003f | ||
| 285 | |||
| 286 | /* BCM4331 ChipControl numbers. */ | ||
| 287 | #define BCMA_CHIPCTL_4331_BT_COEXIST BIT(0) /* 0 disable */ | ||
| 288 | #define BCMA_CHIPCTL_4331_SECI BIT(1) /* 0 SECI is disabled (JATG functional) */ | ||
| 289 | #define BCMA_CHIPCTL_4331_EXT_LNA BIT(2) /* 0 disable */ | ||
| 290 | #define BCMA_CHIPCTL_4331_SPROM_GPIO13_15 BIT(3) /* sprom/gpio13-15 mux */ | ||
| 291 | #define BCMA_CHIPCTL_4331_EXTPA_EN BIT(4) /* 0 ext pa disable, 1 ext pa enabled */ | ||
| 292 | #define BCMA_CHIPCTL_4331_GPIOCLK_ON_SPROMCS BIT(5) /* set drive out GPIO_CLK on sprom_cs pin */ | ||
| 293 | #define BCMA_CHIPCTL_4331_PCIE_MDIO_ON_SPROMCS BIT(6) /* use sprom_cs pin as PCIE mdio interface */ | ||
| 294 | #define BCMA_CHIPCTL_4331_EXTPA_ON_GPIO2_5 BIT(7) /* aband extpa will be at gpio2/5 and sprom_dout */ | ||
| 295 | #define BCMA_CHIPCTL_4331_OVR_PIPEAUXCLKEN BIT(8) /* override core control on pipe_AuxClkEnable */ | ||
| 296 | #define BCMA_CHIPCTL_4331_OVR_PIPEAUXPWRDOWN BIT(9) /* override core control on pipe_AuxPowerDown */ | ||
| 297 | #define BCMA_CHIPCTL_4331_PCIE_AUXCLKEN BIT(10) /* pcie_auxclkenable */ | ||
| 298 | #define BCMA_CHIPCTL_4331_PCIE_PIPE_PLLDOWN BIT(11) /* pcie_pipe_pllpowerdown */ | ||
| 299 | #define BCMA_CHIPCTL_4331_BT_SHD0_ON_GPIO4 BIT(16) /* enable bt_shd0 at gpio4 */ | ||
| 300 | #define BCMA_CHIPCTL_4331_BT_SHD1_ON_GPIO5 BIT(17) /* enable bt_shd1 at gpio5 */ | ||
| 301 | |||
| 242 | /* Data for the PMU, if available. | 302 | /* Data for the PMU, if available. |
| 243 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) | 303 | * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) |
| 244 | */ | 304 | */ |
| @@ -247,14 +307,37 @@ struct bcma_chipcommon_pmu { | |||
| 247 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ | 307 | u32 crystalfreq; /* The active crystal frequency (in kHz) */ |
| 248 | }; | 308 | }; |
| 249 | 309 | ||
| 310 | #ifdef CONFIG_BCMA_DRIVER_MIPS | ||
| 311 | struct bcma_pflash { | ||
| 312 | u8 buswidth; | ||
| 313 | u32 window; | ||
| 314 | u32 window_size; | ||
| 315 | }; | ||
| 316 | |||
| 317 | struct bcma_serial_port { | ||
| 318 | void *regs; | ||
| 319 | unsigned long clockspeed; | ||
| 320 | unsigned int irq; | ||
| 321 | unsigned int baud_base; | ||
| 322 | unsigned int reg_shift; | ||
| 323 | }; | ||
| 324 | #endif /* CONFIG_BCMA_DRIVER_MIPS */ | ||
| 325 | |||
| 250 | struct bcma_drv_cc { | 326 | struct bcma_drv_cc { |
| 251 | struct bcma_device *core; | 327 | struct bcma_device *core; |
| 252 | u32 status; | 328 | u32 status; |
| 253 | u32 capabilities; | 329 | u32 capabilities; |
| 254 | u32 capabilities_ext; | 330 | u32 capabilities_ext; |
| 331 | u8 setup_done:1; | ||
| 255 | /* Fast Powerup Delay constant */ | 332 | /* Fast Powerup Delay constant */ |
| 256 | u16 fast_pwrup_delay; | 333 | u16 fast_pwrup_delay; |
| 257 | struct bcma_chipcommon_pmu pmu; | 334 | struct bcma_chipcommon_pmu pmu; |
| 335 | #ifdef CONFIG_BCMA_DRIVER_MIPS | ||
| 336 | struct bcma_pflash pflash; | ||
| 337 | |||
| 338 | int nr_serial_ports; | ||
| 339 | struct bcma_serial_port serial_ports[4]; | ||
| 340 | #endif /* CONFIG_BCMA_DRIVER_MIPS */ | ||
| 258 | }; | 341 | }; |
| 259 | 342 | ||
| 260 | /* Register access */ | 343 | /* Register access */ |
| @@ -275,6 +358,8 @@ extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); | |||
| 275 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); | 358 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); |
| 276 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); | 359 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); |
| 277 | 360 | ||
| 361 | void bcma_chipco_bcm4331_ext_pa_lines_ctl(struct bcma_drv_cc *cc, bool enable); | ||
| 362 | |||
| 278 | extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, | 363 | extern void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, |
| 279 | u32 ticks); | 364 | u32 ticks); |
| 280 | 365 | ||
| @@ -293,4 +378,13 @@ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); | |||
| 293 | /* PMU support */ | 378 | /* PMU support */ |
| 294 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); | 379 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); |
| 295 | 380 | ||
| 381 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, | ||
| 382 | u32 value); | ||
| 383 | extern void bcma_chipco_pll_maskset(struct bcma_drv_cc *cc, u32 offset, | ||
| 384 | u32 mask, u32 set); | ||
| 385 | extern void bcma_chipco_chipctl_maskset(struct bcma_drv_cc *cc, | ||
| 386 | u32 offset, u32 mask, u32 set); | ||
| 387 | extern void bcma_chipco_regctl_maskset(struct bcma_drv_cc *cc, | ||
| 388 | u32 offset, u32 mask, u32 set); | ||
| 389 | |||
| 296 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ | 390 | #endif /* LINUX_BCMA_DRIVER_CC_H_ */ |
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h new file mode 100644 index 000000000000..c0043645cdcb --- /dev/null +++ b/include/linux/bcma/bcma_driver_mips.h | |||
| @@ -0,0 +1,51 @@ | |||
| 1 | #ifndef LINUX_BCMA_DRIVER_MIPS_H_ | ||
| 2 | #define LINUX_BCMA_DRIVER_MIPS_H_ | ||
| 3 | |||
| 4 | #define BCMA_MIPS_IPSFLAG 0x0F08 | ||
| 5 | /* which sbflags get routed to mips interrupt 1 */ | ||
| 6 | #define BCMA_MIPS_IPSFLAG_IRQ1 0x0000003F | ||
| 7 | #define BCMA_MIPS_IPSFLAG_IRQ1_SHIFT 0 | ||
| 8 | /* which sbflags get routed to mips interrupt 2 */ | ||
| 9 | #define BCMA_MIPS_IPSFLAG_IRQ2 0x00003F00 | ||
| 10 | #define BCMA_MIPS_IPSFLAG_IRQ2_SHIFT 8 | ||
| 11 | /* which sbflags get routed to mips interrupt 3 */ | ||
| 12 | #define BCMA_MIPS_IPSFLAG_IRQ3 0x003F0000 | ||
| 13 | #define BCMA_MIPS_IPSFLAG_IRQ3_SHIFT 16 | ||
| 14 | /* which sbflags get routed to mips interrupt 4 */ | ||
| 15 | #define BCMA_MIPS_IPSFLAG_IRQ4 0x3F000000 | ||
| 16 | #define BCMA_MIPS_IPSFLAG_IRQ4_SHIFT 24 | ||
| 17 | |||
| 18 | /* MIPS 74K core registers */ | ||
| 19 | #define BCMA_MIPS_MIPS74K_CORECTL 0x0000 | ||
| 20 | #define BCMA_MIPS_MIPS74K_EXCEPTBASE 0x0004 | ||
| 21 | #define BCMA_MIPS_MIPS74K_BIST 0x000C | ||
| 22 | #define BCMA_MIPS_MIPS74K_INTMASK_INT0 0x0014 | ||
| 23 | #define BCMA_MIPS_MIPS74K_INTMASK(int) \ | ||
| 24 | ((int) * 4 + BCMA_MIPS_MIPS74K_INTMASK_INT0) | ||
| 25 | #define BCMA_MIPS_MIPS74K_NMIMASK 0x002C | ||
| 26 | #define BCMA_MIPS_MIPS74K_GPIOSEL 0x0040 | ||
| 27 | #define BCMA_MIPS_MIPS74K_GPIOOUT 0x0044 | ||
| 28 | #define BCMA_MIPS_MIPS74K_GPIOEN 0x0048 | ||
| 29 | #define BCMA_MIPS_MIPS74K_CLKCTLST 0x01E0 | ||
| 30 | |||
| 31 | #define BCMA_MIPS_OOBSELOUTA30 0x100 | ||
| 32 | |||
| 33 | struct bcma_device; | ||
| 34 | |||
| 35 | struct bcma_drv_mips { | ||
| 36 | struct bcma_device *core; | ||
| 37 | u8 setup_done:1; | ||
| 38 | unsigned int assigned_irqs; | ||
| 39 | }; | ||
| 40 | |||
| 41 | #ifdef CONFIG_BCMA_DRIVER_MIPS | ||
| 42 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); | ||
| 43 | #else | ||
| 44 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } | ||
| 45 | #endif | ||
| 46 | |||
| 47 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); | ||
| 48 | |||
| 49 | extern unsigned int bcma_core_mips_irq(struct bcma_device *dev); | ||
| 50 | |||
| 51 | #endif /* LINUX_BCMA_DRIVER_MIPS_H_ */ | ||
diff --git a/include/linux/bcma/bcma_soc.h b/include/linux/bcma/bcma_soc.h new file mode 100644 index 000000000000..4203c5593b9f --- /dev/null +++ b/include/linux/bcma/bcma_soc.h | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | #ifndef LINUX_BCMA_SOC_H_ | ||
| 2 | #define LINUX_BCMA_SOC_H_ | ||
| 3 | |||
| 4 | #include <linux/bcma/bcma.h> | ||
| 5 | |||
| 6 | struct bcma_soc { | ||
| 7 | struct bcma_bus bus; | ||
| 8 | struct bcma_device core_cc; | ||
| 9 | struct bcma_device core_mips; | ||
| 10 | }; | ||
| 11 | |||
| 12 | int __init bcma_host_soc_register(struct bcma_soc *soc); | ||
| 13 | |||
| 14 | int bcma_bus_register(struct bcma_bus *bus); | ||
| 15 | |||
| 16 | #endif /* LINUX_BCMA_SOC_H_ */ | ||
diff --git a/include/linux/caif/caif_socket.h b/include/linux/caif/caif_socket.h index d9cb19b7cff7..3f3bac6af7bc 100644 --- a/include/linux/caif/caif_socket.h +++ b/include/linux/caif/caif_socket.h | |||
| @@ -9,12 +9,7 @@ | |||
| 9 | #define _LINUX_CAIF_SOCKET_H | 9 | #define _LINUX_CAIF_SOCKET_H |
| 10 | 10 | ||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | |||
| 13 | #ifdef __KERNEL__ | ||
| 14 | #include <linux/socket.h> | 12 | #include <linux/socket.h> |
| 15 | #else | ||
| 16 | #include <sys/socket.h> | ||
| 17 | #endif | ||
| 18 | 13 | ||
| 19 | /** | 14 | /** |
| 20 | * enum caif_link_selector - Physical Link Selection. | 15 | * enum caif_link_selector - Physical Link Selection. |
| @@ -144,7 +139,7 @@ enum caif_debug_service { | |||
| 144 | * CAIF Channel. It defines the service to connect to on the modem. | 139 | * CAIF Channel. It defines the service to connect to on the modem. |
| 145 | */ | 140 | */ |
| 146 | struct sockaddr_caif { | 141 | struct sockaddr_caif { |
| 147 | sa_family_t family; | 142 | __kernel_sa_family_t family; |
| 148 | union { | 143 | union { |
| 149 | struct { | 144 | struct { |
| 150 | __u8 type; /* type: enum caif_at_type */ | 145 | __u8 type; /* type: enum caif_at_type */ |
diff --git a/include/linux/can.h b/include/linux/can.h index d18333302cbd..9a19bcb3eeaf 100644 --- a/include/linux/can.h +++ b/include/linux/can.h | |||
| @@ -8,8 +8,6 @@ | |||
| 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
| 9 | * All rights reserved. | 9 | * All rights reserved. |
| 10 | * | 10 | * |
| 11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 12 | * | ||
| 13 | */ | 11 | */ |
| 14 | 12 | ||
| 15 | #ifndef CAN_H | 13 | #ifndef CAN_H |
| @@ -78,7 +76,7 @@ struct can_frame { | |||
| 78 | * @can_addr: protocol specific address information | 76 | * @can_addr: protocol specific address information |
| 79 | */ | 77 | */ |
| 80 | struct sockaddr_can { | 78 | struct sockaddr_can { |
| 81 | sa_family_t can_family; | 79 | __kernel_sa_family_t can_family; |
| 82 | int can_ifindex; | 80 | int can_ifindex; |
| 83 | union { | 81 | union { |
| 84 | /* transport protocol class address information (e.g. ISOTP) */ | 82 | /* transport protocol class address information (e.g. ISOTP) */ |
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild index 8cb05aae661c..c62b7f1728f9 100644 --- a/include/linux/can/Kbuild +++ b/include/linux/can/Kbuild | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | header-y += raw.h | 1 | header-y += raw.h |
| 2 | header-y += bcm.h | 2 | header-y += bcm.h |
| 3 | header-y += gw.h | ||
| 3 | header-y += error.h | 4 | header-y += error.h |
| 4 | header-y += netlink.h | 5 | header-y += netlink.h |
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h index 1432b278c52d..3ebe387fea4d 100644 --- a/include/linux/can/bcm.h +++ b/include/linux/can/bcm.h | |||
| @@ -7,14 +7,13 @@ | |||
| 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
| 8 | * All rights reserved. | 8 | * All rights reserved. |
| 9 | * | 9 | * |
| 10 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 11 | * | ||
| 12 | */ | 10 | */ |
| 13 | 11 | ||
| 14 | #ifndef CAN_BCM_H | 12 | #ifndef CAN_BCM_H |
| 15 | #define CAN_BCM_H | 13 | #define CAN_BCM_H |
| 16 | 14 | ||
| 17 | #include <linux/types.h> | 15 | #include <linux/types.h> |
| 16 | #include <linux/can.h> | ||
| 18 | 17 | ||
| 19 | /** | 18 | /** |
| 20 | * struct bcm_msg_head - head of messages to/from the broadcast manager | 19 | * struct bcm_msg_head - head of messages to/from the broadcast manager |
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index 5ce6b5d62ecc..0ccc1cd28b95 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
| @@ -8,8 +8,6 @@ | |||
| 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
| 9 | * All rights reserved. | 9 | * All rights reserved. |
| 10 | * | 10 | * |
| 11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 12 | * | ||
| 13 | */ | 11 | */ |
| 14 | 12 | ||
| 15 | #ifndef CAN_CORE_H | 13 | #ifndef CAN_CORE_H |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index cc0bb4961669..a0969fcb72b9 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | * | 8 | * |
| 9 | * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com> | 9 | * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com> |
| 10 | * | 10 | * |
| 11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 12 | */ | 11 | */ |
| 13 | 12 | ||
| 14 | #ifndef CAN_DEV_H | 13 | #ifndef CAN_DEV_H |
diff --git a/include/linux/can/error.h b/include/linux/can/error.h index 5958074302a4..63e855ea6b84 100644 --- a/include/linux/can/error.h +++ b/include/linux/can/error.h | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 7 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
| 8 | * All rights reserved. | 8 | * All rights reserved. |
| 9 | * | 9 | * |
| 10 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 11 | * | ||
| 12 | */ | 10 | */ |
| 13 | 11 | ||
| 14 | #ifndef CAN_ERROR_H | 12 | #ifndef CAN_ERROR_H |
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h new file mode 100644 index 000000000000..8e1db18c3cb6 --- /dev/null +++ b/include/linux/can/gw.h | |||
| @@ -0,0 +1,162 @@ | |||
| 1 | /* | ||
| 2 | * linux/can/gw.h | ||
| 3 | * | ||
| 4 | * Definitions for CAN frame Gateway/Router/Bridge | ||
| 5 | * | ||
| 6 | * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> | ||
| 7 | * Copyright (c) 2011 Volkswagen Group Electronic Research | ||
| 8 | * All rights reserved. | ||
| 9 | * | ||
| 10 | */ | ||
| 11 | |||
| 12 | #ifndef CAN_GW_H | ||
| 13 | #define CAN_GW_H | ||
| 14 | |||
| 15 | #include <linux/types.h> | ||
| 16 | #include <linux/can.h> | ||
| 17 | |||
| 18 | struct rtcanmsg { | ||
| 19 | __u8 can_family; | ||
| 20 | __u8 gwtype; | ||
| 21 | __u16 flags; | ||
| 22 | }; | ||
| 23 | |||
| 24 | /* CAN gateway types */ | ||
| 25 | enum { | ||
| 26 | CGW_TYPE_UNSPEC, | ||
| 27 | CGW_TYPE_CAN_CAN, /* CAN->CAN routing */ | ||
| 28 | __CGW_TYPE_MAX | ||
| 29 | }; | ||
| 30 | |||
| 31 | #define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1) | ||
| 32 | |||
| 33 | /* CAN rtnetlink attribute definitions */ | ||
| 34 | enum { | ||
| 35 | CGW_UNSPEC, | ||
| 36 | CGW_MOD_AND, /* CAN frame modification binary AND */ | ||
| 37 | CGW_MOD_OR, /* CAN frame modification binary OR */ | ||
| 38 | CGW_MOD_XOR, /* CAN frame modification binary XOR */ | ||
| 39 | CGW_MOD_SET, /* CAN frame modification set alternate values */ | ||
| 40 | CGW_CS_XOR, /* set data[] XOR checksum into data[index] */ | ||
| 41 | CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */ | ||
| 42 | CGW_HANDLED, /* number of handled CAN frames */ | ||
| 43 | CGW_DROPPED, /* number of dropped CAN frames */ | ||
| 44 | CGW_SRC_IF, /* ifindex of source network interface */ | ||
| 45 | CGW_DST_IF, /* ifindex of destination network interface */ | ||
| 46 | CGW_FILTER, /* specify struct can_filter on source CAN device */ | ||
| 47 | __CGW_MAX | ||
| 48 | }; | ||
| 49 | |||
| 50 | #define CGW_MAX (__CGW_MAX - 1) | ||
| 51 | |||
| 52 | #define CGW_FLAGS_CAN_ECHO 0x01 | ||
| 53 | #define CGW_FLAGS_CAN_SRC_TSTAMP 0x02 | ||
| 54 | |||
| 55 | #define CGW_MOD_FUNCS 4 /* AND OR XOR SET */ | ||
| 56 | |||
| 57 | /* CAN frame elements that are affected by curr. 3 CAN frame modifications */ | ||
| 58 | #define CGW_MOD_ID 0x01 | ||
| 59 | #define CGW_MOD_DLC 0x02 | ||
| 60 | #define CGW_MOD_DATA 0x04 | ||
| 61 | |||
| 62 | #define CGW_FRAME_MODS 3 /* ID DLC DATA */ | ||
| 63 | |||
| 64 | #define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS) | ||
| 65 | |||
| 66 | struct cgw_frame_mod { | ||
| 67 | struct can_frame cf; | ||
| 68 | __u8 modtype; | ||
| 69 | } __attribute__((packed)); | ||
| 70 | |||
| 71 | #define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod) | ||
| 72 | |||
| 73 | struct cgw_csum_xor { | ||
| 74 | __s8 from_idx; | ||
| 75 | __s8 to_idx; | ||
| 76 | __s8 result_idx; | ||
| 77 | __u8 init_xor_val; | ||
| 78 | } __attribute__((packed)); | ||
| 79 | |||
| 80 | struct cgw_csum_crc8 { | ||
| 81 | __s8 from_idx; | ||
| 82 | __s8 to_idx; | ||
| 83 | __s8 result_idx; | ||
| 84 | __u8 init_crc_val; | ||
| 85 | __u8 final_xor_val; | ||
| 86 | __u8 crctab[256]; | ||
| 87 | __u8 profile; | ||
| 88 | __u8 profile_data[20]; | ||
| 89 | } __attribute__((packed)); | ||
| 90 | |||
| 91 | /* length of checksum operation parameters. idx = index in CAN frame data[] */ | ||
| 92 | #define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor) | ||
| 93 | #define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8) | ||
| 94 | |||
| 95 | /* CRC8 profiles (compute CRC for additional data elements - see below) */ | ||
| 96 | enum { | ||
| 97 | CGW_CRC8PRF_UNSPEC, | ||
| 98 | CGW_CRC8PRF_1U8, /* compute one additional u8 value */ | ||
| 99 | CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */ | ||
| 100 | CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */ | ||
| 101 | __CGW_CRC8PRF_MAX | ||
| 102 | }; | ||
| 103 | |||
| 104 | #define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1) | ||
| 105 | |||
| 106 | /* | ||
| 107 | * CAN rtnetlink attribute contents in detail | ||
| 108 | * | ||
| 109 | * CGW_XXX_IF (length 4 bytes): | ||
| 110 | * Sets an interface index for source/destination network interfaces. | ||
| 111 | * For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory. | ||
| 112 | * | ||
| 113 | * CGW_FILTER (length 8 bytes): | ||
| 114 | * Sets a CAN receive filter for the gateway job specified by the | ||
| 115 | * struct can_filter described in include/linux/can.h | ||
| 116 | * | ||
| 117 | * CGW_MOD_XXX (length 17 bytes): | ||
| 118 | * Specifies a modification that's done to a received CAN frame before it is | ||
| 119 | * send out to the destination interface. | ||
| 120 | * | ||
| 121 | * <struct can_frame> data used as operator | ||
| 122 | * <u8> affected CAN frame elements | ||
| 123 | * | ||
| 124 | * CGW_CS_XOR (length 4 bytes): | ||
| 125 | * Set a simple XOR checksum starting with an initial value into | ||
| 126 | * data[result-idx] using data[start-idx] .. data[end-idx] | ||
| 127 | * | ||
| 128 | * The XOR checksum is calculated like this: | ||
| 129 | * | ||
| 130 | * xor = init_xor_val | ||
| 131 | * | ||
| 132 | * for (i = from_idx .. to_idx) | ||
| 133 | * xor ^= can_frame.data[i] | ||
| 134 | * | ||
| 135 | * can_frame.data[ result_idx ] = xor | ||
| 136 | * | ||
| 137 | * CGW_CS_CRC8 (length 282 bytes): | ||
| 138 | * Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table, | ||
| 139 | * a given initial value and a defined input data[start-idx] .. data[end-idx]. | ||
| 140 | * Finally the result value is XOR'ed with the final_xor_val. | ||
| 141 | * | ||
| 142 | * The CRC8 checksum is calculated like this: | ||
| 143 | * | ||
| 144 | * crc = init_crc_val | ||
| 145 | * | ||
| 146 | * for (i = from_idx .. to_idx) | ||
| 147 | * crc = crctab[ crc ^ can_frame.data[i] ] | ||
| 148 | * | ||
| 149 | * can_frame.data[ result_idx ] = crc ^ final_xor_val | ||
| 150 | * | ||
| 151 | * The calculated CRC may contain additional source data elements that can be | ||
| 152 | * defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs | ||
| 153 | * like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf | ||
| 154 | * E.g. the profile_data[] may contain additional u8 values (called DATA_IDs) | ||
| 155 | * that are used depending on counter values inside the CAN frame data[]. | ||
| 156 | * So far only three profiles have been implemented for illustration. | ||
| 157 | * | ||
| 158 | * Remark: In general the attribute data is a linear buffer. | ||
| 159 | * Beware of sending unpacked or aligned structs! | ||
| 160 | */ | ||
| 161 | |||
| 162 | #endif | ||
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h index 34542d374dd8..14966ddb7df1 100644 --- a/include/linux/can/netlink.h +++ b/include/linux/can/netlink.h | |||
| @@ -5,8 +5,6 @@ | |||
| 5 | * | 5 | * |
| 6 | * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com> | 6 | * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com> |
| 7 | * | 7 | * |
| 8 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 9 | * | ||
| 10 | */ | 8 | */ |
| 11 | 9 | ||
| 12 | #ifndef CAN_NETLINK_H | 10 | #ifndef CAN_NETLINK_H |
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h index b2a0f87492c5..781f3a3701be 100644 --- a/include/linux/can/raw.h +++ b/include/linux/can/raw.h | |||
| @@ -8,8 +8,6 @@ | |||
| 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research | 8 | * Copyright (c) 2002-2007 Volkswagen Group Electronic Research |
| 9 | * All rights reserved. | 9 | * All rights reserved. |
| 10 | * | 10 | * |
| 11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
| 12 | * | ||
| 13 | */ | 11 | */ |
| 14 | 12 | ||
| 15 | #ifndef CAN_RAW_H | 13 | #ifndef CAN_RAW_H |
diff --git a/include/linux/capability.h b/include/linux/capability.h index c42112350003..a63d13d84ad8 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
| @@ -198,7 +198,7 @@ struct cpu_vfs_cap_data { | |||
| 198 | /* Allow modification of routing tables */ | 198 | /* Allow modification of routing tables */ |
| 199 | /* Allow setting arbitrary process / process group ownership on | 199 | /* Allow setting arbitrary process / process group ownership on |
| 200 | sockets */ | 200 | sockets */ |
| 201 | /* Allow binding to any address for transparent proxying */ | 201 | /* Allow binding to any address for transparent proxying (also via NET_RAW) */ |
| 202 | /* Allow setting TOS (type of service) */ | 202 | /* Allow setting TOS (type of service) */ |
| 203 | /* Allow setting promiscuous mode */ | 203 | /* Allow setting promiscuous mode */ |
| 204 | /* Allow clearing driver statistics */ | 204 | /* Allow clearing driver statistics */ |
| @@ -210,6 +210,7 @@ struct cpu_vfs_cap_data { | |||
| 210 | 210 | ||
| 211 | /* Allow use of RAW sockets */ | 211 | /* Allow use of RAW sockets */ |
| 212 | /* Allow use of PACKET sockets */ | 212 | /* Allow use of PACKET sockets */ |
| 213 | /* Allow binding to any address for transparent proxying (also via NET_ADMIN) */ | ||
| 213 | 214 | ||
| 214 | #define CAP_NET_RAW 13 | 215 | #define CAP_NET_RAW 13 |
| 215 | 216 | ||
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h index 12c517b51ca2..d03612b196e1 100644 --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h | |||
| @@ -54,6 +54,7 @@ struct proc_event { | |||
| 54 | PROC_EVENT_GID = 0x00000040, | 54 | PROC_EVENT_GID = 0x00000040, |
| 55 | PROC_EVENT_SID = 0x00000080, | 55 | PROC_EVENT_SID = 0x00000080, |
| 56 | PROC_EVENT_PTRACE = 0x00000100, | 56 | PROC_EVENT_PTRACE = 0x00000100, |
| 57 | PROC_EVENT_COMM = 0x00000200, | ||
| 57 | /* "next" should be 0x00000400 */ | 58 | /* "next" should be 0x00000400 */ |
| 58 | /* "last" is the last process event: exit */ | 59 | /* "last" is the last process event: exit */ |
| 59 | PROC_EVENT_EXIT = 0x80000000 | 60 | PROC_EVENT_EXIT = 0x80000000 |
| @@ -103,6 +104,12 @@ struct proc_event { | |||
| 103 | __kernel_pid_t tracer_tgid; | 104 | __kernel_pid_t tracer_tgid; |
| 104 | } ptrace; | 105 | } ptrace; |
| 105 | 106 | ||
| 107 | struct comm_proc_event { | ||
| 108 | __kernel_pid_t process_pid; | ||
| 109 | __kernel_pid_t process_tgid; | ||
| 110 | char comm[16]; | ||
| 111 | } comm; | ||
| 112 | |||
| 106 | struct exit_proc_event { | 113 | struct exit_proc_event { |
| 107 | __kernel_pid_t process_pid; | 114 | __kernel_pid_t process_pid; |
| 108 | __kernel_pid_t process_tgid; | 115 | __kernel_pid_t process_tgid; |
| @@ -118,6 +125,7 @@ void proc_exec_connector(struct task_struct *task); | |||
| 118 | void proc_id_connector(struct task_struct *task, int which_id); | 125 | void proc_id_connector(struct task_struct *task, int which_id); |
| 119 | void proc_sid_connector(struct task_struct *task); | 126 | void proc_sid_connector(struct task_struct *task); |
| 120 | void proc_ptrace_connector(struct task_struct *task, int which_id); | 127 | void proc_ptrace_connector(struct task_struct *task, int which_id); |
| 128 | void proc_comm_connector(struct task_struct *task); | ||
| 121 | void proc_exit_connector(struct task_struct *task); | 129 | void proc_exit_connector(struct task_struct *task); |
| 122 | #else | 130 | #else |
| 123 | static inline void proc_fork_connector(struct task_struct *task) | 131 | static inline void proc_fork_connector(struct task_struct *task) |
| @@ -133,6 +141,9 @@ static inline void proc_id_connector(struct task_struct *task, | |||
| 133 | static inline void proc_sid_connector(struct task_struct *task) | 141 | static inline void proc_sid_connector(struct task_struct *task) |
| 134 | {} | 142 | {} |
| 135 | 143 | ||
| 144 | static inline void proc_comm_connector(struct task_struct *task) | ||
| 145 | {} | ||
| 146 | |||
| 136 | static inline void proc_ptrace_connector(struct task_struct *task, | 147 | static inline void proc_ptrace_connector(struct task_struct *task, |
| 137 | int ptrace_id) | 148 | int ptrace_id) |
| 138 | {} | 149 | {} |
diff --git a/include/linux/device.h b/include/linux/device.h index 4639419522da..46751bdb71da 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -350,6 +350,8 @@ struct class_attribute { | |||
| 350 | char *buf); | 350 | char *buf); |
| 351 | ssize_t (*store)(struct class *class, struct class_attribute *attr, | 351 | ssize_t (*store)(struct class *class, struct class_attribute *attr, |
| 352 | const char *buf, size_t count); | 352 | const char *buf, size_t count); |
| 353 | const void *(*namespace)(struct class *class, | ||
| 354 | const struct class_attribute *attr); | ||
| 353 | }; | 355 | }; |
| 354 | 356 | ||
| 355 | #define CLASS_ATTR(_name, _mode, _show, _store) \ | 357 | #define CLASS_ATTR(_name, _mode, _show, _store) \ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index c6e427ab65fe..45f00b61c096 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -117,99 +117,101 @@ struct ethtool_eeprom { | |||
| 117 | __u8 data[0]; | 117 | __u8 data[0]; |
| 118 | }; | 118 | }; |
| 119 | 119 | ||
| 120 | /* for configuring coalescing parameters of chip */ | 120 | /** |
| 121 | * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates | ||
| 122 | * @cmd: ETHTOOL_{G,S}COALESCE | ||
| 123 | * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after | ||
| 124 | * a packet arrives. | ||
| 125 | * @rx_max_coalesced_frames: Maximum number of packets to receive | ||
| 126 | * before an RX interrupt. | ||
| 127 | * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that | ||
| 128 | * this value applies while an IRQ is being serviced by the host. | ||
| 129 | * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames, | ||
| 130 | * except that this value applies while an IRQ is being serviced | ||
| 131 | * by the host. | ||
| 132 | * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after | ||
| 133 | * a packet is sent. | ||
| 134 | * @tx_max_coalesced_frames: Maximum number of packets to be sent | ||
| 135 | * before a TX interrupt. | ||
| 136 | * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that | ||
| 137 | * this value applies while an IRQ is being serviced by the host. | ||
| 138 | * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames, | ||
| 139 | * except that this value applies while an IRQ is being serviced | ||
| 140 | * by the host. | ||
| 141 | * @stats_block_coalesce_usecs: How many usecs to delay in-memory | ||
| 142 | * statistics block updates. Some drivers do not have an | ||
| 143 | * in-memory statistic block, and in such cases this value is | ||
| 144 | * ignored. This value must not be zero. | ||
| 145 | * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing. | ||
| 146 | * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing. | ||
| 147 | * @pkt_rate_low: Threshold for low packet rate (packets per second). | ||
| 148 | * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after | ||
| 149 | * a packet arrives, when the packet rate is below @pkt_rate_low. | ||
| 150 | * @rx_max_coalesced_frames_low: Maximum number of packets to be received | ||
| 151 | * before an RX interrupt, when the packet rate is below @pkt_rate_low. | ||
| 152 | * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after | ||
| 153 | * a packet is sent, when the packet rate is below @pkt_rate_low. | ||
| 154 | * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before | ||
| 155 | * a TX interrupt, when the packet rate is below @pkt_rate_low. | ||
| 156 | * @pkt_rate_high: Threshold for high packet rate (packets per second). | ||
| 157 | * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after | ||
| 158 | * a packet arrives, when the packet rate is above @pkt_rate_high. | ||
| 159 | * @rx_max_coalesced_frames_high: Maximum number of packets to be received | ||
| 160 | * before an RX interrupt, when the packet rate is above @pkt_rate_high. | ||
| 161 | * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after | ||
| 162 | * a packet is sent, when the packet rate is above @pkt_rate_high. | ||
| 163 | * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before | ||
| 164 | * a TX interrupt, when the packet rate is above @pkt_rate_high. | ||
| 165 | * @rate_sample_interval: How often to do adaptive coalescing packet rate | ||
| 166 | * sampling, measured in seconds. Must not be zero. | ||
| 167 | * | ||
| 168 | * Each pair of (usecs, max_frames) fields specifies this exit | ||
| 169 | * condition for interrupt coalescing: | ||
| 170 | * (usecs > 0 && time_since_first_completion >= usecs) || | ||
| 171 | * (max_frames > 0 && completed_frames >= max_frames) | ||
| 172 | * It is illegal to set both usecs and max_frames to zero as this | ||
| 173 | * would cause interrupts to never be generated. To disable | ||
| 174 | * coalescing, set usecs = 0 and max_frames = 1. | ||
| 175 | * | ||
| 176 | * Some implementations ignore the value of max_frames and use the | ||
| 177 | * condition: | ||
| 178 | * time_since_first_completion >= usecs | ||
| 179 | * This is deprecated. Drivers for hardware that does not support | ||
| 180 | * counting completions should validate that max_frames == !rx_usecs. | ||
| 181 | * | ||
| 182 | * Adaptive RX/TX coalescing is an algorithm implemented by some | ||
| 183 | * drivers to improve latency under low packet rates and improve | ||
| 184 | * throughput under high packet rates. Some drivers only implement | ||
| 185 | * one of RX or TX adaptive coalescing. Anything not implemented by | ||
| 186 | * the driver causes these values to be silently ignored. | ||
| 187 | * | ||
| 188 | * When the packet rate is below @pkt_rate_high but above | ||
| 189 | * @pkt_rate_low (both measured in packets per second) the | ||
| 190 | * normal {rx,tx}_* coalescing parameters are used. | ||
| 191 | */ | ||
| 121 | struct ethtool_coalesce { | 192 | struct ethtool_coalesce { |
| 122 | __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ | 193 | __u32 cmd; |
| 123 | |||
| 124 | /* How many usecs to delay an RX interrupt after | ||
| 125 | * a packet arrives. If 0, only rx_max_coalesced_frames | ||
| 126 | * is used. | ||
| 127 | */ | ||
| 128 | __u32 rx_coalesce_usecs; | 194 | __u32 rx_coalesce_usecs; |
| 129 | |||
| 130 | /* How many packets to delay an RX interrupt after | ||
| 131 | * a packet arrives. If 0, only rx_coalesce_usecs is | ||
| 132 | * used. It is illegal to set both usecs and max frames | ||
| 133 | * to zero as this would cause RX interrupts to never be | ||
| 134 | * generated. | ||
| 135 | */ | ||
| 136 | __u32 rx_max_coalesced_frames; | 195 | __u32 rx_max_coalesced_frames; |
| 137 | |||
| 138 | /* Same as above two parameters, except that these values | ||
| 139 | * apply while an IRQ is being serviced by the host. Not | ||
| 140 | * all cards support this feature and the values are ignored | ||
| 141 | * in that case. | ||
| 142 | */ | ||
| 143 | __u32 rx_coalesce_usecs_irq; | 196 | __u32 rx_coalesce_usecs_irq; |
| 144 | __u32 rx_max_coalesced_frames_irq; | 197 | __u32 rx_max_coalesced_frames_irq; |
| 145 | |||
| 146 | /* How many usecs to delay a TX interrupt after | ||
| 147 | * a packet is sent. If 0, only tx_max_coalesced_frames | ||
| 148 | * is used. | ||
| 149 | */ | ||
| 150 | __u32 tx_coalesce_usecs; | 198 | __u32 tx_coalesce_usecs; |
| 151 | |||
| 152 | /* How many packets to delay a TX interrupt after | ||
| 153 | * a packet is sent. If 0, only tx_coalesce_usecs is | ||
| 154 | * used. It is illegal to set both usecs and max frames | ||
| 155 | * to zero as this would cause TX interrupts to never be | ||
| 156 | * generated. | ||
| 157 | */ | ||
| 158 | __u32 tx_max_coalesced_frames; | 199 | __u32 tx_max_coalesced_frames; |
| 159 | |||
| 160 | /* Same as above two parameters, except that these values | ||
| 161 | * apply while an IRQ is being serviced by the host. Not | ||
| 162 | * all cards support this feature and the values are ignored | ||
| 163 | * in that case. | ||
| 164 | */ | ||
| 165 | __u32 tx_coalesce_usecs_irq; | 200 | __u32 tx_coalesce_usecs_irq; |
| 166 | __u32 tx_max_coalesced_frames_irq; | 201 | __u32 tx_max_coalesced_frames_irq; |
| 167 | |||
| 168 | /* How many usecs to delay in-memory statistics | ||
| 169 | * block updates. Some drivers do not have an in-memory | ||
| 170 | * statistic block, and in such cases this value is ignored. | ||
| 171 | * This value must not be zero. | ||
| 172 | */ | ||
| 173 | __u32 stats_block_coalesce_usecs; | 202 | __u32 stats_block_coalesce_usecs; |
| 174 | |||
| 175 | /* Adaptive RX/TX coalescing is an algorithm implemented by | ||
| 176 | * some drivers to improve latency under low packet rates and | ||
| 177 | * improve throughput under high packet rates. Some drivers | ||
| 178 | * only implement one of RX or TX adaptive coalescing. Anything | ||
| 179 | * not implemented by the driver causes these values to be | ||
| 180 | * silently ignored. | ||
| 181 | */ | ||
| 182 | __u32 use_adaptive_rx_coalesce; | 203 | __u32 use_adaptive_rx_coalesce; |
| 183 | __u32 use_adaptive_tx_coalesce; | 204 | __u32 use_adaptive_tx_coalesce; |
| 184 | |||
| 185 | /* When the packet rate (measured in packets per second) | ||
| 186 | * is below pkt_rate_low, the {rx,tx}_*_low parameters are | ||
| 187 | * used. | ||
| 188 | */ | ||
| 189 | __u32 pkt_rate_low; | 205 | __u32 pkt_rate_low; |
| 190 | __u32 rx_coalesce_usecs_low; | 206 | __u32 rx_coalesce_usecs_low; |
| 191 | __u32 rx_max_coalesced_frames_low; | 207 | __u32 rx_max_coalesced_frames_low; |
| 192 | __u32 tx_coalesce_usecs_low; | 208 | __u32 tx_coalesce_usecs_low; |
| 193 | __u32 tx_max_coalesced_frames_low; | 209 | __u32 tx_max_coalesced_frames_low; |
| 194 | |||
| 195 | /* When the packet rate is below pkt_rate_high but above | ||
| 196 | * pkt_rate_low (both measured in packets per second) the | ||
| 197 | * normal {rx,tx}_* coalescing parameters are used. | ||
| 198 | */ | ||
| 199 | |||
| 200 | /* When the packet rate is (measured in packets per second) | ||
| 201 | * is above pkt_rate_high, the {rx,tx}_*_high parameters are | ||
| 202 | * used. | ||
| 203 | */ | ||
| 204 | __u32 pkt_rate_high; | 210 | __u32 pkt_rate_high; |
| 205 | __u32 rx_coalesce_usecs_high; | 211 | __u32 rx_coalesce_usecs_high; |
| 206 | __u32 rx_max_coalesced_frames_high; | 212 | __u32 rx_max_coalesced_frames_high; |
| 207 | __u32 tx_coalesce_usecs_high; | 213 | __u32 tx_coalesce_usecs_high; |
| 208 | __u32 tx_max_coalesced_frames_high; | 214 | __u32 tx_max_coalesced_frames_high; |
| 209 | |||
| 210 | /* How often to do adaptive coalescing packet rate sampling, | ||
| 211 | * measured in seconds. Must not be zero. | ||
| 212 | */ | ||
| 213 | __u32 rate_sample_interval; | 215 | __u32 rate_sample_interval; |
| 214 | }; | 216 | }; |
| 215 | 217 | ||
| @@ -444,7 +446,7 @@ struct ethtool_flow_ext { | |||
| 444 | }; | 446 | }; |
| 445 | 447 | ||
| 446 | /** | 448 | /** |
| 447 | * struct ethtool_rx_flow_spec - specification for RX flow filter | 449 | * struct ethtool_rx_flow_spec - classification rule for RX flows |
| 448 | * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW | 450 | * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW |
| 449 | * @h_u: Flow fields to match (dependent on @flow_type) | 451 | * @h_u: Flow fields to match (dependent on @flow_type) |
| 450 | * @h_ext: Additional fields to match | 452 | * @h_ext: Additional fields to match |
| @@ -454,7 +456,9 @@ struct ethtool_flow_ext { | |||
| 454 | * includes the %FLOW_EXT flag. | 456 | * includes the %FLOW_EXT flag. |
| 455 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC | 457 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC |
| 456 | * if packets should be discarded | 458 | * if packets should be discarded |
| 457 | * @location: Index of filter in hardware table | 459 | * @location: Location of rule in the table. Locations must be |
| 460 | * numbered such that a flow matching multiple rules will be | ||
| 461 | * classified according to the first (lowest numbered) rule. | ||
| 458 | */ | 462 | */ |
| 459 | struct ethtool_rx_flow_spec { | 463 | struct ethtool_rx_flow_spec { |
| 460 | __u32 flow_type; | 464 | __u32 flow_type; |
| @@ -473,9 +477,9 @@ struct ethtool_rx_flow_spec { | |||
| 473 | * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS | 477 | * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS |
| 474 | * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW | 478 | * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW |
| 475 | * @data: Command-dependent value | 479 | * @data: Command-dependent value |
| 476 | * @fs: Flow filter specification | 480 | * @fs: Flow classification rule |
| 477 | * @rule_cnt: Number of rules to be affected | 481 | * @rule_cnt: Number of rules to be affected |
| 478 | * @rule_locs: Array of valid rule indices | 482 | * @rule_locs: Array of used rule locations |
| 479 | * | 483 | * |
| 480 | * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating | 484 | * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating |
| 481 | * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following | 485 | * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following |
| @@ -487,23 +491,20 @@ struct ethtool_rx_flow_spec { | |||
| 487 | * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined | 491 | * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined |
| 488 | * rules on return. | 492 | * rules on return. |
| 489 | * | 493 | * |
| 490 | * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an | 494 | * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an |
| 491 | * existing filter rule on entry and @fs contains the rule on return. | 495 | * existing rule on entry and @fs contains the rule on return. |
| 492 | * | 496 | * |
| 493 | * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the | 497 | * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the |
| 494 | * user buffer for @rule_locs on entry. On return, @data is the size | 498 | * user buffer for @rule_locs on entry. On return, @data is the size |
| 495 | * of the filter table and @rule_locs contains the indices of the | 499 | * of the rule table, @rule_cnt is the number of defined rules, and |
| 496 | * defined rules. | 500 | * @rule_locs contains the locations of the defined rules. Drivers |
| 501 | * must use the second parameter to get_rxnfc() instead of @rule_locs. | ||
| 497 | * | 502 | * |
| 498 | * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or | 503 | * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update. |
| 499 | * update. @fs.@location specifies the index to use and must not be | 504 | * @fs.@location specifies the location to use and must not be ignored. |
| 500 | * ignored. | ||
| 501 | * | 505 | * |
| 502 | * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an | 506 | * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an |
| 503 | * existing filter rule on entry. | 507 | * existing rule on entry. |
| 504 | * | ||
| 505 | * Implementation of indexed classification rules generally requires a | ||
| 506 | * TCAM. | ||
| 507 | */ | 508 | */ |
| 508 | struct ethtool_rxnfc { | 509 | struct ethtool_rxnfc { |
| 509 | __u32 cmd; | 510 | __u32 cmd; |
| @@ -726,6 +727,9 @@ enum ethtool_sfeatures_retval_bits { | |||
| 726 | /* needed by dev_disable_lro() */ | 727 | /* needed by dev_disable_lro() */ |
| 727 | extern int __ethtool_set_flags(struct net_device *dev, u32 flags); | 728 | extern int __ethtool_set_flags(struct net_device *dev, u32 flags); |
| 728 | 729 | ||
| 730 | extern int __ethtool_get_settings(struct net_device *dev, | ||
| 731 | struct ethtool_cmd *cmd); | ||
| 732 | |||
| 729 | /** | 733 | /** |
| 730 | * enum ethtool_phys_id_state - indicator state for physical identification | 734 | * enum ethtool_phys_id_state - indicator state for physical identification |
| 731 | * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated | 735 | * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated |
| @@ -936,7 +940,7 @@ struct ethtool_ops { | |||
| 936 | int (*set_priv_flags)(struct net_device *, u32); | 940 | int (*set_priv_flags)(struct net_device *, u32); |
| 937 | int (*get_sset_count)(struct net_device *, int); | 941 | int (*get_sset_count)(struct net_device *, int); |
| 938 | int (*get_rxnfc)(struct net_device *, | 942 | int (*get_rxnfc)(struct net_device *, |
| 939 | struct ethtool_rxnfc *, void *); | 943 | struct ethtool_rxnfc *, u32 *rule_locs); |
| 940 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 944 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
| 941 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 945 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
| 942 | int (*reset)(struct net_device *, u32 *); | 946 | int (*reset)(struct net_device *, u32 *); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 741956fa5bfd..8eeb205f298b 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -155,7 +155,7 @@ extern unsigned int sk_run_filter(const struct sk_buff *skb, | |||
| 155 | const struct sock_filter *filter); | 155 | const struct sock_filter *filter); |
| 156 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 156 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
| 157 | extern int sk_detach_filter(struct sock *sk); | 157 | extern int sk_detach_filter(struct sock *sk); |
| 158 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | 158 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); |
| 159 | 159 | ||
| 160 | #ifdef CONFIG_BPF_JIT | 160 | #ifdef CONFIG_BPF_JIT |
| 161 | extern void bpf_jit_compile(struct sk_filter *fp); | 161 | extern void bpf_jit_compile(struct sk_filter *fp); |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 54c878960872..48363c3c40f8 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -130,6 +130,8 @@ | |||
| 130 | #define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060 | 130 | #define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060 |
| 131 | /* A-MSDU 802.11n */ | 131 | /* A-MSDU 802.11n */ |
| 132 | #define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080 | 132 | #define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080 |
| 133 | /* Mesh Control 802.11s */ | ||
| 134 | #define IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT 0x0100 | ||
| 133 | 135 | ||
| 134 | /* U-APSD queue for WMM IEs sent by AP */ | 136 | /* U-APSD queue for WMM IEs sent by AP */ |
| 135 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | 137 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) |
| @@ -629,9 +631,14 @@ struct ieee80211_rann_ie { | |||
| 629 | u8 rann_ttl; | 631 | u8 rann_ttl; |
| 630 | u8 rann_addr[6]; | 632 | u8 rann_addr[6]; |
| 631 | u32 rann_seq; | 633 | u32 rann_seq; |
| 634 | u32 rann_interval; | ||
| 632 | u32 rann_metric; | 635 | u32 rann_metric; |
| 633 | } __attribute__ ((packed)); | 636 | } __attribute__ ((packed)); |
| 634 | 637 | ||
| 638 | enum ieee80211_rann_flags { | ||
| 639 | RANN_FLAG_IS_GATE = 1 << 0, | ||
| 640 | }; | ||
| 641 | |||
| 635 | #define WLAN_SA_QUERY_TR_ID_LEN 2 | 642 | #define WLAN_SA_QUERY_TR_ID_LEN 2 |
| 636 | 643 | ||
| 637 | struct ieee80211_mgmt { | 644 | struct ieee80211_mgmt { |
| @@ -736,19 +743,10 @@ struct ieee80211_mgmt { | |||
| 736 | __le16 params; | 743 | __le16 params; |
| 737 | __le16 reason_code; | 744 | __le16 reason_code; |
| 738 | } __attribute__((packed)) delba; | 745 | } __attribute__((packed)) delba; |
| 739 | struct{ | 746 | struct { |
| 740 | u8 action_code; | 747 | u8 action_code; |
| 741 | /* capab_info for open and confirm, | ||
| 742 | * reason for close | ||
| 743 | */ | ||
| 744 | __le16 aux; | ||
| 745 | /* Followed in plink_confirm by status | ||
| 746 | * code, AID and supported rates, | ||
| 747 | * and directly by supported rates in | ||
| 748 | * plink_open and plink_close | ||
| 749 | */ | ||
| 750 | u8 variable[0]; | 748 | u8 variable[0]; |
| 751 | } __attribute__((packed)) plink_action; | 749 | } __attribute__((packed)) self_prot; |
| 752 | struct{ | 750 | struct{ |
| 753 | u8 action_code; | 751 | u8 action_code; |
| 754 | u8 variable[0]; | 752 | u8 variable[0]; |
| @@ -761,6 +759,12 @@ struct ieee80211_mgmt { | |||
| 761 | u8 action; | 759 | u8 action; |
| 762 | u8 smps_control; | 760 | u8 smps_control; |
| 763 | } __attribute__ ((packed)) ht_smps; | 761 | } __attribute__ ((packed)) ht_smps; |
| 762 | struct { | ||
| 763 | u8 action_code; | ||
| 764 | u8 dialog_token; | ||
| 765 | __le16 capability; | ||
| 766 | u8 variable[0]; | ||
| 767 | } __packed tdls_discover_resp; | ||
| 764 | } u; | 768 | } u; |
| 765 | } __attribute__ ((packed)) action; | 769 | } __attribute__ ((packed)) action; |
| 766 | } u; | 770 | } u; |
| @@ -779,6 +783,13 @@ struct ieee80211_mmie { | |||
| 779 | u8 mic[8]; | 783 | u8 mic[8]; |
| 780 | } __attribute__ ((packed)); | 784 | } __attribute__ ((packed)); |
| 781 | 785 | ||
| 786 | struct ieee80211_vendor_ie { | ||
| 787 | u8 element_id; | ||
| 788 | u8 len; | ||
| 789 | u8 oui[3]; | ||
| 790 | u8 oui_type; | ||
| 791 | } __packed; | ||
| 792 | |||
| 782 | /* Control frames */ | 793 | /* Control frames */ |
| 783 | struct ieee80211_rts { | 794 | struct ieee80211_rts { |
| 784 | __le16 frame_control; | 795 | __le16 frame_control; |
| @@ -800,6 +811,52 @@ struct ieee80211_pspoll { | |||
| 800 | u8 ta[6]; | 811 | u8 ta[6]; |
| 801 | } __attribute__ ((packed)); | 812 | } __attribute__ ((packed)); |
| 802 | 813 | ||
| 814 | /* TDLS */ | ||
| 815 | |||
| 816 | /* Link-id information element */ | ||
| 817 | struct ieee80211_tdls_lnkie { | ||
| 818 | u8 ie_type; /* Link Identifier IE */ | ||
| 819 | u8 ie_len; | ||
| 820 | u8 bssid[6]; | ||
| 821 | u8 init_sta[6]; | ||
| 822 | u8 resp_sta[6]; | ||
| 823 | } __packed; | ||
| 824 | |||
| 825 | struct ieee80211_tdls_data { | ||
| 826 | u8 da[6]; | ||
| 827 | u8 sa[6]; | ||
| 828 | __be16 ether_type; | ||
| 829 | u8 payload_type; | ||
| 830 | u8 category; | ||
| 831 | u8 action_code; | ||
| 832 | union { | ||
| 833 | struct { | ||
| 834 | u8 dialog_token; | ||
| 835 | __le16 capability; | ||
| 836 | u8 variable[0]; | ||
| 837 | } __packed setup_req; | ||
| 838 | struct { | ||
| 839 | __le16 status_code; | ||
| 840 | u8 dialog_token; | ||
| 841 | __le16 capability; | ||
| 842 | u8 variable[0]; | ||
| 843 | } __packed setup_resp; | ||
| 844 | struct { | ||
| 845 | __le16 status_code; | ||
| 846 | u8 dialog_token; | ||
| 847 | u8 variable[0]; | ||
| 848 | } __packed setup_cfm; | ||
| 849 | struct { | ||
| 850 | __le16 reason_code; | ||
| 851 | u8 variable[0]; | ||
| 852 | } __packed teardown; | ||
| 853 | struct { | ||
| 854 | u8 dialog_token; | ||
| 855 | u8 variable[0]; | ||
| 856 | } __packed discover_req; | ||
| 857 | } u; | ||
| 858 | } __packed; | ||
| 859 | |||
| 803 | /** | 860 | /** |
| 804 | * struct ieee80211_bar - HT Block Ack Request | 861 | * struct ieee80211_bar - HT Block Ack Request |
| 805 | * | 862 | * |
| @@ -816,9 +873,11 @@ struct ieee80211_bar { | |||
| 816 | } __attribute__((packed)); | 873 | } __attribute__((packed)); |
| 817 | 874 | ||
| 818 | /* 802.11 BAR control masks */ | 875 | /* 802.11 BAR control masks */ |
| 819 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 | 876 | #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000 |
| 820 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 | 877 | #define IEEE80211_BAR_CTRL_MULTI_TID 0x0002 |
| 821 | 878 | #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004 | |
| 879 | #define IEEE80211_BAR_CTRL_TID_INFO_MASK 0xf000 | ||
| 880 | #define IEEE80211_BAR_CTRL_TID_INFO_SHIFT 12 | ||
| 822 | 881 | ||
| 823 | #define IEEE80211_HT_MCS_MASK_LEN 10 | 882 | #define IEEE80211_HT_MCS_MASK_LEN 10 |
| 824 | 883 | ||
| @@ -1189,16 +1248,13 @@ enum ieee80211_eid { | |||
| 1189 | WLAN_EID_TS_DELAY = 43, | 1248 | WLAN_EID_TS_DELAY = 43, |
| 1190 | WLAN_EID_TCLAS_PROCESSING = 44, | 1249 | WLAN_EID_TCLAS_PROCESSING = 44, |
| 1191 | WLAN_EID_QOS_CAPA = 46, | 1250 | WLAN_EID_QOS_CAPA = 46, |
| 1251 | /* 802.11z */ | ||
| 1252 | WLAN_EID_LINK_ID = 101, | ||
| 1192 | /* 802.11s */ | 1253 | /* 802.11s */ |
| 1193 | WLAN_EID_MESH_CONFIG = 113, | 1254 | WLAN_EID_MESH_CONFIG = 113, |
| 1194 | WLAN_EID_MESH_ID = 114, | 1255 | WLAN_EID_MESH_ID = 114, |
| 1195 | WLAN_EID_LINK_METRIC_REPORT = 115, | 1256 | WLAN_EID_LINK_METRIC_REPORT = 115, |
| 1196 | WLAN_EID_CONGESTION_NOTIFICATION = 116, | 1257 | WLAN_EID_CONGESTION_NOTIFICATION = 116, |
| 1197 | /* Note that the Peer Link IE has been replaced with the similar | ||
| 1198 | * Peer Management IE. We will keep the former definition until mesh | ||
| 1199 | * code is changed to comply with latest 802.11s drafts. | ||
| 1200 | */ | ||
| 1201 | WLAN_EID_PEER_LINK = 55, /* no longer in 802.11s drafts */ | ||
| 1202 | WLAN_EID_PEER_MGMT = 117, | 1258 | WLAN_EID_PEER_MGMT = 117, |
| 1203 | WLAN_EID_CHAN_SWITCH_PARAM = 118, | 1259 | WLAN_EID_CHAN_SWITCH_PARAM = 118, |
| 1204 | WLAN_EID_MESH_AWAKE_WINDOW = 119, | 1260 | WLAN_EID_MESH_AWAKE_WINDOW = 119, |
| @@ -1277,13 +1333,11 @@ enum ieee80211_category { | |||
| 1277 | WLAN_CATEGORY_HT = 7, | 1333 | WLAN_CATEGORY_HT = 7, |
| 1278 | WLAN_CATEGORY_SA_QUERY = 8, | 1334 | WLAN_CATEGORY_SA_QUERY = 8, |
| 1279 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, | 1335 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, |
| 1336 | WLAN_CATEGORY_TDLS = 12, | ||
| 1280 | WLAN_CATEGORY_MESH_ACTION = 13, | 1337 | WLAN_CATEGORY_MESH_ACTION = 13, |
| 1281 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, | 1338 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, |
| 1282 | WLAN_CATEGORY_SELF_PROTECTED = 15, | 1339 | WLAN_CATEGORY_SELF_PROTECTED = 15, |
| 1283 | WLAN_CATEGORY_WMM = 17, | 1340 | WLAN_CATEGORY_WMM = 17, |
| 1284 | /* TODO: remove MESH_PATH_SEL after mesh is updated | ||
| 1285 | * to current 802.11s draft */ | ||
| 1286 | WLAN_CATEGORY_MESH_PATH_SEL = 32, | ||
| 1287 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | 1341 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, |
| 1288 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | 1342 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, |
| 1289 | }; | 1343 | }; |
| @@ -1309,6 +1363,31 @@ enum ieee80211_ht_actioncode { | |||
| 1309 | WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, | 1363 | WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, |
| 1310 | }; | 1364 | }; |
| 1311 | 1365 | ||
| 1366 | /* Self Protected Action codes */ | ||
| 1367 | enum ieee80211_self_protected_actioncode { | ||
| 1368 | WLAN_SP_RESERVED = 0, | ||
| 1369 | WLAN_SP_MESH_PEERING_OPEN = 1, | ||
| 1370 | WLAN_SP_MESH_PEERING_CONFIRM = 2, | ||
| 1371 | WLAN_SP_MESH_PEERING_CLOSE = 3, | ||
| 1372 | WLAN_SP_MGK_INFORM = 4, | ||
| 1373 | WLAN_SP_MGK_ACK = 5, | ||
| 1374 | }; | ||
| 1375 | |||
| 1376 | /* Mesh action codes */ | ||
| 1377 | enum ieee80211_mesh_actioncode { | ||
| 1378 | WLAN_MESH_ACTION_LINK_METRIC_REPORT, | ||
| 1379 | WLAN_MESH_ACTION_HWMP_PATH_SELECTION, | ||
| 1380 | WLAN_MESH_ACTION_GATE_ANNOUNCEMENT, | ||
| 1381 | WLAN_MESH_ACTION_CONGESTION_CONTROL_NOTIFICATION, | ||
| 1382 | WLAN_MESH_ACTION_MCCA_SETUP_REQUEST, | ||
| 1383 | WLAN_MESH_ACTION_MCCA_SETUP_REPLY, | ||
| 1384 | WLAN_MESH_ACTION_MCCA_ADVERTISEMENT_REQUEST, | ||
| 1385 | WLAN_MESH_ACTION_MCCA_ADVERTISEMENT, | ||
| 1386 | WLAN_MESH_ACTION_MCCA_TEARDOWN, | ||
| 1387 | WLAN_MESH_ACTION_TBTT_ADJUSTMENT_REQUEST, | ||
| 1388 | WLAN_MESH_ACTION_TBTT_ADJUSTMENT_RESPONSE, | ||
| 1389 | }; | ||
| 1390 | |||
| 1312 | /* Security key length */ | 1391 | /* Security key length */ |
| 1313 | enum ieee80211_key_len { | 1392 | enum ieee80211_key_len { |
| 1314 | WLAN_KEY_LEN_WEP40 = 5, | 1393 | WLAN_KEY_LEN_WEP40 = 5, |
| @@ -1318,6 +1397,36 @@ enum ieee80211_key_len { | |||
| 1318 | WLAN_KEY_LEN_AES_CMAC = 16, | 1397 | WLAN_KEY_LEN_AES_CMAC = 16, |
| 1319 | }; | 1398 | }; |
| 1320 | 1399 | ||
| 1400 | /* Public action codes */ | ||
| 1401 | enum ieee80211_pub_actioncode { | ||
| 1402 | WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14, | ||
| 1403 | }; | ||
| 1404 | |||
| 1405 | /* TDLS action codes */ | ||
| 1406 | enum ieee80211_tdls_actioncode { | ||
| 1407 | WLAN_TDLS_SETUP_REQUEST = 0, | ||
| 1408 | WLAN_TDLS_SETUP_RESPONSE = 1, | ||
| 1409 | WLAN_TDLS_SETUP_CONFIRM = 2, | ||
| 1410 | WLAN_TDLS_TEARDOWN = 3, | ||
| 1411 | WLAN_TDLS_PEER_TRAFFIC_INDICATION = 4, | ||
| 1412 | WLAN_TDLS_CHANNEL_SWITCH_REQUEST = 5, | ||
| 1413 | WLAN_TDLS_CHANNEL_SWITCH_RESPONSE = 6, | ||
| 1414 | WLAN_TDLS_PEER_PSM_REQUEST = 7, | ||
| 1415 | WLAN_TDLS_PEER_PSM_RESPONSE = 8, | ||
| 1416 | WLAN_TDLS_PEER_TRAFFIC_RESPONSE = 9, | ||
| 1417 | WLAN_TDLS_DISCOVERY_REQUEST = 10, | ||
| 1418 | }; | ||
| 1419 | |||
| 1420 | /* | ||
| 1421 | * TDLS capabililites to be enabled in the 5th byte of the | ||
| 1422 | * @WLAN_EID_EXT_CAPABILITY information element | ||
| 1423 | */ | ||
| 1424 | #define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5) | ||
| 1425 | #define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6) | ||
| 1426 | |||
| 1427 | /* TDLS specific payload type in the LLC/SNAP header */ | ||
| 1428 | #define WLAN_TDLS_SNAP_RFTYPE 0x2 | ||
| 1429 | |||
| 1321 | /** | 1430 | /** |
| 1322 | * enum - mesh path selection protocol identifier | 1431 | * enum - mesh path selection protocol identifier |
| 1323 | * | 1432 | * |
| @@ -1453,6 +1562,9 @@ enum ieee80211_sa_query_action { | |||
| 1453 | 1562 | ||
| 1454 | #define WLAN_PMKID_LEN 16 | 1563 | #define WLAN_PMKID_LEN 16 |
| 1455 | 1564 | ||
| 1565 | #define WLAN_OUI_WFA 0x506f9a | ||
| 1566 | #define WLAN_OUI_TYPE_WFA_P2P 9 | ||
| 1567 | |||
| 1456 | /* | 1568 | /* |
| 1457 | * WMM/802.11e Tspec Element | 1569 | * WMM/802.11e Tspec Element |
| 1458 | */ | 1570 | */ |
diff --git a/include/linux/if.h b/include/linux/if.h index 03489ca92ded..db20bd4fd16b 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
| @@ -78,6 +78,7 @@ | |||
| 78 | * datapath port */ | 78 | * datapath port */ |
| 79 | #define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing | 79 | #define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing |
| 80 | * skbs on transmit */ | 80 | * skbs on transmit */ |
| 81 | #define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */ | ||
| 81 | 82 | ||
| 82 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 83 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
| 83 | #define IF_GET_PROTO 0x0002 | 84 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index a3d99ff6e3b5..e473003e4bda 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
| @@ -83,11 +83,13 @@ | |||
| 83 | #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ | 83 | #define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ |
| 84 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ | 84 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ |
| 85 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ | 85 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ |
| 86 | #define ETH_P_TDLS 0x890D /* TDLS */ | ||
| 86 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ | 87 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ |
| 87 | #define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ | 88 | #define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ |
| 88 | #define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ | 89 | #define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ |
| 89 | #define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ | 90 | #define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ |
| 90 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | 91 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ |
| 92 | #define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
| 91 | 93 | ||
| 92 | /* | 94 | /* |
| 93 | * Non DIX types. Won't clash for 1500 types. | 95 | * Non DIX types. Won't clash for 1500 types. |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 0ee969a5593d..c52d4b5f872a 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
| @@ -279,6 +279,7 @@ enum { | |||
| 279 | IFLA_VF_MAC, /* Hardware queue specific attributes */ | 279 | IFLA_VF_MAC, /* Hardware queue specific attributes */ |
| 280 | IFLA_VF_VLAN, | 280 | IFLA_VF_VLAN, |
| 281 | IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ | 281 | IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ |
| 282 | IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */ | ||
| 282 | __IFLA_VF_MAX, | 283 | __IFLA_VF_MAX, |
| 283 | }; | 284 | }; |
| 284 | 285 | ||
| @@ -300,13 +301,22 @@ struct ifla_vf_tx_rate { | |||
| 300 | __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ | 301 | __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ |
| 301 | }; | 302 | }; |
| 302 | 303 | ||
| 304 | struct ifla_vf_spoofchk { | ||
| 305 | __u32 vf; | ||
| 306 | __u32 setting; | ||
| 307 | }; | ||
| 308 | #ifdef __KERNEL__ | ||
| 309 | |||
| 310 | /* We don't want this structure exposed to user space */ | ||
| 303 | struct ifla_vf_info { | 311 | struct ifla_vf_info { |
| 304 | __u32 vf; | 312 | __u32 vf; |
| 305 | __u8 mac[32]; | 313 | __u8 mac[32]; |
| 306 | __u32 vlan; | 314 | __u32 vlan; |
| 307 | __u32 qos; | 315 | __u32 qos; |
| 308 | __u32 tx_rate; | 316 | __u32 tx_rate; |
| 317 | __u32 spoofchk; | ||
| 309 | }; | 318 | }; |
| 319 | #endif | ||
| 310 | 320 | ||
| 311 | /* VF ports management section | 321 | /* VF ports management section |
| 312 | * | 322 | * |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index e28b2e4959d4..d103dca5c563 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -64,6 +64,7 @@ struct macvlan_dev { | |||
| 64 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | 64 | int (*forward)(struct net_device *dev, struct sk_buff *skb); |
| 65 | struct macvtap_queue *taps[MAX_MACVTAP_QUEUES]; | 65 | struct macvtap_queue *taps[MAX_MACVTAP_QUEUES]; |
| 66 | int numvtaps; | 66 | int numvtaps; |
| 67 | int minor; | ||
| 67 | }; | 68 | }; |
| 68 | 69 | ||
| 69 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | 70 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index c1486060f5ed..f3799295d231 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
| @@ -61,6 +61,17 @@ struct tpacket_stats { | |||
| 61 | unsigned int tp_drops; | 61 | unsigned int tp_drops; |
| 62 | }; | 62 | }; |
| 63 | 63 | ||
| 64 | struct tpacket_stats_v3 { | ||
| 65 | unsigned int tp_packets; | ||
| 66 | unsigned int tp_drops; | ||
| 67 | unsigned int tp_freeze_q_cnt; | ||
| 68 | }; | ||
| 69 | |||
| 70 | union tpacket_stats_u { | ||
| 71 | struct tpacket_stats stats1; | ||
| 72 | struct tpacket_stats_v3 stats3; | ||
| 73 | }; | ||
| 74 | |||
| 64 | struct tpacket_auxdata { | 75 | struct tpacket_auxdata { |
| 65 | __u32 tp_status; | 76 | __u32 tp_status; |
| 66 | __u32 tp_len; | 77 | __u32 tp_len; |
| @@ -78,6 +89,7 @@ struct tpacket_auxdata { | |||
| 78 | #define TP_STATUS_LOSING 0x4 | 89 | #define TP_STATUS_LOSING 0x4 |
| 79 | #define TP_STATUS_CSUMNOTREADY 0x8 | 90 | #define TP_STATUS_CSUMNOTREADY 0x8 |
| 80 | #define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */ | 91 | #define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */ |
| 92 | #define TP_STATUS_BLK_TMO 0x20 | ||
| 81 | 93 | ||
| 82 | /* Tx ring - header status */ | 94 | /* Tx ring - header status */ |
| 83 | #define TP_STATUS_AVAILABLE 0x0 | 95 | #define TP_STATUS_AVAILABLE 0x0 |
| @@ -85,6 +97,9 @@ struct tpacket_auxdata { | |||
| 85 | #define TP_STATUS_SENDING 0x2 | 97 | #define TP_STATUS_SENDING 0x2 |
| 86 | #define TP_STATUS_WRONG_FORMAT 0x4 | 98 | #define TP_STATUS_WRONG_FORMAT 0x4 |
| 87 | 99 | ||
| 100 | /* Rx ring - feature request bits */ | ||
| 101 | #define TP_FT_REQ_FILL_RXHASH 0x1 | ||
| 102 | |||
| 88 | struct tpacket_hdr { | 103 | struct tpacket_hdr { |
| 89 | unsigned long tp_status; | 104 | unsigned long tp_status; |
| 90 | unsigned int tp_len; | 105 | unsigned int tp_len; |
| @@ -111,11 +126,100 @@ struct tpacket2_hdr { | |||
| 111 | __u16 tp_padding; | 126 | __u16 tp_padding; |
| 112 | }; | 127 | }; |
| 113 | 128 | ||
| 129 | struct tpacket_hdr_variant1 { | ||
| 130 | __u32 tp_rxhash; | ||
| 131 | __u32 tp_vlan_tci; | ||
| 132 | }; | ||
| 133 | |||
| 134 | struct tpacket3_hdr { | ||
| 135 | __u32 tp_next_offset; | ||
| 136 | __u32 tp_sec; | ||
| 137 | __u32 tp_nsec; | ||
| 138 | __u32 tp_snaplen; | ||
| 139 | __u32 tp_len; | ||
| 140 | __u32 tp_status; | ||
| 141 | __u16 tp_mac; | ||
| 142 | __u16 tp_net; | ||
| 143 | /* pkt_hdr variants */ | ||
| 144 | union { | ||
| 145 | struct tpacket_hdr_variant1 hv1; | ||
| 146 | }; | ||
| 147 | }; | ||
| 148 | |||
| 149 | struct tpacket_bd_ts { | ||
| 150 | unsigned int ts_sec; | ||
| 151 | union { | ||
| 152 | unsigned int ts_usec; | ||
| 153 | unsigned int ts_nsec; | ||
| 154 | }; | ||
| 155 | }; | ||
| 156 | |||
| 157 | struct tpacket_hdr_v1 { | ||
| 158 | __u32 block_status; | ||
| 159 | __u32 num_pkts; | ||
| 160 | __u32 offset_to_first_pkt; | ||
| 161 | |||
| 162 | /* Number of valid bytes (including padding) | ||
| 163 | * blk_len <= tp_block_size | ||
| 164 | */ | ||
| 165 | __u32 blk_len; | ||
| 166 | |||
| 167 | /* | ||
| 168 | * Quite a few uses of sequence number: | ||
| 169 | * 1. Make sure cache flush etc worked. | ||
| 170 | * Well, one can argue - why not use the increasing ts below? | ||
| 171 | * But look at 2. below first. | ||
| 172 | * 2. When you pass around blocks to other user space decoders, | ||
| 173 | * you can see which blk[s] is[are] outstanding etc. | ||
| 174 | * 3. Validate kernel code. | ||
| 175 | */ | ||
| 176 | __aligned_u64 seq_num; | ||
| 177 | |||
| 178 | /* | ||
| 179 | * ts_last_pkt: | ||
| 180 | * | ||
| 181 | * Case 1. Block has 'N'(N >=1) packets and TMO'd(timed out) | ||
| 182 | * ts_last_pkt == 'time-stamp of last packet' and NOT the | ||
| 183 | * time when the timer fired and the block was closed. | ||
| 184 | * By providing the ts of the last packet we can absolutely | ||
| 185 | * guarantee that time-stamp wise, the first packet in the | ||
| 186 | * next block will never precede the last packet of the | ||
| 187 | * previous block. | ||
| 188 | * Case 2. Block has zero packets and TMO'd | ||
| 189 | * ts_last_pkt = time when the timer fired and the block | ||
| 190 | * was closed. | ||
| 191 | * Case 3. Block has 'N' packets and NO TMO. | ||
| 192 | * ts_last_pkt = time-stamp of the last pkt in the block. | ||
| 193 | * | ||
| 194 | * ts_first_pkt: | ||
| 195 | * Is always the time-stamp when the block was opened. | ||
| 196 | * Case a) ZERO packets | ||
| 197 | * No packets to deal with but atleast you know the | ||
| 198 | * time-interval of this block. | ||
| 199 | * Case b) Non-zero packets | ||
| 200 | * Use the ts of the first packet in the block. | ||
| 201 | * | ||
| 202 | */ | ||
| 203 | struct tpacket_bd_ts ts_first_pkt, ts_last_pkt; | ||
| 204 | }; | ||
| 205 | |||
| 206 | union tpacket_bd_header_u { | ||
| 207 | struct tpacket_hdr_v1 bh1; | ||
| 208 | }; | ||
| 209 | |||
| 210 | struct tpacket_block_desc { | ||
| 211 | __u32 version; | ||
| 212 | __u32 offset_to_priv; | ||
| 213 | union tpacket_bd_header_u hdr; | ||
| 214 | }; | ||
| 215 | |||
| 114 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) | 216 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) |
| 217 | #define TPACKET3_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket3_hdr)) + sizeof(struct sockaddr_ll)) | ||
| 115 | 218 | ||
| 116 | enum tpacket_versions { | 219 | enum tpacket_versions { |
| 117 | TPACKET_V1, | 220 | TPACKET_V1, |
| 118 | TPACKET_V2, | 221 | TPACKET_V2, |
| 222 | TPACKET_V3 | ||
| 119 | }; | 223 | }; |
| 120 | 224 | ||
| 121 | /* | 225 | /* |
| @@ -138,6 +242,21 @@ struct tpacket_req { | |||
| 138 | unsigned int tp_frame_nr; /* Total number of frames */ | 242 | unsigned int tp_frame_nr; /* Total number of frames */ |
| 139 | }; | 243 | }; |
| 140 | 244 | ||
| 245 | struct tpacket_req3 { | ||
| 246 | unsigned int tp_block_size; /* Minimal size of contiguous block */ | ||
| 247 | unsigned int tp_block_nr; /* Number of blocks */ | ||
| 248 | unsigned int tp_frame_size; /* Size of frame */ | ||
| 249 | unsigned int tp_frame_nr; /* Total number of frames */ | ||
| 250 | unsigned int tp_retire_blk_tov; /* timeout in msecs */ | ||
| 251 | unsigned int tp_sizeof_priv; /* offset to private data area */ | ||
| 252 | unsigned int tp_feature_req_word; | ||
| 253 | }; | ||
| 254 | |||
| 255 | union tpacket_req_u { | ||
| 256 | struct tpacket_req req; | ||
| 257 | struct tpacket_req3 req3; | ||
| 258 | }; | ||
| 259 | |||
| 141 | struct packet_mreq { | 260 | struct packet_mreq { |
| 142 | int mr_ifindex; | 261 | int mr_ifindex; |
| 143 | unsigned short mr_type; | 262 | unsigned short mr_type; |
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h index 184bc5566207..23cefa1111bf 100644 --- a/include/linux/if_pppol2tp.h +++ b/include/linux/if_pppol2tp.h | |||
| @@ -39,7 +39,7 @@ struct pppol2tp_addr { | |||
| 39 | * bits. So we need a different sockaddr structure. | 39 | * bits. So we need a different sockaddr structure. |
| 40 | */ | 40 | */ |
| 41 | struct pppol2tpv3_addr { | 41 | struct pppol2tpv3_addr { |
| 42 | pid_t pid; /* pid that owns the fd. | 42 | __kernel_pid_t pid; /* pid that owns the fd. |
| 43 | * 0 => current */ | 43 | * 0 => current */ |
| 44 | int fd; /* FD of UDP or IP socket to use */ | 44 | int fd; /* FD of UDP or IP socket to use */ |
| 45 | 45 | ||
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 397921b09ef9..b5f927f59f26 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
| @@ -20,8 +20,9 @@ | |||
| 20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
| 21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
| 22 | 22 | ||
| 23 | #ifdef __KERNEL__ | 23 | #include <linux/socket.h> |
| 24 | #include <linux/if_ether.h> | 24 | #include <linux/if_ether.h> |
| 25 | #ifdef __KERNEL__ | ||
| 25 | #include <linux/if.h> | 26 | #include <linux/if.h> |
| 26 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
| 27 | #include <linux/ppp_channel.h> | 28 | #include <linux/ppp_channel.h> |
| @@ -63,7 +64,7 @@ struct pptp_addr { | |||
| 63 | #define PX_MAX_PROTO 3 | 64 | #define PX_MAX_PROTO 3 |
| 64 | 65 | ||
| 65 | struct sockaddr_pppox { | 66 | struct sockaddr_pppox { |
| 66 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 67 | __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 67 | unsigned int sa_protocol; /* protocol identifier */ | 68 | unsigned int sa_protocol; /* protocol identifier */ |
| 68 | union { | 69 | union { |
| 69 | struct pppoe_addr pppoe; | 70 | struct pppoe_addr pppoe; |
| @@ -77,7 +78,7 @@ struct sockaddr_pppox { | |||
| 77 | * type instead. | 78 | * type instead. |
| 78 | */ | 79 | */ |
| 79 | struct sockaddr_pppol2tp { | 80 | struct sockaddr_pppol2tp { |
| 80 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 81 | __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 81 | unsigned int sa_protocol; /* protocol identifier */ | 82 | unsigned int sa_protocol; /* protocol identifier */ |
| 82 | struct pppol2tp_addr pppol2tp; | 83 | struct pppol2tp_addr pppol2tp; |
| 83 | } __attribute__((packed)); | 84 | } __attribute__((packed)); |
| @@ -86,7 +87,7 @@ struct sockaddr_pppol2tp { | |||
| 86 | * bits. So we need a different sockaddr structure. | 87 | * bits. So we need a different sockaddr structure. |
| 87 | */ | 88 | */ |
| 88 | struct sockaddr_pppol2tpv3 { | 89 | struct sockaddr_pppol2tpv3 { |
| 89 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 90 | __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */ |
| 90 | unsigned int sa_protocol; /* protocol identifier */ | 91 | unsigned int sa_protocol; /* protocol identifier */ |
| 91 | struct pppol2tpv3_addr pppol2tp; | 92 | struct pppol2tpv3_addr pppol2tp; |
| 92 | } __attribute__((packed)); | 93 | } __attribute__((packed)); |
diff --git a/include/linux/in.h b/include/linux/in.h index beeb6dee2b49..01129c0ea87c 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
| @@ -182,7 +182,7 @@ struct in_pktinfo { | |||
| 182 | /* Structure describing an Internet (IP) socket address. */ | 182 | /* Structure describing an Internet (IP) socket address. */ |
| 183 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ | 183 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ |
| 184 | struct sockaddr_in { | 184 | struct sockaddr_in { |
| 185 | sa_family_t sin_family; /* Address family */ | 185 | __kernel_sa_family_t sin_family; /* Address family */ |
| 186 | __be16 sin_port; /* Port number */ | 186 | __be16 sin_port; /* Port number */ |
| 187 | struct in_addr sin_addr; /* Internet address */ | 187 | struct in_addr sin_addr; /* Internet address */ |
| 188 | 188 | ||
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h index bc8c49022084..80b480c97532 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h | |||
| @@ -97,9 +97,10 @@ enum { | |||
| 97 | INET_DIAG_INFO, | 97 | INET_DIAG_INFO, |
| 98 | INET_DIAG_VEGASINFO, | 98 | INET_DIAG_VEGASINFO, |
| 99 | INET_DIAG_CONG, | 99 | INET_DIAG_CONG, |
| 100 | INET_DIAG_TOS, | ||
| 100 | }; | 101 | }; |
| 101 | 102 | ||
| 102 | #define INET_DIAG_MAX INET_DIAG_CONG | 103 | #define INET_DIAG_MAX INET_DIAG_TOS |
| 103 | 104 | ||
| 104 | 105 | ||
| 105 | /* INET_DIAG_MEM */ | 106 | /* INET_DIAG_MEM */ |
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h index acb9ad684d63..bf22b0317902 100644 --- a/include/linux/ip6_tunnel.h +++ b/include/linux/ip6_tunnel.h | |||
| @@ -16,6 +16,8 @@ | |||
| 16 | #define IP6_TNL_F_MIP6_DEV 0x8 | 16 | #define IP6_TNL_F_MIP6_DEV 0x8 |
| 17 | /* copy DSCP from the outer packet */ | 17 | /* copy DSCP from the outer packet */ |
| 18 | #define IP6_TNL_F_RCV_DSCP_COPY 0x10 | 18 | #define IP6_TNL_F_RCV_DSCP_COPY 0x10 |
| 19 | /* copy fwmark from inner packet */ | ||
| 20 | #define IP6_TNL_F_USE_ORIG_FWMARK 0x20 | ||
| 19 | 21 | ||
| 20 | struct ip6_tnl_parm { | 22 | struct ip6_tnl_parm { |
| 21 | char name[IFNAMSIZ]; /* name of tunnel device */ | 23 | char name[IFNAMSIZ]; /* name of tunnel device */ |
diff --git a/include/linux/ipx.h b/include/linux/ipx.h index aabb1d294025..3d48014cdd71 100644 --- a/include/linux/ipx.h +++ b/include/linux/ipx.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | #define IPX_MTU 576 | 7 | #define IPX_MTU 576 |
| 8 | 8 | ||
| 9 | struct sockaddr_ipx { | 9 | struct sockaddr_ipx { |
| 10 | sa_family_t sipx_family; | 10 | __kernel_sa_family_t sipx_family; |
| 11 | __be16 sipx_port; | 11 | __be16 sipx_port; |
| 12 | __be32 sipx_network; | 12 | __be32 sipx_network; |
| 13 | unsigned char sipx_node[IPX_NODE_LEN]; | 13 | unsigned char sipx_node[IPX_NODE_LEN]; |
diff --git a/include/linux/irda.h b/include/linux/irda.h index 00bdad0e8515..a014c3252311 100644 --- a/include/linux/irda.h +++ b/include/linux/irda.h | |||
| @@ -26,12 +26,9 @@ | |||
| 26 | #define KERNEL_IRDA_H | 26 | #define KERNEL_IRDA_H |
| 27 | 27 | ||
| 28 | #include <linux/types.h> | 28 | #include <linux/types.h> |
| 29 | #include <linux/socket.h> | ||
| 29 | 30 | ||
| 30 | /* Please do *not* add any #include in this file, this file is | 31 | /* Note that this file is shared with user space. */ |
| 31 | * included as-is in user space. | ||
| 32 | * Please fix the calling file to properly included needed files before | ||
| 33 | * this one, or preferably to include <net/irda/irda.h> instead. | ||
| 34 | * Jean II */ | ||
| 35 | 32 | ||
| 36 | /* Hint bit positions for first hint byte */ | 33 | /* Hint bit positions for first hint byte */ |
| 37 | #define HINT_PNP 0x01 | 34 | #define HINT_PNP 0x01 |
| @@ -125,7 +122,7 @@ enum { | |||
| 125 | #define LSAP_ANY 0xff | 122 | #define LSAP_ANY 0xff |
| 126 | 123 | ||
| 127 | struct sockaddr_irda { | 124 | struct sockaddr_irda { |
| 128 | sa_family_t sir_family; /* AF_IRDA */ | 125 | __kernel_sa_family_t sir_family; /* AF_IRDA */ |
| 129 | __u8 sir_lsap_sel; /* LSAP selector */ | 126 | __u8 sir_lsap_sel; /* LSAP selector */ |
| 130 | __u32 sir_addr; /* Device address */ | 127 | __u32 sir_addr; /* Device address */ |
| 131 | char sir_name[25]; /* Usually <service>:IrDA:TinyTP */ | 128 | char sir_name[25]; /* Usually <service>:IrDA:TinyTP */ |
diff --git a/include/linux/l2tp.h b/include/linux/l2tp.h index 4bdb31df8e72..e77d7f9bb246 100644 --- a/include/linux/l2tp.h +++ b/include/linux/l2tp.h | |||
| @@ -8,8 +8,8 @@ | |||
| 8 | #define _LINUX_L2TP_H_ | 8 | #define _LINUX_L2TP_H_ |
| 9 | 9 | ||
| 10 | #include <linux/types.h> | 10 | #include <linux/types.h> |
| 11 | #ifdef __KERNEL__ | ||
| 12 | #include <linux/socket.h> | 11 | #include <linux/socket.h> |
| 12 | #ifdef __KERNEL__ | ||
| 13 | #include <linux/in.h> | 13 | #include <linux/in.h> |
| 14 | #else | 14 | #else |
| 15 | #include <netinet/in.h> | 15 | #include <netinet/in.h> |
| @@ -26,14 +26,15 @@ | |||
| 26 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ | 26 | #define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ |
| 27 | struct sockaddr_l2tpip { | 27 | struct sockaddr_l2tpip { |
| 28 | /* The first fields must match struct sockaddr_in */ | 28 | /* The first fields must match struct sockaddr_in */ |
| 29 | sa_family_t l2tp_family; /* AF_INET */ | 29 | __kernel_sa_family_t l2tp_family; /* AF_INET */ |
| 30 | __be16 l2tp_unused; /* INET port number (unused) */ | 30 | __be16 l2tp_unused; /* INET port number (unused) */ |
| 31 | struct in_addr l2tp_addr; /* Internet address */ | 31 | struct in_addr l2tp_addr; /* Internet address */ |
| 32 | 32 | ||
| 33 | __u32 l2tp_conn_id; /* Connection ID of tunnel */ | 33 | __u32 l2tp_conn_id; /* Connection ID of tunnel */ |
| 34 | 34 | ||
| 35 | /* Pad to size of `struct sockaddr'. */ | 35 | /* Pad to size of `struct sockaddr'. */ |
| 36 | unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) - | 36 | unsigned char __pad[sizeof(struct sockaddr) - |
| 37 | sizeof(__kernel_sa_family_t) - | ||
| 37 | sizeof(__be16) - sizeof(struct in_addr) - | 38 | sizeof(__be16) - sizeof(struct in_addr) - |
| 38 | sizeof(__u32)]; | 39 | sizeof(__u32)]; |
| 39 | }; | 40 | }; |
diff --git a/include/linux/lapb.h b/include/linux/lapb.h index ce709e1885cc..873c1eb635e4 100644 --- a/include/linux/lapb.h +++ b/include/linux/lapb.h | |||
| @@ -44,7 +44,8 @@ struct lapb_parms_struct { | |||
| 44 | unsigned int mode; | 44 | unsigned int mode; |
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks); | 47 | extern int lapb_register(struct net_device *dev, |
| 48 | const struct lapb_register_struct *callbacks); | ||
| 48 | extern int lapb_unregister(struct net_device *dev); | 49 | extern int lapb_unregister(struct net_device *dev); |
| 49 | extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms); | 50 | extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms); |
| 50 | extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms); | 51 | extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms); |
diff --git a/include/linux/llc.h b/include/linux/llc.h index ad7074ba81af..a2418ae13ee9 100644 --- a/include/linux/llc.h +++ b/include/linux/llc.h | |||
| @@ -12,16 +12,20 @@ | |||
| 12 | * | 12 | * |
| 13 | * See the GNU General Public License for more details. | 13 | * See the GNU General Public License for more details. |
| 14 | */ | 14 | */ |
| 15 | |||
| 16 | #include <linux/socket.h> | ||
| 17 | |||
| 15 | #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */ | 18 | #define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */ |
| 16 | struct sockaddr_llc { | 19 | struct sockaddr_llc { |
| 17 | sa_family_t sllc_family; /* AF_LLC */ | 20 | __kernel_sa_family_t sllc_family; /* AF_LLC */ |
| 18 | sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ | 21 | __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ |
| 19 | unsigned char sllc_test; | 22 | unsigned char sllc_test; |
| 20 | unsigned char sllc_xid; | 23 | unsigned char sllc_xid; |
| 21 | unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */ | 24 | unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */ |
| 22 | unsigned char sllc_sap; | 25 | unsigned char sllc_sap; |
| 23 | unsigned char sllc_mac[IFHWADDRLEN]; | 26 | unsigned char sllc_mac[IFHWADDRLEN]; |
| 24 | unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 - | 27 | unsigned char __pad[__LLC_SOCK_SIZE__ - |
| 28 | sizeof(__kernel_sa_family_t) * 2 - | ||
| 25 | sizeof(unsigned char) * 4 - IFHWADDRLEN]; | 29 | sizeof(unsigned char) * 4 - IFHWADDRLEN]; |
| 26 | }; | 30 | }; |
| 27 | 31 | ||
diff --git a/include/linux/mii.h b/include/linux/mii.h index 103113a2fd18..27748230aa69 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
| @@ -11,131 +11,130 @@ | |||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | 12 | ||
| 13 | /* Generic MII registers. */ | 13 | /* Generic MII registers. */ |
| 14 | 14 | #define MII_BMCR 0x00 /* Basic mode control register */ | |
| 15 | #define MII_BMCR 0x00 /* Basic mode control register */ | 15 | #define MII_BMSR 0x01 /* Basic mode status register */ |
| 16 | #define MII_BMSR 0x01 /* Basic mode status register */ | 16 | #define MII_PHYSID1 0x02 /* PHYS ID 1 */ |
| 17 | #define MII_PHYSID1 0x02 /* PHYS ID 1 */ | 17 | #define MII_PHYSID2 0x03 /* PHYS ID 2 */ |
| 18 | #define MII_PHYSID2 0x03 /* PHYS ID 2 */ | 18 | #define MII_ADVERTISE 0x04 /* Advertisement control reg */ |
| 19 | #define MII_ADVERTISE 0x04 /* Advertisement control reg */ | 19 | #define MII_LPA 0x05 /* Link partner ability reg */ |
| 20 | #define MII_LPA 0x05 /* Link partner ability reg */ | 20 | #define MII_EXPANSION 0x06 /* Expansion register */ |
| 21 | #define MII_EXPANSION 0x06 /* Expansion register */ | 21 | #define MII_CTRL1000 0x09 /* 1000BASE-T control */ |
| 22 | #define MII_CTRL1000 0x09 /* 1000BASE-T control */ | 22 | #define MII_STAT1000 0x0a /* 1000BASE-T status */ |
| 23 | #define MII_STAT1000 0x0a /* 1000BASE-T status */ | 23 | #define MII_ESTATUS 0x0f /* Extended Status */ |
| 24 | #define MII_ESTATUS 0x0f /* Extended Status */ | 24 | #define MII_DCOUNTER 0x12 /* Disconnect counter */ |
| 25 | #define MII_DCOUNTER 0x12 /* Disconnect counter */ | 25 | #define MII_FCSCOUNTER 0x13 /* False carrier counter */ |
| 26 | #define MII_FCSCOUNTER 0x13 /* False carrier counter */ | 26 | #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ |
| 27 | #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ | 27 | #define MII_RERRCOUNTER 0x15 /* Receive error counter */ |
| 28 | #define MII_RERRCOUNTER 0x15 /* Receive error counter */ | 28 | #define MII_SREVISION 0x16 /* Silicon revision */ |
| 29 | #define MII_SREVISION 0x16 /* Silicon revision */ | 29 | #define MII_RESV1 0x17 /* Reserved... */ |
| 30 | #define MII_RESV1 0x17 /* Reserved... */ | 30 | #define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ |
| 31 | #define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ | 31 | #define MII_PHYADDR 0x19 /* PHY address */ |
| 32 | #define MII_PHYADDR 0x19 /* PHY address */ | 32 | #define MII_RESV2 0x1a /* Reserved... */ |
| 33 | #define MII_RESV2 0x1a /* Reserved... */ | 33 | #define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ |
| 34 | #define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ | 34 | #define MII_NCONFIG 0x1c /* Network interface config */ |
| 35 | #define MII_NCONFIG 0x1c /* Network interface config */ | ||
| 36 | 35 | ||
| 37 | /* Basic mode control register. */ | 36 | /* Basic mode control register. */ |
| 38 | #define BMCR_RESV 0x003f /* Unused... */ | 37 | #define BMCR_RESV 0x003f /* Unused... */ |
| 39 | #define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */ | 38 | #define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */ |
| 40 | #define BMCR_CTST 0x0080 /* Collision test */ | 39 | #define BMCR_CTST 0x0080 /* Collision test */ |
| 41 | #define BMCR_FULLDPLX 0x0100 /* Full duplex */ | 40 | #define BMCR_FULLDPLX 0x0100 /* Full duplex */ |
| 42 | #define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ | 41 | #define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ |
| 43 | #define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */ | 42 | #define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */ |
| 44 | #define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */ | 43 | #define BMCR_PDOWN 0x0800 /* Enable low power state */ |
| 45 | #define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ | 44 | #define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ |
| 46 | #define BMCR_SPEED100 0x2000 /* Select 100Mbps */ | 45 | #define BMCR_SPEED100 0x2000 /* Select 100Mbps */ |
| 47 | #define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */ | 46 | #define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */ |
| 48 | #define BMCR_RESET 0x8000 /* Reset the DP83840 */ | 47 | #define BMCR_RESET 0x8000 /* Reset to default state */ |
| 49 | 48 | ||
| 50 | /* Basic mode status register. */ | 49 | /* Basic mode status register. */ |
| 51 | #define BMSR_ERCAP 0x0001 /* Ext-reg capability */ | 50 | #define BMSR_ERCAP 0x0001 /* Ext-reg capability */ |
| 52 | #define BMSR_JCD 0x0002 /* Jabber detected */ | 51 | #define BMSR_JCD 0x0002 /* Jabber detected */ |
| 53 | #define BMSR_LSTATUS 0x0004 /* Link status */ | 52 | #define BMSR_LSTATUS 0x0004 /* Link status */ |
| 54 | #define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ | 53 | #define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ |
| 55 | #define BMSR_RFAULT 0x0010 /* Remote fault detected */ | 54 | #define BMSR_RFAULT 0x0010 /* Remote fault detected */ |
| 56 | #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ | 55 | #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ |
| 57 | #define BMSR_RESV 0x00c0 /* Unused... */ | 56 | #define BMSR_RESV 0x00c0 /* Unused... */ |
| 58 | #define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ | 57 | #define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ |
| 59 | #define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */ | 58 | #define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */ |
| 60 | #define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */ | 59 | #define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */ |
| 61 | #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ | 60 | #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ |
| 62 | #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ | 61 | #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ |
| 63 | #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ | 62 | #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ |
| 64 | #define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */ | 63 | #define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */ |
| 65 | #define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */ | 64 | #define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */ |
| 66 | 65 | ||
| 67 | /* Advertisement control register. */ | 66 | /* Advertisement control register. */ |
| 68 | #define ADVERTISE_SLCT 0x001f /* Selector bits */ | 67 | #define ADVERTISE_SLCT 0x001f /* Selector bits */ |
| 69 | #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ | 68 | #define ADVERTISE_CSMA 0x0001 /* Only selector supported */ |
| 70 | #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ | 69 | #define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ |
| 71 | #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ | 70 | #define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ |
| 72 | #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ | 71 | #define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ |
| 73 | #define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */ | 72 | #define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */ |
| 74 | #define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ | 73 | #define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ |
| 75 | #define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */ | 74 | #define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */ |
| 76 | #define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ | 75 | #define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ |
| 77 | #define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */ | 76 | #define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */ |
| 78 | #define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ | 77 | #define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ |
| 79 | #define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ | 78 | #define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ |
| 80 | #define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ | 79 | #define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ |
| 81 | #define ADVERTISE_RESV 0x1000 /* Unused... */ | 80 | #define ADVERTISE_RESV 0x1000 /* Unused... */ |
| 82 | #define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */ | 81 | #define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */ |
| 83 | #define ADVERTISE_LPACK 0x4000 /* Ack link partners response */ | 82 | #define ADVERTISE_LPACK 0x4000 /* Ack link partners response */ |
| 84 | #define ADVERTISE_NPAGE 0x8000 /* Next page bit */ | 83 | #define ADVERTISE_NPAGE 0x8000 /* Next page bit */ |
| 85 | 84 | ||
| 86 | #define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ | 85 | #define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ |
| 87 | ADVERTISE_CSMA) | 86 | ADVERTISE_CSMA) |
| 88 | #define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ | 87 | #define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ |
| 89 | ADVERTISE_100HALF | ADVERTISE_100FULL) | 88 | ADVERTISE_100HALF | ADVERTISE_100FULL) |
| 90 | 89 | ||
| 91 | /* Link partner ability register. */ | 90 | /* Link partner ability register. */ |
| 92 | #define LPA_SLCT 0x001f /* Same as advertise selector */ | 91 | #define LPA_SLCT 0x001f /* Same as advertise selector */ |
| 93 | #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ | 92 | #define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ |
| 94 | #define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ | 93 | #define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ |
| 95 | #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ | 94 | #define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ |
| 96 | #define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */ | 95 | #define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */ |
| 97 | #define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ | 96 | #define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ |
| 98 | #define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */ | 97 | #define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */ |
| 99 | #define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ | 98 | #define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ |
| 100 | #define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ | 99 | #define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ |
| 101 | #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ | 100 | #define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ |
| 102 | #define LPA_PAUSE_CAP 0x0400 /* Can pause */ | 101 | #define LPA_PAUSE_CAP 0x0400 /* Can pause */ |
| 103 | #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ | 102 | #define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ |
| 104 | #define LPA_RESV 0x1000 /* Unused... */ | 103 | #define LPA_RESV 0x1000 /* Unused... */ |
| 105 | #define LPA_RFAULT 0x2000 /* Link partner faulted */ | 104 | #define LPA_RFAULT 0x2000 /* Link partner faulted */ |
| 106 | #define LPA_LPACK 0x4000 /* Link partner acked us */ | 105 | #define LPA_LPACK 0x4000 /* Link partner acked us */ |
| 107 | #define LPA_NPAGE 0x8000 /* Next page bit */ | 106 | #define LPA_NPAGE 0x8000 /* Next page bit */ |
| 108 | 107 | ||
| 109 | #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) | 108 | #define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) |
| 110 | #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) | 109 | #define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) |
| 111 | 110 | ||
| 112 | /* Expansion register for auto-negotiation. */ | 111 | /* Expansion register for auto-negotiation. */ |
| 113 | #define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */ | 112 | #define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */ |
| 114 | #define EXPANSION_LCWP 0x0002 /* Got new RX page code word */ | 113 | #define EXPANSION_LCWP 0x0002 /* Got new RX page code word */ |
| 115 | #define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */ | 114 | #define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */ |
| 116 | #define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */ | 115 | #define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */ |
| 117 | #define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ | 116 | #define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ |
| 118 | #define EXPANSION_RESV 0xffe0 /* Unused... */ | 117 | #define EXPANSION_RESV 0xffe0 /* Unused... */ |
| 119 | 118 | ||
| 120 | #define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */ | 119 | #define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */ |
| 121 | #define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */ | 120 | #define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */ |
| 122 | 121 | ||
| 123 | /* N-way test register. */ | 122 | /* N-way test register. */ |
| 124 | #define NWAYTEST_RESV1 0x00ff /* Unused... */ | 123 | #define NWAYTEST_RESV1 0x00ff /* Unused... */ |
| 125 | #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ | 124 | #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ |
| 126 | #define NWAYTEST_RESV2 0xfe00 /* Unused... */ | 125 | #define NWAYTEST_RESV2 0xfe00 /* Unused... */ |
| 127 | 126 | ||
| 128 | /* 1000BASE-T Control register */ | 127 | /* 1000BASE-T Control register */ |
| 129 | #define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ | 128 | #define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ |
| 130 | #define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ | 129 | #define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ |
| 131 | #define CTL1000_AS_MASTER 0x0800 | 130 | #define CTL1000_AS_MASTER 0x0800 |
| 132 | #define CTL1000_ENABLE_MASTER 0x1000 | 131 | #define CTL1000_ENABLE_MASTER 0x1000 |
| 133 | 132 | ||
| 134 | /* 1000BASE-T Status register */ | 133 | /* 1000BASE-T Status register */ |
| 135 | #define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ | 134 | #define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ |
| 136 | #define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */ | 135 | #define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */ |
| 137 | #define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ | 136 | #define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ |
| 138 | #define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ | 137 | #define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ |
| 139 | 138 | ||
| 140 | /* Flow control flags */ | 139 | /* Flow control flags */ |
| 141 | #define FLOW_CTRL_TX 0x01 | 140 | #define FLOW_CTRL_TX 0x01 |
| @@ -149,7 +148,7 @@ struct mii_ioctl_data { | |||
| 149 | __u16 val_out; | 148 | __u16 val_out; |
| 150 | }; | 149 | }; |
| 151 | 150 | ||
| 152 | #ifdef __KERNEL__ | 151 | #ifdef __KERNEL__ |
| 153 | 152 | ||
| 154 | #include <linux/if.h> | 153 | #include <linux/if.h> |
| 155 | 154 | ||
| @@ -180,7 +179,7 @@ extern unsigned int mii_check_media (struct mii_if_info *mii, | |||
| 180 | unsigned int ok_to_print, | 179 | unsigned int ok_to_print, |
| 181 | unsigned int init_media); | 180 | unsigned int init_media); |
| 182 | extern int generic_mii_ioctl(struct mii_if_info *mii_if, | 181 | extern int generic_mii_ioctl(struct mii_if_info *mii_if, |
| 183 | struct mii_ioctl_data *mii_data, int cmd, | 182 | struct mii_ioctl_data *mii_data, int cmd, |
| 184 | unsigned int *duplex_changed); | 183 | unsigned int *duplex_changed); |
| 185 | 184 | ||
| 186 | 185 | ||
| @@ -189,7 +188,6 @@ static inline struct mii_ioctl_data *if_mii(struct ifreq *rq) | |||
| 189 | return (struct mii_ioctl_data *) &rq->ifr_ifru; | 188 | return (struct mii_ioctl_data *) &rq->ifr_ifru; |
| 190 | } | 189 | } |
| 191 | 190 | ||
| 192 | |||
| 193 | /** | 191 | /** |
| 194 | * mii_nway_result | 192 | * mii_nway_result |
| 195 | * @negotiated: value of MII ANAR and'd with ANLPAR | 193 | * @negotiated: value of MII ANAR and'd with ANLPAR |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 53ef894bfa05..2366f94a095a 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
| @@ -75,6 +75,7 @@ enum { | |||
| 75 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21, | 75 | MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21, |
| 76 | MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30, | 76 | MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30, |
| 77 | MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32, | 77 | MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32, |
| 78 | MLX4_DEV_CAP_FLAG_FCS_KEEP = 1LL << 34, | ||
| 78 | MLX4_DEV_CAP_FLAG_WOL = 1LL << 38, | 79 | MLX4_DEV_CAP_FLAG_WOL = 1LL << 38, |
| 79 | MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, | 80 | MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, |
| 80 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, | 81 | MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 774b8952deb4..29971a589ff2 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -135,6 +135,17 @@ struct page { | |||
| 135 | #endif | 135 | #endif |
| 136 | ; | 136 | ; |
| 137 | 137 | ||
| 138 | struct page_frag { | ||
| 139 | struct page *page; | ||
| 140 | #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536) | ||
| 141 | __u32 offset; | ||
| 142 | __u32 size; | ||
| 143 | #else | ||
| 144 | __u16 offset; | ||
| 145 | __u16 size; | ||
| 146 | #endif | ||
| 147 | }; | ||
| 148 | |||
| 138 | typedef unsigned long __nocast vm_flags_t; | 149 | typedef unsigned long __nocast vm_flags_t; |
| 139 | 150 | ||
| 140 | /* | 151 | /* |
diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h index a3b8546354ac..ae5df122e42f 100644 --- a/include/linux/net_tstamp.h +++ b/include/linux/net_tstamp.h | |||
| @@ -45,7 +45,7 @@ struct hwtstamp_config { | |||
| 45 | }; | 45 | }; |
| 46 | 46 | ||
| 47 | /* possible values for hwtstamp_config->tx_type */ | 47 | /* possible values for hwtstamp_config->tx_type */ |
| 48 | enum { | 48 | enum hwtstamp_tx_types { |
| 49 | /* | 49 | /* |
| 50 | * No outgoing packet will need hardware time stamping; | 50 | * No outgoing packet will need hardware time stamping; |
| 51 | * should a packet arrive which asks for it, no hardware | 51 | * should a packet arrive which asks for it, no hardware |
| @@ -60,10 +60,19 @@ enum { | |||
| 60 | * before sending the packet. | 60 | * before sending the packet. |
| 61 | */ | 61 | */ |
| 62 | HWTSTAMP_TX_ON, | 62 | HWTSTAMP_TX_ON, |
| 63 | |||
| 64 | /* | ||
| 65 | * Enables time stamping for outgoing packets just as | ||
| 66 | * HWTSTAMP_TX_ON does, but also enables time stamp insertion | ||
| 67 | * directly into Sync packets. In this case, transmitted Sync | ||
| 68 | * packets will not received a time stamp via the socket error | ||
| 69 | * queue. | ||
| 70 | */ | ||
| 71 | HWTSTAMP_TX_ONESTEP_SYNC, | ||
| 63 | }; | 72 | }; |
| 64 | 73 | ||
| 65 | /* possible values for hwtstamp_config->rx_filter */ | 74 | /* possible values for hwtstamp_config->rx_filter */ |
| 66 | enum { | 75 | enum hwtstamp_rx_filters { |
| 67 | /* time stamp no incoming packet at all */ | 76 | /* time stamp no incoming packet at all */ |
| 68 | HWTSTAMP_FILTER_NONE, | 77 | HWTSTAMP_FILTER_NONE, |
| 69 | 78 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 279726039f00..c8615cd0b2f6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -723,9 +723,8 @@ struct netdev_tc_txq { | |||
| 723 | * | 723 | * |
| 724 | * void (*ndo_set_rx_mode)(struct net_device *dev); | 724 | * void (*ndo_set_rx_mode)(struct net_device *dev); |
| 725 | * This function is called device changes address list filtering. | 725 | * This function is called device changes address list filtering. |
| 726 | * | 726 | * If driver handles unicast address filtering, it should set |
| 727 | * void (*ndo_set_multicast_list)(struct net_device *dev); | 727 | * IFF_UNICAST_FLT to its priv_flags. |
| 728 | * This function is called when the multicast address list changes. | ||
| 729 | * | 728 | * |
| 730 | * int (*ndo_set_mac_address)(struct net_device *dev, void *addr); | 729 | * int (*ndo_set_mac_address)(struct net_device *dev, void *addr); |
| 731 | * This function is called when the Media Access Control address | 730 | * This function is called when the Media Access Control address |
| @@ -782,6 +781,7 @@ struct netdev_tc_txq { | |||
| 782 | * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); | 781 | * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); |
| 783 | * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); | 782 | * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); |
| 784 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); | 783 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); |
| 784 | * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); | ||
| 785 | * int (*ndo_get_vf_config)(struct net_device *dev, | 785 | * int (*ndo_get_vf_config)(struct net_device *dev, |
| 786 | * int vf, struct ifla_vf_info *ivf); | 786 | * int vf, struct ifla_vf_info *ivf); |
| 787 | * int (*ndo_set_vf_port)(struct net_device *dev, int vf, | 787 | * int (*ndo_set_vf_port)(struct net_device *dev, int vf, |
| @@ -868,7 +868,6 @@ struct net_device_ops { | |||
| 868 | void (*ndo_change_rx_flags)(struct net_device *dev, | 868 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 869 | int flags); | 869 | int flags); |
| 870 | void (*ndo_set_rx_mode)(struct net_device *dev); | 870 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| 871 | void (*ndo_set_multicast_list)(struct net_device *dev); | ||
| 872 | int (*ndo_set_mac_address)(struct net_device *dev, | 871 | int (*ndo_set_mac_address)(struct net_device *dev, |
| 873 | void *addr); | 872 | void *addr); |
| 874 | int (*ndo_validate_addr)(struct net_device *dev); | 873 | int (*ndo_validate_addr)(struct net_device *dev); |
| @@ -902,6 +901,8 @@ struct net_device_ops { | |||
| 902 | int queue, u16 vlan, u8 qos); | 901 | int queue, u16 vlan, u8 qos); |
| 903 | int (*ndo_set_vf_tx_rate)(struct net_device *dev, | 902 | int (*ndo_set_vf_tx_rate)(struct net_device *dev, |
| 904 | int vf, int rate); | 903 | int vf, int rate); |
| 904 | int (*ndo_set_vf_spoofchk)(struct net_device *dev, | ||
| 905 | int vf, bool setting); | ||
| 905 | int (*ndo_get_vf_config)(struct net_device *dev, | 906 | int (*ndo_get_vf_config)(struct net_device *dev, |
| 906 | int vf, | 907 | int vf, |
| 907 | struct ifla_vf_info *ivf); | 908 | struct ifla_vf_info *ivf); |
| @@ -924,11 +925,15 @@ struct net_device_ops { | |||
| 924 | u16 xid, | 925 | u16 xid, |
| 925 | struct scatterlist *sgl, | 926 | struct scatterlist *sgl, |
| 926 | unsigned int sgc); | 927 | unsigned int sgc); |
| 928 | #endif | ||
| 929 | |||
| 930 | #if defined(CONFIG_LIBFCOE) || defined(CONFIG_LIBFCOE_MODULE) | ||
| 927 | #define NETDEV_FCOE_WWNN 0 | 931 | #define NETDEV_FCOE_WWNN 0 |
| 928 | #define NETDEV_FCOE_WWPN 1 | 932 | #define NETDEV_FCOE_WWPN 1 |
| 929 | int (*ndo_fcoe_get_wwn)(struct net_device *dev, | 933 | int (*ndo_fcoe_get_wwn)(struct net_device *dev, |
| 930 | u64 *wwn, int type); | 934 | u64 *wwn, int type); |
| 931 | #endif | 935 | #endif |
| 936 | |||
| 932 | #ifdef CONFIG_RFS_ACCEL | 937 | #ifdef CONFIG_RFS_ACCEL |
| 933 | int (*ndo_rx_flow_steer)(struct net_device *dev, | 938 | int (*ndo_rx_flow_steer)(struct net_device *dev, |
| 934 | const struct sk_buff *skb, | 939 | const struct sk_buff *skb, |
| @@ -2587,9 +2592,6 @@ static inline int netif_is_bond_slave(struct net_device *dev) | |||
| 2587 | 2592 | ||
| 2588 | extern struct pernet_operations __net_initdata loopback_net_ops; | 2593 | extern struct pernet_operations __net_initdata loopback_net_ops; |
| 2589 | 2594 | ||
| 2590 | int dev_ethtool_get_settings(struct net_device *dev, | ||
| 2591 | struct ethtool_cmd *cmd); | ||
| 2592 | |||
| 2593 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) | 2595 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) |
| 2594 | { | 2596 | { |
| 2595 | if (dev->features & NETIF_F_RXCSUM) | 2597 | if (dev->features & NETIF_F_RXCSUM) |
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h index 0ca66e97acbc..d1366f05d1b2 100644 --- a/include/linux/netfilter/xt_connlimit.h +++ b/include/linux/netfilter/xt_connlimit.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _XT_CONNLIMIT_H | 2 | #define _XT_CONNLIMIT_H |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/netfilter.h> | ||
| 5 | 6 | ||
| 6 | struct xt_connlimit_data; | 7 | struct xt_connlimit_data; |
| 7 | 8 | ||
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 74b904d8f99c..e3c041d54020 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #define _XT_CONNTRACK_H | 6 | #define _XT_CONNTRACK_H |
| 7 | 7 | ||
| 8 | #include <linux/types.h> | 8 | #include <linux/types.h> |
| 9 | #include <linux/netfilter.h> | ||
| 9 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | 10 | #include <linux/netfilter/nf_conntrack_tuple_common.h> |
| 10 | 11 | ||
| 11 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) | 12 | #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) |
diff --git a/include/linux/netfilter/xt_iprange.h b/include/linux/netfilter/xt_iprange.h index c1f21a779a45..25fd7cf851f0 100644 --- a/include/linux/netfilter/xt_iprange.h +++ b/include/linux/netfilter/xt_iprange.h | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #define _LINUX_NETFILTER_XT_IPRANGE_H 1 | 2 | #define _LINUX_NETFILTER_XT_IPRANGE_H 1 |
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/netfilter.h> | ||
| 5 | 6 | ||
| 6 | enum { | 7 | enum { |
| 7 | IPRANGE_SRC = 1 << 0, /* match source IP address */ | 8 | IPRANGE_SRC = 1 << 0, /* match source IP address */ |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index adbf4bff87ed..e08565d45178 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -52,7 +52,7 @@ struct arpt_arp { | |||
| 52 | struct in_addr smsk, tmsk; | 52 | struct in_addr smsk, tmsk; |
| 53 | 53 | ||
| 54 | /* Device hw address length, src+target device addresses */ | 54 | /* Device hw address length, src+target device addresses */ |
| 55 | u_int8_t arhln, arhln_mask; | 55 | __u8 arhln, arhln_mask; |
| 56 | struct arpt_devaddr_info src_devaddr; | 56 | struct arpt_devaddr_info src_devaddr; |
| 57 | struct arpt_devaddr_info tgt_devaddr; | 57 | struct arpt_devaddr_info tgt_devaddr; |
| 58 | 58 | ||
| @@ -71,9 +71,9 @@ struct arpt_arp { | |||
| 71 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; | 71 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; |
| 72 | 72 | ||
| 73 | /* Flags word */ | 73 | /* Flags word */ |
| 74 | u_int8_t flags; | 74 | __u8 flags; |
| 75 | /* Inverse flags */ | 75 | /* Inverse flags */ |
| 76 | u_int16_t invflags; | 76 | __u16 invflags; |
| 77 | }; | 77 | }; |
| 78 | 78 | ||
| 79 | /* Values for "flag" field in struct arpt_ip (general arp structure). | 79 | /* Values for "flag" field in struct arpt_ip (general arp structure). |
| @@ -102,9 +102,9 @@ struct arpt_entry | |||
| 102 | struct arpt_arp arp; | 102 | struct arpt_arp arp; |
| 103 | 103 | ||
| 104 | /* Size of arpt_entry + matches */ | 104 | /* Size of arpt_entry + matches */ |
| 105 | u_int16_t target_offset; | 105 | __u16 target_offset; |
| 106 | /* Size of arpt_entry + matches + target */ | 106 | /* Size of arpt_entry + matches + target */ |
| 107 | u_int16_t next_offset; | 107 | __u16 next_offset; |
| 108 | 108 | ||
| 109 | /* Back pointer */ | 109 | /* Back pointer */ |
| 110 | unsigned int comefrom; | 110 | unsigned int comefrom; |
| @@ -260,8 +260,8 @@ extern unsigned int arpt_do_table(struct sk_buff *skb, | |||
| 260 | 260 | ||
| 261 | struct compat_arpt_entry { | 261 | struct compat_arpt_entry { |
| 262 | struct arpt_arp arp; | 262 | struct arpt_arp arp; |
| 263 | u_int16_t target_offset; | 263 | __u16 target_offset; |
| 264 | u_int16_t next_offset; | 264 | __u16 next_offset; |
| 265 | compat_uint_t comefrom; | 265 | compat_uint_t comefrom; |
| 266 | struct compat_xt_counters counters; | 266 | struct compat_xt_counters counters; |
| 267 | unsigned char elems[0]; | 267 | unsigned char elems[0]; |
diff --git a/include/linux/netfilter_decnet.h b/include/linux/netfilter_decnet.h index 6f425369ee29..0b09732aacd5 100644 --- a/include/linux/netfilter_decnet.h +++ b/include/linux/netfilter_decnet.h | |||
| @@ -11,6 +11,9 @@ | |||
| 11 | 11 | ||
| 12 | /* only for userspace compatibility */ | 12 | /* only for userspace compatibility */ |
| 13 | #ifndef __KERNEL__ | 13 | #ifndef __KERNEL__ |
| 14 | |||
| 15 | #include <limits.h> /* for INT_MIN, INT_MAX */ | ||
| 16 | |||
| 14 | /* IP Cache bits. */ | 17 | /* IP Cache bits. */ |
| 15 | /* Src IP address. */ | 18 | /* Src IP address. */ |
| 16 | #define NFC_DN_SRC 0x0001 | 19 | #define NFC_DN_SRC 0x0001 |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 29c7727ff0e8..fa0946c549d3 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
| @@ -9,6 +9,9 @@ | |||
| 9 | 9 | ||
| 10 | /* only for userspace compatibility */ | 10 | /* only for userspace compatibility */ |
| 11 | #ifndef __KERNEL__ | 11 | #ifndef __KERNEL__ |
| 12 | |||
| 13 | #include <limits.h> /* for INT_MIN, INT_MAX */ | ||
| 14 | |||
| 12 | /* IP Cache bits. */ | 15 | /* IP Cache bits. */ |
| 13 | /* Src IP address. */ | 16 | /* Src IP address. */ |
| 14 | #define NFC_IP_SRC 0x0001 | 17 | #define NFC_IP_SRC 0x0001 |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 64a5d95c58e8..db79231914ce 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -81,12 +81,12 @@ struct ipt_ip { | |||
| 81 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; | 81 | unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; |
| 82 | 82 | ||
| 83 | /* Protocol, 0 = ANY */ | 83 | /* Protocol, 0 = ANY */ |
| 84 | u_int16_t proto; | 84 | __u16 proto; |
| 85 | 85 | ||
| 86 | /* Flags word */ | 86 | /* Flags word */ |
| 87 | u_int8_t flags; | 87 | __u8 flags; |
| 88 | /* Inverse flags */ | 88 | /* Inverse flags */ |
| 89 | u_int8_t invflags; | 89 | __u8 invflags; |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ | 92 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ |
| @@ -114,9 +114,9 @@ struct ipt_entry { | |||
| 114 | unsigned int nfcache; | 114 | unsigned int nfcache; |
| 115 | 115 | ||
| 116 | /* Size of ipt_entry + matches */ | 116 | /* Size of ipt_entry + matches */ |
| 117 | u_int16_t target_offset; | 117 | __u16 target_offset; |
| 118 | /* Size of ipt_entry + matches + target */ | 118 | /* Size of ipt_entry + matches + target */ |
| 119 | u_int16_t next_offset; | 119 | __u16 next_offset; |
| 120 | 120 | ||
| 121 | /* Back pointer */ | 121 | /* Back pointer */ |
| 122 | unsigned int comefrom; | 122 | unsigned int comefrom; |
| @@ -149,9 +149,9 @@ struct ipt_entry { | |||
| 149 | 149 | ||
| 150 | /* ICMP matching stuff */ | 150 | /* ICMP matching stuff */ |
| 151 | struct ipt_icmp { | 151 | struct ipt_icmp { |
| 152 | u_int8_t type; /* type to match */ | 152 | __u8 type; /* type to match */ |
| 153 | u_int8_t code[2]; /* range of code */ | 153 | __u8 code[2]; /* range of code */ |
| 154 | u_int8_t invflags; /* Inverse flags */ | 154 | __u8 invflags; /* Inverse flags */ |
| 155 | }; | 155 | }; |
| 156 | 156 | ||
| 157 | /* Values for "inv" field for struct ipt_icmp. */ | 157 | /* Values for "inv" field for struct ipt_icmp. */ |
| @@ -288,8 +288,8 @@ extern unsigned int ipt_do_table(struct sk_buff *skb, | |||
| 288 | struct compat_ipt_entry { | 288 | struct compat_ipt_entry { |
| 289 | struct ipt_ip ip; | 289 | struct ipt_ip ip; |
| 290 | compat_uint_t nfcache; | 290 | compat_uint_t nfcache; |
| 291 | u_int16_t target_offset; | 291 | __u16 target_offset; |
| 292 | u_int16_t next_offset; | 292 | __u16 next_offset; |
| 293 | compat_uint_t comefrom; | 293 | compat_uint_t comefrom; |
| 294 | struct compat_xt_counters counters; | 294 | struct compat_xt_counters counters; |
| 295 | unsigned char elems[0]; | 295 | unsigned char elems[0]; |
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index 1f7e300094cd..57c025127f1d 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | 12 | ||
| 13 | /* only for userspace compatibility */ | 13 | /* only for userspace compatibility */ |
| 14 | #ifndef __KERNEL__ | 14 | #ifndef __KERNEL__ |
| 15 | |||
| 16 | #include <limits.h> /* for INT_MIN, INT_MAX */ | ||
| 17 | |||
| 15 | /* IP Cache bits. */ | 18 | /* IP Cache bits. */ |
| 16 | /* Src IP address. */ | 19 | /* Src IP address. */ |
| 17 | #define NFC_IP6_SRC 0x0001 | 20 | #define NFC_IP6_SRC 0x0001 |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index c9784f7a9c1f..f549adccc94c 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -81,14 +81,14 @@ struct ip6t_ip6 { | |||
| 81 | * MH do not match any packets. | 81 | * MH do not match any packets. |
| 82 | * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol. | 82 | * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol. |
| 83 | */ | 83 | */ |
| 84 | u_int16_t proto; | 84 | __u16 proto; |
| 85 | /* TOS to match iff flags & IP6T_F_TOS */ | 85 | /* TOS to match iff flags & IP6T_F_TOS */ |
| 86 | u_int8_t tos; | 86 | __u8 tos; |
| 87 | 87 | ||
| 88 | /* Flags word */ | 88 | /* Flags word */ |
| 89 | u_int8_t flags; | 89 | __u8 flags; |
| 90 | /* Inverse flags */ | 90 | /* Inverse flags */ |
| 91 | u_int8_t invflags; | 91 | __u8 invflags; |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ | 94 | /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ |
| @@ -118,9 +118,9 @@ struct ip6t_entry { | |||
| 118 | unsigned int nfcache; | 118 | unsigned int nfcache; |
| 119 | 119 | ||
| 120 | /* Size of ipt_entry + matches */ | 120 | /* Size of ipt_entry + matches */ |
| 121 | u_int16_t target_offset; | 121 | __u16 target_offset; |
| 122 | /* Size of ipt_entry + matches + target */ | 122 | /* Size of ipt_entry + matches + target */ |
| 123 | u_int16_t next_offset; | 123 | __u16 next_offset; |
| 124 | 124 | ||
| 125 | /* Back pointer */ | 125 | /* Back pointer */ |
| 126 | unsigned int comefrom; | 126 | unsigned int comefrom; |
| @@ -186,9 +186,9 @@ struct ip6t_error { | |||
| 186 | 186 | ||
| 187 | /* ICMP matching stuff */ | 187 | /* ICMP matching stuff */ |
| 188 | struct ip6t_icmp { | 188 | struct ip6t_icmp { |
| 189 | u_int8_t type; /* type to match */ | 189 | __u8 type; /* type to match */ |
| 190 | u_int8_t code[2]; /* range of code */ | 190 | __u8 code[2]; /* range of code */ |
| 191 | u_int8_t invflags; /* Inverse flags */ | 191 | __u8 invflags; /* Inverse flags */ |
| 192 | }; | 192 | }; |
| 193 | 193 | ||
| 194 | /* Values for "inv" field for struct ipt_icmp. */ | 194 | /* Values for "inv" field for struct ipt_icmp. */ |
| @@ -298,8 +298,8 @@ extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | |||
| 298 | struct compat_ip6t_entry { | 298 | struct compat_ip6t_entry { |
| 299 | struct ip6t_ip6 ipv6; | 299 | struct ip6t_ip6 ipv6; |
| 300 | compat_uint_t nfcache; | 300 | compat_uint_t nfcache; |
| 301 | u_int16_t target_offset; | 301 | __u16 target_offset; |
| 302 | u_int16_t next_offset; | 302 | __u16 next_offset; |
| 303 | compat_uint_t comefrom; | 303 | compat_uint_t comefrom; |
| 304 | struct compat_xt_counters counters; | 304 | struct compat_xt_counters counters; |
| 305 | unsigned char elems[0]; | 305 | unsigned char elems[0]; |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 180540a84d37..8180cd9d73d5 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | #ifndef __LINUX_NETLINK_H | 1 | #ifndef __LINUX_NETLINK_H |
| 2 | #define __LINUX_NETLINK_H | 2 | #define __LINUX_NETLINK_H |
| 3 | 3 | ||
| 4 | #include <linux/socket.h> /* for sa_family_t */ | 4 | #include <linux/socket.h> /* for __kernel_sa_family_t */ |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | 6 | ||
| 7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ | 7 | #define NETLINK_ROUTE 0 /* Routing/device hook */ |
diff --git a/include/linux/netrom.h b/include/linux/netrom.h index 6939b32f66a0..af7313cc9cb6 100644 --- a/include/linux/netrom.h +++ b/include/linux/netrom.h | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #ifndef NETROM_KERNEL_H | 7 | #ifndef NETROM_KERNEL_H |
| 8 | #define NETROM_KERNEL_H | 8 | #define NETROM_KERNEL_H |
| 9 | 9 | ||
| 10 | #include <linux/ax25.h> | ||
| 11 | |||
| 10 | #define NETROM_MTU 236 | 12 | #define NETROM_MTU 236 |
| 11 | 13 | ||
| 12 | #define NETROM_T1 1 | 14 | #define NETROM_T1 1 |
diff --git a/include/linux/nfc.h b/include/linux/nfc.h index 330a4c5db588..36cb955b05cc 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h | |||
| @@ -39,6 +39,10 @@ | |||
| 39 | * | 39 | * |
| 40 | * @NFC_CMD_GET_DEVICE: request information about a device (requires | 40 | * @NFC_CMD_GET_DEVICE: request information about a device (requires |
| 41 | * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices | 41 | * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices |
| 42 | * @NFC_CMD_DEV_UP: turn on the nfc device | ||
| 43 | * (requires %NFC_ATTR_DEVICE_INDEX) | ||
| 44 | * @NFC_CMD_DEV_DOWN: turn off the nfc device | ||
| 45 | * (requires %NFC_ATTR_DEVICE_INDEX) | ||
| 42 | * @NFC_CMD_START_POLL: start polling for targets using the given protocols | 46 | * @NFC_CMD_START_POLL: start polling for targets using the given protocols |
| 43 | * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS) | 47 | * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS) |
| 44 | * @NFC_CMD_STOP_POLL: stop polling for targets (requires | 48 | * @NFC_CMD_STOP_POLL: stop polling for targets (requires |
| @@ -56,6 +60,8 @@ | |||
| 56 | enum nfc_commands { | 60 | enum nfc_commands { |
| 57 | NFC_CMD_UNSPEC, | 61 | NFC_CMD_UNSPEC, |
| 58 | NFC_CMD_GET_DEVICE, | 62 | NFC_CMD_GET_DEVICE, |
| 63 | NFC_CMD_DEV_UP, | ||
| 64 | NFC_CMD_DEV_DOWN, | ||
| 59 | NFC_CMD_START_POLL, | 65 | NFC_CMD_START_POLL, |
| 60 | NFC_CMD_STOP_POLL, | 66 | NFC_CMD_STOP_POLL, |
| 61 | NFC_CMD_GET_TARGET, | 67 | NFC_CMD_GET_TARGET, |
| @@ -123,4 +129,6 @@ struct sockaddr_nfc { | |||
| 123 | #define NFC_SOCKPROTO_RAW 0 | 129 | #define NFC_SOCKPROTO_RAW 0 |
| 124 | #define NFC_SOCKPROTO_MAX 1 | 130 | #define NFC_SOCKPROTO_MAX 1 |
| 125 | 131 | ||
| 132 | #define NFC_HEADER_SIZE 1 | ||
| 133 | |||
| 126 | #endif /*__LINUX_NFC_H */ | 134 | #endif /*__LINUX_NFC_H */ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 8ad70dcac3f9..8049bf77d799 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -161,6 +161,13 @@ | |||
| 161 | * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface | 161 | * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface |
| 162 | * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, | 162 | * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, |
| 163 | * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. | 163 | * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. |
| 164 | * Following attributes are provided for drivers that generate full Beacon | ||
| 165 | * and Probe Response frames internally: %NL80211_ATTR_SSID, | ||
| 166 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, | ||
| 167 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | ||
| 168 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | ||
| 169 | * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP, | ||
| 170 | * %NL80211_ATTR_IE_ASSOC_RESP. | ||
| 164 | * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, | 171 | * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, |
| 165 | * parameters are like for %NL80211_CMD_SET_BEACON. | 172 | * parameters are like for %NL80211_CMD_SET_BEACON. |
| 166 | * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it | 173 | * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it |
| @@ -231,6 +238,8 @@ | |||
| 231 | * | 238 | * |
| 232 | * @NL80211_CMD_GET_SCAN: get scan results | 239 | * @NL80211_CMD_GET_SCAN: get scan results |
| 233 | * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters | 240 | * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters |
| 241 | * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the | ||
| 242 | * probe requests at CCK rate or not. | ||
| 234 | * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to | 243 | * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to |
| 235 | * NL80211_CMD_GET_SCAN and on the "scan" multicast group) | 244 | * NL80211_CMD_GET_SCAN and on the "scan" multicast group) |
| 236 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, | 245 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, |
| @@ -425,6 +434,8 @@ | |||
| 425 | * specified using %NL80211_ATTR_DURATION. When called, this operation | 434 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
| 426 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | 435 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the |
| 427 | * TX status event pertaining to the TX request. | 436 | * TX status event pertaining to the TX request. |
| 437 | * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the | ||
| 438 | * management frames at CCK rate or not in 2GHz band. | ||
| 428 | * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this | 439 | * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this |
| 429 | * command may be used with the corresponding cookie to cancel the wait | 440 | * command may be used with the corresponding cookie to cancel the wait |
| 430 | * time if it is known that it is no longer necessary. | 441 | * time if it is known that it is no longer necessary. |
| @@ -492,6 +503,12 @@ | |||
| 492 | * this command may also be sent by the driver as an MLME event to | 503 | * this command may also be sent by the driver as an MLME event to |
| 493 | * inform userspace of the new replay counter. | 504 | * inform userspace of the new replay counter. |
| 494 | * | 505 | * |
| 506 | * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace | ||
| 507 | * of PMKSA caching dandidates. | ||
| 508 | * | ||
| 509 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). | ||
| 510 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. | ||
| 511 | * | ||
| 495 | * @NL80211_CMD_MAX: highest used command number | 512 | * @NL80211_CMD_MAX: highest used command number |
| 496 | * @__NL80211_CMD_AFTER_LAST: internal use | 513 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 497 | */ | 514 | */ |
| @@ -616,6 +633,11 @@ enum nl80211_commands { | |||
| 616 | 633 | ||
| 617 | NL80211_CMD_SET_REKEY_OFFLOAD, | 634 | NL80211_CMD_SET_REKEY_OFFLOAD, |
| 618 | 635 | ||
| 636 | NL80211_CMD_PMKSA_CANDIDATE, | ||
| 637 | |||
| 638 | NL80211_CMD_TDLS_OPER, | ||
| 639 | NL80211_CMD_TDLS_MGMT, | ||
| 640 | |||
| 619 | /* add new commands above here */ | 641 | /* add new commands above here */ |
| 620 | 642 | ||
| 621 | /* used to define NL80211_CMD_MAX below */ | 643 | /* used to define NL80211_CMD_MAX below */ |
| @@ -762,6 +784,8 @@ enum nl80211_commands { | |||
| 762 | * that can be added to a scan request | 784 | * that can be added to a scan request |
| 763 | * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information | 785 | * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information |
| 764 | * elements that can be added to a scheduled scan request | 786 | * elements that can be added to a scheduled scan request |
| 787 | * @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be | ||
| 788 | * used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute. | ||
| 765 | * | 789 | * |
| 766 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 790 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
| 767 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 791 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
| @@ -842,18 +866,20 @@ enum nl80211_commands { | |||
| 842 | * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT | 866 | * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT |
| 843 | * event (u16) | 867 | * event (u16) |
| 844 | * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating | 868 | * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating |
| 845 | * that protected APs should be used. | 869 | * that protected APs should be used. This is also used with NEW_BEACON to |
| 870 | * indicate that the BSS is to use protection. | ||
| 846 | * | 871 | * |
| 847 | * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to | 872 | * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT, ASSOCIATE, and NEW_BEACON |
| 848 | * indicate which unicast key ciphers will be used with the connection | 873 | * to indicate which unicast key ciphers will be used with the connection |
| 849 | * (an array of u32). | 874 | * (an array of u32). |
| 850 | * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate | 875 | * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT, ASSOCIATE, and NEW_BEACON to |
| 851 | * which group key cipher will be used with the connection (a u32). | 876 | * indicate which group key cipher will be used with the connection (a |
| 852 | * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate | 877 | * u32). |
| 853 | * which WPA version(s) the AP we want to associate with is using | 878 | * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to |
| 879 | * indicate which WPA version(s) the AP we want to associate with is using | ||
| 854 | * (a u32 with flags from &enum nl80211_wpa_versions). | 880 | * (a u32 with flags from &enum nl80211_wpa_versions). |
| 855 | * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate | 881 | * @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to |
| 856 | * which key management algorithm(s) to use (an array of u32). | 882 | * indicate which key management algorithm(s) to use (an array of u32). |
| 857 | * | 883 | * |
| 858 | * @NL80211_ATTR_REQ_IE: (Re)association request information elements as | 884 | * @NL80211_ATTR_REQ_IE: (Re)association request information elements as |
| 859 | * sent out by the card, for ROAM and successful CONNECT events. | 885 | * sent out by the card, for ROAM and successful CONNECT events. |
| @@ -1002,6 +1028,24 @@ enum nl80211_commands { | |||
| 1002 | 1028 | ||
| 1003 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan | 1029 | * @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan |
| 1004 | * cycles, in msecs. | 1030 | * cycles, in msecs. |
| 1031 | |||
| 1032 | * @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more | ||
| 1033 | * sets of attributes to match during scheduled scans. Only BSSs | ||
| 1034 | * that match any of the sets will be reported. These are | ||
| 1035 | * pass-thru filter rules. | ||
| 1036 | * For a match to succeed, the BSS must match all attributes of a | ||
| 1037 | * set. Since not every hardware supports matching all types of | ||
| 1038 | * attributes, there is no guarantee that the reported BSSs are | ||
| 1039 | * fully complying with the match sets and userspace needs to be | ||
| 1040 | * able to ignore them by itself. | ||
| 1041 | * Thus, the implementation is somewhat hardware-dependent, but | ||
| 1042 | * this is only an optimization and the userspace application | ||
| 1043 | * needs to handle all the non-filtered results anyway. | ||
| 1044 | * If the match attributes don't make sense when combined with | ||
| 1045 | * the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID | ||
| 1046 | * is included in the probe request, but the match attributes | ||
| 1047 | * will never let it go through), -EINVAL may be returned. | ||
| 1048 | * If ommited, no filtering is done. | ||
| 1005 | * | 1049 | * |
| 1006 | * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported | 1050 | * @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported |
| 1007 | * interface combinations. In each nested item, it contains attributes | 1051 | * interface combinations. In each nested item, it contains attributes |
| @@ -1019,6 +1063,52 @@ enum nl80211_commands { | |||
| 1019 | * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but | 1063 | * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but |
| 1020 | * without the length restriction (at most %NL80211_MAX_SUPP_RATES). | 1064 | * without the length restriction (at most %NL80211_MAX_SUPP_RATES). |
| 1021 | * | 1065 | * |
| 1066 | * @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon | ||
| 1067 | * and Probe Response (when response to wildcard Probe Request); see | ||
| 1068 | * &enum nl80211_hidden_ssid, represented as a u32 | ||
| 1069 | * | ||
| 1070 | * @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame. | ||
| 1071 | * This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to | ||
| 1072 | * provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the | ||
| 1073 | * driver (or firmware) replies to Probe Request frames. | ||
| 1074 | * @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association | ||
| 1075 | * Response frames. This is used with %NL80211_CMD_NEW_BEACON and | ||
| 1076 | * %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into | ||
| 1077 | * (Re)Association Response frames when the driver (or firmware) replies to | ||
| 1078 | * (Re)Association Request frames. | ||
| 1079 | * | ||
| 1080 | * @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration | ||
| 1081 | * of the station, see &enum nl80211_sta_wme_attr. | ||
| 1082 | * @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working | ||
| 1083 | * as AP. | ||
| 1084 | * | ||
| 1085 | * @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of | ||
| 1086 | * roaming to another AP in the same ESS if the signal lever is low. | ||
| 1087 | * | ||
| 1088 | * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching | ||
| 1089 | * candidate information, see &enum nl80211_pmksa_candidate_attr. | ||
| 1090 | * | ||
| 1091 | * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not | ||
| 1092 | * for management frames transmission. In order to avoid p2p probe/action | ||
| 1093 | * frames are being transmitted at CCK rate in 2GHz band, the user space | ||
| 1094 | * applications use this attribute. | ||
| 1095 | * This attribute is used with %NL80211_CMD_TRIGGER_SCAN and | ||
| 1096 | * %NL80211_CMD_FRAME commands. | ||
| 1097 | * | ||
| 1098 | * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup | ||
| 1099 | * request, link setup confirm, link teardown, etc.). Values are | ||
| 1100 | * described in the TDLS (802.11z) specification. | ||
| 1101 | * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a | ||
| 1102 | * TDLS conversation between two devices. | ||
| 1103 | * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see | ||
| 1104 | * &enum nl80211_tdls_operation, represented as a u8. | ||
| 1105 | * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate | ||
| 1106 | * as a TDLS peer sta. | ||
| 1107 | * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown | ||
| 1108 | * procedures should be performed by sending TDLS packets via | ||
| 1109 | * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be | ||
| 1110 | * used for asking the driver to perform a TDLS operation. | ||
| 1111 | * | ||
| 1022 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1112 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 1023 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1113 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 1024 | */ | 1114 | */ |
| @@ -1224,6 +1314,29 @@ enum nl80211_attrs { | |||
| 1224 | 1314 | ||
| 1225 | NL80211_ATTR_SCAN_SUPP_RATES, | 1315 | NL80211_ATTR_SCAN_SUPP_RATES, |
| 1226 | 1316 | ||
| 1317 | NL80211_ATTR_HIDDEN_SSID, | ||
| 1318 | |||
| 1319 | NL80211_ATTR_IE_PROBE_RESP, | ||
| 1320 | NL80211_ATTR_IE_ASSOC_RESP, | ||
| 1321 | |||
| 1322 | NL80211_ATTR_STA_WME, | ||
| 1323 | NL80211_ATTR_SUPPORT_AP_UAPSD, | ||
| 1324 | |||
| 1325 | NL80211_ATTR_ROAM_SUPPORT, | ||
| 1326 | |||
| 1327 | NL80211_ATTR_SCHED_SCAN_MATCH, | ||
| 1328 | NL80211_ATTR_MAX_MATCH_SETS, | ||
| 1329 | |||
| 1330 | NL80211_ATTR_PMKSA_CANDIDATE, | ||
| 1331 | |||
| 1332 | NL80211_ATTR_TX_NO_CCK_RATE, | ||
| 1333 | |||
| 1334 | NL80211_ATTR_TDLS_ACTION, | ||
| 1335 | NL80211_ATTR_TDLS_DIALOG_TOKEN, | ||
| 1336 | NL80211_ATTR_TDLS_OPERATION, | ||
| 1337 | NL80211_ATTR_TDLS_SUPPORT, | ||
| 1338 | NL80211_ATTR_TDLS_EXTERNAL_SETUP, | ||
| 1339 | |||
| 1227 | /* add attributes here, update the policy in nl80211.c */ | 1340 | /* add attributes here, update the policy in nl80211.c */ |
| 1228 | 1341 | ||
| 1229 | __NL80211_ATTR_AFTER_LAST, | 1342 | __NL80211_ATTR_AFTER_LAST, |
| @@ -1321,6 +1434,7 @@ enum nl80211_iftype { | |||
| 1321 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable | 1434 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable |
| 1322 | * @NL80211_STA_FLAG_MFP: station uses management frame protection | 1435 | * @NL80211_STA_FLAG_MFP: station uses management frame protection |
| 1323 | * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated | 1436 | * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated |
| 1437 | * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer | ||
| 1324 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined | 1438 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined |
| 1325 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use | 1439 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use |
| 1326 | */ | 1440 | */ |
| @@ -1331,6 +1445,7 @@ enum nl80211_sta_flags { | |||
| 1331 | NL80211_STA_FLAG_WME, | 1445 | NL80211_STA_FLAG_WME, |
| 1332 | NL80211_STA_FLAG_MFP, | 1446 | NL80211_STA_FLAG_MFP, |
| 1333 | NL80211_STA_FLAG_AUTHENTICATED, | 1447 | NL80211_STA_FLAG_AUTHENTICATED, |
| 1448 | NL80211_STA_FLAG_TDLS_PEER, | ||
| 1334 | 1449 | ||
| 1335 | /* keep last */ | 1450 | /* keep last */ |
| 1336 | __NL80211_STA_FLAG_AFTER_LAST, | 1451 | __NL80211_STA_FLAG_AFTER_LAST, |
| @@ -1433,6 +1548,7 @@ enum nl80211_sta_bss_param { | |||
| 1433 | * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute | 1548 | * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute |
| 1434 | * containing info as possible, see &enum nl80211_sta_bss_param | 1549 | * containing info as possible, see &enum nl80211_sta_bss_param |
| 1435 | * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected | 1550 | * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected |
| 1551 | * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. | ||
| 1436 | * @__NL80211_STA_INFO_AFTER_LAST: internal | 1552 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
| 1437 | * @NL80211_STA_INFO_MAX: highest possible station info attribute | 1553 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
| 1438 | */ | 1554 | */ |
| @@ -1454,6 +1570,7 @@ enum nl80211_sta_info { | |||
| 1454 | NL80211_STA_INFO_RX_BITRATE, | 1570 | NL80211_STA_INFO_RX_BITRATE, |
| 1455 | NL80211_STA_INFO_BSS_PARAM, | 1571 | NL80211_STA_INFO_BSS_PARAM, |
| 1456 | NL80211_STA_INFO_CONNECTED_TIME, | 1572 | NL80211_STA_INFO_CONNECTED_TIME, |
| 1573 | NL80211_STA_INFO_STA_FLAGS, | ||
| 1457 | 1574 | ||
| 1458 | /* keep last */ | 1575 | /* keep last */ |
| 1459 | __NL80211_STA_INFO_AFTER_LAST, | 1576 | __NL80211_STA_INFO_AFTER_LAST, |
| @@ -1683,6 +1800,26 @@ enum nl80211_reg_rule_attr { | |||
| 1683 | }; | 1800 | }; |
| 1684 | 1801 | ||
| 1685 | /** | 1802 | /** |
| 1803 | * enum nl80211_sched_scan_match_attr - scheduled scan match attributes | ||
| 1804 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved | ||
| 1805 | * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, | ||
| 1806 | * only report BSS with matching SSID. | ||
| 1807 | * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter | ||
| 1808 | * attribute number currently defined | ||
| 1809 | * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use | ||
| 1810 | */ | ||
| 1811 | enum nl80211_sched_scan_match_attr { | ||
| 1812 | __NL80211_SCHED_SCAN_MATCH_ATTR_INVALID, | ||
| 1813 | |||
| 1814 | NL80211_ATTR_SCHED_SCAN_MATCH_SSID, | ||
| 1815 | |||
| 1816 | /* keep last */ | ||
| 1817 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, | ||
| 1818 | NL80211_SCHED_SCAN_MATCH_ATTR_MAX = | ||
| 1819 | __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1 | ||
| 1820 | }; | ||
| 1821 | |||
| 1822 | /** | ||
| 1686 | * enum nl80211_reg_rule_flags - regulatory rule flags | 1823 | * enum nl80211_reg_rule_flags - regulatory rule flags |
| 1687 | * | 1824 | * |
| 1688 | * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed | 1825 | * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed |
| @@ -1833,6 +1970,13 @@ enum nl80211_mntr_flags { | |||
| 1833 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a | 1970 | * @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a |
| 1834 | * source mesh point for path selection elements. | 1971 | * source mesh point for path selection elements. |
| 1835 | * | 1972 | * |
| 1973 | * @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between | ||
| 1974 | * root announcements are transmitted. | ||
| 1975 | * | ||
| 1976 | * @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has | ||
| 1977 | * access to a broader network beyond the MBSS. This is done via Root | ||
| 1978 | * Announcement frames. | ||
| 1979 | * | ||
| 1836 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | 1980 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute |
| 1837 | * | 1981 | * |
| 1838 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 1982 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
| @@ -1854,6 +1998,8 @@ enum nl80211_meshconf_params { | |||
| 1854 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, | 1998 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, |
| 1855 | NL80211_MESHCONF_HWMP_ROOTMODE, | 1999 | NL80211_MESHCONF_HWMP_ROOTMODE, |
| 1856 | NL80211_MESHCONF_ELEMENT_TTL, | 2000 | NL80211_MESHCONF_ELEMENT_TTL, |
| 2001 | NL80211_MESHCONF_HWMP_RANN_INTERVAL, | ||
| 2002 | NL80211_MESHCONF_GATE_ANNOUNCEMENTS, | ||
| 1857 | 2003 | ||
| 1858 | /* keep last */ | 2004 | /* keep last */ |
| 1859 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 2005 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
| @@ -2430,4 +2576,78 @@ enum nl80211_rekey_data { | |||
| 2430 | MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 | 2576 | MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1 |
| 2431 | }; | 2577 | }; |
| 2432 | 2578 | ||
| 2579 | /** | ||
| 2580 | * enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID | ||
| 2581 | * @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in | ||
| 2582 | * Beacon frames) | ||
| 2583 | * @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element | ||
| 2584 | * in Beacon frames | ||
| 2585 | * @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID | ||
| 2586 | * element in Beacon frames but zero out each byte in the SSID | ||
| 2587 | */ | ||
| 2588 | enum nl80211_hidden_ssid { | ||
| 2589 | NL80211_HIDDEN_SSID_NOT_IN_USE, | ||
| 2590 | NL80211_HIDDEN_SSID_ZERO_LEN, | ||
| 2591 | NL80211_HIDDEN_SSID_ZERO_CONTENTS | ||
| 2592 | }; | ||
| 2593 | |||
| 2594 | /** | ||
| 2595 | * enum nl80211_sta_wme_attr - station WME attributes | ||
| 2596 | * @__NL80211_STA_WME_INVALID: invalid number for nested attribute | ||
| 2597 | * @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format | ||
| 2598 | * is the same as the AC bitmap in the QoS info field. | ||
| 2599 | * @NL80211_STA_WME_MAX_SP: max service period. the format is the same | ||
| 2600 | * as the MAX_SP field in the QoS info field (but already shifted down). | ||
| 2601 | * @__NL80211_STA_WME_AFTER_LAST: internal | ||
| 2602 | * @NL80211_STA_WME_MAX: highest station WME attribute | ||
| 2603 | */ | ||
| 2604 | enum nl80211_sta_wme_attr { | ||
| 2605 | __NL80211_STA_WME_INVALID, | ||
| 2606 | NL80211_STA_WME_UAPSD_QUEUES, | ||
| 2607 | NL80211_STA_WME_MAX_SP, | ||
| 2608 | |||
| 2609 | /* keep last */ | ||
| 2610 | __NL80211_STA_WME_AFTER_LAST, | ||
| 2611 | NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1 | ||
| 2612 | }; | ||
| 2613 | |||
| 2614 | /** | ||
| 2615 | * enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates | ||
| 2616 | * @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes | ||
| 2617 | * @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher | ||
| 2618 | * priority) | ||
| 2619 | * @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets) | ||
| 2620 | * @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag) | ||
| 2621 | * @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes | ||
| 2622 | * (internal) | ||
| 2623 | * @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute | ||
| 2624 | * (internal) | ||
| 2625 | */ | ||
| 2626 | enum nl80211_pmksa_candidate_attr { | ||
| 2627 | __NL80211_PMKSA_CANDIDATE_INVALID, | ||
| 2628 | NL80211_PMKSA_CANDIDATE_INDEX, | ||
| 2629 | NL80211_PMKSA_CANDIDATE_BSSID, | ||
| 2630 | NL80211_PMKSA_CANDIDATE_PREAUTH, | ||
| 2631 | |||
| 2632 | /* keep last */ | ||
| 2633 | NUM_NL80211_PMKSA_CANDIDATE, | ||
| 2634 | MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1 | ||
| 2635 | }; | ||
| 2636 | |||
| 2637 | /** | ||
| 2638 | * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION | ||
| 2639 | * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request | ||
| 2640 | * @NL80211_TDLS_SETUP: Setup TDLS link | ||
| 2641 | * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established | ||
| 2642 | * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link | ||
| 2643 | * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link | ||
| 2644 | */ | ||
| 2645 | enum nl80211_tdls_operation { | ||
| 2646 | NL80211_TDLS_DISCOVERY_REQ, | ||
| 2647 | NL80211_TDLS_SETUP, | ||
| 2648 | NL80211_TDLS_TEARDOWN, | ||
| 2649 | NL80211_TDLS_ENABLE_LINK, | ||
| 2650 | NL80211_TDLS_DISABLE_LINK, | ||
| 2651 | }; | ||
| 2652 | |||
| 2433 | #endif /* __LINUX_NL80211_H */ | 2653 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 9fc01226055b..f1b1ca1a09e1 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -174,6 +174,8 @@ enum pci_dev_flags { | |||
| 174 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, | 174 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, |
| 175 | /* Device configuration is irrevocably lost if disabled into D3 */ | 175 | /* Device configuration is irrevocably lost if disabled into D3 */ |
| 176 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | 176 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, |
| 177 | /* Provide indication device is assigned by a Virtual Machine Manager */ | ||
| 178 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, | ||
| 177 | }; | 179 | }; |
| 178 | 180 | ||
| 179 | enum pci_irq_reroute_variant { | 181 | enum pci_irq_reroute_variant { |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index 6fb13841db45..f53a4167c5f4 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #define LINUX_PHONET_H | 24 | #define LINUX_PHONET_H |
| 25 | 25 | ||
| 26 | #include <linux/types.h> | 26 | #include <linux/types.h> |
| 27 | #include <linux/socket.h> | ||
| 27 | 28 | ||
| 28 | /* Automatic protocol selection */ | 29 | /* Automatic protocol selection */ |
| 29 | #define PN_PROTO_TRANSPORT 0 | 30 | #define PN_PROTO_TRANSPORT 0 |
| @@ -96,11 +97,11 @@ struct phonetmsg { | |||
| 96 | 97 | ||
| 97 | /* Phonet socket address structure */ | 98 | /* Phonet socket address structure */ |
| 98 | struct sockaddr_pn { | 99 | struct sockaddr_pn { |
| 99 | sa_family_t spn_family; | 100 | __kernel_sa_family_t spn_family; |
| 100 | __u8 spn_obj; | 101 | __u8 spn_obj; |
| 101 | __u8 spn_dev; | 102 | __u8 spn_dev; |
| 102 | __u8 spn_resource; | 103 | __u8 spn_resource; |
| 103 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | 104 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3]; |
| 104 | } __attribute__((packed)); | 105 | } __attribute__((packed)); |
| 105 | 106 | ||
| 106 | /* Well known address */ | 107 | /* Well known address */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 54fc4138955f..79f337c47388 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -420,7 +420,7 @@ struct phy_driver { | |||
| 420 | 420 | ||
| 421 | /* | 421 | /* |
| 422 | * Requests a Tx timestamp for 'skb'. The phy driver promises | 422 | * Requests a Tx timestamp for 'skb'. The phy driver promises |
| 423 | * to deliver it to the socket's error queue as soon as a | 423 | * to deliver it using skb_complete_tx_timestamp() as soon as a |
| 424 | * timestamp becomes available. One of the PTP_CLASS_ values | 424 | * timestamp becomes available. One of the PTP_CLASS_ values |
| 425 | * is passed in 'type'. | 425 | * is passed in 'type'. |
| 426 | */ | 426 | */ |
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h index a175d0598033..4d09f6eab359 100644 --- a/include/linux/rfkill-gpio.h +++ b/include/linux/rfkill-gpio.h | |||
| @@ -30,6 +30,8 @@ | |||
| 30 | * @reset_gpio: GPIO which is used for reseting rfkill switch | 30 | * @reset_gpio: GPIO which is used for reseting rfkill switch |
| 31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch | 31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch |
| 32 | * @power_clk_name: [optional] name of clk to turn off while blocked | 32 | * @power_clk_name: [optional] name of clk to turn off while blocked |
| 33 | * @gpio_runtime_close: clean up platform specific gpio configuration | ||
| 34 | * @gpio_runtime_setup: set up platform specific gpio configuration | ||
| 33 | */ | 35 | */ |
| 34 | 36 | ||
| 35 | struct rfkill_gpio_platform_data { | 37 | struct rfkill_gpio_platform_data { |
| @@ -38,6 +40,8 @@ struct rfkill_gpio_platform_data { | |||
| 38 | int shutdown_gpio; | 40 | int shutdown_gpio; |
| 39 | const char *power_clk_name; | 41 | const char *power_clk_name; |
| 40 | enum rfkill_type type; | 42 | enum rfkill_type type; |
| 43 | void (*gpio_runtime_close)(struct platform_device *); | ||
| 44 | int (*gpio_runtime_setup)(struct platform_device *); | ||
| 41 | }; | 45 | }; |
| 42 | 46 | ||
| 43 | #endif /* __RFKILL_GPIO_H */ | 47 | #endif /* __RFKILL_GPIO_H */ |
diff --git a/include/linux/rose.h b/include/linux/rose.h index c7b4b184c82e..1fcfe95893b8 100644 --- a/include/linux/rose.h +++ b/include/linux/rose.h | |||
| @@ -7,6 +7,9 @@ | |||
| 7 | #ifndef ROSE_KERNEL_H | 7 | #ifndef ROSE_KERNEL_H |
| 8 | #define ROSE_KERNEL_H | 8 | #define ROSE_KERNEL_H |
| 9 | 9 | ||
| 10 | #include <linux/socket.h> | ||
| 11 | #include <linux/ax25.h> | ||
| 12 | |||
| 10 | #define ROSE_MTU 251 | 13 | #define ROSE_MTU 251 |
| 11 | 14 | ||
| 12 | #define ROSE_MAX_DIGIS 6 | 15 | #define ROSE_MAX_DIGIS 6 |
| @@ -44,7 +47,7 @@ typedef struct { | |||
| 44 | } rose_address; | 47 | } rose_address; |
| 45 | 48 | ||
| 46 | struct sockaddr_rose { | 49 | struct sockaddr_rose { |
| 47 | sa_family_t srose_family; | 50 | __kernel_sa_family_t srose_family; |
| 48 | rose_address srose_addr; | 51 | rose_address srose_addr; |
| 49 | ax25_address srose_call; | 52 | ax25_address srose_call; |
| 50 | int srose_ndigis; | 53 | int srose_ndigis; |
| @@ -52,7 +55,7 @@ struct sockaddr_rose { | |||
| 52 | }; | 55 | }; |
| 53 | 56 | ||
| 54 | struct full_sockaddr_rose { | 57 | struct full_sockaddr_rose { |
| 55 | sa_family_t srose_family; | 58 | __kernel_sa_family_t srose_family; |
| 56 | rose_address srose_addr; | 59 | rose_address srose_addr; |
| 57 | ax25_address srose_call; | 60 | ax25_address srose_call; |
| 58 | unsigned int srose_ndigis; | 61 | unsigned int srose_ndigis; |
diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h new file mode 100644 index 000000000000..2076acf8294d --- /dev/null +++ b/include/linux/sh_eth.h | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | #ifndef __ASM_SH_ETH_H__ | ||
| 2 | #define __ASM_SH_ETH_H__ | ||
| 3 | |||
| 4 | #include <linux/phy.h> | ||
| 5 | |||
| 6 | enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN}; | ||
| 7 | enum { | ||
| 8 | SH_ETH_REG_GIGABIT, | ||
| 9 | SH_ETH_REG_FAST_SH4, | ||
| 10 | SH_ETH_REG_FAST_SH3_SH2 | ||
| 11 | }; | ||
| 12 | |||
| 13 | struct sh_eth_plat_data { | ||
| 14 | int phy; | ||
| 15 | int edmac_endian; | ||
| 16 | int register_type; | ||
| 17 | phy_interface_t phy_interface; | ||
| 18 | void (*set_mdio_gate)(void *addr); | ||
| 19 | |||
| 20 | unsigned char mac_addr[6]; | ||
| 21 | unsigned no_ether_link:1; | ||
| 22 | unsigned ether_link_active_low:1; | ||
| 23 | }; | ||
| 24 | |||
| 25 | #endif | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 8bd383caa363..6a6b352326d7 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | #include <linux/rcupdate.h> | 29 | #include <linux/rcupdate.h> |
| 30 | #include <linux/dmaengine.h> | 30 | #include <linux/dmaengine.h> |
| 31 | #include <linux/hrtimer.h> | 31 | #include <linux/hrtimer.h> |
| 32 | #include <linux/dma-mapping.h> | ||
| 32 | 33 | ||
| 33 | /* Don't change this without changing skb_csum_unnecessary! */ | 34 | /* Don't change this without changing skb_csum_unnecessary! */ |
| 34 | #define CHECKSUM_NONE 0 | 35 | #define CHECKSUM_NONE 0 |
| @@ -45,6 +46,11 @@ | |||
| 45 | #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) | 46 | #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) |
| 46 | #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) | 47 | #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) |
| 47 | 48 | ||
| 49 | /* return minimum truesize of one skb containing X bytes of data */ | ||
| 50 | #define SKB_TRUESIZE(X) ((X) + \ | ||
| 51 | SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \ | ||
| 52 | SKB_DATA_ALIGN(sizeof(struct skb_shared_info))) | ||
| 53 | |||
| 48 | /* A. Checksumming of received packets by device. | 54 | /* A. Checksumming of received packets by device. |
| 49 | * | 55 | * |
| 50 | * NONE: device failed to checksum this packet. | 56 | * NONE: device failed to checksum this packet. |
| @@ -134,7 +140,9 @@ struct sk_buff; | |||
| 134 | typedef struct skb_frag_struct skb_frag_t; | 140 | typedef struct skb_frag_struct skb_frag_t; |
| 135 | 141 | ||
| 136 | struct skb_frag_struct { | 142 | struct skb_frag_struct { |
| 137 | struct page *page; | 143 | struct { |
| 144 | struct page *p; | ||
| 145 | } page; | ||
| 138 | #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536) | 146 | #if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536) |
| 139 | __u32 page_offset; | 147 | __u32 page_offset; |
| 140 | __u32 size; | 148 | __u32 size; |
| @@ -144,6 +152,26 @@ struct skb_frag_struct { | |||
| 144 | #endif | 152 | #endif |
| 145 | }; | 153 | }; |
| 146 | 154 | ||
| 155 | static inline unsigned int skb_frag_size(const skb_frag_t *frag) | ||
| 156 | { | ||
| 157 | return frag->size; | ||
| 158 | } | ||
| 159 | |||
| 160 | static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size) | ||
| 161 | { | ||
| 162 | frag->size = size; | ||
| 163 | } | ||
| 164 | |||
| 165 | static inline void skb_frag_size_add(skb_frag_t *frag, int delta) | ||
| 166 | { | ||
| 167 | frag->size += delta; | ||
| 168 | } | ||
| 169 | |||
| 170 | static inline void skb_frag_size_sub(skb_frag_t *frag, int delta) | ||
| 171 | { | ||
| 172 | frag->size -= delta; | ||
| 173 | } | ||
| 174 | |||
| 147 | #define HAVE_HW_TIME_STAMP | 175 | #define HAVE_HW_TIME_STAMP |
| 148 | 176 | ||
| 149 | /** | 177 | /** |
| @@ -322,6 +350,8 @@ typedef unsigned char *sk_buff_data_t; | |||
| 322 | * @queue_mapping: Queue mapping for multiqueue devices | 350 | * @queue_mapping: Queue mapping for multiqueue devices |
| 323 | * @ndisc_nodetype: router type (from link layer) | 351 | * @ndisc_nodetype: router type (from link layer) |
| 324 | * @ooo_okay: allow the mapping of a socket to a queue to be changed | 352 | * @ooo_okay: allow the mapping of a socket to a queue to be changed |
| 353 | * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport | ||
| 354 | * ports. | ||
| 325 | * @dma_cookie: a cookie to one of several possible DMA operations | 355 | * @dma_cookie: a cookie to one of several possible DMA operations |
| 326 | * done by skb DMA functions | 356 | * done by skb DMA functions |
| 327 | * @secmark: security marking | 357 | * @secmark: security marking |
| @@ -414,6 +444,7 @@ struct sk_buff { | |||
| 414 | __u8 ndisc_nodetype:2; | 444 | __u8 ndisc_nodetype:2; |
| 415 | #endif | 445 | #endif |
| 416 | __u8 ooo_okay:1; | 446 | __u8 ooo_okay:1; |
| 447 | __u8 l4_rxhash:1; | ||
| 417 | kmemcheck_bitfield_end(flags2); | 448 | kmemcheck_bitfield_end(flags2); |
| 418 | 449 | ||
| 419 | /* 0/13 bit hole */ | 450 | /* 0/13 bit hole */ |
| @@ -521,6 +552,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | |||
| 521 | return __alloc_skb(size, priority, 1, NUMA_NO_NODE); | 552 | return __alloc_skb(size, priority, 1, NUMA_NO_NODE); |
| 522 | } | 553 | } |
| 523 | 554 | ||
| 555 | extern void skb_recycle(struct sk_buff *skb); | ||
| 524 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); | 556 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); |
| 525 | 557 | ||
| 526 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); | 558 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); |
| @@ -573,11 +605,11 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |||
| 573 | unsigned int to, struct ts_config *config, | 605 | unsigned int to, struct ts_config *config, |
| 574 | struct ts_state *state); | 606 | struct ts_state *state); |
| 575 | 607 | ||
| 576 | extern __u32 __skb_get_rxhash(struct sk_buff *skb); | 608 | extern void __skb_get_rxhash(struct sk_buff *skb); |
| 577 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) | 609 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) |
| 578 | { | 610 | { |
| 579 | if (!skb->rxhash) | 611 | if (!skb->rxhash) |
| 580 | skb->rxhash = __skb_get_rxhash(skb); | 612 | __skb_get_rxhash(skb); |
| 581 | 613 | ||
| 582 | return skb->rxhash; | 614 | return skb->rxhash; |
| 583 | } | 615 | } |
| @@ -823,9 +855,9 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | |||
| 823 | * The reference count is not incremented and the reference is therefore | 855 | * The reference count is not incremented and the reference is therefore |
| 824 | * volatile. Use with caution. | 856 | * volatile. Use with caution. |
| 825 | */ | 857 | */ |
| 826 | static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) | 858 | static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_) |
| 827 | { | 859 | { |
| 828 | struct sk_buff *list = ((struct sk_buff *)list_)->next; | 860 | struct sk_buff *list = ((const struct sk_buff *)list_)->next; |
| 829 | if (list == (struct sk_buff *)list_) | 861 | if (list == (struct sk_buff *)list_) |
| 830 | list = NULL; | 862 | list = NULL; |
| 831 | return list; | 863 | return list; |
| @@ -844,9 +876,9 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) | |||
| 844 | * The reference count is not incremented and the reference is therefore | 876 | * The reference count is not incremented and the reference is therefore |
| 845 | * volatile. Use with caution. | 877 | * volatile. Use with caution. |
| 846 | */ | 878 | */ |
| 847 | static inline struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) | 879 | static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_) |
| 848 | { | 880 | { |
| 849 | struct sk_buff *list = ((struct sk_buff *)list_)->prev; | 881 | struct sk_buff *list = ((const struct sk_buff *)list_)->prev; |
| 850 | if (list == (struct sk_buff *)list_) | 882 | if (list == (struct sk_buff *)list_) |
| 851 | list = NULL; | 883 | list = NULL; |
| 852 | return list; | 884 | return list; |
| @@ -1123,18 +1155,51 @@ static inline int skb_pagelen(const struct sk_buff *skb) | |||
| 1123 | int i, len = 0; | 1155 | int i, len = 0; |
| 1124 | 1156 | ||
| 1125 | for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) | 1157 | for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) |
| 1126 | len += skb_shinfo(skb)->frags[i].size; | 1158 | len += skb_frag_size(&skb_shinfo(skb)->frags[i]); |
| 1127 | return len + skb_headlen(skb); | 1159 | return len + skb_headlen(skb); |
| 1128 | } | 1160 | } |
| 1129 | 1161 | ||
| 1130 | static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | 1162 | /** |
| 1131 | struct page *page, int off, int size) | 1163 | * __skb_fill_page_desc - initialise a paged fragment in an skb |
| 1164 | * @skb: buffer containing fragment to be initialised | ||
| 1165 | * @i: paged fragment index to initialise | ||
| 1166 | * @page: the page to use for this fragment | ||
| 1167 | * @off: the offset to the data with @page | ||
| 1168 | * @size: the length of the data | ||
| 1169 | * | ||
| 1170 | * Initialises the @i'th fragment of @skb to point to &size bytes at | ||
| 1171 | * offset @off within @page. | ||
| 1172 | * | ||
| 1173 | * Does not take any additional reference on the fragment. | ||
| 1174 | */ | ||
| 1175 | static inline void __skb_fill_page_desc(struct sk_buff *skb, int i, | ||
| 1176 | struct page *page, int off, int size) | ||
| 1132 | { | 1177 | { |
| 1133 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | 1178 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; |
| 1134 | 1179 | ||
| 1135 | frag->page = page; | 1180 | frag->page.p = page; |
| 1136 | frag->page_offset = off; | 1181 | frag->page_offset = off; |
| 1137 | frag->size = size; | 1182 | skb_frag_size_set(frag, size); |
| 1183 | } | ||
| 1184 | |||
| 1185 | /** | ||
| 1186 | * skb_fill_page_desc - initialise a paged fragment in an skb | ||
| 1187 | * @skb: buffer containing fragment to be initialised | ||
| 1188 | * @i: paged fragment index to initialise | ||
| 1189 | * @page: the page to use for this fragment | ||
| 1190 | * @off: the offset to the data with @page | ||
| 1191 | * @size: the length of the data | ||
| 1192 | * | ||
| 1193 | * As per __skb_fill_page_desc() -- initialises the @i'th fragment of | ||
| 1194 | * @skb to point to &size bytes at offset @off within @page. In | ||
| 1195 | * addition updates @skb such that @i is the last fragment. | ||
| 1196 | * | ||
| 1197 | * Does not take any additional reference on the fragment. | ||
| 1198 | */ | ||
| 1199 | static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | ||
| 1200 | struct page *page, int off, int size) | ||
| 1201 | { | ||
| 1202 | __skb_fill_page_desc(skb, i, page, off, size); | ||
| 1138 | skb_shinfo(skb)->nr_frags = i + 1; | 1203 | skb_shinfo(skb)->nr_frags = i + 1; |
| 1139 | } | 1204 | } |
| 1140 | 1205 | ||
| @@ -1629,6 +1694,137 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page) | |||
| 1629 | } | 1694 | } |
| 1630 | 1695 | ||
| 1631 | /** | 1696 | /** |
| 1697 | * skb_frag_page - retrieve the page refered to by a paged fragment | ||
| 1698 | * @frag: the paged fragment | ||
| 1699 | * | ||
| 1700 | * Returns the &struct page associated with @frag. | ||
| 1701 | */ | ||
| 1702 | static inline struct page *skb_frag_page(const skb_frag_t *frag) | ||
| 1703 | { | ||
| 1704 | return frag->page.p; | ||
| 1705 | } | ||
| 1706 | |||
| 1707 | /** | ||
| 1708 | * __skb_frag_ref - take an addition reference on a paged fragment. | ||
| 1709 | * @frag: the paged fragment | ||
| 1710 | * | ||
| 1711 | * Takes an additional reference on the paged fragment @frag. | ||
| 1712 | */ | ||
| 1713 | static inline void __skb_frag_ref(skb_frag_t *frag) | ||
| 1714 | { | ||
| 1715 | get_page(skb_frag_page(frag)); | ||
| 1716 | } | ||
| 1717 | |||
| 1718 | /** | ||
| 1719 | * skb_frag_ref - take an addition reference on a paged fragment of an skb. | ||
| 1720 | * @skb: the buffer | ||
| 1721 | * @f: the fragment offset. | ||
| 1722 | * | ||
| 1723 | * Takes an additional reference on the @f'th paged fragment of @skb. | ||
| 1724 | */ | ||
| 1725 | static inline void skb_frag_ref(struct sk_buff *skb, int f) | ||
| 1726 | { | ||
| 1727 | __skb_frag_ref(&skb_shinfo(skb)->frags[f]); | ||
| 1728 | } | ||
| 1729 | |||
| 1730 | /** | ||
| 1731 | * __skb_frag_unref - release a reference on a paged fragment. | ||
| 1732 | * @frag: the paged fragment | ||
| 1733 | * | ||
| 1734 | * Releases a reference on the paged fragment @frag. | ||
| 1735 | */ | ||
| 1736 | static inline void __skb_frag_unref(skb_frag_t *frag) | ||
| 1737 | { | ||
| 1738 | put_page(skb_frag_page(frag)); | ||
| 1739 | } | ||
| 1740 | |||
| 1741 | /** | ||
| 1742 | * skb_frag_unref - release a reference on a paged fragment of an skb. | ||
| 1743 | * @skb: the buffer | ||
| 1744 | * @f: the fragment offset | ||
| 1745 | * | ||
| 1746 | * Releases a reference on the @f'th paged fragment of @skb. | ||
| 1747 | */ | ||
| 1748 | static inline void skb_frag_unref(struct sk_buff *skb, int f) | ||
| 1749 | { | ||
| 1750 | __skb_frag_unref(&skb_shinfo(skb)->frags[f]); | ||
| 1751 | } | ||
| 1752 | |||
| 1753 | /** | ||
| 1754 | * skb_frag_address - gets the address of the data contained in a paged fragment | ||
| 1755 | * @frag: the paged fragment buffer | ||
| 1756 | * | ||
| 1757 | * Returns the address of the data within @frag. The page must already | ||
| 1758 | * be mapped. | ||
| 1759 | */ | ||
| 1760 | static inline void *skb_frag_address(const skb_frag_t *frag) | ||
| 1761 | { | ||
| 1762 | return page_address(skb_frag_page(frag)) + frag->page_offset; | ||
| 1763 | } | ||
| 1764 | |||
| 1765 | /** | ||
| 1766 | * skb_frag_address_safe - gets the address of the data contained in a paged fragment | ||
| 1767 | * @frag: the paged fragment buffer | ||
| 1768 | * | ||
| 1769 | * Returns the address of the data within @frag. Checks that the page | ||
| 1770 | * is mapped and returns %NULL otherwise. | ||
| 1771 | */ | ||
| 1772 | static inline void *skb_frag_address_safe(const skb_frag_t *frag) | ||
| 1773 | { | ||
| 1774 | void *ptr = page_address(skb_frag_page(frag)); | ||
| 1775 | if (unlikely(!ptr)) | ||
| 1776 | return NULL; | ||
| 1777 | |||
| 1778 | return ptr + frag->page_offset; | ||
| 1779 | } | ||
| 1780 | |||
| 1781 | /** | ||
| 1782 | * __skb_frag_set_page - sets the page contained in a paged fragment | ||
| 1783 | * @frag: the paged fragment | ||
| 1784 | * @page: the page to set | ||
| 1785 | * | ||
| 1786 | * Sets the fragment @frag to contain @page. | ||
| 1787 | */ | ||
| 1788 | static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page) | ||
| 1789 | { | ||
| 1790 | frag->page.p = page; | ||
| 1791 | } | ||
| 1792 | |||
| 1793 | /** | ||
| 1794 | * skb_frag_set_page - sets the page contained in a paged fragment of an skb | ||
| 1795 | * @skb: the buffer | ||
| 1796 | * @f: the fragment offset | ||
| 1797 | * @page: the page to set | ||
| 1798 | * | ||
| 1799 | * Sets the @f'th fragment of @skb to contain @page. | ||
| 1800 | */ | ||
| 1801 | static inline void skb_frag_set_page(struct sk_buff *skb, int f, | ||
| 1802 | struct page *page) | ||
| 1803 | { | ||
| 1804 | __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page); | ||
| 1805 | } | ||
| 1806 | |||
| 1807 | /** | ||
| 1808 | * skb_frag_dma_map - maps a paged fragment via the DMA API | ||
| 1809 | * @device: the device to map the fragment to | ||
| 1810 | * @frag: the paged fragment to map | ||
| 1811 | * @offset: the offset within the fragment (starting at the | ||
| 1812 | * fragment's own offset) | ||
| 1813 | * @size: the number of bytes to map | ||
| 1814 | * @direction: the direction of the mapping (%PCI_DMA_*) | ||
| 1815 | * | ||
| 1816 | * Maps the page associated with @frag to @device. | ||
| 1817 | */ | ||
| 1818 | static inline dma_addr_t skb_frag_dma_map(struct device *dev, | ||
| 1819 | const skb_frag_t *frag, | ||
| 1820 | size_t offset, size_t size, | ||
| 1821 | enum dma_data_direction dir) | ||
| 1822 | { | ||
| 1823 | return dma_map_page(dev, skb_frag_page(frag), | ||
| 1824 | frag->page_offset + offset, size, dir); | ||
| 1825 | } | ||
| 1826 | |||
| 1827 | /** | ||
| 1632 | * skb_clone_writable - is the header of a clone writable | 1828 | * skb_clone_writable - is the header of a clone writable |
| 1633 | * @skb: buffer to check | 1829 | * @skb: buffer to check |
| 1634 | * @len: length up to which to write | 1830 | * @len: length up to which to write |
| @@ -1636,7 +1832,7 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page) | |||
| 1636 | * Returns true if modifying the header part of the cloned buffer | 1832 | * Returns true if modifying the header part of the cloned buffer |
| 1637 | * does not requires the data to be copied. | 1833 | * does not requires the data to be copied. |
| 1638 | */ | 1834 | */ |
| 1639 | static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len) | 1835 | static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len) |
| 1640 | { | 1836 | { |
| 1641 | return !skb_header_cloned(skb) && | 1837 | return !skb_header_cloned(skb) && |
| 1642 | skb_headroom(skb) + len <= skb->hdr_len; | 1838 | skb_headroom(skb) + len <= skb->hdr_len; |
| @@ -1730,13 +1926,13 @@ static inline int skb_add_data(struct sk_buff *skb, | |||
| 1730 | } | 1926 | } |
| 1731 | 1927 | ||
| 1732 | static inline int skb_can_coalesce(struct sk_buff *skb, int i, | 1928 | static inline int skb_can_coalesce(struct sk_buff *skb, int i, |
| 1733 | struct page *page, int off) | 1929 | const struct page *page, int off) |
| 1734 | { | 1930 | { |
| 1735 | if (i) { | 1931 | if (i) { |
| 1736 | struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; | 1932 | const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; |
| 1737 | 1933 | ||
| 1738 | return page == frag->page && | 1934 | return page == skb_frag_page(frag) && |
| 1739 | off == frag->page_offset + frag->size; | 1935 | off == frag->page_offset + skb_frag_size(frag); |
| 1740 | } | 1936 | } |
| 1741 | return 0; | 1937 | return 0; |
| 1742 | } | 1938 | } |
| @@ -2020,8 +2216,13 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb) | |||
| 2020 | /** | 2216 | /** |
| 2021 | * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps | 2217 | * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps |
| 2022 | * | 2218 | * |
| 2219 | * PHY drivers may accept clones of transmitted packets for | ||
| 2220 | * timestamping via their phy_driver.txtstamp method. These drivers | ||
| 2221 | * must call this function to return the skb back to the stack, with | ||
| 2222 | * or without a timestamp. | ||
| 2223 | * | ||
| 2023 | * @skb: clone of the the original outgoing packet | 2224 | * @skb: clone of the the original outgoing packet |
| 2024 | * @hwtstamps: hardware time stamps | 2225 | * @hwtstamps: hardware time stamps, may be NULL if not available |
| 2025 | * | 2226 | * |
| 2026 | */ | 2227 | */ |
| 2027 | void skb_complete_tx_timestamp(struct sk_buff *skb, | 2228 | void skb_complete_tx_timestamp(struct sk_buff *skb, |
| @@ -2257,7 +2458,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb) | |||
| 2257 | { | 2458 | { |
| 2258 | /* LRO sets gso_size but not gso_type, whereas if GSO is really | 2459 | /* LRO sets gso_size but not gso_type, whereas if GSO is really |
| 2259 | * wanted then gso_type will be set. */ | 2460 | * wanted then gso_type will be set. */ |
| 2260 | struct skb_shared_info *shinfo = skb_shinfo(skb); | 2461 | const struct skb_shared_info *shinfo = skb_shinfo(skb); |
| 2462 | |||
| 2261 | if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && | 2463 | if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && |
| 2262 | unlikely(shinfo->gso_type == 0)) { | 2464 | unlikely(shinfo->gso_type == 0)) { |
| 2263 | __skb_warn_lro_forwarding(skb); | 2465 | __skb_warn_lro_forwarding(skb); |
| @@ -2281,7 +2483,7 @@ static inline void skb_forward_csum(struct sk_buff *skb) | |||
| 2281 | * Instead of forcing ip_summed to CHECKSUM_NONE, we can | 2483 | * Instead of forcing ip_summed to CHECKSUM_NONE, we can |
| 2282 | * use this helper, to document places where we make this assertion. | 2484 | * use this helper, to document places where we make this assertion. |
| 2283 | */ | 2485 | */ |
| 2284 | static inline void skb_checksum_none_assert(struct sk_buff *skb) | 2486 | static inline void skb_checksum_none_assert(const struct sk_buff *skb) |
| 2285 | { | 2487 | { |
| 2286 | #ifdef DEBUG | 2488 | #ifdef DEBUG |
| 2287 | BUG_ON(skb->ip_summed != CHECKSUM_NONE); | 2489 | BUG_ON(skb->ip_summed != CHECKSUM_NONE); |
| @@ -2290,5 +2492,25 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb) | |||
| 2290 | 2492 | ||
| 2291 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); | 2493 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); |
| 2292 | 2494 | ||
| 2495 | static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size) | ||
| 2496 | { | ||
| 2497 | if (irqs_disabled()) | ||
| 2498 | return false; | ||
| 2499 | |||
| 2500 | if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY) | ||
| 2501 | return false; | ||
| 2502 | |||
| 2503 | if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE) | ||
| 2504 | return false; | ||
| 2505 | |||
| 2506 | skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD); | ||
| 2507 | if (skb_end_pointer(skb) - skb->head < skb_size) | ||
| 2508 | return false; | ||
| 2509 | |||
| 2510 | if (skb_shared(skb) || skb_cloned(skb)) | ||
| 2511 | return false; | ||
| 2512 | |||
| 2513 | return true; | ||
| 2514 | } | ||
| 2293 | #endif /* __KERNEL__ */ | 2515 | #endif /* __KERNEL__ */ |
| 2294 | #endif /* _LINUX_SKBUFF_H */ | 2516 | #endif /* _LINUX_SKBUFF_H */ |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 8623217f84d0..f10ed7b4a714 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
| @@ -25,7 +25,7 @@ struct ssb_sprom { | |||
| 25 | u8 et1phyaddr; /* MII address for enet1 */ | 25 | u8 et1phyaddr; /* MII address for enet1 */ |
| 26 | u8 et0mdcport; /* MDIO for enet0 */ | 26 | u8 et0mdcport; /* MDIO for enet0 */ |
| 27 | u8 et1mdcport; /* MDIO for enet1 */ | 27 | u8 et1mdcport; /* MDIO for enet1 */ |
| 28 | u8 board_rev; /* Board revision number from SPROM. */ | 28 | u16 board_rev; /* Board revision number from SPROM. */ |
| 29 | u8 country_code; /* Country Code */ | 29 | u8 country_code; /* Country Code */ |
| 30 | u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ | 30 | u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */ |
| 31 | u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ | 31 | u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */ |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index efbf459d571c..98941203a27f 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
| @@ -462,6 +462,46 @@ | |||
| 462 | #define SSB_SPROM8_OFDM5GLPO 0x014A /* 5.2GHz OFDM power offset */ | 462 | #define SSB_SPROM8_OFDM5GLPO 0x014A /* 5.2GHz OFDM power offset */ |
| 463 | #define SSB_SPROM8_OFDM5GHPO 0x014E /* 5.8GHz OFDM power offset */ | 463 | #define SSB_SPROM8_OFDM5GHPO 0x014E /* 5.8GHz OFDM power offset */ |
| 464 | 464 | ||
| 465 | /* Values for boardflags_lo read from SPROM */ | ||
| 466 | #define SSB_BFL_BTCOEXIST 0x0001 /* implements Bluetooth coexistance */ | ||
| 467 | #define SSB_BFL_PACTRL 0x0002 /* GPIO 9 controlling the PA */ | ||
| 468 | #define SSB_BFL_AIRLINEMODE 0x0004 /* implements GPIO 13 radio disable indication */ | ||
| 469 | #define SSB_BFL_RSSI 0x0008 /* software calculates nrssi slope. */ | ||
| 470 | #define SSB_BFL_ENETSPI 0x0010 /* has ephy roboswitch spi */ | ||
| 471 | #define SSB_BFL_XTAL_NOSLOW 0x0020 /* no slow clock available */ | ||
| 472 | #define SSB_BFL_CCKHIPWR 0x0040 /* can do high power CCK transmission */ | ||
| 473 | #define SSB_BFL_ENETADM 0x0080 /* has ADMtek switch */ | ||
| 474 | #define SSB_BFL_ENETVLAN 0x0100 /* can do vlan */ | ||
| 475 | #define SSB_BFL_AFTERBURNER 0x0200 /* supports Afterburner mode */ | ||
| 476 | #define SSB_BFL_NOPCI 0x0400 /* board leaves PCI floating */ | ||
| 477 | #define SSB_BFL_FEM 0x0800 /* supports the Front End Module */ | ||
| 478 | #define SSB_BFL_EXTLNA 0x1000 /* has an external LNA */ | ||
| 479 | #define SSB_BFL_HGPA 0x2000 /* had high gain PA */ | ||
| 480 | #define SSB_BFL_BTCMOD 0x4000 /* BFL_BTCOEXIST is given in alternate GPIOs */ | ||
| 481 | #define SSB_BFL_ALTIQ 0x8000 /* alternate I/Q settings */ | ||
| 482 | |||
| 483 | /* Values for boardflags_hi read from SPROM */ | ||
| 484 | #define SSB_BFH_NOPA 0x0001 /* has no PA */ | ||
| 485 | #define SSB_BFH_RSSIINV 0x0002 /* RSSI uses positive slope (not TSSI) */ | ||
| 486 | #define SSB_BFH_PAREF 0x0004 /* uses the PARef LDO */ | ||
| 487 | #define SSB_BFH_3TSWITCH 0x0008 /* uses a triple throw switch shared with bluetooth */ | ||
| 488 | #define SSB_BFH_PHASESHIFT 0x0010 /* can support phase shifter */ | ||
| 489 | #define SSB_BFH_BUCKBOOST 0x0020 /* has buck/booster */ | ||
| 490 | #define SSB_BFH_FEM_BT 0x0040 /* has FEM and switch to share antenna with bluetooth */ | ||
| 491 | |||
| 492 | /* Values for boardflags2_lo read from SPROM */ | ||
| 493 | #define SSB_BFL2_RXBB_INT_REG_DIS 0x0001 /* external RX BB regulator present */ | ||
| 494 | #define SSB_BFL2_APLL_WAR 0x0002 /* alternative A-band PLL settings implemented */ | ||
| 495 | #define SSB_BFL2_TXPWRCTRL_EN 0x0004 /* permits enabling TX Power Control */ | ||
| 496 | #define SSB_BFL2_2X4_DIV 0x0008 /* 2x4 diversity switch */ | ||
| 497 | #define SSB_BFL2_5G_PWRGAIN 0x0010 /* supports 5G band power gain */ | ||
| 498 | #define SSB_BFL2_PCIEWAR_OVR 0x0020 /* overrides ASPM and Clkreq settings */ | ||
| 499 | #define SSB_BFL2_CAESERS_BRD 0x0040 /* is Caesers board (unused) */ | ||
| 500 | #define SSB_BFL2_BTC3WIRE 0x0080 /* used 3-wire bluetooth coexist */ | ||
| 501 | #define SSB_BFL2_SKWRKFEM_BRD 0x0100 /* 4321mcm93 uses Skyworks FEM */ | ||
| 502 | #define SSB_BFL2_SPUR_WAR 0x0200 /* has a workaround for clock-harmonic spurs */ | ||
| 503 | #define SSB_BFL2_GPLL_WAR 0x0400 /* altenative G-band PLL settings implemented */ | ||
| 504 | |||
| 465 | /* Values for SSB_SPROM1_BINF_CCODE */ | 505 | /* Values for SSB_SPROM1_BINF_CCODE */ |
| 466 | enum { | 506 | enum { |
| 467 | SSB_SPROM1CCODE_WORLD = 0, | 507 | SSB_SPROM1CCODE_WORLD = 0, |
diff --git a/include/linux/sungem_phy.h b/include/linux/sungem_phy.h new file mode 100644 index 000000000000..bd9be9f59d3a --- /dev/null +++ b/include/linux/sungem_phy.h | |||
| @@ -0,0 +1,132 @@ | |||
| 1 | #ifndef __SUNGEM_PHY_H__ | ||
| 2 | #define __SUNGEM_PHY_H__ | ||
| 3 | |||
| 4 | struct mii_phy; | ||
| 5 | |||
| 6 | /* Operations supported by any kind of PHY */ | ||
| 7 | struct mii_phy_ops | ||
| 8 | { | ||
| 9 | int (*init)(struct mii_phy *phy); | ||
| 10 | int (*suspend)(struct mii_phy *phy); | ||
| 11 | int (*setup_aneg)(struct mii_phy *phy, u32 advertise); | ||
| 12 | int (*setup_forced)(struct mii_phy *phy, int speed, int fd); | ||
| 13 | int (*poll_link)(struct mii_phy *phy); | ||
| 14 | int (*read_link)(struct mii_phy *phy); | ||
| 15 | int (*enable_fiber)(struct mii_phy *phy, int autoneg); | ||
| 16 | }; | ||
| 17 | |||
| 18 | /* Structure used to statically define an mii/gii based PHY */ | ||
| 19 | struct mii_phy_def | ||
| 20 | { | ||
| 21 | u32 phy_id; /* Concatenated ID1 << 16 | ID2 */ | ||
| 22 | u32 phy_id_mask; /* Significant bits */ | ||
| 23 | u32 features; /* Ethtool SUPPORTED_* defines */ | ||
| 24 | int magic_aneg; /* Autoneg does all speed test for us */ | ||
| 25 | const char* name; | ||
| 26 | const struct mii_phy_ops* ops; | ||
| 27 | }; | ||
| 28 | |||
| 29 | enum { | ||
| 30 | BCM54XX_COPPER, | ||
| 31 | BCM54XX_FIBER, | ||
| 32 | BCM54XX_GBIC, | ||
| 33 | BCM54XX_SGMII, | ||
| 34 | BCM54XX_UNKNOWN, | ||
| 35 | }; | ||
| 36 | |||
| 37 | /* An instance of a PHY, partially borrowed from mii_if_info */ | ||
| 38 | struct mii_phy | ||
| 39 | { | ||
| 40 | struct mii_phy_def* def; | ||
| 41 | u32 advertising; | ||
| 42 | int mii_id; | ||
| 43 | |||
| 44 | /* 1: autoneg enabled, 0: disabled */ | ||
| 45 | int autoneg; | ||
| 46 | |||
| 47 | /* forced speed & duplex (no autoneg) | ||
| 48 | * partner speed & duplex & pause (autoneg) | ||
| 49 | */ | ||
| 50 | int speed; | ||
| 51 | int duplex; | ||
| 52 | int pause; | ||
| 53 | |||
| 54 | /* Provided by host chip */ | ||
| 55 | struct net_device *dev; | ||
| 56 | int (*mdio_read) (struct net_device *dev, int mii_id, int reg); | ||
| 57 | void (*mdio_write) (struct net_device *dev, int mii_id, int reg, int val); | ||
| 58 | void *platform_data; | ||
| 59 | }; | ||
| 60 | |||
| 61 | /* Pass in a struct mii_phy with dev, mdio_read and mdio_write | ||
| 62 | * filled, the remaining fields will be filled on return | ||
| 63 | */ | ||
| 64 | extern int sungem_phy_probe(struct mii_phy *phy, int mii_id); | ||
| 65 | |||
| 66 | |||
| 67 | /* MII definitions missing from mii.h */ | ||
| 68 | |||
| 69 | #define BMCR_SPD2 0x0040 /* Gigabit enable (bcm54xx) */ | ||
| 70 | #define LPA_PAUSE 0x0400 | ||
| 71 | |||
| 72 | /* More PHY registers (model specific) */ | ||
| 73 | |||
| 74 | /* MII BCM5201 MULTIPHY interrupt register */ | ||
| 75 | #define MII_BCM5201_INTERRUPT 0x1A | ||
| 76 | #define MII_BCM5201_INTERRUPT_INTENABLE 0x4000 | ||
| 77 | |||
| 78 | #define MII_BCM5201_AUXMODE2 0x1B | ||
| 79 | #define MII_BCM5201_AUXMODE2_LOWPOWER 0x0008 | ||
| 80 | |||
| 81 | #define MII_BCM5201_MULTIPHY 0x1E | ||
| 82 | |||
| 83 | /* MII BCM5201 MULTIPHY register bits */ | ||
| 84 | #define MII_BCM5201_MULTIPHY_SERIALMODE 0x0002 | ||
| 85 | #define MII_BCM5201_MULTIPHY_SUPERISOLATE 0x0008 | ||
| 86 | |||
| 87 | /* MII BCM5221 Additional registers */ | ||
| 88 | #define MII_BCM5221_TEST 0x1f | ||
| 89 | #define MII_BCM5221_TEST_ENABLE_SHADOWS 0x0080 | ||
| 90 | #define MII_BCM5221_SHDOW_AUX_STAT2 0x1b | ||
| 91 | #define MII_BCM5221_SHDOW_AUX_STAT2_APD 0x0020 | ||
| 92 | #define MII_BCM5221_SHDOW_AUX_MODE4 0x1a | ||
| 93 | #define MII_BCM5221_SHDOW_AUX_MODE4_IDDQMODE 0x0001 | ||
| 94 | #define MII_BCM5221_SHDOW_AUX_MODE4_CLKLOPWR 0x0004 | ||
| 95 | |||
| 96 | /* MII BCM5241 Additional registers */ | ||
| 97 | #define MII_BCM5241_SHDOW_AUX_MODE4_STANDBYPWR 0x0008 | ||
| 98 | |||
| 99 | /* MII BCM5400 1000-BASET Control register */ | ||
| 100 | #define MII_BCM5400_GB_CONTROL 0x09 | ||
| 101 | #define MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP 0x0200 | ||
| 102 | |||
| 103 | /* MII BCM5400 AUXCONTROL register */ | ||
| 104 | #define MII_BCM5400_AUXCONTROL 0x18 | ||
| 105 | #define MII_BCM5400_AUXCONTROL_PWR10BASET 0x0004 | ||
| 106 | |||
| 107 | /* MII BCM5400 AUXSTATUS register */ | ||
| 108 | #define MII_BCM5400_AUXSTATUS 0x19 | ||
| 109 | #define MII_BCM5400_AUXSTATUS_LINKMODE_MASK 0x0700 | ||
| 110 | #define MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT 8 | ||
| 111 | |||
| 112 | /* 1000BT control (Marvell & BCM54xx at least) */ | ||
| 113 | #define MII_1000BASETCONTROL 0x09 | ||
| 114 | #define MII_1000BASETCONTROL_FULLDUPLEXCAP 0x0200 | ||
| 115 | #define MII_1000BASETCONTROL_HALFDUPLEXCAP 0x0100 | ||
| 116 | |||
| 117 | /* Marvell 88E1011 PHY control */ | ||
| 118 | #define MII_M1011_PHY_SPEC_CONTROL 0x10 | ||
| 119 | #define MII_M1011_PHY_SPEC_CONTROL_MANUAL_MDIX 0x20 | ||
| 120 | #define MII_M1011_PHY_SPEC_CONTROL_AUTO_MDIX 0x40 | ||
| 121 | |||
| 122 | /* Marvell 88E1011 PHY status */ | ||
| 123 | #define MII_M1011_PHY_SPEC_STATUS 0x11 | ||
| 124 | #define MII_M1011_PHY_SPEC_STATUS_1000 0x8000 | ||
| 125 | #define MII_M1011_PHY_SPEC_STATUS_100 0x4000 | ||
| 126 | #define MII_M1011_PHY_SPEC_STATUS_SPD_MASK 0xc000 | ||
| 127 | #define MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX 0x2000 | ||
| 128 | #define MII_M1011_PHY_SPEC_STATUS_RESOLVED 0x0800 | ||
| 129 | #define MII_M1011_PHY_SPEC_STATUS_TX_PAUSE 0x0008 | ||
| 130 | #define MII_M1011_PHY_SPEC_STATUS_RX_PAUSE 0x0004 | ||
| 131 | |||
| 132 | #endif /* __SUNGEM_PHY_H__ */ | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 11684d9e6bd2..9a1ec10fd504 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -435,7 +435,7 @@ enum { | |||
| 435 | NET_IPV4_ROUTE_MAX_SIZE=5, | 435 | NET_IPV4_ROUTE_MAX_SIZE=5, |
| 436 | NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, | 436 | NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, |
| 437 | NET_IPV4_ROUTE_GC_TIMEOUT=7, | 437 | NET_IPV4_ROUTE_GC_TIMEOUT=7, |
| 438 | NET_IPV4_ROUTE_GC_INTERVAL=8, | 438 | NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */ |
| 439 | NET_IPV4_ROUTE_REDIRECT_LOAD=9, | 439 | NET_IPV4_ROUTE_REDIRECT_LOAD=9, |
| 440 | NET_IPV4_ROUTE_REDIRECT_NUMBER=10, | 440 | NET_IPV4_ROUTE_REDIRECT_NUMBER=10, |
| 441 | NET_IPV4_ROUTE_REDIRECT_SILENCE=11, | 441 | NET_IPV4_ROUTE_REDIRECT_SILENCE=11, |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index d7d2f2158142..dac0859e6440 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -112,6 +112,7 @@ struct bin_attribute { | |||
| 112 | struct sysfs_ops { | 112 | struct sysfs_ops { |
| 113 | ssize_t (*show)(struct kobject *, struct attribute *,char *); | 113 | ssize_t (*show)(struct kobject *, struct attribute *,char *); |
| 114 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 114 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
| 115 | const void *(*namespace)(struct kobject *, const struct attribute *); | ||
| 115 | }; | 116 | }; |
| 116 | 117 | ||
| 117 | struct sysfs_dirent; | 118 | struct sysfs_dirent; |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 531ede8006d9..7f59ee946983 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -111,7 +111,8 @@ enum { | |||
| 111 | #define TCPI_OPT_TIMESTAMPS 1 | 111 | #define TCPI_OPT_TIMESTAMPS 1 |
| 112 | #define TCPI_OPT_SACK 2 | 112 | #define TCPI_OPT_SACK 2 |
| 113 | #define TCPI_OPT_WSCALE 4 | 113 | #define TCPI_OPT_WSCALE 4 |
| 114 | #define TCPI_OPT_ECN 8 | 114 | #define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */ |
| 115 | #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ | ||
| 115 | 116 | ||
| 116 | enum tcp_ca_state { | 117 | enum tcp_ca_state { |
| 117 | TCP_CA_Open = 0, | 118 | TCP_CA_Open = 0, |
| @@ -379,6 +380,10 @@ struct tcp_sock { | |||
| 379 | u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ | 380 | u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ |
| 380 | u32 snd_cwnd_used; | 381 | u32 snd_cwnd_used; |
| 381 | u32 snd_cwnd_stamp; | 382 | u32 snd_cwnd_stamp; |
| 383 | u32 prior_cwnd; /* Congestion window at start of Recovery. */ | ||
| 384 | u32 prr_delivered; /* Number of newly delivered packets to | ||
| 385 | * receiver in Recovery. */ | ||
| 386 | u32 prr_out; /* Total number of pkts sent during Recovery. */ | ||
| 382 | 387 | ||
| 383 | u32 rcv_wnd; /* Current receiver window */ | 388 | u32 rcv_wnd; /* Current receiver window */ |
| 384 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ | 389 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ |
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h index 0db239590b4d..9730b0e51e46 100644 --- a/include/linux/tipc_config.h +++ b/include/linux/tipc_config.h | |||
| @@ -41,6 +41,10 @@ | |||
| 41 | #include <linux/string.h> | 41 | #include <linux/string.h> |
| 42 | #include <asm/byteorder.h> | 42 | #include <asm/byteorder.h> |
| 43 | 43 | ||
| 44 | #ifndef __KERNEL__ | ||
| 45 | #include <arpa/inet.h> /* for ntohs etc. */ | ||
| 46 | #endif | ||
| 47 | |||
| 44 | /* | 48 | /* |
| 45 | * Configuration | 49 | * Configuration |
| 46 | * | 50 | * |
diff --git a/include/linux/un.h b/include/linux/un.h index 45561c564b8e..3ed3e46c1b1f 100644 --- a/include/linux/un.h +++ b/include/linux/un.h | |||
| @@ -1,10 +1,12 @@ | |||
| 1 | #ifndef _LINUX_UN_H | 1 | #ifndef _LINUX_UN_H |
| 2 | #define _LINUX_UN_H | 2 | #define _LINUX_UN_H |
| 3 | 3 | ||
| 4 | #include <linux/socket.h> | ||
| 5 | |||
| 4 | #define UNIX_PATH_MAX 108 | 6 | #define UNIX_PATH_MAX 108 |
| 5 | 7 | ||
| 6 | struct sockaddr_un { | 8 | struct sockaddr_un { |
| 7 | sa_family_t sun_family; /* AF_UNIX */ | 9 | __kernel_sa_family_t sun_family; /* AF_UNIX */ |
| 8 | char sun_path[UNIX_PATH_MAX]; /* pathname */ | 10 | char sun_path[UNIX_PATH_MAX]; /* pathname */ |
| 9 | }; | 11 | }; |
| 10 | 12 | ||
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 710885749605..851ebf1a4476 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -61,6 +61,9 @@ struct virtqueue { | |||
| 61 | * virtqueue_detach_unused_buf: detach first unused buffer | 61 | * virtqueue_detach_unused_buf: detach first unused buffer |
| 62 | * vq: the struct virtqueue we're talking about. | 62 | * vq: the struct virtqueue we're talking about. |
| 63 | * Returns NULL or the "data" token handed to add_buf | 63 | * Returns NULL or the "data" token handed to add_buf |
| 64 | * virtqueue_get_vring_size: return the size of the virtqueue's vring | ||
| 65 | * vq: the struct virtqueue containing the vring of interest. | ||
| 66 | * Returns the size of the vring. | ||
| 64 | * | 67 | * |
| 65 | * Locking rules are straightforward: the driver is responsible for | 68 | * Locking rules are straightforward: the driver is responsible for |
| 66 | * locking. No two operations may be invoked simultaneously, with the exception | 69 | * locking. No two operations may be invoked simultaneously, with the exception |
| @@ -97,6 +100,8 @@ bool virtqueue_enable_cb_delayed(struct virtqueue *vq); | |||
| 97 | 100 | ||
| 98 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); | 101 | void *virtqueue_detach_unused_buf(struct virtqueue *vq); |
| 99 | 102 | ||
| 103 | unsigned int virtqueue_get_vring_size(struct virtqueue *vq); | ||
| 104 | |||
| 100 | /** | 105 | /** |
| 101 | * virtio_device - representation of a device using virtio | 106 | * virtio_device - representation of a device using virtio |
| 102 | * @index: unique position on the virtio bus | 107 | * @index: unique position on the virtio bus |
diff --git a/include/linux/x25.h b/include/linux/x25.h index 6450a7f12074..810cce6737ea 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #define X25_KERNEL_H | 12 | #define X25_KERNEL_H |
| 13 | 13 | ||
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 15 | #include <linux/socket.h> | ||
| 15 | 16 | ||
| 16 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) | 17 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) |
| 17 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) | 18 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) |
| @@ -57,7 +58,7 @@ struct x25_address { | |||
| 57 | * Linux X.25 Address structure, used for bind, and connect mostly. | 58 | * Linux X.25 Address structure, used for bind, and connect mostly. |
| 58 | */ | 59 | */ |
| 59 | struct sockaddr_x25 { | 60 | struct sockaddr_x25 { |
| 60 | sa_family_t sx25_family; /* Must be AF_X25 */ | 61 | __kernel_sa_family_t sx25_family; /* Must be AF_X25 */ |
| 61 | struct x25_address sx25_addr; /* X.121 Address */ | 62 | struct x25_address sx25_addr; /* X.121 Address */ |
| 62 | }; | 63 | }; |
| 63 | 64 | ||
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 582e4ae70753..cbc6bb0a6838 100644 --- a/include/net/addrconf.h +++ b/include/net/addrconf.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #define TEMP_VALID_LIFETIME (7*86400) | 9 | #define TEMP_VALID_LIFETIME (7*86400) |
| 10 | #define TEMP_PREFERRED_LIFETIME (86400) | 10 | #define TEMP_PREFERRED_LIFETIME (86400) |
| 11 | #define REGEN_MAX_RETRY (5) | 11 | #define REGEN_MAX_RETRY (3) |
| 12 | #define MAX_DESYNC_FACTOR (600) | 12 | #define MAX_DESYNC_FACTOR (600) |
| 13 | 13 | ||
| 14 | #define ADDR_CHECK_FREQUENCY (120*HZ) | 14 | #define ADDR_CHECK_FREQUENCY (120*HZ) |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index be30aabe7b88..aaf79af72432 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -716,6 +716,16 @@ struct hci_rp_read_bd_addr { | |||
| 716 | bdaddr_t bdaddr; | 716 | bdaddr_t bdaddr; |
| 717 | } __packed; | 717 | } __packed; |
| 718 | 718 | ||
| 719 | #define HCI_OP_WRITE_PAGE_SCAN_ACTIVITY 0x0c1c | ||
| 720 | struct hci_cp_write_page_scan_activity { | ||
| 721 | __le16 interval; | ||
| 722 | __le16 window; | ||
| 723 | } __packed; | ||
| 724 | |||
| 725 | #define HCI_OP_WRITE_PAGE_SCAN_TYPE 0x0c47 | ||
| 726 | #define PAGE_SCAN_TYPE_STANDARD 0x00 | ||
| 727 | #define PAGE_SCAN_TYPE_INTERLACED 0x01 | ||
| 728 | |||
| 719 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | 729 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 |
| 720 | struct hci_cp_le_set_event_mask { | 730 | struct hci_cp_le_set_event_mask { |
| 721 | __u8 mask[8]; | 731 | __u8 mask[8]; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 8f441b8b2963..5b924423cf20 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -195,8 +195,6 @@ struct hci_dev { | |||
| 195 | 195 | ||
| 196 | __u16 init_last_cmd; | 196 | __u16 init_last_cmd; |
| 197 | 197 | ||
| 198 | struct crypto_blkcipher *tfm; | ||
| 199 | |||
| 200 | struct inquiry_cache inq_cache; | 198 | struct inquiry_cache inq_cache; |
| 201 | struct hci_conn_hash conn_hash; | 199 | struct hci_conn_hash conn_hash; |
| 202 | struct list_head blacklist; | 200 | struct list_head blacklist; |
| @@ -348,6 +346,7 @@ enum { | |||
| 348 | HCI_CONN_RSWITCH_PEND, | 346 | HCI_CONN_RSWITCH_PEND, |
| 349 | HCI_CONN_MODE_CHANGE_PEND, | 347 | HCI_CONN_MODE_CHANGE_PEND, |
| 350 | HCI_CONN_SCO_SETUP_PEND, | 348 | HCI_CONN_SCO_SETUP_PEND, |
| 349 | HCI_CONN_LE_SMP_PEND, | ||
| 351 | }; | 350 | }; |
| 352 | 351 | ||
| 353 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 352 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
| @@ -395,6 +394,22 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) | |||
| 395 | } | 394 | } |
| 396 | } | 395 | } |
| 397 | 396 | ||
| 397 | static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) | ||
| 398 | { | ||
| 399 | struct hci_conn_hash *h = &hdev->conn_hash; | ||
| 400 | switch (type) { | ||
| 401 | case ACL_LINK: | ||
| 402 | return h->acl_num; | ||
| 403 | case LE_LINK: | ||
| 404 | return h->le_num; | ||
| 405 | case SCO_LINK: | ||
| 406 | case ESCO_LINK: | ||
| 407 | return h->sco_num; | ||
| 408 | default: | ||
| 409 | return 0; | ||
| 410 | } | ||
| 411 | } | ||
| 412 | |||
| 398 | static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, | 413 | static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, |
| 399 | __u16 handle) | 414 | __u16 handle) |
| 400 | { | 415 | { |
| @@ -475,7 +490,7 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
| 475 | { | 490 | { |
| 476 | if (atomic_dec_and_test(&conn->refcnt)) { | 491 | if (atomic_dec_and_test(&conn->refcnt)) { |
| 477 | unsigned long timeo; | 492 | unsigned long timeo; |
| 478 | if (conn->type == ACL_LINK) { | 493 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { |
| 479 | del_timer(&conn->idle_timer); | 494 | del_timer(&conn->idle_timer); |
| 480 | if (conn->state == BT_CONNECTED) { | 495 | if (conn->state == BT_CONNECTED) { |
| 481 | timeo = msecs_to_jiffies(conn->disc_timeout); | 496 | timeo = msecs_to_jiffies(conn->disc_timeout); |
| @@ -838,7 +853,7 @@ int mgmt_powered(u16 index, u8 powered); | |||
| 838 | int mgmt_discoverable(u16 index, u8 discoverable); | 853 | int mgmt_discoverable(u16 index, u8 discoverable); |
| 839 | int mgmt_connectable(u16 index, u8 connectable); | 854 | int mgmt_connectable(u16 index, u8 connectable); |
| 840 | int mgmt_new_key(u16 index, struct link_key *key, u8 persistent); | 855 | int mgmt_new_key(u16 index, struct link_key *key, u8 persistent); |
| 841 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); | 856 | int mgmt_connected(u16 index, bdaddr_t *bdaddr, u8 link_type); |
| 842 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); | 857 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); |
| 843 | int mgmt_disconnect_failed(u16 index); | 858 | int mgmt_disconnect_failed(u16 index); |
| 844 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); | 859 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); |
| @@ -858,6 +873,8 @@ int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi, | |||
| 858 | u8 *eir); | 873 | u8 *eir); |
| 859 | int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name); | 874 | int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name); |
| 860 | int mgmt_discovering(u16 index, u8 discovering); | 875 | int mgmt_discovering(u16 index, u8 discovering); |
| 876 | int mgmt_device_blocked(u16 index, bdaddr_t *bdaddr); | ||
| 877 | int mgmt_device_unblocked(u16 index, bdaddr_t *bdaddr); | ||
| 861 | 878 | ||
| 862 | /* HCI info for socket */ | 879 | /* HCI info for socket */ |
| 863 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 880 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 4f34ad25e75c..ab90ae0970a6 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -354,8 +354,8 @@ struct l2cap_chan { | |||
| 354 | __u8 retry_count; | 354 | __u8 retry_count; |
| 355 | __u8 num_acked; | 355 | __u8 num_acked; |
| 356 | __u16 sdu_len; | 356 | __u16 sdu_len; |
| 357 | __u16 partial_sdu_len; | ||
| 358 | struct sk_buff *sdu; | 357 | struct sk_buff *sdu; |
| 358 | struct sk_buff *sdu_last_frag; | ||
| 359 | 359 | ||
| 360 | __u8 remote_tx_win; | 360 | __u8 remote_tx_win; |
| 361 | __u8 remote_max_tx; | 361 | __u8 remote_max_tx; |
| @@ -409,14 +409,8 @@ struct l2cap_conn { | |||
| 409 | 409 | ||
| 410 | __u8 disc_reason; | 410 | __u8 disc_reason; |
| 411 | 411 | ||
| 412 | __u8 preq[7]; /* SMP Pairing Request */ | ||
| 413 | __u8 prsp[7]; /* SMP Pairing Response */ | ||
| 414 | __u8 prnd[16]; /* SMP Pairing Random */ | ||
| 415 | __u8 pcnf[16]; /* SMP Pairing Confirm */ | ||
| 416 | __u8 tk[16]; /* SMP Temporary Key */ | ||
| 417 | __u8 smp_key_size; | ||
| 418 | |||
| 419 | struct timer_list security_timer; | 412 | struct timer_list security_timer; |
| 413 | struct smp_chan *smp_chan; | ||
| 420 | 414 | ||
| 421 | struct list_head chan_l; | 415 | struct list_head chan_l; |
| 422 | rwlock_t chan_lock; | 416 | rwlock_t chan_lock; |
| @@ -454,7 +448,6 @@ enum { | |||
| 454 | #define L2CAP_CONF_MAX_CONF_RSP 2 | 448 | #define L2CAP_CONF_MAX_CONF_RSP 2 |
| 455 | 449 | ||
| 456 | enum { | 450 | enum { |
| 457 | CONN_SAR_SDU, | ||
| 458 | CONN_SREJ_SENT, | 451 | CONN_SREJ_SENT, |
| 459 | CONN_WAIT_F, | 452 | CONN_WAIT_F, |
| 460 | CONN_SREJ_ACT, | 453 | CONN_SREJ_ACT, |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 5428fd32ccec..d66da0f94f95 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
| @@ -211,6 +211,11 @@ struct mgmt_cp_unblock_device { | |||
| 211 | bdaddr_t bdaddr; | 211 | bdaddr_t bdaddr; |
| 212 | } __packed; | 212 | } __packed; |
| 213 | 213 | ||
| 214 | #define MGMT_OP_SET_FAST_CONNECTABLE 0x001F | ||
| 215 | struct mgmt_cp_set_fast_connectable { | ||
| 216 | __u8 enable; | ||
| 217 | } __packed; | ||
| 218 | |||
| 214 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 219 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
| 215 | struct mgmt_ev_cmd_complete { | 220 | struct mgmt_ev_cmd_complete { |
| 216 | __le16 opcode; | 221 | __le16 opcode; |
| @@ -249,6 +254,7 @@ struct mgmt_ev_new_key { | |||
| 249 | #define MGMT_EV_CONNECTED 0x000B | 254 | #define MGMT_EV_CONNECTED 0x000B |
| 250 | struct mgmt_ev_connected { | 255 | struct mgmt_ev_connected { |
| 251 | bdaddr_t bdaddr; | 256 | bdaddr_t bdaddr; |
| 257 | __u8 link_type; | ||
| 252 | } __packed; | 258 | } __packed; |
| 253 | 259 | ||
| 254 | #define MGMT_EV_DISCONNECTED 0x000C | 260 | #define MGMT_EV_DISCONNECTED 0x000C |
| @@ -301,3 +307,13 @@ struct mgmt_ev_remote_name { | |||
| 301 | } __packed; | 307 | } __packed; |
| 302 | 308 | ||
| 303 | #define MGMT_EV_DISCOVERING 0x0014 | 309 | #define MGMT_EV_DISCOVERING 0x0014 |
| 310 | |||
| 311 | #define MGMT_EV_DEVICE_BLOCKED 0x0015 | ||
| 312 | struct mgmt_ev_device_blocked { | ||
| 313 | bdaddr_t bdaddr; | ||
| 314 | } __packed; | ||
| 315 | |||
| 316 | #define MGMT_EV_DEVICE_UNBLOCKED 0x0016 | ||
| 317 | struct mgmt_ev_device_unblocked { | ||
| 318 | bdaddr_t bdaddr; | ||
| 319 | } __packed; | ||
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h index 46c457612300..15b97d549441 100644 --- a/include/net/bluetooth/smp.h +++ b/include/net/bluetooth/smp.h | |||
| @@ -115,9 +115,26 @@ struct smp_cmd_security_req { | |||
| 115 | #define SMP_MIN_ENC_KEY_SIZE 7 | 115 | #define SMP_MIN_ENC_KEY_SIZE 7 |
| 116 | #define SMP_MAX_ENC_KEY_SIZE 16 | 116 | #define SMP_MAX_ENC_KEY_SIZE 16 |
| 117 | 117 | ||
| 118 | struct smp_chan { | ||
| 119 | struct l2cap_conn *conn; | ||
| 120 | u8 preq[7]; /* SMP Pairing Request */ | ||
| 121 | u8 prsp[7]; /* SMP Pairing Response */ | ||
| 122 | u8 prnd[16]; /* SMP Pairing Random (local) */ | ||
| 123 | u8 rrnd[16]; /* SMP Pairing Random (remote) */ | ||
| 124 | u8 pcnf[16]; /* SMP Pairing Confirm */ | ||
| 125 | u8 tk[16]; /* SMP Temporary Key */ | ||
| 126 | u8 smp_key_size; | ||
| 127 | struct crypto_blkcipher *tfm; | ||
| 128 | struct work_struct confirm; | ||
| 129 | struct work_struct random; | ||
| 130 | |||
| 131 | }; | ||
| 132 | |||
| 118 | /* SMP Commands */ | 133 | /* SMP Commands */ |
| 119 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); | 134 | int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); |
| 120 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); | 135 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); |
| 121 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); | 136 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); |
| 122 | 137 | ||
| 138 | void smp_chan_destroy(struct l2cap_conn *conn); | ||
| 139 | |||
| 123 | #endif /* __SMP_H */ | 140 | #endif /* __SMP_H */ |
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h index c5dedd87b4cb..8d552519ff67 100644 --- a/include/net/caif/caif_hsi.h +++ b/include/net/caif/caif_hsi.h | |||
| @@ -52,8 +52,9 @@ struct cfhsi_desc { | |||
| 52 | /* | 52 | /* |
| 53 | * Maximum bytes transferred in one transfer. | 53 | * Maximum bytes transferred in one transfer. |
| 54 | */ | 54 | */ |
| 55 | /* TODO: 4096 is temporary... */ | 55 | #define CFHSI_MAX_CAIF_FRAME_SZ 4096 |
| 56 | #define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * 4096) | 56 | |
| 57 | #define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * CFHSI_MAX_CAIF_FRAME_SZ) | ||
| 57 | 58 | ||
| 58 | /* Size of the complete HSI TX buffer. */ | 59 | /* Size of the complete HSI TX buffer. */ |
| 59 | #define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ) | 60 | #define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ) |
| @@ -75,18 +76,21 @@ struct cfhsi_desc { | |||
| 75 | #define CFHSI_WAKE_UP_ACK 1 | 76 | #define CFHSI_WAKE_UP_ACK 1 |
| 76 | #define CFHSI_WAKE_DOWN_ACK 2 | 77 | #define CFHSI_WAKE_DOWN_ACK 2 |
| 77 | #define CFHSI_AWAKE 3 | 78 | #define CFHSI_AWAKE 3 |
| 78 | #define CFHSI_PENDING_RX 4 | 79 | #define CFHSI_WAKELOCK_HELD 4 |
| 79 | #define CFHSI_SHUTDOWN 6 | 80 | #define CFHSI_SHUTDOWN 5 |
| 80 | #define CFHSI_FLUSH_FIFO 7 | 81 | #define CFHSI_FLUSH_FIFO 6 |
| 81 | 82 | ||
| 82 | #ifndef CFHSI_INACTIVITY_TOUT | 83 | #ifndef CFHSI_INACTIVITY_TOUT |
| 83 | #define CFHSI_INACTIVITY_TOUT (1 * HZ) | 84 | #define CFHSI_INACTIVITY_TOUT (1 * HZ) |
| 84 | #endif /* CFHSI_INACTIVITY_TOUT */ | 85 | #endif /* CFHSI_INACTIVITY_TOUT */ |
| 85 | 86 | ||
| 86 | #ifndef CFHSI_WAKEUP_TOUT | 87 | #ifndef CFHSI_WAKE_TOUT |
| 87 | #define CFHSI_WAKEUP_TOUT (3 * HZ) | 88 | #define CFHSI_WAKE_TOUT (3 * HZ) |
| 88 | #endif /* CFHSI_WAKEUP_TOUT */ | 89 | #endif /* CFHSI_WAKE_TOUT */ |
| 89 | 90 | ||
| 91 | #ifndef CFHSI_MAX_RX_RETRIES | ||
| 92 | #define CFHSI_MAX_RX_RETRIES (10 * HZ) | ||
| 93 | #endif | ||
| 90 | 94 | ||
| 91 | /* Structure implemented by the CAIF HSI driver. */ | 95 | /* Structure implemented by the CAIF HSI driver. */ |
| 92 | struct cfhsi_drv { | 96 | struct cfhsi_drv { |
| @@ -104,11 +108,21 @@ struct cfhsi_dev { | |||
| 104 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); | 108 | int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); |
| 105 | int (*cfhsi_wake_up) (struct cfhsi_dev *dev); | 109 | int (*cfhsi_wake_up) (struct cfhsi_dev *dev); |
| 106 | int (*cfhsi_wake_down) (struct cfhsi_dev *dev); | 110 | int (*cfhsi_wake_down) (struct cfhsi_dev *dev); |
| 111 | int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status); | ||
| 107 | int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); | 112 | int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); |
| 108 | int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); | 113 | int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); |
| 109 | struct cfhsi_drv *drv; | 114 | struct cfhsi_drv *drv; |
| 110 | }; | 115 | }; |
| 111 | 116 | ||
| 117 | /* Structure holds status of received CAIF frames processing */ | ||
| 118 | struct cfhsi_rx_state { | ||
| 119 | int state; | ||
| 120 | int nfrms; | ||
| 121 | int pld_len; | ||
| 122 | int retries; | ||
| 123 | bool piggy_desc; | ||
| 124 | }; | ||
| 125 | |||
| 112 | /* Structure implemented by CAIF HSI drivers. */ | 126 | /* Structure implemented by CAIF HSI drivers. */ |
| 113 | struct cfhsi { | 127 | struct cfhsi { |
| 114 | struct caif_dev_common cfdev; | 128 | struct caif_dev_common cfdev; |
| @@ -118,7 +132,8 @@ struct cfhsi { | |||
| 118 | struct cfhsi_drv drv; | 132 | struct cfhsi_drv drv; |
| 119 | struct cfhsi_dev *dev; | 133 | struct cfhsi_dev *dev; |
| 120 | int tx_state; | 134 | int tx_state; |
| 121 | int rx_state; | 135 | struct cfhsi_rx_state rx_state; |
| 136 | unsigned long inactivity_timeout; | ||
| 122 | int rx_len; | 137 | int rx_len; |
| 123 | u8 *rx_ptr; | 138 | u8 *rx_ptr; |
| 124 | u8 *tx_buf; | 139 | u8 *tx_buf; |
| @@ -130,13 +145,13 @@ struct cfhsi { | |||
| 130 | struct list_head list; | 145 | struct list_head list; |
| 131 | struct work_struct wake_up_work; | 146 | struct work_struct wake_up_work; |
| 132 | struct work_struct wake_down_work; | 147 | struct work_struct wake_down_work; |
| 133 | struct work_struct rx_done_work; | 148 | struct work_struct out_of_sync_work; |
| 134 | struct work_struct tx_done_work; | ||
| 135 | struct workqueue_struct *wq; | 149 | struct workqueue_struct *wq; |
| 136 | wait_queue_head_t wake_up_wait; | 150 | wait_queue_head_t wake_up_wait; |
| 137 | wait_queue_head_t wake_down_wait; | 151 | wait_queue_head_t wake_down_wait; |
| 138 | wait_queue_head_t flush_fifo_wait; | 152 | wait_queue_head_t flush_fifo_wait; |
| 139 | struct timer_list timer; | 153 | struct timer_list timer; |
| 154 | struct timer_list rx_slowpath_timer; | ||
| 140 | unsigned long bits; | 155 | unsigned long bits; |
| 141 | }; | 156 | }; |
| 142 | 157 | ||
diff --git a/include/net/cfg80211-wext.h b/include/net/cfg80211-wext.h new file mode 100644 index 000000000000..25baddc4fbed --- /dev/null +++ b/include/net/cfg80211-wext.h | |||
| @@ -0,0 +1,55 @@ | |||
| 1 | #ifndef __NET_CFG80211_WEXT_H | ||
| 2 | #define __NET_CFG80211_WEXT_H | ||
| 3 | /* | ||
| 4 | * 802.11 device and configuration interface -- wext handlers | ||
| 5 | * | ||
| 6 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or modify | ||
| 9 | * it under the terms of the GNU General Public License version 2 as | ||
| 10 | * published by the Free Software Foundation. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/netdevice.h> | ||
| 14 | #include <linux/wireless.h> | ||
| 15 | #include <net/iw_handler.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | * Temporary wext handlers & helper functions | ||
| 19 | * | ||
| 20 | * These are used only by drivers that aren't yet fully | ||
| 21 | * converted to cfg80211. | ||
| 22 | */ | ||
| 23 | int cfg80211_wext_giwname(struct net_device *dev, | ||
| 24 | struct iw_request_info *info, | ||
| 25 | char *name, char *extra); | ||
| 26 | int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, | ||
| 27 | u32 *mode, char *extra); | ||
| 28 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, | ||
| 29 | u32 *mode, char *extra); | ||
| 30 | int cfg80211_wext_siwscan(struct net_device *dev, | ||
| 31 | struct iw_request_info *info, | ||
| 32 | union iwreq_data *wrqu, char *extra); | ||
| 33 | int cfg80211_wext_giwscan(struct net_device *dev, | ||
| 34 | struct iw_request_info *info, | ||
| 35 | struct iw_point *data, char *extra); | ||
| 36 | int cfg80211_wext_giwrange(struct net_device *dev, | ||
| 37 | struct iw_request_info *info, | ||
| 38 | struct iw_point *data, char *extra); | ||
| 39 | int cfg80211_wext_siwrts(struct net_device *dev, | ||
| 40 | struct iw_request_info *info, | ||
| 41 | struct iw_param *rts, char *extra); | ||
| 42 | int cfg80211_wext_giwrts(struct net_device *dev, | ||
| 43 | struct iw_request_info *info, | ||
| 44 | struct iw_param *rts, char *extra); | ||
| 45 | int cfg80211_wext_siwfrag(struct net_device *dev, | ||
| 46 | struct iw_request_info *info, | ||
| 47 | struct iw_param *frag, char *extra); | ||
| 48 | int cfg80211_wext_giwfrag(struct net_device *dev, | ||
| 49 | struct iw_request_info *info, | ||
| 50 | struct iw_param *frag, char *extra); | ||
| 51 | int cfg80211_wext_giwretry(struct net_device *dev, | ||
| 52 | struct iw_request_info *info, | ||
| 53 | struct iw_param *retry, char *extra); | ||
| 54 | |||
| 55 | #endif /* __NET_CFG80211_WEXT_H */ | ||
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 401d73bd151f..92cf1c2c30c9 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -20,11 +20,6 @@ | |||
| 20 | #include <linux/ieee80211.h> | 20 | #include <linux/ieee80211.h> |
| 21 | #include <net/regulatory.h> | 21 | #include <net/regulatory.h> |
| 22 | 22 | ||
| 23 | /* remove once we remove the wext stuff */ | ||
| 24 | #include <net/iw_handler.h> | ||
| 25 | #include <linux/wireless.h> | ||
| 26 | |||
| 27 | |||
| 28 | /** | 23 | /** |
| 29 | * DOC: Introduction | 24 | * DOC: Introduction |
| 30 | * | 25 | * |
| @@ -339,6 +334,36 @@ struct survey_info { | |||
| 339 | }; | 334 | }; |
| 340 | 335 | ||
| 341 | /** | 336 | /** |
| 337 | * struct cfg80211_crypto_settings - Crypto settings | ||
| 338 | * @wpa_versions: indicates which, if any, WPA versions are enabled | ||
| 339 | * (from enum nl80211_wpa_versions) | ||
| 340 | * @cipher_group: group key cipher suite (or 0 if unset) | ||
| 341 | * @n_ciphers_pairwise: number of AP supported unicast ciphers | ||
| 342 | * @ciphers_pairwise: unicast key cipher suites | ||
| 343 | * @n_akm_suites: number of AKM suites | ||
| 344 | * @akm_suites: AKM suites | ||
| 345 | * @control_port: Whether user space controls IEEE 802.1X port, i.e., | ||
| 346 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is | ||
| 347 | * required to assume that the port is unauthorized until authorized by | ||
| 348 | * user space. Otherwise, port is marked authorized by default. | ||
| 349 | * @control_port_ethertype: the control port protocol that should be | ||
| 350 | * allowed through even on unauthorized ports | ||
| 351 | * @control_port_no_encrypt: TRUE to prevent encryption of control port | ||
| 352 | * protocol frames. | ||
| 353 | */ | ||
| 354 | struct cfg80211_crypto_settings { | ||
| 355 | u32 wpa_versions; | ||
| 356 | u32 cipher_group; | ||
| 357 | int n_ciphers_pairwise; | ||
| 358 | u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES]; | ||
| 359 | int n_akm_suites; | ||
| 360 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; | ||
| 361 | bool control_port; | ||
| 362 | __be16 control_port_ethertype; | ||
| 363 | bool control_port_no_encrypt; | ||
| 364 | }; | ||
| 365 | |||
| 366 | /** | ||
| 342 | * struct beacon_parameters - beacon parameters | 367 | * struct beacon_parameters - beacon parameters |
| 343 | * | 368 | * |
| 344 | * Used to configure the beacon for an interface. | 369 | * Used to configure the beacon for an interface. |
| @@ -351,11 +376,38 @@ struct survey_info { | |||
| 351 | * @dtim_period: DTIM period or zero if not changed | 376 | * @dtim_period: DTIM period or zero if not changed |
| 352 | * @head_len: length of @head | 377 | * @head_len: length of @head |
| 353 | * @tail_len: length of @tail | 378 | * @tail_len: length of @tail |
| 379 | * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from | ||
| 380 | * user space) | ||
| 381 | * @ssid_len: length of @ssid | ||
| 382 | * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames | ||
| 383 | * @crypto: crypto settings | ||
| 384 | * @privacy: the BSS uses privacy | ||
| 385 | * @auth_type: Authentication type (algorithm) | ||
| 386 | * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL | ||
| 387 | * @beacon_ies_len: length of beacon_ies in octets | ||
| 388 | * @proberesp_ies: extra information element(s) to add into Probe Response | ||
| 389 | * frames or %NULL | ||
| 390 | * @proberesp_ies_len: length of proberesp_ies in octets | ||
| 391 | * @assocresp_ies: extra information element(s) to add into (Re)Association | ||
| 392 | * Response frames or %NULL | ||
| 393 | * @assocresp_ies_len: length of assocresp_ies in octets | ||
| 354 | */ | 394 | */ |
| 355 | struct beacon_parameters { | 395 | struct beacon_parameters { |
| 356 | u8 *head, *tail; | 396 | u8 *head, *tail; |
| 357 | int interval, dtim_period; | 397 | int interval, dtim_period; |
| 358 | int head_len, tail_len; | 398 | int head_len, tail_len; |
| 399 | const u8 *ssid; | ||
| 400 | size_t ssid_len; | ||
| 401 | enum nl80211_hidden_ssid hidden_ssid; | ||
| 402 | struct cfg80211_crypto_settings crypto; | ||
| 403 | bool privacy; | ||
| 404 | enum nl80211_auth_type auth_type; | ||
| 405 | const u8 *beacon_ies; | ||
| 406 | size_t beacon_ies_len; | ||
| 407 | const u8 *proberesp_ies; | ||
| 408 | size_t proberesp_ies_len; | ||
| 409 | const u8 *assocresp_ies; | ||
| 410 | size_t assocresp_ies_len; | ||
| 359 | }; | 411 | }; |
| 360 | 412 | ||
| 361 | /** | 413 | /** |
| @@ -372,6 +424,17 @@ enum plink_actions { | |||
| 372 | }; | 424 | }; |
| 373 | 425 | ||
| 374 | /** | 426 | /** |
| 427 | * enum station_parameters_apply_mask - station parameter values to apply | ||
| 428 | * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp) | ||
| 429 | * | ||
| 430 | * Not all station parameters have in-band "no change" signalling, | ||
| 431 | * for those that don't these flags will are used. | ||
| 432 | */ | ||
| 433 | enum station_parameters_apply_mask { | ||
| 434 | STATION_PARAM_APPLY_UAPSD = BIT(0), | ||
| 435 | }; | ||
| 436 | |||
| 437 | /** | ||
| 375 | * struct station_parameters - station parameters | 438 | * struct station_parameters - station parameters |
| 376 | * | 439 | * |
| 377 | * Used to change and create a new station. | 440 | * Used to change and create a new station. |
| @@ -389,17 +452,24 @@ enum plink_actions { | |||
| 389 | * @plink_action: plink action to take | 452 | * @plink_action: plink action to take |
| 390 | * @plink_state: set the peer link state for a station | 453 | * @plink_state: set the peer link state for a station |
| 391 | * @ht_capa: HT capabilities of station | 454 | * @ht_capa: HT capabilities of station |
| 455 | * @uapsd_queues: bitmap of queues configured for uapsd. same format | ||
| 456 | * as the AC bitmap in the QoS info field | ||
| 457 | * @max_sp: max Service Period. same format as the MAX_SP in the | ||
| 458 | * QoS info field (but already shifted down) | ||
| 392 | */ | 459 | */ |
| 393 | struct station_parameters { | 460 | struct station_parameters { |
| 394 | u8 *supported_rates; | 461 | u8 *supported_rates; |
| 395 | struct net_device *vlan; | 462 | struct net_device *vlan; |
| 396 | u32 sta_flags_mask, sta_flags_set; | 463 | u32 sta_flags_mask, sta_flags_set; |
| 464 | u32 sta_modify_mask; | ||
| 397 | int listen_interval; | 465 | int listen_interval; |
| 398 | u16 aid; | 466 | u16 aid; |
| 399 | u8 supported_rates_len; | 467 | u8 supported_rates_len; |
| 400 | u8 plink_action; | 468 | u8 plink_action; |
| 401 | u8 plink_state; | 469 | u8 plink_state; |
| 402 | struct ieee80211_ht_cap *ht_capa; | 470 | struct ieee80211_ht_cap *ht_capa; |
| 471 | u8 uapsd_queues; | ||
| 472 | u8 max_sp; | ||
| 403 | }; | 473 | }; |
| 404 | 474 | ||
| 405 | /** | 475 | /** |
| @@ -426,6 +496,8 @@ struct station_parameters { | |||
| 426 | * @STATION_INFO_RX_BITRATE: @rxrate fields are filled | 496 | * @STATION_INFO_RX_BITRATE: @rxrate fields are filled |
| 427 | * @STATION_INFO_BSS_PARAM: @bss_param filled | 497 | * @STATION_INFO_BSS_PARAM: @bss_param filled |
| 428 | * @STATION_INFO_CONNECTED_TIME: @connected_time filled | 498 | * @STATION_INFO_CONNECTED_TIME: @connected_time filled |
| 499 | * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled | ||
| 500 | * @STATION_INFO_STA_FLAGS: @sta_flags filled | ||
| 429 | */ | 501 | */ |
| 430 | enum station_info_flags { | 502 | enum station_info_flags { |
| 431 | STATION_INFO_INACTIVE_TIME = 1<<0, | 503 | STATION_INFO_INACTIVE_TIME = 1<<0, |
| @@ -444,7 +516,9 @@ enum station_info_flags { | |||
| 444 | STATION_INFO_SIGNAL_AVG = 1<<13, | 516 | STATION_INFO_SIGNAL_AVG = 1<<13, |
| 445 | STATION_INFO_RX_BITRATE = 1<<14, | 517 | STATION_INFO_RX_BITRATE = 1<<14, |
| 446 | STATION_INFO_BSS_PARAM = 1<<15, | 518 | STATION_INFO_BSS_PARAM = 1<<15, |
| 447 | STATION_INFO_CONNECTED_TIME = 1<<16 | 519 | STATION_INFO_CONNECTED_TIME = 1<<16, |
| 520 | STATION_INFO_ASSOC_REQ_IES = 1<<17, | ||
| 521 | STATION_INFO_STA_FLAGS = 1<<18 | ||
| 448 | }; | 522 | }; |
| 449 | 523 | ||
| 450 | /** | 524 | /** |
| @@ -536,6 +610,11 @@ struct sta_bss_parameters { | |||
| 536 | * This number should increase every time the list of stations | 610 | * This number should increase every time the list of stations |
| 537 | * changes, i.e. when a station is added or removed, so that | 611 | * changes, i.e. when a station is added or removed, so that |
| 538 | * userspace can tell whether it got a consistent snapshot. | 612 | * userspace can tell whether it got a consistent snapshot. |
| 613 | * @assoc_req_ies: IEs from (Re)Association Request. | ||
| 614 | * This is used only when in AP mode with drivers that do not use | ||
| 615 | * user space MLME/SME implementation. The information is provided for | ||
| 616 | * the cfg80211_new_sta() calls to notify user space of the IEs. | ||
| 617 | * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets. | ||
| 539 | */ | 618 | */ |
| 540 | struct station_info { | 619 | struct station_info { |
| 541 | u32 filled; | 620 | u32 filled; |
| @@ -556,8 +635,17 @@ struct station_info { | |||
| 556 | u32 tx_failed; | 635 | u32 tx_failed; |
| 557 | u32 rx_dropped_misc; | 636 | u32 rx_dropped_misc; |
| 558 | struct sta_bss_parameters bss_param; | 637 | struct sta_bss_parameters bss_param; |
| 638 | struct nl80211_sta_flag_update sta_flags; | ||
| 559 | 639 | ||
| 560 | int generation; | 640 | int generation; |
| 641 | |||
| 642 | const u8 *assoc_req_ies; | ||
| 643 | size_t assoc_req_ies_len; | ||
| 644 | |||
| 645 | /* | ||
| 646 | * Note: Add a new enum station_info_flags value for each new field and | ||
| 647 | * use it to check which fields are initialized. | ||
| 648 | */ | ||
| 561 | }; | 649 | }; |
| 562 | 650 | ||
| 563 | /** | 651 | /** |
| @@ -688,6 +776,12 @@ struct mesh_config { | |||
| 688 | u16 dot11MeshHWMPpreqMinInterval; | 776 | u16 dot11MeshHWMPpreqMinInterval; |
| 689 | u16 dot11MeshHWMPnetDiameterTraversalTime; | 777 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
| 690 | u8 dot11MeshHWMPRootMode; | 778 | u8 dot11MeshHWMPRootMode; |
| 779 | u16 dot11MeshHWMPRannInterval; | ||
| 780 | /* This is missnamed in draft 12.0: dot11MeshGateAnnouncementProtocol | ||
| 781 | * set to true only means that the station will announce others it's a | ||
| 782 | * mesh gate, but not necessarily using the gate announcement protocol. | ||
| 783 | * Still keeping the same nomenclature to be in sync with the spec. */ | ||
| 784 | bool dot11MeshGateAnnouncementProtocol; | ||
| 691 | }; | 785 | }; |
| 692 | 786 | ||
| 693 | /** | 787 | /** |
| @@ -781,6 +875,7 @@ struct cfg80211_ssid { | |||
| 781 | * @wiphy: the wiphy this was for | 875 | * @wiphy: the wiphy this was for |
| 782 | * @dev: the interface | 876 | * @dev: the interface |
| 783 | * @aborted: (internal) scan request was notified as aborted | 877 | * @aborted: (internal) scan request was notified as aborted |
| 878 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band | ||
| 784 | */ | 879 | */ |
| 785 | struct cfg80211_scan_request { | 880 | struct cfg80211_scan_request { |
| 786 | struct cfg80211_ssid *ssids; | 881 | struct cfg80211_ssid *ssids; |
| @@ -795,12 +890,22 @@ struct cfg80211_scan_request { | |||
| 795 | struct wiphy *wiphy; | 890 | struct wiphy *wiphy; |
| 796 | struct net_device *dev; | 891 | struct net_device *dev; |
| 797 | bool aborted; | 892 | bool aborted; |
| 893 | bool no_cck; | ||
| 798 | 894 | ||
| 799 | /* keep last */ | 895 | /* keep last */ |
| 800 | struct ieee80211_channel *channels[0]; | 896 | struct ieee80211_channel *channels[0]; |
| 801 | }; | 897 | }; |
| 802 | 898 | ||
| 803 | /** | 899 | /** |
| 900 | * struct cfg80211_match_set - sets of attributes to match | ||
| 901 | * | ||
| 902 | * @ssid: SSID to be matched | ||
| 903 | */ | ||
| 904 | struct cfg80211_match_set { | ||
| 905 | struct cfg80211_ssid ssid; | ||
| 906 | }; | ||
| 907 | |||
| 908 | /** | ||
| 804 | * struct cfg80211_sched_scan_request - scheduled scan request description | 909 | * struct cfg80211_sched_scan_request - scheduled scan request description |
| 805 | * | 910 | * |
| 806 | * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) | 911 | * @ssids: SSIDs to scan for (passed in the probe_reqs in active scans) |
| @@ -809,6 +914,11 @@ struct cfg80211_scan_request { | |||
| 809 | * @interval: interval between each scheduled scan cycle | 914 | * @interval: interval between each scheduled scan cycle |
| 810 | * @ie: optional information element(s) to add into Probe Request or %NULL | 915 | * @ie: optional information element(s) to add into Probe Request or %NULL |
| 811 | * @ie_len: length of ie in octets | 916 | * @ie_len: length of ie in octets |
| 917 | * @match_sets: sets of parameters to be matched for a scan result | ||
| 918 | * entry to be considered valid and to be passed to the host | ||
| 919 | * (others are filtered out). | ||
| 920 | * If ommited, all results are passed. | ||
| 921 | * @n_match_sets: number of match sets | ||
| 812 | * @wiphy: the wiphy this was for | 922 | * @wiphy: the wiphy this was for |
| 813 | * @dev: the interface | 923 | * @dev: the interface |
| 814 | * @channels: channels to scan | 924 | * @channels: channels to scan |
| @@ -820,6 +930,8 @@ struct cfg80211_sched_scan_request { | |||
| 820 | u32 interval; | 930 | u32 interval; |
| 821 | const u8 *ie; | 931 | const u8 *ie; |
| 822 | size_t ie_len; | 932 | size_t ie_len; |
| 933 | struct cfg80211_match_set *match_sets; | ||
| 934 | int n_match_sets; | ||
| 823 | 935 | ||
| 824 | /* internal */ | 936 | /* internal */ |
| 825 | struct wiphy *wiphy; | 937 | struct wiphy *wiphy; |
| @@ -896,36 +1008,6 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | |||
| 896 | 1008 | ||
| 897 | 1009 | ||
| 898 | /** | 1010 | /** |
| 899 | * struct cfg80211_crypto_settings - Crypto settings | ||
| 900 | * @wpa_versions: indicates which, if any, WPA versions are enabled | ||
| 901 | * (from enum nl80211_wpa_versions) | ||
| 902 | * @cipher_group: group key cipher suite (or 0 if unset) | ||
| 903 | * @n_ciphers_pairwise: number of AP supported unicast ciphers | ||
| 904 | * @ciphers_pairwise: unicast key cipher suites | ||
| 905 | * @n_akm_suites: number of AKM suites | ||
| 906 | * @akm_suites: AKM suites | ||
| 907 | * @control_port: Whether user space controls IEEE 802.1X port, i.e., | ||
| 908 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is | ||
| 909 | * required to assume that the port is unauthorized until authorized by | ||
| 910 | * user space. Otherwise, port is marked authorized by default. | ||
| 911 | * @control_port_ethertype: the control port protocol that should be | ||
| 912 | * allowed through even on unauthorized ports | ||
| 913 | * @control_port_no_encrypt: TRUE to prevent encryption of control port | ||
| 914 | * protocol frames. | ||
| 915 | */ | ||
| 916 | struct cfg80211_crypto_settings { | ||
| 917 | u32 wpa_versions; | ||
| 918 | u32 cipher_group; | ||
| 919 | int n_ciphers_pairwise; | ||
| 920 | u32 ciphers_pairwise[NL80211_MAX_NR_CIPHER_SUITES]; | ||
| 921 | int n_akm_suites; | ||
| 922 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; | ||
| 923 | bool control_port; | ||
| 924 | __be16 control_port_ethertype; | ||
| 925 | bool control_port_no_encrypt; | ||
| 926 | }; | ||
| 927 | |||
| 928 | /** | ||
| 929 | * struct cfg80211_auth_request - Authentication request data | 1011 | * struct cfg80211_auth_request - Authentication request data |
| 930 | * | 1012 | * |
| 931 | * This structure provides information needed to complete IEEE 802.11 | 1013 | * This structure provides information needed to complete IEEE 802.11 |
| @@ -1343,6 +1425,9 @@ struct cfg80211_gtk_rekey_data { | |||
| 1343 | * @set_ringparam: Set tx and rx ring sizes. | 1425 | * @set_ringparam: Set tx and rx ring sizes. |
| 1344 | * | 1426 | * |
| 1345 | * @get_ringparam: Get tx and rx ring current and maximum sizes. | 1427 | * @get_ringparam: Get tx and rx ring current and maximum sizes. |
| 1428 | * | ||
| 1429 | * @tdls_mgmt: Transmit a TDLS management frame. | ||
| 1430 | * @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup). | ||
| 1346 | */ | 1431 | */ |
| 1347 | struct cfg80211_ops { | 1432 | struct cfg80211_ops { |
| 1348 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); | 1433 | int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); |
| @@ -1419,7 +1504,7 @@ struct cfg80211_ops { | |||
| 1419 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, | 1504 | int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, |
| 1420 | struct bss_parameters *params); | 1505 | struct bss_parameters *params); |
| 1421 | 1506 | ||
| 1422 | int (*set_txq_params)(struct wiphy *wiphy, | 1507 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, |
| 1423 | struct ieee80211_txq_params *params); | 1508 | struct ieee80211_txq_params *params); |
| 1424 | 1509 | ||
| 1425 | int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, | 1510 | int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, |
| @@ -1495,7 +1580,8 @@ struct cfg80211_ops { | |||
| 1495 | struct ieee80211_channel *chan, bool offchan, | 1580 | struct ieee80211_channel *chan, bool offchan, |
| 1496 | enum nl80211_channel_type channel_type, | 1581 | enum nl80211_channel_type channel_type, |
| 1497 | bool channel_type_valid, unsigned int wait, | 1582 | bool channel_type_valid, unsigned int wait, |
| 1498 | const u8 *buf, size_t len, u64 *cookie); | 1583 | const u8 *buf, size_t len, bool no_cck, |
| 1584 | u64 *cookie); | ||
| 1499 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1585 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
| 1500 | struct net_device *dev, | 1586 | struct net_device *dev, |
| 1501 | u64 cookie); | 1587 | u64 cookie); |
| @@ -1525,6 +1611,12 @@ struct cfg80211_ops { | |||
| 1525 | 1611 | ||
| 1526 | int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev, | 1612 | int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev, |
| 1527 | struct cfg80211_gtk_rekey_data *data); | 1613 | struct cfg80211_gtk_rekey_data *data); |
| 1614 | |||
| 1615 | int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1616 | u8 *peer, u8 action_code, u8 dialog_token, | ||
| 1617 | u16 status_code, const u8 *buf, size_t len); | ||
| 1618 | int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev, | ||
| 1619 | u8 *peer, enum nl80211_tdls_operation oper); | ||
| 1528 | }; | 1620 | }; |
| 1529 | 1621 | ||
| 1530 | /* | 1622 | /* |
| @@ -1574,6 +1666,15 @@ struct cfg80211_ops { | |||
| 1574 | * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing | 1666 | * @WIPHY_FLAG_MESH_AUTH: The device supports mesh authentication by routing |
| 1575 | * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. | 1667 | * auth frames to userspace. See @NL80211_MESH_SETUP_USERSPACE_AUTH. |
| 1576 | * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans. | 1668 | * @WIPHY_FLAG_SUPPORTS_SCHED_SCAN: The device supports scheduled scans. |
| 1669 | * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the | ||
| 1670 | * firmware. | ||
| 1671 | * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP. | ||
| 1672 | * @WIPHY_FLAG_SUPPORTS_TDLS: The device supports TDLS (802.11z) operation. | ||
| 1673 | * @WIPHY_FLAG_TDLS_EXTERNAL_SETUP: The device does not handle TDLS (802.11z) | ||
| 1674 | * link setup/discovery operations internally. Setup, discovery and | ||
| 1675 | * teardown packets should be sent through the @NL80211_CMD_TDLS_MGMT | ||
| 1676 | * command. When this flag is not set, @NL80211_CMD_TDLS_OPER should be | ||
| 1677 | * used for asking the driver/firmware to perform a TDLS operation. | ||
| 1577 | */ | 1678 | */ |
| 1578 | enum wiphy_flags { | 1679 | enum wiphy_flags { |
| 1579 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1680 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
| @@ -1588,6 +1689,10 @@ enum wiphy_flags { | |||
| 1588 | WIPHY_FLAG_MESH_AUTH = BIT(10), | 1689 | WIPHY_FLAG_MESH_AUTH = BIT(10), |
| 1589 | WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), | 1690 | WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), |
| 1590 | WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), | 1691 | WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), |
| 1692 | WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13), | ||
| 1693 | WIPHY_FLAG_AP_UAPSD = BIT(14), | ||
| 1694 | WIPHY_FLAG_SUPPORTS_TDLS = BIT(15), | ||
| 1695 | WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(16), | ||
| 1591 | }; | 1696 | }; |
| 1592 | 1697 | ||
| 1593 | /** | 1698 | /** |
| @@ -1749,6 +1854,7 @@ struct wiphy_wowlan_support { | |||
| 1749 | * @debugfsdir: debugfs directory used for this wiphy, will be renamed | 1854 | * @debugfsdir: debugfs directory used for this wiphy, will be renamed |
| 1750 | * automatically on wiphy renames | 1855 | * automatically on wiphy renames |
| 1751 | * @dev: (virtual) struct device for this wiphy | 1856 | * @dev: (virtual) struct device for this wiphy |
| 1857 | * @registered: helps synchronize suspend/resume with wiphy unregister | ||
| 1752 | * @wext: wireless extension handlers | 1858 | * @wext: wireless extension handlers |
| 1753 | * @priv: driver private data (sized according to wiphy_new() parameter) | 1859 | * @priv: driver private data (sized according to wiphy_new() parameter) |
| 1754 | * @interface_modes: bitmask of interfaces types valid for this wiphy, | 1860 | * @interface_modes: bitmask of interfaces types valid for this wiphy, |
| @@ -1765,6 +1871,9 @@ struct wiphy_wowlan_support { | |||
| 1765 | * any given scan | 1871 | * any given scan |
| 1766 | * @max_sched_scan_ssids: maximum number of SSIDs the device can scan | 1872 | * @max_sched_scan_ssids: maximum number of SSIDs the device can scan |
| 1767 | * for in any given scheduled scan | 1873 | * for in any given scheduled scan |
| 1874 | * @max_match_sets: maximum number of match sets the device can handle | ||
| 1875 | * when performing a scheduled scan, 0 if filtering is not | ||
| 1876 | * supported. | ||
| 1768 | * @max_scan_ie_len: maximum length of user-controlled IEs device can | 1877 | * @max_scan_ie_len: maximum length of user-controlled IEs device can |
| 1769 | * add to probe request frames transmitted during a scan, must not | 1878 | * add to probe request frames transmitted during a scan, must not |
| 1770 | * include fixed IEs like supported rates | 1879 | * include fixed IEs like supported rates |
| @@ -1822,6 +1931,7 @@ struct wiphy { | |||
| 1822 | int bss_priv_size; | 1931 | int bss_priv_size; |
| 1823 | u8 max_scan_ssids; | 1932 | u8 max_scan_ssids; |
| 1824 | u8 max_sched_scan_ssids; | 1933 | u8 max_sched_scan_ssids; |
| 1934 | u8 max_match_sets; | ||
| 1825 | u16 max_scan_ie_len; | 1935 | u16 max_scan_ie_len; |
| 1826 | u16 max_sched_scan_ie_len; | 1936 | u16 max_sched_scan_ie_len; |
| 1827 | 1937 | ||
| @@ -2235,6 +2345,69 @@ extern int ieee80211_radiotap_iterator_next( | |||
| 2235 | extern const unsigned char rfc1042_header[6]; | 2345 | extern const unsigned char rfc1042_header[6]; |
| 2236 | extern const unsigned char bridge_tunnel_header[6]; | 2346 | extern const unsigned char bridge_tunnel_header[6]; |
| 2237 | 2347 | ||
| 2348 | /* Parsed Information Elements */ | ||
| 2349 | struct ieee802_11_elems { | ||
| 2350 | u8 *ie_start; | ||
| 2351 | size_t total_len; | ||
| 2352 | |||
| 2353 | /* pointers to IEs */ | ||
| 2354 | u8 *ssid; | ||
| 2355 | u8 *supp_rates; | ||
| 2356 | u8 *fh_params; | ||
| 2357 | u8 *ds_params; | ||
| 2358 | u8 *cf_params; | ||
| 2359 | struct ieee80211_tim_ie *tim; | ||
| 2360 | u8 *ibss_params; | ||
| 2361 | u8 *challenge; | ||
| 2362 | u8 *wpa; | ||
| 2363 | u8 *rsn; | ||
| 2364 | u8 *erp_info; | ||
| 2365 | u8 *ext_supp_rates; | ||
| 2366 | u8 *wmm_info; | ||
| 2367 | u8 *wmm_param; | ||
| 2368 | struct ieee80211_ht_cap *ht_cap_elem; | ||
| 2369 | struct ieee80211_ht_info *ht_info_elem; | ||
| 2370 | struct ieee80211_meshconf_ie *mesh_config; | ||
| 2371 | u8 *mesh_id; | ||
| 2372 | u8 *peering; | ||
| 2373 | u8 *preq; | ||
| 2374 | u8 *prep; | ||
| 2375 | u8 *perr; | ||
| 2376 | struct ieee80211_rann_ie *rann; | ||
| 2377 | u8 *ch_switch_elem; | ||
| 2378 | u8 *country_elem; | ||
| 2379 | u8 *pwr_constr_elem; | ||
| 2380 | u8 *quiet_elem; /* first quite element */ | ||
| 2381 | u8 *timeout_int; | ||
| 2382 | |||
| 2383 | /* length of them, respectively */ | ||
| 2384 | u8 ssid_len; | ||
| 2385 | u8 supp_rates_len; | ||
| 2386 | u8 fh_params_len; | ||
| 2387 | u8 ds_params_len; | ||
| 2388 | u8 cf_params_len; | ||
| 2389 | u8 tim_len; | ||
| 2390 | u8 ibss_params_len; | ||
| 2391 | u8 challenge_len; | ||
| 2392 | u8 wpa_len; | ||
| 2393 | u8 rsn_len; | ||
| 2394 | u8 erp_info_len; | ||
| 2395 | u8 ext_supp_rates_len; | ||
| 2396 | u8 wmm_info_len; | ||
| 2397 | u8 wmm_param_len; | ||
| 2398 | u8 mesh_id_len; | ||
| 2399 | u8 peering_len; | ||
| 2400 | u8 preq_len; | ||
| 2401 | u8 prep_len; | ||
| 2402 | u8 perr_len; | ||
| 2403 | u8 ch_switch_elem_len; | ||
| 2404 | u8 country_elem_len; | ||
| 2405 | u8 pwr_constr_elem_len; | ||
| 2406 | u8 quiet_elem_len; | ||
| 2407 | u8 num_of_quiet_elem; /* can be more the one */ | ||
| 2408 | u8 timeout_int_len; | ||
| 2409 | }; | ||
| 2410 | |||
| 2238 | /** | 2411 | /** |
| 2239 | * ieee80211_get_hdrlen_from_skb - get header length from data | 2412 | * ieee80211_get_hdrlen_from_skb - get header length from data |
| 2240 | * | 2413 | * |
| @@ -2324,6 +2497,24 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb); | |||
| 2324 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); | 2497 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); |
| 2325 | 2498 | ||
| 2326 | /** | 2499 | /** |
| 2500 | * cfg80211_find_vendor_ie - find vendor specific information element in data | ||
| 2501 | * | ||
| 2502 | * @oui: vendor OUI | ||
| 2503 | * @oui_type: vendor-specific OUI type | ||
| 2504 | * @ies: data consisting of IEs | ||
| 2505 | * @len: length of data | ||
| 2506 | * | ||
| 2507 | * This function will return %NULL if the vendor specific element ID | ||
| 2508 | * could not be found or if the element is invalid (claims to be | ||
| 2509 | * longer than the given data), or a pointer to the first byte | ||
| 2510 | * of the requested element, that is the byte containing the | ||
| 2511 | * element ID. There are no checks on the element length | ||
| 2512 | * other than having to fit into the given data. | ||
| 2513 | */ | ||
| 2514 | const u8 *cfg80211_find_vendor_ie(unsigned int oui, u8 oui_type, | ||
| 2515 | const u8 *ies, int len); | ||
| 2516 | |||
| 2517 | /** | ||
| 2327 | * DOC: Regulatory enforcement infrastructure | 2518 | * DOC: Regulatory enforcement infrastructure |
| 2328 | * | 2519 | * |
| 2329 | * TODO | 2520 | * TODO |
| @@ -2398,113 +2589,6 @@ extern int freq_reg_info(struct wiphy *wiphy, | |||
| 2398 | const struct ieee80211_reg_rule **reg_rule); | 2589 | const struct ieee80211_reg_rule **reg_rule); |
| 2399 | 2590 | ||
| 2400 | /* | 2591 | /* |
| 2401 | * Temporary wext handlers & helper functions | ||
| 2402 | * | ||
| 2403 | * In the future cfg80211 will simply assign the entire wext handler | ||
| 2404 | * structure to netdevs it manages, but we're not there yet. | ||
| 2405 | */ | ||
| 2406 | int cfg80211_wext_giwname(struct net_device *dev, | ||
| 2407 | struct iw_request_info *info, | ||
| 2408 | char *name, char *extra); | ||
| 2409 | int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info, | ||
| 2410 | u32 *mode, char *extra); | ||
| 2411 | int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, | ||
| 2412 | u32 *mode, char *extra); | ||
| 2413 | int cfg80211_wext_siwscan(struct net_device *dev, | ||
| 2414 | struct iw_request_info *info, | ||
| 2415 | union iwreq_data *wrqu, char *extra); | ||
| 2416 | int cfg80211_wext_giwscan(struct net_device *dev, | ||
| 2417 | struct iw_request_info *info, | ||
| 2418 | struct iw_point *data, char *extra); | ||
| 2419 | int cfg80211_wext_siwmlme(struct net_device *dev, | ||
| 2420 | struct iw_request_info *info, | ||
| 2421 | struct iw_point *data, char *extra); | ||
| 2422 | int cfg80211_wext_giwrange(struct net_device *dev, | ||
| 2423 | struct iw_request_info *info, | ||
| 2424 | struct iw_point *data, char *extra); | ||
| 2425 | int cfg80211_wext_siwgenie(struct net_device *dev, | ||
| 2426 | struct iw_request_info *info, | ||
| 2427 | struct iw_point *data, char *extra); | ||
| 2428 | int cfg80211_wext_siwauth(struct net_device *dev, | ||
| 2429 | struct iw_request_info *info, | ||
| 2430 | struct iw_param *data, char *extra); | ||
| 2431 | int cfg80211_wext_giwauth(struct net_device *dev, | ||
| 2432 | struct iw_request_info *info, | ||
| 2433 | struct iw_param *data, char *extra); | ||
| 2434 | |||
| 2435 | int cfg80211_wext_siwfreq(struct net_device *dev, | ||
| 2436 | struct iw_request_info *info, | ||
| 2437 | struct iw_freq *freq, char *extra); | ||
| 2438 | int cfg80211_wext_giwfreq(struct net_device *dev, | ||
| 2439 | struct iw_request_info *info, | ||
| 2440 | struct iw_freq *freq, char *extra); | ||
| 2441 | int cfg80211_wext_siwessid(struct net_device *dev, | ||
| 2442 | struct iw_request_info *info, | ||
| 2443 | struct iw_point *data, char *ssid); | ||
| 2444 | int cfg80211_wext_giwessid(struct net_device *dev, | ||
| 2445 | struct iw_request_info *info, | ||
| 2446 | struct iw_point *data, char *ssid); | ||
| 2447 | int cfg80211_wext_siwrate(struct net_device *dev, | ||
| 2448 | struct iw_request_info *info, | ||
| 2449 | struct iw_param *rate, char *extra); | ||
| 2450 | int cfg80211_wext_giwrate(struct net_device *dev, | ||
| 2451 | struct iw_request_info *info, | ||
| 2452 | struct iw_param *rate, char *extra); | ||
| 2453 | |||
| 2454 | int cfg80211_wext_siwrts(struct net_device *dev, | ||
| 2455 | struct iw_request_info *info, | ||
| 2456 | struct iw_param *rts, char *extra); | ||
| 2457 | int cfg80211_wext_giwrts(struct net_device *dev, | ||
| 2458 | struct iw_request_info *info, | ||
| 2459 | struct iw_param *rts, char *extra); | ||
| 2460 | int cfg80211_wext_siwfrag(struct net_device *dev, | ||
| 2461 | struct iw_request_info *info, | ||
| 2462 | struct iw_param *frag, char *extra); | ||
| 2463 | int cfg80211_wext_giwfrag(struct net_device *dev, | ||
| 2464 | struct iw_request_info *info, | ||
| 2465 | struct iw_param *frag, char *extra); | ||
| 2466 | int cfg80211_wext_siwretry(struct net_device *dev, | ||
| 2467 | struct iw_request_info *info, | ||
| 2468 | struct iw_param *retry, char *extra); | ||
| 2469 | int cfg80211_wext_giwretry(struct net_device *dev, | ||
| 2470 | struct iw_request_info *info, | ||
| 2471 | struct iw_param *retry, char *extra); | ||
| 2472 | int cfg80211_wext_siwencodeext(struct net_device *dev, | ||
| 2473 | struct iw_request_info *info, | ||
| 2474 | struct iw_point *erq, char *extra); | ||
| 2475 | int cfg80211_wext_siwencode(struct net_device *dev, | ||
| 2476 | struct iw_request_info *info, | ||
| 2477 | struct iw_point *erq, char *keybuf); | ||
| 2478 | int cfg80211_wext_giwencode(struct net_device *dev, | ||
| 2479 | struct iw_request_info *info, | ||
| 2480 | struct iw_point *erq, char *keybuf); | ||
| 2481 | int cfg80211_wext_siwtxpower(struct net_device *dev, | ||
| 2482 | struct iw_request_info *info, | ||
| 2483 | union iwreq_data *data, char *keybuf); | ||
| 2484 | int cfg80211_wext_giwtxpower(struct net_device *dev, | ||
| 2485 | struct iw_request_info *info, | ||
| 2486 | union iwreq_data *data, char *keybuf); | ||
| 2487 | struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev); | ||
| 2488 | |||
| 2489 | int cfg80211_wext_siwpower(struct net_device *dev, | ||
| 2490 | struct iw_request_info *info, | ||
| 2491 | struct iw_param *wrq, char *extra); | ||
| 2492 | int cfg80211_wext_giwpower(struct net_device *dev, | ||
| 2493 | struct iw_request_info *info, | ||
| 2494 | struct iw_param *wrq, char *extra); | ||
| 2495 | |||
| 2496 | int cfg80211_wext_siwap(struct net_device *dev, | ||
| 2497 | struct iw_request_info *info, | ||
| 2498 | struct sockaddr *ap_addr, char *extra); | ||
| 2499 | int cfg80211_wext_giwap(struct net_device *dev, | ||
| 2500 | struct iw_request_info *info, | ||
| 2501 | struct sockaddr *ap_addr, char *extra); | ||
| 2502 | |||
| 2503 | int cfg80211_wext_siwpmksa(struct net_device *dev, | ||
| 2504 | struct iw_request_info *info, | ||
| 2505 | struct iw_point *data, char *extra); | ||
| 2506 | |||
| 2507 | /* | ||
| 2508 | * callbacks for asynchronous cfg80211 methods, notification | 2592 | * callbacks for asynchronous cfg80211 methods, notification |
| 2509 | * functions and BSS handling helpers | 2593 | * functions and BSS handling helpers |
| 2510 | */ | 2594 | */ |
| @@ -3090,6 +3174,17 @@ void cfg80211_cqm_pktloss_notify(struct net_device *dev, | |||
| 3090 | void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid, | 3174 | void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid, |
| 3091 | const u8 *replay_ctr, gfp_t gfp); | 3175 | const u8 *replay_ctr, gfp_t gfp); |
| 3092 | 3176 | ||
| 3177 | /** | ||
| 3178 | * cfg80211_pmksa_candidate_notify - notify about PMKSA caching candidate | ||
| 3179 | * @dev: network device | ||
| 3180 | * @index: candidate index (the smaller the index, the higher the priority) | ||
| 3181 | * @bssid: BSSID of AP | ||
| 3182 | * @preauth: Whether AP advertises support for RSN pre-authentication | ||
| 3183 | * @gfp: allocation flags | ||
| 3184 | */ | ||
| 3185 | void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index, | ||
| 3186 | const u8 *bssid, bool preauth, gfp_t gfp); | ||
| 3187 | |||
| 3093 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3188 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 3094 | 3189 | ||
| 3095 | /* wiphy_printk helpers, similar to dev_printk */ | 3190 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h index bc1e7ef40171..443626ed4cbc 100644 --- a/include/net/dcbevent.h +++ b/include/net/dcbevent.h | |||
| @@ -24,8 +24,26 @@ enum dcbevent_notif_type { | |||
| 24 | DCB_APP_EVENT = 1, | 24 | DCB_APP_EVENT = 1, |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | #ifdef CONFIG_DCB | ||
| 27 | extern int register_dcbevent_notifier(struct notifier_block *nb); | 28 | extern int register_dcbevent_notifier(struct notifier_block *nb); |
| 28 | extern int unregister_dcbevent_notifier(struct notifier_block *nb); | 29 | extern int unregister_dcbevent_notifier(struct notifier_block *nb); |
| 29 | extern int call_dcbevent_notifiers(unsigned long val, void *v); | 30 | extern int call_dcbevent_notifiers(unsigned long val, void *v); |
| 31 | #else | ||
| 32 | static inline int | ||
| 33 | register_dcbevent_notifier(struct notifier_block *nb) | ||
| 34 | { | ||
| 35 | return 0; | ||
| 36 | } | ||
| 37 | |||
| 38 | static inline int unregister_dcbevent_notifier(struct notifier_block *nb) | ||
| 39 | { | ||
| 40 | return 0; | ||
| 41 | } | ||
| 42 | |||
| 43 | static inline int call_dcbevent_notifiers(unsigned long val, void *v) | ||
| 44 | { | ||
| 45 | return 0; | ||
| 46 | } | ||
| 47 | #endif /* CONFIG_DCB */ | ||
| 30 | 48 | ||
| 31 | #endif | 49 | #endif |
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h index f5aa39997f0b..2cd66d0be348 100644 --- a/include/net/dcbnl.h +++ b/include/net/dcbnl.h | |||
| @@ -23,9 +23,10 @@ | |||
| 23 | #include <linux/dcbnl.h> | 23 | #include <linux/dcbnl.h> |
| 24 | 24 | ||
| 25 | struct dcb_app_type { | 25 | struct dcb_app_type { |
| 26 | char name[IFNAMSIZ]; | 26 | int ifindex; |
| 27 | struct dcb_app app; | 27 | struct dcb_app app; |
| 28 | struct list_head list; | 28 | struct list_head list; |
| 29 | u8 dcbx; | ||
| 29 | }; | 30 | }; |
| 30 | 31 | ||
| 31 | int dcb_setapp(struct net_device *, struct dcb_app *); | 32 | int dcb_setapp(struct net_device *, struct dcb_app *); |
diff --git a/include/net/dst.h b/include/net/dst.h index 13d507d69ddb..4fb6c4381791 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -325,7 +325,14 @@ static inline void skb_dst_force(struct sk_buff *skb) | |||
| 325 | static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | 325 | static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) |
| 326 | { | 326 | { |
| 327 | skb->dev = dev; | 327 | skb->dev = dev; |
| 328 | skb->rxhash = 0; | 328 | |
| 329 | /* | ||
| 330 | * Clear rxhash so that we can recalulate the hash for the | ||
| 331 | * encapsulated packet, unless we have already determine the hash | ||
| 332 | * over the L4 4-tuple. | ||
| 333 | */ | ||
| 334 | if (!skb->l4_rxhash) | ||
| 335 | skb->rxhash = 0; | ||
| 329 | skb_set_queue_mapping(skb, 0); | 336 | skb_set_queue_mapping(skb, 0); |
| 330 | skb_dst_drop(skb); | 337 | skb_dst_drop(skb); |
| 331 | nf_reset(skb); | 338 | nf_reset(skb); |
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index b0be5fb9de19..7e2c4d483ad0 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h | |||
| @@ -251,6 +251,7 @@ enum ieee80211_radiotap_type { | |||
| 251 | * retries */ | 251 | * retries */ |
| 252 | #define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ | 252 | #define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ |
| 253 | #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ | 253 | #define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ |
| 254 | #define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* don't expect an ack */ | ||
| 254 | 255 | ||
| 255 | 256 | ||
| 256 | /* For IEEE80211_RADIOTAP_MCS */ | 257 | /* For IEEE80211_RADIOTAP_MCS */ |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 11cf373970a9..51a7031b4aa3 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
| @@ -41,6 +41,7 @@ struct inet6_ifaddr { | |||
| 41 | struct in6_addr addr; | 41 | struct in6_addr addr; |
| 42 | __u32 prefix_len; | 42 | __u32 prefix_len; |
| 43 | 43 | ||
| 44 | /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */ | ||
| 44 | __u32 valid_lft; | 45 | __u32 valid_lft; |
| 45 | __u32 prefered_lft; | 46 | __u32 prefered_lft; |
| 46 | atomic_t refcnt; | 47 | atomic_t refcnt; |
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h index 2fa8d1341a0a..2fa14691869c 100644 --- a/include/net/inet_ecn.h +++ b/include/net/inet_ecn.h | |||
| @@ -30,6 +30,14 @@ static inline int INET_ECN_is_capable(__u8 dsfield) | |||
| 30 | return dsfield & INET_ECN_ECT_0; | 30 | return dsfield & INET_ECN_ECT_0; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * RFC 3168 9.1.1 | ||
| 35 | * The full-functionality option for ECN encapsulation is to copy the | ||
| 36 | * ECN codepoint of the inside header to the outside header on | ||
| 37 | * encapsulation if the inside header is not-ECT or ECT, and to set the | ||
| 38 | * ECN codepoint of the outside header to ECT(0) if the ECN codepoint of | ||
| 39 | * the inside header is CE. | ||
| 40 | */ | ||
| 33 | static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) | 41 | static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) |
| 34 | { | 42 | { |
| 35 | outer &= ~INET_ECN_MASK; | 43 | outer &= ~INET_ECN_MASK; |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index f1a770977c4f..180231c5bbbe 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
| @@ -126,7 +126,8 @@ struct inet_timewait_sock { | |||
| 126 | /* And these are ours. */ | 126 | /* And these are ours. */ |
| 127 | unsigned int tw_ipv6only : 1, | 127 | unsigned int tw_ipv6only : 1, |
| 128 | tw_transparent : 1, | 128 | tw_transparent : 1, |
| 129 | tw_pad : 14, /* 14 bits hole */ | 129 | tw_pad : 6, /* 6 bits hole */ |
| 130 | tw_tos : 8, | ||
| 130 | tw_ipv6_offset : 16; | 131 | tw_ipv6_offset : 16; |
| 131 | kmemcheck_bitfield_end(flags); | 132 | kmemcheck_bitfield_end(flags); |
| 132 | unsigned long tw_ttd; | 133 | unsigned long tw_ttd; |
diff --git a/include/net/ip.h b/include/net/ip.h index aa76c7a4d9c3..eca0ef7a495e 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
| @@ -165,6 +165,7 @@ struct ip_reply_arg { | |||
| 165 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ | 165 | int csumoffset; /* u16 offset of csum in iov[0].iov_base */ |
| 166 | /* -1 if not needed */ | 166 | /* -1 if not needed */ |
| 167 | int bound_dev_if; | 167 | int bound_dev_if; |
| 168 | u8 tos; | ||
| 168 | }; | 169 | }; |
| 169 | 170 | ||
| 170 | #define IP_REPLY_ARG_NOSRCCHECK 1 | 171 | #define IP_REPLY_ARG_NOSRCCHECK 1 |
| @@ -175,7 +176,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
| 175 | } | 176 | } |
| 176 | 177 | ||
| 177 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, | 178 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, |
| 178 | struct ip_reply_arg *arg, unsigned int len); | 179 | const struct ip_reply_arg *arg, unsigned int len); |
| 179 | 180 | ||
| 180 | struct ipv4_config { | 181 | struct ipv4_config { |
| 181 | int log_martians; | 182 | int log_martians; |
| @@ -406,9 +407,18 @@ enum ip_defrag_users { | |||
| 406 | IP_DEFRAG_VS_OUT, | 407 | IP_DEFRAG_VS_OUT, |
| 407 | IP_DEFRAG_VS_FWD, | 408 | IP_DEFRAG_VS_FWD, |
| 408 | IP_DEFRAG_AF_PACKET, | 409 | IP_DEFRAG_AF_PACKET, |
| 410 | IP_DEFRAG_MACVLAN, | ||
| 409 | }; | 411 | }; |
| 410 | 412 | ||
| 411 | int ip_defrag(struct sk_buff *skb, u32 user); | 413 | int ip_defrag(struct sk_buff *skb, u32 user); |
| 414 | #ifdef CONFIG_INET | ||
| 415 | struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user); | ||
| 416 | #else | ||
| 417 | static inline struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user) | ||
| 418 | { | ||
| 419 | return skb; | ||
| 420 | } | ||
| 421 | #endif | ||
| 412 | int ip_frag_mem(struct net *net); | 422 | int ip_frag_mem(struct net *net); |
| 413 | int ip_frag_nqueues(struct net *net); | 423 | int ip_frag_nqueues(struct net *net); |
| 414 | 424 | ||
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h index f82a1e877372..f2419cf44cef 100644 --- a/include/net/iucv/af_iucv.h +++ b/include/net/iucv/af_iucv.h | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <linux/list.h> | 14 | #include <linux/list.h> |
| 15 | #include <linux/poll.h> | 15 | #include <linux/poll.h> |
| 16 | #include <linux/socket.h> | 16 | #include <linux/socket.h> |
| 17 | #include <net/iucv/iucv.h> | ||
| 17 | 18 | ||
| 18 | #ifndef AF_IUCV | 19 | #ifndef AF_IUCV |
| 19 | #define AF_IUCV 32 | 20 | #define AF_IUCV 32 |
| @@ -33,6 +34,7 @@ enum { | |||
| 33 | }; | 34 | }; |
| 34 | 35 | ||
| 35 | #define IUCV_QUEUELEN_DEFAULT 65535 | 36 | #define IUCV_QUEUELEN_DEFAULT 65535 |
| 37 | #define IUCV_HIPER_MSGLIM_DEFAULT 128 | ||
| 36 | #define IUCV_CONN_TIMEOUT (HZ * 40) | 38 | #define IUCV_CONN_TIMEOUT (HZ * 40) |
| 37 | #define IUCV_DISCONN_TIMEOUT (HZ * 2) | 39 | #define IUCV_DISCONN_TIMEOUT (HZ * 2) |
| 38 | #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) | 40 | #define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) |
| @@ -57,8 +59,51 @@ struct sock_msg_q { | |||
| 57 | spinlock_t lock; | 59 | spinlock_t lock; |
| 58 | }; | 60 | }; |
| 59 | 61 | ||
| 62 | #define AF_IUCV_FLAG_ACK 0x1 | ||
| 63 | #define AF_IUCV_FLAG_SYN 0x2 | ||
| 64 | #define AF_IUCV_FLAG_FIN 0x4 | ||
| 65 | #define AF_IUCV_FLAG_WIN 0x8 | ||
| 66 | |||
| 67 | struct af_iucv_trans_hdr { | ||
| 68 | u16 magic; | ||
| 69 | u8 version; | ||
| 70 | u8 flags; | ||
| 71 | u16 window; | ||
| 72 | char destNodeID[8]; | ||
| 73 | char destUserID[8]; | ||
| 74 | char destAppName[16]; | ||
| 75 | char srcNodeID[8]; | ||
| 76 | char srcUserID[8]; | ||
| 77 | char srcAppName[16]; /* => 70 bytes */ | ||
| 78 | struct iucv_message iucv_hdr; /* => 33 bytes */ | ||
| 79 | u8 pad; /* total 104 bytes */ | ||
| 80 | } __packed; | ||
| 81 | |||
| 82 | enum iucv_tx_notify { | ||
| 83 | /* transmission of skb is completed and was successful */ | ||
| 84 | TX_NOTIFY_OK = 0, | ||
| 85 | /* target is unreachable */ | ||
| 86 | TX_NOTIFY_UNREACHABLE = 1, | ||
| 87 | /* transfer pending queue full */ | ||
| 88 | TX_NOTIFY_TPQFULL = 2, | ||
| 89 | /* general error */ | ||
| 90 | TX_NOTIFY_GENERALERROR = 3, | ||
| 91 | /* transmission of skb is pending - may interleave | ||
| 92 | * with TX_NOTIFY_DELAYED_* */ | ||
| 93 | TX_NOTIFY_PENDING = 4, | ||
| 94 | /* transmission of skb was done successfully (delayed) */ | ||
| 95 | TX_NOTIFY_DELAYED_OK = 5, | ||
| 96 | /* target unreachable (detected delayed) */ | ||
| 97 | TX_NOTIFY_DELAYED_UNREACHABLE = 6, | ||
| 98 | /* general error (detected delayed) */ | ||
| 99 | TX_NOTIFY_DELAYED_GENERALERROR = 7, | ||
| 100 | }; | ||
| 101 | |||
| 60 | #define iucv_sk(__sk) ((struct iucv_sock *) __sk) | 102 | #define iucv_sk(__sk) ((struct iucv_sock *) __sk) |
| 61 | 103 | ||
| 104 | #define AF_IUCV_TRANS_IUCV 0 | ||
| 105 | #define AF_IUCV_TRANS_HIPER 1 | ||
| 106 | |||
| 62 | struct iucv_sock { | 107 | struct iucv_sock { |
| 63 | struct sock sk; | 108 | struct sock sk; |
| 64 | char src_user_id[8]; | 109 | char src_user_id[8]; |
| @@ -75,6 +120,13 @@ struct iucv_sock { | |||
| 75 | unsigned int send_tag; | 120 | unsigned int send_tag; |
| 76 | u8 flags; | 121 | u8 flags; |
| 77 | u16 msglimit; | 122 | u16 msglimit; |
| 123 | u16 msglimit_peer; | ||
| 124 | atomic_t msg_sent; | ||
| 125 | atomic_t msg_recv; | ||
| 126 | atomic_t pendings; | ||
| 127 | int transport; | ||
| 128 | void (*sk_txnotify)(struct sk_buff *skb, | ||
| 129 | enum iucv_tx_notify n); | ||
| 78 | }; | 130 | }; |
| 79 | 131 | ||
| 80 | /* iucv socket options (SOL_IUCV) */ | 132 | /* iucv socket options (SOL_IUCV) */ |
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h index 1121baa9f695..0894ced31957 100644 --- a/include/net/iucv/iucv.h +++ b/include/net/iucv/iucv.h | |||
| @@ -120,7 +120,7 @@ struct iucv_message { | |||
| 120 | u32 reply_size; | 120 | u32 reply_size; |
| 121 | u8 rmmsg[8]; | 121 | u8 rmmsg[8]; |
| 122 | u8 flags; | 122 | u8 flags; |
| 123 | }; | 123 | } __packed; |
| 124 | 124 | ||
| 125 | /* | 125 | /* |
| 126 | * struct iucv_handler | 126 | * struct iucv_handler |
| @@ -459,3 +459,37 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg, | |||
| 459 | int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg, | 459 | int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg, |
| 460 | u8 flags, u32 srccls, void *buffer, size_t size, | 460 | u8 flags, u32 srccls, void *buffer, size_t size, |
| 461 | void *answer, size_t asize, size_t *residual); | 461 | void *answer, size_t asize, size_t *residual); |
| 462 | |||
| 463 | struct iucv_interface { | ||
| 464 | int (*message_receive)(struct iucv_path *path, struct iucv_message *msg, | ||
| 465 | u8 flags, void *buffer, size_t size, size_t *residual); | ||
| 466 | int (*__message_receive)(struct iucv_path *path, | ||
| 467 | struct iucv_message *msg, u8 flags, void *buffer, size_t size, | ||
| 468 | size_t *residual); | ||
| 469 | int (*message_reply)(struct iucv_path *path, struct iucv_message *msg, | ||
| 470 | u8 flags, void *reply, size_t size); | ||
| 471 | int (*message_reject)(struct iucv_path *path, struct iucv_message *msg); | ||
| 472 | int (*message_send)(struct iucv_path *path, struct iucv_message *msg, | ||
| 473 | u8 flags, u32 srccls, void *buffer, size_t size); | ||
| 474 | int (*__message_send)(struct iucv_path *path, struct iucv_message *msg, | ||
| 475 | u8 flags, u32 srccls, void *buffer, size_t size); | ||
| 476 | int (*message_send2way)(struct iucv_path *path, | ||
| 477 | struct iucv_message *msg, u8 flags, u32 srccls, void *buffer, | ||
| 478 | size_t size, void *answer, size_t asize, size_t *residual); | ||
| 479 | int (*message_purge)(struct iucv_path *path, struct iucv_message *msg, | ||
| 480 | u32 srccls); | ||
| 481 | int (*path_accept)(struct iucv_path *path, struct iucv_handler *handler, | ||
| 482 | u8 userdata[16], void *private); | ||
| 483 | int (*path_connect)(struct iucv_path *path, | ||
| 484 | struct iucv_handler *handler, | ||
| 485 | u8 userid[8], u8 system[8], u8 userdata[16], void *private); | ||
| 486 | int (*path_quiesce)(struct iucv_path *path, u8 userdata[16]); | ||
| 487 | int (*path_resume)(struct iucv_path *path, u8 userdata[16]); | ||
| 488 | int (*path_sever)(struct iucv_path *path, u8 userdata[16]); | ||
| 489 | int (*iucv_register)(struct iucv_handler *handler, int smp); | ||
| 490 | void (*iucv_unregister)(struct iucv_handler *handler, int smp); | ||
| 491 | struct bus_type *bus; | ||
| 492 | struct device *root; | ||
| 493 | }; | ||
| 494 | |||
| 495 | extern struct iucv_interface iucv_if; | ||
diff --git a/include/net/lapb.h b/include/net/lapb.h index 96cb5ddaa9f1..fd2bf572ee1d 100644 --- a/include/net/lapb.h +++ b/include/net/lapb.h | |||
| @@ -95,7 +95,7 @@ struct lapb_cb { | |||
| 95 | struct sk_buff_head write_queue; | 95 | struct sk_buff_head write_queue; |
| 96 | struct sk_buff_head ack_queue; | 96 | struct sk_buff_head ack_queue; |
| 97 | unsigned char window; | 97 | unsigned char window; |
| 98 | struct lapb_register_struct callbacks; | 98 | const struct lapb_register_struct *callbacks; |
| 99 | 99 | ||
| 100 | /* FRMR control information */ | 100 | /* FRMR control information */ |
| 101 | struct lapb_frame frmr_data; | 101 | struct lapb_frame frmr_data; |
diff --git a/include/net/lib80211.h b/include/net/lib80211.h index b95bbb083ee8..2ec896bb72b2 100644 --- a/include/net/lib80211.h +++ b/include/net/lib80211.h | |||
| @@ -117,10 +117,7 @@ void lib80211_crypt_info_free(struct lib80211_crypt_info *info); | |||
| 117 | int lib80211_register_crypto_ops(struct lib80211_crypto_ops *ops); | 117 | int lib80211_register_crypto_ops(struct lib80211_crypto_ops *ops); |
| 118 | int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops); | 118 | int lib80211_unregister_crypto_ops(struct lib80211_crypto_ops *ops); |
| 119 | struct lib80211_crypto_ops *lib80211_get_crypto_ops(const char *name); | 119 | struct lib80211_crypto_ops *lib80211_get_crypto_ops(const char *name); |
| 120 | void lib80211_crypt_deinit_entries(struct lib80211_crypt_info *, int); | ||
| 121 | void lib80211_crypt_deinit_handler(unsigned long); | ||
| 122 | void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info, | 120 | void lib80211_crypt_delayed_deinit(struct lib80211_crypt_info *info, |
| 123 | struct lib80211_crypt_data **crypt); | 121 | struct lib80211_crypt_data **crypt); |
| 124 | void lib80211_crypt_quiescing(struct lib80211_crypt_info *info); | ||
| 125 | 122 | ||
| 126 | #endif /* LIB80211_H */ | 123 | #endif /* LIB80211_H */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 9259e97864d7..dc1123aa8181 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
| 17 | #include <linux/if_ether.h> | 17 | #include <linux/if_ether.h> |
| 18 | #include <linux/skbuff.h> | 18 | #include <linux/skbuff.h> |
| 19 | #include <linux/wireless.h> | ||
| 20 | #include <linux/device.h> | 19 | #include <linux/device.h> |
| 21 | #include <linux/ieee80211.h> | 20 | #include <linux/ieee80211.h> |
| 22 | #include <net/cfg80211.h> | 21 | #include <net/cfg80211.h> |
| @@ -110,6 +109,7 @@ enum ieee80211_ac_numbers { | |||
| 110 | IEEE80211_AC_BE = 2, | 109 | IEEE80211_AC_BE = 2, |
| 111 | IEEE80211_AC_BK = 3, | 110 | IEEE80211_AC_BK = 3, |
| 112 | }; | 111 | }; |
| 112 | #define IEEE80211_NUM_ACS 4 | ||
| 113 | 113 | ||
| 114 | /** | 114 | /** |
| 115 | * struct ieee80211_tx_queue_params - transmit queue configuration | 115 | * struct ieee80211_tx_queue_params - transmit queue configuration |
| @@ -165,13 +165,14 @@ struct ieee80211_low_level_stats { | |||
| 165 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | 165 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note |
| 166 | * that it is only ever disabled for station mode. | 166 | * that it is only ever disabled for station mode. |
| 167 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. | 167 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. |
| 168 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | ||
| 168 | */ | 169 | */ |
| 169 | enum ieee80211_bss_change { | 170 | enum ieee80211_bss_change { |
| 170 | BSS_CHANGED_ASSOC = 1<<0, | 171 | BSS_CHANGED_ASSOC = 1<<0, |
| 171 | BSS_CHANGED_ERP_CTS_PROT = 1<<1, | 172 | BSS_CHANGED_ERP_CTS_PROT = 1<<1, |
| 172 | BSS_CHANGED_ERP_PREAMBLE = 1<<2, | 173 | BSS_CHANGED_ERP_PREAMBLE = 1<<2, |
| 173 | BSS_CHANGED_ERP_SLOT = 1<<3, | 174 | BSS_CHANGED_ERP_SLOT = 1<<3, |
| 174 | BSS_CHANGED_HT = 1<<4, | 175 | BSS_CHANGED_HT = 1<<4, |
| 175 | BSS_CHANGED_BASIC_RATES = 1<<5, | 176 | BSS_CHANGED_BASIC_RATES = 1<<5, |
| 176 | BSS_CHANGED_BEACON_INT = 1<<6, | 177 | BSS_CHANGED_BEACON_INT = 1<<6, |
| 177 | BSS_CHANGED_BSSID = 1<<7, | 178 | BSS_CHANGED_BSSID = 1<<7, |
| @@ -182,6 +183,7 @@ enum ieee80211_bss_change { | |||
| 182 | BSS_CHANGED_ARP_FILTER = 1<<12, | 183 | BSS_CHANGED_ARP_FILTER = 1<<12, |
| 183 | BSS_CHANGED_QOS = 1<<13, | 184 | BSS_CHANGED_QOS = 1<<13, |
| 184 | BSS_CHANGED_IDLE = 1<<14, | 185 | BSS_CHANGED_IDLE = 1<<14, |
| 186 | BSS_CHANGED_SSID = 1<<15, | ||
| 185 | 187 | ||
| 186 | /* when adding here, make sure to change ieee80211_reconfig */ | 188 | /* when adding here, make sure to change ieee80211_reconfig */ |
| 187 | }; | 189 | }; |
| @@ -255,6 +257,9 @@ enum ieee80211_rssi_event { | |||
| 255 | * @idle: This interface is idle. There's also a global idle flag in the | 257 | * @idle: This interface is idle. There's also a global idle flag in the |
| 256 | * hardware config which may be more appropriate depending on what | 258 | * hardware config which may be more appropriate depending on what |
| 257 | * your driver/device needs to do. | 259 | * your driver/device needs to do. |
| 260 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | ||
| 261 | * @ssid_len: Length of SSID given in @ssid. | ||
| 262 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | ||
| 258 | */ | 263 | */ |
| 259 | struct ieee80211_bss_conf { | 264 | struct ieee80211_bss_conf { |
| 260 | const u8 *bssid; | 265 | const u8 *bssid; |
| @@ -281,6 +286,9 @@ struct ieee80211_bss_conf { | |||
| 281 | bool arp_filter_enabled; | 286 | bool arp_filter_enabled; |
| 282 | bool qos; | 287 | bool qos; |
| 283 | bool idle; | 288 | bool idle; |
| 289 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | ||
| 290 | size_t ssid_len; | ||
| 291 | bool hidden_ssid; | ||
| 284 | }; | 292 | }; |
| 285 | 293 | ||
| 286 | /** | 294 | /** |
| @@ -331,9 +339,9 @@ struct ieee80211_bss_conf { | |||
| 331 | * used to indicate that a frame was already retried due to PS | 339 | * used to indicate that a frame was already retried due to PS |
| 332 | * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, | 340 | * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, |
| 333 | * used to indicate frame should not be encrypted | 341 | * used to indicate frame should not be encrypted |
| 334 | * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?) | 342 | * @IEEE80211_TX_CTL_POLL_RESPONSE: This frame is a response to a poll |
| 335 | * This frame is a response to a PS-poll frame and should be sent | 343 | * frame (PS-Poll or uAPSD) and should be sent although the station |
| 336 | * although the station is in powersave mode. | 344 | * is in powersave mode. |
| 337 | * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the | 345 | * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the |
| 338 | * transmit function after the current frame, this can be used | 346 | * transmit function after the current frame, this can be used |
| 339 | * by drivers to kick the DMA queue only if unset or when the | 347 | * by drivers to kick the DMA queue only if unset or when the |
| @@ -341,8 +349,6 @@ struct ieee80211_bss_conf { | |||
| 341 | * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted | 349 | * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted |
| 342 | * after TX status because the destination was asleep, it must not | 350 | * after TX status because the destination was asleep, it must not |
| 343 | * be modified again (no seqno assignment, crypto, etc.) | 351 | * be modified again (no seqno assignment, crypto, etc.) |
| 344 | * @IEEE80211_TX_INTFL_HAS_RADIOTAP: This frame was injected and still | ||
| 345 | * has a radiotap header at skb->data. | ||
| 346 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 | 352 | * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 |
| 347 | * MLME command (internal to mac80211 to figure out whether to send TX | 353 | * MLME command (internal to mac80211 to figure out whether to send TX |
| 348 | * status to user space) | 354 | * status to user space) |
| @@ -356,6 +362,20 @@ struct ieee80211_bss_conf { | |||
| 356 | * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP | 362 | * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP |
| 357 | * testing. It will be sent out with incorrect Michael MIC key to allow | 363 | * testing. It will be sent out with incorrect Michael MIC key to allow |
| 358 | * TKIP countermeasures to be tested. | 364 | * TKIP countermeasures to be tested. |
| 365 | * @IEEE80211_TX_CTL_NO_CCK_RATE: This frame will be sent at non CCK rate. | ||
| 366 | * This flag is actually used for management frame especially for P2P | ||
| 367 | * frames not being sent at CCK rate in 2GHz band. | ||
| 368 | * @IEEE80211_TX_STATUS_EOSP: This packet marks the end of service period, | ||
| 369 | * when its status is reported the service period ends. For frames in | ||
| 370 | * an SP that mac80211 transmits, it is already set; for driver frames | ||
| 371 | * the driver may set this flag. It is also used to do the same for | ||
| 372 | * PS-Poll responses. | ||
| 373 | * @IEEE80211_TX_CTL_USE_MINRATE: This frame will be sent at lowest rate. | ||
| 374 | * This flag is used to send nullfunc frame at minimum rate when | ||
| 375 | * the nullfunc is used for connection monitoring purpose. | ||
| 376 | * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it | ||
| 377 | * would be fragmented by size (this is optional, only used for | ||
| 378 | * monitor injection). | ||
| 359 | * | 379 | * |
| 360 | * Note: If you have to add new flags to the enumeration, then don't | 380 | * Note: If you have to add new flags to the enumeration, then don't |
| 361 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | 381 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. |
| @@ -377,15 +397,19 @@ enum mac80211_tx_control_flags { | |||
| 377 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), | 397 | IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), |
| 378 | IEEE80211_TX_INTFL_RETRIED = BIT(15), | 398 | IEEE80211_TX_INTFL_RETRIED = BIT(15), |
| 379 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), | 399 | IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), |
| 380 | IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), | 400 | IEEE80211_TX_CTL_POLL_RESPONSE = BIT(17), |
| 381 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), | 401 | IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), |
| 382 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), | 402 | IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), |
| 383 | IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), | 403 | /* hole at 20, use later */ |
| 384 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), | 404 | IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), |
| 385 | IEEE80211_TX_CTL_LDPC = BIT(22), | 405 | IEEE80211_TX_CTL_LDPC = BIT(22), |
| 386 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), | 406 | IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), |
| 387 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), | 407 | IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), |
| 388 | IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), | 408 | IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), |
| 409 | IEEE80211_TX_CTL_NO_CCK_RATE = BIT(27), | ||
| 410 | IEEE80211_TX_STATUS_EOSP = BIT(28), | ||
| 411 | IEEE80211_TX_CTL_USE_MINRATE = BIT(29), | ||
| 412 | IEEE80211_TX_CTL_DONTFRAG = BIT(30), | ||
| 389 | }; | 413 | }; |
| 390 | 414 | ||
| 391 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 415 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
| @@ -399,9 +423,9 @@ enum mac80211_tx_control_flags { | |||
| 399 | IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ | 423 | IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ |
| 400 | IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ | 424 | IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ |
| 401 | IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ | 425 | IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ |
| 402 | IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ | 426 | IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_POLL_RESPONSE | \ |
| 403 | IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ | 427 | IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ |
| 404 | IEEE80211_TX_CTL_STBC) | 428 | IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP) |
| 405 | 429 | ||
| 406 | /** | 430 | /** |
| 407 | * enum mac80211_rate_control_flags - per-rate flags set by the | 431 | * enum mac80211_rate_control_flags - per-rate flags set by the |
| @@ -948,6 +972,9 @@ enum set_key_cmd { | |||
| 948 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. | 972 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. |
| 949 | * @drv_priv: data area for driver use, will always be aligned to | 973 | * @drv_priv: data area for driver use, will always be aligned to |
| 950 | * sizeof(void *), size is determined in hw information. | 974 | * sizeof(void *), size is determined in hw information. |
| 975 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid | ||
| 976 | * if wme is supported. | ||
| 977 | * @max_sp: max Service Period. Only valid if wme is supported. | ||
| 951 | */ | 978 | */ |
| 952 | struct ieee80211_sta { | 979 | struct ieee80211_sta { |
| 953 | u32 supp_rates[IEEE80211_NUM_BANDS]; | 980 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
| @@ -955,6 +982,8 @@ struct ieee80211_sta { | |||
| 955 | u16 aid; | 982 | u16 aid; |
| 956 | struct ieee80211_sta_ht_cap ht_cap; | 983 | struct ieee80211_sta_ht_cap ht_cap; |
| 957 | bool wme; | 984 | bool wme; |
| 985 | u8 uapsd_queues; | ||
| 986 | u8 max_sp; | ||
| 958 | 987 | ||
| 959 | /* must be last */ | 988 | /* must be last */ |
| 960 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 989 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
| @@ -1095,6 +1124,10 @@ enum sta_notify_cmd { | |||
| 1095 | * stations based on the PM bit of incoming frames. | 1124 | * stations based on the PM bit of incoming frames. |
| 1096 | * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure | 1125 | * Use ieee80211_start_ps()/ieee8021_end_ps() to manually configure |
| 1097 | * the PS mode of connected stations. | 1126 | * the PS mode of connected stations. |
| 1127 | * | ||
| 1128 | * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session | ||
| 1129 | * setup strictly in HW. mac80211 should not attempt to do this in | ||
| 1130 | * software. | ||
| 1098 | */ | 1131 | */ |
| 1099 | enum ieee80211_hw_flags { | 1132 | enum ieee80211_hw_flags { |
| 1100 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1133 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -1120,6 +1153,7 @@ enum ieee80211_hw_flags { | |||
| 1120 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, | 1153 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, |
| 1121 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | 1154 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, |
| 1122 | IEEE80211_HW_AP_LINK_PS = 1<<22, | 1155 | IEEE80211_HW_AP_LINK_PS = 1<<22, |
| 1156 | IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, | ||
| 1123 | }; | 1157 | }; |
| 1124 | 1158 | ||
| 1125 | /** | 1159 | /** |
| @@ -1511,6 +1545,95 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1511 | */ | 1545 | */ |
| 1512 | 1546 | ||
| 1513 | /** | 1547 | /** |
| 1548 | * DOC: AP support for powersaving clients | ||
| 1549 | * | ||
| 1550 | * In order to implement AP and P2P GO modes, mac80211 has support for | ||
| 1551 | * client powersaving, both "legacy" PS (PS-Poll/null data) and uAPSD. | ||
| 1552 | * There currently is no support for sAPSD. | ||
| 1553 | * | ||
| 1554 | * There is one assumption that mac80211 makes, namely that a client | ||
| 1555 | * will not poll with PS-Poll and trigger with uAPSD at the same time. | ||
| 1556 | * Both are supported, and both can be used by the same client, but | ||
| 1557 | * they can't be used concurrently by the same client. This simplifies | ||
| 1558 | * the driver code. | ||
| 1559 | * | ||
| 1560 | * The first thing to keep in mind is that there is a flag for complete | ||
| 1561 | * driver implementation: %IEEE80211_HW_AP_LINK_PS. If this flag is set, | ||
| 1562 | * mac80211 expects the driver to handle most of the state machine for | ||
| 1563 | * powersaving clients and will ignore the PM bit in incoming frames. | ||
| 1564 | * Drivers then use ieee80211_sta_ps_transition() to inform mac80211 of | ||
| 1565 | * stations' powersave transitions. In this mode, mac80211 also doesn't | ||
| 1566 | * handle PS-Poll/uAPSD. | ||
| 1567 | * | ||
| 1568 | * In the mode without %IEEE80211_HW_AP_LINK_PS, mac80211 will check the | ||
| 1569 | * PM bit in incoming frames for client powersave transitions. When a | ||
| 1570 | * station goes to sleep, we will stop transmitting to it. There is, | ||
| 1571 | * however, a race condition: a station might go to sleep while there is | ||
| 1572 | * data buffered on hardware queues. If the device has support for this | ||
| 1573 | * it will reject frames, and the driver should give the frames back to | ||
| 1574 | * mac80211 with the %IEEE80211_TX_STAT_TX_FILTERED flag set which will | ||
| 1575 | * cause mac80211 to retry the frame when the station wakes up. The | ||
| 1576 | * driver is also notified of powersave transitions by calling its | ||
| 1577 | * @sta_notify callback. | ||
| 1578 | * | ||
| 1579 | * When the station is asleep, it has three choices: it can wake up, | ||
| 1580 | * it can PS-Poll, or it can possibly start a uAPSD service period. | ||
| 1581 | * Waking up is implemented by simply transmitting all buffered (and | ||
| 1582 | * filtered) frames to the station. This is the easiest case. When | ||
| 1583 | * the station sends a PS-Poll or a uAPSD trigger frame, mac80211 | ||
| 1584 | * will inform the driver of this with the @allow_buffered_frames | ||
| 1585 | * callback; this callback is optional. mac80211 will then transmit | ||
| 1586 | * the frames as usual and set the %IEEE80211_TX_CTL_POLL_RESPONSE | ||
| 1587 | * on each frame. The last frame in the service period (or the only | ||
| 1588 | * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to | ||
| 1589 | * indicate that it ends the service period; as this frame must have | ||
| 1590 | * TX status report it also sets %IEEE80211_TX_CTL_REQ_TX_STATUS. | ||
| 1591 | * When TX status is reported for this frame, the service period is | ||
| 1592 | * marked has having ended and a new one can be started by the peer. | ||
| 1593 | * | ||
| 1594 | * Another race condition can happen on some devices like iwlwifi | ||
| 1595 | * when there are frames queued for the station and it wakes up | ||
| 1596 | * or polls; the frames that are already queued could end up being | ||
| 1597 | * transmitted first instead, causing reordering and/or wrong | ||
| 1598 | * processing of the EOSP. The cause is that allowing frames to be | ||
| 1599 | * transmitted to a certain station is out-of-band communication to | ||
| 1600 | * the device. To allow this problem to be solved, the driver can | ||
| 1601 | * call ieee80211_sta_block_awake() if frames are buffered when it | ||
| 1602 | * is notified that the station went to sleep. When all these frames | ||
| 1603 | * have been filtered (see above), it must call the function again | ||
| 1604 | * to indicate that the station is no longer blocked. | ||
| 1605 | * | ||
| 1606 | * If the driver buffers frames in the driver for aggregation in any | ||
| 1607 | * way, it must use the ieee80211_sta_set_buffered() call when it is | ||
| 1608 | * notified of the station going to sleep to inform mac80211 of any | ||
| 1609 | * TIDs that have frames buffered. Note that when a station wakes up | ||
| 1610 | * this information is reset (hence the requirement to call it when | ||
| 1611 | * informed of the station going to sleep). Then, when a service | ||
| 1612 | * period starts for any reason, @release_buffered_frames is called | ||
| 1613 | * with the number of frames to be released and which TIDs they are | ||
| 1614 | * to come from. In this case, the driver is responsible for setting | ||
| 1615 | * the EOSP (for uAPSD) and MORE_DATA bits in the released frames, | ||
| 1616 | * to help the @more_data paramter is passed to tell the driver if | ||
| 1617 | * there is more data on other TIDs -- the TIDs to release frames | ||
| 1618 | * from are ignored since mac80211 doesn't know how many frames the | ||
| 1619 | * buffers for those TIDs contain. | ||
| 1620 | * | ||
| 1621 | * If the driver also implement GO mode, where absence periods may | ||
| 1622 | * shorten service periods (or abort PS-Poll responses), it must | ||
| 1623 | * filter those response frames except in the case of frames that | ||
| 1624 | * are buffered in the driver -- those must remain buffered to avoid | ||
| 1625 | * reordering. Because it is possible that no frames are released | ||
| 1626 | * in this case, the driver must call ieee80211_sta_eosp_irqsafe() | ||
| 1627 | * to indicate to mac80211 that the service period ended anyway. | ||
| 1628 | * | ||
| 1629 | * Finally, if frames from multiple TIDs are released from mac80211 | ||
| 1630 | * but the driver might reorder them, it must clear & set the flags | ||
| 1631 | * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP) | ||
| 1632 | * and also take care of the EOSP and MORE_DATA bits in the frame. | ||
| 1633 | * The driver may also use ieee80211_sta_eosp_irqsafe() in this case. | ||
| 1634 | */ | ||
| 1635 | |||
| 1636 | /** | ||
| 1514 | * enum ieee80211_filter_flags - hardware filter flags | 1637 | * enum ieee80211_filter_flags - hardware filter flags |
| 1515 | * | 1638 | * |
| 1516 | * These flags determine what the filter in hardware should be | 1639 | * These flags determine what the filter in hardware should be |
| @@ -1600,6 +1723,17 @@ enum ieee80211_tx_sync_type { | |||
| 1600 | }; | 1723 | }; |
| 1601 | 1724 | ||
| 1602 | /** | 1725 | /** |
| 1726 | * enum ieee80211_frame_release_type - frame release reason | ||
| 1727 | * @IEEE80211_FRAME_RELEASE_PSPOLL: frame released for PS-Poll | ||
| 1728 | * @IEEE80211_FRAME_RELEASE_UAPSD: frame(s) released due to | ||
| 1729 | * frame received on trigger-enabled AC | ||
| 1730 | */ | ||
| 1731 | enum ieee80211_frame_release_type { | ||
| 1732 | IEEE80211_FRAME_RELEASE_PSPOLL, | ||
| 1733 | IEEE80211_FRAME_RELEASE_UAPSD, | ||
| 1734 | }; | ||
| 1735 | |||
| 1736 | /** | ||
| 1603 | * struct ieee80211_ops - callbacks from mac80211 to the driver | 1737 | * struct ieee80211_ops - callbacks from mac80211 to the driver |
| 1604 | * | 1738 | * |
| 1605 | * This structure contains various callbacks that the driver may | 1739 | * This structure contains various callbacks that the driver may |
| @@ -1896,11 +2030,6 @@ enum ieee80211_tx_sync_type { | |||
| 1896 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | 2030 | * ieee80211_remain_on_channel_expired(). This callback may sleep. |
| 1897 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | 2031 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is |
| 1898 | * aborted before it expires. This callback may sleep. | 2032 | * aborted before it expires. This callback may sleep. |
| 1899 | * @offchannel_tx: Transmit frame on another channel, wait for a response | ||
| 1900 | * and return. Reliable TX status must be reported for the frame. If the | ||
| 1901 | * return value is 1, then the @remain_on_channel will be used with a | ||
| 1902 | * regular transmission (if supported.) | ||
| 1903 | * @offchannel_tx_cancel_wait: cancel wait associated with offchannel TX | ||
| 1904 | * | 2033 | * |
| 1905 | * @set_ringparam: Set tx and rx ring sizes. | 2034 | * @set_ringparam: Set tx and rx ring sizes. |
| 1906 | * | 2035 | * |
| @@ -1914,6 +2043,45 @@ enum ieee80211_tx_sync_type { | |||
| 1914 | * The callback can sleep. | 2043 | * The callback can sleep. |
| 1915 | * @rssi_callback: Notify driver when the average RSSI goes above/below | 2044 | * @rssi_callback: Notify driver when the average RSSI goes above/below |
| 1916 | * thresholds that were registered previously. The callback can sleep. | 2045 | * thresholds that were registered previously. The callback can sleep. |
| 2046 | * | ||
| 2047 | * @release_buffered_frames: Release buffered frames according to the given | ||
| 2048 | * parameters. In the case where the driver buffers some frames for | ||
| 2049 | * sleeping stations mac80211 will use this callback to tell the driver | ||
| 2050 | * to release some frames, either for PS-poll or uAPSD. | ||
| 2051 | * Note that if the @more_data paramter is %false the driver must check | ||
| 2052 | * if there are more frames on the given TIDs, and if there are more than | ||
| 2053 | * the frames being released then it must still set the more-data bit in | ||
| 2054 | * the frame. If the @more_data parameter is %true, then of course the | ||
| 2055 | * more-data bit must always be set. | ||
| 2056 | * The @tids parameter tells the driver which TIDs to release frames | ||
| 2057 | * from, for PS-poll it will always have only a single bit set. | ||
| 2058 | * In the case this is used for a PS-poll initiated release, the | ||
| 2059 | * @num_frames parameter will always be 1 so code can be shared. In | ||
| 2060 | * this case the driver must also set %IEEE80211_TX_STATUS_EOSP flag | ||
| 2061 | * on the TX status (and must report TX status) so that the PS-poll | ||
| 2062 | * period is properly ended. This is used to avoid sending multiple | ||
| 2063 | * responses for a retried PS-poll frame. | ||
| 2064 | * In the case this is used for uAPSD, the @num_frames parameter may be | ||
| 2065 | * bigger than one, but the driver may send fewer frames (it must send | ||
| 2066 | * at least one, however). In this case it is also responsible for | ||
| 2067 | * setting the EOSP flag in the QoS header of the frames. Also, when the | ||
| 2068 | * service period ends, the driver must set %IEEE80211_TX_STATUS_EOSP | ||
| 2069 | * on the last frame in the SP. Alternatively, it may call the function | ||
| 2070 | * ieee80211_sta_eosp_irqsafe() to inform mac80211 of the end of the SP. | ||
| 2071 | * This callback must be atomic. | ||
| 2072 | * @allow_buffered_frames: Prepare device to allow the given number of frames | ||
| 2073 | * to go out to the given station. The frames will be sent by mac80211 | ||
| 2074 | * via the usual TX path after this call. The TX information for frames | ||
| 2075 | * released will also have the %IEEE80211_TX_CTL_POLL_RESPONSE flag set | ||
| 2076 | * and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case | ||
| 2077 | * frames from multiple TIDs are released and the driver might reorder | ||
| 2078 | * them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag | ||
| 2079 | * on the last frame and clear it on all others and also handle the EOSP | ||
| 2080 | * bit in the QoS header correctly. Alternatively, it can also call the | ||
| 2081 | * ieee80211_sta_eosp_irqsafe() function. | ||
| 2082 | * The @tids parameter is a bitmap and tells the driver which TIDs the | ||
| 2083 | * frames will be on; it will at most have two bits set. | ||
| 2084 | * This callback must be atomic. | ||
| 1917 | */ | 2085 | */ |
| 1918 | struct ieee80211_ops { | 2086 | struct ieee80211_ops { |
| 1919 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 2087 | void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| @@ -1986,11 +2154,13 @@ struct ieee80211_ops { | |||
| 1986 | struct ieee80211_sta *sta); | 2154 | struct ieee80211_sta *sta); |
| 1987 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2155 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 1988 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2156 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
| 1989 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, | 2157 | int (*conf_tx)(struct ieee80211_hw *hw, |
| 2158 | struct ieee80211_vif *vif, u16 queue, | ||
| 1990 | const struct ieee80211_tx_queue_params *params); | 2159 | const struct ieee80211_tx_queue_params *params); |
| 1991 | u64 (*get_tsf)(struct ieee80211_hw *hw); | 2160 | u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); |
| 1992 | void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); | 2161 | void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 1993 | void (*reset_tsf)(struct ieee80211_hw *hw); | 2162 | u64 tsf); |
| 2163 | void (*reset_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
| 1994 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 2164 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
| 1995 | int (*ampdu_action)(struct ieee80211_hw *hw, | 2165 | int (*ampdu_action)(struct ieee80211_hw *hw, |
| 1996 | struct ieee80211_vif *vif, | 2166 | struct ieee80211_vif *vif, |
| @@ -2019,11 +2189,6 @@ struct ieee80211_ops { | |||
| 2019 | enum nl80211_channel_type channel_type, | 2189 | enum nl80211_channel_type channel_type, |
| 2020 | int duration); | 2190 | int duration); |
| 2021 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2191 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
| 2022 | int (*offchannel_tx)(struct ieee80211_hw *hw, struct sk_buff *skb, | ||
| 2023 | struct ieee80211_channel *chan, | ||
| 2024 | enum nl80211_channel_type channel_type, | ||
| 2025 | unsigned int wait); | ||
| 2026 | int (*offchannel_tx_cancel_wait)(struct ieee80211_hw *hw); | ||
| 2027 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2192 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
| 2028 | void (*get_ringparam)(struct ieee80211_hw *hw, | 2193 | void (*get_ringparam)(struct ieee80211_hw *hw, |
| 2029 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); | 2194 | u32 *tx, u32 *tx_max, u32 *rx, u32 *rx_max); |
| @@ -2032,6 +2197,17 @@ struct ieee80211_ops { | |||
| 2032 | const struct cfg80211_bitrate_mask *mask); | 2197 | const struct cfg80211_bitrate_mask *mask); |
| 2033 | void (*rssi_callback)(struct ieee80211_hw *hw, | 2198 | void (*rssi_callback)(struct ieee80211_hw *hw, |
| 2034 | enum ieee80211_rssi_event rssi_event); | 2199 | enum ieee80211_rssi_event rssi_event); |
| 2200 | |||
| 2201 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, | ||
| 2202 | struct ieee80211_sta *sta, | ||
| 2203 | u16 tids, int num_frames, | ||
| 2204 | enum ieee80211_frame_release_type reason, | ||
| 2205 | bool more_data); | ||
| 2206 | void (*release_buffered_frames)(struct ieee80211_hw *hw, | ||
| 2207 | struct ieee80211_sta *sta, | ||
| 2208 | u16 tids, int num_frames, | ||
| 2209 | enum ieee80211_frame_release_type reason, | ||
| 2210 | bool more_data); | ||
| 2035 | }; | 2211 | }; |
| 2036 | 2212 | ||
| 2037 | /** | 2213 | /** |
| @@ -2346,20 +2522,38 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta, | |||
| 2346 | * The TX headroom reserved by mac80211 for its own tx_status functions. | 2522 | * The TX headroom reserved by mac80211 for its own tx_status functions. |
| 2347 | * This is enough for the radiotap header. | 2523 | * This is enough for the radiotap header. |
| 2348 | */ | 2524 | */ |
| 2349 | #define IEEE80211_TX_STATUS_HEADROOM 13 | 2525 | #define IEEE80211_TX_STATUS_HEADROOM 14 |
| 2350 | 2526 | ||
| 2351 | /** | 2527 | /** |
| 2352 | * ieee80211_sta_set_tim - set the TIM bit for a sleeping station | 2528 | * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames |
| 2353 | * @sta: &struct ieee80211_sta pointer for the sleeping station | 2529 | * @sta: &struct ieee80211_sta pointer for the sleeping station |
| 2530 | * @tid: the TID that has buffered frames | ||
| 2531 | * @buffered: indicates whether or not frames are buffered for this TID | ||
| 2354 | * | 2532 | * |
| 2355 | * If a driver buffers frames for a powersave station instead of passing | 2533 | * If a driver buffers frames for a powersave station instead of passing |
| 2356 | * them back to mac80211 for retransmission, the station needs to be told | 2534 | * them back to mac80211 for retransmission, the station may still need |
| 2357 | * to wake up using the TIM bitmap in the beacon. | 2535 | * to be told that there are buffered frames via the TIM bit. |
| 2358 | * | 2536 | * |
| 2359 | * This function sets the station's TIM bit - it will be cleared when the | 2537 | * This function informs mac80211 whether or not there are frames that are |
| 2360 | * station wakes up. | 2538 | * buffered in the driver for a given TID; mac80211 can then use this data |
| 2539 | * to set the TIM bit (NOTE: This may call back into the driver's set_tim | ||
| 2540 | * call! Beware of the locking!) | ||
| 2541 | * | ||
| 2542 | * If all frames are released to the station (due to PS-poll or uAPSD) | ||
| 2543 | * then the driver needs to inform mac80211 that there no longer are | ||
| 2544 | * frames buffered. However, when the station wakes up mac80211 assumes | ||
| 2545 | * that all buffered frames will be transmitted and clears this data, | ||
| 2546 | * drivers need to make sure they inform mac80211 about all buffered | ||
| 2547 | * frames on the sleep transition (sta_notify() with %STA_NOTIFY_SLEEP). | ||
| 2548 | * | ||
| 2549 | * Note that technically mac80211 only needs to know this per AC, not per | ||
| 2550 | * TID, but since driver buffering will inevitably happen per TID (since | ||
| 2551 | * it is related to aggregation) it is easier to make mac80211 map the | ||
| 2552 | * TID to the AC as required instead of keeping track in all drivers that | ||
| 2553 | * use this API. | ||
| 2361 | */ | 2554 | */ |
| 2362 | void ieee80211_sta_set_tim(struct ieee80211_sta *sta); | 2555 | void ieee80211_sta_set_buffered(struct ieee80211_sta *sta, |
| 2556 | u8 tid, bool buffered); | ||
| 2363 | 2557 | ||
| 2364 | /** | 2558 | /** |
| 2365 | * ieee80211_tx_status - transmit status callback | 2559 | * ieee80211_tx_status - transmit status callback |
| @@ -3017,6 +3211,24 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
| 3017 | struct ieee80211_sta *pubsta, bool block); | 3211 | struct ieee80211_sta *pubsta, bool block); |
| 3018 | 3212 | ||
| 3019 | /** | 3213 | /** |
| 3214 | * ieee80211_sta_eosp - notify mac80211 about end of SP | ||
| 3215 | * @pubsta: the station | ||
| 3216 | * | ||
| 3217 | * When a device transmits frames in a way that it can't tell | ||
| 3218 | * mac80211 in the TX status about the EOSP, it must clear the | ||
| 3219 | * %IEEE80211_TX_STATUS_EOSP bit and call this function instead. | ||
| 3220 | * This applies for PS-Poll as well as uAPSD. | ||
| 3221 | * | ||
| 3222 | * Note that there is no non-_irqsafe version right now as | ||
| 3223 | * it wasn't needed, but just like _tx_status() and _rx() | ||
| 3224 | * must not be mixed in irqsafe/non-irqsafe versions, this | ||
| 3225 | * function must not be mixed with those either. Use the | ||
| 3226 | * all irqsafe, or all non-irqsafe, don't mix! If you need | ||
| 3227 | * the non-irqsafe version of this, you need to add it. | ||
| 3228 | */ | ||
| 3229 | void ieee80211_sta_eosp_irqsafe(struct ieee80211_sta *pubsta); | ||
| 3230 | |||
| 3231 | /** | ||
| 3020 | * ieee80211_iter_keys - iterate keys programmed into the device | 3232 | * ieee80211_iter_keys - iterate keys programmed into the device |
| 3021 | * @hw: pointer obtained from ieee80211_alloc_hw() | 3233 | * @hw: pointer obtained from ieee80211_alloc_hw() |
| 3022 | * @vif: virtual interface to iterate, may be %NULL for all | 3234 | * @vif: virtual interface to iterate, may be %NULL for all |
| @@ -3229,6 +3441,19 @@ void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); | |||
| 3229 | void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap, | 3441 | void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap, |
| 3230 | const u8 *addr); | 3442 | const u8 *addr); |
| 3231 | 3443 | ||
| 3444 | /** | ||
| 3445 | * ieee80211_send_bar - send a BlockAckReq frame | ||
| 3446 | * | ||
| 3447 | * can be used to flush pending frames from the peer's aggregation reorder | ||
| 3448 | * buffer. | ||
| 3449 | * | ||
| 3450 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 3451 | * @ra: the peer's destination address | ||
| 3452 | * @tid: the TID of the aggregation session | ||
| 3453 | * @ssn: the new starting sequence number for the receiver | ||
| 3454 | */ | ||
| 3455 | void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn); | ||
| 3456 | |||
| 3232 | /* Rate control API */ | 3457 | /* Rate control API */ |
| 3233 | 3458 | ||
| 3234 | /** | 3459 | /** |
| @@ -3419,4 +3644,9 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif, | |||
| 3419 | int rssi_max_thold); | 3644 | int rssi_max_thold); |
| 3420 | 3645 | ||
| 3421 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); | 3646 | void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); |
| 3647 | |||
| 3648 | int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb); | ||
| 3649 | |||
| 3650 | int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, | ||
| 3651 | struct sk_buff *skb); | ||
| 3422 | #endif /* MAC80211_H */ | 3652 | #endif /* MAC80211_H */ |
diff --git a/include/net/nfc/nci.h b/include/net/nfc/nci.h new file mode 100644 index 000000000000..39b85bc0804f --- /dev/null +++ b/include/net/nfc/nci.h | |||
| @@ -0,0 +1,313 @@ | |||
| 1 | /* | ||
| 2 | * The NFC Controller Interface is the communication protocol between an | ||
| 3 | * NFC Controller (NFCC) and a Device Host (DH). | ||
| 4 | * | ||
| 5 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
| 6 | * | ||
| 7 | * Written by Ilan Elias <ilane@ti.com> | ||
| 8 | * | ||
| 9 | * Acknowledgements: | ||
| 10 | * This file is based on hci.h, which was written | ||
| 11 | * by Maxim Krasnyansky. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License version 2 | ||
| 15 | * as published by the Free Software Foundation | ||
| 16 | * | ||
| 17 | * This program is distributed in the hope that it will be useful, | ||
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | * GNU General Public License for more details. | ||
| 21 | * | ||
| 22 | * You should have received a copy of the GNU General Public License | ||
| 23 | * along with this program; if not, write to the Free Software | ||
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef __NCI_H | ||
| 29 | #define __NCI_H | ||
| 30 | |||
| 31 | /* NCI constants */ | ||
| 32 | #define NCI_MAX_NUM_MAPPING_CONFIGS 10 | ||
| 33 | #define NCI_MAX_NUM_RF_CONFIGS 10 | ||
| 34 | #define NCI_MAX_NUM_CONN 10 | ||
| 35 | |||
| 36 | /* NCI Status Codes */ | ||
| 37 | #define NCI_STATUS_OK 0x00 | ||
| 38 | #define NCI_STATUS_REJECTED 0x01 | ||
| 39 | #define NCI_STATUS_MESSAGE_CORRUPTED 0x02 | ||
| 40 | #define NCI_STATUS_BUFFER_FULL 0x03 | ||
| 41 | #define NCI_STATUS_FAILED 0x04 | ||
| 42 | #define NCI_STATUS_NOT_INITIALIZED 0x05 | ||
| 43 | #define NCI_STATUS_SYNTAX_ERROR 0x06 | ||
| 44 | #define NCI_STATUS_SEMANTIC_ERROR 0x07 | ||
| 45 | #define NCI_STATUS_UNKNOWN_GID 0x08 | ||
| 46 | #define NCI_STATUS_UNKNOWN_OID 0x09 | ||
| 47 | #define NCI_STATUS_INVALID_PARAM 0x0a | ||
| 48 | #define NCI_STATUS_MESSAGE_SIZE_EXCEEDED 0x0b | ||
| 49 | /* Discovery Specific Status Codes */ | ||
| 50 | #define NCI_STATUS_DISCOVERY_ALREADY_STARTED 0xa0 | ||
| 51 | #define NCI_STATUS_DISCOVERY_TARGET_ACTIVATION_FAILED 0xa1 | ||
| 52 | /* RF Interface Specific Status Codes */ | ||
| 53 | #define NCI_STATUS_RF_TRANSMISSION_ERROR 0xb0 | ||
| 54 | #define NCI_STATUS_RF_PROTOCOL_ERROR 0xb1 | ||
| 55 | #define NCI_STATUS_RF_TIMEOUT_ERROR 0xb2 | ||
| 56 | #define NCI_STATUS_RF_LINK_LOSS_ERROR 0xb3 | ||
| 57 | /* NFCEE Interface Specific Status Codes */ | ||
| 58 | #define NCI_STATUS_MAX_ACTIVE_NFCEE_INTERFACES_REACHED 0xc0 | ||
| 59 | #define NCI_STATUS_NFCEE_INTERFACE_ACTIVATION_FAILED 0xc1 | ||
| 60 | #define NCI_STATUS_NFCEE_TRANSMISSION_ERROR 0xc2 | ||
| 61 | #define NCI_STATUS_NFCEE_PROTOCOL_ERROR 0xc3 | ||
| 62 | #define NCI_STATUS_NFCEE_TIMEOUT_ERROR 0xc4 | ||
| 63 | |||
| 64 | /* NCI RF Technology and Mode */ | ||
| 65 | #define NCI_NFC_A_PASSIVE_POLL_MODE 0x00 | ||
| 66 | #define NCI_NFC_B_PASSIVE_POLL_MODE 0x01 | ||
| 67 | #define NCI_NFC_F_PASSIVE_POLL_MODE 0x02 | ||
| 68 | #define NCI_NFC_A_ACTIVE_POLL_MODE 0x03 | ||
| 69 | #define NCI_NFC_F_ACTIVE_POLL_MODE 0x05 | ||
| 70 | #define NCI_NFC_A_PASSIVE_LISTEN_MODE 0x80 | ||
| 71 | #define NCI_NFC_B_PASSIVE_LISTEN_MODE 0x81 | ||
| 72 | #define NCI_NFC_F_PASSIVE_LISTEN_MODE 0x82 | ||
| 73 | #define NCI_NFC_A_ACTIVE_LISTEN_MODE 0x83 | ||
| 74 | #define NCI_NFC_F_ACTIVE_LISTEN_MODE 0x85 | ||
| 75 | |||
| 76 | /* NCI RF Protocols */ | ||
| 77 | #define NCI_RF_PROTOCOL_UNKNOWN 0x00 | ||
| 78 | #define NCI_RF_PROTOCOL_T1T 0x01 | ||
| 79 | #define NCI_RF_PROTOCOL_T2T 0x02 | ||
| 80 | #define NCI_RF_PROTOCOL_T3T 0x03 | ||
| 81 | #define NCI_RF_PROTOCOL_ISO_DEP 0x04 | ||
| 82 | #define NCI_RF_PROTOCOL_NFC_DEP 0x05 | ||
| 83 | |||
| 84 | /* NCI RF Interfaces */ | ||
| 85 | #define NCI_RF_INTERFACE_RFU 0x00 | ||
| 86 | #define NCI_RF_INTERFACE_FRAME 0x01 | ||
| 87 | #define NCI_RF_INTERFACE_ISO_DEP 0x02 | ||
| 88 | #define NCI_RF_INTERFACE_NFC_DEP 0x03 | ||
| 89 | |||
| 90 | /* NCI RF_DISCOVER_MAP_CMD modes */ | ||
| 91 | #define NCI_DISC_MAP_MODE_POLL 0x01 | ||
| 92 | #define NCI_DISC_MAP_MODE_LISTEN 0x02 | ||
| 93 | #define NCI_DISC_MAP_MODE_BOTH 0x03 | ||
| 94 | |||
| 95 | /* NCI Discovery Types */ | ||
| 96 | #define NCI_DISCOVERY_TYPE_POLL_A_PASSIVE 0x00 | ||
| 97 | #define NCI_DISCOVERY_TYPE_POLL_B_PASSIVE 0x01 | ||
| 98 | #define NCI_DISCOVERY_TYPE_POLL_F_PASSIVE 0x02 | ||
| 99 | #define NCI_DISCOVERY_TYPE_POLL_A_ACTIVE 0x03 | ||
| 100 | #define NCI_DISCOVERY_TYPE_POLL_F_ACTIVE 0x05 | ||
| 101 | #define NCI_DISCOVERY_TYPE_WAKEUP_A_PASSIVE 0x06 | ||
| 102 | #define NCI_DISCOVERY_TYPE_WAKEUP_B_PASSIVE 0x07 | ||
| 103 | #define NCI_DISCOVERY_TYPE_WAKEUP_A_ACTIVE 0x09 | ||
| 104 | #define NCI_DISCOVERY_TYPE_LISTEN_A_PASSIVE 0x80 | ||
| 105 | #define NCI_DISCOVERY_TYPE_LISTEN_B_PASSIVE 0x81 | ||
| 106 | #define NCI_DISCOVERY_TYPE_LISTEN_F_PASSIVE 0x82 | ||
| 107 | #define NCI_DISCOVERY_TYPE_LISTEN_A_ACTIVE 0x83 | ||
| 108 | #define NCI_DISCOVERY_TYPE_LISTEN_F_ACTIVE 0x85 | ||
| 109 | |||
| 110 | /* NCI Deactivation Type */ | ||
| 111 | #define NCI_DEACTIVATE_TYPE_IDLE_MODE 0x00 | ||
| 112 | #define NCI_DEACTIVATE_TYPE_SLEEP_MODE 0x01 | ||
| 113 | #define NCI_DEACTIVATE_TYPE_SLEEP_AF_MODE 0x02 | ||
| 114 | #define NCI_DEACTIVATE_TYPE_RF_LINK_LOSS 0x03 | ||
| 115 | #define NCI_DEACTIVATE_TYPE_DISCOVERY_ERROR 0x04 | ||
| 116 | |||
| 117 | /* Message Type (MT) */ | ||
| 118 | #define NCI_MT_DATA_PKT 0x00 | ||
| 119 | #define NCI_MT_CMD_PKT 0x01 | ||
| 120 | #define NCI_MT_RSP_PKT 0x02 | ||
| 121 | #define NCI_MT_NTF_PKT 0x03 | ||
| 122 | |||
| 123 | #define nci_mt(hdr) (((hdr)[0]>>5)&0x07) | ||
| 124 | #define nci_mt_set(hdr, mt) ((hdr)[0] |= (__u8)(((mt)&0x07)<<5)) | ||
| 125 | |||
| 126 | /* Packet Boundary Flag (PBF) */ | ||
| 127 | #define NCI_PBF_LAST 0x00 | ||
| 128 | #define NCI_PBF_CONT 0x01 | ||
| 129 | |||
| 130 | #define nci_pbf(hdr) (__u8)(((hdr)[0]>>4)&0x01) | ||
| 131 | #define nci_pbf_set(hdr, pbf) ((hdr)[0] |= (__u8)(((pbf)&0x01)<<4)) | ||
| 132 | |||
| 133 | /* Control Opcode manipulation */ | ||
| 134 | #define nci_opcode_pack(gid, oid) (__u16)((((__u16)((gid)&0x0f))<<8)|\ | ||
| 135 | ((__u16)((oid)&0x3f))) | ||
| 136 | #define nci_opcode(hdr) nci_opcode_pack(hdr[0], hdr[1]) | ||
| 137 | #define nci_opcode_gid(op) (__u8)(((op)&0x0f00)>>8) | ||
| 138 | #define nci_opcode_oid(op) (__u8)((op)&0x003f) | ||
| 139 | |||
| 140 | /* Payload Length */ | ||
| 141 | #define nci_plen(hdr) (__u8)((hdr)[2]) | ||
| 142 | |||
| 143 | /* Connection ID */ | ||
| 144 | #define nci_conn_id(hdr) (__u8)(((hdr)[0])&0x0f) | ||
| 145 | |||
| 146 | /* GID values */ | ||
| 147 | #define NCI_GID_CORE 0x0 | ||
| 148 | #define NCI_GID_RF_MGMT 0x1 | ||
| 149 | #define NCI_GID_NFCEE_MGMT 0x2 | ||
| 150 | #define NCI_GID_PROPRIETARY 0xf | ||
| 151 | |||
| 152 | /* ---- NCI Packet structures ---- */ | ||
| 153 | #define NCI_CTRL_HDR_SIZE 3 | ||
| 154 | #define NCI_DATA_HDR_SIZE 3 | ||
| 155 | |||
| 156 | struct nci_ctrl_hdr { | ||
| 157 | __u8 gid; /* MT & PBF & GID */ | ||
| 158 | __u8 oid; | ||
| 159 | __u8 plen; | ||
| 160 | } __packed; | ||
| 161 | |||
| 162 | struct nci_data_hdr { | ||
| 163 | __u8 conn_id; /* MT & PBF & ConnID */ | ||
| 164 | __u8 rfu; | ||
| 165 | __u8 plen; | ||
| 166 | } __packed; | ||
| 167 | |||
| 168 | /* ------------------------ */ | ||
| 169 | /* ----- NCI Commands ---- */ | ||
| 170 | /* ------------------------ */ | ||
| 171 | #define NCI_OP_CORE_RESET_CMD nci_opcode_pack(NCI_GID_CORE, 0x00) | ||
| 172 | |||
| 173 | #define NCI_OP_CORE_INIT_CMD nci_opcode_pack(NCI_GID_CORE, 0x01) | ||
| 174 | |||
| 175 | #define NCI_OP_CORE_SET_CONFIG_CMD nci_opcode_pack(NCI_GID_CORE, 0x02) | ||
| 176 | |||
| 177 | #define NCI_OP_CORE_CONN_CREATE_CMD nci_opcode_pack(NCI_GID_CORE, 0x04) | ||
| 178 | struct nci_core_conn_create_cmd { | ||
| 179 | __u8 target_handle; | ||
| 180 | __u8 num_target_specific_params; | ||
| 181 | } __packed; | ||
| 182 | |||
| 183 | #define NCI_OP_CORE_CONN_CLOSE_CMD nci_opcode_pack(NCI_GID_CORE, 0x06) | ||
| 184 | |||
| 185 | #define NCI_OP_RF_DISCOVER_MAP_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | ||
| 186 | struct disc_map_config { | ||
| 187 | __u8 rf_protocol; | ||
| 188 | __u8 mode; | ||
| 189 | __u8 rf_interface_type; | ||
| 190 | } __packed; | ||
| 191 | |||
| 192 | struct nci_rf_disc_map_cmd { | ||
| 193 | __u8 num_mapping_configs; | ||
| 194 | struct disc_map_config mapping_configs | ||
| 195 | [NCI_MAX_NUM_MAPPING_CONFIGS]; | ||
| 196 | } __packed; | ||
| 197 | |||
| 198 | #define NCI_OP_RF_DISCOVER_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) | ||
| 199 | struct disc_config { | ||
| 200 | __u8 type; | ||
| 201 | __u8 frequency; | ||
| 202 | } __packed; | ||
| 203 | |||
| 204 | struct nci_rf_disc_cmd { | ||
| 205 | __u8 num_disc_configs; | ||
| 206 | struct disc_config disc_configs[NCI_MAX_NUM_RF_CONFIGS]; | ||
| 207 | } __packed; | ||
| 208 | |||
| 209 | #define NCI_OP_RF_DEACTIVATE_CMD nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) | ||
| 210 | struct nci_rf_deactivate_cmd { | ||
| 211 | __u8 type; | ||
| 212 | } __packed; | ||
| 213 | |||
| 214 | /* ----------------------- */ | ||
| 215 | /* ---- NCI Responses ---- */ | ||
| 216 | /* ----------------------- */ | ||
| 217 | #define NCI_OP_CORE_RESET_RSP nci_opcode_pack(NCI_GID_CORE, 0x00) | ||
| 218 | struct nci_core_reset_rsp { | ||
| 219 | __u8 status; | ||
| 220 | __u8 nci_ver; | ||
| 221 | } __packed; | ||
| 222 | |||
| 223 | #define NCI_OP_CORE_INIT_RSP nci_opcode_pack(NCI_GID_CORE, 0x01) | ||
| 224 | struct nci_core_init_rsp_1 { | ||
| 225 | __u8 status; | ||
| 226 | __le32 nfcc_features; | ||
| 227 | __u8 num_supported_rf_interfaces; | ||
| 228 | __u8 supported_rf_interfaces[0]; /* variable size array */ | ||
| 229 | /* continuted in nci_core_init_rsp_2 */ | ||
| 230 | } __packed; | ||
| 231 | |||
| 232 | struct nci_core_init_rsp_2 { | ||
| 233 | __u8 max_logical_connections; | ||
| 234 | __le16 max_routing_table_size; | ||
| 235 | __u8 max_control_packet_payload_length; | ||
| 236 | __le16 rf_sending_buffer_size; | ||
| 237 | __le16 rf_receiving_buffer_size; | ||
| 238 | __le16 manufacturer_id; | ||
| 239 | } __packed; | ||
| 240 | |||
| 241 | #define NCI_OP_CORE_SET_CONFIG_RSP nci_opcode_pack(NCI_GID_CORE, 0x02) | ||
| 242 | |||
| 243 | #define NCI_OP_CORE_CONN_CREATE_RSP nci_opcode_pack(NCI_GID_CORE, 0x04) | ||
| 244 | struct nci_core_conn_create_rsp { | ||
| 245 | __u8 status; | ||
| 246 | __u8 max_pkt_payload_size; | ||
| 247 | __u8 initial_num_credits; | ||
| 248 | __u8 conn_id; | ||
| 249 | } __packed; | ||
| 250 | |||
| 251 | #define NCI_OP_CORE_CONN_CLOSE_RSP nci_opcode_pack(NCI_GID_CORE, 0x06) | ||
| 252 | |||
| 253 | #define NCI_OP_RF_DISCOVER_MAP_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x00) | ||
| 254 | |||
| 255 | #define NCI_OP_RF_DISCOVER_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x03) | ||
| 256 | |||
| 257 | #define NCI_OP_RF_DEACTIVATE_RSP nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) | ||
| 258 | |||
| 259 | /* --------------------------- */ | ||
| 260 | /* ---- NCI Notifications ---- */ | ||
| 261 | /* --------------------------- */ | ||
| 262 | #define NCI_OP_CORE_CONN_CREDITS_NTF nci_opcode_pack(NCI_GID_CORE, 0x07) | ||
| 263 | struct conn_credit_entry { | ||
| 264 | __u8 conn_id; | ||
| 265 | __u8 credits; | ||
| 266 | } __packed; | ||
| 267 | |||
| 268 | struct nci_core_conn_credit_ntf { | ||
| 269 | __u8 num_entries; | ||
| 270 | struct conn_credit_entry conn_entries[NCI_MAX_NUM_CONN]; | ||
| 271 | } __packed; | ||
| 272 | |||
| 273 | #define NCI_OP_RF_FIELD_INFO_NTF nci_opcode_pack(NCI_GID_CORE, 0x08) | ||
| 274 | struct nci_rf_field_info_ntf { | ||
| 275 | __u8 rf_field_status; | ||
| 276 | } __packed; | ||
| 277 | |||
| 278 | #define NCI_OP_RF_ACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x05) | ||
| 279 | struct rf_tech_specific_params_nfca_poll { | ||
| 280 | __u16 sens_res; | ||
| 281 | __u8 nfcid1_len; /* 0, 4, 7, or 10 Bytes */ | ||
| 282 | __u8 nfcid1[10]; | ||
| 283 | __u8 sel_res_len; /* 0 or 1 Bytes */ | ||
| 284 | __u8 sel_res; | ||
| 285 | } __packed; | ||
| 286 | |||
| 287 | struct activation_params_nfca_poll_iso_dep { | ||
| 288 | __u8 rats_res_len; | ||
| 289 | __u8 rats_res[20]; | ||
| 290 | }; | ||
| 291 | |||
| 292 | struct nci_rf_activate_ntf { | ||
| 293 | __u8 target_handle; | ||
| 294 | __u8 rf_protocol; | ||
| 295 | __u8 rf_tech_and_mode; | ||
| 296 | __u8 rf_tech_specific_params_len; | ||
| 297 | |||
| 298 | union { | ||
| 299 | struct rf_tech_specific_params_nfca_poll nfca_poll; | ||
| 300 | } rf_tech_specific_params; | ||
| 301 | |||
| 302 | __u8 rf_interface_type; | ||
| 303 | __u8 activation_params_len; | ||
| 304 | |||
| 305 | union { | ||
| 306 | struct activation_params_nfca_poll_iso_dep nfca_poll_iso_dep; | ||
| 307 | } activation_params; | ||
| 308 | |||
| 309 | } __packed; | ||
| 310 | |||
| 311 | #define NCI_OP_RF_DEACTIVATE_NTF nci_opcode_pack(NCI_GID_RF_MGMT, 0x06) | ||
| 312 | |||
| 313 | #endif /* __NCI_H */ | ||
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h new file mode 100644 index 000000000000..b8b4bbd7e0fc --- /dev/null +++ b/include/net/nfc/nci_core.h | |||
| @@ -0,0 +1,184 @@ | |||
| 1 | /* | ||
| 2 | * The NFC Controller Interface is the communication protocol between an | ||
| 3 | * NFC Controller (NFCC) and a Device Host (DH). | ||
| 4 | * | ||
| 5 | * Copyright (C) 2011 Texas Instruments, Inc. | ||
| 6 | * | ||
| 7 | * Written by Ilan Elias <ilane@ti.com> | ||
| 8 | * | ||
| 9 | * Acknowledgements: | ||
| 10 | * This file is based on hci_core.h, which was written | ||
| 11 | * by Maxim Krasnyansky. | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License version 2 | ||
| 15 | * as published by the Free Software Foundation | ||
| 16 | * | ||
| 17 | * This program is distributed in the hope that it will be useful, | ||
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 20 | * GNU General Public License for more details. | ||
| 21 | * | ||
| 22 | * You should have received a copy of the GNU General Public License | ||
| 23 | * along with this program; if not, write to the Free Software | ||
| 24 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 25 | * | ||
| 26 | */ | ||
| 27 | |||
| 28 | #ifndef __NCI_CORE_H | ||
| 29 | #define __NCI_CORE_H | ||
| 30 | |||
| 31 | #include <linux/interrupt.h> | ||
| 32 | #include <linux/skbuff.h> | ||
| 33 | |||
| 34 | #include <net/nfc/nfc.h> | ||
| 35 | #include <net/nfc/nci.h> | ||
| 36 | |||
| 37 | /* NCI device state */ | ||
| 38 | enum { | ||
| 39 | NCI_INIT, | ||
| 40 | NCI_UP, | ||
| 41 | NCI_DISCOVERY, | ||
| 42 | NCI_POLL_ACTIVE, | ||
| 43 | NCI_DATA_EXCHANGE, | ||
| 44 | }; | ||
| 45 | |||
| 46 | /* NCI timeouts */ | ||
| 47 | #define NCI_RESET_TIMEOUT 5000 | ||
| 48 | #define NCI_INIT_TIMEOUT 5000 | ||
| 49 | #define NCI_RF_DISC_TIMEOUT 5000 | ||
| 50 | #define NCI_RF_DEACTIVATE_TIMEOUT 5000 | ||
| 51 | #define NCI_CMD_TIMEOUT 5000 | ||
| 52 | |||
| 53 | struct nci_dev; | ||
| 54 | |||
| 55 | struct nci_ops { | ||
| 56 | int (*open)(struct nci_dev *ndev); | ||
| 57 | int (*close)(struct nci_dev *ndev); | ||
| 58 | int (*send)(struct sk_buff *skb); | ||
| 59 | }; | ||
| 60 | |||
| 61 | #define NCI_MAX_SUPPORTED_RF_INTERFACES 4 | ||
| 62 | |||
| 63 | /* NCI Core structures */ | ||
| 64 | struct nci_dev { | ||
| 65 | struct nfc_dev *nfc_dev; | ||
| 66 | struct nci_ops *ops; | ||
| 67 | |||
| 68 | int tx_headroom; | ||
| 69 | int tx_tailroom; | ||
| 70 | |||
| 71 | unsigned long flags; | ||
| 72 | |||
| 73 | atomic_t cmd_cnt; | ||
| 74 | atomic_t credits_cnt; | ||
| 75 | |||
| 76 | struct timer_list cmd_timer; | ||
| 77 | |||
| 78 | struct workqueue_struct *cmd_wq; | ||
| 79 | struct work_struct cmd_work; | ||
| 80 | |||
| 81 | struct workqueue_struct *rx_wq; | ||
| 82 | struct work_struct rx_work; | ||
| 83 | |||
| 84 | struct workqueue_struct *tx_wq; | ||
| 85 | struct work_struct tx_work; | ||
| 86 | |||
| 87 | struct sk_buff_head cmd_q; | ||
| 88 | struct sk_buff_head rx_q; | ||
| 89 | struct sk_buff_head tx_q; | ||
| 90 | |||
| 91 | struct mutex req_lock; | ||
| 92 | struct completion req_completion; | ||
| 93 | __u32 req_status; | ||
| 94 | __u32 req_result; | ||
| 95 | |||
| 96 | void *driver_data; | ||
| 97 | |||
| 98 | __u32 poll_prots; | ||
| 99 | __u32 target_available_prots; | ||
| 100 | __u32 target_active_prot; | ||
| 101 | |||
| 102 | /* received during NCI_OP_CORE_RESET_RSP */ | ||
| 103 | __u8 nci_ver; | ||
| 104 | |||
| 105 | /* received during NCI_OP_CORE_INIT_RSP */ | ||
| 106 | __u32 nfcc_features; | ||
| 107 | __u8 num_supported_rf_interfaces; | ||
| 108 | __u8 supported_rf_interfaces | ||
| 109 | [NCI_MAX_SUPPORTED_RF_INTERFACES]; | ||
| 110 | __u8 max_logical_connections; | ||
| 111 | __u16 max_routing_table_size; | ||
| 112 | __u8 max_control_packet_payload_length; | ||
| 113 | __u16 rf_sending_buffer_size; | ||
| 114 | __u16 rf_receiving_buffer_size; | ||
| 115 | __u16 manufacturer_id; | ||
| 116 | |||
| 117 | /* received during NCI_OP_CORE_CONN_CREATE_RSP for static conn 0 */ | ||
| 118 | __u8 max_pkt_payload_size; | ||
| 119 | __u8 initial_num_credits; | ||
| 120 | __u8 conn_id; | ||
| 121 | |||
| 122 | /* stored during nci_data_exchange */ | ||
| 123 | data_exchange_cb_t data_exchange_cb; | ||
| 124 | void *data_exchange_cb_context; | ||
| 125 | struct sk_buff *rx_data_reassembly; | ||
| 126 | }; | ||
| 127 | |||
| 128 | /* ----- NCI Devices ----- */ | ||
| 129 | struct nci_dev *nci_allocate_device(struct nci_ops *ops, | ||
| 130 | __u32 supported_protocols, | ||
| 131 | int tx_headroom, | ||
| 132 | int tx_tailroom); | ||
| 133 | void nci_free_device(struct nci_dev *ndev); | ||
| 134 | int nci_register_device(struct nci_dev *ndev); | ||
| 135 | void nci_unregister_device(struct nci_dev *ndev); | ||
| 136 | int nci_recv_frame(struct sk_buff *skb); | ||
| 137 | |||
| 138 | static inline struct sk_buff *nci_skb_alloc(struct nci_dev *ndev, | ||
| 139 | unsigned int len, | ||
| 140 | gfp_t how) | ||
| 141 | { | ||
| 142 | struct sk_buff *skb; | ||
| 143 | |||
| 144 | skb = alloc_skb(len + ndev->tx_headroom + ndev->tx_tailroom, how); | ||
| 145 | if (skb) | ||
| 146 | skb_reserve(skb, ndev->tx_headroom); | ||
| 147 | |||
| 148 | return skb; | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline void nci_set_parent_dev(struct nci_dev *ndev, struct device *dev) | ||
| 152 | { | ||
| 153 | nfc_set_parent_dev(ndev->nfc_dev, dev); | ||
| 154 | } | ||
| 155 | |||
| 156 | static inline void nci_set_drvdata(struct nci_dev *ndev, void *data) | ||
| 157 | { | ||
| 158 | ndev->driver_data = data; | ||
| 159 | } | ||
| 160 | |||
| 161 | static inline void *nci_get_drvdata(struct nci_dev *ndev) | ||
| 162 | { | ||
| 163 | return ndev->driver_data; | ||
| 164 | } | ||
| 165 | |||
| 166 | void nci_rsp_packet(struct nci_dev *ndev, struct sk_buff *skb); | ||
| 167 | void nci_ntf_packet(struct nci_dev *ndev, struct sk_buff *skb); | ||
| 168 | void nci_rx_data_packet(struct nci_dev *ndev, struct sk_buff *skb); | ||
| 169 | int nci_send_cmd(struct nci_dev *ndev, __u16 opcode, __u8 plen, void *payload); | ||
| 170 | int nci_send_data(struct nci_dev *ndev, __u8 conn_id, struct sk_buff *skb); | ||
| 171 | void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb, | ||
| 172 | int err); | ||
| 173 | |||
| 174 | /* ----- NCI requests ----- */ | ||
| 175 | #define NCI_REQ_DONE 0 | ||
| 176 | #define NCI_REQ_PEND 1 | ||
| 177 | #define NCI_REQ_CANCELED 2 | ||
| 178 | |||
| 179 | void nci_req_complete(struct nci_dev *ndev, int result); | ||
| 180 | |||
| 181 | /* ----- NCI status code ----- */ | ||
| 182 | int nci_to_errno(__u8 code); | ||
| 183 | |||
| 184 | #endif /* __NCI_CORE_H */ | ||
diff --git a/include/net/nfc.h b/include/net/nfc/nfc.h index cc0130312f70..6a7f602aa841 100644 --- a/include/net/nfc.h +++ b/include/net/nfc/nfc.h | |||
| @@ -48,6 +48,8 @@ typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb, | |||
| 48 | int err); | 48 | int err); |
| 49 | 49 | ||
| 50 | struct nfc_ops { | 50 | struct nfc_ops { |
| 51 | int (*dev_up)(struct nfc_dev *dev); | ||
| 52 | int (*dev_down)(struct nfc_dev *dev); | ||
| 51 | int (*start_poll)(struct nfc_dev *dev, u32 protocols); | 53 | int (*start_poll)(struct nfc_dev *dev, u32 protocols); |
| 52 | void (*stop_poll)(struct nfc_dev *dev); | 54 | void (*stop_poll)(struct nfc_dev *dev); |
| 53 | int (*activate_target)(struct nfc_dev *dev, u32 target_idx, | 55 | int (*activate_target)(struct nfc_dev *dev, u32 target_idx, |
| @@ -78,10 +80,15 @@ struct nfc_dev { | |||
| 78 | int targets_generation; | 80 | int targets_generation; |
| 79 | spinlock_t targets_lock; | 81 | spinlock_t targets_lock; |
| 80 | struct device dev; | 82 | struct device dev; |
| 83 | bool dev_up; | ||
| 81 | bool polling; | 84 | bool polling; |
| 85 | bool remote_activated; | ||
| 82 | struct nfc_genl_data genl_data; | 86 | struct nfc_genl_data genl_data; |
| 83 | u32 supported_protocols; | 87 | u32 supported_protocols; |
| 84 | 88 | ||
| 89 | int tx_headroom; | ||
| 90 | int tx_tailroom; | ||
| 91 | |||
| 85 | struct nfc_ops *ops; | 92 | struct nfc_ops *ops; |
| 86 | }; | 93 | }; |
| 87 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) | 94 | #define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev) |
| @@ -89,7 +96,9 @@ struct nfc_dev { | |||
| 89 | extern struct class nfc_class; | 96 | extern struct class nfc_class; |
| 90 | 97 | ||
| 91 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, | 98 | struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops, |
| 92 | u32 supported_protocols); | 99 | u32 supported_protocols, |
| 100 | int tx_headroom, | ||
| 101 | int tx_tailroom); | ||
| 93 | 102 | ||
| 94 | /** | 103 | /** |
| 95 | * nfc_free_device - free nfc device | 104 | * nfc_free_device - free nfc device |
diff --git a/include/net/regulatory.h b/include/net/regulatory.h index 356d6e3dc20a..eb7d3c2d4274 100644 --- a/include/net/regulatory.h +++ b/include/net/regulatory.h | |||
| @@ -3,11 +3,19 @@ | |||
| 3 | /* | 3 | /* |
| 4 | * regulatory support structures | 4 | * regulatory support structures |
| 5 | * | 5 | * |
| 6 | * Copyright 2008-2009 Luis R. Rodriguez <lrodriguez@atheros.com> | 6 | * Copyright 2008-2009 Luis R. Rodriguez <mcgrof@qca.qualcomm.com> |
| 7 | * | 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify | 8 | * Permission to use, copy, modify, and/or distribute this software for any |
| 9 | * it under the terms of the GNU General Public License version 2 as | 9 | * purpose with or without fee is hereby granted, provided that the above |
| 10 | * published by the Free Software Foundation. | 10 | * copyright notice and this permission notice appear in all copies. |
| 11 | * | ||
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 13 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 14 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 15 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 16 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 17 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 18 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 11 | */ | 19 | */ |
| 12 | 20 | ||
| 13 | 21 | ||
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 4fc88f3ccd5f..2eb207ea4eaf 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -46,14 +46,14 @@ struct qdisc_size_table { | |||
| 46 | struct Qdisc { | 46 | struct Qdisc { |
| 47 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); | 47 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); |
| 48 | struct sk_buff * (*dequeue)(struct Qdisc *dev); | 48 | struct sk_buff * (*dequeue)(struct Qdisc *dev); |
| 49 | unsigned flags; | 49 | unsigned int flags; |
| 50 | #define TCQ_F_BUILTIN 1 | 50 | #define TCQ_F_BUILTIN 1 |
| 51 | #define TCQ_F_INGRESS 2 | 51 | #define TCQ_F_INGRESS 2 |
| 52 | #define TCQ_F_CAN_BYPASS 4 | 52 | #define TCQ_F_CAN_BYPASS 4 |
| 53 | #define TCQ_F_MQROOT 8 | 53 | #define TCQ_F_MQROOT 8 |
| 54 | #define TCQ_F_WARN_NONWC (1 << 16) | 54 | #define TCQ_F_WARN_NONWC (1 << 16) |
| 55 | int padded; | 55 | int padded; |
| 56 | struct Qdisc_ops *ops; | 56 | const struct Qdisc_ops *ops; |
| 57 | struct qdisc_size_table __rcu *stab; | 57 | struct qdisc_size_table __rcu *stab; |
| 58 | struct list_head list; | 58 | struct list_head list; |
| 59 | u32 handle; | 59 | u32 handle; |
| @@ -224,7 +224,7 @@ struct qdisc_skb_cb { | |||
| 224 | long data[]; | 224 | long data[]; |
| 225 | }; | 225 | }; |
| 226 | 226 | ||
| 227 | static inline int qdisc_qlen(struct Qdisc *q) | 227 | static inline int qdisc_qlen(const struct Qdisc *q) |
| 228 | { | 228 | { |
| 229 | return q->q.qlen; | 229 | return q->q.qlen; |
| 230 | } | 230 | } |
| @@ -239,12 +239,12 @@ static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc) | |||
| 239 | return &qdisc->q.lock; | 239 | return &qdisc->q.lock; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) | 242 | static inline struct Qdisc *qdisc_root(const struct Qdisc *qdisc) |
| 243 | { | 243 | { |
| 244 | return qdisc->dev_queue->qdisc; | 244 | return qdisc->dev_queue->qdisc; |
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) | 247 | static inline struct Qdisc *qdisc_root_sleeping(const struct Qdisc *qdisc) |
| 248 | { | 248 | { |
| 249 | return qdisc->dev_queue->qdisc_sleeping; | 249 | return qdisc->dev_queue->qdisc_sleeping; |
| 250 | } | 250 | } |
| @@ -260,7 +260,7 @@ static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) | |||
| 260 | * root. This is enforced by holding the RTNL semaphore, which | 260 | * root. This is enforced by holding the RTNL semaphore, which |
| 261 | * all users of this lock accessor must do. | 261 | * all users of this lock accessor must do. |
| 262 | */ | 262 | */ |
| 263 | static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) | 263 | static inline spinlock_t *qdisc_root_lock(const struct Qdisc *qdisc) |
| 264 | { | 264 | { |
| 265 | struct Qdisc *root = qdisc_root(qdisc); | 265 | struct Qdisc *root = qdisc_root(qdisc); |
| 266 | 266 | ||
| @@ -268,7 +268,7 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) | |||
| 268 | return qdisc_lock(root); | 268 | return qdisc_lock(root); |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc) | 271 | static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc) |
| 272 | { | 272 | { |
| 273 | struct Qdisc *root = qdisc_root_sleeping(qdisc); | 273 | struct Qdisc *root = qdisc_root_sleeping(qdisc); |
| 274 | 274 | ||
| @@ -276,17 +276,17 @@ static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc) | |||
| 276 | return qdisc_lock(root); | 276 | return qdisc_lock(root); |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) | 279 | static inline struct net_device *qdisc_dev(const struct Qdisc *qdisc) |
| 280 | { | 280 | { |
| 281 | return qdisc->dev_queue->dev; | 281 | return qdisc->dev_queue->dev; |
| 282 | } | 282 | } |
| 283 | 283 | ||
| 284 | static inline void sch_tree_lock(struct Qdisc *q) | 284 | static inline void sch_tree_lock(const struct Qdisc *q) |
| 285 | { | 285 | { |
| 286 | spin_lock_bh(qdisc_root_sleeping_lock(q)); | 286 | spin_lock_bh(qdisc_root_sleeping_lock(q)); |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | static inline void sch_tree_unlock(struct Qdisc *q) | 289 | static inline void sch_tree_unlock(const struct Qdisc *q) |
| 290 | { | 290 | { |
| 291 | spin_unlock_bh(qdisc_root_sleeping_lock(q)); | 291 | spin_unlock_bh(qdisc_root_sleeping_lock(q)); |
| 292 | } | 292 | } |
| @@ -319,7 +319,7 @@ static inline unsigned int qdisc_class_hash(u32 id, u32 mask) | |||
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | static inline struct Qdisc_class_common * | 321 | static inline struct Qdisc_class_common * |
| 322 | qdisc_class_find(struct Qdisc_class_hash *hash, u32 id) | 322 | qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id) |
| 323 | { | 323 | { |
| 324 | struct Qdisc_class_common *cl; | 324 | struct Qdisc_class_common *cl; |
| 325 | struct hlist_node *n; | 325 | struct hlist_node *n; |
| @@ -393,7 +393,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev) | |||
| 393 | } | 393 | } |
| 394 | 394 | ||
| 395 | /* Are any of the TX qdiscs changing? */ | 395 | /* Are any of the TX qdiscs changing? */ |
| 396 | static inline bool qdisc_tx_changing(struct net_device *dev) | 396 | static inline bool qdisc_tx_changing(const struct net_device *dev) |
| 397 | { | 397 | { |
| 398 | unsigned int i; | 398 | unsigned int i; |
| 399 | for (i = 0; i < dev->num_tx_queues; i++) { | 399 | for (i = 0; i < dev->num_tx_queues; i++) { |
diff --git a/include/net/scm.h b/include/net/scm.h index 745460fa2f02..d456f4c71a32 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
| @@ -49,7 +49,7 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm, | |||
| 49 | struct pid *pid, const struct cred *cred) | 49 | struct pid *pid, const struct cred *cred) |
| 50 | { | 50 | { |
| 51 | scm->pid = get_pid(pid); | 51 | scm->pid = get_pid(pid); |
| 52 | scm->cred = get_cred(cred); | 52 | scm->cred = cred ? get_cred(cred) : NULL; |
| 53 | cred_to_ucred(pid, cred, &scm->creds); | 53 | cred_to_ucred(pid, cred, &scm->creds); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| @@ -73,8 +73,7 @@ static __inline__ void scm_destroy(struct scm_cookie *scm) | |||
| 73 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, | 73 | static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, |
| 74 | struct scm_cookie *scm) | 74 | struct scm_cookie *scm) |
| 75 | { | 75 | { |
| 76 | scm_set_cred(scm, task_tgid(current), current_cred()); | 76 | memset(scm, 0, sizeof(*scm)); |
| 77 | scm->fp = NULL; | ||
| 78 | unix_get_peersec_dgram(sock, scm); | 77 | unix_get_peersec_dgram(sock, scm); |
| 79 | if (msg->msg_controllen <= 0) | 78 | if (msg->msg_controllen <= 0) |
| 80 | return 0; | 79 | return 0; |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index f7d9c3fc06fd..e90e7a9935dd 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -1915,6 +1915,7 @@ struct sctp_association { | |||
| 1915 | __u32 addip_serial; | 1915 | __u32 addip_serial; |
| 1916 | union sctp_addr *asconf_addr_del_pending; | 1916 | union sctp_addr *asconf_addr_del_pending; |
| 1917 | int src_out_of_asoc_ok; | 1917 | int src_out_of_asoc_ok; |
| 1918 | struct sctp_transport *new_transport; | ||
| 1918 | 1919 | ||
| 1919 | /* SCTP AUTH: list of the endpoint shared keys. These | 1920 | /* SCTP AUTH: list of the endpoint shared keys. These |
| 1920 | * keys are provided out of band by the user applicaton | 1921 | * keys are provided out of band by the user applicaton |
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h index d97f6892c019..c2e542b27a5a 100644 --- a/include/net/secure_seq.h +++ b/include/net/secure_seq.h | |||
| @@ -10,7 +10,7 @@ extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, | |||
| 10 | __be16 dport); | 10 | __be16 dport); |
| 11 | extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, | 11 | extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, |
| 12 | __be16 sport, __be16 dport); | 12 | __be16 sport, __be16 dport); |
| 13 | extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr, | 13 | extern __u32 secure_tcpv6_sequence_number(const __be32 *saddr, const __be32 *daddr, |
| 14 | __be16 sport, __be16 dport); | 14 | __be16 sport, __be16 dport); |
| 15 | extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, | 15 | extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr, |
| 16 | __be16 sport, __be16 dport); | 16 | __be16 sport, __be16 dport); |
diff --git a/include/net/sock.h b/include/net/sock.h index 8e4062f165b8..5ac682f73d63 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -686,16 +686,25 @@ static inline void sock_rps_reset_flow(const struct sock *sk) | |||
| 686 | #endif | 686 | #endif |
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | static inline void sock_rps_save_rxhash(struct sock *sk, u32 rxhash) | 689 | static inline void sock_rps_save_rxhash(struct sock *sk, |
| 690 | const struct sk_buff *skb) | ||
| 690 | { | 691 | { |
| 691 | #ifdef CONFIG_RPS | 692 | #ifdef CONFIG_RPS |
| 692 | if (unlikely(sk->sk_rxhash != rxhash)) { | 693 | if (unlikely(sk->sk_rxhash != skb->rxhash)) { |
| 693 | sock_rps_reset_flow(sk); | 694 | sock_rps_reset_flow(sk); |
| 694 | sk->sk_rxhash = rxhash; | 695 | sk->sk_rxhash = skb->rxhash; |
| 695 | } | 696 | } |
| 696 | #endif | 697 | #endif |
| 697 | } | 698 | } |
| 698 | 699 | ||
| 700 | static inline void sock_rps_reset_rxhash(struct sock *sk) | ||
| 701 | { | ||
| 702 | #ifdef CONFIG_RPS | ||
| 703 | sock_rps_reset_flow(sk); | ||
| 704 | sk->sk_rxhash = 0; | ||
| 705 | #endif | ||
| 706 | } | ||
| 707 | |||
| 699 | #define sk_wait_event(__sk, __timeo, __condition) \ | 708 | #define sk_wait_event(__sk, __timeo, __condition) \ |
| 700 | ({ int __rc; \ | 709 | ({ int __rc; \ |
| 701 | release_sock(__sk); \ | 710 | release_sock(__sk); \ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index acc620a4a45f..e147f42d643d 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #ifndef _TCP_H | 18 | #ifndef _TCP_H |
| 19 | #define _TCP_H | 19 | #define _TCP_H |
| 20 | 20 | ||
| 21 | #define TCP_DEBUG 1 | ||
| 22 | #define FASTRETRANS_DEBUG 1 | 21 | #define FASTRETRANS_DEBUG 1 |
| 23 | 22 | ||
| 24 | #include <linux/list.h> | 23 | #include <linux/list.h> |
| @@ -327,9 +326,9 @@ extern int tcp_sendpage(struct sock *sk, struct page *page, int offset, | |||
| 327 | size_t size, int flags); | 326 | size_t size, int flags); |
| 328 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); | 327 | extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); |
| 329 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | 328 | extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, |
| 330 | struct tcphdr *th, unsigned len); | 329 | const struct tcphdr *th, unsigned int len); |
| 331 | extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, | 330 | extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, |
| 332 | struct tcphdr *th, unsigned len); | 331 | const struct tcphdr *th, unsigned int len); |
| 333 | extern void tcp_rcv_space_adjust(struct sock *sk); | 332 | extern void tcp_rcv_space_adjust(struct sock *sk); |
| 334 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); | 333 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); |
| 335 | extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); | 334 | extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); |
| @@ -356,6 +355,7 @@ static inline void tcp_dec_quickack_mode(struct sock *sk, | |||
| 356 | #define TCP_ECN_OK 1 | 355 | #define TCP_ECN_OK 1 |
| 357 | #define TCP_ECN_QUEUE_CWR 2 | 356 | #define TCP_ECN_QUEUE_CWR 2 |
| 358 | #define TCP_ECN_DEMAND_CWR 4 | 357 | #define TCP_ECN_DEMAND_CWR 4 |
| 358 | #define TCP_ECN_SEEN 8 | ||
| 359 | 359 | ||
| 360 | static __inline__ void | 360 | static __inline__ void |
| 361 | TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) | 361 | TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) |
| @@ -400,10 +400,10 @@ extern void tcp_set_keepalive(struct sock *sk, int val); | |||
| 400 | extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); | 400 | extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); |
| 401 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 401 | extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
| 402 | size_t len, int nonblock, int flags, int *addr_len); | 402 | size_t len, int nonblock, int flags, int *addr_len); |
| 403 | extern void tcp_parse_options(struct sk_buff *skb, | 403 | extern void tcp_parse_options(const struct sk_buff *skb, |
| 404 | struct tcp_options_received *opt_rx, u8 **hvpp, | 404 | struct tcp_options_received *opt_rx, const u8 **hvpp, |
| 405 | int estab); | 405 | int estab); |
| 406 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | 406 | extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th); |
| 407 | 407 | ||
| 408 | /* | 408 | /* |
| 409 | * TCP v4 functions exported for the inet6 API | 409 | * TCP v4 functions exported for the inet6 API |
| @@ -449,7 +449,7 @@ extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); | |||
| 449 | /* From net/ipv6/syncookies.c */ | 449 | /* From net/ipv6/syncookies.c */ |
| 450 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); | 450 | extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); |
| 451 | #ifdef CONFIG_SYN_COOKIES | 451 | #ifdef CONFIG_SYN_COOKIES |
| 452 | extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, | 452 | extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, |
| 453 | __u16 *mss); | 453 | __u16 *mss); |
| 454 | #else | 454 | #else |
| 455 | static inline __u32 cookie_v6_init_sequence(struct sock *sk, | 455 | static inline __u32 cookie_v6_init_sequence(struct sock *sk, |
| @@ -521,7 +521,7 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | |||
| 521 | } | 521 | } |
| 522 | 522 | ||
| 523 | /* tcp.c */ | 523 | /* tcp.c */ |
| 524 | extern void tcp_get_info(struct sock *, struct tcp_info *); | 524 | extern void tcp_get_info(const struct sock *, struct tcp_info *); |
| 525 | 525 | ||
| 526 | /* Read 'sendfile()'-style from a TCP socket */ | 526 | /* Read 'sendfile()'-style from a TCP socket */ |
| 527 | typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, | 527 | typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, |
| @@ -531,8 +531,8 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc, | |||
| 531 | 531 | ||
| 532 | extern void tcp_initialize_rcv_mss(struct sock *sk); | 532 | extern void tcp_initialize_rcv_mss(struct sock *sk); |
| 533 | 533 | ||
| 534 | extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); | 534 | extern int tcp_mtu_to_mss(const struct sock *sk, int pmtu); |
| 535 | extern int tcp_mss_to_mtu(struct sock *sk, int mss); | 535 | extern int tcp_mss_to_mtu(const struct sock *sk, int mss); |
| 536 | extern void tcp_mtup_init(struct sock *sk); | 536 | extern void tcp_mtup_init(struct sock *sk); |
| 537 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); | 537 | extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); |
| 538 | 538 | ||
| @@ -573,7 +573,7 @@ static inline void tcp_fast_path_check(struct sock *sk) | |||
| 573 | /* Compute the actual rto_min value */ | 573 | /* Compute the actual rto_min value */ |
| 574 | static inline u32 tcp_rto_min(struct sock *sk) | 574 | static inline u32 tcp_rto_min(struct sock *sk) |
| 575 | { | 575 | { |
| 576 | struct dst_entry *dst = __sk_dst_get(sk); | 576 | const struct dst_entry *dst = __sk_dst_get(sk); |
| 577 | u32 rto_min = TCP_RTO_MIN; | 577 | u32 rto_min = TCP_RTO_MIN; |
| 578 | 578 | ||
| 579 | if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) | 579 | if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) |
| @@ -635,13 +635,14 @@ struct tcp_skb_cb { | |||
| 635 | __u32 seq; /* Starting sequence number */ | 635 | __u32 seq; /* Starting sequence number */ |
| 636 | __u32 end_seq; /* SEQ + FIN + SYN + datalen */ | 636 | __u32 end_seq; /* SEQ + FIN + SYN + datalen */ |
| 637 | __u32 when; /* used to compute rtt's */ | 637 | __u32 when; /* used to compute rtt's */ |
| 638 | __u8 flags; /* TCP header flags. */ | 638 | __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ |
| 639 | __u8 sacked; /* State flags for SACK/FACK. */ | 639 | __u8 sacked; /* State flags for SACK/FACK. */ |
| 640 | #define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ | 640 | #define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ |
| 641 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ | 641 | #define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ |
| 642 | #define TCPCB_LOST 0x04 /* SKB is lost */ | 642 | #define TCPCB_LOST 0x04 /* SKB is lost */ |
| 643 | #define TCPCB_TAGBITS 0x07 /* All tag bits */ | 643 | #define TCPCB_TAGBITS 0x07 /* All tag bits */ |
| 644 | 644 | __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ | |
| 645 | /* 1 byte hole */ | ||
| 645 | #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ | 646 | #define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ |
| 646 | #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) | 647 | #define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) |
| 647 | 648 | ||
| @@ -818,6 +819,7 @@ static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp) | |||
| 818 | static inline __u32 tcp_current_ssthresh(const struct sock *sk) | 819 | static inline __u32 tcp_current_ssthresh(const struct sock *sk) |
| 819 | { | 820 | { |
| 820 | const struct tcp_sock *tp = tcp_sk(sk); | 821 | const struct tcp_sock *tp = tcp_sk(sk); |
| 822 | |||
| 821 | if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery)) | 823 | if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery)) |
| 822 | return tp->snd_ssthresh; | 824 | return tp->snd_ssthresh; |
| 823 | else | 825 | else |
| @@ -830,7 +832,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) | |||
| 830 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) | 832 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) |
| 831 | 833 | ||
| 832 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); | 834 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); |
| 833 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); | 835 | extern __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst); |
| 834 | 836 | ||
| 835 | /* Slow start with delack produces 3 packets of burst, so that | 837 | /* Slow start with delack produces 3 packets of burst, so that |
| 836 | * it is safe "de facto". This will be the default - same as | 838 | * it is safe "de facto". This will be the default - same as |
| @@ -859,7 +861,7 @@ static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss, | |||
| 859 | 861 | ||
| 860 | static inline void tcp_check_probe_timer(struct sock *sk) | 862 | static inline void tcp_check_probe_timer(struct sock *sk) |
| 861 | { | 863 | { |
| 862 | struct tcp_sock *tp = tcp_sk(sk); | 864 | const struct tcp_sock *tp = tcp_sk(sk); |
| 863 | const struct inet_connection_sock *icsk = inet_csk(sk); | 865 | const struct inet_connection_sock *icsk = inet_csk(sk); |
| 864 | 866 | ||
| 865 | if (!tp->packets_out && !icsk->icsk_pending) | 867 | if (!tp->packets_out && !icsk->icsk_pending) |
| @@ -1182,8 +1184,9 @@ struct tcp_md5sig_pool { | |||
| 1182 | 1184 | ||
| 1183 | /* - functions */ | 1185 | /* - functions */ |
| 1184 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, | 1186 | extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, |
| 1185 | struct sock *sk, struct request_sock *req, | 1187 | const struct sock *sk, |
| 1186 | struct sk_buff *skb); | 1188 | const struct request_sock *req, |
| 1189 | const struct sk_buff *skb); | ||
| 1187 | extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk, | 1190 | extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk, |
| 1188 | struct sock *addr_sk); | 1191 | struct sock *addr_sk); |
| 1189 | extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey, | 1192 | extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey, |
| @@ -1200,17 +1203,17 @@ extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr); | |||
| 1200 | #define tcp_twsk_md5_key(twsk) NULL | 1203 | #define tcp_twsk_md5_key(twsk) NULL |
| 1201 | #endif | 1204 | #endif |
| 1202 | 1205 | ||
| 1203 | extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); | 1206 | extern struct tcp_md5sig_pool __percpu *tcp_alloc_md5sig_pool(struct sock *); |
| 1204 | extern void tcp_free_md5sig_pool(void); | 1207 | extern void tcp_free_md5sig_pool(void); |
| 1205 | 1208 | ||
| 1206 | extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); | 1209 | extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); |
| 1207 | extern void tcp_put_md5sig_pool(void); | 1210 | extern void tcp_put_md5sig_pool(void); |
| 1208 | 1211 | ||
| 1209 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); | 1212 | extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *); |
| 1210 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, | 1213 | extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *, |
| 1211 | unsigned header_len); | 1214 | unsigned header_len); |
| 1212 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, | 1215 | extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, |
| 1213 | struct tcp_md5sig_key *key); | 1216 | const struct tcp_md5sig_key *key); |
| 1214 | 1217 | ||
| 1215 | /* write queue abstraction */ | 1218 | /* write queue abstraction */ |
| 1216 | static inline void tcp_write_queue_purge(struct sock *sk) | 1219 | static inline void tcp_write_queue_purge(struct sock *sk) |
| @@ -1223,22 +1226,24 @@ static inline void tcp_write_queue_purge(struct sock *sk) | |||
| 1223 | tcp_clear_all_retrans_hints(tcp_sk(sk)); | 1226 | tcp_clear_all_retrans_hints(tcp_sk(sk)); |
| 1224 | } | 1227 | } |
| 1225 | 1228 | ||
| 1226 | static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) | 1229 | static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk) |
| 1227 | { | 1230 | { |
| 1228 | return skb_peek(&sk->sk_write_queue); | 1231 | return skb_peek(&sk->sk_write_queue); |
| 1229 | } | 1232 | } |
| 1230 | 1233 | ||
| 1231 | static inline struct sk_buff *tcp_write_queue_tail(struct sock *sk) | 1234 | static inline struct sk_buff *tcp_write_queue_tail(const struct sock *sk) |
| 1232 | { | 1235 | { |
| 1233 | return skb_peek_tail(&sk->sk_write_queue); | 1236 | return skb_peek_tail(&sk->sk_write_queue); |
| 1234 | } | 1237 | } |
| 1235 | 1238 | ||
| 1236 | static inline struct sk_buff *tcp_write_queue_next(struct sock *sk, struct sk_buff *skb) | 1239 | static inline struct sk_buff *tcp_write_queue_next(const struct sock *sk, |
| 1240 | const struct sk_buff *skb) | ||
| 1237 | { | 1241 | { |
| 1238 | return skb_queue_next(&sk->sk_write_queue, skb); | 1242 | return skb_queue_next(&sk->sk_write_queue, skb); |
| 1239 | } | 1243 | } |
| 1240 | 1244 | ||
| 1241 | static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_buff *skb) | 1245 | static inline struct sk_buff *tcp_write_queue_prev(const struct sock *sk, |
| 1246 | const struct sk_buff *skb) | ||
| 1242 | { | 1247 | { |
| 1243 | return skb_queue_prev(&sk->sk_write_queue, skb); | 1248 | return skb_queue_prev(&sk->sk_write_queue, skb); |
| 1244 | } | 1249 | } |
| @@ -1252,7 +1257,7 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu | |||
| 1252 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ | 1257 | #define tcp_for_write_queue_from_safe(skb, tmp, sk) \ |
| 1253 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) | 1258 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) |
| 1254 | 1259 | ||
| 1255 | static inline struct sk_buff *tcp_send_head(struct sock *sk) | 1260 | static inline struct sk_buff *tcp_send_head(const struct sock *sk) |
| 1256 | { | 1261 | { |
| 1257 | return sk->sk_send_head; | 1262 | return sk->sk_send_head; |
| 1258 | } | 1263 | } |
| @@ -1263,7 +1268,7 @@ static inline bool tcp_skb_is_last(const struct sock *sk, | |||
| 1263 | return skb_queue_is_last(&sk->sk_write_queue, skb); | 1268 | return skb_queue_is_last(&sk->sk_write_queue, skb); |
| 1264 | } | 1269 | } |
| 1265 | 1270 | ||
| 1266 | static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb) | 1271 | static inline void tcp_advance_send_head(struct sock *sk, const struct sk_buff *skb) |
| 1267 | { | 1272 | { |
| 1268 | if (tcp_skb_is_last(sk, skb)) | 1273 | if (tcp_skb_is_last(sk, skb)) |
| 1269 | sk->sk_send_head = NULL; | 1274 | sk->sk_send_head = NULL; |
| @@ -1443,9 +1448,9 @@ struct tcp_sock_af_ops { | |||
| 1443 | struct sock *addr_sk); | 1448 | struct sock *addr_sk); |
| 1444 | int (*calc_md5_hash) (char *location, | 1449 | int (*calc_md5_hash) (char *location, |
| 1445 | struct tcp_md5sig_key *md5, | 1450 | struct tcp_md5sig_key *md5, |
| 1446 | struct sock *sk, | 1451 | const struct sock *sk, |
| 1447 | struct request_sock *req, | 1452 | const struct request_sock *req, |
| 1448 | struct sk_buff *skb); | 1453 | const struct sk_buff *skb); |
| 1449 | int (*md5_add) (struct sock *sk, | 1454 | int (*md5_add) (struct sock *sk, |
| 1450 | struct sock *addr_sk, | 1455 | struct sock *addr_sk, |
| 1451 | u8 *newkey, | 1456 | u8 *newkey, |
| @@ -1462,9 +1467,9 @@ struct tcp_request_sock_ops { | |||
| 1462 | struct request_sock *req); | 1467 | struct request_sock *req); |
| 1463 | int (*calc_md5_hash) (char *location, | 1468 | int (*calc_md5_hash) (char *location, |
| 1464 | struct tcp_md5sig_key *md5, | 1469 | struct tcp_md5sig_key *md5, |
| 1465 | struct sock *sk, | 1470 | const struct sock *sk, |
| 1466 | struct request_sock *req, | 1471 | const struct request_sock *req, |
| 1467 | struct sk_buff *skb); | 1472 | const struct sk_buff *skb); |
| 1468 | #endif | 1473 | #endif |
| 1469 | }; | 1474 | }; |
| 1470 | 1475 | ||
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h index ae8c68f30f1b..639a4491fc0d 100644 --- a/include/rdma/ib_addr.h +++ b/include/rdma/ib_addr.h | |||
| @@ -218,8 +218,12 @@ static inline int iboe_get_rate(struct net_device *dev) | |||
| 218 | { | 218 | { |
| 219 | struct ethtool_cmd cmd; | 219 | struct ethtool_cmd cmd; |
| 220 | u32 speed; | 220 | u32 speed; |
| 221 | int err; | ||
| 221 | 222 | ||
| 222 | if (dev_ethtool_get_settings(dev, &cmd)) | 223 | rtnl_lock(); |
| 224 | err = __ethtool_get_settings(dev, &cmd); | ||
| 225 | rtnl_unlock(); | ||
| 226 | if (err) | ||
| 223 | return IB_RATE_PORT_CURRENT; | 227 | return IB_RATE_PORT_CURRENT; |
| 224 | 228 | ||
| 225 | speed = ethtool_cmd_speed(&cmd); | 229 | speed = ethtool_cmd_speed(&cmd); |
