aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti/wl12xx/main.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
commitcd6362befe4cc7bf589a5236d2a780af2d47bcc9 (patch)
tree3bd4e13ec3f92a00dc4f6c3d65e820b54dbfe46e /drivers/net/wireless/ti/wl12xx/main.c
parent0f1b1e6d73cb989ce2c071edc57deade3b084dfe (diff)
parentb1586f099ba897542ece36e8a23c1a62907261ef (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Here is my initial pull request for the networking subsystem during this merge window: 1) Support for ESN in AH (RFC 4302) from Fan Du. 2) Add full kernel doc for ethtool command structures, from Ben Hutchings. 3) Add BCM7xxx PHY driver, from Florian Fainelli. 4) Export computed TCP rate information in netlink socket dumps, from Eric Dumazet. 5) Allow IPSEC SA to be dumped partially using a filter, from Nicolas Dichtel. 6) Convert many drivers to pci_enable_msix_range(), from Alexander Gordeev. 7) Record SKB timestamps more efficiently, from Eric Dumazet. 8) Switch to microsecond resolution for TCP round trip times, also from Eric Dumazet. 9) Clean up and fix 6lowpan fragmentation handling by making use of the existing inet_frag api for it's implementation. 10) Add TX grant mapping to xen-netback driver, from Zoltan Kiss. 11) Auto size SKB lengths when composing netlink messages based upon past message sizes used, from Eric Dumazet. 12) qdisc dumps can take a long time, add a cond_resched(), From Eric Dumazet. 13) Sanitize netpoll core and drivers wrt. SKB handling semantics. Get rid of never-used-in-tree netpoll RX handling. From Eric W Biederman. 14) Support inter-address-family and namespace changing in VTI tunnel driver(s). From Steffen Klassert. 15) Add Altera TSE driver, from Vince Bridgers. 16) Optimizing csum_replace2() so that it doesn't adjust the checksum by checksumming the entire header, from Eric Dumazet. 17) Expand BPF internal implementation for faster interpreting, more direct translations into JIT'd code, and much cleaner uses of BPF filtering in non-socket ocntexts. From Daniel Borkmann and Alexei Starovoitov" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1976 commits) netpoll: Use skb_irq_freeable to make zap_completion_queue safe. net: Add a test to see if a skb is freeable in irq context qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port' net: ptp: move PTP classifier in its own file net: sxgbe: make "core_ops" static net: sxgbe: fix logical vs bitwise operation net: sxgbe: sxgbe_mdio_register() frees the bus Call efx_set_channels() before efx->type->dimension_resources() xen-netback: disable rogue vif in kthread context net/mlx4: Set proper build dependancy with vxlan be2net: fix build dependency on VxLAN mac802154: make csma/cca parameters per-wpan mac802154: allow only one WPAN to be up at any given time net: filter: minor: fix kdoc in __sk_run_filter netlink: don't compare the nul-termination in nla_strcmp can: c_can: Avoid led toggling for every packet. can: c_can: Simplify TX interrupt cleanup can: c_can: Store dlc private can: c_can: Reduce register access can: c_can: Make the code readable ...
Diffstat (limited to 'drivers/net/wireless/ti/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/ti/wl12xx/main.c67
1 files changed, 65 insertions, 2 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c
index be7129ba16ad..d50dfac91631 100644
--- a/drivers/net/wireless/ti/wl12xx/main.c
+++ b/drivers/net/wireless/ti/wl12xx/main.c
@@ -1378,7 +1378,7 @@ static u32 wl12xx_get_rx_packet_len(struct wl1271 *wl, void *rx_data,
1378 1378
1379static int wl12xx_tx_delayed_compl(struct wl1271 *wl) 1379static int wl12xx_tx_delayed_compl(struct wl1271 *wl)
1380{ 1380{
1381 if (wl->fw_status_1->tx_results_counter == 1381 if (wl->fw_status->tx_results_counter ==
1382 (wl->tx_results_count & 0xff)) 1382 (wl->tx_results_count & 0xff))
1383 return 0; 1383 return 0;
1384 1384
@@ -1438,6 +1438,37 @@ out:
1438 return ret; 1438 return ret;
1439} 1439}
1440 1440
1441static void wl12xx_convert_fw_status(struct wl1271 *wl, void *raw_fw_status,
1442 struct wl_fw_status *fw_status)
1443{
1444 struct wl12xx_fw_status *int_fw_status = raw_fw_status;
1445
1446 fw_status->intr = le32_to_cpu(int_fw_status->intr);
1447 fw_status->fw_rx_counter = int_fw_status->fw_rx_counter;
1448 fw_status->drv_rx_counter = int_fw_status->drv_rx_counter;
1449 fw_status->tx_results_counter = int_fw_status->tx_results_counter;
1450 fw_status->rx_pkt_descs = int_fw_status->rx_pkt_descs;
1451
1452 fw_status->fw_localtime = le32_to_cpu(int_fw_status->fw_localtime);
1453 fw_status->link_ps_bitmap = le32_to_cpu(int_fw_status->link_ps_bitmap);
1454 fw_status->link_fast_bitmap =
1455 le32_to_cpu(int_fw_status->link_fast_bitmap);
1456 fw_status->total_released_blks =
1457 le32_to_cpu(int_fw_status->total_released_blks);
1458 fw_status->tx_total = le32_to_cpu(int_fw_status->tx_total);
1459
1460 fw_status->counters.tx_released_pkts =
1461 int_fw_status->counters.tx_released_pkts;
1462 fw_status->counters.tx_lnk_free_pkts =
1463 int_fw_status->counters.tx_lnk_free_pkts;
1464 fw_status->counters.tx_voice_released_blks =
1465 int_fw_status->counters.tx_voice_released_blks;
1466 fw_status->counters.tx_last_rate =
1467 int_fw_status->counters.tx_last_rate;
1468
1469 fw_status->log_start_addr = le32_to_cpu(int_fw_status->log_start_addr);
1470}
1471
1441static u32 wl12xx_sta_get_ap_rate_mask(struct wl1271 *wl, 1472static u32 wl12xx_sta_get_ap_rate_mask(struct wl1271 *wl,
1442 struct wl12xx_vif *wlvif) 1473 struct wl12xx_vif *wlvif)
1443{ 1474{
@@ -1677,6 +1708,7 @@ static struct wlcore_ops wl12xx_ops = {
1677 .tx_delayed_compl = wl12xx_tx_delayed_compl, 1708 .tx_delayed_compl = wl12xx_tx_delayed_compl,
1678 .hw_init = wl12xx_hw_init, 1709 .hw_init = wl12xx_hw_init,
1679 .init_vif = NULL, 1710 .init_vif = NULL,
1711 .convert_fw_status = wl12xx_convert_fw_status,
1680 .sta_get_ap_rate_mask = wl12xx_sta_get_ap_rate_mask, 1712 .sta_get_ap_rate_mask = wl12xx_sta_get_ap_rate_mask,
1681 .get_pg_ver = wl12xx_get_pg_ver, 1713 .get_pg_ver = wl12xx_get_pg_ver,
1682 .get_mac = wl12xx_get_mac, 1714 .get_mac = wl12xx_get_mac,
@@ -1711,22 +1743,53 @@ static struct ieee80211_sta_ht_cap wl12xx_ht_cap = {
1711 }, 1743 },
1712}; 1744};
1713 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
1714static int wl12xx_setup(struct wl1271 *wl) 1769static int wl12xx_setup(struct wl1271 *wl)
1715{ 1770{
1716 struct wl12xx_priv *priv = wl->priv; 1771 struct wl12xx_priv *priv = wl->priv;
1717 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev); 1772 struct wlcore_platdev_data *pdev_data = dev_get_platdata(&wl->pdev->dev);
1718 struct wl12xx_platform_data *pdata = pdev_data->pdata; 1773 struct wl12xx_platform_data *pdata = pdev_data->pdata;
1719 1774
1775 BUILD_BUG_ON(WL12XX_MAX_LINKS > WLCORE_MAX_LINKS);
1776 BUILD_BUG_ON(WL12XX_MAX_AP_STATIONS > WL12XX_MAX_LINKS);
1777
1720 wl->rtable = wl12xx_rtable; 1778 wl->rtable = wl12xx_rtable;
1721 wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS; 1779 wl->num_tx_desc = WL12XX_NUM_TX_DESCRIPTORS;
1722 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS; 1780 wl->num_rx_desc = WL12XX_NUM_RX_DESCRIPTORS;
1723 wl->num_channels = 1; 1781 wl->num_links = WL12XX_MAX_LINKS;
1782 wl->max_ap_stations = WL12XX_MAX_AP_STATIONS;
1783 wl->iface_combinations = wl12xx_iface_combinations;
1784 wl->n_iface_combinations = ARRAY_SIZE(wl12xx_iface_combinations);
1724 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES; 1785 wl->num_mac_addr = WL12XX_NUM_MAC_ADDRESSES;
1725 wl->band_rate_to_idx = wl12xx_band_rate_to_idx; 1786 wl->band_rate_to_idx = wl12xx_band_rate_to_idx;
1726 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;
1727 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0; 1788 wl->hw_min_ht_rate = WL12XX_CONF_HW_RXTX_RATE_MCS0;
1789 wl->fw_status_len = sizeof(struct wl12xx_fw_status);
1728 wl->fw_status_priv_len = 0; 1790 wl->fw_status_priv_len = 0;
1729 wl->stats.fw_stats_len = sizeof(struct wl12xx_acx_statistics); 1791 wl->stats.fw_stats_len = sizeof(struct wl12xx_acx_statistics);
1792 wl->ofdm_only_ap = true;
1730 wlcore_set_ht_cap(wl, IEEE80211_BAND_2GHZ, &wl12xx_ht_cap); 1793 wlcore_set_ht_cap(wl, IEEE80211_BAND_2GHZ, &wl12xx_ht_cap);
1731 wlcore_set_ht_cap(wl, IEEE80211_BAND_5GHZ, &wl12xx_ht_cap); 1794 wlcore_set_ht_cap(wl, IEEE80211_BAND_5GHZ, &wl12xx_ht_cap);
1732 wl12xx_conf_init(wl); 1795 wl12xx_conf_init(wl);