Commit 604e603d authored by Diogo Ivo's avatar Diogo Ivo Committed by Paolo Abeni
Browse files

net: ti: icssg-prueth: Adjust the number of TX channels for SR1.0

As SR1.0 uses the current higher priority channel to send commands to
the firmware, take this into account when setting/getting the number
of channels to/from the user.

Based on the work of Roger Quadros in TI's 5.10 SDK [1].

[1]: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/?h=ti-linux-5.10.y



Co-developed-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: default avatarDiogo Ivo <diogo.ivo@siemens.com>
Reviewed-by: default avatarRoger Quadros <rogerq@kernel.org>
Reviewed-by: default avatarMD Danish Anwar <danishanwar@ti.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent 95c2e689
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -142,6 +142,9 @@ static int emac_set_channels(struct net_device *ndev,

	emac->tx_ch_num = ch->tx_count;

	if (emac->is_sr1)
		emac->tx_ch_num++;

	return 0;
}

@@ -152,8 +155,17 @@ static void emac_get_channels(struct net_device *ndev,

	ch->max_rx = 1;
	ch->max_tx = PRUETH_MAX_TX_QUEUES;

	/* Disable multiple TX channels due to timeouts
	 * when using more than one queue */
	if (emac->is_sr1)
		ch->max_tx = 1;

	ch->rx_count = 1;
	ch->tx_count = emac->tx_ch_num;

	if (emac->is_sr1)
		ch->tx_count--;
}

static const struct ethtool_rmon_hist_range emac_rmon_ranges[] = {