/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * * Linux MegaRAID device driver * * Copyright (c) 2003-2004 LSI Logic Corporation. * * FILE : megaraid_mbox.h */ #ifndef _MEGARAID_H_ #define _MEGARAID_H_ #include "mega_common.h" #include "mbox_defs.h" #include "megaraid_ioctl.h" #define MEGARAID_VERSION … #define MEGARAID_EXT_VERSION … /* * Define some PCI values here until they are put in the kernel */ #define PCI_DEVICE_ID_PERC4_DI_DISCOVERY … #define PCI_SUBSYS_ID_PERC4_DI_DISCOVERY … #define PCI_DEVICE_ID_PERC4_SC … #define PCI_SUBSYS_ID_PERC4_SC … #define PCI_DEVICE_ID_PERC4_DC … #define PCI_SUBSYS_ID_PERC4_DC … #define PCI_DEVICE_ID_VERDE … #define PCI_DEVICE_ID_PERC4_DI_EVERGLADES … #define PCI_SUBSYS_ID_PERC4_DI_EVERGLADES … #define PCI_DEVICE_ID_PERC4E_SI_BIGBEND … #define PCI_SUBSYS_ID_PERC4E_SI_BIGBEND … #define PCI_DEVICE_ID_PERC4E_DI_KOBUK … #define PCI_SUBSYS_ID_PERC4E_DI_KOBUK … #define PCI_DEVICE_ID_PERC4E_DI_CORVETTE … #define PCI_SUBSYS_ID_PERC4E_DI_CORVETTE … #define PCI_DEVICE_ID_PERC4E_DI_EXPEDITION … #define PCI_SUBSYS_ID_PERC4E_DI_EXPEDITION … #define PCI_DEVICE_ID_PERC4E_DI_GUADALUPE … #define PCI_SUBSYS_ID_PERC4E_DI_GUADALUPE … #define PCI_DEVICE_ID_DOBSON … #define PCI_DEVICE_ID_MEGARAID_SCSI_320_0 … #define PCI_SUBSYS_ID_MEGARAID_SCSI_320_0 … #define PCI_DEVICE_ID_MEGARAID_SCSI_320_1 … #define PCI_SUBSYS_ID_MEGARAID_SCSI_320_1 … #define PCI_DEVICE_ID_MEGARAID_SCSI_320_2 … #define PCI_SUBSYS_ID_MEGARAID_SCSI_320_2 … #define PCI_DEVICE_ID_MEGARAID_I4_133_RAID … #define PCI_SUBSYS_ID_MEGARAID_I4_133_RAID … #define PCI_DEVICE_ID_MEGARAID_SATA_150_4 … #define PCI_SUBSYS_ID_MEGARAID_SATA_150_4 … #define PCI_DEVICE_ID_MEGARAID_SATA_150_6 … #define PCI_SUBSYS_ID_MEGARAID_SATA_150_6 … #define PCI_DEVICE_ID_LINDSAY … #define PCI_DEVICE_ID_INTEL_RAID_SRCS16 … #define PCI_SUBSYS_ID_INTEL_RAID_SRCS16 … #define PCI_DEVICE_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK … #define PCI_SUBSYS_ID_INTEL_RAID_SRCU41L_LAKE_SHETEK … #define PCI_SUBSYS_ID_PERC3_QC … #define PCI_SUBSYS_ID_PERC3_DC … #define PCI_SUBSYS_ID_PERC3_SC … #define PCI_SUBSYS_ID_CERC_ATA100_4CH … #define MBOX_MAX_SCSI_CMDS … #define MBOX_MAX_USER_CMDS … #define MBOX_DEF_CMD_PER_LUN … #define MBOX_DEFAULT_SG_SIZE … #define MBOX_MAX_SG_SIZE … #define MBOX_MAX_SECTORS … #define MBOX_TIMEOUT … #define MBOX_BUSY_WAIT … #define MBOX_RESET_WAIT … #define MBOX_RESET_EXT_WAIT … #define MBOX_SYNC_WAIT_CNT … #define MBOX_SYNC_DELAY_200 … /* * maximum transfer that can happen through the firmware commands issued * internnaly from the driver. */ #define MBOX_IBUF_SIZE … /** * mbox_ccb_t - command control block specific to mailbox based controllers * @raw_mbox : raw mailbox pointer * @mbox : mailbox * @mbox64 : extended mailbox * @mbox_dma_h : mailbox dma address * @sgl64 : 64-bit scatter-gather list * @sgl32 : 32-bit scatter-gather list * @sgl_dma_h : dma handle for the scatter-gather list * @pthru : passthru structure * @pthru_dma_h : dma handle for the passthru structure * @epthru : extended passthru structure * @epthru_dma_h : dma handle for extended passthru structure * @buf_dma_h : dma handle for buffers w/o sg list * * command control block specific to the mailbox based controllers */ mbox_ccb_t; /** * mraid_device_t - adapter soft state structure for mailbox controllers * @una_mbox64 : 64-bit mbox - unaligned * @una_mbox64_dma : mbox dma addr - unaligned * @mbox : 32-bit mbox - aligned * @mbox64 : 64-bit mbox - aligned * @mbox_dma : mbox dma addr - aligned * @mailbox_lock : exclusion lock for the mailbox * @baseport : base port of hba memory * @baseaddr : mapped addr of hba memory * @mbox_pool : pool of mailboxes * @mbox_pool_handle : handle for the mailbox pool memory * @epthru_pool : a pool for extended passthru commands * @epthru_pool_handle : handle to the pool above * @sg_pool : pool of scatter-gather lists for this driver * @sg_pool_handle : handle to the pool above * @ccb_list : list of our command control blocks * @uccb_list : list of cmd control blocks for mgmt module * @umbox64 : array of mailbox for user commands (cmm) * @pdrv_state : array for state of each physical drive. * @last_disp : flag used to show device scanning * @hw_error : set if FW not responding * @fast_load : If set, skip physical device scanning * @channel_class : channel class, RAID or SCSI * @sysfs_mtx : mutex to serialize access to sysfs res. * @sysfs_uioc : management packet to issue FW calls from sysfs * @sysfs_mbox64 : mailbox packet to issue FW calls from sysfs * @sysfs_buffer : data buffer for FW commands issued from sysfs * @sysfs_buffer_dma : DMA buffer for FW commands issued from sysfs * @sysfs_wait_q : wait queue for sysfs operations * @random_del_supported : set if the random deletion is supported * @curr_ldmap : current LDID map * * Initialization structure for mailbox controllers: memory based and IO based * All the fields in this structure are LLD specific and may be discovered at * init() or start() time. * * NOTE: The fields of this structures are placed to minimize cache misses */ #define MAX_LD_EXTENDED64 … mraid_device_t; // route to raid device from adapter #define ADAP2RAIDDEV(adp) … #define MAILBOX_LOCK(rdev) … // Find out if this channel is a RAID or SCSI #define IS_RAID_CH(rdev, ch) … #define RDINDOOR(rdev) … #define RDOUTDOOR(rdev) … #define WRINDOOR(rdev, value) … #define WROUTDOOR(rdev, value) … #endif // _MEGARAID_H_