Andrei Emeltchenko | be21871 | 2010-12-01 16:58:26 +0200 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
| 4 | |
| 5 | Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com> |
| 6 | |
| 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License version 2 as |
| 9 | published by the Free Software Foundation; |
| 10 | |
| 11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
Andrei Emeltchenko | be21871 | 2010-12-01 16:58:26 +0200 | [diff] [blame] | 15 | CLAIM, OR ANY SPECIAL 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 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 19 | |
Andrei Emeltchenko | be21871 | 2010-12-01 16:58:26 +0200 | [diff] [blame] | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | SOFTWARE IS DISCLAIMED. |
| 23 | */ |
| 24 | |
| 25 | #ifndef __SCO_H |
| 26 | #define __SCO_H |
| 27 | |
| 28 | /* SCO defaults */ |
| 29 | #define SCO_DEFAULT_MTU 500 |
| 30 | #define SCO_DEFAULT_FLUSH_TO 0xFFFF |
| 31 | |
| 32 | #define SCO_CONN_TIMEOUT (HZ * 40) |
| 33 | #define SCO_DISCONN_TIMEOUT (HZ * 2) |
| 34 | #define SCO_CONN_IDLE_TIMEOUT (HZ * 60) |
| 35 | |
| 36 | /* SCO socket address */ |
| 37 | struct sockaddr_sco { |
| 38 | sa_family_t sco_family; |
| 39 | bdaddr_t sco_bdaddr; |
| 40 | }; |
| 41 | |
| 42 | /* SCO socket options */ |
| 43 | #define SCO_OPTIONS 0x01 |
| 44 | struct sco_options { |
| 45 | __u16 mtu; |
| 46 | }; |
| 47 | |
| 48 | #define SCO_CONNINFO 0x02 |
| 49 | struct sco_conninfo { |
| 50 | __u16 hci_handle; |
| 51 | __u8 dev_class[3]; |
| 52 | }; |
| 53 | |
| 54 | /* ---- SCO connections ---- */ |
| 55 | struct sco_conn { |
| 56 | struct hci_conn *hcon; |
| 57 | |
Andrei Emeltchenko | 735cbc4 | 2010-12-01 16:58:22 +0200 | [diff] [blame] | 58 | bdaddr_t *dst; |
| 59 | bdaddr_t *src; |
| 60 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | spinlock_t lock; |
Andrei Emeltchenko | 735cbc4 | 2010-12-01 16:58:22 +0200 | [diff] [blame] | 62 | struct sock *sk; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | |
| 64 | unsigned int mtu; |
| 65 | }; |
| 66 | |
| 67 | #define sco_conn_lock(c) spin_lock(&c->lock); |
| 68 | #define sco_conn_unlock(c) spin_unlock(&c->lock); |
| 69 | |
| 70 | /* ----- SCO socket info ----- */ |
| 71 | #define sco_pi(sk) ((struct sco_pinfo *) sk) |
| 72 | |
| 73 | struct sco_pinfo { |
| 74 | struct bt_sock bt; |
| 75 | __u32 flags; |
| 76 | struct sco_conn *conn; |
| 77 | }; |
| 78 | |
| 79 | #endif /* __SCO_H */ |