Skip to content

Commit

Permalink
Quick and very dirty hack to get r8169 driver working again, prior to
Browse files Browse the repository at this point in the history
any rewrite.
  • Loading branch information
Michael Brown committed Sep 26, 2007
1 parent ed5ff61 commit 14fb6ba
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions src/drivers/net/r8169.c
Expand Up @@ -48,6 +48,7 @@
#include "nic.h"
#include <gpxe/pci.h>
#include <gpxe/ethernet.h>
#include <gpxe/malloc.h>
#include "timer.h"

#define drv_version "v1.6"
Expand Down Expand Up @@ -335,11 +336,11 @@ struct {
unsigned char txb[NUM_TX_DESC * RX_BUF_SIZE];
struct RxDesc rx_ring[NUM_RX_DESC] __align_256;
unsigned char rxb[NUM_RX_DESC * RX_BUF_SIZE];
} r8169_bufs __shared;
#define tx_ring r8169_bufs.tx_ring
#define rx_ring r8169_bufs.rx_ring
#define txb r8169_bufs.txb
#define rxb r8169_bufs.rxb
} *r8169_bufs;
#define tx_ring r8169_bufs->tx_ring
#define rx_ring r8169_bufs->rx_ring
#define txb r8169_bufs->txb
#define rxb r8169_bufs->rxb

static struct rtl8169_private {
void *mmio_addr; /* memory map physical address */
Expand Down Expand Up @@ -881,6 +882,15 @@ static int r8169_probe ( struct nic *nic, struct pci_device *pci ) {

printed_version = 1;

/* Quick and very dirty hack to get r8169 driver working
* again, pre-rewrite
*/
if ( ! r8169_bufs )
r8169_bufs = malloc_dma ( sizeof ( *r8169_bufs ), 256 );
if ( ! r8169_bufs )
return 0;
memset ( r8169_bufs, 0, sizeof ( *r8169_bufs ) );

/* point to private storage */
tpc = &tpx;

Expand Down

0 comments on commit 14fb6ba

Please sign in to comment.