@@ -492,6 +492,36 @@ static int icssg_prueth_del_mcast(struct net_device *ndev, const u8 *addr)
492492 return 0 ;
493493}
494494
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+
495525/**
496526 * emac_ndo_open - EMAC device open
497527 * @ndev: network adapter device
@@ -652,7 +682,10 @@ static int emac_ndo_stop(struct net_device *ndev)
652682
653683 icssg_class_disable (prueth -> miig_rt , prueth_emac_slice (emac ));
654684
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 );
656689
657690 atomic_set (& emac -> tdown_cnt , emac -> tx_ch_num );
658691 /* ensure new tdown_cnt value is visible */
@@ -730,7 +763,12 @@ static void emac_ndo_set_rx_mode_work(struct work_struct *work)
730763 return ;
731764 }
732765
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 );
734772}
735773
736774/**
0 commit comments