Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  *  linux/drivers/message/fusion/mptsas.h
0003  *      High performance SCSI + LAN / Fibre Channel device drivers.
0004  *      For use with PCI chip/adapter(s):
0005  *          LSIFC9xx/LSI409xx Fibre Channel
0006  *      running LSI MPT (Message Passing Technology) firmware.
0007  *
0008  *  Copyright (c) 1999-2008 LSI Corporation
0009  *  (mailto:DL-MPTFusionLinux@lsi.com)
0010  *
0011  */
0012 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
0013 /*
0014     This program is free software; you can redistribute it and/or modify
0015     it under the terms of the GNU General Public License as published by
0016     the Free Software Foundation; version 2 of the License.
0017 
0018     This program is distributed in the hope that it will be useful,
0019     but WITHOUT ANY WARRANTY; without even the implied warranty of
0020     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0021     GNU General Public License for more details.
0022 
0023     NO WARRANTY
0024     THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR
0025     CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT
0026     LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
0027     MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is
0028     solely responsible for determining the appropriateness of using and
0029     distributing the Program and assumes all risks associated with its
0030     exercise of rights under this Agreement, including but not limited to
0031     the risks and costs of program errors, damage to or loss of data,
0032     programs or equipment, and unavailability or interruption of operations.
0033 
0034     DISCLAIMER OF LIABILITY
0035     NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY
0036     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0037     DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND
0038     ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
0039     TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
0040     USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
0041     HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES
0042 
0043     You should have received a copy of the GNU General Public License
0044     along with this program; if not, write to the Free Software
0045     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
0046 */
0047 
0048 #ifndef MPTSAS_H_INCLUDED
0049 #define MPTSAS_H_INCLUDED
0050 /*{-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
0051 
0052 struct mptsas_target_reset_event {
0053     struct list_head    list;
0054     EVENT_DATA_SAS_DEVICE_STATUS_CHANGE sas_event_data;
0055     u8  target_reset_issued;
0056     unsigned long    time_count;
0057 };
0058 
0059 enum mptsas_hotplug_action {
0060     MPTSAS_ADD_DEVICE,
0061     MPTSAS_DEL_DEVICE,
0062     MPTSAS_ADD_RAID,
0063     MPTSAS_DEL_RAID,
0064     MPTSAS_ADD_PHYSDISK,
0065     MPTSAS_ADD_PHYSDISK_REPROBE,
0066     MPTSAS_DEL_PHYSDISK,
0067     MPTSAS_DEL_PHYSDISK_REPROBE,
0068     MPTSAS_ADD_INACTIVE_VOLUME,
0069     MPTSAS_IGNORE_EVENT,
0070 };
0071 
0072 struct mptsas_mapping{
0073     u8          id;
0074     u8          channel;
0075 };
0076 
0077 struct mptsas_device_info {
0078     struct list_head    list;
0079     struct mptsas_mapping   os; /* operating system mapping*/
0080     struct mptsas_mapping   fw; /* firmware mapping */
0081     u64         sas_address;
0082     u32         device_info; /* specific bits for devices */
0083     u16         slot;       /* enclosure slot id */
0084     u64         enclosure_logical_id; /*enclosure address */
0085     u8          is_logical_volume; /* is this logical volume */
0086     /* this belongs to volume */
0087     u8          is_hidden_raid_component;
0088     /* this valid when is_hidden_raid_component set */
0089     u8          volume_id;
0090     /* cached data for a removed device */
0091     u8          is_cached;
0092 };
0093 
0094 struct mptsas_hotplug_event {
0095     MPT_ADAPTER     *ioc;
0096     enum mptsas_hotplug_action event_type;
0097     u64         sas_address;
0098     u8          channel;
0099     u8          id;
0100     u32         device_info;
0101     u16         handle;
0102     u8          phy_id;
0103     u8          phys_disk_num;      /* hrc - unique index*/
0104     struct scsi_device  *sdev;
0105 };
0106 
0107 struct fw_event_work {
0108     struct list_head    list;
0109     struct delayed_work  work;
0110     int         users;
0111     MPT_ADAPTER *ioc;
0112     u32         event;
0113     u8          retries;
0114     char            event_data[] __aligned(4);
0115 };
0116 
0117 struct mptsas_discovery_event {
0118     struct work_struct  work;
0119     MPT_ADAPTER     *ioc;
0120 };
0121 
0122 /*
0123  * SAS topology structures
0124  *
0125  * The MPT Fusion firmware interface spreads information about the
0126  * SAS topology over many manufacture pages, thus we need some data
0127  * structure to collect it and process it for the SAS transport class.
0128  */
0129 
0130 struct mptsas_devinfo {
0131     u16 handle;     /* unique id to address this device */
0132     u16 handle_parent;  /* unique id to address parent device */
0133     u16 handle_enclosure; /* enclosure identifier of the enclosure */
0134     u16 slot;       /* physical slot in enclosure */
0135     u8  phy_id;     /* phy number of parent device */
0136     u8  port_id;    /* sas physical port this device
0137                    is assoc'd with */
0138     u8  id;     /* logical target id of this device */
0139     u32 phys_disk_num;  /* phys disk id, for csmi-ioctls */
0140     u8  channel;    /* logical bus number of this device */
0141     u64 sas_address;    /* WWN of this device,
0142                    SATA is assigned by HBA,expander */
0143     u32 device_info;    /* bitfield detailed info about this device */
0144     u16 flags;      /* sas device pg0 flags */
0145 };
0146 
0147 /*
0148  * Specific details on ports, wide/narrow
0149  */
0150 struct mptsas_portinfo_details{
0151     u16 num_phys;   /* number of phys belong to this port */
0152     u64 phy_bitmask;    /* TODO, extend support for 255 phys */
0153     struct sas_rphy *rphy;  /* transport layer rphy object */
0154     struct sas_port *port;  /* transport layer port object */
0155     struct scsi_target *starget;
0156     struct mptsas_portinfo *port_info;
0157 };
0158 
0159 struct mptsas_phyinfo {
0160     u16 handle;         /* unique id to address this */
0161     u8  phy_id;         /* phy index */
0162     u8  port_id;        /* firmware port identifier */
0163     u8  negotiated_link_rate;   /* nego'd link rate for this phy */
0164     u8  hw_link_rate;       /* hardware max/min phys link rate */
0165     u8  programmed_link_rate;   /* programmed max/min phy link rate */
0166     u8  sas_port_add_phy;   /* flag to request sas_port_add_phy*/
0167     struct mptsas_devinfo identify; /* point to phy device info */
0168     struct mptsas_devinfo attached; /* point to attached device info */
0169     struct sas_phy *phy;        /* transport layer phy object */
0170     struct mptsas_portinfo *portinfo;
0171     struct mptsas_portinfo_details * port_details;
0172 };
0173 
0174 struct mptsas_portinfo {
0175     struct list_head list;
0176     u16     num_phys;   /* number of phys */
0177     struct mptsas_phyinfo *phy_info;
0178 };
0179 
0180 struct mptsas_enclosure {
0181     u64 enclosure_logical_id;   /* The WWN for the enclosure */
0182     u16 enclosure_handle;   /* unique id to address this */
0183     u16 flags;          /* details enclosure management */
0184     u16 num_slot;       /* num slots */
0185     u16 start_slot;     /* first slot */
0186     u8  start_id;       /* starting logical target id */
0187     u8  start_channel;      /* starting logical channel id */
0188     u8  sep_id;         /* SEP device logical target id */
0189     u8  sep_channel;        /* SEP channel logical channel id */
0190 };
0191 
0192 /*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
0193 #endif