]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
[MTHCA, TOOLS] fix printing of port capabilities , fix compilation bug
authorsleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 7 Feb 2007 13:03:37 +0000 (13:03 +0000)
committersleybo <sleybo@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 7 Feb 2007 13:03:37 +0000 (13:03 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1@583 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

trunk/hw/mthca/kernel/hca_data.c
trunk/hw/mthca/kernel/mthca_doorbell.h
trunk/tools/vstat/user/vstat_main.c

index 5e639a33ee87fc61a428762b785ae4aaefde295a..f8e5b7a66f6587d142169d4169ecefaab564f56a 100644 (file)
@@ -214,18 +214,31 @@ mthca_port_cap_to_ibal(
        IN                              u32                     mthca_port_cap,\r
                OUT                     ib_port_cap_t                           *ibal_port_cap_p)\r
 {\r
-       if (mthca_port_cap & IB_PORT_CM_SUP)\r
-               ibal_port_cap_p->cm = TRUE;\r
-       if (mthca_port_cap & IB_PORT_SNMP_TUNNEL_SUP)\r
-               ibal_port_cap_p->snmp = TRUE;\r
-       if (mthca_port_cap & IB_PORT_DEVICE_MGMT_SUP)\r
-               ibal_port_cap_p->dev_mgmt = TRUE;\r
-       if (mthca_port_cap & IB_PORT_VENDOR_CLASS_SUP)\r
-               ibal_port_cap_p->vend = TRUE;\r
-       if (mthca_port_cap & IB_PORT_SM_DISABLED)\r
-               ibal_port_cap_p->sm_disable = TRUE;\r
-       if (mthca_port_cap & IB_PORT_SM)\r
-               ibal_port_cap_p->sm = TRUE;\r
+#define SET_CAP(flag,cap)      if (mthca_port_cap & flag) ibal_port_cap_p->cap = TRUE\r
+\r
+       SET_CAP(IB_PORT_CM_SUP,cm);\r
+       SET_CAP(IB_PORT_SNMP_TUNNEL_SUP,snmp);\r
+       SET_CAP(IB_PORT_DEVICE_MGMT_SUP,dev_mgmt);\r
+       SET_CAP(IB_PORT_VENDOR_CLASS_SUP,vend);\r
+       SET_CAP(IB_PORT_SM_DISABLED,sm_disable);\r
+       SET_CAP(IB_PORT_SM,sm);\r
+       SET_CAP(IB_PORT_NOTICE_SUP,notice);\r
+       SET_CAP(IB_PORT_TRAP_SUP,trap);\r
+       SET_CAP(IB_PORT_AUTO_MIGR_SUP,apm);\r
+       SET_CAP(IB_PORT_SL_MAP_SUP,slmap);\r
+       SET_CAP(IB_PORT_LED_INFO_SUP,ledinfo);\r
+       SET_CAP(IB_PORT_CAP_MASK_NOTICE_SUP,capm_notice);\r
+       SET_CAP(IB_PORT_CLIENT_REG_SUP,client_reregister);\r
+       SET_CAP(IB_PORT_SYS_IMAGE_GUID_SUP,sysguid);\r
+       SET_CAP(IB_PORT_BOOT_MGMT_SUP,boot_mgmt);\r
+       SET_CAP(IB_PORT_DR_NOTICE_SUP,dr_notice);\r
+       SET_CAP(IB_PORT_PKEY_SW_EXT_PORT_TRAP_SUP,pkey_switch_ext_port);\r
+       SET_CAP(IB_PORT_LINK_LATENCY_SUP,link_rtl);\r
+       SET_CAP(IB_PORT_REINIT_SUP,reinit);\r
+       SET_CAP(IB_PORT_OPT_IPD_SUP,ipd);\r
+       SET_CAP(IB_PORT_MKEY_NVRAM,mkey_nvram);\r
+       SET_CAP(IB_PORT_PKEY_NVRAM,pkey_nvram);\r
+       // there no MTHCA flags for qkey_ctr, pkey_ctr, port_active, bm IBAL capabilities;\r
 }\r
 \r
 \r
index c873c9c940f0bf9eb4590eba05fd2bbcccaee876..92cfb3fd26fa5c55d3c0e28717437f92a43cf267 100644 (file)
@@ -48,7 +48,7 @@ enum {
 
 
 #define MTHCA_DECLARE_DOORBELL_LOCK(name)
-#define MTHCA_INIT_DOORBELL_LOCK(ptr)    do { } while (0)
+#define MTHCA_INIT_DOORBELL_LOCK(ptr) 
 #define MTHCA_GET_DOORBELL_LOCK(ptr)      (NULL)
 
 static inline void mthca_write64_raw(__be64 val, void __iomem *dest)
index 465e7fae6abfbaa4db561f118125a0c5913309a4..391aeea2ba6f6c7eb7b8e49402831f55bf5ad564 100644 (file)
@@ -143,6 +143,33 @@ void printPortMTU(int mtu){ //TODO: check that these are all the options and tha
        }\r
 }\r
 \r
+void printPortCaps(ib_port_cap_t *ibal_port_cap_p)\r
+{\r
+#define PRINT_CAP(cap, name)   if (ibal_port_cap_p->cap) printf( #name "," )\r
+       \r
+       printf("\t\tcapabilities: ");\r
+       PRINT_CAP(cm, CM);\r
+       PRINT_CAP(snmp, SNMP_TUNNEL);\r
+       PRINT_CAP(dev_mgmt, DEVICE_MGMT);\r
+       PRINT_CAP(sm_disable, SM_DISABLED);\r
+       PRINT_CAP(sm, SM);\r
+       PRINT_CAP(vend, VENDOR_CLASS);\r
+       PRINT_CAP(notice, NOTICE);\r
+       PRINT_CAP(trap, TRAP);\r
+       PRINT_CAP(apm, APM);\r
+       PRINT_CAP(slmap, SL_MAP);\r
+       PRINT_CAP(ledinfo, LED_INFO);\r
+       PRINT_CAP(client_reregister, CLIENT_REG);\r
+       PRINT_CAP(sysguid, SYSGUID);\r
+       PRINT_CAP(boot_mgmt, BOOT_MGMT);\r
+       PRINT_CAP(pkey_switch_ext_port, PKEY_SW_EXT_PORT_TRAP);\r
+       PRINT_CAP(link_rtl, LINK_LATENCY);\r
+       PRINT_CAP(reinit, REINIT);\r
+       PRINT_CAP(ipd, OPT_IPD);\r
+       PRINT_CAP(mkey_nvram, MKEY_NVRAM);\r
+       PRINT_CAP(pkey_nvram, PKEY_NVRAM);\r
+       printf("\n");\r
+}\r
 void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){\r
        printf("\t\tport=%d\n", portPtr->port_num);\r
        printPortLinkState(portPtr->link_state);\r
@@ -152,7 +179,7 @@ void printPortInfo(ib_port_attr_t* portPtr, BOOLEAN fullPrint){
        printPortMTU(portPtr->mtu);\r
        if(fullPrint){\r
                printf("\t\tmax_msg_sz=0x%x     (Max message size)\n", portPtr->max_msg_size);\r
-               printf("\t\tcapability_mask=0x%x        (Port capability mask)\n", portPtr->cap);\r
+               printPortCaps( &portPtr->cap );\r
                printf("\t\tmax_vl_num=0x%x             (Maximum number of VL supported by this port)\n", portPtr->max_vls);\r
                printf("\t\tbad_pkey_counter=0x%x       (Bad PKey counter)\n", portPtr->pkey_ctr);\r
                printf("\t\tqkey_viol_counter=0x%x      (QKey violation counter)\n", portPtr->qkey_ctr);\r