Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183309
b: refs/heads/master
c: 265dc7f
h: refs/heads/master
i:
  183307: 936e94d
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Dec 22, 2009
1 parent 2ef4496 commit fddcc7b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c7e6bc9ac7cb518cf037495932d80f71a1596f2
refs/heads/master: 265dc7f0964e4df95ab57a9d1618689301d39a55
35 changes: 33 additions & 2 deletions trunk/drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,38 @@ static bool hwsim_ps_rx_ok(struct mac80211_hwsim_data *data,
}


struct mac80211_hwsim_addr_match_data {
bool ret;
const u8 *addr;
};

static void mac80211_hwsim_addr_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct mac80211_hwsim_addr_match_data *md = data;
if (memcmp(mac, md->addr, ETH_ALEN) == 0)
md->ret = true;
}


static bool mac80211_hwsim_addr_match(struct mac80211_hwsim_data *data,
const u8 *addr)
{
struct mac80211_hwsim_addr_match_data md;

if (memcmp(addr, data->hw->wiphy->perm_addr, ETH_ALEN) == 0)
return true;

md.ret = false;
md.addr = addr;
ieee80211_iterate_active_interfaces_atomic(data->hw,
mac80211_hwsim_addr_iter,
&md);

return md.ret;
}


static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
struct sk_buff *skb)
{
Expand Down Expand Up @@ -488,8 +520,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
if (nskb == NULL)
continue;

if (memcmp(hdr->addr1, data2->hw->wiphy->perm_addr,
ETH_ALEN) == 0)
if (mac80211_hwsim_addr_match(data2, hdr->addr1))
ack = true;
memcpy(IEEE80211_SKB_RXCB(nskb), &rx_status, sizeof(rx_status));
ieee80211_rx_irqsafe(data2->hw, nskb);
Expand Down

0 comments on commit fddcc7b

Please sign in to comment.