Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259541
b: refs/heads/master
c: 63d8916
h: refs/heads/master
i:
  259539: 6ab92cb
v: v3
  • Loading branch information
Kalle Valo authored and Greg Kroah-Hartman committed Jun 28, 2011
1 parent fc4573c commit 1567858
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e59f0aa71f5d2fdc144259ad80d050c02c3dc14c
refs/heads/master: 63d8916034ef2f577a9662f2a39e2667be75ed37
58 changes: 58 additions & 0 deletions trunk/drivers/staging/ath6kl/os/linux/cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <linux/wireless.h>
#include <linux/ieee80211.h>
#include <net/cfg80211.h>
#include <net/netlink.h>

#include "ar6000_drv.h"

Expand Down Expand Up @@ -1458,6 +1459,62 @@ ar6k_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
return 0;
}

#ifdef CONFIG_NL80211_TESTMODE
enum ar6k_testmode_attr {
__AR6K_TM_ATTR_INVALID = 0,
AR6K_TM_ATTR_CMD = 1,
AR6K_TM_ATTR_DATA = 2,

/* keep last */
__AR6K_TM_ATTR_AFTER_LAST,
AR6K_TM_ATTR_MAX = __AR6K_TM_ATTR_AFTER_LAST - 1
};

enum ar6k_testmode_cmd {
AR6K_TM_CMD_TCMD = 0,
};

#define AR6K_TM_DATA_MAX_LEN 5000

static const struct nla_policy ar6k_testmode_policy[AR6K_TM_ATTR_MAX + 1] = {
[AR6K_TM_ATTR_CMD] = { .type = NLA_U32 },
[AR6K_TM_ATTR_DATA] = { .type = NLA_BINARY,
.len = AR6K_TM_DATA_MAX_LEN },
};

static int ar6k_testmode_cmd(struct wiphy *wiphy, void *data, int len)
{
struct ar6_softc *ar = wiphy_priv(wiphy);
struct nlattr *tb[AR6K_TM_ATTR_MAX + 1];
int err, buf_len;
void *buf;

err = nla_parse(tb, AR6K_TM_ATTR_MAX, data, len,
ar6k_testmode_policy);
if (err)
return err;

if (!tb[AR6K_TM_ATTR_CMD])
return -EINVAL;

switch (nla_get_u32(tb[AR6K_TM_ATTR_CMD])) {
case AR6K_TM_CMD_TCMD:
if (!tb[AR6K_TM_ATTR_DATA])
return -EINVAL;

buf = nla_data(tb[AR6K_TM_ATTR_DATA]);
buf_len = nla_len(tb[AR6K_TM_ATTR_DATA]);

wmi_test_cmd(ar->arWmi, buf, buf_len);

return 0;

break;
default:
return -EOPNOTSUPP;
}
}
#endif

static const
u32 cipher_suites[] = {
Expand Down Expand Up @@ -1633,6 +1690,7 @@ cfg80211_ops ar6k_cfg80211_ops = {
.join_ibss = ar6k_cfg80211_join_ibss,
.leave_ibss = ar6k_cfg80211_leave_ibss,
.get_station = ar6k_get_station,
CFG80211_TESTMODE_CMD(ar6k_testmode_cmd)
};

struct wireless_dev *
Expand Down

0 comments on commit 1567858

Please sign in to comment.