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

[cdi-devel] [PATCH] e1000: Fix receive buffer size



We use receive buffers of 1536 bytes, but tell the NIC that the buffer
size is 2048. Probably not a good idea.

While at it, make the buffer size setting in RCTL explicit, even though
it's just a zero.

Signed-off-by: Kevin Wolf <kevin@xxxxxxxxxx>
---
 e1000/device.c |    3 ++-
 e1000/device.h |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/e1000/device.c b/e1000/device.c
index 6ce814c..c817cc2 100644
--- a/e1000/device.c
+++ b/e1000/device.c
@@ -323,7 +323,8 @@ static void reset_nic(struct e1000_device* netcard)
     netcard->rx_cur_buffer = 0;
 
     // Rx/Tx aktivieren
-    reg_outl(netcard, REG_RX_CTL, RCTL_ENABLE | RCTL_BROADCAST);
+    reg_outl(netcard, REG_RX_CTL, RCTL_ENABLE | RCTL_BROADCAST
+        | RCTL_2K_BUFSIZE);
     reg_outl(netcard, REG_TX_CTL, TCTL_ENABLE | TCTL_PADDING
         | TCTL_COLL_TSH | TCTL_COLL_DIST);
 }
diff --git a/e1000/device.h b/e1000/device.h
index af614c2..1fd1750 100644
--- a/e1000/device.h
+++ b/e1000/device.h
@@ -83,6 +83,7 @@ enum {
 enum {
     RCTL_ENABLE     = (1 <<  1),
     RCTL_BROADCAST  = (1 << 15), /* BAM */
+    RCTL_2K_BUFSIZE = (0 << 16), /* BSIZE */
 };
 
 enum {
@@ -127,7 +128,7 @@ enum {
 #define TX_BUFFER_SIZE  2048
 //#define TX_BUFFER_NUM   64
 
-#define RX_BUFFER_SIZE  1536
+#define RX_BUFFER_SIZE  2048
 //#define RX_BUFFER_NUM   64
 
 // Die Anzahl von Deskriptoren muss jeweils ein vielfaches von 8 sein
-- 
1.6.0.2