aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl18xx/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r--drivers/net/wireless/ti/wl18xx/main.c85
1 files changed, 81 insertions, 4 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c
index ec37b16585df..de5b4fa5d166 100644
--- a/drivers/net/wireless/ti/wl18xx/main.c
+++ b/drivers/net/wireless/ti/wl18xx/main.c
@@ -648,7 +648,7 @@ static const struct wl18xx_clk_cfg wl18xx_clk_table[NUM_CLOCK_CONFIGS] = {
648}; 648};
649 649
650/* TODO: maybe move to a new header file? */ 650/* TODO: maybe move to a new header file? */
651#define WL18XX_FW_NAME "ti-connectivity/wl18xx-fw-2.bin" 651#define WL18XX_FW_NAME "ti-connectivity/wl18xx-fw-3.bin"
652 652
653static int wl18xx_identify_chip(struct wl1271 *wl) 653static int wl18xx_identify_chip(struct wl1271 *wl)
654{ 654{
@@ -1133,6 +1133,39 @@ static int wl18xx_hw_init(struct wl1271 *wl)
1133 return ret; 1133 return ret;
1134} 1134}
1135 1135
1136static void wl18xx_convert_fw_status(struct wl1271 *wl, void *raw_fw_status,
1137 struct wl_fw_status *fw_status)
1138{
1139 struct wl18xx_fw_status *int_fw_status = raw_fw_status;
1140
1141 fw_status->intr = le32_to_cpu(int_fw_status->intr);
1142 fw_status->fw_rx_counter = int_fw_status->fw_rx_counter;
1143 fw_status->drv_rx_counter = int_fw_status->drv_rx_counter;
1144 fw_status->tx_results_counter = int_fw_status->tx_results_counter;
1145 fw_status->rx_pkt_descs = int_fw_status->rx_pkt_descs;
1146
1147 fw_status->fw_localtime = le32_to_cpu(int_fw_status->fw_localtime);
1148 fw_status->link_ps_bitmap = le32_to_cpu(int_fw_status->link_ps_bitmap);
1149 fw_status->link_fast_bitmap =
1150 le32_to_cpu(int_fw_status->link_fast_bitmap);
1151 fw_status->total_released_blks =
1152 le32_to_cpu(int_fw_status->total_released_blks);
1153 fw_status->tx_total = le32_to_cpu(int_fw_status->tx_total);
1154
1155 fw_status->counters.tx_released_pkts =
1156 int_fw_status->counters.tx_released_pkts;
1157 fw_status->counters.tx_lnk_free_pkts =
1158 int_fw_status->counters.tx_lnk_free_pkts;
1159 fw_status->counters.tx_voice_released_blks =
1160 int_fw_status->counters.tx_voice_released_blks;
1161 fw_status->counters.tx_last_rate =
1162 int_fw_status->counters.tx_last_rate;
1163
1164 fw_status->log_start_addr = le32_to_cpu(int_fw_status->log_start_addr);
1165
1166 fw_status->priv = &int_fw_status->priv;
1167}
1168
1136static void wl18xx_set_tx_desc_csum(struct wl1271 *wl, 1169static void wl18xx_set_tx_desc_csum(struct wl1271 *wl,
1137 struct wl1271_tx_hw_descr *desc, 1170 struct wl1271_tx_hw_descr *desc,
1138 struct sk_buff *skb) 1171 struct sk_buff *skb)
@@ -1572,7 +1605,7 @@ static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid,
1572{ 1605{
1573 u8 thold; 1606 u8 thold;
1574 struct wl18xx_fw_status_priv *status_priv = 1607 struct wl18xx_fw_status_priv *status_priv =
1575 (struct wl18xx_fw_status_priv *)wl->fw_status_2->priv; 1608 (struct wl18xx_fw_status_priv *)wl->fw_status->priv;
1576 u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); 1609 u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);
1577 1610
1578 /* suspended links are never high priority */ 1611 /* suspended links are never high priority */
@@ -1594,7 +1627,7 @@ static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid,
1594{ 1627{
1595 u8 thold; 1628 u8 thold;
1596 struct wl18xx_fw_status_priv *status_priv = 1629 struct wl18xx_fw_status_priv *status_priv =
1597 (struct wl18xx_fw_status_priv *)wl->fw_status_2->priv; 1630 (struct wl18xx_fw_status_priv *)wl->fw_status->priv;
1598 u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); 1631 u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap);
1599 1632
1600 if (test_bit(hlid, (unsigned long *)&suspend_bitmap)) 1633 if (test_bit(hlid, (unsigned long *)&suspend_bitmap))
@@ -1632,6 +1665,7 @@ static struct wlcore_ops wl18xx_ops = {
1632 .tx_immediate_compl = wl18xx_tx_immediate_completion, 1665 .tx_immediate_compl = wl18xx_tx_immediate_completion,
1633 .tx_delayed_compl = NULL, 1666 .tx_delayed_compl = NULL,
1634 .hw_init = wl18xx_hw_init, 1667 .hw_init = wl18xx_hw_init,
1668 .convert_fw_status = wl18xx_convert_fw_status,
1635 .set_tx_desc_csum = wl18xx_set_tx_desc_csum, 1669 .set_tx_desc_csum = wl18xx_set_tx_desc_csum,
1636 .get_pg_ver = wl18xx_get_pg_ver, 1670 .get_pg_ver = wl18xx_get_pg_ver,
1637 .set_rx_csum = wl18xx_set_rx_csum, 1671 .set_rx_csum = wl18xx_set_rx_csum,
@@ -1713,19 +1747,62 @@ static struct ieee80211_sta_ht_cap wl18xx_mimo_ht_cap_2ghz = {
1713 }, 1747 },
1714}; 1748};
1715 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
1716static int wl18xx_setup(struct wl1271 *wl) 1786static int wl18xx_setup(struct wl1271 *wl)
1717{ 1787{
1718 struct wl18xx_priv *priv = wl->priv; 1788 struct wl18xx_priv *priv = wl->priv;
1719 int ret; 1789 int ret;
1720 1790
1791 BUILD_BUG_ON(WL18XX_MAX_LINKS > WLCORE_MAX_LINKS);
1792 BUILD_BUG_ON(WL18XX_MAX_AP_STATIONS > WL18XX_MAX_LINKS);
1793
1721 wl->rtable = wl18xx_rtable; 1794 wl->rtable = wl18xx_rtable;
1722 wl->num_tx_desc = WL18XX_NUM_TX_DESCRIPTORS; 1795 wl->num_tx_desc = WL18XX_NUM_TX_DESCRIPTORS;
1723 wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS; 1796 wl->num_rx_desc = WL18XX_NUM_RX_DESCRIPTORS;
1724 wl->num_channels = 2; 1797 wl->num_links = WL18XX_MAX_LINKS;
1798 wl->max_ap_stations = WL18XX_MAX_AP_STATIONS;
1799 wl->iface_combinations = wl18xx_iface_combinations;
1800 wl->n_iface_combinations = ARRAY_SIZE(wl18xx_iface_combinations);
1725 wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES; 1801 wl->num_mac_addr = WL18XX_NUM_MAC_ADDRESSES;
1726 wl->band_rate_to_idx = wl18xx_band_rate_to_idx; 1802 wl->band_rate_to_idx = wl18xx_band_rate_to_idx;
1727 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;
1728 wl->hw_min_ht_rate = WL18XX_CONF_HW_RXTX_RATE_MCS0; 1804 wl->hw_min_ht_rate = WL18XX_CONF_HW_RXTX_RATE_MCS0;
1805 wl->fw_status_len = sizeof(struct wl18xx_fw_status);
1729 wl->fw_status_priv_len = sizeof(struct wl18xx_fw_status_priv); 1806 wl->fw_status_priv_len = sizeof(struct wl18xx_fw_status_priv);
1730 wl->stats.fw_stats_len = sizeof(struct wl18xx_acx_statistics); 1807 wl->stats.fw_stats_len = sizeof(struct wl18xx_acx_statistics);
1731 wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv); 1808 wl->static_data_priv_len = sizeof(struct wl18xx_static_data_priv);