# Problems with Dlink DGE-528T, seems to have new(?) pci-id

## siaco

Hi all!

I have just bought a D-LINK DGE-528T card which I cant get to work under Linux. I'm using the newest Gentoo, kernel 2.6.24-gentoo-r3 #26.

I compiled in the r8169 in kernel, as I googled and saw many places that D-LINK DGE-528T should work with that driver, but with no luck.

At these pages which stated that the r8169 would be my friend, I also noticed that lspci -n returned 1186:4300 for these users. (here and here, and on other pages too. Searched this forum and found 2 posts saying the same thing.)

My lspci is returning:

```
lspci -nn

00:0d.0 Ethernet controller [0200]: D-Link System Inc Unknown device [1186:0300] (rev 10)

lspci -vvv

00:0d.0 Ethernet controller: D-Link System Inc Unknown device 0300 (rev 10)

        Subsystem: D-Link System Inc Unknown device 0300

        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-

        Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR+ INTx-

        Latency: 32 (8000ns min), Cache Line Size: 32 bytes

        Interrupt: pin A routed to IRQ 10

        Region 0: I/O ports at 1000 [size=256]

        Region 1: Memory at 30050000 (32-bit, non-prefetchable) [size=256]

        [virtual] Expansion ROM at 30000000 [disabled] [size=128K]

        Capabilities: [dc] Power Management version 2

                Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot-,D3cold+)

                Status: D0 PME-Enable- DSel=0 DScale=0 PME-
```

So it seems I have a different pci-id on my card and as this pages shows, this have happened before too. Before 2.6.10, the r8169.c didn't include the 1186:4300 in it's PCI table, only :8169. Therefor, I tried to edit my drivers/net/r8169.c so that the PCI table looked like this:

```
static struct pci_device_id rtl8169_pci_tbl[] = {

        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8129), 0, 0, RTL_CFG_0 },

        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8136), 0, 0, RTL_CFG_2 },

        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8167), 0, 0, RTL_CFG_0 },

        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8168), 0, 0, RTL_CFG_1 },

        { PCI_DEVICE(PCI_VENDOR_ID_REALTEK,     0x8169), 0, 0, RTL_CFG_0 },

        { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x4300), 0, 0, RTL_CFG_0 },

        { PCI_DEVICE(PCI_VENDOR_ID_DLINK,       0x0300), 0, 0, RTL_CFG_0 }, // <------ INSERTED BY ME

        { PCI_DEVICE(PCI_VENDOR_ID_AT,          0xc107), 0, 0, RTL_CFG_0 },

        { PCI_DEVICE(0x16ec,                    0x0116), 0, 0, RTL_CFG_0 },

        { PCI_VENDOR_ID_LINKSYS,                0x1032,

                PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 },

        { 0x0001,                               0x8168,

                PCI_ANY_ID, 0x2410, 0, 0, RTL_CFG_2 },

        {0,},

};
```

I recompiled and got myself a kernel panic.

So, I removed that line again, tried to make this driver as a module and modprobe it, without any luck. I'm kinda out of ideas here, as I am no Linux guru. 

Can anyone please help me on what to try next? Thank you! :-)

----------

## anti-s

Have you tried the official drivers ?

http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=4&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true

----------

## anti-s

And maybe this will help : 

http://www.linuxquestions.org/questions/linux-hardware-18/ethernet-card-dge-528t-and-kernel-2.6-350564/

----------

## siaco

 *anti-s wrote:*   

> Have you tried the official drivers ?
> 
> http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PNid=13&PFid=4&Level=5&Conn=4&DownTypeID=3&GetDown=false&Downloads=true

 

Hi, and thank you for answering!

I did try this now, follow the install instructions in readme file, and I got this:

```
siaco r8169-6.004.00 # make clean modules

make -C src/ clean

make[1]: Entering directory `/root/r8169-6.004.00/src'

rm -rf *.o *.ko *~ core* .dep* .*.d .*.cmd *.mod.c *.a *.s .*.flags .tmp_versions Module.symvers Modules.symvers rset

make[1]: Leaving directory `/root/r8169-6.004.00/src'

make -C src/ modules

make[1]: Entering directory `/root/r8169-6.004.00/src'

make -C /lib/modules/2.6.24-gentoo-r3/build SUBDIRS=/root/r8169-6.004.00/src modules

make[2]: Entering directory `/usr/src/linux-2.6.24-gentoo-r3'

  CC [M]  /root/r8169-6.004.00/src/r8169_n.o

/root/r8169-6.004.00/src/r8169_n.c:1109: error: unknown field 'get_perm_addr' specified in initializer

/root/r8169-6.004.00/src/r8169_n.c:1109: error: 'ethtool_op_get_perm_addr' undeclared here (not in a function)

/root/r8169-6.004.00/src/r8169_n.c: In function 'rtl8169_init_one':

/root/r8169-6.004.00/src/r8169_n.c:2219: error: implicit declaration of function 'SET_MODULE_OWNER'

/root/r8169-6.004.00/src/r8169_n.c: In function 'rtl8169_try_rx_copy':

/root/r8169-6.004.00/src/r8169_n.c:3270: error: implicit declaration of function 'eth_copy_and_sum'

make[3]: *** [/root/r8169-6.004.00/src/r8169_n.o] Error 1

make[2]: *** [_module_/root/r8169-6.004.00/src] Error 2

make[2]: Leaving directory `/usr/src/linux-2.6.24-gentoo-r3'

make[1]: *** [modules] Error 2

make[1]: Leaving directory `/root/r8169-6.004.00/src'

make: *** [modules] Error 2
```

In the changelog to 2.6.23 kernel, it says:

 *Quote:*   

> commit 7c5b016246a889ec4b5dc8d40cab525e888a649e
> 
> Author: Jan Altenberg <jan.altenberg@linutronix.de>
> 
> Date:   Fri Aug 3 16:08:15 2007 +0800
> ...

 

I really don't know if there is a link there, guess I'm in for some more google-time. If anyone knows what to do next, please share :-)

(Btw, I have looked at the linuxquestions.org-link before, without no help.)

----------

## siaco

So, the strangest thing happened!

This is what I have done since last post: 

Since I couldn't compile the Realtek driver under 2.6.24, I switched to and booted up my old kernel, version 2.6.17. Under this one, I compiled  and installed the module. Just out of curiosity, I did lspci again, and to my surprise, I noticed that it now printed out: 

```
00:0d.0 Ethernet controller: D-Link System Inc DGE-528T Gigabit Ethernet Adapter (rev 10)
```

 and not 

```
00:0d.0 Ethernet controller [0200]: D-Link System Inc Unknown device [1186:0300] (rev 10)
```

 as it did the first time.. I then tried to lookup the PCI id again, and I got: 

```
00:0d.0 Ethernet controller [0200]: D-Link System Inc DGE-528T Gigabit Ethernet Adapter [1186:4300] (rev 10)
```

.

How is this possible? It has changed from 1186:0300 to 1186:4300! I then switched to kernel 2.6.24 again, compiled in the r8169 driver into the kernel and now suddenly everything works fine.

----------

## anti-s

Thats werid. May be changes in the /usr/src/linux/include/linux/pci_ids.h file. There is clearly somthing wrong, because it says "Unknown Device" on the newest kernel and not "Gigabit Ethernet Adapter"

----------

