Lines Matching refs:cp

791 	struct hci_cp_read_clock *cp;  in hci_cc_read_clock()  local
804 cp = hci_sent_cmd_data(hdev, HCI_OP_READ_CLOCK); in hci_cc_read_clock()
805 if (!cp) in hci_cc_read_clock()
808 if (cp->which == 0x00) { in hci_cc_read_clock()
861 struct hci_cp_pin_code_reply *cp; in hci_cc_pin_code_reply() local
874 cp = hci_sent_cmd_data(hdev, HCI_OP_PIN_CODE_REPLY); in hci_cc_pin_code_reply()
875 if (!cp) in hci_cc_pin_code_reply()
878 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cc_pin_code_reply()
880 conn->pin_length = cp->pin_len; in hci_cc_pin_code_reply()
1081 struct hci_cp_le_set_scan_param *cp; in hci_cc_le_set_scan_param() local
1089 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_PARAM); in hci_cc_le_set_scan_param()
1090 if (!cp) in hci_cc_le_set_scan_param()
1095 hdev->le_scan_type = cp->type; in hci_cc_le_set_scan_param()
1132 struct hci_cp_le_set_scan_enable *cp; in hci_cc_le_set_scan_enable() local
1140 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_SCAN_ENABLE); in hci_cc_le_set_scan_enable()
1141 if (!cp) in hci_cc_le_set_scan_enable()
1146 switch (cp->enable) { in hci_cc_le_set_scan_enable()
1191 BT_ERR("Used reserved LE_Scan_Enable param %d", cp->enable); in hci_cc_le_set_scan_enable()
1360 struct hci_cp_le_set_adv_param *cp; in hci_cc_set_adv_param() local
1368 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADV_PARAM); in hci_cc_set_adv_param()
1369 if (!cp) in hci_cc_set_adv_param()
1373 hdev->adv_addr_type = cp->own_address_type; in hci_cc_set_adv_param()
1459 struct hci_cp_create_conn *cp; in hci_cs_create_conn() local
1464 cp = hci_sent_cmd_data(hdev, HCI_OP_CREATE_CONN); in hci_cs_create_conn()
1465 if (!cp) in hci_cs_create_conn()
1470 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cs_create_conn()
1472 BT_DBG("%s bdaddr %pMR hcon %p", hdev->name, &cp->bdaddr, conn); in hci_cs_create_conn()
1485 conn = hci_conn_add(hdev, ACL_LINK, &cp->bdaddr, in hci_cs_create_conn()
1497 struct hci_cp_add_sco *cp; in hci_cs_add_sco() local
1506 cp = hci_sent_cmd_data(hdev, HCI_OP_ADD_SCO); in hci_cs_add_sco()
1507 if (!cp) in hci_cs_add_sco()
1510 handle = __le16_to_cpu(cp->handle); in hci_cs_add_sco()
1532 struct hci_cp_auth_requested *cp; in hci_cs_auth_requested() local
1540 cp = hci_sent_cmd_data(hdev, HCI_OP_AUTH_REQUESTED); in hci_cs_auth_requested()
1541 if (!cp) in hci_cs_auth_requested()
1546 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_auth_requested()
1559 struct hci_cp_set_conn_encrypt *cp; in hci_cs_set_conn_encrypt() local
1567 cp = hci_sent_cmd_data(hdev, HCI_OP_SET_CONN_ENCRYPT); in hci_cs_set_conn_encrypt()
1568 if (!cp) in hci_cs_set_conn_encrypt()
1573 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_set_conn_encrypt()
1609 struct hci_cp_remote_name_req cp; in hci_resolve_name() local
1611 memset(&cp, 0, sizeof(cp)); in hci_resolve_name()
1613 bacpy(&cp.bdaddr, &e->data.bdaddr); in hci_resolve_name()
1614 cp.pscan_rep_mode = e->data.pscan_rep_mode; in hci_resolve_name()
1615 cp.pscan_mode = e->data.pscan_mode; in hci_resolve_name()
1616 cp.clock_offset = e->data.clock_offset; in hci_resolve_name()
1618 return hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); in hci_resolve_name()
1692 struct hci_cp_remote_name_req *cp; in hci_cs_remote_name_req() local
1702 cp = hci_sent_cmd_data(hdev, HCI_OP_REMOTE_NAME_REQ); in hci_cs_remote_name_req()
1703 if (!cp) in hci_cs_remote_name_req()
1708 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cs_remote_name_req()
1711 hci_check_pending_name(hdev, conn, &cp->bdaddr, NULL, 0); in hci_cs_remote_name_req()
1735 struct hci_cp_read_remote_features *cp; in hci_cs_read_remote_features() local
1743 cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_FEATURES); in hci_cs_read_remote_features()
1744 if (!cp) in hci_cs_read_remote_features()
1749 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_read_remote_features()
1762 struct hci_cp_read_remote_ext_features *cp; in hci_cs_read_remote_ext_features() local
1770 cp = hci_sent_cmd_data(hdev, HCI_OP_READ_REMOTE_EXT_FEATURES); in hci_cs_read_remote_ext_features()
1771 if (!cp) in hci_cs_read_remote_ext_features()
1776 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_read_remote_ext_features()
1789 struct hci_cp_setup_sync_conn *cp; in hci_cs_setup_sync_conn() local
1798 cp = hci_sent_cmd_data(hdev, HCI_OP_SETUP_SYNC_CONN); in hci_cs_setup_sync_conn()
1799 if (!cp) in hci_cs_setup_sync_conn()
1802 handle = __le16_to_cpu(cp->handle); in hci_cs_setup_sync_conn()
1824 struct hci_cp_sniff_mode *cp; in hci_cs_sniff_mode() local
1832 cp = hci_sent_cmd_data(hdev, HCI_OP_SNIFF_MODE); in hci_cs_sniff_mode()
1833 if (!cp) in hci_cs_sniff_mode()
1838 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_sniff_mode()
1851 struct hci_cp_exit_sniff_mode *cp; in hci_cs_exit_sniff_mode() local
1859 cp = hci_sent_cmd_data(hdev, HCI_OP_EXIT_SNIFF_MODE); in hci_cs_exit_sniff_mode()
1860 if (!cp) in hci_cs_exit_sniff_mode()
1865 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_exit_sniff_mode()
1878 struct hci_cp_disconnect *cp; in hci_cs_disconnect() local
1884 cp = hci_sent_cmd_data(hdev, HCI_OP_DISCONNECT); in hci_cs_disconnect()
1885 if (!cp) in hci_cs_disconnect()
1890 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_disconnect()
1900 struct hci_cp_le_create_conn *cp; in hci_cs_le_create_conn() local
1912 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_CREATE_CONN); in hci_cs_le_create_conn()
1913 if (!cp) in hci_cs_le_create_conn()
1918 conn = hci_conn_hash_lookup_le(hdev, &cp->peer_addr, in hci_cs_le_create_conn()
1919 cp->peer_addr_type); in hci_cs_le_create_conn()
1927 conn->init_addr_type = cp->own_address_type; in hci_cs_le_create_conn()
1928 if (cp->own_address_type == ADDR_LE_DEV_RANDOM) in hci_cs_le_create_conn()
1933 conn->resp_addr_type = cp->peer_addr_type; in hci_cs_le_create_conn()
1934 bacpy(&conn->resp_addr, &cp->peer_addr); in hci_cs_le_create_conn()
1941 if (cp->filter_policy == HCI_LE_USE_PEER_ADDR) in hci_cs_le_create_conn()
1952 struct hci_cp_le_read_remote_features *cp; in hci_cs_le_read_remote_features() local
1960 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_READ_REMOTE_FEATURES); in hci_cs_le_read_remote_features()
1961 if (!cp) in hci_cs_le_read_remote_features()
1966 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_le_read_remote_features()
1979 struct hci_cp_le_start_enc *cp; in hci_cs_le_start_enc() local
1989 cp = hci_sent_cmd_data(hdev, HCI_OP_LE_START_ENC); in hci_cs_le_start_enc()
1990 if (!cp) in hci_cs_le_start_enc()
1993 conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); in hci_cs_le_start_enc()
2009 struct hci_cp_switch_role *cp; in hci_cs_switch_role() local
2017 cp = hci_sent_cmd_data(hdev, HCI_OP_SWITCH_ROLE); in hci_cs_switch_role()
2018 if (!cp) in hci_cs_switch_role()
2023 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr); in hci_cs_switch_role()
2174 struct hci_cp_read_remote_features cp; in hci_conn_complete_evt() local
2175 cp.handle = ev->handle; in hci_conn_complete_evt()
2177 sizeof(cp), &cp); in hci_conn_complete_evt()
2184 struct hci_cp_change_conn_ptype cp; in hci_conn_complete_evt() local
2185 cp.handle = ev->handle; in hci_conn_complete_evt()
2186 cp.pkt_type = cpu_to_le16(conn->pkt_type); in hci_conn_complete_evt()
2187 hci_send_cmd(hdev, HCI_OP_CHANGE_CONN_PTYPE, sizeof(cp), in hci_conn_complete_evt()
2188 &cp); in hci_conn_complete_evt()
2214 struct hci_cp_reject_conn_req cp; in hci_reject_conn() local
2216 bacpy(&cp.bdaddr, bdaddr); in hci_reject_conn()
2217 cp.reason = HCI_ERROR_REJ_BAD_ADDR; in hci_reject_conn()
2218 hci_send_cmd(hdev, HCI_OP_REJECT_CONN_REQ, sizeof(cp), &cp); in hci_reject_conn()
2284 struct hci_cp_accept_conn_req cp; in hci_conn_request_evt() local
2287 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
2290 cp.role = 0x00; /* Become master */ in hci_conn_request_evt()
2292 cp.role = 0x01; /* Remain slave */ in hci_conn_request_evt()
2294 hci_send_cmd(hdev, HCI_OP_ACCEPT_CONN_REQ, sizeof(cp), &cp); in hci_conn_request_evt()
2296 struct hci_cp_accept_sync_conn_req cp; in hci_conn_request_evt() local
2299 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_conn_request_evt()
2300 cp.pkt_type = cpu_to_le16(conn->pkt_type); in hci_conn_request_evt()
2302 cp.tx_bandwidth = cpu_to_le32(0x00001f40); in hci_conn_request_evt()
2303 cp.rx_bandwidth = cpu_to_le32(0x00001f40); in hci_conn_request_evt()
2304 cp.max_latency = cpu_to_le16(0xffff); in hci_conn_request_evt()
2305 cp.content_format = cpu_to_le16(hdev->voice_setting); in hci_conn_request_evt()
2306 cp.retrans_effort = 0xff; in hci_conn_request_evt()
2308 hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ, sizeof(cp), in hci_conn_request_evt()
2309 &cp); in hci_conn_request_evt()
2440 struct hci_cp_set_conn_encrypt cp; in hci_auth_complete_evt() local
2441 cp.handle = ev->handle; in hci_auth_complete_evt()
2442 cp.encrypt = 0x01; in hci_auth_complete_evt()
2443 hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), in hci_auth_complete_evt()
2444 &cp); in hci_auth_complete_evt()
2460 struct hci_cp_set_conn_encrypt cp; in hci_auth_complete_evt() local
2461 cp.handle = ev->handle; in hci_auth_complete_evt()
2462 cp.encrypt = 0x01; in hci_auth_complete_evt()
2463 hci_send_cmd(hdev, HCI_OP_SET_CONN_ENCRYPT, sizeof(cp), in hci_auth_complete_evt()
2464 &cp); in hci_auth_complete_evt()
2505 struct hci_cp_auth_requested cp; in hci_remote_name_evt() local
2509 cp.handle = __cpu_to_le16(conn->handle); in hci_remote_name_evt()
2510 hci_send_cmd(hdev, HCI_OP_AUTH_REQUESTED, sizeof(cp), &cp); in hci_remote_name_evt()
2635 struct hci_cp_read_enc_key_size cp; in hci_encrypt_change_evt() local
2649 cp.handle = cpu_to_le16(conn->handle); in hci_encrypt_change_evt()
2650 hci_req_add(&req, HCI_OP_READ_ENC_KEY_SIZE, sizeof(cp), &cp); in hci_encrypt_change_evt()
2720 struct hci_cp_read_remote_ext_features cp; in hci_remote_features_evt() local
2721 cp.handle = ev->handle; in hci_remote_features_evt()
2722 cp.page = 0x01; in hci_remote_features_evt()
2724 sizeof(cp), &cp); in hci_remote_features_evt()
2729 struct hci_cp_remote_name_req cp; in hci_remote_features_evt() local
2730 memset(&cp, 0, sizeof(cp)); in hci_remote_features_evt()
2731 bacpy(&cp.bdaddr, &conn->dst); in hci_remote_features_evt()
2732 cp.pscan_rep_mode = 0x02; in hci_remote_features_evt()
2733 hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); in hci_remote_features_evt()
3418 struct hci_cp_link_key_reply cp; in hci_link_key_request_evt() local
3461 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_link_key_request_evt()
3462 memcpy(cp.link_key, key->val, HCI_LINK_KEY_SIZE); in hci_link_key_request_evt()
3464 hci_send_cmd(hdev, HCI_OP_LINK_KEY_REPLY, sizeof(cp), &cp); in hci_link_key_request_evt()
3702 struct hci_cp_remote_name_req cp; in hci_remote_ext_features_evt() local
3703 memset(&cp, 0, sizeof(cp)); in hci_remote_ext_features_evt()
3704 bacpy(&cp.bdaddr, &conn->dst); in hci_remote_ext_features_evt()
3705 cp.pscan_rep_mode = 0x02; in hci_remote_ext_features_evt()
3706 hci_send_cmd(hdev, HCI_OP_REMOTE_NAME_REQ, sizeof(cp), &cp); in hci_remote_ext_features_evt()
3988 struct hci_cp_io_capability_reply cp; in hci_io_capa_request_evt() local
3990 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
3993 cp.capability = (conn->io_capability == 0x04) ? in hci_io_capa_request_evt()
4014 cp.authentication = conn->auth_type; in hci_io_capa_request_evt()
4015 cp.oob_data = bredr_oob_data_present(conn); in hci_io_capa_request_evt()
4018 sizeof(cp), &cp); in hci_io_capa_request_evt()
4020 struct hci_cp_io_capability_neg_reply cp; in hci_io_capa_request_evt() local
4022 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_io_capa_request_evt()
4023 cp.reason = HCI_ERROR_PAIRING_NOT_ALLOWED; in hci_io_capa_request_evt()
4026 sizeof(cp), &cp); in hci_io_capa_request_evt()
4266 struct hci_cp_remote_oob_data_neg_reply cp; in hci_remote_oob_data_request_evt() local
4268 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
4270 sizeof(cp), &cp); in hci_remote_oob_data_request_evt()
4275 struct hci_cp_remote_oob_ext_data_reply cp; in hci_remote_oob_data_request_evt() local
4277 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
4279 memset(cp.hash192, 0, sizeof(cp.hash192)); in hci_remote_oob_data_request_evt()
4280 memset(cp.rand192, 0, sizeof(cp.rand192)); in hci_remote_oob_data_request_evt()
4282 memcpy(cp.hash192, data->hash192, sizeof(cp.hash192)); in hci_remote_oob_data_request_evt()
4283 memcpy(cp.rand192, data->rand192, sizeof(cp.rand192)); in hci_remote_oob_data_request_evt()
4285 memcpy(cp.hash256, data->hash256, sizeof(cp.hash256)); in hci_remote_oob_data_request_evt()
4286 memcpy(cp.rand256, data->rand256, sizeof(cp.rand256)); in hci_remote_oob_data_request_evt()
4289 sizeof(cp), &cp); in hci_remote_oob_data_request_evt()
4291 struct hci_cp_remote_oob_data_reply cp; in hci_remote_oob_data_request_evt() local
4293 bacpy(&cp.bdaddr, &ev->bdaddr); in hci_remote_oob_data_request_evt()
4294 memcpy(cp.hash, data->hash192, sizeof(cp.hash)); in hci_remote_oob_data_request_evt()
4295 memcpy(cp.rand, data->rand192, sizeof(cp.rand)); in hci_remote_oob_data_request_evt()
4298 sizeof(cp), &cp); in hci_remote_oob_data_request_evt()
4577 struct hci_cp_le_read_remote_features cp; in hci_le_conn_complete_evt() local
4579 cp.handle = __cpu_to_le16(conn->handle); in hci_le_conn_complete_evt()
4582 sizeof(cp), &cp); in hci_le_conn_complete_evt()
4966 struct hci_cp_le_ltk_reply cp; in hci_le_ltk_request_evt() local
4993 memcpy(cp.ltk, ltk->val, ltk->enc_size); in hci_le_ltk_request_evt()
4994 memset(cp.ltk + ltk->enc_size, 0, sizeof(cp.ltk) - ltk->enc_size); in hci_le_ltk_request_evt()
4995 cp.handle = cpu_to_le16(conn->handle); in hci_le_ltk_request_evt()
5001 hci_send_cmd(hdev, HCI_OP_LE_LTK_REPLY, sizeof(cp), &cp); in hci_le_ltk_request_evt()
5030 struct hci_cp_le_conn_param_req_neg_reply cp; in send_conn_param_neg_reply() local
5032 cp.handle = cpu_to_le16(handle); in send_conn_param_neg_reply()
5033 cp.reason = reason; in send_conn_param_neg_reply()
5035 hci_send_cmd(hdev, HCI_OP_LE_CONN_PARAM_REQ_NEG_REPLY, sizeof(cp), in send_conn_param_neg_reply()
5036 &cp); in send_conn_param_neg_reply()
5043 struct hci_cp_le_conn_param_req_reply cp; in hci_le_remote_conn_param_req_evt() local
5086 cp.handle = ev->handle; in hci_le_remote_conn_param_req_evt()
5087 cp.interval_min = ev->interval_min; in hci_le_remote_conn_param_req_evt()
5088 cp.interval_max = ev->interval_max; in hci_le_remote_conn_param_req_evt()
5089 cp.latency = ev->latency; in hci_le_remote_conn_param_req_evt()
5090 cp.timeout = ev->timeout; in hci_le_remote_conn_param_req_evt()
5091 cp.min_ce_len = 0; in hci_le_remote_conn_param_req_evt()
5092 cp.max_ce_len = 0; in hci_le_remote_conn_param_req_evt()
5094 hci_send_cmd(hdev, HCI_OP_LE_CONN_PARAM_REQ_REPLY, sizeof(cp), &cp); in hci_le_remote_conn_param_req_evt()