Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162235
b: refs/heads/master
c: 8eef673
h: refs/heads/master
i:
  162233: 9e148c5
  162231: 63a2568
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Sep 15, 2009
1 parent 0473044 commit 9fe5885
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 51 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b8ffe077776543bfcd7aa470ee9df0ab64651d0
refs/heads/master: 8eef67392e25c04c52454e656c079bbec62487e1
87 changes: 37 additions & 50 deletions trunk/drivers/staging/hv/include/NetVscApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,35 @@
#include "List.h"

/* Defines */

#define NETVSC_DEVICE_RING_BUFFER_SIZE 64*PAGE_SIZE

#define HW_MACADDR_LEN 6

#define NETVSC_DEVICE_RING_BUFFER_SIZE (64*PAGE_SIZE)
#define HW_MACADDR_LEN 6

/* Fwd declaration */

struct hv_netvsc_packet;



/* Data types */


typedef int (*PFN_ON_OPEN)(struct hv_device *Device);
typedef int (*PFN_ON_CLOSE)(struct hv_device *Device);

typedef void (*PFN_QUERY_LINKSTATUS)(struct hv_device *Device);
typedef int (*PFN_ON_SEND)(struct hv_device *dev, struct hv_netvsc_packet *packet);
typedef void (*PFN_ON_SENDRECVCOMPLETION)(void * Context);
typedef int (*PFN_ON_SEND)(struct hv_device *dev,
struct hv_netvsc_packet *packet);
typedef void (*PFN_ON_SENDRECVCOMPLETION)(void *Context);

typedef int (*PFN_ON_RECVCALLBACK)(struct hv_device *dev, struct hv_netvsc_packet *packet);
typedef int (*PFN_ON_RECVCALLBACK)(struct hv_device *dev,
struct hv_netvsc_packet *packet);
typedef void (*PFN_ON_LINKSTATUS_CHANGED)(struct hv_device *dev, u32 Status);

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

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


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

/*
* Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
Expand All @@ -75,79 +68,73 @@ struct hv_netvsc_packet {
LIST_ENTRY ListEntry;

struct hv_device *Device;
bool IsDataPacket;
bool IsDataPacket;

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

union {
struct{
u64 ReceiveCompletionTid;
void * ReceiveCompletionContext;
PFN_ON_SENDRECVCOMPLETION OnReceiveCompletion;
u64 ReceiveCompletionTid;
void *ReceiveCompletionContext;
PFN_ON_SENDRECVCOMPLETION OnReceiveCompletion;
} Recv;
struct{
u64 SendCompletionTid;
void * SendCompletionContext;
PFN_ON_SENDRECVCOMPLETION OnSendCompletion;
u64 SendCompletionTid;
void *SendCompletionContext;
PFN_ON_SENDRECVCOMPLETION OnSendCompletion;
} Send;
} Completion;

/* This points to the memory after PageBuffers */
void * Extension;
void *Extension;

u32 TotalDataBufferLength;
u32 TotalDataBufferLength;
/* Points to the send/receive buffer where the ethernet frame is */
u32 PageBufferCount;
u32 PageBufferCount;
struct hv_page_buffer PageBuffers[NETVSC_PACKET_MAXPAGE];

};


/* Represents the net vsc driver */
typedef struct _NETVSC_DRIVER_OBJECT {
struct hv_driver Base; /* Must be the first field */
/* Must be the first field */
/* Which is a bug FIXME! */
struct hv_driver Base;

u32 RingBufferSize;
u32 RequestExtSize;
u32 RingBufferSize;
u32 RequestExtSize;

/* Additional num of page buffers to allocate */
u32 AdditionalRequestPageBufferCount;
u32 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_RECVCALLBACK OnReceiveCallback;

PFN_ON_LINKSTATUS_CHANGED OnLinkStatusChanged;
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_ON_OPEN OnOpen;
PFN_ON_CLOSE OnClose;
PFN_ON_SEND OnSend;
/* PFN_ON_RECVCOMPLETION OnReceiveCompletion; */

/* PFN_QUERY_LINKSTATUS QueryLinkStatus; */
/* PFN_QUERY_LINKSTATUS QueryLinkStatus; */

void* Context;
void *Context;
} NETVSC_DRIVER_OBJECT;


typedef struct _NETVSC_DEVICE_INFO {
unsigned char MacAddr[6];
bool LinkState; /* 0 - link up, 1 - link down */
unsigned char MacAddr[6];
bool LinkState; /* 0 - link up, 1 - link down */
} NETVSC_DEVICE_INFO;


/* Interface */

int
NetVscInitialize(
struct hv_driver *drv
);
int NetVscInitialize(struct hv_driver *drv);

#endif /* _NETVSC_API_H_ */

0 comments on commit 9fe5885

Please sign in to comment.