086edeb0b4a6fcb571f18ed0bf5fc5d22e6523fc
[openwrt/openwrt.git] / package / kernel / mwlwifi / patches / 100-drop_old_api.patch
1 --- a/main.c
2 +++ b/main.c
3 @@ -423,11 +423,7 @@ static void mwl_set_ht_caps(struct mwl_p
4 band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_20;
5 band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40;
6
7 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
8 - hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
9 -#else
10 ieee80211_hw_set(hw, AMPDU_AGGREGATION);
11 -#endif
12 band->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
13 band->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_4;
14
15 @@ -563,29 +559,16 @@ static int mwl_wl_init(struct mwl_priv *
16 hw->queues = SYSADPT_TX_WMM_QUEUES;
17
18 /* Set rssi values to dBm */
19 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
20 - hw->flags |= IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_HAS_RATE_CONTROL;
21 -#else
22 ieee80211_hw_set(hw, SIGNAL_DBM);
23 ieee80211_hw_set(hw, HAS_RATE_CONTROL);
24 -#endif
25
26 /* Ask mac80211 not to trigger PS mode
27 * based on PM bit of incoming frames.
28 */
29 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
30 - hw->flags |= IEEE80211_HW_AP_LINK_PS;
31 -#else
32 ieee80211_hw_set(hw, AP_LINK_PS);
33 -#endif
34
35 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0)
36 - hw->flags |= IEEE80211_HW_SUPPORTS_PER_STA_GTK |
37 - IEEE80211_HW_MFP_CAPABLE;
38 -#else
39 ieee80211_hw_set(hw, SUPPORTS_PER_STA_GTK);
40 ieee80211_hw_set(hw, MFP_CAPABLE);
41 -#endif
42
43 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
44 hw->wiphy->flags |= WIPHY_FLAG_HAS_CHANNEL_SWITCH;
45 --- a/dev.h
46 +++ b/dev.h
47 @@ -506,10 +506,6 @@ static inline struct mwl_sta *mwl_dev_ge
48 return (struct mwl_sta *)&sta->drv_priv;
49 }
50
51 -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
52 -#define ether_addr_copy(dst, src) memcpy(dst, src, ETH_ALEN)
53 -#endif
54 -
55 /* Defined in mac80211.c. */
56 extern const struct ieee80211_ops mwl_mac80211_ops;
57
58 --- a/mac80211.c
59 +++ b/mac80211.c
60 @@ -598,19 +598,11 @@ static int mwl_mac80211_get_survey(struc
61 return 0;
62 }
63
64 -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
65 -static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw,
66 - struct ieee80211_vif *vif,
67 - enum ieee80211_ampdu_mlme_action action,
68 - struct ieee80211_sta *sta,
69 - u16 tid, u16 *ssn, u8 buf_size)
70 -#else
71 static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw,
72 struct ieee80211_vif *vif,
73 enum ieee80211_ampdu_mlme_action action,
74 struct ieee80211_sta *sta,
75 u16 tid, u16 *ssn, u8 buf_size, bool amsdu)
76 -#endif
77 {
78 int rc = 0;
79 struct mwl_priv *priv = hw->priv;
80 --- a/rx.c
81 +++ b/rx.c
82 @@ -232,10 +232,8 @@ static inline void mwl_rx_prepare_status
83 status->flag |= RX_FLAG_VHT;
84 if (bw == RX_RATE_INFO_HT40)
85 status->flag |= RX_FLAG_40MHZ;
86 -#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 18, 0)
87 if (bw == RX_RATE_INFO_HT80)
88 status->vht_flag |= RX_VHT_FLAG_80MHZ;
89 -#endif
90 if (gi == RX_RATE_INFO_SHORT_INTERVAL)
91 status->flag |= RX_FLAG_SHORT_GI;
92 status->vht_nss = (nss + 1);