Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mpr/mpr_mapping.c
Show First 20 Lines • Show All 2,201 Lines • ▼ Show 20 Lines | mpr_mapping_free_memory(struct mpr_softc *sc) | ||||
free(sc->mapping_table, M_MPR); | free(sc->mapping_table, M_MPR); | ||||
free(sc->removal_table, M_MPR); | free(sc->removal_table, M_MPR); | ||||
free(sc->enclosure_table, M_MPR); | free(sc->enclosure_table, M_MPR); | ||||
free(sc->dpm_entry_used, M_MPR); | free(sc->dpm_entry_used, M_MPR); | ||||
free(sc->dpm_flush_entry, M_MPR); | free(sc->dpm_flush_entry, M_MPR); | ||||
free(sc->dpm_pg0, M_MPR); | free(sc->dpm_pg0, M_MPR); | ||||
} | } | ||||
static void | static bool | ||||
_mapping_process_dpm_pg0(struct mpr_softc *sc) | _mapping_process_dpm_pg0(struct mpr_softc *sc) | ||||
{ | { | ||||
u8 missing_cnt, enc_idx; | u8 missing_cnt, enc_idx; | ||||
u16 slot_id, entry_num, num_slots; | u16 slot_id, entry_num, num_slots; | ||||
u32 map_idx, dev_idx, start_idx, end_idx; | u32 map_idx, dev_idx, start_idx, end_idx; | ||||
struct dev_mapping_table *mt_entry; | struct dev_mapping_table *mt_entry; | ||||
Mpi2DriverMap0Entry_t *dpm_entry; | Mpi2DriverMap0Entry_t *dpm_entry; | ||||
u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); | u16 ioc_pg8_flags = le16toh(sc->ioc_pg8.Flags); | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE) == | ||||
for (map_idx = dev_idx; map_idx < (dev_idx + num_slots); | for (map_idx = dev_idx; map_idx < (dev_idx + num_slots); | ||||
map_idx++, mt_entry++) { | map_idx++, mt_entry++) { | ||||
if (mt_entry->dpm_entry_num != | if (mt_entry->dpm_entry_num != | ||||
MPR_DPM_BAD_IDX) { | MPR_DPM_BAD_IDX) { | ||||
mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, | mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, | ||||
"%s: Conflict in mapping table for " | "%s: Conflict in mapping table for " | ||||
" enclosure %d\n", __func__, | " enclosure %d\n", __func__, | ||||
enc_idx); | enc_idx); | ||||
break; | goto fail; | ||||
} | } | ||||
physical_id = | physical_id = | ||||
dpm_entry->PhysicalIdentifier.High; | dpm_entry->PhysicalIdentifier.High; | ||||
mt_entry->physical_id = (physical_id << 32) | | mt_entry->physical_id = (physical_id << 32) | | ||||
dpm_entry->PhysicalIdentifier.Low; | dpm_entry->PhysicalIdentifier.Low; | ||||
mt_entry->phy_bits = phy_bits; | mt_entry->phy_bits = phy_bits; | ||||
mt_entry->id = dev_idx; | mt_entry->id = dev_idx; | ||||
mt_entry->dpm_entry_num = entry_num; | mt_entry->dpm_entry_num = entry_num; | ||||
Show All 10 Lines | if ((ioc_pg8_flags & MPI2_IOCPAGE8_FLAGS_MASK_MAPPING_MODE) == | ||||
* (as described above in Enc/Slot mapping). | * (as described above in Enc/Slot mapping). | ||||
*/ | */ | ||||
map_idx = dev_idx; | map_idx = dev_idx; | ||||
mt_entry = &sc->mapping_table[map_idx]; | mt_entry = &sc->mapping_table[map_idx]; | ||||
if (mt_entry->dpm_entry_num != MPR_DPM_BAD_IDX) { | if (mt_entry->dpm_entry_num != MPR_DPM_BAD_IDX) { | ||||
mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " | mpr_dprint(sc, MPR_ERROR | MPR_MAPPING, "%s: " | ||||
"Conflict in mapping table for device %d\n", | "Conflict in mapping table for device %d\n", | ||||
__func__, map_idx); | __func__, map_idx); | ||||
break; | goto fail; | ||||
} | } | ||||
physical_id = dpm_entry->PhysicalIdentifier.High; | physical_id = dpm_entry->PhysicalIdentifier.High; | ||||
mt_entry->physical_id = (physical_id << 32) | | mt_entry->physical_id = (physical_id << 32) | | ||||
dpm_entry->PhysicalIdentifier.Low; | dpm_entry->PhysicalIdentifier.Low; | ||||
mt_entry->phy_bits = phy_bits; | mt_entry->phy_bits = phy_bits; | ||||
mt_entry->id = dev_idx; | mt_entry->id = dev_idx; | ||||
mt_entry->missing_count = missing_cnt; | mt_entry->missing_count = missing_cnt; | ||||
mt_entry->dpm_entry_num = entry_num; | mt_entry->dpm_entry_num = entry_num; | ||||
mt_entry->device_info = MPR_DEV_RESERVED; | mt_entry->device_info = MPR_DEV_RESERVED; | ||||
} | } | ||||
} /*close the loop for DPM table */ | } /*close the loop for DPM table */ | ||||
return (true); | |||||
fail: | |||||
for (entry_num = 0; entry_num < sc->max_dpm_entries; entry_num++, | |||||
dpm_entry++) { | |||||
slm: Doesn't look like you need 'dpm_entry' here. | |||||
sc->dpm_entry_used[entry_num] = 0; | |||||
/* for IR firmware, should wipe out sc->mapping_table volumes */ | |||||
} | } | ||||
sc->num_enc_table_entries = 0; | |||||
return (false); | |||||
} | |||||
/* | /* | ||||
* mpr_mapping_check_devices - start of the day check for device availabilty | * mpr_mapping_check_devices - start of the day check for device availabilty | ||||
* @sc: per adapter object | * @sc: per adapter object | ||||
* | * | ||||
* Returns nothing. | * Returns nothing. | ||||
*/ | */ | ||||
void | void | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | if (mpr_config_get_dpm_pg0(sc, &mpi_reply, sc->dpm_pg0, | ||||
if (retry_count < 3) { | if (retry_count < 3) { | ||||
retry_count++; | retry_count++; | ||||
goto retry_read_dpm; | goto retry_read_dpm; | ||||
} | } | ||||
sc->is_dpm_enable = 0; | sc->is_dpm_enable = 0; | ||||
} | } | ||||
} | } | ||||
if (sc->is_dpm_enable) | if (sc->is_dpm_enable) { | ||||
_mapping_process_dpm_pg0(sc); | if (!_mapping_process_dpm_pg0(sc)) | ||||
else { | sc->is_dpm_enable = 0; | ||||
} | |||||
if (! sc->is_dpm_enable) { | |||||
mpr_dprint(sc, MPR_MAPPING, "%s: DPM processing is disabled. " | mpr_dprint(sc, MPR_MAPPING, "%s: DPM processing is disabled. " | ||||
"Device mappings will not persist across reboots or " | "Device mappings will not persist across reboots or " | ||||
"resets.\n", __func__); | "resets.\n", __func__); | ||||
} | } | ||||
sc->track_mapping_events = 1; | sc->track_mapping_events = 1; | ||||
return 0; | return 0; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 490 Lines • Show Last 20 Lines |
Doesn't look like you need 'dpm_entry' here.