diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2011-06-13 18:55:11 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 16:59:53 -0400 |
commit | b85daafe46eeb0a9ad32c4b2c3a4e09ffcae9599 (patch) | |
tree | 8b54ba0700e1cea95f5c8a47e2e04c3c9d295727 /drivers/scsi/bfa/bfad_bsg.h | |
parent | 75332a70a84908810ab5f525b03f230be9e31753 (diff) |
[SCSI] bfa: Add BSG interface to support ELS, CT and vendor commands.
- Added BSG interface support to BFA driver
- Adds support to send ELS/CT FC passthru commands and
few vendor specific BSG requests.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfad_bsg.h')
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.h | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfad_bsg.h b/drivers/scsi/bfa/bfad_bsg.h new file mode 100644 index 000000000000..e0e90f031ff7 --- /dev/null +++ b/drivers/scsi/bfa/bfad_bsg.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2005-2010 Brocade Communications Systems, Inc. | ||
3 | * All rights reserved | ||
4 | * www.brocade.com | ||
5 | * | ||
6 | * Linux driver for Brocade Fibre Channel Host Bus Adapter. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License (GPL) Version 2 as | ||
10 | * published by the Free Software Foundation | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | */ | ||
17 | #ifndef BFAD_BSG_H | ||
18 | #define BFAD_BSG_H | ||
19 | |||
20 | #include "bfa_defs.h" | ||
21 | #include "bfa_defs_fcs.h" | ||
22 | |||
23 | /* Definitions of vendor unique structures and command codes passed in | ||
24 | * using FC_BSG_HST_VENDOR message code. | ||
25 | */ | ||
26 | enum { | ||
27 | IOCMD_IOC_GET_ATTR = 0x1, | ||
28 | IOCMD_IOC_GET_INFO, | ||
29 | IOCMD_PORT_GET_ATTR, | ||
30 | IOCMD_LPORT_GET_ATTR, | ||
31 | IOCMD_RPORT_GET_ADDR, | ||
32 | IOCMD_FABRIC_GET_LPORTS, | ||
33 | IOCMD_ITNIM_GET_ATTR, | ||
34 | }; | ||
35 | |||
36 | struct bfa_bsg_ioc_info_s { | ||
37 | bfa_status_t status; | ||
38 | u16 bfad_num; | ||
39 | u16 rsvd; | ||
40 | char serialnum[64]; | ||
41 | char hwpath[BFA_STRING_32]; | ||
42 | char adapter_hwpath[BFA_STRING_32]; | ||
43 | char guid[BFA_ADAPTER_SYM_NAME_LEN*2]; | ||
44 | char name[BFA_ADAPTER_SYM_NAME_LEN]; | ||
45 | char port_name[BFA_ADAPTER_SYM_NAME_LEN]; | ||
46 | char eth_name[BFA_ADAPTER_SYM_NAME_LEN]; | ||
47 | wwn_t pwwn; | ||
48 | wwn_t nwwn; | ||
49 | wwn_t factorypwwn; | ||
50 | wwn_t factorynwwn; | ||
51 | mac_t mac; | ||
52 | mac_t factory_mac; /* Factory mac address */ | ||
53 | mac_t current_mac; /* Currently assigned mac address */ | ||
54 | enum bfa_ioc_type_e ioc_type; | ||
55 | u16 pvid; /* Port vlan id */ | ||
56 | u16 rsvd1; | ||
57 | u32 host; | ||
58 | u32 bandwidth; /* For PF support */ | ||
59 | u32 rsvd2; | ||
60 | }; | ||
61 | |||
62 | struct bfa_bsg_ioc_attr_s { | ||
63 | bfa_status_t status; | ||
64 | u16 bfad_num; | ||
65 | u16 rsvd; | ||
66 | struct bfa_ioc_attr_s ioc_attr; | ||
67 | }; | ||
68 | |||
69 | struct bfa_bsg_port_attr_s { | ||
70 | bfa_status_t status; | ||
71 | u16 bfad_num; | ||
72 | u16 rsvd; | ||
73 | struct bfa_port_attr_s attr; | ||
74 | }; | ||
75 | |||
76 | struct bfa_bsg_lport_attr_s { | ||
77 | bfa_status_t status; | ||
78 | u16 bfad_num; | ||
79 | u16 vf_id; | ||
80 | wwn_t pwwn; | ||
81 | struct bfa_lport_attr_s port_attr; | ||
82 | }; | ||
83 | |||
84 | struct bfa_bsg_rport_scsi_addr_s { | ||
85 | bfa_status_t status; | ||
86 | u16 bfad_num; | ||
87 | u16 vf_id; | ||
88 | wwn_t pwwn; | ||
89 | wwn_t rpwwn; | ||
90 | u32 host; | ||
91 | u32 bus; | ||
92 | u32 target; | ||
93 | u32 lun; | ||
94 | }; | ||
95 | |||
96 | struct bfa_bsg_fabric_get_lports_s { | ||
97 | bfa_status_t status; | ||
98 | u16 bfad_num; | ||
99 | u16 vf_id; | ||
100 | u64 buf_ptr; | ||
101 | u32 nports; | ||
102 | u32 rsvd; | ||
103 | }; | ||
104 | |||
105 | struct bfa_bsg_itnim_attr_s { | ||
106 | bfa_status_t status; | ||
107 | u16 bfad_num; | ||
108 | u16 vf_id; | ||
109 | wwn_t lpwwn; | ||
110 | wwn_t rpwwn; | ||
111 | struct bfa_itnim_attr_s attr; | ||
112 | }; | ||
113 | |||
114 | struct bfa_bsg_fcpt_s { | ||
115 | bfa_status_t status; | ||
116 | u16 vf_id; | ||
117 | wwn_t lpwwn; | ||
118 | wwn_t dpwwn; | ||
119 | u32 tsecs; | ||
120 | int cts; | ||
121 | enum fc_cos cos; | ||
122 | struct fchs_s fchs; | ||
123 | }; | ||
124 | #define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s | ||
125 | |||
126 | struct bfa_bsg_data { | ||
127 | int payload_len; | ||
128 | void *payload; | ||
129 | }; | ||
130 | |||
131 | #define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz) \ | ||
132 | (((__payload_len) != ((__hdrsz) + (__bufsz))) ? \ | ||
133 | BFA_STATUS_FAILED : BFA_STATUS_OK) | ||
134 | |||
135 | #endif /* BFAD_BSG_H */ | ||