2 * ibmvfc.h -- driver for IBM Power Virtual Fibre Channel Adapter
4 * Written By: Brian King <brking@linux.vnet.ibm.com>, IBM Corporation
6 * Copyright (C) IBM Corporation, 2008
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <linux/list.h>
28 #include <linux/types.h>
31 #define IBMVFC_NAME "ibmvfc"
32 #define IBMVFC_DRIVER_VERSION "1.0.9"
33 #define IBMVFC_DRIVER_DATE "(August 5, 2010)"
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
59 * Ensure we have resources for ERP and initialization:
61 * 1 for initialization
64 * 2 for each discovery thread
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
74 enum ibmvfc_crq_valid
{
75 IBMVFC_CRQ_CMD_RSP
= 0x80,
76 IBMVFC_CRQ_INIT_RSP
= 0xC0,
77 IBMVFC_CRQ_XPORT_EVENT
= 0xFF,
80 enum ibmvfc_crq_format
{
81 IBMVFC_CRQ_INIT
= 0x01,
82 IBMVFC_CRQ_INIT_COMPLETE
= 0x02,
83 IBMVFC_PARTITION_MIGRATED
= 0x06,
86 enum ibmvfc_cmd_status_flags
{
87 IBMVFC_FABRIC_MAPPED
= 0x0001,
88 IBMVFC_VIOS_FAILURE
= 0x0002,
89 IBMVFC_FC_FAILURE
= 0x0004,
90 IBMVFC_FC_SCSI_ERROR
= 0x0008,
91 IBMVFC_HW_EVENT_LOGGED
= 0x0010,
92 IBMVFC_VIOS_LOGGED
= 0x0020,
95 enum ibmvfc_fabric_mapped_errors
{
96 IBMVFC_UNABLE_TO_ESTABLISH
= 0x0001,
97 IBMVFC_XPORT_FAULT
= 0x0002,
98 IBMVFC_CMD_TIMEOUT
= 0x0003,
99 IBMVFC_ENETDOWN
= 0x0004,
100 IBMVFC_HW_FAILURE
= 0x0005,
101 IBMVFC_LINK_DOWN_ERR
= 0x0006,
102 IBMVFC_LINK_DEAD_ERR
= 0x0007,
103 IBMVFC_UNABLE_TO_REGISTER
= 0x0008,
104 IBMVFC_XPORT_BUSY
= 0x000A,
105 IBMVFC_XPORT_DEAD
= 0x000B,
106 IBMVFC_CONFIG_ERROR
= 0x000C,
107 IBMVFC_NAME_SERVER_FAIL
= 0x000D,
108 IBMVFC_LINK_HALTED
= 0x000E,
109 IBMVFC_XPORT_GENERAL
= 0x8000,
112 enum ibmvfc_vios_errors
{
113 IBMVFC_CRQ_FAILURE
= 0x0001,
114 IBMVFC_SW_FAILURE
= 0x0002,
115 IBMVFC_INVALID_PARAMETER
= 0x0003,
116 IBMVFC_MISSING_PARAMETER
= 0x0004,
117 IBMVFC_HOST_IO_BUS
= 0x0005,
118 IBMVFC_TRANS_CANCELLED
= 0x0006,
119 IBMVFC_TRANS_CANCELLED_IMPLICIT
= 0x0007,
120 IBMVFC_INSUFFICIENT_RESOURCE
= 0x0008,
121 IBMVFC_PLOGI_REQUIRED
= 0x0010,
122 IBMVFC_COMMAND_FAILED
= 0x8000,
125 enum ibmvfc_mad_types
{
126 IBMVFC_NPIV_LOGIN
= 0x0001,
127 IBMVFC_DISC_TARGETS
= 0x0002,
128 IBMVFC_PORT_LOGIN
= 0x0004,
129 IBMVFC_PROCESS_LOGIN
= 0x0008,
130 IBMVFC_QUERY_TARGET
= 0x0010,
131 IBMVFC_IMPLICIT_LOGOUT
= 0x0040,
132 IBMVFC_PASSTHRU
= 0x0200,
133 IBMVFC_TMF_MAD
= 0x0100,
134 IBMVFC_NPIV_LOGOUT
= 0x0800,
137 struct ibmvfc_mad_common
{
144 }__attribute__((packed
, aligned (8)));
146 struct ibmvfc_npiv_login_mad
{
147 struct ibmvfc_mad_common common
;
148 struct srp_direct_buf buffer
;
149 }__attribute__((packed
, aligned (8)));
151 struct ibmvfc_npiv_logout_mad
{
152 struct ibmvfc_mad_common common
;
153 }__attribute__((packed
, aligned (8)));
155 #define IBMVFC_MAX_NAME 256
157 struct ibmvfc_npiv_login
{
159 #define IBMVFC_OS_LINUX 0x02
165 u32 vfc_frame_version
;
168 #define IBMVFC_CLIENT_MIGRATED 0x01
169 #define IBMVFC_FLUSH_ON_HALT 0x02
172 #define IBMVFC_CAN_MIGRATE 0x01
174 struct srp_direct_buf async
;
175 u8 partition_name
[IBMVFC_MAX_NAME
];
176 u8 device_name
[IBMVFC_MAX_NAME
];
177 u8 drc_name
[IBMVFC_MAX_NAME
];
179 }__attribute__((packed
, aligned (8)));
181 struct ibmvfc_common_svc_parms
{
185 u16 bb_rcv_sz
; /* upper nibble is BB_SC_N */
188 }__attribute__((packed
, aligned (4)));
190 struct ibmvfc_service_parms
{
191 struct ibmvfc_common_svc_parms common
;
198 u32 vendor_version
[4];
199 u32 services_avail
[2];
203 }__attribute__((packed
, aligned (4)));
205 struct ibmvfc_npiv_login_resp
{
210 #define IBMVFC_NATIVE_FC 0x01
211 #define IBMVFC_CAN_FLUSH_ON_HALT 0x08
214 #define IBMVFC_CAN_FLUSH_ON_HALT 0x08
222 u8 partition_name
[IBMVFC_MAX_NAME
];
223 u8 device_name
[IBMVFC_MAX_NAME
];
224 u8 port_loc_code
[IBMVFC_MAX_NAME
];
225 u8 drc_name
[IBMVFC_MAX_NAME
];
226 struct ibmvfc_service_parms service_parms
;
228 }__attribute__((packed
, aligned (8)));
230 union ibmvfc_npiv_login_data
{
231 struct ibmvfc_npiv_login login
;
232 struct ibmvfc_npiv_login_resp resp
;
233 }__attribute__((packed
, aligned (8)));
235 struct ibmvfc_discover_targets_buf
{
237 #define IBMVFC_DISC_TGT_SCSI_ID_MASK 0x00ffffff
240 struct ibmvfc_discover_targets
{
241 struct ibmvfc_mad_common common
;
242 struct srp_direct_buf buffer
;
250 }__attribute__((packed
, aligned (8)));
252 enum ibmvfc_fc_reason
{
253 IBMVFC_INVALID_ELS_CMD_CODE
= 0x01,
254 IBMVFC_INVALID_VERSION
= 0x02,
255 IBMVFC_LOGICAL_ERROR
= 0x03,
256 IBMVFC_INVALID_CT_IU_SIZE
= 0x04,
257 IBMVFC_LOGICAL_BUSY
= 0x05,
258 IBMVFC_PROTOCOL_ERROR
= 0x07,
259 IBMVFC_UNABLE_TO_PERFORM_REQ
= 0x09,
260 IBMVFC_CMD_NOT_SUPPORTED
= 0x0B,
261 IBMVFC_SERVER_NOT_AVAIL
= 0x0D,
262 IBMVFC_CMD_IN_PROGRESS
= 0x0E,
263 IBMVFC_VENDOR_SPECIFIC
= 0xFF,
266 enum ibmvfc_fc_type
{
267 IBMVFC_FABRIC_REJECT
= 0x01,
268 IBMVFC_PORT_REJECT
= 0x02,
269 IBMVFC_LS_REJECT
= 0x03,
270 IBMVFC_FABRIC_BUSY
= 0x04,
271 IBMVFC_PORT_BUSY
= 0x05,
272 IBMVFC_BASIC_REJECT
= 0x06,
275 enum ibmvfc_gs_explain
{
276 IBMVFC_PORT_NAME_NOT_REG
= 0x02,
279 struct ibmvfc_port_login
{
280 struct ibmvfc_mad_common common
;
283 u16 fc_service_class
;
287 u16 error
; /* also fc_reason */
291 struct ibmvfc_service_parms service_parms
;
292 struct ibmvfc_service_parms service_parms_change
;
294 }__attribute__((packed
, aligned (8)));
296 struct ibmvfc_prli_svc_parms
{
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
314 }__attribute__((packed
, aligned (4)));
316 struct ibmvfc_process_login
{
317 struct ibmvfc_mad_common common
;
319 struct ibmvfc_prli_svc_parms parms
;
322 u16 error
; /* also fc_reason */
325 }__attribute__((packed
, aligned (8)));
327 struct ibmvfc_query_tgt
{
328 struct ibmvfc_mad_common common
;
336 }__attribute__((packed
, aligned (8)));
338 struct ibmvfc_implicit_logout
{
339 struct ibmvfc_mad_common common
;
342 }__attribute__((packed
, aligned (8)));
345 struct ibmvfc_mad_common common
;
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
358 }__attribute__((packed
, aligned (8)));
360 enum ibmvfc_fcp_rsp_info_codes
{
361 RSP_NO_FAILURE
= 0x00,
362 RSP_TMF_REJECTED
= 0x04,
363 RSP_TMF_FAILED
= 0x05,
364 RSP_TMF_INVALID_LUN
= 0x09,
367 struct ibmvfc_fcp_rsp_info
{
371 }__attribute__((packed
, aligned (2)));
373 enum ibmvfc_fcp_rsp_flags
{
375 FCP_BIDI_READ_RESID_UNDER
= 0x40,
376 FCP_BIDI_READ_RESID_OVER
= 0x20,
378 FCP_RESID_UNDER
= 0x08,
379 FCP_RESID_OVER
= 0x04,
380 FCP_SNS_LEN_VALID
= 0x02,
381 FCP_RSP_LEN_VALID
= 0x01,
384 union ibmvfc_fcp_rsp_data
{
385 struct ibmvfc_fcp_rsp_info info
;
386 u8 sense
[SCSI_SENSE_BUFFERSIZE
+ sizeof(struct ibmvfc_fcp_rsp_info
)];
387 }__attribute__((packed
, aligned (8)));
389 struct ibmvfc_fcp_rsp
{
391 u16 retry_delay_timer
;
397 union ibmvfc_fcp_rsp_data data
;
398 }__attribute__((packed
, aligned (8)));
400 enum ibmvfc_cmd_flags
{
401 IBMVFC_SCATTERLIST
= 0x0001,
402 IBMVFC_NO_MEM_DESC
= 0x0002,
403 IBMVFC_READ
= 0x0004,
404 IBMVFC_WRITE
= 0x0008,
406 IBMVFC_CLASS_3_ERR
= 0x0100,
409 enum ibmvfc_fc_task_attr
{
410 IBMVFC_SIMPLE_TASK
= 0x00,
411 IBMVFC_HEAD_OF_QUEUE
= 0x01,
412 IBMVFC_ORDERED_TASK
= 0x02,
413 IBMVFC_ACA_TASK
= 0x04,
416 enum ibmvfc_fc_tmf_flags
{
417 IBMVFC_ABORT_TASK_SET
= 0x02,
418 IBMVFC_LUN_RESET
= 0x10,
419 IBMVFC_TARGET_RESET
= 0x20,
422 struct ibmvfc_fcp_cmd_iu
{
428 #define IBMVFC_RDDATA 0x02
429 #define IBMVFC_WRDATA 0x01
430 u8 cdb
[IBMVFC_MAX_CDB_LEN
];
432 }__attribute__((packed
, aligned (4)));
444 #define IBMVFC_ADAPTER_RESID_VALID 0x01
447 struct srp_direct_buf ext_func
;
448 struct srp_direct_buf ioba
;
449 struct srp_direct_buf resp
;
454 struct ibmvfc_fcp_cmd_iu iu
;
455 struct ibmvfc_fcp_rsp rsp
;
456 }__attribute__((packed
, aligned (8)));
458 struct ibmvfc_passthru_fc_iu
{
460 #define IBMVFC_ADISC 0x52000000
464 struct ibmvfc_passthru_iu
{
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
477 struct srp_direct_buf cmd
;
478 struct srp_direct_buf rsp
;
483 }__attribute__((packed
, aligned (8)));
485 struct ibmvfc_passthru_mad
{
486 struct ibmvfc_mad_common common
;
487 struct srp_direct_buf cmd_ioba
;
488 struct ibmvfc_passthru_iu iu
;
489 struct ibmvfc_passthru_fc_iu fc_iu
;
490 }__attribute__((packed
, aligned (8)));
492 struct ibmvfc_trace_start_entry
{
494 }__attribute__((packed
));
496 struct ibmvfc_trace_end_entry
{
503 }__attribute__((packed
));
505 struct ibmvfc_trace_entry
{
506 struct ibmvfc_event
*evt
;
514 #define IBMVFC_TRC_START 0x00
515 #define IBMVFC_TRC_END 0xff
517 struct ibmvfc_trace_start_entry start
;
518 struct ibmvfc_trace_end_entry end
;
520 }__attribute__((packed
, aligned (8)));
522 enum ibmvfc_crq_formats
{
523 IBMVFC_CMD_FORMAT
= 0x01,
524 IBMVFC_ASYNC_EVENT
= 0x02,
525 IBMVFC_MAD_FORMAT
= 0x04,
528 enum ibmvfc_async_event
{
529 IBMVFC_AE_ELS_PLOGI
= 0x0001,
530 IBMVFC_AE_ELS_LOGO
= 0x0002,
531 IBMVFC_AE_ELS_PRLO
= 0x0004,
532 IBMVFC_AE_SCN_NPORT
= 0x0008,
533 IBMVFC_AE_SCN_GROUP
= 0x0010,
534 IBMVFC_AE_SCN_DOMAIN
= 0x0020,
535 IBMVFC_AE_SCN_FABRIC
= 0x0040,
536 IBMVFC_AE_LINK_UP
= 0x0080,
537 IBMVFC_AE_LINK_DOWN
= 0x0100,
538 IBMVFC_AE_LINK_DEAD
= 0x0200,
539 IBMVFC_AE_HALT
= 0x0400,
540 IBMVFC_AE_RESUME
= 0x0800,
541 IBMVFC_AE_ADAPTER_FAILED
= 0x1000,
544 struct ibmvfc_async_desc
{
546 enum ibmvfc_async_event ae
;
555 }__attribute__((packed
, aligned (8)));
557 struct ibmvfc_crq_queue
{
558 struct ibmvfc_crq
*msgs
;
560 dma_addr_t msg_token
;
563 enum ibmvfc_ae_link_state
{
564 IBMVFC_AE_LS_LINK_UP
= 0x01,
565 IBMVFC_AE_LS_LINK_BOUNCED
= 0x02,
566 IBMVFC_AE_LS_LINK_DOWN
= 0x04,
567 IBMVFC_AE_LS_LINK_DEAD
= 0x08,
570 struct ibmvfc_async_crq
{
576 volatile u64 scsi_id
;
578 volatile u64 node_name
;
580 }__attribute__((packed
, aligned (8)));
582 struct ibmvfc_async_crq_queue
{
583 struct ibmvfc_async_crq
*msgs
;
585 dma_addr_t msg_token
;
589 struct ibmvfc_mad_common mad_common
;
590 struct ibmvfc_npiv_login_mad npiv_login
;
591 struct ibmvfc_npiv_logout_mad npiv_logout
;
592 struct ibmvfc_discover_targets discover_targets
;
593 struct ibmvfc_port_login plogi
;
594 struct ibmvfc_process_login prli
;
595 struct ibmvfc_query_tgt query_tgt
;
596 struct ibmvfc_implicit_logout implicit_logout
;
597 struct ibmvfc_tmf tmf
;
598 struct ibmvfc_cmd cmd
;
599 struct ibmvfc_passthru_mad passthru
;
600 }__attribute__((packed
, aligned (8)));
602 enum ibmvfc_target_action
{
603 IBMVFC_TGT_ACTION_NONE
= 0,
604 IBMVFC_TGT_ACTION_INIT
,
605 IBMVFC_TGT_ACTION_INIT_WAIT
,
606 IBMVFC_TGT_ACTION_DEL_RPORT
,
607 IBMVFC_TGT_ACTION_DELETED_RPORT
,
610 struct ibmvfc_target
{
611 struct list_head queue
;
612 struct ibmvfc_host
*vhost
;
615 struct fc_rport
*rport
;
617 enum ibmvfc_target_action action
;
623 struct ibmvfc_service_parms service_parms
;
624 struct ibmvfc_service_parms service_parms_change
;
625 struct fc_rport_identifiers ids
;
626 void (*job_step
) (struct ibmvfc_target
*);
627 struct timer_list timer
;
631 /* a unit of work for the hosting partition */
632 struct ibmvfc_event
{
633 struct list_head queue
;
634 struct ibmvfc_host
*vhost
;
635 struct ibmvfc_target
*tgt
;
636 struct scsi_cmnd
*cmnd
;
638 union ibmvfc_iu
*xfer_iu
;
639 void (*done
) (struct ibmvfc_event
*);
640 struct ibmvfc_crq crq
;
642 union ibmvfc_iu
*sync_iu
;
643 struct srp_direct_buf
*ext_list
;
644 dma_addr_t ext_list_token
;
645 struct completion comp
;
646 struct completion
*eh_comp
;
647 struct timer_list timer
;
650 /* a pool of event structs for use */
651 struct ibmvfc_event_pool
{
652 struct ibmvfc_event
*events
;
654 union ibmvfc_iu
*iu_storage
;
658 enum ibmvfc_host_action
{
659 IBMVFC_HOST_ACTION_NONE
= 0,
660 IBMVFC_HOST_ACTION_RESET
,
661 IBMVFC_HOST_ACTION_REENABLE
,
662 IBMVFC_HOST_ACTION_LOGO
,
663 IBMVFC_HOST_ACTION_LOGO_WAIT
,
664 IBMVFC_HOST_ACTION_INIT
,
665 IBMVFC_HOST_ACTION_INIT_WAIT
,
666 IBMVFC_HOST_ACTION_QUERY
,
667 IBMVFC_HOST_ACTION_QUERY_TGTS
,
668 IBMVFC_HOST_ACTION_TGT_DEL
,
669 IBMVFC_HOST_ACTION_ALLOC_TGTS
,
670 IBMVFC_HOST_ACTION_TGT_INIT
,
671 IBMVFC_HOST_ACTION_TGT_DEL_FAILED
,
674 enum ibmvfc_host_state
{
686 struct list_head queue
;
687 struct Scsi_Host
*host
;
688 enum ibmvfc_host_state state
;
689 enum ibmvfc_host_action action
;
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)
693 struct ibmvfc_trace_entry
*trace
;
694 u32 trace_index
:IBMVFC_NUM_TRACE_INDEX_BITS
;
696 struct list_head targets
;
697 struct list_head sent
;
698 struct list_head free
;
700 struct ibmvfc_event_pool pool
;
701 struct dma_pool
*sg_pool
;
703 struct ibmvfc_crq_queue crq
;
704 struct ibmvfc_async_crq_queue async_crq
;
705 struct ibmvfc_npiv_login login_info
;
706 union ibmvfc_npiv_login_data
*login_buf
;
707 dma_addr_t login_buf_dma
;
710 struct ibmvfc_discover_targets_buf
*disc_buf
;
711 struct mutex passthru_mutex
;
714 int discovery_threads
;
721 int aborting_passthru
;
723 #define IBMVFC_AE_LINKUP 0x0001
724 #define IBMVFC_AE_LINKDOWN 0x0002
725 #define IBMVFC_AE_RSCN 0x0004
726 dma_addr_t disc_buf_dma
;
727 unsigned int partition_number
;
728 char partition_name
[97];
729 void (*job_step
) (struct ibmvfc_host
*);
730 struct task_struct
*work_thread
;
731 struct tasklet_struct tasklet
;
732 struct work_struct rport_add_work_q
;
733 wait_queue_head_t init_wait_q
;
734 wait_queue_head_t work_wait_q
;
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)