FreeBSD kernel CAM code
ctl_frontend.h File Reference
#include <cam/ctl/ctl_ioctl.h>
#include <sys/nv.h>
Include dependency graph for ctl_frontend.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ctl_wwpn_iid
 
struct  ctl_port
 
struct  ctl_frontend
 

Macros

#define CTL_FRONTEND_DECLARE(name, driver)
 

Typedefs

typedef int(* fe_init_t) (void)
 
typedef int(* fe_shutdown_t) (void)
 
typedef void(* port_func_t) (void *onoff_arg)
 
typedef int(* port_info_func_t) (void *onoff_arg, struct sbuf *sb)
 
typedef int(* lun_func_t) (void *arg, int lun_id)
 
typedef int(* fe_ioctl_t) (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)
 

Enumerations

enum  ctl_port_status { CTL_PORT_STATUS_NONE = 0x00 , CTL_PORT_STATUS_ONLINE = 0x01 , CTL_PORT_STATUS_HA_SHARED = 0x02 }
 

Functions

int ctl_frontend_register (struct ctl_frontend *fe)
 
int ctl_frontend_deregister (struct ctl_frontend *fe)
 
struct ctl_frontendctl_frontend_find (char *frontend_name)
 
int ctl_port_register (struct ctl_port *port)
 
int ctl_port_deregister (struct ctl_port *port)
 
void ctl_port_set_wwns (struct ctl_port *port, int wwnn_valid, uint64_t wwnn, int wwpn_valid, uint64_t wwpn)
 
void ctl_port_online (struct ctl_port *fe)
 
void ctl_port_offline (struct ctl_port *fe)
 
int ctl_queue (union ctl_io *io)
 
int ctl_run (union ctl_io *io)
 
int ctl_queue_sense (union ctl_io *io)
 
int ctl_add_initiator (struct ctl_port *port, int iid, uint64_t wwpn, char *name)
 
int ctl_remove_initiator (struct ctl_port *port, int iid)
 

Macro Definition Documentation

◆ CTL_FRONTEND_DECLARE

#define CTL_FRONTEND_DECLARE (   name,
  driver 
)
Value:
static int name ## _modevent(module_t mod, int type, void *data) \
{ \
switch (type) { \
case MOD_LOAD: \
(struct ctl_frontend *)data)); \
break; \
case MOD_UNLOAD: \
(struct ctl_frontend *)data)); \
break; \
default: \
return EOPNOTSUPP; \
} \
return 0; \
} \
static moduledata_t name ## _mod = { \
#name, \
name ## _modevent, \
(void *)&driver \
}; \
DECLARE_MODULE(name, name ## _mod, SI_SUB_CONFIGURE, SI_ORDER_FOURTH); \
MODULE_DEPEND(name, ctl, 1, 1, 1); \
MODULE_DEPEND(name, cam, 1, 1, 1)
int ctl_frontend_deregister(struct ctl_frontend *fe)
Definition: ctl_frontend.c:109
int ctl_frontend_register(struct ctl_frontend *fe)
Definition: ctl_frontend.c:73

Definition at line 62 of file ctl_frontend.h.

Typedef Documentation

◆ fe_init_t

typedef int(* fe_init_t) (void)

Definition at line 54 of file ctl_frontend.h.

◆ fe_ioctl_t

typedef int(* fe_ioctl_t) (struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td)

Definition at line 59 of file ctl_frontend.h.

◆ fe_shutdown_t

typedef int(* fe_shutdown_t) (void)

Definition at line 55 of file ctl_frontend.h.

◆ lun_func_t

typedef int(* lun_func_t) (void *arg, int lun_id)

Definition at line 58 of file ctl_frontend.h.

◆ port_func_t

typedef void(* port_func_t) (void *onoff_arg)

Definition at line 56 of file ctl_frontend.h.

◆ port_info_func_t

typedef int(* port_info_func_t) (void *onoff_arg, struct sbuf *sb)

Definition at line 57 of file ctl_frontend.h.

Enumeration Type Documentation

◆ ctl_port_status

Enumerator
CTL_PORT_STATUS_NONE 
CTL_PORT_STATUS_ONLINE 
CTL_PORT_STATUS_HA_SHARED 

Definition at line 48 of file ctl_frontend.h.

Function Documentation

◆ ctl_add_initiator()

int ctl_add_initiator ( struct ctl_port port,
int  iid,
uint64_t  wwpn,
char *  name 
)

Definition at line 2174 of file ctl.c.

References ctl_isc_announce_iid(), ctl_softc::ctl_lock, CTL_MAX_INIT_PER_PORT, ctl_port::ctl_softc, ctl_wwpn_iid::in_use, ctl_wwpn_iid::last_use, ctl_wwpn_iid::name, ctl_port::targ_port, ctl_wwpn_iid::wwpn, and ctl_port::wwpn_iid.

Referenced by cfiscsi_session_register_initiator(), and ctlfeasync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctl_frontend_deregister()

int ctl_frontend_deregister ( struct ctl_frontend fe)

Definition at line 109 of file ctl_frontend.c.

References control_softc, ctl_softc::ctl_lock, ctl_frontend::name, ctl_softc::num_frontends, and ctl_frontend::shutdown.

Referenced by ctl_shutdown().

Here is the caller graph for this function:

◆ ctl_frontend_find()

struct ctl_frontend * ctl_frontend_find ( char *  frontend_name)

Definition at line 131 of file ctl_frontend.c.

References control_softc, ctl_softc::ctl_lock, and ctl_frontend::name.

Referenced by ctl_ioctl().

Here is the caller graph for this function:

◆ ctl_frontend_register()

int ctl_frontend_register ( struct ctl_frontend fe)

Definition at line 73 of file ctl_frontend.c.

References control_softc, ctl_softc::ctl_lock, ctl_frontend::init, ctl_frontend::name, and ctl_softc::num_frontends.

Referenced by ctl_init().

Here is the caller graph for this function:

◆ ctl_port_deregister()

◆ ctl_port_offline()

◆ ctl_port_online()

◆ ctl_port_register()

◆ ctl_port_set_wwns()

◆ ctl_queue()

◆ ctl_queue_sense()

◆ ctl_remove_initiator()

int ctl_remove_initiator ( struct ctl_port port,
int  iid 
)

Definition at line 2145 of file ctl.c.

References ctl_i_t_nexus_loss(), ctl_isc_announce_iid(), ctl_softc::ctl_lock, CTL_MAX_INIT_PER_PORT, ctl_port::ctl_softc, CTL_UA_POWERON, ctl_wwpn_iid::in_use, ctl_wwpn_iid::last_use, and ctl_port::wwpn_iid.

Referenced by cfiscsi_session_unregister_initiator(), and ctlfeasync().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctl_run()