Skip to content

Commit dd2baee

Browse files
Danielmachonkuba-moo
authored andcommitted
net: sparx5: add function for RGMII port check
The lan969x device contains two RGMII port interfaces, sitting at port 28 and 29. Add function: is_port_rgmii() to the match data ops, that checks if a given port is an RGMII port or not. For Sparx5, this function always returns false. Reviewed-by: Steen Hegelund <[email protected]> Reviewed-by: Horatiu Vultur <[email protected]> Tested-by: Robert Marko <[email protected]> Signed-off-by: Daniel Machon <[email protected]> Link: https://patch.msgid.link/20241220-sparx5-lan969x-switch-driver-4-v5-2-fa8ba5dff732@microchip.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c71b596 commit dd2baee

File tree

5 files changed

+13
-0
lines changed

5 files changed

+13
-0
lines changed

drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ static const struct sparx5_ops lan969x_ops = {
329329
.is_port_5g = &lan969x_port_is_5g,
330330
.is_port_10g = &lan969x_port_is_10g,
331331
.is_port_25g = &lan969x_port_is_25g,
332+
.is_port_rgmii = &lan969x_port_is_rgmii,
332333
.get_port_dev_index = &lan969x_port_dev_mapping,
333334
.get_port_dev_bit = &lan969x_get_dev_mode_bit,
334335
.get_hsch_max_group_rate = &lan969x_get_hsch_max_group_rate,

drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ static inline bool lan969x_port_is_25g(int portno)
5959
return false;
6060
}
6161

62+
static inline bool lan969x_port_is_rgmii(int portno)
63+
{
64+
return portno == 28 || portno == 29;
65+
}
66+
6267
/* lan969x_calendar.c */
6368
int lan969x_dsm_calendar_calc(struct sparx5 *sparx5, u32 taxi,
6469
struct sparx5_calendar_data *data);

drivers/net/ethernet/microchip/sparx5/sparx5_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ static const struct sparx5_ops sparx5_ops = {
10721072
.is_port_5g = &sparx5_port_is_5g,
10731073
.is_port_10g = &sparx5_port_is_10g,
10741074
.is_port_25g = &sparx5_port_is_25g,
1075+
.is_port_rgmii = &sparx5_port_is_rgmii,
10751076
.get_port_dev_index = &sparx5_port_dev_mapping,
10761077
.get_port_dev_bit = &sparx5_port_dev_mapping,
10771078
.get_hsch_max_group_rate = &sparx5_get_hsch_max_group_rate,

drivers/net/ethernet/microchip/sparx5/sparx5_main.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ struct sparx5_ops {
313313
bool (*is_port_5g)(int portno);
314314
bool (*is_port_10g)(int portno);
315315
bool (*is_port_25g)(int portno);
316+
bool (*is_port_rgmii)(int portno);
316317
u32 (*get_port_dev_index)(struct sparx5 *sparx5, int port);
317318
u32 (*get_port_dev_bit)(struct sparx5 *sparx5, int port);
318319
u32 (*get_hsch_max_group_rate)(int grp);

drivers/net/ethernet/microchip/sparx5/sparx5_port.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ static inline bool sparx5_port_is_25g(int portno)
4040
return portno >= 56 && portno <= 63;
4141
}
4242

43+
static inline bool sparx5_port_is_rgmii(int portno)
44+
{
45+
return false;
46+
}
47+
4348
static inline u32 sparx5_to_high_dev(struct sparx5 *sparx5, int port)
4449
{
4550
const struct sparx5_ops *ops = sparx5->data->ops;

0 commit comments

Comments
 (0)