1 .\" $NetBSD: radio.9,v 1.3 2002/01/02 02:15:42 wiz Exp $
2 .\" $OpenBSD: radio.9,v 1.2 2001/10/08 08:52:50 mpech Exp $
4 .\" Copyright (c) Maxim Tsyplakov <tm@oganer.net>
5 .\" All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
22 .\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23 .\" ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 .Nd interface between low and high level radio drivers
34 The radio device driver is divided into a high level,
35 hardware independent layer, and a low level hardware
37 The interface between these is the
42 int (*open)(void *, int, int, struct lwp *);
43 int (*close)(void *, int, int, struct lwp *);
44 int (*get_info)(void *, struct radio_info *);
45 int (*set_info)(void *, struct radio_info *);
46 int (*search)(void *, int);
50 The high level radio driver attaches to the low level driver
56 radio_attach_mi(rhwp, hdlp, dev)
57 struct radio_hw_if *rhwp;
64 struct is as shown above.
67 argument is a handle to some low level data structure.
68 It is sent as the first argument to all the functions in
70 when the high level driver calls them.
72 is the device struct for the hardware device.
76 are described in some more detail below.
78 int open (void *, int flags, int fmt, struct lwp *p);
80 Is called when the radio device is opened.
81 Returns 0 on success, otherwise an error code.
83 int close (void *, int flags, int fmt, struct lwp *p);
85 Is called when the radio device is closed.
86 Returns 0 on success, otherwise an error code.
88 int get_info (void *, struct radio_info *);
89 Fill the radio_info struct.
90 Returns 0 on success, otherwise an error code.
92 int set_info (void *, struct radio_info *);
93 Set values from the radio_info struct.
94 Returns 0 on success, otherwise an error code.
96 int search (void *, int);
97 Returns 0 on success, otherwise an error code.