/* * ibmvfc.h -- driver for IBM Power Virtual Fibre Channel Adapter * * Written By: Brian King , IBM Corporation * * Copyright (C) IBM Corporation, 2008 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef _IBMVFC_H #define _IBMVFC_H #include #include #include "viosrp.h" #define IBMVFC_NAME "ibmvfc" #define IBMVFC_DRIVER_VERSION "1.0.11" #define IBMVFC_DRIVER_DATE "(April 12, 2013)" #define IBMVFC_DEFAULT_TIMEOUT 60 #define IBMVFC_ADISC_CANCEL_TIMEOUT 45 #define IBMVFC_ADISC_TIMEOUT 15 #define IBMVFC_ADISC_PLUS_CANCEL_TIMEOUT \ (IBMVFC_ADISC_TIMEOUT + IBMVFC_ADISC_CANCEL_TIMEOUT) #define IBMVFC_INIT_TIMEOUT 120 #define IBMVFC_ABORT_TIMEOUT 8 #define IBMVFC_ABORT_WAIT_TIMEOUT 40 #define IBMVFC_MAX_REQUESTS_DEFAULT 100 #define IBMVFC_DEBUG 0 #define IBMVFC_MAX_TARGETS 1024 #define IBMVFC_MAX_LUN 0xffffffff #define IBMVFC_MAX_SECTORS 0xffffu #define IBMVFC_MAX_DISC_THREADS 4 #define IBMVFC_TGT_MEMPOOL_SZ 64 #define IBMVFC_MAX_CMDS_PER_LUN 64 #define IBMVFC_MAX_HOST_INIT_RETRIES 6 #define IBMVFC_MAX_TGT_INIT_RETRIES 3 #define IBMVFC_DEV_LOSS_TMO (5 * 60) #define IBMVFC_DEFAULT_LOG_LEVEL 2 #define IBMVFC_MAX_CDB_LEN 16 /* * Ensure we have resources for ERP and initialization: * 1 for ERP * 1 for initialization * 1 for NPIV Logout * 2 for BSG passthru * 2 for each discovery thread */ #define IBMVFC_NUM_INTERNAL_REQ (1 + 1 + 1 + 2 + (disc_threads * 2)) #define IBMVFC_MAD_SUCCESS 0x00 #define IBMVFC_MAD_NOT_SUPPORTED 0xF1 #define IBMVFC_MAD_FAILED 0xF7 #define IBMVFC_MAD_DRIVER_FAILED 0xEE #define IBMVFC_MAD_CRQ_ERROR 0xEF enum ibmvfc_crq_valid { IBMVFC_CRQ_CMD_RSP = 0x80, IBMVFC_CRQ_INIT_RSP = 0xC0, IBMVFC_CRQ_XPORT_EVENT = 0xFF, }; enum ibmvfc_crq_format { IBMVFC_CRQ_INIT = 0x01, IBMVFC_CRQ_INIT_COMPLETE = 0x02, IBMVFC_PARTITION_MIGRATED = 0x06, }; enum ibmvfc_cmd_status_flags { IBMVFC_FABRIC_MAPPED = 0x0001, IBMVFC_VIOS_FAILURE = 0x0002, IBMVFC_FC_FAILURE = 0x0004, IBMVFC_FC_SCSI_ERROR = 0x0008, IBMVFC_HW_EVENT_LOGGED = 0x0010, IBMVFC_VIOS_LOGGED = 0x0020, }; enum ibmvfc_fabric_mapped_errors { IBMVFC_UNABLE_TO_ESTABLISH = 0x0001, IBMVFC_XPORT_FAULT = 0x0002, IBMVFC_CMD_TIMEOUT = 0x0003, IBMVFC_ENETDOWN = 0x0004, IBMVFC_HW_FAILURE = 0x0005, IBMVFC_LINK_DOWN_ERR = 0x0006, IBMVFC_LINK_DEAD_ERR = 0x0007, IBMVFC_UNABLE_TO_REGISTER = 0x0008, IBMVFC_XPORT_BUSY = 0x000A, IBMVFC_XPORT_DEAD = 0x000B, IBMVFC_CONFIG_ERROR = 0x000C, IBMVFC_NAME_SERVER_FAIL = 0x000D, IBMVFC_LINK_HALTED = 0x000E, IBMVFC_XPORT_GENERAL = 0x8000, }; enum ibmvfc_vios_errors { IBMVFC_CRQ_FAILURE = 0x0001, IBMVFC_SW_FAILURE = 0x0002, IBMVFC_INVALID_PARAMETER = 0x0003, IBMVFC_MISSING_PARAMETER = 0x0004, IBMVFC_HOST_IO_BUS = 0x0005, IBMVFC_TRANS_CANCELLED = 0x0006, IBMVFC_TRANS_CANCELLED_IMPLICIT = 0x0007, IBMVFC_INSUFFICIENT_RESOURCE = 0x0008, IBMVFC_PLOGI_REQUIRED = 0x0010, IBMVFC_COMMAND_FAILED = 0x8000, }; enum ibmvfc_mad_types { IBMVFC_NPIV_LOGIN = 0x0001, IBMVFC_DISC_TARGETS = 0x0002, IBMVFC_PORT_LOGIN = 0x0004, IBMVFC_PROCESS_LOGIN = 0x0008, IBMVFC_QUERY_TARGET = 0x0010, IBMVFC_IMPLICIT_LOGOUT = 0x0040, IBMVFC_PASSTHRU = 0x0200, IBMVFC_TMF_MAD = 0x0100, IBMVFC_NPIV_LOGOUT = 0x0800, }; struct ibmvfc_mad_common { __be32 version; __be32 reserved; __be32 opcode; __be16 status; __be16 length; __be64 tag; }__attribute__((packed, aligned (8))); struct ibmvfc_npiv_login_mad { struct ibmvfc_mad_common common; struct srp_direct_buf buffer; }__attribute__((packed, aligned (8))); struct ibmvfc_npiv_logout_mad { struct ibmvfc_mad_common common; }__attribute__((packed, aligned (8))); #define IBMVFC_MAX_NAME 256 struct ibmvfc_npiv_login { __be32 ostype; #define IBMVFC_OS_LINUX 0x02 __be32 pad; __be64 max_dma_len; __be32 max_payload; __be32 max_response; __be32 partition_num; __be32 vfc_frame_version; __be16 fcp_version; __be16 flags; #define IBMVFC_CLIENT_MIGRATED 0x01 #define IBMVFC_FLUSH_ON_HALT 0x02 __be32 max_cmds; __be64 capabilities; #define IBMVFC_CAN_MIGRATE 0x01 __be64 node_name; struct srp_direct_buf async; u8 partition_name[IBMVFC_MAX_NAME]; u8 device_name[IBMVFC_MAX_NAME]; u8 drc_name[IBMVFC_MAX_NAME]; __be64 reserved2[2]; }__attribute__((packed, aligned (8))); struct ibmvfc_common_svc_parms { __be16 fcph_version; __be16 b2b_credit; __be16 features; __be16 bb_rcv_sz; /* upper nibble is BB_SC_
# GENERATED FROM XML -- DO NOT EDIT

URI: stopping.html.de
Content-Language: de
Content-type: text/html; charset=ISO-8859-1

URI: stopping.html.en
Content-Language: en
Content-type: text/html; charset=ISO-8859-1

URI: stopping.html.es
Content-Language: es
Content-type: text/html; charset=ISO-8859-1

URI: stopping.html.ja.utf8
Content-Language: ja
Content-type: text/html; charset=UTF-8

URI: stopping.html.ko.euc-kr
Content-Language: ko
Content-type: text/html; charset=EUC-KR

URI: stopping.html.ru.koi8-r
Content-Language: ru
Content-type: text/html; charset=KOI8-R

URI: stopping.html.tr.utf8
Content-Language: tr
Content-type: text/html; charset=UTF-8
on ibmvfc_iu *sync_iu; struct srp_direct_buf *ext_list; dma_addr_t ext_list_token; struct completion comp; struct completion *eh_comp; struct timer_list timer; }; /* a pool of event structs for use */ struct ibmvfc_event_pool { struct ibmvfc_event *events; u32 size; union ibmvfc_iu *iu_storage; dma_addr_t iu_token; }; enum ibmvfc_host_action { IBMVFC_HOST_ACTION_NONE = 0, IBMVFC_HOST_ACTION_RESET, IBMVFC_HOST_ACTION_REENABLE, IBMVFC_HOST_ACTION_LOGO, IBMVFC_HOST_ACTION_LOGO_WAIT, IBMVFC_HOST_ACTION_INIT, IBMVFC_HOST_ACTION_INIT_WAIT, IBMVFC_HOST_ACTION_QUERY, IBMVFC_HOST_ACTION_QUERY_TGTS, IBMVFC_HOST_ACTION_TGT_DEL, IBMVFC_HOST_ACTION_ALLOC_TGTS, IBMVFC_HOST_ACTION_TGT_INIT, IBMVFC_HOST_ACTION_TGT_DEL_FAILED, }; enum ibmvfc_host_state { IBMVFC_NO_CRQ = 0, IBMVFC_INITIALIZING, IBMVFC_ACTIVE, IBMVFC_HALTED, IBMVFC_LINK_DOWN, IBMVFC_LINK_DEAD, IBMVFC_HOST_OFFLINE, }; struct ibmvfc_host { char name[8]; struct list_head queue; struct Scsi_Host *host; enum ibmvfc_host_state state; enum ibmvfc_host_action action; #define IBMVFC_NUM_TRACE_INDEX_BITS 8 #define IBMVFC_NUM_TRACE_ENTRIES (1 << IBMVFC_NUM_TRACE_INDEX_BITS) #define IBMVFC_TRACE_SIZE (sizeof(struct ibmvfc_trace_entry) * IBMVFC_NUM_TRACE_ENTRIES) struct ibmvfc_trace_entry *trace; u32 trace_index:IBMVFC_NUM_TRACE_INDEX_BITS; int num_targets; struct list_head targets; struct list_head sent; struct list_head free; struct device *dev; struct ibmvfc_event_pool pool; struct dma_pool *sg_pool; mempool_t *tgt_pool; struct ibmvfc_crq_queue crq; struct ibmvfc_async_crq_queue async_crq; struct ibmvfc_npiv_login login_info; union ibmvfc_npiv_login_data *login_buf; dma_addr_t login_buf_dma; int disc_buf_sz; int log_level; struct ibmvfc_discover_targets_buf *disc_buf; struct mutex passthru_mutex; int task_set; int init_retries; int discovery_threads; int abort_threads; int client_migrated; int reinit; int delay_init; int scan_complete; int logged_in; int aborting_passthru; int events_to_log; #define IBMVFC_AE_LINKUP 0x0001 #define IBMVFC_AE_LINKDOWN 0x0002 #define IBMVFC_AE_RSCN 0x0004 dma_addr_t disc_buf_dma; unsigned int partition_number; char partition_name[97]; void (*job_step) (struct ibmvfc_host *); struct task_struct *work_thread; struct tasklet_struct tasklet; struct work_struct rport_add_work_q; wait_queue_head_t init_wait_q; wait_queue_head_t work_wait_q; }; #define DBG_CMD(CMD) do { if (ibmvfc_debug) CMD; } while (0) #define tgt_dbg(t, fmt, ...) \ DBG_CMD(dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__)) #define tgt_info(t, fmt, ...) \ dev_info((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__) #define tgt_err(t, fmt, ...) \ dev_err((t)->vhost->dev, "%llX: " fmt, (t)->scsi_id, ##__VA_ARGS__) #define tgt_log(t, level, fmt, ...) \ do { \ if ((t)->vhost->log_level >= level) \ tgt_err(t, fmt, ##__VA_ARGS__); \ } while (0) #define ibmvfc_dbg(vhost, ...) \ DBG_CMD(dev_info((vhost)->dev, ##__VA_ARGS__)) #define ibmvfc_log(vhost, level, ...) \ do { \ if ((vhost)->log_level >= level) \ dev_err((vhost)->dev, ##__VA_ARGS__); \ } while (0) #define ENTER DBG_CMD(printk(KERN_INFO IBMVFC_NAME": Entering %s\n", __func__)) #define LEAVE DBG_CMD(printk(KERN_INFO IBMVFC_NAME": Leaving %s\n", __func__)) #ifdef CONFIG_SCSI_IBMVFC_TRACE #define ibmvfc_create_trace_file(kobj, attr) sysfs_create_bin_file(kobj, attr) #define ibmvfc_remove_trace_file(kobj, attr) sysfs_remove_bin_file(kobj, attr) #else #define ibmvfc_create_trace_file(kobj, attr) 0 #define ibmvfc_remove_trace_file(kobj, attr) do { } while (0) #endif #endif