Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 267978
b: refs/heads/master
c: 4ab0871
h: refs/heads/master
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Aug 25, 2011
1 parent 5894e3b commit 46ece34
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 65 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3f4636e625204e74986e9f1f845229ebd6235f9e
refs/heads/master: 4ab0871ddd1bfdc514f93472cfd68290ecdb62c0
126 changes: 62 additions & 64 deletions trunk/drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ struct input_device_context {
int connected;
};

static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len);

static struct mousevsc_dev *alloc_input_device(struct hv_device *device)
{
struct mousevsc_dev *input_dev;
Expand Down Expand Up @@ -651,6 +649,68 @@ static int mousevsc_connect_to_vsp(struct hv_device *device)
return ret;
}

static int mousevsc_hid_open(struct hid_device *hid)
{
return 0;
}

static void mousevsc_hid_close(struct hid_device *hid)
{
}

static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
{
struct input_device_context *input_device_ctx =
dev_get_drvdata(&dev->device);
struct hid_device *hid_dev;

/* hid_debug = -1; */
hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);

if (hid_parse_report(hid_dev, packet, len)) {
DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
return;
}

if (hid_dev) {
DPRINT_INFO(INPUTVSC_DRV, "hid_device created");

hid_dev->ll_driver->open = mousevsc_hid_open;
hid_dev->ll_driver->close = mousevsc_hid_close;

hid_dev->bus = BUS_VIRTUAL;
hid_dev->vendor = input_device_ctx->device_info.vendor;
hid_dev->product = input_device_ctx->device_info.product;
hid_dev->version = input_device_ctx->device_info.version;
hid_dev->dev = dev->device;

sprintf(hid_dev->name, "%s",
input_device_ctx->device_info.name);

/*
* HJ Do we want to call it with a 0
*/
if (!hidinput_connect(hid_dev, 0)) {
hid_dev->claimed |= HID_CLAIMED_INPUT;

input_device_ctx->connected = 1;

DPRINT_INFO(INPUTVSC_DRV,
"HID device claimed by input\n");
}

if (!hid_dev->claimed) {
DPRINT_ERR(INPUTVSC_DRV,
"HID device not claimed by "
"input or hiddev\n");
}

input_device_ctx->hid_device = hid_dev;
}

kfree(hid_dev);
}

static int mousevsc_on_device_add(struct hv_device *device,
void *additional_info)
{
Expand Down Expand Up @@ -762,15 +822,6 @@ static int mousevsc_on_device_remove(struct hv_device *device)
}


static int mousevsc_hid_open(struct hid_device *hid)
{
return 0;
}

static void mousevsc_hid_close(struct hid_device *hid)
{
}

static int mousevsc_probe(struct hv_device *dev)
{
int ret = 0;
Expand Down Expand Up @@ -826,59 +877,6 @@ static int mousevsc_remove(struct hv_device *dev)
return ret;
}

static void reportdesc_callback(struct hv_device *dev, void *packet, u32 len)
{
struct input_device_context *input_device_ctx =
dev_get_drvdata(&dev->device);
struct hid_device *hid_dev;

/* hid_debug = -1; */
hid_dev = kmalloc(sizeof(struct hid_device), GFP_KERNEL);

if (hid_parse_report(hid_dev, packet, len)) {
DPRINT_INFO(INPUTVSC_DRV, "Unable to call hd_parse_report");
return;
}

if (hid_dev) {
DPRINT_INFO(INPUTVSC_DRV, "hid_device created");

hid_dev->ll_driver->open = mousevsc_hid_open;
hid_dev->ll_driver->close = mousevsc_hid_close;

hid_dev->bus = BUS_VIRTUAL;
hid_dev->vendor = input_device_ctx->device_info.vendor;
hid_dev->product = input_device_ctx->device_info.product;
hid_dev->version = input_device_ctx->device_info.version;
hid_dev->dev = dev->device;

sprintf(hid_dev->name, "%s",
input_device_ctx->device_info.name);

/*
* HJ Do we want to call it with a 0
*/
if (!hidinput_connect(hid_dev, 0)) {
hid_dev->claimed |= HID_CLAIMED_INPUT;

input_device_ctx->connected = 1;

DPRINT_INFO(INPUTVSC_DRV,
"HID device claimed by input\n");
}

if (!hid_dev->claimed) {
DPRINT_ERR(INPUTVSC_DRV,
"HID device not claimed by "
"input or hiddev\n");
}

input_device_ctx->hid_device = hid_dev;
}

kfree(hid_dev);
}

static const struct hv_vmbus_device_id id_table[] = {
/* Mouse guid */
{ VMBUS_DEVICE(0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
Expand Down

0 comments on commit 46ece34

Please sign in to comment.