aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2014-02-10 06:47:24 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-13 15:20:15 -0500
commitabf0b24912640c4fa94b0a2f22ee9d51c8521b16 (patch)
tree32172300f891727565e1d2633550241f2bdcb219
parent32f0fd5b700064f821105be041d0075decc4ec64 (diff)
wlcore/wl12xx/wl18xx: configure iface_combinations per-hw
Each hw supports a different iface combinations. Define the supported combinations in each driver, and save it in wl->iface_combinations. Since each driver defines its own combinations now, it can also define its max supported channels, so we no longer need to save and set it explicitly in wlcore. Update wl18xx interface combinations to allow multiple APs. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c26
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c39
-rw-r--r--drivers/net/wireless/ti/wlcore/main.c28
-rw-r--r--drivers/net/wireless/ti/wlcore/wlcore.h5
4 files changed, 68 insertions, 30 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index f486f0f8becb..33071a770630 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1743,6 +1743,29 @@ static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
1743 }, 1743 },
1744}; 1744};
1745 1745
1746static const struct ieee80211_iface_limit wl12xx_iface_limits[] = {
1747 {
1748 .max = 3,
1749 .types = BIT(NL80211_IFTYPE_STATION),
1750 },
1751 {
1752 .max = 1,
1753 .types = BIT(NL80211_IFTYPE_AP) |
1754 BIT(NL80211_IFTYPE_P2P_GO) |
1755 BIT(NL80211_IFTYPE_P2P_CLIENT),
1756 },
1757};
1758
1759static const struct ieee80211_iface_combination
1760wl12xx_iface_combinations[] = {
1761 {
1762 .max_interfaces = 3,
1763 .limits = wl12xx_iface_limits,
1764 .n_limits = ARRAY_SIZE(wl12xx_iface_limits),
1765 .num_different_channels = 1,
1766 },
1767};
1768
1746static int wl12xx_setup(struct wl1271 *wl) 1769static int wl12xx_setup(struct wl1271 *wl)
1747{ 1770{
1748 struct wl12xx_priv *priv = wl->priv; 1771 struct wl12xx_priv *priv = wl->priv;
@@ -1757,7 +1780,8 @@ static int wl12xx_setup(struct wl1271 *wl)
1757 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS; 1780 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS;
1758 wl->num_links = WL12XX_MAX_LINKS; 1781 wl->num_links = WL12XX_MAX_LINKS;
1759 wl->max_ap_stations = WL12XX_MAX_AP_STATIONS; 1782 wl->max_ap_stations = WL12XX_MAX_AP_STATIONS;
1760 wl->num_channels = 1; 1783 wl->iface_combinations = wl12xx_iface_combinations;
1784 wl->n_iface_combinations = ARRAY_SIZE(wl12xx_iface_combinations);
1761 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES; 1785 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES;
1762 wl->band_rate_to_idx = wl12xx_band_rate_to_idx; 1786 wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
1763 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX; 1787 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index f19e9b5af589..966a866d76f0 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -1747,6 +1747,42 @@ static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_2ghz = {
1747 }, 1747 },
1748}; 1748};
1749 1749
1750static const struct ieee80211_iface_limit wl18xx_iface_limits[] = {
1751 {
1752 .max = 3,
1753 .types = BIT(NL80211_IFTYPE_STATION),
1754 },
1755 {
1756 .max = 1,
1757 .types = BIT(NL80211_IFTYPE_AP) |
1758 BIT(NL80211_IFTYPE_P2P_GO) |
1759 BIT(NL80211_IFTYPE_P2P_CLIENT),
1760 },
1761};
1762
1763static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = {
1764 {
1765 .max = 2,
1766 .types = BIT(NL80211_IFTYPE_AP),
1767 },
1768};
1769
1770static const struct ieee80211_iface_combination
1771wl18xx_iface_combinations[] = {
1772 {
1773 .max_interfaces = 3,
1774 .limits = wl18xx_iface_limits,
1775 .n_limits = ARRAY_SIZE(wl18xx_iface_limits),
1776 .num_different_channels = 2,
1777 },
1778 {
1779 .max_interfaces = 2,
1780 .limits = wl18xx_iface_ap_limits,
1781 .n_limits = ARRAY_SIZE(wl18xx_iface_ap_limits),
1782 .num_different_channels = 1,
1783 }
1784};
1785
1750static int wl18xx_setup(struct wl1271 *wl) 1786static int wl18xx_setup(struct wl1271 *wl)
1751{ 1787{
1752 struct wl18xx_priv *priv = wl->priv; 1788 struct wl18xx_priv *priv = wl->priv;
@@ -1760,7 +1796,8 @@ static int wl18xx_setup(struct wl1271 *wl)
1760 wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS; 1796 wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS;
1761 wl->num_links = WL18XX_MAX_LINKS; 1797 wl->num_links = WL18XX_MAX_LINKS;
1762 wl->max_ap_stations = WL18XX_MAX_AP_STATIONS; 1798 wl->max_ap_stations = WL18XX_MAX_AP_STATIONS;
1763 wl->num_channels = 2; 1799 wl->iface_combinations = wl18xx_iface_combinations;
1800 wl->n_iface_combinations = ARRAY_SIZE(wl18xx_iface_combinations);
1764 wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES; 1801 wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES;
1765 wl->band_rate_to_idx = wl18xx_band_rate_to_idx; 1802 wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
1766 wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX; 1803 wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index b649726828f9..d16fb7e0eb98 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -5690,28 +5690,6 @@ static void wl1271_unregister_hw(struct wl1271 *wl)
5690 5690
5691} 5691}
5692 5692
5693static const struct ieee80211_iface_limit wlcore_iface_limits[] = {
5694 {
5695 .max = 3,
5696 .types = BIT(NL80211_IFTYPE_STATION),
5697 },
5698 {
5699 .max = 1,
5700 .types = BIT(NL80211_IFTYPE_AP) |
5701 BIT(NL80211_IFTYPE_P2P_GO) |
5702 BIT(NL80211_IFTYPE_P2P_CLIENT),
5703 },
5704};
5705
5706static struct ieee80211_iface_combination
5707wlcore_iface_combinations[] = {
5708 {
5709 .max_interfaces = 3,
5710 .limits = wlcore_iface_limits,
5711 .n_limits = ARRAY_SIZE(wlcore_iface_limits),
5712 },
5713};
5714
5715static int wl1271_init_ieee80211(struct wl1271 *wl) 5693static int wl1271_init_ieee80211(struct wl1271 *wl)
5716{ 5694{
5717 int i; 5695 int i;
@@ -5832,10 +5810,8 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
5832 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P; 5810 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P;
5833 5811
5834 /* allowed interface combinations */ 5812 /* allowed interface combinations */
5835 wlcore_iface_combinations[0].num_different_channels = wl->num_channels; 5813 wl->hw->wiphy->iface_combinations = wl->iface_combinations;
5836 wl->hw->wiphy->iface_combinations = wlcore_iface_combinations; 5814 wl->hw->wiphy->n_iface_combinations = wl->n_iface_combinations;
5837 wl->hw->wiphy->n_iface_combinations =
5838 ARRAY_SIZE(wlcore_iface_combinations);
5839 5815
5840 SET_IEEE80211_DEV(wl->hw, wl->dev); 5816 SET_IEEE80211_DEV(wl->hw, wl->dev);
5841 5817
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h
index 2356bddc7cdb..a1cc1c639fd6 100644
--- a/drivers/net/wireless/ti/wlcore/wlcore.h
+++ b/drivers/net/wireless/ti/wlcore/wlcore.h
@@ -483,8 +483,9 @@ struct wl1271 {
483 483
484 struct completion nvs_loading_complete; 484 struct completion nvs_loading_complete;
485 485
486 /* number of concurrent channels the HW supports */ 486 /* interface combinations supported by the hw */
487 u32 num_channels; 487 const struct ieee80211_iface_combination *iface_combinations;
488 u8 n_iface_combinations;
488}; 489};
489 490
490int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev); 491int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);