48 #if defined(OCS_INCLUDE_DEBUG)
52 #define SLI4_BMBX_DELAY_US 1000
53 #define SLI4_INIT_PORT_DELAY_US 10000
64 0xff, 0x12, 0x34, 0xff,
65 0xff, 0x56, 0x78, 0xff,
69 0xff, 0xaa, 0xbb, 0xff,
70 0xff, 0xcc, 0xdd, 0xff,
130 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX } , { 0,
SLI4_BMBX_REG },
136 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
143 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
150 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
157 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
164 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
174 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0,
SLI4_SLIPORT_CONTROL_REG }, { UINT32_MAX, UINT32_MAX },
179 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0,
SLI4_SLIPORT_ERROR1 }, { UINT32_MAX, UINT32_MAX },
184 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { 0,
SLI4_SLIPORT_ERROR2 }, { UINT32_MAX, UINT32_MAX },
191 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
201 { 0,
SLI4_UERR_MASK_HIGH_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
202 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }
206 { 0,
SLI4_UERR_MASK_LOW_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
207 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }
212 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }
216 { 0,
SLI4_UERR_STATUS_LOW_REG }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
217 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }
221 { 1,
SLI4_SW_UE_CSR1}, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
222 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }
226 { 1,
SLI4_SW_UE_CSR2}, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX },
227 { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }, { UINT32_MAX, UINT32_MAX }
245 if ((UINT32_MAX == r->
rset) || (UINT32_MAX == r->
off)) {
246 ocs_log_err(sli->
os,
"regname %d not defined for if_type %d\n", reg, sli->
if_type);
250 return ocs_reg_read32(sli->
os, r->
rset, r->
off);
268 if ((UINT32_MAX == r->
rset) || (UINT32_MAX == r->
off)) {
269 ocs_log_err(sli->
os,
"regname %d not defined for if_type %d\n", reg, sli->
if_type);
273 ocs_reg_write32(sli->
os, r->
rset, r->
off, val);
366 return(!(val & SLI4_BMBX_RDY));
382 ocs_dma_sync(&sli4->
bmbx, OCS_DMASYNC_PREWRITE);
387 ocs_log_crit(sli4->
os,
"BMBX WRITE_HI failed\n");
397 #if defined(OCS_INCLUDE_DEBUG)
420 sli_dump_bmbx_command(
sli4_t *sli4,
void *mbx,
const char *prefix)
435 if (sli_config->
emb) {
436 ocs_snprintf(label,
sizeof(label),
"%s (emb)", prefix);
440 size =
sizeof(*sli_config) -
sizeof(sli_config->
payload) +
443 (uint8_t *)sli4->
bmbx.virt, size);
446 ocs_snprintf(label,
sizeof(label),
"%s (non-emb hdr)", prefix);
450 size =
sizeof(*sli_config) -
sizeof(sli_config->
payload) + (12 * sli_config->
pmd_count);
452 (uint8_t *)sli4->
bmbx.virt, size);
456 if ((pmd->
address_high == ocs_addr32_hi(sli4->bmbx_non_emb_pmd->phys)) &&
457 (pmd->
address_low == ocs_addr32_lo(sli4->bmbx_non_emb_pmd->phys))) {
458 for (i = 0; i < sli_config->
pmd_count; i++, pmd++) {
459 sli_config_hdr = sli4->bmbx_non_emb_pmd->virt;
460 ocs_snprintf(label,
sizeof(label),
"%s (non-emb pay[%d])",
463 (uint8_t *)sli4->bmbx_non_emb_pmd->virt,
467 ocs_log_debug(sli4->
os,
"pmd addr does not match pmd:%x %x (%x %x)\n",
469 ocs_addr32_hi(sli4->bmbx_non_emb_pmd->phys),
470 ocs_addr32_lo(sli4->bmbx_non_emb_pmd->phys));
479 (uint8_t *)mbx, size);
497 #
if defined(OCS_INCLUDE_DEBUG)
498 sli_dump_bmbx_command(sli4, sli4->
bmbx.virt,
"bmbx cmd");
502 ocs_log_crit(sli4->
os,
"Chip is in an error state - Mailbox "
503 "command rejected status=%#x error1=%#x error2=%#x\n",
511 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail phys=%p reg=%#x\n",
512 (
void*)sli4->
bmbx.phys,
518 ocs_dma_sync(&sli4->
bmbx, OCS_DMASYNC_POSTREAD);
520 #if defined(OCS_INCLUDE_DEBUG)
521 sli_dump_bmbx_command(sli4, sli4->
bmbx.virt,
"bmbx cmpl");
526 ocs_log_err(sli4->
os,
"invalid or wrong type\n");
550 ocs_memset(buf, 0, size);
555 config_link->
cscn = 1;
559 ocs_log_debug(sli4->
os,
"config_link->bbscn: %d\n", config_link->
bbscn);
581 ocs_memset(buf, 0, size);
606 ocs_memset(buf, 0, size);
633 uint32_t sli_config_off = 0;
634 uint32_t payload_size;
641 payload_size = dma->size;
652 ocs_memset(req, 0, dma->size);
680 uint8_t req_ext_counters,
681 uint8_t clear_overflow_flags,
682 uint8_t clear_all_counters)
686 ocs_memset(buf, 0, size);
689 cmd->
rec = req_ext_counters;
690 cmd->
clrc = clear_all_counters;
691 cmd->
clof = clear_overflow_flags;
708 uint8_t clear_counters)
712 ocs_memset(buf, 0, size);
715 cmd->
cc = clear_counters;
733 ocs_memset(buf, 0, size);
753 ocs_memset(buf, 0, size);
776 ocs_memset(buf, 0, size);
796 ocs_log_test(sli4->
os,
"unsupported FC speed %d\n", speed);
810 ocs_log_test(sli4->
os,
"unsupported FC-AL speed %d\n", speed);
818 ocs_log_test(sli4->
os,
"unsupported topology %#x\n", sli4->
config.
topology);
847 uint16_t fcfi, uint16_t vpi)
851 ocs_memset(buf, 0, size);
856 init_vfi->
fcfi = fcfi;
887 ocs_memset(buf, 0, size);
913 ocs_memset(buf, 0, size);
920 post_xri->
enx = TRUE;
921 post_xri->
val = TRUE;
943 ocs_memset(buf, 0, size);
965 ocs_memset(buf, 0, size);
986 ocs_memset(buf, 0, size);
1008 uint32_t preferred_d_id)
1012 ocs_memset(buf, 0, size);
1015 ocs_memcpy(write_nvparms->
wwpn, wwpn, 8);
1016 ocs_memcpy(write_nvparms->
wwnn, wwnn, 8);
1038 ocs_memset(buf, 0, size);
1042 if (vpd && vpd->size) {
1043 read_rev->
vpd = TRUE;
1072 ocs_memset(buf, 0, size);
1075 ocs_log_test(sli4->
os,
"special VPI not supported!!!\n");
1079 if (!dma || !dma->phys) {
1080 ocs_log_test(sli4->
os,
"bad DMA buffer\n");
1088 read_sparm64->
bde_64.
u.
data.buffer_address_low = ocs_addr32_lo(dma->phys);
1089 read_sparm64->
bde_64.
u.
data.buffer_address_high = ocs_addr32_hi(dma->phys);
1091 read_sparm64->
vpi = vpi;
1112 ocs_memset(buf, 0, size);
1116 if (dma && dma->size) {
1118 ocs_log_test(sli4->
os,
"loop map buffer too small %jd\n",
1123 ocs_memset(dma->virt, 0, dma->size);
1153 ocs_memset(buf, 0, size);
1161 case 0: reg_fcfi->
rq_id_0 = rq_cfg[0].rq_id;
break;
1162 case 1: reg_fcfi->
rq_id_1 = rq_cfg[1].rq_id;
break;
1163 case 2: reg_fcfi->
rq_id_2 = rq_cfg[2].rq_id;
break;
1164 case 3: reg_fcfi->
rq_id_3 = rq_cfg[3].rq_id;
break;
1173 reg_fcfi->
vv = TRUE;
1194 uint16_t fcf_index, uint16_t vlan_id,
1199 bool filter_ext_used = FALSE;
1201 ocs_memset(buf, 0, size);
1204 reg_fcfi_mrq->
mode = mode;
1208 reg_fcfi_mrq->
vv = TRUE;
1217 case 7: reg_fcfi_mrq->
rq_id_7 = rq_cfg[i].rq_id;
break;
1218 case 6: reg_fcfi_mrq->
rq_id_6 = rq_cfg[i].rq_id;
break;
1219 case 5: reg_fcfi_mrq->
rq_id_5 = rq_cfg[i].rq_id;
break;
1220 case 4: reg_fcfi_mrq->
rq_id_4 = rq_cfg[i].rq_id;
break;
1221 case 3: reg_fcfi_mrq->
rq_id_3 = rq_cfg[i].rq_id;
break;
1222 case 2: reg_fcfi_mrq->
rq_id_2 = rq_cfg[i].rq_id;
break;
1223 case 1: reg_fcfi_mrq->
rq_id_1 = rq_cfg[i].rq_id;
break;
1224 case 0: reg_fcfi_mrq->
rq_id_0 = rq_cfg[i].rq_id;
break;
1227 if (rq_cfg[i].rq_id == 0xffff) {
1238 filter_ext_used = TRUE;
1248 if (rq_cfg[i].protocol_valid) {
1249 reg_fcfi_mrq->
ptc |= (1 << i);
1250 reg_fcfi_mrq->
pt |= ((rq_cfg[i].protocol & 0x1) << i);
1254 if (rq_cfg[i].is_mrq) {
1255 if (rq_cfg[i].mrq_set_num == 0) {
1257 rq_cfg[i].mrq_set_count;
1259 if (rq_cfg[i].filtermask & 0xf0) {
1261 rq_cfg[i].filtermask;
1264 rq_cfg[i].filtermask;
1268 rq_cfg[i].mrq_policy;
1270 }
else if (rq_cfg[i].mrq_set_num == 1) {
1272 rq_cfg[i].mrq_set_count;
1274 if (rq_cfg[i].filtermask & 0xf0) {
1276 rq_cfg[i].filtermask;
1279 rq_cfg[i].filtermask;
1283 rq_cfg[i].mrq_policy;
1290 if (filter_ext_used) {
1291 reg_fcfi_mrq->
xmv = TRUE;
1316 uint16_t vpi, ocs_dma_t *dma, uint8_t update,
1317 uint8_t enable_t10_pi, uint8_t hlm)
1321 ocs_memset(buf, 0, size);
1327 reg_rpi->
upd = update;
1328 reg_rpi->
etow = enable_t10_pi;
1333 reg_rpi->
bde_64.
u.
data.buffer_address_low = ocs_addr32_lo(dma->phys);
1334 reg_rpi->
bde_64.
u.
data.buffer_address_high = ocs_addr32_hi(dma->phys);
1357 uint8_t bbscn_fabric = 0;
1359 if (!sli4 || !buf || !domain) {
1363 ocs_memset(buf, 0, size);
1367 reg_vfi->
vfi = domain->indicator;
1369 reg_vfi->
fcfi = domain->fcf_indicator;
1374 reg_vfi->
sparm.
u.
data.buffer_address_low = ocs_addr32_lo(domain->dma.phys);
1375 reg_vfi->
sparm.
u.
data.buffer_address_high = ocs_addr32_hi(domain->dma.phys);
1381 reg_vfi->
vpi = domain->sport->indicator;
1382 ocs_memcpy(reg_vfi->
wwpn, &domain->sport->sli_wwpn,
sizeof(reg_vfi->
wwpn));
1387 ocs_log_debug(sli4->
os,
"bbscn_fabric: %d\n", bbscn_fabric);
1398 if (bbscn_fabric <= sli4->config.bbscn_max) {
1402 ocs_log_info(sli4->
os,
"Enabling BBCR with BB_SC_N: %d\n", reg_vfi->
bbscn);
1427 if (!sli4 || !buf || !sport) {
1431 ocs_memset(buf, 0, size);
1436 reg_vpi->
upd = update != 0;
1437 ocs_memcpy(reg_vpi->
wwpn, &sport->sli_wwpn,
sizeof(reg_vpi->
wwpn));
1438 reg_vpi->
vpi = sport->indicator;
1439 reg_vpi->
vfi = sport->domain->indicator;
1460 ocs_memset(buf, 0, size);
1465 features->
qry = TRUE;
1489 if ((length >
sizeof(sli_config->
payload.
embed)) && (dma == NULL)) {
1490 ocs_log_test(sli4->
os,
"length(%d) > payload(%ld)\n",
1497 ocs_memset(buf, 0, size);
1501 sli_config->
emb = TRUE;
1504 sli_config->
emb = FALSE;
1512 #if defined(OCS_INCLUDE_DEBUG)
1514 sli4->bmbx_non_emb_pmd = dma;
1542 for (iter = 0; iter < 3000; iter ++) {
1552 ocs_log_crit(sli4->
os,
"port failed to become ready after initialization\n");
1574 if (!sli4 || !buf) {
1578 ocs_memset(buf, 0, size);
1582 unreg_fcfi->
fcfi = indicator;
1605 uint8_t index_indicator = 0;
1607 if (!sli4 || !buf) {
1611 ocs_memset(buf, 0, size);
1618 if (fc_id != UINT32_MAX) {
1619 unreg_rpi->
dp = TRUE;
1633 ocs_log_test(sli4->
os,
"unknown type %#x\n", which);
1637 unreg_rpi->
ii = index_indicator;
1638 unreg_rpi->
index = indicator;
1660 if (!sli4 || !buf || !domain) {
1664 ocs_memset(buf, 0, size);
1669 unreg_vfi->
index = domain->indicator;
1672 unreg_vfi->
index = domain->fcf_indicator;
1675 unreg_vfi->
index = UINT16_MAX;
1705 if (!sli4 || !buf) {
1709 ocs_memset(buf, 0, size);
1712 unreg_vpi->
index = indicator;
1724 unreg_vpi->
index = UINT16_MAX;
1752 if (!sli4 || !buf) {
1756 ocs_memset(buf, 0, size);
1779 uint32_t max_burst_len, uint32_t block_size)
1783 if (!sli4 || !buf) {
1787 ocs_memset(buf, 0, size);
1811 uint32_t max_burst_len, uint32_t xri_cnt,
1812 uint32_t tow_feature)
1816 if (!sli4 || !buf) {
1820 ocs_memset(buf, 0, size);
1850 size_t size, uint32_t max_burst_len,
1851 uint32_t xri_cnt, uint32_t block_size,
1852 uint32_t tow_feature)
1856 if (!sli4 || !buf) {
1860 ocs_memset(buf, 0, size);
1889 uint32_t sli_config_off = 0;
1892 uint32_t payload_size;
1925 ocs_dma_t *qmem, uint16_t eq_id, uint16_t ignored)
1929 uint32_t sli_config_off = 0;
1932 uint32_t if_type = sli4->
if_type;
1933 uint32_t page_bytes = 0;
1934 uint32_t num_pages = 0;
1935 uint32_t cmd_size = 0;
1936 uint32_t page_size = 0;
1968 ocs_log_test(sli4->
os,
"unsupported IF_TYPE %d\n", if_type);
1975 uint32_t payload_size;
2006 ocs_log_test(sli4->
os,
"num_pages %d not valid\n", cqv0->
num_pages);
2014 cqv0->
eq_id = eq_id;
2016 for (p = 0, addr = qmem->phys;
2017 p < cqv0->num_pages;
2018 p++, addr += page_bytes) {
2059 ocs_log_test(sli4->
os,
"num_pages %d not valid\n", cqv2->
num_pages);
2068 cqv2->
eq_id = eq_id;
2070 for (p = 0, addr = qmem->phys;
2071 p < cqv2->num_pages;
2072 p++, addr += page_bytes) {
2079 ocs_log_test(sli4->
os,
"unsupported IF_TYPE %d\n", if_type);
2083 return (sli_config_off + cmd_size);
2102 uint32_t sli_config_off = 0;
2137 uint32_t delay_mult)
2140 uint32_t sli_config_off = 0;
2157 modify_delay->
num_eq = num_q;
2159 for (i = 0; i<num_q; i++) {
2188 uint16_t ignored1, uint16_t ignored2)
2191 uint32_t sli_config_off = 0;
2196 uint32_t payload_size;
2230 ocs_log_test(sli4->
os,
"num_pages %d not valid\n", eq->
num_pages);
2241 for (p = 0, addr = qmem->phys;
2272 uint32_t sli_config_off = 0;
2308 uint32_t sli_config_off = 0;
2340 uint32_t unit_size, int32_t buf_count, uint32_t *phys_addr,
2341 uintptr_t lwpd_phys_addr)
2344 uint32_t sli_config_off = 0;
2369 req->
lwpd_addr_lo = (uint32_t)(lwpd_phys_addr & 0xFFFFFFFF);
2371 for (i = 0; i < buf_count; i++) {
2391 uint32_t sli_config_off = 0;
2415 uint32_t sli_config_off = 0;
2428 ocs_log_info(sli4->
os,
"Clearing the ITCM parity stats\n");
2438 uint32_t sli_config_off = 0;
2450 ocs_memset(dma->virt, 0, dma->size);
2477 uint32_t sli_config_off = 0;
2487 ocs_memset(dma->virt, 0, dma->size);
2514 ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
2517 uint32_t sli_config_off = 0;
2522 uint32_t payload_size;
2553 ocs_log_test(sli4->
os,
"num_pages %d not valid\n", mq->
num_pages);
2569 for (p = 0, addr = qmem->phys;
2595 uint32_t sli_config_off = 0;
2631 uint32_t sli_config_off = 0;
2646 ocs_memcpy(&nop->
context, &context,
sizeof(context));
2666 uint32_t sli_config_off = 0;
2699 uint32_t sli_config_off = 0;
2729 uint32_t sli_config_off = 0;
2730 uint32_t payload_size;
2765 uint32_t sli_config_off = 0;
2766 uint32_t payload_size;
2767 uint8_t version = 0;
2782 ocs_log_test(sli4->
os,
"unsupported IF_TYPE %d\n", sli4->
if_type);
2832 uint16_t noc, uint16_t eof, uint32_t desired_write_length,
2838 uint32_t sli_config_off = 0;
2867 host_buffer->
u.
data.buffer_address_low = ocs_addr32_lo(dma->phys);
2868 host_buffer->
u.
data.buffer_address_high = ocs_addr32_hi(dma->phys);
2891 uint32_t sli_config_off = 0;
2927 uint32_t desired_read_length,
2933 uint32_t sli_config_off = 0;
2961 host_buffer->
u.
data.buffer_address_low = ocs_addr32_lo(dma->phys);
2962 host_buffer->
u.
data.buffer_address_high = ocs_addr32_hi(dma->phys);
2964 host_buffer->
u.
data.buffer_address_low = 0;
2965 host_buffer->
u.
data.buffer_address_high = 0;
2990 uint32_t sli_config_off = 0;
3032 uint8_t query, uint8_t is_buffer_list,
3033 ocs_dma_t *buffer, uint8_t fdb)
3036 uint32_t sli_config_off = 0;
3052 set_dump_loc->
blp = is_buffer_list;
3053 set_dump_loc->
qry = query;
3054 set_dump_loc->
fdb = fdb;
3057 set_dump_loc->
buf_addr_low = ocs_addr32_lo(buffer->phys);
3085 ocs_dma_t *tx_buffer,
size_t tx_buf_len,
3086 ocs_dma_t *rx_buffer,
size_t rx_buf_len)
3090 if (!sli4 || !buf) {
3091 ocs_log_err(NULL,
"Invalid parameters\n");
3095 if (!tx_buffer || !rx_buffer) {
3096 ocs_log_err(sli4->
os,
"Invalid Tx/Rx buffers\n");
3099 ocs_memset(buf, 0, size);
3129 uint32_t sli_config_off = 0;
3145 set_loopback_mode->
typ = type;
3168 uint32_t sli_config_off = 0;
3208 uint32_t sli_config_off = 0;
3226 ocs_memcpy(cmd->
params, parameter, param_len);
3246 uint32_t sli_config_off = 0;
3247 uint32_t payload_size;
3257 ocs_memset(req, 0, dma->size);
3258 payload_size = dma->size;
3288 uint8_t profile_id, uint32_t descriptor_count, uint8_t isap)
3291 uint32_t cmd_off = 0;
3292 uint32_t payload_size;
3302 ocs_memset(req, 0, dma->size);
3303 payload_size = dma->size;
3334 uint32_t start_profile_index, ocs_dma_t *dma)
3337 uint32_t cmd_off = 0;
3338 uint32_t payload_size;
3348 ocs_memset(req, 0, dma->size);
3349 payload_size = dma->size;
3379 uint32_t cmd_off = 0;
3380 uint32_t payload_size;
3393 ((uint8_t*)buf + cmd_off);
3417 uint32_t fd, uint32_t active_profile_id)
3420 uint32_t cmd_off = 0;
3421 uint32_t payload_size;
3434 ((uint8_t*)buf + cmd_off);
3461 uint32_t cmd_off = 0;
3462 uint32_t payload_size;
3476 ocs_memset(req, 0, dma->size);
3477 payload_size = dma->size;
3506 uint32_t fd, uint32_t active_link_config_id)
3509 uint32_t cmd_off = 0;
3510 uint32_t payload_size;
3524 ocs_memset(req, 0, dma->size);
3525 payload_size = dma->size;
3561 ocs_log_warn(NULL,
"Ignoring MCQE, completion bit not set\n");
3566 ocs_log_err(NULL,
"MCQE: bad status (cmpl=%#x ext=%#x con=%d cmp=%d ae=%d val=%d)\n",
3569 ocs_log_err(NULL,
" %08X %08X %08X %08X\n", ((uint32_t *)buf)[0],
3570 ((uint32_t *)buf)[1], ((uint32_t *)buf)[2], ((uint32_t *)buf)[3]);
3591 if (!sli4 || !buf) {
3592 ocs_log_err(NULL,
"bad parameter sli4=%p buf=%p\n", sli4, buf);
3604 ocs_log_debug(sli4->
os,
"ACQE GRP5\n");
3607 ocs_log_debug(sli4->
os,
"ACQE SLI Port, type=0x%x, data1,2=0x%08x,0x%08x\n",
3609 #if defined(OCS_INCLUDE_DEBUG)
3619 ocs_log_test(sli4->
os,
"ACQE unknown=%#x\n", acqe->
event_code);
3642 ocs_log_err(NULL,
"bad parameter buf=%p cmd=%#x\n", buf,
3651 if (sli_config->
emb) {
3654 ocs_log_test(NULL,
"external buffers not supported\n");
3672 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (COM_FUNC_RESET)\n");
3676 ocs_log_err(sli4->
os,
"bad status COM_FUNC_RESET\n");
3680 ocs_log_err(sli4->
os,
"bad COM_FUNC_RESET write\n");
3704 uint32_t ready = FALSE;
3712 }
while (!ready && (iter > 0));
3738 ocs_log_crit(sli4->
os,
"FW status is NOT ready\n");
3750 ocs_log_crit(sli4->
os,
"bootstrap mailbox not ready\n");
3756 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (FW_INIT)\n");
3760 ocs_log_crit(sli4->
os,
"bad FW_INIT write\n");
3765 ocs_log_err(sli4->
os,
"bad COM_FUNC_RESET write\n");
3771 #if BYTE_ORDER == LITTLE_ENDIAN
3781 ocs_log_test(sli4->
os,
"if_type %d not supported\n", sli4->
if_type);
3804 ocs_log_crit(sli4->
os,
"bootstrap mailbox not ready\n");
3809 ocs_log_err(sli4->
os,
"bad COM_FUNC_RESET write\n");
3815 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (FW_DEINIT)\n");
3819 ocs_log_test(sli4->
os,
"bad FW_DEINIT write\n");
3823 #if BYTE_ORDER == LITTLE_ENDIAN
3882 if (!q->
u.
flag.is_hdr) {
3890 if (q->
u.
flag.rq_batch) {
3904 if (q->
u.
dpp.enabled) {
3918 ocs_log_test(sli4->
os,
"bad queue type %d\n", q->
type);
3930 *features, query)) {
3934 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (REQUEST_FEATURES)\n");
3938 ocs_log_err(sli4->
os,
"REQUEST_FEATURES bad status %#x\n",
3944 ocs_log_err(sli4->
os,
"bad REQUEST_FEATURES write\n");
3962 uint32_t alloc_size, qentries, qentry_size;
3976 alloc_size = qentries * qentry_size;
3981 alloc_size = qentries * qentry_size;
3983 ocs_log_debug(sli4->
os,
"[%s]: max_qentries from %d to %d (max dma %d)\n",
4012 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (QUERY_FW_CONFIG)\n");
4016 ocs_log_err(sli4->
os,
"COMMON_QUERY_FW_CONFIG bad status %#x\n",
4048 ocs_log_err(sli4->
os,
"bad QUERY_FW_CONFIG write\n");
4058 ocs_dma_t get_cntl_addl_data;
4069 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_CONFIG)\n");
4073 ocs_log_err(sli4->
os,
"READ_CONFIG bad status %#x\n",
4084 if (NULL == (base = ocs_malloc(sli4->
os,
SLI_RSRC_MAX *
sizeof(uint32_t),
4085 OCS_M_ZERO | OCS_M_NOWAIT))) {
4086 ocs_log_err(sli4->
os,
"memory allocation failed for sli4_resource_t\n");
4106 #if defined(OCS_USPACE_SPDK)
4109 ocs_log_info(sli4->
os,
"SLI4 Xri base = %d cnt = %d\n",
4125 sli4->
config.
extent[i].use_map = ocs_bitmap_alloc(total);
4127 ocs_log_err(sli4->
os,
"bitmap memory allocation failed "
4128 "resource %d\n", i);
4139 ocs_log_debug(sli4->
os,
"FCoE\n");
4142 ocs_log_debug(sli4->
os,
"FC (unknown)\n");
4145 ocs_log_debug(sli4->
os,
"FC (direct attach)\n");
4148 ocs_log_debug(sli4->
os,
"FC (arbitrated loop)\n");
4163 ocs_log_debug(sli4->
os,
"bbscn_max: %d, bbscn_def: %d\n",
4180 ocs_log_err(sli4->
os,
"bad READ_CONFIG write\n");
4189 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (COMMON_GET_SLI4_PARAMETERS)\n");
4192 ocs_log_err(sli4->
os,
"COMMON_GET_SLI4_PARAMETERS bad status %#x att'l %#x\n",
4254 (1ull << parms->
dw20w1) - 1;
4273 ocs_log_err(sli4->
os,
"Error sending QUERY_FW_CONFIG\n");
4288 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (COMMON_GET_CNTL_ATTRIBUTES)\n");
4291 ocs_log_err(sli4->
os,
"COMMON_GET_CNTL_ATTRIBUTES bad status %#x att'l %#x\n",
4302 ocs_log_err(sli4->
os,
"bad COMMON_GET_CNTL_ATTRIBUTES write\n");
4307 OCS_MIN_DMA_ALIGNMENT)) {
4308 ocs_log_err(sli4->
os,
"Failed to allocate memory for GET_CNTL_ADDL_ATTR data\n");
4311 &get_cntl_addl_data)) {
4315 ocs_log_crit(sli4->
os,
4316 "bootstrap mailbox write fail (COMMON_GET_CNTL_ADDL_ATTRIBUTES)\n");
4317 ocs_dma_free(sli4->
os, &get_cntl_addl_data);
4321 ocs_log_err(sli4->
os,
"COMMON_GET_CNTL_ADDL_ATTRIBUTES bad status %#x\n",
4323 ocs_dma_free(sli4->
os, &get_cntl_addl_data);
4331 ocs_log_err(sli4->
os,
"bad COMMON_GET_CNTL_ADDL_ATTRIBUTES write\n");
4332 ocs_dma_free(sli4->
os, &get_cntl_addl_data);
4336 ocs_dma_free(sli4->
os, &get_cntl_addl_data);
4344 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (COMMON_GET_PORT_NAME)\n");
4356 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_REV)\n");
4360 ocs_log_err(sli4->
os,
"READ_REV bad status %#x\n",
4375 ocs_log_info(sli4->
os,
"FW1:%s (%08x) / FW2:%s (%08x)\n",
4384 ocs_log_test(sli4->
os,
"VPD length: available=%d returned=%d actual=%d\n",
4391 ocs_log_err(sli4->
os,
"bad READ_REV write\n");
4399 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_NVPARMS)\n");
4403 ocs_log_err(sli4->
os,
"READ_NVPARMS bad status %#x\n",
4411 ocs_log_debug(sli4->
os,
"WWPN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
4420 ocs_log_debug(sli4->
os,
"WWNN %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
4430 ocs_log_err(sli4->
os,
"bad READ_NVPARMS write\n");
4454 uint32_t sli_intf = UINT32_MAX;
4455 uint32_t pci_class_rev = 0;
4456 uint32_t rev_id = 0;
4457 uint32_t family = 0;
4461 ocs_memset(sli4, 0,
sizeof(
sli4_t));
4473 ocs_log_err(os,
"SLI_INTF is not valid\n");
4480 ocs_log_err(os,
"Unsupported SLI revision (intf=%#x)\n",
4500 for (i = 0, asic = sli4_asic_table; i < ARRAY_SIZE(sli4_asic_table); i++, asic++) {
4501 if ((rev_id == asic->
rev_id) && (family == asic->
family)) {
4509 ocs_log_err(os,
"no matching asic family/rev found: %02x/%02x\n", family, rev_id);
4521 ocs_log_err(os,
"bootstrap mailbox allocation failed\n");
4526 ocs_log_err(os,
"bad alignment for bootstrap mailbox\n");
4530 ocs_log_debug(os,
"bmbx v=%p p=0x%x %08x s=%zd\n", sli4->
bmbx.virt,
4531 ocs_addr32_hi(sli4->
bmbx.phys),
4532 ocs_addr32_lo(sli4->
bmbx.phys),
4536 if (ocs_dma_alloc(sli4->
os, &sli4->
vpd.
data, 4096, 4096)) {
4539 ocs_log_test(os,
"VPD buffer allocation failed\n");
4543 ocs_log_err(sli4->
os,
"FW initialization failed\n");
4549 ocs_log_debug(os,
"status=%#x error1=%#x error2=%#x\n",
4595 ocs_log_test(sli4->
os,
"XXX need to implement extent allocation\n");
4616 ocs_log_crit(sli4->
os,
"FW initialization failed\n");
4668 ocs_log_crit(sli4->
os,
"FW status is NOT ready\n");
4686 ocs_log_test(sli4->
os,
"Unexpected iftype %d\n", sli4->
if_type);
4694 ocs_log_crit(sli4->
os,
"Failed to become ready after firmware reset\n");
4711 ocs_log_crit(sli4->
os,
"FW status is NOT ready\n");
4718 ocs_log_debug(sli4->
os,
"PM: Setting SLI4_REG_PHYSDEV_CONTROL to val: 0x%x\n", val);
4722 ocs_log_test(sli4->
os,
"Unexpected iftype %d\n", sli4->
if_type);
4729 ocs_log_crit(sli4->
os,
"Failed to become ready after firmware reset\n");
4765 ocs_log_err(sli4->
os,
"FW deinitialization failed\n");
4768 ocs_dma_free(sli4->
os, &sli4->
vpd.
data);
4769 ocs_dma_free(sli4->
os, &sli4->
bmbx);
4790 ocs_log_err(NULL,
"bad parameter sli4=%p which=%#x func=%p\n",
4805 ocs_log_test(sli4->
os,
"unknown callback %#x\n", which);
4834 size_t size, uint32_t n_entries, uint32_t align)
4839 if ((q->
dma.virt == NULL) || (size != q->
size) || (n_entries != q->
length)) {
4841 ocs_dma_free(sli4->
os, &q->
dma);
4846 if (ocs_dma_alloc(sli4->
os, &q->
dma, size * n_entries, align)) {
4847 ocs_log_err(sli4->
os,
"%s allocation failed\n",
SLI_QNAME[qtype]);
4851 ocs_memset(q->
dma.virt, 0, size * n_entries);
4899 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail %s\n",
4901 ocs_dma_free(sli4->
os, &q->
dma);
4906 ocs_dma_free(sli4->
os, &q->
dma);
4909 res_q = (
void *)((uint8_t *)sli4->
bmbx.virt +
4913 ocs_log_err(sli4->
os,
"bad create %s status=%#x addl=%#x\n",
4916 ocs_dma_free(sli4->
os, &q->
dma);
4950 q->
u.
dpp.enabled = dpp_res_q->
dpp;
4952 if (dpp_res_q->
dpp) {
4958 ocs_log_info(sli4->
os,
"DPP WQ Create success dpp_id = %d \n",
4998 ocs_log_err(NULL,
"bad parameter sli4=%p\n", sli4);
5017 ocs_log_test(sli4->
os,
"unsupported queue entry size\n");
5025 ocs_log_test(sli4->
os,
"unknown queue type %d\n", qtype);
5050 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (MODIFY EQ DELAY)\n");
5054 ocs_log_err(sli4->
os,
"bad status MODIFY EQ DELAY\n");
5087 ocs_log_err(NULL,
"bad parameter sli4=%p q=%p\n", sli4, q);
5106 switch (n_entries) {
5113 ocs_log_test(sli4->
os,
"illegal n_entries value %d for MQ\n", n_entries);
5116 assoc->
u.
flag.is_mq = TRUE;
5128 ocs_log_test(sli4->
os,
"unsupported WQ create\n");
5133 ocs_log_test(sli4->
os,
"unknown queue type %d\n", qtype);
5139 ocs_log_err(sli4->
os,
"%s allocation failed\n",
SLI_QNAME[qtype]);
5146 ocs_log_err(sli4->
os,
"create %s failed\n",
SLI_QNAME[qtype]);
5151 ocs_log_err(sli4->
os,
"cannot create %s\n",
SLI_QNAME[qtype]);
5175 uint32_t i, offset = 0, page_bytes = 0, payload_size, cmd_size = 0;
5176 uint32_t p = 0, page_size = 0, n_cqe = 0, num_pages_cq;
5183 ocs_log_err(NULL,
"bad parameter sli4=%p\n", sli4);
5187 memset(&dma, 0,
sizeof(dma));
5190 for (i = 0; i < num_cqs; i++) {
5193 ocs_log_err(sli4->
os,
"Queue init failed.\n");
5218 if (ocs_dma_alloc(sli4->
os, &dma, payload_size, SLI_PAGE_SIZE)) {
5219 ocs_log_err(sli4->
os,
"DMA allocation failed\n");
5222 ocs_memset(dma.virt, 0, payload_size);
5225 payload_size, &dma) == -1) {
5254 ocs_log_test(sli4->
os,
"num_pages %d not valid\n", req->
num_pages);
5266 for (i = 0; i < num_cqs; i++) {
5268 for (p = 0, addr = qs[i]->dma.phys; p < req->num_pages; p++, addr += page_bytes) {
5276 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail CQSet\n");
5280 res = (
void *)((uint8_t *)dma.virt);
5282 ocs_log_err(sli4->
os,
"bad create CQSet status=%#x addl=%#x\n",
5288 ocs_log_crit(sli4->
os,
"Requested count CQs doesnt match.\n");
5293 for (i = 0; i < num_cqs; i++) {
5294 qs[i]->
id = res->
q_id + i;
5300 ocs_dma_free(sli4->
os, &dma);
5305 for (i = 0; i < num_cqs; i++) {
5306 if (qs[i]->dma.
size) {
5307 ocs_dma_free(sli4->
os, &qs[i]->
dma);
5312 ocs_dma_free(sli4->
os, &dma);
5341 ocs_log_err(NULL,
"bad parameter sli4=%p q=%p\n", sli4, q);
5345 if (destroy_queues) {
5361 ocs_log_test(sli4->
os,
"unsupported WQ destroy\n");
5370 ocs_log_test(sli4->
os,
"unsupported RQ destroy\n");
5375 ocs_log_test(sli4->
os,
"bad queue type %d\n",
5394 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail destroy %s\n",
5399 res = (
void *)((uint8_t *)sli4->
bmbx.virt +
5403 ocs_log_err(sli4->
os,
"bad destroy %s status=%#x addl=%#x\n",
5416 ocs_lock_free(&q->
lock);
5418 if (ocs_dma_free(sli4->
os, &q->
dma)) {
5419 ocs_log_err(sli4->
os,
"%s queue ID %d free failed\n",
5441 if (q->
dma.virt != NULL) {
5442 ocs_memset(q->
dma.virt, 0, (q->
size * (uint64_t)q->
length));
5445 ocs_unlock(&q->
lock);
5466 uint8_t *qe = q->
dma.virt;
5470 ocs_dma_sync(&q->
dma, OCS_DMASYNC_POSTREAD);
5476 ocs_unlock(&q->
lock);
5503 ocs_unlock(&q->
lock);
5543 ocs_log_test(sli4->
os,
"should only be used for EQ/CQ, not %s\n",
5547 ocs_unlock(&q->
lock);
5568 uint8_t *qe = q->
dma.virt;
5570 uint8_t dpp = FALSE;
5582 if (q->
u.
dpp.enabled)
5585 #if defined(OCS_INCLUDE_DEBUG)
5601 ocs_memcpy(qe, entry, q->
size);
5603 tmp = (uint8_t *)entry;
5604 for (i = 0; i < q->
size; i +=
sizeof(uint32_t)) {
5605 ocs_reg_write32(sli4->
os,
5607 q->
u.
dpp.db_offset + i,
5608 *((uint32_t *)(tmp + i)));
5614 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
5624 }
else if (rc > 0) {
5651 ocs_unlock(&q->
lock);
5668 uint8_t valid = FALSE;
5669 uint8_t valid_bit_set = 0;
5674 if (valid && clear) {
5683 valid_bit_set = (qe[15] & 0x80) != 0;
5684 if (valid_bit_set == q->
phase)
5687 if (valid & clear) {
5699 ocs_log_test(NULL,
"doesn't handle type=%#x\n", q->
type);
5703 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
5723 uint8_t *qe = q->
dma.virt;
5724 uint32_t *qindex = NULL;
5735 ocs_dma_sync(&q->
dma, OCS_DMASYNC_POSTREAD);
5737 qe += *qindex * q->
size;
5740 ocs_unlock(&q->
lock);
5745 ocs_memcpy(entry, qe, q->
size);
5746 #if defined(OCS_INCLUDE_DEBUG)
5767 *qindex = (*qindex + 1) & (q->
length - 1);
5775 q->
phase ^= (uint16_t) 0x1;
5784 ocs_unlock(&q->
lock);
5807 ocs_unlock(&q->
lock);
5816 uint8_t *qe = q->
dma.virt;
5818 if (index >= q->
length) {
5822 qe += index * q->
size;
5825 ocs_memcpy(qe, entry, q->
size);
5828 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
5855 uint32_t extent_idx;
5867 *index = UINT32_MAX;
5868 status = ocs_bitmap_find(sli4->
config.
extent[rtype].use_map,
5871 ocs_log_err(sli4->
os,
"out of resource %d (alloc=%d, status=%d, map_size=%d)\n",
5883 extent_idx = *index / size;
5884 item_idx = *index % size;
5886 *rid = sli4->
config.
extent[rtype].base[extent_idx] + item_idx;
5917 uint32_t size, *base;
5938 for (x = 0; x < sli4->
config.
extent[rtype].number; x++) {
5939 if ((rid >= base[x]) && (rid < (base[x] + size))) {
5972 for (i = 0; i < sli4->
config.
extent[rtype].map_size; i++) {
5973 ocs_bitmap_clear(sli4->
config.
extent[rtype].use_map, i);
6005 if (!sli4 || !buf || !cq_id) {
6006 ocs_log_err(NULL,
"bad parameters sli4=%p buf=%p cq_id=%p\n",
6017 ocs_log_debug(sli4->
os,
"sentinel EQE\n");
6021 ocs_log_test(sli4->
os,
"Unsupported EQE: major %x minor %x\n",
6051 if (!sli4 || !cq || !cqe || !etype) {
6052 ocs_log_err(NULL,
"bad parameters sli4=%p cq=%p cqe=%p etype=%p q_id=%p\n",
6053 sli4, cq, cqe, etype, q_id);
6057 if (cq->
u.
flag.is_mq) {
6070 ocs_log_test(sli4->
os,
"implement CQE parsing type = %#x\n",
6149 uint32_t uerr_mask_lo;
6150 uint32_t uerr_mask_hi;
6158 if ((uerr_lo & ~uerr_mask_lo) || (uerr_hi & ~uerr_mask_hi)) {
6181 uint32_t skip_dump = FALSE;
6223 ocs_log_test(sli4->
os,
"Function only supported for I/F type 2/6");
6234 if (UINT32_MAX == val) {
6235 ocs_log_err(sli4->
os,
"error reading SLIPORT_STATUS\n");
6258 ocs_log_test(sli4->
os,
"reset required N/A for iftype 0\n");
6263 if (UINT32_MAX == val) {
6264 ocs_log_err(sli4->
os,
"error reading SLIPORT_STATUS\n");
6285 uint32_t sliport_semaphore;
6289 if (UINT32_MAX == sliport_semaphore) {
6290 ocs_log_err(sli4->
os,
"error reading SLIPORT_SEMAPHORE register\n");
6298 uint32_t uerr_mask_lo, uerr_mask_hi;
6299 uint32_t uerr_status_lo, uerr_status_hi;
6305 if ((uerr_mask_lo & uerr_status_lo) != 0 ||
6306 (uerr_mask_hi & uerr_status_hi) != 0) {
6311 uint32_t sliport_status;
6406 ocs_log_debug(sli4->
os,
"error1: 0x%x\n", err1);
6407 ocs_log_debug(sli4->
os,
"error2: 0x%x\n", err2);
6419 ocs_log_crit(sli4->
os,
"Skipping diagnostic dump for (error1, error2) = (%#x, %#x)\n", err1, err2);
int32_t sli_cmd_fcoe_wq_create_v1(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
Write an FCOE_WQ_CREATE_V1 command.
sli4_mbox_command_header_t hdr
uint32_t chain_sge_initial_value_hi
READ_STATUS - read tx/rx status of a particular port.
Mailbox Completion Queue Entry.
int32_t(* link)(void *, void *)
uint32_t ulp1_toe_wq_total
int32_t sli_cmd_read_link_stats(sli4_t *sli4, void *buf, size_t size, uint8_t req_ext_counters, uint8_t clear_overflow_flags, uint8_t clear_all_counters)
Write a READ_LINK_STAT command to the provided buffer.
#define SLI4_OPC_COMMON_GET_ACTIVE_PROFILE
int32_t sli_cmd_down_link(sli4_t *sli4, void *buf, size_t size)
Write a DOWN_LINK command to the provided buffer.
#define SLI4_FAMILY_CHECK_ASIC_TYPE
uint32_t uint32_t sge_supported_length
uint32_t desired_write_length
uint32_t ocs_instance(void *os)
Return instance index of an opaque ocs structure.
int32_t sli_cmd_read_status(sli4_t *sli4, void *buf, size_t size, uint8_t clear_counters)
Write a READ_STATUS command to the provided buffer.
int32_t sli_cmd_common_nop(sli4_t *sli4, void *buf, size_t size, uint64_t context)
Write a COMMON_NOP command.
#define SLI4_MBOX_COMMAND_UNREG_VPI
uint32_t uint32_t wq_db_offset
union sli4_cmd_sli_config_t::@36 payload
uint32_t ulp0_toe_defrq_total
#define SLI4_ACQE_EVENT_CODE_FC_LINK_EVENT
sli4_port_type_e port_type
int32_t sli_cmd_write_nvparms(sli4_t *sli4, void *buf, size_t size, uint8_t *wwpn, uint8_t *wwnn, uint8_t hard_alpa, uint32_t preferred_d_id)
Write a WRITE_NVPARMS command to the provided buffer.
#define SLI4_OPC_COMMON_GET_RESOURCE_EXTENT_INFO
#define SLI4_MBOX_COMMAND_REG_VPI
UNREG_RPI - unregister one or more RPI.
#define SLI4_UNREG_RPI_II_RPI
uint32_t rq_selection_policy_1
#define OCS_TOW_FEATURE_TFB
char bios_version_string[32]
#define SLI4_PCI_REV_ID_SHIFT
#define SLI4_IO_WQ_DOORBELL_REG
WQ_DOORBELL - WQ Doorbell Register.
Generic Common Create EQ/CQ/MQ/WQ/RQ Queue completion.
static int32_t sli_cmd_fw_initialize(sli4_t *, void *, size_t)
Write a FW_INITIALIZE command to the provided buffer.
uint32_t next_link_config_id
int32_t sli_fc_process_sli_port_event(sli4_t *sli4, void *acqe)
Process an asynchronous sli port event.
uint16_t count_mask[SLI_QTYPE_MAX]
int32_t sli_cmd_common_read_transceiver_data(sli4_t *sli4, void *buf, size_t size, uint32_t page_num, ocs_dma_t *dma)
Write a COMMON_READ_TRANSCEIVER_DATA command.
#define SLI4_PHSDEV_CONTROL_REG_236
REG_RPI - register a Remote Port Indicator.
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t cqe_count_mask
uint32_t uint32_t scsi_max_data_len
#define SLI4_ACQE_EVENT_CODE_LINK_STATE
static uint32_t sli_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
int32_t sli_fw_error_status(sli4_t *sli4)
Read the SLIPORT_SEMAPHORE and SLIPORT_STATUS registers to check if the port status indicates that a ...
uint32_t uint32_t rq_selection_policy_2
uint32_t cq_create_version
int32_t sli_queue_poke(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
uint32_t uint32_t timeout
uint16_t link_module_type
sli4_mbox_command_header_t hdr
#define SLI4_PCI_SOFT_RESET_MASK
uint32_t watchdog_timeout
#define SLI4_MIN_LOOP_MAP_BYTES
#define SLI4_MBOX_COMMAND_REG_FCFI_MRQ
#define SLI4_IF6_EQ_DOORBELL_REG
#define SLI4_QUEUE_RQ_BATCH
int32_t sli_cmd_common_set_dump_location(sli4_t *sli4, void *buf, size_t size, uint8_t query, uint8_t is_buffer_list, ocs_dma_t *buffer, uint8_t fdb)
Write a COMMON_SET_DUMP_LOCATION command.
#define SLI4_OPC_COMMON_DESTROY_EQ
#define SLI4_OPC_LOWLEVEL_GET_ITCM_PARITY_STATS
sli4_mbox_command_header_t hdr
#define SLI4_PHYDEV_CONTROL_CFP
#define SLI4_READ_SPARM64_VPI_SPECIAL
sli4_mbox_command_header_t hdr
INIT_VFI - initialize the VFI resource.
uint32_t uint32_t wki_selection
int32_t sli_cq_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_e *etype, uint16_t *q_id)
Parse a CQ entry to retrieve the event type and the associated queue.
#define SLI4_SLIPORT_CONTROL_BIG_ENDIAN
int32_t sli_dump_is_ready(sli4_t *sli4)
Read the SLIPORT_STATUS register to to check if a dump is present.
#define SLI4_FW_READY_TIMEOUT_MSEC
uint16_t sgl_index_field_offset
#define OCS_DEBUG_ENABLE_MQ_DUMP
#define SLI4_UNREG_RPI_II_FCFI
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t rq_db_window
#define SLI4_PAUSE_ERRX_PAIR_CNT
uint32_t max_qentries[SLI_QTYPE_MAX]
struct sli4_features_t::@35 flag
#define SLI4_MBOX_COMMAND_UNREG_VFI
#define SLI4_IF6_RQ_DOORBELL_REG
#define SLI4_FCOE_RQE_SIZE
#define FC_LINK_SPEED_32G
uint32_t uint32_t additional_status
#define SLI4_UERR_MASK_HIGH_REG
uint32_t suppress_rsp_not_supported
void sli_validate_pause_errors(sli4_t *sli4, uint32_t *skip_dump)
static int32_t sli_bmbx_write(sli4_t *sli4)
Write bootstrap mailbox.
uint32_t uint32_t scsi_block_size
#define SLI4_OPC_COMMON_QUERY_FW_CONFIG
#define SLI4_PORT_SEMAPHORE_REG_0
SLIPORT_SEMAPHORE - SLI Port Host and Port Status Register.
uint32_t uint32_t uint32_t eqe_count_method
int32_t sli_cmd_init_link(sli4_t *sli4, void *buf, size_t size, uint32_t speed, uint8_t reset_alpa)
Write an INIT_LINK command to the provided buffer.
int32_t sli_eq_modify_delay(sli4_t *sli4, sli4_queue_t *eq, uint32_t num_eq, uint32_t shift, uint32_t delay_mult)
Modify the delay timer for all the EQs.
static bool ocs_power_of_2(size_t len)
int32_t sli_cmd_common_set_features(sli4_t *sli4, void *buf, size_t size, uint32_t feature, uint32_t param_len, void *parameter)
Write a COMMON_SET_FEATURES command.
#define SLI4_READ_CFG_TOPO_FC_DA
#define SLI4_ACQE_EVENT_CODE_GRP_5
sli4_sli_config_pmd_t mem
#define SLI4_READ_CFG_TOPO_FCOE
int32_t sli_cmd_fcoe_rq_destroy(sli4_t *sli4, void *buf, size_t size, uint16_t rq_id)
Write an FCOE_RQ_DESTROY command.
int32_t sli_setup(sli4_t *sli4, ocs_os_handle_t os, sli4_port_type_e port_type)
Set up the SLI context.
#define SLI4_PHYDEV_CONTROL_DD
static uint32_t sli_iftype6_eq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
#define SLI4_OPC_COMMON_GET_PROFILE_LIST
#define SLI4_MQ_DOORBELL_REG
MQ_DOORBELL - MQ Doorbell Register.
uint32_t uint32_t mrq_filter_bitmask_2
#define SLI4_CMD_REG_FCFI_NUM_RQ_CFG
REG_FCFI - activate a FC Forwarder.
sli4_mbox_command_header_t hdr
int32_t sli_cmd_config_optimized_write_hp(sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len, uint32_t xri_cnt, uint32_t block_size, uint32_t tow_feature)
Write an CONFIG_OPTIMIZED_WRITE_HP command to the provided buffer.
static uint8_t sli_pci_rev_id(uint32_t val)
Retrieve PCI revision ID.
uint32_t ulp1_toe_defrq_total
uint32_t sgl_pre_registered
#define SLI4_MBOX_COMMAND_CONFIG_TOW
sli4_mbox_command_header_t hdr
UNREG_VFI - unregister one or more VFI.
uint32_t uint32_t uint32_t eq_page_cnt
#define SLI4_MBOX_COMMAND_DOWN_LINK
static uint8_t sli_intf_sli_family(uint32_t val)
void sli4_cmd_lowlevel_get_itcm_parity_stats(sli4_t *sli4, void *buf, size_t size, bool clear_stats)
INIT_VPI - initialize the VPI resource.
sli4_mbox_command_header_t hdr
int32_t sli_queue_write(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Write an entry to the queue object.
static uint32_t sli_iftype6_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
sli4_sgl_chaining_params_t sgl_chaining_params
#define FW_DUMP_READY_STATUS_DD_PRESENT
#define SLI4_MBOX_COMMAND_DUMP
unfair enable_topology_failover
#define SLI4_OPC_COMMON_GET_RECONFIG_LINK_INFO
void sli4_cmd_lowlevel_set_watchdog(sli4_t *sli4, void *buf, size_t size, uint16_t timeout)
Write a LOWLEVEL_SET_WATCHDOG command.
uint32_t hdr_template_req
static uint8_t sli_intf_sli_revision(uint32_t val)
Retrieve the SLI revision level.
#define SLI4_FUNCTION_MODE_DUA_MODE
#define SLI4_DPP_WQ_DOORBELL(n, x, i)
static uint32_t sli_get_tow_capable(sli4_t *sli4)
#define SLI4_OPC_COMMON_GET_CNTL_ADDL_ATTRIBUTES
#define SLI4_OPC_COMMON_SET_RECONFIG_LINK_ID
#define SLI4_MBOX_COMMAND_READ_SPARM64
struct sli4_bde_t::@27::@28 data
int32_t sli_queue_free(sli4_t *sli4, sli4_queue_t *q, uint32_t destroy_queues, uint32_t free_memory)
Free a queue.
#define SLI4_OPC_COMMON_SET_ACTIVE_PROFILE
#define SLI4_BMBX_TIMEOUT_MSEC
uint32_t uint32_t scsi_max_data_len
#define SLI4_INTF_SLI_FAMILY_SHIFT
int32_t sli_fw_ready(sli4_t *sli4)
Determine if the chip FW is in a ready state.
sli4_bde_t host_buffer_descriptor[0]
int32_t sli_queue_reset(sli4_t *sli4, sli4_queue_t *q)
static uint8_t sli_asic_gen(uint32_t val)
retrieve SLI ASIC generation
static uint32_t sli_convert_mask_to_count(uint32_t method, uint32_t mask)
uint16_t count_method[SLI_QTYPE_MAX]
#define SLI4_MBOX_COMMAND_INIT_VPI
#define SLI4_OPC_COMMON_GET_PROFILE_CONFIG
sli4_asic_entry_t sli4_asic_table[]
#define SLI4_INTF_IF_TYPE_MASK
int32_t sli_resource_alloc(sli4_t *sli4, sli4_resource_e rtype, uint32_t *rid, uint32_t *index)
Allocate SLI Port resources.
#define SLI4_BMBX_WRITE_HI(r)
READ_SPARM64 - read the Port service parameters.
int32_t sli_cmd_unreg_rpi(sli4_t *sli4, void *buf, size_t size, uint16_t indicator, sli4_resource_e which, uint32_t fc_id)
Write an UNREG_RPI command to the provided buffer.
int32_t sli_cmd_post_xri(sli4_t *sli4, void *buf, size_t size, uint16_t xri_base, uint16_t xri_count)
Write a POST_XRI command to the provided buffer.
int32_t sli_queue_is_empty(sli4_t *sli4, sli4_queue_t *q)
Check if the given queue is empty.
sli4_mbox_command_header_t hdr
int32_t sli_cmd_fc_set_trunk_mode(sli4_t *sli4, void *buf, size_t size, uint32_t trunk_mode)
Write a SLI4_OPC_FC_SET_TRUNK_MODE command.
static int32_t sli_query_fw_config(sli4_t *sli4)
Issue a FW_CONFIG mailbox command and store the results.
#define SLI4_SLIPORT_ERROR2
SLI4_SLIPORT_ERROR2 - SLI Port Error Register.
uint32_t cmd_buf_addr_low
#define SLI4_OPC_COMMON_DESTROY_MQ
static int32_t sli_cmd_common_modify_eq_delay(sli4_t *sli4, void *buf, size_t size, sli4_queue_t *q, int num_q, uint32_t shift, uint32_t delay_mult)
Write a COMMON_MODIFY_EQ_DELAY command.
uint32_t uint32_t read_offset
uint32_t uint32_t uint32_t rq_id_4
void sli_reg_write(sli4_t *sli, sli4_regname_e reg, uint32_t val)
Write the value to the given SLI register.
#define SLI_USER_MQ_COUNT
#define SLI4_PCI_SOFT_RESET_CSR
int32_t sli_fc_cqe_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_e *etype, uint16_t *r_id)
Parse an FC/FCoE work queue CQ entry.
uint32_t sli4_features_t command
uint32_t mq_create_version
#define SLI4_MBOX_COMMAND_RELEASE_XRI
#define SLI4_IF_TYPE_BE3_SKH_VF
int32_t sli_cmd_reg_fcfi(sli4_t *sli4, void *buf, size_t size, uint16_t index, sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG], uint16_t vlan_id)
Write a REG_FCFI command to the provided buffer.
#define FW_DUMP_READY_STATUS_SKIP_DUMP
static int32_t sli_get_config(sli4_t *sli4)
#define FW_DUMP_READY_STATUS_FAILED
int32_t sli_resource_reset(sli4_t *sli4, sli4_resource_e rtype)
int32_t sli_cqe_mq(void *buf)
Check the mailbox/queue completion entry.
#define SLI4_IF6_MQ_DOORBELL_REG
sli4_mbox_command_header_t hdr
#define SLI4_SLIPORT_ERROR1
SLI4_SLIPORT_ERROR1 - SLI Port Error Register.
static int32_t sli_request_features(sli4_t *sli4, sli4_features_t *features, uint8_t query)
sli4_mbox_command_header_t hdr
static int32_t sli_cmd_common_get_cntl_attributes(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
int32_t sli_cmd_config_optimized_write(sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len, uint32_t xri_cnt, uint32_t tow_feature)
Write an CONFIG_OPTIMIZED_WRITE command to the provided buffer.
uint32_t uint32_t first_hw_revision
#define SLI4_PORT_MIGRATION_BIT
READ_LNK_STAT - read link status of a particular port.
int32_t sli_queue_read(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Read an entry from the queue object.
uint32_t uint32_t physical_address_low
#define SLI4_INTF_IF_TYPE_SHIFT
uint32_t returned_vpd_length
#define SLI4_READ_CFG_TOPO_FC
static int32_t sli_cmd_request_features(sli4_t *sli4, void *buf, size_t size, sli4_features_t mask, uint8_t query)
Write a REQUEST_FEATURES command to the provided buffer.
uint32_t uint32_t payload_length
struct sli4_req_lowlevel_set_diag_log_options_t::@43 buffer_desc[0]
int32_t sli_teardown(sli4_t *sli4)
Tear down a SLI context.
#define SLI4_MBOX_COMMAND_SLI_CONFIG
#define SLI4_UNREG_VPI_II_VPI
#define SLI4_OPC_COMMON_FUNCTION_RESET
int32_t sli_cmd_reg_fcfi_mrq(sli4_t *sli4, void *buf, size_t size, uint8_t mode, uint16_t fcf_index, uint16_t vlan_id, sli4_cmd_rq_cfg_t rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG])
Write REG_FCFI_MRQ to provided command buffer.
#define SLI4_PCI_REV_ID_MASK
int32_t sli_cmd_common_write_object(sli4_t *sli4, void *buf, size_t size, uint16_t noc, uint16_t eof, uint32_t desired_write_length, uint32_t offset, char *object_name, ocs_dma_t *dma)
Write a COMMON_WRITE_OBJECT command.
#define SLI4_CQ_CNT_LARGE
#define SLI4_ULP_MODE_FCOE_TGT
#define SLI4_MQ_DOORBELL(n, i)
#define SLI4_ASIC_ID_REG
ASIC_ID - SLI ASIC Type and Revision Register.
READ_NVPARMS - read SLI port configuration parameters.
#define SLI4_WQE_EXT_BYTES
sli4_mbox_command_header_t hdr
#define SLI4_MBOX_COMMAND_REG_VFI
#define SLI4_SLIPORT_CONTROL_FDD
uint32_t third_hw_revision
void sli_calc_max_qentries(sli4_t *sli4)
Calculate max queue entries.
#define SLI4_ASYNC_EVT_FC_FCOE
#define SLI4_MBOX_COMMAND_WRITE_NVPARMS
uint32_t completion_status
static int32_t sli_cmd_common_create_eq(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t ignored1, uint16_t ignored2)
Write a COMMON_CREATE_EQ command.
#define SLI4_MBOX_COMMAND_READ_STATUS
int32_t sli_link_is_configurable(sli4_t *sli)
Determine if the link can be configured.
sli4_mbox_command_header_t hdr
struct sli4_t::@47 config
#define SLI4_OPC_COMMON_SET_DUMP_LOCATION
#define SLI4_INTF_VALID_MASK
int32_t sli_resource_free(sli4_t *sli4, sli4_resource_e rtype, uint32_t rid)
Free the SLI Port resources.
#define SLI4_UNREG_RPI_II_VFI
#define SLI4_MBOX_COMMAND_READ_NVPARMS
static int32_t sli_cmd_common_function_reset(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_FUNCTION_RESET command.
uint32_t uint32_t uint32_t uint32_t uint32_t cq_page_cnt
int32_t sli_cqe_async(sli4_t *sli4, void *buf)
Check the asynchronous event completion entry.
int32_t sli_cmd_config_auto_xfer_rdy(sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len)
Write an CONFIG_AUTO_XFER_RDY command to the provided buffer. Command to enable AXR in G5...
sli4_regname_e
Register name enums.
uint32_t rx_phy_addr_high
COMMON_SET_DUMP_LOCATION.
static uint8_t sli_queue_entry_is_valid(sli4_queue_t *, uint8_t *, uint8_t)
Check if the current queue entry is valid.
sli4_mbox_command_header_t hdr
int32_t sli_cmd_read_sparm64(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint16_t vpi)
Write a READ_SPARM64 command to the provided buffer.
uint32_t chain_sge_initial_value_hi
int32_t sli_cmd_common_set_reconfig_link_id(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint32_t fd, uint32_t active_link_config_id)
Write a COMMON_SET_RECONFIG_LINK_ID command.
static int32_t sli_common_function_reset(sli4_t *sli4)
Issue a COMMON_FUNCTION_RESET command.
#define SLI4_OPC_COMMON_MODIFY_EQ_DELAY
#define SLI4_BMBX_REG
BMBX - Bootstrap Mailbox Register.
int32_t sli_port_migration(sli4_t *sli4)
#define SLI4_MBOX_COMMAND_REG_FCFI
uint32_t uint32_t min_rq_buffer_size
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t wqe_sizes
uint32_t host_buffer_descriptor_count
#define SLI4_SUBSYSTEM_COMMON
#define SLI4_INTF_SLI_FAMILY_MASK
sli4_mbox_command_header_t hdr
#define SLI4_RQ_DOORBELL_REG
RQ_DOORBELL - RQ Doorbell Register.
#define SLI4_MBOX_COMMAND_INIT_VFI
void ocs_dump32(uint32_t mask, ocs_os_handle_t os, const char *label, void *buf, uint32_t buf_length)
Dump 32 bit hex/ascii data.
int32_t sli_queue_eq_arm(sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
Arm an EQ.
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t mq_page_cnt
uint32_t uint32_t uint32_t uint32_t eqe_count_mask
AUTO_XFER_RDY - Configure the auto-generate XFER-RDY feature.
int32_t sli_raise_ue(sli4_t *sli4, uint8_t dump)
Cause chip to enter an unrecoverable error state.
Buffer Descriptor Entry (BDE)
#define SLI4_MBOX_COMMAND_REQUEST_FEATURES
uint8_t ipl_file_name[16]
#define SLI4_OPC_COMMON_WRITE_OBJECT
uint32_t t10_dif_inline_capable
uint32_t chain_sge_initial_value_lo
#define SLI4_ASIC_GEN_SHIFT
#define SLI4_OPC_COMMON_NOP
#define SLI4_MBOX_COMMAND_UNREG_RPI
COMMON_SET_RECONFIG_LINK_ID.
#define SLI4_OPC_DMTF_EXEC_CLP_CMD
#define SLI4_MAX_IF_TYPES
static void sli_set_wq_id_association(void *entry, uint16_t q_id)
Format a WQE with WQ_ID Association performance hint.
uint32_t sgl_index_field_offset
sli4_mbox_command_header_t hdr
COMMON_SET_PROFILE_CONFIG.
uint32_t cmd_buf_addr_high
static int32_t sli_cmd_common_get_cntl_addl_attributes(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
Write a COMMON_GET_CNTL_ADDL_ATTRIBUTES command.
int32_t sli_get_queue_entry_size(sli4_t *sli4, uint32_t qtype)
Get queue entry size.
int32_t sli_cmd_reg_vpi(sli4_t *sli4, void *buf, size_t size, ocs_sli_port_t *sport, uint8_t update)
Write a REG_VPI command to the provided buffer.
#define SLI4_PHYDEV_CONTROL_FRST
COMMON_GET_SLI4_PARAMETERS.
static int32_t sli_cmd_common_get_port_name(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_GET_PORT_NAME command to the provided buffer.
sli4_mbox_command_header_t hdr
const uint8_t sli4_fw_initialize[]
FW_INITIALIZE - initialize a SLI port.
int32_t sli_eq_parse(sli4_t *sli4, uint8_t *buf, uint16_t *cq_id)
Parse an EQ entry to retrieve the CQ_ID for this event.
sli4_mbox_command_header_t hdr
uint32_t uint32_t block_size
#define SLI4_GET_SLI_CONFIG_OFFSET(buf, offset)
SLI_CONFIG - submit a configuration command to Port.
struct sli4_t::@47::@50 extent[SLI_RSRC_MAX]
COMMON_GET_RECONFIG_LINK_INFO.
Asynchronous Completion Queue Entry.
#define SLI4_UNREG_VPI_II_FCFI
#define SLI4_UNREG_RPI_II_VPI
uint32_t t10_dif_separate_capable
int32_t sli_cmd_common_get_resource_extent_info(sli4_t *sli4, void *buf, size_t size, uint16_t rtype)
Write a COMMON_GET_RESOURCE_EXTENT_INFO command.
POST_XRI - post XRI resources to the SLI Port.
#define SLI4_INIT_PORT_DELAY_US
uint32_t async_event_bitmap
sli4_mbox_command_header_t hdr
#define SLI4_READ_CFG_TOPO_FC_AL
static int32_t sli_cmd_common_query_fw_config(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_QUERY_FW_CONFIG command to the provided buffer.
uint32_t physical_address_high
COMMON_READ_TRANSCEIVER_DATA.
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t mqe_count_mask
struct sli4_queue_t::@44::@45 flag
#define SLI4_PORT_STATUS_READY(r)
sli4_mbox_command_header_t hdr
sli4_asic_type_e asic_type
#define SLI4_SW_UE_REG
Registers for generating software UE (Skyhawk)
int32_t sli_cmd_read_nvparms(sli4_t *sli4, void *buf, size_t size)
Write a READ_NVPARMS command to the provided buffer.
uint32_t uint32_t alt_mrq_filter_bit_mask_2
int32_t sli_dump_is_present(sli4_t *sli4)
Read the SLIPORT_STATUS register to check if a dump is present.
#define SLI4_SW_UE_CSR1
Registers for generating software UE (BE3)
#define SLI4_TRUNK_MODE_4_LINKS_PER_TRUNK
#define OCS_DEBUG_ENABLE_CQ_DUMP
static uint8_t sli_intf_valid_check(uint32_t val)
Check if the SLI_INTF register is valid.
#define SLI4_OPC_LOWLEVEL_SET_DIAG_LOG_OPTIONS
#define FW_DUMP_READY_STATUS_FDB_PRESENT
#define SLI4_PORT_STATUS_REG_236
SLIPORT_STATUS - SLI Port Status Register.
uint32_t uint32_t num_mrq_pairs_2
#define SLI4_UERR_STATUS_HIGH_REG
#define SLI4_COMMON_CREATE_CQ_V2_MAX_PAGES
int32_t sli_cmd_sli_config(sli4_t *sli4, void *buf, size_t size, uint32_t length, ocs_dma_t *dma)
Write a SLI_CONFIG command to the provided buffer.
#define SLI4_OPC_COMMON_DESTROY_CQ
COMMON_GET_PROFILE_CONFIG.
#define SLI4_PORT_STATUS_SPP
uint32_t uint32_t uint32_t uint32_t uint32_t cqv
static int32_t sli_queue_doorbell(sli4_t *, sli4_queue_t *)
Write the doorbell register associated with the queue object.
uint32_t resp_buf_addr_low
#define SLI4_UNREG_VPI_II_VFI
uint32_t delay_multiplier
REQUEST_FEATURES - request / query SLI features.
int32_t(* sli4_create_q_fn_t)(sli4_t *, void *, size_t, ocs_dma_t *, uint16_t, uint16_t)
Common Create Queue function prototype.
int32_t sli_cmd_fcoe_set_loopback_mode(sli4_t *sli4, void *buf, size_t size, int type)
Write a SLI4_OPC_FCOE_SET_LINK_DIAG_LOOPBACK command.
int32_t sli_cmd_common_get_profile_list(sli4_t *sli4, void *buf, size_t size, uint32_t start_profile_index, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_PROFILE_LIST command.
AUTO_XFER_RDY - Configure the Target Optimized Write Feature.
int32_t sli_cmd_common_read_object(sli4_t *sli4, void *buf, size_t size, uint32_t desired_read_length, uint32_t offset, char *object_name, ocs_dma_t *dma)
Write a COMMON_READ_OBJECT command.
#define SLI4_PORT_SEMAPHORE_REG_236
#define SLI4_MBOX_COMMAND_READ_TOPOLOGY
uint8_t bios_version_string[32]
uint32_t resp_buf_addr_high
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t mqv
sli4_mbox_command_header_t hdr
int32_t sli_fc_process_fcoe(sli4_t *sli4, void *acqe)
Process an asynchronous FCoE event entry.
sli4_bde_t host_buffer_descriptor[0]
#define SLI4_INIT_LINK_F_FCAL_ONLY
#define SLI4_BMBX_DELAY_US
struct sli4_cmd_reg_fcfi_mrq_t::@34 rq_cfg_2[4]
WRITE_NVPARMS - write SLI port configuration parameters.
#define SLI4_ULP_MODE_FCOE_INI
#define FC_LINK_SPEED_16G
int32_t sli_queue_arm(sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
Arm a queue.
uint32_t link_speed_selection_code
#define SLI4_OPC_COMMON_CREATE_EQ
int32_t sli_reset(sli4_t *sli4)
int32_t sli_cmd_dmtf_exec_clp_cmd(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *cmd, ocs_dma_t *resp)
Write a DMTF_EXEC_CLP_CMD command.
static int32_t sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t eq_id, uint16_t ignored)
Write a COMMON_CREATE_CQ command.
RELEASE_XRI - Release XRI resources from the SLI Port.
uint32_t uint32_t uint32_t uint32_t uint32_t cqe_count_method
#define FW_FUNC_DESC_DUMP
#define SLI4_BMBX_WRITE_LO(r)
int32_t sli_cq_alloc_set(sli4_t *sli4, sli4_queue_t *qs[], uint32_t num_cqs, uint32_t n_entries, sli4_queue_t *eqs[])
Allocate a c queue set.
struct sli4_cmd_reg_fcfi_mrq_t::@33 rq_cfg_1[4]
#define SLI4_PORT_STATUS_FDP_PRESENT(r)
COMMON_GET_RESOURCE_EXTENT_INFO.
uint32_t sgl_pre_registration_required
#define SLI4_PORT_SEMAPHORE_PORT(r)
static int32_t sli_fw_init(sli4_t *)
Initialize the firmware.
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t rqe_count_mask
#define SLI4_OPC_COMMON_RUN_BIU_DIAG
#define SLI4_MQE_SIZE_128
uint32_t uint32_t remote_n_port_id
sli4_mbox_command_header_t hdr
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t wq_page_cnt
#define SLI4_OPC_COMMON_SET_FEATURES
#define SLI4_OPC_COMMON_CREATE_CQ
#define SLI4_SUBSYSTEM_LOWLEVEL
int32_t sli_cmd_common_get_profile_config(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_PROFILE_CONFIG command.
COMMON_SET_LOOPBACK_MODE.
uint32_t delay_multiplier
#define SLI4_OPC_COMMON_READ_OBJECT
sli4_mbox_command_header_t hdr
COMMON_GET_ACTIVE_PROFILE.
#define SLI4_PORT_SEMAPHORE_IN_ERR(r)
#define FW_CHIP_LEVEL_DUMP
UNREG_FCFI - unregister a FCFI.
#define SLI4_RQ_DOORBELL(n, i)
#define SLI4_UNREG_VFI_II_FCFI
#define SLI4_SLIPORT_CONTROL_REG
SLIPORT_CONTROL - SLI Port Control Register.
static uint32_t sli_page_count(size_t bytes, uint32_t page_size)
static int32_t sli_bmbx_wait(sli4_t *sli4, uint32_t msec)
Wait for the bootstrap mailbox to report "ready".
#define SLI4_MBOX_COMMAND_READ_LNK_STAT
static sli4_asic_type_e sli_get_asic_type(sli4_t *sli4)
int32_t sli_cmd_config_auto_xfer_rdy_hp(sli4_t *sli4, void *buf, size_t size, uint32_t max_burst_len, uint32_t block_size)
Write an CONFIG_AUTO_XFER_RDY_HP command to the provided buffer.
#define SLI4_OPC_FC_SET_TRUNK_MODE
int32_t sli_reset_required(sli4_t *sli4)
Read the SLIPORT_STATUS register to check if the reset required is set.
#define SLI4_MAJOR_CODE_SENTINEL
uint32_t sli_reg_read(sli4_t *sli, sli4_regname_e reg)
Read the given SLI register.
uint32_t alt_mrq_filter_bit_mask_1
struct sli4_req_common_modify_eq_delay_t::@40 eq_delay_record[8]
int32_t sli_cmd_common_delete_object(sli4_t *sli4, void *buf, size_t size, char *object_name)
Write a COMMON_DELETE_OBJECT command.
#define SLI4_MBOX_COMMAND_POST_XRI
#define SLI4_INTF_REG
SLI_INTF - SLI Interface Definition Register.
#define SLI4_IF_TYPE_LANCER_G7
int32_t sli_fc_process_link_attention(sli4_t *sli4, void *acqe)
Process an asynchronous Link Attention event entry.
uint32_t actual_vpd_length
#define SLI4_PCI_CLASS_REVISION
READ_TOPOLOGY - read the link event information.
#define SLI4_ACQE_EVENT_CODE_SLI_PORT_EVENT
#define FC_LINK_SPEED_10G
uint32_t available_length
#define SLI4_OPC_COMMON_CREATE_CQ_SET
int32_t __sli_create_queue(sli4_t *sli4, sli4_queue_t *q)
Issue the command to create a queue.
uint32_t tx_phy_addr_high
#define SLI4_INTF_SLI_REVISION_SHIFT
uint32_t sge_supported_length
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t mqe_count_method
static bool ocs_bbcr_enabled(ocs_t *ocs)
int32_t sli_cmd_fcoe_wq_destroy(sli4_t *sli4, void *buf, size_t size, uint16_t wq_id)
Write an FCOE_WQ_DESTROY command.
void sli4_cmd_lowlevel_disable_ras(sli4_t *sli4, void *buf, size_t size)
Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command.
#define SLI4_PORT_STATUS_ERROR(r)
sli4_mbox_command_header_t hdr
int32_t __sli_queue_init(sli4_t *sli4, sli4_queue_t *q, uint32_t qtype, size_t size, uint32_t n_entries, uint32_t align)
Initialize a queue object.
int32_t sli_fw_reset(sli4_t *sli4)
Issue a Firmware Reset.
unfair select_hightest_al_pa
int32_t sli_cmd_reg_vfi(sli4_t *sli4, void *buf, size_t size, ocs_domain_t *domain)
Write a REG_VFI command to the provided buffer.
int32_t _sli_queue_poke(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
struct sli4_cmd_reg_fcfi_t::@32 rq_cfg[SLI4_CMD_REG_FCFI_NUM_RQ_CFG]
#define SLI4_CMD_REG_FCFI_SET_FCFI_MODE
int32_t sli_cmd_common_get_reconfig_link_info(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
Write a COMMON_GET_RECONFIG_LINK_INFO command.
uint32_t desired_read_length
#define SLI4_MBOX_COMMAND_READ_REV
#define SLI4_OPC_COMMON_CREATE_MQ_EXT
int32_t sli_cmd_unreg_vpi(sli4_t *sli4, void *buf, size_t size, uint16_t indicator, uint32_t which)
Write an UNREG_VPI command to the provided buffer.
sli4_mbox_command_header_t hdr
int32_t sli_cmd_common_set_active_profile(sli4_t *sli4, void *buf, size_t size, uint32_t fd, uint32_t active_profile_id)
Write a COMMON_COMMON_SET_ACTIVE_PROFILE command.
#define ocs_hal_assert(cond)
uint32_t mrq_filter_bitmask_1
int32_t sli_cmd_common_get_active_profile(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_COMMON_GET_ACTIVE_PROFILE command.
#define SLI4_IF_TYPE_BE3_SKH_PF
static int32_t sli_cmd_common_create_mq_ext(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
Write a COMMON_CREATE_MQ_EXT command.
sli4_mbox_command_header_t hdr
#define SLI4_IF_TYPE_LANCER_RDMA
#define SLI4_OPC_COMMON_GET_SLI4_PARAMETERS
#define SLI4_UERR_STATUS_LOW_REG
User error registers.
int32_t sli_cmd_release_xri(sli4_t *sli4, void *buf, size_t size, uint8_t num_xri)
Write a RELEASE_XRI command to the provided buffer.
#define SLI4_EQCQ_DOORBELL_REG
EQCQ_DOORBELL - EQ and CQ Doorbell Register.
#define SLI4_PORT_SEMAPHORE_STATUS_POST_READY
static int32_t sli_res_sli_config(void *buf)
Check the SLI_CONFIG response.
int32_t sli_cmd_read_config(sli4_t *sli4, void *buf, size_t size)
Write a READ_CONFIG command to the provided buffer.
uint32_t chain_sge_initial_value_lo
#define SLI4_ASIC_GEN_MASK
#define SLI4_PORT_STATUS_DUMP_PRESENT(r)
uint32_t destination_n_port_id
sli4_mbox_command_header_t hdr
int32_t sli_is_paused(sli4_t *sli4)
COMMON_GET_CNTL_ATTRIBUTES.
int ocs_debug_is_enabled(uint32_t mask)
return true if debug bits are enabled
uint32_t uint32_t uint32_t rq_id_5
#define SLI4_SUBSYSTEM_DMTF
#define SLI4_OPC_COMMON_SET_PROFILE_CONFIG
#define SLI4_PORT_SEMAPHORE_REG_1
int32_t sli_queue_alloc(sli4_t *sli4, uint32_t qtype, sli4_queue_t *q, uint32_t n_entries, sli4_queue_t *assoc, uint16_t ulp)
Allocate a queue.
#define SLI4_ACQE_EVENT_CODE_FCOE_FIP
sli4_mbox_command_header_t hdr
#define SLI4_SUBSYSTEM_FCFCOE
uint32_t uint32_t uint32_t max_rq_buffer_size
uint32_t sli4_cmd_init_link_flags_t link_flags
static int32_t sli_cmd_common_destroy_cq(sli4_t *sli4, void *buf, size_t size, uint16_t cq_id)
Write a COMMON_DESTROY_CQ command.
static int32_t sli_wait_for_fw_ready(sli4_t *sli4, uint32_t timeout_ms)
check to see if the FW is ready.
UNREG_VPI - unregister one or more VPI.
int32_t sli_bmbx_command(sli4_t *sli4)
Submit a command to the bootstrap mailbox and check the status.
static uint8_t sli_intf_if_type(uint32_t val)
Retrieve the SLI interface type.
struct sli4_req_common_create_eq_t::@41 page_address[8]
uint32_t start_profile_index
int32_t sli_fc_process_link_state(sli4_t *sli4, void *acqe)
Process an asynchronous Link State event entry.
int32_t sli_cmd_unreg_vfi(sli4_t *sli4, void *buf, size_t size, ocs_domain_t *domain, uint32_t which)
Write an UNREG_VFI command to the provided buffer.
#define SLI4_MBOX_COMMAND_REG_RPI
#define SLI4_OPC_COMMON_GET_CNTL_ATTRIBUTES
#define SLI4_MBOX_COMMAND_INIT_LINK
int32_t sli_cmd_dump_type4(sli4_t *sli4, void *buf, size_t size, uint16_t wki)
Write a DUMP Type 4 command to the provided buffer.
static int32_t sli_cmd_common_destroy_mq(sli4_t *sli4, void *buf, size_t size, uint16_t mq_id)
Write a COMMON_DESTROY_MQ command.
struct sli4_queue_t::@44::@46 dpp
int32_t sli_cmd_init_vpi(sli4_t *sli4, void *buf, size_t size, uint16_t vpi, uint16_t vfi)
Write an INIT_VPI command to the provided buffer.
int32_t sli_callback(sli4_t *sli4, sli4_callback_e which, void *func, void *arg)
Register a callback for the given event.
static int32_t sli_cmd_fw_deinitialize(sli4_t *, void *, size_t)
Write a FW_DEINITIALIZE command to the provided buffer.
#define OCS_TOW_FEATURE_AXR
static int32_t sli_fw_term(sli4_t *)
Terminate the firmware.
static int32_t sli_cmd_read_rev(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *vpd)
Write a READ_REV command to the provided buffer.
#define SLI4_OPC_COMMON_GET_PORT_NAME
uint8_t embed[58 *sizeof(uint32_t)]
uint32_t sgl_index_field_size
static int32_t sli_sliport_control(sli4_t *sli4, uint32_t endian)
Initialize SLI Port control register.
READ_CONFIG - read SLI port configuration parameters.
void sli4_cmd_lowlevel_enable_ras(sli4_t *sli4, void *buf, size_t size, int log_level, uint32_t unit_size, int32_t buf_count, uint32_t *phys_addr, uintptr_t lwpd_phys_addr)
Write a LOWLEVEL_SET_DIAG_LOG_OPTIONS command.
static int32_t sli_cmd_common_destroy_eq(sli4_t *sli4, void *buf, size_t size, uint16_t eq_id)
Write a COMMON_DESTROY_EQ command.
int32_t sli_cmd_common_set_profile_config(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma, uint8_t profile_id, uint32_t descriptor_count, uint8_t isap)
Write a COMMON_COMMON_SET_PROFILE_CONFIG command.
REG_VFI - register a Virtual Fabric Indicator.
int32_t sli_cmd_common_get_sli4_parameters(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_GET_SLI4_PARAMETERS command.
#define SLI4_MBOX_COMMAND_CONFIG_LINK
uint16_t max_qcount[SLI_QTYPE_MAX]
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t rq_page_cnt
REG_VPI - register a Virtual Port Indicator.
int32_t sli_cmd_config_run_biu_diag(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *tx_buffer, size_t tx_buf_len, ocs_dma_t *rx_buffer, size_t rx_buf_len)
Write a RUN_BIU_DIAG command.
static uint32_t sli_get_if_type(sli4_t *sli4)
int32_t sli_cmd_init_vfi(sli4_t *sli4, void *buf, size_t size, uint16_t vfi, uint16_t fcfi, uint16_t vpi)
Write an INIT_VFI command to the provided buffer.
uint64_t sgl_index_field_mask
struct sli4_req_common_create_cq_v0_t::@37 page_physical_address[0]
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t wqe_count_mask
sli4_mbox_command_header_t hdr
#define SLI4_MBOX_COMMAND_UNREG_FCFI
#define SLI4_BDE_TYPE_BDE_64
#define SLI4_UERR_MASK_LOW_REG
uint32_t perf_wq_id_association
struct sli4_req_common_create_cq_v2_t::@38 page_physical_address[0]
uint16_t frag_num_field_offset
int32_t sli_cmd_unreg_fcfi(sli4_t *sli4, void *buf, size_t size, uint16_t indicator)
Write a UNREG_FCFI command to the provided buffer.
int32_t sli_cmd_config_link(sli4_t *sli4, void *buf, size_t size)
Write a CONFIG_LINK command to the provided buffer.
#define SLI4_INTF_SLI_REVISION_MASK
#define SLI4_MAJOR_CODE_STANDARD
sli4_mbox_command_header_t hdr
uint64_t frag_num_field_mask
Generic Command Request header.
#define FW_DUMP_READY_STATUS_NOT_READY
struct sli4_req_common_create_mq_ext_t::@42 page_physical_address[8]
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t rqe_count_method
uint32_t qpage_count[SLI_QTYPE_MAX]
sli4_mbox_command_header_t hdr
sli4_mbox_command_header_t hdr
Generic Command Response header.
COMMON_SET_ACTIVE_PROFILE.
#define SLI4_PORT_STATUS_RN
#define SLI4_REG_RPI_BUF_LEN
#define SLI4_OPC_FCOE_SET_LINK_DIAG_LOOPBACK
#define SLI4_INTF_VALID_SHIFT
const uint8_t sli4_fw_deinitialize[]
FW_DEINITIALIZE - deinitialize a SLI port.
uint32_t uint32_t dpp_offset
int32_t(* fip)(void *, void *)
uint32_t ulp0_toe_wq_total
struct sli4_req_common_create_cq_set_v0_t::@39 page_physical_address[0]
uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t uint32_t wqe_count_method
uint32_t active_profile_id
uint32_t second_hw_revision
READ_REV - read the Port revision levels.
#define SLI4_IF6_WQ_DOORBELL_REG
#define SLI4_BMBX_MASK_LO
uint32_t selective_reset_al_pa
int32_t sli_cmd_read_topology(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *dma)
Write a READ_TOPOLOGY command to the provided buffer.
#define OCS_DEBUG_ENABLE_EQ_DUMP
#define SLI4_INIT_LINK_F_P2P_FAIL_OVER
int32_t sli_queue_index(sli4_t *sli4, sli4_queue_t *q)
int32_t _sli_queue_write(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Write an entry to the queue object.
#define SLI4_PORT_STATUS_DIP
int32_t sli_init(sli4_t *sli4)
#define SLI4_SLIPORT_CONTROL_LITTLE_ENDIAN
#define SLI4_OPC_COMMON_DELETE_OBJECT
#define SLI4_OPC_LOWLEVEL_SET_WATCHDOG
#define SLI4_MBOX_COMMAND_CONFIG_TOW_HP
int32_t sli_cmd_reg_rpi(sli4_t *sli4, void *buf, size_t size, uint32_t nport_id, uint16_t rpi, uint16_t vpi, ocs_dma_t *dma, uint8_t update, uint8_t enable_t10_pi, uint8_t hlm)
Write a REG_RPI command to the provided buffer.
#define SLI4_128BYTE_WQE_SUPPORT
#define SLI4_MBOX_COMMAND_READ_CONFIG
#define SLI4_WQ_DOORBELL(n, x, i)
static uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
struct sli4_t::@49 pause_errx_pair[SLI4_PAUSE_ERRX_PAIR_CNT]
union sli4_queue_t::@44 u
static uint32_t sli_get_auto_xfer_rdy_capable(sli4_t *sli4)
uint32_t common_service_parameters[4]
sli4_mbox_command_header_t hdr
#define SLI4_OPC_COMMON_READ_TRANSCEIVER_DATA
#define SLI4_IF_TYPE_LANCER_FC_ETH
int32_t(* sli4_destroy_q_fn_t)(sli4_t *, void *, size_t, uint16_t)
Common Destroy Queue function prototype.
int32_t sli_cmd_fcoe_wq_create(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp)
Write an FCOE_WQ_CREATE command.
#define OCS_DEBUG_ENABLE_WQ_DUMP
#define SLI4_SLIPORT_CONTROL_IP
#define SLI4_IF6_CQ_DOORBELL_REG
const sli4_reg_t regmap[SLI4_REG_MAX][SLI4_MAX_IF_TYPES]
Define the mapping of registers to their BAR and offset.
uint32_t host_buffer_descriptor_count
unfair gen_loop_validity_check