0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef __CSIO_INIT_H__
0036 #define __CSIO_INIT_H__
0037
0038 #include <linux/pci.h>
0039 #include <linux/if_ether.h>
0040 #include <scsi/scsi.h>
0041 #include <scsi/scsi_device.h>
0042 #include <scsi/scsi_host.h>
0043 #include <scsi/scsi_transport_fc.h>
0044
0045 #include "csio_scsi.h"
0046 #include "csio_lnode.h"
0047 #include "csio_rnode.h"
0048 #include "csio_hw.h"
0049
0050 #define CSIO_DRV_AUTHOR "Chelsio Communications"
0051 #define CSIO_DRV_DESC "Chelsio FCoE driver"
0052 #define CSIO_DRV_VERSION "1.0.0-ko"
0053
0054 extern struct fc_function_template csio_fc_transport_funcs;
0055 extern struct fc_function_template csio_fc_transport_vport_funcs;
0056
0057 void csio_fchost_attr_init(struct csio_lnode *);
0058
0059
0060 void csio_scsi_intx_handler(struct csio_hw *, void *, uint32_t,
0061 struct csio_fl_dma_buf *, void *);
0062
0063 void csio_fwevt_intx_handler(struct csio_hw *, void *, uint32_t,
0064 struct csio_fl_dma_buf *, void *);
0065
0066
0067 void csio_lnodes_block_request(struct csio_hw *);
0068 void csio_lnodes_unblock_request(struct csio_hw *);
0069 void csio_lnodes_block_by_port(struct csio_hw *, uint8_t);
0070 void csio_lnodes_unblock_by_port(struct csio_hw *, uint8_t);
0071
0072 struct csio_lnode *csio_shost_init(struct csio_hw *, struct device *, bool,
0073 struct csio_lnode *);
0074 void csio_shost_exit(struct csio_lnode *);
0075 void csio_lnodes_exit(struct csio_hw *, bool);
0076
0077
0078 void csio_add_debugfs_mem(struct csio_hw *, const char *,
0079 unsigned int, unsigned int);
0080
0081 static inline struct Scsi_Host *
0082 csio_ln_to_shost(struct csio_lnode *ln)
0083 {
0084 return container_of((void *)ln, struct Scsi_Host, hostdata[0]);
0085 }
0086
0087
0088 static inline struct csio_ioreq *
0089 csio_get_scsi_ioreq_lock(struct csio_hw *hw, struct csio_scsim *scsim)
0090 {
0091 struct csio_ioreq *ioreq;
0092 unsigned long flags;
0093
0094 spin_lock_irqsave(&scsim->freelist_lock, flags);
0095 ioreq = csio_get_scsi_ioreq(scsim);
0096 spin_unlock_irqrestore(&scsim->freelist_lock, flags);
0097
0098 return ioreq;
0099 }
0100
0101 static inline void
0102 csio_put_scsi_ioreq_lock(struct csio_hw *hw, struct csio_scsim *scsim,
0103 struct csio_ioreq *ioreq)
0104 {
0105 unsigned long flags;
0106
0107 spin_lock_irqsave(&scsim->freelist_lock, flags);
0108 csio_put_scsi_ioreq(scsim, ioreq);
0109 spin_unlock_irqrestore(&scsim->freelist_lock, flags);
0110 }
0111
0112
0113 static inline void
0114 csio_put_scsi_ioreq_list_lock(struct csio_hw *hw, struct csio_scsim *scsim,
0115 struct list_head *reqlist, int n)
0116 {
0117 unsigned long flags;
0118
0119 spin_lock_irqsave(&scsim->freelist_lock, flags);
0120 csio_put_scsi_ioreq_list(scsim, reqlist, n);
0121 spin_unlock_irqrestore(&scsim->freelist_lock, flags);
0122 }
0123
0124
0125 static inline void
0126 csio_put_scsi_ddp_list_lock(struct csio_hw *hw, struct csio_scsim *scsim,
0127 struct list_head *reqlist, int n)
0128 {
0129 unsigned long flags;
0130
0131 spin_lock_irqsave(&hw->lock, flags);
0132 csio_put_scsi_ddp_list(scsim, reqlist, n);
0133 spin_unlock_irqrestore(&hw->lock, flags);
0134 }
0135
0136 #endif