diff options
| author | Dustin Brown <dustinb@codeaurora.org> | 2016-10-17 12:16:35 -0700 |
|---|---|---|
| committer | qcabuildsw <qcabuildsw@localhost> | 2016-10-28 18:08:28 -0700 |
| commit | bb7e2f5927dcaa3fd4328fdf63229c5b195fea35 (patch) | |
| tree | d531ab6477cef8f3e5246ca0dc8b230443c0eaf9 | |
| parent | e0024fa419ba3439dee5d051662b013c7f254ed5 (diff) | |
qcacld-3.0: 4.8 Kernel Migration - Remove nla_put_u64()
nla_put_u64() was replaced by nla_put_u64_64bit() in the 4.7 Kernel.
Replace any references as needed, and provide a shim for compiling
against older versions of the Linux kernel.
Change-Id: Ia85a0d1d839a0c76a90dedd603ea667e029a1c6b
CRs-Fixed: 1078754
(cherry picked from commit b5578f0c34243338d9a421e921c9432f5c1d835f)
| -rw-r--r-- | core/hdd/inc/wlan_hdd_main.h | 15 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_ext_scan.c | 8 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_scan.c | 8 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_stats.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_tsf.c | 7 |
5 files changed, 29 insertions, 11 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index bfd9115d7817..dbab5eba0196 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1947,4 +1947,19 @@ void hdd_unsafe_channel_restart_sap(hdd_context_t *hdd_ctx); int hdd_enable_disable_ca_event(hdd_context_t *hddctx, uint8_t set_value); void wlan_hdd_undo_acs(hdd_adapter_t *adapter); + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0)) +static inline int +hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) +{ + return nla_put_u64(skb, attrtype, value); +} +#else +static inline int +hdd_wlan_nla_put_u64(struct sk_buff *skb, int attrtype, u64 value) +{ + return nla_put_u64_64bit(skb, attrtype, value, NL80211_ATTR_PAD); +} +#endif + #endif /* end #if !defined(WLAN_HDD_MAIN_H) */ diff --git a/core/hdd/src/wlan_hdd_ext_scan.c b/core/hdd/src/wlan_hdd_ext_scan.c index 558b15fdd0df..3c16d709596a 100644 --- a/core/hdd/src/wlan_hdd_ext_scan.c +++ b/core/hdd/src/wlan_hdd_ext_scan.c @@ -230,7 +230,7 @@ static int hdd_extscan_nl_fill_bss(struct sk_buff *skb, tSirWifiScanResult *ap, if (!nla_ap) return -EINVAL; - if (nla_put_u64(skb, PARAM_TIME_STAMP, ap->ts) || + if (hdd_wlan_nla_put_u64(skb, PARAM_TIME_STAMP, ap->ts) || nla_put(skb, PARAM_SSID, sizeof(ap->ssid), ap->ssid) || nla_put(skb, PARAM_BSSID, sizeof(ap->bssid), ap->bssid.bytes) || nla_put_u32(skb, PARAM_CHANNEL, ap->channel) || @@ -591,7 +591,7 @@ wlan_hdd_cfg80211_extscan_hotlist_match_ind(void *ctx, if (!ap) goto fail; - if (nla_put_u64(skb, + if (hdd_wlan_nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, data->ap[i].ts) || nla_put(skb, @@ -837,7 +837,7 @@ wlan_hdd_cfg80211_extscan_full_scan_result_event(void *ctx, if (nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID, pData->requestId) || - nla_put_u64(skb, + hdd_wlan_nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, pData->ap.ts) || nla_put(skb, @@ -1383,7 +1383,7 @@ wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind(void *ctx, goto fail; } - if (nla_put_u64(skb, + if (hdd_wlan_nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP, event->ap[i].ts) || nla_put(skb, diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 729f0519ccfd..8871b50583a5 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -1085,7 +1085,7 @@ static void hdd_vendor_scan_callback(hdd_adapter_t *adapter, nla_put_u32(skb, QCA_WLAN_VENDOR_ATTR_SCAN_FLAGS, req->flags)) goto nla_put_failure; - if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) + if (hdd_wlan_nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) goto nla_put_failure; scan_status = (aborted == true) ? VENDOR_SCAN_STATUS_ABORTED : @@ -1842,7 +1842,8 @@ static int wlan_hdd_send_scan_start_event(struct wiphy *wiphy, return -ENOMEM; } - if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) { + if (hdd_wlan_nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, + cookie)) { hdd_err("nla put fail"); kfree_skb(skb); return -EINVAL; @@ -1859,7 +1860,8 @@ static int wlan_hdd_send_scan_start_event(struct wiphy *wiphy, return -ENOMEM; } - if (nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, cookie)) { + if (hdd_wlan_nla_put_u64(skb, QCA_WLAN_VENDOR_ATTR_SCAN_COOKIE, + cookie)) { kfree_skb(skb); return -EINVAL; } diff --git a/core/hdd/src/wlan_hdd_stats.c b/core/hdd/src/wlan_hdd_stats.c index d03a97c50299..e38f1db5f85a 100644 --- a/core/hdd/src/wlan_hdd_stats.c +++ b/core/hdd/src/wlan_hdd_stats.c @@ -473,7 +473,7 @@ static bool put_wifi_iface_stats(tpSirWifiIfaceStat pWifiIfaceStat, nla_put_u32(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_LEAKY_AP_GUARD_TIME, pWifiIfaceStat->rx_leak_window) || - nla_put_u64(vendor_event, + hdd_wlan_nla_put_u64(vendor_event, QCA_WLAN_VENDOR_ATTR_LL_STATS_IFACE_AVERAGE_TSF_OFFSET, average_tsf_offset)) { hdd_err("QCA_WLAN_VENDOR_ATTR put fail"); diff --git a/core/hdd/src/wlan_hdd_tsf.c b/core/hdd/src/wlan_hdd_tsf.c index 00ba66a82c59..7710527d9a65 100644 --- a/core/hdd/src/wlan_hdd_tsf.c +++ b/core/hdd/src/wlan_hdd_tsf.c @@ -342,12 +342,13 @@ static int __wlan_hdd_cfg80211_handle_tsf_cmd(struct wiphy *wiphy, status = -ENOMEM; goto end; } - if (nla_put_u64(reply_skb, QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE, + if (hdd_wlan_nla_put_u64(reply_skb, + QCA_WLAN_VENDOR_ATTR_TSF_TIMER_VALUE, ((uint64_t) adapter->tsf_high << 32 | adapter->tsf_low)) || - nla_put_u64(reply_skb, + hdd_wlan_nla_put_u64(reply_skb, QCA_WLAN_VENDOR_ATTR_TSF_SOC_TIMER_VALUE, - adapter->tsf_sync_soc_timer)){ + adapter->tsf_sync_soc_timer)) { hdd_err("nla put fail"); kfree_skb(reply_skb); status = -EINVAL; |
