Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328312
b: refs/heads/master
c: 55d2e9d
h: refs/heads/master
v: v3
  • Loading branch information
Gertjan van Wingerde authored and John W. Linville committed Sep 25, 2012
1 parent 6fcdc83 commit 927cb70
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 40 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: 3e4c4151e56ff367fb1487ea79134eea74104077
refs/heads/master: 55d2e9da744ba11eae900b4bfc2da72eace3c1e1
14 changes: 14 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00.h
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,14 @@ enum rt2x00_capability_flags {
CAPABILITY_VCO_RECALIBRATION,
};

/*
* Interface combinations
*/
enum {
IF_COMB_AP = 0,
NUM_IF_COMB,
};

/*
* rt2x00 device structure.
*/
Expand Down Expand Up @@ -866,6 +874,12 @@ struct rt2x00_dev {
unsigned int intf_associated;
unsigned int intf_beaconing;

/*
* Interface combinations
*/
struct ieee80211_iface_limit if_limits_ap;
struct ieee80211_iface_combination if_combinations[NUM_IF_COMB];

/*
* Link quality
*/
Expand Down
33 changes: 33 additions & 0 deletions trunk/drivers/net/wireless/rt2x00/rt2x00dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,13 +1118,46 @@ void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev)
rt2x00dev->intf_associated = 0;
}

static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev)
{
struct ieee80211_iface_limit *if_limit;
struct ieee80211_iface_combination *if_combination;

/*
* Build up AP interface limits structure.
*/
if_limit = &rt2x00dev->if_limits_ap;
if_limit->max = rt2x00dev->ops->max_ap_intf;
if_limit->types = BIT(NL80211_IFTYPE_AP);

/*
* Build up AP interface combinations structure.
*/
if_combination = &rt2x00dev->if_combinations[IF_COMB_AP];
if_combination->limits = if_limit;
if_combination->n_limits = 1;
if_combination->max_interfaces = if_limit->max;
if_combination->num_different_channels = 1;

/*
* Finally, specify the possible combinations to mac80211.
*/
rt2x00dev->hw->wiphy->iface_combinations = rt2x00dev->if_combinations;
rt2x00dev->hw->wiphy->n_iface_combinations = 1;
}

/*
* driver allocation handlers.
*/
int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
{
int retval = -ENOMEM;

/*
* Set possible interface combinations.
*/
rt2x00lib_set_if_combinations(rt2x00dev);

/*
* Allocate the driver data memory, if necessary.
*/
Expand Down
39 changes: 0 additions & 39 deletions trunk/drivers/net/wireless/rt2x00/rt2x00mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,45 +214,6 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
!test_bit(DEVICE_STATE_STARTED, &rt2x00dev->flags))
return -ENODEV;

switch (vif->type) {
case NL80211_IFTYPE_AP:
/*
* We don't support mixed combinations of
* sta and ap interfaces.
*/
if (rt2x00dev->intf_sta_count)
return -ENOBUFS;

/*
* Check if we exceeded the maximum amount
* of supported interfaces.
*/
if (rt2x00dev->intf_ap_count >= rt2x00dev->ops->max_ap_intf)
return -ENOBUFS;

break;
case NL80211_IFTYPE_STATION:
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_MESH_POINT:
case NL80211_IFTYPE_WDS:
/*
* We don't support mixed combinations of
* sta and ap interfaces.
*/
if (rt2x00dev->intf_ap_count)
return -ENOBUFS;

/*
* We don't support multiple STA interfaces.
*/
if (rt2x00dev->intf_sta_count)
return -ENOBUFS;

break;
default:
return -EINVAL;
}

/*
* Loop through all beacon queues to find a free
* entry. Since there are as much beacon entries
Expand Down

0 comments on commit 927cb70

Please sign in to comment.