[PATCH 039/510] beceem: debug message format changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Stephen Hemminger <stephen.hemminger@xxxxxxxxxx>

Add more debug messages and make them similar to other drivers

Signed-off-by: Stephen Hemminger <shemminger@xxxxxxxxxx>
---
 drivers/staging/bcm/Bcmnet.c       |   12 ++++++------
 drivers/staging/bcm/CmHost.c       |    2 +-
 drivers/staging/bcm/InterfaceIsr.c |    4 ++++
 drivers/staging/bcm/InterfaceRx.c  |    9 ++++++---
 drivers/staging/bcm/InterfaceTx.c  |    4 ++++
 drivers/staging/bcm/Misc.c         |    2 +-
 drivers/staging/bcm/Qos.c          |    7 +++++--
 7 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/bcm/Bcmnet.c b/drivers/staging/bcm/Bcmnet.c
index bf3a04d..fbaf73a 100644
--- a/drivers/staging/bcm/Bcmnet.c
+++ b/drivers/staging/bcm/Bcmnet.c
@@ -16,17 +16,17 @@ static INT bcm_open(struct net_device *dev)
 	PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(dev);
 
 	if (Adapter->fw_download_done == FALSE) {
-		pr_notice(DRV_NAME "%s: link up failed (download in progress)\n",
-			  dev->name);
+		pr_notice(PFX "%s: link up failed (download in progress)\n",
+ 			  dev->name);
 		return -EBUSY;
 	}
 
 	if (netif_msg_ifup(Adapter))
-		pr_info(DRV_NAME "%s: enabling interface\n", dev->name);
+		pr_info(PFX "%s: enabling interface\n", dev->name);
 
 	if (Adapter->LinkUpStatus) {
 		if (netif_msg_link(Adapter))
-			pr_info(DRV_NAME "%s: link up\n", dev->name);
+			pr_info(PFX "%s: link up\n", dev->name);
 
 		netif_carrier_on(Adapter->dev);
 		netif_start_queue(Adapter->dev);
@@ -40,7 +40,7 @@ static INT bcm_close(struct net_device *dev)
 	PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(dev);
 
 	if (netif_msg_ifdown(Adapter))
-		pr_info(DRV_NAME "%s: disabling interface\n", dev->name);
+		pr_info(PFX "%s: disabling interface\n", dev->name);
 
 	netif_carrier_off(dev);
 	netif_stop_queue(dev);
@@ -106,7 +106,7 @@ static netdev_tx_t bcm_transmit(struct sk_buff *skb, struct net_device *dev)
 
 	/* Now Enqueue the packet */
 	if (netif_msg_tx_queued(Adapter))
-		pr_info(DRV_NAME "%s: enqueueing packet to queue %d\n",
+		pr_info(PFX "%s: enqueueing packet to queue %d\n",
 			dev->name, qindex);
 
 	spin_lock(&Adapter->PackInfo[qindex].SFQueueLock);
diff --git a/drivers/staging/bcm/CmHost.c b/drivers/staging/bcm/CmHost.c
index 949aaa3..1aa962f 100644
--- a/drivers/staging/bcm/CmHost.c
+++ b/drivers/staging/bcm/CmHost.c
@@ -2138,7 +2138,7 @@ BOOLEAN CmControlResponseMessage(PMINI_ADAPTER Adapter,  /**<Pointer to the Adap
 								netif_start_queue(Adapter->dev);
 								Adapter->LinkUpStatus = 1;
 								if (netif_msg_link(Adapter))
-									pr_info(DRV_NAME "%s: link up\n", Adapter->dev->name);
+									pr_info(PFX "%s: link up\n", Adapter->dev->name);
 								atomic_set(&Adapter->TxPktAvail, 1);
 								wake_up(&Adapter->tx_packet_wait_queue);
 								Adapter->liTimeSinceLastNetEntry = get_seconds();
diff --git a/drivers/staging/bcm/InterfaceIsr.c b/drivers/staging/bcm/InterfaceIsr.c
index c1f8e7a..2d26e2e 100644
--- a/drivers/staging/bcm/InterfaceIsr.c
+++ b/drivers/staging/bcm/InterfaceIsr.c
@@ -7,6 +7,10 @@ static void read_int_callback(struct urb *urb/*, struct pt_regs *regs*/)
 	PS_INTERFACE_ADAPTER psIntfAdapter = (PS_INTERFACE_ADAPTER)urb->context;
 	PMINI_ADAPTER Adapter = psIntfAdapter->psAdapter ;
 
+	if (netif_msg_intr(Adapter))
+		pr_info(PFX "%s: interrupt status %d\n",
+			Adapter->dev->name, status);
+
 	if(Adapter->device_removed == TRUE)
 	{
 		BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, INTF_INIT, DBG_LVL_ALL,"Device has Got Removed.");
diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c
index 6f1ed78..07326a9 100644
--- a/drivers/staging/bcm/InterfaceRx.c
+++ b/drivers/staging/bcm/InterfaceRx.c
@@ -38,7 +38,9 @@ static void read_bulk_callback(struct urb *urb)
 	PMINI_ADAPTER Adapter = psIntfAdapter->psAdapter;
 	PLEADER pLeader = urb->transfer_buffer;
 
-
+	if (unlikely(netif_msg_rx_status(Adapter)))
+		pr_info(PFX "%s: rx urb status %d length %d\n",
+			Adapter->dev->name, urb->status, urb->actual_length);
 
 	if((Adapter->device_removed == TRUE)  ||
 		(TRUE == Adapter->bEndPointHalted) ||
@@ -83,8 +85,9 @@ static void read_bulk_callback(struct urb *urb)
 	BCM_DEBUG_PRINT(Adapter,DBG_TYPE_RX, RX_DPC, DBG_LVL_ALL, "Leader Status:0x%hX, Length:0x%hX, VCID:0x%hX", pLeader->Status,pLeader->PLength,pLeader->Vcid);
 	if(MAX_CNTL_PKT_SIZE < pLeader->PLength)
 	{
-		BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "Corrupted leader length...%d\n",
-					pLeader->PLength);
+		if (netif_msg_rx_err(Adapter))
+			pr_info(PFX "%s: corrupted leader length...%d\n",
+				Adapter->dev->name, pLeader->PLength);
 		atomic_inc(&Adapter->RxPacketDroppedCount);
 		atomic_add(pLeader->PLength, &Adapter->BadRxByteCount);
 		atomic_dec(&psIntfAdapter->uNumRcbUsed);
diff --git a/drivers/staging/bcm/InterfaceTx.c b/drivers/staging/bcm/InterfaceTx.c
index a3dadf1..f434b89 100644
--- a/drivers/staging/bcm/InterfaceTx.c
+++ b/drivers/staging/bcm/InterfaceTx.c
@@ -9,6 +9,10 @@ static void write_bulk_callback(struct urb *urb/*, struct pt_regs *regs*/)
 	PMINI_ADAPTER psAdapter = psIntfAdapter->psAdapter ;
 	BOOLEAN bpowerDownMsg = FALSE ;
     PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev);
+
+    if (unlikely(netif_msg_tx_done(Adapter)))
+	    pr_info(PFX "%s: transmit status %d\n", Adapter->dev->name, urb->status);
+
 	if(urb->status != STATUS_SUCCESS)
 	{
 		if(urb->status == -EPIPE)
diff --git a/drivers/staging/bcm/Misc.c b/drivers/staging/bcm/Misc.c
index 7f3a936..8212af3 100644
--- a/drivers/staging/bcm/Misc.c
+++ b/drivers/staging/bcm/Misc.c
@@ -1896,7 +1896,7 @@ void beceem_protocol_reset (PMINI_ADAPTER Adapter)
 	int i;
 
 	if (netif_msg_link(Adapter))
-		pr_notice(DRV_NAME "%s: protocol reset\n", Adapter->dev->name);
+		pr_notice(PFX "%s: protocol reset\n", Adapter->dev->name);
 
 	netif_carrier_off(Adapter->dev);
 	netif_stop_queue(Adapter->dev);
diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
index 7e8013c..21b611c 100644
--- a/drivers/staging/bcm/Qos.c
+++ b/drivers/staging/bcm/Qos.c
@@ -356,8 +356,11 @@ VOID PruneQueue(PMINI_ADAPTER Adapter,/**<Pointer to the driver control structur
 
 		if(PacketToDrop)
 		{
-			if(netstats)
-				netstats->tx_dropped++;
+			if (netif_msg_tx_err(Adapter))
+				pr_info(PFX "%s: tx queue %d overlimit\n", 
+					Adapter->dev->name, iIndex);
+
+			netstats->tx_dropped++;
 			atomic_inc(&Adapter->TxDroppedPacketCount);
 			DEQUEUEPACKET(Adapter->PackInfo[iIndex].FirstTxQueue,
 						Adapter->PackInfo[iIndex].LastTxQueue);
-- 
1.7.3.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux