9da57d7b0ddd8d73b676ce12c040362132cdd538bt * CDDL HEADER START
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China * Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * The contents of this file are subject to the terms of the
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Common Development and Distribution License (the "License").
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * You may not use this file except in compliance with the License.
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * or http://www.opensolaris.org/os/licensing.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * See the License for the specific language governing permissions
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * and limitations under the License.
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * When distributing Covered Code, include this CDDL HEADER in each
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * If applicable, add the following below this CDDL HEADER, with the
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * fields enclosed by brackets "[]" replaced with your own identifying
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * information: Portions Copyright [yyyy] [name of copyright owner]
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * CDDL HEADER END
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China * Use is subject to license terms.
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Dump interrupt-related registers & structures
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * interrupt control registers
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "..eims: 0x%x\n", IXGBE_READ_REG(hw, IXGBE_EIMS));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "..eimc: 0x%x\n", IXGBE_READ_REG(hw, IXGBE_EIMC));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "..eiac: 0x%x\n", IXGBE_READ_REG(hw, IXGBE_EIAC));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "..eiam: 0x%x\n", IXGBE_READ_REG(hw, IXGBE_EIAM));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "..gpie: 0x%x\n", IXGBE_READ_REG(hw, IXGBE_GPIE));
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo ixgbe_log(ixgbe, "otherflag: 0x%x\n", ixgbe->capab->other_intr);
13740cb230f19fcbf1a6468d1a6a0ba9a0a09c22Paul Guo ixgbe_log(ixgbe, "eims_mask: 0x%x\n", ixgbe->eims);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* ivar: interrupt vector allocation registers */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < IXGBE_IVAR_REG_NUM; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* each allocated vector */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "vector %d rx rings %d tx rings %d eitr: 0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* for each rx ring bit set */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt j = bt_getlowbit(vect->rx_map, 0, (ixgbe->num_rx_rings - 1));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt while (j >= 0) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "rx %d ivar %d rxdctl: 0x%x srrctl: 0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* for each tx ring bit set */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt j = bt_getlowbit(vect->tx_map, 0, (ixgbe->num_tx_rings - 1));
9da57d7b0ddd8d73b676ce12c040362132cdd538bt while (j >= 0) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* reta: RSS redirection table */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < 32; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* rssrk: RSS random key */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < 10; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* check ral/rah */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < 16; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* check mta */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < 128; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* check vfta */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < 640; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* check mdef */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i < 8; i++) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt * Dump an ethernet address
9da57d7b0ddd8d73b676ce12c040362132cdd538btixgbe_dump_addr(void *adapter, char *tag, const uint8_t *addr)
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_VENID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_DEVID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_COMMAND:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_STATUS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_REVID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_PROG_CLASS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_SUB_CLASS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BAS_CLASS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_CACHE_LINESZ:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_LATENCY_TIMER:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_HEADER_TYPE:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BIST:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BASE0:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BASE1:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BASE2:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* MSI-X BAR */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BASE4:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_BASE5:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_CIS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_SUBVENID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_SUBSYSID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_ROM:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_ILINE:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_IPIN:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_MIN_G:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_CONF_MAX_L:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* Power Management */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_PM_CAP_ID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_PM_CAP:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_PM_CSR:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_PM_CSR_BSE:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_PM_DATA:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* MSI Configuration */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_MSI_CAP_ID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_MSI_CTRL:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_MSI_ADDR:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_MSI_ADDR_HI:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_MSI_DATA:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* MSI-X Configuration */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCI_MSIX_CAP_ID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt msix_ctrl = pci_config_get16(handle, offset + PCI_MSIX_CTRL);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt tbl_offset = pci_config_get32(handle, offset + PCI_MSIX_TBL_OFFSET);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt pba_offset = pci_config_get32(handle, offset + PCI_MSIX_PBA_OFFSET);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* PCI Express Configuration */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_CAP_ID:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt next_ptr = pci_config_get8(handle, offset + PCIE_CAP_NEXT_PTR);
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_PCIECAP:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_DEVCAP:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_DEVCTL:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_DEVSTS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_LINKCAP:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_LINKCTL:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt "PCIE_LINKSTS:\t0x%x\n",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt /* MSI-X Memory Space */
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if (ddi_dev_regsize(ixgbe->dip, 4, &mem_size) != DDI_SUCCESS) {
9da57d7b0ddd8d73b676ce12c040362132cdd538bt if ((ddi_regs_map_setup(ixgbe->dip, 4, (caddr_t *)&base, 0, mem_size,
9da57d7b0ddd8d73b676ce12c040362132cdd538bt ixgbe_log(ixgbe, "MSI-X Memory Space: (mem_size = %d, base = %x)",
9da57d7b0ddd8d73b676ce12c040362132cdd538bt for (i = 0; i <= msix_tbl_sz; i++) {
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing Chinaixgbe_dump_regs(void *adapter)
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_t *ixgbe = (ixgbe_t *)adapter;
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China struct ixgbe_hw *hw = &ixgbe->hw;
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China DEBUGFUNC("ixgbe_dump_regs");
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China /* Dump basic's like CTRL, STATUS, CTRL_EXT. */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "Basic IXGBE registers..");
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_CTRL);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tCTRL=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_STATUS);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tSTATUS=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tCTRL_EXT=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_FCTRL);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tFCTRL=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China /* Misc Interrupt regs */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "Some IXGBE interrupt registers..");
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_GPIE);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tGPIE=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_IVAR(0));
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tIVAR(0)=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_IVAR_MISC);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tIVAR_MISC=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China /* Dump RX related reg's */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "Receive registers...");
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tRXCTRL=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China for (i = 0; i < ixgbe->num_rx_rings; i++) {
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer reg_val = IXGBE_READ_REG(hw, IXGBE_RXDCTL(hw_index));
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer ixgbe_log(ixgbe, "\tRXDCTL(%d)=%x\n", hw_index, reg_val);
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer reg_val = IXGBE_READ_REG(hw, IXGBE_SRRCTL(hw_index));
0dc2366f7b9f9f36e10909b1e95edbf2a261c2acVenugopal Iyer ixgbe_log(ixgbe, "\tSRRCTL(%d)=%x\n", hw_index, reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_RXCSUM);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tRXCSUM=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_MRQC);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tMRQC=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tRDRXCTL=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China /* Dump TX related regs */
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "Some transmit registers..");
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_DMATXCTL);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tDMATXCTL=%x\n", reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China for (i = 0; i < ixgbe->num_tx_rings; i++) {
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_TXDCTL(i));
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tTXDCTL(%d)=%x\n", i, reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_TDWBAL(i));
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tTDWBAL(%d)=%x\n", i, reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_TDWBAH(i));
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tTDWBAH(%d)=%x\n", i, reg_val);
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China reg_val = IXGBE_READ_REG(hw, IXGBE_TXPBSIZE(i));
73cd555c10e70dac413ae4b40de8450a291750acBin Tu - Sun Microsystems - Beijing China ixgbe_log(ixgbe, "\tTXPBSIZE(%d)=%x\n", i, reg_val);