X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fnetdev.c;h=e77fcdfa30b3c965545646e908542b28a49b1610;hb=a5ac7299f8042c01fcdb60c5508047146baf3a16;hp=70f9678b20e176e65f988987a8d016111b3439c7;hpb=ee9bed06cd2794ced29190b6c6539993159d76f5;p=openvswitch diff --git a/lib/netdev.c b/lib/netdev.c index 70f9678b..e77fcdfa 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -892,6 +892,15 @@ netdev_get_carrier(const struct netdev *netdev) return carrier; } +/* Returns the number of times 'netdev''s carrier has changed. */ +long long int +netdev_get_carrier_resets(const struct netdev *netdev) +{ + return (netdev_get_dev(netdev)->netdev_class->get_carrier_resets + ? netdev_get_dev(netdev)->netdev_class->get_carrier_resets(netdev) + : 0); +} + /* Attempts to force netdev_get_carrier() to poll 'netdev''s MII registers for * link status instead of checking 'netdev''s carrier. 'netdev''s MII * registers will be polled once ever 'interval' milliseconds. If 'netdev' @@ -1241,24 +1250,6 @@ netdev_change_seq(const struct netdev *netdev) { return netdev_get_dev(netdev)->netdev_class->change_seq(netdev); } - -/* If 'netdev' is a VLAN network device (e.g. one created with vconfig(8)), - * sets '*vlan_vid' to the VLAN VID associated with that device and returns 0. - * Otherwise returns a errno value (specifically ENOENT if 'netdev_name' is the - * name of a network device that is not a VLAN device) and sets '*vlan_vid' to - * -1. */ -int -netdev_get_vlan_vid(const struct netdev *netdev, int *vlan_vid) -{ - int error = (netdev_get_dev(netdev)->netdev_class->get_vlan_vid - ? netdev_get_dev(netdev)->netdev_class->get_vlan_vid(netdev, - vlan_vid) - : ENOENT); - if (error) { - *vlan_vid = 0; - } - return error; -} /* Initializes 'netdev_dev' as a netdev device named 'name' of the specified * 'netdev_class'. This function is ordinarily called from a netdev provider's