aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa
diff options
context:
space:
mode:
authorJing Huang <huangj@brocade.com>2010-07-08 22:53:40 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-27 13:04:14 -0400
commit9aeb6802ddc06b66fc1a58a882fa54bba37040b3 (patch)
tree656e679428f8b82a1a570624932b5ad36904c30e /drivers/scsi/bfa
parent3e98cc013fc4902df5f9d9defe1856df0f0cb657 (diff)
[SCSI] bfa: update to support firmware configuation
Update related data structures to support firmeare configuration. Add AEN events related to firmware configuation. Signed-off-by: Jing Huang <huangj@brocade.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r--drivers/scsi/bfa/bfa_ioc.c6
-rw-r--r--drivers/scsi/bfa/bfa_ioc.h1
-rw-r--r--drivers/scsi/bfa/bfa_log_module.c86
-rw-r--r--drivers/scsi/bfa/include/aen/bfa_aen_ioc.h8
-rw-r--r--drivers/scsi/bfa/include/cs/bfa_debug.h3
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_ioc.h7
-rw-r--r--drivers/scsi/bfa/include/defs/bfa_defs_status.h3
-rw-r--r--drivers/scsi/bfa/include/log/bfa_log_linux.h6
8 files changed, 112 insertions, 8 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 1600f747eb6c..c4922fb995d5 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -71,8 +71,6 @@ bfa_boolean_t bfa_auto_recover = BFA_TRUE;
71/* 71/*
72 * forward declarations 72 * forward declarations
73 */ 73 */
74static void bfa_ioc_aen_post(struct bfa_ioc_s *bfa,
75 enum bfa_ioc_aen_event event);
76static void bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc); 74static void bfa_ioc_hw_sem_get(struct bfa_ioc_s *ioc);
77static void bfa_ioc_hw_sem_get_cancel(struct bfa_ioc_s *ioc); 75static void bfa_ioc_hw_sem_get_cancel(struct bfa_ioc_s *ioc);
78static void bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force); 76static void bfa_ioc_hwinit(struct bfa_ioc_s *ioc, bfa_boolean_t force);
@@ -1902,7 +1900,7 @@ bfa_ioc_get_fcmode(struct bfa_ioc_s *ioc)
1902/** 1900/**
1903 * Send AEN notification 1901 * Send AEN notification
1904 */ 1902 */
1905static void 1903void
1906bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) 1904bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event)
1907{ 1905{
1908 union bfa_aen_data_u aen_data; 1906 union bfa_aen_data_u aen_data;
@@ -2052,7 +2050,7 @@ bfa_ioc_recover(struct bfa_ioc_s *ioc)
2052 2050
2053#else 2051#else
2054 2052
2055static void 2053void
2056bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event) 2054bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event)
2057{ 2055{
2058} 2056}
diff --git a/drivers/scsi/bfa/bfa_ioc.h b/drivers/scsi/bfa/bfa_ioc.h
index 2425c00a72d3..cae05b251c99 100644
--- a/drivers/scsi/bfa/bfa_ioc.h
+++ b/drivers/scsi/bfa/bfa_ioc.h
@@ -297,6 +297,7 @@ void bfa_ioc_fwver_get(struct bfa_ioc_s *ioc,
297 struct bfi_ioc_image_hdr_s *fwhdr); 297 struct bfi_ioc_image_hdr_s *fwhdr);
298bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc, 298bfa_boolean_t bfa_ioc_fwver_cmp(struct bfa_ioc_s *ioc,
299 struct bfi_ioc_image_hdr_s *fwhdr); 299 struct bfi_ioc_image_hdr_s *fwhdr);
300void bfa_ioc_aen_post(struct bfa_ioc_s *ioc, enum bfa_ioc_aen_event event);
300 301
301/* 302/*
302 * bfa mfg wwn API functions 303 * bfa mfg wwn API functions
diff --git a/drivers/scsi/bfa/bfa_log_module.c b/drivers/scsi/bfa/bfa_log_module.c
index 5c154d341d69..cf577ef7cb97 100644
--- a/drivers/scsi/bfa/bfa_log_module.c
+++ b/drivers/scsi/bfa/bfa_log_module.c
@@ -110,6 +110,27 @@ struct bfa_log_msgdef_s bfa_log_msg_array[] = {
110 "Running firmware version is incompatible with the driver version.", 110 "Running firmware version is incompatible with the driver version.",
111 (0), 0}, 111 (0), 0},
112 112
113{BFA_AEN_IOC_FWCFG_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
114 BFA_LOG_CRITICAL, "BFA_AEN_IOC_FWCFG_ERROR",
115 "Link initialization failed due to firmware configuration read error:"
116 " WWN = %s.",
117 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
118
119{BFA_AEN_IOC_INVALID_VENDOR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
120 BFA_LOG_ERROR, "BFA_AEN_IOC_INVALID_VENDOR",
121 "Unsupported switch vendor. Link initialization failed: WWN = %s.",
122 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
123
124{BFA_AEN_IOC_INVALID_NWWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
125 BFA_LOG_ERROR, "BFA_AEN_IOC_INVALID_NWWN",
126 "Invalid NWWN. Link initialization failed: NWWN = 00:00:00:00:00:00:00:00.",
127 (0), 0},
128
129{BFA_AEN_IOC_INVALID_PWWN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
130 BFA_LOG_ERROR, "BFA_AEN_IOC_INVALID_PWWN",
131 "Invalid PWWN. Link initialization failed: PWWN = 00:00:00:00:00:00:00:00.",
132 (0), 0},
133
113 134
114 135
115 136
@@ -347,6 +368,22 @@ struct bfa_log_msgdef_s bfa_log_msg_array[] = {
347 ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) | 368 ((BFA_LOG_S << BFA_LOG_ARG0) | (BFA_LOG_D << BFA_LOG_ARG1) |
348 (BFA_LOG_D << BFA_LOG_ARG2) | 0), 3}, 369 (BFA_LOG_D << BFA_LOG_ARG2) | 0), 3},
349 370
371{BFA_LOG_HAL_DRIVER_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
372 BFA_LOG_INFO, "HAL_DRIVER_ERROR",
373 "%s",
374 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
375
376{BFA_LOG_HAL_DRIVER_CONFIG_ERROR,
377 BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO,
378 "HAL_DRIVER_CONFIG_ERROR",
379 "%s",
380 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
381
382{BFA_LOG_HAL_MBOX_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
383 BFA_LOG_INFO, "HAL_MBOX_ERROR",
384 "%s",
385 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
386
350 387
351 388
352 389
@@ -412,6 +449,55 @@ struct bfa_log_msgdef_s bfa_log_msg_array[] = {
412 ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_P << BFA_LOG_ARG1) | 449 ((BFA_LOG_D << BFA_LOG_ARG0) | (BFA_LOG_P << BFA_LOG_ARG1) |
413 (BFA_LOG_X << BFA_LOG_ARG2) | 0), 3}, 450 (BFA_LOG_X << BFA_LOG_ARG2) | 0), 3},
414 451
452{BFA_LOG_LINUX_DRIVER_CONFIG_ERROR,
453 BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO,
454 "LINUX_DRIVER_CONFIG_ERROR",
455 "%s",
456 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
457
458{BFA_LOG_LINUX_BNA_STATE_MACHINE,
459 BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO,
460 "LINUX_BNA_STATE_MACHINE",
461 "%s",
462 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
463
464{BFA_LOG_LINUX_IOC_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
465 BFA_LOG_INFO, "LINUX_IOC_ERROR",
466 "%s",
467 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
468
469{BFA_LOG_LINUX_RESOURCE_ALLOC_ERROR,
470 BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO,
471 "LINUX_RESOURCE_ALLOC_ERROR",
472 "%s",
473 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
474
475{BFA_LOG_LINUX_RING_BUFFER_ERROR,
476 BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG, BFA_LOG_INFO,
477 "LINUX_RING_BUFFER_ERROR",
478 "%s",
479 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
480
481{BFA_LOG_LINUX_DRIVER_ERROR, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
482 BFA_LOG_ERROR, "LINUX_DRIVER_ERROR",
483 "%s",
484 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
485
486{BFA_LOG_LINUX_DRIVER_INFO, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
487 BFA_LOG_INFO, "LINUX_DRIVER_INFO",
488 "%s",
489 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
490
491{BFA_LOG_LINUX_DRIVER_DIAG, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
492 BFA_LOG_INFO, "LINUX_DRIVER_DIAG",
493 "%s",
494 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
495
496{BFA_LOG_LINUX_DRIVER_AEN, BFA_LOG_ATTR_NONE | BFA_LOG_ATTR_LOG,
497 BFA_LOG_INFO, "LINUX_DRIVER_AEN",
498 "%s",
499 ((BFA_LOG_S << BFA_LOG_ARG0) | 0), 1},
500
415 501
416 502
417 503
diff --git a/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h b/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h
index 71378b446b69..4daf96faa266 100644
--- a/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h
+++ b/drivers/scsi/bfa/include/aen/bfa_aen_ioc.h
@@ -32,6 +32,14 @@
32 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_DISABLE) 32 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_DISABLE)
33#define BFA_AEN_IOC_FWMISMATCH \ 33#define BFA_AEN_IOC_FWMISMATCH \
34 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_FWMISMATCH) 34 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_FWMISMATCH)
35#define BFA_AEN_IOC_FWCFG_ERROR \
36 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_FWCFG_ERROR)
37#define BFA_AEN_IOC_INVALID_VENDOR \
38 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_INVALID_VENDOR)
39#define BFA_AEN_IOC_INVALID_NWWN \
40 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_INVALID_NWWN)
41#define BFA_AEN_IOC_INVALID_PWWN \
42 BFA_LOG_CREATE_ID(BFA_AEN_CAT_IOC, BFA_IOC_AEN_INVALID_PWWN)
35 43
36#endif 44#endif
37 45
diff --git a/drivers/scsi/bfa/include/cs/bfa_debug.h b/drivers/scsi/bfa/include/cs/bfa_debug.h
index 441be86b1b0f..75a911ea7936 100644
--- a/drivers/scsi/bfa/include/cs/bfa_debug.h
+++ b/drivers/scsi/bfa/include/cs/bfa_debug.h
@@ -28,7 +28,8 @@
28} while (0) 28} while (0)
29 29
30#define bfa_sm_fault(__mod, __event) do { \ 30#define bfa_sm_fault(__mod, __event) do { \
31 bfa_sm_panic((__mod)->logm, __LINE__, __FILE__, __event); \ 31 bfa_trc(__mod, (((uint32_t)0xDEAD << 16) | __event)); \
32 bfa_sm_panic((__mod)->logm, __LINE__, __FILE__, __event); \
32} while (0) 33} while (0)
33 34
34#ifndef BFA_PERF_BUILD 35#ifndef BFA_PERF_BUILD
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h b/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h
index 8d8e6a966537..add0a05d941d 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_ioc.h
@@ -126,7 +126,7 @@ struct bfa_ioc_attr_s {
126 struct bfa_ioc_driver_attr_s driver_attr; /* driver attr */ 126 struct bfa_ioc_driver_attr_s driver_attr; /* driver attr */
127 struct bfa_ioc_pci_attr_s pci_attr; 127 struct bfa_ioc_pci_attr_s pci_attr;
128 u8 port_id; /* port number */ 128 u8 port_id; /* port number */
129 u8 rsvd[7]; /*!< 64bit align */ 129 u8 rsvd[7]; /* 64bit align */
130}; 130};
131 131
132/** 132/**
@@ -138,6 +138,11 @@ enum bfa_ioc_aen_event {
138 BFA_IOC_AEN_ENABLE = 3, /* IOC enabled event */ 138 BFA_IOC_AEN_ENABLE = 3, /* IOC enabled event */
139 BFA_IOC_AEN_DISABLE = 4, /* IOC disabled event */ 139 BFA_IOC_AEN_DISABLE = 4, /* IOC disabled event */
140 BFA_IOC_AEN_FWMISMATCH = 5, /* IOC firmware mismatch */ 140 BFA_IOC_AEN_FWMISMATCH = 5, /* IOC firmware mismatch */
141 BFA_IOC_AEN_FWCFG_ERROR = 6, /* IOC firmware config error */
142 BFA_IOC_AEN_INVALID_VENDOR = 7,
143 BFA_IOC_AEN_INVALID_NWWN = 8, /* Zero NWWN */
144 BFA_IOC_AEN_INVALID_PWWN = 9 /* Zero PWWN */
145
141}; 146};
142 147
143/** 148/**
diff --git a/drivers/scsi/bfa/include/defs/bfa_defs_status.h b/drivers/scsi/bfa/include/defs/bfa_defs_status.h
index 7cef900707c5..c8bc60ad2df6 100644
--- a/drivers/scsi/bfa/include/defs/bfa_defs_status.h
+++ b/drivers/scsi/bfa/include/defs/bfa_defs_status.h
@@ -254,6 +254,9 @@ enum bfa_status {
254 * Teaming mode */ 254 * Teaming mode */
255 BFA_STATUS_PBC = 154, /* Operation not allowed for pre-boot 255 BFA_STATUS_PBC = 154, /* Operation not allowed for pre-boot
256 * configuration */ 256 * configuration */
257 BFA_STATUS_DEVID_MISSING = 155, /* Boot image is not for the adapter(s)
258 * installed */
259 BFA_STATUS_BAD_FWCFG = 156, /* Bad firmware configuration */
257 BFA_STATUS_MAX_VAL /* Unknown error code */ 260 BFA_STATUS_MAX_VAL /* Unknown error code */
258}; 261};
259#define bfa_status_t enum bfa_status 262#define bfa_status_t enum bfa_status
diff --git a/drivers/scsi/bfa/include/log/bfa_log_linux.h b/drivers/scsi/bfa/include/log/bfa_log_linux.h
index bd451db4c30a..44bc89768bda 100644
--- a/drivers/scsi/bfa/include/log/bfa_log_linux.h
+++ b/drivers/scsi/bfa/include/log/bfa_log_linux.h
@@ -53,8 +53,10 @@
53 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 16) 53 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 16)
54#define BFA_LOG_LINUX_DRIVER_ERROR \ 54#define BFA_LOG_LINUX_DRIVER_ERROR \
55 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 17) 55 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 17)
56#define BFA_LOG_LINUX_DRIVER_DIAG \ 56#define BFA_LOG_LINUX_DRIVER_INFO \
57 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 18) 57 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 18)
58#define BFA_LOG_LINUX_DRIVER_AEN \ 58#define BFA_LOG_LINUX_DRIVER_DIAG \
59 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 19) 59 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 19)
60#define BFA_LOG_LINUX_DRIVER_AEN \
61 (((u32) BFA_LOG_LINUX_ID << BFA_LOG_MODID_OFFSET) | 20)
60#endif 62#endif