• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/linux/linux-2.6.36/drivers/staging/hv/

Lines Matching defs:netDevice

78 	struct netvsc_device *netDevice;
80 netDevice = kzalloc(sizeof(struct netvsc_device), GFP_KERNEL);
81 if (!netDevice)
85 atomic_cmpxchg(&netDevice->RefCount, 0, 2);
87 netDevice->Device = Device;
88 Device->Extension = netDevice;
90 return netDevice;
104 struct netvsc_device *netDevice;
106 netDevice = Device->Extension;
107 if (netDevice && atomic_read(&netDevice->RefCount) > 1)
108 atomic_inc(&netDevice->RefCount);
110 netDevice = NULL;
112 return netDevice;
118 struct netvsc_device *netDevice;
120 netDevice = Device->Extension;
121 if (netDevice && atomic_read(&netDevice->RefCount))
122 atomic_inc(&netDevice->RefCount);
124 netDevice = NULL;
126 return netDevice;
131 struct netvsc_device *netDevice;
133 netDevice = Device->Extension;
134 /* ASSERT(netDevice); */
136 atomic_dec(&netDevice->RefCount);
141 struct netvsc_device *netDevice;
143 netDevice = Device->Extension;
144 if (netDevice == NULL)
148 while (atomic_cmpxchg(&netDevice->RefCount, 2, 1) != 2)
151 return netDevice;
156 struct netvsc_device *netDevice;
158 netDevice = Device->Extension;
159 if (netDevice == NULL)
163 while (atomic_cmpxchg(&netDevice->RefCount, 1, 0) != 1)
167 return netDevice;
208 struct netvsc_device *netDevice;
211 netDevice = GetOutboundNetDevice(Device);
212 if (!netDevice) {
217 /* ASSERT(netDevice->ReceiveBufferSize > 0); */
219 /* ASSERT((netDevice->ReceiveBufferSize & (PAGE_SIZE - 1)) == 0); */
221 netDevice->ReceiveBuffer =
222 osd_PageAlloc(netDevice->ReceiveBufferSize >> PAGE_SHIFT);
223 if (!netDevice->ReceiveBuffer) {
226 netDevice->ReceiveBufferSize);
231 /* ASSERT(((unsigned long)netDevice->ReceiveBuffer & (PAGE_SIZE - 1)) == */
242 netDevice->ReceiveBuffer,
243 netDevice->ReceiveBufferSize,
244 &netDevice->ReceiveBufferGpadlHandle);
256 initPacket = &netDevice->ChannelInitPacket;
261 initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->ReceiveBufferGpadlHandle;
277 osd_WaitEventWait(netDevice->ChannelInitEvent);
289 /* ASSERT(netDevice->ReceiveSectionCount == 0); */
290 /* ASSERT(netDevice->ReceiveSections == NULL); */
292 netDevice->ReceiveSectionCount = initPacket->Messages.Version1Messages.SendReceiveBufferComplete.NumSections;
294 netDevice->ReceiveSections = kmalloc(netDevice->ReceiveSectionCount * sizeof(struct nvsp_1_receive_buffer_section), GFP_KERNEL);
295 if (netDevice->ReceiveSections == NULL) {
300 memcpy(netDevice->ReceiveSections,
302 netDevice->ReceiveSectionCount * sizeof(struct nvsp_1_receive_buffer_section));
306 netDevice->ReceiveSectionCount,
307 netDevice->ReceiveSections[0].Offset,
308 netDevice->ReceiveSections[0].EndOffset,
309 netDevice->ReceiveSections[0].SubAllocationSize,
310 netDevice->ReceiveSections[0].NumSubAllocations);
316 if (netDevice->ReceiveSectionCount != 1 ||
317 netDevice->ReceiveSections->Offset != 0) {
325 NetVscDestroyReceiveBuffer(netDevice);
335 struct netvsc_device *netDevice;
338 netDevice = GetOutboundNetDevice(Device);
339 if (!netDevice) {
344 if (netDevice->SendBufferSize <= 0) {
350 /* ASSERT((netDevice->SendBufferSize & (PAGE_SIZE - 1)) == 0); */
352 netDevice->SendBuffer =
353 osd_PageAlloc(netDevice->SendBufferSize >> PAGE_SHIFT);
354 if (!netDevice->SendBuffer) {
356 netDevice->SendBufferSize);
361 /* ASSERT(((unsigned long)netDevice->SendBuffer & (PAGE_SIZE - 1)) == 0); */
371 netDevice->SendBuffer,
372 netDevice->SendBufferSize,
373 &netDevice->SendBufferGpadlHandle);
384 initPacket = &netDevice->ChannelInitPacket;
389 initPacket->Messages.Version1Messages.SendReceiveBuffer.GpadlHandle = netDevice->SendBufferGpadlHandle;
404 osd_WaitEventWait(netDevice->ChannelInitEvent);
415 netDevice->SendSectionSize = initPacket->Messages.Version1Messages.SendSendBufferComplete.SectionSize;
420 NetVscDestroySendBuffer(netDevice);
573 struct netvsc_device *netDevice;
577 netDevice = GetOutboundNetDevice(Device);
578 if (!netDevice) {
584 initPacket = &netDevice->ChannelInitPacket;
606 osd_WaitEventWait(netDevice->ChannelInitEvent);
686 struct netvsc_device *netDevice;
691 netDevice = AllocNetDevice(Device);
692 if (!netDevice) {
697 DPRINT_DBG(NETVSC, "netvsc channel object allocated - %p", netDevice);
700 netDevice->ReceiveBufferSize = NETVSC_RECEIVE_BUFFER_SIZE;
701 spin_lock_init(&netDevice->receive_packet_list_lock);
703 netDevice->SendBufferSize = NETVSC_SEND_BUFFER_SIZE;
705 INIT_LIST_HEAD(&netDevice->ReceivePacketList);
718 &netDevice->ReceivePacketList);
720 netDevice->ChannelInitEvent = osd_WaitEventCreate();
721 if (!netDevice->ChannelInitEvent) {
762 if (netDevice) {
763 kfree(netDevice->ChannelInitEvent);
766 &netDevice->ReceivePacketList,
775 FreeNetDevice(netDevice);
786 struct netvsc_device *netDevice;
793 netDevice = ReleaseOutboundNetDevice(Device);
794 if (!netDevice) {
800 while (atomic_read(&netDevice->NumOutstandingSends)) {
802 atomic_read(&netDevice->NumOutstandingSends));
808 NetVscDisconnectFromVsp(netDevice);
814 netDevice = ReleaseInboundNetDevice(Device);
816 /* At this point, no one should be accessing netDevice except in here */
817 DPRINT_INFO(NETVSC, "net device (%p) safe to remove", netDevice);
824 &netDevice->ReceivePacketList, ListEntry) {
829 kfree(netDevice->ChannelInitEvent);
830 FreeNetDevice(netDevice);
844 struct netvsc_device *netDevice;
848 netDevice = GetInboundNetDevice(Device);
849 if (!netDevice) {
866 memcpy(&netDevice->ChannelInitPacket, nvspPacket,
868 osd_WaitEventSet(netDevice->ChannelInitEvent);
878 atomic_dec(&netDevice->NumOutstandingSends);
890 struct netvsc_device *netDevice;
895 netDevice = GetOutboundNetDevice(Device);
896 if (!netDevice) {
898 "ignoring outbound packets", netDevice);
936 atomic_inc(&netDevice->NumOutstandingSends);
944 struct netvsc_device *netDevice;
957 netDevice = GetInboundNetDevice(Device);
958 if (!netDevice) {
1008 spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
1009 while (!list_empty(&netDevice->ReceivePacketList)) {
1010 list_move_tail(netDevice->ReceivePacketList.next, &listHead);
1014 spin_unlock_irqrestore(&netDevice->receive_packet_list_lock, flags);
1027 spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
1030 &netDevice->ReceivePacketList);
1032 spin_unlock_irqrestore(&netDevice->receive_packet_list_lock,
1079 /* netDevice->ReceiveBufferSize); */
1084 start = virt_to_phys((void *)((unsigned long)netDevice->ReceiveBuffer + vmxferpagePacket->Ranges[i].ByteOffset));
1087 endVirtual = (unsigned long)netDevice->ReceiveBuffer
1188 struct netvsc_device *netDevice;
1200 netDevice = GetInboundNetDevice(device);
1201 if (!netDevice) {
1208 spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
1221 &netDevice->ReceivePacketList);
1226 list_add_tail(&packet->ListEntry, &netDevice->ReceivePacketList);
1227 spin_unlock_irqrestore(&netDevice->receive_packet_list_lock, flags);
1240 struct netvsc_device *netDevice;
1256 netDevice = GetInboundNetDevice(device);
1257 if (!netDevice) {
1259 "ignoring inbound packets", netDevice);