mac80211: trace interface name

It's not all that useful to have the vif/sdata pointer,
we'd rather refer to the interfaces by their name.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg 2009-11-25 20:30:31 +01:00 committed by John W. Linville
parent 47846c9b0c
commit 12375ef933
10 changed files with 49 additions and 50 deletions

View File

@ -41,8 +41,7 @@ void __ieee80211_stop_rx_ba_session(struct sta_info *sta, u16 tid,
sta->sta.addr, tid); sta->sta.addr, tid);
#endif /* CONFIG_MAC80211_HT_DEBUG */ #endif /* CONFIG_MAC80211_HT_DEBUG */
if (drv_ampdu_action(local, &sta->sdata->vif, if (drv_ampdu_action(local, sta->sdata, IEEE80211_AMPDU_RX_STOP,
IEEE80211_AMPDU_RX_STOP,
&sta->sta, tid, NULL)) &sta->sta, tid, NULL))
printk(KERN_DEBUG "HW problem - can not stop rx " printk(KERN_DEBUG "HW problem - can not stop rx "
"aggregation for tid %d\n", tid); "aggregation for tid %d\n", tid);
@ -280,8 +279,7 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
goto end; goto end;
} }
ret = drv_ampdu_action(local, &sta->sdata->vif, ret = drv_ampdu_action(local, sta->sdata, IEEE80211_AMPDU_RX_START,
IEEE80211_AMPDU_RX_START,
&sta->sta, tid, &start_seq_num); &sta->sta, tid, &start_seq_num);
#ifdef CONFIG_MAC80211_HT_DEBUG #ifdef CONFIG_MAC80211_HT_DEBUG
printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret); printk(KERN_DEBUG "Rx A-MPDU request on tid %d result %d\n", tid, ret);

View File

@ -144,7 +144,7 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
*state = HT_AGG_STATE_REQ_STOP_BA_MSK | *state = HT_AGG_STATE_REQ_STOP_BA_MSK |
(initiator << HT_AGG_STATE_INITIATOR_SHIFT); (initiator << HT_AGG_STATE_INITIATOR_SHIFT);
ret = drv_ampdu_action(local, &sta->sdata->vif, ret = drv_ampdu_action(local, sta->sdata,
IEEE80211_AMPDU_TX_STOP, IEEE80211_AMPDU_TX_STOP,
&sta->sta, tid, NULL); &sta->sta, tid, NULL);
@ -303,8 +303,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid)
start_seq_num = sta->tid_seq[tid]; start_seq_num = sta->tid_seq[tid];
ret = drv_ampdu_action(local, &sdata->vif, ret = drv_ampdu_action(local, sdata, IEEE80211_AMPDU_TX_START,
IEEE80211_AMPDU_TX_START,
pubsta, tid, &start_seq_num); pubsta, tid, &start_seq_num);
if (ret) { if (ret) {
@ -420,7 +419,7 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local,
ieee80211_agg_splice_finish(local, sta, tid); ieee80211_agg_splice_finish(local, sta, tid);
spin_unlock(&local->ampdu_lock); spin_unlock(&local->ampdu_lock);
drv_ampdu_action(local, &sta->sdata->vif, drv_ampdu_action(local, sta->sdata,
IEEE80211_AMPDU_TX_OPERATIONAL, IEEE80211_AMPDU_TX_OPERATIONAL,
&sta->sta, tid, NULL); &sta->sta, tid, NULL);
} }

View File

@ -39,7 +39,7 @@ static inline int drv_add_interface(struct ieee80211_local *local,
struct ieee80211_if_init_conf *conf) struct ieee80211_if_init_conf *conf)
{ {
int ret = local->ops->add_interface(&local->hw, conf); int ret = local->ops->add_interface(&local->hw, conf);
trace_drv_add_interface(local, conf->vif, ret); trace_drv_add_interface(local, vif_to_sdata(conf->vif), ret);
return ret; return ret;
} }
@ -47,7 +47,7 @@ static inline void drv_remove_interface(struct ieee80211_local *local,
struct ieee80211_if_init_conf *conf) struct ieee80211_if_init_conf *conf)
{ {
local->ops->remove_interface(&local->hw, conf); local->ops->remove_interface(&local->hw, conf);
trace_drv_remove_interface(local, conf->vif); trace_drv_remove_interface(local, vif_to_sdata(conf->vif));
} }
static inline int drv_config(struct ieee80211_local *local, u32 changed) static inline int drv_config(struct ieee80211_local *local, u32 changed)
@ -58,13 +58,13 @@ static inline int drv_config(struct ieee80211_local *local, u32 changed)
} }
static inline void drv_bss_info_changed(struct ieee80211_local *local, static inline void drv_bss_info_changed(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *info, struct ieee80211_bss_conf *info,
u32 changed) u32 changed)
{ {
if (local->ops->bss_info_changed) if (local->ops->bss_info_changed)
local->ops->bss_info_changed(&local->hw, vif, info, changed); local->ops->bss_info_changed(&local->hw, &sdata->vif, info, changed);
trace_drv_bss_info_changed(local, vif, info, changed); trace_drv_bss_info_changed(local, sdata, info, changed);
} }
static inline u64 drv_prepare_multicast(struct ieee80211_local *local, static inline u64 drv_prepare_multicast(struct ieee80211_local *local,
@ -106,12 +106,13 @@ static inline int drv_set_tim(struct ieee80211_local *local,
} }
static inline int drv_set_key(struct ieee80211_local *local, static inline int drv_set_key(struct ieee80211_local *local,
enum set_key_cmd cmd, struct ieee80211_vif *vif, enum set_key_cmd cmd,
struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key) struct ieee80211_key_conf *key)
{ {
int ret = local->ops->set_key(&local->hw, cmd, vif, sta, key); int ret = local->ops->set_key(&local->hw, cmd, &sdata->vif, sta, key);
trace_drv_set_key(local, cmd, vif, sta, key, ret); trace_drv_set_key(local, cmd, sdata, sta, key, ret);
return ret; return ret;
} }
@ -179,13 +180,13 @@ static inline int drv_set_rts_threshold(struct ieee80211_local *local,
} }
static inline void drv_sta_notify(struct ieee80211_local *local, static inline void drv_sta_notify(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
enum sta_notify_cmd cmd, enum sta_notify_cmd cmd,
struct ieee80211_sta *sta) struct ieee80211_sta *sta)
{ {
if (local->ops->sta_notify) if (local->ops->sta_notify)
local->ops->sta_notify(&local->hw, vif, cmd, sta); local->ops->sta_notify(&local->hw, &sdata->vif, cmd, sta);
trace_drv_sta_notify(local, vif, cmd, sta); trace_drv_sta_notify(local, sdata, cmd, sta);
} }
static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue, static inline int drv_conf_tx(struct ieee80211_local *local, u16 queue,
@ -239,16 +240,16 @@ static inline int drv_tx_last_beacon(struct ieee80211_local *local)
} }
static inline int drv_ampdu_action(struct ieee80211_local *local, static inline int drv_ampdu_action(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
enum ieee80211_ampdu_mlme_action action, enum ieee80211_ampdu_mlme_action action,
struct ieee80211_sta *sta, u16 tid, struct ieee80211_sta *sta, u16 tid,
u16 *ssn) u16 *ssn)
{ {
int ret = -EOPNOTSUPP; int ret = -EOPNOTSUPP;
if (local->ops->ampdu_action) if (local->ops->ampdu_action)
ret = local->ops->ampdu_action(&local->hw, vif, action, ret = local->ops->ampdu_action(&local->hw, &sdata->vif, action,
sta, tid, ssn); sta, tid, ssn);
trace_drv_ampdu_action(local, vif, action, sta, tid, ssn, ret); trace_drv_ampdu_action(local, sdata, action, sta, tid, ssn, ret);
return ret; return ret;
} }

View File

@ -25,10 +25,12 @@ static inline void trace_ ## name(proto) {}
#define STA_PR_FMT " sta:%pM" #define STA_PR_FMT " sta:%pM"
#define STA_PR_ARG __entry->sta_addr #define STA_PR_ARG __entry->sta_addr
#define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, vif) #define VIF_ENTRY __field(enum nl80211_iftype, vif_type) __field(void *, sdata) \
#define VIF_ASSIGN __entry->vif_type = vif ? vif->type : 0; __entry->vif = vif __string(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
#define VIF_PR_FMT " vif:%p(%d)" #define VIF_ASSIGN __entry->vif_type = sdata->vif.type; __entry->sdata = sdata; \
#define VIF_PR_ARG __entry->vif, __entry->vif_type __assign_str(vif_name, sdata->dev ? sdata->dev->name : "<nodev>")
#define VIF_PR_FMT " vif:%s(%d)"
#define VIF_PR_ARG __get_str(vif_name), __entry->vif_type
TRACE_EVENT(drv_start, TRACE_EVENT(drv_start,
TP_PROTO(struct ieee80211_local *local, int ret), TP_PROTO(struct ieee80211_local *local, int ret),
@ -70,10 +72,10 @@ TRACE_EVENT(drv_stop,
TRACE_EVENT(drv_add_interface, TRACE_EVENT(drv_add_interface,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
int ret), int ret),
TP_ARGS(local, vif, ret), TP_ARGS(local, sdata, ret),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
@ -85,7 +87,7 @@ TRACE_EVENT(drv_add_interface,
TP_fast_assign( TP_fast_assign(
LOCAL_ASSIGN; LOCAL_ASSIGN;
VIF_ASSIGN; VIF_ASSIGN;
memcpy(__entry->addr, vif->addr, 6); memcpy(__entry->addr, sdata->vif.addr, 6);
__entry->ret = ret; __entry->ret = ret;
), ),
@ -96,9 +98,9 @@ TRACE_EVENT(drv_add_interface,
); );
TRACE_EVENT(drv_remove_interface, TRACE_EVENT(drv_remove_interface,
TP_PROTO(struct ieee80211_local *local, struct ieee80211_vif *vif), TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata),
TP_ARGS(local, vif), TP_ARGS(local, sdata),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
@ -109,7 +111,7 @@ TRACE_EVENT(drv_remove_interface,
TP_fast_assign( TP_fast_assign(
LOCAL_ASSIGN; LOCAL_ASSIGN;
VIF_ASSIGN; VIF_ASSIGN;
memcpy(__entry->addr, vif->addr, 6); memcpy(__entry->addr, sdata->vif.addr, 6);
), ),
TP_printk( TP_printk(
@ -163,11 +165,11 @@ TRACE_EVENT(drv_config,
TRACE_EVENT(drv_bss_info_changed, TRACE_EVENT(drv_bss_info_changed,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
struct ieee80211_bss_conf *info, struct ieee80211_bss_conf *info,
u32 changed), u32 changed),
TP_ARGS(local, vif, info, changed), TP_ARGS(local, sdata, info, changed),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
@ -291,11 +293,11 @@ TRACE_EVENT(drv_set_tim,
TRACE_EVENT(drv_set_key, TRACE_EVENT(drv_set_key,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
enum set_key_cmd cmd, struct ieee80211_vif *vif, enum set_key_cmd cmd, struct ieee80211_sub_if_data *sdata,
struct ieee80211_sta *sta, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key, int ret), struct ieee80211_key_conf *key, int ret),
TP_ARGS(local, cmd, vif, sta, key, ret), TP_ARGS(local, cmd, sdata, sta, key, ret),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
@ -489,11 +491,11 @@ TRACE_EVENT(drv_set_rts_threshold,
TRACE_EVENT(drv_sta_notify, TRACE_EVENT(drv_sta_notify,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
enum sta_notify_cmd cmd, enum sta_notify_cmd cmd,
struct ieee80211_sta *sta), struct ieee80211_sta *sta),
TP_ARGS(local, vif, cmd, sta), TP_ARGS(local, sdata, cmd, sta),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY
@ -654,12 +656,12 @@ TRACE_EVENT(drv_tx_last_beacon,
TRACE_EVENT(drv_ampdu_action, TRACE_EVENT(drv_ampdu_action,
TP_PROTO(struct ieee80211_local *local, TP_PROTO(struct ieee80211_local *local,
struct ieee80211_vif *vif, struct ieee80211_sub_if_data *sdata,
enum ieee80211_ampdu_mlme_action action, enum ieee80211_ampdu_mlme_action action,
struct ieee80211_sta *sta, u16 tid, struct ieee80211_sta *sta, u16 tid,
u16 *ssn, int ret), u16 *ssn, int ret),
TP_ARGS(local, vif, action, sta, tid, ssn, ret), TP_ARGS(local, sdata, action, sta, tid, ssn, ret),
TP_STRUCT__entry( TP_STRUCT__entry(
LOCAL_ENTRY LOCAL_ENTRY

View File

@ -139,7 +139,7 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
struct ieee80211_sub_if_data, struct ieee80211_sub_if_data,
u.ap); u.ap);
ret = drv_set_key(key->local, SET_KEY, &sdata->vif, sta, &key->conf); ret = drv_set_key(key->local, SET_KEY, sdata, sta, &key->conf);
if (!ret) { if (!ret) {
spin_lock_bh(&todo_lock); spin_lock_bh(&todo_lock);
@ -181,7 +181,7 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
struct ieee80211_sub_if_data, struct ieee80211_sub_if_data,
u.ap); u.ap);
ret = drv_set_key(key->local, DISABLE_KEY, &sdata->vif, ret = drv_set_key(key->local, DISABLE_KEY, sdata,
sta, &key->conf); sta, &key->conf);
if (ret) if (ret)

View File

@ -222,8 +222,7 @@ void ieee80211_bss_info_change_notify(struct ieee80211_sub_if_data *sdata,
} }
} }
drv_bss_info_changed(local, &sdata->vif, drv_bss_info_changed(local, sdata, &sdata->vif.bss_conf, changed);
&sdata->vif.bss_conf, changed);
} }
u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata) u32 ieee80211_reset_erp_info(struct ieee80211_sub_if_data *sdata)

View File

@ -65,7 +65,7 @@ int __ieee80211_suspend(struct ieee80211_hw *hw)
struct ieee80211_sub_if_data, struct ieee80211_sub_if_data,
u.ap); u.ap);
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE, drv_sta_notify(local, sdata, STA_NOTIFY_REMOVE,
&sta->sta); &sta->sta);
} }

View File

@ -1021,7 +1021,7 @@ static void ap_sta_ps_start(struct sta_info *sta)
atomic_inc(&sdata->bss->num_sta_ps); atomic_inc(&sdata->bss->num_sta_ps);
set_sta_flags(sta, WLAN_STA_PS_STA); set_sta_flags(sta, WLAN_STA_PS_STA);
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_SLEEP, &sta->sta); drv_sta_notify(local, sdata, STA_NOTIFY_SLEEP, &sta->sta);
#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG #ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n", printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n",
sdata->name, sta->sta.addr, sta->sta.aid); sdata->name, sta->sta.addr, sta->sta.aid);

View File

@ -397,7 +397,7 @@ int sta_info_insert(struct sta_info *sta)
struct ieee80211_sub_if_data, struct ieee80211_sub_if_data,
u.ap); u.ap);
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, &sta->sta); drv_sta_notify(local, sdata, STA_NOTIFY_ADD, &sta->sta);
sdata = sta->sdata; sdata = sta->sdata;
} }
@ -537,7 +537,7 @@ static void __sta_info_unlink(struct sta_info **sta)
struct ieee80211_sub_if_data, struct ieee80211_sub_if_data,
u.ap); u.ap);
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_REMOVE, drv_sta_notify(local, sdata, STA_NOTIFY_REMOVE,
&(*sta)->sta); &(*sta)->sta);
sdata = (*sta)->sdata; sdata = (*sta)->sdata;
} }
@ -876,7 +876,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
struct ieee80211_local *local = sdata->local; struct ieee80211_local *local = sdata->local;
int sent, buffered; int sent, buffered;
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_AWAKE, &sta->sta); drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta);
if (!skb_queue_empty(&sta->ps_tx_buf)) if (!skb_queue_empty(&sta->ps_tx_buf))
sta_info_clear_tim_bit(sta); sta_info_clear_tim_bit(sta);

View File

@ -1066,7 +1066,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
struct ieee80211_sub_if_data, struct ieee80211_sub_if_data,
u.ap); u.ap);
drv_sta_notify(local, &sdata->vif, STA_NOTIFY_ADD, drv_sta_notify(local, sdata, STA_NOTIFY_ADD,
&sta->sta); &sta->sta);
} }
spin_unlock_irqrestore(&local->sta_lock, flags); spin_unlock_irqrestore(&local->sta_lock, flags);