本文整理汇总了C++中DPRINT_EXIT函数的典型用法代码示例。如果您正苦于以下问题:C++ DPRINT_EXIT函数的具体用法?C++ DPRINT_EXIT怎么用?C++ DPRINT_EXIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DPRINT_EXIT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BlkVscOnDeviceAdd
static int BlkVscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
{
struct storvsc_device_info *deviceInfo;
int ret = 0;
DPRINT_ENTER(BLKVSC);
deviceInfo = (struct storvsc_device_info *)AdditionalInfo;
ret = StorVscOnDeviceAdd(Device, AdditionalInfo);
if (ret != 0) {
DPRINT_EXIT(BLKVSC);
return ret;
}
/*
* We need to use the device instance guid to set the path and target
* id. For IDE devices, the device instance id is formatted as
* <bus id> * - <device id> - 8899 - 000000000000.
*/
deviceInfo->PathId = Device->deviceInstance.data[3] << 24 |
Device->deviceInstance.data[2] << 16 |
Device->deviceInstance.data[1] << 8 |
Device->deviceInstance.data[0];
deviceInfo->TargetId = Device->deviceInstance.data[5] << 8 |
Device->deviceInstance.data[4];
DPRINT_EXIT(BLKVSC);
return ret;
}
示例2: netvsc_drv_init
/*++
Name: netvsc_drv_init()
Desc: NetVsc driver initialization
--*/
int netvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init)
{
int ret = 0;
NETVSC_DRIVER_OBJECT *net_drv_obj=&g_netvsc_drv.drv_obj;
struct driver_context *drv_ctx=&g_netvsc_drv.drv_ctx;
DPRINT_ENTER(NETVSC_DRV);
vmbus_get_interface(&net_drv_obj->Base.VmbusChannelInterface);
net_drv_obj->RingBufferSize = netvsc_ringbuffer_size;
/* Fixme: warning: assignment from incompatible pointer type */
net_drv_obj->OnReceiveCallback = netvsc_recv_callback;
net_drv_obj->OnLinkStatusChanged = netvsc_linkstatus_callback;
// Callback to client driver to complete the initialization
pfn_drv_init(&net_drv_obj->Base);
memcpy(&drv_ctx->class_id, &net_drv_obj->Base.deviceType, sizeof(GUID));
// The driver belongs to vmbus
vmbus_child_driver_register(drv_ctx);
DPRINT_EXIT(NETVSC_DRV);
return ret;
}
示例3: VmbusOnDeviceAdd
static int VmbusOnDeviceAdd(struct hv_device *dev, void *AdditionalInfo)
{
u32 *irqvector = AdditionalInfo;
int ret;
DPRINT_ENTER(VMBUS);
gDevice = dev;
memcpy(&gDevice->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
memcpy(&gDevice->deviceInstance, &gVmbusDeviceId,
sizeof(struct hv_guid));
/* strcpy(dev->name, "vmbus"); */
/* SynIC setup... */
on_each_cpu(HvSynicInit, (void *)irqvector, 1);
/* Connect to VMBus in the root partition */
ret = VmbusConnect();
/* VmbusSendEvent(device->localPortId+1); */
DPRINT_EXIT(VMBUS);
return ret;
}
示例4: VmbusOnISR
static int VmbusOnISR(struct hv_driver *drv)
{
int ret = 0;
int cpu = smp_processor_id();
void *page_addr;
struct hv_message *msg;
union hv_synic_event_flags *event;
page_addr = gHvContext.synICMessagePage[cpu];
msg = (struct hv_message *)page_addr + VMBUS_MESSAGE_SINT;
DPRINT_ENTER(VMBUS);
/* Check if there are actual msgs to be process */
if (msg->Header.MessageType != HvMessageTypeNone) {
DPRINT_DBG(VMBUS, "received msg type %d size %d",
msg->Header.MessageType,
msg->Header.PayloadSize);
ret |= 0x1;
}
/* TODO: Check if there are events to be process */
page_addr = gHvContext.synICEventPage[cpu];
event = (union hv_synic_event_flags *)page_addr + VMBUS_MESSAGE_SINT;
/* Since we are a child, we only need to check bit 0 */
if (test_and_clear_bit(0, (unsigned long *) &event->Flags32[0])) {
DPRINT_DBG(VMBUS, "received event %d", event->Flags32[0]);
ret |= 0x2;
}
DPRINT_EXIT(VMBUS);
return ret;
}
示例5: netvsc_linkstatus_callback
/*
* netvsc_linkstatus_callback - Link up/down notification
*/
static void netvsc_linkstatus_callback(struct hv_device *device_obj,
unsigned int status)
{
struct vm_device *device_ctx = to_vm_device(device_obj);
struct net_device *net = dev_get_drvdata(&device_ctx->device);
struct net_device_context *ndev_ctx;
DPRINT_ENTER(NETVSC_DRV);
if (!net) {
DPRINT_ERR(NETVSC_DRV, "got link status but net device "
"not initialized yet");
return;
}
if (status == 1) {
netif_carrier_on(net);
netif_wake_queue(net);
netif_notify_peers(net);
ndev_ctx = netdev_priv(net);
schedule_work(&ndev_ctx->work);
} else {
netif_carrier_off(net);
netif_stop_queue(net);
}
DPRINT_EXIT(NETVSC_DRV);
}
示例6: netvsc_open
static int netvsc_open(struct net_device *net)
{
struct net_device_context *net_device_ctx = netdev_priv(net);
struct driver_context *driver_ctx =
driver_to_driver_context(net_device_ctx->device_ctx->device.driver);
struct netvsc_driver_context *net_drv_ctx =
(struct netvsc_driver_context *)driver_ctx;
struct netvsc_driver *net_drv_obj = &net_drv_ctx->drv_obj;
struct hv_device *device_obj = &net_device_ctx->device_ctx->device_obj;
int ret = 0;
DPRINT_ENTER(NETVSC_DRV);
if (netif_carrier_ok(net)) {
memset(&net_device_ctx->stats, 0,
sizeof(struct net_device_stats));
/* Open up the device */
ret = net_drv_obj->OnOpen(device_obj);
if (ret != 0) {
DPRINT_ERR(NETVSC_DRV,
"unable to open device (ret %d).", ret);
return ret;
}
netif_start_queue(net);
} else {
DPRINT_ERR(NETVSC_DRV, "unable to open device...link is down.");
}
DPRINT_EXIT(NETVSC_DRV);
return ret;
}
示例7: netvsc_xmit_completion
static void netvsc_xmit_completion(void *context)
{
struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
struct sk_buff *skb = (struct sk_buff *)
(unsigned long)packet->Completion.Send.SendCompletionTid;
struct net_device *net;
DPRINT_ENTER(NETVSC_DRV);
kfree(packet);
if (skb) {
net = skb->dev;
dev_kfree_skb_any(skb);
if (netif_queue_stopped(net)) {
DPRINT_INFO(NETVSC_DRV, "net device (%p) waking up...",
net);
netif_wake_queue(net);
}
}
DPRINT_EXIT(NETVSC_DRV);
}
示例8: RingBufferWrite
int RingBufferWrite(RING_BUFFER_INFO *OutRingInfo,
struct scatterlist *sglist, u32 sgcount)
{
int i = 0;
u32 byteAvailToWrite;
u32 byteAvailToRead;
u32 totalBytesToWrite = 0;
struct scatterlist *sg;
volatile u32 nextWriteLocation;
u64 prevIndices = 0;
unsigned long flags;
DPRINT_ENTER(VMBUS);
for_each_sg(sglist, sg, sgcount, i)
{
totalBytesToWrite += sg->length;
}
totalBytesToWrite += sizeof(u64);
spin_lock_irqsave(&OutRingInfo->ring_lock, flags);
GetRingBufferAvailBytes(OutRingInfo,
&byteAvailToRead,
&byteAvailToWrite);
DPRINT_DBG(VMBUS, "Writing %u bytes...", totalBytesToWrite);
/* DumpRingInfo(OutRingInfo, "BEFORE "); */
/* If there is only room for the packet, assume it is full. */
/* Otherwise, the next time around, we think the ring buffer */
/* is empty since the read index == write index */
if (byteAvailToWrite <= totalBytesToWrite) {
DPRINT_DBG(VMBUS,
"No more space left on outbound ring buffer "
"(needed %u, avail %u)",
totalBytesToWrite,
byteAvailToWrite);
spin_unlock_irqrestore(&OutRingInfo->ring_lock, flags);
DPRINT_EXIT(VMBUS);
return -1;
}
/* Write to the ring buffer */
nextWriteLocation = GetNextWriteLocation(OutRingInfo);
for_each_sg(sglist, sg, sgcount, i)
{
nextWriteLocation = CopyToRingBuffer(OutRingInfo,
nextWriteLocation,
sg_virt(sg),
sg->length);
}
示例9: VmbusOnCleanup
static void VmbusOnCleanup(struct hv_driver *drv)
{
/* struct vmbus_driver *driver = (struct vmbus_driver *)drv; */
DPRINT_ENTER(VMBUS);
HvCleanup();
DPRINT_EXIT(VMBUS);
}
示例10: netvsc_init
static void netvsc_init(void)
{
DPRINT_ENTER(NETVSC_DRV);
printf("Netvsc initializing....");
netvsc_drv_init(NetVscInitialize);
DPRINT_EXIT(NETVSC_DRV);
}
示例11: VmbusOnDeviceRemove
static int VmbusOnDeviceRemove(struct hv_device *dev)
{
int ret = 0;
DPRINT_ENTER(VMBUS);
VmbusChannelReleaseUnattachedChannels();
VmbusDisconnect();
on_each_cpu(HvSynicCleanup, NULL, 1);
DPRINT_EXIT(VMBUS);
return ret;
}
示例12: netvsc_init
static int __init netvsc_init(void)
{
int ret;
DPRINT_ENTER(NETVSC_DRV);
DPRINT_INFO(NETVSC_DRV, "Netvsc initializing....");
ret = netvsc_drv_init(NetVscInitialize);
DPRINT_EXIT(NETVSC_DRV);
return ret;
}
示例13: heartbeat_onchannelcallback
/*
* Heartbeat functionality.
* Every two seconds, Hyper-V send us a heartbeat request message.
* we respond to this message, and Hyper-V knows we are alive.
*/
static void heartbeat_onchannelcallback(void *context)
{
struct vmbus_channel *channel = context;
u8 *buf;
u32 buflen, recvlen;
u64 requestid;
struct icmsg_hdr *icmsghdrp;
struct heartbeat_msg_data *heartbeat_msg;
DPRINT_ENTER(VMBUS);
buflen = PAGE_SIZE;
buf = kmalloc(buflen, GFP_ATOMIC);
VmbusChannelRecvPacket(channel, buf, buflen, &recvlen, &requestid);
if (recvlen > 0) {
DPRINT_DBG(VMBUS, "heartbeat packet: len=%d, requestid=%lld",
recvlen, requestid);
icmsghdrp = (struct icmsg_hdr *)&buf[
sizeof(struct vmbuspipe_hdr)];
icmsghdrp = (struct icmsg_hdr *)&buf[
sizeof(struct vmbuspipe_hdr)];
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
prep_negotiate_resp(icmsghdrp, NULL, buf);
} else {
heartbeat_msg = (struct heartbeat_msg_data *)&buf[
sizeof(struct vmbuspipe_hdr) +
sizeof(struct icmsg_hdr)];
DPRINT_DBG(VMBUS, "heartbeat seq = %lld",
heartbeat_msg->seq_num);
heartbeat_msg->seq_num += 1;
}
icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
| ICMSGHDRFLAG_RESPONSE;
VmbusChannelSendPacket(channel, buf,
recvlen, requestid,
VmbusPacketTypeDataInBand, 0);
}
kfree(buf);
DPRINT_EXIT(VMBUS);
}
示例14: VmbusInitialize
/**
* VmbusInitialize - Main entry point
*/
int VmbusInitialize(struct hv_driver *drv)
{
struct vmbus_driver *driver = (struct vmbus_driver *)drv;
int ret;
DPRINT_ENTER(VMBUS);
DPRINT_INFO(VMBUS, "+++++++ Build Date=%s %s +++++++",
VersionDate, VersionTime);
DPRINT_INFO(VMBUS, "+++++++ Build Description=%s +++++++",
VersionDesc);
DPRINT_INFO(VMBUS, "+++++++ Vmbus supported version = %d +++++++",
VMBUS_REVISION_NUMBER);
DPRINT_INFO(VMBUS, "+++++++ Vmbus using SINT %d +++++++",
VMBUS_MESSAGE_SINT);
DPRINT_DBG(VMBUS, "sizeof(VMBUS_CHANNEL_PACKET_PAGE_BUFFER)=%zd, "
"sizeof(VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)=%zd",
sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER),
sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER));
drv->name = gDriverName;
memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
/* Setup dispatch table */
driver->Base.OnDeviceAdd = VmbusOnDeviceAdd;
driver->Base.OnDeviceRemove = VmbusOnDeviceRemove;
driver->Base.OnCleanup = VmbusOnCleanup;
driver->OnIsr = VmbusOnISR;
driver->OnMsgDpc = VmbusOnMsgDPC;
driver->OnEventDpc = VmbusOnEventDPC;
driver->GetChannelOffers = VmbusGetChannelOffers;
driver->GetChannelInterface = VmbusGetChannelInterface;
driver->GetChannelInfo = VmbusGetChannelInfo;
/* Hypervisor initialization...setup hypercall page..etc */
ret = HvInit();
if (ret != 0)
DPRINT_ERR(VMBUS, "Unable to initialize the hypervisor - 0x%x",
ret);
gDriver = drv;
DPRINT_EXIT(VMBUS);
return ret;
}
示例15: timesync_onchannelcallback
/*
* Time Sync Channel message handler.
*/
static void timesync_onchannelcallback(void *context)
{
struct vmbus_channel *channel = context;
u8 *buf;
u32 buflen, recvlen;
u64 requestid;
struct icmsg_hdr *icmsghdrp;
struct ictimesync_data *timedatap;
DPRINT_ENTER(VMBUS);
buflen = PAGE_SIZE;
buf = kmalloc(buflen, GFP_ATOMIC);
VmbusChannelRecvPacket(channel, buf, buflen, &recvlen, &requestid);
if (recvlen > 0) {
DPRINT_DBG(VMBUS, "timesync packet: recvlen=%d, requestid=%lld",
recvlen, requestid);
icmsghdrp = (struct icmsg_hdr *)&buf[
sizeof(struct vmbuspipe_hdr)];
if (icmsghdrp->icmsgtype == ICMSGTYPE_NEGOTIATE) {
prep_negotiate_resp(icmsghdrp, NULL, buf);
} else {
timedatap = (struct ictimesync_data *)&buf[
sizeof(struct vmbuspipe_hdr) +
sizeof(struct icmsg_hdr)];
adj_guesttime(timedatap->parenttime, timedatap->flags);
}
icmsghdrp->icflags = ICMSGHDRFLAG_TRANSACTION
| ICMSGHDRFLAG_RESPONSE;
VmbusChannelSendPacket(channel, buf,
recvlen, requestid,
VmbusPacketTypeDataInBand, 0);
}
kfree(buf);
DPRINT_EXIT(VMBUS);
}