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. *
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 *******************************************************************/
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 0x0010 /* Dump events */
26 #define FC_REG_TEMPERATURE_EVENT 0x0020 /* temperature events */
27 #define FC_REG_VPORTRSCN_EVENT 0x0040 /* Vport RSCN events */
28 #define FC_REG_ELS_EVENT 0x0080 /* lpfc els events */
29 #define FC_REG_FABRIC_EVENT 0x0100 /* lpfc fabric events */
30 #define FC_REG_SCSI_EVENT 0x0200 /* lpfc scsi events */
31 #define FC_REG_BOARD_EVENT 0x0400 /* lpfc board events */
32 #define FC_REG_ADAPTER_EVENT 0x0800 /* lpfc adapter events */
33 #define FC_REG_EVENT_MASK (FC_REG_LINK_EVENT | \
37 FC_REG_TEMPERATURE_EVENT | \
38 FC_REG_VPORTRSCN_EVENT | \
40 FC_REG_FABRIC_EVENT | \
42 FC_REG_BOARD_EVENT | \
44 /* Temperature events */
45 #define LPFC_CRIT_TEMP 0x1
46 #define LPFC_THRESHOLD_TEMP 0x2
47 #define LPFC_NORMAL_TEMP 0x3
49 * All net link event payloads will begin with and event type
50 * and subcategory. The event type must come first.
51 * The subcategory further defines the data that follows in the rest
52 * of the payload. Each category will have its own unique header plus
53 * any addtional data unique to the subcategory.
54 * The payload sent via the fc transport is one-way driver->application.
57 /* RSCN event header */
58 struct lpfc_rscn_event_header
{
60 uint32_t payload_length
; /* RSCN data length in bytes */
61 uint32_t rscn_payload
[];
64 /* els event header */
65 struct lpfc_els_event_header
{
72 /* subcategory codes for FC_REG_ELS_EVENT */
73 #define LPFC_EVENT_PLOGI_RCV 0x01
74 #define LPFC_EVENT_PRLO_RCV 0x02
75 #define LPFC_EVENT_ADISC_RCV 0x04
76 #define LPFC_EVENT_LSRJT_RCV 0x08
77 #define LPFC_EVENT_LOGO_RCV 0x10
79 /* special els lsrjt event */
80 struct lpfc_lsrjt_event
{
81 struct lpfc_els_event_header header
;
87 /* special els logo event */
88 struct lpfc_logo_event
{
89 struct lpfc_els_event_header header
;
93 /* fabric event header */
94 struct lpfc_fabric_event_header
{
101 /* subcategory codes for FC_REG_FABRIC_EVENT */
102 #define LPFC_EVENT_FABRIC_BUSY 0x01
103 #define LPFC_EVENT_PORT_BUSY 0x02
104 #define LPFC_EVENT_FCPRDCHKERR 0x04
106 /* special case fabric fcprdchkerr event */
107 struct lpfc_fcprdchkerr_event
{
108 struct lpfc_fabric_event_header header
;
115 /* scsi event header */
116 struct lpfc_scsi_event_header
{
118 uint32_t subcategory
;
124 /* subcategory codes for FC_REG_SCSI_EVENT */
125 #define LPFC_EVENT_QFULL 0x0001
126 #define LPFC_EVENT_DEVBSY 0x0002
127 #define LPFC_EVENT_CHECK_COND 0x0004
128 #define LPFC_EVENT_LUNRESET 0x0008
129 #define LPFC_EVENT_TGTRESET 0x0010
130 #define LPFC_EVENT_BUSRESET 0x0020
131 #define LPFC_EVENT_VARQUEDEPTH 0x0040
133 /* special case scsi varqueuedepth event */
134 struct lpfc_scsi_varqueuedepth_event
{
135 struct lpfc_scsi_event_header scsi_event
;
140 /* special case scsi check condition event */
141 struct lpfc_scsi_check_condition_event
{
142 struct lpfc_scsi_event_header scsi_event
;
149 /* event codes for FC_REG_BOARD_EVENT */
150 #define LPFC_EVENT_PORTINTERR 0x01
152 /* board event header */
153 struct lpfc_board_event_header
{
155 uint32_t subcategory
;
159 /* event codes for FC_REG_ADAPTER_EVENT */
160 #define LPFC_EVENT_ARRIVAL 0x01
162 /* adapter event header */
163 struct lpfc_adapter_event_header
{
165 uint32_t subcategory
;
169 /* event codes for temp_event */
170 #define LPFC_CRIT_TEMP 0x1
171 #define LPFC_THRESHOLD_TEMP 0x2
172 #define LPFC_NORMAL_TEMP 0x3
180 /* bsg definitions */
181 #define LPFC_BSG_VENDOR_SET_CT_EVENT 1
182 #define LPFC_BSG_VENDOR_GET_CT_EVENT 2
184 struct set_ct_event
{
190 struct get_ct_event
{
196 struct get_ct_event_reply
{