James Smart | ea2151b | 2008-09-07 11:52:10 -0400 | [diff] [blame] | 1 | /******************************************************************* |
| 2 | * This file is part of the Emulex Linux Device Driver for * |
| 3 | * Fibre Channel Host Bus Adapters. * |
| 4 | * Copyright (C) 2008 Emulex. All rights reserved. * |
| 5 | * EMULEX and SLI are trademarks of Emulex. * |
| 6 | * www.emulex.com * |
| 7 | * * |
| 8 | * This program is free software; you can redistribute it and/or * |
| 9 | * modify it under the terms of version 2 of the GNU General * |
| 10 | * Public License as published by the Free Software Foundation. * |
| 11 | * This program is distributed in the hope that it will be useful. * |
| 12 | * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * |
| 13 | * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * |
| 14 | * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * |
| 15 | * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * |
| 16 | * TO BE LEGALLY INVALID. See the GNU General Public License for * |
| 17 | * more details, a copy of which can be found in the file COPYING * |
| 18 | * included with this package. * |
| 19 | *******************************************************************/ |
| 20 | |
| 21 | /* Event definitions for RegisterForEvent */ |
| 22 | #define FC_REG_LINK_EVENT 0x0001 /* link up / down events */ |
| 23 | #define FC_REG_RSCN_EVENT 0x0002 /* RSCN events */ |
| 24 | #define FC_REG_CT_EVENT 0x0004 /* CT request events */ |
| 25 | #define FC_REG_DUMP_EVENT 0x0008 /* Dump events */ |
| 26 | #define FC_REG_TEMPERATURE_EVENT 0x0010 /* temperature events */ |
| 27 | #define FC_REG_ELS_EVENT 0x0020 /* lpfc els events */ |
| 28 | #define FC_REG_FABRIC_EVENT 0x0040 /* lpfc fabric events */ |
| 29 | #define FC_REG_SCSI_EVENT 0x0080 /* lpfc scsi events */ |
| 30 | #define FC_REG_BOARD_EVENT 0x0100 /* lpfc board events */ |
| 31 | #define FC_REG_ADAPTER_EVENT 0x0200 /* lpfc adapter events */ |
| 32 | #define FC_REG_EVENT_MASK (FC_REG_LINK_EVENT | \ |
| 33 | FC_REG_RSCN_EVENT | \ |
| 34 | FC_REG_CT_EVENT | \ |
| 35 | FC_REG_DUMP_EVENT | \ |
| 36 | FC_REG_TEMPERATURE_EVENT | \ |
| 37 | FC_REG_ELS_EVENT | \ |
| 38 | FC_REG_FABRIC_EVENT | \ |
| 39 | FC_REG_SCSI_EVENT | \ |
| 40 | FC_REG_BOARD_EVENT | \ |
| 41 | FC_REG_ADAPTER_EVENT) |
| 42 | /* Temperature events */ |
| 43 | #define LPFC_CRIT_TEMP 0x1 |
| 44 | #define LPFC_THRESHOLD_TEMP 0x2 |
| 45 | #define LPFC_NORMAL_TEMP 0x3 |
| 46 | /* |
| 47 | * All net link event payloads will begin with and event type |
| 48 | * and subcategory. The event type must come first. |
| 49 | * The subcategory further defines the data that follows in the rest |
| 50 | * of the payload. Each category will have its own unique header plus |
| 51 | * any addtional data unique to the subcategory. |
| 52 | * The payload sent via the fc transport is one-way driver->application. |
| 53 | */ |
| 54 | |
James Smart | ddcc50f | 2008-12-04 22:38:46 -0500 | [diff] [blame^] | 55 | /* RSCN event header */ |
| 56 | struct lpfc_rscn_event_header { |
| 57 | uint32_t event_type; |
| 58 | uint32_t payload_length; /* RSCN data length in bytes */ |
| 59 | uint32_t rscn_payload[]; |
| 60 | }; |
| 61 | |
James Smart | ea2151b | 2008-09-07 11:52:10 -0400 | [diff] [blame] | 62 | /* els event header */ |
| 63 | struct lpfc_els_event_header { |
| 64 | uint32_t event_type; |
| 65 | uint32_t subcategory; |
| 66 | uint8_t wwpn[8]; |
| 67 | uint8_t wwnn[8]; |
| 68 | }; |
| 69 | |
| 70 | /* subcategory codes for FC_REG_ELS_EVENT */ |
| 71 | #define LPFC_EVENT_PLOGI_RCV 0x01 |
| 72 | #define LPFC_EVENT_PRLO_RCV 0x02 |
| 73 | #define LPFC_EVENT_ADISC_RCV 0x04 |
| 74 | #define LPFC_EVENT_LSRJT_RCV 0x08 |
James Smart | ddcc50f | 2008-12-04 22:38:46 -0500 | [diff] [blame^] | 75 | #define LPFC_EVENT_LOGO_RCV 0x10 |
James Smart | ea2151b | 2008-09-07 11:52:10 -0400 | [diff] [blame] | 76 | |
| 77 | /* special els lsrjt event */ |
| 78 | struct lpfc_lsrjt_event { |
| 79 | struct lpfc_els_event_header header; |
| 80 | uint32_t command; |
| 81 | uint32_t reason_code; |
| 82 | uint32_t explanation; |
| 83 | }; |
| 84 | |
James Smart | ddcc50f | 2008-12-04 22:38:46 -0500 | [diff] [blame^] | 85 | /* special els logo event */ |
| 86 | struct lpfc_logo_event { |
| 87 | struct lpfc_els_event_header header; |
| 88 | uint8_t logo_wwpn[8]; |
| 89 | }; |
James Smart | ea2151b | 2008-09-07 11:52:10 -0400 | [diff] [blame] | 90 | |
| 91 | /* fabric event header */ |
| 92 | struct lpfc_fabric_event_header { |
| 93 | uint32_t event_type; |
| 94 | uint32_t subcategory; |
| 95 | uint8_t wwpn[8]; |
| 96 | uint8_t wwnn[8]; |
| 97 | }; |
| 98 | |
| 99 | /* subcategory codes for FC_REG_FABRIC_EVENT */ |
| 100 | #define LPFC_EVENT_FABRIC_BUSY 0x01 |
| 101 | #define LPFC_EVENT_PORT_BUSY 0x02 |
| 102 | #define LPFC_EVENT_FCPRDCHKERR 0x04 |
| 103 | |
| 104 | /* special case fabric fcprdchkerr event */ |
| 105 | struct lpfc_fcprdchkerr_event { |
| 106 | struct lpfc_fabric_event_header header; |
| 107 | uint32_t lun; |
| 108 | uint32_t opcode; |
| 109 | uint32_t fcpiparam; |
| 110 | }; |
| 111 | |
| 112 | |
| 113 | /* scsi event header */ |
| 114 | struct lpfc_scsi_event_header { |
| 115 | uint32_t event_type; |
| 116 | uint32_t subcategory; |
| 117 | uint32_t lun; |
| 118 | uint8_t wwpn[8]; |
| 119 | uint8_t wwnn[8]; |
| 120 | }; |
| 121 | |
| 122 | /* subcategory codes for FC_REG_SCSI_EVENT */ |
| 123 | #define LPFC_EVENT_QFULL 0x0001 |
| 124 | #define LPFC_EVENT_DEVBSY 0x0002 |
| 125 | #define LPFC_EVENT_CHECK_COND 0x0004 |
| 126 | #define LPFC_EVENT_LUNRESET 0x0008 |
| 127 | #define LPFC_EVENT_TGTRESET 0x0010 |
| 128 | #define LPFC_EVENT_BUSRESET 0x0020 |
| 129 | #define LPFC_EVENT_VARQUEDEPTH 0x0040 |
| 130 | |
| 131 | /* special case scsi varqueuedepth event */ |
| 132 | struct lpfc_scsi_varqueuedepth_event { |
| 133 | struct lpfc_scsi_event_header scsi_event; |
| 134 | uint32_t oldval; |
| 135 | uint32_t newval; |
| 136 | }; |
| 137 | |
| 138 | /* special case scsi check condition event */ |
| 139 | struct lpfc_scsi_check_condition_event { |
| 140 | struct lpfc_scsi_event_header scsi_event; |
James Smart | ddcc50f | 2008-12-04 22:38:46 -0500 | [diff] [blame^] | 141 | uint8_t opcode; |
James Smart | ea2151b | 2008-09-07 11:52:10 -0400 | [diff] [blame] | 142 | uint8_t sense_key; |
| 143 | uint8_t asc; |
| 144 | uint8_t ascq; |
| 145 | }; |
| 146 | |
| 147 | /* event codes for FC_REG_BOARD_EVENT */ |
| 148 | #define LPFC_EVENT_PORTINTERR 0x01 |
| 149 | |
| 150 | /* board event header */ |
| 151 | struct lpfc_board_event_header { |
| 152 | uint32_t event_type; |
| 153 | uint32_t subcategory; |
| 154 | }; |
| 155 | |
| 156 | |
| 157 | /* event codes for FC_REG_ADAPTER_EVENT */ |
| 158 | #define LPFC_EVENT_ARRIVAL 0x01 |
| 159 | |
| 160 | /* adapter event header */ |
| 161 | struct lpfc_adapter_event_header { |
| 162 | uint32_t event_type; |
| 163 | uint32_t subcategory; |
| 164 | }; |
| 165 | |
| 166 | |
| 167 | /* event codes for temp_event */ |
| 168 | #define LPFC_CRIT_TEMP 0x1 |
| 169 | #define LPFC_THRESHOLD_TEMP 0x2 |
| 170 | #define LPFC_NORMAL_TEMP 0x3 |
| 171 | |
| 172 | struct temp_event { |
| 173 | uint32_t event_type; |
| 174 | uint32_t event_code; |
| 175 | uint32_t data; |
| 176 | }; |
| 177 | |