aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-05-13 04:58:57 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-16 14:10:40 -0400
commit7527a782e187d1214a5b3dc2897ce441033bb4ef (patch)
tree3310adf988e72cb91736c0638d4c17edcccebfe1 /include/net
parent805d7d23ef9806e47b550ad80270c4cea4ffc984 (diff)
cfg80211: advertise possible interface combinations
Add the ability to advertise interface combinations in nl80211. This allows the driver to indicate what the combinations are that it supports. "Combinations" of just a single interface are implicit, as previously. Note that cfg80211 will enforce that the restrictions are met, but not for all drivers yet (once all drivers are updated, we can remove the flag and enforce for all). When no combinations are actually supported, an empty list will be exported so that userspace can know if the kernel exported this info or not (although it isn't clear to me what tools using the info should do if the kernel didn't export it). Since some interface types are purely virtual/software and don't fit the restrictions, those are exposed in a new list of pure SW types, not subject to restrictions. This mainly exists to handle AP-VLAN and monitor interfaces in mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h88
1 files changed, 88 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e1f1b41f7b13..04afcfb9eaf4 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -1547,6 +1547,10 @@ struct cfg80211_ops {
1547 * hints read the documenation for regulatory_hint_found_beacon() 1547 * hints read the documenation for regulatory_hint_found_beacon()
1548 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this 1548 * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this
1549 * wiphy at all 1549 * wiphy at all
1550 * @WIPHY_FLAG_ENFORCE_COMBINATIONS: Set this flag to enforce interface
1551 * combinations for this device. This flag is used for backward
1552 * compatibility only until all drivers advertise combinations and
1553 * they will always be enforced.
1550 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled 1554 * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled
1551 * by default -- this flag will be set depending on the kernel's default 1555 * by default -- this flag will be set depending on the kernel's default
1552 * on wiphy_new(), but can be changed by the driver if it has a good 1556 * on wiphy_new(), but can be changed by the driver if it has a good
@@ -1574,6 +1578,81 @@ enum wiphy_flags {
1574 WIPHY_FLAG_IBSS_RSN = BIT(8), 1578 WIPHY_FLAG_IBSS_RSN = BIT(8),
1575 WIPHY_FLAG_MESH_AUTH = BIT(10), 1579 WIPHY_FLAG_MESH_AUTH = BIT(10),
1576 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11), 1580 WIPHY_FLAG_SUPPORTS_SCHED_SCAN = BIT(11),
1581 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
1582};
1583
1584/**
1585 * struct ieee80211_iface_limit - limit on certain interface types
1586 * @max: maximum number of interfaces of these types
1587 * @types: interface types (bits)
1588 */
1589struct ieee80211_iface_limit {
1590 u16 max;
1591 u16 types;
1592};
1593
1594/**
1595 * struct ieee80211_iface_combination - possible interface combination
1596 * @limits: limits for the given interface types
1597 * @n_limits: number of limitations
1598 * @num_different_channels: can use up to this many different channels
1599 * @max_interfaces: maximum number of interfaces in total allowed in this
1600 * group
1601 * @beacon_int_infra_match: In this combination, the beacon intervals
1602 * between infrastructure and AP types must match. This is required
1603 * only in special cases.
1604 *
1605 * These examples can be expressed as follows:
1606 *
1607 * Allow #STA <= 1, #AP <= 1, matching BI, channels = 1, 2 total:
1608 *
1609 * struct ieee80211_iface_limit limits1[] = {
1610 * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
1611 * { .max = 1, .types = BIT(NL80211_IFTYPE_AP}, },
1612 * };
1613 * struct ieee80211_iface_combination combination1 = {
1614 * .limits = limits1,
1615 * .n_limits = ARRAY_SIZE(limits1),
1616 * .max_interfaces = 2,
1617 * .beacon_int_infra_match = true,
1618 * };
1619 *
1620 *
1621 * Allow #{AP, P2P-GO} <= 8, channels = 1, 8 total:
1622 *
1623 * struct ieee80211_iface_limit limits2[] = {
1624 * { .max = 8, .types = BIT(NL80211_IFTYPE_AP) |
1625 * BIT(NL80211_IFTYPE_P2P_GO), },
1626 * };
1627 * struct ieee80211_iface_combination combination2 = {
1628 * .limits = limits2,
1629 * .n_limits = ARRAY_SIZE(limits2),
1630 * .max_interfaces = 8,
1631 * .num_different_channels = 1,
1632 * };
1633 *
1634 *
1635 * Allow #STA <= 1, #{P2P-client,P2P-GO} <= 3 on two channels, 4 total.
1636 * This allows for an infrastructure connection and three P2P connections.
1637 *
1638 * struct ieee80211_iface_limit limits3[] = {
1639 * { .max = 1, .types = BIT(NL80211_IFTYPE_STATION), },
1640 * { .max = 3, .types = BIT(NL80211_IFTYPE_P2P_GO) |
1641 * BIT(NL80211_IFTYPE_P2P_CLIENT), },
1642 * };
1643 * struct ieee80211_iface_combination combination3 = {
1644 * .limits = limits3,
1645 * .n_limits = ARRAY_SIZE(limits3),
1646 * .max_interfaces = 4,
1647 * .num_different_channels = 2,
1648 * };
1649 */
1650struct ieee80211_iface_combination {
1651 const struct ieee80211_iface_limit *limits;
1652 u32 num_different_channels;
1653 u16 max_interfaces;
1654 u8 n_limits;
1655 bool beacon_int_infra_match;
1577}; 1656};
1578 1657
1579struct mac_address { 1658struct mac_address {
@@ -1653,6 +1732,11 @@ struct wiphy_wowlan_support {
1653 * @priv: driver private data (sized according to wiphy_new() parameter) 1732 * @priv: driver private data (sized according to wiphy_new() parameter)
1654 * @interface_modes: bitmask of interfaces types valid for this wiphy, 1733 * @interface_modes: bitmask of interfaces types valid for this wiphy,
1655 * must be set by driver 1734 * must be set by driver
1735 * @iface_combinations: Valid interface combinations array, should not
1736 * list single interface types.
1737 * @n_iface_combinations: number of entries in @iface_combinations array.
1738 * @software_iftypes: bitmask of software interface types, these are not
1739 * subject to any restrictions since they are purely managed in SW.
1656 * @flags: wiphy flags, see &enum wiphy_flags 1740 * @flags: wiphy flags, see &enum wiphy_flags
1657 * @bss_priv_size: each BSS struct has private data allocated with it, 1741 * @bss_priv_size: each BSS struct has private data allocated with it,
1658 * this variable determines its size 1742 * this variable determines its size
@@ -1697,6 +1781,10 @@ struct wiphy {
1697 1781
1698 const struct ieee80211_txrx_stypes *mgmt_stypes; 1782 const struct ieee80211_txrx_stypes *mgmt_stypes;
1699 1783
1784 const struct ieee80211_iface_combination *iface_combinations;
1785 int n_iface_combinations;
1786 u16 software_iftypes;
1787
1700 u16 n_addresses; 1788 u16 n_addresses;
1701 1789
1702 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1790 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */