#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <scsi/scsi_device.h>
#include <linux/unaligned.h>
#include "smartpqi.h"
#include "smartpqi_sis.h"
#define SIS_CMD_GET_ADAPTER_PROPERTIES …
#define SIS_CMD_INIT_BASE_STRUCT_ADDRESS …
#define SIS_CMD_GET_PQI_CAPABILITIES …
#define SIS_REENABLE_SIS_MODE …
#define SIS_ENABLE_MSIX …
#define SIS_ENABLE_INTX …
#define SIS_SOFT_RESET …
#define SIS_CMD_READY …
#define SIS_NOTIFY_KDUMP …
#define SIS_TRIGGER_SHUTDOWN …
#define SIS_PQI_RESET_QUIESCE …
#define SIS_CMD_COMPLETE …
#define SIS_CLEAR_CTRL_TO_HOST_DOORBELL …
#define SIS_CMD_STATUS_SUCCESS …
#define SIS_CMD_COMPLETE_TIMEOUT_SECS …
#define SIS_CMD_COMPLETE_POLL_INTERVAL_MSECS …
#define SIS_EXTENDED_PROPERTIES_SUPPORTED …
#define SIS_SMARTARRAY_FEATURES_SUPPORTED …
#define SIS_PQI_MODE_SUPPORTED …
#define SIS_PQI_RESET_QUIESCE_SUPPORTED …
#define SIS_REQUIRED_EXTENDED_PROPERTIES …
#define SIS_BASE_STRUCT_REVISION …
#define SIS_BASE_STRUCT_ALIGNMENT …
#define SIS_CTRL_KERNEL_FW_TRIAGE …
#define SIS_CTRL_KERNEL_CTRL_LOGGING …
#define SIS_CTRL_KERNEL_CTRL_LOGGING_STATUS …
#define SIS_CTRL_KERNEL_UP …
#define SIS_CTRL_KERNEL_PANIC …
#define SIS_CTRL_READY_TIMEOUT_SECS …
#define SIS_CTRL_READY_RESUME_TIMEOUT_SECS …
#define SIS_CTRL_READY_POLL_INTERVAL_MSECS …
enum sis_fw_triage_status { … };
enum sis_ctrl_logging_status { … };
#pragma pack(1)
struct sis_base_struct { … };
#pragma pack()
unsigned int sis_ctrl_ready_timeout_secs = …;
static int sis_wait_for_ctrl_ready_with_timeout(struct pqi_ctrl_info *ctrl_info,
unsigned int timeout_secs)
{ … }
int sis_wait_for_ctrl_ready(struct pqi_ctrl_info *ctrl_info)
{ … }
int sis_wait_for_ctrl_ready_resume(struct pqi_ctrl_info *ctrl_info)
{ … }
bool sis_is_firmware_running(struct pqi_ctrl_info *ctrl_info)
{ … }
bool sis_is_kernel_up(struct pqi_ctrl_info *ctrl_info)
{ … }
u32 sis_get_product_id(struct pqi_ctrl_info *ctrl_info)
{ … }
struct sis_sync_cmd_params { … };
static int sis_send_sync_cmd(struct pqi_ctrl_info *ctrl_info,
u32 cmd, struct sis_sync_cmd_params *params)
{ … }
int sis_get_ctrl_properties(struct pqi_ctrl_info *ctrl_info)
{ … }
int sis_get_pqi_capabilities(struct pqi_ctrl_info *ctrl_info)
{ … }
int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info)
{ … }
#define SIS_DOORBELL_BIT_CLEAR_TIMEOUT_SECS …
static int sis_wait_for_doorbell_bit_to_clear(
struct pqi_ctrl_info *ctrl_info, u32 bit)
{ … }
static inline int sis_set_doorbell_bit(struct pqi_ctrl_info *ctrl_info, u32 bit)
{ … }
void sis_enable_msix(struct pqi_ctrl_info *ctrl_info)
{ … }
void sis_enable_intx(struct pqi_ctrl_info *ctrl_info)
{ … }
void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info,
enum pqi_ctrl_shutdown_reason ctrl_shutdown_reason)
{ … }
int sis_pqi_reset_quiesce(struct pqi_ctrl_info *ctrl_info)
{ … }
int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info)
{ … }
void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value)
{ … }
u32 sis_read_driver_scratch(struct pqi_ctrl_info *ctrl_info)
{ … }
static inline enum sis_fw_triage_status
sis_read_firmware_triage_status(struct pqi_ctrl_info *ctrl_info)
{ … }
bool sis_is_ctrl_logging_supported(struct pqi_ctrl_info *ctrl_info)
{ … }
void sis_notify_kdump(struct pqi_ctrl_info *ctrl_info)
{ … }
static inline enum sis_ctrl_logging_status sis_read_ctrl_logging_status(struct pqi_ctrl_info *ctrl_info)
{ … }
void sis_soft_reset(struct pqi_ctrl_info *ctrl_info)
{ … }
#define SIS_FW_TRIAGE_STATUS_TIMEOUT_SECS …
#define SIS_FW_TRIAGE_STATUS_POLL_INTERVAL_SECS …
int sis_wait_for_fw_triage_completion(struct pqi_ctrl_info *ctrl_info)
{ … }
#define SIS_CTRL_LOGGING_STATUS_TIMEOUT_SECS …
#define SIS_CTRL_LOGGING_STATUS_POLL_INTERVAL_SECS …
int sis_wait_for_ctrl_logging_completion(struct pqi_ctrl_info *ctrl_info)
{ … }
void sis_verify_structures(void)
{ … }