From 2c2ea5a88a12ea3bfb003a37f7ec2c2446539a7c Mon Sep 17 00:00:00 2001 From: Pravin B Shelar Date: Thu, 22 Mar 2012 10:58:32 -0700 Subject: [PATCH] netdev: Rename netdev->get_status() to netdev->get_drv_info(). get_status actually returns driver information, so get_drv_info() is better name. Signed-off-by: Pravin B Shelar --- lib/netdev-dummy.c | 2 +- lib/netdev-linux.c | 10 +++++----- lib/netdev-provider.h | 6 +++--- lib/netdev-vport.c | 8 ++++---- lib/netdev.c | 6 +++--- lib/netdev.h | 2 +- vswitchd/bridge.c | 2 +- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index 5c6563ccb..083a4ddb5 100644 --- a/lib/netdev-dummy.c +++ b/lib/netdev-dummy.c @@ -352,7 +352,7 @@ static const struct netdev_class dummy_class = { NULL, /* get_in6 */ NULL, /* add_router */ NULL, /* get_next_hop */ - NULL, /* get_status */ + NULL, /* get_drv_info */ NULL, /* arp_lookup */ netdev_dummy_update_flags, diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index be70a916e..a5e6d3663 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -2272,7 +2272,7 @@ netdev_linux_get_next_hop(const struct in_addr *host, struct in_addr *next_hop, } static int -netdev_linux_get_status(const struct netdev *netdev, struct shash *sh) +netdev_linux_get_drv_info(const struct netdev *netdev, struct shash *sh) { int error; struct netdev_dev_linux *netdev_dev = @@ -2288,7 +2288,7 @@ netdev_linux_get_status(const struct netdev *netdev, struct shash *sh) } static int -netdev_internal_get_status(const struct netdev *netdev OVS_UNUSED, struct shash *sh) +netdev_internal_get_drv_info(const struct netdev *netdev OVS_UNUSED, struct shash *sh) { shash_add(sh, "driver_name", xstrdup("openvswitch")); return 0; @@ -2448,7 +2448,7 @@ const struct netdev_class netdev_linux_class = netdev_linux_get_stats, NULL, /* set_stats */ netdev_linux_get_features, - netdev_linux_get_status); + netdev_linux_get_drv_info); const struct netdev_class netdev_tap_class = NETDEV_LINUX_CLASS( @@ -2457,7 +2457,7 @@ const struct netdev_class netdev_tap_class = netdev_tap_get_stats, NULL, /* set_stats */ netdev_linux_get_features, - netdev_linux_get_status); + netdev_linux_get_drv_info); const struct netdev_class netdev_internal_class = NETDEV_LINUX_CLASS( @@ -2466,7 +2466,7 @@ const struct netdev_class netdev_internal_class = netdev_internal_get_stats, netdev_vport_set_stats, NULL, /* get_features */ - netdev_internal_get_status); + netdev_internal_get_drv_info); /* HTB traffic control class. */ diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index dea171db2..daf46adee 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -540,10 +540,10 @@ struct netdev_class { int (*get_next_hop)(const struct in_addr *host, struct in_addr *next_hop, char **netdev_name); - /* Retrieves the status of the device. + /* Retrieves driver information of the device. * * Populates 'sh' with key-value pairs representing the status of the - * device. A device's status is a set of key-value string pairs + * device. Driver info is a set of key-value string pairs * representing netdev type specific information. For more information see * ovs-vswitchd.conf.db(5). * @@ -552,7 +552,7 @@ struct netdev_class { * * This function may be set to null if it would always return EOPNOTSUPP * anyhow. */ - int (*get_status)(const struct netdev *netdev, struct shash *sh); + int (*get_drv_info)(const struct netdev *netdev, struct shash *sh); /* Looks up the ARP table entry for 'ip' on 'netdev' and stores the * corresponding MAC address in 'mac'. A return value of ENXIO, in diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 92096e3f7..7bd50a41c 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -458,7 +458,7 @@ netdev_vport_set_stats(struct netdev *netdev, const struct netdev_stats *stats) } static int -netdev_vport_get_status(const struct netdev *netdev, struct shash *sh) +netdev_vport_get_drv_info(const struct netdev *netdev, struct shash *sh) { const char *iface = netdev_vport_get_tnl_iface(netdev); @@ -952,15 +952,15 @@ netdev_vport_register(void) { static const struct vport_class vport_classes[] = { { OVS_VPORT_TYPE_GRE, - { "gre", VPORT_FUNCTIONS(netdev_vport_get_status) }, + { "gre", VPORT_FUNCTIONS(netdev_vport_get_drv_info) }, parse_tunnel_config, unparse_tunnel_config }, { OVS_VPORT_TYPE_GRE, - { "ipsec_gre", VPORT_FUNCTIONS(netdev_vport_get_status) }, + { "ipsec_gre", VPORT_FUNCTIONS(netdev_vport_get_drv_info) }, parse_tunnel_config, unparse_tunnel_config }, { OVS_VPORT_TYPE_CAPWAP, - { "capwap", VPORT_FUNCTIONS(netdev_vport_get_status) }, + { "capwap", VPORT_FUNCTIONS(netdev_vport_get_drv_info) }, parse_tunnel_config, unparse_tunnel_config }, { OVS_VPORT_TYPE_PATCH, diff --git a/lib/netdev.c b/lib/netdev.c index 305ad13f6..2652a3fde 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -765,12 +765,12 @@ netdev_get_next_hop(const struct netdev *netdev, * may be used to populate the status column of the Interface table as defined * in ovs-vswitchd.conf.db(5). */ int -netdev_get_status(const struct netdev *netdev, struct shash *sh) +netdev_get_drv_info(const struct netdev *netdev, struct shash *sh) { struct netdev_dev *dev = netdev_get_dev(netdev); - return (dev->netdev_class->get_status - ? dev->netdev_class->get_status(netdev, sh) + return (dev->netdev_class->get_drv_info + ? dev->netdev_class->get_drv_info(netdev, sh) : EOPNOTSUPP); } diff --git a/lib/netdev.h b/lib/netdev.h index ea278ffc0..bff110116 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -159,7 +159,7 @@ int netdev_get_in6(const struct netdev *, struct in6_addr *); int netdev_add_router(struct netdev *, struct in_addr router); int netdev_get_next_hop(const struct netdev *, const struct in_addr *host, struct in_addr *next_hop, char **); -int netdev_get_status(const struct netdev *, struct shash *sh); +int netdev_get_drv_info(const struct netdev *, struct shash *sh); int netdev_arp_lookup(const struct netdev *, ovs_be32 ip, uint8_t mac[6]); int netdev_get_flags(const struct netdev *, enum netdev_flags *); diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 6449333de..1682280fa 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1496,7 +1496,7 @@ iface_refresh_status(struct iface *iface) shash_init(&sh); - if (!netdev_get_status(iface->netdev, &sh)) { + if (!netdev_get_drv_info(iface->netdev, &sh)) { size_t n; char **keys, **values; -- 2.43.0