--- zzzz-none-000/linux-2.4.17/drivers/net/8139too.c 2001-12-21 17:41:54.000000000 +0000 +++ sangam-fb-322/linux-2.4.17/drivers/net/8139too.c 2004-11-24 13:23:31.000000000 +0000 @@ -73,7 +73,7 @@ Jean-Jacques Michel - bug fix - Tobias Ringström - Rx interrupt status checking suggestion + Tobias Ringstr÷m - Rx interrupt status checking suggestion Andrew Morton - Clear blocked signals, avoid buffer overrun setting current->comm. @@ -112,6 +112,13 @@ #include #include +#ifdef CONFIG_8139TOO_DREAMCAST +#define CONFIG_8139TOO_BUF16K 1 +#define USE_NO_DMAMAP 1 +#else +#define USE_NO_DMAMAP 0 +#endif + #define RTL8139_DRIVER_NAME DRV_NAME " Fast Ethernet driver " DRV_VERSION #define PFX DRV_NAME ": " @@ -153,14 +160,19 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1}; /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ -static int max_interrupt_work = 20; +//static int max_interrupt_work = 20; +static int max_interrupt_work = 10; /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). The RTL chips use a 64 element hash table based on the Ethernet CRC. */ static int multicast_filter_limit = 32; /* Size of the in-memory receive ring. */ +#ifdef CONFIG_8139TOO_BUF16K +#define RX_BUF_LEN_IDX 1 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#else #define RX_BUF_LEN_IDX 2 /* 0==8K, 1==16K, 2==32K, 3==64K */ +#endif #define RX_BUF_LEN (8192 << RX_BUF_LEN_IDX) #define RX_BUF_PAD 16 #define RX_BUF_WRAP_PAD 2048 /* spare padding to handle lack of packet wrap */ @@ -212,6 +224,7 @@ ADDTRON8139, DFE538TX, DFE690TXD, + SEGABBA, RTL8129, } board_t; @@ -229,6 +242,7 @@ { "Addtron Technolgy 8139 10/100BaseTX", RTL8139_CAPS }, { "D-Link DFE-538TX (RealTek RTL8139)", RTL8139_CAPS }, { "D-Link DFE-690TXD (RealTek RTL8139)", RTL8139_CAPS }, + { "SEGA Broadband Adapter", RTL8139_CAPS }, { "RealTek RTL8129", RTL8129_CAPS }, }; @@ -242,6 +256,7 @@ {0x4033, 0x1360, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ADDTRON8139 }, {0x1186, 0x1300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE538TX }, {0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE690TXD }, + {0x11db, 0x1234, PCI_ANY_ID, PCI_ANY_ID, 0, 0, SEGABBA }, #ifdef CONFIG_8139TOO_8129 {0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8129 }, @@ -654,10 +669,17 @@ PCIErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK | RxErr | RxOK; +#ifdef CONFIG_8139TOO_BUF16K +static const unsigned int rtl8139_rx_config = + RxCfgRcv16K | RxNoWrap | + (RX_FIFO_THRESH << RxCfgFIFOShift) | + (RX_DMA_BURST << RxCfgDMAShift); +#else static const unsigned int rtl8139_rx_config = RxCfgRcv32K | RxNoWrap | (RX_FIFO_THRESH << RxCfgFIFOShift) | (RX_DMA_BURST << RxCfgDMAShift); +#endif static const unsigned int rtl8139_tx_config = (TX_DMA_BURST << TxDMAShift) | (TX_RETRY << TxRetryShift); @@ -794,6 +816,9 @@ pci_set_master (pdev); #ifdef USE_IO_OPS +#ifdef CONFIG_MIPS_AVALANCHE /* Maybe there is a better way of doing this */ + pio_start |= 0xf0000000; +#endif ioaddr = (void *) pio_start; dev->base_addr = pio_start; tp->mmio_addr = ioaddr; @@ -1335,8 +1360,9 @@ tp->rx_config = rtl8139_rx_config | AcceptBroadcast | AcceptMyPhys; RTL_W32 (RxConfig, tp->rx_config); + tp->rx_config = 0; - /* Check this value: the documentation for IFG contradicts ifself. */ + /* Check this value: the documentation for IFG contradicts itself. */ RTL_W32 (TxConfig, rtl8139_tx_config); tp->cur_rx = 0;