Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60b021bb authored by Henri Chataing's avatar Henri Chataing
Browse files

Remove unused legacy HCI command serializers

btsnd_hcic_accept_cis_req
btsnd_hcic_accept_conn
btsnd_hcic_ble_enh_rx_test
btsnd_hcic_ble_enh_tx_test
btsnd_hcic_change_conn_type
btsnd_hcic_rej_cis_req

Bug: 331817295
Test: m com.android.btservices
Flag: EXEMPT, dead code removal
Change-Id: I79d5fec628d40780e660e5bf3612b29f024cae8f
parent 6541142b
Loading
Loading
Loading
Loading
+0 −65
Original line number Diff line number Diff line
@@ -397,42 +397,6 @@ void btsnd_hcic_ble_set_data_length(uint16_t conn_handle, uint16_t tx_octets,
  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_ble_enh_rx_test(uint8_t rx_chan, uint8_t phy,
                                uint8_t mod_index) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);

  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_ENH_RX_TEST;
  p->offset = 0;

  UINT16_TO_STREAM(pp, HCI_BLE_ENH_RECEIVER_TEST);
  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_ENH_RX_TEST);

  UINT8_TO_STREAM(pp, rx_chan);
  UINT8_TO_STREAM(pp, phy);
  UINT8_TO_STREAM(pp, mod_index);

  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_ble_enh_tx_test(uint8_t tx_chan, uint8_t data_len,
                                uint8_t payload, uint8_t phy) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);

  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_BLE_ENH_TX_TEST;
  p->offset = 0;

  UINT16_TO_STREAM(pp, HCI_BLE_ENH_TRANSMITTER_TEST);
  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_BLE_ENH_TX_TEST);
  UINT8_TO_STREAM(pp, tx_chan);
  UINT8_TO_STREAM(pp, data_len);
  UINT8_TO_STREAM(pp, payload);
  UINT8_TO_STREAM(pp, phy);

  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_ble_set_extended_scan_params(uint8_t own_address_type,
                                             uint8_t scanning_filter_policy,
                                             uint8_t scanning_phys,
@@ -547,35 +511,6 @@ void btsnd_hcic_remove_cig(uint8_t cig_id,
                            std::move(cb));
}

void btsnd_hcic_accept_cis_req(uint16_t conn_handle) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);

  const int param_len = 2;
  p->len = HCIC_PREAMBLE_SIZE + param_len;
  p->offset = 0;

  UINT16_TO_STREAM(pp, HCI_LE_ACCEPT_CIS_REQ);
  UINT8_TO_STREAM(pp, param_len);

  UINT16_TO_STREAM(pp, conn_handle);

  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_rej_cis_req(uint16_t conn_handle, uint8_t reason,
                            base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
  const int params_len = 3;
  uint8_t param[params_len];
  uint8_t* pp = param;

  UINT16_TO_STREAM(pp, conn_handle);
  UINT8_TO_STREAM(pp, reason);

  btu_hcif_send_cmd_with_cb(FROM_HERE, HCI_LE_REJ_CIS_REQ, param, params_len,
                            std::move(cb));
}

void btsnd_hcic_req_peer_sca(uint16_t conn_handle) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);
+0 −15
Original line number Diff line number Diff line
@@ -522,21 +522,6 @@ void btsnd_hcic_create_conn_cancel(const RawAddress& dest) {
  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_accept_conn(const RawAddress& dest, uint8_t role) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);

  p->len = HCIC_PREAMBLE_SIZE + HCIC_PARAM_SIZE_ACCEPT_CONN;
  p->offset = 0;

  UINT16_TO_STREAM(pp, HCI_ACCEPT_CONNECTION_REQUEST);
  UINT8_TO_STREAM(pp, HCIC_PARAM_SIZE_ACCEPT_CONN);
  BDADDR_TO_STREAM(pp, dest);
  UINT8_TO_STREAM(pp, role);

  btu_hcif_send_cmd(LOCAL_BR_EDR_CONTROLLER_ID, p);
}

void btsnd_hcic_reject_conn(const RawAddress& dest, uint8_t reason) {
  BT_HDR* p = (BT_HDR*)osi_malloc(HCI_CMD_BUF_SIZE);
  uint8_t* pp = (uint8_t*)(p + 1);
+4 −35
Original line number Diff line number Diff line
@@ -60,69 +60,45 @@ const Interface& GetInterface();
/* Add SCO Connection */
void btsnd_hcic_add_SCO_conn(uint16_t handle, uint16_t packet_types);

/* Add SCO Connection */

/* Create Connection Cancel */
void btsnd_hcic_create_conn_cancel(const RawAddress& dest);

/* Create Connection Cancel */

/* Accept Connection Request */
void btsnd_hcic_accept_conn(const RawAddress& bd_addr, uint8_t role);

/* Accept Connection Request */

/* Reject Connection Request */
void btsnd_hcic_reject_conn(const RawAddress& bd_addr, uint8_t reason);

/* Reject Connection Request */

/* Link Key Request Reply */
void btsnd_hcic_link_key_req_reply(const RawAddress& bd_addr,
                                   const LinkKey& link_key);

/* Link Key Request Reply  */

/* Link Key Request Neg Reply */
void btsnd_hcic_link_key_neg_reply(const RawAddress& bd_addr);

/* Link Key Request Neg Reply  */

/* PIN Code Request Reply */
void btsnd_hcic_pin_code_req_reply(const RawAddress& bd_addr,
                                   uint8_t pin_code_len, PIN_CODE pin_code);

/* PIN Code Request Reply  */

/* Link Key Request Neg Reply */
void btsnd_hcic_pin_code_neg_reply(const RawAddress& bd_addr);

/* Link Key Request Neg Reply  */

/* Change Connection Type */
void btsnd_hcic_change_conn_type(uint16_t handle, uint16_t packet_types);

/* Change Connection Type */

void btsnd_hcic_auth_request(uint16_t handle); /* Authentication Request */

/* Set Connection Encryption */
void btsnd_hcic_set_conn_encrypt(uint16_t handle, bool enable);
/* Set Connection Encryption */

/* Remote Name Request */
void btsnd_hcic_rmt_name_req(const RawAddress& bd_addr,
                             uint8_t page_scan_rep_mode, uint8_t page_scan_mode,
                             uint16_t clock_offset);
/* Remote Name Request */

/* Remote Name Request Cancel */
void btsnd_hcic_rmt_name_req_cancel(const RawAddress& bd_addr);
/* Remote Name Request Cancel */

/* Remote Extended Features */
void btsnd_hcic_rmt_ext_features(uint16_t handle, uint8_t page_num);
/* Remote Extended Features */

void btsnd_hcic_rmt_ver_req(uint16_t handle); /* Remote Version Info Request */
void btsnd_hcic_read_rmt_clk_offset(uint16_t handle); /* Remote Clock Offset */
@@ -147,24 +123,22 @@ void btsnd_hcic_hold_mode(uint16_t handle, uint16_t max_hold_period,
void btsnd_hcic_sniff_mode(uint16_t handle, uint16_t max_sniff_period,
                           uint16_t min_sniff_period, uint16_t sniff_attempt,
                           uint16_t sniff_timeout);
/* Sniff Mode */

void btsnd_hcic_exit_sniff_mode(uint16_t handle); /* Exit Sniff Mode */
/* Exit Sniff Mode */
void btsnd_hcic_exit_sniff_mode(uint16_t handle);

/* Park Mode */
void btsnd_hcic_park_mode(uint16_t handle, uint16_t beacon_max_interval,
                          uint16_t beacon_min_interval);
/* Park Mode */

void btsnd_hcic_exit_park_mode(uint16_t handle); /* Exit Park Mode */
/* Exit Park Mode */
void btsnd_hcic_exit_park_mode(uint16_t handle);

/* Write Policy Settings */
void btsnd_hcic_write_policy_set(uint16_t handle, uint16_t settings);
/* Write Policy Settings */

/* Write Default Policy Settings */
void btsnd_hcic_write_def_policy_set(uint16_t settings);
/* Write Default Policy Settings */

/******************************************
 *    Lisbon Features
@@ -430,11 +404,6 @@ void btsnd_hcic_create_cis(uint8_t num_cis,
void btsnd_hcic_remove_cig(uint8_t cig_id,
                           base::OnceCallback<void(uint8_t*, uint16_t)> cb);

void btsnd_hcic_accept_cis_req(uint16_t conn_handle);

void btsnd_hcic_rej_cis_req(uint16_t conn_handle, uint8_t reason,
                            base::OnceCallback<void(uint8_t*, uint16_t)> cb);

void btsnd_hcic_req_peer_sca(uint16_t conn_handle);

void btsnd_hcic_create_big(uint8_t big_handle, uint8_t adv_handle,
+0 −26
Original line number Diff line number Diff line
@@ -39,9 +39,6 @@ struct btsnd_hci_ble_clear_periodic_advertiser_list
    btsnd_hci_ble_clear_periodic_advertiser_list;
struct btsnd_hci_ble_remove_device_from_periodic_advertiser_list
    btsnd_hci_ble_remove_device_from_periodic_advertiser_list;
struct btsnd_hcic_accept_cis_req btsnd_hcic_accept_cis_req;
struct btsnd_hcic_ble_enh_rx_test btsnd_hcic_ble_enh_rx_test;
struct btsnd_hcic_ble_enh_tx_test btsnd_hcic_ble_enh_tx_test;
struct btsnd_hcic_ble_ltk_req_neg_reply btsnd_hcic_ble_ltk_req_neg_reply;
struct btsnd_hcic_ble_ltk_req_reply btsnd_hcic_ble_ltk_req_reply;
struct btsnd_hcic_ble_periodic_advertising_create_sync
@@ -86,7 +83,6 @@ struct btsnd_hcic_ble_write_adv_params btsnd_hcic_ble_write_adv_params;
struct btsnd_hcic_create_big btsnd_hcic_create_big;
struct btsnd_hcic_create_cis btsnd_hcic_create_cis;
struct btsnd_hcic_read_iso_link_quality btsnd_hcic_read_iso_link_quality;
struct btsnd_hcic_rej_cis_req btsnd_hcic_rej_cis_req;
struct btsnd_hcic_remove_cig btsnd_hcic_remove_cig;
struct btsnd_hcic_remove_iso_data_path btsnd_hcic_remove_iso_data_path;
struct btsnd_hcic_req_peer_sca btsnd_hcic_req_peer_sca;
@@ -128,22 +124,6 @@ void btsnd_hci_ble_remove_device_from_periodic_advertiser_list(
      btsnd_hci_ble_remove_device_from_periodic_advertiser_list(
          adv_addr_type, adv_addr, adv_sid, std::move(cb));
}
void btsnd_hcic_accept_cis_req(uint16_t conn_handle) {
  inc_func_call_count(__func__);
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_accept_cis_req(conn_handle);
}
void btsnd_hcic_ble_enh_rx_test(uint8_t rx_chan, uint8_t phy,
                                uint8_t mod_index) {
  inc_func_call_count(__func__);
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_enh_rx_test(rx_chan, phy,
                                                                mod_index);
}
void btsnd_hcic_ble_enh_tx_test(uint8_t tx_chan, uint8_t data_len,
                                uint8_t payload, uint8_t phy) {
  inc_func_call_count(__func__);
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_enh_tx_test(
      tx_chan, data_len, payload, phy);
}
void btsnd_hcic_ble_ltk_req_neg_reply(uint16_t handle) {
  inc_func_call_count(__func__);
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_ble_ltk_req_neg_reply(handle);
@@ -344,12 +324,6 @@ void btsnd_hcic_read_iso_link_quality(
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_read_iso_link_quality(
      iso_handle, std::move(cb));
}
void btsnd_hcic_rej_cis_req(uint16_t conn_handle, uint8_t reason,
                            base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
  inc_func_call_count(__func__);
  test::mock::stack_hcic_hciblecmds::btsnd_hcic_rej_cis_req(conn_handle, reason,
                                                            std::move(cb));
}
void btsnd_hcic_remove_cig(uint8_t cig_id,
                           base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
  inc_func_call_count(__func__);
+0 −52
Original line number Diff line number Diff line
@@ -88,16 +88,6 @@ struct btsnd_hci_ble_remove_device_from_periodic_advertiser_list {
extern struct btsnd_hci_ble_remove_device_from_periodic_advertiser_list
    btsnd_hci_ble_remove_device_from_periodic_advertiser_list;

// Name: btsnd_hcic_accept_cis_req
// Params: uint16_t conn_handle
// Return: void
struct btsnd_hcic_accept_cis_req {
  std::function<void(uint16_t conn_handle)> body{
      [](uint16_t /* conn_handle */) {}};
  void operator()(uint16_t conn_handle) { body(conn_handle); };
};
extern struct btsnd_hcic_accept_cis_req btsnd_hcic_accept_cis_req;

// Name: btsnd_hcic_ble_add_device_resolving_list
// Params: uint8_t addr_type_peer, const RawAddress& bda_peer, const Octet16&
// irk_peer, const Octet16& irk_local Return: void
@@ -125,33 +115,6 @@ struct btsnd_hcic_ble_clear_resolving_list {
extern struct btsnd_hcic_ble_clear_resolving_list
    btsnd_hcic_ble_clear_resolving_list;

// Name: btsnd_hcic_ble_enh_rx_test
// Params: uint8_t rx_chan, uint8_t phy, uint8_t mod_index
// Return: void
struct btsnd_hcic_ble_enh_rx_test {
  std::function<void(uint8_t rx_chan, uint8_t phy, uint8_t mod_index)> body{
      [](uint8_t /* rx_chan */, uint8_t /* phy */, uint8_t /* mod_index */) {}};
  void operator()(uint8_t rx_chan, uint8_t phy, uint8_t mod_index) {
    body(rx_chan, phy, mod_index);
  };
};
extern struct btsnd_hcic_ble_enh_rx_test btsnd_hcic_ble_enh_rx_test;

// Name: btsnd_hcic_ble_enh_tx_test
// Params: uint8_t tx_chan, uint8_t data_len, uint8_t payload, uint8_t phy
// Return: void
struct btsnd_hcic_ble_enh_tx_test {
  std::function<void(uint8_t tx_chan, uint8_t data_len, uint8_t payload,
                     uint8_t phy)>
      body{[](uint8_t /* tx_chan */, uint8_t /* data_len */,
              uint8_t /* payload */, uint8_t /* phy */) {}};
  void operator()(uint8_t tx_chan, uint8_t data_len, uint8_t payload,
                  uint8_t phy) {
    body(tx_chan, data_len, payload, phy);
  };
};
extern struct btsnd_hcic_ble_enh_tx_test btsnd_hcic_ble_enh_tx_test;

// Name: btsnd_hcic_ble_ltk_req_neg_reply
// Params: uint16_t handle
// Return: void
@@ -618,21 +581,6 @@ struct btsnd_hcic_read_iso_link_quality {
};
extern struct btsnd_hcic_read_iso_link_quality btsnd_hcic_read_iso_link_quality;

// Name: btsnd_hcic_rej_cis_req
// Params: uint16_t conn_handle, uint8_t reason,
// base::OnceCallback<void(uint8_t*, uint16_t Return: void
struct btsnd_hcic_rej_cis_req {
  std::function<void(uint16_t, uint8_t,
                     base::OnceCallback<void(uint8_t*, uint16_t)>)>
      body{[](uint16_t /* conn_handle */, uint8_t /* reason */,
              base::OnceCallback<void(uint8_t*, uint16_t)> /* cb */) {}};
  void operator()(uint16_t conn_handle, uint8_t reason,
                  base::OnceCallback<void(uint8_t*, uint16_t)> cb) {
    body(conn_handle, reason, std::move(cb));
  };
};
extern struct btsnd_hcic_rej_cis_req btsnd_hcic_rej_cis_req;

// Name: btsnd_hcic_remove_cig
// Params: uint8_t cig_id, base::OnceCallback<void(uint8_t*, uint16_t
// Return: void
Loading