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.6"
33 #define IBMVFC_DRIVER_DATE "(May 28, 2009)"
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_MAX_REQUESTS_DEFAULT 100
43 #define IBMVFC_DEBUG 0
44 #define IBMVFC_MAX_TARGETS 1024
45 #define IBMVFC_MAX_LUN 0xffffffff
46 #define IBMVFC_MAX_SECTORS 0xffffu
47 #define IBMVFC_MAX_DISC_THREADS 4
48 #define IBMVFC_TGT_MEMPOOL_SZ 64
49 #define IBMVFC_MAX_CMDS_PER_LUN 64
50 #define IBMVFC_MAX_HOST_INIT_RETRIES 6
51 #define IBMVFC_MAX_TGT_INIT_RETRIES 3
52 #define IBMVFC_DEV_LOSS_TMO (5 * 60)
53 #define IBMVFC_DEFAULT_LOG_LEVEL 2
54 #define IBMVFC_MAX_CDB_LEN 16
57 * Ensure we have resources for ERP and initialization:
59 * 1 for initialization
61 * 2 for each discovery thread
63 #define IBMVFC_NUM_INTERNAL_REQ (1 + 1 + 1 + (disc_threads * 2))
65 #define IBMVFC_MAD_SUCCESS 0x00
66 #define IBMVFC_MAD_NOT_SUPPORTED 0xF1
67 #define IBMVFC_MAD_FAILED 0xF7
68 #define IBMVFC_MAD_DRIVER_FAILED 0xEE
69 #define IBMVFC_MAD_CRQ_ERROR 0xEF
71 enum ibmvfc_crq_valid
{
72 IBMVFC_CRQ_CMD_RSP
= 0x80,
73 IBMVFC_CRQ_INIT_RSP
= 0xC0,
74 IBMVFC_CRQ_XPORT_EVENT
= 0xFF,
77 enum ibmvfc_crq_format
{
78 IBMVFC_CRQ_INIT
= 0x01,
79 IBMVFC_CRQ_INIT_COMPLETE
= 0x02,
80 IBMVFC_PARTITION_MIGRATED
= 0x06,
83 enum ibmvfc_cmd_status_flags
{
84 IBMVFC_FABRIC_MAPPED
= 0x0001,
85 IBMVFC_VIOS_FAILURE
= 0x0002,
86 IBMVFC_FC_FAILURE
= 0x0004,
87 IBMVFC_FC_SCSI_ERROR
= 0x0008,
88 IBMVFC_HW_EVENT_LOGGED
= 0x0010,
89 IBMVFC_VIOS_LOGGED
= 0x0020,
92 enum ibmvfc_fabric_mapped_errors
{
93 IBMVFC_UNABLE_TO_ESTABLISH
= 0x0001,
94 IBMVFC_XPORT_FAULT
= 0x0002,
95 IBMVFC_CMD_TIMEOUT
= 0x0003,
96 IBMVFC_ENETDOWN
= 0x0004,
97 IBMVFC_HW_FAILURE
= 0x0005,
98 IBMVFC_LINK_DOWN_ERR
= 0x0006,
99 IBMVFC_LINK_DEAD_ERR
= 0x0007,
100 IBMVFC_UNABLE_TO_REGISTER
= 0x0008,
101 IBMVFC_XPORT_BUSY
= 0x000A,
102 IBMVFC_XPORT_DEAD
= 0x000B,
103 IBMVFC_CONFIG_ERROR
= 0x000C,
104 IBMVFC_NAME_SERVER_FAIL
= 0x000D,
105 IBMVFC_LINK_HALTED
= 0x000E,
106 IBMVFC_XPORT_GENERAL
= 0x8000,
109 enum ibmvfc_vios_errors
{
110 IBMVFC_CRQ_FAILURE
= 0x0001,
111 IBMVFC_SW_FAILURE
= 0x0002,
112 IBMVFC_INVALID_PARAMETER
= 0x0003,
113 IBMVFC_MISSING_PARAMETER
= 0x0004,
114 IBMVFC_HOST_IO_BUS
= 0x0005,
115 IBMVFC_TRANS_CANCELLED
= 0x0006,
116 IBMVFC_TRANS_CANCELLED_IMPLICIT
= 0x0007,
117 IBMVFC_INSUFFICIENT_RESOURCE
= 0x0008,
118 IBMVFC_PLOGI_REQUIRED
= 0x0010,
119 IBMVFC_COMMAND_FAILED
= 0x8000,
122 enum ibmvfc_mad_types
{
123 IBMVFC_NPIV_LOGIN
= 0x0001,
124 IBMVFC_DISC_TARGETS
= 0x0002,
125 IBMVFC_PORT_LOGIN
= 0x0004,
126 IBMVFC_PROCESS_LOGIN
= 0x0008,
127 IBMVFC_QUERY_TARGET
= 0x0010,
128 IBMVFC_IMPLICIT_LOGOUT
= 0x0040,
129 IBMVFC_PASSTHRU
= 0x0200,
130 IBMVFC_TMF_MAD
= 0x0100,
131 IBMVFC_NPIV_LOGOUT
= 0x0800,
134 struct ibmvfc_mad_common
{
141 }__attribute__((packed
, aligned (8)));
143 struct ibmvfc_npiv_login_mad
{
144 struct ibmvfc_mad_common common
;
145 struct srp_direct_buf buffer
;
146 }__attribute__((packed
, aligned (8)));
148 struct ibmvfc_npiv_logout_mad
{
149 struct ibmvfc_mad_common common
;
150 }__attribute__((packed
, aligned (8)));
152 #define IBMVFC_MAX_NAME 256
154 struct ibmvfc_npiv_login
{
156 #define IBMVFC_OS_LINUX 0x02
162 u32 vfc_frame_version
;
165 #define IBMVFC_CLIENT_MIGRATED 0x01
166 #define IBMVFC_FLUSH_ON_HALT 0x02
169 #define IBMVFC_CAN_MIGRATE 0x01
171 struct srp_direct_buf async
;
172 u8 partition_name
[IBMVFC_MAX_NAME
];
173 u8 device_name
[IBMVFC_MAX_NAME
];
174 u8 drc_name
[IBMVFC_MAX_NAME
];
176 }__attribute__((packed
, aligned (8)));
178 struct ibmvfc_common_svc_parms
{
182 u16 bb_rcv_sz
; /* upper nibble is BB_SC_N */
185 }__attribute__((packed
, aligned (4)));
187 struct ibmvfc_service_parms
{
188 struct ibmvfc_common_svc_parms common
;
195 u32 vendor_version
[4];
196 u32 services_avail
[2];
200 }__attribute__((packed
, aligned (4)));
202 struct ibmvfc_npiv_login_resp
{
207 #define IBMVFC_NATIVE_FC 0x01
208 #define IBMVFC_CAN_FLUSH_ON_HALT 0x08
211 #define IBMVFC_CAN_FLUSH_ON_HALT 0x08
219 u8 partition_name
[IBMVFC_MAX_NAME
];
220 u8 device_name
[IBMVFC_MAX_NAME
];
221 u8 port_loc_code
[IBMVFC_MAX_NAME
];
222 u8 drc_name
[IBMVFC_MAX_NAME
];
223 struct ibmvfc_service_parms service_parms
;
225 }__attribute__((packed
, aligned (8)));
227 union ibmvfc_npiv_login_data
{
228 struct ibmvfc_npiv_login login
;
229 struct ibmvfc_npiv_login_resp resp
;
230 }__attribute__((packed
, aligned (8)));
232 struct ibmvfc_discover_targets_buf
{
234 #define IBMVFC_DISC_TGT_SCSI_ID_MASK 0x00ffffff
237 struct ibmvfc_discover_targets
{
238 struct ibmvfc_mad_common common
;
239 struct srp_direct_buf buffer
;
247 }__attribute__((packed
, aligned (8)));
249 enum ibmvfc_fc_reason
{
250 IBMVFC_INVALID_ELS_CMD_CODE
= 0x01,
251 IBMVFC_INVALID_VERSION
= 0x02,
252 IBMVFC_LOGICAL_ERROR
= 0x03,
253 IBMVFC_INVALID_CT_IU_SIZE
= 0x04,
254 IBMVFC_LOGICAL_BUSY
= 0x05,
255 IBMVFC_PROTOCOL_ERROR
= 0x07,
256 IBMVFC_UNABLE_TO_PERFORM_REQ
= 0x09,
257 IBMVFC_CMD_NOT_SUPPORTED
= 0x0B,
258 IBMVFC_SERVER_NOT_AVAIL
= 0x0D,
259 IBMVFC_CMD_IN_PROGRESS
= 0x0E,
260 IBMVFC_VENDOR_SPECIFIC
= 0xFF,
263 enum ibmvfc_fc_type
{
264 IBMVFC_FABRIC_REJECT
= 0x01,
265 IBMVFC_PORT_REJECT
= 0x02,
266 IBMVFC_LS_REJECT
= 0x03,
267 IBMVFC_FABRIC_BUSY
= 0x04,
268 IBMVFC_PORT_BUSY
= 0x05,
269 IBMVFC_BASIC_REJECT
= 0x06,
272 enum ibmvfc_gs_explain
{
273 IBMVFC_PORT_NAME_NOT_REG
= 0x02,
276 struct ibmvfc_port_login
{
277 struct ibmvfc_mad_common common
;
280 u16 fc_service_class
;
284 u16 error
; /* also fc_reason */
288 struct ibmvfc_service_parms service_parms
;
289 struct ibmvfc_service_parms service_parms_change
;
291 }__attribute__((packed
, aligned (8)));
293 struct ibmvfc_prli_svc_parms
{
295 #define IBMVFC_SCSI_FCP_TYPE 0x08
298 #define IBMVFC_PRLI_ORIG_PA_VALID 0x8000
299 #define IBMVFC_PRLI_RESP_PA_VALID 0x4000
300 #define IBMVFC_PRLI_EST_IMG_PAIR 0x2000
304 #define IBMVFC_PRLI_TASK_RETRY 0x00000200
305 #define IBMVFC_PRLI_RETRY 0x00000100
306 #define IBMVFC_PRLI_DATA_OVERLAY 0x00000040
307 #define IBMVFC_PRLI_INITIATOR_FUNC 0x00000020
308 #define IBMVFC_PRLI_TARGET_FUNC 0x00000010
309 #define IBMVFC_PRLI_READ_FCP_XFER_RDY_DISABLED 0x00000002
310 #define IBMVFC_PRLI_WR_FCP_XFER_RDY_DISABLED 0x00000001
311 }__attribute__((packed
, aligned (4)));
313 struct ibmvfc_process_login
{
314 struct ibmvfc_mad_common common
;
316 struct ibmvfc_prli_svc_parms parms
;
319 u16 error
; /* also fc_reason */
322 }__attribute__((packed
, aligned (8)));
324 struct ibmvfc_query_tgt
{
325 struct ibmvfc_mad_common common
;
333 }__attribute__((packed
, aligned (8)));
335 struct ibmvfc_implicit_logout
{
336 struct ibmvfc_mad_common common
;
339 }__attribute__((packed
, aligned (8)));
342 struct ibmvfc_mad_common common
;
346 #define IBMVFC_TMF_ABORT_TASK 0x02
347 #define IBMVFC_TMF_ABORT_TASK_SET 0x04
348 #define IBMVFC_TMF_LUN_RESET 0x10
349 #define IBMVFC_TMF_TGT_RESET 0x20
350 #define IBMVFC_TMF_LUA_VALID 0x40
355 }__attribute__((packed
, aligned (8)));
357 enum ibmvfc_fcp_rsp_info_codes
{
358 RSP_NO_FAILURE
= 0x00,
359 RSP_TMF_REJECTED
= 0x04,
360 RSP_TMF_FAILED
= 0x05,
361 RSP_TMF_INVALID_LUN
= 0x09,
364 struct ibmvfc_fcp_rsp_info
{
368 }__attribute__((packed
, aligned (2)));
370 enum ibmvfc_fcp_rsp_flags
{
372 FCP_BIDI_READ_RESID_UNDER
= 0x40,
373 FCP_BIDI_READ_RESID_OVER
= 0x20,
375 FCP_RESID_UNDER
= 0x08,
376 FCP_RESID_OVER
= 0x04,
377 FCP_SNS_LEN_VALID
= 0x02,
378 FCP_RSP_LEN_VALID
= 0x01,
381 union ibmvfc_fcp_rsp_data
{
382 struct ibmvfc_fcp_rsp_info info
;
383 u8 sense
[SCSI_SENSE_BUFFERSIZE
+ sizeof(struct ibmvfc_fcp_rsp_info
)];
384 }__attribute__((packed
, aligned (8)));
386 struct ibmvfc_fcp_rsp
{
388 u16 retry_delay_timer
;
394 union ibmvfc_fcp_rsp_data data
;
395 }__attribute__((packed
, aligned (8)));
397 enum ibmvfc_cmd_flags
{
398 IBMVFC_SCATTERLIST
= 0x0001,
399 IBMVFC_NO_MEM_DESC
= 0x0002,
400 IBMVFC_READ
= 0x0004,
401 IBMVFC_WRITE
= 0x0008,
403 IBMVFC_CLASS_3_ERR
= 0x0100,
406 enum ibmvfc_fc_task_attr
{
407 IBMVFC_SIMPLE_TASK
= 0x00,
408 IBMVFC_HEAD_OF_QUEUE
= 0x01,
409 IBMVFC_ORDERED_TASK
= 0x02,
410 IBMVFC_ACA_TASK
= 0x04,
413 enum ibmvfc_fc_tmf_flags
{
414 IBMVFC_ABORT_TASK_SET
= 0x02,
415 IBMVFC_LUN_RESET
= 0x10,
416 IBMVFC_TARGET_RESET
= 0x20,
419 struct ibmvfc_fcp_cmd_iu
{
425 #define IBMVFC_RDDATA 0x02
426 #define IBMVFC_WRDATA 0x01
427 u8 cdb
[IBMVFC_MAX_CDB_LEN
];
429 }__attribute__((packed
, aligned (4)));
441 #define IBMVFC_ADAPTER_RESID_VALID 0x01
444 struct srp_direct_buf ext_func
;
445 struct srp_direct_buf ioba
;
446 struct srp_direct_buf resp
;
451 struct ibmvfc_fcp_cmd_iu iu
;
452 struct ibmvfc_fcp_rsp rsp
;
453 }__attribute__((packed
, aligned (8)));
455 struct ibmvfc_passthru_fc_iu
{
457 #define IBMVFC_ADISC 0x52000000
461 struct ibmvfc_passthru_iu
{
468 #define IBMVFC_FC_ELS 0x01
471 struct srp_direct_buf cmd
;
472 struct srp_direct_buf rsp
;
477 }__attribute__((packed
, aligned (8)));
479 struct ibmvfc_passthru_mad
{
480 struct ibmvfc_mad_common common
;
481 struct srp_direct_buf cmd_ioba
;
482 struct ibmvfc_passthru_iu iu
;
483 struct ibmvfc_passthru_fc_iu fc_iu
;
484 }__attribute__((packed
, aligned (8)));
486 struct ibmvfc_trace_start_entry
{
488 }__attribute__((packed
));
490 struct ibmvfc_trace_end_entry
{
497 }__attribute__((packed
));
499 struct ibmvfc_trace_entry
{
500 struct ibmvfc_event
*evt
;
508 #define IBMVFC_TRC_START 0x00
509 #define IBMVFC_TRC_END 0xff
511 struct ibmvfc_trace_start_entry start
;
512 struct ibmvfc_trace_end_entry end
;
514 }__attribute__((packed
, aligned (8)));
516 enum ibmvfc_crq_formats
{
517 IBMVFC_CMD_FORMAT
= 0x01,
518 IBMVFC_ASYNC_EVENT
= 0x02,
519 IBMVFC_MAD_FORMAT
= 0x04,
522 enum ibmvfc_async_event
{
523 IBMVFC_AE_ELS_PLOGI
= 0x0001,
524 IBMVFC_AE_ELS_LOGO
= 0x0002,
525 IBMVFC_AE_ELS_PRLO
= 0x0004,
526 IBMVFC_AE_SCN_NPORT
= 0x0008,
527 IBMVFC_AE_SCN_GROUP
= 0x0010,
528 IBMVFC_AE_SCN_DOMAIN
= 0x0020,
529 IBMVFC_AE_SCN_FABRIC
= 0x0040,
530 IBMVFC_AE_LINK_UP
= 0x0080,
531 IBMVFC_AE_LINK_DOWN
= 0x0100,
532 IBMVFC_AE_LINK_DEAD
= 0x0200,
533 IBMVFC_AE_HALT
= 0x0400,
534 IBMVFC_AE_RESUME
= 0x0800,
535 IBMVFC_AE_ADAPTER_FAILED
= 0x1000,
543 }__attribute__((packed
, aligned (8)));
545 struct ibmvfc_crq_queue
{
546 struct ibmvfc_crq
*msgs
;
548 dma_addr_t msg_token
;
551 enum ibmvfc_ae_link_state
{
552 IBMVFC_AE_LS_LINK_UP
= 0x01,
553 IBMVFC_AE_LS_LINK_BOUNCED
= 0x02,
554 IBMVFC_AE_LS_LINK_DOWN
= 0x04,
555 IBMVFC_AE_LS_LINK_DEAD
= 0x08,
558 struct ibmvfc_async_crq
{
564 volatile u64 scsi_id
;
566 volatile u64 node_name
;
568 }__attribute__((packed
, aligned (8)));
570 struct ibmvfc_async_crq_queue
{
571 struct ibmvfc_async_crq
*msgs
;
573 dma_addr_t msg_token
;
577 struct ibmvfc_mad_common mad_common
;
578 struct ibmvfc_npiv_login_mad npiv_login
;
579 struct ibmvfc_npiv_logout_mad npiv_logout
;
580 struct ibmvfc_discover_targets discover_targets
;
581 struct ibmvfc_port_login plogi
;
582 struct ibmvfc_process_login prli
;
583 struct ibmvfc_query_tgt query_tgt
;
584 struct ibmvfc_implicit_logout implicit_logout
;
585 struct ibmvfc_tmf tmf
;
586 struct ibmvfc_cmd cmd
;
587 struct ibmvfc_passthru_mad passthru
;
588 }__attribute__((packed
, aligned (8)));
590 enum ibmvfc_target_action
{
591 IBMVFC_TGT_ACTION_NONE
= 0,
592 IBMVFC_TGT_ACTION_INIT
,
593 IBMVFC_TGT_ACTION_INIT_WAIT
,
594 IBMVFC_TGT_ACTION_DEL_RPORT
,
597 struct ibmvfc_target
{
598 struct list_head queue
;
599 struct ibmvfc_host
*vhost
;
602 struct fc_rport
*rport
;
604 enum ibmvfc_target_action action
;
610 struct ibmvfc_service_parms service_parms
;
611 struct ibmvfc_service_parms service_parms_change
;
612 struct fc_rport_identifiers ids
;
613 void (*job_step
) (struct ibmvfc_target
*);
614 struct timer_list timer
;
618 /* a unit of work for the hosting partition */
619 struct ibmvfc_event
{
620 struct list_head queue
;
621 struct ibmvfc_host
*vhost
;
622 struct ibmvfc_target
*tgt
;
623 struct scsi_cmnd
*cmnd
;
625 union ibmvfc_iu
*xfer_iu
;
626 void (*done
) (struct ibmvfc_event
*);
627 struct ibmvfc_crq crq
;
629 union ibmvfc_iu
*sync_iu
;
630 struct srp_direct_buf
*ext_list
;
631 dma_addr_t ext_list_token
;
632 struct completion comp
;
633 struct completion
*eh_comp
;
634 struct timer_list timer
;
637 /* a pool of event structs for use */
638 struct ibmvfc_event_pool
{
639 struct ibmvfc_event
*events
;
641 union ibmvfc_iu
*iu_storage
;
645 enum ibmvfc_host_action
{
646 IBMVFC_HOST_ACTION_NONE
= 0,
647 IBMVFC_HOST_ACTION_LOGO
,
648 IBMVFC_HOST_ACTION_LOGO_WAIT
,
649 IBMVFC_HOST_ACTION_INIT
,
650 IBMVFC_HOST_ACTION_INIT_WAIT
,
651 IBMVFC_HOST_ACTION_QUERY
,
652 IBMVFC_HOST_ACTION_QUERY_TGTS
,
653 IBMVFC_HOST_ACTION_TGT_DEL
,
654 IBMVFC_HOST_ACTION_ALLOC_TGTS
,
655 IBMVFC_HOST_ACTION_TGT_INIT
,
656 IBMVFC_HOST_ACTION_TGT_DEL_FAILED
,
659 enum ibmvfc_host_state
{
671 struct list_head queue
;
672 struct Scsi_Host
*host
;
673 enum ibmvfc_host_state state
;
674 enum ibmvfc_host_action action
;
675 #define IBMVFC_NUM_TRACE_INDEX_BITS 8
676 #define IBMVFC_NUM_TRACE_ENTRIES (1 << IBMVFC_NUM_TRACE_INDEX_BITS)
677 #define IBMVFC_TRACE_SIZE (sizeof(struct ibmvfc_trace_entry) * IBMVFC_NUM_TRACE_ENTRIES)
678 struct ibmvfc_trace_entry
*trace
;
679 u32 trace_index
:IBMVFC_NUM_TRACE_INDEX_BITS
;
681 struct list_head targets
;
682 struct list_head sent
;
683 struct list_head free
;
685 struct ibmvfc_event_pool pool
;
686 struct dma_pool
*sg_pool
;
688 struct ibmvfc_crq_queue crq
;
689 struct ibmvfc_async_crq_queue async_crq
;
690 struct ibmvfc_npiv_login login_info
;
691 union ibmvfc_npiv_login_data
*login_buf
;
692 dma_addr_t login_buf_dma
;
695 struct ibmvfc_discover_targets_buf
*disc_buf
;
698 int discovery_threads
;
706 #define IBMVFC_AE_LINKUP 0x0001
707 #define IBMVFC_AE_LINKDOWN 0x0002
708 #define IBMVFC_AE_RSCN 0x0004
709 dma_addr_t disc_buf_dma
;
710 unsigned int partition_number
;
711 char partition_name
[97];
712 void (*job_step
) (struct ibmvfc_host
*);
713 struct task_struct
*work_thread
;
714 struct tasklet_struct tasklet
;
715 struct work_struct rport_add_work_q
;
716 wait_queue_head_t init_wait_q
;
717 wait_queue_head_t work_wait_q
;
720 #define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0)
722 #define tgt_dbg(t, fmt, ...) \
723 DBG_CMD(dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__))
725 #define tgt_info(t, fmt, ...) \
726 dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
728 #define tgt_err(t, fmt, ...) \
729 dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)
731 #define tgt_log(t, level, fmt, ...) \
733 if ((t)->vhost->log_level >= level) \
734 tgt_err(t, fmt, ##__VA_ARGS__); \
737 #define ibmvfc_dbg(vhost, ...) \
738 DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__))
740 #define ibmvfc_log(vhost, level, ...) \
742 if ((vhost)->log_level >= level) \
743 dev_err((vhost)->dev, ##__VA_ARGS__); \
746 #define ENTER DBG_CMD(printk(KERN_INFO IBMVFC_NAME": Entering %s\n", __func__))
747 #define LEAVE DBG_CMD(printk(KERN_INFO IBMVFC_NAME": Leaving %s\n", __func__))
749 #ifdef CONFIG_SCSI_IBMVFC_TRACE
750 #define ibmvfc_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr)
751 #define ibmvfc_remove_trace_file(kobj, attr) sysfs_remove_bin_file(kobj, attr)
753 #define ibmvfc_create_trace_file(kobj, attr) 0
754 #define ibmvfc_remove_trace_file(kobj, attr) do { } while (0)