Bluetooth: HCI: Naming consistency tweaks

For consistency, "chan" and "param" are used wherever "channel" and
"parameters" are the words in the specification.

Change-Id: I778a8501ae6af991618c14cc6e395d765a9ae102
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2017-04-11 08:39:58 +02:00 committed by Johan Hedberg
commit 8f9776073f
4 changed files with 40 additions and 39 deletions

View file

@ -96,15 +96,15 @@ static inline bool bt_addr_le_is_identity(const bt_addr_le_t *addr)
#define BT_HCI_ERR_MEM_CAPACITY_EXCEEDED 0x07
#define BT_HCI_ERR_CMD_DISALLOWED 0x0c
#define BT_HCI_ERR_INSUFFICIENT_RESOURCES 0x0d
#define BT_HCI_ERR_UNSUPP_FEATURE_PARAMS_VAL 0x11
#define BT_HCI_ERR_INVALID_PARAMS 0x12
#define BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL 0x11
#define BT_HCI_ERR_INVALID_PARAM 0x12
#define BT_HCI_ERR_REMOTE_USER_TERM_CONN 0x13
#define BT_HCI_ERR_PAIRING_NOT_ALLOWED 0x18
#define BT_HCI_ERR_UNSUPP_REMOTE_FEATURE 0x1a
#define BT_HCI_ERR_INVALID_LL_PARAMS 0x1e
#define BT_HCI_ERR_INVALID_LL_PARAM 0x1e
#define BT_HCI_ERR_UNSPECIFIED 0x1f
#define BT_HCI_ERR_PAIRING_NOT_SUPPORTED 0x29
#define BT_HCI_ERR_UNACCEPT_CONN_PARAMS 0x3b
#define BT_HCI_ERR_UNACCEPT_CONN_PARAM 0x3b
/* EIR/AD data type definitions */
#define BT_DATA_FLAGS 0x01 /* AD flags */
@ -640,8 +640,8 @@ struct bt_hci_cp_le_set_adv_param {
uint8_t filter_policy;
} __packed;
#define BT_HCI_OP_LE_READ_ADV_CH_TX_POWER BT_OP(BT_OGF_LE, 0x0007)
struct bt_hci_rp_le_read_ch_tx_power {
#define BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER BT_OP(BT_OGF_LE, 0x0007)
struct bt_hci_rp_le_read_chan_tx_power {
uint8_t status;
int8_t tx_power_level;
} __packed;
@ -667,11 +667,11 @@ struct bt_hci_cp_le_set_adv_enable {
} __packed;
/* Scan types */
#define BT_HCI_OP_LE_SET_SCAN_PARAMS BT_OP(BT_OGF_LE, 0x000b)
#define BT_HCI_OP_LE_SET_SCAN_PARAM BT_OP(BT_OGF_LE, 0x000b)
#define BT_HCI_LE_SCAN_PASSIVE 0x00
#define BT_HCI_LE_SCAN_ACTIVE 0x01
struct bt_hci_cp_le_set_scan_params {
struct bt_hci_cp_le_set_scan_param {
uint8_t scan_type;
uint16_t interval;
uint16_t window;
@ -738,13 +738,13 @@ struct hci_cp_le_conn_update {
uint16_t max_ce_len;
} __packed;
#define BT_HCI_OP_LE_SET_HOST_CH_CLASSIF BT_OP(BT_OGF_LE, 0x0014)
struct bt_hci_cp_le_set_host_ch_classif {
#define BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF BT_OP(BT_OGF_LE, 0x0014)
struct bt_hci_cp_le_set_host_chan_classif {
uint8_t ch_map[5];
} __packed;
#define BT_HCI_OP_LE_READ_CH_MAP BT_OP(BT_OGF_LE, 0x0015)
struct bt_hci_cp_le_read_ch_map {
#define BT_HCI_OP_LE_READ_CHAN_MAP BT_OP(BT_OGF_LE, 0x0015)
struct bt_hci_cp_le_read_chan_map {
uint16_t handle;
} __packed;
struct bt_hci_rp_le_read_ch_map {
@ -1019,8 +1019,8 @@ struct bt_hci_cp_le_set_adv_set_random_addr {
#define BT_HCI_LE_ADV_PROP_ANON BIT(5)
#define BT_HCI_LE_ADV_PROP_TX_POWER BIT(6)
#define BT_HCI_OP_LE_SET_EXT_ADV_PARAMS BT_OP(BT_OGF_LE, 0x0036)
struct bt_hci_cp_le_set_ext_adv_params {
#define BT_HCI_OP_LE_SET_EXT_ADV_PARAM BT_OP(BT_OGF_LE, 0x0036)
struct bt_hci_cp_le_set_ext_adv_param {
uint8_t handle;
uint16_t props;
uint8_t prim_min_interval[3];
@ -1100,8 +1100,8 @@ struct bt_hci_cp_le_remove_adv_set {
#define BT_HCI_OP_CLEAR_ADV_SETS BT_OP(BT_OGF_LE, 0x003d)
#define BT_HCI_OP_LE_SET_PER_ADV_PARAMS BT_OP(BT_OGF_LE, 0x003e)
struct bt_hci_cp_le_set_per_adv_params {
#define BT_HCI_OP_LE_SET_PER_ADV_PARAM BT_OP(BT_OGF_LE, 0x003e)
struct bt_hci_cp_le_set_per_adv_param {
uint8_t handle;
uint16_t min_interval;
uint16_t max_interval;
@ -1122,7 +1122,7 @@ struct bt_hci_cp_le_set_per_adv_enable {
uint8_t handle;
} __packed;
#define BT_HCI_OP_LE_SET_EXT_SCAN_PARAMS BT_OP(BT_OGF_LE, 0x0041)
#define BT_HCI_OP_LE_SET_EXT_SCAN_PARAM BT_OP(BT_OGF_LE, 0x0041)
struct bt_hci_ext_scan_phy {
uint8_t type;
uint16_t interval;
@ -1133,7 +1133,7 @@ struct bt_hci_ext_scan_phy {
#define BT_HCI_LE_EXT_SCAN_PHY_2M BIT(1)
#define BT_HCI_LE_EXT_SCAN_PHY_CODED BIT(2)
struct bt_hci_cp_le_set_ext_scan_params {
struct bt_hci_cp_le_set_ext_scan_param {
uint8_t own_addr_type;
uint8_t filter_policy;
uint8_t phys;

View file

@ -370,9 +370,9 @@ static void le_set_adv_param(struct net_buf *buf, struct net_buf **evt)
ccst->status = 0x00;
}
static void le_read_adv_ch_tx_power(struct net_buf *buf, struct net_buf **evt)
static void le_read_adv_chan_tx_power(struct net_buf *buf, struct net_buf **evt)
{
struct bt_hci_rp_le_read_ch_tx_power *rp;
struct bt_hci_rp_le_read_chan_tx_power *rp;
rp = cmd_complete(evt, sizeof(*rp));
@ -415,9 +415,9 @@ static void le_set_adv_enable(struct net_buf *buf, struct net_buf **evt)
ccst->status = (!status) ? 0x00 : BT_HCI_ERR_CMD_DISALLOWED;
}
static void le_set_scan_params(struct net_buf *buf, struct net_buf **evt)
static void le_set_scan_param(struct net_buf *buf, struct net_buf **evt)
{
struct bt_hci_cp_le_set_scan_params *cmd = (void *)buf->data;
struct bt_hci_cp_le_set_scan_param *cmd = (void *)buf->data;
struct bt_hci_evt_cc_status *ccst;
uint16_t interval;
uint16_t window;
@ -557,9 +557,9 @@ static void le_conn_update(struct net_buf *buf, struct net_buf **evt)
*evt = cmd_status((!status) ? 0x00 : BT_HCI_ERR_CMD_DISALLOWED);
}
static void le_set_host_ch_classif(struct net_buf *buf, struct net_buf **evt)
static void le_set_host_chan_classif(struct net_buf *buf, struct net_buf **evt)
{
struct bt_hci_cp_le_set_host_ch_classif *cmd = (void *)buf->data;
struct bt_hci_cp_le_set_host_chan_classif *cmd = (void *)buf->data;
struct bt_hci_evt_cc_status *ccst;
uint32_t status;
@ -740,7 +740,7 @@ static void le_write_default_data_len(struct net_buf *buf,
status = ll_length_default_set(cmd->max_tx_octets, cmd->max_tx_time);
ccst = cmd_complete(evt, sizeof(*ccst));
ccst->status = (!status) ? 0x00 : BT_HCI_ERR_INVALID_LL_PARAMS;
ccst->status = (!status) ? 0x00 : BT_HCI_ERR_INVALID_LL_PARAM;
}
static void le_read_max_data_len(struct net_buf *buf, struct net_buf **evt)
@ -779,8 +779,8 @@ static int controller_cmd_handle(uint8_t ocf, struct net_buf *cmd,
le_set_adv_param(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_READ_ADV_CH_TX_POWER):
le_read_adv_ch_tx_power(cmd, evt);
case BT_OCF(BT_HCI_OP_LE_READ_ADV_CHAN_TX_POWER):
le_read_adv_chan_tx_power(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_SET_ADV_DATA):
@ -795,8 +795,8 @@ static int controller_cmd_handle(uint8_t ocf, struct net_buf *cmd,
le_set_adv_enable(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_SET_SCAN_PARAMS):
le_set_scan_params(cmd, evt);
case BT_OCF(BT_HCI_OP_LE_SET_SCAN_PARAM):
le_set_scan_param(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_SET_SCAN_ENABLE):
@ -831,8 +831,8 @@ static int controller_cmd_handle(uint8_t ocf, struct net_buf *cmd,
le_conn_update(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_SET_HOST_CH_CLASSIF):
le_set_host_ch_classif(cmd, evt);
case BT_OCF(BT_HCI_OP_LE_SET_HOST_CHAN_CLASSIF):
le_set_host_chan_classif(cmd, evt);
break;
case BT_OCF(BT_HCI_OP_LE_READ_REMOTE_FEATURES):

View file

@ -872,7 +872,7 @@ static int le_conn_param_req(struct net_buf *buf)
if (!le_param_req(conn, &param)) {
err = le_conn_param_neg_reply(handle,
BT_HCI_ERR_INVALID_LL_PARAMS);
BT_HCI_ERR_INVALID_LL_PARAM);
} else {
err = le_conn_param_req_reply(handle, &param);
}
@ -1393,14 +1393,14 @@ static void io_capa_resp(struct net_buf *buf)
if (evt->authentication > BT_HCI_GENERAL_BONDING_MITM) {
BT_ERR("Invalid remote authentication requirements");
io_capa_neg_reply(&evt->bdaddr,
BT_HCI_ERR_UNSUPP_FEATURE_PARAMS_VAL);
BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL);
return;
}
if (evt->capability > BT_IO_NO_INPUT_OUTPUT) {
BT_ERR("Invalid remote io capability requirements");
io_capa_neg_reply(&evt->bdaddr,
BT_HCI_ERR_UNSUPP_FEATURE_PARAMS_VAL);
BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL);
return;
}
@ -2374,11 +2374,11 @@ static int start_le_scan(uint8_t scan_type, uint16_t interval, uint16_t window,
uint8_t filter_dup)
{
struct net_buf *buf, *rsp;
struct bt_hci_cp_le_set_scan_params *set_param;
struct bt_hci_cp_le_set_scan_param *set_param;
struct bt_hci_cp_le_set_scan_enable *scan_enable;
int err;
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_PARAMS,
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_PARAM,
sizeof(*set_param));
if (!buf) {
return -ENOBUFS;
@ -2419,7 +2419,7 @@ static int start_le_scan(uint8_t scan_type, uint16_t interval, uint16_t window,
}
}
bt_hci_cmd_send(BT_HCI_OP_LE_SET_SCAN_PARAMS, buf);
bt_hci_cmd_send(BT_HCI_OP_LE_SET_SCAN_PARAM, buf);
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_SCAN_ENABLE,
sizeof(*scan_enable));
if (!buf) {
@ -3900,7 +3900,8 @@ int bt_le_adv_start(const struct bt_le_adv_param *param,
}
}
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM, sizeof(*set_param));
buf = bt_hci_cmd_create(BT_HCI_OP_LE_SET_ADV_PARAM,
sizeof(*set_param));
if (!buf) {
return -ENOBUFS;
}

View file

@ -244,7 +244,7 @@ static void le_gen_dhkey(struct net_buf *buf)
}
if (buf->len < sizeof(struct bt_hci_cp_le_generate_dhkey)) {
status = BT_HCI_ERR_INVALID_PARAMS;
status = BT_HCI_ERR_INVALID_PARAM;
goto send_status;
}