[IPoIB] This patch adds support for new GUID type. [mlnx: 3213-3214]
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 24 Sep 2008 17:40:50 +0000 (17:40 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Wed, 24 Sep 2008 17:40:50 +0000 (17:40 +0000)
Signed-off by: Alexander Naslednikov

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1604 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/ipoib_xfr_mgr.h

index 96c1373..02baee2 100644 (file)
@@ -231,6 +231,49 @@ ipoib_mac_from_mlx_guid(
        \r
        return IB_SUCCESS;\r
 }\r
+\r
+/****f* IPOIB/ipoib_mac_from_dell_guid\r
+* NAME\r
+*      ipoib_mac_from_dell_guid\r
+*\r
+* DESCRIPTION\r
+*      Generates an ethernet MAC address given a DELL port GUID.\r
+*\r
+* SYNOPSIS\r
+*/\r
+static inline ib_api_status_t\r
+ipoib_mac_from_dell_guid(\r
+       IN              const   net64_t                                         port_guid,\r
+               OUT                     mac_addr_t* const                       p_mac_addr )\r
+{\r
+       const uint8_t   *p_guid = (const uint8_t*)&port_guid;\r
+\r
+       /* Port guid is in network byte order.  OUI is in lower 3 bytes. */\r
+       ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x18 && p_guid[2] == 0x8b );\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] = p_guid[5];\r
+       p_mac_addr->addr[4] = p_guid[6];\r
+       p_mac_addr->addr[5] = p_guid[7];\r
+       \r
+       return IB_SUCCESS;\r
+}\r
+/*\r
+* PARAMETERS\r
+*      port_guid\r
+*              The port GUID, in network byte order, for which to generate a\r
+*              MAC address.\r
+*\r
+*      p_mac_addr\r
+*              Pointer to a mac address in which to store the results.\r
+*\r
+* RETURN VALUES\r
+*      IB_SUCCESS\r
+*              The MAC address was successfully converted.\r
+*\r
+*********/\r
 /*\r
 * PARAMETERS\r
 *      port_guid\r
@@ -444,6 +487,12 @@ ipoib_mac_from_guid(
                        if( status == IB_SUCCESS )\r
                                return IB_SUCCESS;\r
                }\r
+               else if( p_guid[1] == 0x18 && p_guid[2] == 0x8b )\r
+               {\r
+                       status = ipoib_mac_from_dell_guid( port_guid, p_mac_addr );\r
+                       if( status == IB_SUCCESS )\r
+                               return IB_SUCCESS;\r
+               }\r
        }\r
 \r
        /* Value of zero is reserved. */\r