Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2439ca04 authored by Maxim Altshul's avatar Maxim Altshul Committed by Johannes Berg
Browse files

mac80211: Add ieee80211_hw pointer to get_expected_throughput



The variable is added to allow the driver an easy access to
it's own hw->priv when the op is invoked.

This fixes a crash in wlcore because it was relying on a
station pointer that wasn't initialized yet. It's the wrong
way to fix the crash, but it solves the problem for now and
it does make sense to have the hw pointer here.

Signed-off-by: default avatarMaxim Altshul <maxim.altshul@ti.com>
[rewrite commit message, fix indentation]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 9757235f
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -5700,10 +5700,11 @@ static void wlcore_op_sta_statistics(struct ieee80211_hw *hw,
	mutex_unlock(&wl->mutex);
}

static u32 wlcore_op_get_expected_throughput(struct ieee80211_sta *sta)
static u32 wlcore_op_get_expected_throughput(struct ieee80211_hw *hw,
					     struct ieee80211_sta *sta)
{
	struct wl1271_station *wl_sta = (struct wl1271_station *)sta->drv_priv;
	struct wl1271 *wl = wl_sta->wl;
	struct wl1271 *wl = hw->priv;
	u8 hlid = wl_sta->hlid;

	/* return in units of Kbps */
+2 −1
Original line number Diff line number Diff line
@@ -3620,7 +3620,8 @@ struct ieee80211_ops {

	int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
	void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
	u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
	u32 (*get_expected_throughput)(struct ieee80211_hw *hw,
				       struct ieee80211_sta *sta);
	int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
			   int *dbm);

+1 −1
Original line number Diff line number Diff line
@@ -1094,7 +1094,7 @@ static inline u32 drv_get_expected_throughput(struct ieee80211_local *local,

	trace_drv_get_expected_throughput(sta);
	if (local->ops->get_expected_throughput)
		ret = local->ops->get_expected_throughput(sta);
		ret = local->ops->get_expected_throughput(&local->hw, sta);
	trace_drv_return_u32(local, ret);

	return ret;