@@ -99,6 +99,8 @@ struct mlxsw_sp_fid_ops {
99
99
const struct mlxsw_sp_flood_table * flood_table );
100
100
int (* pgt_size )(const struct mlxsw_sp_fid_family * fid_family ,
101
101
u16 * p_pgt_size );
102
+ u16 (* fid_mid )(const struct mlxsw_sp_fid * fid ,
103
+ const struct mlxsw_sp_flood_table * flood_table );
102
104
};
103
105
104
106
struct mlxsw_sp_fid_family {
@@ -345,12 +347,11 @@ mlxsw_sp_fid_pgt_base_ctl(const struct mlxsw_sp_fid_family *fid_family,
345
347
}
346
348
347
349
static u16
348
- mlxsw_sp_fid_flood_table_mid (const struct mlxsw_sp_fid_family * fid_family ,
349
- const struct mlxsw_sp_flood_table * flood_table ,
350
- u16 fid_offset )
350
+ mlxsw_sp_fid_fid_mid_ctl (const struct mlxsw_sp_fid * fid ,
351
+ const struct mlxsw_sp_flood_table * flood_table )
351
352
{
352
- return mlxsw_sp_fid_pgt_base_ctl (fid_family , flood_table ) +
353
- fid_offset ;
353
+ return mlxsw_sp_fid_pgt_base_ctl (fid -> fid_family , flood_table ) +
354
+ fid -> fid_offset ;
354
355
}
355
356
356
357
int mlxsw_sp_fid_flood_set (struct mlxsw_sp_fid * fid ,
@@ -368,8 +369,7 @@ int mlxsw_sp_fid_flood_set(struct mlxsw_sp_fid *fid,
368
369
if (!flood_table )
369
370
return - ESRCH ;
370
371
371
- mid_index = mlxsw_sp_fid_flood_table_mid (fid_family , flood_table ,
372
- fid -> fid_offset );
372
+ mid_index = fid_family -> ops -> fid_mid (fid , flood_table );
373
373
return mlxsw_sp_pgt_entry_port_set (fid_family -> mlxsw_sp , mid_index ,
374
374
fid -> fid_index , local_port , member );
375
375
}
@@ -1129,6 +1129,7 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021d_ops_ctl = {
1129
1129
.vid_to_fid_rif_update = mlxsw_sp_fid_8021d_vid_to_fid_rif_update ,
1130
1130
.flood_table_init = mlxsw_sp_fid_flood_table_init_ctl ,
1131
1131
.pgt_size = mlxsw_sp_fid_8021d_pgt_size ,
1132
+ .fid_mid = mlxsw_sp_fid_fid_mid_ctl ,
1132
1133
};
1133
1134
1134
1135
#define MLXSW_SP_FID_8021Q_MAX (VLAN_N_VID - 2)
@@ -1472,6 +1473,7 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_8021q_ops_ctl = {
1472
1473
.vid_to_fid_rif_update = mlxsw_sp_fid_8021q_vid_to_fid_rif_update ,
1473
1474
.flood_table_init = mlxsw_sp_fid_flood_table_init_ctl ,
1474
1475
.pgt_size = mlxsw_sp_fid_8021d_pgt_size ,
1476
+ .fid_mid = mlxsw_sp_fid_fid_mid_ctl ,
1475
1477
};
1476
1478
1477
1479
/* There are 4K-2 802.1Q FIDs */
0 commit comments