4 #include <linux/list.h>
5 #include <linux/kfifo.h>
9 INVALIDATE_CMD_RESP_EL = 0,
10 VALID_CMD_RESP_EL = 0x80,
11 VALID_INIT_MSG = 0xC0,
12 VALID_TRANS_EVENT = 0xFF
29 enum srp_trans_event {
32 PARTNER_DEREGISTER = 2,
37 HEADER_DESCRIPTOR = 0xF1,
42 enum srp_mad_version {
53 enum srp_task_attributes {
61 SRP_TASK_MANAGEMENT_FUNCTION_COMPLETE = 0,
62 SRP_REQUEST_FIELDS_INVALID = 2,
63 SRP_TASK_MANAGEMENT_FUNCTION_NOT_SUPPORTED = 4,
64 SRP_TASK_MANAGEMENT_FUNCTION_FAILED = 5
83 struct list_head cmd_queue;
86 struct srp_queue iu_queue;
88 struct srp_buf **rx_ring;
94 struct srp_target *target;
96 struct list_head ilist;
97 dma_addr_t remote_token;
100 struct srp_buf *sbuf;
104 struct ibmvscsis_cmd;
106 typedef int (srp_rdma_t)(struct ibmvscsis_cmd *, struct scatterlist *, int,
107 struct srp_direct_buf *, int,
108 enum dma_data_direction, unsigned int);
109 int srp_target_alloc(struct srp_target *, struct device *, size_t, size_t);
110 void srp_target_free(struct srp_target *);
111 struct iu_entry *srp_iu_get(struct srp_target *);
112 void srp_iu_put(struct iu_entry *);
113 int srp_transfer_data(struct ibmvscsis_cmd *, struct srp_cmd *,
114 srp_rdma_t, int, int);
115 u64 srp_data_length(struct srp_cmd *cmd, enum dma_data_direction dir);
116 int srp_get_desc_table(struct srp_cmd *srp_cmd, enum dma_data_direction *dir,
118 static inline int srp_cmd_direction(struct srp_cmd *cmd)
120 return (cmd->buf_fmt >> 4) ? DMA_TO_DEVICE : DMA_FROM_DEVICE;