Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150402
b: refs/heads/master
c: 73606d0
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Wagner authored and John W. Linville committed May 20, 2009
1 parent 76b0399 commit 2bf9887
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 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: 1071db863b129847cedb65339d1e87ecf5952a8b
refs/heads/master: 73606d00360cb93963aeb7bfbf8bfdbc51cfab9f
35 changes: 34 additions & 1 deletion trunk/drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ struct mac80211_hwsim_data {
bool ps_poll_pending;
struct dentry *debugfs;
struct dentry *debugfs_ps;

/*
* Only radios in the same group can communicate together (the
* channel has to match too). Each bit represents a group. A
* radio can be in more then one group.
*/
u64 group;
struct dentry *debugfs_group;
};


Expand Down Expand Up @@ -412,7 +420,8 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,

if (!data2->started || !data2->radio_enabled ||
!hwsim_ps_rx_ok(data2, skb) ||
data->channel->center_freq != data2->channel->center_freq)
data->channel->center_freq != data2->channel->center_freq ||
!(data->group & data2->group))
continue;

nskb = skb_copy(skb, GFP_ATOMIC);
Expand Down Expand Up @@ -720,6 +729,7 @@ static void mac80211_hwsim_free(void)
spin_unlock_bh(&hwsim_radio_lock);

list_for_each_entry(data, &tmplist, list) {
debugfs_remove(data->debugfs_group);
debugfs_remove(data->debugfs_ps);
debugfs_remove(data->debugfs);
ieee80211_unregister_hw(data->hw);
Expand Down Expand Up @@ -872,6 +882,24 @@ DEFINE_SIMPLE_ATTRIBUTE(hwsim_fops_ps, hwsim_fops_ps_read, hwsim_fops_ps_write,
"%llu\n");


static int hwsim_fops_group_read(void *dat, u64 *val)
{
struct mac80211_hwsim_data *data = dat;
*val = data->group;
return 0;
}

static int hwsim_fops_group_write(void *dat, u64 val)
{
struct mac80211_hwsim_data *data = dat;
data->group = val;
return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(hwsim_fops_group,
hwsim_fops_group_read, hwsim_fops_group_write,
"%llx\n");

static int __init init_mac80211_hwsim(void)
{
int i, err = 0;
Expand Down Expand Up @@ -976,6 +1004,8 @@ static int __init init_mac80211_hwsim(void)

hw->wiphy->bands[band] = sband;
}
/* By default all radios are belonging to the first group */
data->group = 1;

/* Work to be done prior to ieee80211_register_hw() */
switch (regtest) {
Expand Down Expand Up @@ -1100,6 +1130,9 @@ static int __init init_mac80211_hwsim(void)
data->debugfs_ps = debugfs_create_file("ps", 0666,
data->debugfs, data,
&hwsim_fops_ps);
data->debugfs_group = debugfs_create_file("group", 0666,
data->debugfs, data,
&hwsim_fops_group);

setup_timer(&data->beacon_timer, mac80211_hwsim_beacon,
(unsigned long) hw);
Expand Down

0 comments on commit 2bf9887

Please sign in to comment.