Lines Matching refs:sparx5
10 static int sparx5_vlant_set_mask(struct sparx5 *sparx5, u16 vid) in sparx5_vlant_set_mask() argument
15 bitmap_to_arr32(mask, sparx5->vlan_mask[vid], SPX5_PORTS); in sparx5_vlant_set_mask()
18 spx5_wr(mask[0], sparx5, ANA_L3_VLAN_MASK_CFG(vid)); in sparx5_vlant_set_mask()
19 spx5_wr(mask[1], sparx5, ANA_L3_VLAN_MASK_CFG1(vid)); in sparx5_vlant_set_mask()
20 spx5_wr(mask[2], sparx5, ANA_L3_VLAN_MASK_CFG2(vid)); in sparx5_vlant_set_mask()
25 void sparx5_vlan_init(struct sparx5 *sparx5) in sparx5_vlan_init() argument
31 sparx5, in sparx5_vlan_init()
38 sparx5, in sparx5_vlan_init()
42 void sparx5_vlan_port_setup(struct sparx5 *sparx5, int portno) in sparx5_vlan_port_setup() argument
44 struct sparx5_port *port = sparx5->ports[portno]; in sparx5_vlan_port_setup()
51 sparx5, in sparx5_vlan_port_setup()
58 struct sparx5 *sparx5 = port->sparx5; in sparx5_vlan_vid_add() local
73 set_bit(port->portno, sparx5->vlan_mask[vid]); in sparx5_vlan_vid_add()
74 ret = sparx5_vlant_set_mask(sparx5, vid); in sparx5_vlan_vid_add()
82 sparx5_vlan_port_apply(sparx5, port); in sparx5_vlan_vid_add()
89 struct sparx5 *sparx5 = port->sparx5; in sparx5_vlan_vid_del() local
100 clear_bit(port->portno, sparx5->vlan_mask[vid]); in sparx5_vlan_vid_del()
101 ret = sparx5_vlant_set_mask(sparx5, vid); in sparx5_vlan_vid_del()
113 sparx5_vlan_port_apply(sparx5, port); in sparx5_vlan_vid_del()
120 struct sparx5 *sparx5 = port->sparx5; in sparx5_pgid_update_mask() local
127 spx5_rmw(val, mask, sparx5, ANA_AC_PGID_CFG(pgid)); in sparx5_pgid_update_mask()
131 spx5_rmw(val, mask, sparx5, ANA_AC_PGID_CFG1(pgid)); in sparx5_pgid_update_mask()
135 spx5_rmw(val, mask, sparx5, ANA_AC_PGID_CFG2(pgid)); in sparx5_pgid_update_mask()
141 void sparx5_pgid_clear(struct sparx5 *spx5, int pgid) in sparx5_pgid_clear()
148 void sparx5_pgid_read_mask(struct sparx5 *spx5, int pgid, u32 portmask[3]) in sparx5_pgid_read_mask()
155 void sparx5_update_fwd(struct sparx5 *sparx5) in sparx5_update_fwd() argument
162 bitmap_to_arr32(mask, sparx5->bridge_fwd_mask, SPX5_PORTS); in sparx5_update_fwd()
166 spx5_wr(mask[0], sparx5, ANA_AC_PGID_CFG(port)); in sparx5_update_fwd()
167 spx5_wr(mask[1], sparx5, ANA_AC_PGID_CFG1(port)); in sparx5_update_fwd()
168 spx5_wr(mask[2], sparx5, ANA_AC_PGID_CFG2(port)); in sparx5_update_fwd()
173 if (test_bit(port, sparx5->bridge_fwd_mask)) { in sparx5_update_fwd()
175 bitmap_copy(workmask, sparx5->bridge_fwd_mask, SPX5_PORTS); in sparx5_update_fwd()
178 spx5_wr(mask[0], sparx5, ANA_AC_SRC_CFG(port)); in sparx5_update_fwd()
179 spx5_wr(mask[1], sparx5, ANA_AC_SRC_CFG1(port)); in sparx5_update_fwd()
180 spx5_wr(mask[2], sparx5, ANA_AC_SRC_CFG2(port)); in sparx5_update_fwd()
182 spx5_wr(0, sparx5, ANA_AC_SRC_CFG(port)); in sparx5_update_fwd()
183 spx5_wr(0, sparx5, ANA_AC_SRC_CFG1(port)); in sparx5_update_fwd()
184 spx5_wr(0, sparx5, ANA_AC_SRC_CFG2(port)); in sparx5_update_fwd()
189 bitmap_and(workmask, sparx5->bridge_fwd_mask, in sparx5_update_fwd()
190 sparx5->bridge_lrn_mask, SPX5_PORTS); in sparx5_update_fwd()
194 spx5_wr(mask[0], sparx5, ANA_L2_AUTO_LRN_CFG); in sparx5_update_fwd()
195 spx5_wr(mask[1], sparx5, ANA_L2_AUTO_LRN_CFG1); in sparx5_update_fwd()
196 spx5_wr(mask[2], sparx5, ANA_L2_AUTO_LRN_CFG2); in sparx5_update_fwd()
199 void sparx5_vlan_port_apply(struct sparx5 *sparx5, in sparx5_vlan_port_apply() argument
209 spx5_wr(val, sparx5, ANA_CL_VLAN_CTRL(port->portno)); in sparx5_vlan_port_apply()
219 spx5_wr(val, sparx5, in sparx5_vlan_port_apply()
231 spx5_wr(val, sparx5, REW_TAG_CTRL(port->portno)); in sparx5_vlan_port_apply()
236 sparx5, in sparx5_vlan_port_apply()