summaryrefslogtreecommitdiffstats
path: root/src/net/netdevice.c
Commit message (Collapse)AuthorAgeFilesLines
* [netdevice] Provide function to retrieve the most recently opened net deviceMichael Brown2008-11-211-0/+26
| | | | | | | | | | There are currently four places within the codebase that use a heuristic to guess the "boot network device", with varying degrees of success. Add a feature to the net device core to maintain a list of open network devices, in order of opening, and provide a function last_opened_netdev() to retrieve the most recently opened net device. This should do a better job than the current assortment of guess_boot_netdev() functions.
* [netdevice] Retain and report detailed error breakdownsMichael Brown2008-11-081-4/+42
| | | | | | | | | | netdev_rx_err() and netdev_tx_complete_err() get passed the error code, but currently use it only in debug messages. Retain error numbers and frequencey counts for up to NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX. This allows the "ifstat" command to report the reasons for TX/RX errors in most cases, even in non-debug builds.
* [settings] Add the notion of a "tag magic" to numbered settingsMichael Brown2008-10-301-1/+1
| | | | | | | | | | | | | | | | | | | Settings can be constructed using a dotted-decimal notation, to allow for access to unnamed settings. The default interpretation is as a DHCP option number (with encapsulated options represented as "<encapsulating option>.<encapsulated option>". In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to interpret the dotted-decimal notation as referring to non-DHCP options. In this case, it becomes necessary for these contexts to ignore standard DHCP options, otherwise we end up trying to, for example, retrieve the boot filename from SMBIOS. Allow settings blocks to specify a "tag magic". When dotted-decimal notation is used to construct a setting, the tag magic value of the originating settings block will be ORed in to the tag number. Store/fetch methods can then check for the magic number before interpreting arbitrarily-numbered settings.
* [netdevice] Change link-layer push() and pull() methods to take raw typesMichael Brown2008-10-161-6/+8
| | | | | | | | | | EFI requires us to be able to specify the source address for individual transmitted packets, and to be able to extract the destination address on received packets. Take advantage of this to rationalise the push() and pull() methods so that push() takes a (dest,source,proto) tuple and pull() returns a (dest,source,proto) tuple.
* [undi] Fill in ProtType correctly in PXENV_UNDI_ISRMichael Brown2008-08-201-2/+26
| | | | | | | | | Determine the network-layer packet type and fill it in for UNDI clients. This is required by some NBPs such as emBoot's winBoot/i. This change requires refactoring the link-layer portions of the gPXE netdevice API, so that it becomes possible to strip the link-layer header without passing the packet up the network stack.
* [Settings] Use a settings applicator to configure IPv4 routes.Michael Brown2008-03-211-3/+4
|
* [Settings] Add per-netdevice settings blockMichael Brown2008-03-201-0/+14
| | | | | | | | | Add a configuration settings block for each net device. This will provide the parent scope for settings applicable only to that network device (e.g. non-volatile options stored on the NIC, options obtained via DHCP, etc.). Expose the MAC address as a setting.
* Force a netdevice poll in net_tx() before attempting to transmitMichael Brown2007-10-041-0/+8
| | | | | packet, to work around the problem whereby small TX rings get backed up because we haven't yet poll()ed for TX completions.
* Minor debug message improvement.Michael Brown2007-09-211-2/+3
|
* Use net_device_operations structure and netdev_nullify() to allow forMichael Brown2007-07-071-14/+19
| | | | | | | | | | | 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.
* convert to zallocHolger Lubitz2007-07-061-2/+1Star
|
* Allow recording of TX and RX errors to aid in end-user debugging.Michael Brown2007-07-051-16/+48
|
* Use a linker-table based system to automatically mark and start upMichael Brown2007-07-031-8/+1Star
| | | | | permanent processes, rather than requiring each one to have its own initialisation function.
* Implemented (untested) PXENV_START_UNDI.Michael Brown2007-07-031-4/+6
|
* Add trivial net device statistics (TX and RX packet count), reportedMichael Brown2007-07-031-0/+9
| | | | via UNDI API and also by ifstat command; may be useful for debugging.
* Kill off hotplug.h and just make net devices normal reference-countedMichael Brown2007-06-271-25/+49
| | | | | | structures. DHCP still broken and #if 0'd out.
* Modify process semantics; rescheduling is now automatic.Michael Brown2007-05-261-5/+2Star
| | | | | | Add reference-counting to processes. Add timer_running() test.
* pkbuff->iobuf changeoverMichael Brown2007-05-191-47/+47
| | | | | | | | 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;'
* Updated ISAPnP, EISA, MCA and ISA buses to current device model.Michael Brown2007-03-101-1/+1
| | | | | | | ISA 3c509 is currently non-functional, although the EISA (3c509-eisa) and MCA (3c529) variants should build OK. None of this code is yet tested.
* Use stdio.h instead of vsprintf.hMichael Brown2007-01-191-1/+1
|
* Use total free memory as advertised window. This seems to be sufficientMichael Brown2007-01-181-2/+7
| | | | to avoid drops even on slow NICs.
* Remove the one-packet-per-poll-cycle limit; it seems to no longer beMichael Brown2007-01-181-24/+5Star
| | | | needed now that performance is up.
* Switch from calloc() to malloc()+memset() to match the practices usedMichael Brown2007-01-181-1/+4
| | | | almost everywhere else.
* I hate NULL pointer dereferences.Michael Brown2007-01-111-0/+4
|
* Add find_pci_netdev()Michael Brown2007-01-101-0/+18
|
* Add "name" field to struct device to allow human-readable hardware deviceMichael Brown2007-01-101-4/+8
| | | | | | | | | | | names. Add "dev" pointer in struct net_device to tie network interfaces back to a hardware device. Force natural alignment of data types in __table() macros. This seems to prevent gcc from taking the unilateral decision to occasionally increase their alignment (which screws up the table packing).
* Added network interface management commandsMichael Brown2007-01-101-21/+1Star
|
* Add "name" field to network device, to facilitate netdev commands.Michael Brown2007-01-101-4/+28
|
* Add RX quotas to the net device poll() method. This avoids the problemMichael Brown2007-01-091-13/+27
| | | | | | of alloc_pkb() exhaustion when e.g. an iSCSI-booted DOS session is left idle for a long time at the C:\ prompt and builds up a huge packet backlog.
* Added net device TX queue; this will be needed to support the PXE UNDI APIMichael Brown2007-01-091-50/+101
| | | | | | (which will need us to wait for TX completions). Added debug autocolourisation to netdevice.c
* Make open() and close() an official part of the netdevice API.Michael Brown2007-01-041-5/+61
| | | | Call netdevice's poll() and transmit() methods only when device is open.
* Use hotplug support to notify persistent reference holders when aMichael Brown2007-01-041-0/+4
| | | | net_device is unregistered.
* Use stdlib.h for malloc() instead of malloc.h.Michael Brown2006-12-201-1/+1
|
* We don't actually have a stdio.h header file. Our printf() functions areMichael Brown2006-09-271-1/+0Star
| | | | | | | | defined in vsprintf.h. (This may change, since vsprintf.h is a non-standard name, but for now it's the one to use.) There should be no need to include vsprintf.h just for DBG() statements, since include/compiler.h forces it in for a debug build anyway.
* added stdio.h to includes for DBG compilationMarty Connor2006-09-271-0/+1
|
* Clarified packet ownership transfer between a few functions.Michael Brown2006-08-091-3/+5
| | | | | | | | | | | | | Added a large number of missing calls to free_pkb(). In the case of UDP, no received packets were ever freed, which lead to memory exhaustion remarkably quickly once pxelinux started up. In general, any function with _rx() in its name which accepts a pk_buff *must* either call free_pkb() or pass the pkb to another _rx() function (e.g. the next layer up the stack). Since the UDP (and TCP) layers don't pass packet buffers up to the higher-layer protocols (the "applications"), they must free the packet buffer after calling the application's newdata() method.
* Remove the static IP address hack from netdevice.c, and change theMichael Brown2006-07-201-20/+0Star
| | | | default test to the DHCP test.
* Simplify RX data path.Michael Brown2006-06-181-146/+154
| | | | | | | | | | Kill off the static single net device and move to proper dynamic registration (which we need with the new device model). Break the (flawed) assumption that all network-layer protocols can use ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP protocol using ARP_NET_PROTOCOL() and provide a single method for checking the existence of a local network-layer address.
* Simplify TX datapath.Michael Brown2006-06-161-83/+46Star
|
* Avoid causing TX overflow on small TX queues.Michael Brown2006-05-271-3/+9
|
* Move init.h to gpxe/init.h.Michael Brown2006-04-301-5/+3Star
|
* Change semantics of network API so that packet-absorbing calls *always*Michael Brown2006-04-291-33/+76
| | | | | | | | | | | take ownership of the packet, rather than doing so only if they return success. This breaks semantic compatibility with Linux's hard_start_xmit() method, but means that we don't have to worry so much about error cases. Split mechanism of processing received packets (net_rx_process()) out from policy (net_step()), preparatory to putting net_step() in a separate object.
* Network layer now works as a proof of conceptMichael Brown2006-04-281-41/+77
|
* Network API now allows for multiple network devices (although theMichael Brown2006-04-241-86/+171
| | | | | | | | | | | | | implementation allows for only one, and does so without compromising on the efficiency of static allocation). Link-layer protocols are cleanly separated from the device drivers. Network-layer protocols are cleanly separated from individual network devices. Link-layer and network-layer protocols are cleanly separated from each other.
* First sketch of a new net device API.Michael Brown2006-04-191-0/+163