Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300423
b: refs/heads/master
c: 633c938
h: refs/heads/master
i:
  300421: 2e4dda4
  300419: 5e7274c
  300415: 815f0fd
v: v3
  • Loading branch information
David S. Miller committed Apr 2, 2012
1 parent 9b75cc1 commit 533e75d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 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: d33e152e1edd2679cc2c49be0a3604fbabafece7
refs/heads/master: 633c938940cdb79d2a9e54f411f6c26ff09b451b
24 changes: 15 additions & 9 deletions trunk/drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,13 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
goto nla_put_failure;
}

NLA_PUT(skb, HWSIM_ATTR_ADDR_TRANSMITTER,
sizeof(struct mac_address), data->addresses[1].addr);
if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER,
sizeof(struct mac_address), data->addresses[1].addr))
goto nla_put_failure;

/* We get the skb->data */
NLA_PUT(skb, HWSIM_ATTR_FRAME, my_skb->len, my_skb->data);
if (nla_put(skb, HWSIM_ATTR_FRAME, my_skb->len, my_skb->data))
goto nla_put_failure;

/* We get the flags for this transmission, and we translate them to
wmediumd flags */
Expand All @@ -597,7 +599,8 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
if (info->flags & IEEE80211_TX_CTL_NO_ACK)
hwsim_flags |= HWSIM_TX_CTL_NO_ACK;

NLA_PUT_U32(skb, HWSIM_ATTR_FLAGS, hwsim_flags);
if (nla_put_u32(skb, HWSIM_ATTR_FLAGS, hwsim_flags))
goto nla_put_failure;

/* We get the tx control (rate and retries) info*/

Expand All @@ -606,12 +609,14 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
tx_attempts[i].count = info->status.rates[i].count;
}

NLA_PUT(skb, HWSIM_ATTR_TX_INFO,
sizeof(struct hwsim_tx_rate)*IEEE80211_TX_MAX_RATES,
tx_attempts);
if (nla_put(skb, HWSIM_ATTR_TX_INFO,
sizeof(struct hwsim_tx_rate)*IEEE80211_TX_MAX_RATES,
tx_attempts))
goto nla_put_failure;

/* We create a cookie to identify this skb */
NLA_PUT_U64(skb, HWSIM_ATTR_COOKIE, (unsigned long) my_skb);
if (nla_put_u64(skb, HWSIM_ATTR_COOKIE, (unsigned long) my_skb))
goto nla_put_failure;

genlmsg_end(skb, msg_head);
genlmsg_unicast(&init_net, skb, dst_pid);
Expand Down Expand Up @@ -1108,7 +1113,8 @@ static int mac80211_hwsim_testmode_cmd(struct ieee80211_hw *hw,
nla_total_size(sizeof(u32)));
if (!skb)
return -ENOMEM;
NLA_PUT_U32(skb, HWSIM_TM_ATTR_PS, hwsim->ps);
if (nla_put_u32(skb, HWSIM_TM_ATTR_PS, hwsim->ps))
goto nla_put_failure;
return cfg80211_testmode_reply(skb);
default:
return -EOPNOTSUPP;
Expand Down

0 comments on commit 533e75d

Please sign in to comment.