diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_hw.c | 32 | ||||
-rw-r--r-- | drivers/infiniband/hw/ocrdma/ocrdma_sli.h | 147 |
2 files changed, 129 insertions, 50 deletions
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c index df68782b32d1..dd35ae558ae1 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_hw.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_hw.c | |||
@@ -525,7 +525,7 @@ static int ocrdma_mbx_mq_cq_create(struct ocrdma_dev *dev, | |||
525 | 525 | ||
526 | cmd->ev_cnt_flags = OCRDMA_CREATE_CQ_DEF_FLAGS; | 526 | cmd->ev_cnt_flags = OCRDMA_CREATE_CQ_DEF_FLAGS; |
527 | cmd->eqn = eq->id; | 527 | cmd->eqn = eq->id; |
528 | cmd->cqe_count = cq->size / sizeof(struct ocrdma_mcqe); | 528 | cmd->pdid_cqecnt = cq->size / sizeof(struct ocrdma_mcqe); |
529 | 529 | ||
530 | ocrdma_build_q_pages(&cmd->pa[0], cq->size / OCRDMA_MIN_Q_PAGE_SIZE, | 530 | ocrdma_build_q_pages(&cmd->pa[0], cq->size / OCRDMA_MIN_Q_PAGE_SIZE, |
531 | cq->dma, PAGE_SIZE_4K); | 531 | cq->dma, PAGE_SIZE_4K); |
@@ -1265,7 +1265,9 @@ static int ocrdma_mbx_get_ctrl_attribs(struct ocrdma_dev *dev) | |||
1265 | ctrl_attr_rsp = (struct ocrdma_get_ctrl_attribs_rsp *)dma.va; | 1265 | ctrl_attr_rsp = (struct ocrdma_get_ctrl_attribs_rsp *)dma.va; |
1266 | hba_attribs = &ctrl_attr_rsp->ctrl_attribs.hba_attribs; | 1266 | hba_attribs = &ctrl_attr_rsp->ctrl_attribs.hba_attribs; |
1267 | 1267 | ||
1268 | dev->hba_port_num = hba_attribs->phy_port; | 1268 | dev->hba_port_num = (hba_attribs->ptpnum_maxdoms_hbast_cv & |
1269 | OCRDMA_HBA_ATTRB_PTNUM_MASK) | ||
1270 | >> OCRDMA_HBA_ATTRB_PTNUM_SHIFT; | ||
1269 | strncpy(dev->model_number, | 1271 | strncpy(dev->model_number, |
1270 | hba_attribs->controller_model_number, 31); | 1272 | hba_attribs->controller_model_number, 31); |
1271 | } | 1273 | } |
@@ -1315,7 +1317,8 @@ int ocrdma_mbx_get_link_speed(struct ocrdma_dev *dev, u8 *lnk_speed) | |||
1315 | goto mbx_err; | 1317 | goto mbx_err; |
1316 | 1318 | ||
1317 | rsp = (struct ocrdma_get_link_speed_rsp *)cmd; | 1319 | rsp = (struct ocrdma_get_link_speed_rsp *)cmd; |
1318 | *lnk_speed = rsp->phys_port_speed; | 1320 | *lnk_speed = (rsp->pflt_pps_ld_pnum & OCRDMA_PHY_PS_MASK) |
1321 | >> OCRDMA_PHY_PS_SHIFT; | ||
1319 | 1322 | ||
1320 | mbx_err: | 1323 | mbx_err: |
1321 | kfree(cmd); | 1324 | kfree(cmd); |
@@ -1341,11 +1344,16 @@ static int ocrdma_mbx_get_phy_info(struct ocrdma_dev *dev) | |||
1341 | goto mbx_err; | 1344 | goto mbx_err; |
1342 | 1345 | ||
1343 | rsp = (struct ocrdma_get_phy_info_rsp *)cmd; | 1346 | rsp = (struct ocrdma_get_phy_info_rsp *)cmd; |
1344 | dev->phy.phy_type = le16_to_cpu(rsp->phy_type); | 1347 | dev->phy.phy_type = |
1348 | (rsp->ityp_ptyp & OCRDMA_PHY_TYPE_MASK); | ||
1349 | dev->phy.interface_type = | ||
1350 | (rsp->ityp_ptyp & OCRDMA_IF_TYPE_MASK) | ||
1351 | >> OCRDMA_IF_TYPE_SHIFT; | ||
1345 | dev->phy.auto_speeds_supported = | 1352 | dev->phy.auto_speeds_supported = |
1346 | le16_to_cpu(rsp->auto_speeds_supported); | 1353 | (rsp->fspeed_aspeed & OCRDMA_ASPEED_SUPP_MASK); |
1347 | dev->phy.fixed_speeds_supported = | 1354 | dev->phy.fixed_speeds_supported = |
1348 | le16_to_cpu(rsp->fixed_speeds_supported); | 1355 | (rsp->fspeed_aspeed & OCRDMA_FSPEED_SUPP_MASK) |
1356 | >> OCRDMA_FSPEED_SUPP_SHIFT; | ||
1349 | mbx_err: | 1357 | mbx_err: |
1350 | kfree(cmd); | 1358 | kfree(cmd); |
1351 | return status; | 1359 | return status; |
@@ -1470,8 +1478,8 @@ static int ocrdma_mbx_create_ah_tbl(struct ocrdma_dev *dev) | |||
1470 | 1478 | ||
1471 | pbes = (struct ocrdma_pbe *)dev->av_tbl.pbl.va; | 1479 | pbes = (struct ocrdma_pbe *)dev->av_tbl.pbl.va; |
1472 | for (i = 0; i < dev->av_tbl.size / OCRDMA_MIN_Q_PAGE_SIZE; i++) { | 1480 | for (i = 0; i < dev->av_tbl.size / OCRDMA_MIN_Q_PAGE_SIZE; i++) { |
1473 | pbes[i].pa_lo = (u32) (pa & 0xffffffff); | 1481 | pbes[i].pa_lo = (u32)cpu_to_le32(pa & 0xffffffff); |
1474 | pbes[i].pa_hi = (u32) upper_32_bits(pa); | 1482 | pbes[i].pa_hi = (u32)cpu_to_le32(upper_32_bits(pa)); |
1475 | pa += PAGE_SIZE; | 1483 | pa += PAGE_SIZE; |
1476 | } | 1484 | } |
1477 | cmd->tbl_addr[0].lo = (u32)(dev->av_tbl.pbl.pa & 0xFFFFFFFF); | 1485 | cmd->tbl_addr[0].lo = (u32)(dev->av_tbl.pbl.pa & 0xFFFFFFFF); |
@@ -1638,14 +1646,16 @@ int ocrdma_mbx_create_cq(struct ocrdma_dev *dev, struct ocrdma_cq *cq, | |||
1638 | cmd->cmd.pgsz_pgcnt |= OCRDMA_CREATE_CQ_DPP << | 1646 | cmd->cmd.pgsz_pgcnt |= OCRDMA_CREATE_CQ_DPP << |
1639 | OCRDMA_CREATE_CQ_TYPE_SHIFT; | 1647 | OCRDMA_CREATE_CQ_TYPE_SHIFT; |
1640 | cq->phase_change = false; | 1648 | cq->phase_change = false; |
1641 | cmd->cmd.cqe_count = (cq->len / cqe_size); | 1649 | cmd->cmd.pdid_cqecnt = (cq->len / cqe_size); |
1642 | } else { | 1650 | } else { |
1643 | cmd->cmd.cqe_count = (cq->len / cqe_size) - 1; | 1651 | cmd->cmd.pdid_cqecnt = (cq->len / cqe_size) - 1; |
1644 | cmd->cmd.ev_cnt_flags |= OCRDMA_CREATE_CQ_FLAGS_AUTO_VALID; | 1652 | cmd->cmd.ev_cnt_flags |= OCRDMA_CREATE_CQ_FLAGS_AUTO_VALID; |
1645 | cq->phase_change = true; | 1653 | cq->phase_change = true; |
1646 | } | 1654 | } |
1647 | 1655 | ||
1648 | cmd->cmd.pd_id = pd_id; /* valid only for v3 */ | 1656 | /* pd_id valid only for v3 */ |
1657 | cmd->cmd.pdid_cqecnt |= (pd_id << | ||
1658 | OCRDMA_CREATE_CQ_CMD_PDID_SHIFT); | ||
1649 | ocrdma_build_q_pages(&cmd->cmd.pa[0], hw_pages, cq->pa, page_size); | 1659 | ocrdma_build_q_pages(&cmd->cmd.pa[0], hw_pages, cq->pa, page_size); |
1650 | status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd); | 1660 | status = ocrdma_mbx_cmd(dev, (struct ocrdma_mqe *)cmd); |
1651 | if (status) | 1661 | if (status) |
diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h index 3d08e665be26..904989ec5eaa 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_sli.h +++ b/drivers/infiniband/hw/ocrdma/ocrdma_sli.h | |||
@@ -589,17 +589,26 @@ enum { | |||
589 | OCRDMA_FN_MODE_RDMA = 0x4 | 589 | OCRDMA_FN_MODE_RDMA = 0x4 |
590 | }; | 590 | }; |
591 | 591 | ||
592 | enum { | ||
593 | OCRDMA_IF_TYPE_MASK = 0xFFFF0000, | ||
594 | OCRDMA_IF_TYPE_SHIFT = 0x10, | ||
595 | OCRDMA_PHY_TYPE_MASK = 0x0000FFFF, | ||
596 | OCRDMA_FUTURE_DETAILS_MASK = 0xFFFF0000, | ||
597 | OCRDMA_FUTURE_DETAILS_SHIFT = 0x10, | ||
598 | OCRDMA_EX_PHY_DETAILS_MASK = 0x0000FFFF, | ||
599 | OCRDMA_FSPEED_SUPP_MASK = 0xFFFF0000, | ||
600 | OCRDMA_FSPEED_SUPP_SHIFT = 0x10, | ||
601 | OCRDMA_ASPEED_SUPP_MASK = 0x0000FFFF | ||
602 | }; | ||
603 | |||
592 | struct ocrdma_get_phy_info_rsp { | 604 | struct ocrdma_get_phy_info_rsp { |
593 | struct ocrdma_mqe_hdr hdr; | 605 | struct ocrdma_mqe_hdr hdr; |
594 | struct ocrdma_mbx_rsp rsp; | 606 | struct ocrdma_mbx_rsp rsp; |
595 | 607 | ||
596 | u16 phy_type; | 608 | u32 ityp_ptyp; |
597 | u16 interface_type; | ||
598 | u32 misc_params; | 609 | u32 misc_params; |
599 | u16 ext_phy_details; | 610 | u32 ftrdtl_exphydtl; |
600 | u16 rsvd; | 611 | u32 fspeed_aspeed; |
601 | u16 auto_speeds_supported; | ||
602 | u16 fixed_speeds_supported; | ||
603 | u32 future_use[2]; | 612 | u32 future_use[2]; |
604 | }; | 613 | }; |
605 | 614 | ||
@@ -612,19 +621,34 @@ enum { | |||
612 | OCRDMA_PHY_SPEED_40GBPS = 0x20 | 621 | OCRDMA_PHY_SPEED_40GBPS = 0x20 |
613 | }; | 622 | }; |
614 | 623 | ||
624 | enum { | ||
625 | OCRDMA_PORT_NUM_MASK = 0x3F, | ||
626 | OCRDMA_PT_MASK = 0xC0, | ||
627 | OCRDMA_PT_SHIFT = 0x6, | ||
628 | OCRDMA_LINK_DUP_MASK = 0x0000FF00, | ||
629 | OCRDMA_LINK_DUP_SHIFT = 0x8, | ||
630 | OCRDMA_PHY_PS_MASK = 0x00FF0000, | ||
631 | OCRDMA_PHY_PS_SHIFT = 0x10, | ||
632 | OCRDMA_PHY_PFLT_MASK = 0xFF000000, | ||
633 | OCRDMA_PHY_PFLT_SHIFT = 0x18, | ||
634 | OCRDMA_QOS_LNKSP_MASK = 0xFFFF0000, | ||
635 | OCRDMA_QOS_LNKSP_SHIFT = 0x10, | ||
636 | OCRDMA_LLST_MASK = 0xFF, | ||
637 | OCRDMA_PLFC_MASK = 0x00000400, | ||
638 | OCRDMA_PLFC_SHIFT = 0x8, | ||
639 | OCRDMA_PLRFC_MASK = 0x00000200, | ||
640 | OCRDMA_PLRFC_SHIFT = 0x8, | ||
641 | OCRDMA_PLTFC_MASK = 0x00000100, | ||
642 | OCRDMA_PLTFC_SHIFT = 0x8 | ||
643 | }; | ||
615 | 644 | ||
616 | struct ocrdma_get_link_speed_rsp { | 645 | struct ocrdma_get_link_speed_rsp { |
617 | struct ocrdma_mqe_hdr hdr; | 646 | struct ocrdma_mqe_hdr hdr; |
618 | struct ocrdma_mbx_rsp rsp; | 647 | struct ocrdma_mbx_rsp rsp; |
619 | 648 | ||
620 | u8 pt_port_num; | 649 | u32 pflt_pps_ld_pnum; |
621 | u8 link_duplex; | 650 | u32 qos_lsp; |
622 | u8 phys_port_speed; | 651 | u32 res_lls; |
623 | u8 phys_port_fault; | ||
624 | u16 rsvd1; | ||
625 | u16 qos_lnk_speed; | ||
626 | u8 logical_lnk_status; | ||
627 | u8 rsvd2[3]; | ||
628 | }; | 652 | }; |
629 | 653 | ||
630 | enum { | 654 | enum { |
@@ -675,8 +699,7 @@ struct ocrdma_create_cq_cmd { | |||
675 | u32 pgsz_pgcnt; | 699 | u32 pgsz_pgcnt; |
676 | u32 ev_cnt_flags; | 700 | u32 ev_cnt_flags; |
677 | u32 eqn; | 701 | u32 eqn; |
678 | u16 cqe_count; | 702 | u32 pdid_cqecnt; |
679 | u16 pd_id; | ||
680 | u32 rsvd6; | 703 | u32 rsvd6; |
681 | struct ocrdma_pa pa[OCRDMA_CREATE_CQ_MAX_PAGES]; | 704 | struct ocrdma_pa pa[OCRDMA_CREATE_CQ_MAX_PAGES]; |
682 | }; | 705 | }; |
@@ -687,6 +710,10 @@ struct ocrdma_create_cq { | |||
687 | }; | 710 | }; |
688 | 711 | ||
689 | enum { | 712 | enum { |
713 | OCRDMA_CREATE_CQ_CMD_PDID_SHIFT = 0x10 | ||
714 | }; | ||
715 | |||
716 | enum { | ||
690 | OCRDMA_CREATE_CQ_RSP_CQ_ID_MASK = 0xFFFF | 717 | OCRDMA_CREATE_CQ_RSP_CQ_ID_MASK = 0xFFFF |
691 | }; | 718 | }; |
692 | 719 | ||
@@ -1904,12 +1931,62 @@ struct ocrdma_rdma_stats_resp { | |||
1904 | struct ocrdma_rx_dbg_stats rx_dbg_stats; | 1931 | struct ocrdma_rx_dbg_stats rx_dbg_stats; |
1905 | } __packed; | 1932 | } __packed; |
1906 | 1933 | ||
1934 | enum { | ||
1935 | OCRDMA_HBA_ATTRB_EPROM_VER_LO_MASK = 0xFF, | ||
1936 | OCRDMA_HBA_ATTRB_EPROM_VER_HI_MASK = 0xFF00, | ||
1937 | OCRDMA_HBA_ATTRB_EPROM_VER_HI_SHIFT = 0x08, | ||
1938 | OCRDMA_HBA_ATTRB_CDBLEN_MASK = 0xFFFF, | ||
1939 | OCRDMA_HBA_ATTRB_ASIC_REV_MASK = 0xFF0000, | ||
1940 | OCRDMA_HBA_ATTRB_ASIC_REV_SHIFT = 0x10, | ||
1941 | OCRDMA_HBA_ATTRB_GUID0_MASK = 0xFF000000, | ||
1942 | OCRDMA_HBA_ATTRB_GUID0_SHIFT = 0x18, | ||
1943 | OCRDMA_HBA_ATTRB_GUID13_MASK = 0xFF, | ||
1944 | OCRDMA_HBA_ATTRB_GUID14_MASK = 0xFF00, | ||
1945 | OCRDMA_HBA_ATTRB_GUID14_SHIFT = 0x08, | ||
1946 | OCRDMA_HBA_ATTRB_GUID15_MASK = 0xFF0000, | ||
1947 | OCRDMA_HBA_ATTRB_GUID15_SHIFT = 0x10, | ||
1948 | OCRDMA_HBA_ATTRB_PCNT_MASK = 0xFF000000, | ||
1949 | OCRDMA_HBA_ATTRB_PCNT_SHIFT = 0x18, | ||
1950 | OCRDMA_HBA_ATTRB_LDTOUT_MASK = 0xFFFF, | ||
1951 | OCRDMA_HBA_ATTRB_ISCSI_VER_MASK = 0xFF0000, | ||
1952 | OCRDMA_HBA_ATTRB_ISCSI_VER_SHIFT = 0x10, | ||
1953 | OCRDMA_HBA_ATTRB_MFUNC_DEV_MASK = 0xFF000000, | ||
1954 | OCRDMA_HBA_ATTRB_MFUNC_DEV_SHIFT = 0x18, | ||
1955 | OCRDMA_HBA_ATTRB_CV_MASK = 0xFF, | ||
1956 | OCRDMA_HBA_ATTRB_HBA_ST_MASK = 0xFF00, | ||
1957 | OCRDMA_HBA_ATTRB_HBA_ST_SHIFT = 0x08, | ||
1958 | OCRDMA_HBA_ATTRB_MAX_DOMS_MASK = 0xFF0000, | ||
1959 | OCRDMA_HBA_ATTRB_MAX_DOMS_SHIFT = 0x10, | ||
1960 | OCRDMA_HBA_ATTRB_PTNUM_MASK = 0x3F000000, | ||
1961 | OCRDMA_HBA_ATTRB_PTNUM_SHIFT = 0x18, | ||
1962 | OCRDMA_HBA_ATTRB_PT_MASK = 0xC0000000, | ||
1963 | OCRDMA_HBA_ATTRB_PT_SHIFT = 0x1E, | ||
1964 | OCRDMA_HBA_ATTRB_ISCSI_FET_MASK = 0xFF, | ||
1965 | OCRDMA_HBA_ATTRB_ASIC_GEN_MASK = 0xFF00, | ||
1966 | OCRDMA_HBA_ATTRB_ASIC_GEN_SHIFT = 0x08, | ||
1967 | OCRDMA_HBA_ATTRB_PCI_VID_MASK = 0xFFFF, | ||
1968 | OCRDMA_HBA_ATTRB_PCI_DID_MASK = 0xFFFF0000, | ||
1969 | OCRDMA_HBA_ATTRB_PCI_DID_SHIFT = 0x10, | ||
1970 | OCRDMA_HBA_ATTRB_PCI_SVID_MASK = 0xFFFF, | ||
1971 | OCRDMA_HBA_ATTRB_PCI_SSID_MASK = 0xFFFF0000, | ||
1972 | OCRDMA_HBA_ATTRB_PCI_SSID_SHIFT = 0x10, | ||
1973 | OCRDMA_HBA_ATTRB_PCI_BUSNUM_MASK = 0xFF, | ||
1974 | OCRDMA_HBA_ATTRB_PCI_DEVNUM_MASK = 0xFF00, | ||
1975 | OCRDMA_HBA_ATTRB_PCI_DEVNUM_SHIFT = 0x08, | ||
1976 | OCRDMA_HBA_ATTRB_PCI_FUNCNUM_MASK = 0xFF0000, | ||
1977 | OCRDMA_HBA_ATTRB_PCI_FUNCNUM_SHIFT = 0x10, | ||
1978 | OCRDMA_HBA_ATTRB_IF_TYPE_MASK = 0xFF000000, | ||
1979 | OCRDMA_HBA_ATTRB_IF_TYPE_SHIFT = 0x18, | ||
1980 | OCRDMA_HBA_ATTRB_NETFIL_MASK =0xFF | ||
1981 | }; | ||
1907 | 1982 | ||
1908 | struct mgmt_hba_attribs { | 1983 | struct mgmt_hba_attribs { |
1909 | u8 flashrom_version_string[32]; | 1984 | u8 flashrom_version_string[32]; |
1910 | u8 manufacturer_name[32]; | 1985 | u8 manufacturer_name[32]; |
1911 | u32 supported_modes; | 1986 | u32 supported_modes; |
1912 | u32 rsvd0[3]; | 1987 | u32 rsvd_eprom_verhi_verlo; |
1988 | u32 mbx_ds_ver; | ||
1989 | u32 epfw_ds_ver; | ||
1913 | u8 ncsi_ver_string[12]; | 1990 | u8 ncsi_ver_string[12]; |
1914 | u32 default_extended_timeout; | 1991 | u32 default_extended_timeout; |
1915 | u8 controller_model_number[32]; | 1992 | u8 controller_model_number[32]; |
@@ -1922,34 +1999,26 @@ struct mgmt_hba_attribs { | |||
1922 | u8 driver_version_string[32]; | 1999 | u8 driver_version_string[32]; |
1923 | u8 fw_on_flash_version_string[32]; | 2000 | u8 fw_on_flash_version_string[32]; |
1924 | u32 functionalities_supported; | 2001 | u32 functionalities_supported; |
1925 | u16 max_cdblength; | 2002 | u32 guid0_asicrev_cdblen; |
1926 | u8 asic_revision; | 2003 | u8 generational_guid[12]; |
1927 | u8 generational_guid[16]; | 2004 | u32 portcnt_guid15; |
1928 | u8 hba_port_count; | 2005 | u32 mfuncdev_iscsi_ldtout; |
1929 | u16 default_link_down_timeout; | 2006 | u32 ptpnum_maxdoms_hbast_cv; |
1930 | u8 iscsi_ver_min_max; | ||
1931 | u8 multifunction_device; | ||
1932 | u8 cache_valid; | ||
1933 | u8 hba_status; | ||
1934 | u8 max_domains_supported; | ||
1935 | u8 phy_port; | ||
1936 | u32 firmware_post_status; | 2007 | u32 firmware_post_status; |
1937 | u32 hba_mtu[8]; | 2008 | u32 hba_mtu[8]; |
1938 | u32 rsvd1[4]; | 2009 | u32 res_asicgen_iscsi_feaures; |
2010 | u32 rsvd1[3]; | ||
1939 | }; | 2011 | }; |
1940 | 2012 | ||
1941 | struct mgmt_controller_attrib { | 2013 | struct mgmt_controller_attrib { |
1942 | struct mgmt_hba_attribs hba_attribs; | 2014 | struct mgmt_hba_attribs hba_attribs; |
1943 | u16 pci_vendor_id; | 2015 | u32 pci_did_vid; |
1944 | u16 pci_device_id; | 2016 | u32 pci_ssid_svid; |
1945 | u16 pci_sub_vendor_id; | 2017 | u32 ityp_fnum_devnum_bnum; |
1946 | u16 pci_sub_system_id; | 2018 | u32 uid_hi; |
1947 | u8 pci_bus_number; | 2019 | u32 uid_lo; |
1948 | u8 pci_device_number; | 2020 | u32 res_nnetfil; |
1949 | u8 pci_function_number; | 2021 | u32 rsvd0[4]; |
1950 | u8 interface_type; | ||
1951 | u64 unique_identifier; | ||
1952 | u32 rsvd0[5]; | ||
1953 | }; | 2022 | }; |
1954 | 2023 | ||
1955 | struct ocrdma_get_ctrl_attribs_rsp { | 2024 | struct ocrdma_get_ctrl_attribs_rsp { |