diff options
| author | Michael Brown | 2010-03-23 01:46:23 +0100 |
|---|---|---|
| committer | Michael Brown | 2010-03-23 01:46:35 +0100 |
| commit | 88e436376cbdedee73483a9b57203c60a34316ac (patch) | |
| tree | 4b23f51f32be9190621b44e497ef392510f1fd69 /src/net | |
| parent | [phantom] Update interrupt support to match current firmware (diff) | |
| download | ipxe-88e436376cbdedee73483a9b57203c60a34316ac.tar.gz ipxe-88e436376cbdedee73483a9b57203c60a34316ac.tar.xz ipxe-88e436376cbdedee73483a9b57203c60a34316ac.zip | |
[netdevice] Add netdev_is_open() wrapper function
Signed-off-by: Michael Brown <mcb30@etherboot.org>
Diffstat (limited to 'src/net')
| -rw-r--r-- | src/net/80211/net80211.c | 12 | ||||
| -rw-r--r-- | src/net/ipv4.c | 2 | ||||
| -rw-r--r-- | src/net/netdevice.c | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/net/80211/net80211.c b/src/net/80211/net80211.c index 1c54597f9..40f7ba25f 100644 --- a/src/net/80211/net80211.c +++ b/src/net/80211/net80211.c @@ -1304,7 +1304,7 @@ struct net80211_probe_ctx * net80211_probe_start ( struct net80211_device *dev, if ( ! ctx ) return NULL; - assert ( dev->netdev->state & NETDEV_OPEN ); + assert ( netdev_is_open ( dev->netdev ) ); ctx->dev = dev; ctx->old_keep_mgmt = net80211_keep_mgmt ( dev, 1 ); @@ -1908,7 +1908,7 @@ static int net80211_check_settings_update ( void ) int key_reassoc; list_for_each_entry ( dev, &net80211_devices, list ) { - if ( ! ( dev->netdev->state & NETDEV_OPEN ) ) + if ( ! netdev_is_open ( dev->netdev ) ) continue; key_reassoc = 0; @@ -2012,7 +2012,7 @@ static void net80211_set_rtscts_rate ( struct net80211_device *dev ) */ void net80211_set_rate_idx ( struct net80211_device *dev, int rate ) { - assert ( dev->netdev->state & NETDEV_OPEN ); + assert ( netdev_is_open ( dev->netdev ) ); if ( rate >= 0 && rate < dev->nr_rates && rate != dev->rate ) { DBGC2 ( dev, "802.11 %p changing rate from %d->%d Mbps\n", @@ -2035,7 +2035,7 @@ int net80211_change_channel ( struct net80211_device *dev, int channel ) { int i, oldchan = dev->channel; - assert ( dev->netdev->state & NETDEV_OPEN ); + assert ( netdev_is_open ( dev->netdev ) ); for ( i = 0; i < dev->nr_channels; i++ ) { if ( dev->channels[i].channel_nr == channel ) { @@ -2064,7 +2064,7 @@ int net80211_change_channel ( struct net80211_device *dev, int channel ) int net80211_prepare_probe ( struct net80211_device *dev, int band, int active ) { - assert ( dev->netdev->state & NETDEV_OPEN ); + assert ( netdev_is_open ( dev->netdev ) ); if ( active && ( band & NET80211_BAND_BIT_5GHZ ) ) { DBGC ( dev, "802.11 %p cannot perform active scanning on " @@ -2124,7 +2124,7 @@ int net80211_prepare_assoc ( struct net80211_device *dev, struct net80211_handshaker *handshaker; int rc; - assert ( dev->netdev->state & NETDEV_OPEN ); + assert ( netdev_is_open ( dev->netdev ) ); net80211_set_state ( dev, NET80211_ASSOCIATED, 0, 0 ); memcpy ( dev->bssid, wlan->bssid, ETH_ALEN ); diff --git a/src/net/ipv4.c b/src/net/ipv4.c index 4c1393f22..7a8ddd3b2 100644 --- a/src/net/ipv4.c +++ b/src/net/ipv4.c @@ -118,7 +118,7 @@ static struct ipv4_miniroute * ipv4_route ( struct in_addr *dest ) { /* Find first usable route in routing table */ list_for_each_entry ( miniroute, &ipv4_miniroutes, list ) { - if ( ! ( miniroute->netdev->state & NETDEV_OPEN ) ) + if ( ! netdev_is_open ( miniroute->netdev ) ) continue; local = ( ( ( dest->s_addr ^ miniroute->address.s_addr ) & miniroute->netmask.s_addr ) == 0 ); diff --git a/src/net/netdevice.c b/src/net/netdevice.c index ee0d0b72b..2e781d764 100644 --- a/src/net/netdevice.c +++ b/src/net/netdevice.c @@ -130,7 +130,7 @@ int netdev_tx ( struct net_device *netdev, struct io_buffer *iobuf ) { list_add_tail ( &iobuf->list, &netdev->tx_queue ); - if ( ! ( netdev->state & NETDEV_OPEN ) ) { + if ( ! netdev_is_open ( netdev ) ) { rc = -ENETUNREACH; goto err; } @@ -263,7 +263,7 @@ void netdev_rx_err ( struct net_device *netdev, */ void netdev_poll ( struct net_device *netdev ) { - if ( netdev->state & NETDEV_OPEN ) + if ( netdev_is_open ( netdev ) ) netdev->op->poll ( netdev ); } @@ -509,7 +509,7 @@ struct net_device * last_opened_netdev ( void ) { struct net_device *netdev; list_for_each_entry ( netdev, &open_net_devices, open_list ) { - assert ( netdev->state & NETDEV_OPEN ); + assert ( netdev_is_open ( netdev ) ); return netdev; } |
