From: Archie Pusaka <apusaka@google.com>
To: linux-bluetooth <linux-bluetooth@vger.kernel.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: CrosBT Upstreaming <chromeos-bluetooth-upstreaming@chromium.org>,
Archie Pusaka <apusaka@chromium.org>
Subject: [Bluez PATCH 09/62] btio: Inclusive language changes
Date: Fri, 13 Aug 2021 20:17:54 +0800 [thread overview]
Message-ID: <20210813201256.Bluez.9.Ieb652c069b1583fec1439ee784a0f49a02afed11@changeid> (raw)
In-Reply-To: <20210813121848.3686029-1-apusaka@google.com>
From: Archie Pusaka <apusaka@chromium.org>
"central" is preferred, as is reflected in the BT core spec 5.3.
---
android/a2dp.c | 2 +-
btio/btio.c | 42 +++++++++++++++++++++---------------------
btio/btio.h | 2 +-
profiles/audio/a2dp.c | 2 +-
profiles/audio/avctp.c | 2 +-
profiles/sap/server.c | 2 +-
tools/btiotest.c | 8 ++++----
7 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/android/a2dp.c b/android/a2dp.c
index e24f79348d..029107cf5c 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -1692,7 +1692,7 @@ bool bt_a2dp_register(struct ipc *ipc, const bdaddr_t *addr, uint8_t mode)
BT_IO_OPT_SOURCE_BDADDR, &adapter_addr,
BT_IO_OPT_PSM, AVDTP_PSM,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
- BT_IO_OPT_MASTER, true,
+ BT_IO_OPT_CENTRAL, true,
BT_IO_OPT_INVALID);
if (!server) {
error("Failed to listen on AVDTP channel: %s", err->message);
diff --git a/btio/btio.c b/btio/btio.c
index ce958bdd09..bc6ede08fa 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -61,7 +61,7 @@ struct set_opts {
uint16_t mtu;
uint16_t imtu;
uint16_t omtu;
- int master;
+ int central;
uint8_t mode;
int flushable;
uint32_t priority;
@@ -359,7 +359,7 @@ static int l2cap_connect(int sock, const bdaddr_t *dst, uint8_t dst_type,
return 0;
}
-static int l2cap_set_master(int sock, int master)
+static int l2cap_set_central(int sock, int central)
{
int flags;
socklen_t len;
@@ -368,7 +368,7 @@ static int l2cap_set_master(int sock, int master)
if (getsockopt(sock, SOL_L2CAP, L2CAP_LM, &flags, &len) < 0)
return -errno;
- if (master) {
+ if (central) {
if (flags & L2CAP_LM_CENTRAL)
return 0;
flags |= L2CAP_LM_CENTRAL;
@@ -384,7 +384,7 @@ static int l2cap_set_master(int sock, int master)
return 0;
}
-static int rfcomm_set_master(int sock, int master)
+static int rfcomm_set_central(int sock, int central)
{
int flags;
socklen_t len;
@@ -393,7 +393,7 @@ static int rfcomm_set_master(int sock, int master)
if (getsockopt(sock, SOL_RFCOMM, RFCOMM_LM, &flags, &len) < 0)
return -errno;
- if (master) {
+ if (central) {
if (flags & RFCOMM_LM_CENTRAL)
return 0;
flags |= RFCOMM_LM_CENTRAL;
@@ -656,7 +656,7 @@ static gboolean set_le_mode(int sock, uint8_t mode, GError **err)
static gboolean l2cap_set(int sock, uint8_t src_type, int sec_level,
uint16_t imtu, uint16_t omtu, uint8_t mode,
- int master, int flushable, uint32_t priority,
+ int central, int flushable, uint32_t priority,
GError **err)
{
if (imtu || omtu || mode) {
@@ -676,8 +676,8 @@ static gboolean l2cap_set(int sock, uint8_t src_type, int sec_level,
return ret;
}
- if (master >= 0 && l2cap_set_master(sock, master) < 0) {
- ERROR_FAILED(err, "l2cap_set_master", errno);
+ if (central >= 0 && l2cap_set_central(sock, central) < 0) {
+ ERROR_FAILED(err, "l2cap_set_central", errno);
return FALSE;
}
@@ -733,13 +733,13 @@ static int rfcomm_connect(int sock, const bdaddr_t *dst, uint8_t channel)
return 0;
}
-static gboolean rfcomm_set(int sock, int sec_level, int master, GError **err)
+static gboolean rfcomm_set(int sock, int sec_level, int central, GError **err)
{
if (sec_level && !set_sec_level(sock, BT_IO_RFCOMM, sec_level, err))
return FALSE;
- if (master >= 0 && rfcomm_set_master(sock, master) < 0) {
- ERROR_FAILED(err, "rfcomm_set_master", errno);
+ if (central >= 0 && rfcomm_set_central(sock, central) < 0) {
+ ERROR_FAILED(err, "rfcomm_set_central", errno);
return FALSE;
}
@@ -828,7 +828,7 @@ static gboolean parse_set_opts(struct set_opts *opts, GError **err,
/* Set defaults */
opts->type = BT_IO_SCO;
opts->defer = DEFAULT_DEFER_TIMEOUT;
- opts->master = -1;
+ opts->central = -1;
opts->mode = L2CAP_MODE_BASIC;
opts->flushable = -1;
opts->priority = 0;
@@ -889,8 +889,8 @@ static gboolean parse_set_opts(struct set_opts *opts, GError **err,
if (!opts->mtu)
opts->mtu = opts->imtu;
break;
- case BT_IO_OPT_MASTER:
- opts->master = va_arg(args, gboolean);
+ case BT_IO_OPT_CENTRAL:
+ opts->central = va_arg(args, gboolean);
break;
case BT_IO_OPT_MODE:
opts->mode = va_arg(args, int);
@@ -1171,7 +1171,7 @@ parse_opts:
case BT_IO_OPT_IMTU:
*(va_arg(args, uint16_t *)) = l2o.imtu;
break;
- case BT_IO_OPT_MASTER:
+ case BT_IO_OPT_CENTRAL:
len = sizeof(flags);
if (getsockopt(sock, SOL_L2CAP, L2CAP_LM, &flags,
&len) < 0) {
@@ -1336,7 +1336,7 @@ static gboolean rfcomm_get(int sock, GError **err, BtIOOption opt1,
*(va_arg(args, uint8_t *)) = dst.rc_channel;
break;
- case BT_IO_OPT_MASTER:
+ case BT_IO_OPT_CENTRAL:
len = sizeof(flags);
if (getsockopt(sock, SOL_RFCOMM, RFCOMM_LM, &flags,
&len) < 0) {
@@ -1484,7 +1484,7 @@ static gboolean sco_get(int sock, GError **err, BtIOOption opt1, va_list args)
case BT_IO_OPT_DEST_CHANNEL:
case BT_IO_OPT_PSM:
case BT_IO_OPT_CID:
- case BT_IO_OPT_MASTER:
+ case BT_IO_OPT_CENTRAL:
case BT_IO_OPT_MODE:
case BT_IO_OPT_FLUSHABLE:
case BT_IO_OPT_PRIORITY:
@@ -1578,10 +1578,10 @@ gboolean bt_io_set(GIOChannel *io, GError **err, BtIOOption opt1, ...)
switch (type) {
case BT_IO_L2CAP:
return l2cap_set(sock, opts.src_type, opts.sec_level, opts.imtu,
- opts.omtu, opts.mode, opts.master,
+ opts.omtu, opts.mode, opts.central,
opts.flushable, opts.priority, err);
case BT_IO_RFCOMM:
- return rfcomm_set(sock, opts.sec_level, opts.master, err);
+ return rfcomm_set(sock, opts.sec_level, opts.central, err);
case BT_IO_SCO:
return sco_set(sock, opts.mtu, opts.voice, err);
case BT_IO_INVALID:
@@ -1628,7 +1628,7 @@ static GIOChannel *create_io(gboolean server, struct set_opts *opts,
goto failed;
if (!l2cap_set(sock, opts->src_type, opts->sec_level,
opts->imtu, opts->omtu, opts->mode,
- opts->master, opts->flushable, opts->priority,
+ opts->central, opts->flushable, opts->priority,
err))
goto failed;
break;
@@ -1641,7 +1641,7 @@ static GIOChannel *create_io(gboolean server, struct set_opts *opts,
if (rfcomm_bind(sock, &opts->src,
server ? opts->channel : 0, err) < 0)
goto failed;
- if (!rfcomm_set(sock, opts->sec_level, opts->master, err))
+ if (!rfcomm_set(sock, opts->sec_level, opts->central, err))
goto failed;
break;
case BT_IO_SCO:
diff --git a/btio/btio.h b/btio/btio.h
index f0259cf1db..50a2a4dc02 100644
--- a/btio/btio.h
+++ b/btio/btio.h
@@ -36,7 +36,7 @@ typedef enum {
BT_IO_OPT_MTU,
BT_IO_OPT_OMTU,
BT_IO_OPT_IMTU,
- BT_IO_OPT_MASTER,
+ BT_IO_OPT_CENTRAL,
BT_IO_OPT_HANDLE,
BT_IO_OPT_CLASS,
BT_IO_OPT_MODE,
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 86bc02994f..a09ebce086 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -2418,7 +2418,7 @@ static bool a2dp_server_listen(struct a2dp_server *server)
BT_IO_OPT_PSM, AVDTP_PSM,
BT_IO_OPT_MODE, mode,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
- BT_IO_OPT_MASTER, true,
+ BT_IO_OPT_CENTRAL, true,
BT_IO_OPT_INVALID);
if (server->io)
return true;
diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index 50de336181..9f717f35bb 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -1625,7 +1625,7 @@ static GIOChannel *avctp_server_socket(const bdaddr_t *src, gboolean master,
BT_IO_OPT_SOURCE_BDADDR, src,
BT_IO_OPT_PSM, psm,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_MEDIUM,
- BT_IO_OPT_MASTER, master,
+ BT_IO_OPT_CENTRAL, master,
BT_IO_OPT_MODE, mode,
BT_IO_OPT_INVALID);
if (!io) {
diff --git a/profiles/sap/server.c b/profiles/sap/server.c
index 82365fca90..e6f3024ea6 100644
--- a/profiles/sap/server.c
+++ b/profiles/sap/server.c
@@ -1369,7 +1369,7 @@ int sap_server_register(struct btd_adapter *adapter)
btd_adapter_get_address(adapter),
BT_IO_OPT_CHANNEL, SAP_SERVER_CHANNEL,
BT_IO_OPT_SEC_LEVEL, BT_IO_SEC_HIGH,
- BT_IO_OPT_MASTER, TRUE,
+ BT_IO_OPT_CENTRAL, TRUE,
BT_IO_OPT_INVALID);
if (!io) {
error("Can't listen at channel %d.", SAP_SERVER_CHANNEL);
diff --git a/tools/btiotest.c b/tools/btiotest.c
index cb8cc35348..3f4900a5a5 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -343,7 +343,7 @@ static void l2cap_listen(const char *src, uint8_t addr_type, uint16_t psm,
BT_IO_OPT_PSM, psm,
BT_IO_OPT_CID, cid,
BT_IO_OPT_SEC_LEVEL, sec,
- BT_IO_OPT_MASTER, master,
+ BT_IO_OPT_CENTRAL, master,
BT_IO_OPT_INVALID);
else
l2_srv = bt_io_listen(conn, cfm, data,
@@ -353,7 +353,7 @@ static void l2cap_listen(const char *src, uint8_t addr_type, uint16_t psm,
BT_IO_OPT_PSM, psm,
BT_IO_OPT_CID, cid,
BT_IO_OPT_SEC_LEVEL, sec,
- BT_IO_OPT_MASTER, master,
+ BT_IO_OPT_CENTRAL, master,
BT_IO_OPT_INVALID);
if (!l2_srv) {
@@ -427,7 +427,7 @@ static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer,
BT_IO_OPT_SOURCE, src,
BT_IO_OPT_CHANNEL, ch,
BT_IO_OPT_SEC_LEVEL, sec,
- BT_IO_OPT_MASTER, master,
+ BT_IO_OPT_CENTRAL, master,
BT_IO_OPT_INVALID);
else
rc_srv = bt_io_listen(conn, cfm,
@@ -435,7 +435,7 @@ static void rfcomm_listen(const char *src, uint8_t ch, gboolean defer,
&err,
BT_IO_OPT_CHANNEL, ch,
BT_IO_OPT_SEC_LEVEL, sec,
- BT_IO_OPT_MASTER, master,
+ BT_IO_OPT_CENTRAL, master,
BT_IO_OPT_INVALID);
if (!rc_srv) {
--
2.33.0.rc1.237.g0d66db33f3-goog
next prev parent reply other threads:[~2021-08-13 12:20 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 12:17 [Bluez PATCH 00/62] Inclusive language changes Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 01/62] lib: Inclusive language in HCI commands and events Archie Pusaka
2021-08-13 12:49 ` Inclusive language changes bluez.test.bot
2021-08-13 19:26 ` [Bluez PATCH 01/62] lib: Inclusive language in HCI commands and events Marcel Holtmann
2021-08-13 21:47 ` Luiz Augusto von Dentz
2021-08-16 15:59 ` Marcel Holtmann
2021-08-13 12:17 ` [Bluez PATCH 02/62] lib: Inclusive language in consts and strings Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 03/62] tools/hciconfig: Inclusive language update Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 04/62] core: Inclusive language for l2cap Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 05/62] core: Inclusive language for rfcomm Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 06/62] lib: Inclusive language for filtering devices Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 07/62] lib/mgmt: Inclusive language for LTK Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 08/62] doc/mgmt: Inclusive language update Archie Pusaka
2021-08-13 12:17 ` Archie Pusaka [this message]
2021-08-13 12:17 ` [Bluez PATCH 10/62] shared/ad: Inclusive language changes Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 11/62] shared/hfp: " Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 12/62] monitor: Inclusive language in struct member Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 13/62] monitor: Inclusive language in SMP related things Archie Pusaka
2021-08-13 12:17 ` [Bluez PATCH 14/62] monitor: Inclusive language in LE states Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 15/62] monitor: Inclusive language in LL feature Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 16/62] monitor: Inclusive language in link key transaction Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 17/62] monitor: Inclusive language in peripheral broadcast Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 18/62] monitor: Inclusive language in peripheral page response timeout Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 19/62] monitor: Inclusive language in consts and strings Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 20/62] monitor: Inclusive language in filtering devices Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 21/62] emulator: Inclusive language in naming Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 22/62] emulator: Inclusive language in strings Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 23/62] emulator: Inclusive language in filtering device Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 24/62] tools: Inclusive language in referring the central address Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 25/62] tools/parser/hci: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 26/62] tools/parser/smp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 27/62] tools/3dsp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 28/62] tools/mgmt-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 29/62] tools/bdaddr: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 30/62] tools/hciconfig: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 31/62] tools/meshctl: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 32/62] tools/mgmt-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 33/62] tools/parser: Inclusive language in struct member Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 34/62] tools/parser/lmp: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 35/62] tools/parser/avdtp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 36/62] tools/parser/csr: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 37/62] tools/btpclientctl: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 38/62] tools/l2cap-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 39/62] tools/hci-tester: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 40/62] tools/btiotest: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 41/62] tools/hcitool: Inclusive language changes, central peripheral Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 42/62] tools/hcitool: Inclusive language changes, accept list Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 43/62] tools/l2test: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 44/62] tools/rctest: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 45/62] tools/rfcomm: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 46/62] plugins/sixaxis: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 47/62] profiles/audio: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 48/62] profiles/health: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 49/62] sdp: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 50/62] adapter: Inclusive language for central and peripheral Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 51/62] adapter: Inclusive language for storing LTK Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 52/62] adapter: Inclusive language for device filtering Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 53/62] client: Inclusive language changes Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 54/62] mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 55/62] tools/mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 56/62] tools/mesh-gatt: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 57/62] unit/mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 58/62] doc/mesh: " Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 59/62] android: Inclusive language for volume control Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 60/62] android: Inclusive language for describing relation Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 61/62] android: Inclusive language for filtering devices Archie Pusaka
2021-08-13 12:18 ` [Bluez PATCH 62/62] android: Inclusive language in storing LTK Archie Pusaka
2021-08-13 21:42 ` [Bluez PATCH 00/62] Inclusive language changes Luiz Augusto von Dentz
2021-08-14 5:22 ` Archie Pusaka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210813201256.Bluez.9.Ieb652c069b1583fec1439ee784a0f49a02afed11@changeid \
--to=apusaka@google.com \
--cc=apusaka@chromium.org \
--cc=chromeos-bluetooth-upstreaming@chromium.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).