Staging: hv: hv_mouse: remove inputreport_callback function
[zen-stable.git] / drivers / staging / hv / hv_mouse.c
blob257684eff6e62085d3f3c6cc9d8dc8fe21c0f7c9
1 /*
2 * Copyright (c) 2009, Citrix Systems, Inc.
3 * Copyright (c) 2010, Microsoft Corporation.
4 * Copyright (c) 2011, Novell Inc.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
15 #include <linux/init.h>
16 #include <linux/module.h>
17 #include <linux/delay.h>
18 #include <linux/device.h>
19 #include <linux/workqueue.h>
20 #include <linux/sched.h>
21 #include <linux/wait.h>
22 #include <linux/input.h>
23 #include <linux/hid.h>
24 #include <linux/hiddev.h>
26 #include "hyperv.h"
30 * Data types
32 struct hv_input_dev_info {
33 unsigned short vendor;
34 unsigned short product;
35 unsigned short version;
36 char name[128];
39 /* The maximum size of a synthetic input message. */
40 #define SYNTHHID_MAX_INPUT_REPORT_SIZE 16
43 * Current version
45 * History:
46 * Beta, RC < 2008/1/22 1,0
47 * RC > 2008/1/22 2,0
49 #define SYNTHHID_INPUT_VERSION_MAJOR 2
50 #define SYNTHHID_INPUT_VERSION_MINOR 0
51 #define SYNTHHID_INPUT_VERSION (SYNTHHID_INPUT_VERSION_MINOR | \
52 (SYNTHHID_INPUT_VERSION_MAJOR << 16))
55 #pragma pack(push, 1)
57 * Message types in the synthetic input protocol
59 enum synthhid_msg_type {
60 SynthHidProtocolRequest,
61 SynthHidProtocolResponse,
62 SynthHidInitialDeviceInfo,
63 SynthHidInitialDeviceInfoAck,
64 SynthHidInputReport,
65 SynthHidMax
69 * Basic message structures.
71 struct synthhid_msg_hdr {
72 enum synthhid_msg_type type;
73 u32 size;
76 struct synthhid_msg {
77 struct synthhid_msg_hdr header;
78 char data[1]; /* Enclosed message */
81 union synthhid_version {
82 struct {
83 u16 minor_version;
84 u16 major_version;
86 u32 version;
90 * Protocol messages
92 struct synthhid_protocol_request {
93 struct synthhid_msg_hdr header;
94 union synthhid_version version_requested;
97 struct synthhid_protocol_response {
98 struct synthhid_msg_hdr header;
99 union synthhid_version version_requested;
100 unsigned char approved;
103 struct synthhid_device_info {
104 struct synthhid_msg_hdr header;
105 struct hv_input_dev_info hid_dev_info;
106 struct hid_descriptor hid_descriptor;
109 struct synthhid_device_info_ack {
110 struct synthhid_msg_hdr header;
111 unsigned char reserved;
114 struct synthhid_input_report {
115 struct synthhid_msg_hdr header;
116 char buffer[1];
119 #pragma pack(pop)
121 #define INPUTVSC_SEND_RING_BUFFER_SIZE (10*PAGE_SIZE)
122 #define INPUTVSC_RECV_RING_BUFFER_SIZE (10*PAGE_SIZE)
124 #define NBITS(x) (((x)/BITS_PER_LONG)+1)
126 enum pipe_prot_msg_type {
127 PipeMessageInvalid = 0,
128 PipeMessageData,
129 PipeMessageMaximum
133 struct pipe_prt_msg {
134 enum pipe_prot_msg_type type;
135 u32 size;
136 char data[1];
140 * Data types
142 struct mousevsc_prt_msg {
143 enum pipe_prot_msg_type type;
144 u32 size;
145 union {
146 struct synthhid_protocol_request request;
147 struct synthhid_protocol_response response;
148 struct synthhid_device_info_ack ack;
153 * Represents an mousevsc device
155 struct mousevsc_dev {
156 struct hv_device *device;
157 /* 0 indicates the device is being destroyed */
158 atomic_t ref_count;
159 int num_outstanding_req;
160 unsigned char init_complete;
161 struct mousevsc_prt_msg protocol_req;
162 struct mousevsc_prt_msg protocol_resp;
163 /* Synchronize the request/response if needed */
164 wait_queue_head_t protocol_wait_event;
165 wait_queue_head_t dev_info_wait_event;
166 int protocol_wait_condition;
167 int device_wait_condition;
168 int dev_info_status;
170 struct hid_descriptor *hid_desc;
171 unsigned char *report_desc;
172 u32 report_desc_size;
173 struct hv_input_dev_info hid_dev_info;
176 struct input_device_context {
177 struct hv_device *device_ctx;
178 struct hid_device *hid_device;
179 struct hv_input_dev_info device_info;
180 int connected;
183 static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);
185 static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
187 struct mousevsc_dev *input_dev;
189 input_dev = kzalloc(sizeof(struct mousevsc_dev), GFP_KERNEL);
191 if (!input_dev)
192 return NULL;
195 * Set to 2 to allow both inbound and outbound traffics
196 * (ie get_input_device() and must_get_input_device()) to proceed.
198 atomic_cmpxchg(&input_dev->ref_count, 0, 2);
200 input_dev->device = device;
201 device->ext = input_dev;
203 return input_dev;
206 static void free_input_device(struct mousevsc_dev *device)
208 WARN_ON(atomic_read(&device->ref_count) == 0);
209 kfree(device);
213 * Get the inputdevice object if exists and its refcount > 1
215 static struct mousevsc_dev *get_input_device(struct hv_device *device)
217 struct mousevsc_dev *input_dev;
219 input_dev = (struct mousevsc_dev *)device->ext;
222 * FIXME
223 * This sure isn't a valid thing to print for debugging, no matter
224 * what the intention is...
226 * printk(KERN_ERR "-------------------------> REFCOUNT = %d",
227 * input_dev->ref_count);
230 if (input_dev && atomic_read(&input_dev->ref_count) > 1)
231 atomic_inc(&input_dev->ref_count);
232 else
233 input_dev = NULL;
235 return input_dev;
239 * Get the inputdevice object iff exists and its refcount > 0
241 static struct mousevsc_dev *must_get_input_device(struct hv_device *device)
243 struct mousevsc_dev *input_dev;
245 input_dev = (struct mousevsc_dev *)device->ext;
247 if (input_dev && atomic_read(&input_dev->ref_count))
248 atomic_inc(&input_dev->ref_count);
249 else
250 input_dev = NULL;
252 return input_dev;
255 static void put_input_device(struct hv_device *device)
257 struct mousevsc_dev *input_dev;
259 input_dev = (struct mousevsc_dev *)device->ext;
261 atomic_dec(&input_dev->ref_count);
265 * Drop ref count to 1 to effectively disable get_input_device()
267 static struct mousevsc_dev *release_input_device(struct hv_device *device)
269 struct mousevsc_dev *input_dev;
271 input_dev = (struct mousevsc_dev *)device->ext;
273 /* Busy wait until the ref drop to 2, then set it to 1 */
274 while (atomic_cmpxchg(&input_dev->ref_count, 2, 1) != 2)
275 udelay(100);
277 return input_dev;
281 * Drop ref count to 0. No one can use input_device object.
283 static struct mousevsc_dev *final_release_input_device(struct hv_device *device)
285 struct mousevsc_dev *input_dev;
287 input_dev = (struct mousevsc_dev *)device->ext;
289 /* Busy wait until the ref drop to 1, then set it to 0 */
290 while (atomic_cmpxchg(&input_dev->ref_count, 1, 0) != 1)
291 udelay(100);
293 device->ext = NULL;
294 return input_dev;
297 static void mousevsc_on_send_completion(struct hv_device *device,
298 struct vmpacket_descriptor *packet)
300 struct mousevsc_dev *input_dev;
301 void *request;
303 input_dev = must_get_input_device(device);
304 if (!input_dev) {
305 pr_err("unable to get input device...device being destroyed?");
306 return;
309 request = (void *)(unsigned long)packet->trans_id;
311 if (request == &input_dev->protocol_req) {
312 /* FIXME */
313 /* Shouldn't we be doing something here? */
316 put_input_device(device);
319 static void mousevsc_on_receive_device_info(struct mousevsc_dev *input_device,
320 struct synthhid_device_info *device_info)
322 int ret = 0;
323 struct hid_descriptor *desc;
324 struct mousevsc_prt_msg ack;
326 /* Assume success for now */
327 input_device->dev_info_status = 0;
329 /* Save the device attr */
330 memcpy(&input_device->hid_dev_info, &device_info->hid_dev_info,
331 sizeof(struct hv_input_dev_info));
333 /* Save the hid desc */
334 desc = &device_info->hid_descriptor;
335 WARN_ON(desc->bLength > 0);
337 input_device->hid_desc = kzalloc(desc->bLength, GFP_KERNEL);
339 if (!input_device->hid_desc) {
340 pr_err("unable to allocate hid descriptor - size %d", desc->bLength);
341 goto cleanup;
344 memcpy(input_device->hid_desc, desc, desc->bLength);
346 /* Save the report desc */
347 input_device->report_desc_size = desc->desc[0].wDescriptorLength;
348 input_device->report_desc = kzalloc(input_device->report_desc_size,
349 GFP_KERNEL);
351 if (!input_device->report_desc) {
352 pr_err("unable to allocate report descriptor - size %d",
353 input_device->report_desc_size);
354 goto cleanup;
357 memcpy(input_device->report_desc,
358 ((unsigned char *)desc) + desc->bLength,
359 desc->desc[0].wDescriptorLength);
361 /* Send the ack */
362 memset(&ack, 0, sizeof(struct mousevsc_prt_msg));
364 ack.type = PipeMessageData;
365 ack.size = sizeof(struct synthhid_device_info_ack);
367 ack.ack.header.type = SynthHidInitialDeviceInfoAck;
368 ack.ack.header.size = 1;
369 ack.ack.reserved = 0;
371 ret = vmbus_sendpacket(input_device->device->channel,
372 &ack,
373 sizeof(struct pipe_prt_msg) - sizeof(unsigned char) +
374 sizeof(struct synthhid_device_info_ack),
375 (unsigned long)&ack,
376 VM_PKT_DATA_INBAND,
377 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
378 if (ret != 0) {
379 pr_err("unable to send synthhid device info ack - ret %d",
380 ret);
381 goto cleanup;
384 input_device->device_wait_condition = 1;
385 wake_up(&input_device->dev_info_wait_event);
387 return;
389 cleanup:
390 kfree(input_device->hid_desc);
391 input_device->hid_desc = NULL;
393 kfree(input_device->report_desc);
394 input_device->report_desc = NULL;
396 input_device->dev_info_status = -1;
397 input_device->device_wait_condition = 1;
398 wake_up(&input_device->dev_info_wait_event);
401 static void mousevsc_on_receive_input_report(struct mousevsc_dev *input_device,
402 struct synthhid_input_report *input_report)
404 struct hv_driver *input_drv;
405 struct input_device_context *input_dev_ctx;
407 if (!input_device->init_complete) {
408 pr_info("Initialization incomplete...ignoring input_report msg");
409 return;
412 input_drv = drv_to_hv_drv(input_device->device->device.driver);
414 input_dev_ctx = dev_get_drvdata(&input_device->device->device);
416 hid_input_report(input_dev_ctx->hid_device,
417 HID_INPUT_REPORT, input_report->buffer, input_report->header.size, 1);
421 static void mousevsc_on_receive(struct hv_device *device,
422 struct vmpacket_descriptor *packet)
424 struct pipe_prt_msg *pipe_msg;
425 struct synthhid_msg *hid_msg;
426 struct mousevsc_dev *input_dev;
428 input_dev = must_get_input_device(device);
429 if (!input_dev) {
430 pr_err("unable to get input device...device being destroyed?");
431 return;
434 pipe_msg = (struct pipe_prt_msg *)((unsigned long)packet +
435 (packet->offset8 << 3));
437 if (pipe_msg->type != PipeMessageData) {
438 pr_err("unknown pipe msg type - type %d len %d",
439 pipe_msg->type, pipe_msg->size);
440 put_input_device(device);
441 return ;
444 hid_msg = (struct synthhid_msg *)&pipe_msg->data[0];
446 switch (hid_msg->header.type) {
447 case SynthHidProtocolResponse:
448 memcpy(&input_dev->protocol_resp, pipe_msg,
449 pipe_msg->size + sizeof(struct pipe_prt_msg) -
450 sizeof(unsigned char));
451 input_dev->protocol_wait_condition = 1;
452 wake_up(&input_dev->protocol_wait_event);
453 break;
455 case SynthHidInitialDeviceInfo:
456 WARN_ON(pipe_msg->size >= sizeof(struct hv_input_dev_info));
459 * Parse out the device info into device attr,
460 * hid desc and report desc
462 mousevsc_on_receive_device_info(input_dev,
463 (struct synthhid_device_info *)&pipe_msg->data[0]);
464 break;
465 case SynthHidInputReport:
466 mousevsc_on_receive_input_report(input_dev,
467 (struct synthhid_input_report *)&pipe_msg->data[0]);
469 break;
470 default:
471 pr_err("unsupported hid msg type - type %d len %d",
472 hid_msg->header.type, hid_msg->header.size);
473 break;
476 put_input_device(device);
479 static void mousevsc_on_channel_callback(void *context)
481 const int packetSize = 0x100;
482 int ret = 0;
483 struct hv_device *device = (struct hv_device *)context;
484 struct mousevsc_dev *input_dev;
486 u32 bytes_recvd;
487 u64 req_id;
488 unsigned char packet[0x100];
489 struct vmpacket_descriptor *desc;
490 unsigned char *buffer = packet;
491 int bufferlen = packetSize;
493 input_dev = must_get_input_device(device);
495 if (!input_dev) {
496 pr_err("unable to get input device...device being destroyed?");
497 return;
500 do {
501 ret = vmbus_recvpacket_raw(device->channel, buffer,
502 bufferlen, &bytes_recvd, &req_id);
504 if (ret == 0) {
505 if (bytes_recvd > 0) {
506 desc = (struct vmpacket_descriptor *)buffer;
508 switch (desc->type) {
509 case VM_PKT_COMP:
510 mousevsc_on_send_completion(
511 device, desc);
512 break;
514 case VM_PKT_DATA_INBAND:
515 mousevsc_on_receive(
516 device, desc);
517 break;
519 default:
520 pr_err("unhandled packet type %d, tid %llx len %d\n",
521 desc->type,
522 req_id,
523 bytes_recvd);
524 break;
527 /* reset */
528 if (bufferlen > packetSize) {
529 kfree(buffer);
531 buffer = packet;
532 bufferlen = packetSize;
534 } else {
536 * pr_debug("nothing else to read...");
537 * reset
539 if (bufferlen > packetSize) {
540 kfree(buffer);
542 buffer = packet;
543 bufferlen = packetSize;
545 break;
547 } else if (ret == -ENOBUFS) {
548 /* Handle large packet */
549 bufferlen = bytes_recvd;
550 buffer = kzalloc(bytes_recvd, GFP_KERNEL);
552 if (buffer == NULL) {
553 buffer = packet;
554 bufferlen = packetSize;
556 /* Try again next time around */
557 pr_err("unable to allocate buffer of size %d!",
558 bytes_recvd);
559 break;
562 } while (1);
564 put_input_device(device);
566 return;
569 static int mousevsc_connect_to_vsp(struct hv_device *device)
571 int ret = 0;
572 struct mousevsc_dev *input_dev;
573 struct mousevsc_prt_msg *request;
574 struct mousevsc_prt_msg *response;
576 input_dev = get_input_device(device);
578 if (!input_dev) {
579 pr_err("unable to get input device...device being destroyed?");
580 return -1;
583 init_waitqueue_head(&input_dev->protocol_wait_event);
584 init_waitqueue_head(&input_dev->dev_info_wait_event);
586 request = &input_dev->protocol_req;
589 * Now, initiate the vsc/vsp initialization protocol on the open channel
591 memset(request, 0, sizeof(struct mousevsc_prt_msg));
593 request->type = PipeMessageData;
594 request->size = sizeof(struct synthhid_protocol_request);
596 request->request.header.type = SynthHidProtocolRequest;
597 request->request.header.size = sizeof(unsigned long);
598 request->request.version_requested.version = SYNTHHID_INPUT_VERSION;
600 pr_info("synthhid protocol request...");
602 ret = vmbus_sendpacket(device->channel, request,
603 sizeof(struct pipe_prt_msg) -
604 sizeof(unsigned char) +
605 sizeof(struct synthhid_protocol_request),
606 (unsigned long)request,
607 VM_PKT_DATA_INBAND,
608 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
609 if (ret != 0) {
610 pr_err("unable to send synthhid protocol request.");
611 goto cleanup;
614 input_dev->protocol_wait_condition = 0;
615 wait_event_timeout(input_dev->protocol_wait_event,
616 input_dev->protocol_wait_condition, msecs_to_jiffies(1000));
617 if (input_dev->protocol_wait_condition == 0) {
618 ret = -ETIMEDOUT;
619 goto cleanup;
622 response = &input_dev->protocol_resp;
624 if (!response->response.approved) {
625 pr_err("synthhid protocol request failed (version %d)",
626 SYNTHHID_INPUT_VERSION);
627 ret = -1;
628 goto cleanup;
631 input_dev->device_wait_condition = 0;
632 wait_event_timeout(input_dev->dev_info_wait_event,
633 input_dev->device_wait_condition, msecs_to_jiffies(1000));
634 if (input_dev->device_wait_condition == 0) {
635 ret = -ETIMEDOUT;
636 goto cleanup;
640 * We should have gotten the device attr, hid desc and report
641 * desc at this point
643 if (!input_dev->dev_info_status)
644 pr_info("**** input channel up and running!! ****");
645 else
646 ret = -1;
648 cleanup:
649 put_input_device(device);
651 return ret;
654 static int mousevsc_on_device_add(struct hv_device *device,
655 void *additional_info)
657 int ret = 0;
658 struct mousevsc_dev *input_dev;
659 struct hv_driver *input_drv;
660 struct hv_input_dev_info dev_info;
661 struct input_device_context *input_device_ctx;
663 input_dev = alloc_input_device(device);
665 if (!input_dev) {
666 ret = -1;
667 goto cleanup;
670 input_dev->init_complete = false;
672 /* Open the channel */
673 ret = vmbus_open(device->channel,
674 INPUTVSC_SEND_RING_BUFFER_SIZE,
675 INPUTVSC_RECV_RING_BUFFER_SIZE,
676 NULL,
678 mousevsc_on_channel_callback,
679 device
682 if (ret != 0) {
683 pr_err("unable to open channel: %d", ret);
684 free_input_device(input_dev);
685 return -1;
688 pr_info("InputVsc channel open: %d", ret);
690 ret = mousevsc_connect_to_vsp(device);
692 if (ret != 0) {
693 pr_err("unable to connect channel: %d", ret);
695 vmbus_close(device->channel);
696 free_input_device(input_dev);
697 return ret;
700 input_drv = drv_to_hv_drv(input_dev->device->device.driver);
702 dev_info.vendor = input_dev->hid_dev_info.vendor;
703 dev_info.product = input_dev->hid_dev_info.product;
704 dev_info.version = input_dev->hid_dev_info.version;
705 strcpy(dev_info.name, "Microsoft Vmbus HID-compliant Mouse");
707 /* Send the device info back up */
708 input_device_ctx = dev_get_drvdata(&device->device);
709 memcpy(&input_device_ctx->device_info, &dev_info,
710 sizeof(struct hv_input_dev_info));
712 /* Send the report desc back up */
713 /* workaround SA-167 */
714 if (input_dev->report_desc[14] == 0x25)
715 input_dev->report_desc[14] = 0x29;
717 reportdesc_callback(device, input_dev->report_desc,
718 input_dev->report_desc_size);
720 input_dev->init_complete = true;
722 cleanup:
723 return ret;
726 static int mousevsc_on_device_remove(struct hv_device *device)
728 struct mousevsc_dev *input_dev;
729 int ret = 0;
731 pr_info("disabling input device (%p)...",
732 device->ext);
734 input_dev = release_input_device(device);
738 * At this point, all outbound traffic should be disable. We only
739 * allow inbound traffic (responses) to proceed
741 * so that outstanding requests can be completed.
743 while (input_dev->num_outstanding_req) {
744 pr_info("waiting for %d requests to complete...",
745 input_dev->num_outstanding_req);
747 udelay(100);
750 pr_info("removing input device (%p)...", device->ext);
752 input_dev = final_release_input_device(device);
754 pr_info("input device (%p) safe to remove", input_dev);
756 /* Close the channel */
757 vmbus_close(device->channel);
759 free_input_device(input_dev);
761 return ret;
765 static int mousevsc_hid_open(struct hid_device *hid)
767 return 0;
770 static void mousevsc_hid_close(struct hid_device *hid)
774 static int mousevsc_probe(struct hv_device *dev)
776 int ret = 0;
778 struct input_device_context *input_dev_ctx;
780 input_dev_ctx = kmalloc(sizeof(struct input_device_context),
781 GFP_KERNEL);
783 dev_set_drvdata(&dev->device, input_dev_ctx);
785 /* Call to the vsc driver to add the device */
786 ret = mousevsc_on_device_add(dev, NULL);
788 if (ret != 0) {
789 DPRINT_ERR(INPUTVSC_DRV, "unable to add input vsc device");
791 return -1;
794 return 0;
797 static int mousevsc_remove(struct hv_device *dev)
799 int ret = 0;
801 struct input_device_context *input_dev_ctx;
803 input_dev_ctx = kmalloc(sizeof(struct input_device_context),
804 GFP_KERNEL);
806 dev_set_drvdata(&dev->device, input_dev_ctx);
808 if (input_dev_ctx->connected) {
809 hidinput_disconnect(input_dev_ctx->hid_device);
810 input_dev_ctx->connected = 0;
814 * Call to the vsc driver to let it know that the device
815 * is being removed
817 ret = mousevsc_on_device_remove(dev);
819 if (ret != 0) {
820 DPRINT_ERR(INPUTVSC_DRV,
821 "unable to remove vsc device (ret %d)", ret);
824 kfree(input_dev_ctx);
826 return ret;
829 static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
831 struct input_device_context *input_device_ctx =
832 dev_get_drvdata(&dev->device);
833 struct hid_device *hid_dev;
835 /* hid_debug = -1; */
836 hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);
838 if (hid_parse_report(hid_dev, packet, len)) {
839 DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
840 return;
843 if (hid_dev) {
844 DPRINT_INFO(INPUTVSC_DRV, "hid_device created");
846 hid_dev->ll_driver->open = mousevsc_hid_open;
847 hid_dev->ll_driver->close = mousevsc_hid_close;
849 hid_dev->bus = BUS_VIRTUAL;
850 hid_dev->vendor = input_device_ctx->device_info.vendor;
851 hid_dev->product = input_device_ctx->device_info.product;
852 hid_dev->version = input_device_ctx->device_info.version;
853 hid_dev->dev = dev->device;
855 sprintf(hid_dev->name, "%s",
856 input_device_ctx->device_info.name);
859 * HJ Do we want to call it with a 0
861 if (!hidinput_connect(hid_dev, 0)) {
862 hid_dev->claimed |= HID_CLAIMED_INPUT;
864 input_device_ctx->connected = 1;
866 DPRINT_INFO(INPUTVSC_DRV,
867 "HID device claimed by input\n");
870 if (!hid_dev->claimed) {
871 DPRINT_ERR(INPUTVSC_DRV,
872 "HID device not claimed by "
873 "input or hiddev\n");
876 input_device_ctx->hid_device = hid_dev;
879 kfree(hid_dev);
882 static const struct hv_vmbus_device_id id_table[] = {
883 /* Mouse guid */
884 { VMBUS_DEVICE(0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
885 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A) },
886 { },
890 * The mouse driver is not functional; do not auto-load it.
892 /* MODULE_DEVICE_TABLE(vmbus, id_table); */
894 static struct hv_driver mousevsc_drv = {
895 .name = "mousevsc",
896 .id_table = id_table,
897 .probe = mousevsc_probe,
898 .remove = mousevsc_remove,
901 static int __init mousevsc_init(void)
903 return vmbus_driver_register(&mousevsc_drv);
906 static void __exit mousevsc_exit(void)
908 vmbus_driver_unregister(&mousevsc_drv);
911 MODULE_LICENSE("GPL");
912 MODULE_VERSION(HV_DRV_VERSION);
913 module_init(mousevsc_init);
914 module_exit(mousevsc_exit);