djrcv_dev         514 drivers/hid/hid-logitech-dj.c static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev);
djrcv_dev         530 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev;
djrcv_dev         540 drivers/hid/hid-logitech-dj.c 	list_for_each_entry(djrcv_dev, &dj_hdev_list, list) {
djrcv_dev         541 drivers/hid/hid-logitech-dj.c 		if (djrcv_dev->mouse &&
djrcv_dev         542 drivers/hid/hid-logitech-dj.c 		    hid_compare_device_paths(hdev, djrcv_dev->mouse, sep)) {
djrcv_dev         543 drivers/hid/hid-logitech-dj.c 			kref_get(&djrcv_dev->kref);
djrcv_dev         544 drivers/hid/hid-logitech-dj.c 			return djrcv_dev;
djrcv_dev         546 drivers/hid/hid-logitech-dj.c 		if (djrcv_dev->keyboard &&
djrcv_dev         547 drivers/hid/hid-logitech-dj.c 		    hid_compare_device_paths(hdev, djrcv_dev->keyboard, sep)) {
djrcv_dev         548 drivers/hid/hid-logitech-dj.c 			kref_get(&djrcv_dev->kref);
djrcv_dev         549 drivers/hid/hid-logitech-dj.c 			return djrcv_dev;
djrcv_dev         551 drivers/hid/hid-logitech-dj.c 		if (djrcv_dev->hidpp &&
djrcv_dev         552 drivers/hid/hid-logitech-dj.c 		    hid_compare_device_paths(hdev, djrcv_dev->hidpp, sep)) {
djrcv_dev         553 drivers/hid/hid-logitech-dj.c 			kref_get(&djrcv_dev->kref);
djrcv_dev         554 drivers/hid/hid-logitech-dj.c 			return djrcv_dev;
djrcv_dev         563 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = container_of(kref, struct dj_receiver_dev, kref);
djrcv_dev         565 drivers/hid/hid-logitech-dj.c 	list_del(&djrcv_dev->list);
djrcv_dev         566 drivers/hid/hid-logitech-dj.c 	kfifo_free(&djrcv_dev->notif_fifo);
djrcv_dev         567 drivers/hid/hid-logitech-dj.c 	kfree(djrcv_dev);
djrcv_dev         572 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev         576 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->mouse == hdev)
djrcv_dev         577 drivers/hid/hid-logitech-dj.c 		djrcv_dev->mouse = NULL;
djrcv_dev         578 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->keyboard == hdev)
djrcv_dev         579 drivers/hid/hid-logitech-dj.c 		djrcv_dev->keyboard = NULL;
djrcv_dev         580 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->hidpp == hdev)
djrcv_dev         581 drivers/hid/hid-logitech-dj.c 		djrcv_dev->hidpp = NULL;
djrcv_dev         583 drivers/hid/hid-logitech-dj.c 	kref_put(&djrcv_dev->kref, dj_release_receiver_dev);
djrcv_dev         593 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev;
djrcv_dev         597 drivers/hid/hid-logitech-dj.c 	djrcv_dev = dj_find_receiver_dev(hdev, type);
djrcv_dev         598 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev) {
djrcv_dev         599 drivers/hid/hid-logitech-dj.c 		djrcv_dev = kzalloc(sizeof(*djrcv_dev), GFP_KERNEL);
djrcv_dev         600 drivers/hid/hid-logitech-dj.c 		if (!djrcv_dev)
djrcv_dev         603 drivers/hid/hid-logitech-dj.c 		INIT_WORK(&djrcv_dev->work, delayedwork_callback);
djrcv_dev         604 drivers/hid/hid-logitech-dj.c 		spin_lock_init(&djrcv_dev->lock);
djrcv_dev         605 drivers/hid/hid-logitech-dj.c 		if (kfifo_alloc(&djrcv_dev->notif_fifo,
djrcv_dev         608 drivers/hid/hid-logitech-dj.c 			kfree(djrcv_dev);
djrcv_dev         609 drivers/hid/hid-logitech-dj.c 			djrcv_dev = NULL;
djrcv_dev         612 drivers/hid/hid-logitech-dj.c 		kref_init(&djrcv_dev->kref);
djrcv_dev         613 drivers/hid/hid-logitech-dj.c 		list_add_tail(&djrcv_dev->list, &dj_hdev_list);
djrcv_dev         614 drivers/hid/hid-logitech-dj.c 		djrcv_dev->last_query = jiffies;
djrcv_dev         615 drivers/hid/hid-logitech-dj.c 		djrcv_dev->type = type;
djrcv_dev         619 drivers/hid/hid-logitech-dj.c 		djrcv_dev->keyboard = hdev;
djrcv_dev         621 drivers/hid/hid-logitech-dj.c 		djrcv_dev->mouse = hdev;
djrcv_dev         623 drivers/hid/hid-logitech-dj.c 		djrcv_dev->hidpp = hdev;
djrcv_dev         625 drivers/hid/hid-logitech-dj.c 	hid_set_drvdata(hdev, djrcv_dev);
djrcv_dev         628 drivers/hid/hid-logitech-dj.c 	return djrcv_dev;
djrcv_dev         631 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_destroy_djhid_device(struct dj_receiver_dev *djrcv_dev,
djrcv_dev         638 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev         639 drivers/hid/hid-logitech-dj.c 	dj_dev = djrcv_dev->paired_dj_devices[workitem->device_index];
djrcv_dev         640 drivers/hid/hid-logitech-dj.c 	djrcv_dev->paired_dj_devices[workitem->device_index] = NULL;
djrcv_dev         641 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev         647 drivers/hid/hid-logitech-dj.c 		hid_err(djrcv_dev->hidpp, "%s: can't destroy a NULL device\n",
djrcv_dev         652 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_add_djhid_device(struct dj_receiver_dev *djrcv_dev,
djrcv_dev         656 drivers/hid/hid-logitech-dj.c 	struct hid_device *djrcv_hdev = djrcv_dev->hidpp;
djrcv_dev         668 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->paired_dj_devices[device_index]) {
djrcv_dev         708 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->type == recvr_type_27mhz)
djrcv_dev         726 drivers/hid/hid-logitech-dj.c 	dj_dev->dj_receiver_dev = djrcv_dev;
djrcv_dev         730 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev         731 drivers/hid/hid-logitech-dj.c 	djrcv_dev->paired_dj_devices[device_index] = dj_dev;
djrcv_dev         732 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev         742 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev         743 drivers/hid/hid-logitech-dj.c 	djrcv_dev->paired_dj_devices[device_index] = NULL;
djrcv_dev         744 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev         752 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev =
djrcv_dev         762 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev         768 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev->ready) {
djrcv_dev         771 drivers/hid/hid-logitech-dj.c 		spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev         775 drivers/hid/hid-logitech-dj.c 	count = kfifo_out(&djrcv_dev->notif_fifo, &workitem, sizeof(workitem));
djrcv_dev         778 drivers/hid/hid-logitech-dj.c 		spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev         782 drivers/hid/hid-logitech-dj.c 	if (!kfifo_is_empty(&djrcv_dev->notif_fifo))
djrcv_dev         783 drivers/hid/hid-logitech-dj.c 		schedule_work(&djrcv_dev->work);
djrcv_dev         785 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev         789 drivers/hid/hid-logitech-dj.c 		logi_dj_recv_add_djhid_device(djrcv_dev, &workitem);
djrcv_dev         792 drivers/hid/hid-logitech-dj.c 		logi_dj_recv_destroy_djhid_device(djrcv_dev, &workitem);
djrcv_dev         795 drivers/hid/hid-logitech-dj.c 		retval = logi_dj_recv_query_paired_devices(djrcv_dev);
djrcv_dev         797 drivers/hid/hid-logitech-dj.c 			hid_err(djrcv_dev->hidpp, "%s: logi_dj_recv_query_paired_devices error: %d\n",
djrcv_dev         819 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_queue_unknown_work(struct dj_receiver_dev *djrcv_dev)
djrcv_dev         824 drivers/hid/hid-logitech-dj.c 	if (time_before(jiffies, djrcv_dev->last_query + HZ / 2))
djrcv_dev         827 drivers/hid/hid-logitech-dj.c 	kfifo_in(&djrcv_dev->notif_fifo, &workitem, sizeof(workitem));
djrcv_dev         828 drivers/hid/hid-logitech-dj.c 	schedule_work(&djrcv_dev->work);
djrcv_dev         831 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_queue_notification(struct dj_receiver_dev *djrcv_dev,
djrcv_dev         861 drivers/hid/hid-logitech-dj.c 		logi_dj_recv_queue_unknown_work(djrcv_dev);
djrcv_dev         865 drivers/hid/hid-logitech-dj.c 	kfifo_in(&djrcv_dev->notif_fifo, &workitem, sizeof(workitem));
djrcv_dev         866 drivers/hid/hid-logitech-dj.c 	schedule_work(&djrcv_dev->work);
djrcv_dev         873 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev         888 drivers/hid/hid-logitech-dj.c 		if (djrcv_dev->type == recvr_type_mouse_only)
djrcv_dev         922 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev         996 drivers/hid/hid-logitech-dj.c 	kfifo_in(&djrcv_dev->notif_fifo, &workitem, sizeof(workitem));
djrcv_dev         997 drivers/hid/hid-logitech-dj.c 	schedule_work(&djrcv_dev->work);
djrcv_dev        1000 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_forward_null_report(struct dj_receiver_dev *djrcv_dev,
djrcv_dev        1008 drivers/hid/hid-logitech-dj.c 	djdev = djrcv_dev->paired_dj_devices[dj_report->device_index];
djrcv_dev        1026 drivers/hid/hid-logitech-dj.c static void logi_dj_recv_forward_dj(struct dj_receiver_dev *djrcv_dev,
djrcv_dev        1032 drivers/hid/hid-logitech-dj.c 	dj_device = djrcv_dev->paired_dj_devices[dj_report->device_index];
djrcv_dev        1058 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev        1069 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev        1071 drivers/hid/hid-logitech-dj.c 		dj_dev = djrcv_dev->paired_dj_devices[i];
djrcv_dev        1074 drivers/hid/hid-logitech-dj.c 			spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev        1079 drivers/hid/hid-logitech-dj.c 	logi_dj_recv_queue_unknown_work(djrcv_dev);
djrcv_dev        1080 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev        1085 drivers/hid/hid-logitech-dj.c static int logi_dj_recv_send_report(struct dj_receiver_dev *djrcv_dev,
djrcv_dev        1088 drivers/hid/hid-logitech-dj.c 	struct hid_device *hdev = djrcv_dev->hidpp;
djrcv_dev        1110 drivers/hid/hid-logitech-dj.c static int logi_dj_recv_query_hidpp_devices(struct dj_receiver_dev *djrcv_dev)
djrcv_dev        1127 drivers/hid/hid-logitech-dj.c 	retval = hid_hw_raw_request(djrcv_dev->hidpp,
djrcv_dev        1137 drivers/hid/hid-logitech-dj.c static int logi_dj_recv_query_paired_devices(struct dj_receiver_dev *djrcv_dev)
djrcv_dev        1142 drivers/hid/hid-logitech-dj.c 	djrcv_dev->last_query = jiffies;
djrcv_dev        1144 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->type != recvr_type_dj)
djrcv_dev        1145 drivers/hid/hid-logitech-dj.c 		return logi_dj_recv_query_hidpp_devices(djrcv_dev);
djrcv_dev        1153 drivers/hid/hid-logitech-dj.c 	retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
djrcv_dev        1159 drivers/hid/hid-logitech-dj.c static int logi_dj_recv_switch_to_dj_mode(struct dj_receiver_dev *djrcv_dev,
djrcv_dev        1162 drivers/hid/hid-logitech-dj.c 	struct hid_device *hdev = djrcv_dev->hidpp;
djrcv_dev        1171 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->type == recvr_type_dj) {
djrcv_dev        1179 drivers/hid/hid-logitech-dj.c 		retval = logi_dj_recv_send_report(djrcv_dev, dj_report);
djrcv_dev        1249 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = djdev->dj_receiver_dev;
djrcv_dev        1266 drivers/hid/hid-logitech-dj.c 		return hid_hw_raw_request(djrcv_dev->hidpp, reportnum, buf,
djrcv_dev        1273 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->type != recvr_type_dj && count >= 2) {
djrcv_dev        1274 drivers/hid/hid-logitech-dj.c 		if (!djrcv_dev->keyboard) {
djrcv_dev        1279 drivers/hid/hid-logitech-dj.c 		return hid_hw_raw_request(djrcv_dev->keyboard, 0, buf, count,
djrcv_dev        1294 drivers/hid/hid-logitech-dj.c 	ret = hid_hw_raw_request(djrcv_dev->hidpp, out_buf[0], out_buf,
djrcv_dev        1406 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev        1441 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev        1443 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev->paired_dj_devices[dj_report->device_index]) {
djrcv_dev        1445 drivers/hid/hid-logitech-dj.c 		logi_dj_recv_queue_notification(djrcv_dev, dj_report);
djrcv_dev        1454 drivers/hid/hid-logitech-dj.c 		logi_dj_recv_queue_notification(djrcv_dev, dj_report);
djrcv_dev        1459 drivers/hid/hid-logitech-dj.c 			logi_dj_recv_forward_null_report(djrcv_dev, dj_report);
djrcv_dev        1463 drivers/hid/hid-logitech-dj.c 		logi_dj_recv_forward_dj(djrcv_dev, dj_report);
djrcv_dev        1467 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev        1476 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev        1513 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev        1515 drivers/hid/hid-logitech-dj.c 	dj_dev = djrcv_dev->paired_dj_devices[device_index];
djrcv_dev        1521 drivers/hid/hid-logitech-dj.c 	if (djrcv_dev->type == recvr_type_27mhz && dj_dev &&
djrcv_dev        1530 drivers/hid/hid-logitech-dj.c 		kfifo_in(&djrcv_dev->notif_fifo, &workitem, sizeof(workitem));
djrcv_dev        1541 drivers/hid/hid-logitech-dj.c 			logi_dj_recv_queue_unknown_work(djrcv_dev);
djrcv_dev        1544 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev        1553 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev        1556 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev)
djrcv_dev        1561 drivers/hid/hid-logitech-dj.c 		if (djrcv_dev->unnumbered_application == HID_GD_KEYBOARD) {
djrcv_dev        1580 drivers/hid/hid-logitech-dj.c 		if (djrcv_dev->unnumbered_application == HID_GD_MOUSE &&
djrcv_dev        1631 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev;
djrcv_dev        1697 drivers/hid/hid-logitech-dj.c 	djrcv_dev = dj_get_receiver_dev(hdev, id->driver_data,
djrcv_dev        1699 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev) {
djrcv_dev        1705 drivers/hid/hid-logitech-dj.c 		djrcv_dev->unnumbered_application = rep->application;
djrcv_dev        1716 drivers/hid/hid-logitech-dj.c 		retval = logi_dj_recv_switch_to_dj_mode(djrcv_dev, 0);
djrcv_dev        1736 drivers/hid/hid-logitech-dj.c 		spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev        1737 drivers/hid/hid-logitech-dj.c 		djrcv_dev->ready = true;
djrcv_dev        1738 drivers/hid/hid-logitech-dj.c 		spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev        1739 drivers/hid/hid-logitech-dj.c 		retval = logi_dj_recv_query_paired_devices(djrcv_dev);
djrcv_dev        1765 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev        1767 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev || djrcv_dev->hidpp != hdev)
djrcv_dev        1770 drivers/hid/hid-logitech-dj.c 	retval = logi_dj_recv_switch_to_dj_mode(djrcv_dev, 0);
djrcv_dev        1782 drivers/hid/hid-logitech-dj.c 	struct dj_receiver_dev *djrcv_dev = hid_get_drvdata(hdev);
djrcv_dev        1789 drivers/hid/hid-logitech-dj.c 	if (!djrcv_dev)
djrcv_dev        1796 drivers/hid/hid-logitech-dj.c 	spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev        1797 drivers/hid/hid-logitech-dj.c 	djrcv_dev->ready = false;
djrcv_dev        1798 drivers/hid/hid-logitech-dj.c 	spin_unlock_irqrestore(&djrcv_dev->lock, flags);
djrcv_dev        1800 drivers/hid/hid-logitech-dj.c 	cancel_work_sync(&djrcv_dev->work);
djrcv_dev        1813 drivers/hid/hid-logitech-dj.c 		spin_lock_irqsave(&djrcv_dev->lock, flags);
djrcv_dev        1814 drivers/hid/hid-logitech-dj.c 		dj_dev = djrcv_dev->paired_dj_devices[i];
djrcv_dev        1815 drivers/hid/hid-logitech-dj.c 		djrcv_dev->paired_dj_devices[i] = NULL;
djrcv_dev        1816 drivers/hid/hid-logitech-dj.c 		spin_unlock_irqrestore(&djrcv_dev->lock, flags);