u32 packetLen;
u32 userLen;
int ret;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
*BufferActualLen = 0;
*RequestId = 0;
- SpinlockAcquire(Channel->InboundLock);
+ spin_lock_irqsave(&Channel->inbound_lock, flags);
ret = RingBufferPeek(&Channel->Inbound, &desc, sizeof(VMPACKET_DESCRIPTOR));
if (ret != 0)
{
- SpinlockRelease(Channel->InboundLock);
+ spin_unlock_irqrestore(&Channel->inbound_lock, flags);
//DPRINT_DBG(VMBUS, "nothing to read!!");
DPRINT_EXIT(VMBUS);
if (userLen > BufferLen)
{
- SpinlockRelease(Channel->InboundLock);
+ spin_unlock_irqrestore(&Channel->inbound_lock, flags);
DPRINT_ERR(VMBUS, "buffer too small - got %d needs %d", BufferLen, userLen);
DPRINT_EXIT(VMBUS);
// Copy over the packet to the user buffer
ret = RingBufferRead(&Channel->Inbound, Buffer, userLen, (desc.DataOffset8 << 3));
- SpinlockRelease(Channel->InboundLock);
+ spin_unlock_irqrestore(&Channel->inbound_lock, flags);
DPRINT_EXIT(VMBUS);
u32 packetLen;
u32 userLen;
int ret;
+ unsigned long flags;
DPRINT_ENTER(VMBUS);
*BufferActualLen = 0;
*RequestId = 0;
- SpinlockAcquire(Channel->InboundLock);
+ spin_lock_irqsave(&Channel->inbound_lock, flags);
ret = RingBufferPeek(&Channel->Inbound, &desc, sizeof(VMPACKET_DESCRIPTOR));
if (ret != 0)
{
- SpinlockRelease(Channel->InboundLock);
+ spin_unlock_irqrestore(&Channel->inbound_lock, flags);
//DPRINT_DBG(VMBUS, "nothing to read!!");
DPRINT_EXIT(VMBUS);
if (packetLen > BufferLen)
{
- SpinlockRelease(Channel->InboundLock);
+ spin_unlock_irqrestore(&Channel->inbound_lock, flags);
DPRINT_ERR(VMBUS, "buffer too small - needed %d bytes but got space for only %d bytes", packetLen, BufferLen);
DPRINT_EXIT(VMBUS);
// Copy over the entire packet to the user buffer
ret = RingBufferRead(&Channel->Inbound, Buffer, packetLen, 0);
- SpinlockRelease(Channel->InboundLock);
+ spin_unlock_irqrestore(&Channel->inbound_lock, flags);
DPRINT_EXIT(VMBUS);
return NULL;
}
- channel->InboundLock = SpinlockCreate();
- if (!channel->InboundLock)
- {
- kfree(channel);
- return NULL;
- }
+ spin_lock_init(&channel->inbound_lock);
channel->PollTimer = TimerCreate(VmbusChannelOnTimer, channel);
if (!channel->PollTimer)
{
- SpinlockClose(channel->InboundLock);
kfree(channel);
return NULL;
}
if (!channel->ControlWQ)
{
TimerClose(channel->PollTimer);
- SpinlockClose(channel->InboundLock);
kfree(channel);
return NULL;
}
--*/
void FreeVmbusChannel(VMBUS_CHANNEL* Channel)
{
- SpinlockClose(Channel->InboundLock);
TimerClose(Channel->PollTimer);
// We have to release the channel's workqueue/thread in the vmbus's workqueue/thread context