Skip to contentSkip to conversation

net: rtl8169: Add processing when OWNbit did't enable in rtl_recv()

PATCH New Nobuhiro Iwamatsu 2 participants 2 messages Mar 8, 2008 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: rtl8169: Add processing when OWNbit did't enable in rtl_recv()

When rtl_recv() of rtl8169 is called, OWNbit of status register is not enable occasionally.
rtl_recv() doesn't work normally when the driver doesn't do appropriate processing.
This patch fix this problem.

---
 drivers/net/rtl8169.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
drivers/net/rtl8169.c +16 -2
index d71323f..b142ccc 100644
@@ -245,8 +245,17 @@ static struct {
 	u8 version;		/* depend on RTL8169 docs */
 	u32 RxConfigMask;	/* should clear the bits supported by this chip */
 } rtl_chip_info[] = {
-	{"RTL-8169", 0x00, 0xff7e1880,},
-	{"RTL-8169", 0x04, 0xff7e1880,},
+	{"RTL-8169", 0x00, 0xff7e1880,},
+	{"RTL-8169", 0x04, 0xff7e1880,},
+	{"RTL-8169", 0x00, 0xff7e1880,},
+	{"RTL-8169s/8110s",	0x02, 0xff7e1880,},
+	{"RTL-8169s/8110s",	0x04, 0xff7e1880,},
+	{"RTL-8169sb/8110sb",	0x10, 0xff7e1880,},
+	{"RTL-8169sc/8110sc",	0x18, 0xff7e1880,},
+	{"RTL-8168b/8111sb",	0x30, 0xff7e1880,},
+	{"RTL-8168b/8111sb",	0x38, 0xff7e1880,},
+	{"RTL-8101e",		0x34, 0xff7e1880,},
+	{"RTL-8100e",		0x32, 0xff7e1880,},
 };
 
 enum _DescStatusBit {
@@ -312,6 +321,7 @@ static const unsigned int rtl8169_rx_config =
     (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift);
 
 static struct pci_device_id supported[] = {
+	{PCI_VENDOR_ID_REALTEK, 0x8167},
 	{PCI_VENDOR_ID_REALTEK, 0x8169},
 	{}
 };
@@ -433,6 +443,10 @@ static int rtl_recv(struct eth_device *dev)
 		tpc->cur_rx = cur_rx;
 		return 1;
 
+	} else {
+		ushort sts = RTL_R8(IntrStatus);
+		RTL_W8(IntrStatus, sts & ~(TxErr | RxErr | SYSErr));
+		udelay(100);	/* wait */
 	}
 	tpc->cur_rx = cur_rx;
 	return (0);		/* initially as this is called to flush the input */
Signature · 1 line
1.5.3.8
#1 lore raw

PATCH 1/1 net: rtl8169: Add processing when OWNbit did't enable in rtl_recv()

drivers/net/rtl8169.c

Quoted 12 lines · In message <[email protected]> you wrote:

When rtl_recv() of rtl8169 is called, OWNbit of status register is not enable occasionally.
rtl_recv() doesn't work normally when the driver doesn't do appropriate processing.
This patch fix this problem.

---
 drivers/net/rtl8169.c |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
drivers/net/rtl8169.c +0 -0

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
God runs electromagnetics by wave theory on  Monday,  Wednesday,  and
Friday,  and the Devil runs them by quantum theory on Tuesday, Thurs-
day, and Saturday.                                   -- William Bragg