void emc_attach(struct device *parent, struct device *self, void *aux) { struct emc_softc *sc = (struct emc_softc *)self; struct scsi_attach_args *sa = aux; struct scsi_link *link = sa->sa_sc_link; int sp; printf("\n"); /* init link */ link->device_softc = sc; /* init path */ scsi_xsh_set(&sc->sc_path.p_xsh, link, emc_mpath_start); sc->sc_path.p_link = link; /* init status handler */ scsi_xsh_set(&sc->sc_xsh, link, emc_status); sc->sc_pg = dma_alloc(sizeof(*sc->sc_pg), PR_WAITOK); /* let's go */ if (emc_sp_info(sc, &sp)) { printf("%s: unable to get sp info\n", DEVNAME(sc)); return; } if (mpath_path_attach(&sc->sc_path, sp, &emc_mpath_ops) != 0) printf("%s: unable to attach path\n", DEVNAME(sc)); }
void emc_attach(struct device *parent, struct device *self, void *aux) { char model[256], serial[256]; struct emc_softc *sc = (struct emc_softc *)self; struct scsi_attach_args *sa = aux; struct scsi_link *link = sa->sa_sc_link; printf("\n"); /* init link */ link->device_softc = sc; /* init path */ scsi_xsh_set(&sc->sc_path.p_xsh, link, emc_mpath_start); sc->sc_path.p_link = link; sc->sc_path.p_ops = &emc_mpath_ops; if (emc_sp_info(sc)) { printf("%s: unable to get sp info\n", DEVNAME(sc)); return; } if (emc_inquiry(sc, model, serial) != 0) { printf("%s: unable to get inquiry data\n", DEVNAME(sc)); return; } printf("%s: %s %s SP-%c port %d\n", DEVNAME(sc), model, serial, sc->sc_sp + 'A', sc->sc_port); if (sc->sc_lun_state == EMC_SP_INFO_LUN_STATE_OWNED) { if (mpath_path_attach(&sc->sc_path) != 0) printf("%s: unable to attach path\n", DEVNAME(sc)); } }