Lines Matching refs:l2cap_pi
98 l2cap_pi(sk)->sec_level != BT_SECURITY_SDP)
127 for (s = l->head; s; s = l2cap_pi(s)->next_c) {
128 if (l2cap_pi(s)->dcid == cid)
137 for (s = l->head; s; s = l2cap_pi(s)->next_c) {
138 if (l2cap_pi(s)->scid == cid)
160 for (s = l->head; s; s = l2cap_pi(s)->next_c) {
161 if (l2cap_pi(s)->ident == ident)
195 l2cap_pi(l->head)->prev_c = sk;
197 l2cap_pi(sk)->next_c = l->head;
198 l2cap_pi(sk)->prev_c = NULL;
204 struct sock *next = l2cap_pi(sk)->next_c, *prev = l2cap_pi(sk)->prev_c;
211 l2cap_pi(next)->prev_c = prev;
213 l2cap_pi(prev)->next_c = next;
224 l2cap_pi(sk)->psm, l2cap_pi(sk)->dcid);
228 l2cap_pi(sk)->conn = conn;
232 l2cap_pi(sk)->scid = l2cap_alloc_cid(l);
235 l2cap_pi(sk)->scid = L2CAP_CID_CONN_LESS;
236 l2cap_pi(sk)->dcid = L2CAP_CID_CONN_LESS;
237 l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
240 l2cap_pi(sk)->scid = L2CAP_CID_SIGNALING;
241 l2cap_pi(sk)->dcid = L2CAP_CID_SIGNALING;
242 l2cap_pi(sk)->omtu = L2CAP_DEFAULT_MTU;
255 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
265 l2cap_pi(sk)->conn = NULL;
283 if (l2cap_pi(sk)->mode == L2CAP_MODE_ERTM) {
286 del_timer(&l2cap_pi(sk)->retrans_timer);
287 del_timer(&l2cap_pi(sk)->monitor_timer);
288 del_timer(&l2cap_pi(sk)->ack_timer);
303 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
306 if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) {
307 if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH)
312 if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW)
313 l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
315 switch (l2cap_pi(sk)->sec_level) {
328 return hci_conn_security(conn->hcon, l2cap_pi(sk)->sec_level,
427 return !(l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND);
432 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
440 req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
441 req.psm = l2cap_pi(sk)->psm;
443 l2cap_pi(sk)->ident = l2cap_get_ident(conn);
444 l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
446 l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
489 if (l2cap_pi(sk)->mode == L2CAP_MODE_ERTM) {
490 del_timer(&l2cap_pi(sk)->retrans_timer);
491 del_timer(&l2cap_pi(sk)->monitor_timer);
492 del_timer(&l2cap_pi(sk)->ack_timer);
495 req.dcid = cpu_to_le16(l2cap_pi(sk)->dcid);
496 req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
517 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
535 if (!l2cap_mode_supported(l2cap_pi(sk)->mode,
537 && l2cap_pi(sk)->conf_state &
547 req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
548 req.psm = l2cap_pi(sk)->psm;
550 l2cap_pi(sk)->ident = l2cap_get_ident(conn);
551 l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
553 l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
559 rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid);
560 rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid);
579 l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
582 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT ||
588 l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
591 l2cap_pi(sk)->num_conf_req++;
617 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
644 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
645 if (l2cap_pi(sk)->force_reliable)
736 if (l2cap_pi(sk)->sport == psm && !bacmp(&bt_sk(sk)->src, src))
755 if (l2cap_pi(sk)->psm == psm) {
832 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
843 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
852 rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid);
853 rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid);
856 l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
885 struct l2cap_pinfo *pi = l2cap_pi(sk);
893 pi->imtu = l2cap_pi(parent)->imtu;
894 pi->omtu = l2cap_pi(parent)->omtu;
895 pi->conf_state = l2cap_pi(parent)->conf_state;
896 pi->mode = l2cap_pi(parent)->mode;
897 pi->fcs = l2cap_pi(parent)->fcs;
898 pi->max_tx = l2cap_pi(parent)->max_tx;
899 pi->tx_win = l2cap_pi(parent)->tx_win;
900 pi->sec_level = l2cap_pi(parent)->sec_level;
901 pi->role_switch = l2cap_pi(parent)->role_switch;
902 pi->force_reliable = l2cap_pi(parent)->force_reliable;
1024 l2cap_pi(sk)->psm = la.l2_psm;
1025 l2cap_pi(sk)->sport = la.l2_psm;
1030 l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
1051 l2cap_pi(sk)->psm);
1062 switch (l2cap_pi(sk)->sec_level) {
1073 } else if (l2cap_pi(sk)->psm == cpu_to_le16(0x0001)) {
1074 if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH)
1079 if (l2cap_pi(sk)->sec_level == BT_SECURITY_LOW)
1080 l2cap_pi(sk)->sec_level = BT_SECURITY_SDP;
1082 switch (l2cap_pi(sk)->sec_level) {
1096 l2cap_pi(sk)->sec_level, auth_type);
1158 switch (l2cap_pi(sk)->mode) {
1195 l2cap_pi(sk)->psm = la.l2_psm;
1224 switch (l2cap_pi(sk)->mode) {
1237 if (!l2cap_pi(sk)->psm) {
1247 l2cap_pi(sk)->psm = cpu_to_le16(psm);
1248 l2cap_pi(sk)->sport = cpu_to_le16(psm);
1335 la->l2_psm = l2cap_pi(sk)->psm;
1337 la->l2_cid = cpu_to_le16(l2cap_pi(sk)->dcid);
1339 la->l2_psm = l2cap_pi(sk)->sport;
1341 la->l2_cid = cpu_to_le16(l2cap_pi(sk)->scid);
1354 while ((l2cap_pi(sk)->unacked_frames > 0 && l2cap_pi(sk)->conn)) {
1385 if (l2cap_pi(sk)->retry_count >= l2cap_pi(sk)->remote_max_tx) {
1386 l2cap_send_disconn_req(l2cap_pi(sk)->conn, sk, ECONNABORTED);
1391 l2cap_pi(sk)->retry_count++;
1394 l2cap_send_rr_or_rnr(l2cap_pi(sk), L2CAP_CTRL_POLL);
1405 l2cap_pi(sk)->retry_count = 1;
1408 l2cap_pi(sk)->conn_state |= L2CAP_CONN_WAIT_F;
1410 l2cap_send_rr_or_rnr(l2cap_pi(sk), L2CAP_CTRL_POLL);
1419 l2cap_pi(sk)->unacked_frames) {
1420 if (bt_cb(skb)->tx_seq == l2cap_pi(sk)->expected_ack_seq)
1426 l2cap_pi(sk)->unacked_frames--;
1429 if (!l2cap_pi(sk)->unacked_frames)
1430 del_timer(&l2cap_pi(sk)->retrans_timer);
1435 struct l2cap_pinfo *pi = l2cap_pi(sk);
1445 struct l2cap_pinfo *pi = l2cap_pi(sk);
1466 struct l2cap_pinfo *pi = l2cap_pi(sk);
1514 struct l2cap_pinfo *pi = l2cap_pi(sk);
1573 struct l2cap_pinfo *pi = l2cap_pi(sk);
1616 l2cap_send_sframe(l2cap_pi(sk), control);
1621 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
1653 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
1668 lh->cid = cpu_to_le16(l2cap_pi(sk)->dcid);
1670 put_unaligned_le16(l2cap_pi(sk)->psm, skb_put(skb, 2));
1682 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
1697 lh->cid = cpu_to_le16(l2cap_pi(sk)->dcid);
1710 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
1723 if (l2cap_pi(sk)->fcs == L2CAP_FCS_CRC16)
1734 lh->cid = cpu_to_le16(l2cap_pi(sk)->dcid);
1746 if (l2cap_pi(sk)->fcs == L2CAP_FCS_CRC16)
1755 struct l2cap_pinfo *pi = l2cap_pi(sk);
1802 struct l2cap_pinfo *pi = l2cap_pi(sk);
1909 struct l2cap_conn *conn = l2cap_pi(sk)->conn;
1914 rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid);
1915 rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid);
1918 l2cap_send_cmd(l2cap_pi(sk)->conn, l2cap_pi(sk)->ident,
1921 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) {
1926 l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
1929 l2cap_pi(sk)->num_conf_req++;
1958 opts.imtu = l2cap_pi(sk)->imtu;
1959 opts.omtu = l2cap_pi(sk)->omtu;
1960 opts.flush_to = l2cap_pi(sk)->flush_to;
1961 opts.mode = l2cap_pi(sk)->mode;
1962 opts.fcs = l2cap_pi(sk)->fcs;
1963 opts.max_tx = l2cap_pi(sk)->max_tx;
1964 opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win;
1977 l2cap_pi(sk)->mode = opts.mode;
1978 switch (l2cap_pi(sk)->mode) {
1980 l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_STATE2_DEVICE;
1992 l2cap_pi(sk)->imtu = opts.imtu;
1993 l2cap_pi(sk)->omtu = opts.omtu;
1994 l2cap_pi(sk)->fcs = opts.fcs;
1995 l2cap_pi(sk)->max_tx = opts.max_tx;
1996 l2cap_pi(sk)->tx_win = (__u8)opts.txwin_size;
2006 l2cap_pi(sk)->sec_level = BT_SECURITY_LOW;
2008 l2cap_pi(sk)->sec_level = BT_SECURITY_MEDIUM;
2010 l2cap_pi(sk)->sec_level = BT_SECURITY_HIGH;
2012 l2cap_pi(sk)->role_switch = (opt & L2CAP_LM_MASTER);
2013 l2cap_pi(sk)->force_reliable = (opt & L2CAP_LM_RELIABLE);
2064 l2cap_pi(sk)->sec_level = sec.level;
2107 opts.imtu = l2cap_pi(sk)->imtu;
2108 opts.omtu = l2cap_pi(sk)->omtu;
2109 opts.flush_to = l2cap_pi(sk)->flush_to;
2110 opts.mode = l2cap_pi(sk)->mode;
2111 opts.fcs = l2cap_pi(sk)->fcs;
2112 opts.max_tx = l2cap_pi(sk)->max_tx;
2113 opts.txwin_size = (__u16)l2cap_pi(sk)->tx_win;
2122 switch (l2cap_pi(sk)->sec_level) {
2138 if (l2cap_pi(sk)->role_switch)
2141 if (l2cap_pi(sk)->force_reliable)
2156 cinfo.hci_handle = l2cap_pi(sk)->conn->hcon->handle;
2157 memcpy(cinfo.dev_class, l2cap_pi(sk)->conn->hcon->dev_class, 3);
2201 sec.level = l2cap_pi(sk)->sec_level;
2241 if (l2cap_pi(sk)->mode == L2CAP_MODE_ERTM)
2283 l2cap_pi(sk)->conf_state = 0;
2310 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
2455 l2cap_send_ack(l2cap_pi(sk));
2461 l2cap_pi(sk)->expected_ack_seq = 0;
2462 l2cap_pi(sk)->unacked_frames = 0;
2463 l2cap_pi(sk)->buffer_seq = 0;
2464 l2cap_pi(sk)->num_acked = 0;
2465 l2cap_pi(sk)->frames_sent = 0;
2467 setup_timer(&l2cap_pi(sk)->retrans_timer,
2469 setup_timer(&l2cap_pi(sk)->monitor_timer,
2471 setup_timer(&l2cap_pi(sk)->ack_timer,
2477 INIT_WORK(&l2cap_pi(sk)->busy_work, l2cap_busy_work);
2497 struct l2cap_pinfo *pi = l2cap_pi(sk);
2598 struct l2cap_pinfo *pi = l2cap_pi(sk);
2752 struct l2cap_pinfo *pi = l2cap_pi(sk);
2826 rsp->scid = cpu_to_le16(l2cap_pi(sk)->dcid);
2835 struct l2cap_pinfo *pi = l2cap_pi(sk);
2943 l2cap_pi(sk)->psm = psm;
2944 l2cap_pi(sk)->dcid = scid;
2947 dcid = l2cap_pi(sk)->scid;
2951 l2cap_pi(sk)->ident = cmd->ident;
3002 if (sk && !(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT) &&
3005 l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
3008 l2cap_pi(sk)->num_conf_req++;
3041 l2cap_pi(sk)->ident = 0;
3042 l2cap_pi(sk)->dcid = dcid;
3043 l2cap_pi(sk)->conf_state &= ~L2CAP_CONF_CONNECT_PEND;
3045 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT)
3048 l2cap_pi(sk)->conf_state |= L2CAP_CONF_REQ_SENT;
3052 l2cap_pi(sk)->num_conf_req++;
3056 l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
3101 if (l2cap_pi(sk)->conf_len + len > sizeof(l2cap_pi(sk)->conf_req)) {
3109 memcpy(l2cap_pi(sk)->conf_req + l2cap_pi(sk)->conf_len, req->data, len);
3110 l2cap_pi(sk)->conf_len += len;
3128 l2cap_pi(sk)->num_conf_rsp++;
3131 l2cap_pi(sk)->conf_len = 0;
3133 if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_OUTPUT_DONE))
3136 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_INPUT_DONE) {
3137 set_default_fcs(l2cap_pi(sk));
3141 l2cap_pi(sk)->next_tx_seq = 0;
3142 l2cap_pi(sk)->expected_tx_seq = 0;
3144 if (l2cap_pi(sk)->mode == L2CAP_MODE_ERTM)
3151 if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT)) {
3155 l2cap_pi(sk)->num_conf_req++;
3187 if (l2cap_pi(sk)->num_conf_rsp <= L2CAP_CONF_MAX_CONF_RSP) {
3206 l2cap_pi(sk)->num_conf_req++;
3222 l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE;
3224 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_OUTPUT_DONE) {
3225 set_default_fcs(l2cap_pi(sk));
3228 l2cap_pi(sk)->next_tx_seq = 0;
3229 l2cap_pi(sk)->expected_tx_seq = 0;
3231 if (l2cap_pi(sk)->mode == L2CAP_MODE_ERTM)
3258 rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid);
3259 rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid);
3488 struct l2cap_pinfo *pi = l2cap_pi(sk);
3516 struct l2cap_pinfo *pi = l2cap_pi(sk);
3558 struct l2cap_pinfo *pi = l2cap_pi(sk);
3666 struct l2cap_pinfo *pi = l2cap_pi(sk);
3688 l2cap_pi(sk)->retry_count = 1;
3693 l2cap_pi(sk)->conn_state |= L2CAP_CONN_WAIT_F;
3753 struct l2cap_pinfo *pi = l2cap_pi(sk);
3792 struct l2cap_pinfo *pi = l2cap_pi(sk);
3896 l2cap_pi(sk)->buffer_seq_srej =
3897 (l2cap_pi(sk)->buffer_seq_srej + 1) % 64;
3904 struct l2cap_pinfo *pi = l2cap_pi(sk);
3924 struct l2cap_pinfo *pi = l2cap_pi(sk);
3943 struct l2cap_pinfo *pi = l2cap_pi(sk);
3955 l2cap_pi(sk)->conn_state & L2CAP_CONN_WAIT_F) {
4079 struct l2cap_pinfo *pi = l2cap_pi(sk);
4124 struct l2cap_pinfo *pi = l2cap_pi(sk);
4148 struct l2cap_pinfo *pi = l2cap_pi(sk);
4185 struct l2cap_pinfo *pi = l2cap_pi(sk);
4215 l2cap_pi(sk)->conn_state & L2CAP_CONN_WAIT_F) {
4216 del_timer(&l2cap_pi(sk)->monitor_timer);
4217 if (l2cap_pi(sk)->unacked_frames > 0)
4219 l2cap_pi(sk)->conn_state &= ~L2CAP_CONN_WAIT_F;
4246 struct l2cap_pinfo *pi = l2cap_pi(sk);
4328 pi = l2cap_pi(sk);
4415 if (l2cap_pi(sk)->imtu < skb->len)
4485 if (l2cap_pi(sk)->role_switch)
4490 if (l2cap_pi(sk)->role_switch)
4548 if (l2cap_pi(sk)->sec_level == BT_SECURITY_MEDIUM) {
4551 } else if (l2cap_pi(sk)->sec_level == BT_SECURITY_HIGH)
4554 if (l2cap_pi(sk)->sec_level == BT_SECURITY_MEDIUM)
4574 for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
4577 if (l2cap_pi(sk)->conf_state & L2CAP_CONF_CONNECT_PEND) {
4592 req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
4593 req.psm = l2cap_pi(sk)->psm;
4595 l2cap_pi(sk)->ident = l2cap_get_ident(conn);
4596 l2cap_pi(sk)->conf_state |= L2CAP_CONF_CONNECT_PEND;
4598 l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
4617 rsp.scid = cpu_to_le16(l2cap_pi(sk)->dcid);
4618 rsp.dcid = cpu_to_le16(l2cap_pi(sk)->scid);
4621 l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
4729 struct l2cap_pinfo *pi = l2cap_pi(sk);