summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/forcedeth.c
Commit message (Collapse)AuthorAgeFilesLines
* [time] Allow timer to be selected at runtimeMichael Brown2017-01-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Rewrite unrelicensable portions of pci.hMichael Brown2015-03-031-4/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [src] Fix spelling in comments, debug messages and local variable namesStefan Weil2013-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes in comments and debug messages: existance -> existence unecessary -> unnecessary occured -> occurred decriptor -> descriptor neccessary -> necessary addres, adress -> address initilize -> initialize sucessfully -> successfully paramter -> parameter acess -> access upto -> up to likelyhood ->likelihood thru -> through substracting -> subtracting lenght -> length isnt -> isn't interupt -> interrupt publically -> publicly (this one was not wrong, but unusual) recieve -> receive accessable -> accessible seperately -> separately pacet -> packet controled -> controlled dectect -> detect indicies -> indices extremly -> extremely boundry -> boundary usefull -> useful unuseable -> unusable auxilliary -> auxiliary embeded -> embedded enviroment -> environment sturcture -> structure complier -> compiler constructes -> constructs supress -> suppress intruduced -> introduced compatability -> compatibility verfication -> verification ths -> the reponse -> response Fixes in local variable names: retreive -> retrieve Most of these fixes were made using codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Use standard random() functionMichael Brown2012-03-131-2/+1Star
| | | | | | | It seems unlikely that a network card driver requires cryptographically secure random numbers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Ensure that IRQ line is deasserted when disabling interruptsMichael Brown2011-05-041-3/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Never change the NVREG_TRANSMITPOLL_MAC_ADDR_REV flagMichael Brown2011-03-301-5/+0Star
| | | | | | | | | | | iPXE operates the forcedeth NIC in promiscuous mode, and never changes the unicast MAC address filter registers. We should not therefore set the flag indicating (to other drivers loaded later) that the MAC address order has already been corrected. Reported-by: Tal Aloni <tal.aloni.il@gmail.com> Tested-by: Tal Aloni <tal.aloni.il@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Remove software unicast MAC address filterMichael Brown2011-03-291-9/+2Star
| | | | | | | | | | | | | | | | | | | The forcedeth driver currently implements unicast MAC address filtering in software. This is almost invariably the wrong thing to do (since the network stack must already be able to cope with unwanted packets) and it breaks FCoE (which requires the card to operate in promiscuous mode). Also, the implementation is buggy: is_local_ether_addr() is used to check for a locally-assigned Ethernet address (not to check for a unicast address), and the current link-layer address is in netdev->ll_addr, not netdev->hw_addr. Fix by removing this code. Reported-by: Tal Aloni <tal.aloni.il@gmail.com> Tested-by: Tal Aloni <tal.aloni.il@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Avoid unused-but-set variable warning in gcc 4.6Thomas Miletich2011-03-281-3/+2Star
| | | | | | | | | Avoid unused-but-set variable warning in gcc 4.6 which was introduced by commit 9215b7f ("[forcedeth] Clear the MII link status register on link status changes"). Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Clear the MII link status register on link status changesYann Cézard2011-03-201-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Avoid unused variable warning in gcc 4.6Michael Brown2011-03-161-2/+2
| | | | | | Reported-by: Ralph Giles <giles@thaumas.net> Tested-by: Ralph Giles <giles@thaumas.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Make driver PCI ID a property of the PCI deviceMichael Brown2011-02-171-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Exit poll() as early as possible if no work to doMichael Brown2010-11-121-4/+4
| | | | | Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Replace driver with native iPXE driverAndrei Faur2010-08-011-1230/+1774
| | | | | | | | | | | | | | | | | This patch adds a native iPXE forcedeth driver and removes the legacy Etherboot forcedeth driver. It supports 40 different chips, compared to the original 14. It has been tested on a NIC with an CK804 Ethernet Controller, and the results of downloading 5 100mb images in a row have been: 12/11/11/11/11 seconds; booting DSL using pxelinux also succeeded. The driver has also been tested by chaining undionly.kpxe and it worked. Signed-off-by: Andrei Faur <da3drus@gmail.com> Tested-by: Andrei Faur <da3drus@gmail.com> Tested-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-2/+2
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Add support for 10de:054c nforce 630a, MCP 67Thomas Horsten2010-01-141-0/+2
| | | | | | Tested-by: Boudhayan Gupta <bg13.ina@gmail.com> Signed-off-by: Thomas Horsten <thomas@horsten.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* [ethernet] Update mii.h and use it in drivers that had a private copyDaniel Verkamp2009-05-261-31/+4Star
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [forcedeth] Add support for newer forcedeth NICsThomas Miletich2009-03-261-7/+34
| | | | | | | Also adds the MAC_ADDR_CORRECT flag, to indicate whether or not the MAC address needs to be fixed up by the driver. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pci] Add driver_data field to struct pci_device_idThomas Miletich2009-03-261-12/+12
| | | | | Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [makefile] Add -Wformat-nonliteral as an extra warning categoryMichael Brown2008-10-101-1/+1
| | | | | | | | | | | -Wformat-nonliteral is not enabled by -Wall and needs to be explicitly specified. Modified the few files that use nonliteral format strings to work with this new setting in place. Inspired by a patch from Carl Karsten <carl@personnelware.com> and an identical patch from Rorschach <r0rschach@lavabit.com>.
* [forcedeth] Add support for PCI ID 10de:0373Andrew Schran2008-07-101-0/+4
|
* Modify gPXE core and drivers to work with the new timer subsystemAlexey Zaytsev2008-03-021-1/+0Star
| | | | Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
* Remove *_fill_nic() calls, and directly set nic->ioaddr and nic->irqno .Marty Connor2007-12-131-1/+10
| | | | | | | | | | This needs to be done manually because if the irq() routine is implemented then we want something like "nic->irqno = pci->irqno;", else we do "nic->irqno = 0;" nic->ioaddr may also need to be set carefully. Also added local variables to end of many files, for emacs indentation to match kernel style (tab does 8 space indent).
* Add "name" field to struct device to allow human-readable hardware deviceMichael Brown2007-01-101-5/+5
| | | | | | | | | | | names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
* eth_ntoa and warnings fixupsMarty Connor2006-09-251-1/+3
|
* Restructured PCI subsystem to fit the new device model.Michael Brown2006-05-161-6/+6
| | | | | | | | | | | | | | Generic PCI code now handles 64-bit BARs correctly when setting "membase"; drivers should need to call pci_bar_start() only if they want to use BARs other than the first memory or I/O BAR. Split rarely-used PCI functions out into pciextra.c. Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4). 284 bytes of this saving comes from the pci/pciextra split. Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to match the names used in Linux).
* Header rearrangement.Michael Brown2006-04-241-1/+1
| | | | | | | | | I want to get to the point where any header in include/ reflects a standard user-level header (e.g. a POSIX header), while everything that's specific to gPXE lives in include/gpxe/. Headers that reflect a Linux header (e.g. if_ether.h) should also be in include/gpxe/, with the same name as the Linux header and, preferably, the same names used for the definitions.
* Synced across updates from Etherboot 5.4 treeMichael Brown2005-05-191-206/+605
|
* Symbol fixupsMichael Brown2005-05-031-23/+13Star
|
* Automatically updated withMichael Brown2005-04-261-2/+1Star
| | | | perl -pi -0777 -e 's/^static struct \w+_driver (\w+) =\s*(\w+_DRIVER \()/${2} ${1},/msg' *.c
* Coerced into compilingMichael Brown2005-04-221-5/+3Star
|
* Automatically updated with the programMichael Brown2005-04-211-5/+7
| | | | | | | | | | | | | | | | | | | | | | #!/usr/bin/perl -w -pi -0777 use strict; ( my $type ) = /find_(\w+?)_boot_device/ or die "Could not find type\n"; ( my $disable ) = /\.disable\s*=\s*(\w+)/ or die "Could not locate disable\n"; s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*\{)(\s*)/${1}, struct ${type}_device \*${type} __unused${2}${3}nic_disable ( nic );${3}/s; s/(${disable}\s*\(\s*struct\s+nic\s+\*nic)(\s*\)\s*;)/${1}, struct ${type}_device \*${type}${2}/g; s/^\s*.disable\s*=\s*${disable}\s*,\s*?$//m; s/(_probe\s*\(\s*)struct\s+dev\s+\*dev/${1}struct nic \*nic/g; s/^\s*struct\s+nic\s+\*nic\s*=\s*nic_device\s*\(\s*dev\s*\)\s*;\s*?$//m; s/^(\s*)(nic->(ioaddr|irqno)\s*=\s*${type})/${1}${type}_fill_nic ( nic, ${type} );\n${1}${2}/m;
* Automatically modified byMichael Brown2005-04-141-4/+1Star
| | | | perl -pi -0777 -e 's/\s*?if\s*\(\s*!\s*find_pci_device.*?,\s*\&(\w+)\s*\)\s*\)\s*return\s*0;(.*BOOT_DRIVER\s*\(.*?,)(.*?\))/$2 find_pci_boot_device, $1,$3/sm' *.c
* Automatically updated usingMichael Brown2005-04-141-2/+1Star
| | | | | | perl -pi -0777 -e 's/(_probe\s*\(\s*struct\s+dev.*?)(\s*\)\s*{.*?$)\s*struct pci_device.*?=\s*pci_device \( dev \);$/${1}, struct pci_device *pci${2}/ms' *.c sis900 excluded from update
* Finished by handMichael Brown2005-04-131-22/+24
|
* Automatically updated usingMichael Brown2005-04-131-4/+8
| | | | perl -pi -0777 -e 's/^(\s*)dev->disable(\s*)=\s*(\w+)_disable;\s*nic->poll\s*=\s*(\w+);\s*nic->transmit\s*=\s*(\w+);\s*nic->irq\s*=\s*(\w+);/static struct nic_operations ${3}_operations;\nstatic struct nic_operations ${3}_operations = {\n\t.connect\t= dummy_connect,\n\t.poll\t\t= $4,\n\t.transmit\t= $5,\n\t.irq\t\t= $6,\n\t.disable\t= ${3}_disable,\n};${1}nic->nic_op\t= &${3}_operations;/msg' *.c
* Automatically updated usingMichael Brown2005-04-131-2/+1Star
| | | | | | perl -pi -0777 -e 's/_disable\s*\(\s*struct dev \*dev\s*\)\s*{\s*struct nic \*nic.*?$/_disable ( struct nic *nic ) {/ms' *.c perl -pi -0777 -e 's/_disable\s*\(\s*struct dev \*dev(\s*__unused)?\)\s*{/_disable ( struct nic *nic$1 ) {/ms' *.c
* Automatically updated usingMichael Brown2005-04-131-3/+5
| | | | perl -pi -0777 -e 's/_probe\s*\(\s*struct dev \*dev,\s*struct pci_device \*(\w+?)\s*\)\s*{(\s*)struct nic \*nic.*?$/_probe ( struct dev *dev ) {\n${2}struct nic *nic = nic_device ( dev );\n${2}struct pci_device *$1 = pci_device ( dev );/ms' *.c
* Auto-updated usingMichael Brown2005-04-131-8/+4Star
| | | | | | perl -pi -0777 -e 's/static struct pci_driver (\w+) __pci_driver = {.*\.name\s*=\s*(\"\S+\").*\.probe\s*=\s*(\w+).*\.ids\s*=\s*(\w+).*\.class\s*=\s*(\w+).*?};/static struct pci_driver $1 =\n\tPCI_DRIVER ( $2, $4, $5 );\n\nBOOT_DRIVER ( $2, $3 );/ms' *.c perl -pi -e 's/(PCI_DRIVER \(.*, )0 \);/${1}PCI_NO_CLASS );/' *.c
* Initial revisionMichael Brown2005-03-081-0/+1039