qed_iscsi.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* QLogic qed NIC Driver
  2. * Copyright (c) 2015 QLogic Corporation
  3. *
  4. * This software is available under the terms of the GNU General Public License
  5. * (GPL) Version 2, available from the file COPYING in the main directory of
  6. * this source tree.
  7. */
  8. #ifndef _QED_ISCSI_H
  9. #define _QED_ISCSI_H
  10. #include <linux/types.h>
  11. #include <linux/list.h>
  12. #include <linux/slab.h>
  13. #include <linux/spinlock.h>
  14. #include <linux/qed/tcp_common.h>
  15. #include <linux/qed/qed_iscsi_if.h>
  16. #include <linux/qed/qed_chain.h>
  17. #include "qed.h"
  18. #include "qed_hsi.h"
  19. #include "qed_mcp.h"
  20. #include "qed_sp.h"
  21. struct qed_iscsi_info {
  22. spinlock_t lock; /* Connection resources. */
  23. struct list_head free_list;
  24. u16 max_num_outstanding_tasks;
  25. void *event_context;
  26. iscsi_event_cb_t event_cb;
  27. };
  28. #ifdef CONFIG_QED_LL2
  29. extern const struct qed_ll2_ops qed_ll2_ops_pass;
  30. #endif
  31. #if IS_ENABLED(CONFIG_QED_ISCSI)
  32. struct qed_iscsi_info *qed_iscsi_alloc(struct qed_hwfn *p_hwfn);
  33. void qed_iscsi_setup(struct qed_hwfn *p_hwfn,
  34. struct qed_iscsi_info *p_iscsi_info);
  35. void qed_iscsi_free(struct qed_hwfn *p_hwfn,
  36. struct qed_iscsi_info *p_iscsi_info);
  37. #else /* IS_ENABLED(CONFIG_QED_ISCSI) */
  38. static inline struct qed_iscsi_info *qed_iscsi_alloc(
  39. struct qed_hwfn *p_hwfn) { return NULL; }
  40. static inline void qed_iscsi_setup(struct qed_hwfn *p_hwfn,
  41. struct qed_iscsi_info *p_iscsi_info) {}
  42. static inline void qed_iscsi_free(struct qed_hwfn *p_hwfn,
  43. struct qed_iscsi_info *p_iscsi_info) {}
  44. #endif /* IS_ENABLED(CONFIG_QED_ISCSI) */
  45. #endif