* Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
if (userlen > bufferlen) {
spin_unlock_irqrestore(&channel->inbound_lock, flags);
- DPRINT_ERR(VMBUS, "buffer too small - got %d needs %d",
+ pr_err("Buffer too small - got %d needs %d\n",
bufferlen, userlen);
return -1;
}
if (packetlen > bufferlen) {
spin_unlock_irqrestore(&channel->inbound_lock, flags);
- DPRINT_ERR(VMBUS, "buffer too small - needed %d bytes but "
- "got space for only %d bytes", packetlen, bufferlen);
+ pr_err("Buffer too small - needed %d bytes but "
+ "got space for only %d bytes\n",
+ packetlen, bufferlen);
return -2;
}
* Haiyang Zhang <haiyangz@microsoft.com>
* Hank Janssen <hjanssen@microsoft.com>
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
*/
ret = vmbus_child_device_register(newchannel->device_obj);
if (ret != 0) {
- DPRINT_ERR(VMBUS,
- "unable to add child device object (relid %d)",
+ pr_err("unable to add child device object (relid %d)\n",
newchannel->offermsg.child_relid);
spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
hv_cb_utils[cnt].callback,
newchannel) == 0) {
hv_cb_utils[cnt].channel = newchannel;
- DPRINT_INFO(VMBUS, "%s",
- hv_cb_utils[cnt].log_msg);
+
+ pr_info("%s\n", hv_cb_utils[cnt].log_msg);
+
count_hv_channel();
}
}
/* Allocate the channel object and save this offer. */
newchannel = alloc_channel();
if (!newchannel) {
- DPRINT_ERR(VMBUS, "unable to allocate channel object");
+ pr_err("Unable to allocate channel object\n");
return;
}
size = msg->header.payload_size;
if (hdr->msgtype >= CHANNELMSG_COUNT) {
- DPRINT_ERR(VMBUS,
- "Received invalid channel message type %d size %d",
+ pr_err("Received invalid channel message type %d size %d\n",
hdr->msgtype, size);
print_hex_dump_bytes("", DUMP_PREFIX_NONE,
(unsigned char *)msg->u.payload, size);
if (gChannelMessageTable[hdr->msgtype].messageHandler)
gChannelMessageTable[hdr->msgtype].messageHandler(hdr);
else
- DPRINT_ERR(VMBUS, "Unhandled channel message type %d",
- hdr->msgtype);
+ pr_err("Unhandled channel message type %d\n", hdr->msgtype);
}
/*
ret = vmbus_post_msg(msg,
sizeof(struct vmbus_channel_message_header));
if (ret != 0) {
- DPRINT_ERR(VMBUS, "Unable to request offers - %d", ret);
+ pr_err("Unable to request offers - %d\n", ret);
goto cleanup;
}
if (!channel->device_obj->drv) {
list_del(&channel->listentry);
- DPRINT_INFO(VMBUS,
- "Releasing unattached device object %p",
- channel->device_obj);
+
+ pr_err("Releasing unattached device object\n");
vmbus_child_device_unregister(channel->device_obj);
free_channel(channel);
* Hank Janssen <hjanssen@microsoft.com>
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/wait.h>
if (msginfo->response.version_response.version_supported) {
vmbus_connection.conn_state = CONNECTED;
} else {
- DPRINT_ERR(VMBUS, "Vmbus connection failed!!..."
- "current version (%d) not supported",
- VMBUS_REVISION_NUMBER);
+ pr_err("Unable to connect, "
+ "Version %d not supported by Hyper-V\n",
+ VMBUS_REVISION_NUMBER);
ret = -1;
goto Cleanup;
}
vmbus_connection.conn_state = DISCONNECTED;
- DPRINT_INFO(VMBUS, "Vmbus disconnected!!");
+ pr_info("hv_vmbus disconnected\n");
Cleanup:
kfree(msg);
* (void*)channel);
*/
} else {
- DPRINT_ERR(VMBUS, "channel not found for relid - %d.", relid);
+ pr_err("channel not found for relid - %d\n", relid);
}
}
* Hank Janssen <hjanssen@microsoft.com>
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/slab.h>
edx = 0;
op = HVCPUID_VERSION;
cpuid(op, &eax, &ebx, &ecx, &edx);
- DPRINT_INFO(VMBUS, "OS Build:%d-%d.%d-%d-%d.%d",\
+ pr_info("Hyper-V Host OS Build:%d-%d.%d-%d-%d.%d\n",
eax,
ebx >> 16,
ebx & 0xFFFF,
(void *)get_zeroed_page(GFP_ATOMIC);
if (hv_context.synic_message_page[cpu] == NULL) {
- DPRINT_ERR(VMBUS,
- "unable to allocate SYNIC message page!!");
+ pr_err("Unable to allocate SYNIC message page\n");
goto Cleanup;
}
(void *)get_zeroed_page(GFP_ATOMIC);
if (hv_context.synic_event_page[cpu] == NULL) {
- DPRINT_ERR(VMBUS,
- "unable to allocate SYNIC event page!!");
+ pr_err("Unable to allocate SYNIC event page\n");
goto Cleanup;
}
* Hank Janssen <hjanssen@microsoft.com>
*
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/mm.h>
*
* 3/9/2011: K. Y. Srinivasan - Significant restructuring and cleanup
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/init.h>
#include <linux/module.h>
#include <linux/device.h>
ret = dev->probe_error =
drv->driver.probe(child_device);
if (ret != 0) {
- DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s "
- "(%p) on driver %s (%d)...",
- dev_name(child_device), child_device,
- child_device->driver->name, ret);
+ pr_err("probe failed for device %s (%d)\n",
+ dev_name(child_device), ret);
INIT_WORK(&dev->probe_failed_work_item,
vmbus_probe_failed_cb);
schedule_work(&dev->probe_failed_work_item);
}
} else {
- DPRINT_ERR(VMBUS_DRV, "probe() method not set for driver - %s",
- child_device->driver->name);
+ pr_err("probe not set for driver %s\n",
+ dev_name(child_device));
ret = -1;
}
return ret;
if (drv->driver.remove) {
ret = drv->driver.remove(child_device);
} else {
- DPRINT_ERR(VMBUS_DRV,
- "remove() method not set for driver - %s",
- child_device->driver->name);
+ pr_err("remove not set for driver %s\n",
+ dev_name(child_device));
ret = -1;
}
}
/* Hypervisor initialization...setup hypercall page..etc */
ret = hv_init();
if (ret != 0) {
- DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x",
- ret);
+ pr_err("Unable to initialize the hypervisor - 0x%x\n", ret);
goto cleanup;
}
-
hv_bus.bus.name = driver_name;
/* Initialize the bus context */
driver_name, pdev);
if (ret != 0) {
- DPRINT_ERR(VMBUS_DRV, "ERROR - Unable to request IRQ %d",
+ pr_err("Unable to request IRQ %d\n",
pdev->irq);
bus_unregister(&hv_bus.bus);
{
int ret;
- DPRINT_INFO(VMBUS_DRV, "child driver (%p) registering - name %s",
- drv, drv->name);
+ pr_info("child driver registering - name %s\n", drv->name);
/* The child driver on this vmbus */
drv->bus = &hv_bus.bus;
*/
void vmbus_child_driver_unregister(struct device_driver *drv)
{
- DPRINT_INFO(VMBUS_DRV, "child driver (%p) unregistering - name %s",
- drv, drv->name);
+ pr_info("child driver unregistering - name %s\n", drv->name);
driver_unregister(drv);
/* Allocate the new child device */
child_device_obj = kzalloc(sizeof(struct hv_device), GFP_KERNEL);
if (!child_device_obj) {
- DPRINT_ERR(VMBUS_DRV,
- "unable to allocate device_context for child device");
+ pr_err("Unable to allocate device object for child device\n");
return NULL;
}
ret = child_device_obj->probe_error;
if (ret)
- DPRINT_ERR(VMBUS_DRV, "unable to register child device (%p)",
- &child_device_obj->device);
+ pr_err("Unable to register child device\n");
else
- DPRINT_INFO(VMBUS_DRV, "child device (%p) registered",
- &child_device_obj->device);
+ pr_info("child device %s registered\n",
+ dev_name(&child_device_obj->device));
return ret;
}
*/
device_unregister(&device_obj->device);
- DPRINT_INFO(VMBUS_DRV, "child device (%p) unregistered",
- &device_obj->device);
+ pr_info("child device %s unregistered\n",
+ dev_name(&device_obj->device));
}