[ofw][patch] added new case in ipoib_mac_from_guid to handle hp oui

Tzachi Dar tzachid at mellanox.co.il
Thu Jun 19 07:14:00 PDT 2008


Applied in revision 1287.

Thanks
Tzachi 

> -----Original Message-----
> From: ofw-bounces at lists.openfabrics.org 
> [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of 
> Anatoly Greenblatt
> Sent: Thursday, June 19, 2008 4:09 PM
> To: ofw at lists.openfabrics.org
> Subject: [ofw][patch] added new case in ipoib_mac_from_guid 
> to handle hp oui
> 
>  <<mac_generation_from_hp_guid.patch>> Index:
> ulp/ipoib/kernel/ipoib_xfr_mgr.h
> ===================================================================
> --- ulp/ipoib/kernel/ipoib_xfr_mgr.h	(revision 1269)
> +++ ulp/ipoib/kernel/ipoib_xfr_mgr.h	(working copy)
> @@ -337,7 +337,35 @@
>  	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
> @@ -407,8 +435,14 @@
>  			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;
> +		}
>  	}
> +
>  	/* Value of zero is reserved. */
>  	laa = cl_atomic_inc( &g_ipoib.laa_idx );
>  
> 



More information about the ofw mailing list