RADIO(9)                     OpenBSD Kernel Manual                    RADIO(9)

NAME
     radio - interface between low and high level radio drivers

DESCRIPTION
     The radio device driver is divided into a high level, hardware indepen-
     dent layer, and a low level hardware dependent layer.  The interface be-
     tween these is the radio_hw_if structure.

     struct radio_hw_if {
             int     *open(dev_t, int, int, struct proc *);
             void    *close(dev_t, int, int, struct proc *);
             int     *ioctl(dev_t, u_long, caddr_t, int, struct proc *);
     };

     The high level radio driver attaches to the low level driver when the
     latter calls radio_attach_mi. This call should be

         void
         radio_attach_mi(rhwp, hdlp, dev)
             struct radio_hw_if *rhwp;
             void *hdlp;
             struct device *dev;

     The radio_hw_if struct is as shown above.  The hdlp argument is a handle
     to some low level data structure.  It is reserved field for future usage,
     and actually not used in any low-level driver functions.  radio_hw_if
     when the high level driver calls them.  dev is the device struct for the
     hardware device.

     The fields of radio_hw_if are described in some more detail below.

     int open (dev_t dev, int flags, int fmt, struct proc *p);
       Is called when the radio device is opened.
       Returns 0 on success, otherwise an error code.

     int close (dev_t dev, int flags, int fmt, struct proc *p);
       Is called when the radio device is closed.
       Returns 0 on success, otherwise an error code.

     int ioctl (dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p);
       Is ioctl requests handler function.
       Returns 0 on success, otherwise an error code.

SEE ALSO
     radio(4)

OpenBSD 3.0                   September 29, 2001                             1
