Home | History | Annotate | Download | only in sdmmc

Lines Matching defs:sf

431 	struct sdmmc_function *sf;
471 SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list) {
472 if (ISSET(sc->sc_flags, SMF_IO_MODE) && sf->number < 1)
476 saa.manufacturer = sf->cis.manufacturer;
477 saa.product = sf->cis.product;
478 saa.interface = sf->interface;
479 saa.sf = sf;
481 sf->child =
499 struct sdmmc_function *sf, *sfnext;
504 SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list) {
505 if (sf->child != NULL) {
506 config_detach(sf->child, DETACH_FORCE);
507 sf->child = NULL;
520 for (sf = SIMPLEQ_FIRST(&sc->sf_head); sf != NULL; sf = sfnext) {
521 sfnext = SIMPLEQ_NEXT(sf, sf_list);
522 sdmmc_function_free(sf);
533 struct sdmmc_function *sf = sa->sf;
534 struct sdmmc_cis *cis = &sf->sc->sc_fn0->cis;
538 if (sf->number == 0)
561 sf->interface);
567 if (sf->number > 0)
568 printf(" function %d", sf->number);
680 struct sdmmc_function *sf;
682 sf = malloc(sizeof *sf, M_DEVBUF, M_WAITOK|M_ZERO);
683 if (sf == NULL) {
689 sf->sc = sc;
690 sf->number = -1;
691 sf->cis.manufacturer = SDMMC_VENDOR_INVALID;
692 sf->cis.product = SDMMC_PRODUCT_INVALID;
693 sf->cis.function = SDMMC_FUNCTION_INVALID;
694 sf->width = 1;
695 sf->blklen = sdmmc_chip_host_maxblklen(sc->sc_sct, sc->sc_sch);
704 MAXPHYS, 0, BUS_DMA_WAITOK, &sf->bbuf_dmap);
712 &sf->bbuf, BUS_DMA_WAITOK);
715 error = bus_dmamap_load(sc->sc_dmat, sf->bbuf_dmap,
716 sf->bbuf, MAXPHYS, NULL,
721 MAXPHYS, 0, BUS_DMA_WAITOK, &sf->sseg_dmap);
725 bus_dmamap_unload(sc->sc_dmat, sf->bbuf_dmap);
727 bus_dmamem_unmap(sc->sc_dmat, sf->bbuf, MAXPHYS);
731 bus_dmamap_destroy(sc->sc_dmat, sf->bbuf_dmap);
733 free(sf, M_DEVBUF);
734 sf = NULL;
738 return sf;
742 sdmmc_function_free(struct sdmmc_function *sf)
744 struct sdmmc_softc *sc = sf->sc;
749 bus_dmamap_destroy(sc->sc_dmat, sf->sseg_dmap);
750 bus_dmamap_unload(sc->sc_dmat, sf->bbuf_dmap);
751 bus_dmamem_unmap(sc->sc_dmat, sf->bbuf, MAXPHYS);
753 sf->bbuf_dmap->dm_segs, sf->bbuf_dmap->dm_nsegs);
754 bus_dmamap_destroy(sc->sc_dmat, sf->bbuf_dmap);
757 free(sf, M_DEVBUF);
793 struct sdmmc_function *sf;
796 SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list) {
799 sdmmc_io_init(sc, sf) != 0) {
806 sdmmc_mem_init(sc, sf) != 0) {
812 SIMPLEQ_FOREACH(sf, &sc->sf_head, sf_list) {
813 if (!ISSET(sf->flags, SFF_ERROR))
840 sdmmc_app_command(struct sdmmc_softc *sc, struct sdmmc_function *sf, struct sdmmc_command *cmd)
851 acmd.c_arg = (sf != NULL) ? (sf->rca << 16) : 0;
951 sdmmc_set_relative_addr(struct sdmmc_softc *sc, struct sdmmc_function *sf)
970 cmd.c_arg = MMC_ARG_RCA(sf->rca);
978 sf->rca = SD_R6_RCA(cmd.c_resp);
984 sdmmc_select_card(struct sdmmc_softc *sc, struct sdmmc_function *sf)
997 if (sc->sc_card == sf
998 || (sf && sc->sc_card && sc->sc_card->rca == sf->rca)) {
999 sc->sc_card = sf;
1005 cmd.c_arg = (sf == NULL) ? 0 : MMC_ARG_RCA(sf->rca);
1006 cmd.c_flags = SCF_CMD_AC | ((sf == NULL) ? SCF_RSP_R0 : SCF_RSP_R1);
1008 if (error == 0 || sf == NULL)
1009 sc->sc_card = sf;