Commit 073d1cf3 authored by Johan Hedberg's avatar Johan Hedberg Committed by Gustavo Padovan

Bluetooth: Rename L2CAP_CID_LE_DATA to L2CAP_CID_ATT

In future Core Specification versions the ATT CID will be just one of
many possible CIDs that can be used for data transfer. Therefore, it
makes sense to rename the define for the ATT CID to something less
ambigous.
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent c5623556
...@@ -242,7 +242,7 @@ struct l2cap_conn_rsp { ...@@ -242,7 +242,7 @@ struct l2cap_conn_rsp {
#define L2CAP_CID_SIGNALING 0x0001 #define L2CAP_CID_SIGNALING 0x0001
#define L2CAP_CID_CONN_LESS 0x0002 #define L2CAP_CID_CONN_LESS 0x0002
#define L2CAP_CID_A2MP 0x0003 #define L2CAP_CID_A2MP 0x0003
#define L2CAP_CID_LE_DATA 0x0004 #define L2CAP_CID_ATT 0x0004
#define L2CAP_CID_LE_SIGNALING 0x0005 #define L2CAP_CID_LE_SIGNALING 0x0005
#define L2CAP_CID_SMP 0x0006 #define L2CAP_CID_SMP 0x0006
#define L2CAP_CID_DYN_START 0x0040 #define L2CAP_CID_DYN_START 0x0040
......
...@@ -504,8 +504,8 @@ void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan) ...@@ -504,8 +504,8 @@ void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan)
if (conn->hcon->type == LE_LINK) { if (conn->hcon->type == LE_LINK) {
/* LE connection */ /* LE connection */
chan->omtu = L2CAP_DEFAULT_MTU; chan->omtu = L2CAP_DEFAULT_MTU;
chan->scid = L2CAP_CID_LE_DATA; chan->scid = L2CAP_CID_ATT;
chan->dcid = L2CAP_CID_LE_DATA; chan->dcid = L2CAP_CID_ATT;
} else { } else {
/* Alloc CID for connection-oriented socket */ /* Alloc CID for connection-oriented socket */
chan->scid = l2cap_alloc_cid(conn); chan->scid = l2cap_alloc_cid(conn);
...@@ -1344,7 +1344,7 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn) ...@@ -1344,7 +1344,7 @@ static void l2cap_le_conn_ready(struct l2cap_conn *conn)
BT_DBG(""); BT_DBG("");
/* Check if we have socket listening on cid */ /* Check if we have socket listening on cid */
pchan = l2cap_global_chan_by_scid(BT_LISTEN, L2CAP_CID_LE_DATA, pchan = l2cap_global_chan_by_scid(BT_LISTEN, L2CAP_CID_ATT,
conn->src, conn->dst); conn->src, conn->dst);
if (!pchan) if (!pchan)
return; return;
...@@ -1792,7 +1792,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid, ...@@ -1792,7 +1792,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,
auth_type = l2cap_get_auth_type(chan); auth_type = l2cap_get_auth_type(chan);
if (chan->dcid == L2CAP_CID_LE_DATA) if (chan->dcid == L2CAP_CID_ATT)
hcon = hci_connect(hdev, LE_LINK, dst, dst_type, hcon = hci_connect(hdev, LE_LINK, dst, dst_type,
chan->sec_level, auth_type); chan->sec_level, auth_type);
else else
...@@ -6397,7 +6397,7 @@ static void l2cap_att_channel(struct l2cap_conn *conn, ...@@ -6397,7 +6397,7 @@ static void l2cap_att_channel(struct l2cap_conn *conn,
{ {
struct l2cap_chan *chan; struct l2cap_chan *chan;
chan = l2cap_global_chan_by_scid(0, L2CAP_CID_LE_DATA, chan = l2cap_global_chan_by_scid(0, L2CAP_CID_ATT,
conn->src, conn->dst); conn->src, conn->dst);
if (!chan) if (!chan)
goto drop; goto drop;
...@@ -6448,7 +6448,7 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb) ...@@ -6448,7 +6448,7 @@ static void l2cap_recv_frame(struct l2cap_conn *conn, struct sk_buff *skb)
l2cap_conless_channel(conn, psm, skb); l2cap_conless_channel(conn, psm, skb);
break; break;
case L2CAP_CID_LE_DATA: case L2CAP_CID_ATT:
l2cap_att_channel(conn, skb); l2cap_att_channel(conn, skb);
break; break;
...@@ -6574,7 +6574,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) ...@@ -6574,7 +6574,7 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
continue; continue;
} }
if (chan->scid == L2CAP_CID_LE_DATA) { if (chan->scid == L2CAP_CID_ATT) {
if (!status && encrypt) { if (!status && encrypt) {
chan->sec_level = hcon->sec_level; chan->sec_level = hcon->sec_level;
l2cap_chan_ready(chan); l2cap_chan_ready(chan);
......
...@@ -466,7 +466,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname, ...@@ -466,7 +466,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int level, int optname,
static bool l2cap_valid_mtu(struct l2cap_chan *chan, u16 mtu) static bool l2cap_valid_mtu(struct l2cap_chan *chan, u16 mtu)
{ {
switch (chan->scid) { switch (chan->scid) {
case L2CAP_CID_LE_DATA: case L2CAP_CID_ATT:
if (mtu < L2CAP_LE_MIN_MTU) if (mtu < L2CAP_LE_MIN_MTU)
return false; return false;
break; break;
...@@ -630,7 +630,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ...@@ -630,7 +630,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname,
conn = chan->conn; conn = chan->conn;
/*change security for LE channels */ /*change security for LE channels */
if (chan->scid == L2CAP_CID_LE_DATA) { if (chan->scid == L2CAP_CID_ATT) {
if (!conn->hcon->out) { if (!conn->hcon->out) {
err = -EINVAL; err = -EINVAL;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment