@@ -148,8 +148,10 @@ static int prueth_emac_start(struct prueth *prueth)
148148
149149 if (prueth -> is_switch_mode )
150150 firmwares = prueth -> icssg_switch_firmwares ;
151- else if (prueth -> is_hsr_offload_mode )
151+ else if (prueth -> is_hsr_offload_mode && HSR_V1 == prueth -> hsr_prp_version )
152152 firmwares = prueth -> icssg_hsr_firmwares ;
153+ else if (prueth -> is_hsr_offload_mode && PRP_V1 == prueth -> hsr_prp_version )
154+ firmwares = prueth -> icssg_prp_firmwares ;
153155 else
154156 firmwares = prueth -> icssg_emac_firmwares ;
155157
@@ -1527,6 +1529,7 @@ static int prueth_netdevice_event(struct notifier_block *unused,
15271529 struct netdev_notifier_changeupper_info * info ;
15281530 struct prueth_emac * emac = netdev_priv (ndev );
15291531 struct prueth * prueth = emac -> prueth ;
1532+ enum hsr_version hsr_ndev_version ;
15301533 int ret = NOTIFY_DONE ;
15311534
15321535 if (ndev -> netdev_ops != & emac_netdev_ops )
@@ -1538,6 +1541,11 @@ static int prueth_netdevice_event(struct notifier_block *unused,
15381541
15391542 if ((ndev -> features & NETIF_PRUETH_HSR_OFFLOAD_FEATURES ) &&
15401543 is_hsr_master (info -> upper_dev )) {
1544+ hsr_get_version (info -> upper_dev , & hsr_ndev_version );
1545+ if (hsr_ndev_version != HSR_V1 && hsr_ndev_version != PRP_V1 )
1546+ return - EOPNOTSUPP ;
1547+ prueth -> hsr_prp_version = hsr_ndev_version ;
1548+
15411549 if (info -> linking ) {
15421550 if (!prueth -> hsr_dev ) {
15431551 prueth -> hsr_dev = info -> upper_dev ;
@@ -1858,6 +1866,8 @@ static int prueth_probe(struct platform_device *pdev)
18581866 prueth -> icssg_switch_firmwares , "eth" , "sw" );
18591867 icssg_mode_firmware_names (dev , prueth -> icssg_emac_firmwares ,
18601868 prueth -> icssg_hsr_firmwares , "eth" , "hsr" );
1869+ icssg_mode_firmware_names (dev , prueth -> icssg_emac_firmwares ,
1870+ prueth -> icssg_prp_firmwares , "eth" , "prp" );
18611871
18621872 spin_lock_init (& prueth -> vtbl_lock );
18631873 spin_lock_init (& prueth -> stats_lock );
0 commit comments