Bluetooth: controller: split: Differentiate extended ll_adv_params_set

Differentiate call to ll_adv_params_set, whether used by
legacy LE Set Advertising Parameters or LE Set Extended
Advertising Parameters.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2020-04-08 16:23:13 +05:30 committed by Carles Cufí
commit f84ebf4869
2 changed files with 10 additions and 11 deletions

View file

@ -1640,25 +1640,23 @@ static void le_set_ext_adv_param(struct net_buf *buf, struct net_buf **evt)
struct bt_hci_cp_le_set_ext_adv_param *cmd = (void *)buf->data; struct bt_hci_cp_le_set_ext_adv_param *cmd = (void *)buf->data;
struct bt_hci_rp_le_set_ext_adv_param *rp; struct bt_hci_rp_le_set_ext_adv_param *rp;
uint32_t min_interval; uint32_t min_interval;
uint8_t adv_type = 0;
uint16_t evt_prop; uint16_t evt_prop;
uint8_t tx_pwr; uint8_t tx_pwr;
uint8_t status; uint8_t status;
uint8_t phy_p;
uint8_t phy_s;
evt_prop = sys_le16_to_cpu(cmd->props); evt_prop = sys_le16_to_cpu(cmd->props);
min_interval = sys_get_le24(cmd->prim_min_interval); min_interval = sys_get_le24(cmd->prim_min_interval);
tx_pwr = cmd->tx_power; tx_pwr = cmd->tx_power;
phy_p = BIT(cmd->prim_adv_phy - 1);
if (!(evt_prop & BIT(4))) { phy_s = BIT(cmd->sec_adv_phy - 1);
adv_type = 0x05; /* Extending advertising */
}
status = ll_adv_params_set(cmd->handle, evt_prop, min_interval, status = ll_adv_params_set(cmd->handle, evt_prop, min_interval,
adv_type, cmd->own_addr_type, PDU_ADV_TYPE_EXT_IND, cmd->own_addr_type,
cmd->peer_addr.type, cmd->peer_addr.a.val, cmd->peer_addr.type, cmd->peer_addr.a.val,
cmd->prim_channel_map, cmd->filter_policy, cmd->prim_channel_map, cmd->filter_policy,
&tx_pwr, cmd->prim_adv_phy, &tx_pwr, phy_p, cmd->sec_adv_max_skip, phy_s,
cmd->sec_adv_max_skip, cmd->sec_adv_phy,
cmd->sid, cmd->scan_req_notify_enable); cmd->sid, cmd->scan_req_notify_enable);
rp = hci_cmd_complete(evt, sizeof(*rp)); rp = hci_cmd_complete(evt, sizeof(*rp));

View file

@ -124,8 +124,8 @@ uint8_t ll_adv_params_set(uint16_t interval, uint8_t adv_type,
adv->lll.phy_p = BIT(0); adv->lll.phy_p = BIT(0);
/* extended */ /* extended adv param set */
if (adv_type > 0x04) { if (adv_type == PDU_ADV_TYPE_EXT_IND) {
/* legacy */ /* legacy */
if (evt_prop & BIT(4)) { if (evt_prop & BIT(4)) {
uint8_t const leg_adv_type[] = { 0x03, 0x04, 0x02, 0x00}; uint8_t const leg_adv_type[] = { 0x03, 0x04, 0x02, 0x00};
@ -145,7 +145,8 @@ uint8_t ll_adv_params_set(uint16_t interval, uint8_t adv_type,
return BT_HCI_ERR_INVALID_PARAM; return BT_HCI_ERR_INVALID_PARAM;
} }
adv_type = 0x05; /* PDU_ADV_TYPE_EXT_IND */ adv_type = 0x05; /* PDU_ADV_TYPE_EXT_IND in */
/* pdu_adv_type array. */
adv->lll.phy_p = phy_p; adv->lll.phy_p = phy_p;
} }