Changeset c94c251 in rtems
- Timestamp:
- 05/25/00 13:42:00 (23 years ago)
- Children:
- f3b1664f
- Parents:
- 64bddf48
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/libchip/network/dec21140.c
r64bddf48 rc94c251 13 13 * [22.05.2000,StWi/CWA] added support for the DEC/Intel 21143 chip 14 14 * 15 * This support is (for now) only available for the __i386 target, because 16 * that's the only testing platform I have. It should to my best knowledge 17 * work in the same way for the "__PPC" target, but someone should test 18 * this first before it's put into the code. Thanks go to Andrew Klossner 19 * who provided the vital information about the Intel 21143 chip. 15 * The 21143 support is (for now) only available for the __i386 target, 16 * because that's the only testing platform I have. It should (to my best 17 * knowledge) work in the same way for the "__PPC" target, but someone 18 * should test this first before it's put into the code. Thanks go to 19 * Andrew Klossner who provided the vital information about the 20 * Intel 21143 chip. 21 * (FWIW: I tested this driver using a Kingston KNE100TX with 21143PD chip) 20 22 * 21 * (FWIW: my network card is a Kingston KNE100TX with 21143PD chip) 22 * 23 * The 21143 support is enabled by defining the macro 24 * "ENABLE_21143_VARIANT" (see the "#if defined(__i386)" section right 25 * below, just add or remove comments as needed) 23 * The driver will automatically detect whether there is a 21140 or 21143 24 * network card in the system and activate support accordingly. It will 25 * look for the 21140 first. If the 21140 is not found the driver will 26 * look for the 21143. 26 27 * ------------------------------------------------------------------------ 27 28 */ … … 37 38 #if defined(__i386) 38 39 #define DEC21140_SUPPORTED 39 #define ENABLE_21143_VARIANT40 40 #endif 41 41 … … 88 88 #define DEC_DEBUG 89 89 90 /* note: the 21143 isn't really a DEC, it's an Intel chip */ 90 91 #define PCI_INVALID_VENDORDEVICEID 0xffffffff 91 92 #define PCI_VENDOR_ID_DEC 0x1011 92 #if defined(ENABLE_21143_VARIANT) 93 #define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0019 94 #else 95 #define PCI_DEVICE_ID_DEC_TULIP_FAST 0x0009 96 #endif 93 #define PCI_DEVICE_ID_DEC_21140 0x0009 94 #define PCI_DEVICE_ID_DEC_21143 0x0019 97 95 98 96 #define IO_MASK 0x3 … … 386 384 387 385 #ifdef DEC_DEBUG 388 printk("DC2114 0%x:%x:%x:%x:%x:%x IRQ %d IO %x M %x .........\n",386 printk("DC2114x %x:%x:%x:%x:%x:%x IRQ %d IO %x M %x .........\n", 389 387 sc->arpcom.ac_enaddr[0], sc->arpcom.ac_enaddr[1], 390 388 sc->arpcom.ac_enaddr[2], sc->arpcom.ac_enaddr[3], … … 779 777 int mtu; 780 778 int i; 779 int deviceId = PCI_DEVICE_ID_DEC_21140; /* network card device ID */ 781 780 782 781 /* … … 793 792 794 793 /* 795 * First, find a DEC board 794 * Try to find the network card on the PCI bus. Probe for a DEC 21140 795 * card first. If not found probe the bus for a DEC/Intel 21143 card. 796 796 */ 797 if ((diag = pcib_find_by_devid(PCI_VENDOR_ID_DEC, 798 PCI_DEVICE_ID_DEC_TULIP_FAST, 799 0, 800 &signature)) != PCIB_ERR_SUCCESS) 801 rtems_panic("DEC PCI board not found !! (%d)\n", diag); 802 else { 803 printk("DEC PCI Device found\n"); 804 } 797 deviceId = PCI_DEVICE_ID_DEC_21140; 798 diag = pcib_find_by_devid( PCI_VENDOR_ID_DEC, deviceId, 799 0, &signature); 800 if ( diag == PCIB_ERR_SUCCESS) 801 printk( "DEC 21140 PCI network card found\n" ); 802 else 803 { 804 deviceId = PCI_DEVICE_ID_DEC_21143; 805 diag = pcib_find_by_devid( PCI_VENDOR_ID_DEC, deviceId, 806 0, &signature); 807 if ( diag == PCIB_ERR_SUCCESS) 808 printk( "DEC/Intel 21143 PCI network card found\n" ); 809 else 810 rtems_panic("DEC PCI network card not found !!\n"); 811 } 805 812 #endif 806 813 #if defined(__PPC) … … 822 829 continue; 823 830 } 824 if (ulDeviceID == ((PCI_DEVICE_ID_DEC_ TULIP_FAST<<16) + PCI_VENDOR_ID_DEC))831 if (ulDeviceID == ((PCI_DEVICE_ID_DEC_21140<<16) + PCI_VENDOR_ID_DEC)) 825 832 break; 826 833 } 827 if (ulDeviceID == ((PCI_DEVICE_ID_DEC_ TULIP_FAST<<16) + PCI_VENDOR_ID_DEC)){834 if (ulDeviceID == ((PCI_DEVICE_ID_DEC_21140<<16) + PCI_VENDOR_ID_DEC)){ 828 835 printk("DEC Adapter found !!\n"); 829 836 break; … … 853 860 #if defined(__i386) 854 861 855 #if defined(ENABLE_21143_VARIANT) 856 /* the 21143 chip must be enabled before it can be accessed */ 857 pcib_conf_write32( signature, 0x40, 0 ); 858 #endif 862 /* the 21143 chip must be enabled before it can be accessed */ 863 if ( deviceId == PCI_DEVICE_ID_DEC_21143 ) 864 pcib_conf_write32( signature, 0x40, 0 ); 859 865 860 866 pcib_conf_read32(signature, 16, &value); … … 950 956 ether_ifattach (ifp); 951 957 952 printk( "D EC21140: driver has been attached\n" );958 printk( "DC2114x : driver has been attached\n" ); 953 959 return 1; 954 960 };
Note: See TracChangeset
for help on using the changeset viewer.