50 #if defined(OCS_INCLUDE_DEBUG)
63 0xff, 0x12, 0x34, 0xff,
64 0xff, 0x56, 0x78, 0xff,
68 0xff, 0xaa, 0xbb, 0xff,
69 0xff, 0xcc, 0xdd, 0xff,
146 { -1, -1 }, { -1, -1 }, { -1, -1 }, { -1, -1 },
173 { -1, -1 }, { -1, -1 },
178 { -1, -1 }, { -1, -1 },
183 { -1, -1 }, { -1, -1 },
188 { -1, -1 }, { -1, -1 },
215 if ((UINT32_MAX == r->
rset) || (UINT32_MAX == r->
off)) {
216 ocs_log_err(sli->
os,
"regname %d not defined for if_type %d\n", reg, sli->
if_type);
220 return ocs_reg_read32(sli->
os, r->
rset, r->
off);
239 if ((UINT32_MAX == r->
rset) || (UINT32_MAX == r->
off)) {
240 ocs_log_err(NULL,
"regname %d not defined for if_type %d\n", reg, sli->
if_type);
244 ocs_reg_write32(sli->
os, r->
rset, r->
off, val);
321 return (rev << 4) | spin;
351 ocs_delay_usec(1000);
356 return(!(val & SLI4_BMBX_RDY));
381 ocs_dma_sync(&sli4->
bmbx, OCS_DMASYNC_PREWRITE);
386 ocs_log_crit(NULL,
"BMBX WRITE_HI failed\n");
413 #if defined(OCS_INCLUDE_DEBUG)
429 (hdr->
embedded ?
"Embedded Mailbox Command" :
430 "non-Embedded Mailbox Command"),
436 ocs_log_crit(NULL,
"bootstrap mailbox write fail phys=%#lx reg=%#x\n",
443 ocs_dma_sync(&sli4->
bmbx, OCS_DMASYNC_POSTREAD);
447 ocs_log_test(NULL,
"invalid or wrong type\n");
469 ocs_memset(buf, 0, size);
488 ocs_memset(buf, 0, size);
512 uint32_t sgl_offset = 0;
514 ocs_memset(buf, 0, size);
518 ocs_log_test(NULL,
"length(%d) > payload(%ld)\n",
532 sgl[0] = ocs_addr32_lo(dma->phys);
533 sgl[1] = ocs_addr32_hi(dma->phys);
538 mqe_hdr->
tag[0] = tag & 0xFFFFFFFF;
539 mqe_hdr->
tag[1] = tag >> 32;
554 for (iter = 0; iter < 1000; iter ++) {
555 ocs_delay_usec(1000);
558 ocs_log_crit(NULL,
"initialize port failed\n");
580 uint32_t cmd_off = 0;
581 uint32_t payload_size;
611 uint32_t cmd_off = 0;
612 uint32_t payload_size;
643 uint32_t cmd_off = 0;
644 uint32_t payload_size;
675 uint32_t cmd_off = 0;
676 uint32_t payload_size;
686 ocs_memset(get_cntl, 0, payload_size);
709 uint32_t cmd_off = 0;
710 uint32_t payload_size;
720 ocs_memset(get_cntl_addl, 0, payload_size);
744 uint32_t cmd_off = 0;
745 uint32_t payload_size;
779 ocs_dma_t *qmem, uint16_t eq_id, uint16_t ignored)
783 uint32_t cmd_off = 0;
786 uint32_t if_type = sli4->
if_type;
787 uint32_t payload_size;
824 ocs_log_err(NULL,
"num_pages %d not valid\n", cqv0->
num_pages);
850 ocs_log_err(NULL,
"num_pages %d not valid\n", cqv2->
num_pages);
867 for (p = 0, addr = qmem->phys;
895 uint32_t cmd_off = 0;
935 ocs_dma_t *qmem, uint16_t ignored1, uint16_t ignored2)
938 uint32_t cmd_off = 0;
941 uint32_t payload_size;
972 ocs_log_err(NULL,
"num_pages %d not valid\n", eq->
num_pages);
979 for (p = 0, addr = qmem->phys;
1004 uint32_t delay_mult)
1007 uint32_t cmd_off = 0;
1022 modify_delay->
num_eq = num_q;
1024 for (i = 0; i<num_q; i++) {
1051 uint32_t cmd_off = 0;
1086 ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
1089 uint32_t cmd_off = 0;
1092 uint32_t payload_size;
1123 ocs_log_err(NULL,
"num_pages %d not valid\n", mq->
num_pages);
1133 for (p = 0, addr = qmem->phys;
1135 p++, addr += 4096) {
1161 uint32_t cmd_off = 0;
1197 uint16_t wq_id, uint8_t graceful)
1200 uint32_t cmd_off = 0;
1239 uint32_t cmd_off = 0;
1252 ocs_memcpy(&nop->
context, &context,
sizeof(context));
1273 uint64_t tag, uint32_t page_num,
1274 uint32_t port, ocs_dma_t *dma)
1277 uint32_t cmd_off = 0;
1285 pl_size = dma->size;
1325 uint32_t cmd_off = 0;
1326 uint32_t payload_size;
1365 uint32_t cmd_off = 0;
1366 uint32_t payload_size;
1377 ((uint8_t *)buf + cmd_off);
1419 uint32_t cmd_off = 0;
1420 uint32_t payload_size;
1431 ((uint8_t*)buf + cmd_off);
1457 uint32_t cmd_off = 0;
1458 uint32_t payload_size;
1464 payload_size = dma->size;
1474 ocs_memset(dma->virt, 0, dma->size);
1505 uint8_t profile_id, uint32_t descriptor_count, uint8_t isap)
1508 uint32_t cmd_off = 0;
1509 uint32_t payload_size;
1515 payload_size = dma->size;
1525 ocs_memset(dma->virt, 0, dma->size);
1556 uint32_t start_profile_index, ocs_dma_t *dma)
1559 uint32_t cmd_off = 0;
1560 uint32_t payload_size;
1566 payload_size = dma->size;
1576 ocs_memset(dma->virt, 0, dma->size);
1606 uint32_t cmd_off = 0;
1607 uint32_t payload_size;
1618 ((uint8_t*)buf + cmd_off);
1643 uint32_t fd, uint32_t active_profile_id)
1646 uint32_t cmd_off = 0;
1647 uint32_t payload_size;
1658 ((uint8_t*)buf + cmd_off);
1686 uint32_t cmd_off = 0;
1687 uint32_t payload_size;
1690 payload_size = dma->size;
1701 ocs_memset(req, 0, dma->size);
1730 ocs_dma_t *dma, uint32_t fd,
1731 uint32_t active_link_config_id)
1734 uint32_t cmd_off = 0;
1735 uint32_t payload_size;
1738 payload_size = dma->size;
1749 ocs_memset(req, 0, dma->size);
1784 uint32_t cmd_off = 0;
1785 uint32_t payload_size;
1805 ocs_memcpy(cmd->
params, parameter, param_len);
1831 ocs_log_debug(NULL,
"command not finished (cmpl=%#x ext=%#x con=%d cmp=%d ae=%d val=%d)\n",
1844 ocs_log_test(NULL,
"bad status (cmpl=%#x ext=%#x con=%d cmp=%d ae=%d val=%d)\n",
1871 if (!sli4 || !buf) {
1872 ocs_log_err(NULL,
"bad parameter sli4=%p buf=%p\n", sli4, buf);
1881 ocs_log_debug(NULL,
"ACQE FCOE FIP\n");
1887 ocs_log_debug(NULL,
"ACQE GRP5\n");
1890 ocs_log_test(NULL,
"ACQE unknown=%#x\n", acqe->
event_code);
1910 ocs_log_crit(NULL,
"bootstrap mailbox write fail (COMMON_FUNCTION_RESET)\n");
1916 ocs_log_crit(NULL,
"bad status COMMON_FUNCTION_RESET\n");
1920 ocs_log_crit(NULL,
"bad COMMON_FUNCTION_RESET write\n");
1941 ocs_log_crit(NULL,
"bootstrap mailbox write fail (CFG_REMOVE_SGL_PAGES)\n");
1947 ocs_log_err(NULL,
"bad status CFG_REMOVE_SGL_PAGES\n");
1951 ocs_log_err(NULL,
"bad CFG_REMOVE_SGL_PAGES write\n");
1973 uint32_t iter = 1000;
1980 ocs_delay_usec(1000);
1995 ocs_delay_usec(1000);
2002 ocs_log_crit(NULL,
"FW status is NOT ready\n");
2015 ocs_log_crit(NULL,
"bootstrap mailbox not ready\n");
2021 ocs_log_crit(NULL,
"bootstrap mailbox write fail (FW_INIT)\n");
2025 ocs_log_crit(NULL,
"bad FW_INIT write\n");
2030 ocs_log_err(NULL,
"bad COM_FUNC_RESET write\n");
2041 ocs_log_err(NULL,
"if_type %d not supported\n", sli4->
if_type);
2062 ocs_log_crit(NULL,
"bootstrap mailbox not ready\n");
2067 ocs_log_err(NULL,
"Failed to remove SGL pages\n");
2071 ocs_log_err(NULL,
"bad COM_FUNC_RESET write\n");
2077 ocs_log_crit(NULL,
"bootstrap mailbox write fail (FW_DEINIT)\n");
2081 ocs_log_err(NULL,
"bad FW_DEINIT write\n");
2134 if (q->
u.
flag.rq_batch) {
2152 ocs_log_err(sli4->
os,
"bad queue type %d\n", q->
type);
2175 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_CONFIG)\n");
2179 ocs_log_err(sli4->
os,
"COMMON_GET_FW_VERSION bad status %#x\n",
2184 ocs_log_debug(sli4->
os,
"FW_VERSION running FW %s\n",
2186 ocs_log_debug(sli4->
os,
"FW_VERSION flash FW %s\n",
2189 ocs_log_err(sli4->
os,
"bad GET_FW_VERSION write\n");
2205 ocs_dma_t page_buffer;
2207 ocs_log_debug(sli4->
os,
"Getting transceiver data for port %d\n", port);
2219 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_TRANSCEIVER_DATA)\n");
2220 goto free_and_return_failure;
2223 ocs_log_err(sli4->
os,
"COMMON_READ_TRANSCEIVER_DATA bad status %#x/%#x\n",
2225 goto free_and_return_failure;
2228 memcpy(sli4->
sfp_a0, page_buffer.virt,
sizeof(sli4->
sfp_a0));
2230 ocs_log_err(sli4->
os,
"bad READ_TRANSCEIVER_DATA write\n");
2231 goto free_and_return_failure;
2240 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_TRANSCEIVER_DATA)\n");
2241 goto free_and_return_failure;
2244 ocs_log_err(sli4->
os,
"COMMON_READ_TRANSCEIVER_DATA bad status %#x/%#x\n",
2246 goto free_and_return_failure;
2249 memcpy(sli4->
sfp_a2, page_buffer.virt,
sizeof(sli4->
sfp_a2));
2251 ocs_log_err(sli4->
os,
"bad READ_TRANSCEIVER_DATA write\n");
2252 goto free_and_return_failure;
2255 ocs_dma_free(sli4->
os, &page_buffer);
2258 free_and_return_failure:
2259 ocs_dma_free(sli4->
os, &page_buffer);
2285 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_CONFIG)\n");
2289 ocs_log_err(sli4->
os,
"COMMON_QUERY_FW_CONFIG bad status %#x\n",
2342 ocs_log_err(sli4->
os,
"bad READ_CONFIG write\n");
2374 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (GET_FUNCTION_CONFIG)\n");
2378 ocs_log_err(sli4->
os,
"GET_FUNCTION_CONFIG bad status %#x\n",
2391 for (indx = 0; indx < desc_cnt; indx++) {
2392 desc_len = (dword[0] >> 8) & 0xff;
2393 desc_type = dword[0] & 0xff;
2394 desc_pf = (dword[1] >> 16) & 0xff;
2395 if (desc_type == 0x52 &&
2396 desc_pf == sli4->
pf_num) {
2398 sli4->
mac_addr[0] = (dword[3] >> 16) & 0xff;
2399 sli4->
mac_addr[1] = (dword[3] >> 24) & 0xff;
2400 sli4->
mac_addr[2] = dword[4] & 0xff;
2401 sli4->
mac_addr[3] = (dword[4] >> 8) & 0xff;
2402 sli4->
mac_addr[4] = (dword[4] >> 16) & 0xff;
2403 sli4->
mac_addr[5] = (dword[4] >> 24) & 0xff;
2405 ocs_log_debug(sli4->
os,
"EEPROM MAC Addr %02x:%02x:%02x:%02x:%02x:%02x\n",
2414 dword += desc_len / 4;
2417 ocs_log_err(sli4->
os,
"bad GET_FUNCTION_CONFIG write\n");
2424 uint32_t *dword = sli4->
vpd.
data.virt;
2427 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (GET_BE_CONFIG)\n");
2431 ocs_log_err(sli4->
os,
"GET_BE_CONFIG bad status %#x\n",
2442 desc_cnt = dword[4];
2443 for (indx = 0; indx < desc_cnt; indx++) {
2444 if (dword[5 + (17 * indx)] == 0x2 &&
2445 (dword[6 + (17 * indx)] & 0xff) == sli4->
pf_num) {
2447 sli4->
mac_addr[0] = (dword[9 + (17 * indx)] >> 16) & 0xff;
2448 sli4->
mac_addr[1] = (dword[9 + (17 * indx)] >> 24) & 0xff;
2449 sli4->
mac_addr[2] = dword[10 + (17 * indx)] & 0xff;
2450 sli4->
mac_addr[3] = (dword[10 + (17 * indx)] >> 8) & 0xff;
2451 sli4->
mac_addr[4] = (dword[10 + (17 * indx)] >> 16) & 0xff;
2452 sli4->
mac_addr[5] = (dword[10 + (17 * indx)] >> 24) & 0xff;
2454 ocs_log_debug(sli4->
os,
"EEPROM MAC Addr %02x:%02x:%02x:%02x:%02x:%02x\n",
2466 ocs_log_err(sli4->
os,
"bad GET_BE_CONFIG write\n");
2494 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (GET_ALL_IF_ID)\n");
2498 ocs_log_err(sli4->
os,
"GET_ALL_IF_ID bad status %#x\n",
2505 ocs_log_debug(sli4->
os,
"Default interface handle %d\n", sli4->
iface_default);
2508 ocs_log_err(sli4->
os,
"bad GET_IF_ID call\n");
2533 uint32_t sli_intf = UINT32_MAX;
2534 uint32_t sli_asic_id;
2537 uint32_t pci_class_rev = 0;
2538 uint32_t rev_id = 0;
2539 uint32_t family = 0;
2543 ocs_memset(sli4, 0,
sizeof(
sli4_t));
2556 ocs_log_err(os,
"SLI_INTF is not valid\n");
2563 ocs_log_err(os,
"Unsupported SLI revision (intf=%#x)\n",
2577 if (family == 0xf) {
2582 for (i = 0, asic = sli4_asic_table; i < ARRAY_SIZE(sli4_asic_table); i++, asic++) {
2583 if ((rev_id == asic->
rev_id) && (family == asic->
family)) {
2590 ocs_log_err(os,
"no matching asic type/rev found\n");
2595 ocs_log_debug(sli4->
os,
"SLI if_type = 0x%x, Family 0x%x\n",
2605 ocs_log_debug(sli4->
os,
"SLI ASIC revision = 0x%x, generation 0x%x\n",
2606 revision, generation);
2609 ocs_log_debug(os,
"Using BE3 message handlers\n");
2611 ocs_log_debug(os,
"Using Skyhawk message handlers\n");
2617 ocs_log_err(os,
"Unhandled generation (asic_id=%#x)\n",
2622 ocs_log_debug(os,
"Using Skyhawk message handlers\n");
2628 ocs_log_debug(os,
"Using BE3 message handlers\n");
2643 ocs_log_err(os,
"bootstrap mailbox allocation failed\n");
2648 ocs_log_err(os,
"bad alignment for bootstrap mailbox\n");
2652 ocs_log_debug(os,
"bmbx v=%p p=%#lx s=%zd\n", sli4->
bmbx.virt, sli4->
bmbx.phys,
2656 if (ocs_dma_alloc(sli4->
os, &sli4->
vpd.
data, 4096, 4096)) {
2659 ocs_log_test(os,
"VPD buffer allocation failed\n");
2665 ocs_log_test(os,
"CNTL Attribute buffer allocation failed\n");
2669 ocs_log_err(sli4->
os,
"FW initialization failed\n");
2675 ocs_log_err(sli4->
os,
"get FW version failed\n");
2681 ocs_log_err(sli4->
os,
"get SLI4 parameters failed\n");
2687 ocs_log_err(sli4->
os,
"FW config failed\n");
2693 ocs_log_test(sli4->
os,
"Read transceiver data failed\n");
2699 ocs_log_err(sli4->
os,
"Get IF Ids/Info failed\n");
2708 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (COMMON_GET_CNTL_ATTRIBUTES)\n");
2713 ocs_log_err(sli4->
os,
"COMMON_GET_CNTL_ATTRIBUTES bad status %#x\n",
2730 ocs_log_debug(sli4->
os,
"FW1:%s (pf_num %d) \n",
2734 ocs_log_debug(sli4->
os,
"HW1: Device id %08x, rev %08x\n",
2738 ocs_log_err(sli4->
os,
"bad COMMON_GET_CNTL_ATTRIBUTES write\n");
2747 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (COMMON_GET_CNTL_ADDL_ATTRIBUTES)\n");
2752 ocs_log_err(sli4->
os,
"COMMON_GET_CNTL_ADDL_ATTRIBUTES bad status %#x\n",
2760 ocs_log_debug(sli4->
os,
"IPL:%s (pf_num %d) \n",
2765 ocs_log_err(sli4->
os,
"bad COMMON_GET_CNTL_ADDL_ATTRIBUTES write\n");
2772 ocs_log_test(sli4->
os,
"Failed to read EEPROM MAC address\n");
2780 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (READ_NVPARMS)\n");
2785 ocs_log_err(sli4->
os,
"COMMON_GET_VPD bad status %#x\n",
2794 ocs_log_err(sli4->
os,
"bad COMMON_GET_VPD_DATA call\n");
2812 ocs_log_crit(sli4->
os,
"FW initialization failed\n");
2825 uint32_t iter = 3000;
2826 uint32_t not_ready = TRUE;
2835 ocs_delay_usec(10000);
2841 }
while (not_ready && (iter > 0));
2846 ocs_log_crit(sli4->
os,
"Failed to become ready after firmware reset\n");
2870 ocs_log_crit(sli4->
os,
"FW deinitialization failed\n");
2876 ocs_memset(&sli4->
sgl_pages[i], 0,
sizeof(ocs_dma_t));
2881 ocs_dma_free(sli4->
os, &sli4->
vpd.
data);
2882 ocs_memset(&sli4->
vpd.
data, 0,
sizeof(ocs_dma_t));
2885 ocs_memset(&sli4->
cntl_attr, 0,
sizeof(ocs_dma_t));
2887 ocs_dma_free(sli4->
os, &sli4->
bmbx);
2888 ocs_memset(&sli4->
bmbx, 0,
sizeof(ocs_dma_t));
2909 ocs_log_err(NULL,
"bad parameter sli4=%p which=%#x func=%p\n",
2924 ocs_log_test(sli4->
os,
"unknown callback %#x\n", which);
2954 size_t size, uint32_t n_entries, uint32_t align)
2957 if ((size != q->
size) || (n_entries != q->
length)) {
2959 ocs_dma_free(sli4->
os, &q->
dma);
2960 ocs_memset(&q->
dma, 0,
sizeof(ocs_dma_t));
2965 if (ocs_dma_alloc(sli4->
os, &q->
dma, size * n_entries, align)) {
2966 ocs_log_err(sli4->
os,
"%s allocation failed\n",
SLI_QNAME[qtype]);
2970 ocs_memset(q->
dma.virt, 0, size * n_entries);
3012 char queue_name[3] =
"XX";
3015 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail %s\n",
3017 ocs_dma_free(sli4->
os, &q->
dma);
3018 ocs_memset(&q->
dma, 0,
sizeof(ocs_dma_t));
3024 ocs_log_err(sli4->
os,
"bad create %s status=%#x addl=%#x\n",
3027 ocs_dma_free(sli4->
os, &q->
dma);
3028 ocs_memset(&q->
dma, 0,
sizeof(ocs_dma_t));
3037 ocs_memcpy(queue_name,
"EQ", 3);
3044 ocs_memcpy(queue_name,
"CQ", 3);
3051 ocs_memcpy(queue_name,
"MQ", 3);
3058 ocs_memcpy(queue_name,
"RQ", 3);
3067 ocs_memcpy(queue_name,
"WQ", 3);
3079 snprintf(q->
name,
sizeof(q->
name),
"%s-%d", queue_name, q->
id);
3105 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail (MODIFY EQ DELAY)\n");
3111 ocs_log_test(NULL,
"bad status MODIFY EQ DELAY\n");
3140 uint32_t version = 0;
3144 ocs_log_err(NULL,
"bad parameter sli4=%p q=%p\n", sli4, q);
3150 size =
sizeof(uint32_t);
3161 switch (n_entries) {
3168 ocs_log_err(sli4->
os,
"illegal n_entries value %d for MQ\n", n_entries);
3171 assoc->
u.
flag.is_mq = TRUE;
3182 ocs_log_err(sli4->
os,
"unknown queue type %d\n", qtype);
3187 ocs_log_err(sli4->
os,
"%s allocation failed\n",
SLI_QNAME[qtype]);
3192 assoc ? assoc->
id : 0, ulp)) {
3194 ocs_log_err(sli4->
os,
"create %s failed\n",
SLI_QNAME[qtype]);
3199 ocs_log_err(sli4->
os,
"cannot create %s\n",
SLI_QNAME[qtype]);
3224 ocs_log_err(NULL,
"bad parameter sli4=%p q=%p\n", sli4, q);
3245 ocs_log_test(sli4->
os,
"bad queue type %d\n",
3256 ocs_log_crit(sli4->
os,
"bootstrap mailbox write fail destroy %s\n",
3262 ocs_log_test(sli4->
os,
"bad destroy %s status=%#x addl=%#x\n",
3272 ocs_lock_free(&q->
lock);
3274 if (ocs_dma_free(sli4->
os, &q->
dma)) {
3275 ocs_log_test(sli4->
os,
"%s queue ID %d free failed\n",
SLI_QNAME[q->
type], q->
id);
3278 ocs_memset(&q->
dma, 0,
sizeof(ocs_dma_t));
3307 ocs_memset(q->
dma.virt, 0, (q->
size * (uint64_t)q->
length));
3309 ocs_unlock(&q->
lock);
3330 uint8_t *qe = q->
dma.virt;
3334 ocs_dma_sync(&q->
dma, OCS_DMASYNC_POSTREAD);
3340 ocs_unlock(&q->
lock);
3374 ocs_log_test(sli4->
os,
"should only be used for EQ/CQ, not %s\n",
3378 ocs_unlock(&q->
lock);
3400 uint8_t *qe = q->
dma.virt;
3402 #if defined(OCS_INCLUDE_DEBUG)
3410 #if defined(OCS_INCLUDE_DEBUG)
3413 snprintf(desc,
sizeof(desc),
"%s entry %d", q->
name, q->
index);
3421 snprintf(desc,
sizeof(desc),
"mqe outbound entry %d", q->
index);
3434 ocs_memcpy(qe, entry, q->
size);
3438 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
3448 }
else if (rc > 0) {
3474 ocs_unlock(&q->
lock);
3496 if (wqe_index < q->length) {
3497 ctx = &q->
u.
wq.wqe_context[wqe_index];
3499 if (ctx->
io != NULL) {
3506 q->
u.
wq.wqe_free_cnt++;
3508 ocs_log_test(sli4->
os,
"WQE index %d is out of range\n", wqe_index);
3510 ocs_unlock(&q->
lock);
3538 uint8_t tcp_ack_status;
3539 uint32_t cmpl_cnt = 0;
3543 while (ctx != NULL) {
3558 q->
u.
wq.wqe_free_cnt++;
3562 void *arg = io->
arg;
3566 ocs_unlock(&q->
lock);
3575 ocs_log_test(sli4->
os,
"IO at index %d for WQ id %d was not found\n",
3580 if (wrb_index == wqe_index) {
3586 ocs_unlock(&q->
lock);
3589 return (cmpl_cnt > 0);
3614 while (ctx != NULL) {
3617 io->
icd == icd_index) {
3623 ocs_unlock(&q->
lock);
3626 ocs_log_test(sli4->
os,
"ICD index %d is not on the WQ %d busy list\n",
3652 uint8_t *wait_for_tcp_ack,
3653 uint8_t tcp_ack_status)
3661 *wait_for_tcp_ack = FALSE;
3664 while (ctx != NULL) {
3667 io->
icd == icd_index) {
3677 q->
u.
wq.wqe_free_cnt++;
3683 ocs_unlock(&q->
lock);
3686 ocs_log_test(sli4->
os,
"ICD index %d is not on the WQ %d busy list\n",
3704 return q->
u.
wq.wqe_free_cnt;
3727 while (ctx != NULL) {
3734 q->
u.
wq.wqe_free_cnt++;
3738 void *arg = io->
arg;
3743 ocs_unlock(&q->
lock);
3744 ocs_log_test(sli4->
os,
"IO HAL type 0x%x with ICD 0x%x active on freed connection at wrb_index %d\n",
3745 io->
type, io->
icd, wrb_index);
3755 ocs_log_test(sli4->
os,
"IO at index %d for WQ id %d was not found\n",
3759 ocs_unlock(&q->
lock);
3777 uint8_t valid = FALSE;
3782 if (valid && clear) {
3791 valid = (qe[15] & 0x80) != 0;
3792 if (valid & clear) {
3804 ocs_log_test(NULL,
"doesn't handle type=%#x\n", q->
type);
3808 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
3828 uint8_t *qe = q->
dma.virt;
3829 uint32_t *qindex = NULL;
3830 #if defined(OCS_INCLUDE_DEBUG)
3836 ocs_dma_sync(&q->
dma, OCS_DMASYNC_POSTREAD);
3844 qe += *qindex * q->
size;
3847 ocs_unlock(&q->
lock);
3852 ocs_memcpy(entry, qe, q->
size);
3853 #if defined(OCS_INCLUDE_DEBUG)
3856 snprintf(desc,
sizeof(desc),
"%s entry %d", q->
name, *qindex);
3863 snprintf(desc,
sizeof(desc),
"mq Compl entry %d", *qindex);
3881 *qindex = (*qindex + 1) & (q->
length - 1);
3891 ocs_unlock(&q->
lock);
3911 uint8_t *qe = q->
dma.virt;
3913 if (index >= q->
length) {
3917 qe += index * q->
size;
3920 ocs_memcpy(qe, entry, q->
size);
3923 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
3935 ocs_unlock(&q->
lock);
3944 uint8_t *qe = q->
dma.virt;
3946 if (index >= q->
length) {
3950 qe += index * q->
size;
3953 ocs_memcpy(entry, qe, q->
size);
3966 ocs_unlock(&q->
lock);
3986 if (!sli4 || !buf || !cq_id) {
3987 ocs_log_err(NULL,
"bad parameters sli4=%p buf=%p cq_id=%p\n",
4014 if (!sli4 || !cq || !cqe || !fields) {
4015 ocs_log_err(NULL,
"bad parameters sli4=%p cq=%p cqe=%p fields=%p\n",
4016 sli4, cq, cqe, fields);
4020 if (cq->
u.
flag.is_mq) {
4052 (val & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK)) {
4053 val &= ~MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
4072 uint32_t sliport_semaphore;
4076 if (UINT32_MAX == sliport_semaphore) {
4077 ocs_log_test(sli4->
os,
"error reading SLIPORT_SEMAPHORE register\n");
4085 uint32_t uerr_mask_lo, uerr_mask_hi;
4086 uint32_t uerr_status_lo, uerr_status_hi;
4092 if ((uerr_mask_lo & uerr_status_lo) != 0 ||
4093 (uerr_mask_hi & uerr_status_hi) != 0) {
4097 uint32_t sliport_status;
This structure contains the type and associated fields for a CQE completion.
Mailbox Completion Queue Entry.
int32_t(* link)(void *, void *)
uint32_t ulp1_toe_wq_total
static int32_t sli_cmd_common_get_cntl_attributes(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_GET_CNTL_ATTRIBUTES command to the provided buffer.
#define SLI4_OPC_COMMON_GET_ACTIVE_PROFILE
uint32_t ulp0_toe_defrq_total
sli4_port_type_e port_type
#define SLI4_ULP_MODE_ISCSI_TGT
sli4_wqe_context_t * wq_ctx
static int32_t sli_cmd_common_destroy_eq(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t eq_id)
Write a COMMON_DESTROY_EQ command.
void * sli_queue_iscsi_icd_lookup(sli4_t *sli4, sli4_queue_t *q, uint16_t icd_index)
Returns the IO tied to a specific ICD index.
#define SLI4_ASIC_REV_MASK
#define SLI4_PCI_REV_ID_SHIFT
#define SLI4_IO_WQ_DOORBELL_REG
WQ_DOORBELL - WQ Doorbell Register.
#define SLI4_OPC_COMMON_GET_BE_CONFIGURATION_AND_RESOURCES
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_raise_ue(sli4_t *sli4)
static int32_t sli_cmd_common_destroy_cq(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t cq_id)
write a COMMON_DESTROY_CQ command.
#define SLI4_ACQE_EVENT_CODE_LINK_STATE
uint32_t additional_status
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 response_length
int32_t sli_queue_poke(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
#define SLI4_PCI_SOFT_RESET_MASK
#define SLI4_QUEUE_RQ_BATCH
uint32_t iscsi_mac_address_1
struct sli4_req_common_create_mq_ext_t::@31 page_physical_address[8]
int32_t sli_cmd_common_tcp_upload(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t wq_id, uint8_t graceful)
Write a COMMON_TCP_UPLOAD command.
#define SLI4_OPC_COMMON_DESTROY_EQ
static int32_t sli_get_all_if_ids(sli4_t *sli4)
Retrieve all of the defines interface IDs and store the default interface.
#define SLI4_OPC_COMMON_SET_BE_CONFIGURATION_AND_RESOURCES
int32_t sli_cmd_mailbox_queue_entry(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t length, ocs_dma_t *dma)
Write a MQE header in the provided buffer.
uint32_t ulp0_iscsi_icd_total
mailbox queue Element header
#define OCS_DEBUG_ENABLE_MQ_DUMP
#define SLI4_UERR_MASK_HIGH_REG
static int32_t sli_bmbx_write(sli4_t *sli4)
Write bootstrap mailbox.
#define SLI4_OPC_COMMON_QUERY_FW_CONFIG
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.
int32_t sli_queue_peek(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
get_sli4_parameters_t * get_sli4_parameters
struct sli4_queue_t::@33::@35 wq
uint32_t ulp1_iscsi_icd_total
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_ACQE_EVENT_CODE_GRP_5
int32_t sli_fw_reset(sli4_t *sli4)
int32_t sli_setup(sli4_t *sli4, ocs_os_handle_t os, sli4_port_type_e port_type)
Setup the SLI context.
#define SLI4_OPC_COMMON_GET_PROFILE_LIST
#define SLI4_MQ_DOORBELL_REG
MQ_DOORBELL - MQ Doorbell Register.
COMMON_GET_BE_CONFIGURATION_AND_RESOURCES (v1)
static uint8_t sli_pci_rev_id(uint32_t val)
Retrieve PCI revision ID.
uint32_t ulp1_toe_defrq_total
int32_t sli_cmd_common_get_profile_config(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_PROFILE_CONFIG command.
static uint8_t sli_intf_sli_family(uint32_t val)
int32_t sli_cmd_common_get_active_profile(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
Write a COMMON_COMMON_GET_ACTIVE_PROFILE command.
int32_t sli_queue_write(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Write an entry to the queue object.
#define SLI4_OPC_COMMON_TCP_UPLOAD
static void * ocs_list_get_head(ocs_list_t *list)
Return the first item in the list.
uint32_t iscsi_mac_address_4
struct sli4_queue_t::@33::@34 flag
#define SLI4_OPC_COMMON_GET_RECONFIG_LINK_INFO
uint8_t fw_on_flash_version[32]
static uint8_t sli_intf_sli_revision(uint32_t val)
Retrieve the SLI revision level.
#define SLI4_FUNCTION_MODE_DUA_MODE
#define SLI_USER_EQ_COUNT
int32_t sli_cmd_common_set_profile_config(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma, uint8_t profile_id, uint32_t descriptor_count, uint8_t isap)
Write a COMMON_COMMON_SET_PROFILE_CONFIG command.
#define SLI4_OPC_COMMON_GET_CNTL_ADDL_ATTRIBUTES
#define SLI4_OPC_COMMON_SET_RECONFIG_LINK_ID
#define SLI4_OPC_COMMON_SET_ACTIVE_PROFILE
uint32_t iscsi_mac_address_2
#define SLI4_INTF_SLI_FAMILY_SHIFT
static uint8_t sli_asic_gen(uint32_t val)
Retrieve SLI ASIC generation.
#define SLI4_ASYNC_EVT_ISCSI_EVENTS
static int32_t sli_cmd_common_create_cq(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint16_t eq_id, uint16_t ignored)
Write a COMMON_CREATE_CQ command.
#define SLI4_OPC_COMMON_GET_PROFILE_CONFIG
sli4_asic_entry_t sli4_asic_table[]
static int32_t sli_cmd_common_destroy_mq(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t mq_id)
Write a COMMON_DESTROY_MQ command.
#define SLI4_INTF_IF_TYPE_MASK
#define SLI4_BMBX_WRITE_HI(r)
int32_t sli_queue_is_empty(sli4_t *sli4, sli4_queue_t *q)
Check if the given queue is empty.
COMMON_GET_CNTL_ATTRIBUTES.
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.
static int32_t sli_cmd_get_vpd_data(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_GET_VPD_DATA command to the provided buffer.
#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.
int32_t __sli_queue_init(sli4_t *sli4, sli4_queue_t *q, uint32_t qtype, uint32_t version, size_t size, uint32_t n_entries, uint32_t align)
Initialize a queue object.
#define SLI_USER_MQ_COUNT
#define SLI4_PCI_SOFT_RESET_CSR
#define SLI4_IF_TYPE_BE3_SKH_VF
struct sli4_t::@37 features
#define SLI4_PORT_STATUS_REG_23
SLIPORT_STATUS - SLI Port Status Register.
int32_t sli_iscsi_process_iscsi(sli4_t *sli4, void *acqe)
Process an asynchronous iSCSI event entry.
int32_t sli_cqe_mq(void *buf)
Check mailbox/queue completion entry.
#define SLI4_SLIPORT_ERROR1
SLI4_SLIPORT_ERROR1 - SLI Port Error register.
struct sli4_req_common_modify_eq_delay_t::@27 eq_delay_record[8]
int32_t sli_cmd_common_get_reconfig_link_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_RECONFIG_LINK_INFO command.
sli_wqe_handlers_t sli_be3_iscsi_wqe_handlers
uint32_t uint32_t uint32_t valid_fields
int32_t sli_queue_read(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Read an entry from the queue object.
#define SLI4_INTF_IF_TYPE_SHIFT
int32_t sli_teardown(sli4_t *sli4)
Tear down a SLI context.
#define SLI4_OPC_COMMON_FUNCTION_RESET
#define SLI4_PCI_REV_ID_MASK
#define SLI4_MQ_DOORBELL(n, i)
#define SLI4_ASIC_ID_REG
ASIC_ID - SLI ASIC Type and Revision Register.
static void * ocs_list_remove(ocs_list_t *list, void *item)
Remove an item from the list.
union sli4_queue_t::@33 u
uint8_t firmware_version_string[32]
int32_t sli_cmd_iscsi_wq_create(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ulp)
write a ISCSI_WQ_CREATE command
uint32_t bmbx_timeout_msecs
uint32_t completion_status
#define SLI4_ULP_MODE_ISCSI_INI
uint32_t sli_reg_read(sli4_t *sli, sli4_regname_e reg)
Read the given SLI register.
static int32_t sli_cmd_common_function_reset(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
write a COMMON_FUNCTION_RESET command.
int32_t(* sli4_create_q_fn_t)(sli4_t *, void *, size_t, uint64_t, ocs_dma_t *, uint16_t, uint16_t)
Common Create Queue function prototype.
#define SLI4_INTF_VALID_MASK
int32_t sli_cmd_iscsi_remove_sgl_pages(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
write a COMMON_ISCSI_CFG_REMOVE_SGL_PAGES command
uint32_t uint32_t db_offset
static int32_t sli_iscsi_remove_sgl_pages(sli4_t *sli4)
Issue a ISCSI_CFG_REMOVE_SGL_PAGES command.
int32_t sli_cqe_async(sli4_t *sli4, void *buf)
Check asynchronous event completion entry.
sli4_regname_e
Register name enums.
static uint8_t sli_queue_entry_is_valid(sli4_queue_t *, uint8_t *, uint8_t)
Check if the current queue entry is valid.
#define SLI4_ASIC_VER_SHIFT
static int32_t sli_common_function_reset(sli4_t *sli4)
Issue a COMMON_FUNCTION_RESET command.
#define SLI4_OPC_COMMON_MODIFY_EQ_DELAY
static uint8_t sli_asic_revision(uint32_t val)
Retrieve SLI ASIC revision.
int32_t sli_iscsi_process_link_state(sli4_t *sli4, void *acqe)
Process an asynchronous Link State event entry.
#define SLI4_BMBX_REG
BMBX - Bootstrap Mailbox Register.
uint8_t controller_description[64]
uint32_t ulp1_iscsi_icd_base
uint32_t iscsi_mac_address_3
#define SLI4_SUBSYSTEM_COMMON
#define SLI4_INTF_SLI_FAMILY_MASK
#define SLI4_RQ_DOORBELL_REG
RQ_DOORBELL - RQ Doorbell Register.
static int32_t sli_cmd_common_get_cntl_addl_attributes(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_GET_CNTL_ADDL_ATTRIBUTES command to the provided buffer.
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.
#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET
int32_t sli_cmd_common_nop(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint64_t context)
Write a COMMON_NOP command.
int32_t sli_cmd_iscsi_defq_destroy(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t rq_id)
write a ISCSI_DEFQ_DESTROY command
uint8_t ipl_file_name[16]
int32_t(* iscsi_async)(void *, void *)
#define SLI4_ASIC_GEN_SHIFT
#define SLI4_OPC_COMMON_NOP
uint32_t ulp0_iscsi_icd_base
COMMON_SET_RECONFIG_LINK_ID.
#define SLI4_MAX_IF_TYPES
COMMON_GET_CNTL_ATTRIBUTES.
void * sli_queue_iscsi_icd_invalid(sli4_t *sli4, sli4_queue_t *q, uint16_t icd_index, uint8_t *wait_for_tcp_ack, uint8_t tcp_ack_status)
Processes a target command invalidation IO completion. Moves the WRB to the free list.
COMMON_SET_PROFILE_CONFIG.
static int32_t sli_cmd_common_create_mq_ext(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint16_t cq_id, uint16_t ignored)
Write a COMMON_CREATE_MQ_EXT command.
uint32_t ulp0_iscsi_chain_icd_base
uint8_t pci_function_number
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.
COMMON_GET_RECONFIG_LINK_INFO.
Asynchronous Completion Queue Entry.
sli_wqe_handlers_t sli_skh_iscsi_wqe_handlers
#define SLI4_OPC_COMMON_GET_VPD_DATA
int32_t sli_queue_free(sli4_t *sli4, sli4_queue_t *q)
Free a queue.
uint32_t async_event_bitmap
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.
int32_t sli_cmd_common_get_function_config(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
Write a COMMON_COMMON_GET_FUNCTION_CONFIG command.
int32_t sli_cmd_iscsi_wq_destroy(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t wq_id)
write a ISCSI_WQ_DESTROY command
#define SLI4_PORT_STATUS_READY(r)
int32_t _sli_queue_peek(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
sli4_asic_type_e asic_type
COMMON_GET_FUNCTION_CONFIG.
#define OCS_DEBUG_ENABLE_CQ_DUMP
#define SLI4_OPC_COMMON_GET_FW_VERSION
static uint8_t sli_intf_valid_check(uint32_t val)
Check if the SLI_INTF register is valid.
struct sli4_req_common_create_eq_t::@30 page_address[8]
This structure is used to track the WQEs for iSCSI.
#define SLI4_UERR_STATUS_HIGH_REG
#define SLI4_OPC_COMMON_DESTROY_CQ
COMMON_GET_PROFILE_CONFIG.
static int32_t sli_cmd_common_create_eq(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *qmem, uint16_t ignored1, uint16_t ignored2)
write a COMMON_CREATE_EQ command.
static int32_t sli_queue_doorbell(sli4_t *, sli4_queue_t *)
Write the doorbell register associated with the queue object.
uint32_t delay_multiplier
static int32_t sli_get_fw_version(sli4_t *sli4)
Issue a GET_FW_VERSION mailbox command and store the results.
uint32_t ocs_instance(void *os)
Return the instance index of an opaque ocs structure.
int32_t sli_skh_get_sli4_parameters(sli4_t *sli4)
Issue the GET_SLI4_PARAMETERS IOCTL and populate the results.
struct sli4_req_common_create_cq_v0_t::@28 page_physical_address[4]
int32_t sli_queue_arm(sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
Arm or dis-arm a queue.
#define SLI4_OPC_COMMON_CREATE_EQ
struct sli4_t::@38 config
int32_t sli_reset(sli4_t *sli4)
#define SLI4_BMBX_WRITE_LO(r)
#define SLI4_PORT_SEMAPHORE_PORT(r)
static int32_t sli_fw_init(sli4_t *)
Initialize the firmware.
int32_t sli_cmd_iscsi_common_get_all_if_id(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
write a COMMON_ISCSI_NTWK_GET_ALL_IF_ID command
#define SLI4_ASIC_GEN_SKYHAWK
#define SLI4_MQE_SIZE_128
#define SLI4_OPC_COMMON_GET_FUNCTION_CONFIG
#define SLI4_OPC_COMMON_SET_FEATURES
uint32_t uint32_t vf_domain
#define SLI4_OPC_COMMON_CREATE_CQ
static void ocs_list_add_tail(ocs_list_t *list, void *item)
Add an item to the tail of the list.
uint32_t delay_multiplier
COMMON_GET_ACTIVE_PROFILE.
#define SLI4_PORT_SEMAPHORE_IN_ERR(r)
uint32_t iscsi_mac_address_5
#define SLI4_RQ_DOORBELL(n, i)
#define SLI4_SLIPORT_CONTROL_REG
SLIPORT_CONTROL - SLI Port Control Register.
This structure is used to track the SLI4 queues.
static int32_t sli_bmbx_wait(sli4_t *sli4, uint32_t msec)
Wait for the bootstrap mailbox to report "ready".
static int32_t sli_cmd_common_get_fw_version(sli4_t *sli4, void *buf, size_t size)
Write a COMMON_GET_FW_VERSION command to the provided buffer.
int32_t sli_iscsi_cqe_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
int32_t sli_cmd_common_set_active_profile(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t fd, uint32_t active_profile_id)
Write a COMMON_COMMON_SET_ACTIVE_PROFILE command.
void sli_reg_write(sli4_t *sli, sli4_regname_e reg, uint32_t val)
Write the value to the given SLI register.
#define SLI4_INTF_REG
SLI_INTF - SLI Interface Definition Register.
#define SLI4_PCI_CLASS_REVISION
int32_t sli_cq_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a CQ entry to retrieve event type and associated queue.
int32_t __sli_create_queue(sli4_t *sli4, sli4_queue_t *q)
Issue command to create queue.
static void * ocs_list_next(ocs_list_t *list, void *item)
Get the next item on the list.
#define SLI4_INTF_SLI_REVISION_SHIFT
#define SLI4_ASIC_VER_MASK
uint32_t resource_desc_cnt
#define SLI4_PORT_STATUS_ERROR(r)
void sli_queue_iscsi_cleanup(void *hal, sli4_t *sli4, sli4_queue_t *q)
Moves any WQE entries from the busy back to the free list when a connection is uploaded.
int32_t sli_queue_iscsi_tcp_ack(sli4_t *sli4, sli4_queue_t *q, uint8_t wqe_index)
Processes a TCP ACK completion.
int32_t _sli_queue_poke(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
#define SLI4_OPC_COMMON_CREATE_MQ_EXT
#define SLI4_IF_TYPE_BE3_SKH_PF
uint32_t ulp0_iscsi_chain_icd_total
int32_t sli_queue_reset(sli4_t *sli4, sli4_queue_t *q)
Zero all queue entries and reset the indexes.
#define SLI4_UERR_STATUS_LOW_REG
#define SLI4_EQCQ_DOORBELL_REG
EQCQ_DOORBELL - EQ and CQ Doorbell Register.
#define SLI4_PORT_SEMAPHORE_STATUS_POST_READY
#define SLI4_ASIC_GEN_MASK
static int32_t sli_query_fw_mac_addr(sli4_t *sli4)
Issue a mailbox command and find the MAC address.
#define SLI4_OPC_COMMON_SET_PROFILE_CONFIG
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
int32_t sli_be3_get_sli4_parameters(sli4_t *sli4)
Note: GET_SLI4_PARAMETERS IOCTL is not supported on BE3, so we just return constant values...
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 SLI interface type.
uint32_t start_profile_index
int32_t(* sli4_destroy_q_fn_t)(sli4_t *, void *, size_t, uint64_t, uint16_t)
Common Destroy Queue function prototype.
int32_t sli_cmd_common_set_be_configuration_and_resources(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t *mac_addr)
Write a COMMON_COMMON_SET_BE_CONFIGURATION_AND_RESOURCES command.
uint32_t sli_queue_iscsi_free_cnt(sli4_t *sli4, sli4_queue_t *q)
Return the number of free WRB entries.
#define SLI4_OPC_COMMON_GET_CNTL_ATTRIBUTES
int32_t sli_cmd_common_get_profile_list(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t start_profile_index, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_PROFILE_LIST command.
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.
uint16_t num_sges_per_icd
static int32_t sli_fw_term(sli4_t *)
Terminate the firmware.
static int32_t sli_read_transceiver_data(sli4_t *sli4)
Issue a READ_TRANSCEIVER_DATA mailbox command and store the results.
int32_t io_cb_t(struct ocs_hal_io_s *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
IO Completion function prototype.
#define SLI4_ASIC_REV_SHIFT
static int32_t sli_sliport_control(sli4_t *sli4, uint32_t endian)
uint16_t max_qcount[SLI_QTYPE_MAX]
#define SLI4_UERR_MASK_LOW_REG
#define SLI4_INTF_SLI_REVISION_MASK
Generic Command Request header.
void sli_interrupt_set(sli4_t *sli, uint8_t enable)
#define SLI4_ASIC_GEN_BE3
struct sli_wqe_handlers * wqe_handlers
#define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK
Generic Command Response header.
#define SLI4_PORT_SEMAPHORE_REG_23
COMMON_SET_ACTIVE_PROFILE.
void * sli_queue_iscsi_wqe_complete(sli4_t *sli4, sli4_queue_t *q, uint8_t wqe_index)
Processes a solicited IO completion. Moves the WRB to the free list.
#define SLI4_INTF_VALID_SHIFT
const uint8_t sli4_fw_deinitialize[]
FW_DEINITIALIZE - deinitialize a SLI port.
uint32_t ulp0_toe_wq_total
uint32_t active_profile_id
#define SLI4_PORT_SEMAPHORE_REG_01
SLIPORT_SEMAPHORE - SLI Port Host and Port Status Register.
uint8_t sgl_chaining_capable
int32_t sli_cmd_common_set_reconfig_link_id(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma, uint32_t fd, uint32_t active_link_config_id)
Write a COMMON_COMMON_SET_RECONFIG_LINK_ID command.
static int32_t sli_cmd_common_read_transceiver_data(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t page_num, uint32_t port, ocs_dma_t *dma)
Write a COMMON_READ_TRANSCEIVER_DATA command.
#define SLI4_BMBX_MASK_LO
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.
int32_t sli_init(sli4_t *sli4)
#define SLI4_SLIPORT_CONTROL_LITTLE_ENDIAN
#define SLI4_WQ_DOORBELL(n, x, i)
static uint32_t sli_cq_doorbell(uint16_t n_popped, uint16_t id, uint8_t arm)
static int32_t sli_cmd_common_get_be_configuration_and_resources(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
Write a COMMON_COMMON_GET_BE_CONFIGURATION_AND_RESOURCES command.
uint32_t iscsi_mac_address_0
#define SLI4_OPC_COMMON_READ_TRANSCEIVER_DATA
#define SLI4_IF_TYPE_LANCER_FC_ETH
#define OCS_DEBUG_ENABLE_WQ_DUMP
#define SLI4_SLIPORT_CONTROL_IP
uint8_t fw_on_flash_version_string[32]
#define SLI4_ACQE_EVENT_CODE_ISCSI
const sli4_reg_t regmap[SLI4_REG_MAX][SLI4_MAX_IF_TYPES]
Define the mapping of registers to their BAR and offset.
COMMON_SET_BE_CONFIGURATION_AND_RESOURCES (v1)