FreeBSD kernel CAM code
cam_queue.h File Reference
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/queue.h>
#include <cam/cam.h>
Include dependency graph for cam_queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  camq
 
struct  cam_ccbq
 
struct  cam_devq
 

Macros

#define CAMQ_HEAD   1 /* Head of queue index */
 
#define CAMQ_GET_HEAD(camq)   ((camq)->queue_array[CAMQ_HEAD])
 
#define CAMQ_GET_PRIO(camq)
 

Functions

 TAILQ_HEAD (ccb_hdr_tailq, ccb_hdr)
 
 LIST_HEAD (ccb_hdr_list, ccb_hdr)
 
 SLIST_HEAD (ccb_hdr_slist, ccb_hdr)
 
struct cam_devqcam_devq_alloc (int devices, int openings)
 
int cam_devq_init (struct cam_devq *devq, int devices, int openings)
 
void cam_devq_free (struct cam_devq *devq)
 
u_int32_t cam_devq_resize (struct cam_devq *camq, int openings)
 
struct cam_ccbqcam_ccbq_alloc (int openings)
 
u_int32_t cam_ccbq_resize (struct cam_ccbq *ccbq, int devices)
 
int cam_ccbq_init (struct cam_ccbq *ccbq, int openings)
 
void cam_ccbq_free (struct cam_ccbq *ccbq)
 
void cam_ccbq_fini (struct cam_ccbq *ccbq)
 
u_int32_t camq_resize (struct camq *queue, int new_size)
 
int camq_init (struct camq *camq, int size)
 
void camq_fini (struct camq *queue)
 
void camq_insert (struct camq *queue, cam_pinfo *new_entry)
 
cam_pinfocamq_remove (struct camq *queue, int index)
 
void camq_change_priority (struct camq *queue, int index, u_int32_t new_priority)
 
static __inline int cam_ccbq_pending_ccb_count (struct cam_ccbq *ccbq)
 
static __inline void cam_ccbq_take_opening (struct cam_ccbq *ccbq)
 
static __inline void cam_ccbq_insert_ccb (struct cam_ccbq *ccbq, union ccb *new_ccb)
 
static __inline void cam_ccbq_remove_ccb (struct cam_ccbq *ccbq, union ccb *ccb)
 
static __inline union ccbcam_ccbq_peek_ccb (struct cam_ccbq *ccbq, int index)
 
static __inline void cam_ccbq_send_ccb (struct cam_ccbq *queue, union ccb *send_ccb)
 
static __inline void cam_ccbq_ccb_done (struct cam_ccbq *ccbq, union ccb *done_ccb)
 
static __inline void cam_ccbq_release_opening (struct cam_ccbq *ccbq)
 

Macro Definition Documentation

◆ CAMQ_GET_HEAD

#define CAMQ_GET_HEAD (   camq)    ((camq)->queue_array[CAMQ_HEAD])

Definition at line 132 of file cam_queue.h.

◆ CAMQ_GET_PRIO

#define CAMQ_GET_PRIO (   camq)
Value:
(((camq)->entries > 0) ? \
((camq)->queue_array[CAMQ_HEAD]->priority) : 0)
#define CAMQ_HEAD
Definition: cam_queue.h:129
Definition: cam_queue.h:50

Definition at line 135 of file cam_queue.h.

◆ CAMQ_HEAD

#define CAMQ_HEAD   1 /* Head of queue index */

Definition at line 129 of file cam_queue.h.

Function Documentation

◆ cam_ccbq_alloc()

struct cam_ccbq * cam_ccbq_alloc ( int  openings)

Definition at line 234 of file cam_queue.c.

References cam_ccbq_init().

Here is the call graph for this function:

◆ cam_ccbq_ccb_done()

static __inline void cam_ccbq_ccb_done ( struct cam_ccbq ccbq,
union ccb done_ccb 
)
static

Definition at line 265 of file cam_queue.h.

References cam_ccbq::dev_active, and cam_ccbq::dev_openings.

Referenced by xpt_done_process().

Here is the caller graph for this function:

◆ cam_ccbq_fini()

void cam_ccbq_fini ( struct cam_ccbq ccbq)

Definition at line 289 of file cam_queue.c.

References camq_fini(), and cam_ccbq::queue.

Referenced by cam_ccbq_free(), and xpt_release_device().

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

◆ cam_ccbq_free()

void cam_ccbq_free ( struct cam_ccbq ccbq)

Definition at line 252 of file cam_queue.c.

References cam_ccbq_fini().

Here is the call graph for this function:

◆ cam_ccbq_init()

int cam_ccbq_init ( struct cam_ccbq ccbq,
int  openings 
)

Definition at line 277 of file cam_queue.c.

References camq_init(), cam_ccbq::dev_openings, cam_ccbq::queue, and cam_ccbq::total_openings.

Referenced by cam_ccbq_alloc(), and xpt_alloc_device().

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

◆ cam_ccbq_insert_ccb()

static __inline void cam_ccbq_insert_ccb ( struct cam_ccbq ccbq,
union ccb new_ccb 
)
static

◆ cam_ccbq_peek_ccb()

static __inline union ccb * cam_ccbq_peek_ccb ( struct cam_ccbq ccbq,
int  index 
)
static

Definition at line 250 of file cam_queue.h.

References cam_ccbq::queue, and camq::queue_array.

Referenced by xpt_run_devq().

Here is the caller graph for this function:

◆ cam_ccbq_pending_ccb_count()

static __inline int cam_ccbq_pending_ccb_count ( struct cam_ccbq ccbq)
static

Definition at line 170 of file cam_queue.h.

References camq::entries, cam_ccbq::queue, and cam_ccbq::queue_extra_entries.

Referenced by xpt_action_default().

Here is the caller graph for this function:

◆ cam_ccbq_release_opening()

static __inline void cam_ccbq_release_opening ( struct cam_ccbq ccbq)
static

Definition at line 273 of file cam_queue.h.

References cam_ccbq::allocated.

Referenced by xpt_release_ccb().

Here is the caller graph for this function:

◆ cam_ccbq_remove_ccb()

static __inline void cam_ccbq_remove_ccb ( struct cam_ccbq ccbq,
union ccb ccb 
)
static

◆ cam_ccbq_resize()

u_int32_t cam_ccbq_resize ( struct cam_ccbq ccbq,
int  devices 
)

Definition at line 261 of file cam_queue.c.

References camq::array_size, CAM_REQ_CMP, camq_resize(), cam_ccbq::dev_active, cam_ccbq::dev_openings, cam_ccbq::queue, and cam_ccbq::total_openings.

Referenced by xpt_dev_ccbq_resize().

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

◆ cam_ccbq_send_ccb()

static __inline void cam_ccbq_send_ccb ( struct cam_ccbq queue,
union ccb send_ccb 
)
static

Definition at line 256 of file cam_queue.h.

References CAM_ACTIVE_INDEX, ccb::ccb_h, cam_ccbq::dev_active, cam_ccbq::dev_openings, cam_pinfo::index, and ccb_hdr::pinfo.

Referenced by xpt_run_devq().

Here is the caller graph for this function:

◆ cam_ccbq_take_opening()

static __inline void cam_ccbq_take_opening ( struct cam_ccbq ccbq)
static

Definition at line 176 of file cam_queue.h.

References cam_ccbq::allocated.

Referenced by xpt_get_ccb(), and xpt_get_ccb_nowait().

Here is the caller graph for this function:

◆ cam_devq_alloc()

struct cam_devq * cam_devq_alloc ( int  devices,
int  openings 
)

Definition at line 186 of file cam_queue.c.

References cam_devq_init().

Referenced by cam_simq_alloc().

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

◆ cam_devq_free()

void cam_devq_free ( struct cam_devq devq)

Definition at line 216 of file cam_queue.c.

References camq_fini(), cam_devq::send_mtx, and cam_devq::send_queue.

Referenced by cam_simq_free().

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

◆ cam_devq_init()

int cam_devq_init ( struct cam_devq devq,
int  devices,
int  openings 
)

Definition at line 203 of file cam_queue.c.

References camq_init(), cam_devq::send_active, cam_devq::send_mtx, cam_devq::send_openings, and cam_devq::send_queue.

Referenced by cam_devq_alloc().

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

◆ cam_devq_resize()

u_int32_t cam_devq_resize ( struct cam_devq camq,
int  openings 
)

Definition at line 225 of file cam_queue.c.

References camq_resize().

Referenced by xpt_alloc_device(), and xpt_release_device().

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

◆ camq_change_priority()

void camq_change_priority ( struct camq queue,
int  index,
u_int32_t  new_priority 
)

Definition at line 173 of file cam_queue.c.

References camq::entries, heap_down(), heap_up(), cam_pinfo::priority, and camq::queue_array.

Referenced by xpt_schedule_dev().

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

◆ camq_fini()

void camq_fini ( struct camq queue)

Definition at line 84 of file cam_queue.c.

References camq::queue_array.

Referenced by cam_ccbq_fini(), and cam_devq_free().

Here is the caller graph for this function:

◆ camq_init()

int camq_init ( struct camq camq,
int  size 
)

Definition at line 58 of file cam_queue.c.

References camq::array_size, and camq::queue_array.

Referenced by cam_ccbq_init(), and cam_devq_init().

Here is the caller graph for this function:

◆ camq_insert()

void camq_insert ( struct camq queue,
cam_pinfo new_entry 
)

Definition at line 126 of file cam_queue.c.

References camq::array_size, camq::entries, heap_up(), cam_pinfo::index, and camq::queue_array.

Referenced by cam_ccbq_insert_ccb(), cam_ccbq_remove_ccb(), and xpt_schedule_dev().

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

◆ camq_remove()

cam_pinfo * camq_remove ( struct camq queue,
int  index 
)

Definition at line 146 of file cam_queue.c.

References CAM_UNQUEUED_INDEX, camq::entries, heap_down(), cam_pinfo::index, and camq::queue_array.

Referenced by cam_ccbq_insert_ccb(), cam_ccbq_remove_ccb(), xpt_freeze_devq_device(), and xpt_run_devq().

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

◆ camq_resize()

u_int32_t camq_resize ( struct camq queue,
int  new_size 
)

Definition at line 92 of file cam_queue.c.

References camq::array_size, CAM_REQ_CMP, CAM_RESRC_UNAVAIL, camq::entries, and camq::queue_array.

Referenced by cam_ccbq_insert_ccb(), cam_ccbq_resize(), and cam_devq_resize().

Here is the caller graph for this function:

◆ LIST_HEAD()

LIST_HEAD ( ccb_hdr_list  ,
ccb_hdr   
)

◆ SLIST_HEAD()

SLIST_HEAD ( ccb_hdr_slist  ,
ccb_hdr   
)

◆ TAILQ_HEAD()

TAILQ_HEAD ( ccb_hdr_tailq  ,
ccb_hdr   
)

Referenced by adadone(), ctl_be_block_dispatch_dev(), dadone(), and ndadone().

Here is the caller graph for this function: