diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-10-20 00:10:27 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-10-20 00:10:27 -0300 |
commit | d0b2f91bede3bd5e3d24dd6803e56eee959c1797 (patch) | |
tree | 7fee4ab0509879c373c4f2cbd5b8a5be5b4041ee /include/scsi | |
parent | e914f8eb445e8f74b00303c19c2ffceaedd16a05 (diff) |
Linux-libre 4.8.2-gnupck-4.8.2-gnu
Diffstat (limited to 'include/scsi')
-rw-r--r-- | include/scsi/fc/fc_fip.h | 21 | ||||
-rw-r--r-- | include/scsi/libfc.h | 1 | ||||
-rw-r--r-- | include/scsi/libfcoe.h | 25 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 1 | ||||
-rw-r--r-- | include/scsi/scsi_host.h | 5 | ||||
-rw-r--r-- | include/scsi/scsi_transport_sas.h | 5 | ||||
-rw-r--r-- | include/scsi/viosrp.h | 220 |
7 files changed, 256 insertions, 22 deletions
diff --git a/include/scsi/fc/fc_fip.h b/include/scsi/fc/fc_fip.h index ae25d4ab2..9710254fd 100644 --- a/include/scsi/fc/fc_fip.h +++ b/include/scsi/fc/fc_fip.h @@ -22,7 +22,7 @@ /* * This version is based on: * http://www.t11.org/ftp/t11/pub/fc/bb-5/08-543v1.pdf - * and T11 FC-BB-6 10-019v4.pdf (June 2010 VN2VN proposal) + * and T11 FC-BB-6 13-091v5.pdf (December 2013 VN2VN proposal) */ #define FIP_DEF_PRI 128 /* default selection priority */ @@ -109,8 +109,9 @@ enum fip_reset_subcode { * Subcodes for FIP_OP_VLAN. */ enum fip_vlan_subcode { - FIP_SC_VL_REQ = 1, /* request */ - FIP_SC_VL_REP = 2, /* reply */ + FIP_SC_VL_REQ = 1, /* vlan request */ + FIP_SC_VL_NOTE = 2, /* vlan notification */ + FIP_SC_VL_VN2VN_NOTE = 3, /* VN2VN vlan notification */ }; /* @@ -130,6 +131,8 @@ enum fip_vn2vn_subcode { enum fip_flag { FIP_FL_FPMA = 0x8000, /* supports FPMA fabric-provided MACs */ FIP_FL_SPMA = 0x4000, /* supports SPMA server-provided MACs */ + FIP_FL_FCF = 0x0020, /* originated from a controlling FCF */ + FIP_FL_FDF = 0x0010, /* originated from an FDF */ FIP_FL_REC_OR_P2P = 0x0008, /* configured addr or point-to-point */ FIP_FL_AVAIL = 0x0004, /* available for FLOGI/ELP */ FIP_FL_SOL = 0x0002, /* this is a solicited message */ @@ -161,7 +164,9 @@ enum fip_desc_type { FIP_DT_VLAN = 14, /* vlan number */ FIP_DT_FC4F = 15, /* FC-4 features */ FIP_DT_LIMIT, /* max defined desc_type + 1 */ - FIP_DT_VENDOR_BASE = 128, /* first vendor-specific desc_type */ + FIP_DT_NON_CRITICAL = 128, /* First non-critical descriptor */ + FIP_DT_CLR_VLINKS = 128, /* Clear virtual links reason code */ + FIP_DT_VENDOR_BASE = 241, /* first vendor-specific desc_type */ }; /* @@ -259,6 +264,14 @@ enum fip_fka_flags { /* FIP_DT_FKA flags */ /* + * FIP_DT_VLAN descriptor + */ +struct fip_vlan_desc { + struct fip_desc fd_desc; + __be16 fd_vlan; /* Note: highest 4 bytes are unused */ +} __attribute__((packed)); + +/* * FIP_DT_FC4F - FC-4 features. */ struct fip_fc4_feat { diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 93d14daf0..7428a5325 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -878,6 +878,7 @@ struct fc_lport { struct libfc_function_template tt; u8 link_up; u8 qfull; + u16 vlan; enum fc_lport_state state; unsigned long boot_time; struct fc_host_statistics host_stats; diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index de7e3ee60..722d3264d 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h @@ -78,10 +78,12 @@ enum fip_state { * The mode is the state that is to be entered after link up. * It must not change after fcoe_ctlr_init() sets it. */ -#define FIP_MODE_AUTO FIP_ST_AUTO -#define FIP_MODE_NON_FIP FIP_ST_NON_FIP -#define FIP_MODE_FABRIC FIP_ST_ENABLED -#define FIP_MODE_VN2VN FIP_ST_VNMP_START +enum fip_mode { + FIP_MODE_AUTO = FIP_ST_AUTO, + FIP_MODE_NON_FIP, + FIP_MODE_FABRIC, + FIP_MODE_VN2VN, +}; /** * struct fcoe_ctlr - FCoE Controller and FIP state @@ -108,8 +110,10 @@ enum fip_state { * @flogi_req_send: send of FLOGI requested * @flogi_count: number of FLOGI attempts in AUTO mode. * @map_dest: use the FC_MAP mode for destination MAC addresses. + * @fip_resp: start FIP VLAN discovery responder * @spma: supports SPMA server-provided MACs mode * @probe_tries: number of FC_IDs probed + * @priority: DCBx FCoE APP priority * @dest_addr: MAC address of the selected FC forwarder. * @ctl_src_addr: the native MAC address of our local port. * @send: LLD-supplied function to handle sending FIP Ethernet frames @@ -124,7 +128,7 @@ enum fip_state { */ struct fcoe_ctlr { enum fip_state state; - enum fip_state mode; + enum fip_mode mode; struct fc_lport *lp; struct fcoe_fcf *sel_fcf; struct list_head fcfs; @@ -147,7 +151,8 @@ struct fcoe_ctlr { u16 flogi_oxid; u8 flogi_req_send; u8 flogi_count; - u8 map_dest; + bool map_dest; + bool fip_resp; u8 spma; u8 probe_tries; u8 priority; @@ -311,7 +316,7 @@ struct fcoe_transport { struct list_head list; bool (*match) (struct net_device *device); int (*alloc) (struct net_device *device); - int (*create) (struct net_device *device, enum fip_state fip_mode); + int (*create) (struct net_device *device, enum fip_mode fip_mode); int (*destroy) (struct net_device *device); int (*enable) (struct net_device *device); int (*disable) (struct net_device *device); @@ -319,14 +324,16 @@ struct fcoe_transport { /** * struct fcoe_percpu_s - The context for FCoE receive thread(s) - * @thread: The thread context + * @kthread: The thread context (used by bnx2fc) + * @work: The work item (used by fcoe) * @fcoe_rx_list: The queue of pending packets to process * @page: The memory page for calculating frame trailer CRCs * @crc_eof_offset: The offset into the CRC page pointing to available * memory for a new trailer */ struct fcoe_percpu_s { - struct task_struct *thread; + struct task_struct *kthread; + struct work_struct work; struct sk_buff_head fcoe_rx_list; struct page *crc_eof_page; int crc_eof_offset; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index a6c346df2..8a9563144 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -94,7 +94,6 @@ struct scsi_device { spinlock_t list_lock; struct list_head cmd_list; /* queue of in use SCSI Command structures */ struct list_head starved_entry; - struct scsi_cmnd *current_cmnd; /* currently active command */ unsigned short queue_depth; /* How deep of a queue we want */ unsigned short max_queue_depth; /* max queue depth */ unsigned short last_queue_full_depth; /* These two are used by */ diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 76e9d278c..7e4cd5313 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -495,9 +495,6 @@ struct scsi_host_template { */ unsigned int cmd_size; struct scsi_host_cmd_pool *cmd_pool; - - /* temporary flag to disable blk-mq I/O path */ - bool disable_blk_mq; }; /* @@ -774,8 +771,6 @@ static inline int scsi_host_in_recovery(struct Scsi_Host *shost) shost->tmf_in_progress; } -extern bool scsi_use_blk_mq; - static inline bool shost_use_blk_mq(struct Scsi_Host *shost) { return shost->use_blk_mq; diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h index 13c0b2ba1..73d870918 100644 --- a/include/scsi/scsi_transport_sas.h +++ b/include/scsi/scsi_transport_sas.h @@ -11,12 +11,12 @@ struct sas_rphy; struct request; #if !IS_ENABLED(CONFIG_SCSI_SAS_ATTRS) -static inline int is_sas_attached(struct scsi_device *sdev) +static inline int scsi_is_sas_rphy(const struct device *sdev) { return 0; } #else -extern int is_sas_attached(struct scsi_device *sdev); +extern int scsi_is_sas_rphy(const struct device *); #endif static inline int sas_protocol_ata(enum sas_protocol proto) @@ -202,7 +202,6 @@ extern int sas_rphy_add(struct sas_rphy *); extern void sas_rphy_remove(struct sas_rphy *); extern void sas_rphy_delete(struct sas_rphy *); extern void sas_rphy_unlink(struct sas_rphy *); -extern int scsi_is_sas_rphy(const struct device *); struct sas_port *sas_port_alloc(struct device *, int); struct sas_port *sas_port_alloc_num(struct device *); diff --git a/include/scsi/viosrp.h b/include/scsi/viosrp.h new file mode 100644 index 000000000..974e07bd8 --- /dev/null +++ b/include/scsi/viosrp.h @@ -0,0 +1,220 @@ +/*****************************************************************************/ +/* srp.h -- SCSI RDMA Protocol definitions */ +/* */ +/* Written By: Colin Devilbis, IBM Corporation */ +/* */ +/* Copyright (C) 2003 IBM Corporation */ +/* */ +/* 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. */ +/* */ +/* This file contains structures and definitions for IBM RPA (RS/6000 */ +/* platform architecture) implementation of the SRP (SCSI RDMA Protocol) */ +/* standard. SRP is used on IBM iSeries and pSeries platforms to send SCSI */ +/* commands between logical partitions. */ +/* */ +/* SRP Information Units (IUs) are sent on a "Command/Response Queue" (CRQ) */ +/* between partitions. The definitions in this file are architected, */ +/* and cannot be changed without breaking compatibility with other versions */ +/* of Linux and other operating systems (AIX, OS/400) that talk this protocol*/ +/* between logical partitions */ +/*****************************************************************************/ +#ifndef VIOSRP_H +#define VIOSRP_H +#include <scsi/srp.h> + +#define SRP_VERSION "16.a" +#define SRP_MAX_IU_LEN 256 +#define SRP_MAX_LOC_LEN 32 + +union srp_iu { + struct srp_login_req login_req; + struct srp_login_rsp login_rsp; + struct srp_login_rej login_rej; + struct srp_i_logout i_logout; + struct srp_t_logout t_logout; + struct srp_tsk_mgmt tsk_mgmt; + struct srp_cmd cmd; + struct srp_rsp rsp; + u8 reserved[SRP_MAX_IU_LEN]; +}; + +enum viosrp_crq_headers { + VIOSRP_CRQ_FREE = 0x00, + VIOSRP_CRQ_CMD_RSP = 0x80, + VIOSRP_CRQ_INIT_RSP = 0xC0, + VIOSRP_CRQ_XPORT_EVENT = 0xFF +}; + +enum viosrp_crq_init_formats { + VIOSRP_CRQ_INIT = 0x01, + VIOSRP_CRQ_INIT_COMPLETE = 0x02 +}; + +enum viosrp_crq_formats { + VIOSRP_SRP_FORMAT = 0x01, + VIOSRP_MAD_FORMAT = 0x02, + VIOSRP_OS400_FORMAT = 0x03, + VIOSRP_AIX_FORMAT = 0x04, + VIOSRP_LINUX_FORMAT = 0x05, + VIOSRP_INLINE_FORMAT = 0x06 +}; + +enum viosrp_crq_status { + VIOSRP_OK = 0x0, + VIOSRP_NONRECOVERABLE_ERR = 0x1, + VIOSRP_VIOLATES_MAX_XFER = 0x2, + VIOSRP_PARTNER_PANIC = 0x3, + VIOSRP_DEVICE_BUSY = 0x8, + VIOSRP_ADAPTER_FAIL = 0x10, + VIOSRP_OK2 = 0x99, +}; + +struct viosrp_crq { + u8 valid; /* used by RPA */ + u8 format; /* SCSI vs out-of-band */ + u8 reserved; + u8 status; /* non-scsi failure? (e.g. DMA failure) */ + __be16 timeout; /* in seconds */ + __be16 IU_length; /* in bytes */ + __be64 IU_data_ptr; /* the TCE for transferring data */ +}; + +/* MADs are Management requests above and beyond the IUs defined in the SRP + * standard. + */ +enum viosrp_mad_types { + VIOSRP_EMPTY_IU_TYPE = 0x01, + VIOSRP_ERROR_LOG_TYPE = 0x02, + VIOSRP_ADAPTER_INFO_TYPE = 0x03, + VIOSRP_CAPABILITIES_TYPE = 0x05, + VIOSRP_ENABLE_FAST_FAIL = 0x08, +}; + +enum viosrp_mad_status { + VIOSRP_MAD_SUCCESS = 0x00, + VIOSRP_MAD_NOT_SUPPORTED = 0xF1, + VIOSRP_MAD_FAILED = 0xF7, +}; + +enum viosrp_capability_type { + MIGRATION_CAPABILITIES = 0x01, + RESERVATION_CAPABILITIES = 0x02, +}; + +enum viosrp_capability_support { + SERVER_DOES_NOT_SUPPORTS_CAP = 0x0, + SERVER_SUPPORTS_CAP = 0x01, + SERVER_CAP_DATA = 0x02, +}; + +enum viosrp_reserve_type { + CLIENT_RESERVE_SCSI_2 = 0x01, +}; + +enum viosrp_capability_flag { + CLIENT_MIGRATED = 0x01, + CLIENT_RECONNECT = 0x02, + CAP_LIST_SUPPORTED = 0x04, + CAP_LIST_DATA = 0x08, +}; + +/* + * Common MAD header + */ +struct mad_common { + __be32 type; + __be16 status; + __be16 length; + __be64 tag; +}; + +/* + * All SRP (and MAD) requests normally flow from the + * client to the server. There is no way for the server to send + * an asynchronous message back to the client. The Empty IU is used + * to hang out a meaningless request to the server so that it can respond + * asynchrouously with something like a SCSI AER + */ +struct viosrp_empty_iu { + struct mad_common common; + __be64 buffer; + __be32 port; +}; + +struct viosrp_error_log { + struct mad_common common; + __be64 buffer; +}; + +struct viosrp_adapter_info { + struct mad_common common; + __be64 buffer; +}; + +struct viosrp_fast_fail { + struct mad_common common; +}; + +struct viosrp_capabilities { + struct mad_common common; + __be64 buffer; +}; + +struct mad_capability_common { + __be32 cap_type; + __be16 length; + __be16 server_support; +}; + +struct mad_reserve_cap { + struct mad_capability_common common; + __be32 type; +}; + +struct mad_migration_cap { + struct mad_capability_common common; + __be32 ecl; +}; + +struct capabilities { + __be32 flags; + char name[SRP_MAX_LOC_LEN]; + char loc[SRP_MAX_LOC_LEN]; + struct mad_migration_cap migration; + struct mad_reserve_cap reserve; +}; + +union mad_iu { + struct viosrp_empty_iu empty_iu; + struct viosrp_error_log error_log; + struct viosrp_adapter_info adapter_info; + struct viosrp_fast_fail fast_fail; + struct viosrp_capabilities capabilities; +}; + +union viosrp_iu { + union srp_iu srp; + union mad_iu mad; +}; + +struct mad_adapter_info_data { + char srp_version[8]; + char partition_name[96]; + __be32 partition_number; +#define SRP_MAD_VERSION_1 1 + __be32 mad_version; +#define SRP_MAD_OS_LINUX 2 +#define SRP_MAD_OS_AIX 3 + __be32 os_type; + __be32 port_max_txu[8]; /* per-port maximum transfer */ +}; + +#endif |