Lines Matching refs:chan

84 	struct l2cap_chan *chan = l2cap_pi(sk)->chan;  in l2cap_sock_bind()  local
130 bacpy(&chan->src, &la.l2_bdaddr); in l2cap_sock_bind()
131 chan->src_type = la.l2_bdaddr_type; in l2cap_sock_bind()
134 err = l2cap_add_scid(chan, __le16_to_cpu(la.l2_cid)); in l2cap_sock_bind()
136 err = l2cap_add_psm(chan, &la.l2_bdaddr, la.l2_psm); in l2cap_sock_bind()
141 switch (chan->chan_type) { in l2cap_sock_bind()
144 chan->sec_level = BT_SECURITY_SDP; in l2cap_sock_bind()
149 chan->sec_level = BT_SECURITY_SDP; in l2cap_sock_bind()
152 chan->sec_level = BT_SECURITY_SDP; in l2cap_sock_bind()
160 set_bit(FLAG_HOLD_HCI_CONN, &chan->flags); in l2cap_sock_bind()
164 if (chan->psm && bdaddr_type_is_le(chan->src_type)) in l2cap_sock_bind()
165 chan->mode = L2CAP_MODE_LE_FLOWCTL; in l2cap_sock_bind()
167 chan->state = BT_BOUND; in l2cap_sock_bind()
179 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_connect() local
212 if (chan->src_type == BDADDR_BREDR && bacmp(&chan->src, BDADDR_ANY) && in l2cap_sock_connect()
220 if (chan->scid != L2CAP_CID_ATT || in l2cap_sock_connect()
230 chan->src_type = BDADDR_LE_PUBLIC; in l2cap_sock_connect()
233 if (chan->src_type != BDADDR_BREDR && la.l2_bdaddr_type == BDADDR_BREDR) in l2cap_sock_connect()
243 if (chan->psm && bdaddr_type_is_le(chan->src_type) && !chan->mode) in l2cap_sock_connect()
244 chan->mode = L2CAP_MODE_LE_FLOWCTL; in l2cap_sock_connect()
246 err = l2cap_chan_connect(chan, la.l2_psm, __le16_to_cpu(la.l2_cid), in l2cap_sock_connect()
264 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_listen() local
281 switch (chan->mode) { in l2cap_sock_listen()
308 atomic_set(&chan->nesting, L2CAP_NESTING_PARENT); in l2cap_sock_listen()
310 chan->state = BT_LISTEN; in l2cap_sock_listen()
379 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_getname() local
391 la->l2_psm = chan->psm; in l2cap_sock_getname()
394 bacpy(&la->l2_bdaddr, &chan->dst); in l2cap_sock_getname()
395 la->l2_cid = cpu_to_le16(chan->dcid); in l2cap_sock_getname()
396 la->l2_bdaddr_type = chan->dst_type; in l2cap_sock_getname()
398 bacpy(&la->l2_bdaddr, &chan->src); in l2cap_sock_getname()
399 la->l2_cid = cpu_to_le16(chan->scid); in l2cap_sock_getname()
400 la->l2_bdaddr_type = chan->src_type; in l2cap_sock_getname()
406 static int l2cap_get_mode(struct l2cap_chan *chan) in l2cap_get_mode() argument
408 switch (chan->mode) { in l2cap_get_mode()
428 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_getsockopt_old() local
447 if (bdaddr_type_is_le(chan->src_type) && in l2cap_sock_getsockopt_old()
448 chan->scid != L2CAP_CID_ATT) { in l2cap_sock_getsockopt_old()
454 switch (chan->mode) { in l2cap_sock_getsockopt_old()
468 opts.imtu = chan->imtu; in l2cap_sock_getsockopt_old()
469 opts.omtu = chan->omtu; in l2cap_sock_getsockopt_old()
470 opts.flush_to = chan->flush_to; in l2cap_sock_getsockopt_old()
471 opts.mode = chan->mode; in l2cap_sock_getsockopt_old()
472 opts.fcs = chan->fcs; in l2cap_sock_getsockopt_old()
473 opts.max_tx = chan->max_tx; in l2cap_sock_getsockopt_old()
474 opts.txwin_size = chan->tx_win; in l2cap_sock_getsockopt_old()
476 BT_DBG("mode 0x%2.2x", chan->mode); in l2cap_sock_getsockopt_old()
485 switch (chan->sec_level) { in l2cap_sock_getsockopt_old()
505 if (test_bit(FLAG_ROLE_SWITCH, &chan->flags)) in l2cap_sock_getsockopt_old()
508 if (test_bit(FLAG_FORCE_RELIABLE, &chan->flags)) in l2cap_sock_getsockopt_old()
525 cinfo.hci_handle = chan->conn->hcon->handle; in l2cap_sock_getsockopt_old()
526 memcpy(cinfo.dev_class, chan->conn->hcon->dev_class, 3); in l2cap_sock_getsockopt_old()
547 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_getsockopt() local
568 if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED && in l2cap_sock_getsockopt()
569 chan->chan_type != L2CAP_CHAN_FIXED && in l2cap_sock_getsockopt()
570 chan->chan_type != L2CAP_CHAN_RAW) { in l2cap_sock_getsockopt()
576 if (chan->conn) { in l2cap_sock_getsockopt()
577 sec.level = chan->conn->hcon->sec_level; in l2cap_sock_getsockopt()
580 sec.key_size = chan->conn->hcon->enc_key_size; in l2cap_sock_getsockopt()
582 sec.level = chan->sec_level; in l2cap_sock_getsockopt()
604 if (put_user(test_bit(FLAG_FLUSHABLE, &chan->flags), in l2cap_sock_getsockopt()
617 pwr.force_active = test_bit(FLAG_FORCE_ACTIVE, &chan->flags); in l2cap_sock_getsockopt()
626 if (put_user(chan->chan_policy, (u32 __user *) optval)) in l2cap_sock_getsockopt()
631 if (!bdaddr_type_is_le(chan->src_type)) { in l2cap_sock_getsockopt()
641 if (put_user(chan->omtu, (u16 __user *) optval)) in l2cap_sock_getsockopt()
646 if (!bdaddr_type_is_le(chan->src_type)) { in l2cap_sock_getsockopt()
651 if (put_user(chan->imtu, (u16 __user *) optval)) in l2cap_sock_getsockopt()
661 phys = hci_conn_get_phy(chan->conn->hcon); in l2cap_sock_getsockopt()
673 if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { in l2cap_sock_getsockopt()
678 mode = l2cap_get_mode(chan); in l2cap_sock_getsockopt()
697 static bool l2cap_valid_mtu(struct l2cap_chan *chan, u16 mtu) in l2cap_valid_mtu() argument
699 switch (chan->scid) { in l2cap_valid_mtu()
717 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_setsockopt_old() local
728 if (bdaddr_type_is_le(chan->src_type)) { in l2cap_sock_setsockopt_old()
738 opts.imtu = chan->imtu; in l2cap_sock_setsockopt_old()
739 opts.omtu = chan->omtu; in l2cap_sock_setsockopt_old()
740 opts.flush_to = chan->flush_to; in l2cap_sock_setsockopt_old()
741 opts.mode = chan->mode; in l2cap_sock_setsockopt_old()
742 opts.fcs = chan->fcs; in l2cap_sock_setsockopt_old()
743 opts.max_tx = chan->max_tx; in l2cap_sock_setsockopt_old()
744 opts.txwin_size = chan->tx_win; in l2cap_sock_setsockopt_old()
757 if (!l2cap_valid_mtu(chan, opts.imtu)) { in l2cap_sock_setsockopt_old()
765 clear_bit(CONF_STATE2_DEVICE, &chan->conf_state); in l2cap_sock_setsockopt_old()
780 chan->mode = opts.mode; in l2cap_sock_setsockopt_old()
782 BT_DBG("mode 0x%2.2x", chan->mode); in l2cap_sock_setsockopt_old()
784 chan->imtu = opts.imtu; in l2cap_sock_setsockopt_old()
785 chan->omtu = opts.omtu; in l2cap_sock_setsockopt_old()
786 chan->fcs = opts.fcs; in l2cap_sock_setsockopt_old()
787 chan->max_tx = opts.max_tx; in l2cap_sock_setsockopt_old()
788 chan->tx_win = opts.txwin_size; in l2cap_sock_setsockopt_old()
789 chan->flush_to = opts.flush_to; in l2cap_sock_setsockopt_old()
804 chan->sec_level = BT_SECURITY_LOW; in l2cap_sock_setsockopt_old()
806 chan->sec_level = BT_SECURITY_MEDIUM; in l2cap_sock_setsockopt_old()
808 chan->sec_level = BT_SECURITY_HIGH; in l2cap_sock_setsockopt_old()
811 set_bit(FLAG_ROLE_SWITCH, &chan->flags); in l2cap_sock_setsockopt_old()
813 clear_bit(FLAG_ROLE_SWITCH, &chan->flags); in l2cap_sock_setsockopt_old()
816 set_bit(FLAG_FORCE_RELIABLE, &chan->flags); in l2cap_sock_setsockopt_old()
818 clear_bit(FLAG_FORCE_RELIABLE, &chan->flags); in l2cap_sock_setsockopt_old()
830 static int l2cap_set_mode(struct l2cap_chan *chan, u8 mode) in l2cap_set_mode() argument
834 if (bdaddr_type_is_le(chan->src_type)) in l2cap_set_mode()
837 clear_bit(CONF_STATE2_DEVICE, &chan->conf_state); in l2cap_set_mode()
840 if (!disable_ertm || bdaddr_type_is_le(chan->src_type)) in l2cap_set_mode()
845 if (!disable_ertm || bdaddr_type_is_le(chan->src_type)) in l2cap_set_mode()
850 if (!bdaddr_type_is_le(chan->src_type)) in l2cap_set_mode()
856 if (!bdaddr_type_is_le(chan->src_type)) in l2cap_set_mode()
864 chan->mode = mode; in l2cap_set_mode()
873 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_setsockopt() local
892 if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED && in l2cap_sock_setsockopt()
893 chan->chan_type != L2CAP_CHAN_FIXED && in l2cap_sock_setsockopt()
894 chan->chan_type != L2CAP_CHAN_RAW) { in l2cap_sock_setsockopt()
913 chan->sec_level = sec.level; in l2cap_sock_setsockopt()
915 if (!chan->conn) in l2cap_sock_setsockopt()
918 conn = chan->conn; in l2cap_sock_setsockopt()
921 if (chan->scid == L2CAP_CID_ATT) { in l2cap_sock_setsockopt()
927 set_bit(FLAG_PENDING_SECURITY, &chan->flags); in l2cap_sock_setsockopt()
929 chan->state = BT_CONFIG; in l2cap_sock_setsockopt()
935 if (!l2cap_chan_check_security(chan, true)) in l2cap_sock_setsockopt()
957 set_bit(FLAG_DEFER_SETUP, &chan->flags); in l2cap_sock_setsockopt()
960 clear_bit(FLAG_DEFER_SETUP, &chan->flags); in l2cap_sock_setsockopt()
976 conn = chan->conn; in l2cap_sock_setsockopt()
986 set_bit(FLAG_FLUSHABLE, &chan->flags); in l2cap_sock_setsockopt()
988 clear_bit(FLAG_FLUSHABLE, &chan->flags); in l2cap_sock_setsockopt()
992 if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED && in l2cap_sock_setsockopt()
993 chan->chan_type != L2CAP_CHAN_RAW) { in l2cap_sock_setsockopt()
1007 set_bit(FLAG_FORCE_ACTIVE, &chan->flags); in l2cap_sock_setsockopt()
1009 clear_bit(FLAG_FORCE_ACTIVE, &chan->flags); in l2cap_sock_setsockopt()
1023 if (chan->mode != L2CAP_MODE_ERTM && in l2cap_sock_setsockopt()
1024 chan->mode != L2CAP_MODE_STREAMING) { in l2cap_sock_setsockopt()
1029 chan->chan_policy = (u8) opt; in l2cap_sock_setsockopt()
1032 chan->move_role == L2CAP_MOVE_ROLE_NONE) in l2cap_sock_setsockopt()
1033 l2cap_move_start(chan); in l2cap_sock_setsockopt()
1038 if (!bdaddr_type_is_le(chan->src_type)) { in l2cap_sock_setsockopt()
1050 if (!bdaddr_type_is_le(chan->src_type)) { in l2cap_sock_setsockopt()
1055 if (chan->mode == L2CAP_MODE_LE_FLOWCTL && in l2cap_sock_setsockopt()
1066 if (chan->mode == L2CAP_MODE_EXT_FLOWCTL && in l2cap_sock_setsockopt()
1068 err = l2cap_chan_reconfigure(chan, opt); in l2cap_sock_setsockopt()
1070 chan->imtu = opt; in l2cap_sock_setsockopt()
1087 if (chan->chan_type != L2CAP_CHAN_CONN_ORIENTED) { in l2cap_sock_setsockopt()
1099 err = l2cap_set_mode(chan, opt); in l2cap_sock_setsockopt()
1103 BT_DBG("mode 0x%2.2x", chan->mode); in l2cap_sock_setsockopt()
1120 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_sendmsg() local
1141 l2cap_chan_lock(chan); in l2cap_sock_sendmsg()
1142 err = l2cap_chan_send(chan, msg, len); in l2cap_sock_sendmsg()
1143 l2cap_chan_unlock(chan); in l2cap_sock_sendmsg()
1159 if (pi->chan->mode == L2CAP_MODE_EXT_FLOWCTL) { in l2cap_sock_recvmsg()
1161 pi->chan->state = BT_CONNECTED; in l2cap_sock_recvmsg()
1162 __l2cap_ecred_conn_rsp_defer(pi->chan); in l2cap_sock_recvmsg()
1163 } else if (bdaddr_type_is_le(pi->chan->src_type)) { in l2cap_sock_recvmsg()
1165 pi->chan->state = BT_CONNECTED; in l2cap_sock_recvmsg()
1166 __l2cap_le_connect_rsp_defer(pi->chan); in l2cap_sock_recvmsg()
1169 pi->chan->state = BT_CONFIG; in l2cap_sock_recvmsg()
1170 __l2cap_connect_rsp_defer(pi->chan); in l2cap_sock_recvmsg()
1184 if (pi->chan->mode != L2CAP_MODE_ERTM) in l2cap_sock_recvmsg()
1191 if (!test_bit(CONN_LOCAL_BUSY, &pi->chan->conn_state)) in l2cap_sock_recvmsg()
1206 l2cap_chan_busy(pi->chan, 0); in l2cap_sock_recvmsg()
1225 l2cap_chan_put(l2cap_pi(sk)->chan); in l2cap_sock_kill()
1230 static int __l2cap_wait_ack(struct sock *sk, struct l2cap_chan *chan) in __l2cap_wait_ack() argument
1242 chan->unacked_frames, time_after(jiffies, timeout) ? 0 : in __l2cap_wait_ack()
1267 } while (chan->unacked_frames > 0 && in __l2cap_wait_ack()
1268 chan->state == BT_CONNECTED); in __l2cap_wait_ack()
1278 struct l2cap_chan *chan; in l2cap_sock_shutdown() local
1304 chan = l2cap_pi(sk)->chan; in l2cap_sock_shutdown()
1306 l2cap_chan_hold(chan); in l2cap_sock_shutdown()
1308 BT_DBG("chan %p state %s", chan, state_to_string(chan->state)); in l2cap_sock_shutdown()
1310 if (chan->mode == L2CAP_MODE_ERTM && in l2cap_sock_shutdown()
1311 chan->unacked_frames > 0 && in l2cap_sock_shutdown()
1312 chan->state == BT_CONNECTED) { in l2cap_sock_shutdown()
1313 err = __l2cap_wait_ack(sk, chan); in l2cap_sock_shutdown()
1335 l2cap_chan_lock(chan); in l2cap_sock_shutdown()
1336 conn = chan->conn; in l2cap_sock_shutdown()
1340 l2cap_chan_unlock(chan); in l2cap_sock_shutdown()
1346 l2cap_chan_lock(chan); in l2cap_sock_shutdown()
1347 l2cap_chan_close(chan, 0); in l2cap_sock_shutdown()
1348 l2cap_chan_unlock(chan); in l2cap_sock_shutdown()
1363 l2cap_chan_put(chan); in l2cap_sock_shutdown()
1381 struct l2cap_chan *chan; in l2cap_sock_release() local
1391 chan = l2cap_pi(sk)->chan; in l2cap_sock_release()
1393 l2cap_chan_hold(chan); in l2cap_sock_release()
1394 l2cap_chan_lock(chan); in l2cap_sock_release()
1399 l2cap_chan_unlock(chan); in l2cap_sock_release()
1400 l2cap_chan_put(chan); in l2cap_sock_release()
1414 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_cleanup_listen() local
1416 BT_DBG("child chan %p state %s", chan, in l2cap_sock_cleanup_listen()
1417 state_to_string(chan->state)); in l2cap_sock_cleanup_listen()
1419 l2cap_chan_hold(chan); in l2cap_sock_cleanup_listen()
1420 l2cap_chan_lock(chan); in l2cap_sock_cleanup_listen()
1422 __clear_chan_timer(chan); in l2cap_sock_cleanup_listen()
1423 l2cap_chan_close(chan, ECONNRESET); in l2cap_sock_cleanup_listen()
1426 l2cap_chan_unlock(chan); in l2cap_sock_cleanup_listen()
1427 l2cap_chan_put(chan); in l2cap_sock_cleanup_listen()
1431 static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan) in l2cap_sock_new_connection_cb() argument
1433 struct sock *sk, *parent = chan->data; in l2cap_sock_new_connection_cb()
1459 return l2cap_pi(sk)->chan; in l2cap_sock_new_connection_cb()
1462 static int l2cap_sock_recv_cb(struct l2cap_chan *chan, struct sk_buff *skb) in l2cap_sock_recv_cb() argument
1464 struct sock *sk = chan->data; in l2cap_sock_recv_cb()
1474 if (chan->mode != L2CAP_MODE_ERTM && in l2cap_sock_recv_cb()
1475 chan->mode != L2CAP_MODE_STREAMING) { in l2cap_sock_recv_cb()
1495 if (err < 0 && chan->mode == L2CAP_MODE_ERTM) { in l2cap_sock_recv_cb()
1497 l2cap_chan_busy(chan, 1); in l2cap_sock_recv_cb()
1507 static void l2cap_sock_close_cb(struct l2cap_chan *chan) in l2cap_sock_close_cb() argument
1509 struct sock *sk = chan->data; in l2cap_sock_close_cb()
1517 static void l2cap_sock_teardown_cb(struct l2cap_chan *chan, int err) in l2cap_sock_teardown_cb() argument
1519 struct sock *sk = chan->data; in l2cap_sock_teardown_cb()
1525 BT_DBG("chan %p state %s", chan, state_to_string(chan->state)); in l2cap_sock_teardown_cb()
1534 lock_sock_nested(sk, atomic_read(&chan->nesting)); in l2cap_sock_teardown_cb()
1538 switch (chan->state) { in l2cap_sock_teardown_cb()
1546 chan->state = BT_CLOSED; in l2cap_sock_teardown_cb()
1551 chan->state = BT_CLOSED; in l2cap_sock_teardown_cb()
1571 static void l2cap_sock_state_change_cb(struct l2cap_chan *chan, int state, in l2cap_sock_state_change_cb() argument
1574 struct sock *sk = chan->data; in l2cap_sock_state_change_cb()
1582 static struct sk_buff *l2cap_sock_alloc_skb_cb(struct l2cap_chan *chan, in l2cap_sock_alloc_skb_cb() argument
1586 struct sock *sk = chan->data; in l2cap_sock_alloc_skb_cb()
1590 l2cap_chan_unlock(chan); in l2cap_sock_alloc_skb_cb()
1592 l2cap_chan_lock(chan); in l2cap_sock_alloc_skb_cb()
1599 bt_cb(skb)->l2cap.chan = chan; in l2cap_sock_alloc_skb_cb()
1604 static void l2cap_sock_ready_cb(struct l2cap_chan *chan) in l2cap_sock_ready_cb() argument
1606 struct sock *sk = chan->data; in l2cap_sock_ready_cb()
1624 static void l2cap_sock_defer_cb(struct l2cap_chan *chan) in l2cap_sock_defer_cb() argument
1626 struct sock *parent, *sk = chan->data; in l2cap_sock_defer_cb()
1637 static void l2cap_sock_resume_cb(struct l2cap_chan *chan) in l2cap_sock_resume_cb() argument
1639 struct sock *sk = chan->data; in l2cap_sock_resume_cb()
1641 if (test_and_clear_bit(FLAG_PENDING_SECURITY, &chan->flags)) { in l2cap_sock_resume_cb()
1643 chan->state = BT_CONNECTED; in l2cap_sock_resume_cb()
1650 static void l2cap_sock_set_shutdown_cb(struct l2cap_chan *chan) in l2cap_sock_set_shutdown_cb() argument
1652 struct sock *sk = chan->data; in l2cap_sock_set_shutdown_cb()
1659 static long l2cap_sock_get_sndtimeo_cb(struct l2cap_chan *chan) in l2cap_sock_get_sndtimeo_cb() argument
1661 struct sock *sk = chan->data; in l2cap_sock_get_sndtimeo_cb()
1666 static struct pid *l2cap_sock_get_peer_pid_cb(struct l2cap_chan *chan) in l2cap_sock_get_peer_pid_cb() argument
1668 struct sock *sk = chan->data; in l2cap_sock_get_peer_pid_cb()
1673 static void l2cap_sock_suspend_cb(struct l2cap_chan *chan) in l2cap_sock_suspend_cb() argument
1675 struct sock *sk = chan->data; in l2cap_sock_suspend_cb()
1681 static int l2cap_sock_filter(struct l2cap_chan *chan, struct sk_buff *skb) in l2cap_sock_filter() argument
1683 struct sock *sk = chan->data; in l2cap_sock_filter()
1685 switch (chan->mode) { in l2cap_sock_filter()
1716 if (l2cap_pi(sk)->chan) { in l2cap_sock_destruct()
1717 l2cap_pi(sk)->chan->data = NULL; in l2cap_sock_destruct()
1718 l2cap_chan_put(l2cap_pi(sk)->chan); in l2cap_sock_destruct()
1745 struct l2cap_chan *chan = l2cap_pi(sk)->chan; in l2cap_sock_init() local
1750 struct l2cap_chan *pchan = l2cap_pi(parent)->chan; in l2cap_sock_init()
1755 chan->chan_type = pchan->chan_type; in l2cap_sock_init()
1756 chan->imtu = pchan->imtu; in l2cap_sock_init()
1757 chan->omtu = pchan->omtu; in l2cap_sock_init()
1758 chan->conf_state = pchan->conf_state; in l2cap_sock_init()
1759 chan->mode = pchan->mode; in l2cap_sock_init()
1760 chan->fcs = pchan->fcs; in l2cap_sock_init()
1761 chan->max_tx = pchan->max_tx; in l2cap_sock_init()
1762 chan->tx_win = pchan->tx_win; in l2cap_sock_init()
1763 chan->tx_win_max = pchan->tx_win_max; in l2cap_sock_init()
1764 chan->sec_level = pchan->sec_level; in l2cap_sock_init()
1765 chan->flags = pchan->flags; in l2cap_sock_init()
1766 chan->tx_credits = pchan->tx_credits; in l2cap_sock_init()
1767 chan->rx_credits = pchan->rx_credits; in l2cap_sock_init()
1769 if (chan->chan_type == L2CAP_CHAN_FIXED) { in l2cap_sock_init()
1770 chan->scid = pchan->scid; in l2cap_sock_init()
1771 chan->dcid = pchan->scid; in l2cap_sock_init()
1778 chan->chan_type = L2CAP_CHAN_RAW; in l2cap_sock_init()
1781 chan->chan_type = L2CAP_CHAN_CONN_LESS; in l2cap_sock_init()
1786 chan->chan_type = L2CAP_CHAN_CONN_ORIENTED; in l2cap_sock_init()
1790 chan->imtu = L2CAP_DEFAULT_MTU; in l2cap_sock_init()
1791 chan->omtu = 0; in l2cap_sock_init()
1793 chan->mode = L2CAP_MODE_ERTM; in l2cap_sock_init()
1794 set_bit(CONF_STATE2_DEVICE, &chan->conf_state); in l2cap_sock_init()
1796 chan->mode = L2CAP_MODE_BASIC; in l2cap_sock_init()
1799 l2cap_chan_set_defaults(chan); in l2cap_sock_init()
1803 chan->flush_to = L2CAP_DEFAULT_FLUSH_TO; in l2cap_sock_init()
1805 chan->data = sk; in l2cap_sock_init()
1806 chan->ops = &l2cap_chan_ops; in l2cap_sock_init()
1819 struct l2cap_chan *chan; in l2cap_sock_alloc() local
1836 chan = l2cap_chan_create(); in l2cap_sock_alloc()
1837 if (!chan) { in l2cap_sock_alloc()
1842 l2cap_chan_hold(chan); in l2cap_sock_alloc()
1844 l2cap_pi(sk)->chan = chan; in l2cap_sock_alloc()