aboutsummaryrefslogtreecommitdiffstats
path: root/src/arch/i386/drivers
Commit message (Collapse)AuthorAgeFilesLines
* [pci] Provide PCI_CLASS() to calculate a scalar PCI class valueMichael Brown2015-05-081-1/+1
| | | | | | | | Rename PCI_CLASS() (which constructs a struct pci_class_id) to PCI_CLASS_ID(), and provide PCI_CLASS() as a macro which constructs the 24-bit scalar value of a PCI class code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-051-1/+5
| | | | | | | | | | | 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>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-022-2/+10
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Allow drivers to specify a PCI classMichael Brown2015-02-021-5/+2
| | | | | | | | Allow drivers to specify a supported PCI class code. To save space in the final binary, make this an attribute of the driver rather than an attribute of a PCI device ID list entry. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Apply quota only to number of complete received packetsMichael Brown2014-05-141-4/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Place an upper limit on the number of PXENV_UNDI_ISR calls per pollMichael Brown2014-05-031-1/+5
| | | | | | | | | PXENV_UNDI_ISR calls may implicitly refill the underlying receive ring, and so could continue to retrieve packets indefinitely. Place an upper limit on the number of calls to PXENV_UNDI_ISR per call to undinet_poll(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Do not switch to real mode to check for NIC interruptMichael Brown2014-05-031-4/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Report any PXENV_UNDI_ISR errors via netdev_rx_err()Michael Brown2014-05-031-1/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Profile transmit and receive datapathsMichael Brown2014-05-031-1/+33
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Work around bug in gcc >= 4.8Michael Brown2013-09-251-3/+5
| | | | | | | | | | | | | Commit 238050d ("[build] Work around bug in gcc >= 4.8") works around one instance of a bug in recent versions of gcc, in which "ebp" cannot be specified within an asm clobber list. Some versions of gcc seem to exhibit the same bug on other points in the codebase. Fix by changing all instances of "ebp" in a clobber list to use the push/pop %ebp workaround instead. Originally-implemented-by: Víctor Román Archidona <contacto@victor-roman.es> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Convert external PXE API errors into iPXE platform-generated errorsMichael Brown2013-04-291-3/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Work around specific devices with known broken interrupt behaviourMichael Brown2013-03-051-0/+52
| | | | | | | | | | | | | | | | Some PXE stacks are known to claim that IRQs are supported, but then never generate interrupts. No satisfactory solution has been found to this problem; the workaround is to add the PCI vendor and device IDs to a list of devices which will be treated as simply not supporting interrupts. This is something of a hack, since it will generate false positives for identical devices with a working PXE stack (e.g. those that have been reflashed with iPXE), but it's an improvement on the current situation. Reported-by: Richard Moore <rich@richud.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-206-6/+12
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Align the received frame payload for faster processingMichael Brown2012-06-291-8/+16
| | | | | | | | The undinet driver always has to make a copy of the received frame into an I/O buffer. Align this copy sensibly so that subsequent operations are as fast as possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Allow underlying PXE stack to construct link-layer headerMichael Brown2012-03-021-2/+47
| | | | | | | | | | | | | | Some PXE stacks (observed with a QLogic 8242) will always try to prepend a link-layer header, even if the caller uses P_UNKNOWN to indicate that the link-layer header has already been filled in. This results in an invalid packet being transmitted. Work around these faulty PXE stacks where possible by stripping the existing link-layer header and allowing the PXE stack to (re)construct the link-layer header itself. Originally-fixed-by: Buck Huppmann <buckh@pobox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Retry PXENV_UNDI_INITIALIZE multiple timesMichael Brown2011-12-081-8/+30
| | | | | | | | | | | | | | | | On at least one PXE stack (Realtek r8169), PXENV_UNDI_INITIALIZE has been observed to fail intermittently due to a media test failure (PXE error 0x00000061). Retrying the call to PXENV_UNDI_INITIALIZE succeeds, and the NIC is then usable. It is worth noting that this particular Realtek PXE stack is already known to be unreliable: for example, it repeatably fails its own boot-time media test after every warm reboot. Fix by attempting PXENV_UNDI_INITIALIZE multiple times, with a short delay between each attempt to allow the link to settle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Ensure that native drivers are tried before the UNDI PCI driverMichael Brown2011-11-111-1/+1
| | | | | Suggested-by: Alessandro Salvatori <sandr8@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Use meaningful driver and device namesMichael Brown2011-10-281-2/+10
| | | | | | | | | Specify a driver name of "undionly" and a device name based on the UNDI-reported underlying hardware device. For example: net0: 52:54:00:12:34:56 using undionly on UNDI-PCI00:03.0 (open) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Use current (rather than permanent) link-layer addressMichael Brown2011-10-281-0/+1
| | | | | Requested-by: Savitha Hiriyannaia <Savitha.Hiriyannaiah@emulex.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Assume that interrupts are not supported if IRQ=0Michael Brown2011-04-221-1/+3
| | | | | | | | | Some PXE stacks (notably old Etherboot/gPXE stacks) will claim to use the timer interrupt, rather than reporting that interrupts are not supported. Since using the timer interrupt is equivalent to polling anyway, we may as well genuinely poll these stacks. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Cope with devices that erroneously claim not to use interruptsMichael Brown2011-03-231-21/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some PXE stacks advertise that interrupts are not supported, despite requiring the use of interrupts. Attempt to cope with such cards without breaking others by always hooking the interrupt, and using the "interrupts supported" flag only to decide whether or not to wait for an interrupt before calling PXENV_UNDI_ISR_IN_PROCESS. The possible combinations are therefore: 1. Card generates interrupts and claims to support interrupts iPXE will call PXENV_UNDI_ISR_IN_PROCESS only after an interrupt has been observed. (This is required to avoid lockups in some PXE stacks, which spuriously sulk if called before an interrupt has been generated.) Such a card should work correctly. 2. Card does not generate interrupts and does not claim to support interrupts iPXE will call PXENV_UNDI_ISR_IN_PROCESS indiscriminately, matching the observed behaviour of at least one other PXE NBP (winBoot/i). Such a card should work correctly. 3. Card generates interrupts but claims not to support interrupts iPXE will call PXENV_UNDI_ISR_IN_PROCESS indiscriminately. An interrupt will still result in a call to PXENV_UNDI_ISR_IN_START. Such a card may work correctly. 4. Card does not generate interrupts but claims to support interrupts Such a card will not work at all. Reported-by: Jerry Cheng <jaspers.cheng@msa.hinet.net> Tested-by: Jerry Cheng <jaspers.cheng@msa.hinet.net> Reported-by: Mauricio Silveira <mauricio@livreti.com.br> Tested-by: Mauricio Silveira <mauricio@livreti.com.br> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Make driver PCI ID a property of the PCI deviceMichael Brown2011-02-171-2/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Use single "busdevfn" field in struct pci_deviceMichael Brown2011-02-171-3/+4
| | | | | | | Merge the "bus" and "devfn" fields into a single "busdevfn" field, to match the format used by the majority of external code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [init] Remove concept of "shutdown exit flags"Michael Brown2011-01-271-3/+3
| | | | | | | | Remove the concept of shutdown exit flags, and replace it with a counter used to keep track of exposed interfaces that require devices to remain active. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Support underlying UNDI devices that don't support interruptsMichael Brown2010-11-191-17/+31
| | | | | | | | | | | | | | Some network cards do not generate interrupts when operated via the UNDI API. Allow for this by waiting for the ISR to be triggered only if the PXE stack advertises that it supports interrupts. When the PXE stack does not advertise interrupt support, we skip the call to PXENV_UNDI_ISR_IN_START and just poll the device using PXENV_UNDI_ISR_IN_PROCESS. This matches the observed behaviour of at least one other PXE NBP (emBoot's winBoot/i), so there is a reasonable chance of this working. Originally-implemented-by: Muralidhar Appalla <Muralidhar.Appalla@emulex.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Call netdev_link_[up|down|err]() only while registeredMichael Brown2010-09-051-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Use libflat to enable A20 line on each real-to-protected transitionMichael Brown2010-04-201-10/+0
| | | | | | | | | | | | | Use the shared code in libflat to perform the A20 transitions automatically on each transition from real to protected mode. This allows us to remove all explicit calls to gateA20_set(). The old warnings about avoiding automatically enabling A20 are essentially redundant; they date back to the time when we would always start hammering the keyboard controller without first checking to see if gate A20 was already enabled (which it almost always is). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-194-9/+9
| | | | | | | | | | | 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>
* [undi] Ensure only one UNDI instance is loadedStefan Hajnoczi2010-02-241-0/+12
| | | | | | | | | | | | | | | | | | Loading multiple UNDI instances would be useful in systems that have several network cards with vendor PXE ROMs. However, we cannot rely on UNDI ROMs working correctly with multiple instances loaded simultaneously. The gPXE UNDI driver supports the following multi-NIC configurations: 1. Chainloading undionly.kpxe on a specific NIC. 2. Loading the UNDI driver for the first probed device and ignoring all other UNDI devices in the system. This patch refuses to probe additional UNDI devices so there can never be multiple instances of UNDI loaded. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [pxe] Separate parent PXE API caller from UNDINET driverJoshua Oreman2010-01-202-216/+49
| | | | | | | | | Calling the parent PXE stack (the stack that loaded us, for undionly.kkpxe) can be useful for more than UNDI calls; for instance, it lets us get cached DHCP packets to avoid re-DHCP when working with embedded images. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [netdevice] Separate out the concept of hardware and link-layer addressesMichael Brown2009-08-121-2/+2
| | | | | | | | | | | The hardware address is an intrinsic property of the hardware, while the link-layer address can be changed at runtime. This separation is exposed via APIs such as PXE and EFI, but is currently elided by gPXE. Expose the hardware and link-layer addresses as separate properties within a net device. Drivers should now fill in hw_addr, which will be used to initialise ll_addr at the time of calling register_netdev().
* [undi] Include PXENV_GET_IFACE_INFO's ServiceFlags in debug outputMichael Brown2009-06-231-2/+3
|
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-187-0/+14
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [pci] Add driver_data field to struct pci_device_idThomas Miletich2009-03-261-1/+1
| | | | | Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [build] Enable building with the Intel C compiler (icc)Michael Brown2009-03-262-6/+4
|
* [pxeprefix] Add .kkpxe image type and ability to return via PXE stackMichael Brown2009-02-182-22/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain combinations of PXE stack and BIOS result in a broken INT 18 call, which will leave the system displaying a "PRESS ANY KEY TO REBOOT" message instead of proceeding to the next boot device. On these systems, returning via the PXE stack is the only way to continue to the next boot device. Returning via the PXE stack works only if we haven't already blown away the PXE base code in pxeprefix.S. In most circumstances, we do want to blow away the PXE base code. Base memory is a limited resource, and it is desirable to reclaim as much as possible. When we perform an iSCSI boot, we need to place the iBFT above the 512kB mark, because otherwise it may not be detected by the loaded OS; this may not be possible if the PXE base code is still occupying that memory. Introduce a new prefix type .kkpxe which will preserve both the PXE base code and the UNDI driver (as compared to .kpxe, which preserves the UNDI driver but uninstalls the PXE base code). This prefix type can be used on systems that are known to experience the specific problem of INT 18 being broken, or in builds (such as gpxelinux.0) for which it is particularly important to know that returning to the BIOS will work. Written by H. Peter Anvin <hpa@zytor.com> and Stefan Hajnoczi <stefanha@gmail.com>, minor structural alterations by Michael Brown <mcb30@etherboot.org>.
* [i386] Add explicit flags and type on all .section declarationsMichael Brown2009-02-151-4/+2
| | | | | | | | | | | | | | | | | | | | | | | Try to avoid future problems caused by implicit section flags and/or type information by instituting a policy that all .section declarations must explicitly state the flags and type. Most of this change was achieved using perl -pi \ -e 's/".text"$/".text", "ax", \@progbits/ ; ' \ -e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \ -e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \ -e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \ -e 's/".data"$/".data", "aw", \@progbits/ ; ' \ -e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \ -e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \ -e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \ -e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \ -e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \ -e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \ -e 's/".weak"$/".weak", "a", \@nobits/ ; ' \ `git grep -l '\.section'`
* [iobuf] Add iob_disown() and use it where it simplifies codeMichael Brown2009-02-011-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | There are many functions that take ownership of the I/O buffer they are passed as a parameter. The caller should not retain a pointer to the I/O buffer. Use iob_disown() to automatically nullify the caller's pointer, e.g.: xfer_deliver_iob ( xfer, iob_disown ( iobuf ) ); This will ensure that iobuf is set to NULL for any code after the call to xfer_deliver_iob(). iob_disown() is currently used only in places where it simplifies the code, by avoiding an extra line explicitly setting the I/O buffer pointer to NULL. It should ideally be used with each call to any function that takes ownership of an I/O buffer. (The SSA optimisations will ensure that use of iob_disown() gets optimised away in cases where the caller makes no further use of the I/O buffer pointer anyway.) If gcc ever introduces an __attribute__((free)), indicating that use of a function argument after a function call should generate a warning, then we should use this to identify all applicable function call sites, and add iob_disown() as necessary.
* [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] longMichael Brown2008-11-192-3/+3
| | | | | | This brings us in to line with Linux definitions, and also simplifies adding x86_64 support since both platforms have 2-byte shorts, 4-byte ints and 8-byte long longs.
* [uaccess] Formalise the uaccess APIMichael Brown2008-10-131-0/+1
| | | | | | The userptr_t is now the fundamental type that gets used for conversions. For example, virt_to_phys() is implemented in terms of virt_to_user() and user_to_phys().
* [timer] Formalise the timer APIMichael Brown2008-10-122-126/+0
| | | | | | We now have two implementations for the timer API: one using the time-of-day counter at 40:70 and one using RDTSC. Both make use of timer2_udelay().
* [ioapi] Remove old io.h file and switch all users over to <gpxe/io.h>Michael Brown2008-10-121-1/+1
|
* [undi] Scan for UNDI ROMs on 512-byte boundaries rather than 2kB boundariesMichael Brown2008-09-121-2/+2
| | | | | | | | | Apparently some BIOSes will place option ROMs on 512-byte boundaries. While this is against specification, it doesn't actually hurt anything, so we may as well increase our scan granularity to 512 bytes. Contributed by Luca <lucarx76@gmail.com>
* [i386] Change semantics of __from_data16 and __from_text16Michael Brown2008-06-302-11/+8
| | | | | | | | | __from_data16 and __from_text16 now take a pointer to a .data16/.text16 variable, and return the real-mode offset within the appropriate segment. This matches the use case for every occurrence of these macros, and prevents potential future bugs such as that fixed in commit d51d80f. (The bug arose essentially because "&pointer" is still syntactically valid.)
* [undi] Ask for promiscuous packet reception when using UNDI driverMichael Brown2008-06-101-2/+6
| | | | | | We never set up specific multicast filters; native drivers will ask the card to receive all multicast packets. The only way to achieve this via the UNDI API is to enable promiscuous mode.
* [NETDEV] Add notion of link stateMichael Brown2008-04-221-0/+3
| | | | | | | | | | | Add ability for network devices to flag link up/down state to the networking core. Autobooting code will now wait for link-up before attempting DHCP. IPoIB reflects the Infiniband link state as the network device link state (which is not strictly correct; we also need a succesful IPoIB IPv4 broadcast group join), but is probably more informative.
* Use plain C in timer_rdtsc for division instead of inline asssembly.Alexey Zaytsev2008-03-061-43/+21
| | | | | | This also fixes a bug in rdtsc_currticks when the result did not fix in %eax Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
* fix the rdtsc namimgAlexey Zaytsev2008-03-021-7/+7
|
* CleanupsAlexey Zaytsev2008-03-021-2/+3
| | | | | | | | Replace a printf with a DBG in timer_rtdsc.c Replace a printf in timer.c with assert Return proper error codes from timer drivers Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
* Introduce the new timer subsystem.Alexey Zaytsev2008-03-022-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | Timer subsystem initialization code in core/timer.c Split the BIOS and RTDSC timer drivers from i386_timer.c Split arch/i386/firmware/pcbios/bios.c into the RTSDC timer driver and arch/i386/core/nap.c Split the headers properly: include/unistd.h - delay functions to be used by the gPXE core and drivers. include/gpxe/timer.h - the fimer subsystem interface to be used by the timer drivers and currticks() to be used by the code gPXE subsystems. include/latch.h - removed include/timer.h - scheduled for removal. Some driver are using currticks, which is only for core subsystems. Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>