• Home
  • Raw
  • Download

Lines Matching refs:p_dev

140 extern void bta_hh_co_send_hid_info(btif_hh_device_t* p_dev,
157 static void sync_lockstate_on_connect(btif_hh_device_t* p_dev);
264 static void update_keyboard_lockstates(btif_hh_device_t* p_dev) { in update_keyboard_lockstates() argument
272 p_dev->dev_handle, btif_hh_keylockstates); in update_keyboard_lockstates()
278 BTA_HhSendData(p_dev->dev_handle, p_dev->bd_addr, p_buf); in update_keyboard_lockstates()
292 static void sync_lockstate_on_connect(btif_hh_device_t* p_dev) { in sync_lockstate_on_connect() argument
300 update_keyboard_lockstates(p_dev); in sync_lockstate_on_connect()
312 toggle_os_keylockstates(p_dev->fd, keylockstates); in sync_lockstate_on_connect()
390 btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in btif_hh_stop_vup_timer() local
392 if (p_dev != NULL) { in btif_hh_stop_vup_timer()
394 alarm_free(p_dev->vup_timer); in btif_hh_stop_vup_timer()
395 p_dev->vup_timer = NULL; in btif_hh_stop_vup_timer()
409 btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in btif_hh_start_vup_timer() local
410 CHECK(p_dev != NULL); in btif_hh_start_vup_timer()
412 alarm_free(p_dev->vup_timer); in btif_hh_start_vup_timer()
413 p_dev->vup_timer = alarm_new("btif_hh.vup_timer"); in btif_hh_start_vup_timer()
414 alarm_set_on_mloop(p_dev->vup_timer, BTIF_TIMEOUT_VUP_MS, in btif_hh_start_vup_timer()
415 btif_hh_timer_timeout, p_dev); in btif_hh_start_vup_timer()
458 btif_hh_device_t* p_dev; in btif_hh_remove_device() local
474 p_dev = btif_hh_find_dev_by_bda(bd_addr); in btif_hh_remove_device()
475 if (p_dev == NULL) { in btif_hh_remove_device()
482 HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr), in btif_hh_remove_device()
485 p_dev->dev_status = BTHH_CONN_STATE_UNKNOWN; in btif_hh_remove_device()
486 p_dev->dev_handle = BTA_HH_INVALID_HANDLE; in btif_hh_remove_device()
487 p_dev->ready_for_data = false; in btif_hh_remove_device()
495 p_dev->hh_keep_polling = 0; in btif_hh_remove_device()
496 p_dev->hh_poll_thread_id = -1; in btif_hh_remove_device()
497 BTIF_TRACE_DEBUG("%s: uhid fd = %d", __func__, p_dev->fd); in btif_hh_remove_device()
498 if (p_dev->fd >= 0) { in btif_hh_remove_device()
499 bta_hh_co_destroy(p_dev->fd); in btif_hh_remove_device()
500 p_dev->fd = -1; in btif_hh_remove_device()
536 btif_hh_device_t* p_dev; in btif_hh_virtual_unplug() local
537 p_dev = btif_hh_find_dev_by_bda(*bd_addr); in btif_hh_virtual_unplug()
538 if ((p_dev != NULL) && (p_dev->dev_status == BTHH_CONN_STATE_CONNECTED) && in btif_hh_virtual_unplug()
539 (p_dev->attr_mask & HID_VIRTUAL_CABLE)) { in btif_hh_virtual_unplug()
543 p_dev->local_vup = true; in btif_hh_virtual_unplug()
544 BTA_HhSendCtrl(p_dev->dev_handle, BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG); in btif_hh_virtual_unplug()
546 } else if ((p_dev != NULL) && in btif_hh_virtual_unplug()
547 (p_dev->dev_status == BTHH_CONN_STATE_CONNECTED)) { in btif_hh_virtual_unplug()
551 p_dev->local_vup = true; in btif_hh_virtual_unplug()
552 BTA_HhClose(p_dev->dev_handle); in btif_hh_virtual_unplug()
637 btif_hh_device_t* p_dev; in btif_hh_disconnect() local
638 p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in btif_hh_disconnect()
639 if (p_dev != NULL) { in btif_hh_disconnect()
640 BTA_HhClose(p_dev->dev_handle); in btif_hh_disconnect()
654 void btif_hh_setreport(btif_hh_device_t* p_dev, bthh_report_type_t r_type, in btif_hh_setreport() argument
662 BTA_HhSetReport(p_dev->dev_handle, r_type, p_buf); in btif_hh_setreport()
703 void btif_hh_getreport(btif_hh_device_t* p_dev, bthh_report_type_t r_type, in btif_hh_getreport() argument
705 BTA_HhGetReport(p_dev->dev_handle, r_type, reportId, bufferSize); in btif_hh_getreport()
729 btif_hh_device_t* p_dev = NULL; in btif_hh_upstreams_evt() local
781 p_dev = btif_hh_find_connected_dev_by_handle(p_data->conn.handle); in btif_hh_upstreams_evt()
782 if (p_dev == NULL) { in btif_hh_upstreams_evt()
794 } else if (p_dev->fd < 0) { in btif_hh_upstreams_evt()
797 p_dev->bd_addr = p_data->conn.bda; in btif_hh_upstreams_evt()
807 p_dev->bd_addr = p_data->conn.bda; in btif_hh_upstreams_evt()
816 p_dev->dev_status = BTHH_CONN_STATE_CONNECTED; in btif_hh_upstreams_evt()
817 HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr), in btif_hh_upstreams_evt()
818 p_dev->dev_status); in btif_hh_upstreams_evt()
823 p_dev = btif_hh_find_dev_by_bda(*bdaddr); in btif_hh_upstreams_evt()
824 if (p_dev != NULL) { in btif_hh_upstreams_evt()
825 btif_hh_stop_vup_timer(&(p_dev->bd_addr)); in btif_hh_upstreams_evt()
826 if (p_dev->fd >= 0) { in btif_hh_upstreams_evt()
827 bta_hh_co_destroy(p_dev->fd); in btif_hh_upstreams_evt()
828 p_dev->fd = -1; in btif_hh_upstreams_evt()
830 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; in btif_hh_upstreams_evt()
841 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
842 if (p_dev != NULL) { in btif_hh_upstreams_evt()
843 BTIF_TRACE_DEBUG("%s: uhid fd=%d local_vup=%d", __func__, p_dev->fd, in btif_hh_upstreams_evt()
844 p_dev->local_vup); in btif_hh_upstreams_evt()
845 btif_hh_stop_vup_timer(&(p_dev->bd_addr)); in btif_hh_upstreams_evt()
849 if (p_dev->local_vup) { in btif_hh_upstreams_evt()
850 p_dev->local_vup = false; in btif_hh_upstreams_evt()
851 BTA_DmRemoveDevice(p_dev->bd_addr); in btif_hh_upstreams_evt()
855 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; in btif_hh_upstreams_evt()
857 if (p_dev->fd >= 0) { in btif_hh_upstreams_evt()
858 bta_hh_co_destroy(p_dev->fd); in btif_hh_upstreams_evt()
859 p_dev->fd = -1; in btif_hh_upstreams_evt()
861 HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr), in btif_hh_upstreams_evt()
862 p_dev->dev_status); in btif_hh_upstreams_evt()
876 p_dev = btif_hh_find_connected_dev_by_handle(p_data->hs_data.handle); in btif_hh_upstreams_evt()
877 if (p_dev) { in btif_hh_upstreams_evt()
883 (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
887 (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
900 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
901 if (p_dev != NULL) { in btif_hh_upstreams_evt()
902 HAL_CBACK(bt_hh_callbacks, handshake_cb, (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
908 p_dev = btif_hh_find_connected_dev_by_handle(p_data->hs_data.handle); in btif_hh_upstreams_evt()
920 (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
924 HAL_CBACK(bt_hh_callbacks, handshake_cb, (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
932 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
933 if (p_dev) { in btif_hh_upstreams_evt()
934 HAL_CBACK(bt_hh_callbacks, handshake_cb, (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
944 p_dev = btif_hh_find_connected_dev_by_handle(p_data->hs_data.handle); in btif_hh_upstreams_evt()
945 HAL_CBACK(bt_hh_callbacks, idle_time_cb, (RawAddress*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
958 p_dev = btif_hh_cb.p_curr_dev; in btif_hh_upstreams_evt()
959 if (p_dev == NULL) { in btif_hh_upstreams_evt()
964 if (p_dev->fd < 0) { in btif_hh_upstreams_evt()
977 &p_dev->bd_addr, &prop_name) == BT_STATUS_SUCCESS) { in btif_hh_upstreams_evt()
984 bta_hh_co_send_hid_info(p_dev, cached_name, p_data->dscp_info.vendor_id, in btif_hh_upstreams_evt()
989 if (btif_hh_add_added_dev(p_dev->bd_addr, p_dev->attr_mask)) { in btif_hh_upstreams_evt()
993 VLOG(1) << "BTA_HH_GET_DSCP_EVT:bda = " << p_dev->bd_addr; in btif_hh_upstreams_evt()
994 BTA_HhAddDev(p_dev->bd_addr, p_dev->attr_mask, p_dev->sub_class, in btif_hh_upstreams_evt()
995 p_dev->app_id, dscp_info); in btif_hh_upstreams_evt()
998 &(p_dev->bd_addr), p_dev->attr_mask, p_dev->sub_class, in btif_hh_upstreams_evt()
999 p_dev->app_id, p_data->dscp_info.vendor_id, in btif_hh_upstreams_evt()
1032 sync_lockstate_on_connect(p_dev); in btif_hh_upstreams_evt()
1065 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
1067 if (p_dev != NULL) { in btif_hh_upstreams_evt()
1068 VLOG(1) << "BTA_HH_VC_UNPLUG_EVT:bda = " << p_dev->bd_addr; in btif_hh_upstreams_evt()
1071 btif_hh_stop_vup_timer(&(p_dev->bd_addr)); in btif_hh_upstreams_evt()
1072 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; in btif_hh_upstreams_evt()
1074 HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr), in btif_hh_upstreams_evt()
1075 p_dev->dev_status); in btif_hh_upstreams_evt()
1079 if (p_dev->local_vup || check_cod_hid(&(p_dev->bd_addr))) { in btif_hh_upstreams_evt()
1080 p_dev->local_vup = false; in btif_hh_upstreams_evt()
1081 BTA_DmRemoveDevice(p_dev->bd_addr); in btif_hh_upstreams_evt()
1083 btif_hh_remove_device(p_dev->bd_addr); in btif_hh_upstreams_evt()
1084 HAL_CBACK(bt_hh_callbacks, virtual_unplug_cb, &(p_dev->bd_addr), in btif_hh_upstreams_evt()
1194 btif_hh_device_t* p_dev = (btif_hh_device_t*)data; in btif_hh_timer_timeout() local
1200 if (p_dev->dev_status != BTHH_CONN_STATE_CONNECTED) return; in btif_hh_timer_timeout()
1204 p_data.dev_status.handle = p_dev->dev_handle; in btif_hh_timer_timeout()
1265 btif_hh_device_t* p_dev; in disconnect() local
1272 p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in disconnect()
1273 if (p_dev != NULL) { in disconnect()
1294 btif_hh_device_t* p_dev; in virtual_unplug() local
1299 p_dev = btif_hh_find_dev_by_bda(*bd_addr); in virtual_unplug()
1300 if (!p_dev) { in virtual_unplug()
1329 btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in get_idle_time() local
1330 if (p_dev == NULL) return BT_STATUS_FAIL; in get_idle_time()
1332 BTA_HhGetIdle(p_dev->dev_handle); in get_idle_time()
1356 btif_hh_device_t* p_dev = p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in set_idle_time() local
1357 if (p_dev == NULL) { in set_idle_time()
1363 BTA_HhSetIdle(p_dev->dev_handle, idle_time); in set_idle_time()
1433 btif_hh_device_t* p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in get_protocol() local
1434 if (!p_dev) return BT_STATUS_FAIL; in get_protocol()
1436 BTA_HhGetProtoMode(p_dev->dev_handle); in get_protocol()
1452 btif_hh_device_t* p_dev; in set_protocol() local
1463 p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in set_protocol()
1464 if (p_dev == NULL) { in set_protocol()
1473 BTA_HhSetProtoMode(p_dev->dev_handle, protocolMode); in set_protocol()
1492 btif_hh_device_t* p_dev; in get_report() local
1503 p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in get_report()
1504 if (p_dev == NULL) { in get_report()
1512 BTA_HhGetReport(p_dev->dev_handle, reportType, reportId, bufferSize); in get_report()
1530 btif_hh_device_t* p_dev; in set_report() local
1540 p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in set_report()
1541 if (p_dev == NULL) { in set_report()
1565 BTA_HhSetReport(p_dev->dev_handle, reportType, p_buf); in set_report()
1585 btif_hh_device_t* p_dev; in send_data() local
1594 p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); in send_data()
1595 if (p_dev == NULL) { in send_data()
1619 BTA_HhSendData(p_dev->dev_handle, *bd_addr, p_buf); in send_data()
1639 btif_hh_device_t* p_dev; in cleanup() local
1655 p_dev = &btif_hh_cb.devices[i]; in cleanup()
1656 if (p_dev->dev_status != BTHH_CONN_STATE_UNKNOWN && p_dev->fd >= 0) { in cleanup()
1657 BTIF_TRACE_DEBUG("%s: Closing uhid fd = %d", __func__, p_dev->fd); in cleanup()
1658 if (p_dev->fd >= 0) { in cleanup()
1659 bta_hh_co_destroy(p_dev->fd); in cleanup()
1660 p_dev->fd = -1; in cleanup()
1662 p_dev->hh_keep_polling = 0; in cleanup()
1663 p_dev->hh_poll_thread_id = -1; in cleanup()