• Home
  • Raw
  • Download

Lines Matching refs:ctrl_info

81 static int sis_wait_for_ctrl_ready_with_timeout(struct pqi_ctrl_info *ctrl_info,  in sis_wait_for_ctrl_ready_with_timeout()  argument
90 status = readl(&ctrl_info->registers->sis_firmware_status); in sis_wait_for_ctrl_ready_with_timeout()
93 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_ctrl_ready_with_timeout()
96 &ctrl_info->registers->sis_mailbox[7])); in sis_wait_for_ctrl_ready_with_timeout()
103 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_ctrl_ready_with_timeout()
114 int sis_wait_for_ctrl_ready(struct pqi_ctrl_info *ctrl_info) in sis_wait_for_ctrl_ready() argument
116 return sis_wait_for_ctrl_ready_with_timeout(ctrl_info, in sis_wait_for_ctrl_ready()
120 int sis_wait_for_ctrl_ready_resume(struct pqi_ctrl_info *ctrl_info) in sis_wait_for_ctrl_ready_resume() argument
122 return sis_wait_for_ctrl_ready_with_timeout(ctrl_info, in sis_wait_for_ctrl_ready_resume()
126 bool sis_is_firmware_running(struct pqi_ctrl_info *ctrl_info) in sis_is_firmware_running() argument
131 status = readl(&ctrl_info->registers->sis_firmware_status); in sis_is_firmware_running()
139 dev_err(&ctrl_info->pci_dev->dev, in sis_is_firmware_running()
141 readl(&ctrl_info->registers->sis_mailbox[7])); in sis_is_firmware_running()
146 bool sis_is_kernel_up(struct pqi_ctrl_info *ctrl_info) in sis_is_kernel_up() argument
148 return readl(&ctrl_info->registers->sis_firmware_status) & in sis_is_kernel_up()
157 static int sis_send_sync_cmd(struct pqi_ctrl_info *ctrl_info, in sis_send_sync_cmd() argument
166 registers = ctrl_info->registers; in sis_send_sync_cmd()
212 dev_err(&ctrl_info->pci_dev->dev, in sis_send_sync_cmd()
233 int sis_get_ctrl_properties(struct pqi_ctrl_info *ctrl_info) in sis_get_ctrl_properties() argument
242 rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_GET_ADAPTER_PROPERTIES, in sis_get_ctrl_properties()
259 ctrl_info->pqi_reset_quiesce_supported = true; in sis_get_ctrl_properties()
264 int sis_get_pqi_capabilities(struct pqi_ctrl_info *ctrl_info) in sis_get_pqi_capabilities() argument
271 rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_GET_PQI_CAPABILITIES, in sis_get_pqi_capabilities()
276 ctrl_info->max_sg_entries = params.mailbox[1]; in sis_get_pqi_capabilities()
277 ctrl_info->max_transfer_size = params.mailbox[2]; in sis_get_pqi_capabilities()
278 ctrl_info->max_outstanding_requests = params.mailbox[3]; in sis_get_pqi_capabilities()
279 ctrl_info->config_table_offset = params.mailbox[4]; in sis_get_pqi_capabilities()
280 ctrl_info->config_table_length = params.mailbox[5]; in sis_get_pqi_capabilities()
285 int sis_init_base_struct_addr(struct pqi_ctrl_info *ctrl_info) in sis_init_base_struct_addr() argument
301 error_buffer_paddr = (unsigned long)ctrl_info->error_buffer_dma_handle; in sis_init_base_struct_addr()
310 put_unaligned_le32(ctrl_info->max_io_slots, in sis_init_base_struct_addr()
313 bus_address = dma_map_single(&ctrl_info->pci_dev->dev, base_struct, in sis_init_base_struct_addr()
315 if (dma_mapping_error(&ctrl_info->pci_dev->dev, bus_address)) { in sis_init_base_struct_addr()
325 rc = sis_send_sync_cmd(ctrl_info, SIS_CMD_INIT_BASE_STRUCT_ADDRESS, in sis_init_base_struct_addr()
328 dma_unmap_single(&ctrl_info->pci_dev->dev, bus_address, in sis_init_base_struct_addr()
339 struct pqi_ctrl_info *ctrl_info, u32 bit) in sis_wait_for_doorbell_bit_to_clear() argument
349 readl(&ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_wait_for_doorbell_bit_to_clear()
352 if (readl(&ctrl_info->registers->sis_firmware_status) & in sis_wait_for_doorbell_bit_to_clear()
358 dev_err(&ctrl_info->pci_dev->dev, in sis_wait_for_doorbell_bit_to_clear()
370 static inline int sis_set_doorbell_bit(struct pqi_ctrl_info *ctrl_info, u32 bit) in sis_set_doorbell_bit() argument
372 writel(bit, &ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_set_doorbell_bit()
374 return sis_wait_for_doorbell_bit_to_clear(ctrl_info, bit); in sis_set_doorbell_bit()
377 void sis_enable_msix(struct pqi_ctrl_info *ctrl_info) in sis_enable_msix() argument
379 sis_set_doorbell_bit(ctrl_info, SIS_ENABLE_MSIX); in sis_enable_msix()
382 void sis_enable_intx(struct pqi_ctrl_info *ctrl_info) in sis_enable_intx() argument
384 sis_set_doorbell_bit(ctrl_info, SIS_ENABLE_INTX); in sis_enable_intx()
387 void sis_shutdown_ctrl(struct pqi_ctrl_info *ctrl_info) in sis_shutdown_ctrl() argument
389 if (readl(&ctrl_info->registers->sis_firmware_status) & in sis_shutdown_ctrl()
394 &ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_shutdown_ctrl()
397 int sis_pqi_reset_quiesce(struct pqi_ctrl_info *ctrl_info) in sis_pqi_reset_quiesce() argument
399 return sis_set_doorbell_bit(ctrl_info, SIS_PQI_RESET_QUIESCE); in sis_pqi_reset_quiesce()
402 int sis_reenable_sis_mode(struct pqi_ctrl_info *ctrl_info) in sis_reenable_sis_mode() argument
404 return sis_set_doorbell_bit(ctrl_info, SIS_REENABLE_SIS_MODE); in sis_reenable_sis_mode()
407 void sis_write_driver_scratch(struct pqi_ctrl_info *ctrl_info, u32 value) in sis_write_driver_scratch() argument
409 writel(value, &ctrl_info->registers->sis_driver_scratch); in sis_write_driver_scratch()
412 u32 sis_read_driver_scratch(struct pqi_ctrl_info *ctrl_info) in sis_read_driver_scratch() argument
414 return readl(&ctrl_info->registers->sis_driver_scratch); in sis_read_driver_scratch()
417 void sis_soft_reset(struct pqi_ctrl_info *ctrl_info) in sis_soft_reset() argument
420 &ctrl_info->registers->sis_host_to_ctrl_doorbell); in sis_soft_reset()