47#define LINK_WAIT_TIMEOUT ( 15 * TICKS_PER_SEC )
50#define EADDRNOTAVAIL_CONFIG __einfo_error ( EINFO_EADDRNOTAVAIL_CONFIG )
51#define EINFO_EADDRNOTAVAIL_CONFIG \
52 __einfo_uniqify ( EINFO_EADDRNOTAVAIL, 0x01, \
53 "No configuration methods succeeded" )
70 printf (
"Could not open %s: %s\n",
97 for ( i = 0 ; i < (
sizeof ( stats->
errors ) /
98 sizeof ( stats->
errors[0] ) ) ; i++ ) {
112 printf (
"%s: %s using %s on %s (%s) [%s]\n"
113 " [Link:%s%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
116 netdev->ll_protocol->name,
123 printf (
" [Link status: %s]\n",
202 int ongoing_rc =
netdev->link_rc;
205 if ( ongoing_rc == 0 )
287 printf (
"Could not configure %s via %s: %s\n",
294 printf (
"Could not configure %s: %s\n",
301 printf (
"Configuring %s%s%s(%s %s)",
#define NULL
NULL pointer (VOID *)
struct arbelprm_rc_send_wqe rc
#define __einfo_errortab(einfo)
static struct net_device * netdev
#define __unused
Declare a variable or data structure as unused.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
int ifopen(struct net_device *netdev)
Open network device.
int ifconf(struct net_device *netdev, struct net_device_configurator *configurator, unsigned long timeout)
Perform network device configuration.
static struct interface_operation ifpoller_job_op[]
Network device poller operations.
#define LINK_WAIT_TIMEOUT
Default time to wait for link-up.
void ifclose(struct net_device *netdev)
Close network device.
static void ifstat_errors(struct net_device_stats *stats, const char *prefix)
Print network device error breakdown.
static int ifpoller_progress(struct ifpoller *ifpoller, struct job_progress *progress __unused)
Report network device poller progress.
#define EADDRNOTAVAIL_CONFIG
Default unsuccessful configuration status code.
static int ifconf_progress(struct ifpoller *ifpoller)
Check configuration progress.
static int ifpoller_wait(struct net_device *netdev, struct net_device_configurator *configurator, unsigned long timeout, int(*progress)(struct ifpoller *ifpoller))
Poll network device until completion.
int iflinkwait(struct net_device *netdev, unsigned long timeout, int verbose)
Wait for link-up, with status indication.
void ifstat(struct net_device *netdev)
Print status of network device.
static int iflinkwait_progress(struct ifpoller *ifpoller)
Check link-up progress.
static struct interface_descriptor ifpoller_job_desc
Network device poller descriptor.
#define EINFO_EADDRNOTAVAIL_CONFIG
Network interface management.
void intf_close(struct interface *intf, int rc)
Close an object interface.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
#define INTF_INIT(descriptor)
Initialise a static object interface.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
int netdev_configure_all(struct net_device *netdev)
Start network device configuration via all supported configurators.
int netdev_configuration_ok(struct net_device *netdev)
Check if network device has at least one successful configuration.
int netdev_open(struct net_device *netdev)
Open network device.
void netdev_close(struct net_device *netdev)
Close network device.
int netdev_configure(struct net_device *netdev, struct net_device_configurator *configurator)
Start network device configuration.
void netdev_poll(struct net_device *netdev)
Poll for completed and received packets on network device.
int netdev_configuration_in_progress(struct net_device *netdev)
Check if network device configuration is in progress.
Network device management.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static const char * netdev_addr(struct net_device *netdev)
Get printable network device link-layer address.
static struct net_device_configuration * netdev_configuration(struct net_device *netdev, struct net_device_configurator *configurator)
Get network device configuration.
char * strerror(int errno)
Retrieve string representation of error number.
struct interface job
Job control interface.
struct net_device_configurator * configurator
Network device configurator (if applicable)
struct net_device * netdev
Network device.
int(* progress)(struct ifpoller *ifpoller)
Check progress.
An object interface descriptor.
An object interface operation.
A network device configuration.
int rc
Configuration status.
struct net_device_configurator * configurator
Network device configurator.
A network device configurator.
unsigned int count
Error count.
Network device statistics.
struct net_device_error errors[NETDEV_MAX_UNIQUE_ERRORS]
Error breakdowns.
int printf(const char *fmt,...)
Write a formatted string to the console.