Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Eliad Peller and committed by
John W. Linville
abf0b249 32f0fd5b

+68 -30
+25 -1
drivers/net/wireless/ti/wl12xx/main.c
··· 1743 1743 }, 1744 1744 }; 1745 1745 1746 + static 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 + 1759 + static const struct ieee80211_iface_combination 1760 + wl12xx_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 + 1746 1769 static int wl12xx_setup(struct wl1271 *wl) 1747 1770 { 1748 1771 struct wl12xx_priv *priv = wl->priv; ··· 1780 1757 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS; 1781 1758 wl->num_links = WL12XX_MAX_LINKS; 1782 1759 wl->max_ap_stations = WL12XX_MAX_AP_STATIONS; 1783 - wl->num_channels = 1; 1760 + wl->iface_combinations = wl12xx_iface_combinations; 1761 + wl->n_iface_combinations = ARRAY_SIZE(wl12xx_iface_combinations); 1784 1762 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES; 1785 1763 wl->band_rate_to_idx = wl12xx_band_rate_to_idx; 1786 1764 wl->hw_tx_rate_tbl_size = WL12XX_CONF_HW_RXTX_RATE_MAX;
+38 -1
drivers/net/wireless/ti/wl18xx/main.c
··· 1747 1747 }, 1748 1748 }; 1749 1749 1750 + static 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 + 1763 + static const struct ieee80211_iface_limit wl18xx_iface_ap_limits[] = { 1764 + { 1765 + .max = 2, 1766 + .types = BIT(NL80211_IFTYPE_AP), 1767 + }, 1768 + }; 1769 + 1770 + static const struct ieee80211_iface_combination 1771 + wl18xx_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 + 1750 1786 static int wl18xx_setup(struct wl1271 *wl) 1751 1787 { 1752 1788 struct wl18xx_priv *priv = wl->priv; ··· 1796 1760 wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS; 1797 1761 wl->num_links = WL18XX_MAX_LINKS; 1798 1762 wl->max_ap_stations = WL18XX_MAX_AP_STATIONS; 1799 - wl->num_channels = 2; 1763 + wl->iface_combinations = wl18xx_iface_combinations; 1764 + wl->n_iface_combinations = ARRAY_SIZE(wl18xx_iface_combinations); 1800 1765 wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES; 1801 1766 wl->band_rate_to_idx = wl18xx_band_rate_to_idx; 1802 1767 wl->hw_tx_rate_tbl_size = WL18XX_CONF_HW_RXTX_RATE_MAX;
+2 -26
drivers/net/wireless/ti/wlcore/main.c
··· 5690 5690 5691 5691 } 5692 5692 5693 - static 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 - 5706 - static struct ieee80211_iface_combination 5707 - wlcore_iface_combinations[] = { 5708 - { 5709 - .max_interfaces = 3, 5710 - .limits = wlcore_iface_limits, 5711 - .n_limits = ARRAY_SIZE(wlcore_iface_limits), 5712 - }, 5713 - }; 5714 - 5715 5693 static int wl1271_init_ieee80211(struct wl1271 *wl) 5716 5694 { 5717 5695 int i; ··· 5810 5832 NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P; 5811 5833 5812 5834 /* allowed interface combinations */ 5813 - wlcore_iface_combinations[0].num_different_channels = wl->num_channels; 5814 - wl->hw->wiphy->iface_combinations = wlcore_iface_combinations; 5815 - wl->hw->wiphy->n_iface_combinations = 5816 - ARRAY_SIZE(wlcore_iface_combinations); 5835 + wl->hw->wiphy->iface_combinations = wl->iface_combinations; 5836 + wl->hw->wiphy->n_iface_combinations = wl->n_iface_combinations; 5817 5837 5818 5838 SET_IEEE80211_DEV(wl->hw, wl->dev); 5819 5839
+3 -2
drivers/net/wireless/ti/wlcore/wlcore.h
··· 483 483 484 484 struct completion nvs_loading_complete; 485 485 486 - /* number of concurrent channels the HW supports */ 487 - u32 num_channels; 486 + /* interface combinations supported by the hw */ 487 + const struct ieee80211_iface_combination *iface_combinations; 488 + u8 n_iface_combinations; 488 489 }; 489 490 490 491 int wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);