// Initialize the NetVSC channel extension
netDevice->ReceiveBufferSize = NETVSC_RECEIVE_BUFFER_SIZE;
- netDevice->ReceivePacketListLock = SpinlockCreate();
+ spin_lock_init(&netDevice->receive_packet_list_lock);
netDevice->SendBufferSize = NETVSC_SEND_BUFFER_SIZE;
kfree(packet);
}
- SpinlockClose(netDevice->ReceivePacketListLock);
-
ReleaseOutboundNetDevice(Device);
ReleaseInboundNetDevice(Device);
kfree(netvscPacket);
}
- SpinlockClose(netDevice->ReceivePacketListLock);
WaitEventClose(netDevice->ChannelInitEvent);
FreeNetDevice(netDevice);
int i=0, j=0;
int count=0, bytesRemain=0;
+ unsigned long flags;
DPRINT_ENTER(NETVSC);
// Grab free packets (range count + 1) to represent this xfer page packet. +1 to represent
// the xfer page packet itself. We grab it here so that we know exactly how many we can fulfil
- SpinlockAcquire(netDevice->ReceivePacketListLock);
+ spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
while (!IsListEmpty(&netDevice->ReceivePacketList))
{
entry = REMOVE_HEAD_LIST(&netDevice->ReceivePacketList);
if (++count == vmxferpagePacket->RangeCount + 1)
break;
}
- SpinlockRelease(netDevice->ReceivePacketListLock);
+ spin_unlock_irqrestore(&netDevice->receive_packet_list_lock, flags);
// We need at least 2 netvsc pkts (1 to represent the xfer page and at least 1 for the range)
// i.e. we can handled some of the xfer page packet ranges...
DPRINT_ERR(NETVSC, "Got only %d netvsc pkt...needed %d pkts. Dropping this xfer page packet completely!", count, vmxferpagePacket->RangeCount+1);
// Return it to the freelist
- SpinlockAcquire(netDevice->ReceivePacketListLock);
+ spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
for (i=count; i != 0; i--)
{
entry = REMOVE_HEAD_LIST(&listHead);
INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &netvscPacket->ListEntry);
}
- SpinlockRelease(netDevice->ReceivePacketListLock);
+ spin_unlock_irqrestore(&netDevice->receive_packet_list_lock, flags);
NetVscSendReceiveCompletion(Device, vmxferpagePacket->d.TransactionId);
NETVSC_DEVICE* netDevice;
u64 transactionId=0;
bool fSendReceiveComp = false;
+ unsigned long flags;
DPRINT_ENTER(NETVSC);
}
// Overloading use of the lock.
- SpinlockAcquire(netDevice->ReceivePacketListLock);
+ spin_lock_irqsave(&netDevice->receive_packet_list_lock, flags);
ASSERT(packet->XferPagePacket->Count > 0);
packet->XferPagePacket->Count--;
// Put the packet back
INSERT_TAIL_LIST(&netDevice->ReceivePacketList, &packet->ListEntry);
- SpinlockRelease(netDevice->ReceivePacketListLock);
+ spin_unlock_irqrestore(&netDevice->receive_packet_list_lock, flags);
// Send a receive completion for the xfer page packet
if (fSendReceiveComp)