* @regs: Base address for the axienet_local device address space
* @dma_regs: Base address for the axidma device address space
* @dma_err_tasklet: Tasklet structure to process Axi DMA errors
+ * @tx_lock: Spin lock for tx path
* @tx_irq: Axidma TX IRQ number
* @rx_irq: Axidma RX IRQ number
* @phy_mode: Phy type to identify between MII/GMII/RGMII/SGMII/1000 Base-X
void __iomem *dma_regs;
struct tasklet_struct dma_err_tasklet;
+ spinlock_t tx_lock;
spinlock_t rx_lock; /* Spin lock */
struct napi_struct napi; /* NAPI Structure */
dma_addr_t tail_p;
struct axienet_local *lp = netdev_priv(ndev);
struct axidma_bd *cur_p;
+ unsigned long flags;
num_frag = skb_shinfo(skb)->nr_frags;
cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
+ spin_lock_irqsave(&lp->tx_lock, flags);
if (axienet_check_tx_bd_space(lp, num_frag)) {
if (!netif_queue_stopped(ndev))
netif_stop_queue(ndev);
+ spin_unlock_irqrestore(&lp->tx_lock, flags);
return NETDEV_TX_BUSY;
}
++lp->tx_bd_tail;
lp->tx_bd_tail %= TX_BD_NUM;
+ spin_unlock_irqrestore(&lp->tx_lock, flags);
+
return NETDEV_TX_OK;
}
goto free_netdev;
}
+ spin_lock_init(&lp->tx_lock);
spin_lock_init(&lp->rx_lock);
/* Retrieve the MAC address */