ath9k: add a helper to get the string representation of ath_bus_type
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 16 Oct 2016 20:59:06 +0000 (22:59 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Tue, 15 Nov 2016 14:55:37 +0000 (16:55 +0200)
This can be used when the ath_bus_type has to be presented in a log
message or firmware filename.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/main.c

index da7a7c8dafb262f579594466d9a7423c42605059..f3f2784f6ebda9b0a9e202d7fd02cb78cf5522ba 100644 (file)
@@ -327,4 +327,10 @@ static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
 }
 #endif
 
+extern const char *ath_bus_type_strings[];
+static inline const char *ath_bus_type_to_string(enum ath_bus_type bustype)
+{
+       return ath_bus_type_strings[bustype];
+}
+
 #endif /* ATH_H */
index 338d723376043e78d813b1423f3c93e14cec820b..89f4b0513946916230dad4529df7c2d30402f2d8 100644 (file)
@@ -90,3 +90,10 @@ void ath_printk(const char *level, const struct ath_common* common,
        va_end(args);
 }
 EXPORT_SYMBOL(ath_printk);
+
+const char *ath_bus_type_strings[] = {
+       [ATH_PCI] = "pci",
+       [ATH_AHB] = "ahb",
+       [ATH_USB] = "usb",
+};
+EXPORT_SYMBOL(ath_bus_type_strings);