xref: /freebsd/sys/sys/iov_schema.h (revision c57c26179033f64c2011a2d2a904ee3fa62e826a)
11191f715SRyan Stone /*-
24d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
39b10f59aSPedro F. Giffuni  *
4faf139ccSRyan Stone  * Copyright (c) 2014-2015 Sandvine Inc.
51191f715SRyan Stone  * All rights reserved.
61191f715SRyan Stone  *
71191f715SRyan Stone  * Redistribution and use in source and binary forms, with or without
81191f715SRyan Stone  * modification, are permitted provided that the following conditions
91191f715SRyan Stone  * are met:
101191f715SRyan Stone  * 1. Redistributions of source code must retain the above copyright
111191f715SRyan Stone  *    notice, this list of conditions and the following disclaimer.
121191f715SRyan Stone  * 2. Redistributions in binary form must reproduce the above copyright
131191f715SRyan Stone  *    notice, this list of conditions and the following disclaimer in the
141191f715SRyan Stone  *    documentation and/or other materials provided with the distribution.
151191f715SRyan Stone  *
161191f715SRyan Stone  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
171191f715SRyan Stone  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
181191f715SRyan Stone  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
191191f715SRyan Stone  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
201191f715SRyan Stone  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
211191f715SRyan Stone  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
221191f715SRyan Stone  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
231191f715SRyan Stone  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
241191f715SRyan Stone  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
251191f715SRyan Stone  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
261191f715SRyan Stone  * SUCH DAMAGE.
271191f715SRyan Stone  */
281191f715SRyan Stone 
291191f715SRyan Stone #ifndef _SYS_IOV_SCHEMA_H_
301191f715SRyan Stone #define _SYS_IOV_SCHEMA_H_
311191f715SRyan Stone 
321191f715SRyan Stone #define	IOV_SCHEMA_HASDEFAULT	(1 << 0)
331191f715SRyan Stone #define	IOV_SCHEMA_REQUIRED	(1 << 1)
341191f715SRyan Stone 
351191f715SRyan Stone nvlist_t	*pci_iov_schema_alloc_node(void);
361191f715SRyan Stone 
371191f715SRyan Stone void	pci_iov_schema_add_bool(nvlist_t *schema, const char *name,
381191f715SRyan Stone 	    uint32_t flags,  int defaultVal);
391191f715SRyan Stone void	pci_iov_schema_add_string(nvlist_t *schema, const char *name,
401191f715SRyan Stone 	    uint32_t flags, const char *defaultVal);
411191f715SRyan Stone void	pci_iov_schema_add_uint8(nvlist_t *schema, const char *name,
421191f715SRyan Stone 	    uint32_t flags, uint8_t defaultVal);
431191f715SRyan Stone void	pci_iov_schema_add_uint16(nvlist_t *schema, const char *name,
441191f715SRyan Stone 	    uint32_t flags, uint16_t defaultVal);
451191f715SRyan Stone void	pci_iov_schema_add_uint32(nvlist_t *schema, const char *name,
461191f715SRyan Stone 	    uint32_t flags, uint32_t defaultVal);
471191f715SRyan Stone void	pci_iov_schema_add_uint64(nvlist_t *schema, const char *name,
481191f715SRyan Stone 	    uint32_t flags, uint64_t defaultVal);
491191f715SRyan Stone void	pci_iov_schema_add_unicast_mac(nvlist_t *schema, const char *name,
501191f715SRyan Stone 	    uint32_t flags, const uint8_t * defaultVal);
51*c57c2617SKristof Provost void	pci_iov_schema_add_vlan(nvlist_t *schema, const char *name,
52*c57c2617SKristof Provost 	    uint32_t flags, const uint16_t defaultVal);
531191f715SRyan Stone #endif
54