Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mps/mps_sas.c
| Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | |||||
| #include <dev/mps/mpi/mpi2_cnfg.h> | #include <dev/mps/mpi/mpi2_cnfg.h> | ||||
| #include <dev/mps/mpi/mpi2_init.h> | #include <dev/mps/mpi/mpi2_init.h> | ||||
| #include <dev/mps/mpi/mpi2_tool.h> | #include <dev/mps/mpi/mpi2_tool.h> | ||||
| #include <dev/mps/mps_ioctl.h> | #include <dev/mps/mps_ioctl.h> | ||||
| #include <dev/mps/mpsvar.h> | #include <dev/mps/mpsvar.h> | ||||
| #include <dev/mps/mps_table.h> | #include <dev/mps/mps_table.h> | ||||
| #include <dev/mps/mps_sas.h> | #include <dev/mps/mps_sas.h> | ||||
| #define MPSSAS_DISCOVERY_TIMEOUT 20 | |||||
| #define MPSSAS_MAX_DISCOVERY_TIMEOUTS 10 /* 200 seconds */ | |||||
| /* | /* | ||||
| * static array to check SCSI OpCode for EEDP protection bits | * static array to check SCSI OpCode for EEDP protection bits | ||||
| */ | */ | ||||
| #define PRO_R MPI2_SCSIIO_EEDPFLAGS_CHECK_REMOVE_OP | #define PRO_R MPI2_SCSIIO_EEDPFLAGS_CHECK_REMOVE_OP | ||||
| #define PRO_W MPI2_SCSIIO_EEDPFLAGS_INSERT_OP | #define PRO_W MPI2_SCSIIO_EEDPFLAGS_INSERT_OP | ||||
| #define PRO_V MPI2_SCSIIO_EEDPFLAGS_INSERT_OP | #define PRO_V MPI2_SCSIIO_EEDPFLAGS_INSERT_OP | ||||
| static uint8_t op_code_prot[256] = { | static uint8_t op_code_prot[256] = { | ||||
| 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | ||||
| ▲ Show 20 Lines • Show All 668 Lines • ▼ Show 20 Lines | mps_attach_sas(struct mps_softc *sc) | ||||
| * Assume that discovery events will start right away. | * Assume that discovery events will start right away. | ||||
| * | * | ||||
| * Hold off boot until discovery is complete. | * Hold off boot until discovery is complete. | ||||
| */ | */ | ||||
| sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; | sassc->flags |= MPSSAS_IN_STARTUP | MPSSAS_IN_DISCOVERY; | ||||
| sc->sassc->startup_refcount = 0; | sc->sassc->startup_refcount = 0; | ||||
| mpssas_startup_increment(sassc); | mpssas_startup_increment(sassc); | ||||
| callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); | |||||
| mps_unlock(sc); | mps_unlock(sc); | ||||
| /* | /* | ||||
| * Register for async events so we can determine the EEDP | * Register for async events so we can determine the EEDP | ||||
| * capabilities of devices. | * capabilities of devices. | ||||
| */ | */ | ||||
| status = xpt_create_path(&sassc->path, /*periph*/NULL, | status = xpt_create_path(&sassc->path, /*periph*/NULL, | ||||
| cam_sim_path(sc->sassc->sim), CAM_TARGET_WILDCARD, | cam_sim_path(sc->sassc->sim), CAM_TARGET_WILDCARD, | ||||
| ▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void | void | ||||
| mpssas_discovery_end(struct mpssas_softc *sassc) | mpssas_discovery_end(struct mpssas_softc *sassc) | ||||
| { | { | ||||
| struct mps_softc *sc = sassc->sc; | struct mps_softc *sc = sassc->sc; | ||||
| MPS_FUNCTRACE(sc); | MPS_FUNCTRACE(sc); | ||||
| if (sassc->flags & MPSSAS_DISCOVERY_TIMEOUT_PENDING) | |||||
| callout_stop(&sassc->discovery_callout); | |||||
| /* | /* | ||||
| * After discovery has completed, check the mapping table for any | * After discovery has completed, check the mapping table for any | ||||
| * missing devices and update their missing counts. Only do this once | * missing devices and update their missing counts. Only do this once | ||||
| * whenever the driver is initialized so that missing counts aren't | * whenever the driver is initialized so that missing counts aren't | ||||
| * updated unnecessarily. Note that just because discovery has | * updated unnecessarily. Note that just because discovery has | ||||
| * completed doesn't mean that events have been processed yet. The | * completed doesn't mean that events have been processed yet. The | ||||
| * check_devices function is a callout timer that checks if ALL devices | * check_devices function is a callout timer that checks if ALL devices | ||||
| ▲ Show 20 Lines • Show All 2,528 Lines • Show Last 20 Lines | |||||