static int sxg_process_isr(struct adapter_t *adapter, u32 MessageId);
static u32 sxg_process_event_queue(struct adapter_t *adapter, u32 RssId,
int *sxg_napi_continue, int *work_done, int budget);
-static void sxg_complete_slow_send(struct adapter_t *adapter, int irq_context);
+static void sxg_complete_slow_send(struct adapter_t *adapter);
static struct sk_buff *sxg_slow_receive(struct adapter_t *adapter,
struct sxg_event *Event);
static void sxg_process_rcv_error(struct adapter_t *adapter, u32 ErrorStatus);
}
/* Slowpath send completions */
if (Isr & SXG_ISR_SPSEND) {
- sxg_complete_slow_send(adapter, 1);
+ sxg_complete_slow_send(adapter);
}
/* Dump */
if (Isr & SXG_ISR_UPC) {
*
* Arguments -
* adapter - A pointer to our adapter structure
- * irq_context - An integer to denote if we are in interrupt context
* Return
* None
*/
-static void sxg_complete_slow_send(struct adapter_t *adapter, int irq_context)
+static void sxg_complete_slow_send(struct adapter_t *adapter)
{
struct sxg_xmt_ring *XmtRing = &adapter->XmtRings[0];
struct sxg_ring_info *XmtRingInfo = &adapter->XmtRingZeroInfo;
* This means two different processors can both be running/
* through this loop. Be *very* careful.
*/
- if(irq_context) {
- if(!spin_trylock(&adapter->XmtZeroLock))
- goto lock_busy;
- }
- else
- spin_lock_irqsave(&adapter->XmtZeroLock, flags);
+ spin_lock_irqsave(&adapter->XmtZeroLock, flags);
SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "CmpSnds",
adapter, XmtRingInfo->Head, XmtRingInfo->Tail, 0);
* chimney send, which results in a double trip
* in SxgTcpOuput
*/
- if(irq_context)
- spin_unlock(&adapter->XmtZeroLock);
- else
- spin_unlock_irqrestore(
- &adapter->XmtZeroLock, flags);
+ spin_unlock_irqrestore(
+ &adapter->XmtZeroLock, flags);
SxgSgl->DumbPacket = NULL;
SXG_COMPLETE_DUMB_SEND(adapter, skb,
FirstSgeAddress,
FirstSgeLength);
- SXG_FREE_SGL_BUFFER(adapter, SxgSgl, NULL,
- irq_context);
+ SXG_FREE_SGL_BUFFER(adapter, SxgSgl, NULL);
/* and reacquire.. */
- if(irq_context) {
- if(!spin_trylock(&adapter->XmtZeroLock))
- goto lock_busy;
- }
- else
- spin_lock_irqsave(&adapter->XmtZeroLock, flags);
+ spin_lock_irqsave(&adapter->XmtZeroLock, flags);
}
break;
default:
ASSERT(0);
}
}
- if(irq_context)
- spin_unlock(&adapter->XmtZeroLock);
- else
- spin_unlock_irqrestore(&adapter->XmtZeroLock, flags);
-lock_busy:
+ spin_unlock_irqrestore(&adapter->XmtZeroLock, flags);
SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "CmpSnd",
adapter, XmtRingInfo->Head, XmtRingInfo->Tail, 0);
}
*/
spin_unlock_irqrestore(&adapter->XmtZeroLock, flags);
- sxg_complete_slow_send(adapter, 0);
+ sxg_complete_slow_send(adapter);
spin_lock_irqsave(&adapter->XmtZeroLock, flags);
SXG_GET_CMD(XmtRing, XmtRingInfo, XmtCmd, SxgSgl);
if (XmtCmd == NULL) {
unsigned long sgl_flags;
SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "AlSglCmp",
adapter, SxgSgl, Length, 0);
- if(!in_irq())
- spin_lock_irqsave(&adapter->SglQLock, sgl_flags);
- else
- spin_lock(&adapter->SglQLock);
+ spin_lock_irqsave(&adapter->SglQLock, sgl_flags);
adapter->AllSglBufferCount++;
/* PhysicalAddress; */
SxgSgl->PhysicalAddress = PhysicalAddress;
/* Initialize backpointer once */
SxgSgl->adapter = adapter;
InsertTailList(&adapter->AllSglBuffers, &SxgSgl->AllList);
- if(!in_irq())
- spin_unlock_irqrestore(&adapter->SglQLock, sgl_flags);
- else
- spin_unlock(&adapter->SglQLock);
+ spin_unlock_irqrestore(&adapter->SglQLock, sgl_flags);
SxgSgl->State = SXG_BUFFER_BUSY;
- SXG_FREE_SGL_BUFFER(adapter, SxgSgl, NULL, in_irq());
+ SXG_FREE_SGL_BUFFER(adapter, SxgSgl, NULL);
SXG_TRACE(TRACE_SXG, SxgTraceBuffer, TRACE_NOISY, "XAlSgl",
adapter, SxgSgl, Length, 0);
}
}
/* SGL macros */
-#define SXG_FREE_SGL_BUFFER(_pAdapt, _Sgl, _NB, _irq) { \
- if(!_irq) \
- spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \
- else \
- spin_lock(&(_pAdapt)->SglQLock); \
+#define SXG_FREE_SGL_BUFFER(_pAdapt, _Sgl, _NB) { \
+ spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \
(_pAdapt)->FreeSglBufferCount++; \
ASSERT((_pAdapt)->AllSglBufferCount >= (_pAdapt)->FreeSglBufferCount); \
ASSERT(!((_Sgl)->State & SXG_BUFFER_FREE)); \
(_Sgl)->State = SXG_BUFFER_FREE; \
InsertTailList(&(_pAdapt)->FreeSglBuffers, &(_Sgl)->FreeList); \
- if(!_irq) \
- spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags); \
- else \
- spin_unlock(&(_pAdapt)->SglQLock); \
+ spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags); \
}
/*
if(!_irq) \
spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \
else \
- spin_lock(&(_pAdapt)->SglQLock); \
+ spin_lock_irqsave(&(_pAdapt)->SglQLock, sgl_flags); \
if((_pAdapt)->FreeSglBufferCount) { \
ASSERT(!(IsListEmpty(&(_pAdapt)->FreeSglBuffers))); \
_ple = RemoveHeadList(&(_pAdapt)->FreeSglBuffers); \
if(!_irq) \
spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags);\
else \
- spin_unlock(&(_pAdapt)->SglQLock); \
+ spin_unlock_irqrestore(&(_pAdapt)->SglQLock, sgl_flags);\
}
/*