Lines Matching refs:p_cb
51 typedef BT_HDR * (*tSMP_CMD_ACT)(UINT8 cmd_code, tSMP_CB *p_cb);
53 static BT_HDR * smp_build_pairing_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
54 static BT_HDR * smp_build_confirm_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
55 static BT_HDR * smp_build_rand_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
56 static BT_HDR * smp_build_pairing_fail(UINT8 cmd_code, tSMP_CB *p_cb);
57 static BT_HDR * smp_build_identity_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
58 static BT_HDR * smp_build_encrypt_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
59 static BT_HDR * smp_build_security_request(UINT8 cmd_code, tSMP_CB *p_cb);
60 static BT_HDR * smp_build_signing_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
61 static BT_HDR * smp_build_master_id_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
62 static BT_HDR * smp_build_id_addr_cmd(UINT8 cmd_code, tSMP_CB *p_cb);
111 BOOLEAN smp_send_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_send_cmd() argument
120 p_buf = (*smp_cmd_build_act[cmd_code])(cmd_code, p_cb); in smp_send_cmd()
123 smp_send_msg_to_L2CAP(p_cb->pairing_bda, p_buf)) in smp_send_cmd()
127 btu_stop_timer (&p_cb->rsp_timer_ent); in smp_send_cmd()
128 btu_start_timer (&p_cb->rsp_timer_ent, BTU_TTYPE_SMP_PAIRING_CMD, in smp_send_cmd()
135 smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &failure); in smp_send_cmd()
153 tSMP_CB *p_cb = &smp_cb; in smp_rsp_timeout() local
157 SMP_TRACE_EVENT("smp_rsp_timeout state:%d", p_cb->state); in smp_rsp_timeout()
161 smp_sm_event(p_cb, SMP_RELEASE_DELAY_TOUT_EVT, NULL); in smp_rsp_timeout()
165 smp_sm_event(p_cb, SMP_AUTH_CMPL_EVT, &failure); in smp_rsp_timeout()
176 BT_HDR * smp_build_pairing_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_pairing_cmd() argument
186 UINT8_TO_STREAM (p, p_cb->loc_io_caps); in smp_build_pairing_cmd()
187 UINT8_TO_STREAM (p, p_cb->loc_oob_flag); in smp_build_pairing_cmd()
188 UINT8_TO_STREAM (p, p_cb->loc_auth_req); in smp_build_pairing_cmd()
189 UINT8_TO_STREAM (p, p_cb->loc_enc_size); in smp_build_pairing_cmd()
190 UINT8_TO_STREAM (p, p_cb->loc_i_key); in smp_build_pairing_cmd()
191 UINT8_TO_STREAM (p, p_cb->loc_r_key); in smp_build_pairing_cmd()
208 static BT_HDR * smp_build_confirm_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_confirm_cmd() argument
220 ARRAY_TO_STREAM (p, p_cb->confirm, BT_OCTET16_LEN); in smp_build_confirm_cmd()
235 static BT_HDR * smp_build_rand_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_rand_cmd() argument
247 ARRAY_TO_STREAM (p, p_cb->rand, BT_OCTET16_LEN); in smp_build_rand_cmd()
262 static BT_HDR * smp_build_encrypt_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_encrypt_info_cmd() argument
274 ARRAY_TO_STREAM (p, p_cb->ltk, BT_OCTET16_LEN); in smp_build_encrypt_info_cmd()
289 static BT_HDR * smp_build_master_id_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_master_id_cmd() argument
301 UINT16_TO_STREAM (p, p_cb->ediv); in smp_build_master_id_cmd()
302 ARRAY_TO_STREAM (p, p_cb->enc_rand, BT_OCTET8_LEN); in smp_build_master_id_cmd()
317 static BT_HDR * smp_build_identity_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_identity_info_cmd() argument
323 UNUSED(p_cb); in smp_build_identity_info_cmd()
348 static BT_HDR * smp_build_id_addr_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_id_addr_cmd() argument
354 UNUSED(p_cb); in smp_build_id_addr_cmd()
380 static BT_HDR * smp_build_signing_info_cmd(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_signing_info_cmd() argument
392 ARRAY_TO_STREAM (p, p_cb->csrk, BT_OCTET16_LEN); in smp_build_signing_info_cmd()
407 static BT_HDR * smp_build_pairing_fail(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_pairing_fail() argument
419 UINT8_TO_STREAM (p, p_cb->failure); in smp_build_pairing_fail()
434 static BT_HDR * smp_build_security_request(UINT8 cmd_code, tSMP_CB *p_cb) in smp_build_security_request() argument
447 UINT8_TO_STREAM (p, p_cb->loc_auth_req); in smp_build_security_request()
452 SMP_TRACE_EVENT("opcode=%d auth_req=0x%x",SMP_OPCODE_SEC_REQ, p_cb->loc_auth_req ); in smp_build_security_request()
535 void smp_cb_cleanup(tSMP_CB *p_cb) in smp_cb_cleanup() argument
537 tSMP_CALLBACK *p_callback = p_cb->p_callback; in smp_cb_cleanup()
538 UINT8 trace_level = p_cb->trace_level; in smp_cb_cleanup()
541 memset(p_cb, 0, sizeof(tSMP_CB)); in smp_cb_cleanup()
542 p_cb->p_callback = p_callback; in smp_cb_cleanup()
543 p_cb->trace_level = trace_level; in smp_cb_cleanup()
556 void smp_reset_control_value(tSMP_CB *p_cb) in smp_reset_control_value() argument
559 btu_stop_timer (&p_cb->rsp_timer_ent); in smp_reset_control_value()
565 L2CA_RemoveFixedChnl (L2CAP_SMP_CID, p_cb->pairing_bda); in smp_reset_control_value()
575 L2CA_RemoveFixedChnl (L2CAP_SMP_CID, p_cb->pairing_bda); in smp_reset_control_value()
578 smp_cb_cleanup(p_cb); in smp_reset_control_value()
591 void smp_proc_pairing_cmpl(tSMP_CB *p_cb) in smp_proc_pairing_cmpl() argument
597 evt_data.cmplt.reason = p_cb->status; in smp_proc_pairing_cmpl()
599 if (p_cb->status == SMP_SUCCESS) in smp_proc_pairing_cmpl()
600 evt_data.cmplt.sec_level = p_cb->sec_level; in smp_proc_pairing_cmpl()
604 if (p_cb->is_pair_cancel) in smp_proc_pairing_cmpl()
611 if (p_cb->p_callback) in smp_proc_pairing_cmpl()
612 (*p_cb->p_callback) (SMP_COMPLT_EVT, p_cb->pairing_bda, &evt_data); in smp_proc_pairing_cmpl()
615 if (evt_data.cmplt.reason == 0 && p_cb->role == HCI_ROLE_MASTER) in smp_proc_pairing_cmpl()
617 btm_ble_start_encrypt(p_cb->pairing_bda, FALSE, NULL); in smp_proc_pairing_cmpl()
621 smp_reset_control_value(p_cb); in smp_proc_pairing_cmpl()