4 #include <linux/list.h>
5 #include <scsi/scsi_cmnd.h>
6 #include <scsi/scsi_host.h>
29 struct Scsi_Host
*shost
;
33 struct list_head cmd_queue
;
36 struct srp_queue iu_queue
;
38 struct srp_buf
**rx_ring
;
44 struct srp_target
*target
;
46 struct list_head ilist
;
47 dma_addr_t remote_token
;
53 typedef int (srp_rdma_t
)(struct scsi_cmnd
*, struct scatterlist
*, int,
54 struct srp_direct_buf
*, int,
55 enum dma_data_direction
, unsigned int);
56 extern int srp_target_alloc(struct srp_target
*, struct device
*, size_t, size_t);
57 extern void srp_target_free(struct srp_target
*);
59 extern struct iu_entry
*srp_iu_get(struct srp_target
*);
60 extern void srp_iu_put(struct iu_entry
*);
62 extern int srp_cmd_queue(struct Scsi_Host
*, struct srp_cmd
*, void *, u64
);
63 extern int srp_transfer_data(struct scsi_cmnd
*, struct srp_cmd
*,
64 srp_rdma_t
, int, int);
67 static inline struct srp_target
*host_to_srp_target(struct Scsi_Host
*host
)
69 return (struct srp_target
*) host
->hostdata
;
72 static inline int srp_cmd_direction(struct srp_cmd
*cmd
)
74 return (cmd
->buf_fmt
>> 4) ? DMA_TO_DEVICE
: DMA_FROM_DEVICE
;