Back to home page

OSCL-LXR

 
 

    


0001 /*******************************************************************
0002  * This file is part of the Emulex Linux Device Driver for         *
0003  * Fibre Channel Host Bus Adapters.                                *
0004  * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term *
0005  * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.     *
0006  * Copyright (C) 2010 Emulex.  All rights reserved.                *
0007  * EMULEX and SLI are trademarks of Emulex.                        *
0008  * www.broadcom.com                                                *
0009  *                                                                 *
0010  * This program is free software; you can redistribute it and/or   *
0011  * modify it under the terms of version 2 of the GNU General       *
0012  * Public License as published by the Free Software Foundation.    *
0013  * This program is distributed in the hope that it will be useful. *
0014  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
0015  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
0016  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
0017  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
0018  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
0019  * more details, a copy of which can be found in the file COPYING  *
0020  * included with this package.                                     *
0021  *******************************************************************/
0022 
0023 /* Event definitions for RegisterForEvent */
0024 #define FC_REG_LINK_EVENT       0x0001  /* link up / down events */
0025 #define FC_REG_RSCN_EVENT       0x0002  /* RSCN events */
0026 #define FC_REG_CT_EVENT         0x0004  /* CT request events */
0027 #define FC_REG_DUMP_EVENT       0x0010  /* Dump events */
0028 #define FC_REG_TEMPERATURE_EVENT    0x0020  /* temperature events */
0029 #define FC_REG_VPORTRSCN_EVENT      0x0040  /* Vport RSCN events */
0030 #define FC_REG_ELS_EVENT        0x0080  /* lpfc els events */
0031 #define FC_REG_FABRIC_EVENT     0x0100  /* lpfc fabric events */
0032 #define FC_REG_SCSI_EVENT       0x0200  /* lpfc scsi events */
0033 #define FC_REG_BOARD_EVENT      0x0400  /* lpfc board events */
0034 #define FC_REG_ADAPTER_EVENT        0x0800  /* lpfc adapter events */
0035 #define FC_REG_EVENT_MASK       (FC_REG_LINK_EVENT | \
0036                         FC_REG_RSCN_EVENT | \
0037                         FC_REG_CT_EVENT | \
0038                         FC_REG_DUMP_EVENT | \
0039                         FC_REG_TEMPERATURE_EVENT | \
0040                         FC_REG_VPORTRSCN_EVENT | \
0041                         FC_REG_ELS_EVENT | \
0042                         FC_REG_FABRIC_EVENT | \
0043                         FC_REG_SCSI_EVENT | \
0044                         FC_REG_BOARD_EVENT | \
0045                         FC_REG_ADAPTER_EVENT)
0046 /* Temperature events */
0047 #define LPFC_CRIT_TEMP      0x1
0048 #define LPFC_THRESHOLD_TEMP 0x2
0049 #define LPFC_NORMAL_TEMP    0x3
0050 /*
0051  * All net link event payloads will begin with and event type
0052  * and subcategory. The event type must come first.
0053  * The subcategory further defines the data that follows in the rest
0054  * of the payload. Each category will have its own unique header plus
0055  * any additional data unique to the subcategory.
0056  * The payload sent via the fc transport is one-way driver->application.
0057  */
0058 
0059 /* RSCN event header */
0060 struct lpfc_rscn_event_header {
0061     uint32_t event_type;
0062     uint32_t payload_length; /* RSCN data length in bytes */
0063     uint32_t rscn_payload[];
0064 };
0065 
0066 /* els event header */
0067 struct lpfc_els_event_header {
0068     uint32_t event_type;
0069     uint32_t subcategory;
0070     uint8_t wwpn[8];
0071     uint8_t wwnn[8];
0072 };
0073 
0074 /* subcategory codes for FC_REG_ELS_EVENT */
0075 #define LPFC_EVENT_PLOGI_RCV        0x01
0076 #define LPFC_EVENT_PRLO_RCV     0x02
0077 #define LPFC_EVENT_ADISC_RCV        0x04
0078 #define LPFC_EVENT_LSRJT_RCV        0x08
0079 #define LPFC_EVENT_LOGO_RCV     0x10
0080 
0081 /* special els lsrjt event */
0082 struct lpfc_lsrjt_event {
0083     struct lpfc_els_event_header header;
0084     uint32_t command;
0085     uint32_t reason_code;
0086     uint32_t explanation;
0087 };
0088 
0089 /* special els logo event */
0090 struct lpfc_logo_event {
0091     struct lpfc_els_event_header header;
0092     uint8_t logo_wwpn[8];
0093 };
0094 
0095 /* fabric event header */
0096 struct lpfc_fabric_event_header {
0097     uint32_t event_type;
0098     uint32_t subcategory;
0099     uint8_t wwpn[8];
0100     uint8_t wwnn[8];
0101 };
0102 
0103 /* subcategory codes for FC_REG_FABRIC_EVENT */
0104 #define LPFC_EVENT_FABRIC_BUSY      0x01
0105 #define LPFC_EVENT_PORT_BUSY        0x02
0106 #define LPFC_EVENT_FCPRDCHKERR      0x04
0107 
0108 /* special case fabric fcprdchkerr event */
0109 struct lpfc_fcprdchkerr_event {
0110     struct lpfc_fabric_event_header header;
0111     uint32_t lun;
0112     uint32_t opcode;
0113     uint32_t fcpiparam;
0114 };
0115 
0116 
0117 /* scsi event header */
0118 struct lpfc_scsi_event_header {
0119     uint32_t event_type;
0120     uint32_t subcategory;
0121     uint32_t lun;
0122     uint8_t wwpn[8];
0123     uint8_t wwnn[8];
0124 };
0125 
0126 /* subcategory codes for FC_REG_SCSI_EVENT */
0127 #define LPFC_EVENT_QFULL    0x0001
0128 #define LPFC_EVENT_DEVBSY   0x0002
0129 #define LPFC_EVENT_CHECK_COND   0x0004
0130 #define LPFC_EVENT_LUNRESET 0x0008
0131 #define LPFC_EVENT_TGTRESET 0x0010
0132 #define LPFC_EVENT_BUSRESET 0x0020
0133 #define LPFC_EVENT_VARQUEDEPTH  0x0040
0134 
0135 /* special case scsi varqueuedepth event */
0136 struct lpfc_scsi_varqueuedepth_event {
0137     struct lpfc_scsi_event_header scsi_event;
0138     uint32_t oldval;
0139     uint32_t newval;
0140 };
0141 
0142 /* special case scsi check condition event */
0143 struct lpfc_scsi_check_condition_event {
0144     struct lpfc_scsi_event_header scsi_event;
0145     uint8_t opcode;
0146     uint8_t sense_key;
0147     uint8_t asc;
0148     uint8_t ascq;
0149 };
0150 
0151 /* event codes for FC_REG_BOARD_EVENT */
0152 #define LPFC_EVENT_PORTINTERR       0x01
0153 
0154 /* board event header */
0155 struct lpfc_board_event_header {
0156     uint32_t event_type;
0157     uint32_t subcategory;
0158 };
0159 
0160 
0161 /* event codes for FC_REG_ADAPTER_EVENT */
0162 #define LPFC_EVENT_ARRIVAL  0x01
0163 
0164 /* adapter event header */
0165 struct lpfc_adapter_event_header {
0166     uint32_t event_type;
0167     uint32_t subcategory;
0168 };
0169 
0170 
0171 /* event codes for temp_event */
0172 #define LPFC_CRIT_TEMP      0x1
0173 #define LPFC_THRESHOLD_TEMP 0x2
0174 #define LPFC_NORMAL_TEMP    0x3
0175 
0176 struct temp_event {
0177     uint32_t event_type;
0178     uint32_t event_code;
0179     uint32_t data;
0180 };
0181