FreeBSD kernel CAM code
mmc_da.c File Reference
#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/endian.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 <sys/proc.h>
#include <sys/reboot.h>
#include <geom/geom_disk.h>
#include <machine/_inttypes.h>
#include <cam/cam.h>
#include <cam/cam_ccb.h>
#include <cam/cam_queue.h>
#include <cam/cam_periph.h>
#include <cam/cam_sim.h>
#include <cam/cam_xpt.h>
#include <cam/cam_xpt_sim.h>
#include <cam/cam_xpt_periph.h>
#include <cam/cam_xpt_internal.h>
#include <cam/cam_debug.h>
#include <cam/mmc/mmc_all.h>
Include dependency graph for mmc_da.c:

Go to the source code of this file.

Data Structures

struct  sdda_part
 
struct  sdda_softc
 

Macros

#define SDDA_FMT_BOOT   "sdda%dboot"
 
#define SDDA_FMT_GP   "sdda%dgp"
 
#define SDDA_FMT_RPMB   "sdda%drpmb"
 
#define SDDA_LABEL_ENH   "enh"
 
#define SDDA_PART_NAMELEN   (16 + 1)
 
#define ccb_bp   ppriv_ptr1
 

Enumerations

enum  sdda_flags { SDDA_FLAG_OPEN = 0x0002 , SDDA_FLAG_DIRTY = 0x0004 }
 
enum  sdda_state { SDDA_STATE_INIT , SDDA_STATE_INVALID , SDDA_STATE_NORMAL , SDDA_STATE_PART_SWITCH }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static void sddaasync (void *callback_arg, u_int32_t code, struct cam_path *path, void *arg)
 
static void sddadone (struct cam_periph *periph, union ccb *done_ccb)
 
static int sddaerror (union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
 
static int mmc_handle_reply (union ccb *ccb)
 
static uint16_t get_rca (struct cam_periph *periph)
 
static void sdda_start_init (void *context, union ccb *start_ccb)
 
static void sdda_start_init_task (void *context, int pending)
 
static void sdda_process_mmc_partitions (struct cam_periph *periph, union ccb *start_ccb)
 
static uint32_t sdda_get_host_caps (struct cam_periph *periph, union ccb *ccb)
 
static int mmc_select_card (struct cam_periph *periph, union ccb *ccb, uint32_t rca)
 
static uint32_t mmc_get_sector_size (struct cam_periph *periph)
 
static SYSCTL_NODE (_kern_cam, OID_AUTO, sdda, CTLFLAG_RD|CTLFLAG_MPSAFE, 0, "CAM Direct Access Disk driver")
 
 SYSCTL_INT (_kern_cam_sdda, OID_AUTO, mmcsd_compat, CTLFLAG_RDTUN, &sdda_mmcsd_compat, 1, "Enable creation of mmcsd aliases.")
 
static bool sdda_get_read_only (struct cam_periph *periph, union ccb *start_ccb)
 
static uint32_t mmc_get_spec_vers (struct cam_periph *periph)
 
static uint64_t mmc_get_media_size (struct cam_periph *periph)
 
static uint32_t mmc_get_cmd6_timeout (struct cam_periph *periph)
 
static bool sdda_add_part (struct cam_periph *periph, u_int type, const char *name, u_int cnt, off_t media_size, bool ro)
 
 PERIPHDRIVER_DECLARE (sdda, sddadriver)
 
static MALLOC_DEFINE (M_SDDA, "sd_da", "sd_da buffers")
 
static uint32_t mmc_get_bits (uint32_t *bits, int bit_len, int start, int size)
 
static void mmc_decode_csd_sd (uint32_t *raw_csd, struct mmc_csd *csd)
 
static void mmc_decode_csd_mmc (uint32_t *raw_csd, struct mmc_csd *csd)
 
static void mmc_decode_cid_sd (uint32_t *raw_cid, struct mmc_cid *cid)
 
static void mmc_decode_cid_mmc (uint32_t *raw_cid, struct mmc_cid *cid)
 
static void mmc_format_card_id_string (struct sdda_softc *sc, struct mmc_params *mmcp)
 
static int sddaopen (struct disk *dp)
 
static int sddaclose (struct disk *dp)
 
static void sddaschedule (struct cam_periph *periph)
 
static void sddastrategy (struct bio *bp)
 
static void sddadiskgonecb (struct disk *dp)
 
static void sddaoninvalidate (struct cam_periph *periph)
 
static void sddacleanup (struct cam_periph *periph)
 
static int sddagetattr (struct bio *bp)
 
static cam_status sddaregister (struct cam_periph *periph, void *arg)
 
static int mmc_exec_app_cmd (struct cam_periph *periph, union ccb *ccb, struct mmc_command *cmd)
 
static int mmc_app_get_scr (struct cam_periph *periph, union ccb *ccb, uint32_t *rawscr)
 
static int mmc_send_ext_csd (struct cam_periph *periph, union ccb *ccb, uint8_t *rawextcsd, size_t buf_len)
 
static void mmc_app_decode_scr (uint32_t *raw_scr, struct mmc_scr *scr)
 
static void mmc_switch_fill_mmcio (union ccb *ccb, uint8_t set, uint8_t index, uint8_t value, u_int timeout)
 
static int mmc_switch (struct cam_periph *periph, union ccb *ccb, uint8_t set, uint8_t index, uint8_t value, u_int timeout)
 
static int mmc_sd_switch (struct cam_periph *periph, union ccb *ccb, uint8_t mode, uint8_t grp, uint8_t value, uint8_t *res)
 
static int mmc_set_timing (struct cam_periph *periph, union ccb *ccb, enum mmc_bus_timing timing)
 
static void sdda_set_bus_width (struct cam_periph *periph, union ccb *ccb, int width)
 
static const char * part_type (u_int type)
 
static const char * bus_width_str (enum mmc_bus_width w)
 
static uint32_t sdda_get_max_data (struct cam_periph *periph, union ccb *ccb)
 
static void sdda_init_switch_part (struct cam_periph *periph, union ccb *start_ccb, uint8_t part)
 
static void sddastart (struct cam_periph *periph, union ccb *start_ccb)
 
static int sddadump (void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t length)
 

Variables

static const char * mmc_errmsg []
 
static disk_strategy_t sddastrategy
 
static dumper_t sddadump
 
static periph_init_t sddainit
 
static periph_ctor_t sddaregister
 
static periph_dtor_t sddacleanup
 
static periph_start_t sddastart
 
static periph_oninv_t sddaoninvalidate
 
static int sdda_mmcsd_compat = 1
 
static struct periph_driver sddadriver
 
static const int exp [8]
 
static const int mant [16]
 
static const int cur_min [8]
 
static const int cur_max [8]
 

Macro Definition Documentation

◆ ccb_bp

#define ccb_bp   ppriv_ptr1

Definition at line 164 of file mmc_da.c.

◆ SDDA_FMT_BOOT

#define SDDA_FMT_BOOT   "sdda%dboot"

Definition at line 94 of file mmc_da.c.

◆ SDDA_FMT_GP

#define SDDA_FMT_GP   "sdda%dgp"

Definition at line 95 of file mmc_da.c.

◆ SDDA_FMT_RPMB

#define SDDA_FMT_RPMB   "sdda%drpmb"

Definition at line 96 of file mmc_da.c.

◆ SDDA_LABEL_ENH

#define SDDA_LABEL_ENH   "enh"

Definition at line 97 of file mmc_da.c.

◆ SDDA_PART_NAMELEN

#define SDDA_PART_NAMELEN   (16 + 1)

Definition at line 99 of file mmc_da.c.

Enumeration Type Documentation

◆ sdda_flags

enum sdda_flags
Enumerator
SDDA_FLAG_OPEN 
SDDA_FLAG_DIRTY 

Definition at line 82 of file mmc_da.c.

◆ sdda_state

enum sdda_state
Enumerator
SDDA_STATE_INIT 
SDDA_STATE_INVALID 
SDDA_STATE_NORMAL 
SDDA_STATE_PART_SWITCH 

Definition at line 87 of file mmc_da.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ bus_width_str()

static const char * bus_width_str ( enum mmc_bus_width  w)
inlinestatic

Definition at line 1168 of file mmc_da.c.

Referenced by sdda_start_init().

Here is the caller graph for this function:

◆ get_rca()

static uint16_t get_rca ( struct cam_periph periph)
static

Definition at line 236 of file mmc_da.c.

References mmc_params::card_rca, cam_path::device, cam_ed::mmc_ident_data, and cam_periph::path.

Referenced by mmc_exec_app_cmd(), and sdda_start_init().

Here is the caller graph for this function:

◆ MALLOC_DEFINE()

static MALLOC_DEFINE ( M_SDDA  ,
"sd_da"  ,
"sd_da buffers"   
)
static

◆ mmc_app_decode_scr()

static void mmc_app_decode_scr ( uint32_t *  raw_scr,
struct mmc_scr *  scr 
)
static

Definition at line 900 of file mmc_da.c.

References mmc_get_bits().

Referenced by sdda_start_init().

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

◆ mmc_app_get_scr()

static int mmc_app_get_scr ( struct cam_periph periph,
union ccb ccb,
uint32_t *  rawscr 
)
static

Definition at line 847 of file mmc_da.c.

References mmc_exec_app_cmd().

Referenced by sdda_start_init().

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

◆ mmc_decode_cid_mmc()

static void mmc_decode_cid_mmc ( uint32_t *  raw_cid,
struct mmc_cid *  cid 
)
static

Definition at line 384 of file mmc_da.c.

References mmc_get_bits().

Referenced by sdda_start_init().

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

◆ mmc_decode_cid_sd()

static void mmc_decode_cid_sd ( uint32_t *  raw_cid,
struct mmc_cid *  cid 
)
static

Definition at line 366 of file mmc_da.c.

References mmc_get_bits().

Referenced by sdda_start_init().

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

◆ mmc_decode_csd_mmc()

static void mmc_decode_csd_mmc ( uint32_t *  raw_csd,
struct mmc_csd *  csd 
)
static

Definition at line 327 of file mmc_da.c.

References cur_max, cur_min, exp, mant, and mmc_get_bits().

Referenced by sdda_start_init().

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

◆ mmc_decode_csd_sd()

static void mmc_decode_csd_sd ( uint32_t *  raw_csd,
struct mmc_csd *  csd 
)
static

Definition at line 280 of file mmc_da.c.

References cur_max, cur_min, exp, mant, and mmc_get_bits().

Referenced by sdda_start_init().

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

◆ mmc_exec_app_cmd()

static int mmc_exec_app_cmd ( struct cam_periph periph,
union ccb ccb,
struct mmc_command *  cmd 
)
static

Definition at line 792 of file mmc_da.c.

References CAM_DIR_IN, CAM_DIR_NONE, CAM_DIR_OUT, cam_fill_mmcio(), CAM_FLAG_NONE, cam_periph_runccb(), ccb_mmcio::cmd, get_rca(), mmc_handle_reply(), ccb::mmcio, sddaerror(), and ccb_mmcio::stop.

Referenced by mmc_app_get_scr(), and sdda_set_bus_width().

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

◆ mmc_format_card_id_string()

static void mmc_format_card_id_string ( struct sdda_softc sc,
struct mmc_params mmcp 
)
static

Definition at line 402 of file mmc_da.c.

References CARD_FEATURE_MMC, CARD_FEATURE_SDHC, mmc_params::card_features, sdda_softc::card_id_string, sdda_softc::card_sn_string, and sdda_softc::cid.

Referenced by sdda_start_init().

Here is the caller graph for this function:

◆ mmc_get_bits()

static uint32_t mmc_get_bits ( uint32_t *  bits,
int  bit_len,
int  start,
int  size 
)
static

Definition at line 269 of file mmc_da.c.

Referenced by mmc_app_decode_scr(), mmc_decode_cid_mmc(), mmc_decode_cid_sd(), mmc_decode_csd_mmc(), and mmc_decode_csd_sd().

Here is the caller graph for this function:

◆ mmc_get_cmd6_timeout()

static uint32_t mmc_get_cmd6_timeout ( struct cam_periph periph)
static

Definition at line 984 of file mmc_da.c.

References mmc_get_spec_vers(), sdda_softc::periph, sdda_softc::raw_ext_csd, and cam_periph::softc.

Referenced by sdda_start_init().

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

◆ mmc_get_media_size()

static uint64_t mmc_get_media_size ( struct cam_periph periph)
static

Definition at line 977 of file mmc_da.c.

References sdda_softc::mediasize, sdda_softc::periph, and cam_periph::softc.

Referenced by sdda_process_mmc_partitions(), and sdda_start_init().

Here is the caller graph for this function:

◆ mmc_get_sector_size()

static uint32_t mmc_get_sector_size ( struct cam_periph periph)
inlinestatic

Definition at line 187 of file mmc_da.c.

Referenced by sdda_add_part(), and sdda_process_mmc_partitions().

Here is the caller graph for this function:

◆ mmc_get_spec_vers()

static uint32_t mmc_get_spec_vers ( struct cam_periph periph)
static

Definition at line 970 of file mmc_da.c.

References sdda_softc::csd, sdda_softc::periph, and cam_periph::softc.

Referenced by mmc_get_cmd6_timeout(), sdda_process_mmc_partitions(), and sdda_start_init().

Here is the caller graph for this function:

◆ mmc_handle_reply()

static int mmc_handle_reply ( union ccb ccb)
static

Definition at line 247 of file mmc_da.c.

References CAM_REQ_CMP, CAM_STATUS_MASK, ccb::ccb_h, ccb_mmcio::cmd, ccb_hdr::func_code, mmc_errmsg, ccb::mmcio, ccb_hdr::path, ccb_hdr::status, XPT_MMC_IO, and xpt_print_path().

Referenced by mmc_exec_app_cmd(), mmc_sd_switch(), mmc_select_card(), mmc_send_ext_csd(), and mmc_switch().

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

◆ mmc_sd_switch()

static int mmc_sd_switch ( struct cam_periph periph,
union ccb ccb,
uint8_t  mode,
uint8_t  grp,
uint8_t  value,
uint8_t *  res 
)
static

Definition at line 994 of file mmc_da.c.

References CAM_DIR_IN, cam_fill_mmcio(), CAM_FLAG_NONE, cam_periph_runccb(), mmc_handle_reply(), ccb::mmcio, and sddaerror().

Referenced by mmc_set_timing(), and sdda_start_init().

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

◆ mmc_select_card()

static int mmc_select_card ( struct cam_periph periph,
union ccb ccb,
uint32_t  rca 
)
static

Definition at line 937 of file mmc_da.c.

References CAM_DIR_IN, cam_fill_mmcio(), CAM_FLAG_NONE, cam_periph_runccb(), mmc_handle_reply(), ccb::mmcio, and sddaerror().

Referenced by sdda_start_init().

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

◆ mmc_send_ext_csd()

static int mmc_send_ext_csd ( struct cam_periph periph,
union ccb ccb,
uint8_t *  rawextcsd,
size_t  buf_len 
)
static

Definition at line 872 of file mmc_da.c.

References CAM_DIR_IN, cam_fill_mmcio(), CAM_FLAG_NONE, cam_periph_runccb(), mmc_handle_reply(), ccb::mmcio, and sddaerror().

Referenced by sdda_start_init().

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

◆ mmc_set_timing()

◆ mmc_switch()

static int mmc_switch ( struct cam_periph periph,
union ccb ccb,
uint8_t  set,
uint8_t  index,
uint8_t  value,
u_int  timeout 
)
static

Definition at line 958 of file mmc_da.c.

References CAM_FLAG_NONE, cam_periph_runccb(), mmc_handle_reply(), mmc_switch_fill_mmcio(), and sddaerror().

Referenced by mmc_set_timing(), and sdda_set_bus_width().

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

◆ mmc_switch_fill_mmcio()

static void mmc_switch_fill_mmcio ( union ccb ccb,
uint8_t  set,
uint8_t  index,
uint8_t  value,
u_int  timeout 
)
inlinestatic

Definition at line 917 of file mmc_da.c.

References CAM_DIR_NONE, cam_fill_mmcio(), and ccb::mmcio.

Referenced by mmc_switch(), and sdda_init_switch_part().

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

◆ part_type()

static const char * part_type ( u_int  type)
inlinestatic

Definition at line 1145 of file mmc_da.c.

Referenced by sdda_add_part().

Here is the caller graph for this function:

◆ PERIPHDRIVER_DECLARE()

PERIPHDRIVER_DECLARE ( sdda  ,
sddadriver   
)

◆ sdda_add_part()

◆ sdda_get_host_caps()

static uint32_t sdda_get_host_caps ( struct cam_periph periph,
union ccb ccb 
)
static

◆ sdda_get_max_data()

static uint32_t sdda_get_max_data ( struct cam_periph periph,
union ccb ccb 
)
static

◆ sdda_get_read_only()

static bool sdda_get_read_only ( struct cam_periph periph,
union ccb start_ccb 
)
inlinestatic

Definition at line 197 of file mmc_da.c.

Referenced by sdda_process_mmc_partitions(), and sdda_start_init().

Here is the caller graph for this function:

◆ sdda_init_switch_part()

static void sdda_init_switch_part ( struct cam_periph periph,
union ccb start_ccb,
uint8_t  part 
)
static

◆ sdda_process_mmc_partitions()

◆ sdda_set_bus_width()

◆ sdda_start_init()

static void sdda_start_init ( void *  context,
union ccb start_ccb 
)
static

Definition at line 1224 of file mmc_da.c.

References AC_ADVINFO_CHANGED, AC_GETDEV_CHANGED, AC_LOST_DEVICE, bus_width_str(), CAM_DEBUG, CAM_DEBUG_PERIPH, CAM_DEBUG_TRACE, CAM_DIR_NONE, cam_periph_hold(), CAM_PERIPH_INVALID, cam_periph_release(), cam_periph_unhold(), CAM_REQ_CMP, sdda_softc::card_f_max, CARD_FEATURE_MEMORY, CARD_FEATURE_MMC, CARD_FEATURE_SD20, CARD_FEATURE_SDHC, sdda_softc::card_id_string, sdda_softc::card_sn_string, ccb_hdr::cbfcnp, ccb::ccb_h, sdda_softc::cid, sdda_softc::cmd6_time, sdda_softc::csd, ccb::cts, cts, cam_path::device, ccb_hdr::flags, cam_periph::flags, ccb_hdr::func_code, get_rca(), ccb_trans_settings_mmc::host_caps, ccb_trans_settings_mmc::host_f_max, ccb_trans_settings_mmc::ios, ccb_trans_settings_mmc::ios_valid, sdda_softc::mediasize, ccb_trans_settings::mmc, mmc_app_decode_scr(), mmc_app_get_scr(), MMC_CAP_4_BIT_DATA, MMC_CAP_8_BIT_DATA, MMC_CAP_HSPEED, MMC_CAP_SIGNALING_120, MMC_CAP_SIGNALING_180, MMC_CLK, mmc_decode_cid_mmc(), mmc_decode_cid_sd(), mmc_decode_csd_mmc(), mmc_decode_csd_sd(), mmc_format_card_id_string(), mmc_get_cmd6_timeout(), mmc_get_media_size(), mmc_get_spec_vers(), cam_ed::mmc_ident_data, mmc_sd_switch(), mmc_select_card(), mmc_send_ext_csd(), mmc_set_timing(), MMC_VCCQ, sdda_softc::part_curr, cam_periph::path, sdda_softc::periph, ccb_trans_settings::proto_specific, sdda_softc::raw_ext_csd, ccb_hdr::retry_count, sdda_softc::scr, sdda_add_part(), sdda_get_read_only(), sdda_process_mmc_partitions(), sdda_set_bus_width(), SDDA_STATE_NORMAL, sddaasync(), sdda_softc::sector_count, cam_periph::softc, sdda_softc::state, ccb_hdr::status, ccb_hdr::timeout, sdda_softc::timings, cam_periph::unit_number, sdda_softc::vccq_120, sdda_softc::vccq_180, xpt_action(), xpt_announce_periph(), XPT_GET_TRAN_SETTINGS, xpt_register_async(), and XPT_SET_TRAN_SETTINGS.

Referenced by sdda_start_init_task().

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

◆ sdda_start_init_task()

static void sdda_start_init_task ( void *  context,
int  pending 
)
static

Definition at line 1073 of file mmc_da.c.

References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_hold(), cam_periph_lock, cam_periph_unhold(), cam_periph_unlock, CAM_PRIORITY_NONE, ccb::ccb_h, cam_periph::path, sdda_start_init(), xpt_alloc_ccb(), xpt_free_ccb(), and xpt_setup_ccb().

Referenced by sddaregister().

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

◆ sddaasync()

◆ sddacleanup()

static void sddacleanup ( struct cam_periph periph)
static

◆ sddaclose()

static int sddaclose ( struct disk *  dp)
static

Definition at line 473 of file mmc_da.c.

References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_lock, cam_periph_release(), cam_periph_sleep, cam_periph_unlock, sdda_part::flags, sdda_softc::part, cam_periph::path, sdda_softc::periph, sdda_softc::refcount, sdda_part::sc, and SDDA_FLAG_OPEN.

Referenced by sdda_add_part().

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

◆ sddadiskgonecb()

static void sddadiskgonecb ( struct disk *  dp)
static

Definition at line 583 of file mmc_da.c.

References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_release(), cam_periph::path, sdda_softc::periph, and sdda_part::sc.

Referenced by sdda_add_part().

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

◆ sddadone()

◆ sddadump()

◆ sddaerror()

static int sddaerror ( union ccb ccb,
u_int32_t  cam_flags,
u_int32_t  sense_flags 
)
static

Definition at line 2003 of file mmc_da.c.

References cam_periph_error().

Referenced by mmc_exec_app_cmd(), mmc_sd_switch(), mmc_select_card(), mmc_send_ext_csd(), and mmc_switch().

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

◆ sddagetattr()

static int sddagetattr ( struct bio *  bp)
static

Definition at line 732 of file mmc_da.c.

References cam_periph_lock, cam_periph_unlock, cam_periph::path, sdda_softc::periph, sdda_part::sc, and xpt_getattr().

Referenced by sdda_add_part().

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

◆ sddaoninvalidate()

static void sddaoninvalidate ( struct cam_periph periph)
static

◆ sddaopen()

static int sddaopen ( struct disk *  dp)
static

Definition at line 442 of file mmc_da.c.

References CAM_DEBUG, CAM_DEBUG_TRACE, cam_periph_acquire(), cam_periph_hold(), cam_periph_lock, cam_periph_release(), cam_periph_unhold(), cam_periph_unlock, sdda_part::flags, sdda_softc::part, cam_periph::path, sdda_softc::periph, sdda_part::sc, and SDDA_FLAG_OPEN.

Referenced by sdda_add_part().

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

◆ sddaregister()

static cam_status sddaregister ( struct cam_periph periph,
void *  arg 
)
static

◆ sddaschedule()

static void sddaschedule ( struct cam_periph periph)
static

Definition at line 496 of file mmc_da.c.

References sdda_part::bio_queue, CAM_PRIORITY_NORMAL, sdda_softc::part, sdda_softc::part_curr, sdda_softc::periph, cam_periph::softc, and xpt_schedule().

Referenced by sddastart(), and sddastrategy().

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

◆ sddastart()

◆ sddastrategy()

static void sddastrategy ( struct bio *  bp)
static

◆ SYSCTL_INT()

SYSCTL_INT ( _kern_cam_sdda  ,
OID_AUTO  ,
mmcsd_compat  ,
CTLFLAG_RDTUN  ,
sdda_mmcsd_compat,
,
"Enable creation of mmcsd aliases."   
)

◆ SYSCTL_NODE()

static SYSCTL_NODE ( _kern_cam  ,
OID_AUTO  ,
sdda  ,
CTLFLAG_RD|  CTLFLAG_MPSAFE,
,
"CAM Direct Access Disk driver"   
)
static

Variable Documentation

◆ cur_max

const int cur_max[8]
static
Initial value:
= {
1000, 5000, 10000, 25000, 35000, 45000, 800000, 200000
}

Definition at line 231 of file mmc_da.c.

Referenced by mmc_decode_csd_mmc(), and mmc_decode_csd_sd().

◆ cur_min

const int cur_min[8]
static
Initial value:
= {
500, 1000, 5000, 10000, 25000, 35000, 60000, 100000
}

Definition at line 227 of file mmc_da.c.

Referenced by mmc_decode_csd_mmc(), and mmc_decode_csd_sd().

◆ exp

const int exp[8]
static
Initial value:
= {
1, 10, 100, 1000, 10000, 100000, 1000000, 10000000
}

Definition at line 219 of file mmc_da.c.

Referenced by mmc_decode_csd_mmc(), and mmc_decode_csd_sd().

◆ mant

const int mant[16]
static
Initial value:
= {
0, 10, 12, 13, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80
}

Definition at line 223 of file mmc_da.c.

Referenced by mmc_decode_csd_mmc(), and mmc_decode_csd_sd().

◆ mmc_errmsg

const char* mmc_errmsg[]
static
Initial value:
=
{
"None",
"Timeout",
"Bad CRC",
"Fifo",
"Failed",
"Invalid",
"NO MEMORY"
}

Definition at line 153 of file mmc_da.c.

Referenced by mmc_handle_reply().

◆ sdda_mmcsd_compat

int sdda_mmcsd_compat = 1
static

Definition at line 192 of file mmc_da.c.

Referenced by sdda_add_part().

◆ sddacleanup

periph_dtor_t sddacleanup
static

Definition at line 172 of file mmc_da.c.

Referenced by sddaasync().

◆ sddadriver

struct periph_driver sddadriver
static
Initial value:
=
{
sddainit, "sdda",
TAILQ_HEAD_INITIALIZER(sddadriver.units), 0
}
static periph_init_t sddainit
Definition: mmc_da.c:168
static struct periph_driver sddadriver
Definition: mmc_da.c:209

Definition at line 209 of file mmc_da.c.

◆ sddadump

dumper_t sddadump
static

Definition at line 167 of file mmc_da.c.

Referenced by sdda_add_part().

◆ sddainit

static void sddainit ( void  )
static

Definition at line 168 of file mmc_da.c.

◆ sddaoninvalidate

periph_oninv_t sddaoninvalidate
static

Definition at line 174 of file mmc_da.c.

Referenced by sddaasync().

◆ sddaregister

periph_ctor_t sddaregister
static

Definition at line 171 of file mmc_da.c.

Referenced by sddaasync().

◆ sddastart

periph_start_t sddastart
static

Definition at line 173 of file mmc_da.c.

Referenced by sddaasync().

◆ sddastrategy

disk_strategy_t sddastrategy
static

Definition at line 166 of file mmc_da.c.

Referenced by sdda_add_part().