@@ -492,6 +492,36 @@ static int icssg_prueth_del_mcast(struct net_device *ndev, const u8 *addr)
492
492
return 0 ;
493
493
}
494
494
495
+ static int icssg_prueth_hsr_add_mcast (struct net_device * ndev , const u8 * addr )
496
+ {
497
+ struct prueth_emac * emac = netdev_priv (ndev );
498
+ struct prueth * prueth = emac -> prueth ;
499
+
500
+ icssg_fdb_add_del (emac , addr , prueth -> default_vlan ,
501
+ ICSSG_FDB_ENTRY_P0_MEMBERSHIP |
502
+ ICSSG_FDB_ENTRY_P1_MEMBERSHIP |
503
+ ICSSG_FDB_ENTRY_P2_MEMBERSHIP |
504
+ ICSSG_FDB_ENTRY_BLOCK , true);
505
+
506
+ icssg_vtbl_modify (emac , emac -> port_vlan , BIT (emac -> port_id ),
507
+ BIT (emac -> port_id ), true);
508
+ return 0 ;
509
+ }
510
+
511
+ static int icssg_prueth_hsr_del_mcast (struct net_device * ndev , const u8 * addr )
512
+ {
513
+ struct prueth_emac * emac = netdev_priv (ndev );
514
+ struct prueth * prueth = emac -> prueth ;
515
+
516
+ icssg_fdb_add_del (emac , addr , prueth -> default_vlan ,
517
+ ICSSG_FDB_ENTRY_P0_MEMBERSHIP |
518
+ ICSSG_FDB_ENTRY_P1_MEMBERSHIP |
519
+ ICSSG_FDB_ENTRY_P2_MEMBERSHIP |
520
+ ICSSG_FDB_ENTRY_BLOCK , false);
521
+
522
+ return 0 ;
523
+ }
524
+
495
525
/**
496
526
* emac_ndo_open - EMAC device open
497
527
* @ndev: network adapter device
@@ -652,7 +682,10 @@ static int emac_ndo_stop(struct net_device *ndev)
652
682
653
683
icssg_class_disable (prueth -> miig_rt , prueth_emac_slice (emac ));
654
684
655
- __dev_mc_unsync (ndev , icssg_prueth_del_mcast );
685
+ if (emac -> prueth -> is_hsr_offload_mode )
686
+ __dev_mc_unsync (ndev , icssg_prueth_hsr_del_mcast );
687
+ else
688
+ __dev_mc_unsync (ndev , icssg_prueth_del_mcast );
656
689
657
690
atomic_set (& emac -> tdown_cnt , emac -> tx_ch_num );
658
691
/* ensure new tdown_cnt value is visible */
@@ -730,7 +763,12 @@ static void emac_ndo_set_rx_mode_work(struct work_struct *work)
730
763
return ;
731
764
}
732
765
733
- __dev_mc_sync (ndev , icssg_prueth_add_mcast , icssg_prueth_del_mcast );
766
+ if (emac -> prueth -> is_hsr_offload_mode )
767
+ __dev_mc_sync (ndev , icssg_prueth_hsr_add_mcast ,
768
+ icssg_prueth_hsr_del_mcast );
769
+ else
770
+ __dev_mc_sync (ndev , icssg_prueth_add_mcast ,
771
+ icssg_prueth_del_mcast );
734
772
}
735
773
736
774
/**
0 commit comments