Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107115
b: refs/heads/master
c: 14db74b
h: refs/heads/master
i:
  107113: 2ba4594
  107111: 5439a69
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Jul 29, 2008
1 parent b6468bf commit f104b05
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 16 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: bba95fefb8e31f4799652666d05a4a9aad56e492
refs/heads/master: 14db74bcc3f7a779cf395a47e26b06a28207571a
103 changes: 88 additions & 15 deletions trunk/net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct net_device *dev;
enum ieee80211_if_types itype;
struct ieee80211_sub_if_data *sdata;
Expand All @@ -95,6 +96,9 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex,
if (itype == IEEE80211_IF_TYPE_INVALID)
return -EINVAL;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

ret = ieee80211_if_change_type(sdata, itype);
Expand All @@ -117,12 +121,16 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, u8 *mac_addr,
struct key_params *params)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta = NULL;
enum ieee80211_key_alg alg;
struct ieee80211_key *key;
int err;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

switch (params->cipher) {
Expand Down Expand Up @@ -167,10 +175,14 @@ static int ieee80211_add_key(struct wiphy *wiphy, struct net_device *dev,
static int ieee80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, u8 *mac_addr)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta;
int ret;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

rcu_read_lock();
Expand Down Expand Up @@ -211,7 +223,8 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
void (*callback)(void *cookie,
struct key_params *params))
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta = NULL;
u8 seq[6] = {0};
struct key_params params;
Expand All @@ -220,6 +233,11 @@ static int ieee80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u16 iv16;
int err = -ENOENT;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

rcu_read_lock();

if (mac_addr) {
Expand Down Expand Up @@ -293,8 +311,12 @@ static int ieee80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx)
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;

if (dev == local->mdev)
return -EOPNOTSUPP;

rcu_read_lock();

sdata = IEEE80211_DEV_TO_SUB_IF(dev);
Expand Down Expand Up @@ -475,9 +497,15 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct beacon_data *old;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_AP)
return -EINVAL;

Expand All @@ -492,9 +520,15 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev,
static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct beacon_data *old;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_AP)
return -EINVAL;

Expand All @@ -508,9 +542,15 @@ static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,

static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct beacon_data *old;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_AP)
return -EINVAL;

Expand Down Expand Up @@ -646,11 +686,14 @@ static void sta_apply_parameters(struct ieee80211_local *local,
static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_parameters *params)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct sta_info *sta;
struct ieee80211_sub_if_data *sdata;
int err;

if (dev == local->mdev || params->vlan == local->mdev)
return -EOPNOTSUPP;

/* Prevent a race with changing the rate control algorithm */
if (!netif_running(dev))
return -ENETDOWN;
Expand Down Expand Up @@ -701,10 +744,15 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
static int ieee80211_del_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = sdata->local;
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct sta_info *sta;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (mac) {
rcu_read_lock();

Expand All @@ -730,10 +778,13 @@ static int ieee80211_change_station(struct wiphy *wiphy,
u8 *mac,
struct station_parameters *params)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct sta_info *sta;
struct ieee80211_sub_if_data *vlansdata;

if (dev == local->mdev || params->vlan == local->mdev)
return -EOPNOTSUPP;

rcu_read_lock();

/* XXX: get sta belonging to dev */
Expand All @@ -752,7 +803,7 @@ static int ieee80211_change_station(struct wiphy *wiphy,
return -EINVAL;
}

sta->sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan);
sta->sdata = vlansdata;
ieee80211_send_layer2_update(sta);
}

Expand All @@ -767,15 +818,20 @@ static int ieee80211_change_station(struct wiphy *wiphy,
static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
u8 *dst, u8 *next_hop)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct mesh_path *mpath;
struct sta_info *sta;
int err;

if (dev == local->mdev)
return -EOPNOTSUPP;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)
return -ENOTSUPP;

Expand Down Expand Up @@ -817,14 +873,19 @@ static int ieee80211_change_mpath(struct wiphy *wiphy,
struct net_device *dev,
u8 *dst, u8 *next_hop)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct mesh_path *mpath;
struct sta_info *sta;

if (dev == local->mdev)
return -EOPNOTSUPP;

if (!netif_running(dev))
return -ENETDOWN;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)
return -ENOTSUPP;

Expand Down Expand Up @@ -891,9 +952,15 @@ static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev,
u8 *dst, u8 *next_hop, struct mpath_info *pinfo)

{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct mesh_path *mpath;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)
return -ENOTSUPP;

Expand All @@ -913,9 +980,15 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev,
int idx, u8 *dst, u8 *next_hop,
struct mpath_info *pinfo)
{
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata;
struct mesh_path *mpath;

if (dev == local->mdev)
return -EOPNOTSUPP;

sdata = IEEE80211_DEV_TO_SUB_IF(dev);

if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)
return -ENOTSUPP;

Expand Down

0 comments on commit f104b05

Please sign in to comment.