FreeBSD kernel IICBUS device code
icee.c File Reference
#include <sys/cdefs.h>
#include "opt_platform.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/resource.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/uio.h>
#include <machine/bus.h>
#include <dev/iicbus/iiconf.h>
#include <dev/iicbus/iicbus.h>
#include "iicbus_if.h"
Include dependency graph for icee.c:

Go to the source code of this file.

Data Structures

struct  icee_softc
 

Macros

#define MAX_RD_SZ   256 /* Largest read size we support */
 
#define MAX_WR_SZ   256 /* Largest write size we support */
 
#define CDEV2SOFTC(dev)   ((dev)->si_drv1)
 

Functions

 __FBSDID ("$FreeBSD$")
 
static int icee_probe (device_t dev)
 
static int icee_init (struct icee_softc *sc)
 
static int icee_attach (device_t dev)
 
static int icee_detach (device_t dev)
 
static int icee_read (struct cdev *dev, struct uio *uio, int ioflag)
 
static int icee_write (struct cdev *dev, struct uio *uio, int ioflag)
 
 DRIVER_MODULE (icee, iicbus, icee_driver, icee_devclass, 0, 0)
 
 MODULE_VERSION (icee, 1)
 
 MODULE_DEPEND (icee, iicbus, 1, 1, 1)
 
 IICBUS_FDT_PNP_INFO (compat_data)
 

Variables

static d_read_t icee_read
 
static d_write_t icee_write
 
static struct cdevsw icee_cdevsw
 
static device_method_t icee_methods []
 
static driver_t icee_driver
 
static devclass_t icee_devclass
 

Macro Definition Documentation

◆ CDEV2SOFTC

#define CDEV2SOFTC (   dev)    ((dev)->si_drv1)

Definition at line 113 of file icee.c.

◆ MAX_RD_SZ

#define MAX_RD_SZ   256 /* Largest read size we support */

Definition at line 63 of file icee.c.

◆ MAX_WR_SZ

#define MAX_WR_SZ   256 /* Largest write size we support */

Definition at line 64 of file icee.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( icee  ,
iicbus  ,
icee_driver  ,
icee_devclass  ,
,
 
)

◆ icee_attach()

static int icee_attach ( device_t  dev)
static

Definition at line 175 of file icee.c.

References icee_softc::addr, icee_softc::cdev, icee_softc::dev, dev, icee_cdevsw, icee_init(), icee_softc::size, icee_softc::type, and icee_softc::wr_sz.

Here is the call graph for this function:

◆ icee_detach()

static int icee_detach ( device_t  dev)
static

Definition at line 208 of file icee.c.

References icee_softc::cdev, and dev.

◆ icee_init()

static int icee_init ( struct icee_softc sc)
static

Definition at line 147 of file icee.c.

References compat_data, icee_softc::dev, icee_softc::size, icee_softc::type, and icee_softc::wr_sz.

Referenced by icee_attach().

Here is the caller graph for this function:

◆ icee_probe()

static int icee_probe ( device_t  dev)
static

Definition at line 127 of file icee.c.

References compat_data, and dev.

◆ icee_read()

static int icee_read ( struct cdev *  dev,
struct uio *  uio,
int  ioflag 
)
static

◆ icee_write()

static int icee_write ( struct cdev *  dev,
struct uio *  uio,
int  ioflag 
)
static

◆ IICBUS_FDT_PNP_INFO()

IICBUS_FDT_PNP_INFO ( compat_data  )

◆ MODULE_DEPEND()

MODULE_DEPEND ( icee  ,
iicbus  ,
,
,
 
)

◆ MODULE_VERSION()

MODULE_VERSION ( icee  ,
 
)

Variable Documentation

◆ icee_cdevsw

struct cdevsw icee_cdevsw
static
Initial value:
=
{
.d_version = D_VERSION,
.d_read = icee_read,
.d_write = icee_write
}
static d_write_t icee_write
Definition: icee.c:117
static d_read_t icee_read
Definition: icee.c:116

Definition at line 119 of file icee.c.

Referenced by icee_attach().

◆ icee_devclass

devclass_t icee_devclass
static

Definition at line 351 of file icee.c.

◆ icee_driver

driver_t icee_driver
static
Initial value:
= {
"icee",
sizeof(struct icee_softc),
}
static device_method_t icee_methods[]
Definition: icee.c:338

Definition at line 346 of file icee.c.

◆ icee_methods

device_method_t icee_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, icee_probe),
DEVMETHOD(device_attach, icee_attach),
DEVMETHOD(device_detach, icee_detach),
DEVMETHOD_END
}
static int icee_detach(device_t dev)
Definition: icee.c:208
static int icee_probe(device_t dev)
Definition: icee.c:127
static int icee_attach(device_t dev)
Definition: icee.c:175

Definition at line 338 of file icee.c.

◆ icee_read

d_read_t icee_read
static

Definition at line 116 of file icee.c.

◆ icee_write

d_write_t icee_write
static

Definition at line 117 of file icee.c.