mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-21 04:42:25 +01:00
realtek: eth: remove family usage in xmit path
Get away with another family check. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21999 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
47d0773d7d
commit
22db7540b7
2 changed files with 9 additions and 5 deletions
|
|
@ -31,6 +31,7 @@ int rtl83xx_setup_tc(struct net_device *dev, enum tc_setup_type type, void *type
|
|||
#define RTETH_RX_RINGS 2
|
||||
#define RTETH_TX_RING_SIZE 16
|
||||
#define RTETH_TX_RINGS 2
|
||||
#define RTETH_TX_TRIGGER 0x16
|
||||
|
||||
#define NOTIFY_EVENTS 10
|
||||
#define NOTIFY_BLOCKS 10
|
||||
|
|
@ -1041,11 +1042,9 @@ static int rteth_start_xmit(struct sk_buff *skb, struct net_device *netdev)
|
|||
}
|
||||
}
|
||||
|
||||
/* Tell switch to send data */
|
||||
if (ctrl->r->family_id == RTL9310_FAMILY_ID || ctrl->r->family_id == RTL9300_FAMILY_ID)
|
||||
sw_w32_mask(0, BIT(2 + ring), ctrl->r->dma_if_ctrl);
|
||||
else
|
||||
sw_w32_mask(0, TX_DO, ctrl->r->dma_if_ctrl);
|
||||
/* issue SoC independent send for 1 or 2 triggers with some bit vodoo */
|
||||
sw_w32_mask(0, (RTETH_TX_TRIGGER >> ring) & ctrl->r->tx_trigger_mask,
|
||||
ctrl->r->dma_if_ctrl);
|
||||
|
||||
netdev->stats.tx_packets++;
|
||||
netdev->stats.tx_bytes += len;
|
||||
|
|
@ -1439,6 +1438,7 @@ static const struct rteth_config rteth_838x_cfg = {
|
|||
.family_id = RTL8380_FAMILY_ID,
|
||||
.cpu_port = RTETH_838X_CPU_PORT,
|
||||
.rx_rings = 8,
|
||||
.tx_trigger_mask = BIT(1),
|
||||
.net_irq = rteth_83xx_net_irq,
|
||||
.mac_l2_port_ctrl = RTETH_838X_MAC_L2_PORT_CTRL,
|
||||
.qm_pkt2cpu_intpri_map = RTETH_838X_QM_PKT2CPU_INTPRI_MAP,
|
||||
|
|
@ -1486,6 +1486,7 @@ static const struct rteth_config rteth_839x_cfg = {
|
|||
.family_id = RTL8390_FAMILY_ID,
|
||||
.cpu_port = RTETH_839X_CPU_PORT,
|
||||
.rx_rings = 8,
|
||||
.tx_trigger_mask = BIT(1),
|
||||
.net_irq = rteth_83xx_net_irq,
|
||||
.mac_l2_port_ctrl = RTETH_839X_MAC_L2_PORT_CTRL,
|
||||
.qm_pkt2cpu_intpri_map = RTETH_839X_QM_PKT2CPU_INTPRI_MAP,
|
||||
|
|
@ -1533,6 +1534,7 @@ static const struct rteth_config rteth_930x_cfg = {
|
|||
.family_id = RTL9300_FAMILY_ID,
|
||||
.cpu_port = RTETH_930X_CPU_PORT,
|
||||
.rx_rings = 32,
|
||||
.tx_trigger_mask = GENMASK(3, 2),
|
||||
.net_irq = rteth_93xx_net_irq,
|
||||
.mac_l2_port_ctrl = RTETH_930X_MAC_L2_PORT_CTRL,
|
||||
.qm_rsn2cpuqid_ctrl = RTETH_930X_QM_RSN2CPUQID_CTRL_0,
|
||||
|
|
@ -1584,6 +1586,7 @@ static const struct rteth_config rteth_931x_cfg = {
|
|||
.family_id = RTL9310_FAMILY_ID,
|
||||
.cpu_port = RTETH_931X_CPU_PORT,
|
||||
.rx_rings = 32,
|
||||
.tx_trigger_mask = GENMASK(3, 2),
|
||||
.net_irq = rteth_93xx_net_irq,
|
||||
.mac_l2_port_ctrl = RTETH_931X_MAC_L2_PORT_CTRL,
|
||||
.qm_rsn2cpuqid_ctrl = RTETH_931X_QM_RSN2CPUQID_CTRL_0,
|
||||
|
|
|
|||
|
|
@ -422,6 +422,7 @@ struct rteth_config {
|
|||
int family_id;
|
||||
int cpu_port;
|
||||
int rx_rings;
|
||||
int tx_trigger_mask;
|
||||
irqreturn_t (*net_irq)(int irq, void *dev_id);
|
||||
int mac_l2_port_ctrl;
|
||||
int qm_pkt2cpu_intpri_map;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue