Skip to content

Commit

Permalink
[intel] Expose intel_diag() for use by other Intel NIC drivers
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed May 15, 2015
1 parent 5ecd16a commit 28ce9b6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 26 deletions.
26 changes: 0 additions & 26 deletions src/drivers/net/intel.c
Expand Up @@ -250,32 +250,6 @@ static int intel_fetch_mac ( struct intel_nic *intel, uint8_t *hw_addr ) {
return -ENOENT;
}

/******************************************************************************
*
* Diagnostics
*
******************************************************************************
*/

/**
* Dump diagnostic information
*
* @v intel Intel device
*/
static void __attribute__ (( unused )) intel_diag ( struct intel_nic *intel ) {

DBGC ( intel, "INTEL %p TX %04x(%02x)/%04x(%02x) "
"RX %04x(%02x)/%04x(%02x)\n", intel,
( intel->tx.cons & 0xffff ),
readl ( intel->regs + intel->tx.reg + INTEL_xDH ),
( intel->tx.prod & 0xffff ),
readl ( intel->regs + intel->tx.reg + INTEL_xDT ),
( intel->rx.cons & 0xffff ),
readl ( intel->regs + intel->rx.reg + INTEL_xDH ),
( intel->rx.prod & 0xffff ),
readl ( intel->regs + intel->rx.reg + INTEL_xDT ) );
}

/******************************************************************************
*
* Device reset
Expand Down
19 changes: 19 additions & 0 deletions src/drivers/net/intel.h
Expand Up @@ -259,6 +259,25 @@ enum intel_flags {
INTEL_VMWARE = 0x0002,
};

/**
* Dump diagnostic information
*
* @v intel Intel device
*/
static inline void intel_diag ( struct intel_nic *intel ) {

DBGC ( intel, "INTEL %p TX %04x(%02x)/%04x(%02x) "
"RX %04x(%02x)/%04x(%02x)\n", intel,
( intel->tx.cons & 0xffff ),
readl ( intel->regs + intel->tx.reg + INTEL_xDH ),
( intel->tx.prod & 0xffff ),
readl ( intel->regs + intel->tx.reg + INTEL_xDT ),
( intel->rx.cons & 0xffff ),
readl ( intel->regs + intel->rx.reg + INTEL_xDH ),
( intel->rx.prod & 0xffff ),
readl ( intel->regs + intel->rx.reg + INTEL_xDT ) );
}

extern int intel_create_ring ( struct intel_nic *intel,
struct intel_ring *ring );
extern void intel_destroy_ring ( struct intel_nic *intel,
Expand Down

0 comments on commit 28ce9b6

Please sign in to comment.