summaryrefslogtreecommitdiffstats
path: root/src/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [realtek] Use ID word to detect EEPROM presenceMichael Brown2013-04-282-16/+42
| | | | | | | | | | | | | | | | | Some onboard RTL8169 NICs seem to leave the EEPROM pins disconnected. The existing is_valid_ether_addr() test will not necessarily catch this, since it expects a missing EEPROM to show up as a MAC address of 00:00:00:00:00:00 or ff:ff:ff:ff:ff:ff. When the EEPROM pins are floating the MAC address may read as e.g. 00:00:00:00:0f:00, which will not be detected as invalid. Check the ID word in the first two bytes of the EEPROM (which should have the value 0x8129 for all RTL8139 and RTL8169 chips), and use this to determine whether or not an EEPROM is present. Reported-by: Carl Karsten <carl@nextdayvideo.com> Tested-by: Carl Karsten <carl@nextdayvideo.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix dubious uses of bitwise operatorsMichael Brown2013-04-281-1/+1
| | | | | | Detected by sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix uses of literal 0 as a NULL pointerMichael Brown2013-04-2810-19/+15Star
| | | | | | Detected using sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Print bad MAC address in debug message when inferring no EEPROMMichael Brown2013-04-271-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Perform meaningful error code conversionsMichael Brown2013-04-191-38/+45
| | | | | | | | Exploit the redefinition of iPXE error codes to include a "platform error code" to allow for meaningful conversion of EFI_STATUS values to iPXE errors and vice versa. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add intelx driver for Intel 10 Gigabit Ethernet NICsMichael Brown2013-04-192-0/+579
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Expose functionality to be shared with intelx driverMichael Brown2013-04-192-15/+33
| | | | | | | | The Intel 10 Gigabit NICs have a datapath that is almost register-compatible with the Intel 1 Gigabit NICs. Expose common functionality to avoid duplication of code in the new "intelx" driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Remove hardcoded offsets for descriptor ring registersMichael Brown2013-04-192-18/+6Star
| | | | | | | | | | | | | | The Intel 10 Gigabit NICs use the same simplified (aka "legacy") descriptor format and the same layout for descriptor register blocks as the Intel 1 Gigabit NICs. The offsets of the descriptor register blocks are not the same. Simplify reuse of the existing code by removing all hardcoded offsets for registers within descriptor register blocks, and ensuring that all offsets are calculated using the descriptor register block base address provided via intel_init_ring(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prism2] Use standard type namesMichael Brown2013-03-274-1383/+1361Star
| | | | | | | | | | | Avoid using UINT16 and similar typedefs, which are non-standard in the iPXE codebase and generate conflicts when trying to include any of the EFI headers. Also fix trailing whitespace in the affected files, to prevent complaints from git. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [igbvf] Remove conflicting macro definitionsMichael Brown2013-03-251-3/+0Star
| | | | | | | Remove macros which aren't used anywhere in the driver, and which conflict with macros of the same name used in the EFI headers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cs89x0] Remove conflicting macro definitionsMichael Brown2013-03-251-3/+0Star
| | | | | | | Remove macros which aren't used anywhere in the driver, and which conflict with macros of the same name used in the EFI headers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix various tg3 issuesKevin Tran2013-03-042-1/+15
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add Intel I210 Gigabit Ethernet PCI IDJens Rottmann2013-02-201-0/+1
| | | | | Signed-off-by: Jens Rottmann <JRottmann@LiPPERTembedded.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [src] Fix spelling in comments, debug messages and local variable namesStefan Weil2013-01-0328-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [forcedeth] Increase TX ring size to prevent dropped packetsMichael Brown2012-10-291-1/+1
| | | | | | | | | | | Commit 947976d ("[netdevice] Do not force a poll on net_tx()") requires network devices to have TX rings that are sufficiently large to allow a transmitted response to all packets received during a single poll. Reported-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Poll RX queue if hardware reports RX overflowMichael Brown2012-10-281-1/+1
| | | | | | | | | | | | | | | The Intel NIC emulation in some versions of VMware seems to suffer from a flaw whereby the Interrupt Cause Register (ICR) fails to assert the usual "packet received" bit (ICR.RXT0) if a receive overflow (ICR.RXO) has also occurred. Work around this flaw by polling for completed descriptors whenever either ICR.RXT0 or ICR.RXO is asserted. Reported-by: Miroslav Halas <miroslav.halas@bankofamerica.com> Debugged-by: Miroslav Halas <miroslav.halas@bankofamerica.com> Tested-by: Miroslav Halas <miroslav.halas@bankofamerica.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Report receive overruns via network device errorsMichael Brown2012-10-242-1/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipoib] Expose Ethernet-compatible eIPoIB link-layer addresses and headersMichael Brown2012-08-311-260/+375
| | | | | | | | | | | | | Almost all clients of the raw-packet interfaces (UNDI and SNP) can handle only Ethernet link layers. Expose an Ethernet-compatible link layer to local clients, while remaining compatible with IPoIB on the wire. This requires manipulation of ARP (but not DHCP) packets within the IPoIB driver. This is ugly, but it's the only viable way to allow IPoIB devices to be driven via the raw-packet interfaces. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Include destination address vector in ib_complete_recv()Michael Brown2012-08-311-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Use explicit "source" and "dest" address vector parameter namesMichael Brown2012-08-311-16/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Allow queue pairs to have a custom allocator for receive iobufsMichael Brown2012-08-311-3/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Force EEPROM CS low before disabling EEPROM access modeMichael Brown2012-08-242-3/+32
| | | | | | | | | | | | | Some RTL8169 cards seem to drive the EEPROM CS line high (i.e. active) when 9346CR.EEM is set to "normal operating mode", with the result that the CS line is never deasserted. The symptom of this is that the first read from the EEPROM will work, while all subsequent reads will return garbage data. Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Debugged-by: Thomas Miletich <thomas.miletich@gmail.com> Tested-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Forcibly enable advertisement of 1000Mbps speedsMichael Brown2012-08-231-7/+72
| | | | | | | | | | | Some RTL8169 cards (observed with an RTL8169SC) power up advertising only 100Mbps, despite being capable of 1000Mbps. Forcibly enable advertisement of 1000Mbps on any RTL8169-like card. This change relies on the assumption that the CTRL1000 register will not exist on 100Mbps-only RTL8169 cards such as the RTL8101. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mii] Add separate mii_restart() functionMichael Brown2012-08-231-4/+32
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Enable DAC only when built as a 64-bit binaryMichael Brown2012-08-231-2/+7
| | | | | | | | | | | | | | | | | Some RTL8169 cards (observed with an RTL8169SC) crash and burn if DAC is enabled, even if only 32-bit addresses are used. Observed behaviour includes system lockups and repeated transmission of garbage data onto the wire. This seems to be a known problem. The Linux r8169 driver disables DAC by default and provides a "use_dac" module parameter. There appears to be no known test for determining whether or not DAC will work. As a workaround, enable DAC only if we are built as as 64-bit binary. This at least eliminates the problem in the common case of a 32-bit build, which will never use 64-bit addresses anyway. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Use read-modify-write to check for C+ Command registerMichael Brown2012-08-231-3/+4
| | | | | | | Some bits in the C+ Command register are always one. Testing for the presence of the register must allow for this. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Use explicit value for TCR.MXDMAMichael Brown2012-08-232-0/+13
| | | | | | | | | | Some RTL8169 cards (observed with an RTL8169SC) power up with TCR.MXDMA set to 16 bytes. While this does not prevent proper operation, it almost certainly degrades performance. Fix by explicitly setting TCR.MXDMA to "unlimited". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Use explicit values for RCR.RXFTH and RCR.MXDMAMichael Brown2012-08-232-2/+10
| | | | | | | | Some RTL8169 cards (observed with an RTL8169SC) power up with invalid values in RCR.RXFTH and RCR.MXDMA, causing receive DMA to fail. Fix by setting explicit values for both fields. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Always set high dword of ring address registersMichael Brown2012-08-231-4/+2Star
| | | | | | | | | | Some RTL8169 cards (observed with an RTL8169SC) power up with garbage values in the ring address registers, and do not clear the registers on reset. Fix by always setting the high dword of the ring address registers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix driver for BCM5719, BCM5720, BCM5764M, BCM57762Kevin Tran2012-08-204-19/+29
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tg3] Fix excessive DMA alignment.Thomas Miletich2012-07-241-2/+1Star
| | | | | | | | | Change the DMA alignment from 4096 bytes to 16 bytes, to conserve available DMA memory. The hardware doesn't have any specific alignment requirements. Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [epic100] Fix wrong field used as rx packet lengthAlexey2012-07-231-2/+2
| | | | | | | | | | | | Datasheet pp. 41-42 defines 'rx packet length' as upper word of 'status' dword field of the receive descriptor table. http://www.smsc.com/media/Downloads_Archive/discontinued/83c171.pdf Tested on SMC EtherPower II. Signed-off-by: Alexey Smazhenko <darkover@corbina.com.ua> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-2032-34/+64
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [skel] Add missing iounmap()Michael Brown2012-07-191-0/+2
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [myson] Add missing iounmap()Michael Brown2012-07-191-0/+2
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [natsemi] Add missing iounmap()Michael Brown2012-07-191-0/+2
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Add missing iounmap()Michael Brown2012-07-191-0/+2
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add missing iounmap()Michael Brown2012-07-191-0/+2
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [b44] Eliminate call to get_memmap()Michael Brown2012-07-171-26/+31
| | | | | | get_memmap() is not available under all runtime environments. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Explicitly enable descriptor queuesMichael Brown2012-07-102-0/+10
| | | | | | | | | | | | | On i350 the datasheet contradicts itself in stating that the default value of RXDCTL.ENABLE for queue zero is both set (according to the "Receive Initialization" section) and unset (according to the "Receive Descriptor Control - RXDCTL" section). Empirical evidence suggests that the default value is unset. Explicitly enable both transmit and receive queues to avoid any ambiguity. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Refill receive ring only after enabling receiverMichael Brown2012-07-101-3/+3
| | | | | | | | | | | | | | On 82576 (and probably others), the datasheet states that "the tail register of the queue (RDT[n]) should not be bumped until the queue is enabled". There is some confusion over exactly what constitutes "enabled": the initialisation blurb says that we should "poll the RXDCTL register until the ENABLE bit is set", while the description for the RXDCTL register says that the ENABLE bit is set by default (for queue zero). Empirical evidence suggests that the ENABLE bit reads as set immediately after writing to RCTL.EN, and so polling is not necessary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Add missing cpu_to_le16()Michael Brown2012-06-271-1/+1
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sky2] Fix invalid memory accessValentine Barshak2012-06-271-1/+1
| | | | | | | Use hw pointer in PCI driver data as expected by sky2_remove(). Signed-off-by: Valentine Barshak <gvaxon@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Support RTL8139 cards within generic Realtek driverMichael Brown2012-04-283-649/+400Star
| | | | | | | | | | | | | | | | RTL8139C+ cards use essentially the same datapath as RTL8169, which is zerocopy and 64-bit capable. Older RTL8139 cards use a single receive ring buffer rather than a descriptor ring, but still share substantial amounts of functionality with RTL8169. Include support for RTL8139 cards within the generic Realtek driver, since there is no way to differentiate between RTL8139 and RTL8139C+ cards based on the PCI IDs alone. Many thanks to all the people who worked on the rtl8139 driver over the years. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [myson] Replace driver for Myson Technology NICsMichael Brown2012-04-273-1022/+868Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [natsemi] Fix test for addresses below 4GBMichael Brown2012-04-271-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [natsemi] Replace driver for National Semicondutor NICsMichael Brown2012-04-263-1682/+1095Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Replace driver for Intel Gigabit NICsMichael Brown2012-04-2464-47324/+1198Star
| | | | | | Tested-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [realtek] Update link state when device is openedMichael Brown2012-04-231-0/+3
| | | | | | | | | | | | | The link state is currently set at probe time, and updated only when the device is polled. This results in the user seeing a misleading stale "Link: down" message, if autonegotiation did not complete within the short timespan of the probe routine. Fix by updating the link state when the device is opened, so that the message that ends up being displayed to the user reflects the real link state at device open time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [skel] Add skeleton network driverMichael Brown2012-04-212-0/+331
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>