Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab057781 authored by Hank Janssen's avatar Hank Janssen Committed by Greg Kroah-Hartman
Browse files

Staging: hv: add the Hyper-V driver header files



These are the header files for the different Linux Hyper-V drivers to
use.

Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 565e7dc8
Loading
Loading
Loading
Loading
+145 −0
Original line number Diff line number Diff line
/*
 *
 * Copyright (c) 2009, Microsoft Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307 USA.
 *
 * Authors:
 *   Haiyang Zhang <haiyangz@microsoft.com>
 *   Hank Janssen  <hjanssen@microsoft.com>
 *
 */


#ifndef _NETVSC_API_H_
#define _NETVSC_API_H_

#include "VmbusApi.h"

//
// Defines
//
#define NETVSC_DEVICE_RING_BUFFER_SIZE			64*PAGE_SIZE

#define HW_MACADDR_LEN		6

//
// Fwd declaration
//
typedef struct _NETVSC_PACKET	*PNETVSC_PACKET;


//
// Data types
//

typedef int (*PFN_ON_OPEN)(DEVICE_OBJECT *Device);
typedef int (*PFN_ON_CLOSE)(DEVICE_OBJECT *Device);

typedef void (*PFN_QUERY_LINKSTATUS)(DEVICE_OBJECT *Device);
typedef int (*PFN_ON_SEND)(DEVICE_OBJECT *dev, PNETVSC_PACKET packet);
typedef void (*PFN_ON_SENDRECVCOMPLETION)(PVOID Context);

typedef int (*PFN_ON_RECVCALLBACK)(DEVICE_OBJECT *dev, PNETVSC_PACKET packet);
typedef void (*PFN_ON_LINKSTATUS_CHANGED)(DEVICE_OBJECT *dev, UINT32 Status);

// Represent the xfer page packet which contains 1 or more netvsc packet
typedef struct _XFERPAGE_PACKET {
	DLIST_ENTRY			ListEntry;

	// # of netvsc packets this xfer packet contains
	UINT32				Count;
} XFERPAGE_PACKET;


// The number of pages which are enough to cover jumbo frame buffer.
#define NETVSC_PACKET_MAXPAGE  4

// Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame within the RNDIS
typedef struct _NETVSC_PACKET {
	// Bookkeeping stuff
	DLIST_ENTRY				ListEntry;

	DEVICE_OBJECT			*Device;
	BOOL					IsDataPacket;

	// Valid only for receives when we break a xfer page packet into multiple netvsc packets
	XFERPAGE_PACKET		*XferPagePacket;

	union {
		struct{
			UINT64						ReceiveCompletionTid;
			PVOID						ReceiveCompletionContext;
			PFN_ON_SENDRECVCOMPLETION	OnReceiveCompletion;
		} Recv;
		struct{
			UINT64						SendCompletionTid;
			PVOID						SendCompletionContext;
			PFN_ON_SENDRECVCOMPLETION	OnSendCompletion;
		} Send;
	} Completion;

	// This points to the memory after PageBuffers
	PVOID					Extension;

	UINT32					TotalDataBufferLength;
	// Points to the send/receive buffer where the ethernet frame is
	UINT32					PageBufferCount;
	PAGE_BUFFER				PageBuffers[NETVSC_PACKET_MAXPAGE];

} NETVSC_PACKET;


// Represents the net vsc driver
typedef struct _NETVSC_DRIVER_OBJECT {
	DRIVER_OBJECT				Base; // Must be the first field

	UINT32						RingBufferSize;
	UINT32						RequestExtSize;

	// Additional num  of page buffers to allocate
	UINT32						AdditionalRequestPageBufferCount;

	// This is set by the caller to allow us to callback when we receive a packet
	// from the "wire"
	PFN_ON_RECVCALLBACK			OnReceiveCallback;

	PFN_ON_LINKSTATUS_CHANGED	OnLinkStatusChanged;

	// Specific to this driver
	PFN_ON_OPEN					OnOpen;
	PFN_ON_CLOSE				OnClose;
	PFN_ON_SEND					OnSend;
	//PFN_ON_RECVCOMPLETION	OnReceiveCompletion;

	//PFN_QUERY_LINKSTATUS		QueryLinkStatus;

	void*						Context;
} NETVSC_DRIVER_OBJECT;


typedef struct _NETVSC_DEVICE_INFO {
    UCHAR	MacAddr[6];
    BOOL	LinkState;	// 0 - link up, 1 - link down
} NETVSC_DEVICE_INFO;

//
// Interface
//
int
NetVscInitialize(
	DRIVER_OBJECT* drv
	);

#endif // _NETVSC_API_H_
+137 −0
Original line number Diff line number Diff line
/*
 *
 * Copyright (c) 2009, Microsoft Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307 USA.
 *
 * Authors:
 *   Haiyang Zhang <haiyangz@microsoft.com>
 *   Hank Janssen  <hjanssen@microsoft.com>
 *
 */


#ifndef _STORVSC_API_H_
#define _STORVSC_API_H_

#include "VmbusApi.h"

//
// Defines
//

#define STORVSC_RING_BUFFER_SIZE			10*PAGE_SIZE
#define BLKVSC_RING_BUFFER_SIZE				20*PAGE_SIZE

#define STORVSC_MAX_IO_REQUESTS				64

// In Hyper-V, each port/path/target maps to 1 scsi host adapter.
// In reality, the path/target is not used (ie always set to 0) so
// our scsi host adapter essentially has 1 bus with 1 target that contains
// up to 256 luns.

#define STORVSC_MAX_LUNS_PER_TARGET			64
#define STORVSC_MAX_TARGETS					1
#define STORVSC_MAX_CHANNELS				1


// Fwd decl
//
//struct VMBUS_CHANNEL;
typedef struct _STORVSC_REQUEST* PSTORVSC_REQUEST;

//
// Data types
//
typedef int (*PFN_ON_IO_REQUEST)(PDEVICE_OBJECT Device, PSTORVSC_REQUEST Request);
typedef void (*PFN_ON_IO_REQUEST_COMPLTN)(PSTORVSC_REQUEST Request);

typedef int (*PFN_ON_HOST_RESET)(PDEVICE_OBJECT Device);
typedef void (*PFN_ON_HOST_RESCAN)(PDEVICE_OBJECT Device);


// Matches Windows-end
typedef enum _STORVSC_REQUEST_TYPE{
	WRITE_TYPE,
	READ_TYPE,
	UNKNOWN_TYPE,
} STORVSC_REQUEST_TYPE;


typedef struct _STORVSC_REQUEST {
	STORVSC_REQUEST_TYPE		Type;
	UINT32					Host;
	UINT32					Bus;
	UINT32					TargetId;
	UINT32					LunId;
	UINT8*					Cdb;
	UINT32					CdbLen;
	UINT32					Status;
	UINT32					BytesXfer;

	UCHAR*					SenseBuffer;
	UINT32					SenseBufferSize;

	PVOID					Context;

	PFN_ON_IO_REQUEST_COMPLTN	OnIOCompletion;

	// This points to the memory after DataBuffer
	PVOID					Extension;

	MULTIPAGE_BUFFER		DataBuffer;
} STORVSC_REQUEST;


// Represents the block vsc driver
typedef struct _STORVSC_DRIVER_OBJECT {
	DRIVER_OBJECT			Base; // Must be the first field

	// Set by caller (in bytes)
	UINT32					RingBufferSize;

	// Allocate this much private extension for each I/O request
	UINT32					RequestExtSize;

	// Maximum # of requests in flight per channel/device
	UINT32					MaxOutstandingRequestsPerChannel;

	// Set by the caller to allow us to re-enumerate the bus on the host
	PFN_ON_HOST_RESCAN		OnHostRescan;

	// Specific to this driver
	PFN_ON_IO_REQUEST		OnIORequest;
	PFN_ON_HOST_RESET		OnHostReset;

} STORVSC_DRIVER_OBJECT;

typedef struct _STORVSC_DEVICE_INFO {
	ULONG	PortNumber;
    UCHAR	PathId;
    UCHAR	TargetId;
} STORVSC_DEVICE_INFO;

//
// Interface
//
int
StorVscInitialize(
	DRIVER_OBJECT	*Driver
	);

int
BlkVscInitialize(
	DRIVER_OBJECT	*Driver
	);
#endif // _STORVSC_API_H_
+262 −0
Original line number Diff line number Diff line
/*
 *
 * Copyright (c) 2009, Microsoft Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307 USA.
 *
 * Authors:
 *   Haiyang Zhang <haiyangz@microsoft.com>
 *   Hank Janssen  <hjanssen@microsoft.com>
 *
 */


#ifndef _VMBUS_API_H_
#define _VMBUS_API_H_

#include "osd.h"

//
// Defines
//

#define MAX_PAGE_BUFFER_COUNT				16
#define MAX_MULTIPAGE_BUFFER_COUNT			32 // 128K


//
// Fwd declarations
//
typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT;
typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;

//
// Data types
//

#pragma pack(push,1)

// Single-page buffer
typedef struct _PAGE_BUFFER {
	UINT32	Length;
	UINT32	Offset;
	UINT64	Pfn;
} PAGE_BUFFER;

// Multiple-page buffer
typedef struct _MULTIPAGE_BUFFER {
	// Length and Offset determines the # of pfns in the array
	UINT32	Length;
	UINT32	Offset;
	UINT64	PfnArray[MAX_MULTIPAGE_BUFFER_COUNT];
}MULTIPAGE_BUFFER;

//0x18 includes the proprietary packet header
#define MAX_PAGE_BUFFER_PACKET			(0x18 + (sizeof(PAGE_BUFFER) * MAX_PAGE_BUFFER_COUNT))
#define MAX_MULTIPAGE_BUFFER_PACKET		(0x18 + sizeof(MULTIPAGE_BUFFER))


#pragma pack(pop)

// All drivers
typedef int (*PFN_ON_DEVICEADD)(PDEVICE_OBJECT Device, void* AdditionalInfo);
typedef int (*PFN_ON_DEVICEREMOVE)(PDEVICE_OBJECT Device);
typedef char** (*PFN_ON_GETDEVICEIDS)(void);
typedef void (*PFN_ON_CLEANUP)(PDRIVER_OBJECT Driver);

// Vmbus extensions
//typedef int (*PFN_ON_MATCH)(PDEVICE_OBJECT dev, PDRIVER_OBJECT drv);
//typedef int (*PFN_ON_PROBE)(PDEVICE_OBJECT dev);
typedef int	(*PFN_ON_ISR)(PDRIVER_OBJECT drv);
typedef void (*PFN_ON_DPC)(PDRIVER_OBJECT drv);
typedef void (*PFN_GET_CHANNEL_OFFERS)(void);

typedef PDEVICE_OBJECT (*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context);
typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(PDEVICE_OBJECT Device);
typedef int (*PFN_ON_CHILDDEVICE_ADD)(PDEVICE_OBJECT RootDevice, PDEVICE_OBJECT ChildDevice);
typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(PDEVICE_OBJECT Device);

// Vmbus channel interface
typedef void (*VMBUS_CHANNEL_CALLBACK)(PVOID context);

typedef int	(*VMBUS_CHANNEL_OPEN)(
	PDEVICE_OBJECT		Device,
	UINT32				SendBufferSize,
	UINT32				RecvRingBufferSize,
	PVOID				UserData,
	UINT32				UserDataLen,
	VMBUS_CHANNEL_CALLBACK ChannelCallback,
	PVOID				Context
	);

typedef void (*VMBUS_CHANNEL_CLOSE)(
	PDEVICE_OBJECT		Device
	);

typedef int	(*VMBUS_CHANNEL_SEND_PACKET)(
	PDEVICE_OBJECT		Device,
	const PVOID			Buffer,
	UINT32				BufferLen,
	UINT64				RequestId,
	UINT32				Type,
	UINT32				Flags
);

typedef int	(*VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER)(
	PDEVICE_OBJECT		Device,
	PAGE_BUFFER			PageBuffers[],
	UINT32				PageCount,
	PVOID				Buffer,
	UINT32				BufferLen,
	UINT64				RequestId
	);

typedef int	(*VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER)(
	PDEVICE_OBJECT		Device,
	MULTIPAGE_BUFFER	*MultiPageBuffer,
	PVOID				Buffer,
	UINT32				BufferLen,
	UINT64				RequestId
);

typedef int	(*VMBUS_CHANNEL_RECV_PACKET)(
	PDEVICE_OBJECT		Device,
	PVOID				Buffer,
	UINT32				BufferLen,
	UINT32*				BufferActualLen,
	UINT64*				RequestId
	);

typedef int	(*VMBUS_CHANNEL_RECV_PACKET_PAW)(
	PDEVICE_OBJECT		Device,
	PVOID				Buffer,
	UINT32				BufferLen,
	UINT32*				BufferActualLen,
	UINT64*				RequestId
	);

typedef int	(*VMBUS_CHANNEL_ESTABLISH_GPADL)(
	PDEVICE_OBJECT		Device,
	PVOID				Buffer,	// from kmalloc()
	UINT32				BufferLen,		// page-size multiple
	UINT32*				GpadlHandle
	);

typedef int	(*VMBUS_CHANNEL_TEARDOWN_GPADL)(
	PDEVICE_OBJECT		Device,
	UINT32				GpadlHandle
	);


typedef struct _PORT_INFO {
	UINT32		InterruptMask;
	UINT32		ReadIndex;
	UINT32		WriteIndex;
	UINT32		BytesAvailToRead;
	UINT32		BytesAvailToWrite;
} PORT_INFO;


typedef struct _DEVICE_INFO {
	UINT32		ChannelId;
	UINT32		ChannelState;
	GUID		ChannelType;
	GUID		ChannelInstance;

	UINT32						MonitorId;
	UINT32						ServerMonitorPending;
	UINT32						ServerMonitorLatency;
	UINT32						ServerMonitorConnectionId;
	UINT32						ClientMonitorPending;
	UINT32						ClientMonitorLatency;
	UINT32						ClientMonitorConnectionId;

	PORT_INFO	Inbound;
	PORT_INFO	Outbound;
} DEVICE_INFO;

typedef void (*VMBUS_GET_CHANNEL_INFO)(PDEVICE_OBJECT Device, DEVICE_INFO* DeviceInfo);

typedef struct _VMBUS_CHANNEL_INTERFACE {
	VMBUS_CHANNEL_OPEN							Open;
	VMBUS_CHANNEL_CLOSE							Close;
	VMBUS_CHANNEL_SEND_PACKET					SendPacket;
	VMBUS_CHANNEL_SEND_PACKET_PAGEBUFFER		SendPacketPageBuffer;
	VMBUS_CHANNEL_SEND_PACKET_MULTIPAGEBUFFER	SendPacketMultiPageBuffer;
	VMBUS_CHANNEL_RECV_PACKET					RecvPacket;
	VMBUS_CHANNEL_RECV_PACKET_PAW				RecvPacketRaw;
	VMBUS_CHANNEL_ESTABLISH_GPADL				EstablishGpadl;
	VMBUS_CHANNEL_TEARDOWN_GPADL				TeardownGpadl;
	VMBUS_GET_CHANNEL_INFO						GetInfo;
} VMBUS_CHANNEL_INTERFACE;

typedef void (*VMBUS_GET_CHANNEL_INTERFACE)(VMBUS_CHANNEL_INTERFACE *Interface);

// Base driver object
typedef struct _DRIVER_OBJECT {
	const char*				name;
	GUID					deviceType; // the device type supported by this driver

	PFN_ON_DEVICEADD		OnDeviceAdd;
	PFN_ON_DEVICEREMOVE		OnDeviceRemove;
	PFN_ON_GETDEVICEIDS		OnGetDeviceIds; // device ids supported by this driver
	PFN_ON_CLEANUP			OnCleanup;

	VMBUS_CHANNEL_INTERFACE VmbusChannelInterface;
} DRIVER_OBJECT;


// Base device object
typedef struct _DEVICE_OBJECT {
	DRIVER_OBJECT*		Driver;		// the driver for this device
	char				name[64];
	GUID				deviceType; // the device type id of this device
	GUID				deviceInstance; // the device instance id of this device
	void*				context;
	void*				Extension;		// Device extension;
} DEVICE_OBJECT;


// Vmbus driver object
typedef struct _VMBUS_DRIVER_OBJECT {
	DRIVER_OBJECT		Base; // !! Must be the 1st field !!

	// Set by the caller
	PFN_ON_CHILDDEVICE_CREATE	OnChildDeviceCreate;
	PFN_ON_CHILDDEVICE_DESTROY	OnChildDeviceDestroy;
	PFN_ON_CHILDDEVICE_ADD		OnChildDeviceAdd;
	PFN_ON_CHILDDEVICE_REMOVE	OnChildDeviceRemove;

	// Set by the callee
	//PFN_ON_MATCH		OnMatch;
	//PFN_ON_PROBE		OnProbe;
	PFN_ON_ISR				OnIsr;
	PFN_ON_DPC				OnMsgDpc;
	PFN_ON_DPC				OnEventDpc;
	PFN_GET_CHANNEL_OFFERS	GetChannelOffers;

	VMBUS_GET_CHANNEL_INTERFACE GetChannelInterface;
	VMBUS_GET_CHANNEL_INFO		GetChannelInfo;
} VMBUS_DRIVER_OBJECT;


//
// Interface
//
int
VmbusInitialize(
	DRIVER_OBJECT* drv
	);

#endif // _VMBUS_API_H_
+134 −0
Original line number Diff line number Diff line
/*
 *
 * Copyright (c) 2009, Microsoft Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 * Place - Suite 330, Boston, MA 02111-1307 USA.
 *
 * Authors:
 *   Haiyang Zhang <haiyangz@microsoft.com>
 *   Hank Janssen  <hjanssen@microsoft.com>
 *
 */


#ifndef _LOGGING_H_
#define _LOGGING_H_

//#include <linux/init.h>
//#include <linux/module.h>

#include "osd.h"

#define VMBUS				0x0001
#define STORVSC				0x0002
#define NETVSC				0x0004
#define INPUTVSC			0x0008
#define BLKVSC				0x0010
#define VMBUS_DRV			0x0100
#define STORVSC_DRV			0x0200
#define NETVSC_DRV			0x0400
#define INPUTVSC_DRV		0x0800
#define BLKVSC_DRV			0x1000

#define ALL_MODULES			(VMBUS		|\
							STORVSC		|\
							NETVSC		|\
							INPUTVSC	|\
							BLKVSC		|\
							VMBUS_DRV	|\
							STORVSC_DRV	|\
							NETVSC_DRV	|\
							INPUTVSC_DRV|\
							BLKVSC_DRV)

// Logging Level
#define CRITICAL_LVL				2
#define ERROR_LVL					3
#define WARNING_LVL					4
#define INFO_LVL					6
#define DEBUG_LVL					7
#define DEBUG_LVL_ENTEREXIT			8
#define DEBUG_RING_LVL				9

extern unsigned int vmbus_loglevel;

#define ASSERT(expr)	\
        if (!(expr)) {	\
		LogMsg("<%d>Assertion failed! %s,%s,%s,line=%d\n", CRITICAL_LVL, #expr,__FILE__,__FUNCTION__,__LINE__);	\
		__asm__ __volatile__("int3");	\
        }

#define DPRINT(mod, lvl, fmt, args...) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(lvl <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() " fmt "\n", DEBUG_LVL, __FUNCTION__, ## args)):(0);\
	} while (0)

#define DPRINT_DBG(mod, fmt, args...) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(DEBUG_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() " fmt "\n", DEBUG_LVL, __FUNCTION__, ## args)):(0);\
	} while (0)

#define DPRINT_INFO(mod, fmt, args...) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(INFO_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": " fmt "\n", INFO_LVL, ## args)):(0);\
	} while (0)

#define DPRINT_WARN(mod, fmt, args...) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(WARNING_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": WARNING! " fmt "\n", WARNING_LVL, ## args)):(0);\
	} while (0)

#define DPRINT_ERR(mod, fmt, args...) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(ERROR_LVL <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" #mod": %s() ERROR!! " fmt "\n", ERROR_LVL, __FUNCTION__, ## args)):(0);\
	} while (0)

#ifdef DEBUG
#define DPRINT_ENTER(mod) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" "["#mod"]: %s() enter\n", DEBUG_LVL, __FUNCTION__)):(0);\
	} while (0)

#define DPRINT_EXIT(mod) do {\
	if (mod & (HIWORD(vmbus_loglevel))) \
		(DEBUG_LVL_ENTEREXIT <= LOWORD(vmbus_loglevel))?(LogMsg("<%d>" "["#mod"]: %s() exit\n", DEBUG_LVL, __FUNCTION__)):(0);\
	} while (0)
#else
#define DPRINT_ENTER(mod)
#define DPRINT_EXIT(mod)
#endif

static inline void PrintBytes(const unsigned char* bytes, int len)
{
	int i=0;

	LogMsg("\n<< ");
	for (i=0; i< len; i++)
	{
		LogMsg("0x%x ", bytes[i]);
	}
	LogMsg(">>\n");
}

//
// Inline
//
//static inline void GuidToStr(const GUID g, char *str)
//{
//	sprintf(str, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
//	g[3], g[2], g[1], g[0], g[5], g[4], g[7], g[6], g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15]);
//
//}

#endif //_LOGGING_H_
+263 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading