aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2012-02-21 15:06:35 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-21 15:06:35 -0500
commita9802d43f205faa2fff422502a1336a50b9615c3 (patch)
tree57152d6c84556320570802d01bbe04cefd8a2a7d /include
parent0b0a635f79f91f3755b6518627ea06dd0dbfd523 (diff)
parentca994a36f585432458ead9133fcfe05440edbb7b (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Diffstat (limited to 'include')
-rw-r--r--include/linux/bcma/bcma.h2
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h16
-rw-r--r--include/linux/bcma/bcma_driver_pci.h125
-rw-r--r--include/linux/bcma/bcma_regs.h27
-rw-r--r--include/net/bluetooth/bluetooth.h2
-rw-r--r--include/net/bluetooth/hci_core.h6
-rw-r--r--include/net/bluetooth/l2cap.h12
-rw-r--r--include/net/cfg80211.h58
-rw-r--r--include/net/mac80211.h35
9 files changed, 245 insertions, 38 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 83c209f39493..b9f65fbee42f 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -136,6 +136,7 @@ struct bcma_device {
136 bool dev_registered; 136 bool dev_registered;
137 137
138 u8 core_index; 138 u8 core_index;
139 u8 core_unit;
139 140
140 u32 addr; 141 u32 addr;
141 u32 wrap; 142 u32 wrap;
@@ -195,6 +196,7 @@ struct bcma_bus {
195 struct list_head cores; 196 struct list_head cores;
196 u8 nr_cores; 197 u8 nr_cores;
197 u8 init_done:1; 198 u8 init_done:1;
199 u8 num;
198 200
199 struct bcma_drv_cc drv_cc; 201 struct bcma_drv_cc drv_cc;
200 struct bcma_drv_pci drv_pci; 202 struct bcma_drv_pci drv_pci;
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index a33086a7530b..e72938b10714 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -181,6 +181,22 @@
181#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 */ 182#define BCMA_CC_FLASH_CFG_DS 0x0010 /* Data size, 0=8bit, 1=16bit */
183#define BCMA_CC_FLASH_WAITCNT 0x012C 183#define BCMA_CC_FLASH_WAITCNT 0x012C
184#define BCMA_CC_SROM_CONTROL 0x0190
185#define BCMA_CC_SROM_CONTROL_START 0x80000000
186#define BCMA_CC_SROM_CONTROL_BUSY 0x80000000
187#define BCMA_CC_SROM_CONTROL_OPCODE 0x60000000
188#define BCMA_CC_SROM_CONTROL_OP_READ 0x00000000
189#define BCMA_CC_SROM_CONTROL_OP_WRITE 0x20000000
190#define BCMA_CC_SROM_CONTROL_OP_WRDIS 0x40000000
191#define BCMA_CC_SROM_CONTROL_OP_WREN 0x60000000
192#define BCMA_CC_SROM_CONTROL_OTPSEL 0x00000010
193#define BCMA_CC_SROM_CONTROL_LOCK 0x00000008
194#define BCMA_CC_SROM_CONTROL_SIZE_MASK 0x00000006
195#define BCMA_CC_SROM_CONTROL_SIZE_1K 0x00000000
196#define BCMA_CC_SROM_CONTROL_SIZE_4K 0x00000002
197#define BCMA_CC_SROM_CONTROL_SIZE_16K 0x00000004
198#define BCMA_CC_SROM_CONTROL_SIZE_SHIFT 1
199#define BCMA_CC_SROM_CONTROL_PRESENT 0x00000001
184/* 0x1E0 is defined as shared BCMA_CLKCTLST */ 200/* 0x1E0 is defined as shared BCMA_CLKCTLST */
185#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 201#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
186#define BCMA_CC_UART0_DATA 0x0300 202#define BCMA_CC_UART0_DATA 0x0300
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index 3871b668caf9..46c71e27d31f 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -53,6 +53,35 @@ struct pci_dev;
53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000 53#define BCMA_CORE_PCI_SBTOPCI1_MASK 0xFC000000
54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ 54#define BCMA_CORE_PCI_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */
55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000 55#define BCMA_CORE_PCI_SBTOPCI2_MASK 0xC0000000
56#define BCMA_CORE_PCI_CONFIG_ADDR 0x0120 /* pcie config space access */
57#define BCMA_CORE_PCI_CONFIG_DATA 0x0124 /* pcie config space access */
58#define BCMA_CORE_PCI_MDIO_CONTROL 0x0128 /* controls the mdio access */
59#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_MASK 0x7f /* clock to be used on MDIO */
60#define BCMA_CORE_PCI_MDIOCTL_DIVISOR_VAL 0x2
61#define BCMA_CORE_PCI_MDIOCTL_PREAM_EN 0x80 /* Enable preamble sequnce */
62#define BCMA_CORE_PCI_MDIOCTL_ACCESS_DONE 0x100 /* Tranaction complete */
63#define BCMA_CORE_PCI_MDIO_DATA 0x012c /* Data to the mdio access */
64#define BCMA_CORE_PCI_MDIODATA_MASK 0x0000ffff /* data 2 bytes */
65#define BCMA_CORE_PCI_MDIODATA_TA 0x00020000 /* Turnaround */
66#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF_OLD 18 /* Regaddr shift (rev < 10) */
67#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK_OLD 0x003c0000 /* Regaddr Mask (rev < 10) */
68#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF_OLD 22 /* Physmedia devaddr shift (rev < 10) */
69#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK_OLD 0x0fc00000 /* Physmedia devaddr Mask (rev < 10) */
70#define BCMA_CORE_PCI_MDIODATA_REGADDR_SHF 18 /* Regaddr shift */
71#define BCMA_CORE_PCI_MDIODATA_REGADDR_MASK 0x007c0000 /* Regaddr Mask */
72#define BCMA_CORE_PCI_MDIODATA_DEVADDR_SHF 23 /* Physmedia devaddr shift */
73#define BCMA_CORE_PCI_MDIODATA_DEVADDR_MASK 0x0f800000 /* Physmedia devaddr Mask */
74#define BCMA_CORE_PCI_MDIODATA_WRITE 0x10000000 /* write Transaction */
75#define BCMA_CORE_PCI_MDIODATA_READ 0x20000000 /* Read Transaction */
76#define BCMA_CORE_PCI_MDIODATA_START 0x40000000 /* start of Transaction */
77#define BCMA_CORE_PCI_MDIODATA_DEV_ADDR 0x0 /* dev address for serdes */
78#define BCMA_CORE_PCI_MDIODATA_BLK_ADDR 0x1F /* blk address for serdes */
79#define BCMA_CORE_PCI_MDIODATA_DEV_PLL 0x1d /* SERDES PLL Dev */
80#define BCMA_CORE_PCI_MDIODATA_DEV_TX 0x1e /* SERDES TX Dev */
81#define BCMA_CORE_PCI_MDIODATA_DEV_RX 0x1f /* SERDES RX Dev */
82#define BCMA_CORE_PCI_PCIEIND_ADDR 0x0130 /* indirect access to the internal register */
83#define BCMA_CORE_PCI_PCIEIND_DATA 0x0134 /* Data to/from the internal regsiter */
84#define BCMA_CORE_PCI_CLKREQENCTRL 0x0138 /* >= rev 6, Clkreq rdma control */
56#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */ 85#define BCMA_CORE_PCI_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */
57#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */ 86#define BCMA_CORE_PCI_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */
58#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */ 87#define BCMA_CORE_PCI_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */
@@ -72,20 +101,114 @@ struct pci_dev;
72#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */ 101#define BCMA_CORE_PCI_SBTOPCI_RC_READL 0x00000010 /* Memory read line */
73#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */ 102#define BCMA_CORE_PCI_SBTOPCI_RC_READM 0x00000020 /* Memory read multiple */
74 103
104/* PCIE protocol PHY diagnostic registers */
105#define BCMA_CORE_PCI_PLP_MODEREG 0x200 /* Mode */
106#define BCMA_CORE_PCI_PLP_STATUSREG 0x204 /* Status */
107#define BCMA_CORE_PCI_PLP_POLARITYINV_STAT 0x10 /* Status reg PCIE_PLP_STATUSREG */
108#define BCMA_CORE_PCI_PLP_LTSSMCTRLREG 0x208 /* LTSSM control */
109#define BCMA_CORE_PCI_PLP_LTLINKNUMREG 0x20c /* Link Training Link number */
110#define BCMA_CORE_PCI_PLP_LTLANENUMREG 0x210 /* Link Training Lane number */
111#define BCMA_CORE_PCI_PLP_LTNFTSREG 0x214 /* Link Training N_FTS */
112#define BCMA_CORE_PCI_PLP_ATTNREG 0x218 /* Attention */
113#define BCMA_CORE_PCI_PLP_ATTNMASKREG 0x21C /* Attention Mask */
114#define BCMA_CORE_PCI_PLP_RXERRCTR 0x220 /* Rx Error */
115#define BCMA_CORE_PCI_PLP_RXFRMERRCTR 0x224 /* Rx Framing Error */
116#define BCMA_CORE_PCI_PLP_RXERRTHRESHREG 0x228 /* Rx Error threshold */
117#define BCMA_CORE_PCI_PLP_TESTCTRLREG 0x22C /* Test Control reg */
118#define BCMA_CORE_PCI_PLP_SERDESCTRLOVRDREG 0x230 /* SERDES Control Override */
119#define BCMA_CORE_PCI_PLP_TIMINGOVRDREG 0x234 /* Timing param override */
120#define BCMA_CORE_PCI_PLP_RXTXSMDIAGREG 0x238 /* RXTX State Machine Diag */
121#define BCMA_CORE_PCI_PLP_LTSSMDIAGREG 0x23C /* LTSSM State Machine Diag */
122
123/* PCIE protocol DLLP diagnostic registers */
124#define BCMA_CORE_PCI_DLLP_LCREG 0x100 /* Link Control */
125#define BCMA_CORE_PCI_DLLP_LSREG 0x104 /* Link Status */
126#define BCMA_CORE_PCI_DLLP_LAREG 0x108 /* Link Attention */
127#define BCMA_CORE_PCI_DLLP_LSREG_LINKUP (1 << 16)
128#define BCMA_CORE_PCI_DLLP_LAMASKREG 0x10C /* Link Attention Mask */
129#define BCMA_CORE_PCI_DLLP_NEXTTXSEQNUMREG 0x110 /* Next Tx Seq Num */
130#define BCMA_CORE_PCI_DLLP_ACKEDTXSEQNUMREG 0x114 /* Acked Tx Seq Num */
131#define BCMA_CORE_PCI_DLLP_PURGEDTXSEQNUMREG 0x118 /* Purged Tx Seq Num */
132#define BCMA_CORE_PCI_DLLP_RXSEQNUMREG 0x11C /* Rx Sequence Number */
133#define BCMA_CORE_PCI_DLLP_LRREG 0x120 /* Link Replay */
134#define BCMA_CORE_PCI_DLLP_LACKTOREG 0x124 /* Link Ack Timeout */
135#define BCMA_CORE_PCI_DLLP_PMTHRESHREG 0x128 /* Power Management Threshold */
136#define BCMA_CORE_PCI_DLLP_RTRYWPREG 0x12C /* Retry buffer write ptr */
137#define BCMA_CORE_PCI_DLLP_RTRYRPREG 0x130 /* Retry buffer Read ptr */
138#define BCMA_CORE_PCI_DLLP_RTRYPPREG 0x134 /* Retry buffer Purged ptr */
139#define BCMA_CORE_PCI_DLLP_RTRRWREG 0x138 /* Retry buffer Read/Write */
140#define BCMA_CORE_PCI_DLLP_ECTHRESHREG 0x13C /* Error Count Threshold */
141#define BCMA_CORE_PCI_DLLP_TLPERRCTRREG 0x140 /* TLP Error Counter */
142#define BCMA_CORE_PCI_DLLP_ERRCTRREG 0x144 /* Error Counter */
143#define BCMA_CORE_PCI_DLLP_NAKRXCTRREG 0x148 /* NAK Received Counter */
144#define BCMA_CORE_PCI_DLLP_TESTREG 0x14C /* Test */
145#define BCMA_CORE_PCI_DLLP_PKTBIST 0x150 /* Packet BIST */
146#define BCMA_CORE_PCI_DLLP_PCIE11 0x154 /* DLLP PCIE 1.1 reg */
147
148/* SERDES RX registers */
149#define BCMA_CORE_PCI_SERDES_RX_CTRL 1 /* Rx cntrl */
150#define BCMA_CORE_PCI_SERDES_RX_CTRL_FORCE 0x80 /* rxpolarity_force */
151#define BCMA_CORE_PCI_SERDES_RX_CTRL_POLARITY 0x40 /* rxpolarity_value */
152#define BCMA_CORE_PCI_SERDES_RX_TIMER1 2 /* Rx Timer1 */
153#define BCMA_CORE_PCI_SERDES_RX_CDR 6 /* CDR */
154#define BCMA_CORE_PCI_SERDES_RX_CDRBW 7 /* CDR BW */
155
156/* SERDES PLL registers */
157#define BCMA_CORE_PCI_SERDES_PLL_CTRL 1 /* PLL control reg */
158#define BCMA_CORE_PCI_PLL_CTRL_FREQDET_EN 0x4000 /* bit 14 is FREQDET on */
159
75/* PCIcore specific boardflags */ 160/* PCIcore specific boardflags */
76#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */ 161#define BCMA_CORE_PCI_BFL_NOPCI 0x00000400 /* Board leaves PCI floating */
77 162
163/* PCIE Config space accessing MACROS */
164#define BCMA_CORE_PCI_CFG_BUS_SHIFT 24 /* Bus shift */
165#define BCMA_CORE_PCI_CFG_SLOT_SHIFT 19 /* Slot/Device shift */
166#define BCMA_CORE_PCI_CFG_FUN_SHIFT 16 /* Function shift */
167#define BCMA_CORE_PCI_CFG_OFF_SHIFT 0 /* Register shift */
168
169#define BCMA_CORE_PCI_CFG_BUS_MASK 0xff /* Bus mask */
170#define BCMA_CORE_PCI_CFG_SLOT_MASK 0x1f /* Slot/Device mask */
171#define BCMA_CORE_PCI_CFG_FUN_MASK 7 /* Function mask */
172#define BCMA_CORE_PCI_CFG_OFF_MASK 0xfff /* Register mask */
173
174/* PCIE Root Capability Register bits (Host mode only) */
175#define BCMA_CORE_PCI_RC_CRS_VISIBILITY 0x0001
176
177struct bcma_drv_pci;
178
179#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
180struct bcma_drv_pci_host {
181 struct bcma_drv_pci *pdev;
182
183 u32 host_cfg_addr;
184 spinlock_t cfgspace_lock;
185
186 struct pci_controller pci_controller;
187 struct pci_ops pci_ops;
188 struct resource mem_resource;
189 struct resource io_resource;
190};
191#endif
192
78struct bcma_drv_pci { 193struct bcma_drv_pci {
79 struct bcma_device *core; 194 struct bcma_device *core;
80 u8 setup_done:1; 195 u8 setup_done:1;
196 u8 hostmode:1;
197
198#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
199 struct bcma_drv_pci_host *host_controller;
200#endif
81}; 201};
82 202
83/* Register access */ 203/* Register access */
84#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset) 204#define pcicore_read32(pc, offset) bcma_read32((pc)->core, offset)
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 205#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 206
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 207extern void __devinit bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc, 208extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable); 209 struct bcma_device *core, bool enable);
90 210
211extern int bcma_core_pci_pcibios_map_irq(const struct pci_dev *dev);
212extern int bcma_core_pci_plat_dev_init(struct pci_dev *dev);
213
91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 214#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index 9faae2ae02e8..5a71d5719640 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -56,4 +56,31 @@
56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */ 56#define BCMA_PCI_GPIO_XTAL 0x40 /* PCI config space GPIO 14 for Xtal powerup */
57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */ 57#define BCMA_PCI_GPIO_PLL 0x80 /* PCI config space GPIO 15 for PLL powerdown */
58 58
59/* SiliconBackplane Address Map.
60 * All regions may not exist on all chips.
61 */
62#define BCMA_SOC_SDRAM_BASE 0x00000000U /* Physical SDRAM */
63#define BCMA_SOC_PCI_MEM 0x08000000U /* Host Mode sb2pcitranslation0 (64 MB) */
64#define BCMA_SOC_PCI_MEM_SZ (64 * 1024 * 1024)
65#define BCMA_SOC_PCI_CFG 0x0c000000U /* Host Mode sb2pcitranslation1 (64 MB) */
66#define BCMA_SOC_SDRAM_SWAPPED 0x10000000U /* Byteswapped Physical SDRAM */
67#define BCMA_SOC_SDRAM_R2 0x80000000U /* Region 2 for sdram (512 MB) */
68
69
70#define BCMA_SOC_PCI_DMA 0x40000000U /* Client Mode sb2pcitranslation2 (1 GB) */
71#define BCMA_SOC_PCI_DMA2 0x80000000U /* Client Mode sb2pcitranslation2 (1 GB) */
72#define BCMA_SOC_PCI_DMA_SZ 0x40000000U /* Client Mode sb2pcitranslation2 size in bytes */
73#define BCMA_SOC_PCIE_DMA_L32 0x00000000U /* PCIE Client Mode sb2pcitranslation2
74 * (2 ZettaBytes), low 32 bits
75 */
76#define BCMA_SOC_PCIE_DMA_H32 0x80000000U /* PCIE Client Mode sb2pcitranslation2
77 * (2 ZettaBytes), high 32 bits
78 */
79
80#define BCMA_SOC_PCI1_MEM 0x40000000U /* Host Mode sb2pcitranslation0 (64 MB) */
81#define BCMA_SOC_PCI1_CFG 0x44000000U /* Host Mode sb2pcitranslation1 (64 MB) */
82#define BCMA_SOC_PCIE1_DMA_H32 0xc0000000U /* PCIE Client Mode sb2pcitranslation2
83 * (2 ZettaBytes), high 32 bits
84 */
85
59#endif /* LINUX_BCMA_REGS_H_ */ 86#endif /* LINUX_BCMA_REGS_H_ */
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index abaad6ed9b83..4a82ca0bb0b2 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -256,4 +256,6 @@ void l2cap_exit(void);
256int sco_init(void); 256int sco_init(void);
257void sco_exit(void); 257void sco_exit(void);
258 258
259void bt_sock_reclassify_lock(struct sock *sk, int proto);
260
259#endif /* __BLUETOOTH_H */ 261#endif /* __BLUETOOTH_H */
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ea9231f4935f..453893b3120e 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -540,7 +540,7 @@ void hci_conn_put_device(struct hci_conn *conn);
540static inline void hci_conn_hold(struct hci_conn *conn) 540static inline void hci_conn_hold(struct hci_conn *conn)
541{ 541{
542 atomic_inc(&conn->refcnt); 542 atomic_inc(&conn->refcnt);
543 cancel_delayed_work_sync(&conn->disc_work); 543 cancel_delayed_work(&conn->disc_work);
544} 544}
545 545
546static inline void hci_conn_put(struct hci_conn *conn) 546static inline void hci_conn_put(struct hci_conn *conn)
@@ -559,9 +559,9 @@ static inline void hci_conn_put(struct hci_conn *conn)
559 } else { 559 } else {
560 timeo = msecs_to_jiffies(10); 560 timeo = msecs_to_jiffies(10);
561 } 561 }
562 cancel_delayed_work_sync(&conn->disc_work); 562 cancel_delayed_work(&conn->disc_work);
563 queue_delayed_work(conn->hdev->workqueue, 563 queue_delayed_work(conn->hdev->workqueue,
564 &conn->disc_work, jiffies + timeo); 564 &conn->disc_work, timeo);
565 } 565 }
566} 566}
567 567
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 68f589150692..b1664ed884e6 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -611,7 +611,7 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
611{ 611{
612 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout); 612 BT_DBG("chan %p state %d timeout %ld", chan, chan->state, timeout);
613 613
614 if (!__cancel_delayed_work(work)) 614 if (!cancel_delayed_work(work))
615 l2cap_chan_hold(chan); 615 l2cap_chan_hold(chan);
616 schedule_delayed_work(work, timeout); 616 schedule_delayed_work(work, timeout);
617} 617}
@@ -619,20 +619,20 @@ static inline void l2cap_set_timer(struct l2cap_chan *chan,
619static inline void l2cap_clear_timer(struct l2cap_chan *chan, 619static inline void l2cap_clear_timer(struct l2cap_chan *chan,
620 struct delayed_work *work) 620 struct delayed_work *work)
621{ 621{
622 if (__cancel_delayed_work(work)) 622 if (cancel_delayed_work(work))
623 l2cap_chan_put(chan); 623 l2cap_chan_put(chan);
624} 624}
625 625
626#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) 626#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
627#define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) 627#define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer)
628#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ 628#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
629 L2CAP_DEFAULT_RETRANS_TO); 629 msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO));
630#define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) 630#define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer)
631#define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \ 631#define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \
632 L2CAP_DEFAULT_MONITOR_TO); 632 msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO));
633#define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) 633#define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer)
634#define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ 634#define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \
635 L2CAP_DEFAULT_ACK_TO); 635 msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO));
636#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer) 636#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
637 637
638static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2) 638static inline int __seq_offset(struct l2cap_chan *chan, __u16 seq1, __u16 seq2)
@@ -834,7 +834,7 @@ int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
834struct l2cap_chan *l2cap_chan_create(struct sock *sk); 834struct l2cap_chan *l2cap_chan_create(struct sock *sk);
835void l2cap_chan_close(struct l2cap_chan *chan, int reason); 835void l2cap_chan_close(struct l2cap_chan *chan, int reason);
836void l2cap_chan_destroy(struct l2cap_chan *chan); 836void l2cap_chan_destroy(struct l2cap_chan *chan);
837inline int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, 837int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
838 bdaddr_t *dst); 838 bdaddr_t *dst);
839int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, 839int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len,
840 u32 priority); 840 u32 priority);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 2964205332f4..e0c9ff3a1977 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1039,10 +1039,6 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
1039 * @key_len: length of WEP key for shared key authentication 1039 * @key_len: length of WEP key for shared key authentication
1040 * @key_idx: index of WEP key for shared key authentication 1040 * @key_idx: index of WEP key for shared key authentication
1041 * @key: WEP key for shared key authentication 1041 * @key: WEP key for shared key authentication
1042 * @local_state_change: This is a request for a local state only, i.e., no
1043 * Authentication frame is to be transmitted and authentication state is
1044 * to be changed without having to wait for a response from the peer STA
1045 * (AP).
1046 */ 1042 */
1047struct cfg80211_auth_request { 1043struct cfg80211_auth_request {
1048 struct cfg80211_bss *bss; 1044 struct cfg80211_bss *bss;
@@ -1051,7 +1047,6 @@ struct cfg80211_auth_request {
1051 enum nl80211_auth_type auth_type; 1047 enum nl80211_auth_type auth_type;
1052 const u8 *key; 1048 const u8 *key;
1053 u8 key_len, key_idx; 1049 u8 key_len, key_idx;
1054 bool local_state_change;
1055}; 1050};
1056 1051
1057/** 1052/**
@@ -1068,7 +1063,11 @@ enum cfg80211_assoc_req_flags {
1068 * 1063 *
1069 * This structure provides information needed to complete IEEE 802.11 1064 * This structure provides information needed to complete IEEE 802.11
1070 * (re)association. 1065 * (re)association.
1071 * @bss: The BSS to associate with. 1066 * @bss: The BSS to associate with. If the call is successful the driver
1067 * is given a reference that it must release, normally via a call to
1068 * cfg80211_send_rx_assoc(), or, if association timed out, with a
1069 * call to cfg80211_put_bss() (in addition to calling
1070 * cfg80211_send_assoc_timeout())
1072 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL 1071 * @ie: Extra IEs to add to (Re)Association Request frame or %NULL
1073 * @ie_len: Length of ie buffer in octets 1072 * @ie_len: Length of ie buffer in octets
1074 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association 1073 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association
@@ -1096,19 +1095,16 @@ struct cfg80211_assoc_request {
1096 * This structure provides information needed to complete IEEE 802.11 1095 * This structure provides information needed to complete IEEE 802.11
1097 * deauthentication. 1096 * deauthentication.
1098 * 1097 *
1099 * @bss: the BSS to deauthenticate from 1098 * @bssid: the BSSID of the BSS to deauthenticate from
1100 * @ie: Extra IEs to add to Deauthentication frame or %NULL 1099 * @ie: Extra IEs to add to Deauthentication frame or %NULL
1101 * @ie_len: Length of ie buffer in octets 1100 * @ie_len: Length of ie buffer in octets
1102 * @reason_code: The reason code for the deauthentication 1101 * @reason_code: The reason code for the deauthentication
1103 * @local_state_change: This is a request for a local state only, i.e., no
1104 * Deauthentication frame is to be transmitted.
1105 */ 1102 */
1106struct cfg80211_deauth_request { 1103struct cfg80211_deauth_request {
1107 struct cfg80211_bss *bss; 1104 const u8 *bssid;
1108 const u8 *ie; 1105 const u8 *ie;
1109 size_t ie_len; 1106 size_t ie_len;
1110 u16 reason_code; 1107 u16 reason_code;
1111 bool local_state_change;
1112}; 1108};
1113 1109
1114/** 1110/**
@@ -1151,6 +1147,10 @@ struct cfg80211_disassoc_request {
1151 * @beacon_interval: beacon interval to use 1147 * @beacon_interval: beacon interval to use
1152 * @privacy: this is a protected network, keys will be configured 1148 * @privacy: this is a protected network, keys will be configured
1153 * after joining 1149 * after joining
1150 * @control_port: whether user space controls IEEE 802.1X port, i.e.,
1151 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
1152 * required to assume that the port is unauthorized until authorized by
1153 * user space. Otherwise, port is marked authorized by default.
1154 * @basic_rates: bitmap of basic rates to use when creating the IBSS 1154 * @basic_rates: bitmap of basic rates to use when creating the IBSS
1155 * @mcast_rate: per-band multicast rate index + 1 (0: disabled) 1155 * @mcast_rate: per-band multicast rate index + 1 (0: disabled)
1156 */ 1156 */
@@ -1165,6 +1165,7 @@ struct cfg80211_ibss_params {
1165 u32 basic_rates; 1165 u32 basic_rates;
1166 bool channel_fixed; 1166 bool channel_fixed;
1167 bool privacy; 1167 bool privacy;
1168 bool control_port;
1168 int mcast_rate[IEEE80211_NUM_BANDS]; 1169 int mcast_rate[IEEE80211_NUM_BANDS];
1169}; 1170};
1170 1171
@@ -2206,8 +2207,6 @@ struct cfg80211_conn;
2206struct cfg80211_internal_bss; 2207struct cfg80211_internal_bss;
2207struct cfg80211_cached_keys; 2208struct cfg80211_cached_keys;
2208 2209
2209#define MAX_AUTH_BSSES 4
2210
2211/** 2210/**
2212 * struct wireless_dev - wireless per-netdev state 2211 * struct wireless_dev - wireless per-netdev state
2213 * 2212 *
@@ -2271,8 +2270,6 @@ struct wireless_dev {
2271 struct list_head event_list; 2270 struct list_head event_list;
2272 spinlock_t event_lock; 2271 spinlock_t event_lock;
2273 2272
2274 struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES];
2275 struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES];
2276 struct cfg80211_internal_bss *current_bss; /* associated / joined */ 2273 struct cfg80211_internal_bss *current_bss; /* associated / joined */
2277 struct ieee80211_channel *channel; 2274 struct ieee80211_channel *channel;
2278 2275
@@ -2727,6 +2724,20 @@ struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
2727 struct ieee80211_channel *channel, 2724 struct ieee80211_channel *channel,
2728 const u8 *meshid, size_t meshidlen, 2725 const u8 *meshid, size_t meshidlen,
2729 const u8 *meshcfg); 2726 const u8 *meshcfg);
2727/**
2728 * cfg80211_ref_bss - reference BSS struct
2729 * @bss: the BSS struct to reference
2730 *
2731 * Increments the refcount of the given BSS struct.
2732 */
2733void cfg80211_ref_bss(struct cfg80211_bss *bss);
2734
2735/**
2736 * cfg80211_put_bss - unref BSS struct
2737 * @bss: the BSS struct
2738 *
2739 * Decrements the refcount of the given BSS struct.
2740 */
2730void cfg80211_put_bss(struct cfg80211_bss *bss); 2741void cfg80211_put_bss(struct cfg80211_bss *bss);
2731 2742
2732/** 2743/**
@@ -2764,20 +2775,10 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len);
2764void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); 2775void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr);
2765 2776
2766/** 2777/**
2767 * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled
2768 * @dev: network device
2769 * @addr: The MAC address of the device with which the authentication timed out
2770 *
2771 * When a pending authentication had no action yet, the driver may decide
2772 * to not send a deauth frame, but in that case must calls this function
2773 * to tell cfg80211 about this decision. It is only valid to call this
2774 * function within the deauth() callback.
2775 */
2776void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
2777
2778/**
2779 * cfg80211_send_rx_assoc - notification of processed association 2778 * cfg80211_send_rx_assoc - notification of processed association
2780 * @dev: network device 2779 * @dev: network device
2780 * @bss: the BSS struct association was requested for, the struct reference
2781 * is owned by cfg80211 after this call
2781 * @buf: (re)association response frame (header + body) 2782 * @buf: (re)association response frame (header + body)
2782 * @len: length of the frame data 2783 * @len: length of the frame data
2783 * 2784 *
@@ -2786,7 +2787,8 @@ void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr);
2786 * function or cfg80211_send_assoc_timeout() to indicate the result of 2787 * function or cfg80211_send_assoc_timeout() to indicate the result of
2787 * cfg80211_ops::assoc() call. This function may sleep. 2788 * cfg80211_ops::assoc() call. This function may sleep.
2788 */ 2789 */
2789void cfg80211_send_rx_assoc(struct net_device *dev, const u8 *buf, size_t len); 2790void cfg80211_send_rx_assoc(struct net_device *dev, struct cfg80211_bss *bss,
2791 const u8 *buf, size_t len);
2790 2792
2791/** 2793/**
2792 * cfg80211_send_assoc_timeout - notification of timed out association 2794 * cfg80211_send_assoc_timeout - notification of timed out association
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 520eb4c5e5a2..cbff4f94a200 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -982,6 +982,25 @@ enum set_key_cmd {
982}; 982};
983 983
984/** 984/**
985 * enum ieee80211_sta_state - station state
986 *
987 * @IEEE80211_STA_NOTEXIST: station doesn't exist at all,
988 * this is a special state for add/remove transitions
989 * @IEEE80211_STA_NONE: station exists without special state
990 * @IEEE80211_STA_AUTH: station is authenticated
991 * @IEEE80211_STA_ASSOC: station is associated
992 * @IEEE80211_STA_AUTHORIZED: station is authorized (802.1X)
993 */
994enum ieee80211_sta_state {
995 /* NOTE: These need to be ordered correctly! */
996 IEEE80211_STA_NOTEXIST,
997 IEEE80211_STA_NONE,
998 IEEE80211_STA_AUTH,
999 IEEE80211_STA_ASSOC,
1000 IEEE80211_STA_AUTHORIZED,
1001};
1002
1003/**
985 * struct ieee80211_sta - station table entry 1004 * struct ieee80211_sta - station table entry
986 * 1005 *
987 * A station table entry represents a station we are possibly 1006 * A station table entry represents a station we are possibly
@@ -1145,6 +1164,10 @@ enum sta_notify_cmd {
1145 * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session 1164 * @IEEE80211_HW_TX_AMPDU_SETUP_IN_HW: The device handles TX A-MPDU session
1146 * setup strictly in HW. mac80211 should not attempt to do this in 1165 * setup strictly in HW. mac80211 should not attempt to do this in
1147 * software. 1166 * software.
1167 *
1168 * @IEEE80211_HW_SCAN_WHILE_IDLE: The device can do hw scan while
1169 * being idle (i.e. mac80211 doesn't have to go idle-off during the
1170 * the scan).
1148 */ 1171 */
1149enum ieee80211_hw_flags { 1172enum ieee80211_hw_flags {
1150 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, 1173 IEEE80211_HW_HAS_RATE_CONTROL = 1<<0,
@@ -1171,6 +1194,7 @@ enum ieee80211_hw_flags {
1171 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1194 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1172 IEEE80211_HW_AP_LINK_PS = 1<<22, 1195 IEEE80211_HW_AP_LINK_PS = 1<<22,
1173 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1196 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
1197 IEEE80211_HW_SCAN_WHILE_IDLE = 1<<24,
1174}; 1198};
1175 1199
1176/** 1200/**
@@ -1974,6 +1998,13 @@ enum ieee80211_frame_release_type {
1974 * in AP mode, this callback will not be called when the flag 1998 * in AP mode, this callback will not be called when the flag
1975 * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic. 1999 * %IEEE80211_HW_AP_LINK_PS is set. Must be atomic.
1976 * 2000 *
2001 * @sta_state: Notifies low level driver about state transition of a
2002 * station (which can be the AP, a client, IBSS/WDS/mesh peer etc.)
2003 * This callback is mutually exclusive with @sta_add/@sta_remove.
2004 * It must not fail for down transitions but may fail for transitions
2005 * up the list of states.
2006 * The callback can sleep.
2007 *
1977 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 2008 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1978 * bursting) for a hardware TX queue. 2009 * bursting) for a hardware TX queue.
1979 * Returns a negative error code on failure. 2010 * Returns a negative error code on failure.
@@ -2193,6 +2224,10 @@ struct ieee80211_ops {
2193 struct ieee80211_sta *sta); 2224 struct ieee80211_sta *sta);
2194 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2225 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2195 enum sta_notify_cmd, struct ieee80211_sta *sta); 2226 enum sta_notify_cmd, struct ieee80211_sta *sta);
2227 int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2228 struct ieee80211_sta *sta,
2229 enum ieee80211_sta_state old_state,
2230 enum ieee80211_sta_state new_state);
2196 int (*conf_tx)(struct ieee80211_hw *hw, 2231 int (*conf_tx)(struct ieee80211_hw *hw,
2197 struct ieee80211_vif *vif, u16 queue, 2232 struct ieee80211_vif *vif, u16 queue,
2198 const struct ieee80211_tx_queue_params *params); 2233 const struct ieee80211_tx_queue_params *params);