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