]> git.baikalelectronics.ru Git - kernel.git/commit
net: enetc: create a common enetc_pf_to_port helper
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 16 Apr 2021 23:42:21 +0000 (02:42 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Apr 2021 22:31:45 +0000 (15:31 -0700)
commitcf73ed9d7458d33defd320d28f261d1316e7355c
tree5593cbcbca0e62534834f7cfd7acb11df20e91e4
parentb3b36151db44c12587a67d32a363b91bd83ef2f7
net: enetc: create a common enetc_pf_to_port helper

Even though ENETC interfaces are exposed as individual PCIe PFs with
their own driver instances, the ENETC is still fundamentally a
multi-port Ethernet controller, and some parts of the IP take a port
number (as can be seen in the PSFP implementation).

Create a common helper that can be used outside of the TSN code for
retrieving the ENETC port number based on the PF number. This is only
correct for LS1028A, the only Linux-capable instantiation of ENETC thus
far.

Note that ENETC port 3 is PF 6. The TSN code did not care about this
because ENETC port 3 does not support TSN, so the wrong mapping done by
enetc_get_port for PF 6 could have never been hit.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.h
drivers/net/ethernet/freescale/enetc/enetc_qos.c