Go to the documentation of this file.
27 #include <linux/list.h>
28 #include <linux/types.h>
31 #define IBMVFC_NAME "ibmvfc"
32 #define IBMVFC_DRIVER_VERSION "1.0.10"
33 #define IBMVFC_DRIVER_DATE "(August 24, 2012)"
35 #define IBMVFC_DEFAULT_TIMEOUT 60
36 #define IBMVFC_ADISC_CANCEL_TIMEOUT 45
37 #define IBMVFC_ADISC_TIMEOUT 15
38 #define IBMVFC_ADISC_PLUS_CANCEL_TIMEOUT \
39 (IBMVFC_ADISC_TIMEOUT + IBMVFC_ADISC_CANCEL_TIMEOUT)
40 #define IBMVFC_INIT_TIMEOUT 120
41 #define IBMVFC_ABORT_TIMEOUT 8
42 #define IBMVFC_ABORT_WAIT_TIMEOUT 40
43 #define IBMVFC_MAX_REQUESTS_DEFAULT 100
45 #define IBMVFC_DEBUG 0
46 #define IBMVFC_MAX_TARGETS 1024
47 #define IBMVFC_MAX_LUN 0xffffffff
48 #define IBMVFC_MAX_SECTORS 0xffffu
49 #define IBMVFC_MAX_DISC_THREADS 4
50 #define IBMVFC_TGT_MEMPOOL_SZ 64
51 #define IBMVFC_MAX_CMDS_PER_LUN 64
52 #define IBMVFC_MAX_HOST_INIT_RETRIES 6
53 #define IBMVFC_MAX_TGT_INIT_RETRIES 3
54 #define IBMVFC_DEV_LOSS_TMO (5 * 60)
55 #define IBMVFC_DEFAULT_LOG_LEVEL 2
56 #define IBMVFC_MAX_CDB_LEN 16
66 #define IBMVFC_NUM_INTERNAL_REQ (1 + 1 + 1 + 2 + (disc_threads * 2))
68 #define IBMVFC_MAD_SUCCESS 0x00
69 #define IBMVFC_MAD_NOT_SUPPORTED 0xF1
70 #define IBMVFC_MAD_FAILED 0xF7
71 #define IBMVFC_MAD_DRIVER_FAILED 0xEE
72 #define IBMVFC_MAD_CRQ_ERROR 0xEF
155 #define IBMVFC_MAX_NAME 256
159 #define IBMVFC_OS_LINUX 0x02
168 #define IBMVFC_CLIENT_MIGRATED 0x01
169 #define IBMVFC_FLUSH_ON_HALT 0x02
172 #define IBMVFC_CAN_MIGRATE 0x01
210 #define IBMVFC_NATIVE_FC 0x01
211 #define IBMVFC_CAN_FLUSH_ON_HALT 0x08
214 #define IBMVFC_CAN_FLUSH_ON_HALT 0x08
237 #define IBMVFC_DISC_TGT_SCSI_ID_MASK 0x00ffffff
298 #define IBMVFC_SCSI_FCP_TYPE 0x08
301 #define IBMVFC_PRLI_ORIG_PA_VALID 0x8000
302 #define IBMVFC_PRLI_RESP_PA_VALID 0x4000
303 #define IBMVFC_PRLI_EST_IMG_PAIR 0x2000
307 #define IBMVFC_PRLI_TASK_RETRY 0x00000200
308 #define IBMVFC_PRLI_RETRY 0x00000100
309 #define IBMVFC_PRLI_DATA_OVERLAY 0x00000040
310 #define IBMVFC_PRLI_INITIATOR_FUNC 0x00000020
311 #define IBMVFC_PRLI_TARGET_FUNC 0x00000010
312 #define IBMVFC_PRLI_READ_FCP_XFER_RDY_DISABLED 0x00000002
313 #define IBMVFC_PRLI_WR_FCP_XFER_RDY_DISABLED 0x00000001
349 #define IBMVFC_TMF_ABORT_TASK 0x02
350 #define IBMVFC_TMF_ABORT_TASK_SET 0x04
351 #define IBMVFC_TMF_LUN_RESET 0x10
352 #define IBMVFC_TMF_TGT_RESET 0x20
353 #define IBMVFC_TMF_LUA_VALID 0x40
428 #define IBMVFC_RDDATA 0x02
429 #define IBMVFC_WRDATA 0x01
444 #define IBMVFC_ADAPTER_RESID_VALID 0x01
460 #define IBMVFC_ADISC 0x52000000
471 #define IBMVFC_FC_ELS 0x01
472 #define IBMVFC_FC_CT_IU 0x02
474 #define IBMVFC_PASSTHRU_CANCEL_KEY 0x80000000
475 #define IBMVFC_INTERNAL_CANCEL_KEY 0x80000001
514 #define IBMVFC_TRC_START 0x00
515 #define IBMVFC_TRC_END 0xff
690 #define IBMVFC_NUM_TRACE_INDEX_BITS 8
691 #define IBMVFC_NUM_TRACE_ENTRIES (1 << IBMVFC_NUM_TRACE_INDEX_BITS)
692 #define IBMVFC_TRACE_SIZE (sizeof(struct ibmvfc_trace_entry) * IBMVFC_NUM_TRACE_ENTRIES)
723 #define IBMVFC_AE_LINKUP 0x0001
724 #define IBMVFC_AE_LINKDOWN 0x0002
725 #define IBMVFC_AE_RSCN 0x0004
737 #define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0)
739 #define tgt_dbg(t, fmt, ...) \
740 DBG_CMD(dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__))
742 #define tgt_info(t, fmt, ...) \
743 dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
745 #define tgt_err(t, fmt, ...) \
746 dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
748 #define tgt_log(t, level, fmt, ...) \
750 if ((t)->vhost->log_level >= level) \
751 tgt_err(t, fmt, ##__VA_ARGS__); \
754 #define ibmvfc_dbg(vhost, ...) \
755 DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__))
757 #define ibmvfc_log(vhost, level, ...) \
759 if ((vhost)->log_level >= level) \
760 dev_err((vhost)->dev, ##__VA_ARGS__); \
763 #define ENTER DBG_CMD(printk(KERN_INFO IBMVFC_NAME": Entering %s\n", __func__))
764 #define LEAVE DBG_CMD(printk(KERN_INFO IBMVFC_NAME": Leaving %s\n", __func__))
766 #ifdef CONFIG_SCSI_IBMVFC_TRACE
767 #define ibmvfc_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr)
768 #define ibmvfc_remove_trace_file(kobj, attr) sysfs_remove_bin_file(kobj, attr)
770 #define ibmvfc_create_trace_file(kobj, attr) 0
771 #define ibmvfc_remove_trace_file(kobj, attr) do { } while (0)