/** "ifconf" options */
struct ifconf_options {
+ /** Configuration timeout */
+ unsigned long timeout;
/** Configurator */
struct net_device_configurator *configurator;
};
OPTION_DESC ( "configurator", 'c', required_argument,
struct ifconf_options, configurator,
parse_netdev_configurator ),
+ OPTION_DESC ( "timeout", 't', required_argument,
+ struct ifconf_options, timeout,
+ parse_timeout ),
};
/**
int rc;
/* Attempt configuration */
- if ( ( rc = ifconf ( netdev, opts->configurator ) ) != 0 ) {
+ if ( ( rc = ifconf ( netdev, opts->configurator,
+ opts->timeout ) ) != 0 ) {
/* Close device on failure, to avoid memory exhaustion */
netdev_close ( netdev );
extern int ifopen ( struct net_device *netdev );
extern int ifconf ( struct net_device *netdev,
- struct net_device_configurator *configurator );
+ struct net_device_configurator *configurator,
+ unsigned long timeout );
extern void ifclose ( struct net_device *netdev );
extern void ifstat ( struct net_device *netdev );
extern int iflinkwait ( struct net_device *netdev, unsigned long timeout );
ifstat ( netdev );
/* Configure device */
- if ( ( rc = ifconf ( netdev, NULL ) ) != 0 )
+ if ( ( rc = ifconf ( netdev, NULL, 0 ) ) != 0 )
goto err_dhcp;
route();
*
* @v netdev Network device
* @v configurator Network device configurator, or NULL to use all
+ * @v timeout Timeout period, in ticks
* @ret rc Return status code
*/
int ifconf ( struct net_device *netdev,
- struct net_device_configurator *configurator ) {
+ struct net_device_configurator *configurator,
+ unsigned long timeout ) {
int rc;
/* Ensure device is open and link is up */
( configurator ? configurator->name : "" ),
( configurator ? "] " : "" ),
netdev->name, netdev->ll_protocol->ntoa ( netdev->ll_addr ) );
- return ifpoller_wait ( netdev, configurator, 0, ifconf_progress );
+ return ifpoller_wait ( netdev, configurator, timeout, ifconf_progress );
}