|
iPXE
|
Network device tests. More...
#include <string.h>#include <stdio.h>#include <ipxe/netdevice.h>#include <ipxe/ethernet.h>#include <ipxe/test.h>#include "netdev_test.h"Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| static int | testnet_open (struct net_device *netdev __unused) |
| Open network device. More... | |
| static void | testnet_close (struct net_device *netdev __unused) |
| Close network device. More... | |
| static int | testnet_transmit (struct net_device *netdev, struct io_buffer *iobuf) |
| Transmit packet. More... | |
| static void | testnet_poll (struct net_device *netdev __unused) |
| Poll for completed and received packets. More... | |
| void | testnet_okx (struct testnet *testnet, const char *file, unsigned int line) |
| Report a network device creation test result. More... | |
| void | testnet_open_okx (struct testnet *testnet, const char *file, unsigned int line) |
| Report a network device opening test result. More... | |
| void | testnet_set_okx (struct testnet *testnet, const char *name, const char *value, const char *file, unsigned int line) |
| Report a network device setting test result. More... | |
| void | testnet_close_okx (struct testnet *testnet, const char *file, unsigned int line) |
| Report a network device closing test result. More... | |
| void | testnet_remove_okx (struct testnet *testnet, const char *file, unsigned int line) |
| Report a network device removal test result. More... | |
Variables | |
| static struct net_device_operations | testnet_operations |
| Test network device operations. More... | |
Network device tests.
Definition in file netdev_test.c.
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Open network device.
| netdev | Network device |
| rc | Return status code |
Definition at line 48 of file netdev_test.c.
|
static |
|
static |
Transmit packet.
| netdev | Network device |
| iobuf | I/O buffer |
| rc | Return status code |
Definition at line 71 of file netdev_test.c.
References netdev, and netdev_tx_complete().
|
static |
Poll for completed and received packets.
| netdev | Network device |
Definition at line 84 of file netdev_test.c.
| void testnet_okx | ( | struct testnet * | testnet, |
| const char * | file, | ||
| unsigned int | line | ||
| ) |
Report a network device creation test result.
| testnet | Test network device |
| file | Test code file |
| line | Test code line |
Definition at line 104 of file netdev_test.c.
References alloc_etherdev(), testnet::count, testnet::dev, net_device::dev, testnet_setting::name, device::name, net_device::name, testnet::netdev, netdev_init(), NULL, okx, register_netdev(), snprintf(), testnet_open_okx(), testnet_operations, testnet_set_okx(), testnet::testset, and testnet_setting::value.
| void testnet_open_okx | ( | struct testnet * | testnet, |
| const char * | file, | ||
| unsigned int | line | ||
| ) |
Report a network device opening test result.
| testnet | Test network device |
| file | Test code file |
| line | Test code line |
Definition at line 138 of file netdev_test.c.
References testnet::netdev, netdev_open(), NULL, and okx.
Referenced by testnet_okx().
| void testnet_set_okx | ( | struct testnet * | testnet, |
| const char * | name, | ||
| const char * | value, | ||
| const char * | file, | ||
| unsigned int | line | ||
| ) |
Report a network device setting test result.
| testnet | Test network device |
| name | Setting name (relative to network device's settings) |
| value | Setting value |
| file | Test code file |
| line | Test code line |
Definition at line 157 of file netdev_test.c.
References autovivify_child_settings(), testnet::dev, device::name, settings::name, name, testnet::netdev, netdev_settings(), NULL, okx, parse_setting_name(), snprintf(), storef_setting(), strchr(), strcmp(), strlen(), and value.
Referenced by testnet_okx().
| void testnet_close_okx | ( | struct testnet * | testnet, |
| const char * | file, | ||
| unsigned int | line | ||
| ) |
Report a network device closing test result.
| testnet | Test network device |
| file | Test code file |
| line | Test code line |
Definition at line 190 of file netdev_test.c.
References testnet::netdev, netdev_close(), NULL, and okx.
| void testnet_remove_okx | ( | struct testnet * | testnet, |
| const char * | file, | ||
| unsigned int | line | ||
| ) |
Report a network device removal test result.
| testnet | Test network device |
| file | Test code file |
| line | Test code line |
Definition at line 207 of file netdev_test.c.
References testnet::netdev, netdev_nullify(), netdev_put(), NULL, okx, and unregister_netdev().
|
static |
Test network device operations.
Definition at line 90 of file netdev_test.c.
Referenced by testnet_okx().
1.8.15