From: "K. Y. Srinivasan" <kys@microsoft.com>
To: gregkh@suse.de, linux-kernel@vger.kernel.org,
devel@linuxdriverproject.org, virtualization@lists.osdl.org
Cc: "K. Y. Srinivasan" <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>
Subject: [PATCH 10/59] Staging: hv: util: Make hv_utils a vmbus device driver
Date: Thu, 25 Aug 2011 09:48:36 -0700 [thread overview]
Message-ID: <1314290965-2698-10-git-send-email-kys@microsoft.com> (raw)
In-Reply-To: <1314290965-2698-1-git-send-email-kys@microsoft.com>
In preperation for supporting auto-loading the util driver, make
the util driver a vmbus driver.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
---
drivers/staging/hv/hv_util.c | 64 +++++++++++++++++++++++++++++++++++++++++-
1 files changed, 63 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/hv_util.c b/drivers/staging/hv/hv_util.c
index c164b54..a620f4d 100644
--- a/drivers/staging/hv/hv_util.c
+++ b/drivers/staging/hv/hv_util.c
@@ -36,6 +36,8 @@ static u8 *shut_txf_buf;
static u8 *time_txf_buf;
static u8 *hbeat_txf_buf;
+static const char *driver_name = "hv_util";
+
static void shutdown_onchannelcallback(void *context)
{
struct vmbus_channel *channel = context;
@@ -210,6 +212,63 @@ static void heartbeat_onchannelcallback(void *context)
}
}
+/*
+ * The devices managed by the util driver don't need any additional
+ * setup.
+ */
+static int util_probe(struct hv_device *dev)
+{
+ return 0;
+}
+
+static int util_remove(struct hv_device *dev)
+{
+ return 0;
+}
+
+static const struct hv_vmbus_device_id id_table[] = {
+ {
+ /* Shutdown guid */
+ .guid = {
+ 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
+ 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
+ }
+ },
+ {
+ /* Time synch guid */
+ .guid = {
+ 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
+ }
+ },
+ {
+ /* Heartbeat guid */
+ .guid = {
+ 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
+ 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
+ }
+ },
+ {
+ /* KVP guid */
+ .guid = {
+ 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
+ 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
+ }
+ },
+ {
+ .guid = { }
+ },
+};
+
+MODULE_DEVICE_TABLE(vmbus, id_table);
+
+/* The one and only one */
+static struct hv_driver util_drv = {
+ .id_table = id_table,
+ .probe = util_probe,
+ .remove = util_remove,
+};
+
static const struct pci_device_id __initconst
hv_utils_pci_table[] __maybe_unused = {
{ PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
@@ -264,7 +323,9 @@ static int __init init_hyperv_utils(void)
hv_cb_utils[HV_KVP_MSG].callback = &hv_kvp_onchannelcallback;
- return 0;
+ util_drv.driver.name = driver_name;
+
+ return vmbus_child_driver_register(&util_drv.driver);
}
static void exit_hyperv_utils(void)
@@ -296,6 +357,7 @@ static void exit_hyperv_utils(void)
kfree(shut_txf_buf);
kfree(time_txf_buf);
kfree(hbeat_txf_buf);
+ vmbus_child_driver_unregister(&util_drv.driver);
}
module_init(init_hyperv_utils);
--
1.7.4.1
next prev parent reply other threads:[~2011-08-25 17:03 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 16:47 [PATCH 0000/0059] Staging: hv: Driver cleanup K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 01/59] Staging: hv: vmbus: VMBUS is an ACPI enumerated device, get rid of the PCI signature K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 02/59] Staging: hv: Replace struct hv_guid with the uuid type already defined in Linux K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 03/59] Staging: hv: Add struct hv_vmbus_device_id to mod_devicetable.h K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 04/59] Staging: hv: Add code to parse struct hv_vmbus_device_id table K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 05/59] Staging: hv: vmbus: Introduce vmbus ID space in struct hv_driver K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 06/59] Staging: hv: blkvsc: Use the newly introduced vmbus ID in the blockvsc driver K. Y. Srinivasan
2011-08-25 17:36 ` Greg KH
2011-08-25 17:52 ` KY Srinivasan
2011-08-25 18:46 ` Greg KH
2011-08-25 18:50 ` KY Srinivasan
2011-08-25 20:43 ` Greg KH
2011-08-25 16:48 ` [PATCH 07/59] Staging: hv: storvsc: Use the newly introduced vmbus ID in storvsc driver K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 08/59] Staging: hv: netvsc: Use the newly introduced vmbus ID in netvsc driver K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 09/59] Staging: hv: mousevsc: Use the newly introduced vmbus ID in mouse driver K. Y. Srinivasan
2011-08-25 16:48 ` K. Y. Srinivasan [this message]
2011-08-30 15:53 ` [PATCH 10/59] Staging: hv: util: Make hv_utils a vmbus device driver Dan Carpenter
2011-08-30 17:14 ` KY Srinivasan
2011-08-25 16:48 ` [PATCH 11/59] Staging: hv: vmbus: Cleanup vmbus_match() K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 12/59] Staging: hv: vmbus: Cleanup vmbus_uevent() code K. Y. Srinivasan
2011-08-25 20:59 ` Greg KH
2011-08-25 21:15 ` Greg KH
2011-08-25 22:20 ` KY Srinivasan
2011-08-25 22:28 ` Greg KH
2011-08-25 22:46 ` KY Srinivasan
2011-08-25 22:14 ` KY Srinivasan
2011-08-25 22:26 ` Greg KH
2011-08-25 16:48 ` [PATCH 13/59] Staging: hv: vmbus: Support the notion of id tables in vmbus_match() K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 14/59] Staging: hv: vmbus: Get rid of an unnecessary include line in vmbus_drv.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 15/59] Staging: hv: storvsc: Get rid of the DMI signature K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 16/59] Staging: hv: netvsc: Get rid of the PCI signature K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 17/59] Staging: hv: netvsc: Get rid of the DMI signature in netvsc_drv.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 18/59] Staging: hv: util: Get rid of the DMI signature in hv_util.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 19/59] Staging: hv: util: Get rid of the PCI " K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 20/59] Staging: hv: netvsc: Initialize the driver name directly K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 21/59] Staging: hv: netvsc: Get rid of the empty function netvsc_initialize() K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 22/59] Staging: hv: vmbus: Get rid of the unused name field in struct hv_driver K. Y. Srinivasan
2011-08-25 21:24 ` Greg KH
2011-08-25 21:28 ` Greg KH
2011-08-25 22:11 ` Greg KH
2011-08-25 22:27 ` KY Srinivasan
2011-08-25 22:35 ` Greg KH
2011-08-25 16:48 ` [PATCH 23/59] Staging: hv: vmbus: Get rid of some unnecessary comments K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 24/59] Staging: hv: vmbus: Cleanup unnecessary comments in hv.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 25/59] Staging: hv: vmbus: Cleanup error handling in hv_init() K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 26/59] Staging: hv: vmbus: Get rid of unnecessay comments in connection.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 27/59] Staging: hv: vmbus: Get rid of the function dump_gpadl_body() K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 28/59] Staging: hv: vmbus: Get rid of the function dump_gpadl_header() K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 29/59] Staging: hv: vmbus: Rename openMsg to open_msg in channel.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 30/59] Staging: hv: vmbus: Get rid of unnecessary comments " K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 31/59] Staging: hv: vmbus: Change the variable name openInfo to open_info " K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 32/59] Staging: hv: vmbus: Cleanup error values in ringbuffer.c K. Y. Srinivasan
2011-08-25 16:48 ` [PATCH 33/59] Staging: hv: vmbus: Cleanup the error return value in vmbus_recvpacket_raw() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 34/59] Staging: hv: netvsc: Get rid of an unnecessary print statement in netvsc_probe() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 35/59] Staging: hv: vmbus: Retry vmbus_post_msg() before giving up K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 36/59] Staging: hv: storvsc: Cleanup error handling in storvsc_dev_add() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 37/59] Staging: hv: storvsc: Cleanup error handling in storvsc_channel_init() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 38/59] Staging: hv: storvsc: Cleanup error handling in storvsc_connect_to_vsp() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 39/59] Staging: hv: storvsc: Cleanup error handling in storvsc_do_io() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 40/59] Storage: hv: storvsc: Get rid of some unnecessary DPRINTs from storvsc.c K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 41/59] Staging: hv: storvsc: Fix/cleanup some dated comments in storvsc.c K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 42/59] Staging: hv: storvsc: Cleanup returned error code in storvsc_host_reset() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 43/59] Staging: hv: storvsc: Cleanup error code returned in storvsc_probe() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 44/59] Staging: hv: storvsc: Cleanup returned error code in storvsc_drv_init() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 45/59] Staging: hv: netvsc: Cleanup the returned error code in netvsc_probe() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 46/59] Staging: hv: netvsc: Cleanup error return codes in netvsc_destroy_recv_buf() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 47/59] Staging: hv: netvsc: Cleanup error return values in netvsc_init_recv_buf() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 48/59] Staging: hv: netvsc: Cleanup error returns in netvsc_connect_vsp() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 49/59] Staging: hv: netvsc: Cleanup error return values in netvsc_send() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 50/59] Staging: hv: netvsc: Cleanup error return codes in netvsc_device_add() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 51/59] Staging: hv: netvsc: Cleanup error codes in rndis_filter_receive() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 52/59] Staging: hv: netvsc: Cleanup error code in rndis_filter_query_device() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 53/59] Staging: hv: netvsc: Cleanup error return values in rndis_filter_set_packet_filter() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 54/59] Staging: hv: netvsc: Cleanup error returns in rndis_filter_init_device() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 55/59] Staging: hv: netvsc: Cleanup error code in rndis_filter_device_add() K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 56/59] Staging: hv: mouse: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 57/59] Staging: hv: mouse: Get rid of the unused PCI signature K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 58/59] Staging: hv: netvsc: Change the jump label Cleanup to cleanup K. Y. Srinivasan
2011-08-25 16:49 ` [PATCH 59/59] Staging: hv: netvsc: Change the jump label Exit to exit K. Y. Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1314290965-2698-10-git-send-email-kys@microsoft.com \
--to=kys@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@suse.de \
--cc=haiyangz@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox