mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 17:12:54 +03:00
[netdevice] Add netdev_is_open() wrapper function
Signed-off-by: Michael Brown <mcb30@etherboot.org>
This commit is contained in:
@@ -90,7 +90,7 @@ void ifstat ( struct net_device *netdev ) {
|
||||
printf ( "%s: %s on %s (%s)\n"
|
||||
" [Link:%s, TX:%d TXE:%d RX:%d RXE:%d]\n",
|
||||
netdev->name, netdev_addr ( netdev ), netdev->dev->name,
|
||||
( ( netdev->state & NETDEV_OPEN ) ? "open" : "closed" ),
|
||||
( netdev_is_open ( netdev ) ? "open" : "closed" ),
|
||||
( netdev_link_ok ( netdev ) ? "up" : "down" ),
|
||||
netdev->tx_stats.good, netdev->tx_stats.bad,
|
||||
netdev->rx_stats.good, netdev->rx_stats.bad );
|
||||
|
||||
@@ -125,7 +125,7 @@ int iwlist ( struct net80211_device *dev ) {
|
||||
char ssid_buf[22];
|
||||
int rc;
|
||||
unsigned i;
|
||||
int was_opened = dev->netdev->state & NETDEV_OPEN;
|
||||
int was_opened = netdev_is_open ( dev->netdev );
|
||||
int was_channel = dev->channels[dev->channel].channel_nr;
|
||||
|
||||
if ( ! was_opened ) {
|
||||
|
||||
@@ -38,7 +38,7 @@ void route ( void ) {
|
||||
printf ( "%s", inet_ntoa ( miniroute->netmask ) );
|
||||
if ( miniroute->gateway.s_addr )
|
||||
printf ( " gw %s", inet_ntoa ( miniroute->gateway ) );
|
||||
if ( ! ( miniroute->netdev->state & NETDEV_OPEN ) )
|
||||
if ( ! netdev_is_open ( miniroute->netdev ) )
|
||||
printf ( " (inaccessible)" );
|
||||
printf ( "\n" );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user