FreeBSD/sys/dev/nxge/xgehal/xgehal-device.c
/**
 * xge_hal_rts_rth_itable_set - Set/configure indirection table (IT).
 * @hldev: HAL device handle.
 * @itable: Pointer to the indirection table
 * @itable_size: no of least significant bits to be used for hashing
 *
 * Used to set/configure indirection table.
 * It enables the required no of entries in the IT.
 * It adds entries to the IT.
 *
 * See also: xge_hal_rts_rth_clr(), xge_hal_rts_rth_set().
 */
Set/configure indirection table (IT).
@hldev: HAL device handle.
@itable: Pointer to the indirection table
@itable_size: no of least significant bits to be used for hashing

Used to set/configure indirection table.
It enables the required no of entries in the IT.
It adds entries to the IT.


Set / configure indirection table ( IT ) . @hldev : HAL device handle . @itable : Pointer to the indirection table @itable_size : no of least significant bits to be used for hashing Used to set / configure indirection table . It enables the required no of entries in the IT . It adds entries to the IT .
xge_hal_status_e
xge_hal_rts_rth_itable_set(xge_hal_device_t *hldev, u8 *itable, u32 itable_size)
{
	xge_hal_pci_bar0_t *bar0 = (xge_hal_pci_bar0_t *)(void  *)hldev->bar0;
	u64 val64;
	u32 idx;
	for (idx = 0; idx < itable_size; idx++) {
	    val64 = XGE_HAL_RTS_RTH_MAP_MEM_DATA_ENTRY_EN |
	        XGE_HAL_RTS_RTH_MAP_MEM_DATA(itable[idx]);
	    xge_os_pio_mem_write64(hldev->pdev, hldev->regh0, val64,
	                   &bar0->rts_rth_map_mem_data);
	    val64 = (XGE_HAL_RTS_RTH_MAP_MEM_CTRL_WE |
	         XGE_HAL_RTS_RTH_MAP_MEM_CTRL_STROBE |
	         XGE_HAL_RTS_RTH_MAP_MEM_CTRL_OFFSET(idx));
	    xge_os_pio_mem_write64(hldev->pdev, hldev->regh0, val64,
	                   &bar0->rts_rth_map_mem_ctrl);
	    if (__hal_device_register_poll(hldev,
	           &bar0->rts_rth_map_mem_ctrl, 0,
	           XGE_HAL_RTS_RTH_MAP_MEM_CTRL_STROBE,
	           XGE_HAL_DEVICE_CMDMEM_WAIT_MAX_MILLIS) != XGE_HAL_OK) {
	        return XGE_HAL_INF_MEM_STROBE_CMD_EXECUTING;
	    }
	}
	return XGE_HAL_OK;
}
xge_hal_status_e xge_hal_rts_rth_itable_set ( xge_hal_device_t * hldev , u8 * itable , u32 itable_size ) { xge_hal_pci_bar0_t * bar0 = ( xge_hal_pci_bar0_t * ) ( void * ) hldev -> bar0 ; u64 val64 ; u32 idx ; for ( idx = 0 ; idx < itable_size ; idx ++ ) { val64 = XGE_HAL_RTS_RTH_MAP_MEM_DATA_ENTRY_EN | XGE_HAL_RTS_RTH_MAP_MEM_DATA ( itable [ idx ] ) ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , & bar0 -> rts_rth_map_mem_data ) ; val64 = ( XGE_HAL_RTS_RTH_MAP_MEM_CTRL_WE | XGE_HAL_RTS_RTH_MAP_MEM_CTRL_STROBE | XGE_HAL_RTS_RTH_MAP_MEM_CTRL_OFFSET ( idx ) ) ; xge_os_pio_mem_write64 ( hldev -> pdev , hldev -> regh0 , val64 , & bar0 -> rts_rth_map_mem_ctrl ) ; if ( __hal_device_register_poll ( hldev , & bar0 -> rts_rth_map_mem_ctrl , 0 , XGE_HAL_RTS_RTH_MAP_MEM_CTRL_STROBE , XGE_HAL_DEVICE_CMDMEM_WAIT_MAX_MILLIS ) != XGE_HAL_OK ) { return XGE_HAL_INF_MEM_STROBE_CMD_EXECUTING ; } } return XGE_HAL_OK ; }
xge_hal_rts_rth_itable_set - Set/configure indirection table (IT).
xge_hal_rts_rth_itable_set - Set / configure indirection table ( IT ) .
/* execute */ /* poll until done */ /* upper layer may require to repeat */