Skip to contentSkip to conversation

r8169.c: Force transmission when nic refuse to start.

PATCH In review Corcodel Marian 2 participants 2 messages Aug 14, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 r8169.c: Force transmission when nic refuse to start.

Brute force transmission when Rx interrupt exist on
interface is up. Guaranteed to start on full duplex and not maximum speed.When set half duplex working same without this patch.
For apply this patch set --whitespace=warn

drivers/net/ethernet/realtek/r8169.c +8 -1
index eb2d2a4..6882eab 100644
@@ -7470,15 +7470,22 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
 	u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow;
 	int work_done= 0;
 	u16 status;
+        int tx_force = 1;
 
 	status = rtl_get_events(tp);
 	rtl_ack_events(tp, status & ~tp->event_slow);
-
+       if (netif_running(dev)) {
 	if (status & RTL_EVENT_NAPI_RX)
 		work_done = rtl_rx(dev, tp, (u32) budget);
+                
 
 	if (status & RTL_EVENT_NAPI_TX)
 		rtl_tx(dev, tp);
+         else if (tx_force == 1) {
+                mdelay(10);
+                rtl_tx(dev, tp);
+         }
+        }
 
 	if (status & tp->event_slow) {
 		enable_mask &= ~tp->event_slow;
Signature · 1 line
2.1.4
#1 lore raw

Corcodel Marian <[email protected]> :
[...]

Quoted 15 lines
drivers/net/ethernet/realtek/r8169.c +2 -1
index eb2d2a4..6882eab 100644
@@ -7470,15 +7470,22 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
 	u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow;
 	int work_done= 0;
 	u16 status;
+        int tx_force = 1;
 
 	status = rtl_get_events(tp);
 	rtl_ack_events(tp, status & ~tp->event_slow);
-
+       if (netif_running(dev)) {
 	if (status & RTL_EVENT_NAPI_RX)

drivers/net/ethernet/realtek/r8169.c static int rtl8169_poll(struct napi_struct *napi, int budget) · line 7488

Quoted 10 lines
drivers/net/ethernet/realtek/r8169.c +6 -0
 		work_done = rtl_rx(dev, tp, (u32) budget);
+                
 
 	if (status & RTL_EVENT_NAPI_TX)
 		rtl_tx(dev, tp);
+         else if (tx_force == 1) {
+                mdelay(10);
+                rtl_tx(dev, tp);
+         }
+        }

Please try to use TimerInt instead of this ugly hack.

Signature · 1 line
Ueimor