FreeBSD/sys/dev/nxge/xgehal/xgehal-device.c
/*
 * xge__hal_device_rts_mac_enable
 *
 * @devh: HAL device handle.
 * @index: index number where the MAC addr will be stored
 * @macaddr: MAC address
 *
 * - Enable RTS steering for the given MAC address. This function has to be
 * called with lock acquired.
 *
 * NOTE:
 * 1. ULD has to call this function with the index value which
 *    statisfies the following condition:
 *  ring_num = (index % 8)
 * 2.ULD also needs to make sure that the index is not
 *   occupied by any MAC address. If that index has any MAC address
 *   it will be overwritten and HAL will not check for it.
 *
 */
xge__hal_device_rts_mac_enable
@devh: HAL device handle.
@index: index number where the MAC addr will be stored
@macaddr: MAC address

- Enable RTS steering for the given MAC address. This function has to be
called with lock acquired.

1. ULD has to call this function with the index value which
statisfies the following condition:
ring_num = (index % 8)
2.ULD also needs to make sure that the index is not
occupied by any MAC address. If that index has any MAC address
it will be overwritten and HAL will not check for it.
xge__hal_device_rts_mac_enable @devh : HAL device handle . @index : index number where the MAC addr will be stored @macaddr : MAC address - Enable RTS steering for the given MAC address . This function has to be called with lock acquired . 1 . ULD has to call this function with the index value which statisfies the following condition : ring_num = ( index % 8 ) 2 . ULD also needs to make sure that the index is not occupied by any MAC address . If that index has any MAC address it will be overwritten and HAL will not check for it .
xge_hal_status_e
xge_hal_device_rts_mac_enable(xge_hal_device_h devh, int index, macaddr_t macaddr)
{
	int max_addr = XGE_HAL_MAX_MAC_ADDRESSES;
	xge_hal_status_e status;
	xge_hal_device_t *hldev = (xge_hal_device_t *)devh;
	if (xge_hal_device_check_id(hldev) == XGE_HAL_CARD_HERC)
	    max_addr = XGE_HAL_MAX_MAC_ADDRESSES_HERC;
	if ( index >= max_addr )
	    return XGE_HAL_ERR_OUT_OF_MAC_ADDRESSES;
	status = xge_hal_device_macaddr_set(hldev, index, macaddr);
	if (status != XGE_HAL_OK) {
	    xge_debug_device(XGE_ERR, "%s",
	        "Not able to set the mac addr");
	    return status;
	}
	return xge_hal_device_rts_section_enable(hldev, index);
}
xge_hal_status_e xge_hal_device_rts_mac_enable ( xge_hal_device_h devh , int index , macaddr_t macaddr ) { int max_addr = XGE_HAL_MAX_MAC_ADDRESSES ; xge_hal_status_e status ; xge_hal_device_t * hldev = ( xge_hal_device_t * ) devh ; if ( xge_hal_device_check_id ( hldev ) == XGE_HAL_CARD_HERC ) max_addr = XGE_HAL_MAX_MAC_ADDRESSES_HERC ; if ( index >= max_addr ) return XGE_HAL_ERR_OUT_OF_MAC_ADDRESSES ; status = xge_hal_device_macaddr_set ( hldev , index , macaddr ) ; if ( status != XGE_HAL_OK ) { xge_debug_device ( XGE_ERR , " " , " " ) ; return status ; } return xge_hal_device_rts_section_enable ( hldev , index ) ; }
xge__hal_device_rts_mac_enable
 @devh: HAL device handle.
xge__hal_device_rts_mac_enable @devh : HAL device handle .
/*
	 * Set the MAC address at the given location marked by index.
	 */