aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/linux
Commit message (Collapse)AuthorAgeFilesLines
* [linux] Set a default MAC address for tap devicesMichael Brown2023-07-051-0/+5
| | | | | | | | Avoid the need to always specify a local MAC address on the command line by setting a default hardware MAC address (using the same default address as for slirp devices). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Fix error control flow in af_packet_nic_probe()Michael Brown2023-07-051-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Fix error control flow in tap_probe()Michael Brown2023-07-051-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Allow arbitrary settings to be applied to Linux devicesMichael Brown2021-03-021-13/+37
| | | | | | | | | | | | | | Allow arbitrary settings to be specified on the Linux command line. For example: ./bin-x86_64-linux/slirp.linux \ --net slirp,testserver=qa-test.ipxe.org This can be useful when using the Linux userspace build to test embedded scripts, since it allows arbitrary parameters to be passed directly on the command line. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [slirp] Add libslirp driver for LinuxMichael Brown2021-03-021-0/+552
| | | | | | | | | | | | | | | | | | | Add a driver using libslirp to provide a virtual network interface without requiring root permissions on the host. This simplifies the process of running iPXE as a Linux userspace application with network access. For example: make bin-x86_64-linux/slirp.linux ./bin-x86_64-linux/slirp.linux --net slirp libslirp will provide a built-in emulated DHCP server and NAT router. Settings such as the boot filename may be controlled via command-line options. For example: ./bin-x86_64-linux/slirp.linux \ --net slirp,filename=http://192.168.0.1/boot.ipxe Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Use host glibc system call wrappersMichael Brown2021-02-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | When building as a Linux userspace application, iPXE currently implements its own system calls to the host kernel rather than relying on the host's C library. The output binary is statically linked and has no external dependencies. This matches the general philosophy of other platforms on which iPXE runs, since there are no external libraries available on either BIOS or UEFI bare metal. However, it would be useful for the Linux userspace application to be able to link against host libraries such as libslirp. Modify the build process to perform a two-stage link: first picking out the requested objects in the usual way from blib.a but with relocations left present, then linking again with a helper object to create a standard hosted application. The helper object provides the standard main() entry point and wrappers for the Linux system calls required by the iPXE Linux drivers and interface code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Impose receive quota on tap driverMichael Brown2017-09-041-1/+4
| | | | | | | | | | The tap driver can retrieve a potentially unlimited number of packets in a single poll. This can lead to heap exhaustion under heavy load. Fix by imposing an artificial receive quota (as already used in other drivers without natural receive limits). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Fix building with kernel 4.11 headersMichael Brown2017-03-292-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [af_packet] Add new AF_PACKET driver for LinuxDavid Decotigny2017-01-221-0/+325
| | | | | | | | | | | | This code largely inspired by tap.c. Allows for testing iPXE on real NICs from within Linux. For example: make bin-x86_64-linux/af_packet.linux valgrind ./bin-x86_64-linux/af_packet.linux --net af_packet,if=eth3 Tested as x86_64 and i386 binary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Apply MAC address prior to registering network deviceMichael Brown2013-09-031-5/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Give tap devices a name and bus typeMichael Brown2013-08-271-0/+3
| | | | | | | | Give tap devices a meaningful name, and avoid segmentation faults when attempting to retrieve ${net0/bustype} by assigning a new bus type for tap devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [device] Make driver name a generic device propertyMichael Brown2011-04-071-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Call netdev_link_[up|down|err]() only while registeredMichael Brown2010-09-051-2/+2
| | | | 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>