Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mpr/mprvar.h
Show All 27 Lines | |||||
* Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD | * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _MPRVAR_H | #ifndef _MPRVAR_H | ||||
#define _MPRVAR_H | #define _MPRVAR_H | ||||
#define MPR_DRIVER_VERSION "15.02.00.00-fbsd" | #define MPR_DRIVER_VERSION "15.03.00.00-fbsd" | ||||
#define MPR_DB_MAX_WAIT 2500 | #define MPR_DB_MAX_WAIT 2500 | ||||
#define MPR_REQ_FRAMES 1024 | #define MPR_REQ_FRAMES 1024 | ||||
#define MPR_EVT_REPLY_FRAMES 32 | #define MPR_EVT_REPLY_FRAMES 32 | ||||
#define MPR_REPLY_FRAMES MPR_REQ_FRAMES | #define MPR_REPLY_FRAMES MPR_REQ_FRAMES | ||||
#define MPR_CHAIN_FRAMES 2048 | #define MPR_CHAIN_FRAMES 2048 | ||||
#define MPR_MAXIO_PAGES (-1) | #define MPR_MAXIO_PAGES (-1) | ||||
Show All 19 Lines | |||||
#define MPR_FUNCTRACE(sc) \ | #define MPR_FUNCTRACE(sc) \ | ||||
mpr_dprint((sc), MPR_TRACE, "%s\n", __func__) | mpr_dprint((sc), MPR_TRACE, "%s\n", __func__) | ||||
#define CAN_SLEEP 1 | #define CAN_SLEEP 1 | ||||
#define NO_SLEEP 0 | #define NO_SLEEP 0 | ||||
#define MPR_PERIODIC_DELAY 1 /* 1 second heartbeat/watchdog check */ | #define MPR_PERIODIC_DELAY 1 /* 1 second heartbeat/watchdog check */ | ||||
#define MPR_ATA_ID_TIMEOUT 5 /* 5 second timeout for SATA ID cmd */ | #define MPR_ATA_ID_TIMEOUT 5 /* 5 second timeout for SATA ID cmd */ | ||||
#define MPR_MISSING_CHECK_DELAY 10 /* 10 seconds between missing check */ | |||||
#define IFAULT_IOP_OVER_TEMP_THRESHOLD_EXCEEDED 0x2810 | #define IFAULT_IOP_OVER_TEMP_THRESHOLD_EXCEEDED 0x2810 | ||||
#define MPR_SCSI_RI_INVALID_FRAME (0x00000002) | #define MPR_SCSI_RI_INVALID_FRAME (0x00000002) | ||||
#define MPR_STRING_LENGTH 64 | #define MPR_STRING_LENGTH 64 | ||||
#define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */ | #define DEFAULT_SPINUP_WAIT 3 /* seconds to wait for spinup */ | ||||
#include <sys/endian.h> | #include <sys/endian.h> | ||||
/* | /* | ||||
* host mapping related macro definitions | * host mapping related macro definitions | ||||
*/ | */ | ||||
#define MPR_MAPTABLE_BAD_IDX 0xFFFFFFFF | #define MPR_MAPTABLE_BAD_IDX 0xFFFFFFFF | ||||
#define MPR_DPM_BAD_IDX 0xFFFF | #define MPR_DPM_BAD_IDX 0xFFFF | ||||
#define MPR_ENCTABLE_BAD_IDX 0xFF | #define MPR_ENCTABLE_BAD_IDX 0xFF | ||||
#define MPR_MAX_MISSING_COUNT 0x0F | #define MPR_MAX_MISSING_COUNT 0x0F | ||||
#define MPR_DEV_RESERVED 0x20000000 | #define MPR_DEV_RESERVED 0x20000000 | ||||
#define MPR_MAP_IN_USE 0x10000000 | #define MPR_MAP_IN_USE 0x10000000 | ||||
#define MPR_RAID_CHANNEL 1 | |||||
#define MPR_MAP_BAD_ID 0xFFFFFFFF | #define MPR_MAP_BAD_ID 0xFFFFFFFF | ||||
typedef uint8_t u8; | typedef uint8_t u8; | ||||
typedef uint16_t u16; | typedef uint16_t u16; | ||||
typedef uint32_t u32; | typedef uint32_t u32; | ||||
typedef uint64_t u64; | typedef uint64_t u64; | ||||
/** | /** | ||||
* struct dev_mapping_table - device mapping information | * struct dev_mapping_table - device mapping information | ||||
* @physical_id: SAS address for drives or WWID for RAID volumes | * @physical_id: SAS address for drives or WWID for RAID volumes | ||||
* @device_info: bitfield provides detailed info about the device | * @device_info: bitfield provides detailed info about the device | ||||
* @phy_bits: bitfields indicating controller phys | * @phy_bits: bitfields indicating controller phys | ||||
* @dpm_entry_num: index of this device in device persistent map table | * @dpm_entry_num: index of this device in device persistent map table | ||||
* @dev_handle: device handle for the device pointed by this entry | * @dev_handle: device handle for the device pointed by this entry | ||||
* @channel: target channel | |||||
* @id: target id | * @id: target id | ||||
* @missing_count: number of times the device not detected by driver | * @missing_count: number of times the device not detected by driver | ||||
* @hide_flag: Hide this physical disk/not (foreign configuration) | * @hide_flag: Hide this physical disk/not (foreign configuration) | ||||
* @init_complete: Whether the start of the day checks completed or not | * @init_complete: Whether the start of the day checks completed or not | ||||
* @TLR_bits: Turn TLR support on or off | * @TLR_bits: Turn TLR support on or off | ||||
*/ | */ | ||||
struct dev_mapping_table { | struct dev_mapping_table { | ||||
u64 physical_id; | u64 physical_id; | ||||
u32 device_info; | u32 device_info; | ||||
u32 phy_bits; | u32 phy_bits; | ||||
u16 dpm_entry_num; | u16 dpm_entry_num; | ||||
u16 dev_handle; | u16 dev_handle; | ||||
u8 reserved1; | u16 reserved1; | ||||
u8 channel; | |||||
u16 id; | u16 id; | ||||
u8 missing_count; | u8 missing_count; | ||||
u8 init_complete; | u8 init_complete; | ||||
u8 TLR_bits; | u8 TLR_bits; | ||||
u8 reserved2; | u8 reserved2; | ||||
}; | }; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 172 Lines • ▼ Show 20 Lines | #define MPR_FLAGS_GEN35_IOC (1 << 6) | ||||
uint64_t prp_page_alloc_fail; | uint64_t prp_page_alloc_fail; | ||||
struct sysctl_ctx_list sysctl_ctx; | struct sysctl_ctx_list sysctl_ctx; | ||||
struct sysctl_oid *sysctl_tree; | struct sysctl_oid *sysctl_tree; | ||||
char fw_version[16]; | char fw_version[16]; | ||||
struct mpr_command *commands; | struct mpr_command *commands; | ||||
struct mpr_chain *chains; | struct mpr_chain *chains; | ||||
struct mpr_prp_page *prps; | struct mpr_prp_page *prps; | ||||
struct callout periodic; | struct callout periodic; | ||||
struct callout device_check_callout; | |||||
struct mprsas_softc *sassc; | struct mprsas_softc *sassc; | ||||
char tmp_string[MPR_STRING_LENGTH]; | char tmp_string[MPR_STRING_LENGTH]; | ||||
TAILQ_HEAD(, mpr_command) req_list; | TAILQ_HEAD(, mpr_command) req_list; | ||||
TAILQ_HEAD(, mpr_command) high_priority_req_list; | TAILQ_HEAD(, mpr_command) high_priority_req_list; | ||||
TAILQ_HEAD(, mpr_chain) chain_list; | TAILQ_HEAD(, mpr_chain) chain_list; | ||||
TAILQ_HEAD(, mpr_prp_page) prp_page_list; | TAILQ_HEAD(, mpr_prp_page) prp_page_list; | ||||
TAILQ_HEAD(, mpr_command) tm_list; | TAILQ_HEAD(, mpr_command) tm_list; | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | #define MPR_FLAGS_GEN35_IOC (1 << 6) | ||||
uint8_t *dpm_flush_entry; | uint8_t *dpm_flush_entry; | ||||
Mpi2DriverMappingPage0_t *dpm_pg0; | Mpi2DriverMappingPage0_t *dpm_pg0; | ||||
uint16_t max_devices; | uint16_t max_devices; | ||||
uint16_t max_enclosures; | uint16_t max_enclosures; | ||||
uint16_t max_expanders; | uint16_t max_expanders; | ||||
uint8_t max_volumes; | uint8_t max_volumes; | ||||
uint8_t num_enc_table_entries; | uint8_t num_enc_table_entries; | ||||
uint8_t num_rsvd_entries; | uint8_t num_rsvd_entries; | ||||
uint8_t num_channels; | |||||
uint16_t max_dpm_entries; | uint16_t max_dpm_entries; | ||||
uint8_t is_dpm_enable; | uint8_t is_dpm_enable; | ||||
uint8_t track_mapping_events; | uint8_t track_mapping_events; | ||||
uint32_t pending_map_events; | uint32_t pending_map_events; | ||||
uint8_t mt_full_retry; | |||||
uint8_t mt_add_device_failed; | |||||
/* FW diag Buffer List */ | /* FW diag Buffer List */ | ||||
mpr_fw_diagnostic_buffer_t | mpr_fw_diagnostic_buffer_t | ||||
fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_COUNT]; | fw_diag_buffer_list[MPI2_DIAG_BUF_TYPE_COUNT]; | ||||
/* Event Recording IOCTL support */ | /* Event Recording IOCTL support */ | ||||
uint32_t events_to_record[4]; | uint32_t events_to_record[4]; | ||||
mpr_event_entry_t recorded_events[MPR_EVENT_QUEUE_SIZE]; | mpr_event_entry_t recorded_events[MPR_EVENT_QUEUE_SIZE]; | ||||
▲ Show 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | |||||
void mpr_base_static_config_pages(struct mpr_softc *sc); | void mpr_base_static_config_pages(struct mpr_softc *sc); | ||||
int mpr_mapping_initialize(struct mpr_softc *); | int mpr_mapping_initialize(struct mpr_softc *); | ||||
void mpr_mapping_topology_change_event(struct mpr_softc *, | void mpr_mapping_topology_change_event(struct mpr_softc *, | ||||
Mpi2EventDataSasTopologyChangeList_t *); | Mpi2EventDataSasTopologyChangeList_t *); | ||||
void mpr_mapping_pcie_topology_change_event(struct mpr_softc *sc, | void mpr_mapping_pcie_topology_change_event(struct mpr_softc *sc, | ||||
Mpi26EventDataPCIeTopologyChangeList_t *event_data); | Mpi26EventDataPCIeTopologyChangeList_t *event_data); | ||||
int mpr_mapping_is_reinit_required(struct mpr_softc *); | |||||
void mpr_mapping_free_memory(struct mpr_softc *sc); | void mpr_mapping_free_memory(struct mpr_softc *sc); | ||||
int mpr_config_set_dpm_pg0(struct mpr_softc *, Mpi2ConfigReply_t *, | int mpr_config_set_dpm_pg0(struct mpr_softc *, Mpi2ConfigReply_t *, | ||||
Mpi2DriverMappingPage0_t *, u16 ); | Mpi2DriverMappingPage0_t *, u16 ); | ||||
void mpr_mapping_exit(struct mpr_softc *); | void mpr_mapping_exit(struct mpr_softc *); | ||||
void mpr_mapping_check_devices(struct mpr_softc *, int); | void mpr_mapping_check_devices(void *); | ||||
int mpr_mapping_allocate_memory(struct mpr_softc *sc); | int mpr_mapping_allocate_memory(struct mpr_softc *sc); | ||||
unsigned int mpr_mapping_get_sas_id(struct mpr_softc *, uint64_t , u16); | unsigned int mpr_mapping_get_tid(struct mpr_softc *, uint64_t , u16); | ||||
unsigned int mpr_mapping_get_sas_id_from_handle(struct mpr_softc *sc, | unsigned int mpr_mapping_get_tid_from_handle(struct mpr_softc *sc, | ||||
u16 handle); | u16 handle); | ||||
unsigned int mpr_mapping_get_raid_id(struct mpr_softc *sc, u64 wwid, | unsigned int mpr_mapping_get_raid_tid(struct mpr_softc *sc, u64 wwid, | ||||
u16 handle); | u16 volHandle); | ||||
unsigned int mpr_mapping_get_raid_id_from_handle(struct mpr_softc *sc, | unsigned int mpr_mapping_get_raid_tid_from_handle(struct mpr_softc *sc, | ||||
u16 volHandle); | u16 volHandle); | ||||
void mpr_mapping_enclosure_dev_status_change_event(struct mpr_softc *, | void mpr_mapping_enclosure_dev_status_change_event(struct mpr_softc *, | ||||
Mpi2EventDataSasEnclDevStatusChange_t *event_data); | Mpi2EventDataSasEnclDevStatusChange_t *event_data); | ||||
void mpr_mapping_ir_config_change_event(struct mpr_softc *sc, | void mpr_mapping_ir_config_change_event(struct mpr_softc *sc, | ||||
Mpi2EventDataIrConfigChangeList_t *event_data); | Mpi2EventDataIrConfigChangeList_t *event_data); | ||||
void mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, | void mprsas_evt_handler(struct mpr_softc *sc, uintptr_t data, | ||||
MPI2_EVENT_NOTIFICATION_REPLY *event); | MPI2_EVENT_NOTIFICATION_REPLY *event); | ||||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |