From: Florian F. <f.f...@gm...> - 2016-10-13 14:43:35
|
Take into account a few API changes: * hw->flags converted to a bitmap array (4.2) * FIF_PROMISC_IN_BSS removed (4.2) * ieee80211_probereq_get() takes an address argument instead of vif (3.19) * hw_scan passes an ieee80211_scan_request (3.17) Signed-off-by: Florian Fainelli <f.f...@gm...> --- main.c | 25 ++++++++++++++++++++++++- main.h | 5 +++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index bfec85685f2d..a4e8761392b9 100644 --- a/main.c +++ b/main.c @@ -497,7 +497,11 @@ int acx_free_mechanics(acx_device_t *adev) int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS; +#else + __clear_bit(IEEE80211_HW_RX_INCLUDES_FCS, hw->flags); +#endif hw->queues = 1; hw->wiphy->max_scan_ssids = 1; @@ -525,7 +529,11 @@ int acx_init_ieee80211(acx_device_t *adev, struct ieee80211_hw *hw) /* We base signal quality on winlevel approach of previous driver * TODO OW 20100615 This should into a common init code */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) hw->flags |= IEEE80211_HW_SIGNAL_UNSPEC; +#else + ieee80211_hw_set(hw, SIGNAL_UNSPEC); +#endif hw->max_signal = 100; if (IS_ACX100(adev)) { @@ -945,8 +953,11 @@ void acx_op_configure_filter(struct ieee80211_hw *hw, changed_flags, *total_flags); /* OWI TODO: Set also FIF_PROBE_REQ ? */ - *total_flags &= (FIF_PROMISC_IN_BSS | FIF_ALLMULTI | FIF_FCSFAIL + *total_flags &= (FIF_ALLMULTI | FIF_FCSFAIL | FIF_CONTROL | FIF_OTHER_BSS); +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) + *total_flags &= FIF_PROMISC_IN_BSS; +#endif logf1(L_DEBUG, "2: *total_flags=0x%08x\n", *total_flags); @@ -1044,9 +1055,16 @@ void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, #endif } +#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 17, 0) int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_scan_request *req) { +#else +int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_scan_request *hw_req) +{ + struct cfg80211_scan_request *req = &hw_req->req; +#endif acx_device_t *adev = hw2adev(hw); struct sk_buff *skb; size_t ssid_len = 0; @@ -1082,8 +1100,13 @@ int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, goto out; } #else +#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 19, 0) skb = ieee80211_probereq_get(adev->hw, adev->vif, ssid, ssid_len, req->ie_len); +#else + skb = ieee80211_probereq_get(adev->hw, adev->vif->addr, ssid, ssid_len, + req->ie_len); +#endif if (!skb) { ret = -ENOMEM; goto out; diff --git a/main.h b/main.h index 293f5c897638..f07cbb69411f 100644 --- a/main.h +++ b/main.h @@ -61,8 +61,13 @@ void acx_op_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb); #endif +#if CONFIG_ACX_MAC80211_VERSION < KERNEL_VERSION(3, 17, 0) int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct cfg80211_scan_request *req); +#else +int acx_op_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif, + struct ieee80211_scan_request *req); +#endif int acx_recover_hw(acx_device_t *adev); -- 2.7.4 |