summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/drivers/net/undinet.c
Commit message (Collapse)AuthorAgeFilesLines
* [bios] Add bin-x86_64-pcbios build platformMichael Brown2016-02-161-820/+0Star
| | | | | | | | | | | | | | Move most arch/i386 files to arch/x86, and adjust the contents of the Makefiles and the include/bits/*.h headers to reflect the new locations. This patch makes no substantive code changes, as can be seen using a rename-aware diff (e.g. "git show -M5"). This patch does not make the pcbios platform functional for x86_64; it merely allows it to compile without errors. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Use intptr_t when casting .text16 function pointersMichael Brown2016-02-161-4/+2Star
| | | | 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>
* [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-201-1/+2
| | | | | 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] 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-231-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>
* [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>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-5/+5
| | | | | | | | | | | 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>
* [pxe] Separate parent PXE API caller from UNDINET driverJoshua Oreman2010-01-201-214/+47Star
| | | | | | | | | 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-181-0/+2
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [build] Enable building with the Intel C compiler (icc)Michael Brown2009-03-261-3/+2Star
|
* [pxeprefix] Add .kkpxe image type and ability to return via PXE stackMichael Brown2009-02-181-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* [iobuf] Add iob_disown() and use it where it simplifies codeMichael Brown2009-02-011-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | 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-191-1/+1
| | | | | | 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().
* [i386] Change semantics of __from_data16 and __from_text16Michael Brown2008-07-011-9/+6Star
| | | | | | | | | __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.
* Fix compiler warnings that appear only on OpenBSD.Michael Brown2007-12-061-1/+1
|
* Don't rely on retry.c's periodically calling currticks() in order toMichael Brown2007-07-291-1/+7
| | | | allow the UNDI NIC interrupt to happen.
* Move uninitialised .data16 variables to .bss16; saves around 2000Michael Brown2007-07-161-2/+2
| | | | bytes of useless zeroes in the final image.
* Kill off the enforced RX quota; it only seems to hurt on real hardware.Michael Brown2007-07-141-3/+1Star
|
* Improve error reporting for strange length combinations reported byMichael Brown2007-07-101-6/+21
| | | | | | | | | the UNDI stack. Ignore obviously invalid length combinations (as returned by e.g. VMWare's PXE stack). Limit to one packet per poll to avoid memory exhaustion.
* Report RX errors via netdev_rx_err()Michael Brown2007-07-101-1/+2
|
* Protect ISR against failure to unhook.Michael Brown2007-07-101-34/+15Star
|
* Working code to call the PXE stack from within the ISR.Michael Brown2007-07-101-19/+22
|
* Use net_device_operations structure and netdev_nullify() to allow forMichael Brown2007-07-071-10/+28
| | | | | | | | | | | safe dropping of the netdev ref by the driver while other refs still exist. Add netdev_irq() method. Net device open()/close() methods should no longer enable or disable IRQs. Remove rx_quota; it wasn't used anywhere and added too much complexity to implementing correct interrupt-masking behaviour in pxe_undi.c.
* Work around Etherboot 5.4 bug when multiple packets are received.Michael Brown2007-07-031-1/+38
|
* It's not just Etherboot that fails to generate TX completions.Michael Brown2007-07-031-2/+2
|
* Document TX completion bug.Michael Brown2007-07-031-0/+10
|
* Use a common base-memory packet buffer for DHCP construction (as usedMichael Brown2007-07-021-11/+5Star
| | | | by PXE and NBI) and UNDI packets (as used by undinet and UNDI).
* Kill off hotplug.h and just make net devices normal reference-countedMichael Brown2007-06-271-2/+2
| | | | | | structures. DHCP still broken and #if 0'd out.
* pkbuff->iobuf changeoverMichael Brown2007-05-191-27/+27
| | | | | | | | Achieved via Perl using: perl -pi -e 's/pk_buff/io_buffer/g; s/Packet buffer/I\/O buffer/ig; ' \ -e 's/pkbuff\.h/iobuf.h/g; s/pkb_/iob_/g; s/_pkb/_iob/g; ' \ -e 's/pkb/iobuf/g; s/PKB/IOB/g;'
* Don't call PXENV_STOP_UNDI in the kpxeprefix. This slighy breaks theMichael Brown2007-01-291-9/+14
| | | | | clean separation between loading and starting, but does mean that more PXE stacks survive the process.
* Add some trace messages for important eventsMichael Brown2007-01-131-0/+6
|
* Pick up the return status code from the correct place now that weMichael Brown2007-01-131-2/+1Star
| | | | don't overwrite the parameter block until *after* the debug code.
* When an UNDI API call fails, print everything there is to know about it.Michael Brown2007-01-131-3/+20
|
* Always send EOI. We can't feasibly share interrupts (since we have noMichael Brown2007-01-131-4/+12
| | | | | | clue what the "previous" interrupt handler will do, which could range from "just an iret" to "disable the interrupt"), and that means that we have to take responsibility for ACKing all interrupts. Joy.