STRUCT MPT3SAS_ADAPTER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct MPT3SAS_ADAPTER(9) πŸ’–

okay bestie, welcome to the Kernel API Manual ✨ this page is all about struct MPT3SAS_ADAPTER, and it is lowkey the main character. no cap, every field stays exactly as written, so the compiler and the vibe check both pass 🫢


🌸 NAME 🌸

struct MPT3SAS_ADAPTER β€” the per adapter struct. that's the whole name, and yes, it's giving "one struct to hold the whole adapter situation" energy πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the full struct, bestie β€” every field, every type, every bracket, exactly as written. it's giving "long receipt" energy but we are not skipping a single line 😀

struct MPT3SAS_ADAPTER {
    struct list_head list;
    struct Scsi_Host *shost;
    u8 id;
    int cpu_count;
    char name[MPT_NAME_LENGTH];
    char driver_name[MPT_NAME_LENGTH - 8];
    char tmp_string[MPT_STRING_LENGTH];
    struct pci_dev  *pdev;
    Mpi2SystemInterfaceRegs_t __iomem *chip;
    phys_addr_t chip_phys;
    int logging_level;
    int fwfault_debug;
    u8 ir_firmware;
    int bars;
    u8 mask_interrupts;
    struct workqueue_struct *fault_reset_work_q;
    struct delayed_work fault_reset_work;
    struct workqueue_struct *firmware_event_thread;
    spinlock_t fw_event_lock;
    struct list_head fw_event_list;
    struct fw_event_work    *current_event;
    u8 fw_events_cleanup;
    int aen_event_read_flag;
    u8 broadcast_aen_busy;
    u16 broadcast_aen_pending;
    u8 shost_recovery;
    u8 got_task_abort_from_ioctl;
    struct mutex    reset_in_progress_mutex;
    struct mutex    hostdiag_unlock_mutex;
    spinlock_t ioc_reset_in_progress_lock;
    u8 ioc_link_reset_in_progress;
    u8 ignore_loginfos;
    u8 remove_host;
    u8 pci_error_recovery;
    u8 wait_for_discovery_to_complete;
    u8 is_driver_loading;
    u8 port_enable_failed;
    u8 start_scan;
    u16 start_scan_failed;
    u8 msix_enable;
    u16 msix_vector_count;
    u8 *cpu_msix_table;
    u16 cpu_msix_table_sz;
    resource_size_t __iomem **reply_post_host_index;
    u32 ioc_reset_count;
    MPT3SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
    u32 non_operational_loop;
    u8 ioc_coredump_loop;
    u32 timestamp_update_count;
    u32 time_sync_interval;
    atomic64_t total_io_cnt;
    atomic64_t high_iops_outstanding;
    bool msix_load_balance;
    u16 thresh_hold;
    u8 high_iops_queues;
    u8 iopoll_q_start_index;
    u32 drv_internal_flags;
    u32 drv_support_bitmap;
    u32 dma_mask;
    bool enable_sdev_max_qd;
    bool use_32bit_dma;
    struct io_uring_poll_queue *io_uring_poll_queues;
    u8 scsi_io_cb_idx;
    u8 tm_cb_idx;
    u8 transport_cb_idx;
    u8 scsih_cb_idx;
    u8 ctl_cb_idx;
    u8 base_cb_idx;
    u8 port_enable_cb_idx;
    u8 config_cb_idx;
    u8 tm_tr_cb_idx;
    u8 tm_tr_volume_cb_idx;
    u8 tm_sas_control_cb_idx;
    struct _internal_cmd base_cmds;
    struct _internal_cmd port_enable_cmds;
    struct _internal_cmd transport_cmds;
    struct _internal_cmd scsih_cmds;
    struct _internal_cmd tm_cmds;
    struct _internal_cmd ctl_cmds;
    struct _internal_cmd config_cmds;
    MPT_ADD_SGE base_add_sg_single;
    MPT_BUILD_SG_SCMD build_sg_scmd;
    MPT_BUILD_SG build_sg;
    MPT_BUILD_ZERO_LEN_SGE build_zero_len_sge;
    u16 sge_size_ieee;
    u16 hba_mpi_version_belonged;
    MPT_BUILD_SG build_sg_mpi;
    MPT_BUILD_ZERO_LEN_SGE build_zero_len_sge_mpi;
    NVME_BUILD_PRP build_nvme_prp;
    u32 event_type[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS];
    u32 event_context;
    void *event_log;
    u32 event_masks[MPI2_EVENT_NOTIFY_EVENTMASK_WORDS];
    u8 tm_custom_handling;
    u8 nvme_abort_timeout;
    u16 max_shutdown_latency;
    u16 max_wideport_qd;
    u16 max_narrowport_qd;
    u16 max_nvme_qd;
    u8 max_sata_qd;
    struct mpt3sas_facts facts;
    struct mpt3sas_facts prev_fw_facts;
    struct mpt3sas_port_facts *pfacts;
    Mpi2ManufacturingPage0_t manu_pg0;
    struct Mpi2ManufacturingPage10_t manu_pg10;
    struct Mpi2ManufacturingPage11_t manu_pg11;
    Mpi2BiosPage2_t bios_pg2;
    Mpi2BiosPage3_t bios_pg3;
    Mpi2IOCPage8_t ioc_pg8;
    Mpi2IOUnitPage0_t iounit_pg0;
    Mpi2IOUnitPage1_t iounit_pg1;
    Mpi2IOCPage1_t ioc_pg1_copy;
    struct _boot_device req_boot_device;
    struct _boot_device req_alt_boot_device;
    struct _boot_device current_boot_device;
    struct _sas_node sas_hba;
    struct list_head sas_expander_list;
    struct list_head enclosure_list;
    spinlock_t sas_node_lock;
    struct list_head sas_device_list;
    struct list_head sas_device_init_list;
    spinlock_t sas_device_lock;
    struct list_head pcie_device_list;
    struct list_head pcie_device_init_list;
    spinlock_t pcie_device_lock;
    struct list_head raid_device_list;
    spinlock_t raid_device_lock;
    u8 io_missing_delay;
    u16 device_missing_delay;
    int sas_id;
    int pcie_target_id;
    void *blocking_handles;
    void *pd_handles;
    u16 pd_handles_sz;
    void *pend_os_device_add;
    u16 pend_os_device_add_sz;
    u16 config_page_sz;
    void *config_page;
    dma_addr_t config_page_dma;
    void *config_vaddr;
    u16 hba_queue_depth;
    u16 sge_size;
    u16 scsiio_depth;
    u16 request_sz;
    u8 *request;
    dma_addr_t request_dma;
    u32 request_dma_sz;
    struct pcie_sg_list *pcie_sg_lookup;
    spinlock_t scsi_lookup_lock;
    int pending_io_count;
    wait_queue_head_t reset_wq;
    u16 *io_queue_num;
    struct dma_pool *pcie_sgl_dma_pool;
    u32 page_size;
    struct chain_lookup *chain_lookup;
    struct list_head free_chain_list;
    struct dma_pool *chain_dma_pool;
    ulong chain_pages;
    u16 max_sges_in_main_message;
    u16 max_sges_in_chain_message;
    u16 chains_needed_per_io;
    u32 chain_depth;
    u16 chain_segment_sz;
    u16 chains_per_prp_buffer;
    u16 hi_priority_smid;
    u8 *hi_priority;
    dma_addr_t hi_priority_dma;
    u16 hi_priority_depth;
    struct request_tracker *hpr_lookup;
    struct list_head hpr_free_list;
    u16 internal_smid;
    u8 *internal;
    dma_addr_t internal_dma;
    u16 internal_depth;
    struct request_tracker *internal_lookup;
    struct list_head internal_free_list;
    u8 *sense;
    dma_addr_t sense_dma;
    struct dma_pool *sense_dma_pool;
    u16 reply_sz;
    u8 *reply;
    dma_addr_t reply_dma;
    u32 reply_dma_max_address;
    u32 reply_dma_min_address;
    struct dma_pool *reply_dma_pool;
    u16 reply_free_queue_depth;
    __le32 *reply_free;
    dma_addr_t reply_free_dma;
    struct dma_pool *reply_free_dma_pool;
    u32 reply_free_host_index;
    u16 reply_post_queue_depth;
    struct reply_post_struct *reply_post;
    u8 rdpq_array_capable;
    u8 rdpq_array_enable;
    u8 rdpq_array_enable_assigned;
    struct dma_pool *reply_post_free_dma_pool;
    struct dma_pool *reply_post_free_array_dma_pool;
    Mpi2IOCInitRDPQArrayEntry *reply_post_free_array;
    dma_addr_t reply_post_free_array_dma;
    u8 reply_queue_count;
    struct list_head reply_queue_list;
    u8 combined_reply_queue;
    u8 combined_reply_index_count;
    u8 smp_affinity_enable;
    resource_size_t __iomem **replyPostRegisterIndex;
    struct list_head delayed_tr_list;
    struct list_head delayed_tr_volume_list;
    struct list_head delayed_sc_list;
    struct list_head delayed_event_ack_list;
    u8 temp_sensors_count;
    struct mutex pci_access_mutex;
    u8 *diag_buffer[MPI2_DIAG_BUF_TYPE_COUNT];
    u32 diag_buffer_sz[MPI2_DIAG_BUF_TYPE_COUNT];
    dma_addr_t diag_buffer_dma[MPI2_DIAG_BUF_TYPE_COUNT];
    u8 diag_buffer_status[MPI2_DIAG_BUF_TYPE_COUNT];
    u32 unique_id[MPI2_DIAG_BUF_TYPE_COUNT];
    u32 product_specific[MPI2_DIAG_BUF_TYPE_COUNT][23];
    u32 diagnostic_flags[MPI2_DIAG_BUF_TYPE_COUNT];
    u32 ring_buffer_offset;
    u32 ring_buffer_sz;
    struct htb_rel_query htb_rel;
    u8 reset_from_user;
    u8 is_warpdrive;
    u8 is_mcpu_endpoint;
    u8 hide_ir_msg;
    u8 mfg_pg10_hide_flag;
    u8 hide_drives;
    spinlock_t diag_trigger_lock;
    u8 diag_trigger_active;
    u8 atomic_desc_capable;
    BASE_READ_REG base_readl;
    BASE_READ_REG base_readl_ext_retry;
    struct SL_WH_MASTER_TRIGGER_T diag_trigger_master;
    struct SL_WH_EVENT_TRIGGERS_T diag_trigger_event;
    struct SL_WH_SCSI_TRIGGERS_T diag_trigger_scsi;
    struct SL_WH_MPI_TRIGGERS_T diag_trigger_mpi;
    u8 supports_trigger_pages;
    void *device_remove_in_progress;
    u16 device_remove_in_progress_sz;
    u8 is_gen35_ioc;
    u8 is_aero_ioc;
    struct dentry   *debugfs_root;
    struct dentry   *ioc_dump;
  #if IS_REACHABLE(CONFIG_HWMON);
    struct mpt3sas_hwmon *hwmon;
  #endif;
    PUT_SMID_IO_FP_HIP put_smid_scsi_io;
    PUT_SMID_IO_FP_HIP put_smid_fast_path;
    PUT_SMID_IO_FP_HIP put_smid_hi_priority;
    PUT_SMID_DEFAULT put_smid_default;
    GET_MSIX_INDEX get_msix_index_for_smlio;
    u8 multipath_on_hba;
    struct list_head port_table_list;
};

πŸ’« Members πŸ’«

okay bestie, grab a snack because this is the full roster of struct members and there are a lot of them. every single one, in order, no skipping, we are nothing if not thorough πŸ’…

  • list β€” the ioc_list. iconic little linked-list moment.
  • shost β€” the shost object πŸŽ€
  • id β€” unique adapter id, everyone gets a name tag
  • cpu_count β€” number of online cpus
  • name β€” generic ioc string, kinda the nickname of the whole thing
  • tmp_string β€” tmp string used for logging ✨
  • pdev β€” pci pdev object
  • chip β€” memory mapped register space, the actual vibes of the hardware
  • chip_phys β€” physical address prior to mapping
  • logging_level β€” see mpt3sas_debug.h (go look, i'll wait 🫢)
  • fwfault_debug β€” debugging FW timeouts
  • ir_firmware β€” IR firmware present
  • bars β€” bitmask of BAR's that must be configured
  • mask_interrupts β€” ignore interrupt πŸ™ˆ
  • fault_reset_work_q β€” fw fault workqueue
  • fault_reset_work β€” fw fault work
  • firmware_event_thread β€” fw event work queue
  • fw_event_lock β€” no description given, she's mysterious and we respect it πŸ’€
  • fw_event_list β€” list of fw events
  • aen_event_read_flag β€” event log was read
  • broadcast_aen_busy β€” broadcast aen waiting to be serviced
  • shost_recovery β€” host reset in progress, do not disturb 🚧
  • ioc_reset_in_progress_lock β€” (again, no notes, just pure presence)
  • ioc_link_reset_in_progress β€” phy/hard reset in progress
  • ignore_loginfos β€” ignore loginfos during task management
  • remove_host β€” flag for when driver unloads, to avoid sending dev resets
  • pci_error_recovery β€” flag to prevent ioc access until slot reset completes
  • wait_for_discovery_to_complete β€” flag set at driver load time when waiting on reporting devices
  • is_driver_loading β€” flag set at driver load time
  • port_enable_failed β€” flag set when port enable has failed 😭
  • start_scan β€” flag set from scan_start callback, cleared from _mpt3sas_fw_work
  • start_scan_failed β€” means port enable failed, return's the ioc_status
  • msix_enable β€” flag indicating msix is enabled
  • msix_vector_count β€” number msix vectors
  • cpu_msix_table β€” table for mapping cpus to msix index
  • cpu_msix_table_sz β€” table size
  • schedule_dead_ioc_flush_running_cmds β€” callback to flush pending commands
  • ioc_coredump_loop β€” will have non-zero value when FW is in CoreDump state
  • timestamp_update_count β€” Counter to fire timeSync command. also hanging out here: time_sync_interval β€” Time sync interval read from man page 11 ✨
  • total_io_cnt β€” Gives total IO count, used to load balance the interrupts
  • high_iops_outstanding β€” used to load balance the interrupts within high iops reply queues
  • msix_load_balance β€” Enables load balancing of interrupts across the multiple MSIXs
  • thresh_hold β€” Max number of reply descriptors processed before updating Host Index
  • iopoll_q_start_index β€” starting index of io_uring poll queues in reply queue list
  • drv_internal_flags β€” Bit map internal to driver
  • drv_support_bitmap β€” driver's supported feature bit map
  • use_32bit_dma β€” Flag to use 32 bit consistent dma mask
  • scsi_io_cb_idx β€” shost generated commands
  • tm_cb_idx β€” task management commands
  • transport_cb_idx β€” transport internal commands
  • scsih_cb_idx β€” scsih internal commands
  • ctl_cb_idx β€” ctl internal commands
  • base_cb_idx β€” base internal commands
  • config_cb_idx β€” base internal commands
  • tm_tr_cb_idx β€” device removal target reset handshake
  • tm_tr_volume_cb_idx β€” volume removal target reset
  • base_cmds β€” name only, no description, still slaying 🫢
  • transport_cmds β€” name only, same energy
  • scsih_cmds β€” name only
  • tm_cmds β€” name only
  • ctl_cmds β€” name only
  • config_cmds β€” name only
  • base_add_sg_single β€” handler for either 32/64 bit sgl's
  • event_type β€” bits indicating which events to log
  • event_context β€” unique id for each logged event
  • event_log β€” event log pointer
  • event_masks β€” events that are masked
  • max_shutdown_latency β€” timeout value for NVMe shutdown operation, which is equal that NVMe drive's RTD3 Entry Latency which has reported maximum RTD3 Entry Latency value among attached NVMe drives.
  • facts β€” static facts data
  • prev_fw_facts β€” previous fw facts data
  • pfacts β€” static port facts data
  • manu_pg0 β€” static manufacturing page 0
  • manu_pg10 β€” static manufacturing page 10
  • manu_pg11 β€” static manufacturing page 11
  • bios_pg2 β€” static bios page 2
  • bios_pg3 β€” static bios page 3
  • ioc_pg8 β€” static ioc page 8
  • iounit_pg0 β€” static iounit page 0
  • iounit_pg1 β€” static iounit page 1
  • sas_hba β€” sas host object πŸ¦‹
  • sas_expander_list β€” expander object list
  • enclosure_list β€” enclosure object list
  • sas_node_lock β€” no notes needed, she locks
  • sas_device_list β€” sas device object list
  • sas_device_init_list β€” sas device object list (used only at init time)
  • sas_device_lock β€” yes queen, lock it down
  • pcie_device_list β€” pcie device object list
  • pcie_device_init_list β€” pcie device object list (used only at init time)
  • pcie_device_lock β€” another lock, another slay
  • io_missing_delay β€” time for IO completed by fw when PDR enabled
  • device_missing_delay β€” time for device missing by fw when PDR enabled
  • sas_id β€” used for setting volume target IDs
  • pcie_target_id β€” used for setting pcie target IDs
  • blocking_handles β€” bitmask used to identify which devices need blocking
  • pd_handles β€” bitmask for PD handles
  • pd_handles_sz β€” size of pd_handle bitmask
  • config_page_sz β€” config page size
  • config_page β€” reserve memory for config page payload
  • config_page_dma β€” name only, keeping it lowkey
  • hba_queue_depth β€” hba request queue depth
  • sge_size β€” sg element size for either 32/64 bit
  • scsiio_depth β€” SCSI_IO queue depth
  • request_sz β€” per request frame size
  • request β€” pool of request frames
  • request_dma β€” name only
  • request_dma_sz β€” name only
  • scsi_lookup_lock β€” name only, a lock, we stan
  • pending_io_count β€” name only
  • reset_wq β€” name only
  • max_sges_in_main_message β€” number sg elements in main message
  • max_sges_in_chain_message β€” number sg elements per chain
  • chains_needed_per_io β€” max chains per io
  • chain_depth β€” total chains allocated
  • chain_segment_sz β€” gives the max number of SGEs accommodate on single chain buffer
  • hi_priority_smid β€” name only
  • hi_priority β€” name only
  • hi_priority_dma β€” name only
  • hi_priority_depth β€” name only
  • hpr_lookup β€” name only
  • hpr_free_list β€” name only
  • internal_smid β€” name only
  • internal β€” name only
  • internal_dma β€” name only
  • internal_depth β€” name only
  • internal_lookup β€” name only
  • internal_free_list β€” name only
  • sense β€” pool of sense
  • sense_dma β€” name only
  • sense_dma_pool β€” name only
  • reply_sz β€” per reply frame size:
  • reply β€” pool of replys:
  • reply_dma β€” name only
  • reply_dma_pool β€” name only
  • reply_free_queue_depth β€” reply free depth
  • reply_free β€” pool for reply free queue (32 bit addr)
  • reply_free_dma β€” name only
  • reply_free_dma_pool β€” name only
  • reply_free_host_index β€” tail index in pool to insert free replys
  • reply_post_queue_depth β€” reply post queue depth
  • rdpq_array_capable β€” FW supports multiple reply queue addresses in ioc_init
  • rdpq_array_enable β€” rdpq_array support is enabled in the driver
  • rdpq_array_enable_assigned β€” this ensures that rdpq_array_enable flag is assigned only ones
  • reply_queue_count β€” number of reply queue's
  • reply_queue_list β€” link list contaning the reply queue info
  • replyPostRegisterIndex β€” index of next position in Reply Desc Post Queue
  • delayed_tr_list β€” target reset link list
  • delayed_tr_volume_list β€” volume target reset link list
  • delayed_sc_list β€” name only πŸŽ€
  • delayed_event_ack_list β€” name only
  • temp_sensors_count β€” flag to carry the number of temperature sensors
  • pci_access_mutex β€” Mutex to synchronize ioctl, sysfs show path and pci resource handling. PCI resource freeing will lead to free vital hardware/memory resource, which might be in use by cli/sysfs path functions resulting in Null pointer reference followed by kernel crash. To avoid the above race condition we use mutex syncrhonization which ensures the syncrhonization between cli/sysfs_show path.
bestie that last one is not a vibe to mess with β€” the whole point is avoiding a Null pointer reference followed by kernel crash, so respect the mutex fr fr 😭
  • atomic_desc_capable β€” Atomic Request Descriptor support.
  • multipath_on_hba β€” flag to determine multipath on hba is enabled or not
  • port_table_list β€” list containing HBA's wide/narrow port's info 🌈

🌸 SEE ALSO 🌸

go read these next, the lore is deep and they all live in the kernel file ./drivers/scsi/mpt3sas/mpt3sas_base.h:

  • struct MPT3SAS_TARGET(9)
  • struct MPT3SAS_DEVICE(9)
  • struct _internal_cmd(9)
  • struct _sas_device(9)
  • pcie_device_get(9)
  • pcie_device_free(9)
  • pcie_device_put(9)
  • struct _boot_device(9)
  • struct _sas_port(9)
  • struct _sas_phy(9)
  • struct _sas_node(9)
  • struct _enclosure_node(9)
  • enum reset_type(9)
  • struct pcie_sg_list(9)
  • struct chain_tracker(9)
  • struct scsiio_tracker(9)
  • struct request_tracker(9)
  • struct _tr_list(9)
  • struct _sc_list(9)
  • struct _event_ack_list(9)
  • struct adapter_reply_queue(9)
  • struct io_uring_poll_queue(9)
  • struct virtual_phy(9)
  • struct hba_port(9)
  • struct htb_rel_query(9)

and that's the whole struct, no cap 🫢 this page lives at ./drivers/scsi/mpt3sas, dated October 2026, and yes it's about struct MPT3SAS_ADAPTER(9) β€” go forth and read kernel source, you're gonna do amazing bestie πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from