FreeBSD kernel CAM code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/bio.h>
#include <sys/sysctl.h>
#include <sys/taskqueue.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/conf.h>
#include <sys/devicestat.h>
#include <sys/eventhandler.h>
#include <sys/malloc.h>
#include <sys/cons.h>
#include <geom/geom_disk.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_periph.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_xpt_internal.h>
#include <cam/cam_sim.h>
#include <cam/ata/ata_all.h>
Go to the source code of this file.
Data Structures | |
struct | pmp_softc |
Macros | |
#define | ccb_state ppriv_field0 |
#define | ccb_bp ppriv_ptr1 |
#define | PMP_EV_RESET 1 |
#define | PMP_EV_RESCAN 2 |
#define | PMP_DEFAULT_TIMEOUT 30 /* Timeout in seconds */ |
#define | PMP_DEFAULT_RETRY 1 |
#define | PMP_DEFAULT_HIDE_SPECIAL 1 |
Enumerations | |
enum | pmp_state { PMP_STATE_NORMAL , PMP_STATE_PORTS , PMP_STATE_PM_QUIRKS_1 , PMP_STATE_PM_QUIRKS_2 , PMP_STATE_PM_QUIRKS_3 , PMP_STATE_PRECONFIG , PMP_STATE_RESET , PMP_STATE_CONNECT , PMP_STATE_CHECK , PMP_STATE_CLEAR , PMP_STATE_CONFIG , PMP_STATE_SCAN } |
enum | pmp_flags { PMP_FLAG_SCTX_INIT = 0x200 } |
enum | pmp_ccb_state { PMP_CCB_PROBE = 0x01 } |
Functions | |
__FBSDID ("$FreeBSD$") | |
static void | pmpasync (void *callback_arg, u_int32_t code, struct cam_path *path, void *arg) |
static void | pmpsysctlinit (void *context, int pending) |
static void | pmpdone (struct cam_periph *periph, union ccb *done_ccb) |
static | SYSCTL_NODE (_kern_cam, OID_AUTO, pmp, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "CAM Direct Access Disk driver") |
SYSCTL_INT (_kern_cam_pmp, OID_AUTO, retry_count, CTLFLAG_RWTUN, &pmp_retry_count, 0, "Normal I/O retry count") | |
SYSCTL_INT (_kern_cam_pmp, OID_AUTO, default_timeout, CTLFLAG_RWTUN, &pmp_default_timeout, 0, "Normal I/O timeout (in seconds)") | |
SYSCTL_INT (_kern_cam_pmp, OID_AUTO, hide_special, CTLFLAG_RWTUN, &pmp_hide_special, 0, "Hide extra ports") | |
PERIPHDRIVER_DECLARE (pmp, pmpdriver) | |
static void | pmpfreeze (struct cam_periph *periph, int mask) |
static void | pmprelease (struct cam_periph *periph, int mask) |
static void | pmponinvalidate (struct cam_periph *periph) |
static void | pmpcleanup (struct cam_periph *periph) |
static cam_status | pmpregister (struct cam_periph *periph, void *arg) |
static void | pmpstart (struct cam_periph *periph, union ccb *start_ccb) |
Variables | |
static periph_init_t | pmpinit |
static periph_ctor_t | pmpregister |
static periph_dtor_t | pmpcleanup |
static periph_start_t | pmpstart |
static periph_oninv_t | pmponinvalidate |
static int | pmp_retry_count = PMP_DEFAULT_RETRY |
static int | pmp_default_timeout = PMP_DEFAULT_TIMEOUT |
static int | pmp_hide_special = PMP_DEFAULT_HIDE_SPECIAL |
static struct periph_driver | pmpdriver |
#define ccb_bp ppriv_ptr1 |
#define ccb_state ppriv_field0 |
#define PMP_EV_RESCAN 2 |
#define PMP_EV_RESET 1 |
enum pmp_ccb_state |
enum pmp_state |
__FBSDID | ( | "$FreeBSD$" | ) |
PERIPHDRIVER_DECLARE | ( | pmp | , |
pmpdriver | |||
) |
|
static |
Definition at line 265 of file ata_pmp.c.
References AC_BUS_RESET, AC_FOUND_DEVICE, AC_SCSI_AEN, AC_SENT_BDR, cam_periph_acquire(), cam_periph_alloc(), cam_periph_async(), CAM_PERIPH_BIO, CAM_PRIORITY_DEV, CAM_REQ_CMP, CAM_REQ_INPROG, PMP_EV_RESCAN, PMP_EV_RESET, PMP_STATE_NORMAL, PMP_STATE_PM_QUIRKS_1, PMP_STATE_PRECONFIG, pmpasync(), pmpcleanup, pmpfreeze(), pmponinvalidate, pmpregister, pmprelease(), pmpstart, PROTO_SATAPM, ccb_getdev::protocol, cam_periph::softc, xpt_hold_boot(), xpt_release_boot(), and xpt_schedule().
Referenced by pmpasync(), pmponinvalidate(), and pmpregister().
|
static |
Definition at line 244 of file ata_pmp.c.
References cam_periph_lock, cam_periph_unlock, cam_periph::path, PMP_FLAG_SCTX_INIT, cam_periph::softc, and xpt_print().
|
static |
Definition at line 583 of file ata_pmp.c.
References AC_LOST_DEVICE, AC_SENT_BDR, ccb::ataio, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DEV_QFRZN, cam_freeze_devq(), cam_periph_error(), cam_periph_release_locked(), CAM_PRIORITY_NONE, CAM_PRIORITY_XPT, cam_release_devq(), CAM_REQ_CMP, CAM_STATUS_MASK, ccb, ccb::ccb_h, cts, CTS_SATA_CAPS_H_AN, CTS_SATA_CAPS_H_DMAAA, CTS_SATA_CAPS_H_PMREQ, CTS_SATA_VALID_CAPS, CTS_SATA_VALID_REVISION, CTS_TYPE_CURRENT_SETTINGS, ata_res::lba_high, ata_res::lba_low, ata_res::lba_mid, ccb_hdr::path, cam_periph::path, ccb_hdr::path_id, cam_periph::periph_name, ccb_hdr::pinfo, PMP_EV_RESCAN, pmp_hide_special, PMP_STATE_CHECK, PMP_STATE_CLEAR, PMP_STATE_CONFIG, PMP_STATE_CONNECT, PMP_STATE_NORMAL, PMP_STATE_PM_QUIRKS_1, PMP_STATE_PM_QUIRKS_2, PMP_STATE_PM_QUIRKS_3, PMP_STATE_PORTS, PMP_STATE_PRECONFIG, PMP_STATE_RESET, pmprelease(), cam_pinfo::priority, RELSIM_RELEASE_AFTER_TIMEOUT, ccb_ataio::res, ata_res::sector_count, cam_periph::softc, ccb_hdr::status, cam_periph::unit_number, xpt_action(), xpt_alloc_ccb_nowait(), xpt_async(), xpt_create_path(), xpt_free_path(), xpt_path_path_id(), xpt_release_boot(), xpt_release_ccb(), xpt_rescan(), xpt_schedule(), XPT_SET_TRAN_SETTINGS, and xpt_setup_ccb().
Referenced by pmpstart().
|
static |
Definition at line 178 of file ata_pmp.c.
References cam_freeze_devq(), CAM_REQ_CMP, cam_periph::path, cam_periph::softc, xpt_acquire_device(), xpt_create_path(), xpt_free_path(), and xpt_path_path_id().
Referenced by pmpasync().
|
static |
Definition at line 222 of file ata_pmp.c.
References AC_LOST_DEVICE, CAM_REQ_CMP, cam_periph::path, cam_path::periph, pmpasync(), pmprelease(), xpt_async(), xpt_create_path(), xpt_free_path(), xpt_path_path_id(), and xpt_register_async().
|
static |
Definition at line 368 of file ata_pmp.c.
References AC_BUS_RESET, AC_LOST_DEVICE, AC_SCSI_AEN, AC_SENT_BDR, cam_periph_acquire(), CAM_PRIORITY_DEV, CAM_REQ_CMP, CAM_REQ_CMP_ERR, ccb_getdev::ident_data, cam_periph::path, PMP_EV_RESCAN, PMP_STATE_PORTS, pmpasync(), pmpsysctlinit(), cam_periph::softc, xpt_announce_periph(), xpt_hold_boot(), xpt_register_async(), and xpt_schedule().
|
static |
Definition at line 200 of file ata_pmp.c.
References cam_release_devq(), CAM_REQ_CMP, cam_periph::path, cam_periph::softc, xpt_create_path(), xpt_free_path(), xpt_path_path_id(), and xpt_release_device().
Referenced by pmpasync(), pmpdone(), and pmponinvalidate().
|
static |
Definition at line 421 of file ata_pmp.c.
References ata_pm_read_cmd(), ata_pm_write_cmd(), ccb::ataio, CAM_DEBUG, CAM_DEBUG_TRACE, CAM_DIR_NONE, cam_fill_ataio(), CAM_PRIORITY_NONE, CAM_REQ_CMP, cts, CTS_SATA_CAPS_H_AN, CTS_SATA_VALID_CAPS, CTS_SATA_VALID_REVISION, CTS_TYPE_CURRENT_SETTINGS, CTS_TYPE_USER_SETTINGS, cam_periph::path, pmp_default_timeout, pmp_retry_count, PMP_STATE_CHECK, PMP_STATE_CLEAR, PMP_STATE_CONFIG, PMP_STATE_CONNECT, PMP_STATE_PM_QUIRKS_1, PMP_STATE_PM_QUIRKS_2, PMP_STATE_PM_QUIRKS_3, PMP_STATE_PORTS, PMP_STATE_PRECONFIG, PMP_STATE_RESET, pmpdone(), cam_periph::softc, xpt_action(), xpt_create_path(), xpt_free_path(), XPT_GET_TRAN_SETTINGS, xpt_path_path_id(), and xpt_setup_ccb().
|
static |
Definition at line 339 of file ata_pmp.c.
References cam_periph_acquire(), cam_periph_release(), PMP_FLAG_SCTX_INIT, cam_periph::softc, and cam_periph::unit_number.
Referenced by pmpregister().
SYSCTL_INT | ( | _kern_cam_pmp | , |
OID_AUTO | , | ||
default_timeout | , | ||
CTLFLAG_RWTUN | , | ||
& | pmp_default_timeout, | ||
0 | , | ||
"Normal I/O timeout (in seconds)" | |||
) |
SYSCTL_INT | ( | _kern_cam_pmp | , |
OID_AUTO | , | ||
hide_special | , | ||
CTLFLAG_RWTUN | , | ||
& | pmp_hide_special, | ||
0 | , | ||
"Hide extra ports" | |||
) |
SYSCTL_INT | ( | _kern_cam_pmp | , |
OID_AUTO | , | ||
retry_count | , | ||
CTLFLAG_RWTUN | , | ||
& | pmp_retry_count, | ||
0 | , | ||
"Normal I/O retry count" | |||
) |
|
static |
|
static |
Definition at line 139 of file ata_pmp.c.
Referenced by pmpstart().
|
static |
|
static |
Definition at line 138 of file ata_pmp.c.
Referenced by pmpstart().
|
static |
Definition at line 120 of file ata_pmp.c.
Referenced by pmpasync().
|
static |
|
static |
Definition at line 122 of file ata_pmp.c.
Referenced by pmpasync().
|
static |
Definition at line 119 of file ata_pmp.c.
Referenced by pmpasync().
|
static |
Definition at line 121 of file ata_pmp.c.
Referenced by pmpasync().