X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=drivers%2Fstaging%2Fhv%2FNetVsc.h;h=ba81452a8b275685a3a2dfb4392851eb30f8ea0a;hb=b4f3fda5d475931d596d5cf599a193f42b857594;hp=3a7999db851f10a8a266c78a80592016b3c97ad9;hpb=59471438ccbebafb0d63baf8b818d0ca692f882a;p=~andy%2Flinux diff --git a/drivers/staging/hv/NetVsc.h b/drivers/staging/hv/NetVsc.h index 3a7999db851..ba81452a8b2 100644 --- a/drivers/staging/hv/NetVsc.h +++ b/drivers/staging/hv/NetVsc.h @@ -30,62 +30,59 @@ #include "include/List.h" #include "include/NetVscApi.h" -// -// #defines -// -//#define NVSC_MIN_PROTOCOL_VERSION 1 -//#define NVSC_MAX_PROTOCOL_VERSION 1 -#define NETVSC_SEND_BUFFER_SIZE 64*1024 // 64K -#define NETVSC_SEND_BUFFER_ID 0xface +/* #define NVSC_MIN_PROTOCOL_VERSION 1 */ +/* #define NVSC_MAX_PROTOCOL_VERSION 1 */ +#define NETVSC_SEND_BUFFER_SIZE (64*1024) /* 64K */ +#define NETVSC_SEND_BUFFER_ID 0xface -#define NETVSC_RECEIVE_BUFFER_SIZE 1024*1024 // 1MB -#define NETVSC_RECEIVE_BUFFER_ID 0xcafe +#define NETVSC_RECEIVE_BUFFER_SIZE (1024*1024) /* 1MB */ -#define NETVSC_RECEIVE_SG_COUNT 1 +#define NETVSC_RECEIVE_BUFFER_ID 0xcafe -// Preallocated receive packets -#define NETVSC_RECEIVE_PACKETLIST_COUNT 256 - -// -// Data types -// - -// Per netvsc channel-specific -typedef struct _NETVSC_DEVICE { - DEVICE_OBJECT *Device; - - int RefCount; - - int NumOutstandingSends; - // List of free preallocated NETVSC_PACKET to represent receive packet - LIST_ENTRY ReceivePacketList; - HANDLE ReceivePacketListLock; +#define NETVSC_RECEIVE_SG_COUNT 1 - // Send buffer allocated by us but manages by NetVSP - void * SendBuffer; - u32 SendBufferSize; - u32 SendBufferGpadlHandle; - u32 SendSectionSize; - - // Receive buffer allocated by us but manages by NetVSP - void * ReceiveBuffer; - u32 ReceiveBufferSize; - u32 ReceiveBufferGpadlHandle; - u32 ReceiveSectionCount; - PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections; - - // Used for NetVSP initialization protocol - HANDLE ChannelInitEvent; - NVSP_MESSAGE ChannelInitPacket; - - NVSP_MESSAGE RevokePacket; - //unsigned char HwMacAddr[HW_MACADDR_LEN]; +/* Preallocated receive packets */ +#define NETVSC_RECEIVE_PACKETLIST_COUNT 256 - // Holds rndis device info - void *Extension; -} NETVSC_DEVICE; -#endif // _NETVSC_H_ +/* Per netvsc channel-specific */ +struct NETVSC_DEVICE { + struct hv_device *Device; + + atomic_t RefCount; + atomic_t NumOutstandingSends; + /* + * List of free preallocated hv_netvsc_packet to represent receive + * packet + */ + LIST_ENTRY ReceivePacketList; + spinlock_t receive_packet_list_lock; + + /* Send buffer allocated by us but manages by NetVSP */ + void *SendBuffer; + u32 SendBufferSize; + u32 SendBufferGpadlHandle; + u32 SendSectionSize; + + /* Receive buffer allocated by us but manages by NetVSP */ + void *ReceiveBuffer; + u32 ReceiveBufferSize; + u32 ReceiveBufferGpadlHandle; + u32 ReceiveSectionCount; + PNVSP_1_RECEIVE_BUFFER_SECTION ReceiveSections; + + /* Used for NetVSP initialization protocol */ + struct osd_waitevent *ChannelInitEvent; + NVSP_MESSAGE ChannelInitPacket; + + NVSP_MESSAGE RevokePacket; + /* unsigned char HwMacAddr[HW_MACADDR_LEN]; */ + + /* Holds rndis device info */ + void *Extension; +}; + +#endif /* _NETVSC_H_ */