46 #define LINK_WAIT_TIMEOUT ( 15 * TICKS_PER_SEC ) 49 #define EADDRNOTAVAIL_CONFIG __einfo_error ( EINFO_EADDRNOTAVAIL_CONFIG ) 50 #define EINFO_EADDRNOTAVAIL_CONFIG \ 51 __einfo_uniqify ( EINFO_EADDRNOTAVAIL, 0x01, \ 52 "No configuration methods succeeded" ) 69 printf (
"Could not open %s: %s\n",
96 for ( i = 0 ; i < (
sizeof ( stats->
errors ) /
97 sizeof ( stats->
errors[0] ) ) ; i++ ) {
111 printf (
"%s: %s using %s on %s (%s) [%s]\n" 112 " [Link:%s%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
122 printf (
" [Link status: %s]\n",
204 if ( ongoing_rc == 0 )
286 printf (
"Could not configure %s via %s: %s\n",
293 printf (
"Could not configure %s: %s\n",
300 printf (
"Configuring %s%s%s(%s %s)",
An object interface operation.
struct arbelprm_rc_send_wqe rc
void intf_close(struct interface *intf, int rc)
Close an object interface.
int ifconf(struct net_device *netdev, struct net_device_configurator *configurator, unsigned long timeout)
Perform network device configuration.
int netdev_configuration_in_progress(struct net_device *netdev)
Check if network device configuration is in progress.
int printf(const char *fmt,...)
Write a formatted string to the console.
int monojob_wait(const char *string, unsigned long timeout)
Wait for single foreground job to complete.
struct net_device * netdev
Network device.
static void ifstat_errors(struct net_device_stats *stats, const char *prefix)
Print network device error breakdown.
#define INTF_INIT(descriptor)
Initialise a static object interface.
#define __einfo_errortab(einfo)
int netdev_configure(struct net_device *netdev, struct net_device_configurator *configurator)
Start network device configuration.
void intf_plug_plug(struct interface *a, struct interface *b)
Plug two object interfaces together.
#define EADDRNOTAVAIL_CONFIG
Default unsuccessful configuration status code.
int(* progress)(struct ifpoller *ifpoller)
Check progress.
struct errortab ifmgmt_errors [] __errortab
Human-readable error message.
struct interface job
Job control interface.
static int netdev_link_blocked(struct net_device *netdev)
Check link block state of network device.
static const char * netdev_addr(struct net_device *netdev)
Get printable network device link-layer address.
struct net_device_stats tx_stats
TX statistics.
void ifclose(struct net_device *netdev)
Close network device.
unsigned int count
Error count.
int iflinkwait(struct net_device *netdev, unsigned long timeout, int verbose)
Wait for link-up, with status indication.
int netdev_configure_all(struct net_device *netdev)
Start network device configuration via all supported configurators.
const char * name
Protocol name.
#define LINK_WAIT_TIMEOUT
Default time to wait for link-up.
static int netdev_is_open(struct net_device *netdev)
Check whether or not network device is open.
int link_rc
Link status code.
#define __unused
Declare a variable or data structure as unused.
static int netdev_link_ok(struct net_device *netdev)
Check link state of network device.
static struct net_device * netdev
const char * driver_name
Driver name.
An object interface descriptor.
void netdev_poll(struct net_device *netdev)
Poll for completed and received packets on network device.
char * strerror(int errno)
Retrieve string representation of error number.
struct net_device_stats rx_stats
RX statistics.
#define INTF_OP(op_type, object_type, op_func)
Define an object interface operation.
unsigned int bad
Count of error completions.
#define EINFO_EADDRNOTAVAIL_CONFIG
struct net_device_error errors[NETDEV_MAX_UNIQUE_ERRORS]
Error breakdowns.
Network device statistics.
static int ifpoller_progress(struct ifpoller *ifpoller, struct job_progress *progress __unused)
Report network device poller progress.
int ifopen(struct net_device *netdev)
Open network device.
static int iflinkwait_progress(struct ifpoller *ifpoller)
Check link-up progress.
struct device * dev
Underlying hardware device.
void netdev_close(struct net_device *netdev)
Close network device.
Network device management.
#define INTF_DESC(object_type, intf, operations)
Define an object interface descriptor.
unsigned int good
Count of successful completions.
char name[NETDEV_NAME_LEN]
Name of this network device.
static int ifconf_progress(struct ifpoller *ifpoller)
Check configuration progress.
int rc
Configuration status.
A network device configurator.
static struct interface_operation ifpoller_job_op[]
Network device poller operations.
struct net_device_configurator * configurator
Network device configurator (if applicable)
static struct interface_descriptor ifpoller_job_desc
Network device poller descriptor.
const char *(* ntoa)(const void *ll_addr)
Transcribe link-layer address.
struct net_device_configurator * configurator
Network device configurator.
Network interface management.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void ifstat(struct net_device *netdev)
Print status of network device.
uint8_t ll_addr[MAX_LL_ADDR_LEN]
Link-layer address.
A network device configuration.
int netdev_configuration_ok(struct net_device *netdev)
Check if network device has at least one successful configuration.
#define NULL
NULL pointer (VOID *)
int netdev_open(struct net_device *netdev)
Open network device.
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.
static struct net_device_configuration * netdev_configuration(struct net_device *netdev, struct net_device_configurator *configurator)
Get network device configuration.
struct ll_protocol * ll_protocol
Link-layer protocol.