summaryrefslogtreecommitdiffstats
path: root/src/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [prism2] Remove duplicate PCI_ROM() linesMichael Brown2015-04-151-2/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eepro100] Remove duplicate PCI_ROM() lineMichael Brown2015-04-151-1/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Poll for TX completions only when there is an outstanding TX bufferMichael Brown2015-04-141-8/+4Star
| | | | | | | | | At least one NII implementation (in a Microsoft Surface tablet) seems to fail to report the absence (sic) of TX completions properly. Work around this by checking for TX completions only when we expect to see one. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Poll media status only if advertised as supportedMichael Brown2015-04-141-2/+14
| | | | | | | | Some NII implementations will fail the GET_STATUS operation if we request the media status. Fix by doing so only if GET_INIT_INFO reported that media status is supported. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide a dummy data block in nii_initialise()Michael Brown2015-04-141-1/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [virtio] Downgrade per-iobuf debug messages to DBGC2Laszlo Ersek2015-04-101-6/+6
| | | | | Signed-off-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Respect maximum transfer size of the busMichael Brown2015-03-161-0/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smsc75xx] Move RX FIFO overflow message to DBGLVL_EXTRAMichael Brown2015-03-121-1/+2
| | | | | | | | | | | | | | RX FIFO overflow is almost inevitable since the (usable) USB2 bus bandwidth is approximately one quarter of the Ethernet bandwidth. Avoid flooding the console with RX FIFO overflow messages in a standard debug build. With TCP SACK implemented, the RX FIFO overflow no longer causes a catastrophic drop in throughput. Experimentation shows that HTTP downloads now progress at a fairly smooth 250Mbps, which is around the maximum speed attainable for a USB2 NIC. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smsc75xx] Add driver for SMSC/Microchip LAN75xx USB Ethernet NICsMichael Brown2015-03-112-0/+1365
| | | | | | | | | | | | | | | | | | | This driver is functional but any downloads via a TCP-based protocol tend to perform poorly. The 1Gbps Ethernet line rate is substantially higher than the 480Mbps (in practice around 280Mbps) provided by USB2, and the device has only 32kB of internal buffer memory. Our 256kB TCP receive window therefore rapidly overflows the RX FIFO, leading to multiple dropped packets (usually within the same TCP window) and hence a low overall throughput. Reducing the TCP window size so that the RX FIFO does not overflow greatly increases throughput, but is not a general-purpose solution. Further investigation is required to determine how other OSes (e.g. Linux) cope with this scenario. It is possible that implementing TCP SACK would provide some benefit. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mii] Add generic mii_check_link() functionMichael Brown2015-03-101-0/+32
| | | | | | | | | | | | Most devices expose at least the link up/down status via a bit in a MAC register, since the MAC generally already needs to know whether or not the link is up. Some devices (e.g. the SMSC75xx USB NIC) expose this information to software only via the MII registers. Provide a generic mii_check_link() implementation to check the BMSR and report the link status via netdev_link_{up,down}(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense Davicom DM96xx driversMichael Brown2015-03-102-2/+6
| | | | | Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dm96xx] Add driver for Davicom DM96xx USB Ethernet NICsMichael Brown2015-03-092-0/+861
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add PCI ID for I218-LMThomas Miletich2015-03-091-0/+1
| | | | | Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Set the "feature-rx-notify" flag for netfront devicesMichael Brown2015-03-091-0/+8
| | | | | | | | | | | | iPXE already sends RX notifications to the backend when needed, but does not set the "feature-rx-notify" flag. As of XenServer 6.5, this flag is mandatory and omitting it will cause the backend to fail. Fix by setting the "feature-rx-notify" flag, to inform the backend that we will send notifications. Reported-by: Shalom Bhooshi <shalom.bhooshi@citrix.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-052-2/+2
| | | | | | | | | | | Relicense files with kind permission from Stefan Hajnoczi <stefanha@redhat.com> alongside the contributors who have already granted such relicensing permission. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix the REQUIRE_SYMBOL mechanismMichael Brown2015-03-053-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | At some point in the past few years, binutils became more aggressive at removing unused symbols. To function as a symbol requirement, a relocation record must now be in a section marked with @progbits and must not be in a section which gets discarded during the link (either via --gc-sections or via /DISCARD/). Update REQUIRE_SYMBOL() to generate relocation records meeting these criteria. To minimise the impact upon the final binary size, we use existing symbols (specified via the REQUIRING_SYMBOL() macro) as the relocation targets where possible. We use R_386_NONE or R_X86_64_NONE relocation types to prevent any actual unwanted relocation taking place. Where no suitable symbol exists for REQUIRING_SYMBOL() (such as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to generate a one-byte-long symbol to act as the relocation target. If there are versions of binutils for which this approach fails, then the fallback will probably involve killing off REQUEST_SYMBOL(), redefining REQUIRE_SYMBOL() to use the current definition of REQUEST_SYMBOL(), and postprocessing the linked ELF file with something along the lines of "nm -u | wc -l" to check that there are no undefined symbols remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Rewrite unrelicensable portions of pci.hMichael Brown2015-03-038-12/+10Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Remove outdated and mostly-unused pci_ids.h fileMichael Brown2015-03-023-0/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite byte-swapping codeMichael Brown2015-03-021-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0232-32/+116
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Include full licence text for all GPL2_OR_LATER filesMichael Brown2015-02-265-10/+60
| | | | | | | | Add the standard warranty disclaimer and Free Software Foundation address paragraphs to the licence text where these are not currently present. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Use generic USB network device frameworkMichael Brown2015-02-172-235/+58Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ecm] Use generic USB network device frameworkMichael Brown2015-02-172-211/+35Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Use generic refill framework for bulk IN and interrupt endpointsMichael Brown2015-02-162-252/+92Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ecm] Use generic refill framework for bulk IN and interrupt endpointsMichael Brown2015-02-132-133/+40Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ecm] Add support for CDC-ECM USB Ethernet devicesMichael Brown2015-02-102-1/+750
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Allow usb_stream() to enforce a terminating short packetMichael Brown2015-02-101-2/+2
| | | | | | | | | | Some USB endpoints require that a short packet be used to terminate transfers, since they have no other way to determine message boundaries. If the message length happens to be an exact multiple of the USB packet size, then this requires the use of an additional zero-length packet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Reserve headroom in received packetsMichael Brown2015-02-061-1/+11
| | | | | | | | | Some protocols (such as ARP) may modify the received packet and re-use the same I/O buffer for transmission of a reply. To allow this, reserve sufficient headroom at the start of each received packet buffer for our transmit datapath headers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Use large multi-packet buffers by defaultMichael Brown2015-02-062-165/+301
| | | | | | | | | | | | | | | | | | | | | | | | Some devices have a very small number of internal buffers, and rely on being able to pack multiple packets into each buffer. Using 2048-byte buffers on such devices produces throughput of around 100Mbps. Using a small number of much larger buffers (e.g. 32kB) increases the throughput to around 780Mbps. (The full 1Gbps is not reached because the high RTT induced by the use of multi-packet buffers causes us to saturate our 256kB TCP window.) Since allocation of large buffers is very likely to fail, allocate the buffer set only once when the device is opened and recycle buffers immediately after use. Received data is now always copied to per-packet buffers. If allocation of large buffers fails, fall back to allocating a larger number of smaller buffers. This will give reduced performance, but the device will at least still be functional. Share code between the interrupt and bulk IN endpoint handlers, since the buffer handling is now very similar. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Add support for CDC-NCM USB Ethernet devicesMichael Brown2015-02-034-0/+1158
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Assume that VMBus xfer page ranges correspond to RNDIS messagesMichael Brown2014-12-201-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The (undocumented) VMBus protocol seems to allow for transfer page-based packets where the data payload is split into an arbitrary set of ranges within the transfer page set. The RNDIS protocol includes a length field within the header of each message, and it is known from observation that multiple RNDIS messages can be concatenated into a single VMBus message. iPXE currently assumes that the transfer page range boundaries are entirely arbitrary, and uses the RNDIS header length to determine the RNDIS message boundaries. Windows Server 2012 R2 generates an RNDIS_INDICATE_STATUS_MSG for an undocumented and unknown status code (0x40020006) with a malformed RNDIS header length: the length does not cover the StatusBuffer portion of the message. This causes iPXE to report a malformed RNDIS message and to discard any further RNDIS messages within the same VMBus message. The Linux Hyper-V driver assumes that the transfer page range boundaries correspond to RNDIS message boundaries, and so does not notice the malformed length field in the RNDIS header. Match the behaviour of the Linux Hyper-V driver: assume that the transfer page range boundaries correspond to the RNDIS message boundaries and ignore the RNDIS header length. This avoids triggering the "malformed packet" error and also avoids unnecessary data copying: since we now have one I/O buffer per RNDIS message, there is no longer any need to use iob_split(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Increase TX ring sizeMichael Brown2014-12-201-1/+1
| | | | | | | | Empirical observation suggests that 32 is a sensible size to minimise the number of deferred packet transmissions without overflowing the VMBus transmit ring buffer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Receive all VMBus messages in a pollMichael Brown2014-12-201-1/+3
| | | | | | | Allow for elision of transmitted TCP ACKs by handling all received VMBus messages in each network device poll operation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Tear down NetVSC RX buffer GPADL after closing VMBus deviceMichael Brown2014-12-201-24/+20Star
| | | | | | | | | | | | | On Windows Server 2012 R2, the receive buffer teardown completion message seems to occasionally be deferred until after the VMBus channel has been closed. This happens even if there are no packets currently in the receive buffer. Work around this problem by separating the revocation and teardown of the receive buffer, and deferring the teardown until after the VMBus channel has been closed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Add support for NetVSC paravirtual network devicesMichael Brown2014-12-182-0/+1203
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmxnet3] Add profiling code to exclude time spent in the hypervisorMichael Brown2014-12-121-1/+33
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Use autoloaded MAC address instead of EEPROM MAC addressMichael Brown2014-10-311-4/+4
| | | | | | | | | | | | | | | | | | | The i350 (and possibly other Intel NICs) have a non-trivial correspondence between the PCI function number and the external physical port number. For example, the i350 has a "LAN Function Sel" bit within the EEPROM which can invert the mapping so that function 0 becomes port 3, function 1 becomes port 2, etc. Unfortunately the MAC addresses within the EEPROM are indexed by physical port number rather than PCI function number. The end result is that when anything other than the default mapping is used, iPXE will use the wrong address as the base MAC address. Fix by using the autoloaded MAC address if it is valid, and falling back to reading the MAC address directly from the EEPROM only if no autoloaded address is available. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include NII driver within "snp" and "snponly" build targetsMichael Brown2014-10-174-106/+195
| | | | | | | | | End users almost certainly don't care whether the underlying interface is SNP or NII/UNDI. Try to minimise surprise and unnecessary documentation by including the NII driver whenever the SNP driver is requested. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Check for presence of UNDI in NII protocolMichael Brown2014-10-171-0/+6
| | | | | | | | iPXE itself exposes a dummy NII protocol with no UNDI. Avoid potentially dereferencing a NULL pointer by checking for a non-zero UNDI address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add NII / UNDI driverMichael Brown2014-10-161-0/+1134
| | | | | | | | | | | | | | | | | | | | | | | Some UEFI network drivers provide a software UNDI interface which is exposed via the Network Interface Identifier Protocol (NII), rather than providing a Simple Network Protocol (SNP). The UEFI platform firmware will usually include the SnpDxe driver, which attaches to NII and provides an SNP interface. The SNP interface is usually provided on the same handle as the underlying NII device. This causes problems for our EFI driver model: when efi_driver_connect() detaches existing drivers from the handle it will cause the SNP interface to be uninstalled, and so our SNP driver will not be able to attach to the handle. The platform firmware will eventually reattach the SnpDxe driver and may attach us to the SNP handle, but we have no way to prevent other drivers from attaching first. Fix by providing a driver which can attach directly to the NII protocol, using the software UNDI interface to drive the network device. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Generalise snpnet_dev_info() to efi_device_info()Michael Brown2014-10-161-60/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Free transmit ring entry before calling netdev_tx_complete()Michael Brown2014-10-161-1/+3
| | | | | | | | The snpnet driver uses netdev_tx_defer() and so must ensure that space in the (single-entry) transmit descriptor ring is freed up before calling netdev_tx_complete(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add 8086:1557 card (Intel 82599 10G ethernet mezz)Anton D. Kachalov2014-10-031-0/+1
| | | | | Signed-off-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Add I217-LM PCI IDJan Kiszka2014-09-161-1/+2
| | | | | | | Add the ID for the LM variant and differentiate it from the I217-V. Signed-off-by: Jan Kiszka <jan.kiszka@web.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for non-PCI snpnet devicesMichael Brown2014-09-041-7/+8
| | | | | | | | | | | | | We currently require information about the underlying PCI device to populate the snpnet device's name and description. If the underlying device is not a PCI device, this will fail and prevent the device from being registered. Fix by falling back to populating the device description with information based on the EFI handle, if no PCI device information is available. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Use the SNP protocol instance to match the SNP chainloading deviceMichael Brown2014-09-041-8/+89
| | | | | | | | | | | | | | | | Some systems will install a child of the SNP device and use this as our loaded image's device handle, duplicating the installation of the underlying SNP protocol onto the child device handle. On such systems, we want to end up driving the parent device (and disconnecting any other drivers, such as MNP, which may be attached to the parent device). Fix by recording the SNP protocol instance at initialisation time, and using this to match against device handles (rather than simply comparing the handles themselves). Reported-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Apply PBS/PBA errata workaround only to ICH8 PCI device IDsMichael Brown2014-08-212-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICH8 devices have an errata which requires us to reconfigure the packet buffer size (PBS) register, and correspondingly adjust the packet buffer allocation (PBA) register. The "Intel I/O Controller Hub ICH8/9/10 and 82566/82567/82562V Software Developer's Manual" notes for the PBS register that: 10.4.20 Packet Buffer Size - PBS (01008h; R/W) Note: The default setting of this register is 20 KB and is incorrect. This register must be programmed to 16 KB. Initial value: 0014h 0018h (ICH9/ICH10) It is unclear from this comment precisely which devices require the workaround to be applied. We currently attempt to err on the side of caution: if we detect an initial value of either 0x14 or 0x18 then the workaround will be applied. If the workaround is applied unnecessarily, then the effect should be just that we use less than the full amount of the available packet buffer memory. Unfortunately this approach does not play nicely with other device drivers. For example, the Linux e1000e driver will rewrite PBA while assuming that PBS still contains the default value, which can result in inconsistent values between the two registers, and a corresponding inability to transmit or receive packets. Even more unfortunately, the contents of PBS and PBA are not reset by anything less than a power cycle, meaning that this error condition will survive a hardware reset. The Linux driver (written and maintained by Intel) applies the PBS/PBA errata workaround only for devices in the ICH8 family, identified via the PCI device ID. Adopt a similar approach, using the PCI_ROM() driver data field to indicate when the workaround is required. Reported-by: Donald Bindner <dbindner@truman.edu> Debugged-by: Donald Bindner <dbindner@truman.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Display before and after values for both PBS and PBAMichael Brown2014-08-211-2/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [intel] Display PBS value when applying ICH errata workaroundMichael Brown2014-08-201-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smc9000] Avoid using CONFIG as a preprocessor macroMichael Brown2014-08-192-6/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>