summaryrefslogtreecommitdiffstats
path: root/src/drivers
Commit message (Collapse)AuthorAgeFilesLines
...
* [arbel] Minimise the number of VPM mapping operationsMichael Brown2010-09-192-50/+129
| | | | | | | | | Mapping a single page at a time causes a several-second delay at device initialisation time. Reduce this by mapping multiple pages at a time, using the largest block sizes possible given the alignment constraints. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Allocate only as much memory as is needed for firmware and ICMMichael Brown2010-09-181-26/+66
| | | | | | | | Use individual page mappings rather than a single whole-region mapping, to avoid the waste of memory that occurs due to the constraint that each mapped block must be aligned on its own size. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Synchronise changes with the Hermon driverMichael Brown2010-09-172-38/+70
| | | | | | | | | | | | | Backport some changes from the Hermon driver to the Arbel driver. Specifically: o Rename reserved_lkey to lkey o Add arbel_rate() to calculate transmission rates o Structure code to allow for addition of RC queue pairs Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Optimise ICM layout to reduce overall memory usageMichael Brown2010-09-172-75/+136
| | | | | | | | | | Reduce the amount of ICM space required by choosing to order the various allocations in approximately descending order of alignment requirements. This saves approximately 512kB of host memory. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Perform ICM allocations according to the specificationMichael Brown2010-09-172-44/+87
| | | | | | | | | | | The current method for ICM allocation exactly matches the addresses chosen by the old Etherboot driver, but does not match the specification. Some ICM tables (notably the queue pair context table) therefore end up incorrectly aligned. Fix by performing allocations as per the specification. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Allow for multiple calls to ib_modify_qp()Michael Brown2010-09-172-22/+44
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Inform embedded SMA of partition key changesMichael Brown2010-09-171-5/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Improve debugging output and facilitiesMichael Brown2010-09-172-71/+164
| | | | | | | | | | | Improve the utility of debugging messages by including the relevant port number, queue number (QPN, CQN, EQN), work queue entry (WQE) number, and physical addresses wherever applicable. Add arbel_dump_cqctx() for dumping a completion queue context and arbel_dump_qpctx() for dumping a queue pair context. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Randomise the high-order bits of queue pair numbersMichael Brown2010-09-172-6/+10
| | | | | | | This is a backport of commit 0b1222f ("[hermon] Randomise the high-order bits of queue pair numbers") to the Arbel driver. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Allow software GMA to receive packets destined for QP1Michael Brown2010-09-173-96/+336
| | | | | | | | | | This is a backport of commit cd5a213 ("[hermon] Allow software GMA to receive packets destined for QP1") to the Arbel driver. This patch includes a correction to a bug in the autogenerated hardware description header file. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Map all event types to our event queueMichael Brown2010-09-172-5/+21
| | | | | | | | | | | | | Only port state change events are currently mapped to our event queue, since those are the only events we are prepared to handle. This ignores a potentially useful source of diagnostic information in the case of unexpected failures. Fix by mapping all events to the event queue; a build with debugging enabled will therefore at least dump the raw content of the unexpected events. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Map all event types to our event queueMichael Brown2010-09-162-5/+21
| | | | | | | | | | | | | Only port state change events are currently mapped to our event queue, since those are the only events we are prepared to handle. This ignores a potentially useful source of diagnostic information in the case of unexpected failures. Fix by mapping all events to the event queue; a build with debugging enabled will therefore at least dump the raw content of the unexpected events. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add node GUID as distinct from the first port GUIDMichael Brown2010-09-162-1/+5
| | | | | | | | | | | | | | | iPXE currently uses the first port's port GUID as the node GUID, rather than using the (possibly distinct) real node GUID. This can confuse opensm during the handover to a loaded OS: it thinks the port already belongs to a different node and so discards our port information with a warning message about duplicate ports. Everything is picked up correctly on the second subnet sweep, after opensm has established that the "old" node no longer exists, but this can delay link-up unnecessarily by several seconds. Fix by using the real node GUID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Poll for link state changes while DOWNMichael Brown2010-09-161-0/+9
| | | | | | | No event is generated upon reaching INIT, so we must poll separately for link state changes while we remain DOWN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Poll for link state changes while DOWNMichael Brown2010-09-161-0/+9
| | | | | | | No event is generated upon reaching INIT, so we must poll separately for link state changes while we remain DOWN. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Always call ib_link_state_changed() in ib_smc_update()Michael Brown2010-09-162-12/+5Star
| | | | | | | | | | | | | | ib_smc_update() potentially updates the Infiniband port state, and so should almost always be followed by a call to ib_link_state_changed(). The one exception is the call made to ib_smc_update() before the device is registered. Fix by removing explicit calls to ib_link_state_changed() from drivers using ib_smc_update(), including a call to ib_link_state_changed() within ib_smc_update(), and creating a separate ib_smc_init() for use prior to device registration. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Include sense key within error number reported to userMichael Brown2010-09-151-1/+62
| | | | | | | The sense key gives a first idea of what the problem might be, and so is potentially useful in diagnosing problems in a non-debug build. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Match GID/GUID terminology as used in the IBAMichael Brown2010-09-155-57/+52Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [e1000] Strip the Ethernet CRC from received packetsMichael Brown2010-09-151-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Replace gPXE block-device API with an iPXE asynchronous interfaceMichael Brown2010-09-145-717/+2242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block device interface used in gPXE predates the invention of even the old gPXE data-transfer interface, let alone the current iPXE generic asynchronous interface mechanism. Bring this old code up to date, with the following benefits: o Block device commands can be cancelled by the requestor. The INT 13 layer uses this to provide a global timeout on all INT 13 calls, with the result that an unexpected passive failure mode (such as an iSCSI target ACKing the request but never sending a response) will lead to a timeout that gets reported back to the INT 13 user, rather than simply freezing the system. o INT 13,00 (reset drive) is now able to reset the underlying block device. INT 13 users, such as DOS, that use INT 13,00 as a method for error recovery now have a chance of recovering. o All block device commands are tagged, with a numerical tag that will show up in debugging output and in packet captures; this will allow easier interpretation of bug reports that include both sources of information. o The extremely ugly hacks used to generate the boot firmware tables have been eradicated and replaced with a generic acpi_describe() method (exploiting the ability of iPXE interfaces to pass through methods to an underlying interface). The ACPI tables are now built in a shared data block within .bss16, rather than each requiring dedicated space in .data16. o The architecture-independent concept of a SAN device has been exposed to the iPXE core through the sanboot API, which provides calls to hook, unhook, boot, and describe SAN devices. This allows for much more flexible usage patterns (such as hooking an empty SAN device and then running an OS installer via TFTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Use correct alignment for doorbell recordsMichael Brown2010-09-122-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | Doorbell records are currently embedded within the completion queue and receive work queue strucures, which are allocated using zalloc() and so have an alignment guarantee of only sizeof(void*), i.e. four bytes. This is sufficient for the receive work queue, but not for the completion queue, which requires an alignment guarantee of eight bytes. Though not guaranteed, it so happens that zalloc() will always return a pointer that is exactly four bytes above a sixteen-byte boundary. The completion queue doorbell record is therefore always misaligned, and the value passed to the hardware via SW2HW_CQ is actually always pointing to the page_offset value within the MTT descriptor (which directly precedes the inline doorbell record). Provided that the page offset is greater than 0x100, this looks to the hardware like an update_ci value of greater than 0x010000 (taking into account endianness differences), and so the hardware will happily deliver more than 0x010000 completions before stopping. Hence this problem is rarely observable. Fix by allocating the doorbell records separately and using the correct alignment constraints. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Set event queue number for completion queuesMichael Brown2010-09-121-0/+1
| | | | | | | | Give completion queues a chance to deliver exception events by programming in the number of our event queue (currently used only for port state changes). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Improve debugging output and facilitiesMichael Brown2010-09-122-91/+180
| | | | | | | | | | | Improve the utility of debugging messages by including the relevant port number, queue number (QPN, CQN, EQN), work queue entry (WQE) number, and physical addresses wherever applicable. Add hermon_dump_cqctx() for dumping a completion queue context, and hermon_fill_nop_send_wqe() for inserting NOPs into send work queues. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rtl8139] Check for oversized packets when transmittingMichael Brown2010-09-051-0/+8
| | | | | | | | | | | | | | | | An attempt to transmit a packet of 8192 bytes or larger will collide with the status bits in the TX descriptor. This gives the appearance of the network card's transmit data path having just suddenly stopped responding; iPXE is waiting for the card to report a TX completion but, because of the status bit collision, the card thinks that the descriptor has not yet been written. Fix by explicitly checking for oversized packets in rtl_transmit(). Discovered during Fibre Channel over Ethernet testing, and debugged by using gdb to examine the state of the emulated rtl8139 card in qemu. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [infiniband] Add the concept of an Infiniband upper-layer driverMichael Brown2010-09-051-38/+46
| | | | | | | | | Replace the explicit calls from the Infiniband core to the IPoIB layer with the general concept of an Infiniband upper-layer driver (analogous to a PCI driver) which can create arbitrary devices on top of Infiniband devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Call netdev_link_[up|down|err]() only while registeredMichael Brown2010-09-0519-51/+47Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sis190] Initialise network device before calling register_netdev()Michael Brown2010-09-051-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rtl8139] Strip CRC from received packetsMichael Brown2010-09-031-0/+1
| | | | | | | | | | The rtl8139 driver includes the Ethernet CRC within the received packet. All current protocols ignore trailing garbage, but FCoE requires the frame length to be correct (since the FCoE footer position is calculated from the end of the packet), so fix the driver to strip out the CRC. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eepro100] Add new PCI ID 8086:27dcMarty Connor2010-09-031-0/+1
| | | | | | | | | Add PCI ID 8086:27dc to the eepro100 driver. Reported-by: Cédric Delmas <c.delmas@akka.eu> Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add the tap driverPiotr Jaroszyński2010-08-191-0/+249
| | | | | | | | | Add the tap driver that can be used like: $ ./ipxe.linux --net tap,if=tap0,mac=00:0c:29:c5:39:a1 The if setting is mandatory. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add device and driver modelPiotr Jaroszyński2010-08-191-0/+152
| | | | | | | | | Add the base to build linux drivers and the linux UI code on. UI fills device requests, which are later walked over by the linux root_driver and delegated to specific linux drivers. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mtnic] Switch to malloc_dma() and free_dma()Piotr Jaroszyński2010-08-171-29/+29
| | | | | | | alloc_memblock() and free_memblock() are internal. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Move get_memmap() to the I/O API groupPiotr Jaroszyński2010-08-161-1/+2
| | | | | | | | | pcbios specific get_memmap() is used by the b44 driver making all-drivers builds fail on other platforms. Move it to the I/O API group and provide a dummy implementation on EFI. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [forcedeth] Replace driver with native iPXE driverAndrei Faur2010-08-012-1230/+2375
| | | | | | | | | | | | | | | | | 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>
* [virtio] Replace virtio-net with native iPXE driverStefan Hajnoczi2010-07-172-234/+341
| | | | | | | | | | | | | | | | | | | | | | This patch adds a native iPXE virtio-net driver and removes the legacy Etherboot virtio-net driver. The main reasons for doing this are: 1. Multiple virtio-net NICs are now supported by iPXE. The legacy driver kept global state and caused issues in virtual machines with more than one virtio-net device. 2. Faster downloads. The native iPXE driver downloads 100 MB over HTTP in 12s, the legacy Etherboot driver in 37s. This simple benchmark uses KVM with tap networking and the Python SimpleHTTPServer both running on the same host. Changes to core virtio code reduce vring descriptors to 256 (QEMU uses 128 for virtio-blk and 256 for virtio-net) and change the opaque token from u16 to void*. Lowering the descriptor count reduces memory consumption. The void* opaque token change makes driver code simpler. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [davicom] Use iPXE debugging infrastructureMichael Brown2010-07-141-25/+6Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tulip] Use iPXE debugging infrastructureMichael Brown2010-07-141-209/+79Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcnet32] Fix pcnet32_wio_reset() bugAndrei Faur2010-07-111-1/+1
| | | | | | | | This bug caused .probe to fail because the NIC did not reset properly. Signed-off-by: Andrei Faur <da3drus@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcnet32] Fix uninitialised variableMichael Brown2010-06-251-1/+1
| | | | | Reported-by: Geoff Lywood <glywood@vmware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [myri10ge] Add NonVolatile Option (nvo) supportGlenn Brown2010-06-251-11/+314
| | | | | | | | | | | | | | | Add NonVolatile Option (nvo) and NonVolatile Storage (nvs) support to the myri10ge driver using the EEPROM read/write mechanism provided by the NIC's Vendor Specific PCI capability. The myri10ge NIC is capabile of storing 64KB or more of nonvolatile options, but this patch advertises only 512 bytes of nvo storage because iPXE malloc's a buffer matching the total size we advertise. 512 is plenty without wasting malloc'd memory. (The 2 other drivers currently supporting nvo advertise 256 bytes or less.) Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [r8169] Remove driver cfg lookup, use pci_device_id->driver_data insteadAndrei Faur2010-06-232-66/+11Star
| | | | | | | | | This patch removes the cfg lookup made in the r8169 driver and replaces it with equivalent information found in the driver_data field of the pci_device_id structure. Signed-off-by: Andrei Faur <da3drus@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [interface] Convert all data-xfer interfaces to generic interfacesMichael Brown2010-06-221-32/+14Star
| | | | | | | | | | | | | | Remove data-xfer as an interface type, and replace data-xfer interfaces with generic interfaces supporting the data-xfer methods. Filter interfaces (as used by the TLS layer) are handled using the generic pass-through interface capability. A side-effect of this is that deliver_raw() no longer exists as a data-xfer method. (In practice this doesn't lose any efficiency, since there are no instances within the current codebase where xfer_deliver_raw() is used to pass data to an interface supporting the deliver_raw() method.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [refcnt] Add ref_init() wrapper functionMichael Brown2010-06-221-0/+1
| | | | | | | Standardise on using ref_init() to initialise an embedded reference count, to match the coding style used by other embedded objects. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcnet32] Replace pcnet32 with native driverAndrei Faur2010-06-222-822/+1143
| | | | | | | | | This patch replaces the old pcnet32 driver with a new one that uses iPXE's API. Signed-off-by: Andrei Faur <da3drus@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [jme] Fix 64-bit compile of JMicron ethernet driverGeoff Lywood2010-06-221-1/+1
| | | | | Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [jme] Fix refill behaviorGuo-Fu Tseng2010-06-131-7/+13
| | | | | | | | | | | After changing the driver to refill after feed, if any error occurs a non-contiguous empty buffer will be introduced in the ring due to my reuse-buffer-when-error implementation. Reported-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Move Ethernet MAC address checking routines to ethernet.hMichael Brown2010-06-072-16/+1Star
| | | | | Originally-fixed-by: Faur Andrei <da3drus@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eepro100] Add PCI ID for Intel Pro/100 VEErwan Velu2010-06-071-0/+1
| | | | | | Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [jme] Add JMicron Ethernet driverGuo-Fu Tseng2010-06-022-0/+2217
| | | | | | | | | | | A new driver for JMicron Ethernet controller. Reviewed-by: Joshua Oreman <oremanj@rwcr.net> Reviewed-by: Michael Brown <mbrown@fensystems.co.uk> Reviewed-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add the "snpnet" driverGeoff Lywood2010-06-024-0/+575
| | | | | | | | | Add a new network driver that consumes the EFI Simple Network Protocol. Also add a bus driver that can find the Simple Network Protocol that iPXE was loaded from; the resulting behavior is similar to the "undionly" driver for BIOS systems. Signed-off-by: Michael Brown <mcb30@ipxe.org>