Move DEV_NAME macro from if_ath.c to ieee80211_var.h, and expand on it.
authormtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 21 Nov 2007 09:13:44 +0000 (09:13 +0000)
committermtaylor <mtaylor@0192ed92-7a03-0410-a25b-9323aeb14dbd>
Wed, 21 Nov 2007 09:13:44 +0000 (09:13 +0000)
git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2879 0192ed92-7a03-0410-a25b-9323aeb14dbd

ath/if_ath.c
net80211/ieee80211_var.h

index 8470ec28cac23d78454a5efe6dfc7bb84299883c..e68c24694d32b0bd32c0bae9ba212a69660a34be 100644 (file)
@@ -279,8 +279,6 @@ static int countrycode = -1;
 static int outdoor = -1;
 static int xchanmode = -1;
 
-#define DEV_NAME(_d) ((!_d || !_d->name || !strncmp(_d->name, "wifi%d", 6)) ? "MadWifi" : _d->name)
-
 static const char *hal_status_desc[] = {
        "No error",
        "No hardware present or device not yet supported",
index 2d50c9dff5257752f2fd87dd4e73cded96a7ad4c..03404b77042b09e750949e8a87860259c60c17ea 100644 (file)
@@ -92,6 +92,23 @@ Note: Atheros chips use 7 bits when power is specified in half dBm units, with a
 
 #define IEEE80211_SWBMISS_THRESHOLD    10      /* software beacon miss threshold, in TUs */
 
+#define DEV_NAME(_d) \
+        ((NULL == _d || NULL == _d->name || 0 == strncmp(_d->name, "wifi%d", 6)) ? \
+         "MadWifi" : \
+         _d->name)
+#define VAP_DEV_NAME(_v) \
+        ((NULL == _v) ? \
+         "MadWifi" : \
+         DEV_NAME(_v->iv_dev))
+#define VAP_DEV_NAME(_v) \
+        ((NULL == _v) ? \
+         "MadWifi" : \
+         DEV_NAME(_v->iv_dev))
+#define VAP_IC_DEV_NAME(_v) \
+        ((NULL == _v || NULL == _v->iv_ic) ? \
+         "MadWifi" : \
+         DEV_NAME(_v->iv_ic->ic_dev))
+
 #define        IEEE80211_MS_TO_TU(x)   (((x) * 1000) / 1024)
 #define        IEEE80211_TU_TO_MS(x)   (((x) * 1024) / 1000)
 #define        IEEE80211_TU_TO_JIFFIES(x) ((IEEE80211_TU_TO_MS(x) * HZ) / 1000)