static int
NetVscOnSend(
struct hv_device *Device,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
);
static void
DPRINT_ENTER(NETVSC);
- DPRINT_DBG(NETVSC, "sizeof(NETVSC_PACKET)=%zd, sizeof(NVSP_MESSAGE)=%zd, sizeof(VMTRANSFER_PAGE_PACKET_HEADER)=%zd",
- sizeof(NETVSC_PACKET), sizeof(NVSP_MESSAGE), sizeof(VMTRANSFER_PAGE_PACKET_HEADER));
+ DPRINT_DBG(NETVSC, "sizeof(struct hv_netvsc_packet)=%zd, sizeof(NVSP_MESSAGE)=%zd, sizeof(VMTRANSFER_PAGE_PACKET_HEADER)=%zd",
+ sizeof(struct hv_netvsc_packet), sizeof(NVSP_MESSAGE), sizeof(VMTRANSFER_PAGE_PACKET_HEADER));
/* Make sure we are at least 2 pages since 1 page is used for control */
ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1));
int i;
struct NETVSC_DEVICE *netDevice;
- NETVSC_PACKET* packet;
+ struct hv_netvsc_packet *packet;
LIST_ENTRY *entry;
NETVSC_DRIVER_OBJECT *netDriver = (NETVSC_DRIVER_OBJECT*) Device->Driver;;
for (i=0; i < NETVSC_RECEIVE_PACKETLIST_COUNT; i++)
{
- packet = kzalloc(sizeof(NETVSC_PACKET) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER)), GFP_KERNEL);
+ packet = kzalloc(sizeof(struct hv_netvsc_packet) + (NETVSC_RECEIVE_SG_COUNT* sizeof(PAGE_BUFFER)), GFP_KERNEL);
if (!packet)
{
DPRINT_DBG(NETVSC, "unable to allocate netvsc pkts for receive pool (wanted %d got %d)", NETVSC_RECEIVE_PACKETLIST_COUNT, i);
while (!IsListEmpty(&netDevice->ReceivePacketList))
{
entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList);
- packet = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
+ packet = CONTAINING_RECORD(entry, struct hv_netvsc_packet, ListEntry);
kfree(packet);
}
)
{
struct NETVSC_DEVICE *netDevice;
- NETVSC_PACKET *netvscPacket;
+ struct hv_netvsc_packet *netvscPacket;
int ret=0;
LIST_ENTRY *entry;
while (!IsListEmpty(&netDevice->ReceivePacketList))
{
entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList);
- netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
+ netvscPacket = CONTAINING_RECORD(entry, struct hv_netvsc_packet, ListEntry);
kfree(netvscPacket);
}
{
struct NETVSC_DEVICE *netDevice;
NVSP_MESSAGE *nvspPacket;
- NETVSC_PACKET *nvscPacket;
+ struct hv_netvsc_packet *nvscPacket;
DPRINT_ENTER(NETVSC);
else if (nvspPacket->Header.MessageType == NvspMessage1TypeSendRNDISPacketComplete)
{
/* Get the send context */
- nvscPacket = (NETVSC_PACKET *)(unsigned long)Packet->TransactionId;
+ nvscPacket = (struct hv_netvsc_packet *)(unsigned long)Packet->TransactionId;
ASSERT(nvscPacket);
/* Notify the layer above us */
static int
NetVscOnSend(
struct hv_device *Device,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
)
{
struct NETVSC_DEVICE *netDevice;
struct NETVSC_DEVICE *netDevice;
VMTRANSFER_PAGE_PACKET_HEADER *vmxferpagePacket;
NVSP_MESSAGE *nvspPacket;
- NETVSC_PACKET *netvscPacket=NULL;
+ struct hv_netvsc_packet *netvscPacket=NULL;
LIST_ENTRY* entry;
unsigned long start;
unsigned long end, endVirtual;
while (!IsListEmpty(&netDevice->ReceivePacketList))
{
entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList);
- netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
+ netvscPacket = CONTAINING_RECORD(entry, struct hv_netvsc_packet, ListEntry);
INSERT_TAIL_LIST(&listHead, &netvscPacket->ListEntry);
for (i=count; i != 0; i--)
{
entry = REMOVE_HEAD_LIST(&listHead);
- netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
+ netvscPacket = CONTAINING_RECORD(entry, struct hv_netvsc_packet, ListEntry);
INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &netvscPacket->ListEntry);
}
for (i=0; i < (count - 1); i++)
{
entry = REMOVE_HEAD_LIST(&listHead);
- netvscPacket = CONTAINING_RECORD(entry, NETVSC_PACKET, ListEntry);
+ netvscPacket = CONTAINING_RECORD(entry, struct hv_netvsc_packet, ListEntry);
/* Initialize the netvsc packet */
netvscPacket->XferPagePacket = xferpagePacket;
NetVscOnReceiveCompletion(
void * Context)
{
- NETVSC_PACKET *packet = (NETVSC_PACKET*)Context;
+ struct hv_netvsc_packet *packet = (struct hv_netvsc_packet*)Context;
struct hv_device *device = (struct hv_device*)packet->Device;
struct NETVSC_DEVICE *netDevice;
u64 transactionId=0;
RNDIS_MESSAGE ResponseMessage;
/* Simplify allocation by having a netvsc packet inline */
- NETVSC_PACKET Packet;
+ struct hv_netvsc_packet Packet;
PAGE_BUFFER Buffer;
/* FIXME: We assumed a fixed size request here. */
RNDIS_MESSAGE RequestMessage;
RndisFilterReceiveData(
RNDIS_DEVICE *Device,
RNDIS_MESSAGE *Message,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
);
static int
RndisFilterOnReceive(
struct hv_device *Device,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
);
static int
static int
RndisFilterOnSend(
struct hv_device *Device,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
);
static void
)
{
int ret=0;
- NETVSC_PACKET *packet;
+ struct hv_netvsc_packet *packet;
DPRINT_ENTER(NETVSC);
RndisFilterReceiveData(
RNDIS_DEVICE *Device,
RNDIS_MESSAGE *Message,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
)
{
RNDIS_PACKET *rndisPacket;
static int
RndisFilterOnReceive(
struct hv_device *Device,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
)
{
struct NETVSC_DEVICE *netDevice = (struct NETVSC_DEVICE*)Device->Extension;
static int
RndisFilterOnSend(
struct hv_device *Device,
- NETVSC_PACKET *Packet
+ struct hv_netvsc_packet *Packet
)
{
int ret=0;
/* Fwd declaration */
-typedef struct _NETVSC_PACKET *PNETVSC_PACKET;
+struct hv_netvsc_packet;
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, PNETVSC_PACKET packet);
+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, PNETVSC_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 */
* Represent netvsc packet which contains 1 RNDIS and 1 ethernet frame
* within the RNDIS
*/
-typedef struct _NETVSC_PACKET {
+struct hv_netvsc_packet {
/* Bookkeeping stuff */
DLIST_ENTRY ListEntry;
u32 PageBufferCount;
PAGE_BUFFER PageBuffers[NETVSC_PACKET_MAXPAGE];
-} NETVSC_PACKET;
+};
/* Represents the net vsc driver */
static int netvsc_open(struct net_device *net);
static void netvsc_xmit_completion(void *context);
static int netvsc_start_xmit (struct sk_buff *skb, struct net_device *net);
-static int netvsc_recv_callback(struct hv_device *device_obj, NETVSC_PACKET* Packet);
+static int netvsc_recv_callback(struct hv_device *device_obj, struct hv_netvsc_packet *Packet);
static int netvsc_close(struct net_device *net);
static struct net_device_stats *netvsc_get_stats(struct net_device *net);
static void netvsc_linkstatus_callback(struct hv_device *device_obj, unsigned int status);
--*/
static void netvsc_xmit_completion(void *context)
{
- NETVSC_PACKET *packet = (NETVSC_PACKET *)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;
NETVSC_DRIVER_OBJECT *net_drv_obj = &net_drv_ctx->drv_obj;
int i=0;
- NETVSC_PACKET* packet;
+ struct hv_netvsc_packet *packet;
int num_frags;
int retries=0;
num_frags = skb_shinfo(skb)->nr_frags + 1 + net_drv_obj->AdditionalRequestPageBufferCount;
/* Allocate a netvsc packet based on # of frags. */
- packet = kzalloc(sizeof(NETVSC_PACKET) + (num_frags * sizeof(PAGE_BUFFER)) + net_drv_obj->RequestExtSize, GFP_ATOMIC);
+ packet = kzalloc(sizeof(struct hv_netvsc_packet) + (num_frags * sizeof(PAGE_BUFFER)) + net_drv_obj->RequestExtSize, GFP_ATOMIC);
if (!packet)
{
- DPRINT_ERR(NETVSC_DRV, "unable to allocate NETVSC_PACKET");
+ DPRINT_ERR(NETVSC_DRV, "unable to allocate hv_netvsc_packet");
return -1;
}
- packet->Extension = (void*)(unsigned long)packet + sizeof(NETVSC_PACKET) + (num_frags * sizeof(PAGE_BUFFER)) ;
+ packet->Extension = (void*)(unsigned long)packet + sizeof(struct hv_netvsc_packet) + (num_frags * sizeof(PAGE_BUFFER)) ;
/* Setup the rndis header */
packet->PageBufferCount = num_frags;
Desc: Callback when we receive a packet from the "wire" on the specify device
--*/
-static int netvsc_recv_callback(struct hv_device *device_obj, NETVSC_PACKET* packet)
+static int netvsc_recv_callback(struct hv_device *device_obj, struct hv_netvsc_packet *packet)
{
int ret=0;
struct device_context *device_ctx = to_device_context(device_obj);
/* for kmap_atomic */
local_irq_save(flags);
- /* Copy to skb. This copy is needed here since the memory pointed by NETVSC_PACKET */
+ /* Copy to skb. This copy is needed here since the memory pointed by hv_netvsc_packet */
/* cannot be deallocated */
for (i=0; i<packet->PageBufferCount; i++)
{