aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-20 07:37:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-22 05:59:41 -0400
commit4e8402a3f884427f9233ba436459c158d1f2e114 (patch)
tree3853523eaba309ea8aff89ed4868770cf82d40b2 /include/net
parent861d6882b3dfe1710b35dbddf1b395b962061413 (diff)
[Bluetooth] Retrieve L2CAP features mask on connection setup
The Bluetooth 1.2 specification introduced a specific features mask value to interoperate with newer versions of the specification. So far this piece of information was never needed, but future extensions will rely on it. This patch adds a generic way to retrieve this information only once per connection setup. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/l2cap.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index f7bcd1f782cb..e1ea64085c4f 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -29,7 +29,8 @@
29#define L2CAP_DEFAULT_MTU 672 29#define L2CAP_DEFAULT_MTU 672
30#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF 30#define L2CAP_DEFAULT_FLUSH_TO 0xFFFF
31 31
32#define L2CAP_CONN_TIMEOUT (HZ * 40) 32#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
33#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
33 34
34/* L2CAP socket address */ 35/* L2CAP socket address */
35struct sockaddr_l2 { 36struct sockaddr_l2 {
@@ -160,7 +161,6 @@ struct l2cap_disconn_rsp {
160 161
161struct l2cap_info_req { 162struct l2cap_info_req {
162 __le16 type; 163 __le16 type;
163 __u8 data[0];
164} __attribute__ ((packed)); 164} __attribute__ ((packed));
165 165
166struct l2cap_info_rsp { 166struct l2cap_info_rsp {
@@ -192,6 +192,13 @@ struct l2cap_conn {
192 192
193 unsigned int mtu; 193 unsigned int mtu;
194 194
195 __u32 feat_mask;
196
197 __u8 info_state;
198 __u8 info_ident;
199
200 struct timer_list info_timer;
201
195 spinlock_t lock; 202 spinlock_t lock;
196 203
197 struct sk_buff *rx_skb; 204 struct sk_buff *rx_skb;
@@ -202,6 +209,9 @@ struct l2cap_conn {
202 struct l2cap_chan_list chan_list; 209 struct l2cap_chan_list chan_list;
203}; 210};
204 211
212#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01
213#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x02
214
205/* ----- L2CAP channel and socket info ----- */ 215/* ----- L2CAP channel and socket info ----- */
206#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) 216#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
207 217