xgehal-mgmtaux.c revision a23fd118e437af0a7877dd313db8fdaa3537c675
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2002-2005 Neterion, Inc. 2N/A * All right Reserved. 2N/A * Description: Xframe-family management auxiliary API implementation 2N/A * Created: 1 September 2004 * xge_hal_aux_bar0_read - Read and format Xframe BAR0 register. * @devh: HAL device handle. * @offset: Register offset in the BAR0 space. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read Xframe register from BAR0 space. The result is formatted as an ascii string. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not * XGE_HAL_ERR_INVALID_BAR_ID - BAR id is not valid. * See also: xge_hal_mgmt_reg_read(). * xge_hal_aux_bar1_read - Read and format Xframe BAR1 register. * @devh: HAL device handle. * @offset: Register offset in the BAR1 space. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read Xframe register from BAR1 space. The result is formatted as ascii string. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not * XGE_HAL_ERR_INVALID_BAR_ID - BAR id is not valid. * See also: xge_hal_mgmt_reg_read(). * xge_hal_aux_bar0_write - Write BAR0 register. * @devh: HAL device handle. * @offset: Register offset in the BAR0 space. * @value: Regsister value (to write). * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_INVALID_OFFSET - Register offset in the BAR space is not * XGE_HAL_ERR_INVALID_BAR_ID - BAR id is not valid. * See also: xge_hal_mgmt_reg_write(). * xge_hal_aux_about_read - Retrieve and format about info. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Retrieve about info (using xge_hal_mgmt_about()) and sprintf it * into the provided @retbuf. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * XGE_HAL_FAIL - Failed to retrieve the information. * See also: xge_hal_mgmt_about(), xge_hal_aux_device_dump(). * xge_hal_aux_stats_tmac_read - Read TMAC hardware statistics. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read TMAC hardware statistics. This is a subset of stats counters * from xge_hal_stats_hw_info_t{}. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_mgmt_hw_stats{}, xge_hal_stats_hw_info_t{}, * xge_hal_aux_stats_pci_read(), * xge_hal_aux_device_dump(). * xge_hal_aux_stats_rmac_read - Read RMAC hardware statistics. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read RMAC hardware statistics. This is a subset of stats counters * from xge_hal_stats_hw_info_t{}. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_mgmt_hw_stats{}, xge_hal_stats_hw_info_t{}, * xge_hal_aux_stats_pci_read(), xge_hal_aux_stats_tmac_read(), * xge_hal_aux_device_dump(). * xge_hal_aux_stats_herc_enchanced - Get Hercules hardware statistics. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read Hercules device hardware statistics. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_mgmt_hw_stats{}, xge_hal_stats_hw_info_t{}, * xge_hal_aux_stats_tmac_read(), xge_hal_aux_stats_rmac_read(), * xge_hal_aux_device_dump(). * xge_hal_aux_stats_rmac_read - Read PCI hardware statistics. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read PCI statistics counters, including number of PCI read and * write transactions, PCI retries, discards, etc. * This is a subset of stats counters from xge_hal_stats_hw_info_t{}. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_mgmt_hw_stats{}, xge_hal_stats_hw_info_t{}, * xge_hal_aux_stats_tmac_read(), xge_hal_aux_stats_rmac_read(), * xge_hal_aux_device_dump(). * xge_hal_aux_stats_hal_read - Read HAL (layer) statistics. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * XGE_HAL_INF_STATS_IS_NOT_READY - Statistics information is not * See also: xge_hal_aux_device_dump(). /* for each opened rx channel */ /* for each opened tx channel */ * xge_hal_aux_stats_sw_dev_read - Read software device statistics. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read software-maintained device statistics. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * XGE_HAL_INF_STATS_IS_NOT_READY - Statistics information is not * See also: xge_hal_aux_device_dump(). * xge_hal_aux_pci_config_read - Retrieve and format PCI Configuration * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Retrieve about info (using xge_hal_mgmt_pci_config()) and sprintf it * into the provided @retbuf. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_mgmt_pci_config(), xge_hal_aux_device_dump(). * xge_hal_aux_channel_read - Read channels information. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small. * See also: xge_hal_aux_device_dump(). /* for each opened rx channel */ /* for each opened tx channel */ * xge_hal_aux_device_dump - Dump driver "about" info and device state. * @devh: HAL device handle. * Dump driver & device "about" info and device state, * including all BAR0 registers, hardware and software statistics, PCI * See also: xge_hal_aux_about_read(), xge_hal_mgmt_reg_read(), * xge_hal_aux_pci_config_read(), xge_hal_aux_stats_sw_dev_read(), * xge_hal_aux_stats_tmac_read(), xge_hal_aux_stats_rmac_read(), * xge_hal_aux_channel_read(), xge_hal_aux_stats_hal_read(). * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small. * xge_hal_aux_driver_config_read - Read Driver configuration. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read driver configuration, * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_aux_device_config_read(). * xge_hal_aux_device_config_read - Read device configuration. * @devh: HAL device handle. * @retbuf: Buffer pointer. * @retsize: Size of the result. Cannot be greater than @bufsize. * Read device configuration, * Returns: XGE_HAL_OK - success. * XGE_HAL_ERR_INVALID_DEVICE - Device is not valid. * XGE_HAL_ERR_VERSION_CONFLICT - Version it not maching. * See also: xge_hal_aux_driver_config_read().