struct netvsc_device *net_device;
net_device = device->ext;
- /* ASSERT(netDevice); */
atomic_dec(&net_device->refcnt);
}
sizeof(struct nvsp_message),
sizeof(struct 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)); */
-
drv->name = driver_name;
memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid));
"device being destroyed?");
return -1;
}
- /* ASSERT(netDevice->ReceiveBufferSize > 0); */
- /* page-size grandularity */
- /* ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE - 1)) == 0); */
net_device->recv_buf =
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
ret = -1;
goto cleanup;
}
- /* page-aligned buffer */
- /* ASSERT(((unsigned long)netDevice->ReceiveBuffer & (PAGE_SIZE - 1)) == */
- /* 0); */
DPRINT_INFO(NETVSC, "Establishing receive buffer's GPADL...");
}
/* Parse the response */
- /* ASSERT(netDevice->ReceiveSectionCount == 0); */
- /* ASSERT(netDevice->ReceiveSections == NULL); */
net_device->recv_section_cnt = init_packet->msg.
v1_msg.send_recv_buf_complete.num_sections;
goto cleanup;
}
- /* page-size grandularity */
- /* ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0); */
-
net_device->send_buf =
(void *)__get_free_pages(GFP_KERNEL|__GFP_ZERO,
get_order(net_device->send_buf_size));
ret = -1;
goto cleanup;
}
- /* page-aligned buffer */
- /* ASSERT(((unsigned long)netDevice->SendBuffer & (PAGE_SIZE - 1)) == 0); */
DPRINT_INFO(NETVSC, "Establishing send buffer's GPADL...");
goto cleanup;
}
- /* Now, check the response */
- /* ASSERT(initPacket->Messages.InitMessages.InitComplete.MaximumMdlChainLength <= MAX_MULTIPAGE_BUFFER_COUNT); */
DPRINT_INFO(NETVSC, "NvspMessageTypeInit status(%d) max mdl chain (%d)",
init_packet->msg.init_msg.init_complete.status,
init_packet->msg.init_msg.
/* Get the send context */
nvsc_packet = (struct hv_netvsc_packet *)(unsigned long)
packet->trans_id;
- /* ASSERT(nvscPacket); */
/* Notify the layer above us */
nvsc_packet->completion.send.send_completion(
/* This is how much we can satisfy */
xferpage_packet->count = count - 1;
- /* ASSERT(xferpagePacket->Count > 0 && xferpagePacket->Count <= */
- /* vmxferpagePacket->RangeCount); */
if (xferpage_packet->count != vmxferpage_packet->range_cnt) {
DPRINT_INFO(NETVSC, "Needed %d netvsc pkts to satisy this xfer "
vmxferpage_packet->ranges[i].byte_count;
netvsc_packet->page_buf_cnt = 1;
- /* ASSERT(vmxferpagePacket->Ranges[i].ByteOffset + */
- /* vmxferpagePacket->Ranges[i].ByteCount < */
- /* netDevice->ReceiveBufferSize); */
-
netvsc_packet->page_buf[0].len =
vmxferpage_packet->ranges[i].byte_count;
if (bytes_remain == 0)
break;
}
- /* ASSERT(bytesRemain == 0); */
}
DPRINT_DBG(NETVSC, "[%d] - (abs offset %u len %u) => "
"(pfn %llx, offset %u, len %u)", i,
completion.recv.recv_completion_ctx);
}
- /* ASSERT(list_empty(&listHead)); */
-
put_net_device(device);
}
bool fsend_receive_comp = false;
unsigned long flags;
- /* ASSERT(packet->XferPagePacket); */
-
/*
* Even though it seems logical to do a GetOutboundNetDevice() here to
* send out receive completion, we are using GetInboundNetDevice()
/* Overloading use of the lock. */
spin_lock_irqsave(&net_device->recv_pkt_list_lock, flags);
- /* ASSERT(packet->XferPagePacket->Count > 0); */
packet->xfer_page_pkt->count--;
/*
unsigned char *buffer;
int bufferlen = NETVSC_PACKET_SIZE;
- /* ASSERT(device); */
-
packet = kzalloc(NETVSC_PACKET_SIZE * sizeof(unsigned char),
GFP_ATOMIC);
if (!packet)