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

Commit 434781b5 authored by Johannes Berg's avatar Johannes Berg Committed by Rajeev Kumar Sirasanagandla
Browse files

mac80211: allow passing transmitter station on RX



Sometimes drivers already looked up, or know out-of-band
from their device, which station transmitted a given RX
frame. Allow them to pass the station pointer to mac80211
to save the extra lookup.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>

Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git


Git-commit: d63b548fffdbd239a5e65bb89424be19229048ba
CRs-Fixed: 1112914
[rsirasan@codeaurora.org: pulled changes only in kernel header
file and mac80211 subsystem]
Change-Id: Ie35906d1e9df1ebe7f72e7a6df3293117abdec57
Signed-off-by: default avatarRajeev Kumar Sirasanagandla <rsirasan@codeaurora.org>
parent 0236a032
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -3751,11 +3751,12 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw);
 * This function must be called with BHs disabled.
 *
 * @hw: the hardware this frame came in on
 * @sta: the station the frame was received from, or %NULL
 * @skb: the buffer to receive, owned by mac80211 after this call
 * @napi: the NAPI context
 */
void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
		       struct napi_struct *napi);
void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
		       struct sk_buff *skb, struct napi_struct *napi);

/**
 * ieee80211_rx - receive frame
@@ -3779,7 +3780,7 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
 */
static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb)
{
	ieee80211_rx_napi(hw, skb, NULL);
	ieee80211_rx_napi(hw, NULL, skb, NULL);
}

/**
+13 −5
Original line number Diff line number Diff line
@@ -3447,6 +3447,7 @@ static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx,
 * be called with rcu_read_lock protection.
 */
static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
					 struct ieee80211_sta *pubsta,
					 struct sk_buff *skb,
					 struct napi_struct *napi)
{
@@ -3456,7 +3457,6 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
	__le16 fc;
	struct ieee80211_rx_data rx;
	struct ieee80211_sub_if_data *prev;
	struct sta_info *sta, *prev_sta;
	struct rhash_head *tmp;
	int err = 0;

@@ -3492,7 +3492,14 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
		     ieee80211_is_beacon(hdr->frame_control)))
		ieee80211_scan_rx(local, skb);

	if (ieee80211_is_data(fc)) {
	if (pubsta) {
		rx.sta = container_of(pubsta, struct sta_info, sta);
		rx.sdata = rx.sta->sdata;
		if (ieee80211_prepare_and_rx_handle(&rx, skb, true))
			return;
		goto out;
	} else if (ieee80211_is_data(fc)) {
		struct sta_info *sta, *prev_sta;
		const struct bucket_table *tbl;

		prev_sta = NULL;
@@ -3566,8 +3573,8 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
 * This is the receive path handler. It is called by a low level driver when an
 * 802.11 MPDU is received from the hardware.
 */
void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
		       struct napi_struct *napi)
void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta,
		       struct sk_buff *skb, struct napi_struct *napi)
{
	struct ieee80211_local *local = hw_to_local(hw);
	struct ieee80211_rate *rate = NULL;
@@ -3666,7 +3673,8 @@ void ieee80211_rx_napi(struct ieee80211_hw *hw, struct sk_buff *skb,
	ieee80211_tpt_led_trig_rx(local,
			((struct ieee80211_hdr *)skb->data)->frame_control,
			skb->len);
	__ieee80211_rx_handle_packet(hw, skb, napi);

	__ieee80211_rx_handle_packet(hw, pubsta, skb, napi);

	rcu_read_unlock();