diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-10-30 04:09:48 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-10-30 04:09:48 -0400 |
commit | 6fb47de9cf1be4710fb9f364c500ff216fb47b34 (patch) | |
tree | e638cd1de972e7120dff9200efe71ce1b4ca3805 /include | |
parent | 1041638f2bba0f1de75e66086d50fb1251d64dcf (diff) | |
parent | ab3d59d265e772e734c36fe738809cb1a910f566 (diff) |
Merge remote-tracking branch 'wireless-next/master' into mac80211-next
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bcma/bcma.h | 2 | ||||
-rw-r--r-- | include/linux/bcma/bcma_driver_chipcommon.h | 5 | ||||
-rw-r--r-- | include/linux/bcma/bcma_driver_mips.h | 3 | ||||
-rw-r--r-- | include/linux/bcma/bcma_regs.h | 5 | ||||
-rw-r--r-- | include/linux/ssb/ssb_driver_mips.h | 10 | ||||
-rw-r--r-- | include/net/bluetooth/a2mp.h | 24 | ||||
-rw-r--r-- | include/net/bluetooth/amp.h | 50 | ||||
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 1 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 40 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 48 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 14 | ||||
-rw-r--r-- | include/net/cfg80211.h | 10 | ||||
-rw-r--r-- | include/net/nfc/hci.h | 18 | ||||
-rw-r--r-- | include/net/nfc/nfc.h | 2 | ||||
-rw-r--r-- | include/uapi/linux/nfc.h | 15 |
15 files changed, 229 insertions, 18 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 4180eb78d575..fd15d9829705 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -251,7 +251,7 @@ struct bcma_bus { | |||
251 | u8 num; | 251 | u8 num; |
252 | 252 | ||
253 | struct bcma_drv_cc drv_cc; | 253 | struct bcma_drv_cc drv_cc; |
254 | struct bcma_drv_pci drv_pci; | 254 | struct bcma_drv_pci drv_pci[2]; |
255 | struct bcma_drv_mips drv_mips; | 255 | struct bcma_drv_mips drv_mips; |
256 | struct bcma_drv_gmac_cmn drv_gmac_cmn; | 256 | struct bcma_drv_gmac_cmn drv_gmac_cmn; |
257 | 257 | ||
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 1cf1749440ac..145f3c56227f 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -510,6 +510,7 @@ struct bcma_chipcommon_pmu { | |||
510 | 510 | ||
511 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 511 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
512 | struct bcma_pflash { | 512 | struct bcma_pflash { |
513 | bool present; | ||
513 | u8 buswidth; | 514 | u8 buswidth; |
514 | u32 window; | 515 | u32 window; |
515 | u32 window_size; | 516 | u32 window_size; |
@@ -532,6 +533,7 @@ struct mtd_info; | |||
532 | 533 | ||
533 | struct bcma_nflash { | 534 | struct bcma_nflash { |
534 | bool present; | 535 | bool present; |
536 | bool boot; /* This is the flash the SoC boots from */ | ||
535 | 537 | ||
536 | struct mtd_info *mtd; | 538 | struct mtd_info *mtd; |
537 | }; | 539 | }; |
@@ -552,6 +554,7 @@ struct bcma_drv_cc { | |||
552 | u32 capabilities; | 554 | u32 capabilities; |
553 | u32 capabilities_ext; | 555 | u32 capabilities_ext; |
554 | u8 setup_done:1; | 556 | u8 setup_done:1; |
557 | u8 early_setup_done:1; | ||
555 | /* Fast Powerup Delay constant */ | 558 | /* Fast Powerup Delay constant */ |
556 | u16 fast_pwrup_delay; | 559 | u16 fast_pwrup_delay; |
557 | struct bcma_chipcommon_pmu pmu; | 560 | struct bcma_chipcommon_pmu pmu; |
@@ -583,6 +586,7 @@ struct bcma_drv_cc { | |||
583 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) | 586 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) |
584 | 587 | ||
585 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); | 588 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); |
589 | extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); | ||
586 | 590 | ||
587 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); | 591 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); |
588 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); | 592 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); |
@@ -606,6 +610,7 @@ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); | |||
606 | 610 | ||
607 | /* PMU support */ | 611 | /* PMU support */ |
608 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); | 612 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); |
613 | extern void bcma_pmu_early_init(struct bcma_drv_cc *cc); | ||
609 | 614 | ||
610 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, | 615 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, |
611 | u32 value); | 616 | u32 value); |
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h index c0043645cdcb..0baf8a56b794 100644 --- a/include/linux/bcma/bcma_driver_mips.h +++ b/include/linux/bcma/bcma_driver_mips.h | |||
@@ -35,13 +35,16 @@ struct bcma_device; | |||
35 | struct bcma_drv_mips { | 35 | struct bcma_drv_mips { |
36 | struct bcma_device *core; | 36 | struct bcma_device *core; |
37 | u8 setup_done:1; | 37 | u8 setup_done:1; |
38 | u8 early_setup_done:1; | ||
38 | unsigned int assigned_irqs; | 39 | unsigned int assigned_irqs; |
39 | }; | 40 | }; |
40 | 41 | ||
41 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 42 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
42 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); | 43 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); |
44 | extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore); | ||
43 | #else | 45 | #else |
44 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } | 46 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } |
47 | static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { } | ||
45 | #endif | 48 | #endif |
46 | 49 | ||
47 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); | 50 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index 6c9cb93ae3de..7e8104bb7a7e 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -85,6 +85,9 @@ | |||
85 | * (2 ZettaBytes), high 32 bits | 85 | * (2 ZettaBytes), high 32 bits |
86 | */ | 86 | */ |
87 | 87 | ||
88 | #define BCMA_SFLASH 0x1c000000 | 88 | #define BCMA_SOC_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */ |
89 | #define BCMA_SOC_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */ | ||
90 | #define BCMA_SOC_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */ | ||
91 | #define BCMA_SOC_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */ | ||
89 | 92 | ||
90 | #endif /* LINUX_BCMA_REGS_H_ */ | 93 | #endif /* LINUX_BCMA_REGS_H_ */ |
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index 5f44e9740cd2..07a9c7a2e088 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -13,6 +13,12 @@ struct ssb_serial_port { | |||
13 | unsigned int reg_shift; | 13 | unsigned int reg_shift; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct ssb_pflash { | ||
17 | bool present; | ||
18 | u8 buswidth; | ||
19 | u32 window; | ||
20 | u32 window_size; | ||
21 | }; | ||
16 | 22 | ||
17 | struct ssb_mipscore { | 23 | struct ssb_mipscore { |
18 | struct ssb_device *dev; | 24 | struct ssb_device *dev; |
@@ -20,9 +26,7 @@ struct ssb_mipscore { | |||
20 | int nr_serial_ports; | 26 | int nr_serial_ports; |
21 | struct ssb_serial_port serial_ports[4]; | 27 | struct ssb_serial_port serial_ports[4]; |
22 | 28 | ||
23 | u8 flash_buswidth; | 29 | struct ssb_pflash pflash; |
24 | u32 flash_window; | ||
25 | u32 flash_window_size; | ||
26 | }; | 30 | }; |
27 | 31 | ||
28 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); | 32 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h index 6a76e0a0705e..42f21766c538 100644 --- a/include/net/bluetooth/a2mp.h +++ b/include/net/bluetooth/a2mp.h | |||
@@ -19,13 +19,25 @@ | |||
19 | 19 | ||
20 | #define A2MP_FEAT_EXT 0x8000 | 20 | #define A2MP_FEAT_EXT 0x8000 |
21 | 21 | ||
22 | enum amp_mgr_state { | ||
23 | READ_LOC_AMP_INFO, | ||
24 | READ_LOC_AMP_ASSOC, | ||
25 | READ_LOC_AMP_ASSOC_FINAL, | ||
26 | }; | ||
27 | |||
22 | struct amp_mgr { | 28 | struct amp_mgr { |
29 | struct list_head list; | ||
23 | struct l2cap_conn *l2cap_conn; | 30 | struct l2cap_conn *l2cap_conn; |
24 | struct l2cap_chan *a2mp_chan; | 31 | struct l2cap_chan *a2mp_chan; |
32 | struct l2cap_chan *bredr_chan; | ||
25 | struct kref kref; | 33 | struct kref kref; |
26 | __u8 ident; | 34 | __u8 ident; |
27 | __u8 handle; | 35 | __u8 handle; |
36 | enum amp_mgr_state state; | ||
28 | unsigned long flags; | 37 | unsigned long flags; |
38 | |||
39 | struct list_head amp_ctrls; | ||
40 | struct mutex amp_ctrls_lock; | ||
29 | }; | 41 | }; |
30 | 42 | ||
31 | struct a2mp_cmd { | 43 | struct a2mp_cmd { |
@@ -118,9 +130,19 @@ struct a2mp_physlink_rsp { | |||
118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | 130 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 |
119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | 131 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 |
120 | 132 | ||
121 | void amp_mgr_get(struct amp_mgr *mgr); | 133 | extern struct list_head amp_mgr_list; |
134 | extern struct mutex amp_mgr_list_lock; | ||
135 | |||
136 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); | ||
122 | int amp_mgr_put(struct amp_mgr *mgr); | 137 | int amp_mgr_put(struct amp_mgr *mgr); |
138 | u8 __next_ident(struct amp_mgr *mgr); | ||
123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | 139 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, |
124 | struct sk_buff *skb); | 140 | struct sk_buff *skb); |
141 | struct amp_mgr *amp_mgr_lookup_by_state(u8 state); | ||
142 | void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data); | ||
143 | void a2mp_discover_amp(struct l2cap_chan *chan); | ||
144 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | ||
145 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | ||
146 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | ||
125 | 147 | ||
126 | #endif /* __A2MP_H */ | 148 | #endif /* __A2MP_H */ |
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h new file mode 100644 index 000000000000..2e7c79ea0463 --- /dev/null +++ b/include/net/bluetooth/amp.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | Copyright (c) 2011,2012 Intel Corp. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License version 2 and | ||
6 | only version 2 as published by the Free Software Foundation. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef __AMP_H | ||
15 | #define __AMP_H | ||
16 | |||
17 | struct amp_ctrl { | ||
18 | struct list_head list; | ||
19 | struct kref kref; | ||
20 | __u8 id; | ||
21 | __u16 assoc_len_so_far; | ||
22 | __u16 assoc_rem_len; | ||
23 | __u16 assoc_len; | ||
24 | __u8 *assoc; | ||
25 | }; | ||
26 | |||
27 | int amp_ctrl_put(struct amp_ctrl *ctrl); | ||
28 | void amp_ctrl_get(struct amp_ctrl *ctrl); | ||
29 | struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); | ||
30 | struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); | ||
31 | void amp_ctrl_list_flush(struct amp_mgr *mgr); | ||
32 | |||
33 | struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
34 | u8 remote_id, bool out); | ||
35 | |||
36 | int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); | ||
37 | |||
38 | void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
39 | void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); | ||
40 | void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
41 | void amp_read_loc_assoc_final_data(struct hci_dev *hdev, | ||
42 | struct hci_conn *hcon); | ||
43 | void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
44 | struct hci_conn *hcon); | ||
45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
46 | struct hci_conn *hcon); | ||
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | ||
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | ||
49 | |||
50 | #endif /* __AMP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index ede036977ae8..2554b3f5222a 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -180,7 +180,6 @@ static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) | |||
180 | } | 180 | } |
181 | 181 | ||
182 | void baswap(bdaddr_t *dst, bdaddr_t *src); | 182 | void baswap(bdaddr_t *dst, bdaddr_t *src); |
183 | char *batostr(bdaddr_t *ba); | ||
184 | 183 | ||
185 | /* Common socket structures and functions */ | 184 | /* Common socket structures and functions */ |
186 | 185 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 76b2b6bdcf36..88cbbda61027 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #define HCI_LINK_KEY_SIZE 16 | 33 | #define HCI_LINK_KEY_SIZE 16 |
34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | 34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) |
35 | 35 | ||
36 | #define HCI_MAX_AMP_ASSOC_SIZE 672 | ||
37 | |||
36 | /* HCI dev events */ | 38 | /* HCI dev events */ |
37 | #define HCI_DEV_REG 1 | 39 | #define HCI_DEV_REG 1 |
38 | #define HCI_DEV_UNREG 2 | 40 | #define HCI_DEV_UNREG 2 |
@@ -196,6 +198,7 @@ enum { | |||
196 | #define ACL_START_NO_FLUSH 0x00 | 198 | #define ACL_START_NO_FLUSH 0x00 |
197 | #define ACL_CONT 0x01 | 199 | #define ACL_CONT 0x01 |
198 | #define ACL_START 0x02 | 200 | #define ACL_START 0x02 |
201 | #define ACL_COMPLETE 0x03 | ||
199 | #define ACL_ACTIVE_BCAST 0x04 | 202 | #define ACL_ACTIVE_BCAST 0x04 |
200 | #define ACL_PICO_BCAST 0x08 | 203 | #define ACL_PICO_BCAST 0x08 |
201 | 204 | ||
@@ -205,6 +208,7 @@ enum { | |||
205 | #define ESCO_LINK 0x02 | 208 | #define ESCO_LINK 0x02 |
206 | /* Low Energy links do not have defined link type. Use invented one */ | 209 | /* Low Energy links do not have defined link type. Use invented one */ |
207 | #define LE_LINK 0x80 | 210 | #define LE_LINK 0x80 |
211 | #define AMP_LINK 0x81 | ||
208 | 212 | ||
209 | /* LMP features */ | 213 | /* LMP features */ |
210 | #define LMP_3SLOT 0x01 | 214 | #define LMP_3SLOT 0x01 |
@@ -556,12 +560,46 @@ struct hci_cp_accept_phy_link { | |||
556 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | 560 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; |
557 | } __packed; | 561 | } __packed; |
558 | 562 | ||
559 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | 563 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 |
560 | struct hci_cp_disconn_phy_link { | 564 | struct hci_cp_disconn_phy_link { |
561 | __u8 phy_handle; | 565 | __u8 phy_handle; |
562 | __u8 reason; | 566 | __u8 reason; |
563 | } __packed; | 567 | } __packed; |
564 | 568 | ||
569 | struct ext_flow_spec { | ||
570 | __u8 id; | ||
571 | __u8 stype; | ||
572 | __le16 msdu; | ||
573 | __le32 sdu_itime; | ||
574 | __le32 acc_lat; | ||
575 | __le32 flush_to; | ||
576 | } __packed; | ||
577 | |||
578 | #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 | ||
579 | #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 | ||
580 | struct hci_cp_create_accept_logical_link { | ||
581 | __u8 phy_handle; | ||
582 | struct ext_flow_spec tx_flow_spec; | ||
583 | struct ext_flow_spec rx_flow_spec; | ||
584 | } __packed; | ||
585 | |||
586 | #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a | ||
587 | struct hci_cp_disconn_logical_link { | ||
588 | __le16 log_handle; | ||
589 | } __packed; | ||
590 | |||
591 | #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b | ||
592 | struct hci_cp_logical_link_cancel { | ||
593 | __u8 phy_handle; | ||
594 | __u8 flow_spec_id; | ||
595 | } __packed; | ||
596 | |||
597 | struct hci_rp_logical_link_cancel { | ||
598 | __u8 status; | ||
599 | __u8 phy_handle; | ||
600 | __u8 flow_spec_id; | ||
601 | } __packed; | ||
602 | |||
565 | #define HCI_OP_SNIFF_MODE 0x0803 | 603 | #define HCI_OP_SNIFF_MODE 0x0803 |
566 | struct hci_cp_sniff_mode { | 604 | struct hci_cp_sniff_mode { |
567 | __le16 handle; | 605 | __le16 handle; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e7d454609881..9fe8e2dec870 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -73,6 +73,7 @@ struct discovery_state { | |||
73 | struct hci_conn_hash { | 73 | struct hci_conn_hash { |
74 | struct list_head list; | 74 | struct list_head list; |
75 | unsigned int acl_num; | 75 | unsigned int acl_num; |
76 | unsigned int amp_num; | ||
76 | unsigned int sco_num; | 77 | unsigned int sco_num; |
77 | unsigned int le_num; | 78 | unsigned int le_num; |
78 | }; | 79 | }; |
@@ -124,6 +125,14 @@ struct le_scan_params { | |||
124 | 125 | ||
125 | #define HCI_MAX_SHORT_NAME_LENGTH 10 | 126 | #define HCI_MAX_SHORT_NAME_LENGTH 10 |
126 | 127 | ||
128 | struct amp_assoc { | ||
129 | __u16 len; | ||
130 | __u16 offset; | ||
131 | __u16 rem_len; | ||
132 | __u16 len_so_far; | ||
133 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; | ||
134 | }; | ||
135 | |||
127 | #define NUM_REASSEMBLY 4 | 136 | #define NUM_REASSEMBLY 4 |
128 | struct hci_dev { | 137 | struct hci_dev { |
129 | struct list_head list; | 138 | struct list_head list; |
@@ -177,6 +186,8 @@ struct hci_dev { | |||
177 | __u32 amp_max_flush_to; | 186 | __u32 amp_max_flush_to; |
178 | __u32 amp_be_flush_to; | 187 | __u32 amp_be_flush_to; |
179 | 188 | ||
189 | struct amp_assoc loc_assoc; | ||
190 | |||
180 | __u8 flow_ctl_mode; | 191 | __u8 flow_ctl_mode; |
181 | 192 | ||
182 | unsigned int auto_accept_delay; | 193 | unsigned int auto_accept_delay; |
@@ -252,8 +263,6 @@ struct hci_dev { | |||
252 | 263 | ||
253 | struct sk_buff_head driver_init; | 264 | struct sk_buff_head driver_init; |
254 | 265 | ||
255 | void *core_data; | ||
256 | |||
257 | atomic_t promisc; | 266 | atomic_t promisc; |
258 | 267 | ||
259 | struct dentry *debugfs; | 268 | struct dentry *debugfs; |
@@ -277,6 +286,8 @@ struct hci_dev { | |||
277 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); | 286 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); |
278 | }; | 287 | }; |
279 | 288 | ||
289 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) | ||
290 | |||
280 | struct hci_conn { | 291 | struct hci_conn { |
281 | struct list_head list; | 292 | struct list_head list; |
282 | 293 | ||
@@ -310,6 +321,7 @@ struct hci_conn { | |||
310 | 321 | ||
311 | __u8 remote_cap; | 322 | __u8 remote_cap; |
312 | __u8 remote_auth; | 323 | __u8 remote_auth; |
324 | __u8 remote_id; | ||
313 | bool flush_key; | 325 | bool flush_key; |
314 | 326 | ||
315 | unsigned int sent; | 327 | unsigned int sent; |
@@ -339,7 +351,7 @@ struct hci_conn { | |||
339 | 351 | ||
340 | struct hci_chan { | 352 | struct hci_chan { |
341 | struct list_head list; | 353 | struct list_head list; |
342 | 354 | __u16 handle; | |
343 | struct hci_conn *conn; | 355 | struct hci_conn *conn; |
344 | struct sk_buff_head data_q; | 356 | struct sk_buff_head data_q; |
345 | unsigned int sent; | 357 | unsigned int sent; |
@@ -438,6 +450,9 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) | |||
438 | case ACL_LINK: | 450 | case ACL_LINK: |
439 | h->acl_num++; | 451 | h->acl_num++; |
440 | break; | 452 | break; |
453 | case AMP_LINK: | ||
454 | h->amp_num++; | ||
455 | break; | ||
441 | case LE_LINK: | 456 | case LE_LINK: |
442 | h->le_num++; | 457 | h->le_num++; |
443 | break; | 458 | break; |
@@ -459,6 +474,9 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) | |||
459 | case ACL_LINK: | 474 | case ACL_LINK: |
460 | h->acl_num--; | 475 | h->acl_num--; |
461 | break; | 476 | break; |
477 | case AMP_LINK: | ||
478 | h->amp_num--; | ||
479 | break; | ||
462 | case LE_LINK: | 480 | case LE_LINK: |
463 | h->le_num--; | 481 | h->le_num--; |
464 | break; | 482 | break; |
@@ -475,6 +493,8 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) | |||
475 | switch (type) { | 493 | switch (type) { |
476 | case ACL_LINK: | 494 | case ACL_LINK: |
477 | return h->acl_num; | 495 | return h->acl_num; |
496 | case AMP_LINK: | ||
497 | return h->amp_num; | ||
478 | case LE_LINK: | 498 | case LE_LINK: |
479 | return h->le_num; | 499 | return h->le_num; |
480 | case SCO_LINK: | 500 | case SCO_LINK: |
@@ -556,6 +576,7 @@ void hci_conn_check_pending(struct hci_dev *hdev); | |||
556 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 576 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
557 | void hci_chan_del(struct hci_chan *chan); | 577 | void hci_chan_del(struct hci_chan *chan); |
558 | void hci_chan_list_flush(struct hci_conn *conn); | 578 | void hci_chan_list_flush(struct hci_conn *conn); |
579 | struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); | ||
559 | 580 | ||
560 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 581 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
561 | __u8 dst_type, __u8 sec_level, __u8 auth_type); | 582 | __u8 dst_type, __u8 sec_level, __u8 auth_type); |
@@ -584,7 +605,10 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
584 | 605 | ||
585 | if (atomic_dec_and_test(&conn->refcnt)) { | 606 | if (atomic_dec_and_test(&conn->refcnt)) { |
586 | unsigned long timeo; | 607 | unsigned long timeo; |
587 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { | 608 | |
609 | switch (conn->type) { | ||
610 | case ACL_LINK: | ||
611 | case LE_LINK: | ||
588 | del_timer(&conn->idle_timer); | 612 | del_timer(&conn->idle_timer); |
589 | if (conn->state == BT_CONNECTED) { | 613 | if (conn->state == BT_CONNECTED) { |
590 | timeo = conn->disc_timeout; | 614 | timeo = conn->disc_timeout; |
@@ -593,12 +617,20 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
593 | } else { | 617 | } else { |
594 | timeo = msecs_to_jiffies(10); | 618 | timeo = msecs_to_jiffies(10); |
595 | } | 619 | } |
596 | } else { | 620 | break; |
621 | |||
622 | case AMP_LINK: | ||
623 | timeo = conn->disc_timeout; | ||
624 | break; | ||
625 | |||
626 | default: | ||
597 | timeo = msecs_to_jiffies(10); | 627 | timeo = msecs_to_jiffies(10); |
628 | break; | ||
598 | } | 629 | } |
630 | |||
599 | cancel_delayed_work(&conn->disc_work); | 631 | cancel_delayed_work(&conn->disc_work); |
600 | queue_delayed_work(conn->hdev->workqueue, | 632 | queue_delayed_work(conn->hdev->workqueue, |
601 | &conn->disc_work, timeo); | 633 | &conn->disc_work, timeo); |
602 | } | 634 | } |
603 | } | 635 | } |
604 | 636 | ||
@@ -789,6 +821,10 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason) | |||
789 | sco_disconn_cfm(conn, reason); | 821 | sco_disconn_cfm(conn, reason); |
790 | break; | 822 | break; |
791 | 823 | ||
824 | /* L2CAP would be handled for BREDR chan */ | ||
825 | case AMP_LINK: | ||
826 | break; | ||
827 | |||
792 | default: | 828 | default: |
793 | BT_ERR("unknown link type %d", conn->type); | 829 | BT_ERR("unknown link type %d", conn->type); |
794 | break; | 830 | break; |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7ed8e356425a..6e23afdf65c1 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -32,13 +32,14 @@ | |||
32 | /* L2CAP defaults */ | 32 | /* L2CAP defaults */ |
33 | #define L2CAP_DEFAULT_MTU 672 | 33 | #define L2CAP_DEFAULT_MTU 672 |
34 | #define L2CAP_DEFAULT_MIN_MTU 48 | 34 | #define L2CAP_DEFAULT_MIN_MTU 48 |
35 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 35 | #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF |
36 | #define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF | ||
36 | #define L2CAP_DEFAULT_TX_WINDOW 63 | 37 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
37 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF | 38 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF |
38 | #define L2CAP_DEFAULT_MAX_TX 3 | 39 | #define L2CAP_DEFAULT_MAX_TX 3 |
39 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ | 40 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ |
40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 41 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 42 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */ |
42 | #define L2CAP_DEFAULT_ACK_TO 200 | 43 | #define L2CAP_DEFAULT_ACK_TO 200 |
43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
@@ -508,6 +509,8 @@ struct l2cap_chan { | |||
508 | __u32 remote_acc_lat; | 509 | __u32 remote_acc_lat; |
509 | __u32 remote_flush_to; | 510 | __u32 remote_flush_to; |
510 | 511 | ||
512 | __u8 ctrl_id; | ||
513 | |||
511 | struct delayed_work chan_timer; | 514 | struct delayed_work chan_timer; |
512 | struct delayed_work retrans_timer; | 515 | struct delayed_work retrans_timer; |
513 | struct delayed_work monitor_timer; | 516 | struct delayed_work monitor_timer; |
@@ -538,6 +541,7 @@ struct l2cap_ops { | |||
538 | void (*state_change) (struct l2cap_chan *chan, | 541 | void (*state_change) (struct l2cap_chan *chan, |
539 | int state); | 542 | int state); |
540 | void (*ready) (struct l2cap_chan *chan); | 543 | void (*ready) (struct l2cap_chan *chan); |
544 | void (*defer) (struct l2cap_chan *chan); | ||
541 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 545 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
542 | unsigned long len, int nb); | 546 | unsigned long len, int nb); |
543 | }; | 547 | }; |
@@ -745,6 +749,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) | |||
745 | { | 749 | { |
746 | } | 750 | } |
747 | 751 | ||
752 | static inline void l2cap_chan_no_defer(struct l2cap_chan *chan) | ||
753 | { | ||
754 | } | ||
755 | |||
748 | extern bool disable_ertm; | 756 | extern bool disable_ertm; |
749 | 757 | ||
750 | int l2cap_init_sockets(void); | 758 | int l2cap_init_sockets(void); |
@@ -767,6 +775,8 @@ int l2cap_chan_check_security(struct l2cap_chan *chan); | |||
767 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 775 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
768 | int l2cap_ertm_init(struct l2cap_chan *chan); | 776 | int l2cap_ertm_init(struct l2cap_chan *chan); |
769 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 777 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
778 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
770 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 779 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
780 | void l2cap_send_conn_req(struct l2cap_chan *chan); | ||
771 | 781 | ||
772 | #endif /* __L2CAP_H */ | 782 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index aa0e4a12308c..c6964572890f 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -1232,6 +1232,7 @@ struct cfg80211_deauth_request { | |||
1232 | const u8 *ie; | 1232 | const u8 *ie; |
1233 | size_t ie_len; | 1233 | size_t ie_len; |
1234 | u16 reason_code; | 1234 | u16 reason_code; |
1235 | bool local_state_change; | ||
1235 | }; | 1236 | }; |
1236 | 1237 | ||
1237 | /** | 1238 | /** |
@@ -2665,6 +2666,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
2665 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); | 2666 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
2666 | 2667 | ||
2667 | /** | 2668 | /** |
2669 | * ieee80211_get_mesh_hdrlen - get mesh extension header length | ||
2670 | * @meshhdr: the mesh extension header, only the flags field | ||
2671 | * (first byte) will be accessed | ||
2672 | * Returns the length of the extension header, which is always at | ||
2673 | * least 6 bytes and at most 18 if address 5 and 6 are present. | ||
2674 | */ | ||
2675 | unsigned int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr); | ||
2676 | |||
2677 | /** | ||
2668 | * DOC: Data path helpers | 2678 | * DOC: Data path helpers |
2669 | * | 2679 | * |
2670 | * In addition to generic utilities, cfg80211 also offers | 2680 | * In addition to generic utilities, cfg80211 also offers |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index e900072950cb..639f50af42df 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -24,6 +24,12 @@ | |||
24 | 24 | ||
25 | #include <net/nfc/nfc.h> | 25 | #include <net/nfc/nfc.h> |
26 | 26 | ||
27 | struct nfc_phy_ops { | ||
28 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
29 | int (*enable)(void *dev_id); | ||
30 | void (*disable)(void *dev_id); | ||
31 | }; | ||
32 | |||
27 | struct nfc_hci_dev; | 33 | struct nfc_hci_dev; |
28 | 34 | ||
29 | struct nfc_hci_ops { | 35 | struct nfc_hci_ops { |
@@ -38,15 +44,21 @@ struct nfc_hci_ops { | |||
38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 44 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
39 | int (*start_poll) (struct nfc_hci_dev *hdev, | 45 | int (*start_poll) (struct nfc_hci_dev *hdev, |
40 | u32 im_protocols, u32 tm_protocols); | 46 | u32 im_protocols, u32 tm_protocols); |
47 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, | ||
48 | u8 comm_mode, u8 *gb, size_t gb_len); | ||
49 | int (*dep_link_down)(struct nfc_hci_dev *hdev); | ||
41 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 50 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
42 | struct nfc_target *target); | 51 | struct nfc_target *target); |
43 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 52 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
44 | struct nfc_target *target); | 53 | struct nfc_target *target); |
45 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 54 | int (*im_transceive) (struct nfc_hci_dev *hdev, |
46 | struct nfc_target *target, struct sk_buff *skb, | 55 | struct nfc_target *target, struct sk_buff *skb, |
47 | data_exchange_cb_t cb, void *cb_context); | 56 | data_exchange_cb_t cb, void *cb_context); |
57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
48 | int (*check_presence)(struct nfc_hci_dev *hdev, | 58 | int (*check_presence)(struct nfc_hci_dev *hdev, |
49 | struct nfc_target *target); | 59 | struct nfc_target *target); |
60 | void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | ||
61 | struct sk_buff *skb); | ||
50 | }; | 62 | }; |
51 | 63 | ||
52 | /* Pipes */ | 64 | /* Pipes */ |
@@ -114,6 +126,9 @@ struct nfc_hci_dev { | |||
114 | int async_cb_type; | 126 | int async_cb_type; |
115 | data_exchange_cb_t async_cb; | 127 | data_exchange_cb_t async_cb; |
116 | void *async_cb_context; | 128 | void *async_cb_context; |
129 | |||
130 | u8 *gb; | ||
131 | size_t gb_len; | ||
117 | }; | 132 | }; |
118 | 133 | ||
119 | /* hci device allocation */ | 134 | /* hci device allocation */ |
@@ -219,5 +234,6 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
219 | const u8 *param, size_t param_len); | 234 | const u8 *param, size_t param_len); |
220 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 235 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
221 | const u8 *param, size_t param_len); | 236 | const u8 *param, size_t param_len); |
237 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | ||
222 | 238 | ||
223 | #endif /* __NET_HCI_H */ | 239 | #endif /* __NET_HCI_H */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f05b10682c9d..fce80b2f9be7 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -95,7 +95,7 @@ struct nfc_genl_data { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct nfc_dev { | 97 | struct nfc_dev { |
98 | unsigned int idx; | 98 | int idx; |
99 | u32 target_next_idx; | 99 | u32 target_next_idx; |
100 | struct nfc_target *targets; | 100 | struct nfc_target *targets; |
101 | int n_targets; | 101 | int n_targets; |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index d908d17da56d..0e63cee8d810 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
@@ -60,6 +60,13 @@ | |||
60 | * target mode. | 60 | * target mode. |
61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated |
62 | * from target mode. | 62 | * from target mode. |
63 | * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device | ||
64 | * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for | ||
65 | * a device. LTO must be set before the link is up otherwise -EINPROGRESS | ||
66 | * is returned. RW and MIUX can be set at anytime and will be passed in | ||
67 | * subsequent CONNECT and CC messages. | ||
68 | * If one of the passed parameters is wrong none is set and -EINVAL is | ||
69 | * returned. | ||
63 | */ | 70 | */ |
64 | enum nfc_commands { | 71 | enum nfc_commands { |
65 | NFC_CMD_UNSPEC, | 72 | NFC_CMD_UNSPEC, |
@@ -77,6 +84,8 @@ enum nfc_commands { | |||
77 | NFC_EVENT_TARGET_LOST, | 84 | NFC_EVENT_TARGET_LOST, |
78 | NFC_EVENT_TM_ACTIVATED, | 85 | NFC_EVENT_TM_ACTIVATED, |
79 | NFC_EVENT_TM_DEACTIVATED, | 86 | NFC_EVENT_TM_DEACTIVATED, |
87 | NFC_CMD_LLC_GET_PARAMS, | ||
88 | NFC_CMD_LLC_SET_PARAMS, | ||
80 | /* private: internal use only */ | 89 | /* private: internal use only */ |
81 | __NFC_CMD_AFTER_LAST | 90 | __NFC_CMD_AFTER_LAST |
82 | }; | 91 | }; |
@@ -102,6 +111,9 @@ enum nfc_commands { | |||
102 | * @NFC_ATTR_RF_MODE: Initiator or target | 111 | * @NFC_ATTR_RF_MODE: Initiator or target |
103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | 112 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for |
104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | 113 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for |
114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | ||
115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | ||
116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | ||
105 | */ | 117 | */ |
106 | enum nfc_attrs { | 118 | enum nfc_attrs { |
107 | NFC_ATTR_UNSPEC, | 119 | NFC_ATTR_UNSPEC, |
@@ -119,6 +131,9 @@ enum nfc_attrs { | |||
119 | NFC_ATTR_DEVICE_POWERED, | 131 | NFC_ATTR_DEVICE_POWERED, |
120 | NFC_ATTR_IM_PROTOCOLS, | 132 | NFC_ATTR_IM_PROTOCOLS, |
121 | NFC_ATTR_TM_PROTOCOLS, | 133 | NFC_ATTR_TM_PROTOCOLS, |
134 | NFC_ATTR_LLC_PARAM_LTO, | ||
135 | NFC_ATTR_LLC_PARAM_RW, | ||
136 | NFC_ATTR_LLC_PARAM_MIUX, | ||
122 | /* private: internal use only */ | 137 | /* private: internal use only */ |
123 | __NFC_ATTR_AFTER_LAST | 138 | __NFC_ATTR_AFTER_LAST |
124 | }; | 139 | }; |