Changeset View
Changeset View
Standalone View
Standalone View
sys/cam/mmc/mmc_xpt.c
Show First 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct ccb_pathinq cpi; | struct ccb_pathinq cpi; | ||||
cam_status status; | cam_status status; | ||||
struct cam_periph *old_periph; | struct cam_periph *old_periph; | ||||
int lock; | int lock; | ||||
CAM_DEBUG(path, CAM_DEBUG_TRACE, ("mmc_scan_lun\n")); | CAM_DEBUG(path, CAM_DEBUG_TRACE, ("mmc_scan_lun\n")); | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); | xpt_path_inq(&cpi, periph->path, CAM_PRIORITY_NONE); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
if (cpi.ccb_h.status != CAM_REQ_CMP) { | if (cpi.ccb_h.status != CAM_REQ_CMP) { | ||||
if (request_ccb != NULL) { | if (request_ccb != NULL) { | ||||
request_ccb->ccb_h.status = cpi.ccb_h.status; | request_ccb->ccb_h.status = cpi.ccb_h.status; | ||||
xpt_done(request_ccb); | xpt_done(request_ccb); | ||||
} | } | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | CAM_DEBUG(periph->path, CAM_DEBUG_INFO, | ||||
("mmc_announce_periph: called\n")); | ("mmc_announce_periph: called\n")); | ||||
xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); | ||||
cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; | cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; | ||||
cts.type = CTS_TYPE_CURRENT_SETTINGS; | cts.type = CTS_TYPE_CURRENT_SETTINGS; | ||||
xpt_action((union ccb*)&cts); | xpt_action((union ccb*)&cts); | ||||
if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | if ((cts.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) | ||||
return; | return; | ||||
xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); | xpt_path_inq(&cpi, periph->path, CAM_PRIORITY_NORMAL); | ||||
cpi.ccb_h.func_code = XPT_PATH_INQ; | |||||
xpt_action((union ccb *)&cpi); | |||||
printf("XPT info: CLK %04X, ...\n", cts.proto_specific.mmc.ios.clock); | printf("XPT info: CLK %04X, ...\n", cts.proto_specific.mmc.ios.clock); | ||||
} | } | ||||
/* This func is called per attached device :-( */ | /* This func is called per attached device :-( */ | ||||
void | void | ||||
mmc_print_ident(struct mmc_params *ident_data) | mmc_print_ident(struct mmc_params *ident_data) | ||||
{ | { | ||||
printf("Relative addr: %08x\n", ident_data->card_rca); | printf("Relative addr: %08x\n", ident_data->card_rca); | ||||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Lines | mmcprobe_start(struct cam_periph *periph, union ccb *start_ccb) | ||||
} | } | ||||
/* Here is the place where the identify fun begins */ | /* Here is the place where the identify fun begins */ | ||||
switch (softc->action) { | switch (softc->action) { | ||||
case PROBE_RESET: | case PROBE_RESET: | ||||
/* FALLTHROUGH */ | /* FALLTHROUGH */ | ||||
case PROBE_IDENTIFY: | case PROBE_IDENTIFY: | ||||
init_standard_ccb(start_ccb, XPT_PATH_INQ); | xpt_path_inq(&start_ccb->cpi, periph->path, CAM_PRIORITY_NORMAL); | ||||
xpt_action(start_ccb); | |||||
CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_RESET\n")); | CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_RESET\n")); | ||||
init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); | init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); | ||||
cts->ios.power_mode = power_off; | cts->ios.power_mode = power_off; | ||||
cts->ios_valid = MMC_PM; | cts->ios_valid = MMC_PM; | ||||
xpt_action(start_ccb); | xpt_action(start_ccb); | ||||
mtx_sleep(periph, p_mtx, 0, "mmcios", 100); | mtx_sleep(periph, p_mtx, 0, "mmcios", 100); | ||||
▲ Show 20 Lines • Show All 496 Lines • Show Last 20 Lines |