This patch adds support for Dell GUID
Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
(revision 3206)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
(revision 3214)
@@ -231,6 +231,35 @@
        
        return IB_SUCCESS;
 }
+
+/****f* IPOIB/ipoib_mac_from_dell_guid
+* NAME
+*      ipoib_mac_from_dell_guid
+*
+* DESCRIPTION
+*      Generates an ethernet MAC address given a DELL port GUID.
+*
+* SYNOPSIS
+*/
+static inline ib_api_status_t
+ipoib_mac_from_dell_guid(
+       IN              const   net64_t
port_guid,
+               OUT                     mac_addr_t* const
p_mac_addr )
+{
+       const uint8_t   *p_guid = (const uint8_t*)&port_guid;
+
+       /* Port guid is in network byte order.  OUI is in lower 3 bytes.
*/
+       ASSERT( p_guid[0] == 0x00 && p_guid[1] == 0x18 && p_guid[2] ==
0x8b );
+       
+       p_mac_addr->addr[0] = p_guid[0];
+       p_mac_addr->addr[1] = p_guid[1];
+       p_mac_addr->addr[2] = p_guid[2];
+       p_mac_addr->addr[3] = p_guid[5];
+       p_mac_addr->addr[4] = p_guid[6];
+       p_mac_addr->addr[5] = p_guid[7];
+       
+       return IB_SUCCESS;
+}
 /*
 * PARAMETERS
 *      port_guid
@@ -244,6 +273,20 @@
 *      IB_SUCCESS
 *              The MAC address was successfully converted.
 *
+*********/
+/*
+* PARAMETERS
+*      port_guid
+*              The port GUID, in network byte order, for which to
generate a
+*              MAC address.
+*
+*      p_mac_addr
+*              Pointer to a mac address in which to store the results.
+*
+* RETURN VALUES
+*      IB_SUCCESS
+*              The MAC address was successfully converted.
+*
 *      IB_INVALID_GUID
 *              The port GUID provided was not a known GUID format.
 *
@@ -444,6 +487,12 @@
                        if( status == IB_SUCCESS )
                                return IB_SUCCESS;
                }
+               else if( p_guid[1] == 0x18 && p_guid[2] == 0x8b )
+               {
+                       status = ipoib_mac_from_dell_guid( port_guid,
p_mac_addr );
+                       if( status == IB_SUCCESS )
+                               return IB_SUCCESS;
+               }
        }
 
        /* Value of zero is reserved. */

Attachment: ipoib_guid1.diff
Description: ipoib_guid1.diff

_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to