Procházet zdrojové kódy

Quick and very dirty hack to get r8169 driver working again, prior to

any rewrite.
tags/v0.9.3
Michael Brown před 17 roky
rodič
revize
14fb6ba189
1 změnil soubory, kde provedl 15 přidání a 5 odebrání
  1. 15
    5
      src/drivers/net/r8169.c

+ 15
- 5
src/drivers/net/r8169.c Zobrazit soubor

@@ -48,6 +48,7 @@
48 48
 #include "nic.h"
49 49
 #include <gpxe/pci.h>
50 50
 #include <gpxe/ethernet.h>
51
+#include <gpxe/malloc.h>
51 52
 #include "timer.h"
52 53
 
53 54
 #define drv_version "v1.6"
@@ -335,11 +336,11 @@ struct {
335 336
 	unsigned char txb[NUM_TX_DESC * RX_BUF_SIZE];
336 337
 	struct RxDesc rx_ring[NUM_RX_DESC] __align_256;
337 338
 	unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE];
338
-} r8169_bufs __shared;
339
-#define tx_ring r8169_bufs.tx_ring
340
-#define rx_ring r8169_bufs.rx_ring
341
-#define txb r8169_bufs.txb
342
-#define rxb r8169_bufs.rxb
339
+} *r8169_bufs;
340
+#define tx_ring r8169_bufs->tx_ring
341
+#define rx_ring r8169_bufs->rx_ring
342
+#define txb r8169_bufs->txb
343
+#define rxb r8169_bufs->rxb
343 344
 
344 345
 static struct rtl8169_private {
345 346
 	void *mmio_addr;	/* memory map physical address */
@@ -881,6 +882,15 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {
881 882
 
882 883
 	printed_version = 1;
883 884
 
885
+	/* Quick and very dirty hack to get r8169 driver working
886
+	 * again, pre-rewrite
887
+	 */
888
+	if ( ! r8169_bufs )
889
+		r8169_bufs = malloc_dma ( sizeof ( *r8169_bufs ), 256 );
890
+	if ( ! r8169_bufs )
891
+		return 0;
892
+	memset ( r8169_bufs, 0, sizeof ( *r8169_bufs ) );
893
+
884 894
 	/* point to private storage */
885 895
 	tpc = &tpx;
886 896
 

Načítá se…
Zrušit
Uložit