[ofw] [PATCH 2/4] Clean up MAC generation, add support for HP GUIDs
Fab Tillier
ftillier at windows.microsoft.com
Tue Sep 30 11:21:04 PDT 2008
This patch removes the mask_status local variable from ipoib_mac_from_guid. It also fixes the error flow (where the assertion on mask_status used to be) to return the correct status value. The assertion doesn't serve anything because mask_status at that point can only be IB_SUCCESS or IB_INVALID_GUID, the function ipoib_mac_from_guid_mask never returns anything else.
Signed-off-by: Fab Tillier <ftillier at microsoft.com>
--- \dev\openib\gen1\branches\WOF2-0\trunk\ulp\ipoib\kernel\ipoib_xfr_mgr.h Tue Sep 30 11:10:27 2008
+++ ulp\ipoib\kernel\ipoib_xfr_mgr.h Tue Sep 30 11:11:04 2008
@@ -392,14 +392,13 @@ ipoib_mac_from_guid(
{
static const guid_default_mask = 0xE7; //==0b 11100111
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 )
{
- mask_status = ipoib_mac_from_guid_mask( p_guid, guid_mask, p_mac_addr );
- if( mask_status == IB_SUCCESS )
+ status = ipoib_mac_from_guid_mask( p_guid, guid_mask, p_mac_addr );
+ if( status == IB_SUCCESS )
return IB_SUCCESS;
}
@@ -440,10 +439,7 @@ ipoib_mac_from_guid(
}
if( status == IB_SUCCESS )
- {
- ASSERT ( mask_status == IB_SUCCESS || mask_status == IB_INVALID_GUID );
- return mask_status;
- }
+ return status;
}
/* Value of zero is reserved. */
@@ -459,7 +455,7 @@ ipoib_mac_from_guid(
p_mac_addr->addr[4] = (uint8_t)(laa >> 8);
p_mac_addr->addr[5] = (uint8_t)laa;
- return mask_status;
+ return IB_SUCCESS;
}
/*
* PARAMETERS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipoib_mac.2.patch
Type: application/octet-stream
Size: 1172 bytes
Desc: ipoib_mac.2.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20080930/1ab62c33/attachment.obj>
More information about the ofw
mailing list