Skip to contentSkip to conversation

cs89x0 : packet reception not working

PATCH Superseded Jaccon Bastiaansen 2 participants 2 messages Aug 26, 2012

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cs89x0 : packet reception not working

The RxCFG register of the CS89x0 could be configured incorrectly (because of misplaced parentheses), resulting in the disabling of packet reception.

---
 drivers/net/ethernet/cirrus/cs89x0.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/cirrus/cs89x0.c +4 -4
index 845b202..ea521fa 100644
@@ -1261,10 +1261,10 @@ static void set_multicast_list(struct net_device *dev)
 	 * so we have to enable interrupts on them also
 	 */
 	writereg(dev, PP_RxCFG,
-		 (lp->curr_rx_cfg |
-		  (lp->rx_mode == RX_ALL_ACCEPT)
-		  ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL)
-		  : 0));
+		 lp->curr_rx_cfg |
+		 (lp->rx_mode == RX_ALL_ACCEPT
+		 ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL)
+		 : 0));
 	spin_unlock_irqrestore(&lp->lock, flags);
 }
 
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · Jaccon Bastiaansen

The RxCFG register of the CS89x0 could be configured incorrectly (because of misplaced parentheses), resulting in the disabling of packet reception.

Thanks.

drivers/net/ethernet/cirrus/cs89x0.c

Quoted 1 line
drivers/net/ethernet/cirrus/cs89x0.c +0 -0

[]

Quoted 4 lines
drivers/net/ethernet/cirrus/cs89x0.c +0 -0
@@ -1261,10 +1261,10 @@ static void set_multicast_list(struct net_device *dev)
 	 * so we have to enable interrupts on them also
 	 */
 	writereg(dev, PP_RxCFG,

drivers/net/ethernet/cirrus/cs89x0.c static void set_multicast_list(struct net_device *dev) · line 1269

Quoted 10 lines
drivers/net/ethernet/cirrus/cs89x0.c +4 -4
-		 (lp->curr_rx_cfg |
-		  (lp->rx_mode == RX_ALL_ACCEPT)
-		  ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL)
-		  : 0));
+		 lp->curr_rx_cfg |
+		 (lp->rx_mode == RX_ALL_ACCEPT
+		 ? (RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL)
+		 : 0));
 	spin_unlock_irqrestore(&lp->lock, flags);
 }

Perhaps it would be better to use something like:

	int cfg = lp->curr_rx_cfg;

	if (lp->rx_mode == RX_ALL_ACCEPT)
		cfg |= RX_CRC_ERROR_ENBL | RX_RUNT_ENBL | RX_EXTRA_DATA_ENBL;

	writereg(dev, PP_RxCFG, cfg);