Commit b711b2e0 authored by Alan Cox's avatar Alan Cox Committed by Greg Kroah-Hartman

Staging: et131x: tidy up names for the TX structures

Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fb70ed67
This diff is collapsed.
...@@ -89,14 +89,13 @@ ...@@ -89,14 +89,13 @@
* 14: UDP checksum assist * 14: UDP checksum assist
*/ */
/* TX_DESC_ENTRY_t is sructure representing each descriptor on the ring */ /* struct tx_desc represents each descriptor on the ring */
typedef struct _tx_desc_entry_t { struct tx_desc {
u32 DataBufferPtrHigh; u32 addr_hi;
u32 DataBufferPtrLow; u32 addr_lo;
u32 word2; /* control words how to xmit the */ u32 len_vlan; /* control words how to xmit the */
u32 word3; /* data (detailed above) */ u32 flags; /* data (detailed above) */
} TX_DESC_ENTRY_t, *PTX_DESC_ENTRY_t; };
/* Typedefs for Tx DMA engine status writeback */ /* Typedefs for Tx DMA engine status writeback */
...@@ -120,8 +119,8 @@ typedef union _tx_status_block_t { ...@@ -120,8 +119,8 @@ typedef union _tx_status_block_t {
} TX_STATUS_BLOCK_t, *PTX_STATUS_BLOCK_t; } TX_STATUS_BLOCK_t, *PTX_STATUS_BLOCK_t;
/* TCB (Transmit Control Block) */ /* TCB (Transmit Control Block) */
typedef struct _MP_TCB { struct tcb {
struct _MP_TCB *Next; struct tcb *Next;
u32 Flags; u32 Flags;
u32 Count; u32 Count;
u32 PacketStaleCount; u32 PacketStaleCount;
...@@ -129,7 +128,7 @@ typedef struct _MP_TCB { ...@@ -129,7 +128,7 @@ typedef struct _MP_TCB {
u32 PacketLength; u32 PacketLength;
u32 WrIndex; u32 WrIndex;
u32 WrIndexStart; u32 WrIndexStart;
} MP_TCB, *PMP_TCB; };
/* Structure to hold the skb's in a list */ /* Structure to hold the skb's in a list */
typedef struct tx_skb_list_elem { typedef struct tx_skb_list_elem {
...@@ -137,14 +136,14 @@ typedef struct tx_skb_list_elem { ...@@ -137,14 +136,14 @@ typedef struct tx_skb_list_elem {
struct sk_buff *skb; struct sk_buff *skb;
} TX_SKB_LIST_ELEM, *PTX_SKB_LIST_ELEM; } TX_SKB_LIST_ELEM, *PTX_SKB_LIST_ELEM;
/* TX_RING_t is sructure representing our local reference(s) to the ring */ /* Structure representing our local reference(s) to the ring */
typedef struct _tx_ring_t { struct tx_ring {
/* TCB (Transmit Control Block) memory and lists */ /* TCB (Transmit Control Block) memory and lists */
PMP_TCB MpTcbMem; struct tcb *MpTcbMem;
/* List of TCBs that are ready to be used */ /* List of TCBs that are ready to be used */
PMP_TCB TCBReadyQueueHead; struct tcb *TCBReadyQueueHead;
PMP_TCB TCBReadyQueueTail; struct tcb *TCBReadyQueueTail;
/* list of TCBs that are currently being sent. NOTE that access to all /* list of TCBs that are currently being sent. NOTE that access to all
* three of these (including nBusySend) are controlled via the * three of these (including nBusySend) are controlled via the
...@@ -152,19 +151,19 @@ typedef struct _tx_ring_t { ...@@ -152,19 +151,19 @@ typedef struct _tx_ring_t {
* decrementing nBusySend, or any queue manipulation on CurrSendHead / * decrementing nBusySend, or any queue manipulation on CurrSendHead /
* Tail * Tail
*/ */
PMP_TCB CurrSendHead; struct tcb *CurrSendHead;
PMP_TCB CurrSendTail; struct tcb *CurrSendTail;
int32_t nBusySend; int nBusySend;
/* List of packets (not TCBs) that were queued for lack of resources */ /* List of packets (not TCBs) that were queued for lack of resources */
struct list_head SendWaitQueue; struct list_head SendWaitQueue;
int32_t nWaitSend; int nWaitSend;
/* The actual descriptor ring */ /* The actual descriptor ring */
PTX_DESC_ENTRY_t pTxDescRingVa; struct tx_desc *tx_desc_ring;
dma_addr_t pTxDescRingPa; dma_addr_t tx_desc_ring_pa;
uint64_t pTxDescRingAdjustedPa; u64 pTxDescRingAdjustedPa;
uint64_t TxDescOffset; u64 TxDescOffset;
/* ReadyToSend indicates where we last wrote to in the descriptor ring. */ /* ReadyToSend indicates where we last wrote to in the descriptor ring. */
u32 txDmaReadyToSend; u32 txDmaReadyToSend;
...@@ -180,8 +179,8 @@ typedef struct _tx_ring_t { ...@@ -180,8 +179,8 @@ typedef struct _tx_ring_t {
TXMAC_ERR_t TxMacErr; TXMAC_ERR_t TxMacErr;
/* Variables to track the Tx interrupt coalescing features */ /* Variables to track the Tx interrupt coalescing features */
int32_t TxPacketsSinceLastinterrupt; int TxPacketsSinceLastinterrupt;
} TX_RING_t, *PTX_RING_t; };
/* Forward declaration of the frag-list for the following prototypes */ /* Forward declaration of the frag-list for the following prototypes */
typedef struct _MP_FRAG_LIST MP_FRAG_LIST, *PMP_FRAG_LIST; typedef struct _MP_FRAG_LIST MP_FRAG_LIST, *PMP_FRAG_LIST;
......
...@@ -101,8 +101,8 @@ ...@@ -101,8 +101,8 @@
#define LO_MARK_PERCENT_FOR_RX 15 #define LO_MARK_PERCENT_FOR_RX 15
/* Macros specific to the private adapter structure */ /* Macros specific to the private adapter structure */
#define MP_TCB_RESOURCES_AVAILABLE(_M) ((_M)->TxRing.nBusySend < NUM_TCB) #define MP_TCB_RESOURCES_AVAILABLE(_M) ((_M)->tx_ring.nBusySend < NUM_TCB)
#define MP_TCB_RESOURCES_NOT_AVAILABLE(_M) ((_M)->TxRing.nBusySend >= NUM_TCB) #define MP_TCB_RESOURCES_NOT_AVAILABLE(_M) ((_M)->tx_ring.nBusySend >= NUM_TCB)
#define MP_SHOULD_FAIL_SEND(_M) ((_M)->Flags & fMP_ADAPTER_FAIL_SEND_MASK) #define MP_SHOULD_FAIL_SEND(_M) ((_M)->Flags & fMP_ADAPTER_FAIL_SEND_MASK)
...@@ -255,7 +255,7 @@ struct et131x_adapter { ...@@ -255,7 +255,7 @@ struct et131x_adapter {
MI_BMSR_t Bmsr; MI_BMSR_t Bmsr;
/* Tx Memory Variables */ /* Tx Memory Variables */
TX_RING_t TxRing; struct tx_ring tx_ring;
/* Rx Memory Variables */ /* Rx Memory Variables */
RX_RING_t RxRing; RX_RING_t RxRing;
......
...@@ -179,15 +179,15 @@ irqreturn_t et131x_isr(int irq, void *dev_id) ...@@ -179,15 +179,15 @@ irqreturn_t et131x_isr(int irq, void *dev_id)
/* This is our interrupt, so process accordingly */ /* This is our interrupt, so process accordingly */
if (status & ET_INTR_WATCHDOG) { if (status & ET_INTR_WATCHDOG) {
PMP_TCB pMpTcb = adapter->TxRing.CurrSendHead; struct tcb *tcb = adapter->tx_ring.CurrSendHead;
if (pMpTcb) if (tcb)
if (++pMpTcb->PacketStaleCount > 1) if (++tcb->PacketStaleCount > 1)
status |= ET_INTR_TXDMA_ISR; status |= ET_INTR_TXDMA_ISR;
if (adapter->RxRing.UnfinishedReceives) if (adapter->RxRing.UnfinishedReceives)
status |= ET_INTR_RXDMA_XFR_DONE; status |= ET_INTR_RXDMA_XFR_DONE;
else if (pMpTcb == NULL) else if (tcb == NULL)
writel(0, &adapter->regs->global.watchdog_timer); writel(0, &adapter->regs->global.watchdog_timer);
status &= ~ET_INTR_WATCHDOG; status &= ~ET_INTR_WATCHDOG;
...@@ -397,7 +397,7 @@ void et131x_isr_handler(struct work_struct *work) ...@@ -397,7 +397,7 @@ void et131x_isr_handler(struct work_struct *work)
/* Let's move on to the TxMac */ /* Let's move on to the TxMac */
if (status & ET_INTR_TXMAC) { if (status & ET_INTR_TXMAC) {
etdev->TxRing.TxMacErr.value = etdev->tx_ring.TxMacErr.value =
readl(&iomem->txmac.err.value); readl(&iomem->txmac.err.value);
/* /*
...@@ -412,7 +412,7 @@ void et131x_isr_handler(struct work_struct *work) ...@@ -412,7 +412,7 @@ void et131x_isr_handler(struct work_struct *work)
*/ */
dev_warn(&etdev->pdev->dev, dev_warn(&etdev->pdev->dev,
"TXMAC interrupt, error 0x%08x\n", "TXMAC interrupt, error 0x%08x\n",
etdev->TxRing.TxMacErr.value); etdev->tx_ring.TxMacErr.value);
/* If we are debugging, we want to see this error, /* If we are debugging, we want to see this error,
* otherwise we just want the device to be reset and * otherwise we just want the device to be reset and
......
...@@ -519,7 +519,7 @@ int et131x_tx(struct sk_buff *skb, struct net_device *netdev) ...@@ -519,7 +519,7 @@ int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
void et131x_tx_timeout(struct net_device *netdev) void et131x_tx_timeout(struct net_device *netdev)
{ {
struct et131x_adapter *etdev = netdev_priv(netdev); struct et131x_adapter *etdev = netdev_priv(netdev);
PMP_TCB pMpTcb; struct tcb *tcb;
unsigned long flags; unsigned long flags;
/* Just skip this part if the adapter is doing link detection */ /* Just skip this part if the adapter is doing link detection */
...@@ -541,28 +541,28 @@ void et131x_tx_timeout(struct net_device *netdev) ...@@ -541,28 +541,28 @@ void et131x_tx_timeout(struct net_device *netdev)
/* Is send stuck? */ /* Is send stuck? */
spin_lock_irqsave(&etdev->TCBSendQLock, flags); spin_lock_irqsave(&etdev->TCBSendQLock, flags);
pMpTcb = etdev->TxRing.CurrSendHead; tcb = etdev->tx_ring.CurrSendHead;
if (pMpTcb != NULL) { if (tcb != NULL) {
pMpTcb->Count++; tcb->Count++;
if (pMpTcb->Count > NIC_SEND_HANG_THRESHOLD) { if (tcb->Count > NIC_SEND_HANG_THRESHOLD) {
TX_DESC_ENTRY_t StuckDescriptors[10]; struct tx_desc stuck[10];
if (INDEX10(pMpTcb->WrIndex) > 7) { if (INDEX10(tcb->WrIndex) > 7) {
memcpy(StuckDescriptors, memcpy(stuck,
etdev->TxRing.pTxDescRingVa + etdev->tx_ring.tx_desc_ring +
INDEX10(pMpTcb->WrIndex) - 6, INDEX10(tcb->WrIndex) - 6,
sizeof(TX_DESC_ENTRY_t) * 10); sizeof(struct tx_desc) * 10);
} }
spin_unlock_irqrestore(&etdev->TCBSendQLock, spin_unlock_irqrestore(&etdev->TCBSendQLock,
flags); flags);
dev_warn(&etdev->pdev->dev, dev_warn(&etdev->pdev->dev,
"Send stuck - reset. pMpTcb->WrIndex %x, Flags 0x%08x\n", "Send stuck - reset. tcb->WrIndex %x, Flags 0x%08x\n",
pMpTcb->WrIndex, tcb->WrIndex,
pMpTcb->Flags); tcb->Flags);
et131x_close(netdev); et131x_close(netdev);
et131x_open(netdev); et131x_open(netdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment