[ipoib] Add support for another mlnx series of GUIDs.
authortzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 8 Jul 2008 14:51:08 +0000 (14:51 +0000)
committertzachid <tzachid@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 8 Jul 2008 14:51:08 +0000 (14:51 +0000)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1343 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_xfr_mgr.h

index 5063643..96c1373 100644 (file)
@@ -207,19 +207,22 @@ ipoib_mac_from_mlx_guid(
 {\r
        const uint8_t   *p_guid = (const uint8_t*)&port_guid;\r
        uint32_t                low24;\r
+       net16_t                 guid_middle;\r
 \r
        /* Port guid is in network byte order.  OUI is in lower 3 bytes. */\r
        ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x02 && p_guid[2] == 0xc9 );\r
 \r
-       if( (port_guid & CL_HTON64( 0x000000ffff000000 )) !=\r
-               CL_HTON64(0x0000000200000000))\r
-       {\r
+       guid_middle = (net16_t)((port_guid & CL_HTON64( 0x000000ffff000000 )) >>24);\r
+\r
+       if (guid_middle == 2) {\r
+                       p_mac_addr->addr[0] = 0;\r
+       } else if (guid_middle == 3) {\r
+                       p_mac_addr->addr[0] = 2;\r
+       } else {\r
                return IB_INVALID_GUID;\r
        }\r
-\r
        low24 = ((uint32_t)cl_ntoh64( port_guid ) & 0x00FFFFFF);\r
 \r
-       p_mac_addr->addr[0] = p_guid[0];\r
        p_mac_addr->addr[1] = p_guid[1];\r
        p_mac_addr->addr[2] = p_guid[2];\r
        p_mac_addr->addr[3] = (uint8_t)(low24 >> 16);\r