Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

radio(9) [netbsd man page]

RADIO(9)						   BSD Kernel Developer's 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 independent layer, and a low level hardware dependent layer. The interface between these is the radio_hw_if structure. struct radio_hw_if { int (*open)(void *, int, int, struct lwp *); int (*close)(void *, int, int, struct lwp *); int (*get_info)(void *, struct radio_info *); int (*set_info)(void *, struct radio_info *); int (*search)(void *, int); }; 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 sent as the first argument to all the functions in 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 (void *, int flags, int fmt, struct lwp *p); Optional. Is called when the radio device is opened. Returns 0 on success, otherwise an error code. int close (void *, int flags, int fmt, struct lwp *p); Optional. Is called when the radio device is closed. Returns 0 on success, otherwise an error code. int get_info (void *, struct radio_info *); Fill the radio_info struct. Returns 0 on success, otherwise an error code. int set_info (void *, struct radio_info *); Set values from the radio_info struct. Returns 0 on success, otherwise an error code. int search (void *, int); Returns 0 on success, otherwise an error code. SEE ALSO
radio(4) BSD
December 20, 2005 BSD

Check Out this Related Man Page

DOFILEREAD(9)						   BSD Kernel Developer's Manual					     DOFILEREAD(9)

NAME
dofileread, dofilereadv, dofilewrite, dofilewritev -- high-level file operations SYNOPSIS
#include <sys/file.h> int dofileread(struct lwp *l, int fd, struct file *fp, void *buf, size_t nbyte, off_t *offset, int flags, register_t *retval); int dofilewrite(struct lwp *l, int fd, struct file *fp, const void *buf, size_t nbyte, off_t *offset, int flags, register_t *retval); int dofilereadv(struct lwp *l, int fd, struct file *fp, const struct iovec *iovp, int iovcnt, off_t *offset, int flags, register_t *retval); int dofilewritev(struct lwp *l, int fd, struct file *fp, const struct iovec *iovp, int iovcnt, off_t *offset, int flags, register_t *retval); DESCRIPTION
The functions implement the underlying functionality of the read(2), write(2), readv(2), and writev(2) system calls. They are also used throughout the kernel as high-level access routines for file I/O. The dofileread() function attempts to read nbytes of data from the object referenced by file entry fp into the buffer pointed to by buf. The dofilewrite() function attempts to write nbytes of data to the object referenced by file entry fp from the buffer pointed to by buf. The dofilereadv() and dofilewritev() functions perform the same operations, but scatter the data with the iovcnt buffers specified by the members of the iov array. The offset of the file operations is explicitly specified by *offset. The new file offset after the file operation is returned in *offset. If the FOF_UPDATE_OFFSET flag is specified in the flags argument, the file offset in the file entry fp is updated to reflect the new file offset, otherwise it remains unchanged after the operation. The file descriptor fd is largely unused except for use by the ktrace framework for reporting to userlevel the process's file descriptor. Upon successful completion the number of bytes which were transferred is returned in *retval. RETURN VALUES
Upon successful completion zero is returned, otherwise an appropriate error is returned. CODE REFERENCES
The framework for these file operations is implemented within the file sys/kern/sys_generic.c. SEE ALSO
file(9) BSD
December 20, 2005 BSD
Man Page