summaryrefslogtreecommitdiff
path: root/drivers/scsi/bfa/bfad_bsg.h
blob: 22680452ee1ba13bc7ede528aeeeda1131068869 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
/*
 * Copyright (c) 2005-2010 Brocade Communications Systems, Inc.
 * All rights reserved
 * www.brocade.com
 *
 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License (GPL) Version 2 as
 * published by the Free Software Foundation
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 */
#ifndef BFAD_BSG_H
#define BFAD_BSG_H

#include "bfa_defs.h"
#include "bfa_defs_fcs.h"

/* Definitions of vendor unique structures and command codes passed in
 * using FC_BSG_HST_VENDOR message code.
 */
enum {
	IOCMD_IOC_ENABLE = 0x1,
	IOCMD_IOC_DISABLE,
	IOCMD_IOC_GET_ATTR,
	IOCMD_IOC_GET_INFO,
	IOCMD_IOC_GET_STATS,
	IOCMD_IOC_GET_FWSTATS,
	IOCMD_IOC_RESET_STATS,
	IOCMD_IOC_RESET_FWSTATS,
	IOCMD_IOC_SET_ADAPTER_NAME,
	IOCMD_IOC_SET_PORT_NAME,
	IOCMD_IOCFC_GET_ATTR,
	IOCMD_IOCFC_SET_INTR,
	IOCMD_PORT_ENABLE,
	IOCMD_PORT_DISABLE,
	IOCMD_PORT_GET_ATTR,
	IOCMD_PORT_GET_STATS,
	IOCMD_PORT_RESET_STATS,
	IOCMD_PORT_CFG_TOPO,
	IOCMD_PORT_CFG_SPEED,
	IOCMD_PORT_CFG_ALPA,
	IOCMD_PORT_CFG_MAXFRSZ,
	IOCMD_PORT_CLR_ALPA,
	IOCMD_PORT_BBSC_ENABLE,
	IOCMD_PORT_BBSC_DISABLE,
	IOCMD_LPORT_GET_ATTR,
	IOCMD_LPORT_GET_RPORTS,
	IOCMD_LPORT_GET_STATS,
	IOCMD_LPORT_RESET_STATS,
	IOCMD_LPORT_GET_IOSTATS,
	IOCMD_RPORT_GET_ATTR,
	IOCMD_RPORT_GET_ADDR,
	IOCMD_RPORT_GET_STATS,
	IOCMD_RPORT_RESET_STATS,
	IOCMD_RPORT_SET_SPEED,
	IOCMD_VPORT_GET_ATTR,
	IOCMD_VPORT_GET_STATS,
	IOCMD_VPORT_RESET_STATS,
	IOCMD_FABRIC_GET_LPORTS,
	IOCMD_RATELIM_ENABLE,
	IOCMD_RATELIM_DISABLE,
	IOCMD_RATELIM_DEF_SPEED,
	IOCMD_FCPIM_FAILOVER,
	IOCMD_FCPIM_MODSTATS,
	IOCMD_FCPIM_MODSTATSCLR,
	IOCMD_FCPIM_DEL_ITN_STATS,
	IOCMD_ITNIM_GET_ATTR,
	IOCMD_ITNIM_GET_IOSTATS,
	IOCMD_ITNIM_RESET_STATS,
	IOCMD_ITNIM_GET_ITNSTATS,
	IOCMD_IOC_PCIFN_CFG,
	IOCMD_FCPORT_ENABLE,
	IOCMD_FCPORT_DISABLE,
	IOCMD_PCIFN_CREATE,
	IOCMD_PCIFN_DELETE,
	IOCMD_PCIFN_BW,
	IOCMD_ADAPTER_CFG_MODE,
	IOCMD_PORT_CFG_MODE,
	IOCMD_FLASH_ENABLE_OPTROM,
	IOCMD_FLASH_DISABLE_OPTROM,
	IOCMD_FAA_ENABLE,
	IOCMD_FAA_DISABLE,
	IOCMD_FAA_QUERY,
	IOCMD_CEE_GET_ATTR,
	IOCMD_CEE_GET_STATS,
	IOCMD_CEE_RESET_STATS,
	IOCMD_SFP_MEDIA,
	IOCMD_SFP_SPEED,
	IOCMD_FLASH_GET_ATTR,
	IOCMD_FLASH_ERASE_PART,
	IOCMD_FLASH_UPDATE_PART,
	IOCMD_FLASH_READ_PART,
	IOCMD_DIAG_TEMP,
	IOCMD_DIAG_MEMTEST,
	IOCMD_DIAG_LOOPBACK,
	IOCMD_DIAG_FWPING,
	IOCMD_DIAG_QUEUETEST,
	IOCMD_DIAG_SFP,
	IOCMD_DIAG_LED,
	IOCMD_DIAG_BEACON_LPORT,
	IOCMD_DIAG_LB_STAT,
	IOCMD_PHY_GET_ATTR,
	IOCMD_PHY_GET_STATS,
	IOCMD_PHY_UPDATE_FW,
	IOCMD_PHY_READ_FW,
	IOCMD_VHBA_QUERY,
	IOCMD_DEBUG_PORTLOG,
	IOCMD_DEBUG_FW_CORE,
	IOCMD_DEBUG_FW_STATE_CLR,
	IOCMD_DEBUG_PORTLOG_CLR,
	IOCMD_DEBUG_START_DTRC,
	IOCMD_DEBUG_STOP_DTRC,
	IOCMD_DEBUG_PORTLOG_CTL,
	IOCMD_FCPIM_PROFILE_ON,
	IOCMD_FCPIM_PROFILE_OFF,
	IOCMD_ITNIM_GET_IOPROFILE,
	IOCMD_FCPORT_GET_STATS,
	IOCMD_FCPORT_RESET_STATS,
	IOCMD_BOOT_CFG,
	IOCMD_BOOT_QUERY,
	IOCMD_PREBOOT_QUERY,
	IOCMD_ETHBOOT_CFG,
	IOCMD_ETHBOOT_QUERY,
	IOCMD_TRUNK_ENABLE,
	IOCMD_TRUNK_DISABLE,
	IOCMD_TRUNK_GET_ATTR,
};

struct bfa_bsg_gen_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
};

struct bfa_bsg_portlogctl_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	bfa_boolean_t	ctl;
	int		inst_no;
};

struct bfa_bsg_fcpim_profile_s {
	bfa_status_t    status;
	u16		bfad_num;
	u16		rsvd;
};

struct bfa_bsg_itnim_ioprofile_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		lpwwn;
	wwn_t		rpwwn;
	struct bfa_itnim_ioprofile_s ioprofile;
};

struct bfa_bsg_fcport_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	union bfa_fcport_stats_u stats;
};

struct bfa_bsg_ioc_name_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	char		name[BFA_ADAPTER_SYM_NAME_LEN];
};

struct bfa_bsg_ioc_info_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	char		serialnum[64];
	char		hwpath[BFA_STRING_32];
	char		adapter_hwpath[BFA_STRING_32];
	char		guid[BFA_ADAPTER_SYM_NAME_LEN*2];
	char		name[BFA_ADAPTER_SYM_NAME_LEN];
	char		port_name[BFA_ADAPTER_SYM_NAME_LEN];
	char		eth_name[BFA_ADAPTER_SYM_NAME_LEN];
	wwn_t		pwwn;
	wwn_t		nwwn;
	wwn_t		factorypwwn;
	wwn_t		factorynwwn;
	mac_t		mac;
	mac_t		factory_mac; /* Factory mac address */
	mac_t		current_mac; /* Currently assigned mac address */
	enum bfa_ioc_type_e	ioc_type;
	u16		pvid; /* Port vlan id */
	u16		rsvd1;
	u32		host;
	u32		bandwidth; /* For PF support */
	u32		rsvd2;
};

struct bfa_bsg_ioc_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_ioc_attr_s  ioc_attr;
};

struct bfa_bsg_ioc_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_ioc_stats_s ioc_stats;
};

struct bfa_bsg_ioc_fwstats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		buf_size;
	u32		rsvd1;
	u64		buf_ptr;
};

struct bfa_bsg_iocfc_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_iocfc_attr_s	iocfc_attr;
};

struct bfa_bsg_iocfc_intr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_iocfc_intr_attr_s attr;
};

struct bfa_bsg_port_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_port_attr_s	attr;
};

struct bfa_bsg_port_cfg_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		param;
	u32		rsvd1;
};

struct bfa_bsg_port_cfg_maxfrsize_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		maxfrsize;
};

struct bfa_bsg_port_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		buf_size;
	u32		rsvd1;
	u64		buf_ptr;
};

struct bfa_bsg_lport_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	struct bfa_lport_attr_s port_attr;
};

struct bfa_bsg_lport_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	struct bfa_lport_stats_s port_stats;
};

struct bfa_bsg_lport_iostats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	struct bfa_itnim_iostats_s iostats;
};

struct bfa_bsg_lport_get_rports_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	u64		rbuf_ptr;
	u32		nrports;
	u32		rsvd;
};

struct bfa_bsg_rport_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	wwn_t		rpwwn;
	struct bfa_rport_attr_s attr;
};

struct bfa_bsg_rport_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	wwn_t		rpwwn;
	struct bfa_rport_stats_s stats;
};

struct bfa_bsg_rport_scsi_addr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	wwn_t		rpwwn;
	u32		host;
	u32		bus;
	u32		target;
	u32		lun;
};

struct bfa_bsg_rport_reset_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		pwwn;
	wwn_t		rpwwn;
};

struct bfa_bsg_rport_set_speed_s {
	bfa_status_t		status;
	u16			bfad_num;
	u16			vf_id;
	enum bfa_port_speed	speed;
	u32			rsvd;
	wwn_t			pwwn;
	wwn_t			rpwwn;
};

struct bfa_bsg_vport_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		vpwwn;
	struct bfa_vport_attr_s vport_attr;
};

struct bfa_bsg_vport_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		vpwwn;
	struct bfa_vport_stats_s vport_stats;
};

struct bfa_bsg_reset_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		vpwwn;
};

struct bfa_bsg_fabric_get_lports_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	u64		buf_ptr;
	u32		nports;
	u32		rsvd;
};

struct bfa_bsg_trl_speed_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	enum bfa_port_speed speed;
};

struct bfa_bsg_fcpim_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		param;
};

struct bfa_bsg_fcpim_modstats_s {
	bfa_status_t	status;
	u16		bfad_num;
	struct bfa_itnim_iostats_s modstats;
};

struct bfa_bsg_fcpim_del_itn_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	struct bfa_fcpim_del_itn_stats_s modstats;
};

struct bfa_bsg_fcpim_modstatsclr_s {
	bfa_status_t	status;
	u16		bfad_num;
};

struct bfa_bsg_itnim_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		lpwwn;
	wwn_t		rpwwn;
	struct bfa_itnim_attr_s	attr;
};

struct bfa_bsg_itnim_iostats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		lpwwn;
	wwn_t		rpwwn;
	struct bfa_itnim_iostats_s iostats;
};

struct bfa_bsg_itnim_itnstats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		vf_id;
	wwn_t		lpwwn;
	wwn_t		rpwwn;
	struct bfa_itnim_stats_s itnstats;
};

struct bfa_bsg_pcifn_cfg_s {
	bfa_status_t		status;
	u16			bfad_num;
	u16			rsvd;
	struct bfa_ablk_cfg_s	pcifn_cfg;
};

struct bfa_bsg_pcifn_s {
	bfa_status_t		status;
	u16			bfad_num;
	u16			pcifn_id;
	u32			bandwidth;
	u8			port;
	enum bfi_pcifn_class	pcifn_class;
	u8			rsvd[1];
};

struct bfa_bsg_adapter_cfg_mode_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_adapter_cfg_mode_s	cfg;
};

struct bfa_bsg_port_cfg_mode_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		instance;
	struct bfa_port_cfg_mode_s cfg;
};

struct bfa_bsg_faa_attr_s {
	bfa_status_t		status;
	u16			bfad_num;
	u16			rsvd;
	struct bfa_faa_attr_s	faa_attr;
};

struct bfa_bsg_cee_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		buf_size;
	u32		rsvd1;
	u64		buf_ptr;
};

struct bfa_bsg_cee_stats_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		buf_size;
	u32		rsvd1;
	u64		buf_ptr;
};

struct bfa_bsg_sfp_media_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	enum bfa_defs_sfp_media_e media;
};

struct bfa_bsg_sfp_speed_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	enum bfa_port_speed speed;
};

struct bfa_bsg_flash_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_flash_attr_s attr;
};

struct bfa_bsg_flash_s {
	bfa_status_t	status;
	u16		bfad_num;
	u8		instance;
	u8		rsvd;
	enum  bfa_flash_part_type type;
	int		bufsz;
	u64		buf_ptr;
};

struct bfa_bsg_diag_get_temp_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_diag_results_tempsensor_s result;
};

struct bfa_bsg_diag_memtest_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd[3];
	u32		pat;
	struct bfa_diag_memtest_result result;
	struct bfa_diag_memtest_s memtest;
};

struct bfa_bsg_diag_loopback_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	enum bfa_port_opmode opmode;
	enum bfa_port_speed speed;
	u32		lpcnt;
	u32		pat;
	struct bfa_diag_loopback_result_s result;
};

struct bfa_bsg_diag_fwping_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		cnt;
	u32		pattern;
	struct bfa_diag_results_fwping result;
};

struct bfa_bsg_diag_qtest_s {
	bfa_status_t	status;
	u16	bfad_num;
	u16	rsvd;
	u32	force;
	u32	queue;
	struct bfa_diag_qtest_result_s result;
};

struct bfa_bsg_sfp_show_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct sfp_mem_s sfp;
};

struct bfa_bsg_diag_led_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_diag_ledtest_s ledtest;
};

struct bfa_bsg_diag_beacon_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	bfa_boolean_t   beacon;
	bfa_boolean_t   link_e2e_beacon;
	u32		second;
};

struct bfa_bsg_diag_lb_stat_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
};

struct bfa_bsg_phy_attr_s {
	bfa_status_t	status;
	u16	bfad_num;
	u16	instance;
	struct bfa_phy_attr_s	attr;
};

struct bfa_bsg_phy_s {
	bfa_status_t	status;
	u16	bfad_num;
	u16	instance;
	u64	bufsz;
	u64	buf_ptr;
};

struct bfa_bsg_debug_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	u32		bufsz;
	int		inst_no;
	u64		buf_ptr;
	u64		offset;
};

struct bfa_bsg_phy_stats_s {
	bfa_status_t	status;
	u16	bfad_num;
	u16	instance;
	struct bfa_phy_stats_s	stats;
};

struct bfa_bsg_vhba_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		pcifn_id;
	struct bfa_vhba_attr_s	attr;
};

struct bfa_bsg_boot_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_boot_cfg_s	cfg;
};

struct bfa_bsg_preboot_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_boot_pbc_s	cfg;
};

struct bfa_bsg_ethboot_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct  bfa_ethboot_cfg_s  cfg;
};

struct bfa_bsg_trunk_attr_s {
	bfa_status_t	status;
	u16		bfad_num;
	u16		rsvd;
	struct bfa_trunk_attr_s attr;
};

struct bfa_bsg_fcpt_s {
	bfa_status_t    status;
	u16		vf_id;
	wwn_t		lpwwn;
	wwn_t		dpwwn;
	u32		tsecs;
	int		cts;
	enum fc_cos	cos;
	struct fchs_s	fchs;
};
#define bfa_bsg_fcpt_t struct bfa_bsg_fcpt_s

struct bfa_bsg_data {
	int payload_len;
	void *payload;
};

#define bfad_chk_iocmd_sz(__payload_len, __hdrsz, __bufsz)	\
	(((__payload_len) != ((__hdrsz) + (__bufsz))) ?		\
	 BFA_STATUS_FAILED : BFA_STATUS_OK)

#endif /* BFAD_BSG_H */