Lines Matching refs:dlci
54 static int rfcomm_send_sabm(struct rfcomm_session *s, u8 dlci);
55 static int rfcomm_send_disc(struct rfcomm_session *s, u8 dlci);
59 static int rfcomm_send_msc(struct rfcomm_session *s, int cr, u8 dlci, u8 v24_sig);
83 #define __addr(cr, dlci) (((dlci & 0x3f) << 2) | (cr << 1) | 0x01) argument
86 #define __srv_channel(dlci) (dlci >> 1) argument
351 static struct rfcomm_dlc *rfcomm_dlc_get(struct rfcomm_session *s, u8 dlci) in rfcomm_dlc_get() argument
356 if (d->dlci == dlci) in rfcomm_dlc_get()
371 u8 dlci; in __rfcomm_dlc_open() local
389 dlci = __dlci(__session_dir(s), channel); in __rfcomm_dlc_open()
392 if (rfcomm_dlc_get(s, dlci)) in __rfcomm_dlc_open()
397 d->dlci = dlci; in __rfcomm_dlc_open()
398 d->addr = __addr(s->initiator, dlci); in __rfcomm_dlc_open()
439 rfcomm_send_disc(s, d->dlci); in __rfcomm_dlc_disconn()
454 d, d->state, d->dlci, err, s); in __rfcomm_dlc_close()
505 BT_DBG("dlc %p state %ld dlci %d err %d", d, d->state, d->dlci, err); in rfcomm_dlc_close()
537 u8 dlci; in rfcomm_dlc_exists() local
545 dlci = __dlci(__session_dir(s), channel); in rfcomm_dlc_exists()
546 dlc = rfcomm_dlc_get(s, dlci); in rfcomm_dlc_exists()
847 static int rfcomm_send_sabm(struct rfcomm_session *s, u8 dlci) in rfcomm_send_sabm() argument
851 BT_DBG("%p dlci %d", s, dlci); in rfcomm_send_sabm()
853 cmd.addr = __addr(s->initiator, dlci); in rfcomm_send_sabm()
861 static int rfcomm_send_ua(struct rfcomm_session *s, u8 dlci) in rfcomm_send_ua() argument
865 BT_DBG("%p dlci %d", s, dlci); in rfcomm_send_ua()
867 cmd.addr = __addr(!s->initiator, dlci); in rfcomm_send_ua()
875 static int rfcomm_send_disc(struct rfcomm_session *s, u8 dlci) in rfcomm_send_disc() argument
879 BT_DBG("%p dlci %d", s, dlci); in rfcomm_send_disc()
881 cmd.addr = __addr(s->initiator, dlci); in rfcomm_send_disc()
894 BT_DBG("dlc %p dlci %d", d, d->dlci); in rfcomm_queue_disc()
911 static int rfcomm_send_dm(struct rfcomm_session *s, u8 dlci) in rfcomm_send_dm() argument
915 BT_DBG("%p dlci %d", s, dlci); in rfcomm_send_dm()
917 cmd.addr = __addr(!s->initiator, dlci); in rfcomm_send_dm()
957 BT_DBG("%p cr %d dlci %d mtu %d", s, cr, d->dlci, d->mtu); in rfcomm_send_pn()
969 pn->dlci = d->dlci; in rfcomm_send_pn()
992 int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci, in rfcomm_send_rpn() argument
1004 s, cr, dlci, bit_rate, data_bits, stop_bits, parity, in rfcomm_send_rpn()
1017 rpn->dlci = __addr(1, dlci); in rfcomm_send_rpn()
1030 static int rfcomm_send_rls(struct rfcomm_session *s, int cr, u8 dlci, u8 status) in rfcomm_send_rls() argument
1049 rls->dlci = __addr(1, dlci); in rfcomm_send_rls()
1057 static int rfcomm_send_msc(struct rfcomm_session *s, int cr, u8 dlci, u8 v24_sig) in rfcomm_send_msc() argument
1076 msc->dlci = __addr(1, dlci); in rfcomm_send_msc()
1200 static struct rfcomm_session *rfcomm_recv_ua(struct rfcomm_session *s, u8 dlci) in rfcomm_recv_ua() argument
1202 BT_DBG("session %p state %ld dlci %d", s, s->state, dlci); in rfcomm_recv_ua()
1204 if (dlci) { in rfcomm_recv_ua()
1206 struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_ua()
1208 rfcomm_send_dm(s, dlci); in rfcomm_recv_ua()
1221 rfcomm_send_msc(s, 1, dlci, d->v24_sig); in rfcomm_recv_ua()
1252 static struct rfcomm_session *rfcomm_recv_dm(struct rfcomm_session *s, u8 dlci) in rfcomm_recv_dm() argument
1256 BT_DBG("session %p state %ld dlci %d", s, s->state, dlci); in rfcomm_recv_dm()
1258 if (dlci) { in rfcomm_recv_dm()
1260 struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_dm()
1282 u8 dlci) in rfcomm_recv_disc() argument
1286 BT_DBG("session %p state %ld dlci %d", s, s->state, dlci); in rfcomm_recv_disc()
1288 if (dlci) { in rfcomm_recv_disc()
1289 struct rfcomm_dlc *d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_disc()
1291 rfcomm_send_ua(s, dlci); in rfcomm_recv_disc()
1301 rfcomm_send_dm(s, dlci); in rfcomm_recv_disc()
1323 rfcomm_send_ua(d->session, d->dlci); in rfcomm_dlc_accept()
1335 rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); in rfcomm_dlc_accept()
1357 static int rfcomm_recv_sabm(struct rfcomm_session *s, u8 dlci) in rfcomm_recv_sabm() argument
1362 BT_DBG("session %p state %ld dlci %d", s, s->state, dlci); in rfcomm_recv_sabm()
1364 if (!dlci) { in rfcomm_recv_sabm()
1375 d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_sabm()
1385 channel = __srv_channel(dlci); in rfcomm_recv_sabm()
1387 d->dlci = dlci; in rfcomm_recv_sabm()
1388 d->addr = __addr(s->initiator, dlci); in rfcomm_recv_sabm()
1393 rfcomm_send_dm(s, dlci); in rfcomm_recv_sabm()
1404 d, d->state, d->dlci, pn->mtu, pn->flow_ctrl, pn->credits); in rfcomm_apply_pn()
1432 u8 dlci = pn->dlci; in rfcomm_recv_pn() local
1434 BT_DBG("session %p state %ld dlci %d", s, s->state, dlci); in rfcomm_recv_pn()
1436 if (!dlci) in rfcomm_recv_pn()
1439 d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_pn()
1452 rfcomm_send_sabm(s, d->dlci); in rfcomm_recv_pn()
1457 u8 channel = __srv_channel(dlci); in rfcomm_recv_pn()
1465 d->dlci = dlci; in rfcomm_recv_pn()
1466 d->addr = __addr(s->initiator, dlci); in rfcomm_recv_pn()
1474 rfcomm_send_dm(s, dlci); in rfcomm_recv_pn()
1483 u8 dlci = __get_dlci(rpn->dlci); in rfcomm_recv_rpn() local
1495 dlci, cr, len, rpn->bit_rate, rpn->line_settings, rpn->flow_ctrl, in rfcomm_recv_rpn()
1580 rfcomm_send_rpn(s, 0, dlci, bit_rate, data_bits, stop_bits, in rfcomm_recv_rpn()
1589 u8 dlci = __get_dlci(rls->dlci); in rfcomm_recv_rls() local
1591 BT_DBG("dlci %d cr %d status 0x%x", dlci, cr, rls->status); in rfcomm_recv_rls()
1600 rfcomm_send_rls(s, 0, dlci, rls->status); in rfcomm_recv_rls()
1609 u8 dlci = __get_dlci(msc->dlci); in rfcomm_recv_msc() local
1611 BT_DBG("dlci %d cr %d v24 0x%x", dlci, cr, msc->v24_sig); in rfcomm_recv_msc()
1613 d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_msc()
1632 rfcomm_send_msc(s, 0, dlci, msc->v24_sig); in rfcomm_recv_msc()
1701 static int rfcomm_recv_data(struct rfcomm_session *s, u8 dlci, int pf, struct sk_buff *skb) in rfcomm_recv_data() argument
1705 BT_DBG("session %p state %ld dlci %d pf %d", s, s->state, dlci, pf); in rfcomm_recv_data()
1707 d = rfcomm_dlc_get(s, dlci); in rfcomm_recv_data()
1709 rfcomm_send_dm(s, dlci); in rfcomm_recv_data()
1738 u8 type, dlci, fcs; in rfcomm_recv_frame() local
1746 dlci = __get_dlci(hdr->addr); in rfcomm_recv_frame()
1767 rfcomm_recv_sabm(s, dlci); in rfcomm_recv_frame()
1772 s = rfcomm_recv_disc(s, dlci); in rfcomm_recv_frame()
1777 s = rfcomm_recv_ua(s, dlci); in rfcomm_recv_frame()
1781 s = rfcomm_recv_dm(s, dlci); in rfcomm_recv_frame()
1785 if (dlci) { in rfcomm_recv_frame()
1786 rfcomm_recv_data(s, dlci, __test_pf(hdr->ctrl), skb); in rfcomm_recv_frame()
1834 rfcomm_send_msc(d->session, 1, d->dlci, d->v24_sig); in rfcomm_process_tx()
1910 rfcomm_send_dm(s, d->dlci); in rfcomm_process_dlcs()
2194 d->state, d->dlci, d->mtu, in rfcomm_dlc_debugfs_show()