diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-01-15 15:56:48 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-02-27 00:14:23 -0500 |
commit | bb23c0ab824653be4aa7dfca15b07b3059717004 (patch) | |
tree | bd0390c67d129e8b5ddc2a70a1b12e383db6fa16 /include | |
parent | c4f912e155504e94dd4f3d63c378dab0ff03dbda (diff) |
Bluetooth: Add support for deferring RFCOMM connection setup
In order to decide if listening RFCOMM sockets should be accept()ed
the BD_ADDR of the remote device needs to be known. This patch adds
a socket option which defines a timeout for deferring the actual
connection setup.
The connection setup is done after reading from the socket for the
first time. Until then writing to the socket returns ENOTCONN.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/net/bluetooth/rfcomm.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 4dc8d92a4638..71b45f459687 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
@@ -185,6 +185,7 @@ struct rfcomm_dlc { | |||
185 | u8 out; | 185 | u8 out; |
186 | 186 | ||
187 | u32 link_mode; | 187 | u32 link_mode; |
188 | u32 defer_setup; | ||
188 | 189 | ||
189 | uint mtu; | 190 | uint mtu; |
190 | uint cfc; | 191 | uint cfc; |
@@ -202,10 +203,11 @@ struct rfcomm_dlc { | |||
202 | #define RFCOMM_RX_THROTTLED 0 | 203 | #define RFCOMM_RX_THROTTLED 0 |
203 | #define RFCOMM_TX_THROTTLED 1 | 204 | #define RFCOMM_TX_THROTTLED 1 |
204 | #define RFCOMM_TIMED_OUT 2 | 205 | #define RFCOMM_TIMED_OUT 2 |
205 | #define RFCOMM_MSC_PENDING 3 | 206 | #define RFCOMM_MSC_PENDING 3 |
206 | #define RFCOMM_AUTH_PENDING 4 | 207 | #define RFCOMM_AUTH_PENDING 4 |
207 | #define RFCOMM_AUTH_ACCEPT 5 | 208 | #define RFCOMM_AUTH_ACCEPT 5 |
208 | #define RFCOMM_AUTH_REJECT 6 | 209 | #define RFCOMM_AUTH_REJECT 6 |
210 | #define RFCOMM_DEFER_SETUP 7 | ||
209 | 211 | ||
210 | /* Scheduling flags and events */ | 212 | /* Scheduling flags and events */ |
211 | #define RFCOMM_SCHED_STATE 0 | 213 | #define RFCOMM_SCHED_STATE 0 |
@@ -239,6 +241,7 @@ int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason); | |||
239 | int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb); | 241 | int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb); |
240 | int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig); | 242 | int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig); |
241 | int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig); | 243 | int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig); |
244 | void rfcomm_dlc_accept(struct rfcomm_dlc *d); | ||
242 | 245 | ||
243 | #define rfcomm_dlc_lock(d) spin_lock(&d->lock) | 246 | #define rfcomm_dlc_lock(d) spin_lock(&d->lock) |
244 | #define rfcomm_dlc_unlock(d) spin_unlock(&d->lock) | 247 | #define rfcomm_dlc_unlock(d) spin_unlock(&d->lock) |
@@ -333,7 +336,6 @@ struct rfcomm_dev_req { | |||
333 | bdaddr_t src; | 336 | bdaddr_t src; |
334 | bdaddr_t dst; | 337 | bdaddr_t dst; |
335 | u8 channel; | 338 | u8 channel; |
336 | |||
337 | }; | 339 | }; |
338 | 340 | ||
339 | struct rfcomm_dev_info { | 341 | struct rfcomm_dev_info { |