From: mtaylor Date: Wed, 21 Nov 2007 09:13:44 +0000 (+0000) Subject: Move DEV_NAME macro from if_ath.c to ieee80211_var.h, and expand on it. X-Git-Url: http://git.ozo.com/?a=commitdiff_plain;h=c717e369fdcdd8871bf4142631509bc5a2cb4644;p=madwifi%2F.git Move DEV_NAME macro from if_ath.c to ieee80211_var.h, and expand on it. git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2879 0192ed92-7a03-0410-a25b-9323aeb14dbd --- diff --git a/ath/if_ath.c b/ath/if_ath.c index 8470ec2..e68c246 100644 --- a/ath/if_ath.c +++ b/ath/if_ath.c @@ -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", diff --git a/net80211/ieee80211_var.h b/net80211/ieee80211_var.h index 2d50c9d..03404b7 100644 --- a/net80211/ieee80211_var.h +++ b/net80211/ieee80211_var.h @@ -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)