This patch contains fix for build break (free version only) caused by
IPOIB_PRINT macro used in ipoib_xfr_mgr.h
Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_adapter.c
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_adapter.c
(revision 3222)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_adapter.c
(revision 3228)
@@ -368,8 +368,14 @@
        /* Validate the port GUID and generate the MAC address. */
        status =
                ipoib_mac_from_guid( p_adapter->guids.port_guid.guid,
p_adapter->params.guid_mask, &p_adapter->mac);
-       if( status != IB_SUCCESS )
+       if (status == IB_INVALID_GUID_MASK)
        {
+               IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_ERROR,
+                       ("Invalid GUID mask received, rejecting it") );
+               ipoib_create_log(p_adapter->h_adapter,
GUID_MASK_LOG_INDEX, EVENT_IPOIB_WRONG_PARAMETER_WRN);
+       }
+       else if( status != IB_SUCCESS )
+       {
                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
                        ("ipoib_mac_from_guid returned %s\n", 
                        p_adapter->p_ifc->get_err_str( status )) );
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_port.c
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_port.c (revision 3222)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_port.c (revision 3228)
@@ -1823,8 +1823,14 @@
 #else  /* IPOIB_INLINE_RECV */
 
p_desc->p_buf->ib.grh.src_gid.unicast.interface_id,
p_port->p_adapter->params.guid_mask, &mac );
 #endif /* IPOIB_INLINE_RECV */
-                       if( status != IB_SUCCESS )
+                       if (status == IB_INVALID_GUID_MASK)
                        {
+                               IPOIB_PRINT( TRACE_LEVEL_WARNING,
IPOIB_DBG_ERROR,
+                                       ("Invalid GUID mask received,
rejecting it") );
+
ipoib_create_log(p_port->p_adapter->h_adapter, GUID_MASK_LOG_INDEX,
EVENT_IPOIB_WRONG_PARAMETER_WRN);
+                       }
+                       else if( status != IB_SUCCESS )
+                       {
                                IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,
                                        ("ipoib_mac_from_guid returned
%s\n",
 
p_port->p_adapter->p_ifc->get_err_str( status )) );
@@ -2316,6 +2322,13 @@
                p_cid[1] =  HW_ADDR_LEN +1;// CID length 
                p_cid[2] =  DHCP_HW_TYPE_ETH;// CID type 
                status = ipoib_mac_from_guid( gid.unicast.interface_id,
p_port->p_adapter->params.guid_mask, (mac_addr_t*)&p_cid[3] );
+               if (status == IB_INVALID_GUID_MASK)
+               {
+                       IPOIB_PRINT( TRACE_LEVEL_WARNING,
IPOIB_DBG_ERROR,
+                               ("Invalid GUID mask received, rejecting
it") );
+                       ipoib_create_log(p_port->p_adapter->h_adapter,
GUID_MASK_LOG_INDEX, EVENT_IPOIB_WRONG_PARAMETER_WRN);
+                       status = IB_SUCCESS;
+               }
                p_cid[HW_ADDR_LEN + 3] = DHCP_OPT_END; //terminate tag
        }
        IPOIB_EXIT( IPOIB_DBG_RECV );
@@ -2426,8 +2439,14 @@
                /* Copy the src GID to allow aligned access */
                cl_memcpy( &gid, &p_ib_arp->src_hw.gid, sizeof(ib_gid_t)
);
                status = ipoib_mac_from_guid( gid.unicast.interface_id,
p_port->p_adapter->params.guid_mask, &mac );
-               if( status != IB_SUCCESS )
+               if (status == IB_INVALID_GUID_MASK)
                {
+                       IPOIB_PRINT( TRACE_LEVEL_WARNING,
IPOIB_DBG_ERROR,
+                               ("Invalid GUID mask received, rejecting
it") );
+                       ipoib_create_log(p_port->p_adapter->h_adapter,
GUID_MASK_LOG_INDEX, EVENT_IPOIB_WRONG_PARAMETER_WRN);
+               }
+               else if( status != IB_SUCCESS )
+               {
                        IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR,
IPOIB_DBG_ERROR,
                                ("ipoib_mac_from_guid returned %s\n",
                                p_port->p_adapter->p_ifc->get_err_str(
status )) );
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.c
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.c
(revision 3222)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.c
(revision 3228)
@@ -150,6 +150,8 @@
 
 IPOIB_REG_ENTRY HCARegTable[] = {
        // reg value name             If Required  Offset in parentr
struct             Field size                  Default         Min
Max
+       {NDIS_STRING_CONST("GUIDMask"),         1,
IPOIB_OFFSET(guid_mask),             IPOIB_SIZE(guid_mask),          0,
0,    MAX_GUID_MAX},
+       /* GUIDMask should be the first element */
        {NDIS_STRING_CONST("RqDepth"),          1,
IPOIB_OFFSET(rq_depth),              IPOIB_SIZE(rq_depth),
512,        128,    1024},
        {NDIS_STRING_CONST("RqLowWatermark"),   0,
IPOIB_OFFSET(rq_low_watermark),      IPOIB_SIZE(rq_low_watermark),   4,
2,      8},
        {NDIS_STRING_CONST("SqDepth"),          1,
IPOIB_OFFSET(sq_depth),              IPOIB_SIZE(sq_depth),
512,        128,    1024},
@@ -160,16 +162,14 @@
        {NDIS_STRING_CONST("RecvRatio"),        1,
IPOIB_OFFSET(recv_pool_ratio),       IPOIB_SIZE(recv_pool_ratio),    1,
1,      10},
        {NDIS_STRING_CONST("PayloadMtu"),       1,
IPOIB_OFFSET(payload_mtu),           IPOIB_SIZE(payload_mtu),
2044,       60,   4092},
        {NDIS_STRING_CONST("lso"),              0, IPOIB_OFFSET(lso),
IPOIB_SIZE(lso),                0,          0,      1},
-       {NDIS_STRING_CONST("MCLeaveRescan"),    1,
IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),
260,        1,    3600},
-       {NDIS_STRING_CONST("GUIDMask"),         1,
IPOIB_OFFSET(guid_mask),             IPOIB_SIZE(guid_mask),          0,
0,    MAX_GUID_MAX}
+       {NDIS_STRING_CONST("MCLeaveRescan"),    1,
IPOIB_OFFSET(mc_leave_rescan),       IPOIB_SIZE(mc_leave_rescan),
260,        1,    3600}
        
-       
 };  
 
 #define IPOIB_NUM_REG_PARAMS (sizeof (HCARegTable) /
sizeof(IPOIB_REG_ENTRY))
 
 
-static void
+void
 ipoib_create_log(
        NDIS_HANDLE h_adapter,
        UINT ind,
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.h
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.h
(revision 3222)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.h
(revision 3228)
@@ -119,9 +119,14 @@
 *              List of adapters in the bundle.  The adapter at the head
is the
 *              primary adapter of the bundle.
 *********/
+void
+ipoib_create_log(
+       NDIS_HANDLE h_adapter,
+       UINT ind,
+       ULONG eventLogMsgId);
 
+#define GUID_MASK_LOG_INDEX 0
 
-
 void
 ipoib_resume_oids(
        IN                              ipoib_adapter_t* const
p_adapter );
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
(revision 3222)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
(revision 3228)
@@ -291,7 +291,7 @@
        IN                              uint32_t
guid_mask,
                OUT                     mac_addr_t* const
p_mac_addr )
 {
-#define MAC_ADDR_SIZE 6
+       static const mac_addr_size =  HW_ADDR_LEN;
        uint8_t i;
        const uint8_t   *p_guid = (const uint8_t*)&port_guid;
        int digit_counter = 0;
@@ -301,22 +301,21 @@
        for (i = 7; guid_mask; guid_mask >>= 1, --i) {
                if (guid_mask & 1 ) {
                        ++digit_counter;
-                       if (digit_counter > MAC_ADDR_SIZE) {
+                       if (digit_counter > mac_addr_size) {
                                //to avoid negative index
                                return IB_INVALID_GUID_MASK;
                        }
-                       p_mac_addr->addr[MAC_ADDR_SIZE - digit_counter]
= p_guid [i];
+                       p_mac_addr->addr[mac_addr_size - digit_counter]
= p_guid [i];
                }
        }
                // check for the mask validity: it should have 6
non-zero bits
-               if (digit_counter != MAC_ADDR_SIZE) {
+               if (digit_counter != mac_addr_size) {
                        return IB_INVALID_GUID_MASK;
                }
                
        return IB_SUCCESS;
 }
 
-
 /*
 * PARAMETERS
 *      port_guid
@@ -372,66 +371,7 @@
        return IB_SUCCESS;
 }
 
-/****f* IPOIB/ipoib_mac_from_supermicro_guid
-* NAME
-*      ipoib_mac_from_supermicro_guid
-*
-* DESCRIPTION
-*      Generates an ethernet MAC address given a supermicro port GUID.
-*
-* SYNOPSIS
-*/
-static inline ib_api_status_t
-ipoib_mac_from_supermicro_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] == 0x30 && p_guid[2] ==
0x48 
-       && p_guid[3] == 0xff && p_guid[4] == 0xff);
-
-       p_mac_addr->addr[0] = 0;
-       p_mac_addr->addr[1] = 0x30;
-       p_mac_addr->addr[2] = 0x48; 
-       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;
-}
-
-/****f* IPOIB/ipoib_mac_from_cisco_guid
-* NAME
-*      ipoib_mac_from_cisco_guid
-*
-* DESCRIPTION
-*      Generates an ethernet MAC address given a Cisco port GUID.
-*
-* SYNOPSIS
-*/
-static inline ib_api_status_t
-ipoib_mac_from_cisco_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] == 0x5 && p_guid[2] ==
0xad);
-
-       p_mac_addr->addr[0] = 0;
-       p_mac_addr->addr[1] = 0x5;
-       p_mac_addr->addr[2] = 0xad; 
-       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;
-}
-
-
 /****f* IPOIB/ipoib_mac_from_guid
 * NAME
 *      ipoib_mac_from_guid
@@ -449,26 +389,26 @@
                )
 {
        static const guid_default_mask = 0xE7; //==0b 11100111
-       ib_api_status_t status;
+       ib_api_status_t status = IB_INVALID_GUID;
+       ib_api_status_t mask_status = IB_SUCCESS;
        const uint8_t   *p_guid = (const uint8_t*)&port_guid;
        uint32_t                laa;
 
        if ( guid_mask ) 
        {
-               status = ipoib_mac_from_general_guid(port_guid,
guid_mask, p_mac_addr);
-               if( status == IB_SUCCESS )
+               mask_status = ipoib_mac_from_general_guid(port_guid,
guid_mask, p_mac_addr);
+               if( mask_status == IB_SUCCESS )
                                return IB_SUCCESS;
                //otherwise, mask was invalid, getting back to standard
flow
-               if (status == IB_INVALID_GUID_MASK)
+               /*if (status == IB_INVALID_GUID_MASK)
                {
                        IPOIB_PRINT( TRACE_LEVEL_WARNING,
IPOIB_DBG_ERROR,
                        ("Invalid GUID mask received, rejecting it") );
-               }
+               }*/
        }
                        
        if( p_guid[0] == 0 ) 
        {
-               status = IB_INVALID_GUID;
                if( p_guid[1] == 0x02 && p_guid[2] == 0xc9 )
                {
                        status = ipoib_mac_from_mlx_guid( port_guid,
p_mac_addr );
@@ -503,9 +443,11 @@
                        status =ipoib_mac_from_general_guid(port_guid,
guid_default_mask, p_mac_addr);
                }
                
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
-               ASSERT(status != IB_INVALID_GUID_MASK);
+               if (status == IB_SUCCESS )
+               {
+                       ASSERT ( mask_status == IB_SUCCESS ||
mask_status == IB_INVALID_GUID_MASK );
+                       return mask_status; 
+               }
        }
 
        /* Value of zero is reserved. */
@@ -521,7 +463,7 @@
        p_mac_addr->addr[4] = (uint8_t)(laa >> 8);
        p_mac_addr->addr[5] = (uint8_t)laa;
        
-       return IB_SUCCESS;
+       return mask_status;
 }
 /*
 * PARAMETERS 

-----Original Message-----
From: Alex Naslednikov 
Sent: Monday, September 22, 2008 7:09 PM
To: Alex Naslednikov; [email protected]; Tzachi Dar
Cc: Ishai Rabinovitz
Subject: [ofw] [IPoIB][patch 3/3] Adding support to dell guid and
user-define mask for guid generation - revisited

This patch reuses ipoib_mac_from_general_guid and contains important
bugfix Signed-off by: Alexander Naslednikov (xalex at mellanox.co.il)
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_adapter.c
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_adapter.c
(revision 3221)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_adapter.c
(revision 3222)
@@ -121,7 +121,9 @@
 NDIS_STATUS
 ipoib_get_adapter_params(
        IN                              NDIS_HANDLE* const
wrapper_config_context,
-       IN      OUT                     ipoib_adapter_t
*p_adapter );
+       IN      OUT                     ipoib_adapter_t
*p_adapter,
+       OUT                             PUCHAR
*p_mac,
+       OUT                             UINT
*p_len);
 
 
 /* Implementation */
@@ -134,6 +136,8 @@
        ipoib_adapter_t         *p_adapter;
        ib_api_status_t         status;
        cl_status_t                     cl_status;
+       PUCHAR                          mac;
+       UINT                            len;
 
        IPOIB_ENTER( IPOIB_DBG_INIT );
 
@@ -185,6 +189,17 @@
                return IB_ERROR;
        }
 
+       /* Read configuration parameters. */
+       status = ipoib_get_adapter_params( wrapper_config_context,
+               p_adapter , &mac, &len);
+       if( status != NDIS_STATUS_SUCCESS )
+       {
+               cl_obj_destroy( &p_adapter->obj );
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
+                       ("ipoib_get_adapter_params returned 0x%.8x.\n",
status) );
+               return status;
+       }
+               
        status = adapter_init( p_adapter );
        if( status != IB_SUCCESS )
        {
@@ -195,15 +210,23 @@
                return status;
        }
 
-       /* Read configuration parameters. */
-       status = ipoib_get_adapter_params( wrapper_config_context,
-               p_adapter );
-       if( status != NDIS_STATUS_SUCCESS )
+       ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr,
p_adapter->mac.addr );
+       /* If there is a NetworkAddress override in registry, use it */
+       if( (status == NDIS_STATUS_SUCCESS) && (len == HW_ADDR_LEN) )
        {
-               cl_obj_destroy( &p_adapter->obj );
-               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,
-                       ("ipoib_get_adapter_params returned 0x%.8x.\n",
status) );
-               return status;
+               if( ETH_IS_MULTICAST(mac) || ETH_IS_BROADCAST(mac) ||
+                       !ETH_IS_LOCALLY_ADMINISTERED(mac) )
+               {
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_INIT,
+                               ("Overriding NetworkAddress is invalid -
"
+                               "%02x-%02x-%02x-%02x-%02x-%02x\n",
+                               mac[0], mac[1], mac[2],
+                               mac[3], mac[4], mac[5]) );
+               }
+               else
+       {
+                       ETH_COPY_NETWORK_ADDRESS(
p_adapter->params.conf_mac.addr, mac );
+               }
        }
 
        *pp_adapter = p_adapter;
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.c
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.c
(revision 3221)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_driver.c
(revision 3222)
@@ -484,13 +484,13 @@
 NDIS_STATUS
 ipoib_get_adapter_params(
        IN                              NDIS_HANDLE* const
wrapper_config_context,
-       IN      OUT                     ipoib_adapter_t
*p_adapter )
+       IN      OUT                     ipoib_adapter_t
*p_adapter,
+       OUT                             PUCHAR
*p_mac,
+       OUT                             UINT
*p_len)
 {
        NDIS_STATUS                                             status;
        NDIS_HANDLE
h_config;
        NDIS_CONFIGURATION_PARAMETER    *p_param;
-       PUCHAR                                                  mac;
-       UINT                                                    len;
        UINT                            value;
        PIPOIB_REG_ENTRY                pRegEntry;
        UINT                            i;
@@ -598,26 +598,8 @@
                        p_adapter->params.rq_depth /
p_adapter->params.rq_low_watermark;
 
        p_adapter->params.xfer_block_size = (sizeof(eth_hdr_t) +
p_adapter->params.payload_mtu);
-       NdisReadNetworkAddress( &status, &mac, &len, h_config );
+       NdisReadNetworkAddress( &status, p_mac, p_len, h_config );
 
-       ETH_COPY_NETWORK_ADDRESS( p_adapter->params.conf_mac.addr,
p_adapter->mac.addr );
-       /* If there is a NetworkAddress override in registry, use it */
-       if( (status == NDIS_STATUS_SUCCESS) && (len == HW_ADDR_LEN) )
-       {
-               if( ETH_IS_MULTICAST(mac) || ETH_IS_BROADCAST(mac) ||
-                       !ETH_IS_LOCALLY_ADMINISTERED(mac) )
-               {
-                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_INIT,
-                               ("Overriding NetworkAddress is invalid -
"
-                               "%02x-%02x-%02x-%02x-%02x-%02x\n",
-                               mac[0], mac[1], mac[2],
-                               mac[3], mac[4], mac[5]) );
-               }
-               else
-               {
-                       ETH_COPY_NETWORK_ADDRESS(
p_adapter->params.conf_mac.addr, mac );
-               }
-       }
 
        NdisCloseConfiguration( h_config );
 
Index: D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
===================================================================
--- D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
(revision 3221)
+++ D:/Windows/MLNX_WINOF/ulp/ipoib/kernel/ipoib_xfr_mgr.h
(revision 3222)
@@ -431,53 +431,7 @@
        return IB_SUCCESS;
 }
 
-/****f* IPOIB/ipoib_mac_from_hp_guid
-* NAME
-*      ipoib_mac_from_hp_guid
-*
-* DESCRIPTION
-*      Generates an ethernet MAC address given a HP port GUID.
-*
-* SYNOPSIS
-*/
-static inline ib_api_status_t
-ipoib_mac_from_hp_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] == 0x1a && p_guid[2] ==
0x4b);
-
-       p_mac_addr->addr[0] = 0;
-       p_mac_addr->addr[1] = 0x1a;
-       p_mac_addr->addr[2] = 0x4b; 
-       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
-*              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.
-*
-* SEE ALSO
-*      IPOIB
-*********/
-
-
 /****f* IPOIB/ipoib_mac_from_guid
 * NAME
 *      ipoib_mac_from_guid
@@ -505,53 +459,53 @@
                if( status == IB_SUCCESS )
                                return IB_SUCCESS;
                //otherwise, mask was invalid, getting back to standard
flow
+               if (status == IB_INVALID_GUID_MASK)
+               {
+                       IPOIB_PRINT( TRACE_LEVEL_WARNING,
IPOIB_DBG_ERROR,
+                       ("Invalid GUID mask received, rejecting it") );
+               }
        }
                        
        if( p_guid[0] == 0 ) 
        {
+               status = IB_INVALID_GUID;
                if( p_guid[1] == 0x02 && p_guid[2] == 0xc9 )
                {
                        status = ipoib_mac_from_mlx_guid( port_guid,
p_mac_addr );
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
                }
                else if( p_guid[1] == 0x08 && p_guid[2] == 0xf1 )
                {
                        status = ipoib_mac_from_voltaire_guid(
port_guid, p_mac_addr );
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
                }
                else if( p_guid[1] == 0x30 && p_guid[2] == 0x48 )
                {
-                       status = ipoib_mac_from_supermicro_guid(
port_guid, p_mac_addr );
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
+                       //Supermicro GUID
+                       status =ipoib_mac_from_general_guid(port_guid,
guid_default_mask, 
+p_mac_addr);
                }
                else if( p_guid[1] == 0x05 && p_guid[2] == 0xad )
                {
-                       status = ipoib_mac_from_cisco_guid( port_guid,
p_mac_addr );
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
+                       //Cisco GUID 
+                       status =ipoib_mac_from_general_guid(port_guid,
guid_default_mask, 
+p_mac_addr);
                }        
                /* Port guid is in network byte order.  OUI is in lower
3 bytes. */
                else if( p_guid[1] == 0x06 && p_guid[2] == 0x6a )
                {
                        status = ipoib_mac_from_sst_guid( port_guid,
p_mac_addr );
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
                }
                else if( p_guid[1] == 0x1a && p_guid[2] == 0x4b )
                {
-                       status = ipoib_mac_from_hp_guid( port_guid,
p_mac_addr );
-                       if( status == IB_SUCCESS )
-                               return IB_SUCCESS;
+                       //HP GUID
+                       status =ipoib_mac_from_general_guid(port_guid,
guid_default_mask, 
+p_mac_addr);
                }
                else if( p_guid[1] == 0x18 && p_guid[2] == 0x8b )
                {
-                       status = ipoib_mac_from_dell_guid( port_guid,
p_mac_addr );
+                       //DELL GUID
+                       status =ipoib_mac_from_general_guid(port_guid,
guid_default_mask, p_mac_addr);
+               }
+               
                        if( status == IB_SUCCESS )
                                return IB_SUCCESS;
-               }
+               ASSERT(status != IB_INVALID_GUID_MASK);
        }
 
        /* Value of zero is reserved. */

Attachment: ipoib_guid4.diff
Description: ipoib_guid4.diff

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

Reply via email to