Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/sdhci/sdhci.c
Context not available. | |||||
slot_printf(slot, "Card inserted\n"); | slot_printf(slot, "Card inserted\n"); | ||||
#ifdef MMCCAM | #ifdef MMCCAM | ||||
slot->card_present = 1; | slot->card_present = 1; | ||||
union ccb *ccb; | mmccam_start_discovery(slot->sim); | ||||
uint32_t pathid; | |||||
pathid = cam_sim_path(slot->sim); | |||||
ccb = xpt_alloc_ccb_nowait(); | |||||
if (ccb == NULL) { | |||||
slot_printf(slot, "Unable to alloc CCB for rescan\n"); | |||||
SDHCI_UNLOCK(slot); | |||||
return; | |||||
} | |||||
/* | |||||
* We create a rescan request for BUS:0:0, since the card | |||||
* will be at lun 0. | |||||
*/ | |||||
if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, | |||||
/* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { | |||||
slot_printf(slot, "Unable to create path for rescan\n"); | |||||
SDHCI_UNLOCK(slot); | |||||
xpt_free_ccb(ccb); | |||||
return; | |||||
} | |||||
SDHCI_UNLOCK(slot); | SDHCI_UNLOCK(slot); | ||||
xpt_rescan(ccb); | |||||
#else | #else | ||||
d = slot->dev = device_add_child(slot->bus, "mmc", -1); | d = slot->dev = device_add_child(slot->bus, "mmc", -1); | ||||
SDHCI_UNLOCK(slot); | SDHCI_UNLOCK(slot); | ||||
Context not available. | |||||
slot->dev = NULL; | slot->dev = NULL; | ||||
#ifdef MMCCAM | #ifdef MMCCAM | ||||
slot->card_present = 0; | slot->card_present = 0; | ||||
union ccb *ccb; | mmccam_start_discovery(slot->sim); | ||||
uint32_t pathid; | |||||
pathid = cam_sim_path(slot->sim); | |||||
ccb = xpt_alloc_ccb_nowait(); | |||||
if (ccb == NULL) { | |||||
slot_printf(slot, "Unable to alloc CCB for rescan\n"); | |||||
SDHCI_UNLOCK(slot); | |||||
return; | |||||
} | |||||
/* | |||||
* We create a rescan request for BUS:0:0, since the card | |||||
* will be at lun 0. | |||||
*/ | |||||
if (xpt_create_path(&ccb->ccb_h.path, NULL, pathid, | |||||
/* target */ 0, /* lun */ 0) != CAM_REQ_CMP) { | |||||
slot_printf(slot, "Unable to create path for rescan\n"); | |||||
SDHCI_UNLOCK(slot); | |||||
xpt_free_ccb(ccb); | |||||
return; | |||||
} | |||||
SDHCI_UNLOCK(slot); | SDHCI_UNLOCK(slot); | ||||
xpt_rescan(ccb); | |||||
#else | #else | ||||
slot->intmask &= ~sdhci_tuning_intmask(slot); | slot->intmask &= ~sdhci_tuning_intmask(slot); | ||||
WR4(slot, SDHCI_INT_ENABLE, slot->intmask); | WR4(slot, SDHCI_INT_ENABLE, slot->intmask); | ||||
Context not available. |