xref: /freebsd-src/sys/dev/sfxge/common/mcdi_mon.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
13c838a9fSAndrew Rybchenko /*-
2929c7febSAndrew Rybchenko  * Copyright (c) 2009-2016 Solarflare Communications Inc.
33c838a9fSAndrew Rybchenko  * All rights reserved.
43c838a9fSAndrew Rybchenko  *
53c838a9fSAndrew Rybchenko  * Redistribution and use in source and binary forms, with or without
63c838a9fSAndrew Rybchenko  * modification, are permitted provided that the following conditions are met:
73c838a9fSAndrew Rybchenko  *
83c838a9fSAndrew Rybchenko  * 1. Redistributions of source code must retain the above copyright notice,
93c838a9fSAndrew Rybchenko  *    this list of conditions and the following disclaimer.
103c838a9fSAndrew Rybchenko  * 2. Redistributions in binary form must reproduce the above copyright notice,
113c838a9fSAndrew Rybchenko  *    this list of conditions and the following disclaimer in the documentation
123c838a9fSAndrew Rybchenko  *    and/or other materials provided with the distribution.
133c838a9fSAndrew Rybchenko  *
143c838a9fSAndrew Rybchenko  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
153c838a9fSAndrew Rybchenko  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
163c838a9fSAndrew Rybchenko  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
173c838a9fSAndrew Rybchenko  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
183c838a9fSAndrew Rybchenko  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
193c838a9fSAndrew Rybchenko  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
203c838a9fSAndrew Rybchenko  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
213c838a9fSAndrew Rybchenko  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
223c838a9fSAndrew Rybchenko  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
233c838a9fSAndrew Rybchenko  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
243c838a9fSAndrew Rybchenko  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
253c838a9fSAndrew Rybchenko  *
263c838a9fSAndrew Rybchenko  * The views and conclusions contained in the software and documentation are
273c838a9fSAndrew Rybchenko  * those of the authors and should not be interpreted as representing official
283c838a9fSAndrew Rybchenko  * policies, either expressed or implied, of the FreeBSD Project.
293c838a9fSAndrew Rybchenko  */
303c838a9fSAndrew Rybchenko 
313c838a9fSAndrew Rybchenko #ifndef _SYS_MCDI_MON_H
323c838a9fSAndrew Rybchenko #define	_SYS_MCDI_MON_H
333c838a9fSAndrew Rybchenko 
343c838a9fSAndrew Rybchenko #include "efx.h"
353c838a9fSAndrew Rybchenko 
363c838a9fSAndrew Rybchenko #ifdef	__cplusplus
373c838a9fSAndrew Rybchenko extern "C" {
383c838a9fSAndrew Rybchenko #endif
393c838a9fSAndrew Rybchenko 
403c838a9fSAndrew Rybchenko #if EFSYS_OPT_MON_MCDI
413c838a9fSAndrew Rybchenko 
423c838a9fSAndrew Rybchenko #if EFSYS_OPT_MON_STATS
433c838a9fSAndrew Rybchenko 
44460cb568SAndrew Rybchenko 	__checkReturn	efx_rc_t
453c838a9fSAndrew Rybchenko mcdi_mon_cfg_build(
463c838a9fSAndrew Rybchenko     __in		efx_nic_t *enp);
473c838a9fSAndrew Rybchenko 
483c838a9fSAndrew Rybchenko 			void
493c838a9fSAndrew Rybchenko mcdi_mon_cfg_free(
503c838a9fSAndrew Rybchenko 	__in		efx_nic_t *enp);
513c838a9fSAndrew Rybchenko 
52460cb568SAndrew Rybchenko extern	__checkReturn			efx_rc_t
533c838a9fSAndrew Rybchenko mcdi_mon_ev(
543c838a9fSAndrew Rybchenko 	__in				efx_nic_t *enp,
553c838a9fSAndrew Rybchenko 	__in				efx_qword_t *eqp,
563c838a9fSAndrew Rybchenko 	__out				efx_mon_stat_t *idp,
573c838a9fSAndrew Rybchenko 	__out				efx_mon_stat_value_t *valuep);
583c838a9fSAndrew Rybchenko 
59460cb568SAndrew Rybchenko extern	__checkReturn			efx_rc_t
603c838a9fSAndrew Rybchenko mcdi_mon_stats_update(
613c838a9fSAndrew Rybchenko 	__in				efx_nic_t *enp,
623c838a9fSAndrew Rybchenko 	__in				efsys_mem_t *esmp,
63536c03c2SAndrew Rybchenko 	__inout_ecount(EFX_MON_NSTATS)	efx_mon_stat_value_t *values);
643c838a9fSAndrew Rybchenko 
65*b4d3f02eSAndrew Rybchenko extern	__checkReturn			efx_rc_t
66*b4d3f02eSAndrew Rybchenko mcdi_mon_limits_update(
67*b4d3f02eSAndrew Rybchenko 	__in				efx_nic_t *enp,
68*b4d3f02eSAndrew Rybchenko 	__inout_ecount(EFX_MON_NSTATS)	efx_mon_stat_limits_t *values);
69*b4d3f02eSAndrew Rybchenko 
703c838a9fSAndrew Rybchenko #endif	/* EFSYS_OPT_MON_STATS */
713c838a9fSAndrew Rybchenko 
723c838a9fSAndrew Rybchenko #endif /* EFSYS_OPT_MON_MCDI */
733c838a9fSAndrew Rybchenko 
743c838a9fSAndrew Rybchenko #ifdef	__cplusplus
753c838a9fSAndrew Rybchenko }
763c838a9fSAndrew Rybchenko #endif
773c838a9fSAndrew Rybchenko 
783c838a9fSAndrew Rybchenko #endif	/* _SYS_MCDI_MON_H */
79