From 6f2f5cce6c3fa59fb73f3489ddbcb988131faec7 Mon Sep 17 00:00:00 2001 From: Andrew Evans Date: Mon, 17 Jan 2011 15:18:38 -0800 Subject: [PATCH] netdev: Make 'netdev' parameter of 'get_features()' const. Implementations shouldn't need to modify it. --- AUTHORS | 1 + lib/netdev-linux.c | 2 +- lib/netdev-provider.h | 2 +- lib/netdev.c | 4 ++-- lib/netdev.h | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 183a8b3b..38afb2c8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,7 @@ The following people, in alphabetical order, have either authored or signed off on commits in the Open vSwitch version control repository. +Andrew Evans aevans@nicira.com Andrew Lambeth wal@nicira.com Andy Southgate andy.southgate@citrix.com Ben Pfaff blp@nicira.com diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 1ff4d409..168cd012 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -1201,7 +1201,7 @@ netdev_linux_get_stats(const struct netdev *netdev_, * bitmap of "enum ofp_port_features" bits, in host byte order. Returns 0 if * successful, otherwise a positive errno value. */ static int -netdev_linux_get_features(struct netdev *netdev, +netdev_linux_get_features(const struct netdev *netdev, uint32_t *current, uint32_t *advertised, uint32_t *supported, uint32_t *peer) { diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 9c75ccb6..58d51d7b 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -295,7 +295,7 @@ struct netdev_class { * * This function may be set to null if it would always return EOPNOTSUPP. */ - int (*get_features)(struct netdev *netdev, + int (*get_features)(const struct netdev *netdev, uint32_t *current, uint32_t *advertised, uint32_t *supported, uint32_t *peer); diff --git a/lib/netdev.c b/lib/netdev.c index b2c4d663..122525a0 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -618,11 +618,11 @@ netdev_get_ifindex(const struct netdev *netdev) * Some network devices may not implement support for this function. In such * cases this function will always return EOPNOTSUPP. */ int -netdev_get_features(struct netdev *netdev, +netdev_get_features(const struct netdev *netdev, uint32_t *current, uint32_t *advertised, uint32_t *supported, uint32_t *peer) { - int (*get_features)(struct netdev *netdev, + int (*get_features)(const struct netdev *netdev, uint32_t *current, uint32_t *advertised, uint32_t *supported, uint32_t *peer); uint32_t dummy[4]; diff --git a/lib/netdev.h b/lib/netdev.h index 179628c6..03d7f95c 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -127,7 +127,7 @@ int netdev_get_etheraddr(const struct netdev *, uint8_t mac[6]); /* PHY interface. */ bool netdev_get_carrier(const struct netdev *); bool netdev_get_miimon(const struct netdev *); -int netdev_get_features(struct netdev *, +int netdev_get_features(const struct netdev *, uint32_t *current, uint32_t *advertised, uint32_t *supported, uint32_t *peer); uint64_t netdev_features_to_bps(uint32_t features); -- 2.30.2