~ubuntu-branches/ubuntu/quantal/linux-linaro-mx51/quantal

« back to all changes in this revision

Viewing changes to drivers/scsi/lpfc/lpfc_bsg.h

  • Committer: Package Import Robot
  • Author(s): John Rigby, John Rigby
  • Date: 2011-09-26 10:44:23 UTC
  • Revision ID: package-import@ubuntu.com-20110926104423-3o58a3c1bj7x00rs
Tags: 3.0.0-1007.9
[ John Rigby ]

Enable crypto modules and remove crypto-modules from
exclude-module files
LP: #826021

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * These are the vendor unique structures passed in using the bsg
25
25
 * FC_BSG_HST_VENDOR message code type.
26
26
 */
27
 
#define LPFC_BSG_VENDOR_SET_CT_EVENT    1
28
 
#define LPFC_BSG_VENDOR_GET_CT_EVENT    2
29
 
#define LPFC_BSG_VENDOR_SEND_MGMT_RESP  3
30
 
#define LPFC_BSG_VENDOR_DIAG_MODE       4
31
 
#define LPFC_BSG_VENDOR_DIAG_TEST       5
32
 
#define LPFC_BSG_VENDOR_GET_MGMT_REV    6
33
 
#define LPFC_BSG_VENDOR_MBOX            7
34
 
#define LPFC_BSG_VENDOR_MENLO_CMD       8
35
 
#define LPFC_BSG_VENDOR_MENLO_DATA      9
 
27
#define LPFC_BSG_VENDOR_SET_CT_EVENT            1
 
28
#define LPFC_BSG_VENDOR_GET_CT_EVENT            2
 
29
#define LPFC_BSG_VENDOR_SEND_MGMT_RESP          3
 
30
#define LPFC_BSG_VENDOR_DIAG_MODE               4
 
31
#define LPFC_BSG_VENDOR_DIAG_RUN_LOOPBACK       5
 
32
#define LPFC_BSG_VENDOR_GET_MGMT_REV            6
 
33
#define LPFC_BSG_VENDOR_MBOX                    7
 
34
#define LPFC_BSG_VENDOR_MENLO_CMD               8
 
35
#define LPFC_BSG_VENDOR_MENLO_DATA              9
 
36
#define LPFC_BSG_VENDOR_DIAG_MODE_END           10
 
37
#define LPFC_BSG_VENDOR_LINK_DIAG_TEST          11
36
38
 
37
39
struct set_ct_event {
38
40
        uint32_t command;
67
69
        uint32_t timeout;
68
70
};
69
71
 
 
72
struct sli4_link_diag {
 
73
        uint32_t command;
 
74
        uint32_t timeout;
 
75
        uint32_t test_id;
 
76
        uint32_t loops;
 
77
        uint32_t test_version;
 
78
        uint32_t error_action;
 
79
};
 
80
 
70
81
struct diag_mode_test {
71
82
        uint32_t command;
72
83
};
73
84
 
 
85
struct diag_status {
 
86
        uint32_t mbox_status;
 
87
        uint32_t shdr_status;
 
88
        uint32_t shdr_add_status;
 
89
};
 
90
 
74
91
#define LPFC_WWNN_TYPE          0
75
92
#define LPFC_WWPN_TYPE          1
76
93
 
92
109
};
93
110
 
94
111
#define BSG_MBOX_SIZE 4096 /* mailbox command plus extended data */
 
112
 
 
113
/* BSG mailbox request header */
95
114
struct dfc_mbox_req {
96
115
        uint32_t command;
97
116
        uint32_t mbOffset;
98
117
        uint32_t inExtWLen;
99
118
        uint32_t outExtWLen;
 
119
        uint32_t extMboxTag;
 
120
        uint32_t extSeqNum;
100
121
};
101
122
 
102
123
/* Used for menlo command or menlo data. The xri is only used for menlo data */
109
130
        uint32_t xri; /* return the xri of the iocb exchange */
110
131
};
111
132
 
 
133
/*
 
134
 * macros and data structures for handling sli-config mailbox command
 
135
 * pass-through support, this header file is shared between user and
 
136
 * kernel spaces, note the set of macros are duplicates from lpfc_hw4.h,
 
137
 * with macro names prefixed with bsg_, as the macros defined in
 
138
 * lpfc_hw4.h are not accessible from user space.
 
139
 */
 
140
 
 
141
/* Macros to deal with bit fields. Each bit field must have 3 #defines
 
142
 * associated with it (_SHIFT, _MASK, and _WORD).
 
143
 * EG. For a bit field that is in the 7th bit of the "field4" field of a
 
144
 * structure and is 2 bits in size the following #defines must exist:
 
145
 *      struct temp {
 
146
 *              uint32_t        field1;
 
147
 *              uint32_t        field2;
 
148
 *              uint32_t        field3;
 
149
 *              uint32_t        field4;
 
150
 *      #define example_bit_field_SHIFT         7
 
151
 *      #define example_bit_field_MASK          0x03
 
152
 *      #define example_bit_field_WORD          field4
 
153
 *              uint32_t        field5;
 
154
 *      };
 
155
 * Then the macros below may be used to get or set the value of that field.
 
156
 * EG. To get the value of the bit field from the above example:
 
157
 *      struct temp t1;
 
158
 *      value = bsg_bf_get(example_bit_field, &t1);
 
159
 * And then to set that bit field:
 
160
 *      bsg_bf_set(example_bit_field, &t1, 2);
 
161
 * Or clear that bit field:
 
162
 *      bsg_bf_set(example_bit_field, &t1, 0);
 
163
 */
 
164
#define bsg_bf_get_le32(name, ptr) \
 
165
        ((le32_to_cpu((ptr)->name##_WORD) >> name##_SHIFT) & name##_MASK)
 
166
#define bsg_bf_get(name, ptr) \
 
167
        (((ptr)->name##_WORD >> name##_SHIFT) & name##_MASK)
 
168
#define bsg_bf_set_le32(name, ptr, value) \
 
169
        ((ptr)->name##_WORD = cpu_to_le32(((((value) & \
 
170
        name##_MASK) << name##_SHIFT) | (le32_to_cpu((ptr)->name##_WORD) & \
 
171
        ~(name##_MASK << name##_SHIFT)))))
 
172
#define bsg_bf_set(name, ptr, value) \
 
173
        ((ptr)->name##_WORD = ((((value) & name##_MASK) << name##_SHIFT) | \
 
174
        ((ptr)->name##_WORD & ~(name##_MASK << name##_SHIFT))))
 
175
 
 
176
/*
 
177
 * The sli_config structure specified here is based on the following
 
178
 * restriction:
 
179
 *
 
180
 * -- SLI_CONFIG EMB=0, carrying MSEs, will carry subcommands without
 
181
 *    carrying HBD.
 
182
 * -- SLI_CONFIG EMB=1, not carrying MSE, will carry subcommands with or
 
183
 *    without carrying HBDs.
 
184
 */
 
185
 
 
186
struct lpfc_sli_config_mse {
 
187
        uint32_t pa_lo;
 
188
        uint32_t pa_hi;
 
189
        uint32_t buf_len;
 
190
#define lpfc_mbox_sli_config_mse_len_SHIFT      0
 
191
#define lpfc_mbox_sli_config_mse_len_MASK       0xffffff
 
192
#define lpfc_mbox_sli_config_mse_len_WORD       buf_len
 
193
};
 
194
 
 
195
struct lpfc_sli_config_hbd {
 
196
        uint32_t buf_len;
 
197
#define lpfc_mbox_sli_config_ecmn_hbd_len_SHIFT 0
 
198
#define lpfc_mbox_sli_config_ecmn_hbd_len_MASK  0xffffff
 
199
#define lpfc_mbox_sli_config_ecmn_hbd_len_WORD  buf_len
 
200
        uint32_t pa_lo;
 
201
        uint32_t pa_hi;
 
202
};
 
203
 
 
204
struct lpfc_sli_config_hdr {
 
205
        uint32_t word1;
 
206
#define lpfc_mbox_hdr_emb_SHIFT         0
 
207
#define lpfc_mbox_hdr_emb_MASK          0x00000001
 
208
#define lpfc_mbox_hdr_emb_WORD          word1
 
209
#define lpfc_mbox_hdr_mse_cnt_SHIFT     3
 
210
#define lpfc_mbox_hdr_mse_cnt_MASK      0x0000001f
 
211
#define lpfc_mbox_hdr_mse_cnt_WORD      word1
 
212
        uint32_t payload_length;
 
213
        uint32_t tag_lo;
 
214
        uint32_t tag_hi;
 
215
        uint32_t reserved5;
 
216
};
 
217
 
 
218
struct lpfc_sli_config_emb0_subsys {
 
219
        struct lpfc_sli_config_hdr      sli_config_hdr;
 
220
#define LPFC_MBX_SLI_CONFIG_MAX_MSE     19
 
221
        struct lpfc_sli_config_mse      mse[LPFC_MBX_SLI_CONFIG_MAX_MSE];
 
222
        uint32_t padding;
 
223
        uint32_t word64;
 
224
#define lpfc_emb0_subcmnd_opcode_SHIFT  0
 
225
#define lpfc_emb0_subcmnd_opcode_MASK   0xff
 
226
#define lpfc_emb0_subcmnd_opcode_WORD   word64
 
227
#define lpfc_emb0_subcmnd_subsys_SHIFT  8
 
228
#define lpfc_emb0_subcmnd_subsys_MASK   0xff
 
229
#define lpfc_emb0_subcmnd_subsys_WORD   word64
 
230
/* Subsystem FCOE (0x0C) OpCodes */
 
231
#define SLI_CONFIG_SUBSYS_FCOE          0x0C
 
232
#define FCOE_OPCODE_READ_FCF            0x08
 
233
#define FCOE_OPCODE_ADD_FCF             0x09
 
234
};
 
235
 
 
236
struct lpfc_sli_config_emb1_subsys {
 
237
        struct lpfc_sli_config_hdr      sli_config_hdr;
 
238
        uint32_t word6;
 
239
#define lpfc_emb1_subcmnd_opcode_SHIFT  0
 
240
#define lpfc_emb1_subcmnd_opcode_MASK   0xff
 
241
#define lpfc_emb1_subcmnd_opcode_WORD   word6
 
242
#define lpfc_emb1_subcmnd_subsys_SHIFT  8
 
243
#define lpfc_emb1_subcmnd_subsys_MASK   0xff
 
244
#define lpfc_emb1_subcmnd_subsys_WORD   word6
 
245
/* Subsystem COMN (0x01) OpCodes */
 
246
#define SLI_CONFIG_SUBSYS_COMN          0x01
 
247
#define COMN_OPCODE_READ_OBJECT         0xAB
 
248
#define COMN_OPCODE_WRITE_OBJECT        0xAC
 
249
#define COMN_OPCODE_READ_OBJECT_LIST    0xAD
 
250
#define COMN_OPCODE_DELETE_OBJECT       0xAE
 
251
        uint32_t timeout;
 
252
        uint32_t request_length;
 
253
        uint32_t word9;
 
254
#define lpfc_subcmnd_version_SHIFT      0
 
255
#define lpfc_subcmnd_version_MASK       0xff
 
256
#define lpfc_subcmnd_version_WORD       word9
 
257
        uint32_t word10;
 
258
#define lpfc_subcmnd_ask_rd_len_SHIFT   0
 
259
#define lpfc_subcmnd_ask_rd_len_MASK    0xffffff
 
260
#define lpfc_subcmnd_ask_rd_len_WORD    word10
 
261
        uint32_t rd_offset;
 
262
        uint32_t obj_name[26];
 
263
        uint32_t hbd_count;
 
264
#define LPFC_MBX_SLI_CONFIG_MAX_HBD     8
 
265
        struct lpfc_sli_config_hbd      hbd[LPFC_MBX_SLI_CONFIG_MAX_HBD];
 
266
};
 
267
 
 
268
struct lpfc_sli_config_mbox {
 
269
        uint32_t word0;
 
270
#define lpfc_mqe_status_SHIFT           16
 
271
#define lpfc_mqe_status_MASK            0x0000FFFF
 
272
#define lpfc_mqe_status_WORD            word0
 
273
#define lpfc_mqe_command_SHIFT          8
 
274
#define lpfc_mqe_command_MASK           0x000000FF
 
275
#define lpfc_mqe_command_WORD           word0
 
276
        union {
 
277
                struct lpfc_sli_config_emb0_subsys sli_config_emb0_subsys;
 
278
                struct lpfc_sli_config_emb1_subsys sli_config_emb1_subsys;
 
279
        } un;
 
280
};
 
281
 
 
282
/* driver only */
 
283
#define SLI_CONFIG_NOT_HANDLED          0
 
284
#define SLI_CONFIG_HANDLED              1