28 #include <linux/module.h>
31 #include <asm/unaligned.h>
38 #define VERSION "1.11"
40 static bool disable_cfc;
41 static bool l2cap_ertm;
42 static int channel_mtu = -1;
48 #define rfcomm_lock() mutex_lock(&rfcomm_mutex)
49 #define rfcomm_unlock() mutex_unlock(&rfcomm_mutex)
75 #define __get_dlci(b) ((b & 0xfc) >> 2)
76 #define __get_channel(b) ((b & 0xf8) >> 3)
77 #define __get_dir(b) ((b & 0x04) >> 2)
78 #define __get_type(b) ((b & 0xef))
80 #define __test_ea(b) ((b & 0x01))
81 #define __test_cr(b) ((b & 0x02))
82 #define __test_pf(b) ((b & 0x10))
84 #define __addr(cr, dlci) (((dlci & 0x3f) << 2) | (cr << 1) | 0x01)
85 #define __ctrl(type, pf) (((type & 0xef) | (pf << 4)))
86 #define __dlci(dir, chn) (((chn & 0x1f) << 1) | dir)
87 #define __srv_channel(dlci) (dlci >> 1)
88 #define __dir(dlci) (dlci & 0x01)
90 #define __len8(len) (((len) << 1) | 1)
91 #define __len16(len) ((len) << 1)
94 #define __mcc_type(cr, type) (((type << 2) | (cr << 1) | 0x01))
95 #define __get_mcc_type(b) ((b & 0xfc) >> 2)
96 #define __get_mcc_len(b) ((b & 0xfe) >> 1)
99 #define __rpn_line_settings(data, stop, parity) ((data & 0x3) | ((stop & 0x1) << 2) | ((parity & 0x7) << 3))
100 #define __get_rpn_data_bits(line) ((line) & 0x3)
101 #define __get_rpn_stop_bits(line) (((line) >> 2) & 0x1)
102 #define __get_rpn_parity(line) (((line) >> 3) & 0x7)
104 static void rfcomm_schedule(
void)
114 rfcomm_session_del(s);
120 static unsigned char rfcomm_crc_table[256] = {
121 0x00, 0x91, 0xe3, 0x72, 0x07, 0x96, 0xe4, 0x75,
122 0x0e, 0x9f, 0xed, 0x7c, 0x09, 0x98, 0xea, 0x7b,
123 0x1c, 0x8d, 0xff, 0x6e, 0x1b, 0x8a, 0xf8, 0x69,
124 0x12, 0x83, 0xf1, 0x60, 0x15, 0x84, 0xf6, 0x67,
126 0x38, 0xa9, 0xdb, 0x4a, 0x3f, 0xae, 0xdc, 0x4d,
127 0x36, 0xa7, 0xd5, 0x44, 0x31, 0xa0, 0xd2, 0x43,
128 0x24, 0xb5, 0xc7, 0x56, 0x23, 0xb2, 0xc0, 0x51,
129 0x2a, 0xbb, 0xc9, 0x58, 0x2d, 0xbc, 0xce, 0x5f,
131 0x70, 0xe1, 0x93, 0x02, 0x77, 0xe6, 0x94, 0x05,
132 0x7e, 0xef, 0x9d, 0x0c, 0x79, 0xe8, 0x9a, 0x0b,
133 0x6c, 0xfd, 0x8f, 0x1e, 0x6b, 0xfa, 0x88, 0x19,
134 0x62, 0xf3, 0x81, 0x10, 0x65, 0xf4, 0x86, 0x17,
136 0x48, 0xd9, 0xab, 0x3a, 0x4f, 0xde, 0xac, 0x3d,
137 0x46, 0xd7, 0xa5, 0x34, 0x41, 0xd0, 0xa2, 0x33,
138 0x54, 0xc5, 0xb7, 0x26, 0x53, 0xc2, 0xb0, 0x21,
139 0x5a, 0xcb, 0xb9, 0x28, 0x5d, 0xcc, 0xbe, 0x2f,
141 0xe0, 0x71, 0x03, 0x92, 0xe7, 0x76, 0x04, 0x95,
142 0xee, 0x7f, 0x0d, 0x9c, 0xe9, 0x78, 0x0a, 0x9b,
143 0xfc, 0x6d, 0x1f, 0x8e, 0xfb, 0x6a, 0x18, 0x89,
144 0xf2, 0x63, 0x11, 0x80, 0xf5, 0x64, 0x16, 0x87,
146 0xd8, 0x49, 0x3b, 0xaa, 0xdf, 0x4e, 0x3c, 0xad,
147 0xd6, 0x47, 0x35, 0xa4, 0xd1, 0x40, 0x32, 0xa3,
148 0xc4, 0x55, 0x27, 0xb6, 0xc3, 0x52, 0x20, 0xb1,
149 0xca, 0x5b, 0x29, 0xb8, 0xcd, 0x5c, 0x2e, 0xbf,
151 0x90, 0x01, 0x73, 0xe2, 0x97, 0x06, 0x74, 0xe5,
152 0x9e, 0x0f, 0x7d, 0xec, 0x99, 0x08, 0x7a, 0xeb,
153 0x8c, 0x1d, 0x6f, 0xfe, 0x8b, 0x1a, 0x68, 0xf9,
154 0x82, 0x13, 0x61, 0xf0, 0x85, 0x14, 0x66, 0xf7,
156 0xa8, 0x39, 0x4b, 0xda, 0xaf, 0x3e, 0x4c, 0xdd,
157 0xa6, 0x37, 0x45, 0xd4, 0xa1, 0x30, 0x42, 0xd3,
158 0xb4, 0x25, 0x57, 0xc6, 0xb3, 0x22, 0x50, 0xc1,
159 0xba, 0x2b, 0x59, 0xc8, 0xbd, 0x2c, 0x5e, 0xcf
163 #define __crc(data) (rfcomm_crc_table[rfcomm_crc_table[0xff ^ data[0]] ^ data[1]])
168 return 0xff -
__crc(data);
174 return 0xff - rfcomm_crc_table[
__crc(data) ^ data[2]];
183 f = rfcomm_crc_table[f ^ data[2]];
185 return rfcomm_crc_table[f ^
fcs] != 0xcf;
189 static void rfcomm_l2state_change(
struct sock *
sk)
191 BT_DBG(
"%p state %d", sk, sk->sk_state);
195 static void rfcomm_l2data_ready(
struct sock *
sk,
int bytes)
197 BT_DBG(
"%p bytes %d", sk, bytes);
201 static int rfcomm_l2sock_create(
struct socket **
sock)
209 struct sock *
sk = (*sock)->sk;
216 static int rfcomm_check_security(
struct rfcomm_dlc *
d)
238 static void rfcomm_session_timeout(
unsigned long arg)
248 static void rfcomm_session_set_timer(
struct rfcomm_session *s,
long timeout)
250 BT_DBG(
"session %p state %ld timeout %ld", s, s->
state, timeout);
253 rfcomm_session_hold(s);
261 rfcomm_session_put(s);
265 static void rfcomm_dlc_timeout(
unsigned long arg)
276 static void rfcomm_dlc_set_timer(
struct rfcomm_dlc *d,
long timeout)
278 BT_DBG(
"dlc %p state %ld timeout %ld", d, d->
state, timeout);
284 static void rfcomm_dlc_clear_timer(
struct rfcomm_dlc *d)
292 static void rfcomm_dlc_clear_state(
struct rfcomm_dlc *d)
309 struct rfcomm_dlc *d = kzalloc(
sizeof(*d), prio);
316 skb_queue_head_init(&d->tx_queue);
320 rfcomm_dlc_clear_state(d);
337 BT_DBG(
"dlc %p session %p", d, s);
339 rfcomm_session_hold(s);
341 rfcomm_session_clear_timer(s);
347 static void rfcomm_dlc_unlink(
struct rfcomm_dlc *d)
357 if (list_empty(&s->
dlcs))
360 rfcomm_session_put(s);
380 BT_DBG(
"dlc %p state %ld %s %s channel %d",
389 s = rfcomm_session_get(src, dst);
391 s = rfcomm_session_create(src, dst, d->sec_level, &err);
399 if (rfcomm_dlc_get(s, dlci))
402 rfcomm_dlc_clear_state(d);
409 rfcomm_dlc_link(s, d);
417 if (rfcomm_check_security(d))
418 rfcomm_send_pn(s, 1, d);
434 r = __rfcomm_dlc_open(d, src, dst, channel);
440 static int __rfcomm_dlc_close(
struct rfcomm_dlc *d,
int err)
446 BT_DBG(
"dlc %p state %ld dlci %d err %d session %p",
461 if (skb_queue_empty(&d->
tx_queue)) {
462 rfcomm_send_disc(s, d->
dlci);
465 rfcomm_queue_disc(d);
480 rfcomm_dlc_clear_timer(d);
488 rfcomm_dlc_unlink(d);
500 r = __rfcomm_dlc_close(d, err);
513 BT_DBG(
"dlc %p mtu %d len %d", d, d->
mtu, len);
518 rfcomm_make_uih(skb, d->
addr);
555 BT_DBG(
"dlc %p state %ld v24_sig 0x%x",
556 d, d->
state, v24_sig);
573 BT_DBG(
"dlc %p state %ld v24_sig 0x%x",
588 BT_DBG(
"session %p sock %p", s, sock);
592 INIT_LIST_HEAD(&s->
dlcs);
607 list_add(&s->
list, &session_list);
614 int state = s->
state;
621 rfcomm_send_disc(s, 0);
623 rfcomm_session_clear_timer(s);
631 static struct rfcomm_session *rfcomm_session_get(bdaddr_t *src, bdaddr_t *dst)
641 !bacmp(&sk->
dst, dst))
647 static void rfcomm_session_close(
struct rfcomm_session *s,
int err)
652 BT_DBG(
"session %p state %ld err %d", s, s->
state, err);
654 rfcomm_session_hold(s);
662 __rfcomm_dlc_close(d, err);
665 rfcomm_session_clear_timer(s);
666 rfcomm_session_put(s);
669 static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
681 *err = rfcomm_l2sock_create(&sock);
685 bacpy(&
addr.l2_bdaddr, src);
696 l2cap_pi(sk)->chan->imtu = l2cap_mtu;
697 l2cap_pi(sk)->chan->sec_level = sec_level;
702 s = rfcomm_session_add(sock,
BT_BOUND);
710 bacpy(&
addr.l2_bdaddr, dst);
718 rfcomm_session_del(s);
728 struct sock *sk = s->
sock->sk;
730 bacpy(src, &
bt_sk(sk)->src);
732 bacpy(dst, &
bt_sk(sk)->dst);
741 BT_DBG(
"session %p len %d", s, len);
752 return rfcomm_send_frame(s, (
void *) cmd,
sizeof(*cmd));
759 BT_DBG(
"%p dlci %d", s, dlci);
764 cmd.
fcs = __fcs2((
u8 *) &cmd);
766 return rfcomm_send_cmd(s, &cmd);
773 BT_DBG(
"%p dlci %d", s, dlci);
778 cmd.
fcs = __fcs2((
u8 *) &cmd);
780 return rfcomm_send_cmd(s, &cmd);
787 BT_DBG(
"%p dlci %d", s, dlci);
792 cmd.
fcs = __fcs2((
u8 *) &cmd);
794 return rfcomm_send_cmd(s, &cmd);
797 static int rfcomm_queue_disc(
struct rfcomm_dlc *d)
808 cmd = (
void *) __skb_put(skb,
sizeof(*cmd));
812 cmd->
fcs = __fcs2((
u8 *) cmd);
823 BT_DBG(
"%p dlci %d", s, dlci);
828 cmd.
fcs = __fcs2((
u8 *) &cmd);
830 return rfcomm_send_cmd(s, &cmd);
839 BT_DBG(
"%p cr %d type %d", s, cr, type);
841 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
846 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
853 *ptr = __fcs(buf); ptr++;
855 return rfcomm_send_frame(s, buf, ptr - buf);
863 u8 buf[16], *ptr =
buf;
867 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
870 hdr->
len =
__len8(
sizeof(*mcc) +
sizeof(*pn));
872 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
876 pn = (
void *) ptr; ptr +=
sizeof(*pn);
890 if (cr && channel_mtu >= 0)
895 *ptr = __fcs(buf); ptr++;
897 return rfcomm_send_frame(s, buf, ptr - buf);
902 u8 parity,
u8 flow_ctrl_settings,
903 u8 xon_char,
u8 xoff_char,
u16 param_mask)
908 u8 buf[16], *ptr =
buf;
910 BT_DBG(
"%p cr %d dlci %d bit_r 0x%x data_b 0x%x stop_b 0x%x parity 0x%x"
911 " flwc_s 0x%x xon_c 0x%x xoff_c 0x%x p_mask 0x%x",
912 s, cr, dlci, bit_rate, data_bits, stop_bits, parity,
913 flow_ctrl_settings, xon_char, xoff_char, param_mask);
915 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
918 hdr->
len =
__len8(
sizeof(*mcc) +
sizeof(*rpn));
920 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
924 rpn = (
void *) ptr; ptr +=
sizeof(*rpn);
933 *ptr = __fcs(buf); ptr++;
935 return rfcomm_send_frame(s, buf, ptr - buf);
943 u8 buf[16], *ptr =
buf;
945 BT_DBG(
"%p cr %d status 0x%x", s, cr, status);
947 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
950 hdr->
len =
__len8(
sizeof(*mcc) +
sizeof(*rls));
952 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
956 rls = (
void *) ptr; ptr +=
sizeof(*rls);
960 *ptr = __fcs(buf); ptr++;
962 return rfcomm_send_frame(s, buf, ptr - buf);
970 u8 buf[16], *ptr =
buf;
972 BT_DBG(
"%p cr %d v24 0x%x", s, cr, v24_sig);
974 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
977 hdr->
len =
__len8(
sizeof(*mcc) +
sizeof(*msc));
979 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
983 msc = (
void *) ptr; ptr +=
sizeof(*msc);
987 *ptr = __fcs(buf); ptr++;
989 return rfcomm_send_frame(s, buf, ptr - buf);
996 u8 buf[16], *ptr =
buf;
998 BT_DBG(
"%p cr %d", s, cr);
1000 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
1005 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
1009 *ptr = __fcs(buf); ptr++;
1011 return rfcomm_send_frame(s, buf, ptr - buf);
1018 u8 buf[16], *ptr =
buf;
1020 BT_DBG(
"%p cr %d", s, cr);
1022 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
1027 mcc = (
void *) ptr; ptr +=
sizeof(*mcc);
1031 *ptr = __fcs(buf); ptr++;
1033 return rfcomm_send_frame(s, buf, ptr - buf);
1041 unsigned char hdr[5],
crc[1];
1046 BT_DBG(
"%p cr %d", s, cr);
1050 hdr[2] = 0x01 | ((len + 2) << 1);
1051 hdr[3] = 0x01 | ((cr & 0x01) << 1) | (
RFCOMM_TEST << 2);
1052 hdr[4] = 0x01 | (len << 1);
1054 crc[0] = __fcs(hdr);
1071 u8 buf[16], *ptr =
buf;
1073 BT_DBG(
"%p addr %d credits %d", s, addr, credits);
1075 hdr = (
void *) ptr; ptr +=
sizeof(*hdr);
1080 *ptr = credits; ptr++;
1082 *ptr = __fcs(buf); ptr++;
1084 return rfcomm_send_frame(s, buf, ptr - buf);
1104 *crc = __fcs((
void *) hdr);
1110 BT_DBG(
"session %p state %ld dlci %d", s, s->
state, dlci);
1114 struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci);
1116 rfcomm_send_dm(s, dlci);
1122 rfcomm_dlc_clear_timer(d);
1129 rfcomm_send_msc(s, 1, dlci, d->
v24_sig);
1134 __rfcomm_dlc_close(d, 0);
1136 if (list_empty(&s->
dlcs)) {
1138 rfcomm_send_disc(s, 0);
1139 rfcomm_session_clear_timer(s);
1149 rfcomm_process_connect(s);
1175 BT_DBG(
"session %p state %ld dlci %d", s, s->
state, dlci);
1179 struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci);
1187 __rfcomm_dlc_close(d, err);
1196 rfcomm_session_close(s, err);
1205 BT_DBG(
"session %p state %ld dlci %d", s, s->
state, dlci);
1208 struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci);
1210 rfcomm_send_ua(s, dlci);
1218 __rfcomm_dlc_close(d, err);
1220 rfcomm_send_dm(s, dlci);
1223 rfcomm_send_ua(s, 0);
1231 rfcomm_session_close(s, err);
1239 struct sock *sk = d->
session->sock->sk;
1246 rfcomm_dlc_clear_timer(d);
1259 static void rfcomm_check_accept(
struct rfcomm_dlc *d)
1261 if (rfcomm_check_security(d)) {
1283 BT_DBG(
"session %p state %ld dlci %d", s, s->
state, dlci);
1286 rfcomm_send_ua(s, 0);
1290 rfcomm_process_connect(s);
1296 d = rfcomm_dlc_get(s, dlci);
1300 rfcomm_check_accept(d);
1310 rfcomm_dlc_link(s, d);
1312 rfcomm_check_accept(d);
1314 rfcomm_send_dm(s, dlci);
1324 BT_DBG(
"dlc %p state %ld dlci %d mtu %d fc 0x%x credits %d",
1343 if (cr && d->
mtu > s->
mtu)
1355 BT_DBG(
"session %p state %ld dlci %d", s, s->
state, dlci);
1360 d = rfcomm_dlc_get(s, dlci);
1364 rfcomm_apply_pn(d, cr, pn);
1365 rfcomm_send_pn(s, 0, d);
1370 rfcomm_apply_pn(d, cr, pn);
1373 rfcomm_send_sabm(s, d->
dlci);
1388 rfcomm_dlc_link(s, d);
1390 rfcomm_apply_pn(d, cr, pn);
1393 rfcomm_send_pn(s, 0, d);
1395 rfcomm_send_dm(s, dlci);
1415 BT_DBG(
"dlci %d cr %d len 0x%x bitr 0x%x line 0x%x flow 0x%x xonc 0x%x xoffc 0x%x pm 0x%x",
1440 BT_DBG(
"RPN bit rate mismatch 0x%x", bit_rate);
1449 BT_DBG(
"RPN data bits mismatch 0x%x", data_bits);
1458 BT_DBG(
"RPN stop bits mismatch 0x%x", stop_bits);
1467 BT_DBG(
"RPN parity mismatch 0x%x", parity);
1476 BT_DBG(
"RPN flow ctrl mismatch 0x%x", flow_ctrl);
1485 BT_DBG(
"RPN XON char mismatch 0x%x", xon_char);
1494 BT_DBG(
"RPN XOFF char mismatch 0x%x", xoff_char);
1502 parity, flow_ctrl, xon_char, xoff_char, rpn_mask);
1512 BT_DBG(
"dlci %d cr %d status 0x%x", dlci, cr, rls->
status);
1521 rfcomm_send_rls(s, 0, dlci, rls->
status);
1534 d = rfcomm_dlc_get(s, dlci);
1553 rfcomm_send_msc(s, 0, dlci, msc->
v24_sig);
1571 BT_DBG(
"%p type 0x%x cr %d", s, type, cr);
1577 rfcomm_recv_pn(s, cr, skb);
1581 rfcomm_recv_rpn(s, cr, len, skb);
1585 rfcomm_recv_rls(s, cr, skb);
1589 rfcomm_recv_msc(s, cr, skb);
1595 rfcomm_send_fcoff(s, 0);
1602 rfcomm_send_fcon(s, 0);
1608 rfcomm_send_test(s, 0, skb->
data, skb->
len);
1615 BT_ERR(
"Unknown control type 0x%02x", type);
1616 rfcomm_send_nsc(s, cr, type);
1626 BT_DBG(
"session %p state %ld dlci %d pf %d", s, s->
state, dlci, pf);
1628 d = rfcomm_dlc_get(s, dlci);
1630 rfcomm_send_dm(s, dlci);
1665 fcs = *(
u8 *)skb_tail_pointer(skb);
1667 if (__check_fcs(skb->
data, type, fcs)) {
1668 BT_ERR(
"bad checksum in packet");
1681 rfcomm_recv_sabm(s, dlci);
1686 rfcomm_recv_disc(s, dlci);
1691 rfcomm_recv_ua(s, dlci);
1695 rfcomm_recv_dm(s, dlci);
1700 return rfcomm_recv_data(s, dlci,
__test_pf(hdr->
ctrl), skb);
1702 rfcomm_recv_mcc(s, skb);
1706 BT_ERR(
"Unknown packet type 0x%02x", type);
1726 if (rfcomm_check_security(d)) {
1727 rfcomm_send_pn(s, 1, d);
1739 static int rfcomm_process_tx(
struct rfcomm_dlc *d)
1744 BT_DBG(
"dlc %p state %ld cfc %d rx_credits %d tx_credits %d",
1766 return skb_queue_len(&d->
tx_queue);
1784 return skb_queue_len(&d->
tx_queue);
1808 rfcomm_dlc_clear_timer(d);
1810 rfcomm_send_pn(s, 1, d);
1826 rfcomm_dlc_clear_timer(d);
1828 rfcomm_send_dm(s, d->
dlci);
1843 rfcomm_process_tx(d);
1850 struct sock *sk = sock->
sk;
1858 if (!skb_linearize(skb))
1859 rfcomm_recv_frame(s, skb);
1866 rfcomm_session_put(s);
1868 rfcomm_session_close(s, sk->
sk_err);
1879 if (list_empty(&
bt_sk(sock->
sk)->accept_q))
1889 nsock->sk->sk_data_ready = rfcomm_l2data_ready;
1890 nsock->sk->sk_state_change = rfcomm_l2state_change;
1892 s = rfcomm_session_add(nsock,
BT_OPEN);
1894 rfcomm_session_hold(s);
1899 l2cap_pi(nsock->sk)->chan->imtu) - 5;
1908 struct sock *sk = s->
sock->sk;
1912 switch (sk->sk_state) {
1920 rfcomm_send_sabm(s, 0);
1925 rfcomm_session_close(s, sk->
sk_err);
1930 static void rfcomm_process_sessions(
void)
1942 rfcomm_send_disc(s, 0);
1943 rfcomm_session_put(s);
1948 rfcomm_accept_connection(s);
1952 rfcomm_session_hold(s);
1956 rfcomm_check_connection(s);
1960 rfcomm_process_rx(s);
1964 rfcomm_process_dlcs(s);
1966 rfcomm_session_put(s);
1972 static int rfcomm_add_listener(bdaddr_t *ba)
1981 err = rfcomm_l2sock_create(&sock);
1983 BT_ERR(
"Create socket failed %d", err);
1988 bacpy(&addr.l2_bdaddr, ba);
1994 BT_ERR(
"Bind failed %d", err);
2001 l2cap_pi(sk)->chan->imtu = l2cap_mtu;
2007 BT_ERR(
"Listen failed %d", err);
2012 s = rfcomm_session_add(sock,
BT_LISTEN);
2016 rfcomm_session_hold(s);
2023 static void rfcomm_kill_listener(
void)
2032 rfcomm_session_del(s);
2036 static int rfcomm_run(
void *
unused)
2051 rfcomm_process_sessions();
2057 rfcomm_kill_listener();
2068 BT_DBG(
"conn %p status 0x%02x encrypt 0x%02x", conn, status, encrypt);
2070 s = rfcomm_session_get(&conn->
hdev->bdaddr, &conn->
dst);
2074 rfcomm_session_hold(s);
2080 rfcomm_dlc_clear_timer(d);
2081 if (status || encrypt == 0x00) {
2107 rfcomm_session_put(s);
2112 static struct hci_cb rfcomm_cb = {
2114 .security_cfm = rfcomm_security_cfm
2117 static int rfcomm_dlc_debugfs_show(
struct seq_file *f,
void *
x)
2126 struct sock *sk = s->
sock->sk;
2147 .open = rfcomm_dlc_debugfs_open,
2153 static struct dentry *rfcomm_dlc_debugfs;
2156 static int __init rfcomm_init(
void)
2162 rfcomm_thread =
kthread_run(rfcomm_run, NULL,
"krfcommd");
2163 if (IS_ERR(rfcomm_thread)) {
2164 err = PTR_ERR(rfcomm_thread);
2171 if (!rfcomm_dlc_debugfs)
2172 BT_ERR(
"Failed to create RFCOMM debug file");
2199 static void __exit rfcomm_exit(
void)