From: Alan Cox <alan@linux.intel.com>
We don't need it, we have a perfectly good set of debug tools. For this pass
keep a few debug printks around which are "should not happen" items
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/staging/et131x/Makefile | 1 -
drivers/staging/et131x/et1310_eeprom.c | 1 -
drivers/staging/et131x/et1310_mac.c | 64 +----
drivers/staging/et131x/et1310_phy.c | 88 +-----
drivers/staging/et131x/et1310_pm.c | 14 -
drivers/staging/et131x/et1310_rx.c | 138 ++------
drivers/staging/et131x/et1310_tx.c | 592 +------------------------------
drivers/staging/et131x/et131x_adapter.h | 7 -
drivers/staging/et131x/et131x_debug.c | 208 -----------
drivers/staging/et131x/et131x_debug.h | 255 -------------
drivers/staging/et131x/et131x_initpci.c | 236 +++----------
drivers/staging/et131x/et131x_isr.c | 58 +---
drivers/staging/et131x/et131x_netdev.c | 176 ++--------
13 files changed, 117 insertions(+), 1721 deletions(-)
delete mode 100644 drivers/staging/et131x/et131x_debug.c
delete mode 100644 drivers/staging/et131x/et131x_debug.h
diff --git a/drivers/staging/et131x/Makefile b/drivers/staging/et131x/Makefile
index 1110494..95c645d 100644
--- a/drivers/staging/et131x/Makefile
+++ b/drivers/staging/et131x/Makefile
@@ -10,7 +10,6 @@ et131x-objs := et1310_eeprom.o \
et1310_pm.o \
et1310_rx.o \
et1310_tx.o \
- et131x_debug.o \
et131x_initpci.o \
et131x_isr.o \
et131x_netdev.o
diff --git a/drivers/staging/et131x/et1310_eeprom.c b/drivers/staging/et131x/et1310_eeprom.c
index 7b2e4ea..c853a2c 100644
--- a/drivers/staging/et131x/et1310_eeprom.c
+++ b/drivers/staging/et131x/et1310_eeprom.c
@@ -56,7 +56,6 @@
*/
#include "et131x_version.h"
-#include "et131x_debug.h"
#include "et131x_defs.h"
#include <linux/pci.h>
diff --git a/drivers/staging/et131x/et1310_mac.c b/drivers/staging/et131x/et1310_mac.c
index c94d661..f81e1cb 100644
--- a/drivers/staging/et131x/et1310_mac.c
+++ b/drivers/staging/et131x/et1310_mac.c
@@ -56,7 +56,6 @@
*/
#include "et131x_version.h"
-#include "et131x_debug.h"
#include "et131x_defs.h"
#include <linux/init.h>
@@ -75,6 +74,7 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/bitops.h>
+#include <linux/pci.h>
#include <asm/system.h>
#include <linux/netdevice.h>
@@ -92,11 +92,6 @@
#include "et131x_adapter.h"
#include "et131x_initpci.h"
-/* Data for debugging facilities */
-#ifdef CONFIG_ET131X_DEBUG
-extern dbg_info_t *et131x_dbginfo;
-#endif /* CONFIG_ET131X_DEBUG */
-
/**
* ConfigMacRegs1 - Initialize the first part of MAC regs
* @pAdpater: pointer to our adapter structure
@@ -110,8 +105,6 @@ void ConfigMACRegs1(struct et131x_adapter *etdev)
MAC_HFDP_t hfdp;
MII_MGMT_CFG_t mii_mgmt_cfg;
- DBG_ENTER(et131x_dbginfo);
-
/* First we need to reset everything. Write to MAC configuration
* register 1 to perform reset.
*/
@@ -171,8 +164,6 @@ void ConfigMACRegs1(struct et131x_adapter *etdev)
/* clear out MAC config reset */
writel(0, &pMac->cfg1.value);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -188,8 +179,6 @@ void ConfigMACRegs2(struct et131x_adapter *etdev)
MAC_IF_CTRL_t ifctrl;
TXMAC_CTL_t ctl;
- DBG_ENTER(et131x_dbginfo);
-
ctl.value = readl(&etdev->regs->txmac.ctl.value);
cfg1.value = readl(&pMac->cfg1.value);
cfg2.value = readl(&pMac->cfg2.value);
@@ -255,17 +244,11 @@ void ConfigMACRegs2(struct et131x_adapter *etdev)
delay < 100);
if (delay == 100) {
- DBG_ERROR(et131x_dbginfo,
+ dev_warn(&etdev->pdev->dev,
"Syncd bits did not respond correctly cfg1 word 0x%08x\n",
cfg1.value);
}
- DBG_TRACE(et131x_dbginfo,
- "Speed %d, Dup %d, CFG1 0x%08x, CFG2 0x%08x, if_ctrl 0x%08x\n",
- etdev->linkspeed, etdev->duplex_mode,
- readl(&pMac->cfg1.value), readl(&pMac->cfg2.value),
- readl(&pMac->if_ctrl.value));
-
/* Enable TXMAC */
ctl.bits.txmac_en = 0x1;
ctl.bits.fc_disable = 0x1;
@@ -275,12 +258,7 @@ void ConfigMACRegs2(struct et131x_adapter *etdev)
if (etdev->Flags & fMP_ADAPTER_LOWER_POWER) {
et131x_rx_dma_enable(etdev);
et131x_tx_dma_enable(etdev);
- } else {
- DBG_WARNING(et131x_dbginfo,
- "Didn't enable Rx/Tx due to low-power mode\n");
}
-
- DBG_LEAVE(et131x_dbginfo);
}
void ConfigRxMacRegs(struct et131x_adapter *etdev)
@@ -290,8 +268,6 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev)
RXMAC_WOL_SA_HI_t sa_hi;
RXMAC_PF_CTRL_t pf_ctrl = { 0 };
- DBG_ENTER(et131x_dbginfo);
-
/* Disable the MAC while it is being configured (also disable WOL) */
writel(0x8, &pRxMac->ctrl.value);
@@ -421,8 +397,6 @@ void ConfigRxMacRegs(struct et131x_adapter *etdev)
*/
writel(pf_ctrl.value, &pRxMac->pf_ctrl.value);
writel(0x9, &pRxMac->ctrl.value);
-
- DBG_LEAVE(et131x_dbginfo);
}
void ConfigTxMacRegs(struct et131x_adapter *etdev)
@@ -430,8 +404,6 @@ void ConfigTxMacRegs(struct et131x_adapter *etdev)
struct _TXMAC_t __iomem *pTxMac = &etdev->regs->txmac;
TXMAC_CF_PARAM_t Local;
- DBG_ENTER(et131x_dbginfo);
-
/* We need to update the Control Frame Parameters
* cfpt - control frame pause timer set to 64 (0x40)
* cfep - control frame extended pause timer set to 0x0
@@ -443,8 +415,6 @@ void ConfigTxMacRegs(struct et131x_adapter *etdev)
Local.bits.cfep = 0x0;
writel(Local.value, &pTxMac->cf_param.value);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
void ConfigMacStatRegs(struct et131x_adapter *etdev)
@@ -452,8 +422,6 @@ void ConfigMacStatRegs(struct et131x_adapter *etdev)
struct _MAC_STAT_t __iomem *pDevMacStat =
&etdev->regs->macStat;
- DBG_ENTER(et131x_dbginfo);
-
/* Next we need to initialize all the MAC_STAT registers to zero on
* the device.
*/
@@ -534,8 +502,6 @@ void ConfigMacStatRegs(struct et131x_adapter *etdev)
writel(Carry2M.value, &pDevMacStat->Carry2M.value);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
void ConfigFlowControl(struct et131x_adapter *etdev)
@@ -614,8 +580,6 @@ void HandleMacStatInterrupt(struct et131x_adapter *etdev)
MAC_STAT_REG_1_t Carry1;
MAC_STAT_REG_2_t Carry2;
- DBG_ENTER(et131x_dbginfo);
-
/* Read the interrupt bits from the register(s). These are Clear On
* Write.
*/
@@ -659,8 +623,6 @@ void HandleMacStatInterrupt(struct et131x_adapter *etdev)
etdev->Stats.late_collisions += COUNTER_WRAP_12_BIT;
if (Carry2.bits.tncl)
etdev->Stats.collisions += COUNTER_WRAP_12_BIT;
-
- DBG_LEAVE(et131x_dbginfo);
}
void SetupDeviceForMulticast(struct et131x_adapter *etdev)
@@ -674,30 +636,14 @@ void SetupDeviceForMulticast(struct et131x_adapter *etdev)
uint32_t hash4 = 0;
u32 pm_csr;
- DBG_ENTER(et131x_dbginfo);
-
/* If ET131X_PACKET_TYPE_MULTICAST is specified, then we provision
* the multi-cast LIST. If it is NOT specified, (and "ALL" is not
* specified) then we should pass NO multi-cast addresses to the
* driver.
*/
if (etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST) {
- DBG_VERBOSE(et131x_dbginfo,
- "MULTICAST flag is set, MCCount: %d\n",
- etdev->MCAddressCount);
-
/* Loop through our multicast array and set up the device */
for (nIndex = 0; nIndex < etdev->MCAddressCount; nIndex++) {
- DBG_VERBOSE(et131x_dbginfo,
- "MCList[%d]: %02x:%02x:%02x:%02x:%02x:%02x\n",
- nIndex,
- etdev->MCList[nIndex][0],
- etdev->MCList[nIndex][1],
- etdev->MCList[nIndex][2],
- etdev->MCList[nIndex][3],
- etdev->MCList[nIndex][4],
- etdev->MCList[nIndex][5]);
-
result = ether_crc(6, etdev->MCList[nIndex]);
result = (result & 0x3F800000) >> 23;
@@ -725,8 +671,6 @@ void SetupDeviceForMulticast(struct et131x_adapter *etdev)
writel(hash3, &rxmac->multi_hash3);
writel(hash4, &rxmac->multi_hash4);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
void SetupDeviceForUnicast(struct et131x_adapter *etdev)
@@ -737,8 +681,6 @@ void SetupDeviceForUnicast(struct et131x_adapter *etdev)
RXMAC_UNI_PF_ADDR3_t uni_pf3;
u32 pm_csr;
- DBG_ENTER(et131x_dbginfo);
-
/* Set up unicast packet filter reg 3 to be the first two octets of
* the MAC address for both address
*
@@ -769,6 +711,4 @@ void SetupDeviceForUnicast(struct et131x_adapter *etdev)
writel(uni_pf2.value, &rxmac->uni_pf_addr2.value);
writel(uni_pf3.value, &rxmac->uni_pf_addr3.value);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
diff --git a/drivers/staging/et131x/et1310_phy.c b/drivers/staging/et131x/et1310_phy.c
index 98055e6..dd199bd 100644
--- a/drivers/staging/et131x/et1310_phy.c
+++ b/drivers/staging/et131x/et1310_phy.c
@@ -56,7 +56,6 @@
*/
#include "et131x_version.h"
-#include "et131x_debug.h"
#include "et131x_defs.h"
#include <linux/pci.h>
@@ -98,11 +97,6 @@
#include "et1310_rx.h"
#include "et1310_mac.h"
-/* Data for debugging facilities */
-#ifdef CONFIG_ET131X_DEBUG
-extern dbg_info_t *et131x_dbginfo;
-#endif /* CONFIG_ET131X_DEBUG */
-
/* Prototypes for functions with local scope */
static int et131x_xcvr_init(struct et131x_adapter *adapter);
@@ -157,9 +151,9 @@ int PhyMiRead(struct et131x_adapter *adapter, uint8_t xcvrAddr,
/* If we hit the max delay, we could not read the register */
if (delay >= 50) {
- DBG_WARNING(et131x_dbginfo,
+ dev_warn(&adapter->pdev->dev,
"xcvrReg 0x%08x could not be read\n", xcvrReg);
- DBG_WARNING(et131x_dbginfo, "status is 0x%08x\n",
+ dev_warn(&adapter->pdev->dev, "status is 0x%08x\n",
miiIndicator.value);
status = -EIO;
@@ -179,10 +173,6 @@ int PhyMiRead(struct et131x_adapter *adapter, uint8_t xcvrAddr,
/* Stop the read operation */
writel(0, &mac->mii_mgmt_cmd.value);
- DBG_VERBOSE(et131x_dbginfo, " xcvr_addr = 0x%02x, "
- "xcvr_reg = 0x%02x, "
- "value = 0x%04x.\n", xcvrAddr, xcvrReg, *value);
-
/* set the registers we touched back to the state at which we entered
* this function
*/
@@ -242,11 +232,11 @@ int MiWrite(struct et131x_adapter *adapter, uint8_t xcvrReg, uint16_t value)
if (delay == 100) {
uint16_t TempValue;
- DBG_WARNING(et131x_dbginfo,
- "xcvrReg 0x%08x could not be written", xcvrReg);
- DBG_WARNING(et131x_dbginfo, "status is 0x%08x\n",
+ dev_warn(&adapter->pdev->dev,
+ "xcvrReg 0x%08x could not be written", xcvrReg);
+ dev_warn(&adapter->pdev->dev, "status is 0x%08x\n",
miiIndicator.value);
- DBG_WARNING(et131x_dbginfo, "command is 0x%08x\n",
+ dev_warn(&adapter->pdev->dev, "command is 0x%08x\n",
readl(&mac->mii_mgmt_cmd.value));
MiRead(adapter, xcvrReg, &TempValue);
@@ -263,10 +253,6 @@ int MiWrite(struct et131x_adapter *adapter, uint8_t xcvrReg, uint16_t value)
writel(miiAddr.value, &mac->mii_mgmt_addr.value);
writel(miiCmd.value, &mac->mii_mgmt_cmd.value);
- DBG_VERBOSE(et131x_dbginfo, " xcvr_addr = 0x%02x, "
- "xcvr_reg = 0x%02x, "
- "value = 0x%04x.\n", xcvrAddr, xcvrReg, value);
-
return status;
}
@@ -284,8 +270,6 @@ int et131x_xcvr_find(struct et131x_adapter *adapter)
MI_IDR2_t idr2;
uint32_t xcvr_id;
- DBG_ENTER(et131x_dbginfo);
-
/* We need to get xcvr id and address we just get the first one */
for (xcvr_addr = 0; xcvr_addr < 32; xcvr_addr++) {
/* Read the ID from the PHY */
@@ -299,10 +283,6 @@ int et131x_xcvr_find(struct et131x_adapter *adapter)
xcvr_id = (uint32_t) ((idr1.value << 16) | idr2.value);
if ((idr1.value != 0) && (idr1.value != 0xffff)) {
- DBG_TRACE(et131x_dbginfo,
- "Xcvr addr: 0x%02x\tXcvr_id: 0x%08x\n",
- xcvr_addr, xcvr_id);
-
adapter->Stats.xcvr_id = xcvr_id;
adapter->Stats.xcvr_addr = xcvr_addr;
@@ -310,8 +290,6 @@ int et131x_xcvr_find(struct et131x_adapter *adapter)
break;
}
}
-
- DBG_LEAVE(et131x_dbginfo);
return status;
}
@@ -327,13 +305,9 @@ int et131x_setphy_normal(struct et131x_adapter *adapter)
{
int status;
- DBG_ENTER(et131x_dbginfo);
-
/* Make sure the PHY is powered up */
ET1310_PhyPowerDown(adapter, 0);
status = et131x_xcvr_init(adapter);
-
- DBG_LEAVE(et131x_dbginfo);
return status;
}
@@ -350,8 +324,6 @@ static int et131x_xcvr_init(struct et131x_adapter *adapter)
MI_ISR_t isr;
MI_LCR2_t lcr2;
- DBG_ENTER(et131x_dbginfo);
-
/* Zero out the adapter structure variable representing BMSR */
adapter->Bmsr.value = 0;
@@ -412,8 +384,6 @@ static int et131x_xcvr_init(struct et131x_adapter *adapter)
/* NOTE - Do we need this? */
ET1310_PhyAccessMiBit(adapter, TRUEPHY_BIT_SET, 0, 9, NULL);
-
- DBG_LEAVE(et131x_dbginfo);
return status;
} else {
ET1310_PhyAutoNeg(adapter, false);
@@ -469,7 +439,6 @@ static int et131x_xcvr_init(struct et131x_adapter *adapter)
break;
}
- DBG_LEAVE(et131x_dbginfo);
return status;
}
}
@@ -486,8 +455,6 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
uint32_t polarity;
unsigned long flags;
- DBG_ENTER(et131x_dbginfo);
-
if (bmsr_ints.bits.link_status) {
if (bmsr.bits.link_status) {
etdev->PoMgmt.TransPhyComaModeOnBoot = 20;
@@ -506,8 +473,8 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
if (etdev->RegistryPhyLoopbk == false)
netif_carrier_on(etdev->netdev);
} else {
- DBG_WARNING(et131x_dbginfo,
- "Link down cable problem\n");
+ dev_warn(&etdev->pdev->dev,
+ "Link down - cable problem ?\n");
if (etdev->linkspeed == TRUEPHY_SPEED_10MBPS) {
/* NOTE - Is there a way to query this without
@@ -586,11 +553,6 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
etdev->linkspeed = speed;
etdev->duplex_mode = duplex;
- DBG_TRACE(et131x_dbginfo,
- "etdev->linkspeed 0x%04x, etdev->duplex_mode 0x%08x\n",
- etdev->linkspeed,
- etdev->duplex_mode);
-
etdev->PoMgmt.TransPhyComaModeOnBoot = 20;
if (etdev->linkspeed == TRUEPHY_SPEED_10MBPS) {
@@ -619,8 +581,6 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
ConfigMACRegs2(etdev);
}
}
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -631,8 +591,6 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
*/
void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -646,8 +604,6 @@ void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -658,8 +614,6 @@ void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *etdev)
*/
void TPAL_SetPhy10FullDuplex(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -673,8 +627,6 @@ void TPAL_SetPhy10FullDuplex(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -683,8 +635,6 @@ void TPAL_SetPhy10FullDuplex(struct et131x_adapter *etdev)
*/
void TPAL_SetPhy10Force(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -704,8 +654,6 @@ void TPAL_SetPhy10Force(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -716,8 +664,6 @@ void TPAL_SetPhy10Force(struct et131x_adapter *etdev)
*/
void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -734,8 +680,6 @@ void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -746,8 +690,6 @@ void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
*/
void TPAL_SetPhy100FullDuplex(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -761,8 +703,6 @@ void TPAL_SetPhy100FullDuplex(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -771,8 +711,6 @@ void TPAL_SetPhy100FullDuplex(struct et131x_adapter *etdev)
*/
void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -792,8 +730,6 @@ void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -804,8 +740,6 @@ void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
*/
void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -819,8 +753,6 @@ void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
/* power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -829,8 +761,6 @@ void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
*/
void TPAL_SetPhyAutoNeg(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Power down PHY */
ET1310_PhyPowerDown(etdev, 1);
@@ -849,8 +779,6 @@ void TPAL_SetPhyAutoNeg(struct et131x_adapter *etdev)
/* Power up PHY */
ET1310_PhyPowerDown(etdev, 0);
-
- DBG_LEAVE(et131x_dbginfo);
}
diff --git a/drivers/staging/et131x/et1310_pm.c b/drivers/staging/et131x/et1310_pm.c
index f4c942c..7d07723 100644
--- a/drivers/staging/et131x/et1310_pm.c
+++ b/drivers/staging/et131x/et1310_pm.c
@@ -56,7 +56,6 @@
*/
#include "et131x_version.h"
-#include "et131x_debug.h"
#include "et131x_defs.h"
#include <linux/init.h>
@@ -92,11 +91,6 @@
#include "et131x_adapter.h"
#include "et131x_initpci.h"
-/* Data for debugging facilities */
-#ifdef CONFIG_ET131X_DEBUG
-extern dbg_info_t *et131x_dbginfo;
-#endif /* CONFIG_ET131X_DEBUG */
-
/**
* EnablePhyComa - called when network cable is unplugged
* @etdev: pointer to our adapter structure
@@ -122,8 +116,6 @@ void EnablePhyComa(struct et131x_adapter *etdev)
unsigned long flags;
u32 GlobalPmCSR;
- DBG_ENTER(et131x_dbginfo);
-
GlobalPmCSR = readl(&etdev->regs->global.pm_csr);
/* Save the GbE PHY speed and duplex modes. Need to restore this
@@ -146,8 +138,6 @@ void EnablePhyComa(struct et131x_adapter *etdev)
/* Program gigE PHY in to Coma mode */
GlobalPmCSR |= ET_PM_PHY_SW_COMA;
writel(GlobalPmCSR, &etdev->regs->global.pm_csr);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -158,8 +148,6 @@ void DisablePhyComa(struct et131x_adapter *etdev)
{
u32 GlobalPmCSR;
- DBG_ENTER(et131x_dbginfo);
-
GlobalPmCSR = readl(&etdev->regs->global.pm_csr);
/* Disable phy_sw_coma register and re-enable JAGCore clocks */
@@ -193,7 +181,5 @@ void DisablePhyComa(struct et131x_adapter *etdev)
/* Need to re-enable Rx. */
et131x_rx_dma_enable(etdev);
-
- DBG_LEAVE(et131x_dbginfo);
}
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index 54a7ecf..8f2e91f 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -56,7 +56,6 @@
*/
#include "et131x_version.h"
-#include "et131x_debug.h"
#include "et131x_defs.h"
#include <linux/pci.h>
@@ -93,11 +92,6 @@
#include "et1310_rx.h"
-/* Data for debugging facilities */
-#ifdef CONFIG_ET131X_DEBUG
-extern dbg_info_t *et131x_dbginfo;
-#endif /* CONFIG_ET131X_DEBUG */
-
void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd);
@@ -117,8 +111,6 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
uint32_t pktStatRingSize, FBRChunkSize;
RX_RING_t *rx_ring;
- DBG_ENTER(et131x_dbginfo);
-
/* Setup some convenience pointers */
rx_ring = (RX_RING_t *) &adapter->RxRing;
@@ -183,9 +175,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
bufsize,
&rx_ring->pFbr1RingPa);
if (!rx_ring->pFbr1RingVa) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Free Buffer Ring 1\n");
- DBG_LEAVE(et131x_dbginfo);
return -ENOMEM;
}
@@ -213,9 +204,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
bufsize,
&rx_ring->pFbr0RingPa);
if (!rx_ring->pFbr0RingVa) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Free Buffer Ring 0\n");
- DBG_LEAVE(et131x_dbginfo);
return -ENOMEM;
}
@@ -262,8 +252,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
&rx_ring->Fbr1MemPa[OuterLoop]);
if (!rx_ring->Fbr1MemVa[OuterLoop]) {
- DBG_ERROR(et131x_dbginfo, "Could not alloc memory\n");
- DBG_LEAVE(et131x_dbginfo);
+ dev_err(&adapter->pdev->dev,
+ "Could not alloc memory\n");
return -ENOMEM;
}
@@ -313,8 +303,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
&rx_ring->Fbr0MemPa[OuterLoop]);
if (!rx_ring->Fbr0MemVa[OuterLoop]) {
- DBG_ERROR(et131x_dbginfo, "Could not alloc memory\n");
- DBG_LEAVE(et131x_dbginfo);
+ dev_err(&adapter->pdev->dev,
+ "Could not alloc memory\n");
return -ENOMEM;
}
@@ -356,9 +346,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
&rx_ring->pPSRingPa);
if (!rx_ring->pPSRingVa) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Packet Status Ring\n");
- DBG_LEAVE(et131x_dbginfo);
return -ENOMEM;
}
@@ -384,9 +373,8 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
sizeof(RX_STATUS_BLOCK_t) +
0x7, &rx_ring->pRxStatusPa);
if (!rx_ring->pRxStatusVa) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Status Block\n");
- DBG_LEAVE(et131x_dbginfo);
return -ENOMEM;
}
@@ -422,8 +410,6 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
*/
INIT_LIST_HEAD(&rx_ring->RecvList);
INIT_LIST_HEAD(&rx_ring->RecvPendingList);
-
- DBG_LEAVE(et131x_dbginfo);
return 0;
}
@@ -439,13 +425,11 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
PMP_RFD pMpRfd;
RX_RING_t *rx_ring;
- DBG_ENTER(et131x_dbginfo);
-
/* Setup some convenience pointers */
rx_ring = (RX_RING_t *) &adapter->RxRing;
/* Free RFDs and associated packet descriptors */
- DBG_ASSERT(rx_ring->nReadyRecv == rx_ring->NumRfd);
+ WARN_ON(rx_ring->nReadyRecv != rx_ring->NumRfd);
while (!list_empty(&rx_ring->RecvList)) {
pMpRfd = (MP_RFD *) list_entry(rx_ring->RecvList.next,
@@ -583,8 +567,6 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
/* Reset Counters */
rx_ring->nReadyRecv = 0;
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -601,8 +583,6 @@ int et131x_init_recv(struct et131x_adapter *adapter)
uint32_t TotalNumRfd = 0;
RX_RING_t *rx_ring = NULL;
- DBG_ENTER(et131x_dbginfo);
-
/* Setup some convenience pointers */
rx_ring = (RX_RING_t *) &adapter->RxRing;
@@ -612,7 +592,7 @@ int et131x_init_recv(struct et131x_adapter *adapter)
GFP_ATOMIC | GFP_DMA);
if (!pMpRfd) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Couldn't alloc RFD out of kmem_cache\n");
status = -ENOMEM;
continue;
@@ -620,7 +600,7 @@ int et131x_init_recv(struct et131x_adapter *adapter)
status = et131x_rfd_resources_alloc(adapter, pMpRfd);
if (status != 0) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Couldn't alloc packet for RFD\n");
kmem_cache_free(rx_ring->RecvLookaside, pMpRfd);
continue;
@@ -641,11 +621,9 @@ int et131x_init_recv(struct et131x_adapter *adapter)
if (status != 0) {
kmem_cache_free(rx_ring->RecvLookaside, pMpRfd);
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&adapter->pdev->dev,
"Allocation problems in et131x_init_recv\n");
}
-
- DBG_LEAVE(et131x_dbginfo);
return status;
}
@@ -687,8 +665,6 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
RXDMA_PSR_NUM_DES_t psr_num_des;
unsigned long flags;
- DBG_ENTER(et131x_dbginfo);
-
/* Halt RXDMA to perform the reconfigure. */
et131x_rx_dma_disable(etdev);
@@ -786,8 +762,6 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
writel(PARM_RX_TIME_INT_DEF, &rx_dma->max_pkt_time.value);
spin_unlock_irqrestore(&etdev->RcvLock, flags);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -814,8 +788,6 @@ void et131x_rx_dma_disable(struct et131x_adapter *etdev)
{
RXDMA_CSR_t csr;
- DBG_ENTER(et131x_dbginfo);
-
/* Setup the receive dma configuration register */
writel(0x00002001, &etdev->regs->rxdma.csr.value);
csr.value = readl(&etdev->regs->rxdma.csr.value);
@@ -823,12 +795,10 @@ void et131x_rx_dma_disable(struct et131x_adapter *etdev)
udelay(5);
csr.value = readl(&etdev->regs->rxdma.csr.value);
if (csr.bits.halt_status != 1)
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&etdev->pdev->dev,
"RX Dma failed to enter halt state. CSR 0x%08x\n",
csr.value);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -837,8 +807,6 @@ void et131x_rx_dma_disable(struct et131x_adapter *etdev)
*/
void et131x_rx_dma_enable(struct et131x_adapter *etdev)
{
- DBG_RX_ENTER(et131x_dbginfo);
-
if (etdev->RegistryPhyLoopbk)
/* RxDMA is disabled for loopback operation. */
writel(0x1, &etdev->regs->rxdma.csr.value);
@@ -869,14 +837,12 @@ void et131x_rx_dma_enable(struct et131x_adapter *etdev)
udelay(5);
csr.value = readl(&etdev->regs->rxdma.csr.value);
if (csr.bits.halt_status != 0) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&etdev->pdev->dev,
"RX Dma failed to exit halt state. CSR 0x%08x\n",
csr.value);
}
}
}
-
- DBG_RX_LEAVE(et131x_dbginfo);
}
/**
@@ -905,9 +871,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
uint32_t localLen;
PKT_STAT_DESC_WORD0_t Word0;
-
- DBG_RX_ENTER(et131x_dbginfo);
-
/* RX Status block is written by the DMA engine prior to every
* interrupt. It contains the next to be used entry in the Packet
* Status Ring, and also the two Free Buffer rings.
@@ -919,8 +882,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
pRxStatusBlock->Word1.bits.PSRwrap ==
pRxLocal->local_psr_full.bits.psr_full_wrap) {
/* Looks like this ring is not updated yet */
- DBG_RX(et131x_dbginfo, "(0)\n");
- DBG_RX_LEAVE(et131x_dbginfo);
return NULL;
}
@@ -937,23 +898,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
bufferIndex = (uint16_t) pPSREntry->word1.bits.bi;
Word0 = pPSREntry->word0;
- DBG_RX(et131x_dbginfo, "RX PACKET STATUS\n");
- DBG_RX(et131x_dbginfo, "\tlength : %d\n", localLen);
- DBG_RX(et131x_dbginfo, "\tringIndex : %d\n", ringIndex);
- DBG_RX(et131x_dbginfo, "\tbufferIndex : %d\n", bufferIndex);
- DBG_RX(et131x_dbginfo, "\tword0 : 0x%08x\n", Word0.value);
-
-#if 0
- /* Check the Status Word that the MAC has appended to the PSR
- * entry in case the MAC has detected errors.
- */
- if (Word0.value & ALCATEL_BAD_STATUS) {
- DBG_ERROR(et131x_dbginfo,
- "NICRxPkts >> Alcatel Status Word error."
- "Value 0x%08x\n", pPSREntry->word0.value);
- }
-#endif
-
/* Indicate that we have used this PSR entry. */
if (++pRxLocal->local_psr_full.bits.psr_full >
pRxLocal->PsrNumEntries - 1) {
@@ -966,11 +910,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
#ifndef USE_FBR0
if (ringIndex != 1) {
- DBG_ERROR(et131x_dbginfo,
- "NICRxPkts PSR Entry %d indicates "
- "Buffer Ring 0 in use\n",
- pRxLocal->local_psr_full.bits.psr_full);
- DBG_RX_LEAVE(et131x_dbginfo);
return NULL;
}
#endif
@@ -987,12 +926,11 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
#endif
{
/* Illegal buffer or ring index cannot be used by S/W*/
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&etdev->pdev->dev,
"NICRxPkts PSR Entry %d indicates "
"length of %d and/or bad bi(%d)\n",
pRxLocal->local_psr_full.bits.psr_full,
localLen, bufferIndex);
- DBG_RX_LEAVE(et131x_dbginfo);
return NULL;
}
@@ -1004,9 +942,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
pMpRfd = (PMP_RFD) list_entry(element, MP_RFD, list_node);
if (pMpRfd == NULL) {
- DBG_RX(et131x_dbginfo,
- "NULL RFD returned from RecvList via list_entry()\n");
- DBG_RX_LEAVE(et131x_dbginfo);
spin_unlock_irqrestore(&etdev->RcvLock, flags);
return NULL;
}
@@ -1040,19 +975,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
etdev->ReplicaPhyLoopbkPF = 1;
}
}
- DBG_WARNING(et131x_dbginfo,
- "pBufVa:\t%02x:%02x:%02x:%02x:%02x:%02x\n",
- pBufVa[6], pBufVa[7], pBufVa[8],
- pBufVa[9], pBufVa[10], pBufVa[11]);
-
- DBG_WARNING(et131x_dbginfo,
- "CurrentAddr:\t%02x:%02x:%02x:%02x:%02x:%02x\n",
- etdev->CurrentAddress[0],
- etdev->CurrentAddress[1],
- etdev->CurrentAddress[2],
- etdev->CurrentAddress[3],
- etdev->CurrentAddress[4],
- etdev->CurrentAddress[5]);
}
/* Determine if this is a multicast packet coming in */
@@ -1127,9 +1049,8 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
skb = dev_alloc_skb(pMpRfd->PacketSize + 2);
if (!skb) {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&etdev->pdev->dev,
"Couldn't alloc an SKB for Rx\n");
- DBG_RX_LEAVE(et131x_dbginfo);
return NULL;
}
@@ -1149,9 +1070,6 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
}
nic_return_rfd(etdev, pMpRfd);
-
- DBG_RX(et131x_dbginfo, "(1)\n");
- DBG_RX_LEAVE(et131x_dbginfo);
return pMpRfd;
}
@@ -1166,9 +1084,7 @@ void et131x_reset_recv(struct et131x_adapter *etdev)
PMP_RFD pMpRfd;
struct list_head *element;
- DBG_ENTER(et131x_dbginfo);
-
- DBG_ASSERT(!list_empty(&etdev->RxRing.RecvList));
+ WARN_ON(list_empty(&etdev->RxRing.RecvList));
/* Take all the RFD's from the pending list, and stick them on the
* RecvList.
@@ -1180,8 +1096,6 @@ void et131x_reset_recv(struct et131x_adapter *etdev)
list_move_tail(&pMpRfd->list_node, &etdev->RxRing.RecvList);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -1200,15 +1114,12 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
uint32_t PacketFreeCount = 0;
bool TempUnfinishedRec = false;
- DBG_RX_ENTER(et131x_dbginfo);
-
PacketsToHandle = NUM_PACKETS_HANDLED;
/* Process up to available RFD's */
while (PacketArrayCount < PacketsToHandle) {
if (list_empty(&etdev->RxRing.RecvList)) {
- DBG_ASSERT(etdev->RxRing.nReadyRecv == 0);
- DBG_ERROR(et131x_dbginfo, "NO RFD's !!!!!!!!!!!!!\n");
+ WARN_ON(etdev->RxRing.nReadyRecv != 0);
TempUnfinishedRec = true;
break;
}
@@ -1246,8 +1157,8 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
RFDFreeArray[PacketFreeCount] = pMpRfd;
PacketFreeCount++;
- DBG_WARNING(et131x_dbginfo,
- "RFD's are running out !!!!!!!!!!!!!\n");
+ dev_warn(&etdev->pdev->dev,
+ "RFD's are running out\n");
}
PacketArray[PacketArrayCount] = pMpRfd->Packet;
@@ -1262,8 +1173,6 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
/* Watchdog timer will disable itself if appropriate. */
etdev->RxRing.UnfinishedReceives = false;
}
-
- DBG_RX_LEAVE(et131x_dbginfo);
}
static inline u32 bump_fbr(u32 *fbr, u32 limit)
@@ -1289,8 +1198,6 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
uint8_t ri = pMpRfd->ringindex;
unsigned long flags;
- DBG_RX_ENTER(et131x_dbginfo);
-
/* We don't use any of the OOB data besides status. Otherwise, we
* need to clean up OOB data
*/
@@ -1339,7 +1246,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
#endif
spin_unlock_irqrestore(&etdev->FbrLock, flags);
} else {
- DBG_ERROR(et131x_dbginfo,
+ dev_err(&etdev->pdev->dev,
"NICReturnRFD illegal Buffer Index returned\n");
}
@@ -1351,6 +1258,5 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
rx_local->nReadyRecv++;
spin_unlock_irqrestore(&etdev->RcvLock, flags);
- DBG_ASSERT(rx_local->nReadyRecv <= rx_local->NumRfd);
- DBG_RX_LEAVE(et131x_dbginfo);
+ WARN_ON(rx_local->nReadyRecv > rx_local->NumRfd);
}
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index 4c18e9a..387a697 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -56,7 +56,6 @@
*/
#include "et131x_version.h"
-#include "et131x_debug.h"
#include "et131x_defs.h"
#include <linux/pci.h>
@@ -95,11 +94,6 @@
#include "et1310_tx.h"
-/* Data for debugging facilities */
-#ifdef CONFIG_ET131X_DEBUG
-extern dbg_info_t *et131x_dbginfo;
-#endif /* CONFIG_ET131X_DEBUG */
-
static void et131x_update_tcb_list(struct et131x_adapter *etdev);
static void et131x_check_send_wait_list(struct et131x_adapter *etdev);
static inline void et131x_free_send_packet(struct et131x_adapter *etdev,
@@ -125,14 +119,11 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
int desc_size = 0;
TX_RING_t *tx_ring = &adapter->TxRing;
- DBG_ENTER(et131x_dbginfo);
-
/* Allocate memory for the TCB's (Transmit Control Block) */
adapter->TxRing.MpTcbMem = (MP_TCB *)kcalloc(NUM_TCB, sizeof(MP_TCB),
GFP_ATOMIC | GFP_DMA);
if (!adapter->TxRing.MpTcbMem) {
- DBG_ERROR(et131x_dbginfo, "Cannot alloc memory for TCBs\n");
- DBG_LEAVE(et131x_dbginfo);
+ dev_err(&adapter->pdev->dev, "Cannot alloc memory for TCBs\n");
return -ENOMEM;
}
@@ -144,8 +135,7 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
(PTX_DESC_ENTRY_t) pci_alloc_consistent(adapter->pdev, desc_size,
&tx_ring->pTxDescRingPa);
if (!adapter->TxRing.pTxDescRingVa) {
- DBG_ERROR(et131x_dbginfo, "Cannot alloc memory for Tx Ring\n");
- DBG_LEAVE(et131x_dbginfo);
+ dev_err(&adapter->pdev->dev, "Cannot alloc memory for Tx Ring\n");
return -ENOMEM;
}
@@ -170,9 +160,8 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
sizeof(TX_STATUS_BLOCK_t),
&tx_ring->pTxStatusPa);
if (!adapter->TxRing.pTxStatusPa) {
- DBG_ERROR(et131x_dbginfo,
- "Cannot alloc memory for Tx status block\n");
- DBG_LEAVE(et131x_dbginfo);
+ dev_err(&adapter->pdev->dev,
+ "Cannot alloc memory for Tx status block\n");
return -ENOMEM;
}
@@ -181,13 +170,11 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
NIC_MIN_PACKET_SIZE,
&tx_ring->pTxDummyBlkPa);
if (!adapter->TxRing.pTxDummyBlkPa) {
- DBG_ERROR(et131x_dbginfo,
- "Cannot alloc memory for Tx dummy buffer\n");
- DBG_LEAVE(et131x_dbginfo);
+ dev_err(&adapter->pdev->dev,
+ "Cannot alloc memory for Tx dummy buffer\n");
return -ENOMEM;
}
- DBG_LEAVE(et131x_dbginfo);
return 0;
}
@@ -201,8 +188,6 @@ void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
{
int desc_size = 0;
- DBG_ENTER(et131x_dbginfo);
-
if (adapter->TxRing.pTxDescRingVa) {
/* Free memory relating to Tx rings here */
adapter->TxRing.pTxDescRingVa -= adapter->TxRing.TxDescOffset;
@@ -240,8 +225,6 @@ void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
/* Free the memory for MP_TCB structures */
kfree(adapter->TxRing.MpTcbMem);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -252,8 +235,6 @@ void ConfigTxDmaRegs(struct et131x_adapter *etdev)
{
struct _TXDMA_t __iomem *txdma = &etdev->regs->txdma;
- DBG_ENTER(et131x_dbginfo);
-
/* Load the hardware with the start of the transmit descriptor ring. */
writel((uint32_t) (etdev->TxRing.pTxDescRingAdjustedPa >> 32),
&txdma->pr_base_hi);
@@ -277,8 +258,6 @@ void ConfigTxDmaRegs(struct et131x_adapter *etdev)
writel(0, &txdma->service_request);
etdev->TxRing.txDmaReadyToSend = 0;
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -287,12 +266,8 @@ void ConfigTxDmaRegs(struct et131x_adapter *etdev)
*/
void et131x_tx_dma_disable(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
/* Setup the tramsmit dma configuration register */
writel(0x101, &etdev->regs->txdma.csr.value);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -303,8 +278,6 @@ void et131x_tx_dma_disable(struct et131x_adapter *etdev)
*/
void et131x_tx_dma_enable(struct et131x_adapter *etdev)
{
- DBG_ENTER(et131x_dbginfo);
-
if (etdev->RegistryPhyLoopbk) {
/* TxDMA is disabled for loopback operation. */
writel(0x101, &etdev->regs->txdma.csr.value);
@@ -319,8 +292,6 @@ void et131x_tx_dma_enable(struct et131x_adapter *etdev)
csr.bits.cache_thrshld = PARM_DMA_CACHE_DEF;
writel(csr.value, &etdev->regs->txdma.csr.value);
}
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -333,8 +304,6 @@ void et131x_init_send(struct et131x_adapter *adapter)
uint32_t TcbCount;
TX_RING_t *tx_ring;
- DBG_ENTER(et131x_dbginfo);
-
/* Setup some convenience pointers */
tx_ring = &adapter->TxRing;
pMpTcb = adapter->TxRing.MpTcbMem;
@@ -364,8 +333,6 @@ void et131x_init_send(struct et131x_adapter *adapter)
tx_ring->CurrSendTail = (PMP_TCB) NULL;
INIT_LIST_HEAD(&adapter->TxRing.SendWaitQueue);
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -380,8 +347,6 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
int status = 0;
struct et131x_adapter *etdev = NULL;
- DBG_TX_ENTER(et131x_dbginfo);
-
etdev = netdev_priv(netdev);
/* Send these packets
@@ -397,7 +362,6 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
* packet under Linux; if we just send an error up to the
* netif layer, it will resend the skb to us.
*/
- DBG_VERBOSE(et131x_dbginfo, "TCB Resources Not Available\n");
status = -ENOMEM;
} else {
/* We need to see if the link is up; if it's not, make the
@@ -409,9 +373,6 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
*/
if (MP_SHOULD_FAIL_SEND(etdev) || etdev->DriverNoPhyAccess
|| !netif_carrier_ok(netdev)) {
- DBG_VERBOSE(et131x_dbginfo,
- "Can't Tx, Link is DOWN; drop the packet\n");
-
dev_kfree_skb_any(skb);
skb = NULL;
@@ -426,24 +387,16 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
* send an error up to the netif layer, it
* will resend the skb to us.
*/
- DBG_WARNING(et131x_dbginfo,
- "Resources problem, Queue tx packet\n");
} else if (status != 0) {
/* On any other error, make netif think we're
* OK and drop the packet
*/
- DBG_WARNING(et131x_dbginfo,
- "General error, drop packet\n");
-
dev_kfree_skb_any(skb);
skb = NULL;
-
etdev->net_stats.tx_dropped++;
}
}
}
-
- DBG_TX_LEAVE(et131x_dbginfo);
return status;
}
@@ -464,21 +417,8 @@ static int et131x_send_packet(struct sk_buff *skb,
uint16_t *shbufva;
unsigned long flags;
- DBG_TX_ENTER(et131x_dbginfo);
-
- /* Is our buffer scattered, or continuous? */
- if (skb_shinfo(skb)->nr_frags == 0) {
- DBG_TX(et131x_dbginfo, "Scattered buffer: NO\n");
- } else {
- DBG_TX(et131x_dbginfo, "Scattered buffer: YES, Num Frags: %d\n",
- skb_shinfo(skb)->nr_frags);
- }
-
/* All packets must have at least a MAC address and a protocol type */
if (skb->len < ETH_HLEN) {
- DBG_ERROR(et131x_dbginfo,
- "Packet size < ETH_HLEN (14 bytes)\n");
- DBG_LEAVE(et131x_dbginfo);
return -EIO;
}
@@ -489,9 +429,6 @@ static int et131x_send_packet(struct sk_buff *skb,
if (pMpTcb == NULL) {
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
-
- DBG_WARNING(et131x_dbginfo, "Can't obtain a TCB\n");
- DBG_TX_LEAVE(et131x_dbginfo);
return -ENOMEM;
}
@@ -533,16 +470,10 @@ static int et131x_send_packet(struct sk_buff *skb,
}
etdev->TxRing.TCBReadyQueueTail = pMpTcb;
-
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
-
- DBG_TX_LEAVE(et131x_dbginfo);
return status;
}
-
- DBG_ASSERT(etdev->TxRing.nBusySend <= NUM_TCB);
-
- DBG_TX_LEAVE(et131x_dbginfo);
+ WARN_ON(etdev->TxRing.nBusySend > NUM_TCB);
return 0;
}
@@ -564,8 +495,6 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
struct skb_frag_struct *pFragList = &skb_shinfo(pPacket)->frags[0];
unsigned long flags;
- DBG_TX_ENTER(et131x_dbginfo);
-
/* Part of the optimizations of this send routine restrict us to
* sending 24 fragments at a pass. In practice we should never see
* more than 5 fragments.
@@ -575,7 +504,6 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
* although it is less efficient.
*/
if (FragListCount > 23) {
- DBG_TX_LEAVE(et131x_dbginfo);
return -EIO;
}
@@ -596,15 +524,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
* doesn't seem to like large fragments.
*/
if ((pPacket->len - pPacket->data_len) <= 1514) {
- DBG_TX(et131x_dbginfo,
- "Got packet of length %d, "
- "filling desc entry %d, "
- "TCB: 0x%p\n",
- (pPacket->len - pPacket->data_len),
- etdev->TxRing.txDmaReadyToSend, pMpTcb);
-
CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
-
CurDesc[FragmentNumber].word2.bits.
length_in_bytes =
pPacket->len - pPacket->data_len;
@@ -624,15 +544,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
pPacket->data_len,
PCI_DMA_TODEVICE);
} else {
- DBG_TX(et131x_dbginfo,
- "Got packet of length %d, "
- "filling desc entry %d, "
- "TCB: 0x%p\n",
- (pPacket->len - pPacket->data_len),
- etdev->TxRing.txDmaReadyToSend, pMpTcb);
-
CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
-
CurDesc[FragmentNumber].word2.bits.
length_in_bytes =
((pPacket->len - pPacket->data_len) / 2);
@@ -675,16 +587,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
PCI_DMA_TODEVICE);
}
} else {
- DBG_TX(et131x_dbginfo,
- "Got packet of length %d,"
- "filling desc entry %d\n"
- "TCB: 0x%p\n",
- pFragList[loopIndex].size,
- etdev->TxRing.txDmaReadyToSend,
- pMpTcb);
-
CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
-
CurDesc[FragmentNumber].word2.bits.length_in_bytes =
pFragList[loopIndex - 1].size;
@@ -703,10 +606,8 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
}
}
- if (FragmentNumber == 0) {
- DBG_WARNING(et131x_dbginfo, "No. frags is 0\n");
+ if (FragmentNumber == 0)
return -EIO;
- }
if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS) {
if (++etdev->TxRing.TxPacketsSinceLastinterrupt ==
@@ -774,7 +675,7 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
etdev->TxRing.CurrSendTail = pMpTcb;
- DBG_ASSERT(pMpTcb->Next == NULL);
+ WARN_ON(pMpTcb->Next != NULL);
etdev->TxRing.nBusySend++;
@@ -791,432 +692,11 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO,
&etdev->regs->global.watchdog_timer);
}
-
spin_unlock_irqrestore(&etdev->SendHWLock, flags);
- DBG_TX_LEAVE(et131x_dbginfo);
return 0;
}
-/*
- * NOTE: For now, keep this older version of NICSendPacket around for
- * reference, even though it's not used
- */
-#if 0
-
-/**
- * NICSendPacket - NIC specific send handler.
- * @etdev: pointer to our adapter
- * @pMpTcb: pointer to MP_TCB
- *
- * Returns 0 on succes, errno on failure.
- *
- * This version of the send routine is designed for version A silicon.
- * Assumption - Send spinlock has been acquired.
- */
-static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
-{
- uint32_t loopIndex, fragIndex, loopEnd;
- uint32_t splitfirstelem = 0;
- uint32_t SegmentSize = 0;
- TX_DESC_ENTRY_t CurDesc;
- TX_DESC_ENTRY_t *CurDescPostCopy = NULL;
- uint32_t SlotsAvailable;
- DMA10W_t ServiceComplete;
- unsigned int flags;
- struct sk_buff *pPacket = pMpTcb->Packet;
- uint32_t FragListCount = skb_shinfo(pPacket)->nr_frags + 1;
- struct skb_frag_struct *pFragList = &skb_shinfo(pPacket)->frags[0];
-
- DBG_TX_ENTER(et131x_dbginfo);
-
- ServiceComplete.value =
- readl(&etdev->regs->txdma.NewServiceComplete.value);
-
- /*
- * Attempt to fix TWO hardware bugs:
- * 1) NEVER write an odd number of descriptors.
- * 2) If packet length is less than NIC_MIN_PACKET_SIZE, then pad the
- * packet to NIC_MIN_PACKET_SIZE bytes by adding a new last
- * descriptor IN HALF DUPLEX MODE ONLY
- * NOTE that (2) interacts with (1). If the packet is less than
- * NIC_MIN_PACKET_SIZE bytes then we will append a descriptor.
- * Therefore if it is even now, it will eventually end up odd, and
- * so will need adjusting.
- *
- * VLAN tags get involved since VLAN tags add another one or two
- * segments.
- */
- DBG_TX(et131x_dbginfo,
- "pMpTcb->PacketLength: %d\n", pMpTcb->PacketLength);
-
- if ((etdev->duplex_mode == 0)
- && (pMpTcb->PacketLength < NIC_MIN_PACKET_SIZE)) {
- DBG_TX(et131x_dbginfo,
- "HALF DUPLEX mode AND len < MIN_PKT_SIZE\n");
- if ((FragListCount & 0x1) == 0) {
- DBG_TX(et131x_dbginfo,
- "Even number of descs, split 1st elem\n");
- splitfirstelem = 1;
- /* SegmentSize = pFragList[0].size / 2; */
- SegmentSize = (pPacket->len - pPacket->data_len) / 2;
- }
- } else if (FragListCount & 0x1) {
- DBG_TX(et131x_dbginfo, "Odd number of descs, split 1st elem\n");
-
- splitfirstelem = 1;
- /* SegmentSize = pFragList[0].size / 2; */
- SegmentSize = (pPacket->len - pPacket->data_len) / 2;
- }
-
- spin_lock_irqsave(&etdev->SendHWLock, flags);
-
- if (etdev->TxRing.txDmaReadyToSend.bits.serv_req_wrap ==
- ServiceComplete.bits.serv_cpl_wrap) {
- /* The ring hasn't wrapped. Slots available should be
- * (RING_SIZE) - the difference between the two pointers.
- */
- SlotsAvailable = NUM_DESC_PER_RING_TX -
- (etdev->TxRing.txDmaReadyToSend.bits.serv_req -
- ServiceComplete.bits.serv_cpl);
- } else {
- /* The ring has wrapped. Slots available should be the
- * difference between the two pointers.
- */
- SlotsAvailable = ServiceComplete.bits.serv_cpl -
- etdev->TxRing.txDmaReadyToSend.bits.serv_req;
- }
-
- if ((FragListCount + splitfirstelem) > SlotsAvailable) {
- DBG_WARNING(et131x_dbginfo,
- "Not Enough Space in Tx Desc Ring\n");
- spin_unlock_irqrestore(&etdev->SendHWLock, flags);
- return -ENOMEM;
- }
-
- loopEnd = (FragListCount) + splitfirstelem;
- fragIndex = 0;
-
- DBG_TX(et131x_dbginfo,
- "TCB : 0x%p\n"
- "Packet (SKB) : 0x%p\t Packet->len: %d\t Packet->data_len: %d\n"
- "FragListCount : %d\t splitfirstelem: %d\t loopEnd:%d\n",
- pMpTcb,
- pPacket, pPacket->len, pPacket->data_len,
- FragListCount, splitfirstelem, loopEnd);
-
- for (loopIndex = 0; loopIndex < loopEnd; loopIndex++) {
- if (loopIndex > splitfirstelem)
- fragIndex++;
-
- DBG_TX(et131x_dbginfo,
- "In loop, loopIndex: %d\t fragIndex: %d\n", loopIndex,
- fragIndex);
-
- /* If there is something in this element, let's get a
- * descriptor from the ring and get the necessary data
- */
- DBG_TX(et131x_dbginfo,
- "Packet Length %d,"
- "filling desc entry %d\n",
- pPacket->len,
- etdev->TxRing.txDmaReadyToSend.bits.serv_req);
-
- /*
- * NOTE - Should we do a paranoia check here to make sure the fragment
- * actually has a length? It's HIGHLY unlikely the fragment would
- * contain no data...
- */
- if (1) {
- /* NOTE - Currently always getting 32-bit addrs, and
- * dma_addr_t is only 32-bit, so leave "high" ptr
- * value out for now
- * CurDesc.DataBufferPtrHigh = 0;
- */
-
- CurDesc.word2.value = 0;
- CurDesc.word3.value = 0;
-
- if (fragIndex == 0) {
- if (splitfirstelem) {
- DBG_TX(et131x_dbginfo,
- "Split first element: YES\n");
-
- if (loopIndex == 0) {
- DBG_TX(et131x_dbginfo,
- "Got fragment of length %d, fragIndex: %d\n",
- pPacket->len -
- pPacket->data_len,
- fragIndex);
- DBG_TX(et131x_dbginfo,
- "SegmentSize: %d\n",
- SegmentSize);
-
- CurDesc.word2.bits.
- length_in_bytes =
- SegmentSize;
- CurDesc.DataBufferPtrLow =
- pci_map_single(etdev->
- pdev,
- pPacket->
- data,
- SegmentSize,
- PCI_DMA_TODEVICE);
- DBG_TX(et131x_dbginfo,
- "pci_map_single() returns: 0x%08x\n",
- CurDesc.
- DataBufferPtrLow);
- } else {
- DBG_TX(et131x_dbginfo,
- "Got fragment of length %d, fragIndex: %d\n",
- pPacket->len -
- pPacket->data_len,
- fragIndex);
- DBG_TX(et131x_dbginfo,
- "Leftover Size: %d\n",
- (pPacket->len -
- pPacket->data_len -
- SegmentSize));
-
- CurDesc.word2.bits.
- length_in_bytes =
- ((pPacket->len -
- pPacket->data_len) -
- SegmentSize);
- CurDesc.DataBufferPtrLow =
- pci_map_single(etdev->
- pdev,
- (pPacket->
- data +
- SegmentSize),
- (pPacket->
- len -
- pPacket->
- data_len -
- SegmentSize),
- PCI_DMA_TODEVICE);
- DBG_TX(et131x_dbginfo,
- "pci_map_single() returns: 0x%08x\n",
- CurDesc.
- DataBufferPtrLow);
- }
- } else {
- DBG_TX(et131x_dbginfo,
- "Split first element: NO\n");
-
- CurDesc.word2.bits.length_in_bytes =
- pPacket->len - pPacket->data_len;
-
- CurDesc.DataBufferPtrLow =
- pci_map_single(etdev->pdev,
- pPacket->data,
- (pPacket->len -
- pPacket->data_len),
- PCI_DMA_TODEVICE);
- DBG_TX(et131x_dbginfo,
- "pci_map_single() returns: 0x%08x\n",
- CurDesc.DataBufferPtrLow);
- }
- } else {
-
- CurDesc.word2.bits.length_in_bytes =
- pFragList[fragIndex - 1].size;
- CurDesc.DataBufferPtrLow =
- pci_map_page(etdev->pdev,
- pFragList[fragIndex - 1].page,
- pFragList[fragIndex -
- 1].page_offset,
- pFragList[fragIndex - 1].size,
- PCI_DMA_TODEVICE);
- DBG_TX(et131x_dbginfo,
- "pci_map_page() returns: 0x%08x\n",
- CurDesc.DataBufferPtrLow);
- }
-
- if (loopIndex == 0) {
- /* This is the first descriptor of the packet
- *
- * Set the "f" bit to indicate this is the
- * first descriptor in the packet.
- */
- DBG_TX(et131x_dbginfo,
- "This is our FIRST descriptor\n");
- CurDesc.word3.bits.f = 1;
-
- pMpTcb->WrIndexStart =
- etdev->TxRing.txDmaReadyToSend;
- }
-
- if ((loopIndex == (loopEnd - 1)) &&
- (etdev->duplex_mode ||
- (pMpTcb->PacketLength >= NIC_MIN_PACKET_SIZE))) {
- /* This is the Last descriptor of the packet */
- DBG_TX(et131x_dbginfo,
- "THIS is our LAST descriptor\n");
-
- if (etdev->linkspeed ==
- TRUEPHY_SPEED_1000MBPS) {
- if (++etdev->TxRing.
- TxPacketsSinceLastinterrupt >=
- PARM_TX_NUM_BUFS_DEF) {
- CurDesc.word3.value = 0x5;
- etdev->TxRing.
- TxPacketsSinceLastinterrupt
- = 0;
- } else {
- CurDesc.word3.value = 0x1;
- }
- } else {
- CurDesc.word3.value = 0x5;
- }
-
- /* Following index will be used during freeing
- * of packet
- */
- pMpTcb->WrIndex =
- etdev->TxRing.txDmaReadyToSend;
- pMpTcb->PacketStaleCount = 0;
- }
-
- /* Copy the descriptor (filled above) into the
- * descriptor ring at the next free entry. Advance
- * the "next free entry" variable
- */
- memcpy(etdev->TxRing.pTxDescRingVa +
- etdev->TxRing.txDmaReadyToSend.bits.serv_req,
- &CurDesc, sizeof(TX_DESC_ENTRY_t));
-
- CurDescPostCopy =
- etdev->TxRing.pTxDescRingVa +
- etdev->TxRing.txDmaReadyToSend.bits.serv_req;
-
- DBG_TX(et131x_dbginfo,
- "CURRENT DESCRIPTOR\n"
- "\tAddress : 0x%p\n"
- "\tDataBufferPtrHigh : 0x%08x\n"
- "\tDataBufferPtrLow : 0x%08x\n"
- "\tword2 : 0x%08x\n"
- "\tword3 : 0x%08x\n",
- CurDescPostCopy,
- CurDescPostCopy->DataBufferPtrHigh,
- CurDescPostCopy->DataBufferPtrLow,
- CurDescPostCopy->word2.value,
- CurDescPostCopy->word3.value);
-
- if (++etdev->TxRing.txDmaReadyToSend.bits.serv_req >=
- NUM_DESC_PER_RING_TX) {
- if (etdev->TxRing.txDmaReadyToSend.bits.
- serv_req_wrap) {
- etdev->TxRing.txDmaReadyToSend.
- value = 0;
- } else {
- etdev->TxRing.txDmaReadyToSend.
- value = 0x400;
- }
- }
- }
- }
-
- if (etdev->duplex_mode == 0 &&
- pMpTcb->PacketLength < NIC_MIN_PACKET_SIZE) {
- /* NOTE - Same 32/64-bit issue as above... */
- CurDesc.DataBufferPtrHigh = 0x0;
- CurDesc.DataBufferPtrLow = etdev->TxRing.pTxDummyBlkPa;
- CurDesc.word2.value = 0;
-
- if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS) {
- if (++etdev->TxRing.TxPacketsSinceLastinterrupt >=
- PARM_TX_NUM_BUFS_DEF) {
- CurDesc.word3.value = 0x5;
- etdev->TxRing.TxPacketsSinceLastinterrupt =
- 0;
- } else {
- CurDesc.word3.value = 0x1;
- }
- } else {
- CurDesc.word3.value = 0x5;
- }
-
- CurDesc.word2.bits.length_in_bytes =
- NIC_MIN_PACKET_SIZE - pMpTcb->PacketLength;
-
- pMpTcb->WrIndex = etdev->TxRing.txDmaReadyToSend;
-
- memcpy(etdev->TxRing.pTxDescRingVa +
- etdev->TxRing.txDmaReadyToSend.bits.serv_req,
- &CurDesc, sizeof(TX_DESC_ENTRY_t));
-
- CurDescPostCopy =
- etdev->TxRing.pTxDescRingVa +
- etdev->TxRing.txDmaReadyToSend.bits.serv_req;
-
- DBG_TX(et131x_dbginfo,
- "CURRENT DESCRIPTOR\n"
- "\tAddress : 0x%p\n"
- "\tDataBufferPtrHigh : 0x%08x\n"
- "\tDataBufferPtrLow : 0x%08x\n"
- "\tword2 : 0x%08x\n"
- "\tword3 : 0x%08x\n",
- CurDescPostCopy,
- CurDescPostCopy->DataBufferPtrHigh,
- CurDescPostCopy->DataBufferPtrLow,
- CurDescPostCopy->word2.value,
- CurDescPostCopy->word3.value);
-
- if (++etdev->TxRing.txDmaReadyToSend.bits.serv_req >=
- NUM_DESC_PER_RING_TX) {
- if (etdev->TxRing.txDmaReadyToSend.bits.
- serv_req_wrap) {
- etdev->TxRing.txDmaReadyToSend.value = 0;
- } else {
- etdev->TxRing.txDmaReadyToSend.value = 0x400;
- }
- }
-
- DBG_TX(et131x_dbginfo, "Padding descriptor %d by %d bytes\n",
- /* etdev->TxRing.txDmaReadyToSend.value, */
- etdev->TxRing.txDmaReadyToSend.bits.serv_req,
- NIC_MIN_PACKET_SIZE - pMpTcb->PacketLength);
- }
-
- spin_lock(&etdev->TCBSendQLock);
-
- if (etdev->TxRing.CurrSendTail)
- etdev->TxRing.CurrSendTail->Next = pMpTcb;
- else
- etdev->TxRing.CurrSendHead = pMpTcb;
-
- etdev->TxRing.CurrSendTail = pMpTcb;
-
- DBG_ASSERT(pMpTcb->Next == NULL);
-
- etdev->TxRing.nBusySend++;
-
- spin_unlock(&etdev->TCBSendQLock);
-
- /* Write the new write pointer back to the device. */
- writel(etdev->TxRing.txDmaReadyToSend.value,
- &etdev->regs->txdma.service_request.value);
-
-#ifdef CONFIG_ET131X_DEBUG
- DumpDeviceBlock(DBG_TX_ON, etdev, 1);
-#endif
-
- /* For Gig only, we use Tx Interrupt coalescing. Enable the software
- * timer to wake us up if this packet isn't followed by N more.
- */
- if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS) {
- writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO,
- &etdev->regs->global.watchdog_timer);
- }
-
- spin_unlock_irqrestore(&etdev->SendHWLock, flags);
-
- DBG_TX_LEAVE(et131x_dbginfo);
- return 0;
-}
-
-#endif
/**
* et131x_free_send_packet - Recycle a MP_TCB, complete the packet if necessary
@@ -1246,37 +726,11 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
* corresponding to this packet and umap the fragments
* they point to
*/
- DBG_TX(et131x_dbginfo,
- "Unmap descriptors Here\n"
- "TCB : 0x%p\n"
- "TCB Next : 0x%p\n"
- "TCB PacketLength : %d\n"
- "TCB WrIndexS.value : 0x%08x\n"
- "TCB WrIndex.value : 0x%08x\n",
- pMpTcb,
- pMpTcb->Next,
- pMpTcb->PacketLength,
- pMpTcb->WrIndexStart,
- pMpTcb->WrIndex);
-
do {
desc =
(TX_DESC_ENTRY_t *) (etdev->TxRing.pTxDescRingVa +
INDEX10(pMpTcb->WrIndexStart));
- DBG_TX(et131x_dbginfo,
- "CURRENT DESCRIPTOR\n"
- "\tAddress : 0x%p\n"
- "\tDataBufferPtrHigh : 0x%08x\n"
- "\tDataBufferPtrLow : 0x%08x\n"
- "\tword2 : 0x%08x\n"
- "\tword3 : 0x%08x\n",
- desc,
- desc->DataBufferPtrHigh,
- desc->DataBufferPtrLow,
- desc->word2.value,
- desc->word3.value);
-
pci_unmap_single(etdev->pdev,
desc->DataBufferPtrLow,
desc->word2.value, PCI_DMA_TODEVICE);
@@ -1290,9 +744,6 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
} while (desc != (etdev->TxRing.pTxDescRingVa +
INDEX10(pMpTcb->WrIndex)));
- DBG_TX(et131x_dbginfo,
- "Free Packet (SKB) : 0x%p\n", pMpTcb->Packet);
-
dev_kfree_skb_any(pMpTcb->Packet);
}
@@ -1313,8 +764,7 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
etdev->TxRing.TCBReadyQueueTail = pMpTcb;
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
-
- DBG_ASSERT(etdev->TxRing.nBusySend >= 0);
+ WARN_ON(etdev->TxRing.nBusySend < 0);
}
/**
@@ -1330,8 +780,6 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
unsigned long flags;
uint32_t FreeCounter = 0;
- DBG_ENTER(et131x_dbginfo);
-
while (!list_empty(&etdev->TxRing.SendWaitQueue)) {
spin_lock_irqsave(&etdev->SendWaitLock, flags);
@@ -1360,8 +808,6 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
- DBG_VERBOSE(et131x_dbginfo, "pMpTcb = 0x%p\n", pMpTcb);
-
FreeCounter++;
et131x_free_send_packet(etdev, pMpTcb);
@@ -1370,17 +816,11 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
pMpTcb = etdev->TxRing.CurrSendHead;
}
- if (FreeCounter == NUM_TCB) {
- DBG_ERROR(et131x_dbginfo,
- "MpFreeBusySendPackets exited loop for a bad reason\n");
- BUG();
- }
+ WARN_ON(FreeCounter == NUM_TCB);
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
etdev->TxRing.nBusySend = 0;
-
- DBG_LEAVE(et131x_dbginfo);
}
/**
@@ -1394,8 +834,6 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
*/
void et131x_handle_send_interrupt(struct et131x_adapter *etdev)
{
- DBG_TX_ENTER(et131x_dbginfo);
-
/* Mark as completed any packets which have been sent by the device. */
et131x_update_tcb_list(etdev);
@@ -1403,8 +841,6 @@ void et131x_handle_send_interrupt(struct et131x_adapter *etdev)
* dequeue and send those packets now, as long as we have free TCBs.
*/
et131x_check_send_wait_list(etdev);
-
- DBG_TX_LEAVE(et131x_dbginfo);
}
/**
@@ -1487,15 +923,9 @@ static void et131x_check_send_wait_list(struct et131x_adapter *etdev)
MP_TCB_RESOURCES_AVAILABLE(etdev)) {
struct list_head *entry;
- DBG_VERBOSE(et131x_dbginfo, "Tx packets on the wait queue\n");
-
entry = etdev->TxRing.SendWaitQueue.next;
etdev->TxRing.nWaitSend--;
-
- DBG_WARNING(et131x_dbginfo,
- "MpHandleSendInterrupt - sent a queued pkt. Waiting %d\n",
- etdev->TxRing.nWaitSend);
}
spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
index 4e795f0..1dfe06f 100644
--- a/drivers/staging/et131x/et131x_adapter.h
+++ b/drivers/staging/et131x/et131x_adapter.h
@@ -176,13 +176,6 @@ typedef struct _ce_stats_t {
u32 code_violations;
u32 other_errors;
-#ifdef CONFIG_ET131X_DEBUG
- u32 UnhandledInterruptsPerSec;
- u32 RxDmaInterruptsPerSec;
- u32 TxDmaInterruptsPerSec;
- u32 WatchDogInterruptsPerSec;
-#endif /* CONFIG_ET131X_DEBUG */
-
u32 SynchrounousIterations;
u32 InterruptStatus;
} CE_STATS_t, *PCE_STATS_t;
diff --git a/drivers/staging/et131x/et131x_debug.c b/drivers/staging/et131x/et131x_debug.c
deleted file mode 100644
index 945b4b5..0000000
--- a/drivers/staging/et131x/et131x_debug.c
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Agere Systems Inc.
- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs
- *
- * Copyright