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

Staging: et131x: Clean up tx naming

Clean up the names to be Linux like
Remove the unused pad buffer
Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9251d71a
This diff is collapsed.
...@@ -97,100 +97,71 @@ struct tx_desc { ...@@ -97,100 +97,71 @@ struct tx_desc {
u32 flags; /* data (detailed above) */ u32 flags; /* data (detailed above) */
}; };
/* Typedefs for Tx DMA engine status writeback */
/* /*
* TX_STATUS_BLOCK_t is sructure representing the status of the Tx DMA engine * The status of the Tx DMA engine it sits in free memory, and is pointed to
* it sits in free memory, and is pointed to by 0x101c / 0x1020 * by 0x101c / 0x1020. This is a DMA10 type
*/ */
typedef union _tx_status_block_t {
u32 value; /* TCB (Transmit Control Block: Host Side) */
struct {
#ifdef _BIT_FIELDS_HTOL
u32 unused:21; /* bits 11-31 */
u32 serv_cpl_wrap:1; /* bit 10 */
u32 serv_cpl:10; /* bits 0-9 */
#else
u32 serv_cpl:10; /* bits 0-9 */
u32 serv_cpl_wrap:1; /* bit 10 */
u32 unused:21; /* bits 11-31 */
#endif
} bits;
} TX_STATUS_BLOCK_t, *PTX_STATUS_BLOCK_t;
/* TCB (Transmit Control Block) */
struct tcb { struct tcb {
struct tcb *Next; struct tcb *next; /* Next entry in ring */
u32 Flags; u32 flags; /* Our flags for the packet */
u32 Count; u32 count;
u32 PacketStaleCount; u32 stale; /* Used to spot stuck/lost packets */
struct sk_buff *Packet; struct sk_buff *skb; /* Network skb we are tied to */
u32 PacketLength; u32 len;
u32 WrIndex; u32 index;
u32 WrIndexStart; u32 index_start;
}; };
/* Structure to hold the skb's in a list */
typedef struct tx_skb_list_elem {
struct list_head skb_list_elem;
struct sk_buff *skb;
} TX_SKB_LIST_ELEM, *PTX_SKB_LIST_ELEM;
/* Structure representing our local reference(s) to the ring */ /* Structure representing our local reference(s) to the ring */
struct tx_ring { struct tx_ring {
/* TCB (Transmit Control Block) memory and lists */ /* TCB (Transmit Control Block) memory and lists */
struct tcb *MpTcbMem; struct tcb *tcb_ring;
/* List of TCBs that are ready to be used */ /* List of TCBs that are ready to be used */
struct tcb *TCBReadyQueueHead; struct tcb *tcb_qhead;
struct tcb *TCBReadyQueueTail; struct tcb *tcb_qtail;
/* 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 used) are controlled via the
* TCBSendQLock. This lock should be secured prior to incementing / * TCBSendQLock. This lock should be secured prior to incementing /
* decrementing nBusySend, or any queue manipulation on CurrSendHead / * decrementing used, or any queue manipulation on send_head /
* Tail * Tail
*/ */
struct tcb *CurrSendHead; struct tcb *send_head;
struct tcb *CurrSendTail; struct tcb *send_tail;
int nBusySend; int used;
/* The actual descriptor ring */ /* The actual descriptor ring */
struct tx_desc *tx_desc_ring; struct tx_desc *tx_desc_ring;
dma_addr_t tx_desc_ring_pa; dma_addr_t tx_desc_ring_pa;
/* 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 send_idx;
/* The location of the write-back status block */ /* The location of the write-back status block */
PTX_STATUS_BLOCK_t pTxStatusVa; u32 *tx_status;
dma_addr_t pTxStatusPa; dma_addr_t tx_status_pa;
/* A Block of zeroes used to pad packets that are less than 60 bytes */
void *pTxDummyBlkVa;
dma_addr_t pTxDummyBlkPa;
TXMAC_ERR_t TxMacErr; TXMAC_ERR_t TxMacErr;
/* Variables to track the Tx interrupt coalescing features */ /* Variables to track the Tx interrupt coalescing features */
int TxPacketsSinceLastinterrupt; int since_irq;
}; };
/* Forward declaration of the frag-list for the following prototypes */
typedef struct _MP_FRAG_LIST MP_FRAG_LIST, *PMP_FRAG_LIST;
/* Forward declaration of the private adapter structure */ /* Forward declaration of the private adapter structure */
struct et131x_adapter; struct et131x_adapter;
/* PROTOTYPES for et1310_tx.c */ /* PROTOTYPES for et1310_tx.c */
int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter); int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter);
void et131x_tx_dma_memory_free(struct et131x_adapter *adapter); void et131x_tx_dma_memory_free(struct et131x_adapter *adapter);
void ConfigTxDmaRegs(struct et131x_adapter *pAdapter); void ConfigTxDmaRegs(struct et131x_adapter *adapter);
void et131x_init_send(struct et131x_adapter *adapter); void et131x_init_send(struct et131x_adapter *adapter);
void et131x_tx_dma_disable(struct et131x_adapter *pAdapter); void et131x_tx_dma_disable(struct et131x_adapter *adapter);
void et131x_tx_dma_enable(struct et131x_adapter *pAdapter); void et131x_tx_dma_enable(struct et131x_adapter *adapter);
void et131x_handle_send_interrupt(struct et131x_adapter *pAdapter); void et131x_handle_send_interrupt(struct et131x_adapter *adapter);
void et131x_free_busy_send_packets(struct et131x_adapter *pAdapter); void et131x_free_busy_send_packets(struct et131x_adapter *adapter);
int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev); int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev);
#endif /* __ET1310_TX_H__ */ #endif /* __ET1310_TX_H__ */
...@@ -179,10 +179,10 @@ irqreturn_t et131x_isr(int irq, void *dev_id) ...@@ -179,10 +179,10 @@ 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) {
struct tcb *tcb = adapter->tx_ring.CurrSendHead; struct tcb *tcb = adapter->tx_ring.send_head;
if (tcb) if (tcb)
if (++tcb->PacketStaleCount > 1) if (++tcb->stale > 1)
status |= ET_INTR_TXDMA_ISR; status |= ET_INTR_TXDMA_ISR;
if (adapter->RxRing.UnfinishedReceives) if (adapter->RxRing.UnfinishedReceives)
......
...@@ -541,19 +541,19 @@ void et131x_tx_timeout(struct net_device *netdev) ...@@ -541,19 +541,19 @@ 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);
tcb = etdev->tx_ring.CurrSendHead; tcb = etdev->tx_ring.send_head;
if (tcb != NULL) { if (tcb != NULL) {
tcb->Count++; tcb->count++;
if (tcb->Count > NIC_SEND_HANG_THRESHOLD) { if (tcb->count > NIC_SEND_HANG_THRESHOLD) {
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. tcb->WrIndex %x, Flags 0x%08x\n", "Send stuck - reset. tcb->WrIndex %x, Flags 0x%08x\n",
tcb->WrIndex, tcb->index,
tcb->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