--- nictools-pci-1.3.8.orig/Makefile +++ nictools-pci-1.3.8/Makefile @@ -0,0 +1,73 @@ +CFLAGS= -O -Wall +CC=gcc +INSTALL=install + +TARGETS=alta-diag eepro100-diag epic-diag natsemi-diag \ + ne2k-pci-diag pcnet-diag rtl8139-diag starfire-diag \ + tulip-diag via-diag vortex-diag winbond-diag yellowfin-diag \ + myson-diag ns820-diag pci-config + +all: $(TARGETS) + +alta-diag: + $(CC) $(CFLAGS) -Wstrict-prototypes -o alta-diag alta-diag.c \ + -DLIBFLASH libflash.c -DLIBMII libmii.c + +eepro100-diag: + $(CC) $(CFLAGS) -o eepro100-diag eepro100-diag.c -DLIBMII libmii.c + +epic-diag: + $(CC) $(CFLAGS) -o epic-diag epic-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +myson-diag: + $(CC) $(CFLAGS) -Wstrict-prototypes -o myson-diag myson-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +pci-config: + $(CC) $(CFLAGS) -o pci-config pci-config.c + +netsemi-diag: + $(CC) $(CFLAGS) -o natsemi-diag natsemi-diag.c + +ne2k-pci-diag: + $(CC) $(CFLAGS) -o ne2k-pci-diag ne2k-pci-diag.c + +ns820-diag: + $(CC) $(CFLAGS) -Wstrict-prototypes -o ns820-diag ns820-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +pcnet-diag: + $(CC) $(CFLAGS) -o pcnet-diag pcnet-diag.c + +rtl8139-diag: + $(CC) $(CFLAGS) -o rtl8139-diag rtl8139-diag.c -DLIBMII libmii.c -DLIBFLASH libflash.c + +starfire-diag: + $(CC) $(CFLAGS) -o starfire-diag starfire-diag.c + +tulip-diag: + $(CC) $(CFLAGS) -Wstrict-prototypes -o tulip-diag tulip-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +via-diag: + $(CC) $(CFLAGS) -o via-diag via-diag.c + +vortex-diag: + $(CC) $(CFLAGS) -o vortex-diag vortex-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +winbond-diag: + $(CC) $(CFLAGS) -Wstrict-prototypes -o winbond-diag winbond-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +yellowfin-diag: + $(CC) $(CFLAGS) -Wstrict-prototypes -o yellowfin-diag yellowfin-diag.c \ + -DLIBMII libmii.c -DLIBFLASH libflash.c + +clean: + rm -f *.o $(TARGETS) *~ + +install: all + mkdir -p $(DESTDIR)/usr/sbin + $(INSTALL) $(TARGETS) $(DESTDIR)/usr/sbin --- nictools-pci-1.3.8.orig/alta-diag.c +++ nictools-pci-1.3.8/alta-diag.c @@ -25,7 +25,7 @@ Common-sense licensing statement: Using any portion of this program in your own program means that you must give credit to the original author - and release the resulting code under the GPL. To use this code under + and release the resulting code under the GPL. To use this code under other terms requires an explicit license from the copyright holder. */ @@ -37,38 +37,36 @@ " For details and other options see http://www.scyld.com/diag/index.html\n"; static const char long_usage_msg[] = -"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n\ -\n\ - Show the internal state of a network adapter.\n\ -\n\ - The common usage is\n\ - diag -aem\n\ -\n\ - Frequently used options are\n\ - -a --show_all_registers Print all registers.\n\ - -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n\ - -m --show_mii Print the MII transceiver state\n\ - Using -mm monitors the link.\n\ - -f --force Perform operation, even on a running NIC.\n\ -\n\ - To operate on a single NIC, or one that hasn't been automatically found:\n\ - -# --card_num INDEX Operate on the specified card index.\n\ - -p --port-base IOADDR Assume an adapter at the specified I/O address.\n\ - -t --chip-type TYPE Specify adapter type (with '-p'). Use '-1' to\n\ - list available types indicies.\n\ -\n\ - To change the persistent EEPROM settings\n\ - -G --parameters PARMS Set adapter-specific parameters.\n\ - -H --new-hwaddr 01:23:45:67:89:ab\n\ - Set a new hardware station address.\n\ - -w --write-EEPROM Actually write the new settings into the EEPROM.\n\ -\n\ - -D --debug\n\ - -v --verbose Report each action taken.\n\ - -V --version Emit version information.\n\ -\n\ - -A --advertise (See the mii-diag manual page.)\n\ -"; +"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n" +"\n" +" Show the internal state of a network adapter.\n" +"\n" +" The common usage is\n" +" alta-diag -aem\n" +"\n" +" Frequently used options are\n" +" -a --show_all_registers Print all registers.\n" +" -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n" +" -m --show_mii Print the MII transceiver state\n" +" Using -mm monitors the link.\n" +" -f --force Perform operation, even on a running NIC.\n" +"\n" +" To operate on a single NIC, or one that hasn't been automatically found:\n" +" -# --card_num INDEX Operate on the specified card index.\n" +" -p --port-base IOADDR Assume an adapter at the specified I/O address.\n" +" -t --chip-type TYPE Specify adapter type with '-p', use '-1' to list.\n" +"\n" +" To change the persistent EEPROM settings\n" +" -G --parameters PARMS Set adapter-specific parameters.\n" +" -H --new-hwaddr 01:23:45:67:ab:cd\n" +" Set a new hardware station address. Typically diabled,\n" +" -w --write-EEPROM Actually write the new settings into the EEPROM.\n" +"\n" +" -D --debug\n" +" -v --verbose Report each action taken.\n" +" -V --version Emit version information.\n" +"\n" +" -A --advertise (See the mii-diag manual page.)\n"; #if ! defined(__OPTIMIZE__) #warning You must compile this program with the correct options! @@ -86,7 +84,7 @@ /* The following are required only with unaligned field accesses. */ #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include /* Newer libraries use instead. */ --- nictools-pci-1.3.8.orig/debian/changelog +++ nictools-pci-1.3.8/debian/changelog @@ -0,0 +1,300 @@ +nictools-pci (1.3.8-2) unstable; urgency=low + + * QA upload. + * debian/control: + - Maintainer field set to QA Group. + - Add armhf to Architecture list (closes: #645654). + - Capitalize 'Ethernet' in package description (closes: #469453). + - Add ${misc:Depends} to dependencies. + - Bump Standards-Version to 3.9.5. + * debian/rules: + - Do not ignore make clean errors. + - Use dh_prep instead of dh_clean -k. + - Replace `dpkg --print-gnu-build-architecture` with DEB_BUILD_GNU_TYPE. + - Add build-{arch,indep} targets. + * Add debian/compat and set debhelper compatibility level to 9. + * Remove empty maintainer scripts. + + -- Emanuele Rocca Mon, 13 Jan 2014 22:39:57 +0100 + +nictools-pci (1.3.8-1.2) unstable; urgency=low + + * Non-maintainer upload. + * Really add armel and armeb to the list of supported architectures + (closes: #408787). + + -- Aurelien Jarno Sun, 20 Jan 2008 22:41:36 +0100 + +nictools-pci (1.3.8-1.1) unstable; urgency=low + + * Non-maintainer upload from the Zürich BSP. + * Use patch from Micha Lenk to fix FTBFS: provide linux macros + set_unaligned() and get_unaligned() in new file unaligned.h + previously provided by package linux-libc-dev (closes: #428936). + * Add armel and armeb to the list of supported architectures + (closes: #408787). + * Fix a typo in rtl8139-diag(8) (closes: #444595). + + -- Aurelien Jarno Sat, 12 Jan 2008 00:57:52 +0100 + +nictools-pci (1.3.8-1) unstable; urgency=low + + * New Upstream: rtl8139-diag v2.13 + * Fixed Typos in pci-config.8 (closes: #318505, #325680) + * Fixed Typo in alta-diag.8 (closes: #325677) + + -- Alain Schroeder Sat, 3 Jun 2006 10:33:32 +0200 + +nictools-pci (1.3.7-2) unstable; urgency=low + + * Add amd64 to the list of architectures (closes: #317959) + + -- Alain Schroeder Tue, 12 Jul 2005 18:01:26 +0200 + +nictools-pci (1.3.7-1) unstable; urgency=low + + * New Upstream + * libflash v2.06a + * Another flash chips supported + * libmii v2.11 + * Support for even more chips. + * alta-diag v2.04 + * eepro100 v2.13 + * epic-diag v2.04 + * Support for card selection and help update + * myson-diag v1.08 + * few fixes + * natsemi-diag v2.08 + * updated help + * ne2k-pci-diag v2.06 + * ns820-diag v2.05 + * pcnet-diag v2.03 + * more chips known and media detection fixes + * fixes homepna breakage (closes: #258103) + * rtl8139-diag v2.13 + * Support for more chips + * starfire-diag v2.02 + * Media type fixes + * tulip-diag v2.18 + * setting the hwaddress and eeprom writes improved + * via-diag v2.10 + * vortex-diag v2.16 + * more chips known + * winbond-diag v2.02 + * yellowfin-diag v2.01 + * media type detection improved + * Non-Upstream Patches + * Support for SST39VF512 (Patch from Santiago Garcia Mantinan, + closes: #256711) + * Fixed grammar in description (closes: #306656) + * Activate Flash support in rtl8139-diag and add patch for am29f0x0b flash + chips (closes: #203360). + * added pci-config v2.05, which can be used eg. for setting pci cards into + sleep state. (closes: #237886) + + -- Alain Schroeder Sun, 10 Jul 2005 17:08:43 +0300 + +nictools-pci (1.3.6-1) unstable; urgency=low + + * New Upstream + * libmii v2.10 + * New chip-ids added + * Better support for TDK, VIA and Intel chips + * libflash v2.06 + * Include instead of on newer glibc to fix + compile problem on alpha. (Closes: #183512) + * alta-diag v2.03 + * added online help. + * eepro100 v2.12 + * more cards known + * some documentation changes + * myson-diag v1.07 + * added online help + * natsemi-diag v2.07 + * more error checking + * support emergency eeprom rewrite + * ns820-diag v2.04 + * added online help + * more error checking + * rtl8139-diag v2.11 + * added online help + * now more informative + * tulip-diag v2.17 + * added online help + * more known cards and flags + * via-diag v2.09 + * knows about more cards + * added online help + * more detailed information + * vortex-diag v2.14 + * added online help + * more detailed information + * winbond-diag v2.01 + * added online help + * Fix compile problems with gcc-3.3 by rewriting multiline + strings. (Closes: #194996) + * Incorporate all changes from Petter Reinholdtsen + nicely prepared NMU, which never made it out of the delay queue. + + -- Alain Schroeder Sat, 7 Jun 2003 15:49:19 +0200 + +nictools-pci (1.3.5-1) unstable; urgency=low + + * Put the right names into tulip-diag.8 manpage... (Closes: #148223) + * New Upstream + * eepro100 v2.09 - Long Help, few fixes. + * epic-diag v2.03 - Better interpretation of eeprom + * ne2k-pci-diag v2.05 - Support for misprogrammed Winbond 89C940, more help + * tulip-diag v2.11 - Beautified output + + -- Alain Schroeder Sat, 27 Jul 2002 21:48:57 +0200 + +nictools-pci (1.3.4-1) unstable; urgency=low + + * New Upstream + * eepro100 v2.08 - Knows about "Intel Pro/100 VM (type 1038)" now. + * tulip-diag v2.10 - Added new Chips, small bugfixes parsing the Eeprom. + * vortex-diag v2.06 - Rewrite of Eeprom parsing + + -- Alain Schroeder Sun, 26 May 2002 15:38:22 +0200 + +nictools-pci (1.3.3-3) unstable; urgency=low + + * We should install our manpages, too. + * removed dh_testversion, it's deprecated. + + -- Alain Schroeder Sat, 4 May 2002 18:19:55 +0200 + +nictools-pci (1.3.3-2) unstable; urgency=low + + * Added the last missing manpages for starfire-diag, tulip-diag, via-diag, + vortex-diag, winbond-diag and yellowfin-diag (closes: #107833) + * Fixed some bugs in a few of the previously added manpages. + + -- Alain Schroeder Mon, 18 Feb 2002 19:17:13 +0100 + +nictools-pci (1.3.3-1) unstable; urgency=low + + * New Upstream. + * eepro100-diag 2.07 (Intel Pro/100 VE (type 1031) support) + * epic-diag 2.02 + * libflash 2.04 + * myson-diag 1.01 (Changed backup_ee_contents) + * rtl8139-diag 2.05 (now it checks for the lenght of the eeprom, so + it also shows rtl8139c's upper registers. And while + Donald was at it, he fixed the other bugs, too.) + (closes: #114697, #112396) + * tulip-diag 2.09 + * Small addition to the manpage of alta-diag. + * Wrote manpages for eepro100-diag, epic-diag, myson-diag, natsemi-diag, + ne2k-pci-diag, ns820-diag, pcnet-diag and rtl8139-diag. 6 still to until + I'm finished... + + -- Alain Schroeder Thu, 14 Feb 2002 12:31:04 +0100 + +nictools-pci (1.3.2-3) unstable; urgency=low + + * Fix some typos in description (closes: #125186) + + -- Alain Schroeder Sat, 22 Dec 2001 16:44:43 +0100 + +nictools-pci (1.3.2-2) unstable; urgency=low + + * Removed libc6-dev build dependency. + + -- Alain Schroeder Tue, 10 Jul 2001 13:28:48 +0200 + +nictools-pci (1.3.2-1) unstable; urgency=low + + * Splitted nictools source into mii-diag, nictools-pci and + nictools-nopci. + * New Upstream of eepro100-diag.c (v2.05) + + -- Alain Schroeder Mon, 18 Jun 2001 22:45:37 +0200 + +nictools (1.3.1-2) unstable; urgency=low + + * Removed a tab from debian/control + + -- Alain Schroeder Fri, 1 Jun 2001 13:40:30 +0200 + +nictools (1.3.1-1) unstable; urgency=low + + * New Upstream(s): + ** Added ns820-diag for cards with Myson MTD803 chip (v1.00) + ** Added myson-diag for cards with National Semiconductor DP83820 + chips (v2.02) + ** Updated eepro-diag (v2.04) + ** Updated epic-diag (v2.01) + ** Updated libmmi (v2.04) + ** Updated mii-diag (v2.02) + ** Updated natsemi-diag (v2.04) + ** Updated ne2k-pci-diag (v2.01) + ** Updatet rtl8139-diag (v2.03) + ** Updated tulip-diag (v2.08) + ** Updated via-diag (v2.06) + ** Updated vortex-diag (v2.05) + * Added myson-diag and ns820-diag to description + + -- Alain Schroeder Tue, 22 May 2001 00:18:46 +0200 + +nictools (1.3-6) unstable; urgency=low + + * Added patch that allowes building this package with + /usr/src/kernel-source-* as a symlink from Guido Guenther. + (Closes: #95850) + * Added Build-Depend on gawk. + + -- Alain Schroeder Tue, 17 Apr 2001 00:10:20 +0200 + +nictools (1.3-5) unstable; urgency=low + + * I was a bit too fast with making 3c5x9utils an obsolete package. + I forgot to include the actual binaries. (Closes: #94194) + + -- Alain Schroeder Tue, 17 Apr 2001 00:10:20 +0200 + +nictools (1.3-4) unstable; urgency=low + + * Modified the Descriptions a little bit. + * Wrote manpages for atlantic-diag, atp-diag, eexpress-diag, e21-diag, + hp+-diag and ne2k-diag. + + -- Alain Schroeder Thu, 8 Mar 2001 02:53:10 +0100 + +nictools (1.3-3) unstable; urgency=low + + * Reimplemented debian/rules cleanly. + * Wrote manpages for 3c515-diag, alta-diag and at1700-diag. + + -- Alain Schroeder Wed, 28 Feb 2001 14:02:04 +0100 + +nictools (1.3-2) unstable; urgency=low + + * Fixed Typos in mii-diag's description, closes: #83700 + * Wrote a manpage for mii-diag, closes: #83702 + * Implemented a real "help" mode with all infos from the manpagei in + mii-diag. + + -- Alain Schroeder Fri, 16 Feb 2001 16:03:35 +0100 + +nictools (1.3-1) unstable; urgency=low + + * Jumped upstream version up to 1.3 to nicely integrate 3c5x9utils. + * Reconstructed the building. Now 3c9x5utils and nictools-noisa ist only + build on i386, while nictools-pci is i386 arm alpha only. mii-diag is + the only package that can be crosscompiled, closes: #84704, #85233 + + -- Alain Schroeder Mon, 5 Feb 2001 15:07:24 +0100 + +nictools (1.0-2) unstable; urgency=low + + * Fixed Description to not be wrapped, closes: #83985 + + -- Alain Schroeder Tue, 30 Jan 2001 13:26:25 +0100 + +nictools (1.0-1) unstable; urgency=low + + * Initial Release, closes: #83441 + + -- Alain Schroeder Tue, 9 Jan 2001 20:27:27 +0100 --- nictools-pci-1.3.8.orig/debian/compat +++ nictools-pci-1.3.8/debian/compat @@ -0,0 +1 @@ +9 --- nictools-pci-1.3.8.orig/debian/control +++ nictools-pci-1.3.8/debian/control @@ -0,0 +1,33 @@ +Source: nictools-pci +Section: net +Priority: extra +Maintainer: Debian QA Group +Standards-Version: 3.9.5 +Build-Depends: debhelper (>= 9.0) + +Package: nictools-pci +Architecture: i386 arm armeb armel armhf alpha amd64 +Depends: ${misc:Depends}, ${shlibs:Depends} +Suggests: nictools-nopci +Description: Diagnostic tools for many PCI Ethernet cards + These tools can help you to diagnose problems with your Ethernet cards + or - in some cases - give those cards the final hint, to work in your + network. + . + alta-diag : Diagnostic and setup for the Sundance "Alta" NIC + eepro100-diag : Diagnostic and setup for the Intel EEPro100 Ethernet cards + epic-diag : Diagnostics and EEPROM setup for the SMC EPIC-100 + myson-diag : Diagnostic and setup for the Myson mtd803 Ethernet chip + natsemi-diag : Diagnostic and setup for the NatSemi DP83815 Ethernet chip + ne2k-pci-diag : Diagnostics and EEPROM setup for PCI NE2000 clones + ns820-diag : Diagnostic and setup for the NatSemi DP83820 Ethernet chip + pcnet-diag : Diagnostic and setup for the AMD PCnet/PCI Ethernet chip + rtl8139-diag : Diagnostics and EEPROM setup for RealTek RTL8129/8139 chips + starfire-diag : Diagnostic and setup for the Adaptec Starfire DuraLAN + tulip-diag : Diagnostic and setup for the Digital DC21x4* Ethernet chips + via-diag : Diagnostic and setup for the VIA Rhine vt86c100 and vt3043 + Ethernet chips + vortex-diag : Diagnostics and EEPROM setup for the 3Com Vortex series + winbond-diag : Diagnostic and setup for the Winbond w89c840 Ethernet cards + yellowfin-diag: Diagnostic and setup for the Packet Engines Yellowfin chips + pci-config : Show and manipulate PCI configuration space --- nictools-pci-1.3.8.orig/debian/copyright +++ nictools-pci-1.3.8/debian/copyright @@ -0,0 +1,13 @@ +This package was debianized by Alain Schroeder on +Tue, 9 Jan 2001 20:27:27 +0100. + +It was downloaded from http://www.scyld.com/diag/index.html + +Upstream Author: Donald Becker + +Copyright: + + You are free to distribute this software under the terms of the GNU + General Public License. The full text of this license can be found + in the file /usr/share/common-licenses/GPL. + --- nictools-pci-1.3.8.orig/debian/man/alta-diag.8 +++ nictools-pci-1.3.8/debian/man/alta-diag.8 @@ -0,0 +1,92 @@ +.TH ALTA-DIAG 8 "February 18, 2002" +.SH NAME +alta-diag \- EEPROM setup and diagnostic program for ethernet cards +based on the chip Sundance ST201 "Alta". +.SH SYNOPSIS +.B alta-diag +.RI [ options ] +.SH DESCRIPTION +\fBalta-diag\fP is a program that you can use to diagnose problems with +ethercards based the Sundance ST201 "Alta" Chip as well as reconfiguring it. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-D +Debug mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-a, \-\-all +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-# +Use card number . +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 100baseTx, +10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-t, \-\-chip-type +Use chip type. Only available option is "Sundance Technology Alta", but more may come. +.TP +.B \-w, \-\-write-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-# [card-number] +Specify card to work on. +.TP +.B \-B +Dumps the flash to the screen. +.TP +.B \-L +Load file and write it into the flash. +.TP +.B \-S +Saves the flash to a file. +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run alta-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +alta-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/eepro100-diag.8 +++ nictools-pci-1.3.8/debian/man/eepro100-diag.8 @@ -0,0 +1,78 @@ +.TH EEPRO100-DIAG 8 "February 18, 2002" +.SH NAME +eepro100-diag \- EEPROM setup and diagnostic program for Intel EtherExpress Pro100B, and EEPro PCI 10+ ethernet cards. +.SH SYNOPSIS +.B eepro100-diag +.RI [ options ] +.SH DESCRIPTION +\fBeepro100-diag\fP is a program that you can use to diagnose problems with +ethernet cards based the "Speedo3" chip series: the i82557, '558 and '559. +These chips are used on the EtherExpress Pro100B, and EEPro PCI 10+. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# , \-\-card_num +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, 100baseTx, +10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run eepro100-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +eepro100-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/epic-diag.8 +++ nictools-pci-1.3.8/debian/man/epic-diag.8 @@ -0,0 +1,77 @@ +.TH EPIC-DIAG 8 "February 18, 2002" +.SH NAME +epic-diag \- EEPROM setup and diagnostic program for SMC EtherPowerII ethernet cards and others. +.SH SYNOPSIS +.B epic-diag +.RI [ options ] +.SH DESCRIPTION +\fBepic-diag\fP is a program that you can use to diagnose problems with ethernet cards +based on the SMC83C170 series EPIC/100 chip, as used on the SMC EtherPowerII boards. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, 100baseTx, +10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run epic-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +epic-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/myson-diag.8 +++ nictools-pci-1.3.8/debian/man/myson-diag.8 @@ -0,0 +1,77 @@ +.TH MYSON-DIAG 8 "February 18, 2002" +.SH NAME +myson-diag \- EEPROM setup and diagnostic program for ethernet cards based on the Myson MTD803 chip. +.SH SYNOPSIS +.B myson-diag +.RI [ options ] +.SH DESCRIPTION +\fBmyson-diag\fP is a program that you can use to diagnose problems with ethernet cards +based on the Myson MTD803 chip. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show\-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency\-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, 100baseTx, +10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run myson-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +myson-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/natsemi-diag.8 +++ nictools-pci-1.3.8/debian/man/natsemi-diag.8 @@ -0,0 +1,77 @@ +.TH NATSEMI-DIAG 8 "February 18, 2002" +.SH NAME +natsemi-diag \- EEPROM setup and diagnostic program for ethernet cards based on the National Semiconductor DP83810 / 83815 chips. +.SH SYNOPSIS +.B natsemi-diag +.RI [ options ] +.SH DESCRIPTION +\fBnetsemi-diag\fP is a program that you can use to diagnose problems with ethernet cards +based on the National Semiconductor DP83810 / 83815 chips. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-# +Use card number . +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run natsemi-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +netsemi-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/ne2k-pci-diag.8 +++ nictools-pci-1.3.8/debian/man/ne2k-pci-diag.8 @@ -0,0 +1,72 @@ +.TH NE2K-PCI-DIAG 8 "February 18, 2002" +.SH NAME +ne2k-pci-diag \- EEPROM setup and diagnostic program for PCI NE2000 ethernet cards. +.SH SYNOPSIS +.B ne2k-pci-diag +.RI [ options ] +.SH DESCRIPTION +\fBne2k-pci-diag\fP is a program that you can use to diagnose problems with PCI NE200 Enternet adapters. This include cards with RealTek RTL8029AS, Holtak HT80232 ECON-PCI, Winbond W89c940f and VIA VT86C926 (Amazon) chips. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-# +Use card number . +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run ne2k-pci-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +ne2k-pci-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/ns820-diag.8 +++ nictools-pci-1.3.8/debian/man/ns820-diag.8 @@ -0,0 +1,77 @@ +.TH NS820-DIAG 8 "February 18, 2002" +.SH NAME +ns820-diag \- EEPROM setup and diagnostic program for ethernet cards based on the National Semiconductor DP83820 chip series. +.SH SYNOPSIS +.B ns820-diag +.RI [ options ] +.SH DESCRIPTION +\fBns820-diag\fP is a program that you can use to diagnose problems with ethernet cards +based on the National Semiconductor DP83820 chip series. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-port\-base +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run ns820-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +ns820-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/pci-config.8 +++ nictools-pci-1.3.8/debian/man/pci-config.8 @@ -0,0 +1,52 @@ +.TH PCI-CONFIG 8 "February 18, 2002" +.SH NAME +pcnet-diag \- EEPROM setup and diagnostic program for ethernet cards based on the AMD PCnet/PCI series chips. +.SH SYNOPSIS +.B pci-config +.RI [ options ] +.SH DESCRIPTION +\fBpci-config\fP is a program that you can use to diagnose problems with ethernet cards +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-# +Operate only on device . +.TP +.B \-a, \-\-show_addresses +Show PCI registers +.TP +.B \-S, \-\-sleep +Put device to sleep (ACPI D3). +.TP +.B \-W, \-\-wake +Wake a sleeping device (ACPI D0 state). +.TP +.B \-B, \-\-bus +Show only devices on BUS. +.TP +.B \-A, \-\-set\-addresses +Set PCI address register 1 to the . +.TP +.B \-D, \-\-debug +Show details of operations. +.TP +.B \-f, \-\-force +Override checks and perform the operation. +.TP +.B \-u, \-\-usage +Show a long usage message. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +pci-config was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/pcnet-diag.8 +++ nictools-pci-1.3.8/debian/man/pcnet-diag.8 @@ -0,0 +1,77 @@ +.TH PCNET-DIAG 8 "February 18, 2002" +.SH NAME +pcnet-diag \- EEPROM setup and diagnostic program for ethernet cards based on the AMD PCnet/PCI series chips. +.SH SYNOPSIS +.B pcnet-diag +.RI [ options ] +.SH DESCRIPTION +\fBpcnet-diag\fP is a program that you can use to diagnose problems with ethernet cards +based on the National Semiconductor DP83820 chip series. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +HomePNA, MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run pcnet-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +pcnet-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/rtl8139-diag.8 +++ nictools-pci-1.3.8/debian/man/rtl8139-diag.8 @@ -0,0 +1,77 @@ +.TH RTL8139-DIAG 8 "February 18, 2002" +.SH NAME +rtl8139-diag \- EEPROM setup and diagnostic program for ethernet cards based on the Realtek 8129 and 8139 chips. +.SH SYNOPSIS +.B rtl8139-diag +.RI [ options ] +.SH DESCRIPTION +\fBrtl8139-diag\fP is a program that you can use to diagnose problems with ethernet cards +based on the Realtek 8129 or 8139 chip series. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII, Autosense and Autonegotiate. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run rtl8139-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +rtl8139-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/starfire-diag.8 +++ nictools-pci-1.3.8/debian/man/starfire-diag.8 @@ -0,0 +1,77 @@ +.TH STARFIRE-DIAG 8 "February 18, 2002" +.SH NAME +starfire-diag \- EEPROM setup and diagnostic program for ethernet cards based on the Adaptec 6915 "Starfire" chip. +.SH SYNOPSIS +.B starfire-diag +.RI [ options ] +.SH DESCRIPTION +\fBstarfire-diag\fP is a program that you can use to diagnose problems with +Adaptec 6915 "Starfire" ethernet cards. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run starfire-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +starfire-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/tulip-diag.8 +++ nictools-pci-1.3.8/debian/man/tulip-diag.8 @@ -0,0 +1,80 @@ +.TH TULIP-DIAG 8 "February 18, 2002" +.SH NAME +tulip-diag \- EEPROM setup and diagnostic program for ethernet cards based +on the Digital DC21x4* chip. +.SH SYNOPSIS +.B tulip-diag +.RI [ options ] +.SH DESCRIPTION +\fBtulip-diag\fP is a program that you can use to diagnose problems with +ethernet cards based on Digital DC21x4* chips. This includes the following +chips: Digital and Intel 21040/041/140/142/143/145 and others from Lite-On, +LinkSys, Macronix, ASIX, Compex, STmicro, ADMtek, Davicom and Xircom. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII, HomePNA and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run tulip-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +tulip-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/via-diag.8 +++ nictools-pci-1.3.8/debian/man/via-diag.8 @@ -0,0 +1,78 @@ +.TH VIA-DIAG 8 "February 18, 2002" +.SH NAME +via-diag \- EEPROM setup and diagnostic program for the VIA Rhine vt86c100 +and vt3043 Ethernet controller chips. +.SH SYNOPSIS +.B via-diag +.RI [ options ] +.SH DESCRIPTION +\fBvia-diag\fP is a program that you can use to diagnose problems with +VIA Rhine vt86c100 and vt3043 Ethernet controller chips. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII, HomePNA and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run via-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +via-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/vortex-diag.8 +++ nictools-pci-1.3.8/debian/man/vortex-diag.8 @@ -0,0 +1,78 @@ +.TH VORTEX-DIAG 8 "February 18, 2002" +.SH NAME +vortex-diag \- EEPROM setup and diagnostic program for the 3Com Vortex series. +.SH SYNOPSIS +.B vortex-diag +.RI [ options ] +.SH DESCRIPTION +\fBvortex-diag\fP is a program that you can use to diagnose problems with +the 3Com Vortex series. Those include all cards which are based on the 3Com +Vortex, Boomerang and Cyclone chips. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run vortex-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +vortex-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/winbond-diag.8 +++ nictools-pci-1.3.8/debian/man/winbond-diag.8 @@ -0,0 +1,78 @@ +.TH WINBOND-DIAG 8 "February 18, 2002" +.SH NAME +winbond-diag \- EEPROM setup and diagnostic program for Winbond w89c840 based +Ethernet cards. +.SH SYNOPSIS +.B winbond-diag +.RI [ options ] +.SH DESCRIPTION +\fBwinbond-diag\fP is a program that you can use to diagnose problems with +Ethernet cards based on the Winbond w89c840 chip. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run winbond-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +winbond-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/man/yellowfin-diag.8 +++ nictools-pci-1.3.8/debian/man/yellowfin-diag.8 @@ -0,0 +1,77 @@ +.TH YELLOWFIN-DIAG 8 "February 18, 2002" +.SH NAME +yellowfin-diag \- EEPROM setup and diagnostic program for Ethernet cards based on the "Yellowfin" G-NIC-I chip. +.SH SYNOPSIS +.B yellowfin-diag +.RI [ options ] +.SH DESCRIPTION +\fByellowfin-diag\fP is a program that you can use to diagnose problems with +Ethernet cards based on the "Yellowfin" G-NIC-I or Symbios 53c885 chip. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +A summary of options is included below. +.TP +.B \-h, \-\-help +Show summary of options. +.TP +.B \-V, \-\-version +Show version of program. +.TP +.B \-v, \-\-verbose +Verbose mode. +.TP +.B \-q, \-\-quiet +Be very unverbose. +.TP +.B \-# +Use card number . +.TP +.B \-a, \-\-show_all_registers +Print all registers. +.TP +.B \-e, \-\-show-eeprom +Dump EEPROM contents to stdout. +.TP +.B \-E, \-\-emergency-rewrite +Re-write a corrupted EEPROM. +.TP +.B \-p, \-\-base\-address +Specify port to use. +.TP +.B \-A, \-\-Advertise +Advertise media type. Valid Options are: 10baseT, 100baseT4, 100baseTx, +100baseTx-FD, 100baseTx-HD, 10baseT-FD and 10baseHD. +.TP +.B \-F, \-\-new\-interface +Interface number. Options that make sense are: 10baseT, 10base2, AUI, +100baseTx, 10baseT-FDX, 100baseTx-FDX, 100baseT4, 100baseFx, 100baseFx-FDX, +MII and Autosense. +.TP +.B \-H, \-\-new\-hwaddress
+Set card to a new hardware address. +.TP +.B \-m, \-\-show-mii +Dump MII management registers. +.TP +.B \-R, \-\-reset +Reset the transceiver. +.TP +.B \-T, \-\-test +Do register and SRAM test. +.TP +.B \-w, \-\-write\-EEPROM +Write to the EEPROMS with the specified values. Do not use this, if you do not know what you do! +.TP +.B \-f, \-\-force\-detection +Try to identify the card, even if it is active. +.TP +.B \-t, \-\-chip\-type +Explicitly set the chip. To get all valid numbers, run yellowfin-diag with the options '-t -1'. +.SH SEE ALSO +.BR mii-diag (8) +.SH AUTHOR +yellowfin-diag was written and is still maintained by Donald Becker +. +This manual page was written by Alain Schroeder , +for the Debian GNU/Linux system (but may be used by others). --- nictools-pci-1.3.8.orig/debian/nictools-pci.dirs +++ nictools-pci-1.3.8/debian/nictools-pci.dirs @@ -0,0 +1,2 @@ +usr/sbin +usr/share/man/man8 --- nictools-pci-1.3.8.orig/debian/nictools-pci.files +++ nictools-pci-1.3.8/debian/nictools-pci.files @@ -0,0 +1,16 @@ +usr/sbin/alta-diag +usr/sbin/eepro100-diag +usr/sbin/epic-diag +usr/sbin/myson-diag +usr/sbin/natsemi-diag +usr/sbin/ne2k-pci-diag +usr/sbin/ns820-diag +usr/sbin/pcnet-diag +usr/sbin/rtl8139-diag +usr/sbin/starfire-diag +usr/sbin/tulip-diag +usr/sbin/via-diag +usr/sbin/vortex-diag +usr/sbin/winbond-diag +usr/sbin/yellowfin-diag +usr/sbin/pci-config --- nictools-pci-1.3.8.orig/debian/nictools-pci.manpages +++ nictools-pci-1.3.8/debian/nictools-pci.manpages @@ -0,0 +1,16 @@ +debian/man/alta-diag.8 +debian/man/eepro100-diag.8 +debian/man/epic-diag.8 +debian/man/myson-diag.8 +debian/man/natsemi-diag.8 +debian/man/ne2k-pci-diag.8 +debian/man/ns820-diag.8 +debian/man/pcnet-diag.8 +debian/man/pci-config.8 +debian/man/rtl8139-diag.8 +debian/man/starfire-diag.8 +debian/man/tulip-diag.8 +debian/man/via-diag.8 +debian/man/vortex-diag.8 +debian/man/winbond-diag.8 +debian/man/yellowfin-diag.8 --- nictools-pci-1.3.8.orig/debian/rules +++ nictools-pci-1.3.8/debian/rules @@ -0,0 +1,83 @@ +#!/usr/bin/make -f + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This has to be exported to make some magic below work. +export DH_OPTIONS + +BUILD_ARCH:=$(DEB_BUILD_GNU_TYPE) +# New cross-compilation policy may set the DEB_HOST_ARCH variable. +ifdef DEB_HOST_ARCH + ARCH:=$(DEB_HOST_ARCH) +else + # dpkg-cross sets the ARCH environment variable, so use it. + ifdef ARCH + ARCH:=$(ARCH) + else + ARCH:=$(BUILD_ARCH) + endif +endif + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp + +build-stamp: + dh_testdir + $(MAKE) all + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + + # Add here commands to clean up after the build process. + $(MAKE) clean + + dh_clean + +install: DH_OPTIONS= +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + $(MAKE) install DESTDIR=`pwd`/debian/tmp + -dh_movefiles + +# Build architecture-independent files here. +# Pass -i to all debhelper commands in this target to reduce clutter. +binary-indep: DH_OPTIONS=-i +binary-indep: build install + +# Build architecture-dependent files here. +# Pass -a to all debhelper commands in this target to reduce clutter. +binary-arch: DH_OPTIONS=-s +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu + dh_installcron + + dh_installman +# dh_undocumented + + dh_installinfo + dh_installchangelogs + dh_strip + dh_link + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- nictools-pci-1.3.8.orig/eepro100-diag.c +++ nictools-pci-1.3.8/eepro100-diag.c @@ -34,38 +34,37 @@ " For details and other options see http://www.scyld.com/diag/index.html\n"; static const char long_usage_msg[] = -"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n\ -\n\ - Show the internal state of a network adapter.\n\ -\n\ - The common usage is\n\ - eepro100-diag -aem\n\ -\n\ - Frequently used options are\n\ - -a --show_all_registers Print all registers.\n\ - -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n\ - -m --show_mii Print the MII transceiver state\n\ - Using -mm monitors the link.\n\ - -f --force Perform operation, even on a running NIC.\n\ -\n\ - To operate on a single NIC, or one that hasn't been automatically found:\n\ - -# --card_num INDEX Operate on the specified card index.\n\ - -p --port-base IOADDR Assume an adapter at the specified I/O address.\n\ - -t --chip-type TYPE Specify adapter type (with '-p'). Use '-1' to\n\ - list available types indicies.\n\ -\n\ - To change the persistent EEPROM settings\n\ - -G --parameters PARMS Set adapter-specific parameters.\n\ - -H --new-hwaddr 01:23:45:67:89:ab\n\ - Set a new hardware station address. Typically disabled for safety.\n\ - -w --write-EEPROM Actually write the new settings into the EEPROM.\n\ -\n\ - -D --debug\n\ - -v --verbose Report each action taken.\n\ - -V --version Emit version information.\n\ -\n\ - -A --advertise (See the mii-diag manual page.)\n\ -"; +"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n" +"\n" +" Show the internal state of a network adapter.\n" +"\n" +" The common usage is\n" +" eepro100-diag -aem\n" +"\n" +" Frequently used options are\n" +" -a --show_all_registers Print all registers.\n" +" -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n" +" -m --show_mii Print the MII transceiver state\n" +" Using -mm monitors the link.\n" +" -f --force Perform operation, even on a running NIC.\n" +"\n" +" To operate on a single NIC, or one that hasn't been automatically found:\n" +" -# --card_num INDEX Operate on the specified card index.\n" +" -p --port-base IOADDR Assume an adapter at the specified I/O address.\n" +" -t --chip-type TYPE Specify adapter type (with '-p'), use '-1' to list.\n" +"\n" +" To change the persistent EEPROM settings\n" +" -G --parameters PARMS Set adapter-specific parameters.\n" +" -H --new-hwaddr 01:23:45:67:89:ab\n" +" Set a new hardware station address. Typically disabled for safety.\n" +" -w --write-EEPROM Actually write the new settings into the EEPROM.\n" +"\n" +" -D --debug\n" +" -v --verbose Report each action taken.\n" +" -V --version Emit version information.\n" +"\n" +" -A --advertise (See the mii-diag manual page.)\n" +"\n"; #if ! defined(__OPTIMIZE__) #warning You must compile this program with the correct options! --- nictools-pci-1.3.8.orig/epic-diag.c +++ nictools-pci-1.3.8/epic-diag.c @@ -47,7 +47,7 @@ Show the internal state of a network adapter.\n\ \n\ The common usage is\n\ - diag -aem\n\ + epic-diag -aem\n\ \n\ Frequently used options are\n\ -a --show_all_registers Print all registers.\n\ --- nictools-pci-1.3.8.orig/libflash.c +++ nictools-pci-1.3.8/libflash.c @@ -92,7 +92,6 @@ { 0x1F, 0xC4, 0, 512*1024, 256, "Atmel AT29LV040A", }, /* Bulk-erase, byte-program parts. */ { 0x1F, 0x03, ERASE_FIRST, 64*1024, 1, "Atmel AT49BV512", }, - { 0xBF, 0xD4, ERASE_FIRST, 64*1024, 1, "Silicon Storage Technology SST39VF512", }, /* AMD parts that require 90/01 read method. */ { 0x01, 0x6D, 0, 128*1024, 8*1024, "AMD Am29LV001BB", }, { 0x01, 0xED, 0, 128*1024, 8*1024, "AMD Am29LV001BT", }, @@ -112,9 +111,9 @@ { 0x01, 0x4F, 0, 512*1024, 128, "AMD Am29LV040B", }, { 0x01, 0x03, 0, 0, 0, "AMD Am29BL162C", }, { 0x01, 0x38, 0, 0, 0, "AMD Am29LV081B", }, - { 0x01, 0x20, 0, 0, 0, "AMD Am29F010B", }, - { 0x01, 0xA4, 0, 0, 0, "AMD Am29F040B", }, - { 0x01, 0xD5, 0, 0, 0, "AMD Am29F080B", }, + { 0x01, 0x20, ERASE_FIRST, 128*1024, 1, "AMD Am29F010B", }, + { 0x01, 0xA4, ERASE_FIRST, 512*1024, 1, "AMD Am29F040B", }, + { 0x01, 0xD5, ERASE_FIRST, 1024*1024, 1, "AMD Am29F080B", }, { 0x01, 0xAD, 0, 0, 0, "AMD Am29F016D", }, { 0x01, 0x3D, 0, 0, 0, "AMD Am29F017D", }, { 0x01, 0x41, 0, 0, 0, "AMD Am29F032B", }, @@ -332,12 +331,24 @@ /* Bulk erase the flash ROM. */ void sst_flash_clear(long addr_ioaddr, long data_ioaddr) { + int j; + do_cmd(addr_ioaddr, data_ioaddr, 0x80); do_cmd(addr_ioaddr, data_ioaddr, 0x10); - usleep(20000); /* 20 msec. */ - /* While SST39VF512 specifies a max tsce of 100 ms, the */ - /* AT49BV512 specifies a tEC Erase Cycle Time of 10 sec, so ... */ - sleep(10); + + printf("Chiperase..."); + /* + * Poll for the erase to complete, + * wait until status bits stop toggling. + */ + for (j = 0; j < 2000000; j++) + if (flash_in(addr_ioaddr, data_ioaddr, 0) == + flash_in(addr_ioaddr, data_ioaddr, 0)) { + printf(" OK\n"); + return; + } + + printf(" Timed out\n"); } int flash_program(long addr_ioaddr, long data_ioaddr, char *filename) --- nictools-pci-1.3.8.orig/myson-diag.c +++ nictools-pci-1.3.8/myson-diag.c @@ -14,7 +14,7 @@ The author may be reached as becker@scyld.com, or C/O Scyld Computing Corporation - 410 Severn Ave., Suite 210 + 914 Bay Ridge Road, Suite 220 Annapolis MD 21403 Support and updates available at @@ -28,44 +28,45 @@ */ static char *version_msg = -"myson-diag.c:v1.07 8/07/2002 Donald Becker (becker@scyld.com)\n" +"myson-diag.c:v1.08 2/28/2005 Donald Becker (becker@scyld.com)\n" " http://www.scyld.com/diag/index.html\n"; static char *usage_msg = "Usage: myson-diag [-aEefFGhmqrRtvVwW] [-p ] [-[AF] ]\n" " For details and other options see http://www.scyld.com/diag/index.html\n"; static const char long_usage_msg[] = -"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n" -"\n" -" Show the internal state of a network adapter.\n" -"\n" -" The common usage is\n" -" myson-diag -aem\n" -"\n" -" Frequently used options are\n" -" -a --show_all_registers Print all registers.\n" -" -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n" -" -m --show_mii Print the MII transceiver state\n" -" Using -mm monitors the link.\n" -" -f --force Perform operation, even on a running NIC.\n" -"\n" -" To operate on a single NIC, or one that hasn't been automatically found:\n" -" -# --card_num INDEX Operate on the specified card index.\n" -" -p --port-base IOADDR Assume an adapter at the specified I/O address.\n" -" -t --chip-type TYPE Specify adapter type with '-p', use '-1' to list.\n" -"\n" -" To change the persistent EEPROM settings\n" -" -G --parameters PARMS Set adapter-specific parameters.\n" -" -H --new-hwaddr 01:23:45:67:ab:cd\n" -" Set a new hardware station address. Typically diabled, \n" -" -w --write-EEPROM Actually write the new settings into the EEPROM.\n" -"\n" -" -D --debug\n" -" -v --verbose Report each action taken.\n" -" -V --version Emit version information.\n" -"\n" -" -A --advertise (See the mii-diag manual page.)\n" -"\n"; +"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n\ +\n\ + Show the internal state of a network adapter.\n\ +\n\ + The common usage is\n\ + myson-diag -aem\n\ +\n\ + Frequently used options are\n\ + -a --show_all_registers Print all registers.\n\ + -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n\ + -m --show_mii Print the MII transceiver state\n\ + Using -mm monitors the link.\n\ + -f --force Perform operation, even on a running NIC.\n\ +\n\ + To operate on a single NIC, or one that hasn't been automatically found:\n\ + -# --card_num INDEX Operate on the specified card index.\n\ + -p --port-base IOADDR Assume an adapter at the specified I/O address.\n\ + -t --chip-type TYPE Specify adapter type (with '-p'). Use '-1' to\n\ + list available types indicies.\n\ +\n\ + To change the persistent EEPROM settings\n\ + -G --parameters PARMS Set adapter-specific parameters.\n\ + -H --new-hwaddr 01:23:45:67:89:ab\n\ + Set a new hardware station address. Typically disabled for safety.\n\ + -w --write-EEPROM Actually write the new settings into the EEPROM.\n\ +\n\ + -D --debug\n\ + -v --verbose Report each action taken.\n\ + -V --version Emit version information.\n\ +\n\ + -A --advertise (See the mii-diag manual page.)\n\ +\n"; #if ! defined(__OPTIMIZE__) #warning You must compile this program with the correct options! @@ -82,7 +83,7 @@ /* The following are required only with unaligned field accesses. */ #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include /* Newer libraries use instead. */ @@ -101,9 +102,9 @@ extern void (*flash_out_hook)(long addr, int offset, int val); /* We should use __u8 .. __u32, but they are not always defined. */ -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; +typedef u_int32_t u32; +typedef u_int16_t u16; +typedef u_int8_t u8; struct option longopts[] = { /* { name has_arg *flag val } */ @@ -137,7 +138,7 @@ /* The table of known chips. Because of the bogus /proc/pci interface we must have both the exact - name and a PCI vendor/device IDs. + name from the kernel, a common name and the PCI vendor/device IDs. This table is searched in order: place specific entries followed by 'catch-all' general entries. */ struct pcidev_entry { @@ -437,6 +438,7 @@ "100baseT4", "100baseTx", "100baseTx-FD", "100baseTx-HD", "10baseT", "10baseT-FD", "10baseT-HD", 0, }; + char *endptr; int cap_map[] = { 0x0200, 0x0180, 0x0100, 0x0080, 0x0060, 0x0040, 0x0020,}; int i; if (debug) @@ -444,7 +446,8 @@ for (i = 0; mtypes[i]; i++) if (strcasecmp(mtypes[i], capabilities) == 0) return cap_map[i]; - if ((i = strtoul(capabilities, NULL, 16)) <= 0xffff) + i = strtoul(capabilities, &endptr, 16); + if (*endptr == 0 && 0 < i && i <= 0xffff) return i; fprintf(stderr, "Invalid media advertisement '%s'.\n", capabilities); return 0; @@ -475,16 +478,20 @@ static int get_media_index(const char *name) { + char *endptr; int i; + + if (! name) + return -1; for (i = 0; mediamap[i].name; i++) if (strcasecmp(name, mediamap[i].name) == 0) return i; - if (name && atoi(name) >= 00) - return atoi(name); - fprintf(stderr, "Invalid interface specified: it must be one of\n "); + i = strtol(name, &endptr, 0); + if (*endptr == 0) + return i; + fprintf(stderr, "Invalid interface specified. It must be one of\n"); for (i = 0; mediamap[i].name; i++) - fprintf(stderr, " %s", mediamap[i].name); - fprintf(stderr, ".\n"); + fprintf(stderr, " %d %s\n", mediamap[i].value, mediamap[i].name); return -1; } @@ -825,17 +832,17 @@ } -static char davicom_msg[] = "\n" -" Your EEPROM has been misprogrammed from the factory!\n" -"\n" -" It contains the EEPROM programming for a Davicom 9102 chip, not the\n" -" configuration for the Myson 800 series part.\n" -" This results incorrect operation, and no Wake-On-LAN feature.\n" -" Contact your vendor for a fix or replacement board.\n" -"\n" -" You may, at your own risk, attempt to use the '-E' Emergency rewrite\n" -" option to correct the EEPROM contents.\n" -"\n"; +static char davicom_msg[] = "\n\ + Your EEPROM has been misprogrammed from the factory!\n\ +\n\ + It contains the EEPROM programming for a Davicom 9102 chip, not the\n\ + configuration for the Myson 800 series part.\n\ + This results incorrect operation, and no Wake-On-LAN feature.\n\ + Contact your vendor for a fix or replacement board.\n\ +\n\ + You may, at your own risk, attempt to use the '-E' Emergency rewrite\n\ + option to correct the EEPROM contents.\n\ +"; static void myson_eeprom(unsigned short *ee_data) { --- nictools-pci-1.3.8.orig/natsemi-diag.c +++ nictools-pci-1.3.8/natsemi-diag.c @@ -16,62 +16,64 @@ The author may be reached as becker@scyld.com, or C/O Scyld Computing Corporation - 410 Severn Ave., Suite 210 + 914 Bay Ridge Road, Suite 220 Annapolis MD 21403 - Support and updates available at + Updates and additional information are available at http://www.scyld.com/diag/index.html http://scyld.com/expert/mii-status.html http://scyld.com/expert/NWay.html Common-sense licensing statement: Using any portion of this program in your own program means that you must give credit to the original author - and release the resulting code under the GPL. + and release the resulting code under the GPL. To use this code under + other terms requires an explicit license from the copyright holder. */ static char *version_msg = -"natsemi-diag.c:v2.07 12/17/2002 Donald Becker (becker@scyld.com)\n" +"natsemi-diag.c:v2.08 2/28/2005 Donald Becker (becker@scyld.com)\n" " http://www.scyld.com/diag/index.html\n"; static char *usage_msg = -"Usage: natsemi-diag [-aEefFGhmqrRtvVwW] [-p ] [-[AF] ]\n" +"Usage: natsemi-diag [-aDEefFGhmqrRtvVwW] [-p ] [-[AF] ]\n" " For details and other options see http://www.scyld.com/diag/index.html\n"; static const char long_usage_msg[] = -"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n" -"\n" -" Show the internal state of a network adapter.\n" -"\n" -" The common usage is\n" -" natsemi-diag -aem\n" -"\n" -" Frequently used options are\n" -" -a --show_all_registers Print all registers.\n" -" -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n" -" -m --show_mii Print the MII transceiver state\n" -" Using -mm monitors the link.\n" -" -f --force Perform operation, even on a running NIC.\n" -"\n" -" To operate on a single NIC, or one that hasn't been automatically found:\n" -" -# --card_num INDEX Operate on the specified card index.\n" -" -p --port-base IOADDR Assume an adapter at the specified I/O address.\n" -" -t --chip-type TYPE Specify adapter type with '-p', use '-1' to list.\n" -"\n" -" To change the persistent EEPROM settings\n" -" -G --parameters PARMS Set adapter-specific parameters.\n" -" -H --new-hwaddr 01:23:45:67:ab:cd\n" -" Set a new hardware station address. Typically diabled, \n" -" -w --write-EEPROM Actually write the new settings into the EEPROM.\n" -" To read and write the boot BIOS extension Flash ROM\n" -" -B Show the first few bytes of the ROM\n" -" -L FILE Load the Flash from FILE.\n" -" -S FILE Store the Flash image to FILE.\n" -"\n" -" -D --debug\n" -" -v --verbose Report each action taken.\n" -" -V --version Emit version information.\n" -"\n" -" -A --advertise (See the mii-diag manual page.)\n" -"\n"; +"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n\ +\n\ + Show the internal state of a network adapter.\n\ +\n\ + The common usage is\n\ + natsemi-diag -aem\n\ +\n\ + Frequently used options are\n\ + -a --show_all_registers Print all registers.\n\ + -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n\ + -m --show_mii Print the MII transceiver state\n\ + Using -mm monitors the link.\n\ + -f --force Perform operation, even on a running NIC.\n\ +\n\ + To operate on a single NIC, or one that hasn't been automatically found:\n\ + -# --card_num INDEX Operate on the specified card index.\n\ + -p --port-base IOADDR Assume an adapter at the specified I/O address.\n\ + -t --chip-type TYPE Specify adapter type (with '-p'). Use '-1' to\n\ + list available types indicies.\n\ +\n\ + To change the persistent EEPROM settings\n\ + -G --parameters PARMS Set adapter-specific parameters.\n\ + -H --new-hwaddr 01:23:45:67:89:ab\n\ + Set a new hardware station address. Typically disabled for safety.\n\ + -w --write-EEPROM Actually write the new settings into the EEPROM.\n\ + To read and write the boot BIOS extension Flash ROM\n\ + -B Show the first few bytes of the ROM\n\ + -L FILE Load the Flash from FILE.\n\ + -S FILE Store the Flash image to FILE.\n\ +\n\ + -D --debug\n\ + -v --verbose Report each action taken.\n\ + -V --version Emit version information.\n\ +\n\ + -A --advertise (See the mii-diag manual page.)\n\ +\n"; #if ! defined(__OPTIMIZE__) #warning You must compile this program with the correct options! @@ -90,7 +92,7 @@ /* The following are required only with unaligned field accesses. */ #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include /* Newer libraries use instead. */ @@ -459,7 +461,8 @@ 0x8000 Dynamic Autosense */ /* A table of media names to EEPROM setting. - These match the natsemi internal values. + These match the natsemi internal values. This differs from many other + diagnostics which use the Tulip values as a reference. */ struct { char *name; int value; } mediamap[] = { { "Force 10baseT half duplex", 0 }, --- nictools-pci-1.3.8.orig/ns820-diag.c +++ nictools-pci-1.3.8/ns820-diag.c @@ -85,7 +85,7 @@ /* The following are required only with unaligned field accesses. */ #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include /* Newer libraries use instead. */ --- nictools-pci-1.3.8.orig/pci-config.c +++ nictools-pci-1.3.8/pci-config.c @@ -0,0 +1,489 @@ +/* pci-config-space.c: Read the PCI configuration space. + + Read the PCI configuration space using the Intel bus-bridge interface + registers. This bypasses the BIOS32 entry, and thus we are not assured + of working on all systems. + + Copyright 1998-2003 by Donald Becker. + This software may be used and distributed according to the terms of + the GNU General Public License (GPL), incorporated herein by reference. + Contact the author for use under other terms. + + The author may be reached as becker@scyld.com, or C/O + Scyld Computing Corporation + 914 Bay Ridge Road, Suite 220 + Annapolis MD 21403 + + Support and updates available at + http://www.scyld.com/diag/index.html + + Common-sense licensing statement: Using any portion of this program in + your own program means that you must give credit to the original author + and release the resulting code under the GPL. + */ + +static char *version_msg = +"pci-config.c:v2.05 2/23/2005 Donald Becker (becker@scyld.com)\n" +" http://www.scyld.com/diag/index.html\n"; +static char *usage_msg = +"Usage: pci-config [-aDfSvVW] [-# ]\n"; + +static char *long_usage_msg ="\ +\n\ + This program shows the contents of PCI configuration space.\n\ + It reads the hardware registers, and thus must be run as 'root'.\n\ +\n\ + Running this program with no options shows the installed PCI devices.\n\ + Each line is prefixed by its index which may be used with -#\n\ + e.g. \"pci-config -#3\" to specify the device to operate on.\n\ +\n\ + Commonly use options are\n\ + -# Operate only on DEVICE-INDEX e.g -#3\n\ +\n\ + The operations on the selected device are\n\ + -a --show-addresses Show PCI address registers.\n\ + -S --sleep Put device to sleep (ACPI D3 state)\n\ + -W --wake Wake a sleeping device (ACPI D0 state)\n\ +\n\ + Less commonly used options are\n\ + -B --bus Show only devices on BUS.\n\ + -A --set-addresses Set PCI address register 1 to the ADDR.\n\ + -D --debug Show details of operations\n\ + -f --force Override checks and perform the operation\n\ + -u --usage Show this long usage message\n\ + -v --verbose Verbose mode\n\ + -V --version Display this program's version information\n\ +\n"; + +#include +#include +#include +#include +#include +#include +#include +#if defined(__linux__) && __GNU_LIBRARY__ == 1 +#include /* Newer libraries use instead. */ +#else +#include +#endif +#if !defined(__OPTIMIZE__) +#error You must compile this driver with "-O"! +#endif + +struct option longopts[] = { + {"show-addresses", 0, 0, 'a'}, /* Show PCI address registers. */ + {"set-addresses", 1, 0, 'A'}, /* Show PCI address registers. */ + {"bus", 1, 0, 'B'}, /* Show only devices on BUS. */ + {"debug", 0, 0, 'D'}, /* Increase debug level. */ + {"force", 0, 0, 'f'}, /* Force operation. */ + {"set-WOL", 0, 0, 'M'}, /* Set to Wake-On-LAN mode. */ + {"sleep", 0, 0, 'S'}, /* Put device to sleep (ACPI D3 state). */ + {"usage", 0, 0, 'u'}, /* Show the long usage message. */ + {"verbose", 0, 0, 'v'}, /* Verbose mode */ + {"version", 0, 0, 'V'}, /* Display version number */ + {"wake-on-lan", 0, 0, 'W'}, /* Wake (set to D0 state) the device. */ + {"device-index", 1, 0, '#'}, /* Operate only on device INDEX. */ + { 0, 0, 0, 0 } +}; + +static int verbose=1, opt_a=0, opt_f=0, opt_wake=0, opt_set_WOL=0, debug=0; +static int opt_sleep = 0; +static long set_address = -1; + +static int scan_one_bus(int pci_bus); + + +static void show_addr_config(unsigned char pci_bus, unsigned char pci_dev_fn); +static void show_ext_caps(unsigned int *cfg_space, unsigned char pci_bus, + unsigned char pci_dev_fn); +static void show_one_device(unsigned char pci_bus, unsigned char pci_dev_fn, + int dev_num); + +static void cyclone_WOL(int pci_bus, int pci_dev_fn, void *pci_config_space); +static void acpi_wake(unsigned char pci_bus, unsigned char pci_dev_fn, + void *config); +static void acpi_sleep(unsigned char bus, unsigned char devfn, void *pci_cfg); +static int dump_mem_region(long addr); + +extern int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, + unsigned char where, unsigned char *val); +int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned short *val); +extern int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned int *val); +void pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned char val); +void pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned short val); +void pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned int val); + + +/* Match values for specifying a single device. */ +int card_num = 0; +int match_busnum = -1, match_devfn = -1; +int show_all_devs = 1; + +int main(int argc, char **argv) +{ + int pci_bus = 0; + int errflag = 0, show_version = 0; + int c, longind; + + while ((c = getopt_long(argc, argv, "#:aA:b:B:DfMs:SuvVW", + longopts, &longind)) + != -1) + switch (c) { + case 'a': opt_a++; break; + case 'A': set_address = strtol(optarg, NULL, 16); break; + case 'b': printf("Setting bus to %s.\n", optarg); + case 'B': pci_bus = strtol(optarg, NULL, 0); break; + case 'D': debug++; break; + case 'f': opt_f++; break; + case 'M': opt_set_WOL++; break; + case 's': { + int match_cnt, match_bus, match_dev, match_fn = 0; + match_cnt = sscanf(optarg, "%d:%d.%1d", + &match_bus, &match_dev, &match_fn); + if (match_cnt == 2 || match_cnt == 3) { + match_busnum = match_bus; + match_devfn = (match_dev << 3) | match_fn; + } else { + fprintf(stderr, "Invalid PCI bus:device number '%s'.\n", + optarg); + errflag++; + } + show_all_devs = 0; + break; + } + case 'S': opt_sleep++; break; + case 'u': printf("%s%s", usage_msg, long_usage_msg); return 0; + case 'v': verbose++; break; + case 'V': show_version++; break; + case 'W': opt_wake++; break; + case '#': card_num = atoi(optarg); show_all_devs = 0; break; + case '?': + errflag++; + } + if (errflag) { + fprintf(stderr, "%s%s", usage_msg, " Use -u for more information.\n"); + return 3; + } + + if (verbose) + printf(version_msg); + + /* Get access to all of I/O space. */ + if (iopl(3) < 0) { + perror("pci-config: iopl()"); + fprintf(stderr, "This program must be run as root.\n"); + return 2; + } + + if (match_busnum >= 0) { + if (verbose) + fprintf(stderr, "Looking for device %d:%d.\n", + match_busnum, match_devfn); + scan_one_bus(match_busnum); + } else + scan_one_bus(pci_bus); + + return 0; +} + +static int scan_one_bus(int pci_bus) +{ + int pci_dev_fn; + static int dev_num = 0; + + for (pci_dev_fn = 0; pci_dev_fn < 256; pci_dev_fn++) { + /*unsigned char cb;*/ + unsigned int pci_id; + + /* Read the PCI ID from offset 0. */ + pcibios_read_config_dword(pci_bus, pci_dev_fn, 0, &pci_id); + if (pci_id == 0xffffffff) + continue; + dev_num++; + if (card_num == dev_num) { + show_one_device(pci_bus, pci_dev_fn, dev_num); + } else if (pci_bus == match_busnum && pci_dev_fn == match_devfn) { + show_one_device(pci_bus, pci_dev_fn, dev_num); + } else if (show_all_devs) { + printf("Device #%d at bus %d device/function %d/%d, %8.8x.\n", + dev_num, pci_bus, pci_dev_fn>>3, pci_dev_fn&7, pci_id); + } + /* Skip fn1-fn7 if this is not a multi-function device. */ + if ((pci_dev_fn & 7) == 0) { + unsigned int cdw; + pcibios_read_config_dword(pci_bus, pci_dev_fn, 3*4, &cdw); + if ((cdw & 0x00800000) == 0) + pci_dev_fn += 7; + } + } + + return 0; +} + + +static void show_one_device(unsigned char pci_bus, unsigned char pci_dev_fn, + int dev_num) +{ + unsigned int config[64]; + int i; + int pci_id; + + printf("Device #%d at bus %d device/function %d/%d.", + dev_num, pci_bus, pci_dev_fn>>3, pci_dev_fn&7); + for (i = 0; i < 64; i++) { + pcibios_read_config_dword(pci_bus, pci_dev_fn, i<<2, &config[i]); + printf("%s%8.8x", i % 8 == 0 ? "\n " : " ", config[i]); + } + printf("\n"); + for (i = 0; i < 5; i++) { + unsigned int pciaddr = config[4 + i]; + if (pciaddr) + printf(" Base Address %d: %s at %8.8x.\n", + i, pciaddr & 1 ? "I/O" : "Memory", pciaddr & ~1); + } + if (set_address >= 0) { + fprintf(stderr, "Setting PCI address register 1 to 0x%lx.\n", + set_address); + pcibios_write_config_dword(pci_bus, pci_dev_fn, 0x14, set_address); + pcibios_write_config_dword(pci_bus, pci_dev_fn, 0x04, config[1] | 3); + } + if (opt_a) + show_addr_config(pci_bus, pci_dev_fn); + pci_id = config[0]; + if (config[1] & 0x00100000) + show_ext_caps(config, pci_bus, pci_dev_fn); + if (config[10]) { + char *cis_addr_space[] = {"PCI configuration space", "BAR 0", "BAR 1", "BAR 2", "BAR 3", }; + int space = config[10] & 7; + printf(" CardBus CIS pointer 0x%4.4x (%s), address %x.\n", config[10], + cis_addr_space[space], config[4 + (space-1)]); + if (space > 0 && space < 4) + dump_mem_region(config[4 + ((space-1))]); + } + if (opt_sleep) + acpi_sleep(pci_bus, pci_dev_fn, config); + if (opt_wake) + acpi_wake(pci_bus, pci_dev_fn, config); + if (opt_set_WOL) + if (pci_id == 0x905510b7) + cyclone_WOL(pci_bus, pci_dev_fn, config); +} + +static void show_addr_config(unsigned char pci_bus, unsigned char pci_dev_fn) +{ + int i; + unsigned int pciaddr, cdw; + for (i = 0; i < 5; i++) { + int cfg_i = 0x10 + (i<<2); + pcibios_read_config_dword(pci_bus, pci_dev_fn, cfg_i, &pciaddr); + pcibios_write_config_dword(pci_bus, pci_dev_fn, cfg_i, 0xffffffff); + pcibios_read_config_dword(pci_bus, pci_dev_fn, cfg_i, &cdw); + if (cdw == 0) + break; + printf(" Address %d %s at %8.8x, decoded bits are %8.8x.\n", + i, cdw & 1 ? "is I/O" : "memory", pciaddr & ~1, ~cdw); + pcibios_write_config_dword(pci_bus, pci_dev_fn, cfg_i, pciaddr); + } + pcibios_read_config_dword(pci_bus, pci_dev_fn, 0x30, &pciaddr); + pcibios_write_config_dword(pci_bus, pci_dev_fn, 0x30, 0xfffffffe); + pcibios_read_config_dword(pci_bus, pci_dev_fn, 0x30, &cdw); + pcibios_write_config_dword(pci_bus, pci_dev_fn, 0x30, pciaddr); + if (cdw) + printf(" BIOS ROM at %8.8x, decoded bits are %8.8x.\n", pciaddr, cdw); + else + printf(" No BIOS extension (boot ROM).\n"); + return; +} +static void show_ext_caps(unsigned int *cfg_space, unsigned char pci_bus, + unsigned char pci_dev_fn) +{ + unsigned char *pcfg = (void *)cfg_space; + int cap_idx = cfg_space[13] & 0xff; + + printf(" Extended capabilities, first structure at offset 0x%x.\n", + cap_idx); + for (; cap_idx; cap_idx = pcfg[cap_idx + 1]) { + printf(" Extended PCI capability type %d at 0x%2.2x, next %d.\n", + pcfg[cap_idx], cap_idx, pcfg[cap_idx + 1]); + if (pcfg[cap_idx] == 1) { + printf(" Power management entry ver. %d: Capabilities %2.2x%2.2x" + ", Ctrl %2.2x%2.2x, Event %2.2x%2.2x.\n", + pcfg[cap_idx + 2] & 7, + pcfg[cap_idx + 3], pcfg[cap_idx + 2], + pcfg[cap_idx + 5], pcfg[cap_idx + 4], + pcfg[cap_idx + 7], pcfg[cap_idx + 6]); + printf(" Power state D%d.\n", pcfg[cap_idx + 4] & 3); + } + } +} + + +static int acpi_find(unsigned char pci_bus, unsigned char pci_dev_fn, + void *config) +{ + unsigned char *pcfg = (void *)config; + if (pcfg[6] & 0x10) { + int cap_idx = pcfg[0x34]; + + printf(" Extended capabilities, first structure at offset 0x%x.\n", + cap_idx); + for (; cap_idx; cap_idx = pcfg[cap_idx + 1]) { + if (pcfg[cap_idx] == 1) + return cap_idx; + } + } + return 0; +} + +static void acpi_wake(unsigned char pci_bus, unsigned char pci_dev_fn, + void *pci_config_space) +{ + unsigned char *config = pci_config_space; + unsigned short *configw = pci_config_space; + unsigned int *configdw = pci_config_space; + int pwr_idx = acpi_find(pci_bus, pci_dev_fn, config); + unsigned short pwr_command = configw[(pwr_idx + 4)>>1]; + int i; + + if (debug) + printf("Power index is %#x.\n", pwr_idx); + + printf(" Waking up an ACPI device. Currently powered %s, " + "I/O %#x IRQ %d.\n" + " Updating the power state of %4.4x->%4.4x.\n", + pwr_command & 3 ? "down" : "up", configdw[0x10>>2], config[0x3c], + pwr_command, pwr_command & ~3); + pcibios_write_config_word(pci_bus, pci_dev_fn, pwr_idx + 4, + pwr_command & ~3); + /* Many devices must have their PCI register state restored when changing + from D3 state. */ + for (i = 0x10; i <= 0x20; i+=4) + pcibios_write_config_dword(pci_bus, pci_dev_fn, i, configdw[i >> 2]); + /* PCI_ROM_ADDRESS, interrupt line, cache line size, latency timer */ + pcibios_write_config_dword(pci_bus, pci_dev_fn, 0x30, configdw[0x30 >> 2]); + pcibios_write_config_byte(pci_bus, pci_dev_fn, 0x3c, config[0x3c]); + pcibios_write_config_byte(pci_bus, pci_dev_fn, 0x0c, config[0x0c]); + pcibios_write_config_byte(pci_bus, pci_dev_fn, 0x0d, config[0x0d]); + /* Finally, restore the command register. */ + pcibios_write_config_word(pci_bus, pci_dev_fn, 0x04, configw[4>>1]); +} + +static void acpi_sleep(unsigned char bus, unsigned char devfn, + void *pci_config_space) +{ + unsigned short *configw = pci_config_space; + int pwr_idx = acpi_find(bus, devfn, pci_config_space); + unsigned short pwr_command = configw[(pwr_idx + 4)>>1]; + pcibios_write_config_word(bus, devfn, pwr_idx + 4, pwr_command | 0x0103); +} + +/* Put the 3Com Cyclone e.g. 3c905B series into Wake On LAN mode. */ +static void cyclone_WOL(int pci_bus, int pci_dev_fn, void *config) +{ + int pwr_idx = acpi_find(pci_bus, pci_dev_fn, config); + unsigned short pwr_command = ((unsigned short *)config)[(pwr_idx + 4)>>1]; + long ioaddr = ((int *)config)[0x10]; + + acpi_wake(pci_bus, pci_dev_fn, config); + + outw(0x801f, ioaddr + 0x0e); /* Set RxFilter to accept frames. */ + outw((1<<11) + 7, ioaddr + 0x0e); + outw(7, ioaddr + 0x0c); + printf(" Window 7 Power Management Event is %4.4x.\n", + inw(ioaddr + 0x0c)); + printf(" Changing the power state from %4.4x to 0103.\n", pwr_command); + outw(0x2000, ioaddr + 0x0e); /* RxEnable. */ + pcibios_write_config_word(pci_bus, pci_dev_fn, 0xe0, pwr_command | 0x8103); +} + + +#define PCI_CONFIG_ADDR 0x0cf8 +#define PCI_CONFIG_DATA 0x0cfc + +int pcibios_read_config_byte (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned char *val) +{ + outl(0x80000000 | (bus<<16) | (dev_fn << 8) | (regnum & 0xfc), + PCI_CONFIG_ADDR); + *val = inb(PCI_CONFIG_DATA + (regnum & 3)); + return 0; +} +int pcibios_read_config_word (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned short *val) +{ + outl(0x80000000 | (bus<<16) | (dev_fn << 8) | (regnum & 0xfc), + PCI_CONFIG_ADDR); + *val = inw(PCI_CONFIG_DATA + (regnum & 2)); + return 0; +} +int pcibios_read_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned int *val) +{ + outl(0x80000000 | (bus<<16) | (dev_fn << 8) | (regnum & 0xfc), + PCI_CONFIG_ADDR); + *val = inl(PCI_CONFIG_DATA); + return 0; +} +void pcibios_write_config_byte (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned char val) +{ + outl(0x80000000 | (bus<<16) | (dev_fn << 8) | (regnum & 0xfc), + PCI_CONFIG_ADDR); + outb(val, PCI_CONFIG_DATA + (regnum & 3)); + return; +} +void pcibios_write_config_word (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned short val) +{ + outl(0x80000000 | (bus<<16) | (dev_fn << 8) | (regnum & 0xfc), + PCI_CONFIG_ADDR); + outw(val, PCI_CONFIG_DATA + (regnum & 2)); + return; +} +void pcibios_write_config_dword (unsigned char bus, unsigned char dev_fn, + unsigned char regnum, unsigned int val) +{ + outl(0x80000000 | (bus<<16) | (dev_fn << 8) | (regnum & 0xfc), + PCI_CONFIG_ADDR); + outl(val, PCI_CONFIG_DATA); + return; +} + + +/* Map the board shared memory into our address space -- this code is + a good example of non-kernel access to devices on the PCI bus. */ +static int dump_mem_region(long addr) +{ + unsigned short *shared_mem; + int i; + int memfd = open("/dev/kmem", O_RDWR); + + if (memfd < 0) { + perror("/dev/kmem (shared memory)"); + return 2; + } else + printf("Opened /dev/kmem for PCI memory.\n"); + shared_mem = mmap(0, 0x8000, PROT_READ|PROT_WRITE, + MAP_SHARED, memfd, addr); + printf("Shared memory at %#lx (%p).\n", (long)addr, shared_mem); + for (i = 0; i < 100; i++) + printf(" %4.4x", shared_mem[i]); + close(memfd); + printf(" ...\n"); + return 0; +} + +/* + * Local variables: + * compile-command: "cc -O -Wall -o pci-config pci-config.c" + * tab-width: 4 + * c-indent-level: 4 + * c-basic-offset: 4 + * End: + */ --- nictools-pci-1.3.8.orig/pcnet-diag.c +++ nictools-pci-1.3.8/pcnet-diag.c @@ -41,7 +41,7 @@ Show the internal state of a network adapter.\n\ \n\ The common usage is\n\ - diag -aem\n\ + pcnet-diag -aem\n\ \n\ Frequently used options are\n\ -a --show_all_registers Print all registers.\n\ @@ -88,7 +88,7 @@ #include #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include --- nictools-pci-1.3.8.orig/starfire-diag.c +++ nictools-pci-1.3.8/starfire-diag.c @@ -5,7 +5,7 @@ Adaptec 6915 "Starfire" This file contains the complete diagnostic code. - Copyright 1998-2000 by Donald Becker. + Copyright 1998-2000,2005 by Donald Becker. This software may be used and distributed according to the terms of the GNU General Public License (GPL), incorporated herein by reference. Contact the author for use under other terms. @@ -15,24 +15,65 @@ The author may be reached as becker@scyld.com, or C/O Scyld Computing Corporation - 410 Severn Ave., Suite 210 + 914 Bay Ridge Road, Suite 220 Annapolis MD 21403 - Support and updates available at + Updates and additional information are available at http://www.scyld.com/diag/index.html http://scyld.com/expert/mii-status.html http://scyld.com/expert/NWay.html Common-sense licensing statement: Using any portion of this program in your own program means that you must give credit to the original author - and release the resulting code under the GPL. + and release the resulting code under the GPL. To use this code under + other terms requires an explicit license from the copyright holder. */ static char *version_msg = -"starfire-diag.c:v2.01 7/26/2000 Donald Becker (becker@scyld.com)\n" +"starfire-diag.c:v2.02 2/28/2005 Donald Becker (becker@scyld.com)\n" " http://www.scyld.com/diag/index.html\n"; static char *usage_msg = -"Usage: etherdiag [-aEefFmqrRtvVwW] [-p ] [-[AF] ]\n"; +"Usage: starfire-diag [-aDEefFGhmqrRtvVwW] [-p ] [-[AF] ]\n" +" For details and other options see http://www.scyld.com/diag/index.html\n"; + +static const char long_usage_msg[] = +"Usage: %s [-aDfrRvVw] [-AF ] [-#]\n\ +\n\ + Show the internal state of a network adapter.\n\ +\n\ + The common usage is\n\ + starfire-diag -aem\n\ +\n\ + Frequently used options are\n\ + -a --show_all_registers Print all registers.\n\ + -e --show-eeprom Dump EEPROM contents, \"-ee\" shows the details.\n\ + -m --show_mii Print the MII transceiver state\n\ + Using -mm monitors the link.\n\ + -f --force Perform operation, even on a running NIC.\n\ +\n\ + To operate on a single NIC, or one that hasn't been automatically found:\n\ + -# --card_num INDEX Operate on the specified card index.\n\ + -p --port-base IOADDR Assume an adapter at the specified I/O address.\n\ + -t --chip-type TYPE Specify adapter type (with '-p'). Use '-1' to\n\ + list available types indicies.\n\ +\n\ + To change the persistent EEPROM settings\n\ + -F, --new-interface N Set the default transceiver type.\n\ + -G --parameters PARMS Set adapter-specific parameters.\n\ + -H --new-hwaddr 01:23:45:67:89:ab\n\ + Set a new hardware station address. Typically disabled for safety.\n\ + -w --write-EEPROM Actually write the new settings into the EEPROM.\n\ + To read and write the boot BIOS extension Flash ROM\n\ + -B Show the first few bytes of the ROM\n\ + -L FILE Load the Flash from FILE.\n\ + -S FILE Store the Flash image to FILE.\n\ +\n\ + -D --debug\n\ + -v --verbose Report each action taken.\n\ + -V --version Emit version information.\n\ +\n\ + -A --advertise (See the mii-diag manual page.)\n\ +\n"; #if ! defined(__OPTIMIZE__) #warning You must compile this program with the correct options! @@ -53,7 +94,7 @@ #include #endif -/* No libmii.h or libflash.h yet. */ +/* No libmii.h or libflash.h yet, thus the declarations here. */ extern int show_mii_details(long ioaddr, int phy_id); extern int monitor_mii(long ioaddr, int phy_id); @@ -64,17 +105,18 @@ extern void (*flash_out_hook)(long addr, int offset, int val); /* We should use __u8 .. __u32, but they are not always defined. */ -typedef unsigned int u32; -typedef unsigned short u16; -typedef unsigned char u8; +typedef u_int32_t u32; +typedef u_int16_t u16; +typedef u_int8_t u8; struct option longopts[] = { /* { name has_arg *flag val } */ + {"card-num", 1, 0, '#'}, /* Operate on the specified card index. */ {"Advertise", 1, 0, 'A'}, {"base-address", 1, 0, 'p'}, {"show_all_registers", 0, 0, 'a'}, /* Print all registers. */ - {"help", 0, 0, 'h'}, /* Give help */ - {"show-eeprom", 0, 0, 'e'}, /* Dump EEPROM contents (-ee valid). */ + {"help", 0, 0, 'h'}, /* Print a long usage message. */ + {"show-eeprom", 0, 0, 'e'}, /* Dump EEPROM contents (-ee valid). */ {"emergency-rewrite", 0, 0, 'E'}, /* Re-write a corrupted EEPROM. */ {"force-detection", 0, 0, 'f'}, {"new-interface", 1, 0, 'F'}, /* New interface (built-in, AUI, etc.) */ @@ -97,16 +139,16 @@ /* The table of known chips. Because of the bogus /proc/pci interface we must have both the exact - name and a PCI vendor/device IDs. + name from the kernel, a common name and the PCI vendor/device IDs. This table is searched in order: place specific entries followed by 'catch-all' general entries. */ struct pcidev_entry { - char *proc_pci_name; - char *part_name; + const char *proc_pci_name; + const char *part_name; int vendor, device, device_mask; int flags; int io_size; - int (*diag_func)(int vendor_id, int device_id, long ioaddr, int part_num); + int (*diag_func)(int vendor_id, int device_id, long ioaddr, int part_idx); } pcidev_tbl[] = { { "Adaptec Unknown device", "Adaptec Starfire 6915", 0x9004, 0x6915, 0xffff, 0, 256, starfire_diag}, @@ -129,6 +171,7 @@ static char *opt_flash_dumpfile = NULL, *opt_flash_loadfile = NULL; static unsigned char new_hwaddr[6], set_hwaddr = 0; +static int emergency_rewrite = 0; static int scan_proc_pci(int card_num); static int parse_media_type(const char *capabilities); @@ -140,12 +183,11 @@ { int port_base = 0, chip_type = 0; int errflag = 0, show_version = 0; - int emergency_rewrite = 0; int c, longind; int card_num = 0; extern char *optarg; - while ((c = getopt_long(argc, argv, "#:aA:DeEfF:G:mp:qrRst:vVwWH:BL:S:", + while ((c = getopt_long(argc, argv, "#:aA:DeEfF:G:hH:mp:qrRst:vVwWBL:S:", longopts, &longind)) != -1) switch (c) { @@ -160,7 +202,8 @@ if (new_default_media < 0) errflag++; break; - case 'G': opt_G++; opt_GPIO = strtol(optarg, NULL, 16); break; + case 'G': opt_G++; opt_GPIO = strtoul(optarg, NULL, 16); break; + case 'h': fprintf(stderr, long_usage_msg, argv[0]); return 0; case 'H': { int hwaddr[6], i; @@ -176,7 +219,7 @@ } case 'm': show_mii++; break; case 'p': - port_base = strtol(optarg, NULL, 16); + port_base = strtoul(optarg, NULL, 16); break; case 'q': if (verbose) verbose--; break; case 'r': opt_restart++; break; @@ -250,7 +293,8 @@ static char bogus_irq[] = "This chip has not been assigned a valid IRQ, and will not function.\n" " This must be fixed in the PCI BIOS setup. The device driver has no way\n" -" of changing the PCI IRQ settings.\n"; +" of changing the PCI IRQ settings.\n" +" See http://www.scyld.com/expert/irq-conflict.html for more information.\n"; static int scan_proc_bus_pci(int card_num) { @@ -272,8 +316,9 @@ &pci_bus, &pci_devid, &irq, &pciaddr0, &pciaddr1) <= 0) break; for (i = 0; pcidev_tbl[i].vendor; i++) { - if (pci_devid != - (pcidev_tbl[i].vendor << 16) + pcidev_tbl[i].device) + if ((pci_devid >> 16) != pcidev_tbl[i].vendor + || (pci_devid & pcidev_tbl[i].device_mask) != + pcidev_tbl[i].device) continue; chip_idx = i; card_cnt++; @@ -331,8 +376,9 @@ int i; if (debug) printf("Named ethernet controller %s.\n", chip_name); - for (i = 0; pcidev_tbl[i].proc_pci_name; i++) - if (strncmp(pcidev_tbl[i].proc_pci_name, chip_name, + for (i = 0; pcidev_tbl[i].part_name; i++) + if (pcidev_tbl[i].proc_pci_name && + strncmp(pcidev_tbl[i].proc_pci_name, chip_name, strlen(pcidev_tbl[i].proc_pci_name)) == 0) { state = 2; @@ -388,6 +434,7 @@ "100baseT4", "100baseTx", "100baseTx-FD", "100baseTx-HD", "10baseT", "10baseT-FD", "10baseT-HD", 0, }; + char *endptr; int cap_map[] = { 0x0200, 0x0180, 0x0100, 0x0080, 0x0060, 0x0040, 0x0020,}; int i; if (debug) @@ -395,7 +442,8 @@ for (i = 0; mtypes[i]; i++) if (strcasecmp(mtypes[i], capabilities) == 0) return cap_map[i]; - if ((i = strtol(capabilities, NULL, 16)) <= 0xffff) + i = strtoul(capabilities, &endptr, 16); + if (*endptr == 0 && 0 < i && i <= 0xffff) return i; fprintf(stderr, "Invalid media advertisement '%s'.\n", capabilities); return 0; @@ -426,16 +474,20 @@ static int get_media_index(const char *name) { + char *endptr; int i; + + if (! name) + return -1; for (i = 0; mediamap[i].name; i++) if (strcasecmp(name, mediamap[i].name) == 0) return i; - if (name && atoi(name) >= 00) - return atoi(name); - fprintf(stderr, "Invalid interface specified: it must be one of\n "); + i = strtol(name, &endptr, 0); + if (*endptr == 0) + return i; + fprintf(stderr, "Invalid interface specified. It must be one of\n"); for (i = 0; mediamap[i].name; i++) - fprintf(stderr, " %s", mediamap[i].name); - fprintf(stderr, ".\n"); + fprintf(stderr, " %d %s\n", mediamap[i].value, mediamap[i].name); return -1; } @@ -537,6 +589,13 @@ for (i = 0; i < EEPROM_SIZE; i++) eeprom_contents[i] = read_eeprom(ioaddr, i); + if (opt_GPIO) { + printf("GPIO existing state is %8.8x\n", inl(ioaddr + 0x8C)); + outl(opt_GPIO, ioaddr + 0x8C); + printf(" Updating GPIO register to %8.8x (%8.8x).\n", + opt_GPIO, inl(ioaddr + 0x8C)); + } + if (show_eeprom) { u32 sum = 0; u8 *ee = (u8*)eeprom_contents; --- nictools-pci-1.3.8.orig/tulip-diag.c +++ nictools-pci-1.3.8/tulip-diag.c @@ -43,7 +43,7 @@ " Show the internal state of a network adapter.\n" "\n" " The common usage is\n" -" diag -aem\n" +" tulip-diag -aem\n" "\n" " Frequently used options are\n" " -a --show_all_registers Print all registers.\n" @@ -91,7 +91,7 @@ #include #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include /* Newer libraries use instead. */ --- nictools-pci-1.3.8.orig/unaligned.h +++ nictools-pci-1.3.8/unaligned.h @@ -0,0 +1,37 @@ +/** + * These lines of codes were obtained from Debian package linux-kernel-headers + * and adapted by Micha Lenk to meet the needs of + * nictools-pci. The package linux-kernel-headers in turn obtained the sources + * via BitKeeper from: bk://linux.bkbits.net/linux-2.5, and kernel.org mirrors + * under the terms of the GPL license. + */ + +#ifndef __UNALIGNED_H +#define __UNALIGNED_H + +/** + * get_unaligned - get value from possibly mis-aligned location + * @ptr: pointer to value + * + * This macro should be used for accessing values larger in size than + * single bytes at locations that are expected to be improperly aligned, + * e.g. retrieving a u16 value from a location not u16-aligned. + * + * Note that unaligned accesses can be very expensive on some architectures. + */ +#define get_unaligned(ptr) (*(ptr)) + +/** + * put_unaligned - put value to a possibly mis-aligned location + * @val: value to place + * @ptr: pointer to location + * + * This macro should be used for placing values larger in size than + * single bytes at locations that are expected to be improperly aligned, + * e.g. writing a u16 value to a location not u16-aligned. + * + * Note that unaligned accesses can be very expensive on some architectures. + */ +#define put_unaligned(val, ptr) ((void)( *(ptr) = (val) )) + +#endif --- nictools-pci-1.3.8.orig/via-diag.c +++ nictools-pci-1.3.8/via-diag.c @@ -44,7 +44,7 @@ " Show the internal state of a network adapter.\n" "\n" " The common usage is\n" -" diag -aem\n" +" via-diag -aem\n" "\n" " Frequently used options are\n" " -a --show_all_registers Print all registers.\n" @@ -92,7 +92,7 @@ /* The following are required only with unaligned field accesses. */ #include -#include +#include "unaligned.h" #if defined(__linux__) && __GNU_LIBRARY__ == 1 #include /* Newer libraries use instead. */ --- nictools-pci-1.3.8.orig/winbond-diag.c +++ nictools-pci-1.3.8/winbond-diag.c @@ -32,7 +32,7 @@ "winbond-diag.c:v2.02 2/28/2005 Donald Becker (becker@scyld.com)\n" " http://www.scyld.com/diag/index.html\n"; static char *usage_msg = -"Usage: etherdiag [-aEefFGhmqrRtvVwW] [-p ] [-[AF] ]\n" +"Usage: winbond-diag [-aEefFGhmqrRtvVwW] [-p ] [-[AF] ]\n" " For details and other options see http://www.scyld.com/diag/index.html\n"; static const char long_usage_msg[] = --- nictools-pci-1.3.8.orig/yellowfin-diag.c +++ nictools-pci-1.3.8/yellowfin-diag.c @@ -43,7 +43,7 @@ Show the internal state of a network adapter.\n\ \n\ The common usage is\n\ - diag -aem\n\ + yellowfin-diag -aem\n\ \n\ Frequently used options are\n\ -a --show_all_registers Print all registers.\n\