/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright (c) 2002-2006 Neterion, Inc.
*/
#include "xgehal-mgmt.h"
#include "xgehal-driver.h"
#include "xgehal-device.h"
#ifdef XGE_OS_HAS_SNPRINTF
if (bufsize <= 0) return XGE_HAL_ERR_OUT_OF_SPACE; \
XGE_HAL_AUX_SEPA, value); \
#else
if (bufsize <= 0) return XGE_HAL_ERR_OUT_OF_SPACE; \
return XGE_HAL_ERR_OUT_OF_SPACE;
#endif
}
}
/**
* xge_hal_aux_bar0_read - Read and format Xframe BAR0 register.
* @devh: HAL device handle.
* @offset: Register offset in the BAR0 space.
* @bufsize: Buffer size.
* @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
* valid.
* XGE_HAL_ERR_INVALID_BAR_ID - BAR id is not valid.
*
* See also: xge_hal_mgmt_reg_read().
*/
int *retsize)
{
if (status != XGE_HAL_OK) {
return status;
}
if (bufsize < XGE_OS_SPRINTF_STRLEN) {
return XGE_HAL_ERR_OUT_OF_SPACE;
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_bar1_read - Read and format Xframe BAR1 register.
* @devh: HAL device handle.
* @offset: Register offset in the BAR1 space.
* @bufsize: Buffer size.
* @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
* valid.
* XGE_HAL_ERR_INVALID_BAR_ID - BAR id is not valid.
*
* See also: xge_hal_mgmt_reg_read().
*/
int *retsize)
{
if (status != XGE_HAL_OK)
return status;
if (bufsize < XGE_OS_SPRINTF_STRLEN)
return XGE_HAL_ERR_OUT_OF_SPACE;
return XGE_HAL_OK;
}
/**
* xge_hal_aux_bar0_write - Write BAR0 register.
* @devh: HAL device handle.
* @offset: Register offset in the BAR0 space.
* @value: Regsister value (to write).
*
* Write BAR0 register.
*
* 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
* valid.
* XGE_HAL_ERR_INVALID_BAR_ID - BAR id is not valid.
*
* See also: xge_hal_mgmt_reg_write().
*/
{
if (status != XGE_HAL_OK) {
return status;
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_about_read - Retrieve and format about info.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
sizeof(xge_hal_mgmt_about_info_t));
if (status != XGE_HAL_OK) {
return status;
}
__HAL_AUX_ENTRY("transponder_temperature",
return XGE_HAL_OK;
}
/**
* xge_hal_aux_stats_tmac_read - Read TMAC hardware statistics.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
sizeof(xge_hal_mgmt_hw_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
__HAL_AUX_ENTRY("tmac_drop_frms", (unsigned long long)
__HAL_AUX_ENTRY("tmac_pause_ctrl_frms", (unsigned long long)
__HAL_AUX_ENTRY("tmac_ttl_less_fb_octets", (unsigned long long)
__HAL_AUX_ENTRY("tmac_vld_ip_octets", (unsigned long long)
__HAL_AUX_ENTRY("tmac_tcp", (unsigned long long)
} else {
int i;
sizeof(xge_hal_mgmt_pcim_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
for (i = 0; i < XGE_HAL_MAC_LINKS; i++) {
__hal_aux_pci_link_info("tx_frms", i,
tx_frms);
__hal_aux_pci_link_info("tx_ttl_eth_octets",
i, tx_ttl_eth_octets );
__hal_aux_pci_link_info("tx_data_octets", i,
__hal_aux_pci_link_info("tx_mcst_frms", i,
__hal_aux_pci_link_info("tx_bcst_frms", i,
__hal_aux_pci_link_info("tx_ucst_frms", i,
__hal_aux_pci_link_info("tx_tagged_frms", i,
__hal_aux_pci_link_info("tx_vld_ip", i,
__hal_aux_pci_link_info("tx_vld_ip_octets", i,
__hal_aux_pci_link_info("tx_icmp", i,
tx_icmp);
__hal_aux_pci_link_info("tx_tcp", i,
tx_tcp);
__hal_aux_pci_link_info("tx_rst_tcp", i,
__hal_aux_pci_link_info("tx_udp", i,
tx_udp);
__hal_aux_pci_link_info("tx_unknown_protocol", i,
__hal_aux_pci_link_info("tx_parse_error", i,
__hal_aux_pci_link_info("tx_pause_ctrl_frms", i,
__hal_aux_pci_link_info("tx_lacpdu_frms", i,
__hal_aux_pci_link_info("tx_marker_pdu_frms", i,
__hal_aux_pci_link_info("tx_marker_resp_pdu_frms", i,
__hal_aux_pci_link_info("tx_drop_ip", i,
__hal_aux_pci_link_info("tx_xgmii_char1_match", i,
__hal_aux_pci_link_info("tx_xgmii_char2_match", i,
__hal_aux_pci_link_info("tx_xgmii_column1_match", i,
__hal_aux_pci_link_info("tx_xgmii_column2_match", i,
__hal_aux_pci_link_info("tx_drop_frms", i,
__hal_aux_pci_link_info("tx_any_err_frms", i,
}
for (i = 0; i < XGE_HAL_MAC_AGGREGATORS; i++) {
__hal_aux_pci_aggr_info("tx_mcst_frms", i,
__hal_aux_pci_aggr_info("tx_bcst_frms", i,
__hal_aux_pci_aggr_info("tx_discarded_frms", i,
__hal_aux_pci_aggr_info("tx_errored_frms", i,
}
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_stats_rmac_read - Read RMAC hardware statistics.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
sizeof(xge_hal_mgmt_hw_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
__HAL_AUX_ENTRY("rmac_fcs_err_frms", (unsigned long long)
__HAL_AUX_ENTRY("mac_drop_frms", (unsigned long long)
"%u");
"%u");
__HAL_AUX_ENTRY("rmac_out_rng_len_err_frms",
__HAL_AUX_ENTRY("rmac_in_rng_len_err_frms",
__HAL_AUX_ENTRY("rmac_long_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_pause_ctrl_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_unsup_ctrl_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_accepted_ucst_frms",
"%u");
__HAL_AUX_ENTRY("rmac_accepted_nucst_frms",
__HAL_AUX_ENTRY("rmac_ttl_less_fb_octets", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_frms", (unsigned long long)
__HAL_AUX_ENTRY("reserved_2", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_64_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_65_127_frms", (unsigned long long)
__HAL_AUX_ENTRY("reserved_5", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_128_255_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_256_511_frms", (unsigned long long)
__HAL_AUX_ENTRY("reserved_6", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_512_1023_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ttl_1024_1518_frms", (unsigned long long)
__HAL_AUX_ENTRY("rmac_ip_octets", (unsigned long long)
__HAL_AUX_ENTRY("rmac_tcp", (unsigned long long)
__HAL_AUX_ENTRY("rmac_xgmii_err_sym", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q0", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q1", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q2", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q3", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q4", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q5", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q6", (unsigned long long)
__HAL_AUX_ENTRY("rmac_frms_q7", (unsigned long long)
__HAL_AUX_ENTRY("rmac_xgmii_data_err_cnt", (unsigned long long)
__HAL_AUX_ENTRY("rmac_xgmii_ctrl_err_cnt", (unsigned long long)
} else {
int i;
sizeof(xge_hal_mgmt_pcim_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
for (i = 0; i < XGE_HAL_MAC_LINKS; i++) {
__hal_aux_pci_link_info("rx_ttl_frms", i,
__hal_aux_pci_link_info("rx_vld_frms", i,
__hal_aux_pci_link_info("rx_offld_frms", i,
__hal_aux_pci_link_info("rx_ttl_eth_octets", i,
__hal_aux_pci_link_info("rx_data_octets", i,
__hal_aux_pci_link_info("rx_offld_octets", i,
__hal_aux_pci_link_info("rx_vld_mcst_frms", i,
__hal_aux_pci_link_info("rx_vld_bcst_frms", i,
__hal_aux_pci_link_info("rx_accepted_ucst_frms", i,
__hal_aux_pci_link_info("rx_accepted_nucst_frms", i,
__hal_aux_pci_link_info("rx_tagged_frms", i,
__hal_aux_pci_link_info("rx_long_frms", i,
__hal_aux_pci_link_info("rx_usized_frms", i,
__hal_aux_pci_link_info("rx_osized_frms", i,
__hal_aux_pci_link_info("rx_frag_frms", i,
__hal_aux_pci_link_info("rx_jabber_frms", i,
__hal_aux_pci_link_info("rx_ttl_64_frms", i,
__hal_aux_pci_link_info("rx_ttl_65_127_frms", i,
__hal_aux_pci_link_info("rx_ttl_128_255_frms", i,
__hal_aux_pci_link_info("rx_ttl_256_511_frms", i,
__hal_aux_pci_link_info("rx_ttl_512_1023_frms", i,
__hal_aux_pci_link_info("rx_ttl_1024_1518_frms", i,
__hal_aux_pci_link_info("rx_ttl_1519_4095_frms", i,
__hal_aux_pci_link_info("rx_ttl_40956_8191_frms", i,
__hal_aux_pci_link_info("rx_ttl_8192_max_frms", i,
__hal_aux_pci_link_info("rx_ttl_gt_max_frms", i,
__hal_aux_pci_link_info("rx_ip", i,
rx_ip);
__hal_aux_pci_link_info("rx_ip_octets", i,
__hal_aux_pci_link_info("rx_hdr_err_ip", i,
__hal_aux_pci_link_info("rx_icmp", i,
rx_icmp);
__hal_aux_pci_link_info("rx_tcp", i,
rx_tcp);
__hal_aux_pci_link_info("rx_udp", i,
rx_udp);
__hal_aux_pci_link_info("rx_err_tcp", i,
__hal_aux_pci_link_info("rx_pause_cnt", i,
__hal_aux_pci_link_info("rx_pause_ctrl_frms", i,
__hal_aux_pci_link_info("rx_unsup_ctrl_frms", i,
__hal_aux_pci_link_info("rx_in_rng_len_err_frms", i,
__hal_aux_pci_link_info("rx_out_rng_len_err_frms", i,
__hal_aux_pci_link_info("rx_drop_frms", i,
__hal_aux_pci_link_info("rx_discarded_frms", i,
__hal_aux_pci_link_info("rx_drop_ip", i,
__hal_aux_pci_link_info("rx_err_drp_udp", i,
__hal_aux_pci_link_info("rx_lacpdu_frms", i,
__hal_aux_pci_link_info("rx_marker_pdu_frms", i,
__hal_aux_pci_link_info("rx_marker_resp_pdu_frms", i,
__hal_aux_pci_link_info("rx_unknown_pdu_frms", i,
__hal_aux_pci_link_info("rx_illegal_pdu_frms", i,
__hal_aux_pci_link_info("rx_fcs_discard", i,
__hal_aux_pci_link_info("rx_len_discard", i,
__hal_aux_pci_link_info("rx_pf_discard", i,
__hal_aux_pci_link_info("rx_trash_discard", i,
__hal_aux_pci_link_info("rx_rts_discard", i,
__hal_aux_pci_link_info("rx_wol_discard", i,
__hal_aux_pci_link_info("rx_red_discard", i,
__hal_aux_pci_link_info("rx_ingm_full_discard", i,
__hal_aux_pci_link_info("rx_xgmii_data_err_cnt", i,
__hal_aux_pci_link_info("rx_xgmii_ctrl_err_cnt", i,
__hal_aux_pci_link_info("rx_xgmii_err_sym", i,
__hal_aux_pci_link_info("rx_xgmii_char1_match", i,
__hal_aux_pci_link_info("rx_xgmii_char2_match", i,
__hal_aux_pci_link_info("rx_xgmii_column1_match", i,
__hal_aux_pci_link_info("rx_xgmii_column2_match", i,
__hal_aux_pci_link_info("rx_local_fault", i,
__hal_aux_pci_link_info("rx_remote_fault", i,
__hal_aux_pci_link_info("rx_queue_full", i,
}
for (i = 0; i < XGE_HAL_MAC_AGGREGATORS; i++) {
__hal_aux_pci_link_info("rx_data_octets", i,
__hal_aux_pci_aggr_info("rx_mcst_frms", i,
__hal_aux_pci_aggr_info("rx_bcst_frms", i,
__hal_aux_pci_aggr_info("rx_discarded_frms", i,
__hal_aux_pci_aggr_info("rx_errored_frms", i,
__hal_aux_pci_aggr_info("rx_unknown_protocol_frms", i,
}
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_stats_herc_enchanced - Get Hercules hardware statistics.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
return XGE_HAL_OK;
}
sizeof(xge_hal_mgmt_hw_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
"%u");
"%u");
"%u");
"%u");
"%llu");
"%u");
"%u");
"%u");
"%u");
__HAL_AUX_ENTRY("rmac_accepted_ucst_frms_oflow",
__HAL_AUX_ENTRY("rmac_accepted_nucst_frms_oflow",
__HAL_AUX_ENTRY("rmac_discarded_frms_oflow",
"%u");
"%u");
"%u");
"%u");
"%u");
__HAL_AUX_ENTRY("rmac_ttl_1519_4095_frms",
__HAL_AUX_ENTRY("rmac_ttl_4096_8191_frms",
__HAL_AUX_ENTRY("rmac_ttl_8192_max_frms",
__HAL_AUX_ENTRY("rmac_ttl_gt_max_frms",
__HAL_AUX_ENTRY("rmac_osized_alt_frms",
__HAL_AUX_ENTRY("rmac_jabber_alt_frms",
__HAL_AUX_ENTRY("rmac_gt_max_alt_frms",
__HAL_AUX_ENTRY("rmac_vlan_frms",
"%u");
"%u");
return XGE_HAL_OK;
}
/**
* xge_hal_aux_stats_rmac_read - Read PCI hardware statistics.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
return XGE_HAL_OK;
}
sizeof(xge_hal_mgmt_hw_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_stats_hal_read - Read HAL (layer) statistics.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @retbuf: Buffer pointer.
* @retsize: Size of the result. Cannot be greater than @bufsize.
*
* Read HAL 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
* currently available.
*
* See also: xge_hal_aux_device_dump().
*/
{
int dest_size;
char *dest_addr;
sizeof(xge_hal_mgmt_device_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
__HAL_AUX_ENTRY("rx_traffic_intr_cnt",
}
__HAL_AUX_ENTRY("not_traffic_intr_cnt",
__HAL_AUX_ENTRY("rxufca_lo_adjust_cnt",
__HAL_AUX_ENTRY("rxufca_hi_adjust_cnt",
}
__HAL_AUX_ENTRY("bimodal_lo_adjust_cnt",
__HAL_AUX_ENTRY("bimodal_hi_adjust_cnt",
}
#if defined(XGE_HAL_CONFIG_LRO)
__HAL_AUX_ENTRY("tot_frms_lroised",
__HAL_AUX_ENTRY("tot_lro_sessions",
__HAL_AUX_ENTRY("lro_frm_len_exceed_cnt",
__HAL_AUX_ENTRY("lro_sg_exceed_cnt",
__HAL_AUX_ENTRY("lro_out_of_seq_pkt_cnt",
__HAL_AUX_ENTRY("lro_dup_pkt_cnt",
#endif
/* for each opened rx channel */
sizeof(xge_hal_mgmt_channel_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
}
}
/* for each opened tx channel */
sizeof(xge_hal_mgmt_channel_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_stats_sw_dev_read - Read software device statistics.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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
* currently available.
*
* See also: xge_hal_aux_device_dump().
*/
{
sizeof(xge_hal_mgmt_sw_stats_t));
if (status != XGE_HAL_OK) {
return status;
}
if (t_code_cnt) {
}
if (t_code_cnt) {
}
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_pci_config_read - Retrieve and format PCI Configuration
* info.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
int i;
sizeof(xge_hal_mgmt_pci_config_t));
if (status != XGE_HAL_OK) {
return status;
}
__HAL_AUX_ENTRY("cache_line_size",
__HAL_AUX_ENTRY("not_Implemented1",
"0x%08X");
"0x%08X");
"0x%04X");
__HAL_AUX_ENTRY("capabilities_pointer",
"0x%08X");
"0x%08X");
}
}
return XGE_HAL_OK;
}
/**
* xge_hal_aux_channel_read - Read channels information.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @retbuf: Buffer pointer.
* @retsize: Size of the result. Cannot be greater than @bufsize.
*
* Read HAL statistics.
*
* 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().
*/
{
int dest_size;
char *dest_addr;
return XGE_HAL_ERR_INVALID_DEVICE;
}
/* for each opened rx channel */
continue;
}
/* for each opened tx channel */
continue;
}
return XGE_HAL_OK;
}
/**
* 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
* configuration space.
* 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().
* Returns:
* XGE_HAL_ERR_INVALID_DEVICE - Device is not valid.
* XGE_HAL_ERR_OUT_OF_SPACE - Buffer size is very small.
*/
{
int retsize;
int offset;
xge_os_println("********* xge DEVICE DUMP BEGIN **********");
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
if (status != XGE_HAL_OK) {
goto error;
}
if (!retval) continue;
}
xge_os_println("\n");
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
if (status != XGE_HAL_OK) {
goto error;
}
}
if (status != XGE_HAL_OK) {
goto error;
}
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
&retsize);
if (status != XGE_HAL_OK) {
goto error;
}
xge_os_println("********* XFRAME DEVICE DUMP END **********");
return status;
}
/**
* xge_hal_aux_driver_config_read - Read Driver configuration.
* @bufsize: Buffer size.
* @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().
*/
{
sizeof(xge_hal_driver_config_t));
if (status != XGE_HAL_OK) {
return status;
}
__HAL_AUX_ENTRY("queue size initial",
return XGE_HAL_OK;
}
/**
* xge_hal_aux_device_config_read - Read device configuration.
* @devh: HAL device handle.
* @bufsize: Buffer size.
* @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().
*/
{
int i, j;
int dest_size;
char *dest_addr;
sizeof(xge_hal_device_config_t));
if (dev_config == NULL) {
return XGE_HAL_FAIL;
}
sizeof(xge_hal_device_config_t));
if (status != XGE_HAL_OK) {
sizeof(xge_hal_device_config_t));
return status;
}
__HAL_AUX_ENTRY("max_splits_trans",
__HAL_AUX_ENTRY("stats_refresh_time_sec",
__HAL_AUX_ENTRY("ring_memblock_size",
__HAL_AUX_ENTRY("sched_timer_one_shot",
for(i = 0; i < XGE_HAL_MAX_RING_NUM; i++)
{
if (!ring->configured)
continue;
}
{
__HAL_AUX_ENTRY("tmac_util_period",
__HAL_AUX_ENTRY("rmac_util_period",
__HAL_AUX_ENTRY("rmac_bcast_en",
__HAL_AUX_ENTRY("rmac_pause_gen_en",
__HAL_AUX_ENTRY("rmac_pause_rcv_en",
__HAL_AUX_ENTRY("rmac_pause_time",
__HAL_AUX_ENTRY("mc_pause_threshold_q0q3",
__HAL_AUX_ENTRY("mc_pause_threshold_q4q7",
}
__HAL_AUX_ENTRY("fifo_max_frags",
__HAL_AUX_ENTRY("fifo_reserve_threshold",
__HAL_AUX_ENTRY("fifo_memblock_size",
#ifdef XGE_HAL_ALIGN_XMIT
__HAL_AUX_ENTRY("fifo_alignment_size",
#endif
for (i = 0; i < XGE_HAL_MAX_FIFO_NUM; i++) {
if (!fifo->configured)
continue;
for (j = 0; j < XGE_HAL_MAX_FIFO_TTI_NUM; j++) {
continue;
i * XGE_HAL_MAX_FIFO_TTI_NUM + j);
}
}
/* and bimodal TTIs */
for (i=0; i<XGE_HAL_MAX_RING_NUM; i++) {
continue;
}
__HAL_AUX_ENTRY("dump_on_eccerr",
__HAL_AUX_ENTRY("dump_on_parityerr",
sizeof(xge_hal_device_config_t));
return XGE_HAL_OK;
}