xref: /openbmc/linux/drivers/scsi/lpfc/lpfc_bsg.h (revision 49198b371e2da20548d1408a7d3a8dea2f91263c)
1c79c1292SJames Smart /*******************************************************************
2c79c1292SJames Smart  * This file is part of the Emulex Linux Device Driver for         *
3c79c1292SJames Smart  * Fibre Channel Host Bus Adapters.                                *
4c79c1292SJames Smart  * Copyright (C) 2010 Emulex.  All rights reserved.                *
5c79c1292SJames Smart  * EMULEX and SLI are trademarks of Emulex.                        *
6c79c1292SJames Smart  * www.emulex.com                                                  *
7c79c1292SJames Smart  *                                                                 *
8c79c1292SJames Smart  * This program is free software; you can redistribute it and/or   *
9c79c1292SJames Smart  * modify it under the terms of version 2 of the GNU General       *
10c79c1292SJames Smart  * Public License as published by the Free Software Foundation.    *
11c79c1292SJames Smart  * This program is distributed in the hope that it will be useful. *
12c79c1292SJames Smart  * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND          *
13c79c1292SJames Smart  * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,  *
14c79c1292SJames Smart  * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE      *
15c79c1292SJames Smart  * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD *
16c79c1292SJames Smart  * TO BE LEGALLY INVALID.  See the GNU General Public License for  *
17c79c1292SJames Smart  * more details, a copy of which can be found in the file COPYING  *
18c79c1292SJames Smart  * included with this package.                                     *
19c79c1292SJames Smart  *******************************************************************/
20c79c1292SJames Smart /* bsg definitions
21c79c1292SJames Smart  * No pointers to user data are allowed, all application buffers and sizes will
22c79c1292SJames Smart  * derived through the bsg interface.
23c79c1292SJames Smart  *
24c79c1292SJames Smart  * These are the vendor unique structures passed in using the bsg
25c79c1292SJames Smart  * FC_BSG_HST_VENDOR message code type.
26c79c1292SJames Smart  */
27c79c1292SJames Smart #define LPFC_BSG_VENDOR_SET_CT_EVENT	1
28c79c1292SJames Smart #define LPFC_BSG_VENDOR_GET_CT_EVENT	2
29c79c1292SJames Smart #define LPFC_BSG_VENDOR_SEND_MGMT_RESP	3
30c79c1292SJames Smart #define LPFC_BSG_VENDOR_DIAG_MODE	4
31c79c1292SJames Smart #define LPFC_BSG_VENDOR_DIAG_TEST	5
32c79c1292SJames Smart #define LPFC_BSG_VENDOR_GET_MGMT_REV	6
33c79c1292SJames Smart #define LPFC_BSG_VENDOR_MBOX		7
34e2aed29fSJames Smart #define LPFC_BSG_VENDOR_MENLO_CMD	8
35e2aed29fSJames Smart #define LPFC_BSG_VENDOR_MENLO_DATA	9
36c79c1292SJames Smart 
37c79c1292SJames Smart struct set_ct_event {
38c79c1292SJames Smart 	uint32_t command;
39c79c1292SJames Smart 	uint32_t type_mask;
40c79c1292SJames Smart 	uint32_t ev_req_id;
41c79c1292SJames Smart 	uint32_t ev_reg_id;
42c79c1292SJames Smart };
43c79c1292SJames Smart 
44c79c1292SJames Smart struct get_ct_event {
45c79c1292SJames Smart 	uint32_t command;
46c79c1292SJames Smart 	uint32_t ev_reg_id;
47c79c1292SJames Smart 	uint32_t ev_req_id;
48c79c1292SJames Smart };
49c79c1292SJames Smart 
50c79c1292SJames Smart struct get_ct_event_reply {
51c79c1292SJames Smart 	uint32_t immed_data;
52c79c1292SJames Smart 	uint32_t type;
53c79c1292SJames Smart };
54c79c1292SJames Smart 
55c79c1292SJames Smart struct send_mgmt_resp {
56c79c1292SJames Smart 	uint32_t command;
57c79c1292SJames Smart 	uint32_t tag;
58c79c1292SJames Smart };
59c79c1292SJames Smart 
60c79c1292SJames Smart 
61c79c1292SJames Smart #define INTERNAL_LOOP_BACK 0x1 /* adapter short cuts the loop internally */
62c79c1292SJames Smart #define EXTERNAL_LOOP_BACK 0x2 /* requires an external loopback plug */
63c79c1292SJames Smart 
64c79c1292SJames Smart struct diag_mode_set {
65c79c1292SJames Smart 	uint32_t command;
66c79c1292SJames Smart 	uint32_t type;
67c79c1292SJames Smart 	uint32_t timeout;
68c79c1292SJames Smart };
69c79c1292SJames Smart 
70c79c1292SJames Smart struct diag_mode_test {
71c79c1292SJames Smart 	uint32_t command;
72c79c1292SJames Smart };
73c79c1292SJames Smart 
74c79c1292SJames Smart #define LPFC_WWNN_TYPE		0
75c79c1292SJames Smart #define LPFC_WWPN_TYPE		1
76c79c1292SJames Smart 
77c79c1292SJames Smart struct get_mgmt_rev {
78c79c1292SJames Smart 	uint32_t command;
79c79c1292SJames Smart };
80c79c1292SJames Smart 
81c79c1292SJames Smart #define MANAGEMENT_MAJOR_REV   1
82c79c1292SJames Smart #define MANAGEMENT_MINOR_REV   0
83c79c1292SJames Smart 
84c79c1292SJames Smart /* the MgmtRevInfo structure */
85c79c1292SJames Smart struct MgmtRevInfo {
86c79c1292SJames Smart 	uint32_t a_Major;
87c79c1292SJames Smart 	uint32_t a_Minor;
88c79c1292SJames Smart };
89c79c1292SJames Smart 
90c79c1292SJames Smart struct get_mgmt_rev_reply {
91c79c1292SJames Smart 	struct MgmtRevInfo info;
92c79c1292SJames Smart };
93c79c1292SJames Smart 
94*49198b37SJames Smart #define BSG_MBOX_SIZE 4096 /* mailbox command plus extended data */
95c79c1292SJames Smart struct dfc_mbox_req {
96c79c1292SJames Smart 	uint32_t command;
977a470277SJames Smart 	uint32_t mbOffset;
98c79c1292SJames Smart 	uint32_t inExtWLen;
997a470277SJames Smart 	uint32_t outWxtWLen;
100c79c1292SJames Smart };
101c79c1292SJames Smart 
102e2aed29fSJames Smart /* Used for menlo command or menlo data. The xri is only used for menlo data */
103e2aed29fSJames Smart struct menlo_command {
104e2aed29fSJames Smart 	uint32_t cmd;
105e2aed29fSJames Smart 	uint32_t xri;
106e2aed29fSJames Smart };
107e2aed29fSJames Smart 
108e2aed29fSJames Smart struct menlo_response {
109e2aed29fSJames Smart 	uint32_t xri; /* return the xri of the iocb exchange */
110e2aed29fSJames Smart };
111e2aed29fSJames Smart 
112