mmccam: Use a sbuf for the mmc ident function
While here fix a typo.
This commit is contained in:
parent
5f2d3b42de
commit
d5bfd287c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363424
@ -408,27 +408,47 @@ mmc_announce_periph(struct cam_periph *periph)
|
|||||||
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);
|
struct sbuf *sb;
|
||||||
printf("Card features: <");
|
bool space = false;
|
||||||
if (ident_data->card_features & CARD_FEATURE_MMC)
|
|
||||||
printf("MMC ");
|
sb = sbuf_new_auto();
|
||||||
if (ident_data->card_features & CARD_FEATURE_MEMORY)
|
sbuf_printf(sb, "Relative addr: %08x\n", ident_data->card_rca);
|
||||||
printf("Memory ");
|
sbuf_printf(sb, "Card features: <");
|
||||||
if (ident_data->card_features & CARD_FEATURE_SDHC)
|
if (ident_data->card_features & CARD_FEATURE_MMC) {
|
||||||
printf("High-Capacity ");
|
sbuf_printf(sb, "MMC");
|
||||||
if (ident_data->card_features & CARD_FEATURE_SD20)
|
space = true;
|
||||||
printf("SD2.0-Conditions ");
|
}
|
||||||
if (ident_data->card_features & CARD_FEATURE_SDIO)
|
if (ident_data->card_features & CARD_FEATURE_MEMORY) {
|
||||||
printf("SDIO ");
|
sbuf_printf(sb, "%sMemory", space ? " " : "");
|
||||||
printf(">\n");
|
space = true;
|
||||||
|
}
|
||||||
|
if (ident_data->card_features & CARD_FEATURE_SDHC) {
|
||||||
|
sbuf_printf(sb, "%sHigh-Capacity", space ? " " : "");
|
||||||
|
space = true;
|
||||||
|
}
|
||||||
|
if (ident_data->card_features & CARD_FEATURE_SD20) {
|
||||||
|
sbuf_printf(sb, "%sSD2.0-Conditions", space ? " " : "");
|
||||||
|
space = true;
|
||||||
|
}
|
||||||
|
if (ident_data->card_features & CARD_FEATURE_SDIO) {
|
||||||
|
sbuf_printf(sb, "%sSDIO", space ? " " : "");
|
||||||
|
space = true;
|
||||||
|
}
|
||||||
|
sbuf_printf(sb, ">\n");
|
||||||
|
|
||||||
if (ident_data->card_features & CARD_FEATURE_MEMORY)
|
if (ident_data->card_features & CARD_FEATURE_MEMORY)
|
||||||
printf("Card memory OCR: %08x\n", ident_data->card_ocr);
|
sbuf_printf(sb, "Card memory OCR: %08x\n",
|
||||||
|
ident_data->card_ocr);
|
||||||
|
|
||||||
if (ident_data->card_features & CARD_FEATURE_SDIO) {
|
if (ident_data->card_features & CARD_FEATURE_SDIO) {
|
||||||
printf("Card IO OCR: %08x\n", ident_data->io_ocr);
|
sbuf_printf(sb, "Card IO OCR: %08x\n", ident_data->io_ocr);
|
||||||
printf("Number of funcitions: %u\n", ident_data->sdio_func_count);
|
sbuf_printf(sb, "Number of functions: %u\n",
|
||||||
|
ident_data->sdio_func_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sbuf_finish(sb);
|
||||||
|
printf("%s", sbuf_data(sb));
|
||||||
|
sbuf_clear(sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user