[OpenWrt-Devel] [PATCH 1/3][RFC] switch: export swconfig_speed_str()

Alexander Couzens lynxis at fe80.eu
Tue Dec 9 14:21:19 EST 2014


swconfig_speed_str convert a switch speed enum to a human readable string.
---
 target/linux/generic/files/drivers/net/phy/swconfig.c | 3 ++-
 target/linux/generic/files/include/linux/switch.h     | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c
index 4f2df4c..7f50c03 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig.c
@@ -127,7 +127,7 @@ swconfig_get_pvid(struct switch_dev *dev, const struct switch_attr *attr,
 	return dev->ops->get_port_pvid(dev, val->port_vlan, &val->value.i);
 }
 
-static const char *
+const char *
 swconfig_speed_str(enum switch_port_speed speed)
 {
 	switch (speed) {
@@ -143,6 +143,7 @@ swconfig_speed_str(enum switch_port_speed speed)
 
 	return "unknown";
 }
+EXPORT_SYMBOL_GPL(swconfig_speed_str);
 
 static int
 swconfig_get_link(struct switch_dev *dev, const struct switch_attr *attr,
diff --git a/target/linux/generic/files/include/linux/switch.h b/target/linux/generic/files/include/linux/switch.h
index b53431e..d529ccc 100644
--- a/target/linux/generic/files/include/linux/switch.h
+++ b/target/linux/generic/files/include/linux/switch.h
@@ -25,9 +25,11 @@ struct switch_val;
 struct switch_attr;
 struct switch_attrlist;
 struct switch_led_trigger;
+enum switch_port_speed;
 
 int register_switch(struct switch_dev *dev, struct net_device *netdev);
 void unregister_switch(struct switch_dev *dev);
+const char *swconfig_speed_str(enum switch_port_speed speed);
 
 /**
  * struct switch_attrlist - attribute list
-- 
2.1.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list