diff options
author | Vishal Mahaveer <vishalm@ti.com> | 2015-01-19 12:11:22 -0600 |
---|---|---|
committer | Vishal Mahaveer <vishalm@ti.com> | 2015-01-19 12:11:22 -0600 |
commit | 635f605e19bb559e23632827c631d5c2ab57b771 (patch) | |
tree | b327ad731df48fe6e9f24c79884184c34598f4e0 | |
parent | 0d77782ffb55c092d941616b42cccf9441d175c2 (diff) | |
download | wlan-d-lollipop-release.tar.gz |
wlan: update compat for kernel 3.14d-lollipop-release
Update R8.4 compat package for working with Kernel 3.14
Change-Id: Iee2f7b2d0cf8ac898c5bee36cde79b569587f6af
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
11 files changed, 123 insertions, 26 deletions
diff --git a/mac80211/compat_wl18xx/compat/net-core-flow_dissector.c b/mac80211/compat_wl18xx/compat/net-core-flow_dissector.c index 87577d44..75fe83f5 100644 --- a/mac80211/compat_wl18xx/compat/net-core-flow_dissector.c +++ b/mac80211/compat_wl18xx/compat/net-core-flow_dissector.c @@ -372,7 +372,7 @@ static inline int get_xps_queue(struct net_device *dev, struct sk_buff *skb) #endif } -u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb) +static u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb) { struct sock *sk = skb->sk; int queue_index = sk_tx_queue_get(sk); @@ -392,7 +392,6 @@ u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb) return queue_index; } -EXPORT_SYMBOL(__netdev_pick_tx); struct netdev_queue *netdev_pick_tx(struct net_device *dev, struct sk_buff *skb, @@ -403,8 +402,8 @@ struct netdev_queue *netdev_pick_tx(struct net_device *dev, if (dev->real_num_tx_queues != 1) { const struct net_device_ops *ops = dev->netdev_ops; if (ops->ndo_select_queue) - queue_index = ops->ndo_select_queue(dev, skb, - accel_priv); + queue_index = ops->ndo_select_queue(dev, skb, accel_priv, + __netdev_pick_tx); else queue_index = __netdev_pick_tx(dev, skb); diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/mwifiex/main.c b/mac80211/compat_wl18xx/drivers/net/wireless/mwifiex/main.c index 4d79761b..f8b16f40 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/mwifiex/main.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/mwifiex/main.c @@ -746,9 +746,18 @@ static struct net_device_stats *mwifiex_get_stats(struct net_device *dev) return &priv->stats; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) +static u16 +mwifiex_netdev_select_wmm_queue(struct net_device *dev, struct sk_buff *skb, + void *accel_priv, select_queue_fallback_t fallback) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) static u16 mwifiex_netdev_select_wmm_queue(struct net_device *dev, struct sk_buff *skb, void *accel_priv) +#else +static u16 +mwifiex_netdev_select_wmm_queue(struct net_device *dev, struct sk_buff *skb) +#endif { skb->priority = cfg80211_classify8021d(skb, NULL); return mwifiex_1d_to_wmm_queue[skb->priority]; diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/main.c b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/main.c index 2ea76da3..9a950052 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/main.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl12xx/main.c @@ -1669,7 +1669,7 @@ static bool wl12xx_lnk_high_prio(struct wl1271 *wl, u8 hlid, { u8 thold; - if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map)) + if (test_bit(hlid, &wl->fw_fast_lnk_map)) thold = wl->conf.tx.fast_link_thold; else thold = wl->conf.tx.slow_link_thold; diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/main.c b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/main.c index 6cac0b51..b8fbc070 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/main.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wl18xx/main.c @@ -1621,15 +1621,20 @@ static bool wl18xx_lnk_high_prio(struct wl1271 *wl, u8 hlid, u8 thold; struct wl18xx_fw_status_priv *status_priv = (struct wl18xx_fw_status_priv *)wl->fw_status->priv; - u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); + unsigned long suspend_bitmap; + + /* if we don't have the link map yet, assume they all low prio */ + if (!status_priv) + return false; /* suspended links are never high priority */ - if (test_bit(hlid, (unsigned long *)&suspend_bitmap)) + suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); + if (test_bit(hlid, &suspend_bitmap)) return false; /* the priority thresholds are taken from FW */ - if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map) && - !test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map)) + if (test_bit(hlid, &wl->fw_fast_lnk_map) && + !test_bit(hlid, &wl->ap_fw_ps_map)) thold = status_priv->tx_fast_link_prio_threshold; else thold = status_priv->tx_slow_link_prio_threshold; @@ -1643,12 +1648,17 @@ static bool wl18xx_lnk_low_prio(struct wl1271 *wl, u8 hlid, u8 thold; struct wl18xx_fw_status_priv *status_priv = (struct wl18xx_fw_status_priv *)wl->fw_status->priv; - u32 suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); + unsigned long suspend_bitmap; + + /* if we don't have the link map yet, assume they all low prio */ + if (!status_priv) + return true; - if (test_bit(hlid, (unsigned long *)&suspend_bitmap)) + suspend_bitmap = le32_to_cpu(status_priv->link_suspend_bitmap); + if (test_bit(hlid, &suspend_bitmap)) thold = status_priv->tx_suspend_threshold; - else if (test_bit(hlid, (unsigned long *)&wl->fw_fast_lnk_map) && - !test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map)) + else if (test_bit(hlid, &wl->fw_fast_lnk_map) && + !test_bit(hlid, &wl->ap_fw_ps_map)) thold = status_priv->tx_fast_stop_threshold; else thold = status_priv->tx_slow_stop_threshold; diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/debugfs.c b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/debugfs.c index aba2dcba..754752a1 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/debugfs.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/debugfs.c @@ -741,7 +741,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf, DRIVER_STATE_PRINT_INT(sg_enabled); DRIVER_STATE_PRINT_INT(enable_11a); DRIVER_STATE_PRINT_INT(noise); - DRIVER_STATE_PRINT_HEX(ap_fw_ps_map); + DRIVER_STATE_PRINT_LHEX(ap_fw_ps_map); DRIVER_STATE_PRINT_LHEX(ap_ps_map); DRIVER_STATE_PRINT_HEX(quirks); DRIVER_STATE_PRINT_HEX(irq); diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.c b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.c index d2e81018..2992aaab 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/main.c @@ -333,7 +333,7 @@ static void wl12xx_irq_ps_regulate_link(struct wl1271 *wl, { bool fw_ps; - fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); + fw_ps = test_bit(hlid, &wl->ap_fw_ps_map); /* * Wake up from high level PS if the STA is asleep with too little @@ -360,13 +360,13 @@ static void wl12xx_irq_update_links_status(struct wl1271 *wl, struct wl12xx_vif *wlvif, struct wl_fw_status *status) { - u32 cur_fw_ps_map; + unsigned long cur_fw_ps_map; u8 hlid; cur_fw_ps_map = status->link_ps_bitmap; if (wl->ap_fw_ps_map != cur_fw_ps_map) { wl1271_debug(DEBUG_PSM, - "link ps prev 0x%x cur 0x%x changed 0x%x", + "link ps prev 0x%lx cur 0x%lx changed 0x%lx", wl->ap_fw_ps_map, cur_fw_ps_map, wl->ap_fw_ps_map ^ cur_fw_ps_map); @@ -5002,7 +5002,7 @@ void wl1271_free_sta(struct wl1271 *wl, struct wl12xx_vif *wlvif, u8 hlid) clear_bit(hlid, wlvif->ap.sta_hlid_map); __clear_bit(hlid, &wl->ap_ps_map); - __clear_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); + __clear_bit(hlid, &wl->ap_fw_ps_map); /* * save the last used PN in the private part of iee80211_sta, diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/sdio.c b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/sdio.c index 4ed5a156..c9249fe3 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/sdio.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/sdio.c @@ -35,6 +35,7 @@ #include <linux/pm_runtime.h> #include <linux/printk.h> #include <linux/of.h> +#include <linux/of_irq.h> #include "wlcore.h" #include "wl12xx_80211.h" @@ -215,6 +216,49 @@ static struct wl1271_if_operations sdio_ops = { .set_block_size = wl1271_sdio_set_block_size, }; +#ifdef CONFIG_OF +/* backport dt parsing function from upstream */ +static struct wl12xx_platform_data *wlcore_probe_of(struct device *dev) +{ + struct device_node *np = dev->of_node; + struct wl12xx_platform_data *pdata; + bool need_put_node = false; + + if (!np || !of_device_is_compatible(np, "ti,wlcore")) { + np = of_find_compatible_node(NULL, NULL, "ti,wlcore"); + if (!np) { + dev_err(dev, "No platform data set\n"); + return NULL; + } + need_put_node = true; + } + + pdata = kzalloc(sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + dev_err(dev, "Can't allocate platform data\n"); + goto err; + } + + pdata->irq = irq_of_parse_and_map(np, 0); + if (!pdata->irq) { + dev_err(dev, "No irq in platform data\n"); + goto err; + } + + /* Optional fields */ + of_property_read_u32(np, "board-ref-clock", &pdata->board_ref_clock); + of_property_read_u32(np, "board-tcxo-clock", &pdata->board_tcxo_clock); + of_property_read_u32(np, "platform-quirks", &pdata->platform_quirks); + + return pdata; +err: + if (need_put_node) + of_node_put(np); + kfree(pdata); + return NULL; +} +#endif + static const struct of_device_id wlcore_of_match[] = { { .compatible = "wlcore", @@ -233,6 +277,12 @@ static struct wl12xx_platform_data *get_platform_data(struct device *dev) return kmemdup(pdata, sizeof(*pdata), GFP_KERNEL); #ifdef CONFIG_OF + /* first, try looking for "upstream" dt */ + pdata = wlcore_probe_of(dev); + if (pdata) + return pdata; + + /* if not found, look for our deprecated dt */ np = of_find_matching_node(NULL, wlcore_of_match); if (!np) { dev_err(dev, "No platform data set\n"); @@ -408,8 +458,16 @@ static int wl1271_suspend(struct device *dev) dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n", wl->wow_enabled); - /* check whether sdio should keep power */ - if (wl->wow_enabled) { + /* + * check whether sdio should keep power. + * due to some mmc layer issues, the system automatically + * powers us up on resume, which later cause issues when + * we try to restore_power again explicitly. + * workaround it by always asking to keep power. this is + * fine as the driver controls the chip power anyway. + * TODO: remove it when mmc issue is fixed. + */ + if (true || wl->wow_enabled) { sdio_flags = sdio_get_host_pm_caps(func); if (!(sdio_flags & MMC_PM_KEEP_POWER)) { diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/tx.c b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/tx.c index a07a4863..1a0dbe0c 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/tx.c +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/tx.c @@ -126,7 +126,7 @@ static void wl1271_tx_regulate_link(struct wl1271 *wl, if (WARN_ON(!test_bit(hlid, wlvif->links_map))) return; - fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); + fw_ps = test_bit(hlid, &wl->ap_fw_ps_map); tx_pkts = wl->links[hlid].allocated_pkts; /* diff --git a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/wlcore.h b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/wlcore.h index 1b3797ea..830f9c38 100644 --- a/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/mac80211/compat_wl18xx/drivers/net/wireless/ti/wlcore/wlcore.h @@ -407,10 +407,10 @@ struct wl1271 { int active_link_count; /* Fast/slow links bitmap according to FW */ - u32 fw_fast_lnk_map; + unsigned long fw_fast_lnk_map; /* AP-mode - a bitmap of links currently in PS mode according to FW */ - u32 ap_fw_ps_map; + unsigned long ap_fw_ps_map; /* AP-mode - a bitmap of links currently in PS mode in mac80211 */ unsigned long ap_ps_map; diff --git a/mac80211/compat_wl18xx/net/mac80211/iface.c b/mac80211/compat_wl18xx/net/mac80211/iface.c index f27f75b6..5c998d93 100644 --- a/mac80211/compat_wl18xx/net/mac80211/iface.c +++ b/mac80211/compat_wl18xx/net/mac80211/iface.c @@ -1080,9 +1080,19 @@ static void ieee80211_uninit(struct net_device *dev) ieee80211_teardown_sdata(IEEE80211_DEV_TO_SUB_IF(dev)); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) +static u16 ieee80211_netdev_select_queue(struct net_device *dev, + struct sk_buff *skb, + void *accel_priv, + select_queue_fallback_t fallback) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) static u16 ieee80211_netdev_select_queue(struct net_device *dev, struct sk_buff *skb, void *accel_priv) +#else +static u16 ieee80211_netdev_select_queue(struct net_device *dev, + struct sk_buff *skb) +#endif { return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); } @@ -1098,9 +1108,19 @@ static const struct net_device_ops ieee80211_dataif_ops = { .ndo_select_queue = ieee80211_netdev_select_queue, }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0) +static u16 ieee80211_monitor_select_queue(struct net_device *dev, + struct sk_buff *skb, + void *accel_priv, + select_queue_fallback_t fallback) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,13,0) static u16 ieee80211_monitor_select_queue(struct net_device *dev, struct sk_buff *skb, void *accel_priv) +#else +static u16 ieee80211_monitor_select_queue(struct net_device *dev, + struct sk_buff *skb) +#endif { struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); struct ieee80211_local *local = sdata->local; @@ -1760,6 +1780,8 @@ void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata) ieee80211_teardown_sdata(sdata); } +struct list_head unreg_list; + /* * Remove all interfaces, may only be called at hardware unregistration * time because it doesn't do RCU-safe list removals. @@ -1768,8 +1790,8 @@ void ieee80211_sdata_stop(struct ieee80211_sub_if_data *sdata) void ieee80211_remove_interfaces(struct ieee80211_local *local) { struct ieee80211_sub_if_data *sdata, *tmp; - LIST_HEAD(unreg_list); LIST_HEAD(wdev_list); + INIT_LIST_HEAD(&unreg_list); ASSERT_RTNL(); @@ -1793,7 +1815,6 @@ void ieee80211_remove_interfaces(struct ieee80211_local *local) } mutex_unlock(&local->iflist_mtx); unregister_netdevice_many(&unreg_list); - list_del(&unreg_list); list_for_each_entry_safe(sdata, tmp, &wdev_list, list) { list_del(&sdata->list); diff --git a/mac80211/compat_wl18xx/versions b/mac80211/compat_wl18xx/versions index 014f4d54..4f61d8b7 100644 --- a/mac80211/compat_wl18xx/versions +++ b/mac80211/compat_wl18xx/versions @@ -1,3 +1,3 @@ BACKPORTS_VERSION="ol_r8.a9.14-0-g0d46f43" -BACKPORTED_KERNEL_VERSION="ol_r8.a9.14-0-gd03410c" +BACKPORTED_KERNEL_VERSION="ol_r8.a9.14-7-g3ccf4f9" BACKPORTED_KERNEL_NAME="Linux" |