aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/bfa/bfa_core.c14
-rw-r--r--drivers/scsi/bfa/bfa_defs_svc.h73
-rw-r--r--drivers/scsi/bfa/bfa_modules.h1
-rw-r--r--drivers/scsi/bfa/bfa_port.c365
-rw-r--r--drivers/scsi/bfa/bfa_port.h54
-rw-r--r--drivers/scsi/bfa/bfad_bsg.c96
-rw-r--r--drivers/scsi/bfa/bfad_bsg.h21
-rw-r--r--drivers/scsi/bfa/bfi.h59
8 files changed, 683 insertions, 0 deletions
diff --git a/drivers/scsi/bfa/bfa_core.c b/drivers/scsi/bfa/bfa_core.c
index 21343c26721d..ec9872484711 100644
--- a/drivers/scsi/bfa/bfa_core.c
+++ b/drivers/scsi/bfa/bfa_core.c
@@ -111,6 +111,17 @@ bfa_com_ablk_attach(struct bfa_s *bfa)
111 bfa_ablk_memclaim(ablk, ablk_dma->kva_curp, ablk_dma->dma_curp); 111 bfa_ablk_memclaim(ablk, ablk_dma->kva_curp, ablk_dma->dma_curp);
112} 112}
113 113
114static void
115bfa_com_cee_attach(struct bfa_s *bfa)
116{
117 struct bfa_cee_s *cee = &bfa->modules.cee;
118 struct bfa_mem_dma_s *cee_dma = BFA_MEM_CEE_DMA(bfa);
119
120 cee->trcmod = bfa->trcmod;
121 bfa_cee_attach(cee, &bfa->ioc, bfa);
122 bfa_cee_mem_claim(cee, cee_dma->kva_curp, cee_dma->dma_curp);
123}
124
114/* 125/*
115 * BFA IOC FC related definitions 126 * BFA IOC FC related definitions
116 */ 127 */
@@ -1348,6 +1359,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
1348 int i; 1359 int i;
1349 struct bfa_mem_dma_s *port_dma = BFA_MEM_PORT_DMA(bfa); 1360 struct bfa_mem_dma_s *port_dma = BFA_MEM_PORT_DMA(bfa);
1350 struct bfa_mem_dma_s *ablk_dma = BFA_MEM_ABLK_DMA(bfa); 1361 struct bfa_mem_dma_s *ablk_dma = BFA_MEM_ABLK_DMA(bfa);
1362 struct bfa_mem_dma_s *cee_dma = BFA_MEM_CEE_DMA(bfa);
1351 1363
1352 WARN_ON((cfg == NULL) || (meminfo == NULL)); 1364 WARN_ON((cfg == NULL) || (meminfo == NULL));
1353 1365
@@ -1365,6 +1377,7 @@ bfa_cfg_get_meminfo(struct bfa_iocfc_cfg_s *cfg, struct bfa_meminfo_s *meminfo,
1365 /* dma info setup */ 1377 /* dma info setup */
1366 bfa_mem_dma_setup(meminfo, port_dma, bfa_port_meminfo()); 1378 bfa_mem_dma_setup(meminfo, port_dma, bfa_port_meminfo());
1367 bfa_mem_dma_setup(meminfo, ablk_dma, bfa_ablk_meminfo()); 1379 bfa_mem_dma_setup(meminfo, ablk_dma, bfa_ablk_meminfo());
1380 bfa_mem_dma_setup(meminfo, cee_dma, bfa_cee_meminfo());
1368} 1381}
1369 1382
1370/* 1383/*
@@ -1432,6 +1445,7 @@ bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
1432 1445
1433 bfa_com_port_attach(bfa); 1446 bfa_com_port_attach(bfa);
1434 bfa_com_ablk_attach(bfa); 1447 bfa_com_ablk_attach(bfa);
1448 bfa_com_cee_attach(bfa);
1435} 1449}
1436 1450
1437/* 1451/*
diff --git a/drivers/scsi/bfa/bfa_defs_svc.h b/drivers/scsi/bfa/bfa_defs_svc.h
index 95a17ef631f0..4b6529c7a531 100644
--- a/drivers/scsi/bfa/bfa_defs_svc.h
+++ b/drivers/scsi/bfa/bfa_defs_svc.h
@@ -1142,4 +1142,77 @@ struct bfa_port_cfg_mode_s {
1142 enum bfa_mode_s mode; 1142 enum bfa_mode_s mode;
1143}; 1143};
1144 1144
1145#pragma pack(1)
1146
1147#define BFA_CEE_LLDP_MAX_STRING_LEN (128)
1148#define BFA_CEE_DCBX_MAX_PRIORITY (8)
1149#define BFA_CEE_DCBX_MAX_PGID (8)
1150
1151struct bfa_cee_lldp_str_s {
1152 u8 sub_type;
1153 u8 len;
1154 u8 rsvd[2];
1155 u8 value[BFA_CEE_LLDP_MAX_STRING_LEN];
1156};
1157
1158struct bfa_cee_lldp_cfg_s {
1159 struct bfa_cee_lldp_str_s chassis_id;
1160 struct bfa_cee_lldp_str_s port_id;
1161 struct bfa_cee_lldp_str_s port_desc;
1162 struct bfa_cee_lldp_str_s sys_name;
1163 struct bfa_cee_lldp_str_s sys_desc;
1164 struct bfa_cee_lldp_str_s mgmt_addr;
1165 u16 time_to_live;
1166 u16 enabled_system_cap;
1167};
1168
1169/* CEE/DCBX parameters */
1170struct bfa_cee_dcbx_cfg_s {
1171 u8 pgid[BFA_CEE_DCBX_MAX_PRIORITY];
1172 u8 pg_percentage[BFA_CEE_DCBX_MAX_PGID];
1173 u8 pfc_primap; /* bitmap of priorties with PFC enabled */
1174 u8 fcoe_primap; /* bitmap of priorities used for FcoE traffic */
1175 u8 iscsi_primap; /* bitmap of priorities used for iSCSI traffic */
1176 u8 dcbx_version; /* operating version:CEE or preCEE */
1177 u8 lls_fcoe; /* FCoE Logical Link Status */
1178 u8 lls_lan; /* LAN Logical Link Status */
1179 u8 rsvd[2];
1180};
1181
1182/* CEE Query */
1183struct bfa_cee_attr_s {
1184 u8 cee_status;
1185 u8 error_reason;
1186 struct bfa_cee_lldp_cfg_s lldp_remote;
1187 struct bfa_cee_dcbx_cfg_s dcbx_remote;
1188 mac_t src_mac;
1189 u8 link_speed;
1190 u8 nw_priority;
1191 u8 filler[2];
1192};
1193
1194/* LLDP/DCBX/CEE Statistics */
1195struct bfa_cee_stats_s {
1196 u32 lldp_tx_frames; /* LLDP Tx Frames */
1197 u32 lldp_rx_frames; /* LLDP Rx Frames */
1198 u32 lldp_rx_frames_invalid; /* LLDP Rx Frames invalid */
1199 u32 lldp_rx_frames_new; /* LLDP Rx Frames new */
1200 u32 lldp_tlvs_unrecognized; /* LLDP Rx unrecog. TLVs */
1201 u32 lldp_rx_shutdown_tlvs; /* LLDP Rx shutdown TLVs */
1202 u32 lldp_info_aged_out; /* LLDP remote info aged */
1203 u32 dcbx_phylink_ups; /* DCBX phy link ups */
1204 u32 dcbx_phylink_downs; /* DCBX phy link downs */
1205 u32 dcbx_rx_tlvs; /* DCBX Rx TLVs */
1206 u32 dcbx_rx_tlvs_invalid; /* DCBX Rx TLVs invalid */
1207 u32 dcbx_control_tlv_error; /* DCBX control TLV errors */
1208 u32 dcbx_feature_tlv_error; /* DCBX feature TLV errors */
1209 u32 dcbx_cee_cfg_new; /* DCBX new CEE cfg rcvd */
1210 u32 cee_status_down; /* DCB status down */
1211 u32 cee_status_up; /* DCB status up */
1212 u32 cee_hw_cfg_changed; /* DCB hw cfg changed */
1213 u32 cee_rx_invalid_cfg; /* DCB invalid cfg */
1214};
1215
1216#pragma pack()
1217
1145#endif /* __BFA_DEFS_SVC_H__ */ 1218#endif /* __BFA_DEFS_SVC_H__ */
diff --git a/drivers/scsi/bfa/bfa_modules.h b/drivers/scsi/bfa/bfa_modules.h
index e27fde8c6f2f..239aba711226 100644
--- a/drivers/scsi/bfa/bfa_modules.h
+++ b/drivers/scsi/bfa/bfa_modules.h
@@ -38,6 +38,7 @@ struct bfa_modules_s {
38 struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */ 38 struct bfa_sgpg_mod_s sgpg_mod; /* SG page module */
39 struct bfa_port_s port; /* Physical port module */ 39 struct bfa_port_s port; /* Physical port module */
40 struct bfa_ablk_s ablk; /* ASIC block config module */ 40 struct bfa_ablk_s ablk; /* ASIC block config module */
41 struct bfa_cee_s cee; /* CEE Module */
41}; 42};
42 43
43/* 44/*
diff --git a/drivers/scsi/bfa/bfa_port.c b/drivers/scsi/bfa/bfa_port.c
index 8bb6d75f9160..f382a475a09d 100644
--- a/drivers/scsi/bfa/bfa_port.c
+++ b/drivers/scsi/bfa/bfa_port.c
@@ -480,3 +480,368 @@ bfa_port_attach(struct bfa_port_s *port, struct bfa_ioc_s *ioc,
480 480
481 bfa_trc(port, 0); 481 bfa_trc(port, 0);
482} 482}
483
484/*
485 * CEE module specific definitions
486 */
487
488/*
489 * bfa_cee_get_attr_isr()
490 *
491 * @brief CEE ISR for get-attributes responses from f/w
492 *
493 * @param[in] cee - Pointer to the CEE module
494 * status - Return status from the f/w
495 *
496 * @return void
497 */
498static void
499bfa_cee_get_attr_isr(struct bfa_cee_s *cee, bfa_status_t status)
500{
501 struct bfa_cee_lldp_cfg_s *lldp_cfg = &cee->attr->lldp_remote;
502
503 cee->get_attr_status = status;
504 bfa_trc(cee, 0);
505 if (status == BFA_STATUS_OK) {
506 bfa_trc(cee, 0);
507 memcpy(cee->attr, cee->attr_dma.kva,
508 sizeof(struct bfa_cee_attr_s));
509 lldp_cfg->time_to_live = be16_to_cpu(lldp_cfg->time_to_live);
510 lldp_cfg->enabled_system_cap =
511 be16_to_cpu(lldp_cfg->enabled_system_cap);
512 }
513 cee->get_attr_pending = BFA_FALSE;
514 if (cee->cbfn.get_attr_cbfn) {
515 bfa_trc(cee, 0);
516 cee->cbfn.get_attr_cbfn(cee->cbfn.get_attr_cbarg, status);
517 }
518}
519
520/*
521 * bfa_cee_get_stats_isr()
522 *
523 * @brief CEE ISR for get-stats responses from f/w
524 *
525 * @param[in] cee - Pointer to the CEE module
526 * status - Return status from the f/w
527 *
528 * @return void
529 */
530static void
531bfa_cee_get_stats_isr(struct bfa_cee_s *cee, bfa_status_t status)