diff mbox series

[net-next,v1,1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4

Message ID 20240704141348.3947232-1-o.rempel@pengutronix.de (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v1,1/1] net: dsa: microchip: lan9371/2: update MAC capabilities for port 4 | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 839 this patch: 839
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 9 of 9 maintainers
netdev/build_clang success Errors and warnings before: 846 this patch: 846
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 846 this patch: 846
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-07-05--06-00 (tests: 695)

Commit Message

Oleksij Rempel July 4, 2024, 2:13 p.m. UTC
Set proper MAC capabilities for port 4 on LAN9371 and LAN9372 switches with
integrated 100BaseTX PHY.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/dsa/microchip/lan937x_main.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Florian Fainelli July 4, 2024, 2:21 p.m. UTC | #1
On 7/4/2024 3:13 PM, Oleksij Rempel wrote:
> Set proper MAC capabilities for port 4 on LAN9371 and LAN9372 switches with
> integrated 100BaseTX PHY.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>

Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Arun Ramadoss July 5, 2024, 2:38 a.m. UTC | #2
Hi Oleksij,
On Thu, 2024-07-04 at 16:13 +0200, Oleksij Rempel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> Set proper MAC capabilities for port 4 on LAN9371 and LAN9372
> switches with
> integrated 100BaseTX PHY.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/net/dsa/microchip/lan937x_main.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/dsa/microchip/lan937x_main.c
> b/drivers/net/dsa/microchip/lan937x_main.c
> index 83ac33fede3f5..44911bc7cea1d 100644
> --- a/drivers/net/dsa/microchip/lan937x_main.c
> +++ b/drivers/net/dsa/microchip/lan937x_main.c
> @@ -324,6 +324,11 @@ void lan937x_phylink_get_caps(struct ksz_device
> *dev, int port,
>                 /* MII/RMII/RGMII ports */
>                 config->mac_capabilities |= MAC_ASYM_PAUSE |
> MAC_SYM_PAUSE |
>                                             MAC_100HD | MAC_10 |
> MAC_1000FD;
> +       } else if ((dev->info->chip_id == LAN9371_CHIP_ID ||
> +                   dev->info->chip_id == LAN9372_CHIP_ID) &&
> +                  port == KSZ_PORT_4) {

nitpick:
If you are going to add many features regarding this Tx Phy, then it
would be good to have wrapper function to find out whether it is Tx phy
and set the capabilities accordingly like (bool is_lan937x_tx_phy( int
chipid, int port))
Already you added the same snippet for lan937x_vphy_ind_addr_wr( ).



> +               config->mac_capabilities |= MAC_ASYM_PAUSE |
> MAC_SYM_PAUSE |
> +                                           MAC_100HD | MAC_10;
>         }
>  }
> 
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
index 83ac33fede3f5..44911bc7cea1d 100644
--- a/drivers/net/dsa/microchip/lan937x_main.c
+++ b/drivers/net/dsa/microchip/lan937x_main.c
@@ -324,6 +324,11 @@  void lan937x_phylink_get_caps(struct ksz_device *dev, int port,
 		/* MII/RMII/RGMII ports */
 		config->mac_capabilities |= MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
 					    MAC_100HD | MAC_10 | MAC_1000FD;
+	} else if ((dev->info->chip_id == LAN9371_CHIP_ID ||
+		    dev->info->chip_id == LAN9372_CHIP_ID) &&
+		   port == KSZ_PORT_4) {
+		config->mac_capabilities |= MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
+					    MAC_100HD | MAC_10;
 	}
 }