diff --git a/linux-2.6.31.9/drivers/net/bnx2.c b/linux-2.6.31.9/drivers/net/bnx2.c index 06b9011..140bd48 100644 --- a/linux-2.6.31.9/drivers/net/bnx2.c +++ b/linux-2.6.31.9/drivers/net/bnx2.c @@ -6239,11 +6239,111 @@ bnx2_reset_task(struct work_struct *work) bnx2_netif_start(bp); } + +static void bnx2_dump_ftq(struct bnx2 *bp) +{ + printk(KERN_ERR PFX "<--- start FTQ dump on %s --->\n", bp->dev->name); + printk(KERN_ERR PFX "%s: BNX2_RV2P_PFTQ_CTL %x\n", bp->dev->name, + REG_RD(bp, BNX2_RV2P_PFTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_RV2P_TFTQ_CTL %x\n", bp->dev->name, + REG_RD(bp, BNX2_RV2P_TFTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_RV2P_MFTQ_CTL %x\n", bp->dev->name, + REG_RD(bp, BNX2_RV2P_MFTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_TBDR_FTQ_CTL %x\n", bp->dev->name, + REG_RD(bp, BNX2_TBDR_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_TDMA_FTQ_CTL %x\n", bp->dev->name, + REG_RD(bp, BNX2_TDMA_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_TXP_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_TXP_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_TPAT_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_TPAT_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_RXP_CFTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_RXP_CFTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_RXP_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_RXP_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_COM_COMXQ_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_COM_COMXQ_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_COM_COMTQ_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_COM_COMTQ_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_COM_COMQ_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_COM_COMQ_FTQ_CTL)); + printk(KERN_ERR PFX "%s: BNX2_CP_CPQ_FTQ_CTL %x\n", bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_CP_CPQ_FTQ_CTL)); + printk(KERN_ERR PFX + "%s: TXP mode %x state %x evt_mask %x pc %x pc %x instr %x\n", + bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_TXP_CPU_MODE), + bnx2_reg_rd_ind(bp, BNX2_TXP_CPU_STATE), + bnx2_reg_rd_ind(bp, BNX2_TXP_CPU_EVENT_MASK), + bnx2_reg_rd_ind(bp, BNX2_TXP_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_TXP_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_TXP_CPU_INSTRUCTION)); + printk(KERN_ERR PFX + "%s: TPAT mode %x state %x evt_mask %x pc %x pc %x instr %x\n", + bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_TPAT_CPU_MODE), + bnx2_reg_rd_ind(bp, BNX2_TPAT_CPU_STATE), + bnx2_reg_rd_ind(bp, BNX2_TPAT_CPU_EVENT_MASK), + bnx2_reg_rd_ind(bp, BNX2_TPAT_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_TPAT_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_TPAT_CPU_INSTRUCTION)); + printk(KERN_ERR PFX + "%s: RXP mode %x state %x evt_mask %x pc %x pc %x instr %x\n", + bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_RXP_CPU_MODE), + bnx2_reg_rd_ind(bp, BNX2_RXP_CPU_STATE), + bnx2_reg_rd_ind(bp, BNX2_RXP_CPU_EVENT_MASK), + bnx2_reg_rd_ind(bp, BNX2_RXP_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_RXP_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_RXP_CPU_INSTRUCTION)); + printk(KERN_ERR PFX + "%s: COM mode %x state %x evt_mask %x pc %x pc %x instr %x\n", + bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_COM_CPU_MODE), + bnx2_reg_rd_ind(bp, BNX2_COM_CPU_STATE), + bnx2_reg_rd_ind(bp, BNX2_COM_CPU_EVENT_MASK), + bnx2_reg_rd_ind(bp, BNX2_COM_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_COM_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_COM_CPU_INSTRUCTION)); + printk(KERN_ERR PFX + "%s: CP mode %x state %x evt_mask %x pc %x pc %x instr %x\n", + bp->dev->name, + bnx2_reg_rd_ind(bp, BNX2_CP_CPU_MODE), + bnx2_reg_rd_ind(bp, BNX2_CP_CPU_STATE), + bnx2_reg_rd_ind(bp, BNX2_CP_CPU_EVENT_MASK), + bnx2_reg_rd_ind(bp, BNX2_CP_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_CP_CPU_PROGRAM_COUNTER), + bnx2_reg_rd_ind(bp, BNX2_CP_CPU_INSTRUCTION)); + printk(KERN_ERR PFX "<--- end FTQ dump on %s --->\n", bp->dev->name); +} + +static void +bnx2_dump_state(struct bnx2 *bp) +{ + printk(KERN_ERR PFX "DEBUG: intr_sem[%x]\n", + atomic_read(&bp->intr_sem)); + printk(KERN_ERR PFX "DEBUG: EMAC_TX_STATUS[%08x] RPM_MGMT_PKT_CTRL[%08x]\n", + REG_RD(bp, BNX2_EMAC_TX_STATUS), + REG_RD(bp, BNX2_RPM_MGMT_PKT_CTRL)); + printk(KERN_ERR PFX "DEBUG: MCP_STATE_P0[%08x] MCP_STATE_P1[%08x]\n", + bnx2_reg_rd_ind(bp, BNX2_MCP_STATE_P0), + bnx2_reg_rd_ind(bp, BNX2_MCP_STATE_P1)); + printk(KERN_ERR PFX "DEBUG: HC_STATS_INTERRUPT_STATUS[%08x]\n", + REG_RD(bp, BNX2_HC_STATS_INTERRUPT_STATUS)); + if (bp->flags & BNX2_FLAG_USING_MSIX) + printk(KERN_ERR PFX "DEBUG: PBA[%08x]\n", + REG_RD(bp, BNX2_PCI_GRC_WINDOW3_BASE)); +} + + static void bnx2_tx_timeout(struct net_device *dev) { struct bnx2 *bp = netdev_priv(dev); + bnx2_dump_ftq(bp); + bnx2_dump_state(bp); + /* This allows the netif to be shutdown gracefully before resetting */ schedule_work(&bp->reset_task); } diff --git a/linux-2.6.31.9/drivers/net/bnx2.h b/linux-2.6.31.9/drivers/net/bnx2.h index a4f12fd..0ec9df2 100644 --- a/linux-2.6.31.9/drivers/net/bnx2.h +++ b/linux-2.6.31.9/drivers/net/bnx2.h @@ -6342,6 +6342,8 @@ struct l2_fhdr { #define BNX2_MCP_ROM 0x00150000 #define BNX2_MCP_SCRATCH 0x00160000 +#define BNX2_MCP_STATE_P1 0x0016f9c8 +#define BNX2_MCP_STATE_P0 0x0016fdc #define BNX2_SHM_HDR_SIGNATURE BNX2_MCP_SCRATCH #define BNX2_SHM_HDR_SIGNATURE_SIG_MASK 0xffff0000