Skip to content

Commit

Permalink
mac80211: fix TX status reporting for ieee80211s
Browse files Browse the repository at this point in the history
TX status reporting to ieee80211s is through ieee80211s_update_metric.
There are two problems about ieee80211s_update_metric:

1. The purpose is to estimate the fail probability
to a specific link. No need to restrict to data frame.

2. Current implementation does not work if wireless driver does not
pass tx_status with skb.

Fix this by removing ieee80211_is_data condition, passing
ieee80211_tx_status directly to ieee80211s_update_metric, and
putting it in both __ieee80211_tx_status and ieee80211_tx_status_ext.

Signed-off-by: Yuan-Chi Pang <fu3mo6goo@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Yuan-Chi Pang authored and Johannes Berg committed Sep 10, 2018
1 parent cb59bc1 commit c420551
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion net/mac80211/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ void mesh_rmc_free(struct ieee80211_sub_if_data *sdata);
int mesh_rmc_init(struct ieee80211_sub_if_data *sdata);
void ieee80211s_init(void);
void ieee80211s_update_metric(struct ieee80211_local *local,
struct sta_info *sta, struct sk_buff *skb);
struct sta_info *sta,
struct ieee80211_tx_status *st);
void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata);
void ieee80211_mesh_teardown_sdata(struct ieee80211_sub_if_data *sdata);
int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata);
Expand Down
9 changes: 3 additions & 6 deletions net/mac80211/mesh_hwmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,12 @@ int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata,
}

void ieee80211s_update_metric(struct ieee80211_local *local,
struct sta_info *sta, struct sk_buff *skb)
struct sta_info *sta,
struct ieee80211_tx_status *st)
{
struct ieee80211_tx_info *txinfo = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
struct ieee80211_tx_info *txinfo = st->info;
int failed;

if (!ieee80211_is_data(hdr->frame_control))
return;

failed = !(txinfo->flags & IEEE80211_TX_STAT_ACK);

/* moving average, scaled to 100.
Expand Down
4 changes: 3 additions & 1 deletion net/mac80211/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw,

rate_control_tx_status(local, sband, status);
if (ieee80211_vif_is_mesh(&sta->sdata->vif))
ieee80211s_update_metric(local, sta, skb);
ieee80211s_update_metric(local, sta, status);

if (!(info->flags & IEEE80211_TX_CTL_INJECTED) && acked)
ieee80211_frame_acked(sta, skb);
Expand Down Expand Up @@ -969,6 +969,8 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw,
}

rate_control_tx_status(local, sband, status);
if (ieee80211_vif_is_mesh(&sta->sdata->vif))
ieee80211s_update_metric(local, sta, status);
}

if (acked || noack_success) {
Expand Down

0 comments on commit c420551

Please sign in to comment.