aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/hv/hv_utils.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/staging/hv/hv_utils.c b/drivers/staging/hv/hv_utils.c
index 8a49aafea37..2adc9b48ca9 100644
--- a/drivers/staging/hv/hv_utils.c
+++ b/drivers/staging/hv/hv_utils.c
@@ -24,6 +24,8 @@
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/sysctl.h> 25#include <linux/sysctl.h>
26#include <linux/reboot.h> 26#include <linux/reboot.h>
27#include <linux/dmi.h>
28#include <linux/pci.h>
27 29
28#include "logging.h" 30#include "logging.h"
29#include "osd.h" 31#include "osd.h"
@@ -251,10 +253,36 @@ static void heartbeat_onchannelcallback(void *context)
251 DPRINT_EXIT(VMBUS); 253 DPRINT_EXIT(VMBUS);
252} 254}
253 255
256static const struct pci_device_id __initconst
257hv_utils_pci_table[] __maybe_unused = {
258 { PCI_DEVICE(0x1414, 0x5353) }, /* Hyper-V emulated VGA controller */
259 { 0 }
260};
261MODULE_DEVICE_TABLE(pci, hv_utils_pci_table);
262
263
264static const struct dmi_system_id __initconst
265hv_utils_dmi_table[] __maybe_unused = {
266 {
267 .ident = "Hyper-V",
268 .matches = {
269 DMI_MATCH(DMI_SYS_VENDOR, "Microsoft Corporation"),
270 DMI_MATCH(DMI_PRODUCT_NAME, "Virtual Machine"),
271 DMI_MATCH(DMI_BOARD_NAME, "Virtual Machine"),
272 },
273 },
274 { },
275};
276MODULE_DEVICE_TABLE(dmi, hv_utils_dmi_table);
277
278
254static int __init init_hyperv_utils(void) 279static int __init init_hyperv_utils(void)
255{ 280{
256 printk(KERN_INFO "Registering HyperV Utility Driver\n"); 281 printk(KERN_INFO "Registering HyperV Utility Driver\n");
257 282
283 if (!dmi_check_system(hv_utils_dmi_table))
284 return -ENODEV;
285
258 hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback = 286 hv_cb_utils[HV_SHUTDOWN_MSG].channel->OnChannelCallback =
259 &shutdown_onchannelcallback; 287 &shutdown_onchannelcallback;
260 hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback; 288 hv_cb_utils[HV_SHUTDOWN_MSG].callback = &shutdown_onchannelcallback;