drv_fcoe_fw_funcs.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* QLogic FCoE Offload Driver
  3. * Copyright (c) 2016-2018 Cavium Inc.
  4. */
  5. #ifndef _FCOE_FW_FUNCS_H
  6. #define _FCOE_FW_FUNCS_H
  7. #include "drv_scsi_fw_funcs.h"
  8. #include "qedf_hsi.h"
  9. #include <linux/qed/qed_if.h>
  10. struct fcoe_task_params {
  11. /* Output parameter [set/filled by the HSI function] */
  12. struct fcoe_task_context *context;
  13. /* Output parameter [set/filled by the HSI function] */
  14. struct fcoe_wqe *sqe;
  15. enum fcoe_task_type task_type;
  16. u32 tx_io_size; /* in bytes */
  17. u32 rx_io_size; /* in bytes */
  18. u32 conn_cid;
  19. u16 itid;
  20. u8 cq_rss_number;
  21. /* Whether it's Tape device or not (0=Disk, 1=Tape) */
  22. u8 is_tape_device;
  23. };
  24. /**
  25. * @brief init_initiator_rw_fcoe_task - Initializes FCoE task context for
  26. * read/write task types and init fcoe_sqe
  27. *
  28. * @param task_params - Pointer to task parameters struct
  29. * @param sgl_task_params - Pointer to SGL task params
  30. * @param sense_data_buffer_phys_addr - Pointer to sense data buffer
  31. * @param task_retry_id - retry identification - Used only for Tape device
  32. * @param fcp_cmnd_payload - FCP CMD Payload
  33. */
  34. int init_initiator_rw_fcoe_task(struct fcoe_task_params *task_params,
  35. struct scsi_sgl_task_params *sgl_task_params,
  36. struct regpair sense_data_buffer_phys_addr,
  37. u32 task_retry_id,
  38. u8 fcp_cmd_payload[32]);
  39. /**
  40. * @brief init_initiator_midpath_fcoe_task - Initializes FCoE task context for
  41. * midpath/unsolicited task types and init fcoe_sqe
  42. *
  43. * @param task_params - Pointer to task parameters struct
  44. * @param mid_path_fc_header - FC header
  45. * @param tx_sgl_task_params - Pointer to Tx SGL task params
  46. * @param rx_sgl_task_params - Pointer to Rx SGL task params
  47. * @param fw_to_place_fc_header - Indication if the FW will place the FC header
  48. * in addition to the data arrives.
  49. */
  50. int init_initiator_midpath_unsolicited_fcoe_task(
  51. struct fcoe_task_params *task_params,
  52. struct fcoe_tx_mid_path_params *mid_path_fc_header,
  53. struct scsi_sgl_task_params *tx_sgl_task_params,
  54. struct scsi_sgl_task_params *rx_sgl_task_params,
  55. u8 fw_to_place_fc_header);
  56. /**
  57. * @brief init_initiator_abort_fcoe_task - Initializes FCoE task context for
  58. * abort task types and init fcoe_sqe
  59. *
  60. * @param task_params - Pointer to task parameters struct
  61. */
  62. int init_initiator_abort_fcoe_task(struct fcoe_task_params *task_params);
  63. /**
  64. * @brief init_initiator_cleanup_fcoe_task - Initializes FCoE task context for
  65. * cleanup task types and init fcoe_sqe
  66. *
  67. *
  68. * @param task_params - Pointer to task parameters struct
  69. */
  70. int init_initiator_cleanup_fcoe_task(struct fcoe_task_params *task_params);
  71. /**
  72. * @brief init_initiator_cleanup_fcoe_task - Initializes FCoE task context for
  73. * sequence recovery task types and init fcoe_sqe
  74. *
  75. *
  76. * @param task_params - Pointer to task parameters struct
  77. * @param desired_offset - The desired offest the task will be re-sent from
  78. */
  79. int init_initiator_sequence_recovery_fcoe_task(
  80. struct fcoe_task_params *task_params,
  81. u32 desired_offset);
  82. #endif