Lines Matching refs:p_dev
153 extern void bta_hh_co_send_hid_info(btif_hh_device_t *p_dev, char *dev_name, UINT16 vendor_id,
167 static void sync_lockstate_on_connect(btif_hh_device_t *p_dev);
278 static void update_keyboard_lockstates(btif_hh_device_t *p_dev) in update_keyboard_lockstates() argument
288 __FUNCTION__, p_dev->dev_handle, btif_hh_keylockstates); in update_keyboard_lockstates()
294 bda = (BD_ADDR*) (&p_dev->bd_addr); in update_keyboard_lockstates()
295 BTA_HhSendData(p_dev->dev_handle, *bda, p_buf); in update_keyboard_lockstates()
307 static void sync_lockstate_on_connect(btif_hh_device_t *p_dev) in sync_lockstate_on_connect() argument
314 update_keyboard_lockstates(p_dev); in sync_lockstate_on_connect()
326 toggle_os_keylockstates(p_dev->fd, keylockstates); in sync_lockstate_on_connect()
409 btif_hh_device_t *p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in btif_hh_stop_vup_timer() local
410 if(p_dev != NULL) in btif_hh_stop_vup_timer()
412 if (p_dev->vup_timer_active) in btif_hh_stop_vup_timer()
415 btu_stop_timer(&p_dev->vup_timer); in btif_hh_stop_vup_timer()
417 p_dev->vup_timer_active = FALSE; in btif_hh_stop_vup_timer()
430 btif_hh_device_t *p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in btif_hh_start_vup_timer() local
432 if (p_dev->vup_timer_active == FALSE) in btif_hh_start_vup_timer()
435 memset(&p_dev->vup_timer, 0, sizeof(TIMER_LIST_ENT)); in btif_hh_start_vup_timer()
436 p_dev->vup_timer.param = (UINT32)btif_hh_tmr_hdlr; in btif_hh_start_vup_timer()
437 btu_start_timer(&p_dev->vup_timer, BTU_TTYPE_USER_FUNC, in btif_hh_start_vup_timer()
443 btu_stop_timer(&p_dev->vup_timer); in btif_hh_start_vup_timer()
444 btu_start_timer(&p_dev->vup_timer, BTU_TTYPE_USER_FUNC, in btif_hh_start_vup_timer()
447 p_dev->vup_timer_active = TRUE; in btif_hh_start_vup_timer()
501 btif_hh_device_t *p_dev; in btif_hh_remove_device() local
518 p_dev = btif_hh_find_dev_by_bda(&bd_addr); in btif_hh_remove_device()
519 if (p_dev == NULL) { in btif_hh_remove_device()
526 … HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr), BTHH_CONN_STATE_DISCONNECTED); in btif_hh_remove_device()
528 p_dev->dev_status = BTHH_CONN_STATE_UNKNOWN; in btif_hh_remove_device()
529 p_dev->dev_handle = BTA_HH_INVALID_HANDLE; in btif_hh_remove_device()
537 p_dev->hh_keep_polling = 0; in btif_hh_remove_device()
538 p_dev->hh_poll_thread_id = -1; in btif_hh_remove_device()
539 BTIF_TRACE_DEBUG("%s: uhid fd = %d", __FUNCTION__, p_dev->fd); in btif_hh_remove_device()
540 if (p_dev->fd >= 0) { in btif_hh_remove_device()
541 bta_hh_co_destroy(p_dev->fd); in btif_hh_remove_device()
542 p_dev->fd = -1; in btif_hh_remove_device()
585 btif_hh_device_t *p_dev; in btif_hh_virtual_unplug() local
590 p_dev = btif_hh_find_dev_by_bda(bd_addr); in btif_hh_virtual_unplug()
591 if ((p_dev != NULL) && (p_dev->dev_status == BTHH_CONN_STATE_CONNECTED) in btif_hh_virtual_unplug()
592 && (p_dev->attr_mask & HID_VIRTUAL_CABLE)) in btif_hh_virtual_unplug()
597 p_dev->local_vup = TRUE; in btif_hh_virtual_unplug()
598 BTA_HhSendCtrl(p_dev->dev_handle, BTA_HH_CTRL_VIRTUAL_CABLE_UNPLUG); in btif_hh_virtual_unplug()
678 btif_hh_device_t *p_dev; in btif_hh_disconnect() local
679 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in btif_hh_disconnect()
680 if (p_dev != NULL) in btif_hh_disconnect()
682 BTA_HhClose(p_dev->dev_handle); in btif_hh_disconnect()
697 void btif_hh_setreport(btif_hh_device_t *p_dev, bthh_report_type_t r_type, UINT16 size, in btif_hh_setreport() argument
705 BTA_HhSetReport(p_dev->dev_handle, r_type, p_buf); in btif_hh_setreport()
731 btif_hh_device_t *p_dev = NULL; in btif_hh_upstreams_evt() local
770 p_dev = btif_hh_find_connected_dev_by_handle(p_data->conn.handle); in btif_hh_upstreams_evt()
771 if (p_dev == NULL) { in btif_hh_upstreams_evt()
779 else if (p_dev->fd < 0) { in btif_hh_upstreams_evt()
781 memcpy(&(p_dev->bd_addr), p_data->conn.bda, BD_ADDR_LEN); in btif_hh_upstreams_evt()
788 memcpy(&(p_dev->bd_addr), p_data->conn.bda, BD_ADDR_LEN); in btif_hh_upstreams_evt()
796 p_dev->dev_status = BTHH_CONN_STATE_CONNECTED; in btif_hh_upstreams_evt()
797 … HAL_CBACK(bt_hh_callbacks, connection_state_cb,&(p_dev->bd_addr), p_dev->dev_status); in btif_hh_upstreams_evt()
803 p_dev = btif_hh_find_dev_by_bda(bdaddr); in btif_hh_upstreams_evt()
804 if (p_dev != NULL) { in btif_hh_upstreams_evt()
805 if(p_dev->vup_timer_active) in btif_hh_upstreams_evt()
806 btif_hh_stop_vup_timer(&(p_dev->bd_addr)); in btif_hh_upstreams_evt()
807 if (p_dev->fd >= 0) { in btif_hh_upstreams_evt()
808 bta_hh_co_destroy(p_dev->fd); in btif_hh_upstreams_evt()
809 p_dev->fd = -1; in btif_hh_upstreams_evt()
811 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; in btif_hh_upstreams_evt()
821 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
822 if (p_dev != NULL) { in btif_hh_upstreams_evt()
823 BTIF_TRACE_DEBUG("%s: uhid fd = %d", __FUNCTION__, p_dev->fd); in btif_hh_upstreams_evt()
824 if(p_dev->vup_timer_active) 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()
831 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; in btif_hh_upstreams_evt()
832 … HAL_CBACK(bt_hh_callbacks, connection_state_cb,&(p_dev->bd_addr), p_dev->dev_status); in btif_hh_upstreams_evt()
846 p_dev = btif_hh_find_connected_dev_by_handle(p_data->hs_data.handle); in btif_hh_upstreams_evt()
847 if (p_dev) { in btif_hh_upstreams_evt()
853 (bt_bdaddr_t*) &(p_dev->bd_addr), in btif_hh_upstreams_evt()
857 (bt_bdaddr_t*) &(p_dev->bd_addr), in btif_hh_upstreams_evt()
869 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
870 if (p_dev != NULL) { in btif_hh_upstreams_evt()
872 (bt_bdaddr_t*) &(p_dev->bd_addr), in btif_hh_upstreams_evt()
878 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
886 (bt_bdaddr_t*) &(p_dev->bd_addr), in btif_hh_upstreams_evt()
891 (bt_bdaddr_t*) &(p_dev->bd_addr), in btif_hh_upstreams_evt()
899 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
900 if (p_dev) { in btif_hh_upstreams_evt()
902 (bt_bdaddr_t*)&(p_dev->bd_addr), in btif_hh_upstreams_evt()
921 p_dev = btif_hh_cb.p_curr_dev; in btif_hh_upstreams_evt()
922 if (p_dev == NULL) { in btif_hh_upstreams_evt()
926 if (p_dev->fd < 0) { in btif_hh_upstreams_evt()
937 &p_dev->bd_addr, &prop_name) == BT_STATUS_SUCCESS) in btif_hh_upstreams_evt()
947 bta_hh_co_send_hid_info(p_dev, cached_name, in btif_hh_upstreams_evt()
951 if (btif_hh_add_added_dev(p_dev->bd_addr, p_dev->attr_mask)) { in btif_hh_upstreams_evt()
953 bdcpy(bda, p_dev->bd_addr.address); in btif_hh_upstreams_evt()
956 bdcpy(bda, p_dev->bd_addr.address); in btif_hh_upstreams_evt()
959 p_dev->bd_addr.address[0], p_dev->bd_addr.address[1], in btif_hh_upstreams_evt()
960 p_dev->bd_addr.address[2],p_dev->bd_addr.address[3], in btif_hh_upstreams_evt()
961 p_dev->bd_addr.address[4], p_dev->bd_addr.address[5]); in btif_hh_upstreams_evt()
962 BTA_HhAddDev(bda, p_dev->attr_mask,p_dev->sub_class,p_dev->app_id, dscp_info); in btif_hh_upstreams_evt()
964 …ret = btif_storage_add_hid_device_info(&(p_dev->bd_addr), p_dev->attr_mask,p_dev->sub_class,p_dev-… in btif_hh_upstreams_evt()
1002 sync_lockstate_on_connect(p_dev); in btif_hh_upstreams_evt()
1038 p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle); in btif_hh_upstreams_evt()
1040 if (p_dev != NULL) { in btif_hh_upstreams_evt()
1042 p_dev->bd_addr.address[0], p_dev->bd_addr.address[1], in btif_hh_upstreams_evt()
1043 p_dev->bd_addr.address[2],p_dev->bd_addr.address[3], in btif_hh_upstreams_evt()
1044 p_dev->bd_addr.address[4], p_dev->bd_addr.address[5]); in btif_hh_upstreams_evt()
1046 if(p_dev->vup_timer_active) in btif_hh_upstreams_evt()
1048 btif_hh_stop_vup_timer(&(p_dev->bd_addr)); in btif_hh_upstreams_evt()
1050 p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; in btif_hh_upstreams_evt()
1052 … HAL_CBACK(bt_hh_callbacks, connection_state_cb,&(p_dev->bd_addr), p_dev->dev_status); in btif_hh_upstreams_evt()
1056 if (p_dev->local_vup || check_cod_hid(&(p_dev->bd_addr), COD_HID_MAJOR)) in btif_hh_upstreams_evt()
1058 p_dev->local_vup = FALSE; in btif_hh_upstreams_evt()
1059 BTA_DmRemoveDevice((UINT8 *)p_dev->bd_addr.address); in btif_hh_upstreams_evt()
1062 btif_hh_remove_device(p_dev->bd_addr); in btif_hh_upstreams_evt()
1063 HAL_CBACK(bt_hh_callbacks, virtual_unplug_cb,&(p_dev->bd_addr), in btif_hh_upstreams_evt()
1182 btif_hh_device_t *p_dev; in btif_hh_tmr_hdlr() local
1195 p_dev = &btif_hh_cb.devices[i]; in btif_hh_tmr_hdlr()
1197 if (p_dev->vup_timer_active) in btif_hh_tmr_hdlr()
1199 p_dev->vup_timer_active = FALSE; in btif_hh_tmr_hdlr()
1202 p_data.dev_status.handle = p_dev->dev_handle; in btif_hh_tmr_hdlr()
1270 btif_hh_device_t *p_dev; in disconnect() local
1277 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in disconnect()
1278 if (p_dev != NULL) in disconnect()
1302 btif_hh_device_t *p_dev; in virtual_unplug() local
1312 p_dev = btif_hh_find_dev_by_bda(bd_addr); in virtual_unplug()
1313 if (!p_dev) in virtual_unplug()
1390 btif_hh_device_t *p_dev; in get_protocol() local
1402 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in get_protocol()
1403 if (p_dev != NULL) { in get_protocol()
1405 BTA_HhGetProtoMode(p_dev->dev_handle); in get_protocol()
1425 btif_hh_device_t *p_dev; in set_protocol() local
1439 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in set_protocol()
1440 if (p_dev == NULL) { in set_protocol()
1450 BTA_HhSetProtoMode(p_dev->dev_handle, protocolMode); in set_protocol()
1469 btif_hh_device_t *p_dev; in get_report() local
1484 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in get_report()
1485 if (p_dev == NULL) { in get_report()
1496 BTA_HhGetReport(p_dev->dev_handle, reportType, in get_report()
1515 btif_hh_device_t *p_dev; in set_report() local
1529 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in set_report()
1530 if (p_dev == NULL) { in set_report()
1565 BTA_HhSetReport(p_dev->dev_handle, reportType, p_buf); in set_report()
1586 btif_hh_device_t *p_dev; in send_data() local
1599 p_dev = btif_hh_find_connected_dev_by_bda(bd_addr); in send_data()
1600 if (p_dev == NULL) { in send_data()
1632 BTA_HhSendData(p_dev->dev_handle, *bda, p_buf); in send_data()
1654 btif_hh_device_t *p_dev; in cleanup() local
1662 p_dev = &btif_hh_cb.devices[i]; in cleanup()
1663 if (p_dev->dev_status != BTHH_CONN_STATE_UNKNOWN && p_dev->fd >= 0) { in cleanup()
1664 BTIF_TRACE_DEBUG("%s: Closing uhid fd = %d", __FUNCTION__, p_dev->fd); in cleanup()
1665 if (p_dev->fd >= 0) { in cleanup()
1666 bta_hh_co_destroy(p_dev->fd); in cleanup()
1667 p_dev->fd = -1; in cleanup()
1669 p_dev->hh_keep_polling = 0; in cleanup()
1670 p_dev->hh_poll_thread_id = -1; in cleanup()