Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mpr/mpr_sas_lsi.c
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, | ||||
fw_event->event_data = malloc(sz, M_MPR, M_ZERO|M_NOWAIT); | fw_event->event_data = malloc(sz, M_MPR, M_ZERO|M_NOWAIT); | ||||
if (!fw_event->event_data) { | if (!fw_event->event_data) { | ||||
printf("%s: allocate failed for event_data\n", __func__); | printf("%s: allocate failed for event_data\n", __func__); | ||||
free(fw_event, M_MPR); | free(fw_event, M_MPR); | ||||
return; | return; | ||||
} | } | ||||
bcopy(event->EventData, fw_event->event_data, sz); | bcopy(event->EventData, fw_event->event_data, sz); | ||||
fw_event->event = event->Event; | fw_event->event = le16toh(event->Event); | ||||
if ((event->Event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || | if ((fw_event->event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || | ||||
event->Event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || | fw_event->event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || | ||||
event->Event == MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE || | fw_event->event == MPI2_EVENT_SAS_ENCL_DEVICE_STATUS_CHANGE || | ||||
event->Event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && | fw_event->event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && | ||||
sc->track_mapping_events) | sc->track_mapping_events) | ||||
sc->pending_map_events++; | sc->pending_map_events++; | ||||
/* | /* | ||||
* When wait_for_port_enable flag is set, make sure that all the events | * When wait_for_port_enable flag is set, make sure that all the events | ||||
* are processed. Increment the startup_refcount and decrement it after | * are processed. Increment the startup_refcount and decrement it after | ||||
* events are processed. | * events are processed. | ||||
*/ | */ | ||||
if ((event->Event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || | if ((fw_event->event == MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST || | ||||
event->Event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || | fw_event->event == MPI2_EVENT_PCIE_TOPOLOGY_CHANGE_LIST || | ||||
event->Event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && | fw_event->event == MPI2_EVENT_IR_CONFIGURATION_CHANGE_LIST) && | ||||
sc->wait_for_port_enable) | sc->wait_for_port_enable) | ||||
mprsas_startup_increment(sc->sassc); | mprsas_startup_increment(sc->sassc); | ||||
TAILQ_INSERT_TAIL(&sc->sassc->ev_queue, fw_event, ev_link); | TAILQ_INSERT_TAIL(&sc->sassc->ev_queue, fw_event, ev_link); | ||||
taskqueue_enqueue(sc->sassc->ev_tq, &sc->sassc->ev_task); | taskqueue_enqueue(sc->sassc->ev_tq, &sc->sassc->ev_task); | ||||
} | } | ||||
static void | static void | ||||
▲ Show 20 Lines • Show All 676 Lines • ▼ Show 20 Lines | if (mpr_config_get_sas_device_pg0(sc, &tmp_mpi_reply, | ||||
tmp_mpi_reply.IOCStatus); | tmp_mpi_reply.IOCStatus); | ||||
} else { | } else { | ||||
parent_sas_address = parent_config_page.SASAddress.High; | parent_sas_address = parent_config_page.SASAddress.High; | ||||
parent_sas_address = (parent_sas_address << 32) | | parent_sas_address = (parent_sas_address << 32) | | ||||
parent_config_page.SASAddress.Low; | parent_config_page.SASAddress.Low; | ||||
parent_devinfo = le32toh(parent_config_page.DeviceInfo); | parent_devinfo = le32toh(parent_config_page.DeviceInfo); | ||||
} | } | ||||
} | } | ||||
/* TODO Check proper endianness */ | sas_address = htole32(config_page.SASAddress.High); | ||||
sas_address = config_page.SASAddress.High; | sas_address = (sas_address << 32) | htole32(config_page.SASAddress.Low); | ||||
sas_address = (sas_address << 32) | config_page.SASAddress.Low; | |||||
mpr_dprint(sc, MPR_MAPPING, "Handle 0x%04x SAS Address from SAS device " | mpr_dprint(sc, MPR_MAPPING, "Handle 0x%04x SAS Address from SAS device " | ||||
"page0 = %jx\n", handle, sas_address); | "page0 = %jx\n", handle, sas_address); | ||||
/* | /* | ||||
* Always get SATA Identify information because this is used to | * Always get SATA Identify information because this is used to | ||||
* determine if Start/Stop Unit should be sent to the drive when the | * determine if Start/Stop Unit should be sent to the drive when the | ||||
* system is shutdown. | * system is shutdown. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 808 Lines • Show Last 20 Lines |