Re: ethernet / module

Top Page

Reply to this message
Author: guilde.nt
Date:  
To: guilde
CC: liste Guilde
Subject: Re: ethernet / module
>Mais la question demeure ... SI je vous dis "Telle carte réseau !" , comment
>(où ?) allez-vous me dire "Tel module ! " ? Où trouver cette information ?


Il faut trouver le vendorID et deviceID ; il y a une base de données avec
ces informations pour le bus PCI et USB dans TLDP (the linux documentation
project). Les noms symboliques sont dans include/linux/pci_ids.h. Dans
drivers/net, un fichier .c doit contenir une 'struct pci_device_id' avec
ces informations. Finalement, un fichier Makefile toujours dans drivers/net
doit utiliser l'objet. Exemple :

$ /sbin/lspci
02:0b.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 6c)

$ cat /sys/bus/pci/devices/*02:0b.0/{vendor,device}
0x10b7
0x9200

$ egrep 'PCI_VENDOR_ID.*0x10b7|PCI_DEVICE_ID.*0x9200' include/linux/pci_ids.h
#define PCI_VENDOR_ID_3COM              0x10b7


$ find drivers/net -name '*.c' -exec egrep -i '(PCI_VENDOR_ID_3COM|0x10b7).*0x9200' {} +
drivers/net/3c59x.c:    { 0x10B7, 0x9200, PCI_ANY_ID, PCI_ANY_ID, 0,


$ find drivers/net -name Makefile -exec egrep 3c59x.o {} +
drivers/net/Makefile:obj-$(CONFIG_VORTEX) += 3c59x.o

-Nicolas