1*1da177e4SLinus Torvalds /* 2*1da177e4SLinus Torvalds RFCOMM implementation for Linux Bluetooth stack (BlueZ). 3*1da177e4SLinus Torvalds Copyright (C) 2002 Maxim Krasnyansky <maxk@qualcomm.com> 4*1da177e4SLinus Torvalds Copyright (C) 2002 Marcel Holtmann <marcel@holtmann.org> 5*1da177e4SLinus Torvalds 6*1da177e4SLinus Torvalds This program is free software; you can redistribute it and/or modify 7*1da177e4SLinus Torvalds it under the terms of the GNU General Public License version 2 as 8*1da177e4SLinus Torvalds published by the Free Software Foundation; 9*1da177e4SLinus Torvalds 10*1da177e4SLinus Torvalds THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 11*1da177e4SLinus Torvalds OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 12*1da177e4SLinus Torvalds FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. 13*1da177e4SLinus Torvalds IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY 14*1da177e4SLinus Torvalds CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 15*1da177e4SLinus Torvalds WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16*1da177e4SLinus Torvalds ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17*1da177e4SLinus Torvalds OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18*1da177e4SLinus Torvalds 19*1da177e4SLinus Torvalds ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 20*1da177e4SLinus Torvalds COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 21*1da177e4SLinus Torvalds SOFTWARE IS DISCLAIMED. 22*1da177e4SLinus Torvalds */ 23*1da177e4SLinus Torvalds 24*1da177e4SLinus Torvalds #ifndef __RFCOMM_H 25*1da177e4SLinus Torvalds #define __RFCOMM_H 26*1da177e4SLinus Torvalds 27*1da177e4SLinus Torvalds #define RFCOMM_PSM 3 28*1da177e4SLinus Torvalds 29*1da177e4SLinus Torvalds #define RFCOMM_CONN_TIMEOUT (HZ * 30) 30*1da177e4SLinus Torvalds #define RFCOMM_DISC_TIMEOUT (HZ * 20) 31*1da177e4SLinus Torvalds #define RFCOMM_AUTH_TIMEOUT (HZ * 25) 32*1da177e4SLinus Torvalds 33*1da177e4SLinus Torvalds #define RFCOMM_DEFAULT_MTU 127 34*1da177e4SLinus Torvalds #define RFCOMM_DEFAULT_CREDITS 7 35*1da177e4SLinus Torvalds 36*1da177e4SLinus Torvalds #define RFCOMM_MAX_L2CAP_MTU 1024 37*1da177e4SLinus Torvalds #define RFCOMM_MAX_CREDITS 40 38*1da177e4SLinus Torvalds 39*1da177e4SLinus Torvalds #define RFCOMM_SKB_HEAD_RESERVE 8 40*1da177e4SLinus Torvalds #define RFCOMM_SKB_TAIL_RESERVE 2 41*1da177e4SLinus Torvalds #define RFCOMM_SKB_RESERVE (RFCOMM_SKB_HEAD_RESERVE + RFCOMM_SKB_TAIL_RESERVE) 42*1da177e4SLinus Torvalds 43*1da177e4SLinus Torvalds #define RFCOMM_SABM 0x2f 44*1da177e4SLinus Torvalds #define RFCOMM_DISC 0x43 45*1da177e4SLinus Torvalds #define RFCOMM_UA 0x63 46*1da177e4SLinus Torvalds #define RFCOMM_DM 0x0f 47*1da177e4SLinus Torvalds #define RFCOMM_UIH 0xef 48*1da177e4SLinus Torvalds 49*1da177e4SLinus Torvalds #define RFCOMM_TEST 0x08 50*1da177e4SLinus Torvalds #define RFCOMM_FCON 0x28 51*1da177e4SLinus Torvalds #define RFCOMM_FCOFF 0x18 52*1da177e4SLinus Torvalds #define RFCOMM_MSC 0x38 53*1da177e4SLinus Torvalds #define RFCOMM_RPN 0x24 54*1da177e4SLinus Torvalds #define RFCOMM_RLS 0x14 55*1da177e4SLinus Torvalds #define RFCOMM_PN 0x20 56*1da177e4SLinus Torvalds #define RFCOMM_NSC 0x04 57*1da177e4SLinus Torvalds 58*1da177e4SLinus Torvalds #define RFCOMM_V24_FC 0x02 59*1da177e4SLinus Torvalds #define RFCOMM_V24_RTC 0x04 60*1da177e4SLinus Torvalds #define RFCOMM_V24_RTR 0x08 61*1da177e4SLinus Torvalds #define RFCOMM_V24_IC 0x40 62*1da177e4SLinus Torvalds #define RFCOMM_V24_DV 0x80 63*1da177e4SLinus Torvalds 64*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_2400 0x0 65*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_4800 0x1 66*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_7200 0x2 67*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_9600 0x3 68*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_19200 0x4 69*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_38400 0x5 70*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_57600 0x6 71*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_115200 0x7 72*1da177e4SLinus Torvalds #define RFCOMM_RPN_BR_230400 0x8 73*1da177e4SLinus Torvalds 74*1da177e4SLinus Torvalds #define RFCOMM_RPN_DATA_5 0x0 75*1da177e4SLinus Torvalds #define RFCOMM_RPN_DATA_6 0x1 76*1da177e4SLinus Torvalds #define RFCOMM_RPN_DATA_7 0x2 77*1da177e4SLinus Torvalds #define RFCOMM_RPN_DATA_8 0x3 78*1da177e4SLinus Torvalds 79*1da177e4SLinus Torvalds #define RFCOMM_RPN_STOP_1 0 80*1da177e4SLinus Torvalds #define RFCOMM_RPN_STOP_15 1 81*1da177e4SLinus Torvalds 82*1da177e4SLinus Torvalds #define RFCOMM_RPN_PARITY_NONE 0x0 83*1da177e4SLinus Torvalds #define RFCOMM_RPN_PARITY_ODD 0x4 84*1da177e4SLinus Torvalds #define RFCOMM_RPN_PARITY_EVEN 0x5 85*1da177e4SLinus Torvalds #define RFCOMM_RPN_PARITY_MARK 0x6 86*1da177e4SLinus Torvalds #define RFCOMM_RPN_PARITY_SPACE 0x7 87*1da177e4SLinus Torvalds 88*1da177e4SLinus Torvalds #define RFCOMM_RPN_FLOW_NONE 0x00 89*1da177e4SLinus Torvalds 90*1da177e4SLinus Torvalds #define RFCOMM_RPN_XON_CHAR 0x11 91*1da177e4SLinus Torvalds #define RFCOMM_RPN_XOFF_CHAR 0x13 92*1da177e4SLinus Torvalds 93*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_BITRATE 0x0001 94*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_DATA 0x0002 95*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_STOP 0x0004 96*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_PARITY 0x0008 97*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_PARITY_TYPE 0x0010 98*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_XON 0x0020 99*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_XOFF 0x0040 100*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_FLOW 0x3F00 101*1da177e4SLinus Torvalds 102*1da177e4SLinus Torvalds #define RFCOMM_RPN_PM_ALL 0x3F7F 103*1da177e4SLinus Torvalds 104*1da177e4SLinus Torvalds struct rfcomm_hdr { 105*1da177e4SLinus Torvalds u8 addr; 106*1da177e4SLinus Torvalds u8 ctrl; 107*1da177e4SLinus Torvalds u8 len; // Actual size can be 2 bytes 108*1da177e4SLinus Torvalds } __attribute__ ((packed)); 109*1da177e4SLinus Torvalds 110*1da177e4SLinus Torvalds struct rfcomm_cmd { 111*1da177e4SLinus Torvalds u8 addr; 112*1da177e4SLinus Torvalds u8 ctrl; 113*1da177e4SLinus Torvalds u8 len; 114*1da177e4SLinus Torvalds u8 fcs; 115*1da177e4SLinus Torvalds } __attribute__ ((packed)); 116*1da177e4SLinus Torvalds 117*1da177e4SLinus Torvalds struct rfcomm_mcc { 118*1da177e4SLinus Torvalds u8 type; 119*1da177e4SLinus Torvalds u8 len; 120*1da177e4SLinus Torvalds } __attribute__ ((packed)); 121*1da177e4SLinus Torvalds 122*1da177e4SLinus Torvalds struct rfcomm_pn { 123*1da177e4SLinus Torvalds u8 dlci; 124*1da177e4SLinus Torvalds u8 flow_ctrl; 125*1da177e4SLinus Torvalds u8 priority; 126*1da177e4SLinus Torvalds u8 ack_timer; 127*1da177e4SLinus Torvalds u16 mtu; 128*1da177e4SLinus Torvalds u8 max_retrans; 129*1da177e4SLinus Torvalds u8 credits; 130*1da177e4SLinus Torvalds } __attribute__ ((packed)); 131*1da177e4SLinus Torvalds 132*1da177e4SLinus Torvalds struct rfcomm_rpn { 133*1da177e4SLinus Torvalds u8 dlci; 134*1da177e4SLinus Torvalds u8 bit_rate; 135*1da177e4SLinus Torvalds u8 line_settings; 136*1da177e4SLinus Torvalds u8 flow_ctrl; 137*1da177e4SLinus Torvalds u8 xon_char; 138*1da177e4SLinus Torvalds u8 xoff_char; 139*1da177e4SLinus Torvalds u16 param_mask; 140*1da177e4SLinus Torvalds } __attribute__ ((packed)); 141*1da177e4SLinus Torvalds 142*1da177e4SLinus Torvalds struct rfcomm_rls { 143*1da177e4SLinus Torvalds u8 dlci; 144*1da177e4SLinus Torvalds u8 status; 145*1da177e4SLinus Torvalds } __attribute__ ((packed)); 146*1da177e4SLinus Torvalds 147*1da177e4SLinus Torvalds struct rfcomm_msc { 148*1da177e4SLinus Torvalds u8 dlci; 149*1da177e4SLinus Torvalds u8 v24_sig; 150*1da177e4SLinus Torvalds } __attribute__ ((packed)); 151*1da177e4SLinus Torvalds 152*1da177e4SLinus Torvalds /* ---- Core structures, flags etc ---- */ 153*1da177e4SLinus Torvalds 154*1da177e4SLinus Torvalds struct rfcomm_session { 155*1da177e4SLinus Torvalds struct list_head list; 156*1da177e4SLinus Torvalds struct socket *sock; 157*1da177e4SLinus Torvalds unsigned long state; 158*1da177e4SLinus Torvalds unsigned long flags; 159*1da177e4SLinus Torvalds atomic_t refcnt; 160*1da177e4SLinus Torvalds int initiator; 161*1da177e4SLinus Torvalds 162*1da177e4SLinus Torvalds /* Default DLC parameters */ 163*1da177e4SLinus Torvalds int cfc; 164*1da177e4SLinus Torvalds uint mtu; 165*1da177e4SLinus Torvalds 166*1da177e4SLinus Torvalds struct list_head dlcs; 167*1da177e4SLinus Torvalds }; 168*1da177e4SLinus Torvalds 169*1da177e4SLinus Torvalds struct rfcomm_dlc { 170*1da177e4SLinus Torvalds struct list_head list; 171*1da177e4SLinus Torvalds struct rfcomm_session *session; 172*1da177e4SLinus Torvalds struct sk_buff_head tx_queue; 173*1da177e4SLinus Torvalds struct timer_list timer; 174*1da177e4SLinus Torvalds 175*1da177e4SLinus Torvalds spinlock_t lock; 176*1da177e4SLinus Torvalds unsigned long state; 177*1da177e4SLinus Torvalds unsigned long flags; 178*1da177e4SLinus Torvalds atomic_t refcnt; 179*1da177e4SLinus Torvalds u8 dlci; 180*1da177e4SLinus Torvalds u8 addr; 181*1da177e4SLinus Torvalds u8 priority; 182*1da177e4SLinus Torvalds u8 v24_sig; 183*1da177e4SLinus Torvalds u8 mscex; 184*1da177e4SLinus Torvalds 185*1da177e4SLinus Torvalds u32 link_mode; 186*1da177e4SLinus Torvalds 187*1da177e4SLinus Torvalds uint mtu; 188*1da177e4SLinus Torvalds uint cfc; 189*1da177e4SLinus Torvalds uint rx_credits; 190*1da177e4SLinus Torvalds uint tx_credits; 191*1da177e4SLinus Torvalds 192*1da177e4SLinus Torvalds void *owner; 193*1da177e4SLinus Torvalds 194*1da177e4SLinus Torvalds void (*data_ready)(struct rfcomm_dlc *d, struct sk_buff *skb); 195*1da177e4SLinus Torvalds void (*state_change)(struct rfcomm_dlc *d, int err); 196*1da177e4SLinus Torvalds void (*modem_status)(struct rfcomm_dlc *d, u8 v24_sig); 197*1da177e4SLinus Torvalds }; 198*1da177e4SLinus Torvalds 199*1da177e4SLinus Torvalds /* DLC and session flags */ 200*1da177e4SLinus Torvalds #define RFCOMM_RX_THROTTLED 0 201*1da177e4SLinus Torvalds #define RFCOMM_TX_THROTTLED 1 202*1da177e4SLinus Torvalds #define RFCOMM_TIMED_OUT 2 203*1da177e4SLinus Torvalds #define RFCOMM_MSC_PENDING 3 204*1da177e4SLinus Torvalds #define RFCOMM_AUTH_PENDING 4 205*1da177e4SLinus Torvalds #define RFCOMM_AUTH_ACCEPT 5 206*1da177e4SLinus Torvalds #define RFCOMM_AUTH_REJECT 6 207*1da177e4SLinus Torvalds 208*1da177e4SLinus Torvalds /* Scheduling flags and events */ 209*1da177e4SLinus Torvalds #define RFCOMM_SCHED_STATE 0 210*1da177e4SLinus Torvalds #define RFCOMM_SCHED_RX 1 211*1da177e4SLinus Torvalds #define RFCOMM_SCHED_TX 2 212*1da177e4SLinus Torvalds #define RFCOMM_SCHED_TIMEO 3 213*1da177e4SLinus Torvalds #define RFCOMM_SCHED_AUTH 4 214*1da177e4SLinus Torvalds #define RFCOMM_SCHED_WAKEUP 31 215*1da177e4SLinus Torvalds 216*1da177e4SLinus Torvalds /* MSC exchange flags */ 217*1da177e4SLinus Torvalds #define RFCOMM_MSCEX_TX 1 218*1da177e4SLinus Torvalds #define RFCOMM_MSCEX_RX 2 219*1da177e4SLinus Torvalds #define RFCOMM_MSCEX_OK (RFCOMM_MSCEX_TX + RFCOMM_MSCEX_RX) 220*1da177e4SLinus Torvalds 221*1da177e4SLinus Torvalds /* CFC states */ 222*1da177e4SLinus Torvalds #define RFCOMM_CFC_UNKNOWN -1 223*1da177e4SLinus Torvalds #define RFCOMM_CFC_DISABLED 0 224*1da177e4SLinus Torvalds #define RFCOMM_CFC_ENABLED RFCOMM_MAX_CREDITS 225*1da177e4SLinus Torvalds 226*1da177e4SLinus Torvalds /* ---- RFCOMM DLCs (channels) ---- */ 227*1da177e4SLinus Torvalds struct rfcomm_dlc *rfcomm_dlc_alloc(int prio); 228*1da177e4SLinus Torvalds void rfcomm_dlc_free(struct rfcomm_dlc *d); 229*1da177e4SLinus Torvalds int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel); 230*1da177e4SLinus Torvalds int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason); 231*1da177e4SLinus Torvalds int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb); 232*1da177e4SLinus Torvalds int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig); 233*1da177e4SLinus Torvalds int rfcomm_dlc_get_modem_status(struct rfcomm_dlc *d, u8 *v24_sig); 234*1da177e4SLinus Torvalds 235*1da177e4SLinus Torvalds #define rfcomm_dlc_lock(d) spin_lock(&d->lock) 236*1da177e4SLinus Torvalds #define rfcomm_dlc_unlock(d) spin_unlock(&d->lock) 237*1da177e4SLinus Torvalds 238*1da177e4SLinus Torvalds static inline void rfcomm_dlc_hold(struct rfcomm_dlc *d) 239*1da177e4SLinus Torvalds { 240*1da177e4SLinus Torvalds atomic_inc(&d->refcnt); 241*1da177e4SLinus Torvalds } 242*1da177e4SLinus Torvalds 243*1da177e4SLinus Torvalds static inline void rfcomm_dlc_put(struct rfcomm_dlc *d) 244*1da177e4SLinus Torvalds { 245*1da177e4SLinus Torvalds if (atomic_dec_and_test(&d->refcnt)) 246*1da177e4SLinus Torvalds rfcomm_dlc_free(d); 247*1da177e4SLinus Torvalds } 248*1da177e4SLinus Torvalds 249*1da177e4SLinus Torvalds extern void FASTCALL(__rfcomm_dlc_throttle(struct rfcomm_dlc *d)); 250*1da177e4SLinus Torvalds extern void FASTCALL(__rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)); 251*1da177e4SLinus Torvalds 252*1da177e4SLinus Torvalds static inline void rfcomm_dlc_throttle(struct rfcomm_dlc *d) 253*1da177e4SLinus Torvalds { 254*1da177e4SLinus Torvalds if (!test_and_set_bit(RFCOMM_RX_THROTTLED, &d->flags)) 255*1da177e4SLinus Torvalds __rfcomm_dlc_throttle(d); 256*1da177e4SLinus Torvalds } 257*1da177e4SLinus Torvalds 258*1da177e4SLinus Torvalds static inline void rfcomm_dlc_unthrottle(struct rfcomm_dlc *d) 259*1da177e4SLinus Torvalds { 260*1da177e4SLinus Torvalds if (test_and_clear_bit(RFCOMM_RX_THROTTLED, &d->flags)) 261*1da177e4SLinus Torvalds __rfcomm_dlc_unthrottle(d); 262*1da177e4SLinus Torvalds } 263*1da177e4SLinus Torvalds 264*1da177e4SLinus Torvalds /* ---- RFCOMM sessions ---- */ 265*1da177e4SLinus Torvalds void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *dst); 266*1da177e4SLinus Torvalds 267*1da177e4SLinus Torvalds static inline void rfcomm_session_hold(struct rfcomm_session *s) 268*1da177e4SLinus Torvalds { 269*1da177e4SLinus Torvalds atomic_inc(&s->refcnt); 270*1da177e4SLinus Torvalds } 271*1da177e4SLinus Torvalds 272*1da177e4SLinus Torvalds /* ---- RFCOMM chechsum ---- */ 273*1da177e4SLinus Torvalds extern u8 rfcomm_crc_table[]; 274*1da177e4SLinus Torvalds 275*1da177e4SLinus Torvalds /* ---- RFCOMM sockets ---- */ 276*1da177e4SLinus Torvalds struct sockaddr_rc { 277*1da177e4SLinus Torvalds sa_family_t rc_family; 278*1da177e4SLinus Torvalds bdaddr_t rc_bdaddr; 279*1da177e4SLinus Torvalds u8 rc_channel; 280*1da177e4SLinus Torvalds }; 281*1da177e4SLinus Torvalds 282*1da177e4SLinus Torvalds #define RFCOMM_CONNINFO 0x02 283*1da177e4SLinus Torvalds struct rfcomm_conninfo { 284*1da177e4SLinus Torvalds __u16 hci_handle; 285*1da177e4SLinus Torvalds __u8 dev_class[3]; 286*1da177e4SLinus Torvalds }; 287*1da177e4SLinus Torvalds 288*1da177e4SLinus Torvalds #define RFCOMM_LM 0x03 289*1da177e4SLinus Torvalds #define RFCOMM_LM_MASTER 0x0001 290*1da177e4SLinus Torvalds #define RFCOMM_LM_AUTH 0x0002 291*1da177e4SLinus Torvalds #define RFCOMM_LM_ENCRYPT 0x0004 292*1da177e4SLinus Torvalds #define RFCOMM_LM_TRUSTED 0x0008 293*1da177e4SLinus Torvalds #define RFCOMM_LM_RELIABLE 0x0010 294*1da177e4SLinus Torvalds #define RFCOMM_LM_SECURE 0x0020 295*1da177e4SLinus Torvalds 296*1da177e4SLinus Torvalds #define rfcomm_pi(sk) ((struct rfcomm_pinfo *) sk) 297*1da177e4SLinus Torvalds 298*1da177e4SLinus Torvalds struct rfcomm_pinfo { 299*1da177e4SLinus Torvalds struct bt_sock bt; 300*1da177e4SLinus Torvalds struct rfcomm_dlc *dlc; 301*1da177e4SLinus Torvalds u8 channel; 302*1da177e4SLinus Torvalds u32 link_mode; 303*1da177e4SLinus Torvalds }; 304*1da177e4SLinus Torvalds 305*1da177e4SLinus Torvalds int rfcomm_init_sockets(void); 306*1da177e4SLinus Torvalds void rfcomm_cleanup_sockets(void); 307*1da177e4SLinus Torvalds 308*1da177e4SLinus Torvalds int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc **d); 309*1da177e4SLinus Torvalds 310*1da177e4SLinus Torvalds /* ---- RFCOMM TTY ---- */ 311*1da177e4SLinus Torvalds #define RFCOMM_MAX_DEV 256 312*1da177e4SLinus Torvalds 313*1da177e4SLinus Torvalds #define RFCOMMCREATEDEV _IOW('R', 200, int) 314*1da177e4SLinus Torvalds #define RFCOMMRELEASEDEV _IOW('R', 201, int) 315*1da177e4SLinus Torvalds #define RFCOMMGETDEVLIST _IOR('R', 210, int) 316*1da177e4SLinus Torvalds #define RFCOMMGETDEVINFO _IOR('R', 211, int) 317*1da177e4SLinus Torvalds #define RFCOMMSTEALDLC _IOW('R', 220, int) 318*1da177e4SLinus Torvalds 319*1da177e4SLinus Torvalds #define RFCOMM_REUSE_DLC 0 320*1da177e4SLinus Torvalds #define RFCOMM_RELEASE_ONHUP 1 321*1da177e4SLinus Torvalds #define RFCOMM_HANGUP_NOW 2 322*1da177e4SLinus Torvalds #define RFCOMM_TTY_ATTACHED 3 323*1da177e4SLinus Torvalds 324*1da177e4SLinus Torvalds struct rfcomm_dev_req { 325*1da177e4SLinus Torvalds s16 dev_id; 326*1da177e4SLinus Torvalds u32 flags; 327*1da177e4SLinus Torvalds bdaddr_t src; 328*1da177e4SLinus Torvalds bdaddr_t dst; 329*1da177e4SLinus Torvalds u8 channel; 330*1da177e4SLinus Torvalds 331*1da177e4SLinus Torvalds }; 332*1da177e4SLinus Torvalds 333*1da177e4SLinus Torvalds struct rfcomm_dev_info { 334*1da177e4SLinus Torvalds s16 id; 335*1da177e4SLinus Torvalds u32 flags; 336*1da177e4SLinus Torvalds u16 state; 337*1da177e4SLinus Torvalds bdaddr_t src; 338*1da177e4SLinus Torvalds bdaddr_t dst; 339*1da177e4SLinus Torvalds u8 channel; 340*1da177e4SLinus Torvalds }; 341*1da177e4SLinus Torvalds 342*1da177e4SLinus Torvalds struct rfcomm_dev_list_req { 343*1da177e4SLinus Torvalds u16 dev_num; 344*1da177e4SLinus Torvalds struct rfcomm_dev_info dev_info[0]; 345*1da177e4SLinus Torvalds }; 346*1da177e4SLinus Torvalds 347*1da177e4SLinus Torvalds int rfcomm_dev_ioctl(struct sock *sk, unsigned int cmd, void __user *arg); 348*1da177e4SLinus Torvalds int rfcomm_init_ttys(void); 349*1da177e4SLinus Torvalds void rfcomm_cleanup_ttys(void); 350*1da177e4SLinus Torvalds 351*1da177e4SLinus Torvalds extern struct proc_dir_entry *proc_bt_rfcomm; 352*1da177e4SLinus Torvalds 353*1da177e4SLinus Torvalds #endif /* __RFCOMM_H */ 354