xref: /linux/drivers/net/ethernet/mscc/ocelot_police.h (revision c9a7fe1238e5fb3d26cb541a12083f2e1f3b2356)
12c1d029aSJoergen Andreasen /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
22c1d029aSJoergen Andreasen /* Microsemi Ocelot Switch driver
32c1d029aSJoergen Andreasen  *
42c1d029aSJoergen Andreasen  * Copyright (c) 2019 Microsemi Corporation
52c1d029aSJoergen Andreasen  */
62c1d029aSJoergen Andreasen 
72c1d029aSJoergen Andreasen #ifndef _MSCC_OCELOT_POLICE_H_
82c1d029aSJoergen Andreasen #define _MSCC_OCELOT_POLICE_H_
92c1d029aSJoergen Andreasen 
102c1d029aSJoergen Andreasen #include "ocelot.h"
112c1d029aSJoergen Andreasen 
122c1d029aSJoergen Andreasen struct ocelot_policer {
132c1d029aSJoergen Andreasen 	u32 rate; /* kilobit per second */
142c1d029aSJoergen Andreasen 	u32 burst; /* bytes */
152c1d029aSJoergen Andreasen };
162c1d029aSJoergen Andreasen 
17f270dbfaSVladimir Oltean int ocelot_port_policer_add(struct ocelot *ocelot, int port,
182c1d029aSJoergen Andreasen 			    struct ocelot_policer *pol);
192c1d029aSJoergen Andreasen 
20f270dbfaSVladimir Oltean int ocelot_port_policer_del(struct ocelot *ocelot, int port);
212c1d029aSJoergen Andreasen 
22*c9a7fe12SXiaoliang Yang int ocelot_ace_policer_add(struct ocelot *ocelot, u32 pol_ix,
23*c9a7fe12SXiaoliang Yang 			   struct ocelot_policer *pol);
24*c9a7fe12SXiaoliang Yang 
25*c9a7fe12SXiaoliang Yang int ocelot_ace_policer_del(struct ocelot *ocelot, u32 pol_ix);
26*c9a7fe12SXiaoliang Yang 
272c1d029aSJoergen Andreasen #endif /* _MSCC_OCELOT_POLICE_H_ */
28