1*0d6a2fdeSmiod /* $OpenBSD: radio_if.h,v 1.4 2022/03/21 19:22:40 miod Exp $ */ 20984a33eSmickey /* $RuOBSD: radio_if.h,v 1.6 2001/10/18 16:51:36 pva Exp $ */ 3cee53fdcSgluk 4cee53fdcSgluk /* 5cee53fdcSgluk * Copyright (c) 2001 Maxim Tsyplakov <tm@oganer.net> 6cee53fdcSgluk * All rights reserved. 7cee53fdcSgluk * 8cee53fdcSgluk * Redistribution and use in source and binary forms, with or without 9cee53fdcSgluk * modification, are permitted provided that the following conditions 10cee53fdcSgluk * are met: 11cee53fdcSgluk * 1. Redistributions of source code must retain the above copyright 12cee53fdcSgluk * notice, this list of conditions and the following disclaimer. 13cee53fdcSgluk * 2. Redistributions in binary form must reproduce the above copyright 14cee53fdcSgluk * notice, this list of conditions and the following disclaimer in the 15cee53fdcSgluk * documentation and/or other materials provided with the distribution. 16cee53fdcSgluk * 17cee53fdcSgluk * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18cee53fdcSgluk * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19cee53fdcSgluk * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20cee53fdcSgluk * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21cee53fdcSgluk * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22cee53fdcSgluk * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23cee53fdcSgluk * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24cee53fdcSgluk * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25cee53fdcSgluk * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26cee53fdcSgluk * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27cee53fdcSgluk */ 28cee53fdcSgluk 29cee53fdcSgluk #ifndef _SYS_DEV_RADIO_IF_H 30cee53fdcSgluk #define _SYS_DEV_RADIO_IF_H 31cee53fdcSgluk 32cee53fdcSgluk /* 33cee53fdcSgluk * Generic interface to hardware driver 34cee53fdcSgluk */ 35cee53fdcSgluk 36cee53fdcSgluk #define RADIOUNIT(x) (minor(x)) 37cee53fdcSgluk 38cee53fdcSgluk struct radio_hw_if { 39cee53fdcSgluk /* open hardware */ 400984a33eSmickey int (*open)(void *, int, int, struct proc *); 41cee53fdcSgluk 42cee53fdcSgluk /* close hardware */ 430984a33eSmickey int (*close)(void *, int, int, struct proc *); 44cee53fdcSgluk 450984a33eSmickey int (*get_info)(void *, struct radio_info *); 460984a33eSmickey int (*set_info)(void *, struct radio_info *); 470984a33eSmickey int (*search)(void *, int); 48cee53fdcSgluk }; 49cee53fdcSgluk 50*0d6a2fdeSmiod struct device *radio_attach_mi(const struct radio_hw_if *, void *, 51*0d6a2fdeSmiod struct device *); 52cee53fdcSgluk 53cee53fdcSgluk #endif /* _SYS_DEV_RADIO_IF_H */ 54