Lines Matching refs:ctrl_info

91 static int sis_wait_for_ctrl_ready_with_timeout(struct pqi_ctrl_info *ctrl_info,  in sis_wait_for_ctrl_ready_with_timeout()  argument
100 status = readl(&ctrl_info->registers->sis_firmware_status); in sis_wait_for_ctrl_ready_with_timeout()
103 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_ctrl_ready_with_timeout()
106 &ctrl_info->registers->sis_mailbox[7])); in sis_wait_for_ctrl_ready_with_timeout()
113 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_ctrl_ready_with_timeout()
124 int sis_wait_for_ctrl_ready(struct pqi_ctrl_info *ctrl_info) in sis_wait_for_ctrl_ready() argument
126 return sis_wait_for_ctrl_ready_with_timeout(ctrl_info, in sis_wait_for_ctrl_ready()
130 int sis_wait_for_ctrl_ready_resume(struct pqi_ctrl_info *ctrl_info) in sis_wait_for_ctrl_ready_resume() argument
132 return sis_wait_for_ctrl_ready_with_timeout(ctrl_info, in sis_wait_for_ctrl_ready_resume()
136 bool sis_is_firmware_running(struct pqi_ctrl_info *ctrl_info) in sis_is_firmware_running() argument
141 status = readl(&ctrl_info->registers->sis_firmware_status); in sis_is_firmware_running()
149 dev_err(&ctrl_info->pci_dev->dev, in sis_is_firmware_running()
151 readl(&ctrl_info->registers->sis_mailbox[7])); in sis_is_firmware_running()
156 bool sis_is_kernel_up(struct pqi_ctrl_info *ctrl_info) in sis_is_kernel_up() argument
158 return readl(&ctrl_info->registers->sis_firmware_status) & in sis_is_kernel_up()
162 u32 sis_get_product_id(struct pqi_ctrl_info *ctrl_info) in sis_get_product_id() argument
164 return readl(&ctrl_info->registers->sis_product_identifier); in sis_get_product_id()
172 static int sis_send_sync_cmd(struct pqi_ctrl_info *ctrl_info, in sis_send_sync_cmd() argument
181 registers = ctrl_info->registers; in sis_send_sync_cmd()
228 dev_err(&ctrl_info->pci_dev->dev, in sis_send_sync_cmd()
249 int sis_get_ctrl_properties(struct pqi_ctrl_info *ctrl_info) in sis_get_ctrl_properties() argument
258 rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_GET_ADAPTER_PROPERTIES, in sis_get_ctrl_properties()
275 ctrl_info->pqi_reset_quiesce_supported = true; in sis_get_ctrl_properties()
280 int sis_get_pqi_capabilities(struct pqi_ctrl_info *ctrl_info) in sis_get_pqi_capabilities() argument
287 rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_GET_PQI_CAPABILITIES, in sis_get_pqi_capabilities()
292 ctrl_info->max_sg_entries = params.mailbox[1]; in sis_get_pqi_capabilities()
293 ctrl_info->max_transfer_size = params.mailbox[2]; in sis_get_pqi_capabilities()
294 ctrl_info->max_outstanding_requests = params.mailbox[3]; in sis_get_pqi_capabilities()
295 ctrl_info->config_table_offset = params.mailbox[4]; in sis_get_pqi_capabilities()
296 ctrl_info->config_table_length = params.mailbox[5]; in sis_get_pqi_capabilities()
301 int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info) in sis_init_base_struct_addr() argument
317 error_buffer_paddr = (unsigned long)ctrl_info->error_buffer_dma_handle; in sis_init_base_struct_addr()
326 put_unaligned_le32(ctrl_info->max_io_slots, in sis_init_base_struct_addr()
329 bus_address = dma_map_single(&ctrl_info->pci_dev->dev, base_struct, in sis_init_base_struct_addr()
331 if (dma_mapping_error(&ctrl_info->pci_dev->dev, bus_address)) { in sis_init_base_struct_addr()
341 rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_INIT_BASE_STRUCT_ADDRESS, in sis_init_base_struct_addr()
344 dma_unmap_single(&ctrl_info->pci_dev->dev, bus_address, in sis_init_base_struct_addr()
355 struct pqi_ctrl_info *ctrl_info, u32 bit) in sis_wait_for_doorbell_bit_to_clear() argument
365 readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_wait_for_doorbell_bit_to_clear()
368 if (readl(&ctrl_info->registers->sis_firmware_status) & in sis_wait_for_doorbell_bit_to_clear()
374 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_doorbell_bit_to_clear()
386 static inline int sis_set_doorbell_bit(struct pqi_ctrl_info *ctrl_info, u32 bit) in sis_set_doorbell_bit() argument
388 writel(bit, &ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_set_doorbell_bit()
391 return sis_wait_for_doorbell_bit_to_clear(ctrl_info, bit); in sis_set_doorbell_bit()
394 void sis_enable_msix(struct pqi_ctrl_info *ctrl_info) in sis_enable_msix() argument
396 sis_set_doorbell_bit(ctrl_info, SIS_ENABLE_MSIX); in sis_enable_msix()
399 void sis_enable_intx(struct pqi_ctrl_info *ctrl_info) in sis_enable_intx() argument
401 sis_set_doorbell_bit(ctrl_info, SIS_ENABLE_INTX); in sis_enable_intx()
404 void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info, in sis_shutdown_ctrl() argument
407 if (readl(&ctrl_info->registers->sis_firmware_status) & in sis_shutdown_ctrl()
411 if (ctrl_info->firmware_triage_supported) in sis_shutdown_ctrl()
412 writel(ctrl_shutdown_reason, &ctrl_info->registers->sis_ctrl_shutdown_reason_code); in sis_shutdown_ctrl()
414 writel(SIS_TRIGGER_SHUTDOWN, &ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_shutdown_ctrl()
417 int sis_pqi_reset_quiesce(struct pqi_ctrl_info *ctrl_info) in sis_pqi_reset_quiesce() argument
419 return sis_set_doorbell_bit(ctrl_info, SIS_PQI_RESET_QUIESCE); in sis_pqi_reset_quiesce()
422 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info) in sis_reenable_sis_mode() argument
424 return sis_set_doorbell_bit(ctrl_info, SIS_REENABLE_SIS_MODE); in sis_reenable_sis_mode()
427 void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value) in sis_write_driver_scratch() argument
429 writel(value, &ctrl_info->registers->sis_driver_scratch); in sis_write_driver_scratch()
433 u32 sis_read_driver_scratch(struct pqi_ctrl_info *ctrl_info) in sis_read_driver_scratch() argument
435 return readl(&ctrl_info->registers->sis_driver_scratch); in sis_read_driver_scratch()
439 sis_read_firmware_triage_status(struct pqi_ctrl_info *ctrl_info) in sis_read_firmware_triage_status() argument
441 return ((enum sis_fw_triage_status)(readl(&ctrl_info->registers->sis_firmware_status) & in sis_read_firmware_triage_status()
445 void sis_soft_reset(struct pqi_ctrl_info *ctrl_info) in sis_soft_reset() argument
448 &ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_soft_reset()
454 int sis_wait_for_fw_triage_completion(struct pqi_ctrl_info *ctrl_info) in sis_wait_for_fw_triage_completion() argument
462 status = sis_read_firmware_triage_status(ctrl_info); in sis_wait_for_fw_triage_completion()
464 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_fw_triage_completion()
475 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_fw_triage_completion()