diff --git a/modules b/modules index c185e366..555d6995 100644 --- a/modules +++ b/modules @@ -1,7 +1,7 @@ GLUON_FEEDS='openwrt gluon routing luci' OPENWRT_REPO=git://github.com/openwrt/openwrt.git -OPENWRT_COMMIT=e663db7bb1797740c4a29ac0fc96eda1b88f9e6e +OPENWRT_COMMIT=b21852c60f82bbd53c19098fc0eb1f4cfccfaf35 OPENWRT_BRANCH=chaos_calmer PACKAGES_OPENWRT_REPO=git://github.com/openwrt/packages.git diff --git a/patches/openwrt/0007-mac80211-hostapd-iw-.-update-to-LEDE-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.patch b/patches/openwrt/0007-mac80211-hostapd-iw-.-update-to-LEDE-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.patch index 4858efde..04bf2b2d 100644 --- a/patches/openwrt/0007-mac80211-hostapd-iw-.-update-to-LEDE-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.patch +++ b/patches/openwrt/0007-mac80211-hostapd-iw-.-update-to-LEDE-42f559ed70897a7b74dd3e6293b42e6d2e511eaa.patch @@ -11266,6 +11266,1171 @@ index 55ff817..0000000 - (cur_max_tp_streams - 1 < - minstrel_mcs_groups[sample_group].streams || - sample_dur >= minstrel_get_duration(mi->max_prob_rate))) { +diff --git a/package/kernel/mac80211/patches/344-0001-brcmfmac-change-function-name-for-brcmf_cfg80211_wai.patch b/package/kernel/mac80211/patches/344-0001-brcmfmac-change-function-name-for-brcmf_cfg80211_wai.patch +deleted file mode 100644 +index e3427de..0000000 +--- a/package/kernel/mac80211/patches/344-0001-brcmfmac-change-function-name-for-brcmf_cfg80211_wai.patch ++++ /dev/null +@@ -1,99 +0,0 @@ +-From: Arend van Spriel +-Date: Wed, 17 Feb 2016 11:26:50 +0100 +-Subject: [PATCH] brcmfmac: change function name for +- brcmf_cfg80211_wait_vif_event_timeout() +- +-Dropping the '_timeout' from the function name as the fact that a timeout +-value is passed makes it obvious a timeout is used. Also helps to keep code +-lines a bit shorter and easier to stick to 80 char boundary. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -564,8 +564,8 @@ struct wireless_dev *brcmf_ap_add_vif(st +- } +- +- /* wait for firmware event */ +-- err = brcmf_cfg80211_wait_vif_event_timeout(cfg, BRCMF_E_IF_ADD, +-- BRCMF_VIF_EVENT_TIMEOUT); +-+ err = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_ADD, +-+ BRCMF_VIF_EVENT_TIMEOUT); +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +- if (!err) { +- brcmf_err("timeout occurred\n"); +-@@ -6395,8 +6395,9 @@ bool brcmf_cfg80211_vif_event_armed(stru +- +- return armed; +- } +--int brcmf_cfg80211_wait_vif_event_timeout(struct brcmf_cfg80211_info *cfg, +-- u8 action, ulong timeout) +-+ +-+int brcmf_cfg80211_wait_vif_event(struct brcmf_cfg80211_info *cfg, +-+ u8 action, ulong timeout) +- { +- struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -402,8 +402,8 @@ bool brcmf_get_vif_state_any(struct brcm +- void brcmf_cfg80211_arm_vif_event(struct brcmf_cfg80211_info *cfg, +- struct brcmf_cfg80211_vif *vif); +- bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg); +--int brcmf_cfg80211_wait_vif_event_timeout(struct brcmf_cfg80211_info *cfg, +-- u8 action, ulong timeout); +-+int brcmf_cfg80211_wait_vif_event(struct brcmf_cfg80211_info *cfg, +-+ u8 action, ulong timeout); +- s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg, +- struct brcmf_if *ifp, bool aborted, +- bool fw_abort); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -1988,8 +1988,8 @@ int brcmf_p2p_ifchange(struct brcmf_cfg8 +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +- return err; +- } +-- err = brcmf_cfg80211_wait_vif_event_timeout(cfg, BRCMF_E_IF_CHANGE, +-- BRCMF_VIF_EVENT_TIMEOUT); +-+ err = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_CHANGE, +-+ BRCMF_VIF_EVENT_TIMEOUT); +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +- if (!err) { +- brcmf_err("No BRCMF_E_IF_CHANGE event received\n"); +-@@ -2090,8 +2090,8 @@ static struct wireless_dev *brcmf_p2p_cr +- } +- +- /* wait for firmware event */ +-- err = brcmf_cfg80211_wait_vif_event_timeout(p2p->cfg, BRCMF_E_IF_ADD, +-- BRCMF_VIF_EVENT_TIMEOUT); +-+ err = brcmf_cfg80211_wait_vif_event(p2p->cfg, BRCMF_E_IF_ADD, +-+ BRCMF_VIF_EVENT_TIMEOUT); +- brcmf_cfg80211_arm_vif_event(p2p->cfg, NULL); +- brcmf_fweh_p2pdev_setup(pri_ifp, false); +- if (!err) { +-@@ -2180,8 +2180,8 @@ struct wireless_dev *brcmf_p2p_add_vif(s +- } +- +- /* wait for firmware event */ +-- err = brcmf_cfg80211_wait_vif_event_timeout(cfg, BRCMF_E_IF_ADD, +-- BRCMF_VIF_EVENT_TIMEOUT); +-+ err = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_ADD, +-+ BRCMF_VIF_EVENT_TIMEOUT); +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +- if (!err) { +- brcmf_err("timeout occurred\n"); +-@@ -2274,8 +2274,8 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- } +- if (!err) { +- /* wait for firmware event */ +-- err = brcmf_cfg80211_wait_vif_event_timeout(cfg, BRCMF_E_IF_DEL, +-- BRCMF_VIF_EVENT_TIMEOUT); +-+ err = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL, +-+ BRCMF_VIF_EVENT_TIMEOUT); +- if (!err) +- err = -EIO; +- else +diff --git a/package/kernel/mac80211/patches/344-0002-brcmfmac-Limit-memory-allocs-to-64K.patch b/package/kernel/mac80211/patches/344-0002-brcmfmac-Limit-memory-allocs-to-64K.patch +deleted file mode 100644 +index 9c336f7..0000000 +--- a/package/kernel/mac80211/patches/344-0002-brcmfmac-Limit-memory-allocs-to-64K.patch ++++ /dev/null +@@ -1,127 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:26:51 +0100 +-Subject: [PATCH] brcmfmac: Limit memory allocs to <64K +- +-Some systems have problems with allocating memory allocation larger +-then 64K. Often on unload/load or suspend/resume a failure is +-reported: Could not allocate wiphy device. This patch makes the +-escan intermediate storage buf dynamically allocated, and smaller +-than 64K. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -1125,7 +1125,7 @@ brcmf_cfg80211_escan(struct wiphy *wiphy +- +- /* Arm scan timeout timer */ +- mod_timer(&cfg->escan_timeout, jiffies + +-- WL_ESCAN_TIMER_INTERVAL_MS * HZ / 1000); +-+ BRCMF_ESCAN_TIMER_INTERVAL_MS * HZ / 1000); +- +- return 0; +- +-@@ -3020,7 +3020,7 @@ brcmf_cfg80211_escan_handler(struct brcm +- +- list = (struct brcmf_scan_results *) +- cfg->escan_info.escan_buf; +-- if (bi_length > WL_ESCAN_BUF_SIZE - list->buflen) { +-+ if (bi_length > BRCMF_ESCAN_BUF_SIZE - list->buflen) { +- brcmf_err("Buffer is too small: ignoring\n"); +- goto exit; +- } +-@@ -3033,8 +3033,8 @@ brcmf_cfg80211_escan_handler(struct brcm +- bss_info_le)) +- goto exit; +- } +-- memcpy(&(cfg->escan_info.escan_buf[list->buflen]), +-- bss_info_le, bi_length); +-+ memcpy(&cfg->escan_info.escan_buf[list->buflen], bss_info_le, +-+ bi_length); +- list->version = le32_to_cpu(bss_info_le->version); +- list->buflen += bi_length; +- list->count++; +-@@ -5402,14 +5402,14 @@ static void brcmf_deinit_priv_mem(struct +- { +- kfree(cfg->conf); +- cfg->conf = NULL; +-- kfree(cfg->escan_ioctl_buf); +-- cfg->escan_ioctl_buf = NULL; +- kfree(cfg->extra_buf); +- cfg->extra_buf = NULL; +- kfree(cfg->wowl.nd); +- cfg->wowl.nd = NULL; +- kfree(cfg->wowl.nd_info); +- cfg->wowl.nd_info = NULL; +-+ kfree(cfg->escan_info.escan_buf); +-+ cfg->escan_info.escan_buf = NULL; +- } +- +- static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_info *cfg) +-@@ -5417,9 +5417,6 @@ static s32 brcmf_init_priv_mem(struct br +- cfg->conf = kzalloc(sizeof(*cfg->conf), GFP_KERNEL); +- if (!cfg->conf) +- goto init_priv_mem_out; +-- cfg->escan_ioctl_buf = kzalloc(BRCMF_DCMD_MEDLEN, GFP_KERNEL); +-- if (!cfg->escan_ioctl_buf) +-- goto init_priv_mem_out; +- cfg->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL); +- if (!cfg->extra_buf) +- goto init_priv_mem_out; +-@@ -5431,6 +5428,9 @@ static s32 brcmf_init_priv_mem(struct br +- GFP_KERNEL); +- if (!cfg->wowl.nd_info) +- goto init_priv_mem_out; +-+ cfg->escan_info.escan_buf = kzalloc(BRCMF_ESCAN_BUF_SIZE, GFP_KERNEL); +-+ if (!cfg->escan_info.escan_buf) +-+ goto init_priv_mem_out; +- +- return 0; +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -28,8 +28,11 @@ +- #define WL_ROAM_TRIGGER_LEVEL -75 +- #define WL_ROAM_DELTA 20 +- +--#define WL_ESCAN_BUF_SIZE (1024 * 64) +--#define WL_ESCAN_TIMER_INTERVAL_MS 10000 /* E-Scan timeout */ +-+/* Keep BRCMF_ESCAN_BUF_SIZE below 64K (65536). Allocing over 64K can be +-+ * problematic on some systems and should be avoided. +-+ */ +-+#define BRCMF_ESCAN_BUF_SIZE 65000 +-+#define BRCMF_ESCAN_TIMER_INTERVAL_MS 10000 /* E-Scan timeout */ +- +- #define WL_ESCAN_ACTION_START 1 +- #define WL_ESCAN_ACTION_CONTINUE 2 +-@@ -205,7 +208,7 @@ enum wl_escan_state { +- +- struct escan_info { +- u32 escan_state; +-- u8 escan_buf[WL_ESCAN_BUF_SIZE]; +-+ u8 *escan_buf; +- struct wiphy *wiphy; +- struct brcmf_if *ifp; +- s32 (*run)(struct brcmf_cfg80211_info *cfg, struct brcmf_if *ifp, +-@@ -278,7 +281,6 @@ struct brcmf_cfg80211_wowl { +- * @escan_info: escan information. +- * @escan_timeout: Timer for catch scan timeout. +- * @escan_timeout_work: scan timeout worker. +-- * @escan_ioctl_buf: dongle command buffer for escan commands. +- * @vif_list: linked list of vif instances. +- * @vif_cnt: number of vif instances. +- * @vif_event: vif event signalling. +-@@ -309,7 +311,6 @@ struct brcmf_cfg80211_info { +- struct escan_info escan_info; +- struct timer_list escan_timeout; +- struct work_struct escan_timeout_work; +-- u8 *escan_ioctl_buf; +- struct list_head vif_list; +- struct brcmf_cfg80211_vif_event vif_event; +- struct completion vif_disabled; +diff --git a/package/kernel/mac80211/patches/344-0003-brcmfmac-check-for-wowl-support-before-enumerating-f.patch b/package/kernel/mac80211/patches/344-0003-brcmfmac-check-for-wowl-support-before-enumerating-f.patch +deleted file mode 100644 +index ee3d9f3..0000000 +--- a/package/kernel/mac80211/patches/344-0003-brcmfmac-check-for-wowl-support-before-enumerating-f.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Franky Lin +-Date: Wed, 17 Feb 2016 11:26:52 +0100 +-Subject: [PATCH] brcmfmac: check for wowl support before enumerating feature +- flag +- +-In some cases wiphy->wowlan could be NULL if firmware doesn't have the +-support. Driver should check for support before walking down the feature +-flags. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-Signed-off-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -6594,7 +6594,8 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_SCAN_RANDOM_MAC)) { +- wiphy->features |= NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR; +- #ifdef CONFIG_PM +-- if (wiphy->wowlan->flags & WIPHY_WOWLAN_NET_DETECT) +-+ if (wiphy->wowlan && +-+ wiphy->wowlan->flags & WIPHY_WOWLAN_NET_DETECT) +- wiphy->features |= NL80211_FEATURE_ND_RANDOM_MAC_ADDR; +- #endif +- } +diff --git a/package/kernel/mac80211/patches/344-0004-brcmfmac-Configure-country-code-using-device-specifi.patch b/package/kernel/mac80211/patches/344-0004-brcmfmac-Configure-country-code-using-device-specifi.patch +deleted file mode 100644 +index c52cac8..0000000 +--- a/package/kernel/mac80211/patches/344-0004-brcmfmac-Configure-country-code-using-device-specifi.patch ++++ /dev/null +@@ -1,214 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:26:53 +0100 +-Subject: [PATCH] brcmfmac: Configure country code using device specific +- settings +- +-Country code configuration in a device is a device specific +-operation. For this the country code as specified by reg notifier +-(iso3166 alpha2) needs to be translated to a device specific +-country locale and revision number. This patch adds this +-translation and puts a placeholder in the device specific settings +-where the translation table can be stored. Additional patches will +-be needed to read these tables from for example device platform +-data. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -6405,28 +6405,85 @@ int brcmf_cfg80211_wait_vif_event(struct +- vif_event_equals(event, action), timeout); +- } +- +-+static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +-+ struct brcmf_fil_country_le *ccreq) +-+{ +-+ struct cc_translate *country_codes; +-+ struct cc_entry *cc; +-+ s32 found_index; +-+ int i; +-+ +-+ country_codes = drvr->settings->country_codes; +-+ if (!country_codes) { +-+ brcmf_dbg(TRACE, "No country codes configured for device\n"); +-+ return -EINVAL; +-+ } +-+ +-+ if ((alpha2[0] == ccreq->country_abbrev[0]) && +-+ (alpha2[1] == ccreq->country_abbrev[1])) { +-+ brcmf_dbg(TRACE, "Country code already set\n"); +-+ return -EAGAIN; +-+ } +-+ +-+ found_index = -1; +-+ for (i = 0; i < country_codes->table_size; i++) { +-+ cc = &country_codes->table[i]; +-+ if ((cc->iso3166[0] == '\0') && (found_index == -1)) +-+ found_index = i; +-+ if ((cc->iso3166[0] == alpha2[0]) && +-+ (cc->iso3166[1] == alpha2[1])) { +-+ found_index = i; +-+ break; +-+ } +-+ } +-+ if (found_index == -1) { +-+ brcmf_dbg(TRACE, "No country code match found\n"); +-+ return -EINVAL; +-+ } +-+ memset(ccreq, 0, sizeof(*ccreq)); +-+ ccreq->rev = cpu_to_le32(country_codes->table[found_index].rev); +-+ memcpy(ccreq->ccode, country_codes->table[found_index].cc, +-+ BRCMF_COUNTRY_BUF_SZ); +-+ ccreq->country_abbrev[0] = alpha2[0]; +-+ ccreq->country_abbrev[1] = alpha2[1]; +-+ ccreq->country_abbrev[2] = 0; +-+ +-+ return 0; +-+} +-+ +- static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, +- struct regulatory_request *req) +- { +- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); +- struct brcmf_if *ifp = netdev_priv(cfg_to_ndev(cfg)); +- struct brcmf_fil_country_le ccreq; +-+ s32 err; +- int i; +- +-- brcmf_dbg(TRACE, "enter: initiator=%d, alpha=%c%c\n", req->initiator, +-- req->alpha2[0], req->alpha2[1]); +-- +- /* ignore non-ISO3166 country codes */ +- for (i = 0; i < sizeof(req->alpha2); i++) +- if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') { +-- brcmf_err("not a ISO3166 code\n"); +-+ brcmf_err("not a ISO3166 code (0x%02x 0x%02x)\n", +-+ req->alpha2[0], req->alpha2[1]); +- return; +- } +-- memset(&ccreq, 0, sizeof(ccreq)); +-- ccreq.rev = cpu_to_le32(-1); +-- memcpy(ccreq.ccode, req->alpha2, sizeof(req->alpha2)); +-- if (brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq))) { +-- brcmf_err("firmware rejected country setting\n"); +-+ +-+ brcmf_dbg(TRACE, "Enter: initiator=%d, alpha=%c%c\n", req->initiator, +-+ req->alpha2[0], req->alpha2[1]); +-+ +-+ err = brcmf_fil_iovar_data_get(ifp, "country", &ccreq, sizeof(ccreq)); +-+ if (err) { +-+ brcmf_err("Country code iovar returned err = %d\n", err); +-+ return; +-+ } +-+ +-+ err = brcmf_translate_country_code(ifp->drvr, req->alpha2, &ccreq); +-+ if (err) +-+ return; +-+ +-+ err = brcmf_fil_iovar_data_set(ifp, "country", &ccreq, sizeof(ccreq)); +-+ if (err) { +-+ brcmf_err("Firmware rejected country setting\n"); +- return; +- } +- brcmf_setup_wiphybands(wiphy); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-@@ -230,10 +230,8 @@ void brcmf_mp_attach(void) +- int brcmf_mp_device_attach(struct brcmf_pub *drvr) +- { +- drvr->settings = kzalloc(sizeof(*drvr->settings), GFP_ATOMIC); +-- if (!drvr->settings) { +-- brcmf_err("Failed to alloca storage space for settings\n"); +-+ if (!drvr->settings) +- return -ENOMEM; +-- } +- +- drvr->settings->sdiod_txglomsz = brcmf_sdiod_txglomsz; +- drvr->settings->p2p_enable = !!brcmf_p2p_enable; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-@@ -15,6 +15,8 @@ +- #ifndef BRCMFMAC_COMMON_H +- #define BRCMFMAC_COMMON_H +- +-+#include "fwil_types.h" +-+ +- extern const u8 ALLFFMAC[ETH_ALEN]; +- +- #define BRCMF_FW_ALTPATH_LEN 256 +-@@ -39,6 +41,33 @@ struct brcmf_mp_global_t { +- extern struct brcmf_mp_global_t brcmf_mp_global; +- +- /** +-+ * struct cc_entry - Struct for translating user space country code (iso3166) to +-+ * firmware country code and revision. +-+ * +-+ * @iso3166: iso3166 alpha 2 country code string. +-+ * @cc: firmware country code string. +-+ * @rev: firmware country code revision. +-+ */ +-+struct cc_entry { +-+ char iso3166[BRCMF_COUNTRY_BUF_SZ]; +-+ char cc[BRCMF_COUNTRY_BUF_SZ]; +-+ s32 rev; +-+}; +-+ +-+/** +-+ * struct cc_translate - Struct for translating country codes as set by user +-+ * space to a country code and rev which can be used by +-+ * firmware. +-+ * +-+ * @table_size: number of entries in table (> 0) +-+ * @table: dynamic array of 1 or more elements with translation information. +-+ */ +-+struct cc_translate { +-+ int table_size; +-+ struct cc_entry table[0]; +-+}; +-+ +-+/** +- * struct brcmf_mp_device - Device module paramaters. +- * +- * @sdiod_txglomsz: SDIO txglom size. +-@@ -47,6 +76,7 @@ extern struct brcmf_mp_global_t brcmf_mp +- * @feature_disable: Feature_disable bitmask. +- * @fcmode: FWS flow control. +- * @roamoff: Firmware roaming off? +-+ * @country_codes: If available, pointer to struct for translating country codes +- */ +- struct brcmf_mp_device { +- int sdiod_txglomsz; +-@@ -56,6 +86,7 @@ struct brcmf_mp_device { +- int fcmode; +- bool roamoff; +- bool ignore_probe_fail; +-+ struct cc_translate *country_codes; +- }; +- +- void brcmf_mp_attach(void); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +-@@ -134,6 +134,8 @@ +- #define BRCMF_PFN_MAC_OUI_ONLY BIT(0) +- #define BRCMF_PFN_SET_MAC_UNASSOC BIT(1) +- +-+#define BRCMF_MCSSET_LEN 16 +-+ +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +- BRCMF_JOIN_PREF_RSSI = 1, +-@@ -279,7 +281,7 @@ struct brcmf_bss_info_le { +- __le32 reserved32[1]; /* Reserved for expansion of BSS properties */ +- u8 flags; /* flags */ +- u8 reserved[3]; /* Reserved for expansion of BSS properties */ +-- u8 basic_mcs[MCSSET_LEN]; /* 802.11N BSS required MCS set */ +-+ u8 basic_mcs[BRCMF_MCSSET_LEN]; /* 802.11N BSS required MCS set */ +- +- __le16 ie_offset; /* offset at which IEs start, from beginning */ +- __le32 ie_length; /* byte length of Information Elements */ +diff --git a/package/kernel/mac80211/patches/344-0005-brcmfmac-Add-length-checks-on-firmware-events.patch b/package/kernel/mac80211/patches/344-0005-brcmfmac-Add-length-checks-on-firmware-events.patch +deleted file mode 100644 +index 3e2e350..0000000 +--- a/package/kernel/mac80211/patches/344-0005-brcmfmac-Add-length-checks-on-firmware-events.patch ++++ /dev/null +@@ -1,283 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:26:54 +0100 +-Subject: [PATCH] brcmfmac: Add length checks on firmware events +- +-Add additional length checks on firmware events to create more +-robust code. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Lei Zhang +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -3092,6 +3092,11 @@ brcmf_notify_sched_scan_results(struct b +- +- brcmf_dbg(SCAN, "Enter\n"); +- +-+ if (e->datalen < (sizeof(*pfn_result) + sizeof(*netinfo))) { +-+ brcmf_dbg(SCAN, "Event data to small. Ignore\n"); +-+ return 0; +-+ } +-+ +- if (e->event_code == BRCMF_E_PFN_NET_LOST) { +- brcmf_dbg(SCAN, "PFN NET LOST event. Do Nothing\n"); +- return 0; +-@@ -3415,6 +3420,11 @@ brcmf_wowl_nd_results(struct brcmf_if *i +- +- brcmf_dbg(SCAN, "Enter\n"); +- +-+ if (e->datalen < (sizeof(*pfn_result) + sizeof(*netinfo))) { +-+ brcmf_dbg(SCAN, "Event data to small. Ignore\n"); +-+ return 0; +-+ } +-+ +- pfn_result = (struct brcmf_pno_scanresults_le *)data; +- +- if (e->event_code == BRCMF_E_PFN_NET_LOST) { +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-@@ -26,50 +26,6 @@ +- #include "fwil.h" +- +- /** +-- * struct brcm_ethhdr - broadcom specific ether header. +-- * +-- * @subtype: subtype for this packet. +-- * @length: TODO: length of appended data. +-- * @version: version indication. +-- * @oui: OUI of this packet. +-- * @usr_subtype: subtype for this OUI. +-- */ +--struct brcm_ethhdr { +-- __be16 subtype; +-- __be16 length; +-- u8 version; +-- u8 oui[3]; +-- __be16 usr_subtype; +--} __packed; +-- +--struct brcmf_event_msg_be { +-- __be16 version; +-- __be16 flags; +-- __be32 event_type; +-- __be32 status; +-- __be32 reason; +-- __be32 auth_type; +-- __be32 datalen; +-- u8 addr[ETH_ALEN]; +-- char ifname[IFNAMSIZ]; +-- u8 ifidx; +-- u8 bsscfgidx; +--} __packed; +-- +--/** +-- * struct brcmf_event - contents of broadcom event packet. +-- * +-- * @eth: standard ether header. +-- * @hdr: broadcom specific ether header. +-- * @msg: common part of the actual event message. +-- */ +--struct brcmf_event { +-- struct ethhdr eth; +-- struct brcm_ethhdr hdr; +-- struct brcmf_event_msg_be msg; +--} __packed; +-- +--/** +- * struct brcmf_fweh_queue_item - event item on event queue. +- * +- * @q: list element for queuing. +-@@ -85,6 +41,7 @@ struct brcmf_fweh_queue_item { +- u8 ifidx; +- u8 ifaddr[ETH_ALEN]; +- struct brcmf_event_msg_be emsg; +-+ u32 datalen; +- u8 data[0]; +- }; +- +-@@ -294,6 +251,11 @@ static void brcmf_fweh_event_worker(stru +- brcmf_dbg_hex_dump(BRCMF_EVENT_ON(), event->data, +- min_t(u32, emsg.datalen, 64), +- "event payload, len=%d\n", emsg.datalen); +-+ if (emsg.datalen > event->datalen) { +-+ brcmf_err("event invalid length header=%d, msg=%d\n", +-+ event->datalen, emsg.datalen); +-+ goto event_free; +-+ } +- +- /* special handling of interface event */ +- if (event->code == BRCMF_E_IF) { +-@@ -439,7 +401,8 @@ int brcmf_fweh_activate_events(struct br +- * dispatch the event to a registered handler (using worker). +- */ +- void brcmf_fweh_process_event(struct brcmf_pub *drvr, +-- struct brcmf_event *event_packet) +-+ struct brcmf_event *event_packet, +-+ u32 packet_len) +- { +- enum brcmf_fweh_event_code code; +- struct brcmf_fweh_info *fweh = &drvr->fweh; +-@@ -459,6 +422,9 @@ void brcmf_fweh_process_event(struct brc +- if (code != BRCMF_E_IF && !fweh->evt_handler[code]) +- return; +- +-+ if (datalen > BRCMF_DCMD_MAXLEN) +-+ return; +-+ +- if (in_interrupt()) +- alloc_flag = GFP_ATOMIC; +- +-@@ -472,6 +438,7 @@ void brcmf_fweh_process_event(struct brc +- /* use memcpy to get aligned event message */ +- memcpy(&event->emsg, &event_packet->msg, sizeof(event->emsg)); +- memcpy(event->data, data, datalen); +-+ event->datalen = datalen; +- memcpy(event->ifaddr, event_packet->eth.h_dest, ETH_ALEN); +- +- brcmf_fweh_queue_event(fweh, event); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.h +-@@ -27,7 +27,6 @@ +- struct brcmf_pub; +- struct brcmf_if; +- struct brcmf_cfg80211_info; +--struct brcmf_event; +- +- /* list of firmware events */ +- #define BRCMF_FWEH_EVENT_ENUM_DEFLIST \ +-@@ -180,13 +179,55 @@ enum brcmf_fweh_event_code { +- /** +- * definitions for event packet validation. +- */ +--#define BRCMF_EVENT_OUI_OFFSET 19 +--#define BRCM_OUI "\x00\x10\x18" +--#define DOT11_OUI_LEN 3 +--#define BCMILCP_BCM_SUBTYPE_EVENT 1 +-+#define BRCM_OUI "\x00\x10\x18" +-+#define BCMILCP_BCM_SUBTYPE_EVENT 1 +- +- +- /** +-+ * struct brcm_ethhdr - broadcom specific ether header. +-+ * +-+ * @subtype: subtype for this packet. +-+ * @length: TODO: length of appended data. +-+ * @version: version indication. +-+ * @oui: OUI of this packet. +-+ * @usr_subtype: subtype for this OUI. +-+ */ +-+struct brcm_ethhdr { +-+ __be16 subtype; +-+ __be16 length; +-+ u8 version; +-+ u8 oui[3]; +-+ __be16 usr_subtype; +-+} __packed; +-+ +-+struct brcmf_event_msg_be { +-+ __be16 version; +-+ __be16 flags; +-+ __be32 event_type; +-+ __be32 status; +-+ __be32 reason; +-+ __be32 auth_type; +-+ __be32 datalen; +-+ u8 addr[ETH_ALEN]; +-+ char ifname[IFNAMSIZ]; +-+ u8 ifidx; +-+ u8 bsscfgidx; +-+} __packed; +-+ +-+/** +-+ * struct brcmf_event - contents of broadcom event packet. +-+ * +-+ * @eth: standard ether header. +-+ * @hdr: broadcom specific ether header. +-+ * @msg: common part of the actual event message. +-+ */ +-+struct brcmf_event { +-+ struct ethhdr eth; +-+ struct brcm_ethhdr hdr; +-+ struct brcmf_event_msg_be msg; +-+} __packed; +-+ +-+/** +- * struct brcmf_event_msg - firmware event message. +- * +- * @version: version information. +-@@ -256,34 +297,35 @@ void brcmf_fweh_unregister(struct brcmf_ +- enum brcmf_fweh_event_code code); +- int brcmf_fweh_activate_events(struct brcmf_if *ifp); +- void brcmf_fweh_process_event(struct brcmf_pub *drvr, +-- struct brcmf_event *event_packet); +-+ struct brcmf_event *event_packet, +-+ u32 packet_len); +- void brcmf_fweh_p2pdev_setup(struct brcmf_if *ifp, bool ongoing); +- +- static inline void brcmf_fweh_process_skb(struct brcmf_pub *drvr, +- struct sk_buff *skb) +- { +- struct brcmf_event *event_packet; +-- u8 *data; +- u16 usr_stype; +- +- /* only process events when protocol matches */ +- if (skb->protocol != cpu_to_be16(ETH_P_LINK_CTL)) +- return; +- +-+ if ((skb->len + ETH_HLEN) < sizeof(*event_packet)) +-+ return; +-+ +- /* check for BRCM oui match */ +- event_packet = (struct brcmf_event *)skb_mac_header(skb); +-- data = (u8 *)event_packet; +-- data += BRCMF_EVENT_OUI_OFFSET; +-- if (memcmp(BRCM_OUI, data, DOT11_OUI_LEN)) +-+ if (memcmp(BRCM_OUI, &event_packet->hdr.oui[0], +-+ sizeof(event_packet->hdr.oui))) +- return; +- +- /* final match on usr_subtype */ +-- data += DOT11_OUI_LEN; +-- usr_stype = get_unaligned_be16(data); +-+ usr_stype = get_unaligned_be16(&event_packet->hdr.usr_subtype); +- if (usr_stype != BCMILCP_BCM_SUBTYPE_EVENT) +- return; +- +-- brcmf_fweh_process_event(drvr, event_packet); +-+ brcmf_fweh_process_event(drvr, event_packet, skb->len + ETH_HLEN); +- } +- +- #endif /* FWEH_H_ */ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -1361,6 +1361,11 @@ int brcmf_p2p_notify_action_frame_rx(str +- u16 mgmt_type; +- u8 action; +- +-+ if (e->datalen < sizeof(*rxframe)) { +-+ brcmf_dbg(SCAN, "Event data to small. Ignore\n"); +-+ return 0; +-+ } +-+ +- ch.chspec = be16_to_cpu(rxframe->chanspec); +- cfg->d11inf.decchspec(&ch); +- /* Check if wpa_supplicant has registered for this frame */ +-@@ -1858,6 +1863,11 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere +- brcmf_dbg(INFO, "Enter: event %d reason %d\n", e->event_code, +- e->reason); +- +-+ if (e->datalen < sizeof(*rxframe)) { +-+ brcmf_dbg(SCAN, "Event data to small. Ignore\n"); +-+ return 0; +-+ } +-+ +- ch.chspec = be16_to_cpu(rxframe->chanspec); +- cfg->d11inf.decchspec(&ch); +- +diff --git a/package/kernel/mac80211/patches/344-0006-brcmfmac-add-neighbor-discovery-offload-ip-address-t.patch b/package/kernel/mac80211/patches/344-0006-brcmfmac-add-neighbor-discovery-offload-ip-address-t.patch +deleted file mode 100644 +index 888ad5b..0000000 +--- a/package/kernel/mac80211/patches/344-0006-brcmfmac-add-neighbor-discovery-offload-ip-address-t.patch ++++ /dev/null +@@ -1,333 +0,0 @@ +-From: Franky Lin +-Date: Wed, 17 Feb 2016 11:26:55 +0100 +-Subject: [PATCH] brcmfmac: add neighbor discovery offload ip address table +- configuration +- +-Configure ipv6 address for neighbor discovery offload ip table in +-firmware obtained through ipv6 address notification callback. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -456,7 +456,7 @@ send_key_to_dongle(struct brcmf_if *ifp, +- } +- +- static s32 +--brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable) +-+brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable) +- { +- s32 err; +- u32 mode; +-@@ -484,6 +484,15 @@ brcmf_configure_arp_offload(struct brcmf +- enable, mode); +- } +- +-+ err = brcmf_fil_iovar_int_set(ifp, "ndoe", enable); +-+ if (err) { +-+ brcmf_dbg(TRACE, "failed to configure (%d) ND offload err = %d\n", +-+ enable, err); +-+ err = 0; +-+ } else +-+ brcmf_dbg(TRACE, "successfully configured (%d) ND offload to 0x%x\n", +-+ enable, mode); +-+ +- return err; +- } +- +-@@ -3543,7 +3552,7 @@ static s32 brcmf_cfg80211_resume(struct +- brcmf_report_wowl_wakeind(wiphy, ifp); +- brcmf_fil_iovar_int_set(ifp, "wowl_clear", 0); +- brcmf_config_wowl_pattern(ifp, "clr", NULL, 0, NULL, 0); +-- brcmf_configure_arp_offload(ifp, true); +-+ brcmf_configure_arp_nd_offload(ifp, true); +- brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, +- cfg->wowl.pre_pmmode); +- cfg->wowl.active = false; +-@@ -3567,7 +3576,7 @@ static void brcmf_configure_wowl(struct +- +- brcmf_dbg(TRACE, "Suspend, wowl config.\n"); +- +-- brcmf_configure_arp_offload(ifp, false); +-+ brcmf_configure_arp_nd_offload(ifp, false); +- brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_PM, &cfg->wowl.pre_pmmode); +- brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, PM_MAX); +- +-@@ -4336,7 +4345,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- +- if (!mbss) { +- brcmf_set_mpc(ifp, 0); +-- brcmf_configure_arp_offload(ifp, false); +-+ brcmf_configure_arp_nd_offload(ifp, false); +- } +- +- /* find the RSN_IE */ +-@@ -4482,7 +4491,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- exit: +- if ((err) && (!mbss)) { +- brcmf_set_mpc(ifp, 1); +-- brcmf_configure_arp_offload(ifp, true); +-+ brcmf_configure_arp_nd_offload(ifp, true); +- } +- return err; +- } +-@@ -4540,7 +4549,7 @@ static int brcmf_cfg80211_stop_ap(struct +- brcmf_err("bss_enable config failed %d\n", err); +- } +- brcmf_set_mpc(ifp, 1); +-- brcmf_configure_arp_offload(ifp, true); +-+ brcmf_configure_arp_nd_offload(ifp, true); +- clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); +- brcmf_net_setcarrier(ifp, false); +- +-@@ -6287,7 +6296,7 @@ static s32 brcmf_config_dongle(struct br +- if (err) +- goto default_conf_out; +- +-- brcmf_configure_arp_offload(ifp, true); +-+ brcmf_configure_arp_nd_offload(ifp, true); +- +- cfg->dongle_up = true; +- default_conf_out: +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -20,6 +20,8 @@ +- #include +- #include +- #include +-+#include +-+#include +- #include +- #include +- +-@@ -172,6 +174,35 @@ _brcmf_set_mac_address(struct work_struc +- } +- } +- +-+#if IS_ENABLED(CONFIG_IPV6) +-+static void _brcmf_update_ndtable(struct work_struct *work) +-+{ +-+ struct brcmf_if *ifp; +-+ int i, ret; +-+ +-+ ifp = container_of(work, struct brcmf_if, ndoffload_work); +-+ +-+ /* clear the table in firmware */ +-+ ret = brcmf_fil_iovar_data_set(ifp, "nd_hostip_clear", NULL, 0); +-+ if (ret) { +-+ brcmf_dbg(TRACE, "fail to clear nd ip table err:%d\n", ret); +-+ return; +-+ } +-+ +-+ for (i = 0; i < ifp->ipv6addr_idx; i++) { +-+ ret = brcmf_fil_iovar_data_set(ifp, "nd_hostip", +-+ &ifp->ipv6_addr_tbl[i], +-+ sizeof(struct in6_addr)); +-+ if (ret) +-+ brcmf_err("add nd ip err %d\n", ret); +-+ } +-+} +-+#else +-+static void _brcmf_update_ndtable(struct work_struct *work) +-+{ +-+} +-+#endif +-+ +- static int brcmf_netdev_set_mac_address(struct net_device *ndev, void *addr) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +-@@ -685,6 +716,7 @@ int brcmf_net_attach(struct brcmf_if *if +- +- INIT_WORK(&ifp->setmacaddr_work, _brcmf_set_mac_address); +- INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list); +-+ INIT_WORK(&ifp->ndoffload_work, _brcmf_update_ndtable); +- +- if (rtnl_locked) +- err = register_netdevice(ndev); +-@@ -884,6 +916,7 @@ static void brcmf_del_if(struct brcmf_pu +- if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { +- cancel_work_sync(&ifp->setmacaddr_work); +- cancel_work_sync(&ifp->multicast_work); +-+ cancel_work_sync(&ifp->ndoffload_work); +- } +- brcmf_net_detach(ifp->ndev); +- } else { +-@@ -1025,6 +1058,56 @@ static int brcmf_inetaddr_changed(struct +- } +- #endif +- +-+#if IS_ENABLED(CONFIG_IPV6) +-+static int brcmf_inet6addr_changed(struct notifier_block *nb, +-+ unsigned long action, void *data) +-+{ +-+ struct brcmf_pub *drvr = container_of(nb, struct brcmf_pub, +-+ inet6addr_notifier); +-+ struct inet6_ifaddr *ifa = data; +-+ struct brcmf_if *ifp; +-+ int i; +-+ struct in6_addr *table; +-+ +-+ /* Only handle primary interface */ +-+ ifp = drvr->iflist[0]; +-+ if (!ifp) +-+ return NOTIFY_DONE; +-+ if (ifp->ndev != ifa->idev->dev) +-+ return NOTIFY_DONE; +-+ +-+ table = ifp->ipv6_addr_tbl; +-+ for (i = 0; i < NDOL_MAX_ENTRIES; i++) +-+ if (ipv6_addr_equal(&ifa->addr, &table[i])) +-+ break; +-+ +-+ switch (action) { +-+ case NETDEV_UP: +-+ if (i == NDOL_MAX_ENTRIES) { +-+ if (ifp->ipv6addr_idx < NDOL_MAX_ENTRIES) { +-+ table[ifp->ipv6addr_idx++] = ifa->addr; +-+ } else { +-+ for (i = 0; i < NDOL_MAX_ENTRIES - 1; i++) +-+ table[i] = table[i + 1]; +-+ table[NDOL_MAX_ENTRIES - 1] = ifa->addr; +-+ } +-+ } +-+ break; +-+ case NETDEV_DOWN: +-+ if (i < NDOL_MAX_ENTRIES) +-+ for (; i < ifp->ipv6addr_idx; i++) +-+ table[i] = table[i + 1]; +-+ break; +-+ default: +-+ break; +-+ } +-+ +-+ schedule_work(&ifp->ndoffload_work); +-+ +-+ return NOTIFY_OK; +-+} +-+#endif +-+ +- int brcmf_attach(struct device *dev) +- { +- struct brcmf_pub *drvr = NULL; +-@@ -1164,30 +1247,41 @@ int brcmf_bus_start(struct device *dev) +- #ifdef CONFIG_INET +- drvr->inetaddr_notifier.notifier_call = brcmf_inetaddr_changed; +- ret = register_inetaddr_notifier(&drvr->inetaddr_notifier); +-+ if (ret) +-+ goto fail; +-+ +-+#if IS_ENABLED(CONFIG_IPV6) +-+ drvr->inet6addr_notifier.notifier_call = brcmf_inet6addr_changed; +-+ ret = register_inet6addr_notifier(&drvr->inet6addr_notifier); +-+ if (ret) { +-+ unregister_inetaddr_notifier(&drvr->inetaddr_notifier); +-+ goto fail; +-+ } +- #endif +-+#endif /* CONFIG_INET */ +-+ +-+ return 0; +- +- fail: +-- if (ret < 0) { +-- brcmf_err("failed: %d\n", ret); +-- if (drvr->config) { +-- brcmf_cfg80211_detach(drvr->config); +-- drvr->config = NULL; +-- } +-- if (drvr->fws) { +-- brcmf_fws_del_interface(ifp); +-- brcmf_fws_deinit(drvr); +-- } +-- if (ifp) +-- brcmf_net_detach(ifp->ndev); +-- if (p2p_ifp) +-- brcmf_net_detach(p2p_ifp->ndev); +-- drvr->iflist[0] = NULL; +-- drvr->iflist[1] = NULL; +-- if (brcmf_ignoring_probe_fail(drvr)) +-- ret = 0; +-- return ret; +-+ brcmf_err("failed: %d\n", ret); +-+ if (drvr->config) { +-+ brcmf_cfg80211_detach(drvr->config); +-+ drvr->config = NULL; +-+ } +-+ if (drvr->fws) { +-+ brcmf_fws_del_interface(ifp); +-+ brcmf_fws_deinit(drvr); +- } +-- return 0; +-+ if (ifp) +-+ brcmf_net_detach(ifp->ndev); +-+ if (p2p_ifp) +-+ brcmf_net_detach(p2p_ifp->ndev); +-+ drvr->iflist[0] = NULL; +-+ drvr->iflist[1] = NULL; +-+ if (brcmf_ignoring_probe_fail(drvr)) +-+ ret = 0; +-+ +-+ return ret; +- } +- +- void brcmf_bus_add_txhdrlen(struct device *dev, uint len) +-@@ -1237,6 +1331,10 @@ void brcmf_detach(struct device *dev) +- unregister_inetaddr_notifier(&drvr->inetaddr_notifier); +- #endif +- +-+#if IS_ENABLED(CONFIG_IPV6) +-+ unregister_inet6addr_notifier(&drvr->inet6addr_notifier); +-+#endif +-+ +- /* stop firmware event handling */ +- brcmf_fweh_detach(drvr); +- if (drvr->config) +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -48,6 +48,8 @@ +- */ +- #define BRCMF_DRIVER_FIRMWARE_VERSION_LEN 32 +- +-+#define NDOL_MAX_ENTRIES 8 +-+ +- /** +- * struct brcmf_ampdu_rx_reorder - AMPDU receive reorder info +- * +-@@ -143,6 +145,7 @@ struct brcmf_pub { +- #endif +- +- struct notifier_block inetaddr_notifier; +-+ struct notifier_block inet6addr_notifier; +- struct brcmf_mp_device *settings; +- }; +- +-@@ -175,6 +178,7 @@ enum brcmf_netif_stop_reason { +- * @stats: interface specific network statistics. +- * @setmacaddr_work: worker object for setting mac address. +- * @multicast_work: worker object for multicast provisioning. +-+ * @ndoffload_work: worker object for neighbor discovery offload configuration. +- * @fws_desc: interface specific firmware-signalling descriptor. +- * @ifidx: interface index in device firmware. +- * @bsscfgidx: index of bss associated with this interface. +-@@ -191,6 +195,7 @@ struct brcmf_if { +- struct net_device_stats stats; +- struct work_struct setmacaddr_work; +- struct work_struct multicast_work; +-+ struct work_struct ndoffload_work; +- struct brcmf_fws_mac_descriptor *fws_desc; +- int ifidx; +- s32 bsscfgidx; +-@@ -199,6 +204,8 @@ struct brcmf_if { +- spinlock_t netif_stop_lock; +- atomic_t pend_8021x_cnt; +- wait_queue_head_t pend_8021x_wait; +-+ struct in6_addr ipv6_addr_tbl[NDOL_MAX_ENTRIES]; +-+ u8 ipv6addr_idx; +- }; +- +- struct brcmf_skb_reorder_data { +diff --git a/package/kernel/mac80211/patches/344-0007-brcmfmac-check-return-for-ARP-ip-setting-iovar.patch b/package/kernel/mac80211/patches/344-0007-brcmfmac-check-return-for-ARP-ip-setting-iovar.patch +deleted file mode 100644 +index 68de8ed..0000000 +--- a/package/kernel/mac80211/patches/344-0007-brcmfmac-check-return-for-ARP-ip-setting-iovar.patch ++++ /dev/null +@@ -1,38 +0,0 @@ +-From: Franky Lin +-Date: Wed, 17 Feb 2016 11:26:56 +0100 +-Subject: [PATCH] brcmfmac: check return for ARP ip setting iovar +- +-The return value of iovar set function should be saved and checked. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Hante Meuleman +-Signed-off-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -1039,14 +1039,14 @@ static int brcmf_inetaddr_changed(struct +- return NOTIFY_OK; +- } +- for (i = 0; i < ARPOL_MAX_ENTRIES; i++) { +-- if (addr_table[i] != 0) { +-- brcmf_fil_iovar_data_set(ifp, +-- "arp_hostip", &addr_table[i], +-- sizeof(addr_table[i])); +-- if (ret) +-- brcmf_err("add arp ip err %d\n", +-- ret); +-- } +-+ if (addr_table[i] == 0) +-+ continue; +-+ ret = brcmf_fil_iovar_data_set(ifp, "arp_hostip", +-+ &addr_table[i], +-+ sizeof(addr_table[i])); +-+ if (ret) +-+ brcmf_err("add arp ip err %d\n", +-+ ret); +- } +- } +- break; diff --git a/package/kernel/mac80211/patches/344-0008-brcmfmac-use-device-memsize-config-from-fw-if-define.patch b/package/kernel/mac80211/patches/344-0008-brcmfmac-use-device-memsize-config-from-fw-if-define.patch deleted file mode 100644 index 3de0f64..0000000 @@ -11449,9 +12614,236 @@ index e4a8f30..0000000 - BRCMF_FW_NVRAM_ENTRY(BRCM_CC_4371_CHIP_ID, 0xFFFFFFFF, 4371), - }; - +diff --git a/package/kernel/mac80211/patches/344-0011-brcmfmac-remove-pcie-gen1-support.patch b/package/kernel/mac80211/patches/344-0011-brcmfmac-remove-pcie-gen1-support.patch +deleted file mode 100644 +index f99f6db..0000000 +--- a/package/kernel/mac80211/patches/344-0011-brcmfmac-remove-pcie-gen1-support.patch ++++ /dev/null +@@ -1,221 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:00 +0100 +-Subject: [PATCH] brcmfmac: remove pcie gen1 support +- +-The PCIE bus driver supports older gen1 (v1) chips, but there is no +-actual device which is using this older pcie core which is supported +-by brcmfmac. Remove all gen1 related code. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-@@ -100,9 +100,6 @@ static struct brcmf_firmware_mapping brc +- #define BRCMF_PCIE_PCIE2REG_CONFIGDATA 0x124 +- #define BRCMF_PCIE_PCIE2REG_H2D_MAILBOX 0x140 +- +--#define BRCMF_PCIE_GENREV1 1 +--#define BRCMF_PCIE_GENREV2 2 +-- +- #define BRCMF_PCIE2_INTA 0x01 +- #define BRCMF_PCIE2_INTB 0x02 +- +-@@ -257,9 +254,7 @@ struct brcmf_pciedev_info { +- u32 ram_size; +- struct brcmf_chip *ci; +- u32 coreid; +-- u32 generic_corerev; +- struct brcmf_pcie_shared_info shared; +-- void (*ringbell)(struct brcmf_pciedev_info *devinfo); +- wait_queue_head_t mbdata_resp_wait; +- bool mbdata_completed; +- bool irq_allocated; +-@@ -746,68 +741,22 @@ static void brcmf_pcie_bus_console_read( +- } +- +- +--static __used void brcmf_pcie_ringbell_v1(struct brcmf_pciedev_info *devinfo) +--{ +-- u32 reg_value; +-- +-- brcmf_dbg(PCIE, "RING !\n"); +-- reg_value = brcmf_pcie_read_reg32(devinfo, +-- BRCMF_PCIE_PCIE2REG_MAILBOXINT); +-- reg_value |= BRCMF_PCIE2_INTB; +-- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT, +-- reg_value); +--} +-- +-- +--static void brcmf_pcie_ringbell_v2(struct brcmf_pciedev_info *devinfo) +--{ +-- brcmf_dbg(PCIE, "RING !\n"); +-- /* Any arbitrary value will do, lets use 1 */ +-- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_H2D_MAILBOX, 1); +--} +-- +-- +- static void brcmf_pcie_intr_disable(struct brcmf_pciedev_info *devinfo) +- { +-- if (devinfo->generic_corerev == BRCMF_PCIE_GENREV1) +-- pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_INTMASK, +-- 0); +-- else +-- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXMASK, +-- 0); +-+ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXMASK, 0); +- } +- +- +- static void brcmf_pcie_intr_enable(struct brcmf_pciedev_info *devinfo) +- { +-- if (devinfo->generic_corerev == BRCMF_PCIE_GENREV1) +-- pci_write_config_dword(devinfo->pdev, BRCMF_PCIE_REG_INTMASK, +-- BRCMF_PCIE_INT_DEF); +-- else +-- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXMASK, +-- BRCMF_PCIE_MB_INT_D2H_DB | +-- BRCMF_PCIE_MB_INT_FN0_0 | +-- BRCMF_PCIE_MB_INT_FN0_1); +-+ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXMASK, +-+ BRCMF_PCIE_MB_INT_D2H_DB | +-+ BRCMF_PCIE_MB_INT_FN0_0 | +-+ BRCMF_PCIE_MB_INT_FN0_1); +- } +- +- +--static irqreturn_t brcmf_pcie_quick_check_isr_v1(int irq, void *arg) +--{ +-- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)arg; +-- u32 status; +-- +-- status = 0; +-- pci_read_config_dword(devinfo->pdev, BRCMF_PCIE_REG_INTSTATUS, &status); +-- if (status) { +-- brcmf_pcie_intr_disable(devinfo); +-- brcmf_dbg(PCIE, "Enter\n"); +-- return IRQ_WAKE_THREAD; +-- } +-- return IRQ_NONE; +--} +-- +-- +--static irqreturn_t brcmf_pcie_quick_check_isr_v2(int irq, void *arg) +-+static irqreturn_t brcmf_pcie_quick_check_isr(int irq, void *arg) +- { +- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)arg; +- +-@@ -820,29 +769,7 @@ static irqreturn_t brcmf_pcie_quick_chec +- } +- +- +--static irqreturn_t brcmf_pcie_isr_thread_v1(int irq, void *arg) +--{ +-- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)arg; +-- const struct pci_dev *pdev = devinfo->pdev; +-- u32 status; +-- +-- devinfo->in_irq = true; +-- status = 0; +-- pci_read_config_dword(pdev, BRCMF_PCIE_REG_INTSTATUS, &status); +-- brcmf_dbg(PCIE, "Enter %x\n", status); +-- if (status) { +-- pci_write_config_dword(pdev, BRCMF_PCIE_REG_INTSTATUS, status); +-- if (devinfo->state == BRCMFMAC_PCIE_STATE_UP) +-- brcmf_proto_msgbuf_rx_trigger(&devinfo->pdev->dev); +-- } +-- if (devinfo->state == BRCMFMAC_PCIE_STATE_UP) +-- brcmf_pcie_intr_enable(devinfo); +-- devinfo->in_irq = false; +-- return IRQ_HANDLED; +--} +-- +-- +--static irqreturn_t brcmf_pcie_isr_thread_v2(int irq, void *arg) +-+static irqreturn_t brcmf_pcie_isr_thread(int irq, void *arg) +- { +- struct brcmf_pciedev_info *devinfo = (struct brcmf_pciedev_info *)arg; +- u32 status; +-@@ -879,28 +806,14 @@ static int brcmf_pcie_request_irq(struct +- brcmf_pcie_intr_disable(devinfo); +- +- brcmf_dbg(PCIE, "Enter\n"); +-- /* is it a v1 or v2 implementation */ +-+ +- pci_enable_msi(pdev); +-- if (devinfo->generic_corerev == BRCMF_PCIE_GENREV1) { +-- if (request_threaded_irq(pdev->irq, +-- brcmf_pcie_quick_check_isr_v1, +-- brcmf_pcie_isr_thread_v1, +-- IRQF_SHARED, "brcmf_pcie_intr", +-- devinfo)) { +-- pci_disable_msi(pdev); +-- brcmf_err("Failed to request IRQ %d\n", pdev->irq); +-- return -EIO; +-- } +-- } else { +-- if (request_threaded_irq(pdev->irq, +-- brcmf_pcie_quick_check_isr_v2, +-- brcmf_pcie_isr_thread_v2, +-- IRQF_SHARED, "brcmf_pcie_intr", +-- devinfo)) { +-- pci_disable_msi(pdev); +-- brcmf_err("Failed to request IRQ %d\n", pdev->irq); +-- return -EIO; +-- } +-+ if (request_threaded_irq(pdev->irq, brcmf_pcie_quick_check_isr, +-+ brcmf_pcie_isr_thread, IRQF_SHARED, +-+ "brcmf_pcie_intr", devinfo)) { +-+ pci_disable_msi(pdev); +-+ brcmf_err("Failed to request IRQ %d\n", pdev->irq); +-+ return -EIO; +- } +- devinfo->irq_allocated = true; +- return 0; +-@@ -931,16 +844,9 @@ static void brcmf_pcie_release_irq(struc +- if (devinfo->in_irq) +- brcmf_err("Still in IRQ (processing) !!!\n"); +- +-- if (devinfo->generic_corerev == BRCMF_PCIE_GENREV1) { +-- status = 0; +-- pci_read_config_dword(pdev, BRCMF_PCIE_REG_INTSTATUS, &status); +-- pci_write_config_dword(pdev, BRCMF_PCIE_REG_INTSTATUS, status); +-- } else { +-- status = brcmf_pcie_read_reg32(devinfo, +-- BRCMF_PCIE_PCIE2REG_MAILBOXINT); +-- brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT, +-- status); +-- } +-+ status = brcmf_pcie_read_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT); +-+ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_MAILBOXINT, status); +-+ +- devinfo->irq_allocated = false; +- } +- +-@@ -989,7 +895,9 @@ static int brcmf_pcie_ring_mb_ring_bell( +- if (devinfo->state != BRCMFMAC_PCIE_STATE_UP) +- return -EIO; +- +-- devinfo->ringbell(devinfo); +-+ brcmf_dbg(PCIE, "RING !\n"); +-+ /* Any arbitrary value will do, lets use 1 */ +-+ brcmf_pcie_write_reg32(devinfo, BRCMF_PCIE_PCIE2REG_H2D_MAILBOX, 1); +- +- return 0; +- } +-@@ -1503,9 +1411,6 @@ static int brcmf_pcie_download_fw_nvram( +- u32 address; +- u32 resetintr; +- +-- devinfo->ringbell = brcmf_pcie_ringbell_v2; +-- devinfo->generic_corerev = BRCMF_PCIE_GENREV2; +-- +- brcmf_dbg(PCIE, "Halt ARM.\n"); +- err = brcmf_pcie_enter_download_state(devinfo); +- if (err) diff --git a/package/kernel/mac80211/patches/344-0012-brcmfmac-increase-timeout-for-tx-eapol.patch b/package/kernel/mac80211/patches/344-0012-brcmfmac-increase-timeout-for-tx-eapol.patch deleted file mode 100644 -index c529ff2..0000000 +index 4adfc2d..0000000 --- a/package/kernel/mac80211/patches/344-0012-brcmfmac-increase-timeout-for-tx-eapol.patch +++ /dev/null @@ -1,30 +0,0 @@ @@ -11476,7 +12868,7 @@ index c529ff2..0000000 - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c --@@ -40,7 +40,7 @@ MODULE_AUTHOR("Broadcom Corporation"); +-@@ -42,7 +42,7 @@ MODULE_AUTHOR("Broadcom Corporation"); - MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); - MODULE_LICENSE("Dual BSD/GPL"); - @@ -11485,6 +12877,2980 @@ index c529ff2..0000000 - - /* AMPDU rx reordering definitions */ - #define BRCMF_RXREORDER_FLOWID_OFFSET 0 +diff --git a/package/kernel/mac80211/patches/344-0013-brcmfmac-move-module-init-and-exit-to-common.patch b/package/kernel/mac80211/patches/344-0013-brcmfmac-move-module-init-and-exit-to-common.patch +deleted file mode 100644 +index bd62781..0000000 +--- a/package/kernel/mac80211/patches/344-0013-brcmfmac-move-module-init-and-exit-to-common.patch ++++ /dev/null +@@ -1,135 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:02 +0100 +-Subject: [PATCH] brcmfmac: move module init and exit to common +- +-In preparation of module parameters for all devices the module init +-and exit routines are moved to the common file. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-@@ -28,6 +28,10 @@ +- #include "tracepoint.h" +- #include "common.h" +- +-+MODULE_AUTHOR("Broadcom Corporation"); +-+MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); +-+MODULE_LICENSE("Dual BSD/GPL"); +-+ +- const u8 ALLFFMAC[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; +- +- #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 +-@@ -221,7 +225,7 @@ void __brcmf_dbg(u32 level, const char * +- } +- #endif +- +--void brcmf_mp_attach(void) +-+static void brcmf_mp_attach(void) +- { +- strlcpy(brcmf_mp_global.firmware_path, brcmf_firmware_path, +- BRCMF_FW_ALTPATH_LEN); +-@@ -249,3 +253,33 @@ void brcmf_mp_device_detach(struct brcmf +- kfree(drvr->settings); +- } +- +-+static int __init brcmfmac_module_init(void) +-+{ +-+ int err; +-+ +-+ /* Initialize debug system first */ +-+ brcmf_debugfs_init(); +-+ +-+#ifdef CPTCFG_BRCMFMAC_SDIO +-+ brcmf_sdio_init(); +-+#endif +-+ /* Initialize global module paramaters */ +-+ brcmf_mp_attach(); +-+ +-+ /* Continue the initialization by registering the different busses */ +-+ err = brcmf_core_init(); +-+ if (err) +-+ brcmf_debugfs_exit(); +-+ +-+ return err; +-+} +-+ +-+static void __exit brcmfmac_module_exit(void) +-+{ +-+ brcmf_core_exit(); +-+ brcmf_debugfs_exit(); +-+} +-+ +-+module_init(brcmfmac_module_init); +-+module_exit(brcmfmac_module_exit); +-+ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-@@ -89,7 +89,6 @@ struct brcmf_mp_device { +- struct cc_translate *country_codes; +- }; +- +--void brcmf_mp_attach(void); +- int brcmf_mp_device_attach(struct brcmf_pub *drvr); +- void brcmf_mp_device_detach(struct brcmf_pub *drvr); +- #ifdef DEBUG +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -38,10 +38,6 @@ +- #include "pcie.h" +- #include "common.h" +- +--MODULE_AUTHOR("Broadcom Corporation"); +--MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); +--MODULE_LICENSE("Dual BSD/GPL"); +-- +- #define MAX_WAIT_FOR_8021X_TX msecs_to_jiffies(950) +- +- /* AMPDU rx reordering definitions */ +-@@ -1422,19 +1418,15 @@ static void brcmf_driver_register(struct +- } +- static DECLARE_WORK(brcmf_driver_work, brcmf_driver_register); +- +--static int __init brcmfmac_module_init(void) +-+int __init brcmf_core_init(void) +- { +-- brcmf_debugfs_init(); +--#ifdef CPTCFG_BRCMFMAC_SDIO +-- brcmf_sdio_init(); +--#endif +- if (!schedule_work(&brcmf_driver_work)) +- return -EBUSY; +- +- return 0; +- } +- +--static void __exit brcmfmac_module_exit(void) +-+void __exit brcmf_core_exit(void) +- { +- cancel_work_sync(&brcmf_driver_work); +- +-@@ -1447,8 +1439,5 @@ static void __exit brcmfmac_module_exit( +- #ifdef CPTCFG_BRCMFMAC_PCIE +- brcmf_pcie_exit(); +- #endif +-- brcmf_debugfs_exit(); +- } +- +--module_init(brcmfmac_module_init); +--module_exit(brcmfmac_module_exit); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -227,5 +227,7 @@ void brcmf_txflowblock_if(struct brcmf_i +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +- void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); +- void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on); +-+int __init brcmf_core_init(void); +-+void __exit brcmf_core_exit(void); +- +- #endif /* BRCMFMAC_CORE_H */ +diff --git a/package/kernel/mac80211/patches/344-0014-brcmfmac-add-wowl-gtk-rekeying-offload-support.patch b/package/kernel/mac80211/patches/344-0014-brcmfmac-add-wowl-gtk-rekeying-offload-support.patch +deleted file mode 100644 +index 577ca8e..0000000 +--- a/package/kernel/mac80211/patches/344-0014-brcmfmac-add-wowl-gtk-rekeying-offload-support.patch ++++ /dev/null +@@ -1,260 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:03 +0100 +-Subject: [PATCH] brcmfmac: add wowl gtk rekeying offload support +- +-This patch adds support for gtk rekeying offload and for gtk +-rekeying failure during wowl mode. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -3526,6 +3526,10 @@ static void brcmf_report_wowl_wakeind(st +- else +- wakeup_data.net_detect = cfg->wowl.nd_info; +- } +-+ if (wakeind & BRCMF_WOWL_GTK_FAILURE) { +-+ brcmf_dbg(INFO, "WOWL Wake indicator: BRCMF_WOWL_GTK_FAILURE\n"); +-+ wakeup_data.gtk_rekey_failure = true; +-+ } +- } else { +- wakeup = NULL; +- } +-@@ -3607,6 +3611,8 @@ static void brcmf_configure_wowl(struct +- brcmf_fweh_register(cfg->pub, BRCMF_E_PFN_NET_FOUND, +- brcmf_wowl_nd_results); +- } +-+ if (wowl->gtk_rekey_failure) +-+ wowl_config |= BRCMF_WOWL_GTK_FAILURE; +- if (!test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state)) +- wowl_config |= BRCMF_WOWL_UNASSOC; +- +-@@ -4874,7 +4880,32 @@ static int brcmf_cfg80211_tdls_oper(stru +- return ret; +- } +- +--static struct cfg80211_ops wl_cfg80211_ops = { +-+#ifdef CONFIG_PM +-+static int +-+brcmf_cfg80211_set_rekey_data(struct wiphy *wiphy, struct net_device *ndev, +-+ struct cfg80211_gtk_rekey_data *gtk) +-+{ +-+ struct brcmf_if *ifp = netdev_priv(ndev); +-+ struct brcmf_gtk_keyinfo_le gtk_le; +-+ int ret; +-+ +-+ brcmf_dbg(TRACE, "Enter, bssidx=%d\n", ifp->bsscfgidx); +-+ +-+ memcpy(gtk_le.kck, gtk->kck, sizeof(gtk_le.kck)); +-+ memcpy(gtk_le.kek, gtk->kek, sizeof(gtk_le.kek)); +-+ memcpy(gtk_le.replay_counter, gtk->replay_ctr, +-+ sizeof(gtk_le.replay_counter)); +-+ +-+ ret = brcmf_fil_iovar_data_set(ifp, "gtk_key_info", >k_le, +-+ sizeof(gtk_le)); +-+ if (ret < 0) +-+ brcmf_err("gtk_key_info iovar failed: ret=%d\n", ret); +-+ +-+ return ret; +-+} +-+#endif +-+ +-+static struct cfg80211_ops brcmf_cfg80211_ops = { +- .add_virtual_intf = brcmf_cfg80211_add_iface, +- .del_virtual_intf = brcmf_cfg80211_del_iface, +- .change_virtual_intf = brcmf_cfg80211_change_iface, +-@@ -6139,19 +6170,18 @@ static void brcmf_wiphy_wowl_params(stru +- { +- #ifdef CONFIG_PM +- struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +-- s32 err; +-- u32 wowl_cap; +- +- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_PNO)) { +-- err = brcmf_fil_iovar_int_get(ifp, "wowl_cap", &wowl_cap); +-- if (!err) { +-- if (wowl_cap & BRCMF_WOWL_PFN_FOUND) { +-- brcmf_wowlan_support.flags |= +-- WIPHY_WOWLAN_NET_DETECT; +-- init_waitqueue_head(&cfg->wowl.nd_data_wait); +-- } +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_ND)) { +-+ brcmf_wowlan_support.flags |= WIPHY_WOWLAN_NET_DETECT; +-+ init_waitqueue_head(&cfg->wowl.nd_data_wait); +- } +- } +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK)) { +-+ brcmf_wowlan_support.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY; +-+ brcmf_wowlan_support.flags |= WIPHY_WOWLAN_GTK_REKEY_FAILURE; +-+ } +-+ +- wiphy->wowlan = &brcmf_wowlan_support; +- #endif +- } +-@@ -6538,6 +6568,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- struct net_device *ndev = brcmf_get_ifp(drvr, 0)->ndev; +- struct brcmf_cfg80211_info *cfg; +- struct wiphy *wiphy; +-+ struct cfg80211_ops *ops; +- struct brcmf_cfg80211_vif *vif; +- struct brcmf_if *ifp; +- s32 err = 0; +-@@ -6549,8 +6580,17 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- return NULL; +- } +- +-+ ops = kzalloc(sizeof(*ops), GFP_KERNEL); +-+ if (!ops) +-+ return NULL; +-+ +-+ memcpy(ops, &brcmf_cfg80211_ops, sizeof(*ops)); +- ifp = netdev_priv(ndev); +-- wiphy = wiphy_new(&wl_cfg80211_ops, sizeof(struct brcmf_cfg80211_info)); +-+#ifdef CONFIG_PM +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK)) +-+ ops->set_rekey_data = brcmf_cfg80211_set_rekey_data; +-+#endif +-+ wiphy = wiphy_new(ops, sizeof(struct brcmf_cfg80211_info)); +- if (!wiphy) { +- brcmf_err("Could not allocate wiphy device\n"); +- return NULL; +-@@ -6560,6 +6600,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- +- cfg = wiphy_priv(wiphy); +- cfg->wiphy = wiphy; +-+ cfg->ops = ops; +- cfg->pub = drvr; +- init_vif_event(&cfg->vif_event); +- INIT_LIST_HEAD(&cfg->vif_list); +-@@ -6686,6 +6727,7 @@ priv_out: +- ifp->vif = NULL; +- wiphy_out: +- brcmf_free_wiphy(wiphy); +-+ kfree(ops); +- return NULL; +- } +- +-@@ -6696,6 +6738,7 @@ void brcmf_cfg80211_detach(struct brcmf_ +- +- brcmf_btcoex_detach(cfg); +- wiphy_unregister(cfg->wiphy); +-+ kfree(cfg->ops); +- wl_deinit_priv(cfg); +- brcmf_free_wiphy(cfg->wiphy); +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -256,6 +256,7 @@ struct brcmf_cfg80211_wowl { +- * struct brcmf_cfg80211_info - dongle private data of cfg80211 interface +- * +- * @wiphy: wiphy object for cfg80211 interface. +-+ * @ops: pointer to copy of ops as registered with wiphy object. +- * @conf: dongle configuration. +- * @p2p: peer-to-peer specific information. +- * @btcoex: Bluetooth coexistence information. +-@@ -288,6 +289,7 @@ struct brcmf_cfg80211_wowl { +- */ +- struct brcmf_cfg80211_info { +- struct wiphy *wiphy; +-+ struct cfg80211_ops *ops; +- struct brcmf_cfg80211_conf *conf; +- struct brcmf_p2p_info p2p; +- struct brcmf_btcoex_info *btcoex; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +-@@ -136,6 +136,7 @@ void brcmf_feat_attach(struct brcmf_pub +- { +- struct brcmf_if *ifp = brcmf_get_ifp(drvr, 0); +- struct brcmf_pno_macaddr_le pfn_mac; +-+ u32 wowl_cap; +- s32 err; +- +- brcmf_feat_firmware_capabilities(ifp); +-@@ -143,6 +144,17 @@ void brcmf_feat_attach(struct brcmf_pub +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_PNO, "pfn"); +- if (drvr->bus_if->wowl_supported) +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_WOWL, "wowl"); +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL)) { +-+ err = brcmf_fil_iovar_int_get(ifp, "wowl_cap", &wowl_cap); +-+ if (!err) { +-+ if (wowl_cap & BRCMF_WOWL_PFN_FOUND) +-+ ifp->drvr->feat_flags |= +-+ BIT(BRCMF_FEAT_WOWL_ND); +-+ if (wowl_cap & BRCMF_WOWL_GTK_FAILURE) +-+ ifp->drvr->feat_flags |= +-+ BIT(BRCMF_FEAT_WOWL_GTK); +-+ } +-+ } +- /* MBSS does not work for 43362 */ +- if (drvr->bus_if->chip == BRCM_CC_43362_CHIP_ID) +- ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_MBSS); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +-@@ -27,6 +27,8 @@ +- * RSDB: Real Simultaneous Dual Band +- * TDLS: Tunneled Direct Link Setup +- * SCAN_RANDOM_MAC: Random MAC during (net detect) scheduled scan. +-+ * WOWL_ND: WOWL net detect (PNO) +-+ * WOWL_GTK: (WOWL) GTK rekeying offload +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +-@@ -36,7 +38,9 @@ +- BRCMF_FEAT_DEF(P2P) \ +- BRCMF_FEAT_DEF(RSDB) \ +- BRCMF_FEAT_DEF(TDLS) \ +-- BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) +-+ BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \ +-+ BRCMF_FEAT_DEF(WOWL_ND) \ +-+ BRCMF_FEAT_DEF(WOWL_GTK) +- +- /* +- * Quirks: +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +-@@ -111,7 +111,9 @@ +- /* Wakeup if received matched secured pattern: */ +- #define BRCMF_WOWL_SECURE (1 << 25) +- /* Wakeup on finding preferred network */ +--#define BRCMF_WOWL_PFN_FOUND (1 << 26) +-+#define BRCMF_WOWL_PFN_FOUND (1 << 27) +-+/* Wakeup on receiving pairwise key EAP packets: */ +-+#define WIPHY_WOWL_EAP_PK (1 << 28) +- /* Link Down indication in WoWL mode: */ +- #define BRCMF_WOWL_LINKDOWN (1 << 31) +- +-@@ -136,6 +138,10 @@ +- +- #define BRCMF_MCSSET_LEN 16 +- +-+#define BRCMF_RSN_KCK_LENGTH 16 +-+#define BRCMF_RSN_KEK_LENGTH 16 +-+#define BRCMF_RSN_REPLAY_LEN 8 +-+ +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +- BRCMF_JOIN_PREF_RSSI = 1, +-@@ -789,4 +795,17 @@ struct brcmf_pktcnt_le { +- __le32 rx_ocast_good_pkt; +- }; +- +-+/** +-+ * struct brcmf_gtk_keyinfo_le - GTP rekey data +-+ * +-+ * @kck: key confirmation key. +-+ * @kek: key encryption key. +-+ * @replay_counter: replay counter. +-+ */ +-+struct brcmf_gtk_keyinfo_le { +-+ u8 kck[BRCMF_RSN_KCK_LENGTH]; +-+ u8 kek[BRCMF_RSN_KEK_LENGTH]; +-+ u8 replay_counter[BRCMF_RSN_REPLAY_LEN]; +-+}; +-+ +- #endif /* FWIL_TYPES_H_ */ +diff --git a/package/kernel/mac80211/patches/344-0015-brcmfmac-move-platform-data-retrieval-code-to-common.patch b/package/kernel/mac80211/patches/344-0015-brcmfmac-move-platform-data-retrieval-code-to-common.patch +deleted file mode 100644 +index 2685238..0000000 +--- a/package/kernel/mac80211/patches/344-0015-brcmfmac-move-platform-data-retrieval-code-to-common.patch ++++ /dev/null +@@ -1,385 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:04 +0100 +-Subject: [PATCH] brcmfmac: move platform data retrieval code to common +- +-In preparation of module parameters for all devices the module +-platform data retrieval is moved from sdio to common. It is still +-only used for sdio devices. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -27,8 +27,6 @@ +- #include +- #include +- #include +--#include +--#include +- #include +- #include +- #include +-@@ -46,7 +44,6 @@ +- #include "bus.h" +- #include "debug.h" +- #include "sdio.h" +--#include "of.h" +- #include "core.h" +- #include "common.h" +- +-@@ -106,18 +103,18 @@ static void brcmf_sdiod_dummy_irqhandler +- +- int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) +- { +-+ struct brcmfmac_sdio_platform_data *pdata; +- int ret = 0; +- u8 data; +- u32 addr, gpiocontrol; +- unsigned long flags; +- +-- if ((sdiodev->pdata) && (sdiodev->pdata->oob_irq_supported)) { +-+ pdata = sdiodev->pdata; +-+ if ((pdata) && (pdata->oob_irq_supported)) { +- brcmf_dbg(SDIO, "Enter, register OOB IRQ %d\n", +-- sdiodev->pdata->oob_irq_nr); +-- ret = request_irq(sdiodev->pdata->oob_irq_nr, +-- brcmf_sdiod_oob_irqhandler, +-- sdiodev->pdata->oob_irq_flags, +-- "brcmf_oob_intr", +-+ pdata->oob_irq_nr); +-+ ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler, +-+ pdata->oob_irq_flags, "brcmf_oob_intr", +- &sdiodev->func[1]->dev); +- if (ret != 0) { +- brcmf_err("request_irq failed %d\n", ret); +-@@ -129,7 +126,7 @@ int brcmf_sdiod_intr_register(struct brc +- sdiodev->irq_en = true; +- spin_unlock_irqrestore(&sdiodev->irq_en_lock, flags); +- +-- ret = enable_irq_wake(sdiodev->pdata->oob_irq_nr); +-+ ret = enable_irq_wake(pdata->oob_irq_nr); +- if (ret != 0) { +- brcmf_err("enable_irq_wake failed %d\n", ret); +- return ret; +-@@ -158,7 +155,7 @@ int brcmf_sdiod_intr_register(struct brc +- +- /* redirect, configure and enable io for interrupt signal */ +- data = SDIO_SEPINT_MASK | SDIO_SEPINT_OE; +-- if (sdiodev->pdata->oob_irq_flags & IRQF_TRIGGER_HIGH) +-+ if (pdata->oob_irq_flags & IRQF_TRIGGER_HIGH) +- data |= SDIO_SEPINT_ACT_HI; +- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, data, &ret); +- +-@@ -176,9 +173,12 @@ int brcmf_sdiod_intr_register(struct brc +- +- int brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev) +- { +-+ struct brcmfmac_sdio_platform_data *pdata; +-+ +- brcmf_dbg(SDIO, "Entering\n"); +- +-- if ((sdiodev->pdata) && (sdiodev->pdata->oob_irq_supported)) { +-+ pdata = sdiodev->pdata; +-+ if ((pdata) && (pdata->oob_irq_supported)) { +- sdio_claim_host(sdiodev->func[1]); +- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL); +- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_IENx, 0, NULL); +-@@ -187,11 +187,10 @@ int brcmf_sdiod_intr_unregister(struct b +- if (sdiodev->oob_irq_requested) { +- sdiodev->oob_irq_requested = false; +- if (sdiodev->irq_wake) { +-- disable_irq_wake(sdiodev->pdata->oob_irq_nr); +-+ disable_irq_wake(pdata->oob_irq_nr); +- sdiodev->irq_wake = false; +- } +-- free_irq(sdiodev->pdata->oob_irq_nr, +-- &sdiodev->func[1]->dev); +-+ free_irq(pdata->oob_irq_nr, &sdiodev->func[1]->dev); +- sdiodev->irq_en = false; +- } +- } else { +-@@ -1103,8 +1102,6 @@ static const struct sdio_device_id brcmf +- }; +- MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids); +- +--static struct brcmfmac_sdio_platform_data *brcmfmac_sdio_pdata; +-- +- +- static void brcmf_sdiod_acpi_set_power_manageable(struct device *dev, +- int val) +-@@ -1167,10 +1164,7 @@ static int brcmf_ops_sdio_probe(struct s +- dev_set_drvdata(&func->dev, bus_if); +- dev_set_drvdata(&sdiodev->func[1]->dev, bus_if); +- sdiodev->dev = &sdiodev->func[1]->dev; +-- sdiodev->pdata = brcmfmac_sdio_pdata; +-- +-- if (!sdiodev->pdata) +-- brcmf_of_probe(sdiodev); +-+ sdiodev->pdata = brcmf_get_module_param(sdiodev->dev); +- +- #ifdef CONFIG_PM_SLEEP +- /* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ +-@@ -1296,7 +1290,7 @@ static const struct dev_pm_ops brcmf_sdi +- static struct sdio_driver brcmf_sdmmc_driver = { +- .probe = brcmf_ops_sdio_probe, +- .remove = brcmf_ops_sdio_remove, +-- .name = BRCMFMAC_SDIO_PDATA_NAME, +-+ .name = KBUILD_MODNAME, +- .id_table = brcmf_sdmmc_ids, +- .drv = { +- .owner = THIS_MODULE, +-@@ -1306,37 +1300,6 @@ static struct sdio_driver brcmf_sdmmc_dr +- }, +- }; +- +--static int __init brcmf_sdio_pd_probe(struct platform_device *pdev) +--{ +-- brcmf_dbg(SDIO, "Enter\n"); +-- +-- brcmfmac_sdio_pdata = dev_get_platdata(&pdev->dev); +-- +-- if (brcmfmac_sdio_pdata->power_on) +-- brcmfmac_sdio_pdata->power_on(); +-- +-- return 0; +--} +-- +--static int brcmf_sdio_pd_remove(struct platform_device *pdev) +--{ +-- brcmf_dbg(SDIO, "Enter\n"); +-- +-- if (brcmfmac_sdio_pdata->power_off) +-- brcmfmac_sdio_pdata->power_off(); +-- +-- sdio_unregister_driver(&brcmf_sdmmc_driver); +-- +-- return 0; +--} +-- +--static struct platform_driver brcmf_sdio_pd = { +-- .remove = brcmf_sdio_pd_remove, +-- .driver = { +-- .name = BRCMFMAC_SDIO_PDATA_NAME, +-- } +--}; +-- +- void brcmf_sdio_register(void) +- { +- int ret; +-@@ -1350,19 +1313,6 @@ void brcmf_sdio_exit(void) +- { +- brcmf_dbg(SDIO, "Enter\n"); +- +-- if (brcmfmac_sdio_pdata) +-- platform_driver_unregister(&brcmf_sdio_pd); +-- else +-- sdio_unregister_driver(&brcmf_sdmmc_driver); +-+ sdio_unregister_driver(&brcmf_sdmmc_driver); +- } +- +--void __init brcmf_sdio_init(void) +--{ +-- int ret; +-- +-- brcmf_dbg(SDIO, "Enter\n"); +-- +-- ret = platform_driver_probe(&brcmf_sdio_pd, brcmf_sdio_pd_probe); +-- if (ret == -ENODEV) +-- brcmf_dbg(SDIO, "No platform data available.\n"); +--} +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-@@ -27,6 +27,7 @@ +- #include "fwil_types.h" +- #include "tracepoint.h" +- #include "common.h" +-+#include "of.h" +- +- MODULE_AUTHOR("Broadcom Corporation"); +- MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver."); +-@@ -79,6 +80,7 @@ module_param_named(ignore_probe_fail, br +- MODULE_PARM_DESC(ignore_probe_fail, "always succeed probe for debugging"); +- #endif +- +-+static struct brcmfmac_sdio_platform_data *brcmfmac_pdata; +- struct brcmf_mp_global_t brcmf_mp_global; +- +- int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) +-@@ -231,6 +233,13 @@ static void brcmf_mp_attach(void) +- BRCMF_FW_ALTPATH_LEN); +- } +- +-+struct brcmfmac_sdio_platform_data *brcmf_get_module_param(struct device *dev) +-+{ +-+ if (!brcmfmac_pdata) +-+ brcmf_of_probe(dev, &brcmfmac_pdata); +-+ return brcmfmac_pdata; +-+} +-+ +- int brcmf_mp_device_attach(struct brcmf_pub *drvr) +- { +- drvr->settings = kzalloc(sizeof(*drvr->settings), GFP_ATOMIC); +-@@ -253,6 +262,35 @@ void brcmf_mp_device_detach(struct brcmf +- kfree(drvr->settings); +- } +- +-+static int __init brcmf_common_pd_probe(struct platform_device *pdev) +-+{ +-+ brcmf_dbg(INFO, "Enter\n"); +-+ +-+ brcmfmac_pdata = dev_get_platdata(&pdev->dev); +-+ +-+ if (brcmfmac_pdata->power_on) +-+ brcmfmac_pdata->power_on(); +-+ +-+ return 0; +-+} +-+ +-+static int brcmf_common_pd_remove(struct platform_device *pdev) +-+{ +-+ brcmf_dbg(INFO, "Enter\n"); +-+ +-+ if (brcmfmac_pdata->power_off) +-+ brcmfmac_pdata->power_off(); +-+ +-+ return 0; +-+} +-+ +-+static struct platform_driver brcmf_pd = { +-+ .remove = brcmf_common_pd_remove, +-+ .driver = { +-+ .name = BRCMFMAC_SDIO_PDATA_NAME, +-+ } +-+}; +-+ +- static int __init brcmfmac_module_init(void) +- { +- int err; +-@@ -260,16 +298,21 @@ static int __init brcmfmac_module_init(v +- /* Initialize debug system first */ +- brcmf_debugfs_init(); +- +--#ifdef CPTCFG_BRCMFMAC_SDIO +-- brcmf_sdio_init(); +--#endif +-+ /* Get the platform data (if available) for our devices */ +-+ err = platform_driver_probe(&brcmf_pd, brcmf_common_pd_probe); +-+ if (err == -ENODEV) +-+ brcmf_dbg(INFO, "No platform data available.\n"); +-+ +- /* Initialize global module paramaters */ +- brcmf_mp_attach(); +- +- /* Continue the initialization by registering the different busses */ +- err = brcmf_core_init(); +-- if (err) +-+ if (err) { +- brcmf_debugfs_exit(); +-+ if (brcmfmac_pdata) +-+ platform_driver_unregister(&brcmf_pd); +-+ } +- +- return err; +- } +-@@ -277,6 +320,8 @@ static int __init brcmfmac_module_init(v +- static void __exit brcmfmac_module_exit(void) +- { +- brcmf_core_exit(); +-+ if (brcmfmac_pdata) +-+ platform_driver_unregister(&brcmf_pd); +- brcmf_debugfs_exit(); +- } +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-@@ -15,6 +15,8 @@ +- #ifndef BRCMFMAC_COMMON_H +- #define BRCMFMAC_COMMON_H +- +-+#include +-+#include +- #include "fwil_types.h" +- +- extern const u8 ALLFFMAC[ETH_ALEN]; +-@@ -89,6 +91,7 @@ struct brcmf_mp_device { +- struct cc_translate *country_codes; +- }; +- +-+struct brcmfmac_sdio_platform_data *brcmf_get_module_param(struct device *dev); +- int brcmf_mp_device_attach(struct brcmf_pub *drvr); +- void brcmf_mp_device_detach(struct brcmf_pub *drvr); +- #ifdef DEBUG +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +-@@ -16,17 +16,16 @@ +- #include +- #include +- #include +--#include +--#include +--#include +- +- #include +- #include "debug.h" +--#include "sdio.h" +-+#include "core.h" +-+#include "common.h" +-+#include "of.h" +- +--void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev) +-+void +-+brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_platform_data **sdio) +- { +-- struct device *dev = sdiodev->dev; +- struct device_node *np = dev->of_node; +- int irq; +- u32 irqf; +-@@ -35,12 +34,12 @@ void brcmf_of_probe(struct brcmf_sdio_de +- if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac")) +- return; +- +-- sdiodev->pdata = devm_kzalloc(dev, sizeof(*sdiodev->pdata), GFP_KERNEL); +-- if (!sdiodev->pdata) +-+ *sdio = devm_kzalloc(dev, sizeof(*sdio), GFP_KERNEL); +-+ if (!(*sdio)) +- return; +- +- if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) +-- sdiodev->pdata->drive_strength = val; +-+ (*sdio)->drive_strength = val; +- +- /* make sure there are interrupts defined in the node */ +- if (!of_find_property(np, "interrupts", NULL)) +-@@ -53,7 +52,7 @@ void brcmf_of_probe(struct brcmf_sdio_de +- } +- irqf = irqd_get_trigger_type(irq_get_irq_data(irq)); +- +-- sdiodev->pdata->oob_irq_supported = true; +-- sdiodev->pdata->oob_irq_nr = irq; +-- sdiodev->pdata->oob_irq_flags = irqf; +-+ (*sdio)->oob_irq_supported = true; +-+ (*sdio)->oob_irq_nr = irq; +-+ (*sdio)->oob_irq_flags = irqf; +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +-@@ -14,9 +14,11 @@ +- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +- */ +- #ifdef CONFIG_OF +--void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev); +-+void +-+brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_platform_data **sdio); +- #else +--static void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev) +-+static void brcmf_of_probe(struct device *dev, +-+ struct brcmfmac_sdio_platform_data **sdio) +- { +- } +- #endif /* CONFIG_OF */ +diff --git a/package/kernel/mac80211/patches/344-0016-brcmfmac-keep-ARP-and-ND-offload-enabled-during-WOWL.patch b/package/kernel/mac80211/patches/344-0016-brcmfmac-keep-ARP-and-ND-offload-enabled-during-WOWL.patch +deleted file mode 100644 +index 4e789cf..0000000 +--- a/package/kernel/mac80211/patches/344-0016-brcmfmac-keep-ARP-and-ND-offload-enabled-during-WOWL.patch ++++ /dev/null +@@ -1,69 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:05 +0100 +-Subject: [PATCH] brcmfmac: keep ARP and ND offload enabled during WOWL +- +-Currently ARP and ND (IPv6 Neigbor Discovery) offload get disabled +-on entering suspend. However when firmwares support the wowl_cap +-iovar then these offload routines can be kept enabled as they +-will work during WOWL as well. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -3556,7 +3556,8 @@ static s32 brcmf_cfg80211_resume(struct +- brcmf_report_wowl_wakeind(wiphy, ifp); +- brcmf_fil_iovar_int_set(ifp, "wowl_clear", 0); +- brcmf_config_wowl_pattern(ifp, "clr", NULL, 0, NULL, 0); +-- brcmf_configure_arp_nd_offload(ifp, true); +-+ if (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_ARP_ND)) +-+ brcmf_configure_arp_nd_offload(ifp, true); +- brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, +- cfg->wowl.pre_pmmode); +- cfg->wowl.active = false; +-@@ -3580,7 +3581,8 @@ static void brcmf_configure_wowl(struct +- +- brcmf_dbg(TRACE, "Suspend, wowl config.\n"); +- +-- brcmf_configure_arp_nd_offload(ifp, false); +-+ if (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_ARP_ND)) +-+ brcmf_configure_arp_nd_offload(ifp, false); +- brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_PM, &cfg->wowl.pre_pmmode); +- brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, PM_MAX); +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +-@@ -147,6 +147,7 @@ void brcmf_feat_attach(struct brcmf_pub +- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL)) { +- err = brcmf_fil_iovar_int_get(ifp, "wowl_cap", &wowl_cap); +- if (!err) { +-+ ifp->drvr->feat_flags |= BIT(BRCMF_FEAT_WOWL_ARP_ND); +- if (wowl_cap & BRCMF_WOWL_PFN_FOUND) +- ifp->drvr->feat_flags |= +- BIT(BRCMF_FEAT_WOWL_ND); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +-@@ -29,6 +29,7 @@ +- * SCAN_RANDOM_MAC: Random MAC during (net detect) scheduled scan. +- * WOWL_ND: WOWL net detect (PNO) +- * WOWL_GTK: (WOWL) GTK rekeying offload +-+ * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL. +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +-@@ -40,7 +41,8 @@ +- BRCMF_FEAT_DEF(TDLS) \ +- BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \ +- BRCMF_FEAT_DEF(WOWL_ND) \ +-- BRCMF_FEAT_DEF(WOWL_GTK) +-+ BRCMF_FEAT_DEF(WOWL_GTK) \ +-+ BRCMF_FEAT_DEF(WOWL_ARP_ND) +- +- /* +- * Quirks: +diff --git a/package/kernel/mac80211/patches/344-0017-brcmfmac-switch-to-new-platform-data.patch b/package/kernel/mac80211/patches/344-0017-brcmfmac-switch-to-new-platform-data.patch +deleted file mode 100644 +index 37b6855..0000000 +--- a/package/kernel/mac80211/patches/344-0017-brcmfmac-switch-to-new-platform-data.patch ++++ /dev/null +@@ -1,734 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:07 +0100 +-Subject: [PATCH] brcmfmac: switch to new platform data +- +-Platform data is only available for sdio. With this patch a new +-platform data structure is being used which allows for platform +-data for any device and configurable per device. This patch only +-switches to the new structure and adds support for SDIO devices. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -103,7 +103,7 @@ static void brcmf_sdiod_dummy_irqhandler +- +- int brcmf_sdiod_intr_register(struct brcmf_sdio_dev *sdiodev) +- { +-- struct brcmfmac_sdio_platform_data *pdata; +-+ struct brcmfmac_sdio_pd *pdata; +- int ret = 0; +- u8 data; +- u32 addr, gpiocontrol; +-@@ -173,7 +173,7 @@ int brcmf_sdiod_intr_register(struct brc +- +- int brcmf_sdiod_intr_unregister(struct brcmf_sdio_dev *sdiodev) +- { +-- struct brcmfmac_sdio_platform_data *pdata; +-+ struct brcmfmac_sdio_pd *pdata; +- +- brcmf_dbg(SDIO, "Entering\n"); +- +-@@ -1164,17 +1164,6 @@ static int brcmf_ops_sdio_probe(struct s +- dev_set_drvdata(&func->dev, bus_if); +- dev_set_drvdata(&sdiodev->func[1]->dev, bus_if); +- sdiodev->dev = &sdiodev->func[1]->dev; +-- sdiodev->pdata = brcmf_get_module_param(sdiodev->dev); +-- +--#ifdef CONFIG_PM_SLEEP +-- /* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ +-- * is true or when platform data OOB irq is true). +-- */ +-- if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) && +-- ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) || +-- (sdiodev->pdata && sdiodev->pdata->oob_irq_supported))) +-- bus_if->wowl_supported = true; +--#endif +- +- brcmf_sdiod_change_state(sdiodev, BRCMF_SDIOD_DOWN); +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -6459,8 +6459,8 @@ int brcmf_cfg80211_wait_vif_event(struct +- static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], +- struct brcmf_fil_country_le *ccreq) +- { +-- struct cc_translate *country_codes; +-- struct cc_entry *cc; +-+ struct brcmfmac_pd_cc *country_codes; +-+ struct brcmfmac_pd_cc_entry *cc; +- s32 found_index; +- int i; +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-@@ -80,7 +80,7 @@ module_param_named(ignore_probe_fail, br +- MODULE_PARM_DESC(ignore_probe_fail, "always succeed probe for debugging"); +- #endif +- +--static struct brcmfmac_sdio_platform_data *brcmfmac_pdata; +-+static struct brcmfmac_platform_data *brcmfmac_pdata; +- struct brcmf_mp_global_t brcmf_mp_global; +- +- int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) +-@@ -229,15 +229,46 @@ void __brcmf_dbg(u32 level, const char * +- +- static void brcmf_mp_attach(void) +- { +-+ /* If module param firmware path is set then this will always be used, +-+ * if not set then if available use the platform data version. To make +-+ * sure it gets initialized at all, always copy the module param version +-+ */ +- strlcpy(brcmf_mp_global.firmware_path, brcmf_firmware_path, +- BRCMF_FW_ALTPATH_LEN); +-+ if ((brcmfmac_pdata) && (brcmfmac_pdata->fw_alternative_path) && +-+ (brcmf_mp_global.firmware_path[0] == '\0')) { +-+ strlcpy(brcmf_mp_global.firmware_path, +-+ brcmfmac_pdata->fw_alternative_path, +-+ BRCMF_FW_ALTPATH_LEN); +-+ } +- } +- +--struct brcmfmac_sdio_platform_data *brcmf_get_module_param(struct device *dev) +--{ +-- if (!brcmfmac_pdata) +-- brcmf_of_probe(dev, &brcmfmac_pdata); +-- return brcmfmac_pdata; +-+struct brcmfmac_sdio_pd *brcmf_get_module_param(struct device *dev, +-+ enum brcmf_bus_type bus_type, +-+ u32 chip, u32 chiprev) +-+{ +-+ struct brcmfmac_sdio_pd *pdata; +-+ struct brcmfmac_pd_device *device_pd; +-+ int i; +-+ +-+ if (brcmfmac_pdata) { +-+ for (i = 0; i < brcmfmac_pdata->device_count; i++) { +-+ device_pd = &brcmfmac_pdata->devices[i]; +-+ if ((device_pd->bus_type == bus_type) && +-+ (device_pd->id == chip) && +-+ ((device_pd->rev == chiprev) || +-+ (device_pd->rev == -1))) { +-+ brcmf_dbg(INFO, "Platform data for device found\n"); +-+ if (device_pd->bus_type == BRCMF_BUSTYPE_SDIO) +-+ return &device_pd->bus.sdio; +-+ break; +-+ } +-+ } +-+ } +-+ pdata = NULL; +-+ brcmf_of_probe(dev, &pdata); +-+ +-+ return pdata; +- } +- +- int brcmf_mp_device_attach(struct brcmf_pub *drvr) +-@@ -287,7 +318,7 @@ static int brcmf_common_pd_remove(struct +- static struct platform_driver brcmf_pd = { +- .remove = brcmf_common_pd_remove, +- .driver = { +-- .name = BRCMFMAC_SDIO_PDATA_NAME, +-+ .name = BRCMFMAC_PDATA_NAME, +- } +- }; +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-@@ -16,7 +16,7 @@ +- #define BRCMFMAC_COMMON_H +- +- #include +--#include +-+#include +- #include "fwil_types.h" +- +- extern const u8 ALLFFMAC[ETH_ALEN]; +-@@ -43,33 +43,6 @@ struct brcmf_mp_global_t { +- extern struct brcmf_mp_global_t brcmf_mp_global; +- +- /** +-- * struct cc_entry - Struct for translating user space country code (iso3166) to +-- * firmware country code and revision. +-- * +-- * @iso3166: iso3166 alpha 2 country code string. +-- * @cc: firmware country code string. +-- * @rev: firmware country code revision. +-- */ +--struct cc_entry { +-- char iso3166[BRCMF_COUNTRY_BUF_SZ]; +-- char cc[BRCMF_COUNTRY_BUF_SZ]; +-- s32 rev; +--}; +-- +--/** +-- * struct cc_translate - Struct for translating country codes as set by user +-- * space to a country code and rev which can be used by +-- * firmware. +-- * +-- * @table_size: number of entries in table (> 0) +-- * @table: dynamic array of 1 or more elements with translation information. +-- */ +--struct cc_translate { +-- int table_size; +-- struct cc_entry table[0]; +--}; +-- +--/** +- * struct brcmf_mp_device - Device module paramaters. +- * +- * @sdiod_txglomsz: SDIO txglom size. +-@@ -88,10 +61,12 @@ struct brcmf_mp_device { +- int fcmode; +- bool roamoff; +- bool ignore_probe_fail; +-- struct cc_translate *country_codes; +-+ struct brcmfmac_pd_cc *country_codes; +- }; +- +--struct brcmfmac_sdio_platform_data *brcmf_get_module_param(struct device *dev); +-+struct brcmfmac_sdio_pd *brcmf_get_module_param(struct device *dev, +-+ enum brcmf_bus_type bus_type, +-+ u32 chip, u32 chiprev); +- int brcmf_mp_device_attach(struct brcmf_pub *drvr); +- void brcmf_mp_device_detach(struct brcmf_pub *drvr); +- #ifdef DEBUG +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +-@@ -23,8 +23,7 @@ +- #include "common.h" +- #include "of.h" +- +--void +--brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_platform_data **sdio) +-+void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd **sdio) +- { +- struct device_node *np = dev->of_node; +- int irq; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +-@@ -15,10 +15,9 @@ +- */ +- #ifdef CONFIG_OF +- void +--brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_platform_data **sdio); +-+brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd **sdio); +- #else +--static void brcmf_of_probe(struct device *dev, +-- struct brcmfmac_sdio_platform_data **sdio) +-+static void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd **sdio) +- { +- } +- #endif /* CONFIG_OF */ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -33,8 +33,6 @@ +- #include +- #include +- #include +--#include +--#include +- #include +- #include +- #include +-@@ -44,6 +42,8 @@ +- #include "sdio.h" +- #include "chip.h" +- #include "firmware.h" +-+#include "core.h" +-+#include "common.h" +- +- #define DCMD_RESP_TIMEOUT msecs_to_jiffies(2500) +- #define CTL_DONE_TIMEOUT msecs_to_jiffies(2500) +-@@ -3775,26 +3775,28 @@ static const struct brcmf_buscore_ops br +- static bool +- brcmf_sdio_probe_attach(struct brcmf_sdio *bus) +- { +-+ struct brcmf_sdio_dev *sdiodev; +- u8 clkctl = 0; +- int err = 0; +- int reg_addr; +- u32 reg_val; +- u32 drivestrength; +- +-- sdio_claim_host(bus->sdiodev->func[1]); +-+ sdiodev = bus->sdiodev; +-+ sdio_claim_host(sdiodev->func[1]); +- +- pr_debug("F1 signature read @0x18000000=0x%4x\n", +-- brcmf_sdiod_regrl(bus->sdiodev, SI_ENUM_BASE, NULL)); +-+ brcmf_sdiod_regrl(sdiodev, SI_ENUM_BASE, NULL)); +- +- /* +- * Force PLL off until brcmf_chip_attach() +- * programs PLL control regs +- */ +- +-- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, +-+ brcmf_sdiod_regwb(sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, +- BRCMF_INIT_CLKCTL1, &err); +- if (!err) +-- clkctl = brcmf_sdiod_regrb(bus->sdiodev, +-+ clkctl = brcmf_sdiod_regrb(sdiodev, +- SBSDIO_FUNC1_CHIPCLKCSR, &err); +- +- if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) { +-@@ -3803,50 +3805,77 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- goto fail; +- } +- +-- bus->ci = brcmf_chip_attach(bus->sdiodev, &brcmf_sdio_buscore_ops); +-+ bus->ci = brcmf_chip_attach(sdiodev, &brcmf_sdio_buscore_ops); +- if (IS_ERR(bus->ci)) { +- brcmf_err("brcmf_chip_attach failed!\n"); +- bus->ci = NULL; +- goto fail; +- } +-+ sdiodev->pdata = brcmf_get_module_param(sdiodev->dev, +-+ BRCMF_BUSTYPE_SDIO, +-+ bus->ci->chip, +-+ bus->ci->chiprev); +-+ /* platform specific configuration: +-+ * alignments must be at least 4 bytes for ADMA +-+ */ +-+ bus->head_align = ALIGNMENT; +-+ bus->sgentry_align = ALIGNMENT; +-+ if (sdiodev->pdata) { +-+ if (sdiodev->pdata->sd_head_align > ALIGNMENT) +-+ bus->head_align = sdiodev->pdata->sd_head_align; +-+ if (sdiodev->pdata->sd_sgentry_align > ALIGNMENT) +-+ bus->sgentry_align = sdiodev->pdata->sd_sgentry_align; +-+ } +-+ /* allocate scatter-gather table. sg support +-+ * will be disabled upon allocation failure. +-+ */ +-+ brcmf_sdiod_sgtable_alloc(sdiodev); +-+ +-+#ifdef CONFIG_PM_SLEEP +-+ /* wowl can be supported when KEEP_POWER is true and (WAKE_SDIO_IRQ +-+ * is true or when platform data OOB irq is true). +-+ */ +-+ if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) && +-+ ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) || +-+ (sdiodev->pdata && sdiodev->pdata->oob_irq_supported))) +-+ sdiodev->bus_if->wowl_supported = true; +-+#endif +- +- if (brcmf_sdio_kso_init(bus)) { +- brcmf_err("error enabling KSO\n"); +- goto fail; +- } +- +-- if ((bus->sdiodev->pdata) && (bus->sdiodev->pdata->drive_strength)) +-- drivestrength = bus->sdiodev->pdata->drive_strength; +-+ if ((sdiodev->pdata) && (sdiodev->pdata->drive_strength)) +-+ drivestrength = sdiodev->pdata->drive_strength; +- else +- drivestrength = DEFAULT_SDIO_DRIVE_STRENGTH; +-- brcmf_sdio_drivestrengthinit(bus->sdiodev, bus->ci, drivestrength); +-+ brcmf_sdio_drivestrengthinit(sdiodev, bus->ci, drivestrength); +- +- /* Set card control so an SDIO card reset does a WLAN backplane reset */ +-- reg_val = brcmf_sdiod_regrb(bus->sdiodev, +-- SDIO_CCCR_BRCM_CARDCTRL, &err); +-+ reg_val = brcmf_sdiod_regrb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, &err); +- if (err) +- goto fail; +- +- reg_val |= SDIO_CCCR_BRCM_CARDCTRL_WLANRESET; +- +-- brcmf_sdiod_regwb(bus->sdiodev, +-- SDIO_CCCR_BRCM_CARDCTRL, reg_val, &err); +-+ brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_CARDCTRL, reg_val, &err); +- if (err) +- goto fail; +- +- /* set PMUControl so a backplane reset does PMU state reload */ +- reg_addr = CORE_CC_REG(brcmf_chip_get_pmu(bus->ci)->base, pmucontrol); +-- reg_val = brcmf_sdiod_regrl(bus->sdiodev, reg_addr, &err); +-+ reg_val = brcmf_sdiod_regrl(sdiodev, reg_addr, &err); +- if (err) +- goto fail; +- +- reg_val |= (BCMA_CC_PMU_CTL_RES_RELOAD << BCMA_CC_PMU_CTL_RES_SHIFT); +- +-- brcmf_sdiod_regwl(bus->sdiodev, reg_addr, reg_val, &err); +-+ brcmf_sdiod_regwl(sdiodev, reg_addr, reg_val, &err); +- if (err) +- goto fail; +- +-- sdio_release_host(bus->sdiodev->func[1]); +-+ sdio_release_host(sdiodev->func[1]); +- +- brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN); +- +-@@ -3867,7 +3896,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- return true; +- +- fail: +-- sdio_release_host(bus->sdiodev->func[1]); +-+ sdio_release_host(sdiodev->func[1]); +- return false; +- } +- +-@@ -4045,18 +4074,6 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- bus->txminmax = BRCMF_TXMINMAX; +- bus->tx_seq = SDPCM_SEQ_WRAP - 1; +- +-- /* platform specific configuration: +-- * alignments must be at least 4 bytes for ADMA +-- */ +-- bus->head_align = ALIGNMENT; +-- bus->sgentry_align = ALIGNMENT; +-- if (sdiodev->pdata) { +-- if (sdiodev->pdata->sd_head_align > ALIGNMENT) +-- bus->head_align = sdiodev->pdata->sd_head_align; +-- if (sdiodev->pdata->sd_sgentry_align > ALIGNMENT) +-- bus->sgentry_align = sdiodev->pdata->sd_sgentry_align; +-- } +-- +- /* single-threaded workqueue */ +- wq = alloc_ordered_workqueue("brcmf_wq/%s", WQ_MEM_RECLAIM, +- dev_name(&sdiodev->func[1]->dev)); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +-@@ -184,7 +184,7 @@ struct brcmf_sdio_dev { +- struct brcmf_sdio *bus; +- struct device *dev; +- struct brcmf_bus *bus_if; +-- struct brcmfmac_sdio_platform_data *pdata; +-+ struct brcmfmac_sdio_pd *pdata; +- bool oob_irq_requested; +- bool irq_en; /* irq enable flags */ +- spinlock_t irq_en_lock; +---- a/include/linux/platform_data/brcmfmac-sdio.h +-+++ /dev/null +-@@ -1,135 +0,0 @@ +--/* +-- * Copyright (c) 2013 Broadcom Corporation +-- * +-- * Permission to use, copy, modify, and/or distribute this software for any +-- * purpose with or without fee is hereby granted, provided that the above +-- * copyright notice and this permission notice appear in all copies. +-- * +-- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +-- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +-- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +-- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +-- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +-- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +-- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-- */ +-- +--#ifndef _LINUX_BRCMFMAC_PLATFORM_H +--#define _LINUX_BRCMFMAC_PLATFORM_H +-- +--/* +-- * Platform specific driver functions and data. Through the platform specific +-- * device data functions can be provided to help the brcmfmac driver to +-- * operate with the device in combination with the used platform. +-- * +-- * Use the platform data in the following (similar) way: +-- * +-- * +--#include +-- +-- +--static void brcmfmac_power_on(void) +--{ +--} +-- +--static void brcmfmac_power_off(void) +--{ +--} +-- +--static void brcmfmac_reset(void) +--{ +--} +-- +--static struct brcmfmac_sdio_platform_data brcmfmac_sdio_pdata = { +-- .power_on = brcmfmac_power_on, +-- .power_off = brcmfmac_power_off, +-- .reset = brcmfmac_reset +--}; +-- +--static struct platform_device brcmfmac_device = { +-- .name = BRCMFMAC_SDIO_PDATA_NAME, +-- .id = PLATFORM_DEVID_NONE, +-- .dev.platform_data = &brcmfmac_sdio_pdata +--}; +-- +--void __init brcmfmac_init_pdata(void) +--{ +-- brcmfmac_sdio_pdata.oob_irq_supported = true; +-- brcmfmac_sdio_pdata.oob_irq_nr = gpio_to_irq(GPIO_BRCMF_SDIO_OOB); +-- brcmfmac_sdio_pdata.oob_irq_flags = IORESOURCE_IRQ | +-- IORESOURCE_IRQ_HIGHLEVEL; +-- platform_device_register(&brcmfmac_device); +--} +-- * +-- * +-- * Note: the brcmfmac can be loaded as module or be statically built-in into +-- * the kernel. If built-in then do note that it uses module_init (and +-- * module_exit) routines which equal device_initcall. So if you intend to +-- * create a module with the platform specific data for the brcmfmac and have +-- * it built-in to the kernel then use a higher initcall then device_initcall +-- * (see init.h). If this is not done then brcmfmac will load without problems +-- * but will not pickup the platform data. +-- * +-- * When the driver does not "detect" platform driver data then it will continue +-- * without reporting anything and just assume there is no data needed. Which is +-- * probably true for most platforms. +-- * +-- * Explanation of the platform_data fields: +-- * +-- * drive_strength: is the preferred drive_strength to be used for the SDIO +-- * pins. If 0 then a default value will be used. This is the target drive +-- * strength, the exact drive strength which will be used depends on the +-- * capabilities of the device. +-- * +-- * oob_irq_supported: does the board have support for OOB interrupts. SDIO +-- * in-band interrupts are relatively slow and for having less overhead on +-- * interrupt processing an out of band interrupt can be used. If the HW +-- * supports this then enable this by setting this field to true and configure +-- * the oob related fields. +-- * +-- * oob_irq_nr, oob_irq_flags: the OOB interrupt information. The values are +-- * used for registering the irq using request_irq function. +-- * +-- * broken_sg_support: flag for broken sg list support of SDIO host controller. +-- * Set this to true if the SDIO host controller has higher align requirement +-- * than 32 bytes for each scatterlist item. +-- * +-- * sd_head_align: alignment requirement for start of data buffer +-- * +-- * sd_sgentry_align: length alignment requirement for each sg entry +-- * +-- * power_on: This function is called by the brcmfmac when the module gets +-- * loaded. This can be particularly useful for low power devices. The platform +-- * spcific routine may for example decide to power up the complete device. +-- * If there is no use-case for this function then provide NULL. +-- * +-- * power_off: This function is called by the brcmfmac when the module gets +-- * unloaded. At this point the device can be powered down or otherwise be reset. +-- * So if an actual power_off is not supported but reset is then reset the device +-- * when this function gets called. This can be particularly useful for low power +-- * devices. If there is no use-case for this function (either power-down or +-- * reset) then provide NULL. +-- * +-- * reset: This function can get called if the device communication broke down. +-- * This functionality is particularly useful in case of SDIO type devices. It is +-- * possible to reset a dongle via sdio data interface, but it requires that +-- * this is fully functional. This function is chip/module specific and this +-- * function should return only after the complete reset has completed. +-- */ +-- +--#define BRCMFMAC_SDIO_PDATA_NAME "brcmfmac_sdio" +-- +--struct brcmfmac_sdio_platform_data { +-- unsigned int drive_strength; +-- bool oob_irq_supported; +-- unsigned int oob_irq_nr; +-- unsigned long oob_irq_flags; +-- bool broken_sg_support; +-- unsigned short sd_head_align; +-- unsigned short sd_sgentry_align; +-- void (*power_on)(void); +-- void (*power_off)(void); +-- void (*reset)(void); +--}; +-- +--#endif /* _LINUX_BRCMFMAC_PLATFORM_H */ +---- /dev/null +-+++ b/include/linux/platform_data/brcmfmac.h +-@@ -0,0 +1,185 @@ +-+/* +-+ * Copyright (c) 201 Broadcom Corporation +-+ * +-+ * Permission to use, copy, modify, and/or distribute this software for any +-+ * purpose with or without fee is hereby granted, provided that the above +-+ * copyright notice and this permission notice appear in all copies. +-+ * +-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +-+ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION +-+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +-+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +-+ */ +-+ +-+#ifndef _LINUX_BRCMFMAC_PLATFORM_H +-+#define _LINUX_BRCMFMAC_PLATFORM_H +-+ +-+ +-+#define BRCMFMAC_PDATA_NAME "brcmfmac" +-+ +-+#define BRCMFMAC_COUNTRY_BUF_SZ 4 +-+ +-+ +-+/* +-+ * Platform specific driver functions and data. Through the platform specific +-+ * device data functions and data can be provided to help the brcmfmac driver to +-+ * operate with the device in combination with the used platform. +-+ */ +-+ +-+ +-+/** +-+ * Note: the brcmfmac can be loaded as module or be statically built-in into +-+ * the kernel. If built-in then do note that it uses module_init (and +-+ * module_exit) routines which equal device_initcall. So if you intend to +-+ * create a module with the platform specific data for the brcmfmac and have +-+ * it built-in to the kernel then use a higher initcall then device_initcall +-+ * (see init.h). If this is not done then brcmfmac will load without problems +-+ * but will not pickup the platform data. +-+ * +-+ * When the driver does not "detect" platform driver data then it will continue +-+ * without reporting anything and just assume there is no data needed. Which is +-+ * probably true for most platforms. +-+ */ +-+ +-+/** +-+ * enum brcmf_bus_type - Bus type identifier. Currently SDIO, USB and PCIE are +-+ * supported. +-+ */ +-+enum brcmf_bus_type { +-+ BRCMF_BUSTYPE_SDIO, +-+ BRCMF_BUSTYPE_USB, +-+ BRCMF_BUSTYPE_PCIE +-+}; +-+ +-+ +-+/** +-+ * struct brcmfmac_sdio_pd - SDIO Device specific platform data. +-+ * +-+ * @txglomsz: SDIO txglom size. Use 0 if default of driver is to be +-+ * used. +-+ * @drive_strength: is the preferred drive_strength to be used for the SDIO +-+ * pins. If 0 then a default value will be used. This is +-+ * the target drive strength, the exact drive strength +-+ * which will be used depends on the capabilities of the +-+ * device. +-+ * @oob_irq_supported: does the board have support for OOB interrupts. SDIO +-+ * in-band interrupts are relatively slow and for having +-+ * less overhead on interrupt processing an out of band +-+ * interrupt can be used. If the HW supports this then +-+ * enable this by setting this field to true and configure +-+ * the oob related fields. +-+ * @oob_irq_nr, +-+ * @oob_irq_flags: the OOB interrupt information. The values are used for +-+ * registering the irq using request_irq function. +-+ * @broken_sg_support: flag for broken sg list support of SDIO host controller. +-+ * Set this to true if the SDIO host controller has higher +-+ * align requirement than 32 bytes for each scatterlist +-+ * item. +-+ * @sd_head_align: alignment requirement for start of data buffer. +-+ * @sd_sgentry_align: length alignment requirement for each sg entry. +-+ * @reset: This function can get called if the device communication +-+ * broke down. This functionality is particularly useful in +-+ * case of SDIO type devices. It is possible to reset a +-+ * dongle via sdio data interface, but it requires that +-+ * this is fully functional. This function is chip/module +-+ * specific and this function should return only after the +-+ * complete reset has completed. +-+ */ +-+struct brcmfmac_sdio_pd { +-+ int txglomsz; +-+ unsigned int drive_strength; +-+ bool oob_irq_supported; +-+ unsigned int oob_irq_nr; +-+ unsigned long oob_irq_flags; +-+ bool broken_sg_support; +-+ unsigned short sd_head_align; +-+ unsigned short sd_sgentry_align; +-+ void (*reset)(void); +-+}; +-+ +-+/** +-+ * struct brcmfmac_pd_cc_entry - Struct for translating user space country code +-+ * (iso3166) to firmware country code and +-+ * revision. +-+ * +-+ * @iso3166: iso3166 alpha 2 country code string. +-+ * @cc: firmware country code string. +-+ * @rev: firmware country code revision. +-+ */ +-+struct brcmfmac_pd_cc_entry { +-+ char iso3166[BRCMFMAC_COUNTRY_BUF_SZ]; +-+ char cc[BRCMFMAC_COUNTRY_BUF_SZ]; +-+ s32 rev; +-+}; +-+ +-+/** +-+ * struct brcmfmac_pd_cc - Struct for translating country codes as set by user +-+ * space to a country code and rev which can be used by +-+ * firmware. +-+ * +-+ * @table_size: number of entries in table (> 0) +-+ * @table: array of 1 or more elements with translation information. +-+ */ +-+struct brcmfmac_pd_cc { +-+ int table_size; +-+ struct brcmfmac_pd_cc_entry table[0]; +-+}; +-+ +-+/** +-+ * struct brcmfmac_pd_device - Device specific platform data. (id/rev/bus_type) +-+ * is the unique identifier of the device. +-+ * +-+ * @id: ID of the device for which this data is. In case of SDIO +-+ * or PCIE this is the chipid as identified by chip.c In +-+ * case of USB this is the chipid as identified by the +-+ * device query. +-+ * @rev: chip revision, see id. +-+ * @bus_type: The type of bus. Some chipid/rev exist for different bus +-+ * types. Each bus type has its own set of settings. +-+ * @feature_disable: Bitmask of features to disable (override), See feature.c +-+ * in brcmfmac for details. +-+ * @country_codes: If available, pointer to struct for translating country +-+ * codes. +-+ * @bus: Bus specific (union) device settings. Currently only +-+ * SDIO. +-+ */ +-+struct brcmfmac_pd_device { +-+ unsigned int id; +-+ unsigned int rev; +-+ enum brcmf_bus_type bus_type; +-+ unsigned int feature_disable; +-+ struct brcmfmac_pd_cc *country_codes; +-+ union { +-+ struct brcmfmac_sdio_pd sdio; +-+ } bus; +-+}; +-+ +-+/** +-+ * struct brcmfmac_platform_data - BRCMFMAC specific platform data. +-+ * +-+ * @power_on: This function is called by the brcmfmac driver when the module +-+ * gets loaded. This can be particularly useful for low power +-+ * devices. The platform spcific routine may for example decide to +-+ * power up the complete device. If there is no use-case for this +-+ * function then provide NULL. +-+ * @power_off: This function is called by the brcmfmac when the module gets +-+ * unloaded. At this point the devices can be powered down or +-+ * otherwise be reset. So if an actual power_off is not supported +-+ * but reset is supported by the devices then reset the devices +-+ * when this function gets called. This can be particularly useful +-+ * for low power devices. If there is no use-case for this +-+ * function then provide NULL. +-+ */ +-+struct brcmfmac_platform_data { +-+ void (*power_on)(void); +-+ void (*power_off)(void); +-+ char *fw_alternative_path; +-+ int device_count; +-+ struct brcmfmac_pd_device devices[0]; +-+}; +-+ +-+ +-+#endif /* _LINUX_BRCMFMAC_PLATFORM_H */ +diff --git a/package/kernel/mac80211/patches/344-0018-brcmfmac-merge-platform-data-and-module-paramaters.patch b/package/kernel/mac80211/patches/344-0018-brcmfmac-merge-platform-data-and-module-paramaters.patch +deleted file mode 100644 +index 34341d7..0000000 +--- a/package/kernel/mac80211/patches/344-0018-brcmfmac-merge-platform-data-and-module-paramaters.patch ++++ /dev/null +@@ -1,607 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:08 +0100 +-Subject: [PATCH] brcmfmac: merge platform data and module paramaters +- +-Merge module parameters and platform data in one struct. This is the +-last step to move to the new platform data per device. Now parameters +-of platform data will be merged with module parameters per device. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -109,8 +109,8 @@ int brcmf_sdiod_intr_register(struct brc +- u32 addr, gpiocontrol; +- unsigned long flags; +- +-- pdata = sdiodev->pdata; +-- if ((pdata) && (pdata->oob_irq_supported)) { +-+ pdata = &sdiodev->settings->bus.sdio; +-+ if (pdata->oob_irq_supported) { +- brcmf_dbg(SDIO, "Enter, register OOB IRQ %d\n", +- pdata->oob_irq_nr); +- ret = request_irq(pdata->oob_irq_nr, brcmf_sdiod_oob_irqhandler, +-@@ -177,8 +177,8 @@ int brcmf_sdiod_intr_unregister(struct b +- +- brcmf_dbg(SDIO, "Entering\n"); +- +-- pdata = sdiodev->pdata; +-- if ((pdata) && (pdata->oob_irq_supported)) { +-+ pdata = &sdiodev->settings->bus.sdio; +-+ if (pdata->oob_irq_supported) { +- sdio_claim_host(sdiodev->func[1]); +- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_BRCM_SEPINT, 0, NULL); +- brcmf_sdiod_regwb(sdiodev, SDIO_CCCR_IENx, 0, NULL); +-@@ -522,7 +522,7 @@ static int brcmf_sdiod_sglist_rw(struct +- target_list = pktlist; +- /* for host with broken sg support, prepare a page aligned list */ +- __skb_queue_head_init(&local_list); +-- if (sdiodev->pdata && sdiodev->pdata->broken_sg_support && !write) { +-+ if (!write && sdiodev->settings->bus.sdio.broken_sg_support) { +- req_sz = 0; +- skb_queue_walk(pktlist, pkt_next) +- req_sz += pkt_next->len; +-@@ -629,7 +629,7 @@ static int brcmf_sdiod_sglist_rw(struct +- } +- } +- +-- if (sdiodev->pdata && sdiodev->pdata->broken_sg_support && !write) { +-+ if (!write && sdiodev->settings->bus.sdio.broken_sg_support) { +- local_pkt_next = local_list.next; +- orig_offset = 0; +- skb_queue_walk(pktlist, pkt_next) { +-@@ -900,7 +900,7 @@ void brcmf_sdiod_sgtable_alloc(struct br +- return; +- +- nents = max_t(uint, BRCMF_DEFAULT_RXGLOM_SIZE, +-- sdiodev->bus_if->drvr->settings->sdiod_txglomsz); +-+ sdiodev->settings->bus.sdio.txglomsz); +- nents += (nents >> 4) + 1; +- +- WARN_ON(nents > sdiodev->max_segment_count); +-@@ -912,7 +912,7 @@ void brcmf_sdiod_sgtable_alloc(struct br +- sdiodev->sg_support = false; +- } +- +-- sdiodev->txglomsz = sdiodev->bus_if->drvr->settings->sdiod_txglomsz; +-+ sdiodev->txglomsz = sdiodev->settings->bus.sdio.txglomsz; +- } +- +- #ifdef CONFIG_PM_SLEEP +-@@ -1246,8 +1246,8 @@ static int brcmf_ops_sdio_suspend(struct +- +- sdio_flags = MMC_PM_KEEP_POWER; +- if (sdiodev->wowl_enabled) { +-- if (sdiodev->pdata->oob_irq_supported) +-- enable_irq_wake(sdiodev->pdata->oob_irq_nr); +-+ if (sdiodev->settings->bus.sdio.oob_irq_supported) +-+ enable_irq_wake(sdiodev->settings->bus.sdio.oob_irq_nr); +- else +- sdio_flags |= MMC_PM_WAKE_SDIO_IRQ; +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +-@@ -43,6 +43,8 @@ enum brcmf_bus_protocol_type { +- BRCMF_PROTO_MSGBUF +- }; +- +-+struct brcmf_mp_device; +-+ +- struct brcmf_bus_dcmd { +- char *name; +- char *param; +-@@ -217,7 +219,7 @@ bool brcmf_c_prec_enq(struct device *dev +- void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp); +- +- /* Indication from bus module regarding presence/insertion of dongle. */ +--int brcmf_attach(struct device *dev); +-+int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings); +- /* Indication from bus module regarding removal/absence of dongle */ +- void brcmf_detach(struct device *dev); +- /* Indication from bus module that dongle should be reset */ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +-@@ -243,14 +243,35 @@ static void brcmf_mp_attach(void) +- } +- } +- +--struct brcmfmac_sdio_pd *brcmf_get_module_param(struct device *dev, +-- enum brcmf_bus_type bus_type, +-- u32 chip, u32 chiprev) +-+struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, +-+ enum brcmf_bus_type bus_type, +-+ u32 chip, u32 chiprev) +- { +-- struct brcmfmac_sdio_pd *pdata; +-+ struct brcmf_mp_device *settings; +- struct brcmfmac_pd_device *device_pd; +-+ bool found; +- int i; +- +-+ brcmf_dbg(INFO, "Enter, bus=%d, chip=%d, rev=%d\n", bus_type, chip, +-+ chiprev); +-+ settings = kzalloc(sizeof(*settings), GFP_ATOMIC); +-+ if (!settings) +-+ return NULL; +-+ +-+ /* start by using the module paramaters */ +-+ settings->p2p_enable = !!brcmf_p2p_enable; +-+ settings->feature_disable = brcmf_feature_disable; +-+ settings->fcmode = brcmf_fcmode; +-+ settings->roamoff = !!brcmf_roamoff; +-+#ifdef DEBUG +-+ settings->ignore_probe_fail = !!brcmf_ignore_probe_fail; +-+#endif +-+ +-+ if (bus_type == BRCMF_BUSTYPE_SDIO) +-+ settings->bus.sdio.txglomsz = brcmf_sdiod_txglomsz; +-+ +-+ /* See if there is any device specific platform data configured */ +-+ found = false; +- if (brcmfmac_pdata) { +- for (i = 0; i < brcmfmac_pdata->device_count; i++) { +- device_pd = &brcmfmac_pdata->devices[i]; +-@@ -259,38 +280,29 @@ struct brcmfmac_sdio_pd *brcmf_get_modul +- ((device_pd->rev == chiprev) || +- (device_pd->rev == -1))) { +- brcmf_dbg(INFO, "Platform data for device found\n"); +-+ settings->country_codes = +-+ device_pd->country_codes; +- if (device_pd->bus_type == BRCMF_BUSTYPE_SDIO) +-- return &device_pd->bus.sdio; +-+ memcpy(&settings->bus.sdio, +-+ &device_pd->bus.sdio, +-+ sizeof(settings->bus.sdio)); +-+ found = true; +- break; +- } +- } +- } +-- pdata = NULL; +-- brcmf_of_probe(dev, &pdata); +-- +-- return pdata; +--} +-- +--int brcmf_mp_device_attach(struct brcmf_pub *drvr) +--{ +-- drvr->settings = kzalloc(sizeof(*drvr->settings), GFP_ATOMIC); +-- if (!drvr->settings) +-- return -ENOMEM; +-- +-- drvr->settings->sdiod_txglomsz = brcmf_sdiod_txglomsz; +-- drvr->settings->p2p_enable = !!brcmf_p2p_enable; +-- drvr->settings->feature_disable = brcmf_feature_disable; +-- drvr->settings->fcmode = brcmf_fcmode; +-- drvr->settings->roamoff = !!brcmf_roamoff; +--#ifdef DEBUG +-- drvr->settings->ignore_probe_fail = !!brcmf_ignore_probe_fail; +--#endif +-- return 0; +-+ if ((bus_type == BRCMF_BUSTYPE_SDIO) && (!found)) { +-+ /* No platform data for this device. In case of SDIO try OF +-+ * (Open Firwmare) Device Tree. +-+ */ +-+ brcmf_of_probe(dev, &settings->bus.sdio); +-+ } +-+ return settings; +- } +- +--void brcmf_mp_device_detach(struct brcmf_pub *drvr) +-+void brcmf_release_module_param(struct brcmf_mp_device *module_param) +- { +-- kfree(drvr->settings); +-+ kfree(module_param); +- } +- +- static int __init brcmf_common_pd_probe(struct platform_device *pdev) +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +-@@ -45,41 +45,30 @@ extern struct brcmf_mp_global_t brcmf_mp +- /** +- * struct brcmf_mp_device - Device module paramaters. +- * +-- * @sdiod_txglomsz: SDIO txglom size. +-- * @joinboost_5g_rssi: 5g rssi booost for preferred join selection. +- * @p2p_enable: Legacy P2P0 enable (old wpa_supplicant). +- * @feature_disable: Feature_disable bitmask. +- * @fcmode: FWS flow control. +- * @roamoff: Firmware roaming off? +-+ * @ignore_probe_fail: Ignore probe failure. +- * @country_codes: If available, pointer to struct for translating country codes +-+ * @bus: Bus specific platform data. Only SDIO at the mmoment. +- */ +- struct brcmf_mp_device { +-- int sdiod_txglomsz; +-- int joinboost_5g_rssi; +-- bool p2p_enable; +-- int feature_disable; +-- int fcmode; +-- bool roamoff; +-- bool ignore_probe_fail; +-+ bool p2p_enable; +-+ unsigned int feature_disable; +-+ int fcmode; +-+ bool roamoff; +-+ bool ignore_probe_fail; +- struct brcmfmac_pd_cc *country_codes; +-+ union { +-+ struct brcmfmac_sdio_pd sdio; +-+ } bus; +- }; +- +--struct brcmfmac_sdio_pd *brcmf_get_module_param(struct device *dev, +-- enum brcmf_bus_type bus_type, +-- u32 chip, u32 chiprev); +--int brcmf_mp_device_attach(struct brcmf_pub *drvr); +--void brcmf_mp_device_detach(struct brcmf_pub *drvr); +--#ifdef DEBUG +--static inline bool brcmf_ignoring_probe_fail(struct brcmf_pub *drvr) +--{ +-- return drvr->settings->ignore_probe_fail; +--} +--#else +--static inline bool brcmf_ignoring_probe_fail(struct brcmf_pub *drvr) +--{ +-- return false; +--} +--#endif +-+struct brcmf_mp_device *brcmf_get_module_param(struct device *dev, +-+ enum brcmf_bus_type bus_type, +-+ u32 chip, u32 chiprev); +-+void brcmf_release_module_param(struct brcmf_mp_device *module_param); +- +- /* Sets dongle media info (drv_version, mac address). */ +- int brcmf_c_preinit_dcmds(struct brcmf_if *ifp); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -1104,7 +1104,7 @@ static int brcmf_inet6addr_changed(struc +- } +- #endif +- +--int brcmf_attach(struct device *dev) +-+int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings) +- { +- struct brcmf_pub *drvr = NULL; +- int ret = 0; +-@@ -1126,10 +1126,7 @@ int brcmf_attach(struct device *dev) +- drvr->hdrlen = 0; +- drvr->bus_if = dev_get_drvdata(dev); +- drvr->bus_if->drvr = drvr; +-- +-- /* Initialize device specific settings */ +-- if (brcmf_mp_device_attach(drvr)) +-- goto fail; +-+ drvr->settings = settings; +- +- /* attach debug facilities */ +- brcmf_debug_attach(drvr); +-@@ -1274,7 +1271,7 @@ fail: +- brcmf_net_detach(p2p_ifp->ndev); +- drvr->iflist[0] = NULL; +- drvr->iflist[1] = NULL; +-- if (brcmf_ignoring_probe_fail(drvr)) +-+ if (drvr->settings->ignore_probe_fail) +- ret = 0; +- +- return ret; +-@@ -1350,8 +1347,6 @@ void brcmf_detach(struct device *dev) +- +- brcmf_proto_detach(drvr); +- +-- brcmf_mp_device_detach(drvr); +-- +- brcmf_debug_detach(drvr); +- bus_if->drvr = NULL; +- kfree(drvr); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +-@@ -23,7 +23,7 @@ +- #include "common.h" +- #include "of.h" +- +--void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd **sdio) +-+void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio) +- { +- struct device_node *np = dev->of_node; +- int irq; +-@@ -33,12 +33,8 @@ void brcmf_of_probe(struct device *dev, +- if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac")) +- return; +- +-- *sdio = devm_kzalloc(dev, sizeof(*sdio), GFP_KERNEL); +-- if (!(*sdio)) +-- return; +-- +- if (of_property_read_u32(np, "brcm,drive-strength", &val) == 0) +-- (*sdio)->drive_strength = val; +-+ sdio->drive_strength = val; +- +- /* make sure there are interrupts defined in the node */ +- if (!of_find_property(np, "interrupts", NULL)) +-@@ -51,7 +47,7 @@ void brcmf_of_probe(struct device *dev, +- } +- irqf = irqd_get_trigger_type(irq_get_irq_data(irq)); +- +-- (*sdio)->oob_irq_supported = true; +-- (*sdio)->oob_irq_nr = irq; +-- (*sdio)->oob_irq_flags = irqf; +-+ sdio->oob_irq_supported = true; +-+ sdio->oob_irq_nr = irq; +-+ sdio->oob_irq_flags = irqf; +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.h +-@@ -14,10 +14,9 @@ +- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +- */ +- #ifdef CONFIG_OF +--void +--brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd **sdio); +-+void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio); +- #else +--static void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd **sdio) +-+static void brcmf_of_probe(struct device *dev, struct brcmfmac_sdio_pd *sdio) +- { +- } +- #endif /* CONFIG_OF */ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-@@ -37,6 +37,8 @@ +- #include "pcie.h" +- #include "firmware.h" +- #include "chip.h" +-+#include "core.h" +-+#include "common.h" +- +- +- enum brcmf_pcie_state { +-@@ -266,6 +268,7 @@ struct brcmf_pciedev_info { +- u16 (*read_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset); +- void (*write_ptr)(struct brcmf_pciedev_info *devinfo, u32 mem_offset, +- u16 value); +-+ struct brcmf_mp_device *settings; +- }; +- +- struct brcmf_pcie_ringbuf { +-@@ -1525,16 +1528,16 @@ static void brcmf_pcie_release_resource( +- } +- +- +--static int brcmf_pcie_attach_bus(struct device *dev) +-+static int brcmf_pcie_attach_bus(struct brcmf_pciedev_info *devinfo) +- { +- int ret; +- +- /* Attach to the common driver interface */ +-- ret = brcmf_attach(dev); +-+ ret = brcmf_attach(&devinfo->pdev->dev, devinfo->settings); +- if (ret) { +- brcmf_err("brcmf_attach failed\n"); +- } else { +-- ret = brcmf_bus_start(dev); +-+ ret = brcmf_bus_start(&devinfo->pdev->dev); +- if (ret) +- brcmf_err("dongle is not responding\n"); +- } +-@@ -1672,7 +1675,7 @@ static void brcmf_pcie_setup(struct devi +- init_waitqueue_head(&devinfo->mbdata_resp_wait); +- +- brcmf_pcie_intr_enable(devinfo); +-- if (brcmf_pcie_attach_bus(bus->dev) == 0) +-+ if (brcmf_pcie_attach_bus(devinfo) == 0) +- return; +- +- brcmf_pcie_bus_console_read(devinfo); +-@@ -1716,6 +1719,15 @@ brcmf_pcie_probe(struct pci_dev *pdev, c +- goto fail; +- } +- +-+ devinfo->settings = brcmf_get_module_param(&devinfo->pdev->dev, +-+ BRCMF_BUSTYPE_PCIE, +-+ devinfo->ci->chip, +-+ devinfo->ci->chiprev); +-+ if (!devinfo->settings) { +-+ ret = -ENOMEM; +-+ goto fail; +-+ } +-+ +- bus = kzalloc(sizeof(*bus), GFP_KERNEL); +- if (!bus) { +- ret = -ENOMEM; +-@@ -1760,6 +1772,8 @@ fail: +- brcmf_pcie_release_resource(devinfo); +- if (devinfo->ci) +- brcmf_chip_detach(devinfo->ci); +-+ if (devinfo->settings) +-+ brcmf_release_module_param(devinfo->settings); +- kfree(pcie_bus_dev); +- kfree(devinfo); +- return ret; +-@@ -1799,6 +1813,8 @@ brcmf_pcie_remove(struct pci_dev *pdev) +- +- if (devinfo->ci) +- brcmf_chip_detach(devinfo->ci); +-+ if (devinfo->settings) +-+ brcmf_release_module_param(devinfo->settings); +- +- kfree(devinfo); +- dev_set_drvdata(&pdev->dev, NULL); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -2442,15 +2442,17 @@ static void brcmf_sdio_bus_stop(struct d +- +- static inline void brcmf_sdio_clrintr(struct brcmf_sdio *bus) +- { +-+ struct brcmf_sdio_dev *sdiodev; +- unsigned long flags; +- +-- if (bus->sdiodev->oob_irq_requested) { +-- spin_lock_irqsave(&bus->sdiodev->irq_en_lock, flags); +-- if (!bus->sdiodev->irq_en && !atomic_read(&bus->ipend)) { +-- enable_irq(bus->sdiodev->pdata->oob_irq_nr); +-- bus->sdiodev->irq_en = true; +-+ sdiodev = bus->sdiodev; +-+ if (sdiodev->oob_irq_requested) { +-+ spin_lock_irqsave(&sdiodev->irq_en_lock, flags); +-+ if (!sdiodev->irq_en && !atomic_read(&bus->ipend)) { +-+ enable_irq(sdiodev->settings->bus.sdio.oob_irq_nr); +-+ sdiodev->irq_en = true; +- } +-- spin_unlock_irqrestore(&bus->sdiodev->irq_en_lock, flags); +-+ spin_unlock_irqrestore(&sdiodev->irq_en_lock, flags); +- } +- } +- +-@@ -3394,9 +3396,7 @@ static int brcmf_sdio_bus_preinit(struct +- sizeof(u32)); +- } else { +- /* otherwise, set txglomalign */ +-- value = 4; +-- if (sdiodev->pdata) +-- value = sdiodev->pdata->sd_sgentry_align; +-+ value = sdiodev->settings->bus.sdio.sd_sgentry_align; +- /* SDIO ADMA requires at least 32 bit alignment */ +- value = max_t(u32, value, 4); +- err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value, +-@@ -3811,21 +3811,25 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- bus->ci = NULL; +- goto fail; +- } +-- sdiodev->pdata = brcmf_get_module_param(sdiodev->dev, +-+ sdiodev->settings = brcmf_get_module_param(sdiodev->dev, +- BRCMF_BUSTYPE_SDIO, +- bus->ci->chip, +- bus->ci->chiprev); +-+ if (!sdiodev->settings) { +-+ brcmf_err("Failed to get device parameters\n"); +-+ goto fail; +-+ } +- /* platform specific configuration: +- * alignments must be at least 4 bytes for ADMA +- */ +- bus->head_align = ALIGNMENT; +- bus->sgentry_align = ALIGNMENT; +-- if (sdiodev->pdata) { +-- if (sdiodev->pdata->sd_head_align > ALIGNMENT) +-- bus->head_align = sdiodev->pdata->sd_head_align; +-- if (sdiodev->pdata->sd_sgentry_align > ALIGNMENT) +-- bus->sgentry_align = sdiodev->pdata->sd_sgentry_align; +-- } +-+ if (sdiodev->settings->bus.sdio.sd_head_align > ALIGNMENT) +-+ bus->head_align = sdiodev->settings->bus.sdio.sd_head_align; +-+ if (sdiodev->settings->bus.sdio.sd_sgentry_align > ALIGNMENT) +-+ bus->sgentry_align = +-+ sdiodev->settings->bus.sdio.sd_sgentry_align; +-+ +- /* allocate scatter-gather table. sg support +- * will be disabled upon allocation failure. +- */ +-@@ -3837,7 +3841,7 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- */ +- if ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_KEEP_POWER) && +- ((sdio_get_host_pm_caps(sdiodev->func[1]) & MMC_PM_WAKE_SDIO_IRQ) || +-- (sdiodev->pdata && sdiodev->pdata->oob_irq_supported))) +-+ (sdiodev->settings->bus.sdio.oob_irq_supported))) +- sdiodev->bus_if->wowl_supported = true; +- #endif +- +-@@ -3846,8 +3850,8 @@ brcmf_sdio_probe_attach(struct brcmf_sdi +- goto fail; +- } +- +-- if ((sdiodev->pdata) && (sdiodev->pdata->drive_strength)) +-- drivestrength = sdiodev->pdata->drive_strength; +-+ if (sdiodev->settings->bus.sdio.drive_strength) +-+ drivestrength = sdiodev->settings->bus.sdio.drive_strength; +- else +- drivestrength = DEFAULT_SDIO_DRIVE_STRENGTH; +- brcmf_sdio_drivestrengthinit(sdiodev, bus->ci, drivestrength); +-@@ -4124,7 +4128,7 @@ struct brcmf_sdio *brcmf_sdio_probe(stru +- bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN; +- +- /* Attach to the common layer, reserve hdr space */ +-- ret = brcmf_attach(bus->sdiodev->dev); +-+ ret = brcmf_attach(bus->sdiodev->dev, bus->sdiodev->settings); +- if (ret != 0) { +- brcmf_err("brcmf_attach failed\n"); +- goto fail; +-@@ -4228,6 +4232,8 @@ void brcmf_sdio_remove(struct brcmf_sdio +- } +- brcmf_chip_detach(bus->ci); +- } +-+ if (bus->sdiodev->settings) +-+ brcmf_release_module_param(bus->sdiodev->settings); +- +- kfree(bus->rxbuf); +- kfree(bus->hdrbuf); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h +-@@ -184,7 +184,7 @@ struct brcmf_sdio_dev { +- struct brcmf_sdio *bus; +- struct device *dev; +- struct brcmf_bus *bus_if; +-- struct brcmfmac_sdio_pd *pdata; +-+ struct brcmf_mp_device *settings; +- bool oob_irq_requested; +- bool irq_en; /* irq enable flags */ +- spinlock_t irq_en_lock; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-@@ -27,6 +27,8 @@ +- #include "debug.h" +- #include "firmware.h" +- #include "usb.h" +-+#include "core.h" +-+#include "common.h" +- +- +- #define IOCTL_RESP_TIMEOUT msecs_to_jiffies(2000) +-@@ -171,6 +173,7 @@ struct brcmf_usbdev_info { +- struct urb *bulk_urb; /* used for FW download */ +- +- bool wowl_enabled; +-+ struct brcmf_mp_device *settings; +- }; +- +- static void brcmf_usb_rx_refill(struct brcmf_usbdev_info *devinfo, +-@@ -1027,6 +1030,9 @@ static void brcmf_usb_detach(struct brcm +- +- kfree(devinfo->tx_reqs); +- kfree(devinfo->rx_reqs); +-+ +-+ if (devinfo->settings) +-+ brcmf_release_module_param(devinfo->settings); +- } +- +- +-@@ -1136,7 +1142,7 @@ static int brcmf_usb_bus_setup(struct br +- int ret; +- +- /* Attach to the common driver interface */ +-- ret = brcmf_attach(devinfo->dev); +-+ ret = brcmf_attach(devinfo->dev, devinfo->settings); +- if (ret) { +- brcmf_err("brcmf_attach failed\n"); +- return ret; +-@@ -1223,6 +1229,14 @@ static int brcmf_usb_probe_cb(struct brc +- bus->wowl_supported = true; +- #endif +- +-+ devinfo->settings = brcmf_get_module_param(bus->dev, BRCMF_BUSTYPE_USB, +-+ bus_pub->devid, +-+ bus_pub->chiprev); +-+ if (!devinfo->settings) { +-+ ret = -ENOMEM; +-+ goto fail; +-+ } +-+ +- if (!brcmf_usb_dlneeded(devinfo)) { +- ret = brcmf_usb_bus_setup(devinfo); +- if (ret) +diff --git a/package/kernel/mac80211/patches/344-0019-brcmfmac-integrate-add_keyext-in-add_key.patch b/package/kernel/mac80211/patches/344-0019-brcmfmac-integrate-add_keyext-in-add_key.patch +deleted file mode 100644 +index eb680fc..0000000 +--- a/package/kernel/mac80211/patches/344-0019-brcmfmac-integrate-add_keyext-in-add_key.patch ++++ /dev/null +@@ -1,227 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:09 +0100 +-Subject: [PATCH] brcmfmac: integrate add_keyext in add_key +- +-brcmf_add_keyext is called when a key is configured for a specific +-mac address. This function is very similar to the calling function +-brcmf_add_key. Integrate this function and also use existing del_key +-function in case key is to be cleared. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -2073,84 +2073,34 @@ done: +- } +- +- static s32 +--brcmf_add_keyext(struct wiphy *wiphy, struct net_device *ndev, +-- u8 key_idx, const u8 *mac_addr, struct key_params *params) +-+brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, +-+ u8 key_idx, bool pairwise, const u8 *mac_addr) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +- struct brcmf_wsec_key key; +- s32 err = 0; +-- u8 keybuf[8]; +-+ +-+ brcmf_dbg(TRACE, "Enter\n"); +-+ if (!check_vif_up(ifp->vif)) +-+ return -EIO; +-+ +-+ if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) { +-+ /* we ignore this key index in this case */ +-+ return -EINVAL; +-+ } +- +- memset(&key, 0, sizeof(key)); +-- key.index = (u32) key_idx; +-- /* Instead of bcast for ea address for default wep keys, +-- driver needs it to be Null */ +-- if (!is_multicast_ether_addr(mac_addr)) +-- memcpy((char *)&key.ea, (void *)mac_addr, ETH_ALEN); +-- key.len = (u32) params->key_len; +-- /* check for key index change */ +-- if (key.len == 0) { +-- /* key delete */ +-- err = send_key_to_dongle(ifp, &key); +-- if (err) +-- brcmf_err("key delete error (%d)\n", err); +-- } else { +-- if (key.len > sizeof(key.data)) { +-- brcmf_err("Invalid key length (%d)\n", key.len); +-- return -EINVAL; +-- } +- +-- brcmf_dbg(CONN, "Setting the key index %d\n", key.index); +-- memcpy(key.data, params->key, key.len); +-+ key.index = (u32)key_idx; +-+ key.flags = BRCMF_PRIMARY_KEY; +-+ key.algo = CRYPTO_ALGO_OFF; +- +-- if (!brcmf_is_apmode(ifp->vif) && +-- (params->cipher == WLAN_CIPHER_SUITE_TKIP)) { +-- brcmf_dbg(CONN, "Swapping RX/TX MIC key\n"); +-- memcpy(keybuf, &key.data[24], sizeof(keybuf)); +-- memcpy(&key.data[24], &key.data[16], sizeof(keybuf)); +-- memcpy(&key.data[16], keybuf, sizeof(keybuf)); +-- } +-+ brcmf_dbg(CONN, "key index (%d)\n", key_idx); +- +-- /* if IW_ENCODE_EXT_RX_SEQ_VALID set */ +-- if (params->seq && params->seq_len == 6) { +-- /* rx iv */ +-- u8 *ivptr; +-- ivptr = (u8 *) params->seq; +-- key.rxiv.hi = (ivptr[5] << 24) | (ivptr[4] << 16) | +-- (ivptr[3] << 8) | ivptr[2]; +-- key.rxiv.lo = (ivptr[1] << 8) | ivptr[0]; +-- key.iv_initialized = true; +-- } +-+ /* Set the new key/index */ +-+ err = send_key_to_dongle(ifp, &key); +- +-- switch (params->cipher) { +-- case WLAN_CIPHER_SUITE_WEP40: +-- key.algo = CRYPTO_ALGO_WEP1; +-- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP40\n"); +-- break; +-- case WLAN_CIPHER_SUITE_WEP104: +-- key.algo = CRYPTO_ALGO_WEP128; +-- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_WEP104\n"); +-- break; +-- case WLAN_CIPHER_SUITE_TKIP: +-- key.algo = CRYPTO_ALGO_TKIP; +-- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_TKIP\n"); +-- break; +-- case WLAN_CIPHER_SUITE_AES_CMAC: +-- key.algo = CRYPTO_ALGO_AES_CCM; +-- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_AES_CMAC\n"); +-- break; +-- case WLAN_CIPHER_SUITE_CCMP: +-- key.algo = CRYPTO_ALGO_AES_CCM; +-- brcmf_dbg(CONN, "WLAN_CIPHER_SUITE_CCMP\n"); +-- break; +-- default: +-- brcmf_err("Invalid cipher (0x%x)\n", params->cipher); +-- return -EINVAL; +-- } +-- err = send_key_to_dongle(ifp, &key); +-- if (err) +-- brcmf_err("wsec_key error (%d)\n", err); +-- } +-+ brcmf_dbg(TRACE, "Exit\n"); +- return err; +- } +- +-@@ -2163,8 +2113,9 @@ brcmf_cfg80211_add_key(struct wiphy *wip +- struct brcmf_wsec_key *key; +- s32 val; +- s32 wsec; +-- s32 err = 0; +-+ s32 err; +- u8 keybuf[8]; +-+ bool ext_key; +- +- brcmf_dbg(TRACE, "Enter\n"); +- brcmf_dbg(CONN, "key index (%d)\n", key_idx); +-@@ -2177,27 +2128,32 @@ brcmf_cfg80211_add_key(struct wiphy *wip +- return -EINVAL; +- } +- +-- if (mac_addr && +-- (params->cipher != WLAN_CIPHER_SUITE_WEP40) && +-- (params->cipher != WLAN_CIPHER_SUITE_WEP104)) { +-- brcmf_dbg(TRACE, "Exit"); +-- return brcmf_add_keyext(wiphy, ndev, key_idx, mac_addr, params); +-- } +-- +-- key = &ifp->vif->profile.key[key_idx]; +-- memset(key, 0, sizeof(*key)); +-+ if (params->key_len == 0) +-+ return brcmf_cfg80211_del_key(wiphy, ndev, key_idx, pairwise, +-+ mac_addr); +- +- if (params->key_len > sizeof(key->data)) { +- brcmf_err("Too long key length (%u)\n", params->key_len); +-- err = -EINVAL; +-- goto done; +-+ return -EINVAL; +-+ } +-+ +-+ ext_key = false; +-+ if (mac_addr && (params->cipher != WLAN_CIPHER_SUITE_WEP40) && +-+ (params->cipher != WLAN_CIPHER_SUITE_WEP104)) { +-+ brcmf_dbg(TRACE, "Ext key, mac %pM", mac_addr); +-+ ext_key = true; +- } +-+ +-+ key = &ifp->vif->profile.key[key_idx]; +-+ memset(key, 0, sizeof(*key)); +-+ if ((ext_key) && (!is_multicast_ether_addr(mac_addr))) +-+ memcpy((char *)&key->ea, (void *)mac_addr, ETH_ALEN); +- key->len = params->key_len; +- key->index = key_idx; +-- +- memcpy(key->data, params->key, key->len); +-+ if (!ext_key) +-+ key->flags = BRCMF_PRIMARY_KEY; +- +-- key->flags = BRCMF_PRIMARY_KEY; +- switch (params->cipher) { +- case WLAN_CIPHER_SUITE_WEP40: +- key->algo = CRYPTO_ALGO_WEP1; +-@@ -2237,7 +2193,7 @@ brcmf_cfg80211_add_key(struct wiphy *wip +- } +- +- err = send_key_to_dongle(ifp, key); +-- if (err) +-+ if (ext_key || err) +- goto done; +- +- err = brcmf_fil_bsscfg_int_get(ifp, "wsec", &wsec); +-@@ -2256,38 +2212,6 @@ done: +- brcmf_dbg(TRACE, "Exit\n"); +- return err; +- } +-- +--static s32 +--brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *ndev, +-- u8 key_idx, bool pairwise, const u8 *mac_addr) +--{ +-- struct brcmf_if *ifp = netdev_priv(ndev); +-- struct brcmf_wsec_key key; +-- s32 err = 0; +-- +-- brcmf_dbg(TRACE, "Enter\n"); +-- if (!check_vif_up(ifp->vif)) +-- return -EIO; +-- +-- if (key_idx >= BRCMF_MAX_DEFAULT_KEYS) { +-- /* we ignore this key index in this case */ +-- return -EINVAL; +-- } +-- +-- memset(&key, 0, sizeof(key)); +-- +-- key.index = (u32) key_idx; +-- key.flags = BRCMF_PRIMARY_KEY; +-- key.algo = CRYPTO_ALGO_OFF; +-- +-- brcmf_dbg(CONN, "key index (%d)\n", key_idx); +-- +-- /* Set the new key/index */ +-- err = send_key_to_dongle(ifp, &key); +-- +-- brcmf_dbg(TRACE, "Exit\n"); +-- return err; +--} +- +- static s32 +- brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, +diff --git a/package/kernel/mac80211/patches/344-0020-brcmfmac-add-802.11w-management-frame-protection-sup.patch b/package/kernel/mac80211/patches/344-0020-brcmfmac-add-802.11w-management-frame-protection-sup.patch +deleted file mode 100644 +index c20d40c..0000000 +--- a/package/kernel/mac80211/patches/344-0020-brcmfmac-add-802.11w-management-frame-protection-sup.patch ++++ /dev/null +@@ -1,509 +0,0 @@ +-From: Hante Meuleman +-Date: Wed, 17 Feb 2016 11:27:10 +0100 +-Subject: [PATCH] brcmfmac: add 802.11w management frame protection support +- +-Add full support for both AP and STA for management frame protection. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky (Zhenhui) Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -72,8 +72,13 @@ +- #define RSN_AKM_NONE 0 /* None (IBSS) */ +- #define RSN_AKM_UNSPECIFIED 1 /* Over 802.1x */ +- #define RSN_AKM_PSK 2 /* Pre-shared Key */ +-+#define RSN_AKM_SHA256_1X 5 /* SHA256, 802.1X */ +-+#define RSN_AKM_SHA256_PSK 6 /* SHA256, Pre-shared Key */ +- #define RSN_CAP_LEN 2 /* Length of RSN capabilities */ +--#define RSN_CAP_PTK_REPLAY_CNTR_MASK 0x000C +-+#define RSN_CAP_PTK_REPLAY_CNTR_MASK (BIT(2) | BIT(3)) +-+#define RSN_CAP_MFPR_MASK BIT(6) +-+#define RSN_CAP_MFPC_MASK BIT(7) +-+#define RSN_PMKID_COUNT_LEN 2 +- +- #define VNDR_IE_CMD_LEN 4 /* length of the set command +- * string :"add", "del" (+ NUL) +-@@ -211,12 +216,19 @@ static const struct ieee80211_regdomain +- REG_RULE(5470-10, 5850+10, 80, 6, 20, 0), } +- }; +- +--static const u32 __wl_cipher_suites[] = { +-+/* Note: brcmf_cipher_suites is an array of int defining which cipher suites +-+ * are supported. A pointer to this array and the number of entries is passed +-+ * on to upper layers. AES_CMAC defines whether or not the driver supports MFP. +-+ * So the cipher suite AES_CMAC has to be the last one in the array, and when +-+ * device does not support MFP then the number of suites will be decreased by 1 +-+ */ +-+static const u32 brcmf_cipher_suites[] = { +- WLAN_CIPHER_SUITE_WEP40, +- WLAN_CIPHER_SUITE_WEP104, +- WLAN_CIPHER_SUITE_TKIP, +- WLAN_CIPHER_SUITE_CCMP, +-- WLAN_CIPHER_SUITE_AES_CMAC, +-+ /* Keep as last entry: */ +-+ WLAN_CIPHER_SUITE_AES_CMAC +- }; +- +- /* Vendor specific ie. id = 221, oui and type defines exact ie */ +-@@ -1533,7 +1545,7 @@ static s32 brcmf_set_auth_type(struct ne +- +- static s32 +- brcmf_set_wsec_mode(struct net_device *ndev, +-- struct cfg80211_connect_params *sme, bool mfp) +-+ struct cfg80211_connect_params *sme) +- { +- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); +- struct brcmf_cfg80211_security *sec; +-@@ -1592,10 +1604,7 @@ brcmf_set_wsec_mode(struct net_device *n +- sme->privacy) +- pval = AES_ENABLED; +- +-- if (mfp) +-- wsec = pval | gval | MFP_CAPABLE; +-- else +-- wsec = pval | gval; +-+ wsec = pval | gval; +- err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wsec", wsec); +- if (err) { +- brcmf_err("error (%d)\n", err); +-@@ -1612,56 +1621,100 @@ brcmf_set_wsec_mode(struct net_device *n +- static s32 +- brcmf_set_key_mgmt(struct net_device *ndev, struct cfg80211_connect_params *sme) +- { +-- struct brcmf_cfg80211_profile *profile = ndev_to_prof(ndev); +-- struct brcmf_cfg80211_security *sec; +-- s32 val = 0; +-- s32 err = 0; +-+ struct brcmf_if *ifp = netdev_priv(ndev); +-+ s32 val; +-+ s32 err; +-+ const struct brcmf_tlv *rsn_ie; +-+ const u8 *ie; +-+ u32 ie_len; +-+ u32 offset; +-+ u16 rsn_cap; +-+ u32 mfp; +-+ u16 count; +- +-- if (sme->crypto.n_akm_suites) { +-- err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), +-- "wpa_auth", &val); +-- if (err) { +-- brcmf_err("could not get wpa_auth (%d)\n", err); +-- return err; +-+ if (!sme->crypto.n_akm_suites) +-+ return 0; +-+ +-+ err = brcmf_fil_bsscfg_int_get(netdev_priv(ndev), "wpa_auth", &val); +-+ if (err) { +-+ brcmf_err("could not get wpa_auth (%d)\n", err); +-+ return err; +-+ } +-+ if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) { +-+ switch (sme->crypto.akm_suites[0]) { +-+ case WLAN_AKM_SUITE_8021X: +-+ val = WPA_AUTH_UNSPECIFIED; +-+ break; +-+ case WLAN_AKM_SUITE_PSK: +-+ val = WPA_AUTH_PSK; +-+ break; +-+ default: +-+ brcmf_err("invalid cipher group (%d)\n", +-+ sme->crypto.cipher_group); +-+ return -EINVAL; +- } +-- if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) { +-- switch (sme->crypto.akm_suites[0]) { +-- case WLAN_AKM_SUITE_8021X: +-- val = WPA_AUTH_UNSPECIFIED; +-- break; +-- case WLAN_AKM_SUITE_PSK: +-- val = WPA_AUTH_PSK; +-- break; +-- default: +-- brcmf_err("invalid cipher group (%d)\n", +-- sme->crypto.cipher_group); +-- return -EINVAL; +-- } +-- } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) { +-- switch (sme->crypto.akm_suites[0]) { +-- case WLAN_AKM_SUITE_8021X: +-- val = WPA2_AUTH_UNSPECIFIED; +-- break; +-- case WLAN_AKM_SUITE_PSK: +-- val = WPA2_AUTH_PSK; +-- break; +-- default: +-- brcmf_err("invalid cipher group (%d)\n", +-- sme->crypto.cipher_group); +-- return -EINVAL; +-- } +-+ } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) { +-+ switch (sme->crypto.akm_suites[0]) { +-+ case WLAN_AKM_SUITE_8021X: +-+ val = WPA2_AUTH_UNSPECIFIED; +-+ break; +-+ case WLAN_AKM_SUITE_8021X_SHA256: +-+ val = WPA2_AUTH_1X_SHA256; +-+ break; +-+ case WLAN_AKM_SUITE_PSK_SHA256: +-+ val = WPA2_AUTH_PSK_SHA256; +-+ break; +-+ case WLAN_AKM_SUITE_PSK: +-+ val = WPA2_AUTH_PSK; +-+ break; +-+ default: +-+ brcmf_err("invalid cipher group (%d)\n", +-+ sme->crypto.cipher_group); +-+ return -EINVAL; +- } +-+ } +- +-- brcmf_dbg(CONN, "setting wpa_auth to %d\n", val); +-- err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), +-- "wpa_auth", val); +-- if (err) { +-- brcmf_err("could not set wpa_auth (%d)\n", err); +-- return err; +-- } +-+ if (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) +-+ goto skip_mfp_config; +-+ /* The MFP mode (1 or 2) needs to be determined, parse IEs. The +-+ * IE will not be verified, just a quick search for MFP config +-+ */ +-+ rsn_ie = brcmf_parse_tlvs((const u8 *)sme->ie, sme->ie_len, +-+ WLAN_EID_RSN); +-+ if (!rsn_ie) +-+ goto skip_mfp_config; +-+ ie = (const u8 *)rsn_ie; +-+ ie_len = rsn_ie->len + TLV_HDR_LEN; +-+ /* Skip unicast suite */ +-+ offset = TLV_HDR_LEN + WPA_IE_VERSION_LEN + WPA_IE_MIN_OUI_LEN; +-+ if (offset + WPA_IE_SUITE_COUNT_LEN >= ie_len) +-+ goto skip_mfp_config; +-+ /* Skip multicast suite */ +-+ count = ie[offset] + (ie[offset + 1] << 8); +-+ offset += WPA_IE_SUITE_COUNT_LEN + (count * WPA_IE_MIN_OUI_LEN); +-+ if (offset + WPA_IE_SUITE_COUNT_LEN >= ie_len) +-+ goto skip_mfp_config; +-+ /* Skip auth key management suite(s) */ +-+ count = ie[offset] + (ie[offset + 1] << 8); +-+ offset += WPA_IE_SUITE_COUNT_LEN + (count * WPA_IE_MIN_OUI_LEN); +-+ if (offset + WPA_IE_SUITE_COUNT_LEN > ie_len) +-+ goto skip_mfp_config; +-+ /* Ready to read capabilities */ +-+ mfp = BRCMF_MFP_NONE; +-+ rsn_cap = ie[offset] + (ie[offset + 1] << 8); +-+ if (rsn_cap & RSN_CAP_MFPR_MASK) +-+ mfp = BRCMF_MFP_REQUIRED; +-+ else if (rsn_cap & RSN_CAP_MFPC_MASK) +-+ mfp = BRCMF_MFP_CAPABLE; +-+ brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "mfp", mfp); +-+ +-+skip_mfp_config: +-+ brcmf_dbg(CONN, "setting wpa_auth to %d\n", val); +-+ err = brcmf_fil_bsscfg_int_set(netdev_priv(ndev), "wpa_auth", val); +-+ if (err) { +-+ brcmf_err("could not set wpa_auth (%d)\n", err); +-+ return err; +- } +-- sec = &profile->sec; +-- sec->wpa_auth = sme->crypto.akm_suites[0]; +- +- return err; +- } +-@@ -1827,7 +1880,7 @@ brcmf_cfg80211_connect(struct wiphy *wip +- goto done; +- } +- +-- err = brcmf_set_wsec_mode(ndev, sme, sme->mfp == NL80211_MFP_REQUIRED); +-+ err = brcmf_set_wsec_mode(ndev, sme); +- if (err) { +- brcmf_err("wl_set_set_cipher failed (%d)\n", err); +- goto done; +-@@ -2077,10 +2130,12 @@ brcmf_cfg80211_del_key(struct wiphy *wip +- u8 key_idx, bool pairwise, const u8 *mac_addr) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +-- struct brcmf_wsec_key key; +-- s32 err = 0; +-+ struct brcmf_wsec_key *key; +-+ s32 err; +- +- brcmf_dbg(TRACE, "Enter\n"); +-+ brcmf_dbg(CONN, "key index (%d)\n", key_idx); +-+ +- if (!check_vif_up(ifp->vif)) +- return -EIO; +- +-@@ -2089,16 +2144,19 @@ brcmf_cfg80211_del_key(struct wiphy *wip +- return -EINVAL; +- } +- +-- memset(&key, 0, sizeof(key)); +-+ key = &ifp->vif->profile.key[key_idx]; +- +-- key.index = (u32)key_idx; +-- key.flags = BRCMF_PRIMARY_KEY; +-- key.algo = CRYPTO_ALGO_OFF; +-+ if (key->algo == CRYPTO_ALGO_OFF) { +-+ brcmf_dbg(CONN, "Ignore clearing of (never configured) key\n"); +-+ return -EINVAL; +-+ } +- +-- brcmf_dbg(CONN, "key index (%d)\n", key_idx); +-+ memset(key, 0, sizeof(*key)); +-+ key->index = (u32)key_idx; +-+ key->flags = BRCMF_PRIMARY_KEY; +- +-- /* Set the new key/index */ +-- err = send_key_to_dongle(ifp, &key); +-+ /* Clear the key/index */ +-+ err = send_key_to_dongle(ifp, key); +- +- brcmf_dbg(TRACE, "Exit\n"); +- return err; +-@@ -2106,8 +2164,8 @@ brcmf_cfg80211_del_key(struct wiphy *wip +- +- static s32 +- brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *ndev, +-- u8 key_idx, bool pairwise, const u8 *mac_addr, +-- struct key_params *params) +-+ u8 key_idx, bool pairwise, const u8 *mac_addr, +-+ struct key_params *params) +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +- struct brcmf_wsec_key *key; +-@@ -2214,9 +2272,10 @@ done: +- } +- +- static s32 +--brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, +-- u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie, +-- void (*callback) (void *cookie, struct key_params * params)) +-+brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *ndev, u8 key_idx, +-+ bool pairwise, const u8 *mac_addr, void *cookie, +-+ void (*callback)(void *cookie, +-+ struct key_params *params)) +- { +- struct key_params params; +- struct brcmf_if *ifp = netdev_priv(ndev); +-@@ -2268,8 +2327,15 @@ done: +- +- static s32 +- brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy, +-- struct net_device *ndev, u8 key_idx) +-+ struct net_device *ndev, u8 key_idx) +- { +-+ struct brcmf_if *ifp = netdev_priv(ndev); +-+ +-+ brcmf_dbg(TRACE, "Enter key_idx %d\n", key_idx); +-+ +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) +-+ return 0; +-+ +- brcmf_dbg(INFO, "Not supported\n"); +- +- return -EOPNOTSUPP; +-@@ -3769,7 +3835,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +- u32 auth = 0; /* d11 open authentication */ +- u16 count; +- s32 err = 0; +-- s32 len = 0; +-+ s32 len; +- u32 i; +- u32 wsec; +- u32 pval = 0; +-@@ -3779,6 +3845,7 @@ brcmf_configure_wpaie(struct brcmf_if *i +- u8 *data; +- u16 rsn_cap; +- u32 wme_bss_disable; +-+ u32 mfp; +- +- brcmf_dbg(TRACE, "Enter\n"); +- if (wpa_ie == NULL) +-@@ -3893,19 +3960,53 @@ brcmf_configure_wpaie(struct brcmf_if *i +- is_rsn_ie ? (wpa_auth |= WPA2_AUTH_PSK) : +- (wpa_auth |= WPA_AUTH_PSK); +- break; +-+ case RSN_AKM_SHA256_PSK: +-+ brcmf_dbg(TRACE, "RSN_AKM_MFP_PSK\n"); +-+ wpa_auth |= WPA2_AUTH_PSK_SHA256; +-+ break; +-+ case RSN_AKM_SHA256_1X: +-+ brcmf_dbg(TRACE, "RSN_AKM_MFP_1X\n"); +-+ wpa_auth |= WPA2_AUTH_1X_SHA256; +-+ break; +- default: +- brcmf_err("Ivalid key mgmt info\n"); +- } +- offset++; +- } +- +-+ mfp = BRCMF_MFP_NONE; +- if (is_rsn_ie) { +- wme_bss_disable = 1; +- if ((offset + RSN_CAP_LEN) <= len) { +- rsn_cap = data[offset] + (data[offset + 1] << 8); +- if (rsn_cap & RSN_CAP_PTK_REPLAY_CNTR_MASK) +- wme_bss_disable = 0; +-+ if (rsn_cap & RSN_CAP_MFPR_MASK) { +-+ brcmf_dbg(TRACE, "MFP Required\n"); +-+ mfp = BRCMF_MFP_REQUIRED; +-+ /* Firmware only supports mfp required in +-+ * combination with WPA2_AUTH_PSK_SHA256 or +-+ * WPA2_AUTH_1X_SHA256. +-+ */ +-+ if (!(wpa_auth & (WPA2_AUTH_PSK_SHA256 | +-+ WPA2_AUTH_1X_SHA256))) { +-+ err = -EINVAL; +-+ goto exit; +-+ } +-+ /* Firmware has requirement that WPA2_AUTH_PSK/ +-+ * WPA2_AUTH_UNSPECIFIED be set, if SHA256 OUI +-+ * is to be included in the rsn ie. +-+ */ +-+ if (wpa_auth & WPA2_AUTH_PSK_SHA256) +-+ wpa_auth |= WPA2_AUTH_PSK; +-+ else if (wpa_auth & WPA2_AUTH_1X_SHA256) +-+ wpa_auth |= WPA2_AUTH_UNSPECIFIED; +-+ } else if (rsn_cap & RSN_CAP_MFPC_MASK) { +-+ brcmf_dbg(TRACE, "MFP Capable\n"); +-+ mfp = BRCMF_MFP_CAPABLE; +-+ } +- } +-+ offset += RSN_CAP_LEN; +- /* set wme_bss_disable to sync RSN Capabilities */ +- err = brcmf_fil_bsscfg_int_set(ifp, "wme_bss_disable", +- wme_bss_disable); +-@@ -3913,6 +4014,21 @@ brcmf_configure_wpaie(struct brcmf_if *i +- brcmf_err("wme_bss_disable error %d\n", err); +- goto exit; +- } +-+ +-+ /* Skip PMKID cnt as it is know to be 0 for AP. */ +-+ offset += RSN_PMKID_COUNT_LEN; +-+ +-+ /* See if there is BIP wpa suite left for MFP */ +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP) && +-+ ((offset + WPA_IE_MIN_OUI_LEN) <= len)) { +-+ err = brcmf_fil_bsscfg_data_set(ifp, "bip", +-+ &data[offset], +-+ WPA_IE_MIN_OUI_LEN); +-+ if (err < 0) { +-+ brcmf_err("bip error %d\n", err); +-+ goto exit; +-+ } +-+ } +- } +- /* FOR WPS , set SES_OW_ENABLED */ +- wsec = (pval | gval | SES_OW_ENABLED); +-@@ -3929,6 +4045,16 @@ brcmf_configure_wpaie(struct brcmf_if *i +- brcmf_err("wsec error %d\n", err); +- goto exit; +- } +-+ /* Configure MFP, this needs to go after wsec otherwise the wsec command +-+ * will overwrite the values set by MFP +-+ */ +-+ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) { +-+ err = brcmf_fil_bsscfg_int_set(ifp, "mfp", mfp); +-+ if (err < 0) { +-+ brcmf_err("mfp error %d\n", err); +-+ goto exit; +-+ } +-+ } +- /* set upper-layer auth */ +- err = brcmf_fil_bsscfg_int_set(ifp, "wpa_auth", wpa_auth); +- if (err < 0) { +-@@ -6149,8 +6275,10 @@ static int brcmf_setup_wiphy(struct wiph +- wiphy->n_addresses = i; +- +- wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; +-- wiphy->cipher_suites = __wl_cipher_suites; +-- wiphy->n_cipher_suites = ARRAY_SIZE(__wl_cipher_suites); +-+ wiphy->cipher_suites = brcmf_cipher_suites; +-+ wiphy->n_cipher_suites = ARRAY_SIZE(brcmf_cipher_suites); +-+ if (!brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MFP)) +-+ wiphy->n_cipher_suites--; +- wiphy->flags |= WIPHY_FLAG_PS_ON_BY_DEFAULT | +- WIPHY_FLAG_OFFCHAN_TX | +- WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -72,7 +72,7 @@ +- +- #define BRCMF_VNDR_IE_P2PAF_SHIFT 12 +- +--#define BRCMF_MAX_DEFAULT_KEYS 4 +-+#define BRCMF_MAX_DEFAULT_KEYS 6 +- +- /* beacon loss timeout defaults */ +- #define BRCMF_DEFAULT_BCN_TIMEOUT_ROAM_ON 2 +-@@ -107,7 +107,6 @@ struct brcmf_cfg80211_security { +- u32 auth_type; +- u32 cipher_pairwise; +- u32 cipher_group; +-- u32 wpa_auth; +- }; +- +- /** +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +-@@ -161,6 +161,7 @@ void brcmf_feat_attach(struct brcmf_pub +- ifp->drvr->feat_flags &= ~BIT(BRCMF_FEAT_MBSS); +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_RSDB, "rsdb_mode"); +- brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_TDLS, "tdls_enable"); +-+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_MFP, "mfp"); +- +- pfn_mac.version = BRCMF_PFN_MACADDR_CFG_VER; +- err = brcmf_fil_iovar_data_get(ifp, "pfn_macaddr", &pfn_mac, +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +-@@ -30,6 +30,7 @@ +- * WOWL_ND: WOWL net detect (PNO) +- * WOWL_GTK: (WOWL) GTK rekeying offload +- * WOWL_ARP_ND: ARP and Neighbor Discovery offload support during WOWL. +-+ * MFP: 802.11w Management Frame Protection. +- */ +- #define BRCMF_FEAT_LIST \ +- BRCMF_FEAT_DEF(MBSS) \ +-@@ -42,7 +43,8 @@ +- BRCMF_FEAT_DEF(SCAN_RANDOM_MAC) \ +- BRCMF_FEAT_DEF(WOWL_ND) \ +- BRCMF_FEAT_DEF(WOWL_GTK) \ +-- BRCMF_FEAT_DEF(WOWL_ARP_ND) +-+ BRCMF_FEAT_DEF(WOWL_ARP_ND) \ +-+ BRCMF_FEAT_DEF(MFP) +- +- /* +- * Quirks: +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +-@@ -142,6 +142,10 @@ +- #define BRCMF_RSN_KEK_LENGTH 16 +- #define BRCMF_RSN_REPLAY_LEN 8 +- +-+#define BRCMF_MFP_NONE 0 +-+#define BRCMF_MFP_CAPABLE 1 +-+#define BRCMF_MFP_REQUIRED 2 +-+ +- /* join preference types for join_pref iovar */ +- enum brcmf_join_pref_types { +- BRCMF_JOIN_PREF_RSSI = 1, +---- a/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h +-@@ -236,6 +236,8 @@ static inline bool ac_bitmap_tst(u8 bitm +- #define WPA2_AUTH_RESERVED3 0x0200 +- #define WPA2_AUTH_RESERVED4 0x0400 +- #define WPA2_AUTH_RESERVED5 0x0800 +-+#define WPA2_AUTH_1X_SHA256 0x1000 /* 1X with SHA256 key derivation */ +-+#define WPA2_AUTH_PSK_SHA256 0x8000 /* PSK with SHA256 key derivation */ +- +- #define DOT11_DEFAULT_RTS_LEN 2347 +- #define DOT11_DEFAULT_FRAG_LEN 2346 diff --git a/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch b/package/kernel/mac80211/patches/344-mac80211-send-delBA-on-unexpected-BlockAck-data-fram.patch new file mode 100644 index 0000000..3bbca22 @@ -11555,10 +15921,370 @@ index 0000000..3bbca22 + /* tx */ + struct work_struct work; + struct tid_ampdu_tx __rcu *tid_tx[IEEE80211_NUM_TIDS]; -diff --git a/package/kernel/mac80211/patches/345-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch b/package/kernel/mac80211/patches/345-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch +diff --git a/package/kernel/mac80211/patches/345-brcmfmac-Remove-waitqueue_active-check.patch b/package/kernel/mac80211/patches/345-brcmfmac-Remove-waitqueue_active-check.patch +deleted file mode 100644 +index 39f4383..0000000 +--- a/package/kernel/mac80211/patches/345-brcmfmac-Remove-waitqueue_active-check.patch ++++ /dev/null +@@ -1,54 +0,0 @@ +-From: Hui Wang +-Date: Wed, 9 Mar 2016 15:25:26 +0800 +-Subject: [PATCH] brcmfmac: Remove waitqueue_active check +- +-We met a problem of pm_suspend when repeated closing/opening the lid +-on a Lenovo laptop (1/20 reproduce rate), below is the log: +- +-[ 199.735876] PM: Entering mem sleep +-[ 199.750516] e1000e: EEE TX LPI TIMER: 00000011 +-[ 199.856638] Trying to free nonexistent resource <000000000000d000-000000000000d0ff> +-[ 201.753566] brcmfmac: brcmf_pcie_suspend: Timeout on response for entering D3 substate +-[ 201.753581] pci_legacy_suspend(): brcmf_pcie_suspend+0x0/0x1f0 [brcmfmac] returns -5 +-[ 201.753585] dpm_run_callback(): pci_pm_suspend+0x0/0x160 returns -5 +-[ 201.753589] PM: Device 0000:04:00.0 failed to suspend async: error -5 +- +-Through debugging, we found when problem happens, it is not the device +-fails to enter D3, but the signal D3_ACK comes too early to pass the +-waitqueue_active() check. +- +-Just like this: +-brcmf_pcie_send_mb_data(devinfo, BRCMF_H2D_HOST_D3_INFORM); +-// signal is triggered here +-wait_event_timeout(devinfo->mbdata_resp_wait, devinfo->mbdata_completed, +- BRCMF_PCIE_MBDATA_TIMEOUT); +- +-So far I think it is safe to remove waitqueue_active check since there +-is only one place to trigger this signal (sending +-BRCMF_H2D_HOST_D3_INFORM). And it is not a problem calling wake_up +-event earlier than calling wait_event. +- +-Cc: Brett Rudley +-Cc: Hante Meuleman +-Cc: Franky (Zhenhui) Lin +-Cc: Pieter-Paul Giesberts +-Cc: Arend van Spriel +-Signed-off-by: Hui Wang +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +-@@ -677,10 +677,8 @@ static void brcmf_pcie_handle_mb_data(st +- brcmf_dbg(PCIE, "D2H_MB_DATA: DEEP SLEEP EXIT\n"); +- if (dtoh_mb_data & BRCMF_D2H_DEV_D3_ACK) { +- brcmf_dbg(PCIE, "D2H_MB_DATA: D3 ACK\n"); +-- if (waitqueue_active(&devinfo->mbdata_resp_wait)) { +-- devinfo->mbdata_completed = true; +-- wake_up(&devinfo->mbdata_resp_wait); +-- } +-+ devinfo->mbdata_completed = true; +-+ wake_up(&devinfo->mbdata_resp_wait); +- } +- } +- +diff --git a/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch b/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch +new file mode 100644 +index 0000000..c3d3118 +--- /dev/null ++++ b/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch +@@ -0,0 +1,26 @@ ++From: Johannes Berg ++Date: Mon, 29 Aug 2016 23:25:19 +0300 ++Subject: [PATCH] mac80211: send delBA on unexpected BlockAck Request ++ ++If we don't have a BA session, send delBA, as requested by the ++IEEE 802.11 spec. Apply the same limit of sending such a delBA ++only once as in the previous patch. ++ ++Signed-off-by: Johannes Berg ++--- ++ ++--- a/net/mac80211/rx.c +++++ b/net/mac80211/rx.c ++@@ -2537,6 +2537,12 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_ ++ ++ tid = le16_to_cpu(bar_data.control) >> 12; ++ +++ if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && +++ !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) +++ ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, +++ WLAN_BACK_RECIPIENT, +++ WLAN_REASON_QSTA_REQUIRE_SETUP); +++ ++ tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]); ++ if (!tid_agg_rx) ++ return RX_DROP_MONITOR; +diff --git a/package/kernel/mac80211/patches/346-brcmfmac-uninitialized-ret-variable.patch b/package/kernel/mac80211/patches/346-brcmfmac-uninitialized-ret-variable.patch +deleted file mode 100644 +index 3c9ed42..0000000 +--- a/package/kernel/mac80211/patches/346-brcmfmac-uninitialized-ret-variable.patch ++++ /dev/null +@@ -1,21 +0,0 @@ +-From: Dan Carpenter +-Date: Tue, 15 Mar 2016 10:06:10 +0300 +-Subject: [PATCH] brcmfmac: uninitialized "ret" variable +- +-There is an error path where "ret" isn't initialized. +- +-Signed-off-by: Dan Carpenter +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -250,7 +250,7 @@ static int brcmf_sdiod_request_data(stru +- u32 addr, u8 regsz, void *data, bool write) +- { +- struct sdio_func *func; +-- int ret; +-+ int ret = -EINVAL; +- +- brcmf_dbg(SDIO, "rw=%d, func=%d, addr=0x%05x, nbytes=%d\n", +- write, fn, addr, regsz); +diff --git a/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch +new file mode 100644 +index 0000000..a82d12f +--- /dev/null ++++ b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch +@@ -0,0 +1,107 @@ ++From: Felix Fietkau ++Date: Sun, 4 Sep 2016 17:46:24 +0200 ++Subject: [PATCH] mac80211: fix sequence number assignment for PS response ++ frames ++ ++When using intermediate queues, sequence number allocation is deferred ++until dequeue. This doesn't work for PS response frames, which bypass ++those queues. ++ ++Signed-off-by: Felix Fietkau ++--- ++ ++--- a/net/mac80211/tx.c +++++ b/net/mac80211/tx.c ++@@ -792,6 +792,36 @@ static __le16 ieee80211_tx_next_seq(stru ++ return ret; ++ } ++ +++static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local, +++ struct ieee80211_vif *vif, +++ struct ieee80211_sta *pubsta, +++ struct sk_buff *skb) +++{ +++ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +++ struct ieee80211_txq *txq = NULL; +++ +++ if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) || +++ (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) +++ return NULL; +++ +++ if (!ieee80211_is_data(hdr->frame_control)) +++ return NULL; +++ +++ if (pubsta) { +++ u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; +++ +++ txq = pubsta->txq[tid]; +++ } else if (vif) { +++ txq = vif->txq; +++ } +++ +++ if (!txq) +++ return NULL; +++ +++ return to_txq_info(txq); +++} +++ ++ static ieee80211_tx_result debug_noinline ++ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) ++ { ++@@ -849,7 +879,8 @@ ieee80211_tx_h_sequence(struct ieee80211 ++ tid = *qc & IEEE80211_QOS_CTL_TID_MASK; ++ tx->sta->tx_stats.msdu[tid]++; ++ ++- if (!tx->sta->sta.txq[0]) +++ if (!ieee80211_get_txq(tx->local, info->control.vif, &tx->sta->sta, +++ tx->skb)) ++ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); ++ ++ return TX_CONTINUE; ++@@ -1238,36 +1269,6 @@ ieee80211_tx_prepare(struct ieee80211_su ++ return TX_CONTINUE; ++ } ++ ++-static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local, ++- struct ieee80211_vif *vif, ++- struct ieee80211_sta *pubsta, ++- struct sk_buff *skb) ++-{ ++- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; ++- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++- struct ieee80211_txq *txq = NULL; ++- ++- if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) || ++- (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) ++- return NULL; ++- ++- if (!ieee80211_is_data(hdr->frame_control)) ++- return NULL; ++- ++- if (pubsta) { ++- u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; ++- ++- txq = pubsta->txq[tid]; ++- } else if (vif) { ++- txq = vif->txq; ++- } ++- ++- if (!txq) ++- return NULL; ++- ++- return to_txq_info(txq); ++-} ++- ++ static void ieee80211_set_skb_enqueue_time(struct sk_buff *skb) ++ { ++ IEEE80211_SKB_CB(skb)->control.enqueue_time = codel_get_time(); ++@@ -3265,7 +3266,7 @@ static bool ieee80211_xmit_fast(struct i ++ ++ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { ++ *ieee80211_get_qos_ctl(hdr) = tid; ++- if (!sta->sta.txq[0]) +++ if (!ieee80211_get_txq(local, &sdata->vif, &sta->sta, skb)) ++ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); ++ } else { ++ info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; +diff --git a/package/kernel/mac80211/patches/347-brcmfmac-sdio-remove-unused-variable-retry_limit.patch b/package/kernel/mac80211/patches/347-brcmfmac-sdio-remove-unused-variable-retry_limit.patch +deleted file mode 100644 +index d1deb6e..0000000 +--- a/package/kernel/mac80211/patches/347-brcmfmac-sdio-remove-unused-variable-retry_limit.patch ++++ /dev/null +@@ -1,24 +0,0 @@ +-From: Colin Ian King +-Date: Sun, 20 Mar 2016 17:34:52 +0000 +-Subject: [PATCH] brcmfmac: sdio: remove unused variable retry_limit +- +-retry_limit has never been used during the life of this driver, so +-we may as well remove it as it is redundant. +- +-Signed-off-by: Colin Ian King +-Reviewed-by: Julian Calaby +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -535,9 +535,6 @@ static int qcount[NUMPRIO]; +- +- #define RETRYCHAN(chan) ((chan) == SDPCM_EVENT_CHANNEL) +- +--/* Retry count for register access failures */ +--static const uint retry_limit = 2; +-- +- /* Limit on rounding up frames */ +- static const uint max_roundup = 512; +- +diff --git a/package/kernel/mac80211/patches/348-brcmfmac-Delete-unnecessary-variable-initialisation.patch b/package/kernel/mac80211/patches/348-brcmfmac-Delete-unnecessary-variable-initialisation.patch +deleted file mode 100644 +index d399b26..0000000 +--- a/package/kernel/mac80211/patches/348-brcmfmac-Delete-unnecessary-variable-initialisation.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: Markus Elfring +-Date: Fri, 18 Mar 2016 13:23:24 +1100 +-Subject: [PATCH] brcmfmac: Delete unnecessary variable initialisation +- +-In brcmf_sdio_download_firmware(), bcmerror is set by the call to +-brcmf_sdio_download_code_file(), before it's checked in the following +-line. +- +-Signed-off-by: Markus Elfring +-Acked-by: Arend van Spriel +-[Rewrote commit message] +-Signed-off-by: Julian Calaby +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -3258,7 +3258,7 @@ static int brcmf_sdio_download_firmware( +- const struct firmware *fw, +- void *nvram, u32 nvlen) +- { +-- int bcmerror = -EFAULT; +-+ int bcmerror; +- u32 rstvec; +- +- sdio_claim_host(bus->sdiodev->func[1]); +diff --git a/package/kernel/mac80211/patches/349-0001-brcmfmac-clear-eventmask-array-before-using-it.patch b/package/kernel/mac80211/patches/349-0001-brcmfmac-clear-eventmask-array-before-using-it.patch +deleted file mode 100644 +index 0acb4fa..0000000 +--- a/package/kernel/mac80211/patches/349-0001-brcmfmac-clear-eventmask-array-before-using-it.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Hante Meuleman +-Date: Mon, 11 Apr 2016 11:35:21 +0200 +-Subject: [PATCH] brcmfmac: clear eventmask array before using it +- +-When the event_msgs iovar is set an array is used to configure the +-enabled events. This arrays needs to nulled before configuring +-otherwise unhandled events will be enabled. This solves a problem +-where in case of wowl the host got woken by an incorrectly enabled +-event. +- +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Arend Van Spriel +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-@@ -371,6 +371,7 @@ int brcmf_fweh_activate_events(struct br +- int i, err; +- s8 eventmask[BRCMF_EVENTING_MASK_LEN]; +- +-+ memset(eventmask, 0, sizeof(eventmask)); +- for (i = 0; i < BRCMF_E_LAST; i++) { +- if (ifp->drvr->fweh.evt_handler[i]) { +- brcmf_dbg(EVENT, "enable event %s\n", +diff --git a/package/kernel/mac80211/patches/349-0002-brcmfmac-fix-clearing-wowl-wake-indicators.patch b/package/kernel/mac80211/patches/349-0002-brcmfmac-fix-clearing-wowl-wake-indicators.patch +deleted file mode 100644 +index 8d30678..0000000 +--- a/package/kernel/mac80211/patches/349-0002-brcmfmac-fix-clearing-wowl-wake-indicators.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: Hante Meuleman +-Date: Mon, 11 Apr 2016 11:35:22 +0200 +-Subject: [PATCH] brcmfmac: fix clearing wowl wake indicators +- +-Newer firmwares require the usage of the wowl wakeind struct as size +-for the iovar to clear the wake indicators. Older firmwares do not +-care, so change the used size. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -3608,7 +3608,8 @@ static void brcmf_configure_wowl(struct +- if (!test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state)) +- wowl_config |= BRCMF_WOWL_UNASSOC; +- +-- brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", "clear", strlen("clear")); +-+ brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", "clear", +-+ sizeof(struct brcmf_wowl_wakeind_le)); +- brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config); +- brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1); +- brcmf_bus_wowl_config(cfg->pub->bus_if, true); +diff --git a/package/kernel/mac80211/patches/349-0003-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch b/package/kernel/mac80211/patches/349-0003-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch deleted file mode 100644 index f293401..0000000 ---- a/package/kernel/mac80211/patches/345-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch +--- a/package/kernel/mac80211/patches/349-0003-brcmfmac-insert-default-boardrev-in-nvram-data-if-mi.patch +++ /dev/null @@ -1,114 +0,0 @@ -From: Hante Meuleman @@ -11675,151 +16401,4180 @@ index f293401..0000000 - pad = nvp.nvram_len; - *new_length = roundup(nvp.nvram_len + 1, 4); - while (pad != *new_length) { -diff --git a/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch b/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch -new file mode 100644 -index 0000000..c3d3118 ---- /dev/null -+++ b/package/kernel/mac80211/patches/345-mac80211-send-delBA-on-unexpected-BlockAck-Request.patch -@@ -0,0 +1,26 @@ -+From: Johannes Berg -+Date: Mon, 29 Aug 2016 23:25:19 +0300 -+Subject: [PATCH] mac80211: send delBA on unexpected BlockAck Request -+ -+If we don't have a BA session, send delBA, as requested by the -+IEEE 802.11 spec. Apply the same limit of sending such a delBA -+only once as in the previous patch. -+ -+Signed-off-by: Johannes Berg -+--- -+ -+--- a/net/mac80211/rx.c -++++ b/net/mac80211/rx.c -+@@ -2537,6 +2537,12 @@ ieee80211_rx_h_ctrl(struct ieee80211_rx_ -+ -+ tid = le16_to_cpu(bar_data.control) >> 12; -+ -++ if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && -++ !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) -++ ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, -++ WLAN_BACK_RECIPIENT, -++ WLAN_REASON_QSTA_REQUIRE_SETUP); -++ -+ tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]); -+ if (!tid_agg_rx) -+ return RX_DROP_MONITOR; -diff --git a/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch -new file mode 100644 -index 0000000..a82d12f ---- /dev/null -+++ b/package/kernel/mac80211/patches/346-mac80211-fix-sequence-number-assignment-for-PS-respo.patch -@@ -0,0 +1,107 @@ -+From: Felix Fietkau -+Date: Sun, 4 Sep 2016 17:46:24 +0200 -+Subject: [PATCH] mac80211: fix sequence number assignment for PS response -+ frames -+ -+When using intermediate queues, sequence number allocation is deferred -+until dequeue. This doesn't work for PS response frames, which bypass -+those queues. -+ -+Signed-off-by: Felix Fietkau -+--- -+ -+--- a/net/mac80211/tx.c -++++ b/net/mac80211/tx.c -+@@ -792,6 +792,36 @@ static __le16 ieee80211_tx_next_seq(stru -+ return ret; -+ } -+ -++static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local, -++ struct ieee80211_vif *vif, -++ struct ieee80211_sta *pubsta, -++ struct sk_buff *skb) -++{ -++ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; -++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); -++ struct ieee80211_txq *txq = NULL; -++ -++ if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) || -++ (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) -++ return NULL; -++ -++ if (!ieee80211_is_data(hdr->frame_control)) -++ return NULL; -++ -++ if (pubsta) { -++ u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; -++ -++ txq = pubsta->txq[tid]; -++ } else if (vif) { -++ txq = vif->txq; -++ } -++ -++ if (!txq) -++ return NULL; -++ -++ return to_txq_info(txq); -++} -++ -+ static ieee80211_tx_result debug_noinline -+ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) -+ { -+@@ -849,7 +879,8 @@ ieee80211_tx_h_sequence(struct ieee80211 -+ tid = *qc & IEEE80211_QOS_CTL_TID_MASK; -+ tx->sta->tx_stats.msdu[tid]++; -+ -+- if (!tx->sta->sta.txq[0]) -++ if (!ieee80211_get_txq(tx->local, info->control.vif, &tx->sta->sta, -++ tx->skb)) -+ hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); -+ -+ return TX_CONTINUE; -+@@ -1238,36 +1269,6 @@ ieee80211_tx_prepare(struct ieee80211_su -+ return TX_CONTINUE; -+ } -+ -+-static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local, -+- struct ieee80211_vif *vif, -+- struct ieee80211_sta *pubsta, -+- struct sk_buff *skb) -+-{ -+- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; -+- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); -+- struct ieee80211_txq *txq = NULL; -+- -+- if ((info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) || -+- (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) -+- return NULL; -+- -+- if (!ieee80211_is_data(hdr->frame_control)) -+- return NULL; -+- -+- if (pubsta) { -+- u8 tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; -+- -+- txq = pubsta->txq[tid]; -+- } else if (vif) { -+- txq = vif->txq; -+- } -+- -+- if (!txq) -+- return NULL; -+- -+- return to_txq_info(txq); -+-} -+- -+ static void ieee80211_set_skb_enqueue_time(struct sk_buff *skb) -+ { -+ IEEE80211_SKB_CB(skb)->control.enqueue_time = codel_get_time(); -+@@ -3265,7 +3266,7 @@ static bool ieee80211_xmit_fast(struct i -+ -+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) { -+ *ieee80211_get_qos_ctl(hdr) = tid; -+- if (!sta->sta.txq[0]) -++ if (!ieee80211_get_txq(local, &sdata->vif, &sta->sta, skb)) -+ hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); -+ } else { -+ info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ; +diff --git a/package/kernel/mac80211/patches/349-0004-brcmfmac-fix-p2p-scan-abort-null-pointer-exception.patch b/package/kernel/mac80211/patches/349-0004-brcmfmac-fix-p2p-scan-abort-null-pointer-exception.patch +deleted file mode 100644 +index ed0c83f..0000000 +--- a/package/kernel/mac80211/patches/349-0004-brcmfmac-fix-p2p-scan-abort-null-pointer-exception.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From: Hante Meuleman +-Date: Mon, 11 Apr 2016 11:35:24 +0200 +-Subject: [PATCH] brcmfmac: fix p2p scan abort null pointer exception +- +-When p2p connection setup is performed without having ever done an +-escan a null pointer exception can occur. This is because the ifp +-to abort scanning is taken from escan struct while it was never +-initialized. Fix this by using the primary ifp for scan abort. The +-abort should still be performed and all scan related commands are +-performed on primary ifp. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -1266,7 +1266,7 @@ static void +- brcmf_p2p_stop_wait_next_action_frame(struct brcmf_cfg80211_info *cfg) +- { +- struct brcmf_p2p_info *p2p = &cfg->p2p; +-- struct brcmf_if *ifp = cfg->escan_info.ifp; +-+ struct brcmf_if *ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; +- +- if (test_bit(BRCMF_P2P_STATUS_SENDING_ACT_FRAME, &p2p->status) && +- (test_bit(BRCMF_P2P_STATUS_ACTION_TX_COMPLETED, &p2p->status) || +diff --git a/package/kernel/mac80211/patches/349-0005-brcmfmac-screening-firmware-event-packet.patch b/package/kernel/mac80211/patches/349-0005-brcmfmac-screening-firmware-event-packet.patch +deleted file mode 100644 +index 4d26404..0000000 +--- a/package/kernel/mac80211/patches/349-0005-brcmfmac-screening-firmware-event-packet.patch ++++ /dev/null +@@ -1,297 +0,0 @@ +-From: Franky Lin +-Date: Mon, 11 Apr 2016 11:35:25 +0200 +-Subject: [PATCH] brcmfmac: screening firmware event packet +- +-Firmware uses asynchronized events as a communication method to the +-host. The event packets are marked as ETH_P_LINK_CTL protocol type. For +-SDIO and PCIe bus, this kind of packets are delivered through virtual +-event channel not data channel. This patch adds a screening logic to +-make sure the event handler only processes the events coming from the +-correct channel. +- +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +-@@ -216,7 +216,9 @@ bool brcmf_c_prec_enq(struct device *dev +- int prec); +- +- /* Receive frame for delivery to OS. Callee disposes of rxp. */ +--void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp); +-+void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_evnt); +-+/* Receive async event packet from firmware. Callee disposes of rxp. */ +-+void brcmf_rx_event(struct device *dev, struct sk_buff *rxp); +- +- /* Indication from bus module regarding presence/insertion of dongle. */ +- int brcmf_attach(struct device *dev, struct brcmf_mp_device *settings); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -311,16 +311,17 @@ void brcmf_txflowblock(struct device *de +- brcmf_fws_bus_blocked(drvr, state); +- } +- +--void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb) +-+void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb, +-+ bool handle_event) +- { +-- skb->dev = ifp->ndev; +-- skb->protocol = eth_type_trans(skb, skb->dev); +-+ skb->protocol = eth_type_trans(skb, ifp->ndev); +- +- if (skb->pkt_type == PACKET_MULTICAST) +- ifp->stats.multicast++; +- +- /* Process special event packets */ +-- brcmf_fweh_process_skb(ifp->drvr, skb); +-+ if (handle_event) +-+ brcmf_fweh_process_skb(ifp->drvr, skb); +- +- if (!(ifp->ndev->flags & IFF_UP)) { +- brcmu_pkt_buf_free_skb(skb); +-@@ -381,7 +382,7 @@ static void brcmf_rxreorder_process_info +- /* validate flags and flow id */ +- if (flags == 0xFF) { +- brcmf_err("invalid flags...so ignore this packet\n"); +-- brcmf_netif_rx(ifp, pkt); +-+ brcmf_netif_rx(ifp, pkt, false); +- return; +- } +- +-@@ -393,7 +394,7 @@ static void brcmf_rxreorder_process_info +- if (rfi == NULL) { +- brcmf_dbg(INFO, "received flags to cleanup, but no flow (%d) yet\n", +- flow_id); +-- brcmf_netif_rx(ifp, pkt); +-+ brcmf_netif_rx(ifp, pkt, false); +- return; +- } +- +-@@ -418,7 +419,7 @@ static void brcmf_rxreorder_process_info +- rfi = kzalloc(buf_size, GFP_ATOMIC); +- if (rfi == NULL) { +- brcmf_err("failed to alloc buffer\n"); +-- brcmf_netif_rx(ifp, pkt); +-+ brcmf_netif_rx(ifp, pkt, false); +- return; +- } +- +-@@ -532,11 +533,11 @@ static void brcmf_rxreorder_process_info +- netif_rx: +- skb_queue_walk_safe(&reorder_list, pkt, pnext) { +- __skb_unlink(pkt, &reorder_list); +-- brcmf_netif_rx(ifp, pkt); +-+ brcmf_netif_rx(ifp, pkt, false); +- } +- } +- +--void brcmf_rx_frame(struct device *dev, struct sk_buff *skb) +-+void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_evnt) +- { +- struct brcmf_if *ifp; +- struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-@@ -560,7 +561,32 @@ void brcmf_rx_frame(struct device *dev, +- if (rd->reorder) +- brcmf_rxreorder_process_info(ifp, rd->reorder, skb); +- else +-- brcmf_netif_rx(ifp, skb); +-+ brcmf_netif_rx(ifp, skb, handle_evnt); +-+} +-+ +-+void brcmf_rx_event(struct device *dev, struct sk_buff *skb) +-+{ +-+ struct brcmf_if *ifp; +-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-+ struct brcmf_pub *drvr = bus_if->drvr; +-+ int ret; +-+ +-+ brcmf_dbg(EVENT, "Enter: %s: rxp=%p\n", dev_name(dev), skb); +-+ +-+ /* process and remove protocol-specific header */ +-+ ret = brcmf_proto_hdrpull(drvr, true, skb, &ifp); +-+ +-+ if (ret || !ifp || !ifp->ndev) { +-+ if (ret != -ENODATA && ifp) +-+ ifp->stats.rx_errors++; +-+ brcmu_pkt_buf_free_skb(skb); +-+ return; +-+ } +-+ +-+ skb->protocol = eth_type_trans(skb, ifp->ndev); +-+ +-+ brcmf_fweh_process_skb(ifp->drvr, skb); +-+ brcmu_pkt_buf_free_skb(skb); +- } +- +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success) +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -225,7 +225,8 @@ int brcmf_get_next_free_bsscfgidx(struct +- void brcmf_txflowblock_if(struct brcmf_if *ifp, +- enum brcmf_netif_stop_reason reason, bool state); +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +--void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); +-+void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb, +-+ bool handle_event); +- void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on); +- int __init brcmf_core_init(void); +- void __exit brcmf_core_exit(void); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-@@ -20,6 +20,7 @@ +- +- #include +- #include +-+#include +- +- #include +- #include +-@@ -1075,28 +1076,13 @@ static void brcmf_msgbuf_rxbuf_event_pos +- } +- +- +--static void +--brcmf_msgbuf_rx_skb(struct brcmf_msgbuf *msgbuf, struct sk_buff *skb, +-- u8 ifidx) +--{ +-- struct brcmf_if *ifp; +-- +-- ifp = brcmf_get_ifp(msgbuf->drvr, ifidx); +-- if (!ifp || !ifp->ndev) { +-- brcmf_err("Received pkt for invalid ifidx %d\n", ifidx); +-- brcmu_pkt_buf_free_skb(skb); +-- return; +-- } +-- brcmf_netif_rx(ifp, skb); +--} +-- +-- +- static void brcmf_msgbuf_process_event(struct brcmf_msgbuf *msgbuf, void *buf) +- { +- struct msgbuf_rx_event *event; +- u32 idx; +- u16 buflen; +- struct sk_buff *skb; +-+ struct brcmf_if *ifp; +- +- event = (struct msgbuf_rx_event *)buf; +- idx = le32_to_cpu(event->msg.request_id); +-@@ -1116,7 +1102,19 @@ static void brcmf_msgbuf_process_event(s +- +- skb_trim(skb, buflen); +- +-- brcmf_msgbuf_rx_skb(msgbuf, skb, event->msg.ifidx); +-+ ifp = brcmf_get_ifp(msgbuf->drvr, event->msg.ifidx); +-+ if (!ifp || !ifp->ndev) { +-+ brcmf_err("Received pkt for invalid ifidx %d\n", +-+ event->msg.ifidx); +-+ goto exit; +-+ } +-+ +-+ skb->protocol = eth_type_trans(skb, ifp->ndev); +-+ +-+ brcmf_fweh_process_skb(ifp->drvr, skb); +-+ +-+exit: +-+ brcmu_pkt_buf_free_skb(skb); +- } +- +- +-@@ -1128,6 +1126,7 @@ brcmf_msgbuf_process_rx_complete(struct +- u16 data_offset; +- u16 buflen; +- u32 idx; +-+ struct brcmf_if *ifp; +- +- brcmf_msgbuf_update_rxbufpost_count(msgbuf, 1); +- +-@@ -1148,7 +1147,14 @@ brcmf_msgbuf_process_rx_complete(struct +- +- skb_trim(skb, buflen); +- +-- brcmf_msgbuf_rx_skb(msgbuf, skb, rx_complete->msg.ifidx); +-+ ifp = brcmf_get_ifp(msgbuf->drvr, rx_complete->msg.ifidx); +-+ if (!ifp || !ifp->ndev) { +-+ brcmf_err("Received pkt for invalid ifidx %d\n", +-+ rx_complete->msg.ifidx); +-+ brcmu_pkt_buf_free_skb(skb); +-+ return; +-+ } +-+ brcmf_netif_rx(ifp, skb, false); +- } +- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -1294,6 +1294,17 @@ static inline u8 brcmf_sdio_getdatoffset +- return (u8)((hdrvalue & SDPCM_DOFFSET_MASK) >> SDPCM_DOFFSET_SHIFT); +- } +- +-+static inline bool brcmf_sdio_fromevntchan(u8 *swheader) +-+{ +-+ u32 hdrvalue; +-+ u8 ret; +-+ +-+ hdrvalue = *(u32 *)swheader; +-+ ret = (u8)((hdrvalue & SDPCM_CHANNEL_MASK) >> SDPCM_CHANNEL_SHIFT); +-+ +-+ return (ret == SDPCM_EVENT_CHANNEL); +-+} +-+ +- static int brcmf_sdio_hdparse(struct brcmf_sdio *bus, u8 *header, +- struct brcmf_sdio_hdrinfo *rd, +- enum brcmf_sdio_frmtype type) +-@@ -1641,7 +1652,11 @@ static u8 brcmf_sdio_rxglom(struct brcmf +- pfirst->len, pfirst->next, +- pfirst->prev); +- skb_unlink(pfirst, &bus->glom); +-- brcmf_rx_frame(bus->sdiodev->dev, pfirst); +-+ if (brcmf_sdio_fromevntchan(pfirst->data)) +-+ brcmf_rx_event(bus->sdiodev->dev, pfirst); +-+ else +-+ brcmf_rx_frame(bus->sdiodev->dev, pfirst, +-+ false); +- bus->sdcnt.rxglompkts++; +- } +- +-@@ -1967,18 +1982,19 @@ static uint brcmf_sdio_readframes(struct +- __skb_trim(pkt, rd->len); +- skb_pull(pkt, rd->dat_offset); +- +-+ if (pkt->len == 0) +-+ brcmu_pkt_buf_free_skb(pkt); +-+ else if (rd->channel == SDPCM_EVENT_CHANNEL) +-+ brcmf_rx_event(bus->sdiodev->dev, pkt); +-+ else +-+ brcmf_rx_frame(bus->sdiodev->dev, pkt, +-+ false); +-+ +- /* prepare the descriptor for the next read */ +- rd->len = rd->len_nxtfrm << 4; +- rd->len_nxtfrm = 0; +- /* treat all packet as event if we don't know */ +- rd->channel = SDPCM_EVENT_CHANNEL; +-- +-- if (pkt->len == 0) { +-- brcmu_pkt_buf_free_skb(pkt); +-- continue; +-- } +-- +-- brcmf_rx_frame(bus->sdiodev->dev, pkt); +- } +- +- rxcount = maxframes - rxleft; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-@@ -514,7 +514,7 @@ static void brcmf_usb_rx_complete(struct +- +- if (devinfo->bus_pub.state == BRCMFMAC_USB_STATE_UP) { +- skb_put(skb, urb->actual_length); +-- brcmf_rx_frame(devinfo->dev, skb); +-+ brcmf_rx_frame(devinfo->dev, skb, true); +- brcmf_usb_rx_refill(devinfo, req); +- } else { +- brcmu_pkt_buf_free_skb(skb); +diff --git a/package/kernel/mac80211/patches/349-0006-brcmfmac-cleanup-ampdu-rx-host-reorder-code.patch b/package/kernel/mac80211/patches/349-0006-brcmfmac-cleanup-ampdu-rx-host-reorder-code.patch +deleted file mode 100644 +index 33b263d..0000000 +--- a/package/kernel/mac80211/patches/349-0006-brcmfmac-cleanup-ampdu-rx-host-reorder-code.patch ++++ /dev/null +@@ -1,585 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 11 Apr 2016 11:35:26 +0200 +-Subject: [PATCH] brcmfmac: cleanup ampdu-rx host reorder code +- +-The code for ampdu-rx host reorder is related to the firmware signalling +-supported in BCDC protocol. This change moves the code to fwsignal module. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +-@@ -351,6 +351,12 @@ brcmf_proto_bcdc_add_tdls_peer(struct br +- { +- } +- +-+static void brcmf_proto_bcdc_rxreorder(struct brcmf_if *ifp, +-+ struct sk_buff *skb) +-+{ +-+ brcmf_fws_rxreorder(ifp, skb); +-+} +-+ +- int brcmf_proto_bcdc_attach(struct brcmf_pub *drvr) +- { +- struct brcmf_bcdc *bcdc; +-@@ -372,6 +378,7 @@ int brcmf_proto_bcdc_attach(struct brcmf +- drvr->proto->configure_addr_mode = brcmf_proto_bcdc_configure_addr_mode; +- drvr->proto->delete_peer = brcmf_proto_bcdc_delete_peer; +- drvr->proto->add_tdls_peer = brcmf_proto_bcdc_add_tdls_peer; +-+ drvr->proto->rxreorder = brcmf_proto_bcdc_rxreorder; +- drvr->proto->pd = bcdc; +- +- drvr->hdrlen += BCDC_HEADER_LEN + BRCMF_PROT_FW_SIGNAL_MAX_TXBYTES; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -40,19 +40,6 @@ +- +- #define MAX_WAIT_FOR_8021X_TX msecs_to_jiffies(950) +- +--/* AMPDU rx reordering definitions */ +--#define BRCMF_RXREORDER_FLOWID_OFFSET 0 +--#define BRCMF_RXREORDER_MAXIDX_OFFSET 2 +--#define BRCMF_RXREORDER_FLAGS_OFFSET 4 +--#define BRCMF_RXREORDER_CURIDX_OFFSET 6 +--#define BRCMF_RXREORDER_EXPIDX_OFFSET 8 +-- +--#define BRCMF_RXREORDER_DEL_FLOW 0x01 +--#define BRCMF_RXREORDER_FLUSH_ALL 0x02 +--#define BRCMF_RXREORDER_CURIDX_VALID 0x04 +--#define BRCMF_RXREORDER_EXPIDX_VALID 0x08 +--#define BRCMF_RXREORDER_NEW_HOLE 0x10 +-- +- #define BRCMF_BSSIDX_INVALID -1 +- +- char *brcmf_ifname(struct brcmf_if *ifp) +-@@ -342,207 +329,11 @@ void brcmf_netif_rx(struct brcmf_if *ifp +- netif_rx_ni(skb); +- } +- +--static void brcmf_rxreorder_get_skb_list(struct brcmf_ampdu_rx_reorder *rfi, +-- u8 start, u8 end, +-- struct sk_buff_head *skb_list) +--{ +-- /* initialize return list */ +-- __skb_queue_head_init(skb_list); +-- +-- if (rfi->pend_pkts == 0) { +-- brcmf_dbg(INFO, "no packets in reorder queue\n"); +-- return; +-- } +-- +-- do { +-- if (rfi->pktslots[start]) { +-- __skb_queue_tail(skb_list, rfi->pktslots[start]); +-- rfi->pktslots[start] = NULL; +-- } +-- start++; +-- if (start > rfi->max_idx) +-- start = 0; +-- } while (start != end); +-- rfi->pend_pkts -= skb_queue_len(skb_list); +--} +-- +--static void brcmf_rxreorder_process_info(struct brcmf_if *ifp, u8 *reorder_data, +-- struct sk_buff *pkt) +--{ +-- u8 flow_id, max_idx, cur_idx, exp_idx, end_idx; +-- struct brcmf_ampdu_rx_reorder *rfi; +-- struct sk_buff_head reorder_list; +-- struct sk_buff *pnext; +-- u8 flags; +-- u32 buf_size; +-- +-- flow_id = reorder_data[BRCMF_RXREORDER_FLOWID_OFFSET]; +-- flags = reorder_data[BRCMF_RXREORDER_FLAGS_OFFSET]; +-- +-- /* validate flags and flow id */ +-- if (flags == 0xFF) { +-- brcmf_err("invalid flags...so ignore this packet\n"); +-- brcmf_netif_rx(ifp, pkt, false); +-- return; +-- } +-- +-- rfi = ifp->drvr->reorder_flows[flow_id]; +-- if (flags & BRCMF_RXREORDER_DEL_FLOW) { +-- brcmf_dbg(INFO, "flow-%d: delete\n", +-- flow_id); +-- +-- if (rfi == NULL) { +-- brcmf_dbg(INFO, "received flags to cleanup, but no flow (%d) yet\n", +-- flow_id); +-- brcmf_netif_rx(ifp, pkt, false); +-- return; +-- } +-- +-- brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, rfi->exp_idx, +-- &reorder_list); +-- /* add the last packet */ +-- __skb_queue_tail(&reorder_list, pkt); +-- kfree(rfi); +-- ifp->drvr->reorder_flows[flow_id] = NULL; +-- goto netif_rx; +-- } +-- /* from here on we need a flow reorder instance */ +-- if (rfi == NULL) { +-- buf_size = sizeof(*rfi); +-- max_idx = reorder_data[BRCMF_RXREORDER_MAXIDX_OFFSET]; +-- +-- buf_size += (max_idx + 1) * sizeof(pkt); +-- +-- /* allocate space for flow reorder info */ +-- brcmf_dbg(INFO, "flow-%d: start, maxidx %d\n", +-- flow_id, max_idx); +-- rfi = kzalloc(buf_size, GFP_ATOMIC); +-- if (rfi == NULL) { +-- brcmf_err("failed to alloc buffer\n"); +-- brcmf_netif_rx(ifp, pkt, false); +-- return; +-- } +-- +-- ifp->drvr->reorder_flows[flow_id] = rfi; +-- rfi->pktslots = (struct sk_buff **)(rfi+1); +-- rfi->max_idx = max_idx; +-- } +-- if (flags & BRCMF_RXREORDER_NEW_HOLE) { +-- if (rfi->pend_pkts) { +-- brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, +-- rfi->exp_idx, +-- &reorder_list); +-- WARN_ON(rfi->pend_pkts); +-- } else { +-- __skb_queue_head_init(&reorder_list); +-- } +-- rfi->cur_idx = reorder_data[BRCMF_RXREORDER_CURIDX_OFFSET]; +-- rfi->exp_idx = reorder_data[BRCMF_RXREORDER_EXPIDX_OFFSET]; +-- rfi->max_idx = reorder_data[BRCMF_RXREORDER_MAXIDX_OFFSET]; +-- rfi->pktslots[rfi->cur_idx] = pkt; +-- rfi->pend_pkts++; +-- brcmf_dbg(DATA, "flow-%d: new hole %d (%d), pending %d\n", +-- flow_id, rfi->cur_idx, rfi->exp_idx, rfi->pend_pkts); +-- } else if (flags & BRCMF_RXREORDER_CURIDX_VALID) { +-- cur_idx = reorder_data[BRCMF_RXREORDER_CURIDX_OFFSET]; +-- exp_idx = reorder_data[BRCMF_RXREORDER_EXPIDX_OFFSET]; +-- +-- if ((exp_idx == rfi->exp_idx) && (cur_idx != rfi->exp_idx)) { +-- /* still in the current hole */ +-- /* enqueue the current on the buffer chain */ +-- if (rfi->pktslots[cur_idx] != NULL) { +-- brcmf_dbg(INFO, "HOLE: ERROR buffer pending..free it\n"); +-- brcmu_pkt_buf_free_skb(rfi->pktslots[cur_idx]); +-- rfi->pktslots[cur_idx] = NULL; +-- } +-- rfi->pktslots[cur_idx] = pkt; +-- rfi->pend_pkts++; +-- rfi->cur_idx = cur_idx; +-- brcmf_dbg(DATA, "flow-%d: store pkt %d (%d), pending %d\n", +-- flow_id, cur_idx, exp_idx, rfi->pend_pkts); +-- +-- /* can return now as there is no reorder +-- * list to process. +-- */ +-- return; +-- } +-- if (rfi->exp_idx == cur_idx) { +-- if (rfi->pktslots[cur_idx] != NULL) { +-- brcmf_dbg(INFO, "error buffer pending..free it\n"); +-- brcmu_pkt_buf_free_skb(rfi->pktslots[cur_idx]); +-- rfi->pktslots[cur_idx] = NULL; +-- } +-- rfi->pktslots[cur_idx] = pkt; +-- rfi->pend_pkts++; +-- +-- /* got the expected one. flush from current to expected +-- * and update expected +-- */ +-- brcmf_dbg(DATA, "flow-%d: expected %d (%d), pending %d\n", +-- flow_id, cur_idx, exp_idx, rfi->pend_pkts); +-- +-- rfi->cur_idx = cur_idx; +-- rfi->exp_idx = exp_idx; +-- +-- brcmf_rxreorder_get_skb_list(rfi, cur_idx, exp_idx, +-- &reorder_list); +-- brcmf_dbg(DATA, "flow-%d: freeing buffers %d, pending %d\n", +-- flow_id, skb_queue_len(&reorder_list), +-- rfi->pend_pkts); +-- } else { +-- u8 end_idx; +-- +-- brcmf_dbg(DATA, "flow-%d (0x%x): both moved, old %d/%d, new %d/%d\n", +-- flow_id, flags, rfi->cur_idx, rfi->exp_idx, +-- cur_idx, exp_idx); +-- if (flags & BRCMF_RXREORDER_FLUSH_ALL) +-- end_idx = rfi->exp_idx; +-- else +-- end_idx = exp_idx; +-- +-- /* flush pkts first */ +-- brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, end_idx, +-- &reorder_list); +-- +-- if (exp_idx == ((cur_idx + 1) % (rfi->max_idx + 1))) { +-- __skb_queue_tail(&reorder_list, pkt); +-- } else { +-- rfi->pktslots[cur_idx] = pkt; +-- rfi->pend_pkts++; +-- } +-- rfi->exp_idx = exp_idx; +-- rfi->cur_idx = cur_idx; +-- } +-- } else { +-- /* explicity window move updating the expected index */ +-- exp_idx = reorder_data[BRCMF_RXREORDER_EXPIDX_OFFSET]; +-- +-- brcmf_dbg(DATA, "flow-%d (0x%x): change expected: %d -> %d\n", +-- flow_id, flags, rfi->exp_idx, exp_idx); +-- if (flags & BRCMF_RXREORDER_FLUSH_ALL) +-- end_idx = rfi->exp_idx; +-- else +-- end_idx = exp_idx; +-- +-- brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, end_idx, +-- &reorder_list); +-- __skb_queue_tail(&reorder_list, pkt); +-- /* set the new expected idx */ +-- rfi->exp_idx = exp_idx; +-- } +--netif_rx: +-- skb_queue_walk_safe(&reorder_list, pkt, pnext) { +-- __skb_unlink(pkt, &reorder_list); +-- brcmf_netif_rx(ifp, pkt, false); +-- } +--} +-- +- void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_evnt) +- { +- struct brcmf_if *ifp; +- struct brcmf_bus *bus_if = dev_get_drvdata(dev); +- struct brcmf_pub *drvr = bus_if->drvr; +-- struct brcmf_skb_reorder_data *rd; +- int ret; +- +- brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb); +-@@ -557,9 +348,8 @@ void brcmf_rx_frame(struct device *dev, +- return; +- } +- +-- rd = (struct brcmf_skb_reorder_data *)skb->cb; +-- if (rd->reorder) +-- brcmf_rxreorder_process_info(ifp, rd->reorder, skb); +-+ if (brcmf_proto_is_reorder_skb(skb)) +-+ brcmf_proto_rxreorder(ifp, skb); +- else +- brcmf_netif_rx(ifp, skb, handle_evnt); +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -208,10 +208,6 @@ struct brcmf_if { +- u8 ipv6addr_idx; +- }; +- +--struct brcmf_skb_reorder_data { +-- u8 *reorder; +--}; +-- +- int brcmf_netdev_wait_pend8021x(struct brcmf_if *ifp); +- +- /* Return pointer to interface name */ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-@@ -92,6 +92,19 @@ enum brcmf_fws_tlv_len { +- }; +- #undef BRCMF_FWS_TLV_DEF +- +-+/* AMPDU rx reordering definitions */ +-+#define BRCMF_RXREORDER_FLOWID_OFFSET 0 +-+#define BRCMF_RXREORDER_MAXIDX_OFFSET 2 +-+#define BRCMF_RXREORDER_FLAGS_OFFSET 4 +-+#define BRCMF_RXREORDER_CURIDX_OFFSET 6 +-+#define BRCMF_RXREORDER_EXPIDX_OFFSET 8 +-+ +-+#define BRCMF_RXREORDER_DEL_FLOW 0x01 +-+#define BRCMF_RXREORDER_FLUSH_ALL 0x02 +-+#define BRCMF_RXREORDER_CURIDX_VALID 0x04 +-+#define BRCMF_RXREORDER_EXPIDX_VALID 0x08 +-+#define BRCMF_RXREORDER_NEW_HOLE 0x10 +-+ +- #ifdef DEBUG +- /* +- * brcmf_fws_tlv_names - array of tlv names. +-@@ -1614,6 +1627,202 @@ static int brcmf_fws_notify_bcmc_credit_ +- return 0; +- } +- +-+static void brcmf_rxreorder_get_skb_list(struct brcmf_ampdu_rx_reorder *rfi, +-+ u8 start, u8 end, +-+ struct sk_buff_head *skb_list) +-+{ +-+ /* initialize return list */ +-+ __skb_queue_head_init(skb_list); +-+ +-+ if (rfi->pend_pkts == 0) { +-+ brcmf_dbg(INFO, "no packets in reorder queue\n"); +-+ return; +-+ } +-+ +-+ do { +-+ if (rfi->pktslots[start]) { +-+ __skb_queue_tail(skb_list, rfi->pktslots[start]); +-+ rfi->pktslots[start] = NULL; +-+ } +-+ start++; +-+ if (start > rfi->max_idx) +-+ start = 0; +-+ } while (start != end); +-+ rfi->pend_pkts -= skb_queue_len(skb_list); +-+} +-+ +-+void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *pkt) +-+{ +-+ u8 *reorder_data; +-+ u8 flow_id, max_idx, cur_idx, exp_idx, end_idx; +-+ struct brcmf_ampdu_rx_reorder *rfi; +-+ struct sk_buff_head reorder_list; +-+ struct sk_buff *pnext; +-+ u8 flags; +-+ u32 buf_size; +-+ +-+ reorder_data = ((struct brcmf_skb_reorder_data *)pkt->cb)->reorder; +-+ flow_id = reorder_data[BRCMF_RXREORDER_FLOWID_OFFSET]; +-+ flags = reorder_data[BRCMF_RXREORDER_FLAGS_OFFSET]; +-+ +-+ /* validate flags and flow id */ +-+ if (flags == 0xFF) { +-+ brcmf_err("invalid flags...so ignore this packet\n"); +-+ brcmf_netif_rx(ifp, pkt, false); +-+ return; +-+ } +-+ +-+ rfi = ifp->drvr->reorder_flows[flow_id]; +-+ if (flags & BRCMF_RXREORDER_DEL_FLOW) { +-+ brcmf_dbg(INFO, "flow-%d: delete\n", +-+ flow_id); +-+ +-+ if (rfi == NULL) { +-+ brcmf_dbg(INFO, "received flags to cleanup, but no flow (%d) yet\n", +-+ flow_id); +-+ brcmf_netif_rx(ifp, pkt, false); +-+ return; +-+ } +-+ +-+ brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, rfi->exp_idx, +-+ &reorder_list); +-+ /* add the last packet */ +-+ __skb_queue_tail(&reorder_list, pkt); +-+ kfree(rfi); +-+ ifp->drvr->reorder_flows[flow_id] = NULL; +-+ goto netif_rx; +-+ } +-+ /* from here on we need a flow reorder instance */ +-+ if (rfi == NULL) { +-+ buf_size = sizeof(*rfi); +-+ max_idx = reorder_data[BRCMF_RXREORDER_MAXIDX_OFFSET]; +-+ +-+ buf_size += (max_idx + 1) * sizeof(pkt); +-+ +-+ /* allocate space for flow reorder info */ +-+ brcmf_dbg(INFO, "flow-%d: start, maxidx %d\n", +-+ flow_id, max_idx); +-+ rfi = kzalloc(buf_size, GFP_ATOMIC); +-+ if (rfi == NULL) { +-+ brcmf_err("failed to alloc buffer\n"); +-+ brcmf_netif_rx(ifp, pkt, false); +-+ return; +-+ } +-+ +-+ ifp->drvr->reorder_flows[flow_id] = rfi; +-+ rfi->pktslots = (struct sk_buff **)(rfi + 1); +-+ rfi->max_idx = max_idx; +-+ } +-+ if (flags & BRCMF_RXREORDER_NEW_HOLE) { +-+ if (rfi->pend_pkts) { +-+ brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, +-+ rfi->exp_idx, +-+ &reorder_list); +-+ WARN_ON(rfi->pend_pkts); +-+ } else { +-+ __skb_queue_head_init(&reorder_list); +-+ } +-+ rfi->cur_idx = reorder_data[BRCMF_RXREORDER_CURIDX_OFFSET]; +-+ rfi->exp_idx = reorder_data[BRCMF_RXREORDER_EXPIDX_OFFSET]; +-+ rfi->max_idx = reorder_data[BRCMF_RXREORDER_MAXIDX_OFFSET]; +-+ rfi->pktslots[rfi->cur_idx] = pkt; +-+ rfi->pend_pkts++; +-+ brcmf_dbg(DATA, "flow-%d: new hole %d (%d), pending %d\n", +-+ flow_id, rfi->cur_idx, rfi->exp_idx, rfi->pend_pkts); +-+ } else if (flags & BRCMF_RXREORDER_CURIDX_VALID) { +-+ cur_idx = reorder_data[BRCMF_RXREORDER_CURIDX_OFFSET]; +-+ exp_idx = reorder_data[BRCMF_RXREORDER_EXPIDX_OFFSET]; +-+ +-+ if ((exp_idx == rfi->exp_idx) && (cur_idx != rfi->exp_idx)) { +-+ /* still in the current hole */ +-+ /* enqueue the current on the buffer chain */ +-+ if (rfi->pktslots[cur_idx] != NULL) { +-+ brcmf_dbg(INFO, "HOLE: ERROR buffer pending..free it\n"); +-+ brcmu_pkt_buf_free_skb(rfi->pktslots[cur_idx]); +-+ rfi->pktslots[cur_idx] = NULL; +-+ } +-+ rfi->pktslots[cur_idx] = pkt; +-+ rfi->pend_pkts++; +-+ rfi->cur_idx = cur_idx; +-+ brcmf_dbg(DATA, "flow-%d: store pkt %d (%d), pending %d\n", +-+ flow_id, cur_idx, exp_idx, rfi->pend_pkts); +-+ +-+ /* can return now as there is no reorder +-+ * list to process. +-+ */ +-+ return; +-+ } +-+ if (rfi->exp_idx == cur_idx) { +-+ if (rfi->pktslots[cur_idx] != NULL) { +-+ brcmf_dbg(INFO, "error buffer pending..free it\n"); +-+ brcmu_pkt_buf_free_skb(rfi->pktslots[cur_idx]); +-+ rfi->pktslots[cur_idx] = NULL; +-+ } +-+ rfi->pktslots[cur_idx] = pkt; +-+ rfi->pend_pkts++; +-+ +-+ /* got the expected one. flush from current to expected +-+ * and update expected +-+ */ +-+ brcmf_dbg(DATA, "flow-%d: expected %d (%d), pending %d\n", +-+ flow_id, cur_idx, exp_idx, rfi->pend_pkts); +-+ +-+ rfi->cur_idx = cur_idx; +-+ rfi->exp_idx = exp_idx; +-+ +-+ brcmf_rxreorder_get_skb_list(rfi, cur_idx, exp_idx, +-+ &reorder_list); +-+ brcmf_dbg(DATA, "flow-%d: freeing buffers %d, pending %d\n", +-+ flow_id, skb_queue_len(&reorder_list), +-+ rfi->pend_pkts); +-+ } else { +-+ u8 end_idx; +-+ +-+ brcmf_dbg(DATA, "flow-%d (0x%x): both moved, old %d/%d, new %d/%d\n", +-+ flow_id, flags, rfi->cur_idx, rfi->exp_idx, +-+ cur_idx, exp_idx); +-+ if (flags & BRCMF_RXREORDER_FLUSH_ALL) +-+ end_idx = rfi->exp_idx; +-+ else +-+ end_idx = exp_idx; +-+ +-+ /* flush pkts first */ +-+ brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, end_idx, +-+ &reorder_list); +-+ +-+ if (exp_idx == ((cur_idx + 1) % (rfi->max_idx + 1))) { +-+ __skb_queue_tail(&reorder_list, pkt); +-+ } else { +-+ rfi->pktslots[cur_idx] = pkt; +-+ rfi->pend_pkts++; +-+ } +-+ rfi->exp_idx = exp_idx; +-+ rfi->cur_idx = cur_idx; +-+ } +-+ } else { +-+ /* explicity window move updating the expected index */ +-+ exp_idx = reorder_data[BRCMF_RXREORDER_EXPIDX_OFFSET]; +-+ +-+ brcmf_dbg(DATA, "flow-%d (0x%x): change expected: %d -> %d\n", +-+ flow_id, flags, rfi->exp_idx, exp_idx); +-+ if (flags & BRCMF_RXREORDER_FLUSH_ALL) +-+ end_idx = rfi->exp_idx; +-+ else +-+ end_idx = exp_idx; +-+ +-+ brcmf_rxreorder_get_skb_list(rfi, rfi->exp_idx, end_idx, +-+ &reorder_list); +-+ __skb_queue_tail(&reorder_list, pkt); +-+ /* set the new expected idx */ +-+ rfi->exp_idx = exp_idx; +-+ } +-+netif_rx: +-+ skb_queue_walk_safe(&reorder_list, pkt, pnext) { +-+ __skb_unlink(pkt, &reorder_list); +-+ brcmf_netif_rx(ifp, pkt, false); +-+ } +-+} +-+ +- void brcmf_fws_hdrpull(struct brcmf_if *ifp, s16 siglen, struct sk_buff *skb) +- { +- struct brcmf_skb_reorder_data *rd; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.h +-@@ -29,5 +29,6 @@ void brcmf_fws_add_interface(struct brcm +- void brcmf_fws_del_interface(struct brcmf_if *ifp); +- void brcmf_fws_bustxfail(struct brcmf_fws_info *fws, struct sk_buff *skb); +- void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked); +-+void brcmf_fws_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb); +- +- #endif /* FWSIGNAL_H_ */ +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-@@ -527,6 +527,9 @@ static int brcmf_msgbuf_hdrpull(struct b +- return -ENODEV; +- } +- +-+static void brcmf_msgbuf_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb) +-+{ +-+} +- +- static void +- brcmf_msgbuf_remove_flowring(struct brcmf_msgbuf *msgbuf, u16 flowid) +-@@ -1466,6 +1469,7 @@ int brcmf_proto_msgbuf_attach(struct brc +- drvr->proto->configure_addr_mode = brcmf_msgbuf_configure_addr_mode; +- drvr->proto->delete_peer = brcmf_msgbuf_delete_peer; +- drvr->proto->add_tdls_peer = brcmf_msgbuf_add_tdls_peer; +-+ drvr->proto->rxreorder = brcmf_msgbuf_rxreorder; +- drvr->proto->pd = msgbuf; +- +- init_waitqueue_head(&msgbuf->ioctl_resp_wait); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/proto.h +-@@ -22,6 +22,9 @@ enum proto_addr_mode { +- ADDR_DIRECT +- }; +- +-+struct brcmf_skb_reorder_data { +-+ u8 *reorder; +-+}; +- +- struct brcmf_proto { +- int (*hdrpull)(struct brcmf_pub *drvr, bool do_fws, +-@@ -38,6 +41,7 @@ struct brcmf_proto { +- u8 peer[ETH_ALEN]); +- void (*add_tdls_peer)(struct brcmf_pub *drvr, int ifidx, +- u8 peer[ETH_ALEN]); +-+ void (*rxreorder)(struct brcmf_if *ifp, struct sk_buff *skb); +- void *pd; +- }; +- +-@@ -91,6 +95,18 @@ brcmf_proto_add_tdls_peer(struct brcmf_p +- { +- drvr->proto->add_tdls_peer(drvr, ifidx, peer); +- } +-+static inline bool brcmf_proto_is_reorder_skb(struct sk_buff *skb) +-+{ +-+ struct brcmf_skb_reorder_data *rd; +-+ +-+ rd = (struct brcmf_skb_reorder_data *)skb->cb; +-+ return !!rd->reorder; +-+} +- +-+static inline void +-+brcmf_proto_rxreorder(struct brcmf_if *ifp, struct sk_buff *skb) +-+{ +-+ ifp->drvr->proto->rxreorder(ifp, skb); +-+} +- +- #endif /* BRCMFMAC_PROTO_H */ +diff --git a/package/kernel/mac80211/patches/349-0007-brcmfmac-revise-handling-events-in-receive-path.patch b/package/kernel/mac80211/patches/349-0007-brcmfmac-revise-handling-events-in-receive-path.patch +deleted file mode 100644 +index a43feff..0000000 +--- a/package/kernel/mac80211/patches/349-0007-brcmfmac-revise-handling-events-in-receive-path.patch ++++ /dev/null +@@ -1,139 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 11 Apr 2016 11:35:27 +0200 +-Subject: [PATCH] brcmfmac: revise handling events in receive path +- +-Move event handling out of brcmf_netif_rx() avoiding the need +-to pass a flag. This flag is only ever true for USB hosts as +-other interface use separate brcmf_rx_event() function. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +-@@ -216,7 +216,7 @@ bool brcmf_c_prec_enq(struct device *dev +- int prec); +- +- /* Receive frame for delivery to OS. Callee disposes of rxp. */ +--void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_evnt); +-+void brcmf_rx_frame(struct device *dev, struct sk_buff *rxp, bool handle_event); +- /* Receive async event packet from firmware. Callee disposes of rxp. */ +- void brcmf_rx_event(struct device *dev, struct sk_buff *rxp); +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -298,18 +298,11 @@ void brcmf_txflowblock(struct device *de +- brcmf_fws_bus_blocked(drvr, state); +- } +- +--void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb, +-- bool handle_event) +-+void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb) +- { +-- skb->protocol = eth_type_trans(skb, ifp->ndev); +-- +- if (skb->pkt_type == PACKET_MULTICAST) +- ifp->stats.multicast++; +- +-- /* Process special event packets */ +-- if (handle_event) +-- brcmf_fweh_process_skb(ifp->drvr, skb); +-- +- if (!(ifp->ndev->flags & IFF_UP)) { +- brcmu_pkt_buf_free_skb(skb); +- return; +-@@ -329,7 +322,7 @@ void brcmf_netif_rx(struct brcmf_if *ifp +- netif_rx_ni(skb); +- } +- +--void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_evnt) +-+void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event) +- { +- struct brcmf_if *ifp; +- struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-@@ -348,10 +341,17 @@ void brcmf_rx_frame(struct device *dev, +- return; +- } +- +-- if (brcmf_proto_is_reorder_skb(skb)) +-+ skb->protocol = eth_type_trans(skb, ifp->ndev); +-+ +-+ if (brcmf_proto_is_reorder_skb(skb)) { +- brcmf_proto_rxreorder(ifp, skb); +-- else +-- brcmf_netif_rx(ifp, skb, handle_evnt); +-+ } else { +-+ /* Process special event packets */ +-+ if (handle_event) +-+ brcmf_fweh_process_skb(ifp->drvr, skb); +-+ +-+ brcmf_netif_rx(ifp, skb); +-+ } +- } +- +- void brcmf_rx_event(struct device *dev, struct sk_buff *skb) +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -221,8 +221,7 @@ int brcmf_get_next_free_bsscfgidx(struct +- void brcmf_txflowblock_if(struct brcmf_if *ifp, +- enum brcmf_netif_stop_reason reason, bool state); +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +--void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb, +-- bool handle_event); +-+void brcmf_netif_rx(struct brcmf_if *ifp, struct sk_buff *skb); +- void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on); +- int __init brcmf_core_init(void); +- void __exit brcmf_core_exit(void); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-@@ -1668,7 +1668,7 @@ void brcmf_fws_rxreorder(struct brcmf_if +- /* validate flags and flow id */ +- if (flags == 0xFF) { +- brcmf_err("invalid flags...so ignore this packet\n"); +-- brcmf_netif_rx(ifp, pkt, false); +-+ brcmf_netif_rx(ifp, pkt); +- return; +- } +- +-@@ -1680,7 +1680,7 @@ void brcmf_fws_rxreorder(struct brcmf_if +- if (rfi == NULL) { +- brcmf_dbg(INFO, "received flags to cleanup, but no flow (%d) yet\n", +- flow_id); +-- brcmf_netif_rx(ifp, pkt, false); +-+ brcmf_netif_rx(ifp, pkt); +- return; +- } +- +-@@ -1705,7 +1705,7 @@ void brcmf_fws_rxreorder(struct brcmf_if +- rfi = kzalloc(buf_size, GFP_ATOMIC); +- if (rfi == NULL) { +- brcmf_err("failed to alloc buffer\n"); +-- brcmf_netif_rx(ifp, pkt, false); +-+ brcmf_netif_rx(ifp, pkt); +- return; +- } +- +-@@ -1819,7 +1819,7 @@ void brcmf_fws_rxreorder(struct brcmf_if +- netif_rx: +- skb_queue_walk_safe(&reorder_list, pkt, pnext) { +- __skb_unlink(pkt, &reorder_list); +-- brcmf_netif_rx(ifp, pkt, false); +-+ brcmf_netif_rx(ifp, pkt); +- } +- } +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-@@ -1157,7 +1157,7 @@ brcmf_msgbuf_process_rx_complete(struct +- brcmu_pkt_buf_free_skb(skb); +- return; +- } +-- brcmf_netif_rx(ifp, skb, false); +-+ brcmf_netif_rx(ifp, skb); +- } +- +- +diff --git a/package/kernel/mac80211/patches/349-0008-brcmfmac-create-common-function-for-handling-brcmf_p.patch b/package/kernel/mac80211/patches/349-0008-brcmfmac-create-common-function-for-handling-brcmf_p.patch +deleted file mode 100644 +index 08ea235..0000000 +--- a/package/kernel/mac80211/patches/349-0008-brcmfmac-create-common-function-for-handling-brcmf_p.patch ++++ /dev/null +@@ -1,88 +0,0 @@ +-From: Arend van Spriel +-Date: Mon, 11 Apr 2016 11:35:28 +0200 +-Subject: [PATCH] brcmfmac: create common function for handling +- brcmf_proto_hdrpull() +- +-In receive path brcmf_proto_hdrpull() needs to be called and handled +-similar in brcmf_rx_frame() and brcmf_rx_event(). Move that duplicated +-code in separate function. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -322,26 +322,35 @@ void brcmf_netif_rx(struct brcmf_if *ifp +- netif_rx_ni(skb); +- } +- +--void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event) +-+static int brcmf_rx_hdrpull(struct brcmf_pub *drvr, struct sk_buff *skb, +-+ struct brcmf_if **ifp) +- { +-- struct brcmf_if *ifp; +-- struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-- struct brcmf_pub *drvr = bus_if->drvr; +- int ret; +- +-- brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb); +-- +- /* process and remove protocol-specific header */ +-- ret = brcmf_proto_hdrpull(drvr, true, skb, &ifp); +-+ ret = brcmf_proto_hdrpull(drvr, true, skb, ifp); +- +-- if (ret || !ifp || !ifp->ndev) { +-+ if (ret || !(*ifp) || !(*ifp)->ndev) { +- if (ret != -ENODATA && ifp) +-- ifp->stats.rx_errors++; +-+ (*ifp)->stats.rx_errors++; +- brcmu_pkt_buf_free_skb(skb); +-- return; +-+ return -ENODATA; +- } +- +-- skb->protocol = eth_type_trans(skb, ifp->ndev); +-+ skb->protocol = eth_type_trans(skb, (*ifp)->ndev); +-+ return 0; +-+} +-+ +-+void brcmf_rx_frame(struct device *dev, struct sk_buff *skb, bool handle_event) +-+{ +-+ struct brcmf_if *ifp; +-+ struct brcmf_bus *bus_if = dev_get_drvdata(dev); +-+ struct brcmf_pub *drvr = bus_if->drvr; +-+ +-+ brcmf_dbg(DATA, "Enter: %s: rxp=%p\n", dev_name(dev), skb); +-+ +-+ if (brcmf_rx_hdrpull(drvr, skb, &ifp)) +-+ return; +- +- if (brcmf_proto_is_reorder_skb(skb)) { +- brcmf_proto_rxreorder(ifp, skb); +-@@ -359,21 +368,11 @@ void brcmf_rx_event(struct device *dev, +- struct brcmf_if *ifp; +- struct brcmf_bus *bus_if = dev_get_drvdata(dev); +- struct brcmf_pub *drvr = bus_if->drvr; +-- int ret; +- +- brcmf_dbg(EVENT, "Enter: %s: rxp=%p\n", dev_name(dev), skb); +- +-- /* process and remove protocol-specific header */ +-- ret = brcmf_proto_hdrpull(drvr, true, skb, &ifp); +-- +-- if (ret || !ifp || !ifp->ndev) { +-- if (ret != -ENODATA && ifp) +-- ifp->stats.rx_errors++; +-- brcmu_pkt_buf_free_skb(skb); +-+ if (brcmf_rx_hdrpull(drvr, skb, &ifp)) +- return; +-- } +-- +-- skb->protocol = eth_type_trans(skb, ifp->ndev); +- +- brcmf_fweh_process_skb(ifp->drvr, skb); +- brcmu_pkt_buf_free_skb(skb); +diff --git a/package/kernel/mac80211/patches/351-0005-brcmfmac-rework-function-picking-free-BSS-index.patch b/package/kernel/mac80211/patches/351-0005-brcmfmac-rework-function-picking-free-BSS-index.patch +deleted file mode 100644 +index c602f22..0000000 +--- a/package/kernel/mac80211/patches/351-0005-brcmfmac-rework-function-picking-free-BSS-index.patch ++++ /dev/null +@@ -1,119 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Thu, 26 May 2016 01:44:27 +0200 +-Subject: [PATCH] brcmfmac: rework function picking free BSS index +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-The old implementation was overcomplicated and slightly bugged in some +-corner cases. +- +-Consider following state of BSS-es (limited to 6 for simplification): +-drvr->iflist[0]: { bsscfgidx:0, ndev->name:wlan1, } +-drvr->iflist[1]: (null) +-drvr->iflist[2]: { bsscfgidx:2, ndev->name:wlan1-1, } +-drvr->iflist[3]: { bsscfgidx:3, ndev->name:wlan1-2, } +-drvr->iflist[4]: (null) +-drvr->iflist[5]: (null) +-In such case the next AP interface should bsscfgidx 4 (we don't use 1 as +-it's reserved for P2P). +- +-With old code the loop iterations were following: +-[ifidx = 0] [bsscfgidx = 2] [highest = 2] +-[ifidx = 1] [bsscfgidx = 2] [highest = 2] available = true +-[ifidx = 2] [bsscfgidx = 2] [highest = 2] bsscfgidx = highest + 1 +-[ifidx = 3] [bsscfgidx = 3] [highest = 2] bsscfgidx = highest + 1 +-[ifidx = 4] [bsscfgidx = 3] [highest = 2] available = true +-[ifidx = 5] [bsscfgidx = 3] [highest = 2] available = true +-There were 2 obvious problems: +-1) Having empty BSS at index 1 was resulting in available being always +- set to true, even if we would run out of BSS-es. +-2) Calculated bsscfgidx was invalid (3 instead of 4) resulting in driver +- not being able to create the 4th AP interface. +- +-New code is simpler, placed in file where it's really used, handles +-running out of free BSS-es and allows using 4 interfaces at the same +-time. It also looks for the first free BSS instead of one after the last +-in use. It works well with current driver (which doesn't allow deleting +-interfaces) and should be future proof (if we ever allow deleting). +- +-Signed-off-by: RafaÅ‚ MiÅ‚ecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -527,6 +527,21 @@ brcmf_cfg80211_update_proto_addr_mode(st +- ADDR_INDIRECT); +- } +- +-+static int brcmf_get_first_free_bsscfgidx(struct brcmf_pub *drvr) +-+{ +-+ int bsscfgidx; +-+ +-+ for (bsscfgidx = 0; bsscfgidx < BRCMF_MAX_IFS; bsscfgidx++) { +-+ /* bsscfgidx 1 is reserved for legacy P2P */ +-+ if (bsscfgidx == 1) +-+ continue; +-+ if (!drvr->iflist[bsscfgidx]) +-+ return bsscfgidx; +-+ } +-+ +-+ return -ENOMEM; +-+} +-+ +- static int brcmf_cfg80211_request_ap_if(struct brcmf_if *ifp) +- { +- struct brcmf_mbss_ssid_le mbss_ssid_le; +-@@ -534,7 +549,7 @@ static int brcmf_cfg80211_request_ap_if( +- int err; +- +- memset(&mbss_ssid_le, 0, sizeof(mbss_ssid_le)); +-- bsscfgidx = brcmf_get_next_free_bsscfgidx(ifp->drvr); +-+ bsscfgidx = brcmf_get_first_free_bsscfgidx(ifp->drvr); +- if (bsscfgidx < 0) +- return bsscfgidx; +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -753,30 +753,6 @@ void brcmf_remove_interface(struct brcmf +- brcmf_del_if(ifp->drvr, ifp->bsscfgidx); +- } +- +--int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr) +--{ +-- int ifidx; +-- int bsscfgidx; +-- bool available; +-- int highest; +-- +-- available = false; +-- bsscfgidx = 2; +-- highest = 2; +-- for (ifidx = 0; ifidx < BRCMF_MAX_IFS; ifidx++) { +-- if (drvr->iflist[ifidx]) { +-- if (drvr->iflist[ifidx]->bsscfgidx == bsscfgidx) +-- bsscfgidx = highest + 1; +-- else if (drvr->iflist[ifidx]->bsscfgidx > highest) +-- highest = drvr->iflist[ifidx]->bsscfgidx; +-- } else { +-- available = true; +-- } +-- } +-- +-- return available ? bsscfgidx : -ENOMEM; +--} +-- +- #ifdef CONFIG_INET +- #define ARPOL_MAX_ENTRIES 8 +- static int brcmf_inetaddr_changed(struct notifier_block *nb, +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -217,7 +217,6 @@ int brcmf_net_attach(struct brcmf_if *if +- struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, +- bool is_p2pdev, char *name, u8 *mac_addr); +- void brcmf_remove_interface(struct brcmf_if *ifp); +--int brcmf_get_next_free_bsscfgidx(struct brcmf_pub *drvr); +- void brcmf_txflowblock_if(struct brcmf_if *ifp, +- enum brcmf_netif_stop_reason reason, bool state); +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +diff --git a/package/kernel/mac80211/patches/351-0007-brcmutil-add-field-storing-control-channel-to-the-st.patch b/package/kernel/mac80211/patches/351-0007-brcmutil-add-field-storing-control-channel-to-the-st.patch +deleted file mode 100644 +index a79c9a2..0000000 +--- a/package/kernel/mac80211/patches/351-0007-brcmutil-add-field-storing-control-channel-to-the-st.patch ++++ /dev/null +@@ -1,244 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 20 May 2016 13:38:57 +0200 +-Subject: [PATCH] brcmutil: add field storing control channel to the struct +- brcmu_chan +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Our d11 code supports encoding/decoding channel info into/from chanspec +-format used by firmware. Current implementation is quite misleading +-because of the way "chnum" field is used. +-When encoding channel info, "chnum" has to be filled by a caller with +-*center* channel number. However when decoding chanspec the same field +-is filled with a *control* channel number. +- +-1) This can be confusing. It's expected for information to be the same +- after encoding and decoding. +-2) It doesn't allow accessing all info when decoding. Some functions may +- need to know both channel numbers, e.g. cfg80211 callback getting +- current channel. +-Solve this by adding a separated field for control channel. +- +-Signed-off-by: RafaÅ‚ MiÅ‚ecki +-Reviewed-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -2689,7 +2689,7 @@ static s32 brcmf_inform_single_bss(struc +- if (!bi->ctl_ch) { +- ch.chspec = le16_to_cpu(bi->chanspec); +- cfg->d11inf.decchspec(&ch); +-- bi->ctl_ch = ch.chnum; +-+ bi->ctl_ch = ch.control_ch_num; +- } +- channel = bi->ctl_ch; +- +-@@ -2807,7 +2807,7 @@ static s32 brcmf_inform_ibss(struct brcm +- else +- band = wiphy->bands[IEEE80211_BAND_5GHZ]; +- +-- freq = ieee80211_channel_to_frequency(ch.chnum, band->band); +-+ freq = ieee80211_channel_to_frequency(ch.control_ch_num, band->band); +- cfg->channel = freq; +- notify_channel = ieee80211_get_channel(wiphy, freq); +- +-@@ -2817,7 +2817,7 @@ static s32 brcmf_inform_ibss(struct brcm +- notify_ielen = le32_to_cpu(bi->ie_length); +- notify_signal = (s16)le16_to_cpu(bi->RSSI) * 100; +- +-- brcmf_dbg(CONN, "channel: %d(%d)\n", ch.chnum, freq); +-+ brcmf_dbg(CONN, "channel: %d(%d)\n", ch.control_ch_num, freq); +- brcmf_dbg(CONN, "capability: %X\n", notify_capability); +- brcmf_dbg(CONN, "beacon interval: %d\n", notify_interval); +- brcmf_dbg(CONN, "signal: %d\n", notify_signal); +-@@ -5235,7 +5235,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg8 +- else +- band = wiphy->bands[IEEE80211_BAND_5GHZ]; +- +-- freq = ieee80211_channel_to_frequency(ch.chnum, band->band); +-+ freq = ieee80211_channel_to_frequency(ch.control_ch_num, band->band); +- notify_channel = ieee80211_get_channel(wiphy, freq); +- +- done: +-@@ -5757,14 +5757,15 @@ static int brcmf_construct_chaninfo(stru +- channel = band->channels; +- index = band->n_channels; +- for (j = 0; j < band->n_channels; j++) { +-- if (channel[j].hw_value == ch.chnum) { +-+ if (channel[j].hw_value == ch.control_ch_num) { +- index = j; +- break; +- } +- } +- channel[index].center_freq = +-- ieee80211_channel_to_frequency(ch.chnum, band->band); +-- channel[index].hw_value = ch.chnum; +-+ ieee80211_channel_to_frequency(ch.control_ch_num, +-+ band->band); +-+ channel[index].hw_value = ch.control_ch_num; +- +- /* assuming the chanspecs order is HT20, +- * HT40 upper, HT40 lower, and VHT80. +-@@ -5866,7 +5867,7 @@ static int brcmf_enable_bw40_2g(struct b +- if (WARN_ON(ch.bw != BRCMU_CHAN_BW_40)) +- continue; +- for (j = 0; j < band->n_channels; j++) { +-- if (band->channels[j].hw_value == ch.chnum) +-+ if (band->channels[j].hw_value == ch.control_ch_num) +- break; +- } +- if (WARN_ON(j == band->n_channels)) +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -1246,7 +1246,7 @@ bool brcmf_p2p_scan_finding_common_chann +- if (!bi->ctl_ch) { +- ch.chspec = le16_to_cpu(bi->chanspec); +- cfg->d11inf.decchspec(&ch); +-- bi->ctl_ch = ch.chnum; +-+ bi->ctl_ch = ch.control_ch_num; +- } +- afx_hdl->peer_chan = bi->ctl_ch; +- brcmf_dbg(TRACE, "ACTION FRAME SCAN : Peer %pM found, channel : %d\n", +-@@ -1385,7 +1385,7 @@ int brcmf_p2p_notify_action_frame_rx(str +- if (test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL, +- &p2p->status) && +- (ether_addr_equal(afx_hdl->tx_dst_addr, e->addr))) { +-- afx_hdl->peer_chan = ch.chnum; +-+ afx_hdl->peer_chan = ch.control_ch_num; +- brcmf_dbg(INFO, "GON request: Peer found, channel=%d\n", +- afx_hdl->peer_chan); +- complete(&afx_hdl->act_frm_scan); +-@@ -1428,7 +1428,7 @@ int brcmf_p2p_notify_action_frame_rx(str +- memcpy(&mgmt_frame->u, frame, mgmt_frame_len); +- mgmt_frame_len += offsetof(struct ieee80211_mgmt, u); +- +-- freq = ieee80211_channel_to_frequency(ch.chnum, +-+ freq = ieee80211_channel_to_frequency(ch.control_ch_num, +- ch.band == BRCMU_CHAN_BAND_2G ? +- IEEE80211_BAND_2GHZ : +- IEEE80211_BAND_5GHZ); +-@@ -1873,7 +1873,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere +- +- if (test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL, &p2p->status) && +- (ether_addr_equal(afx_hdl->tx_dst_addr, e->addr))) { +-- afx_hdl->peer_chan = ch.chnum; +-+ afx_hdl->peer_chan = ch.control_ch_num; +- brcmf_dbg(INFO, "PROBE REQUEST: Peer found, channel=%d\n", +- afx_hdl->peer_chan); +- complete(&afx_hdl->act_frm_scan); +-@@ -1898,7 +1898,7 @@ s32 brcmf_p2p_notify_rx_mgmt_p2p_probere +- +- mgmt_frame = (u8 *)(rxframe + 1); +- mgmt_frame_len = e->datalen - sizeof(*rxframe); +-- freq = ieee80211_channel_to_frequency(ch.chnum, +-+ freq = ieee80211_channel_to_frequency(ch.control_ch_num, +- ch.band == BRCMU_CHAN_BAND_2G ? +- IEEE80211_BAND_2GHZ : +- IEEE80211_BAND_5GHZ); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +-@@ -107,6 +107,7 @@ static void brcmu_d11n_decchspec(struct +- u16 val; +- +- ch->chnum = (u8)(ch->chspec & BRCMU_CHSPEC_CH_MASK); +-+ ch->control_ch_num = ch->chnum; +- +- switch (ch->chspec & BRCMU_CHSPEC_D11N_BW_MASK) { +- case BRCMU_CHSPEC_D11N_BW_20: +-@@ -118,10 +119,10 @@ static void brcmu_d11n_decchspec(struct +- val = ch->chspec & BRCMU_CHSPEC_D11N_SB_MASK; +- if (val == BRCMU_CHSPEC_D11N_SB_L) { +- ch->sb = BRCMU_CHAN_SB_L; +-- ch->chnum -= CH_10MHZ_APART; +-+ ch->control_ch_num -= CH_10MHZ_APART; +- } else { +- ch->sb = BRCMU_CHAN_SB_U; +-- ch->chnum += CH_10MHZ_APART; +-+ ch->control_ch_num += CH_10MHZ_APART; +- } +- break; +- default: +-@@ -147,6 +148,7 @@ static void brcmu_d11ac_decchspec(struct +- u16 val; +- +- ch->chnum = (u8)(ch->chspec & BRCMU_CHSPEC_CH_MASK); +-+ ch->control_ch_num = ch->chnum; +- +- switch (ch->chspec & BRCMU_CHSPEC_D11AC_BW_MASK) { +- case BRCMU_CHSPEC_D11AC_BW_20: +-@@ -158,10 +160,10 @@ static void brcmu_d11ac_decchspec(struct +- val = ch->chspec & BRCMU_CHSPEC_D11AC_SB_MASK; +- if (val == BRCMU_CHSPEC_D11AC_SB_L) { +- ch->sb = BRCMU_CHAN_SB_L; +-- ch->chnum -= CH_10MHZ_APART; +-+ ch->control_ch_num -= CH_10MHZ_APART; +- } else if (val == BRCMU_CHSPEC_D11AC_SB_U) { +- ch->sb = BRCMU_CHAN_SB_U; +-- ch->chnum += CH_10MHZ_APART; +-+ ch->control_ch_num += CH_10MHZ_APART; +- } else { +- WARN_ON_ONCE(1); +- } +-@@ -172,16 +174,16 @@ static void brcmu_d11ac_decchspec(struct +- BRCMU_CHSPEC_D11AC_SB_SHIFT); +- switch (ch->sb) { +- case BRCMU_CHAN_SB_LL: +-- ch->chnum -= CH_30MHZ_APART; +-+ ch->control_ch_num -= CH_30MHZ_APART; +- break; +- case BRCMU_CHAN_SB_LU: +-- ch->chnum -= CH_10MHZ_APART; +-+ ch->control_ch_num -= CH_10MHZ_APART; +- break; +- case BRCMU_CHAN_SB_UL: +-- ch->chnum += CH_10MHZ_APART; +-+ ch->control_ch_num += CH_10MHZ_APART; +- break; +- case BRCMU_CHAN_SB_UU: +-- ch->chnum += CH_30MHZ_APART; +-+ ch->control_ch_num += CH_30MHZ_APART; +- break; +- default: +- WARN_ON_ONCE(1); +---- a/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcmu_d11.h +-@@ -125,14 +125,36 @@ enum brcmu_chan_sb { +- BRCMU_CHAN_SB_UU = BRCMU_CHAN_SB_LUU, +- }; +- +-+/** +-+ * struct brcmu_chan - stores channel formats +-+ * +-+ * This structure can be used with functions translating chanspec into generic +-+ * channel info and the other way. +-+ * +-+ * @chspec: firmware specific format +-+ * @chnum: center channel number +-+ * @control_ch_num: control channel number +-+ * @band: frequency band +-+ * @bw: channel width +-+ * @sb: control sideband (location of control channel against the center one) +-+ */ +- struct brcmu_chan { +- u16 chspec; +- u8 chnum; +-+ u8 control_ch_num; +- u8 band; +- enum brcmu_chan_bw bw; +- enum brcmu_chan_sb sb; +- }; +- +-+/** +-+ * struct brcmu_d11inf - provides functions translating channel format +-+ * +-+ * @io_type: determines version of channel format used by firmware +-+ * @encchspec: encodes channel info into a chanspec, requires center channel +-+ * number, ignores control one +-+ * @decchspec: decodes chanspec into generic info +-+ */ +- struct brcmu_d11inf { +- u8 io_type; +- +diff --git a/package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch b/package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch +deleted file mode 100644 +index 2c536d1..0000000 +--- a/package/kernel/mac80211/patches/351-0008-brcmfmac-support-get_channel-cfg80211-callback.patch ++++ /dev/null +@@ -1,94 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 20 May 2016 13:38:58 +0200 +-Subject: [PATCH] brcmfmac: support get_channel cfg80211 callback +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This is important for brcmfmac as some of released firmwares (e.g. +-brcmfmac4366b-pcie.bin) may pick different channel than requested. This +-has been tested with BCM4366B1 in D-Link DIR-885L. +- +-Signed-off-by: RafaÅ‚ MiÅ‚ecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -4847,6 +4847,68 @@ exit: +- return err; +- } +- +-+static int brcmf_cfg80211_get_channel(struct wiphy *wiphy, +-+ struct wireless_dev *wdev, +-+ struct cfg80211_chan_def *chandef) +-+{ +-+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); +-+ struct net_device *ndev = wdev->netdev; +-+ struct brcmf_if *ifp; +-+ struct brcmu_chan ch; +-+ enum nl80211_band band = 0; +-+ enum nl80211_chan_width width = 0; +-+ u32 chanspec; +-+ int freq, err; +-+ +-+ if (!ndev) +-+ return -ENODEV; +-+ ifp = netdev_priv(ndev); +-+ +-+ err = brcmf_fil_iovar_int_get(ifp, "chanspec", &chanspec); +-+ if (err) { +-+ brcmf_err("chanspec failed (%d)\n", err); +-+ return err; +-+ } +-+ +-+ ch.chspec = chanspec; +-+ cfg->d11inf.decchspec(&ch); +-+ +-+ switch (ch.band) { +-+ case BRCMU_CHAN_BAND_2G: +-+ band = NL80211_BAND_2GHZ; +-+ break; +-+ case BRCMU_CHAN_BAND_5G: +-+ band = NL80211_BAND_5GHZ; +-+ break; +-+ } +-+ +-+ switch (ch.bw) { +-+ case BRCMU_CHAN_BW_80: +-+ width = NL80211_CHAN_WIDTH_80; +-+ break; +-+ case BRCMU_CHAN_BW_40: +-+ width = NL80211_CHAN_WIDTH_40; +-+ break; +-+ case BRCMU_CHAN_BW_20: +-+ width = NL80211_CHAN_WIDTH_20; +-+ break; +-+ case BRCMU_CHAN_BW_80P80: +-+ width = NL80211_CHAN_WIDTH_80P80; +-+ break; +-+ case BRCMU_CHAN_BW_160: +-+ width = NL80211_CHAN_WIDTH_160; +-+ break; +-+ } +-+ +-+ freq = ieee80211_channel_to_frequency(ch.control_ch_num, band); +-+ chandef->chan = ieee80211_get_channel(wiphy, freq); +-+ chandef->width = width; +-+ chandef->center_freq1 = ieee80211_channel_to_frequency(ch.chnum, band); +-+ chandef->center_freq2 = 0; +-+ +-+ return 0; +-+} +-+ +- static int brcmf_cfg80211_crit_proto_start(struct wiphy *wiphy, +- struct wireless_dev *wdev, +- enum nl80211_crit_proto_id proto, +-@@ -5009,6 +5071,7 @@ static struct cfg80211_ops brcmf_cfg8021 +- .mgmt_tx = brcmf_cfg80211_mgmt_tx, +- .remain_on_channel = brcmf_p2p_remain_on_channel, +- .cancel_remain_on_channel = brcmf_cfg80211_cancel_remain_on_channel, +-+ .get_channel = brcmf_cfg80211_get_channel, +- .start_p2p_device = brcmf_p2p_start_device, +- .stop_p2p_device = brcmf_p2p_stop_device, +- .crit_proto_start = brcmf_cfg80211_crit_proto_start, +diff --git a/package/kernel/mac80211/patches/351-0009-brcmfmac-print-errors-if-creating-interface-fails.patch b/package/kernel/mac80211/patches/351-0009-brcmfmac-print-errors-if-creating-interface-fails.patch +deleted file mode 100644 +index 1b119b2..0000000 +--- a/package/kernel/mac80211/patches/351-0009-brcmfmac-print-errors-if-creating-interface-fails.patch ++++ /dev/null +@@ -1,59 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 27 May 2016 10:54:28 +0200 +-Subject: [PATCH] brcmfmac: print errors if creating interface fails +- +-This is helpful for debugging. Without this all I was getting from "iw" +-command on failed creating of P2P interface was: +-> command failed: Too many open files in system (-23) +- +-Signed-off-by: Rafal Milecki +-[arend@broadcom.com: reduce error prints upon iface creation] +-Signed-off-by: Arend van Spriel +-Reviewed-by: Julian Calaby +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -670,20 +670,24 @@ static struct wireless_dev *brcmf_cfg802 +- return ERR_PTR(-EOPNOTSUPP); +- case NL80211_IFTYPE_AP: +- wdev = brcmf_ap_add_vif(wiphy, name, flags, params); +-- if (!IS_ERR(wdev)) +-- brcmf_cfg80211_update_proto_addr_mode(wdev); +-- return wdev; +-+ break; +- case NL80211_IFTYPE_P2P_CLIENT: +- case NL80211_IFTYPE_P2P_GO: +- case NL80211_IFTYPE_P2P_DEVICE: +- wdev = brcmf_p2p_add_vif(wiphy, name, name_assign_type, type, flags, params); +-- if (!IS_ERR(wdev)) +-- brcmf_cfg80211_update_proto_addr_mode(wdev); +-- return wdev; +-+ break; +- case NL80211_IFTYPE_UNSPECIFIED: +- default: +- return ERR_PTR(-EINVAL); +- } +-+ +-+ if (IS_ERR(wdev)) +-+ brcmf_err("add iface %s type %d failed: err=%d\n", +-+ name, type, (int)PTR_ERR(wdev)); +-+ else +-+ brcmf_cfg80211_update_proto_addr_mode(wdev); +-+ +-+ return wdev; +- } +- +- static void brcmf_scan_config_mpc(struct brcmf_if *ifp, int mpc) +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -2030,8 +2030,6 @@ static int brcmf_p2p_request_p2p_if(stru +- +- err = brcmf_fil_iovar_data_set(ifp, "p2p_ifadd", &if_request, +- sizeof(if_request)); +-- if (err) +-- return err; +- +- return err; +- } +diff --git a/package/kernel/mac80211/patches/351-0010-brcmfmac-fix-setting-AP-channel-with-new-firmwares.patch b/package/kernel/mac80211/patches/351-0010-brcmfmac-fix-setting-AP-channel-with-new-firmwares.patch +deleted file mode 100644 +index a2e18a5..0000000 +--- a/package/kernel/mac80211/patches/351-0010-brcmfmac-fix-setting-AP-channel-with-new-firmwares.patch ++++ /dev/null +@@ -1,114 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 27 May 2016 21:07:19 +0200 +-Subject: [PATCH] brcmfmac: fix setting AP channel with new firmwares +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Firmware for new chipsets is based on a new major version of code +-internally maintained at Broadcom. E.g. brcmfmac4366b-pcie.bin (used for +-BCM4366B1) is based on 10.10.69.3309 while brcmfmac43602-pcie.ap.bin was +-based on 7.35.177.56. +- +-Currently setting AP 5 GHz channel doesn't work reliably with BCM4366B1. +-When setting e.g. 36 control channel with VHT80 (center channel 42) +-firmware may randomly pick one of: +-1) 52 control channel with 58 as center one +-2) 100 control channel with 106 as center one +-3) 116 control channel with 122 as center one +-4) 149 control channel with 155 as center one +- +-It seems new firmwares require setting AP mode (BRCMF_C_SET_AP) before +-specifying a channel. Changing an order of firmware calls fixes the +-problem. This requirement resulted in two separated "chanspec" calls, +-one in AP code path and one in P2P path. +- +-This fix was verified with BCM4366B1 and tested for regressions on +-BCM43602. +- +-Signed-off-by: RafaÅ‚ MiÅ‚ecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -4382,7 +4382,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- struct brcmf_join_params join_params; +- enum nl80211_iftype dev_role; +- struct brcmf_fil_bss_enable_le bss_enable; +-- u16 chanspec; +-+ u16 chanspec = chandef_to_chanspec(&cfg->d11inf, &settings->chandef); +- bool mbss; +- int is_11d; +- +-@@ -4458,16 +4458,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- +- brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon); +- +-+ /* Parameters shared by all radio interfaces */ +- if (!mbss) { +-- chanspec = chandef_to_chanspec(&cfg->d11inf, +-- &settings->chandef); +-- err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); +-- if (err < 0) { +-- brcmf_err("Set Channel failed: chspec=%d, %d\n", +-- chanspec, err); +-- goto exit; +-- } +-- +- if (is_11d != ifp->vif->is_11d) { +- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, +- is_11d); +-@@ -4515,6 +4507,8 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- err = -EINVAL; +- goto exit; +- } +-+ +-+ /* Interface specific setup */ +- if (dev_role == NL80211_IFTYPE_AP) { +- if ((brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) && (!mbss)) +- brcmf_fil_iovar_int_set(ifp, "mbss", 1); +-@@ -4524,6 +4518,17 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- brcmf_err("setting AP mode failed %d\n", err); +- goto exit; +- } +-+ if (!mbss) { +-+ /* Firmware 10.x requires setting channel after enabling +-+ * AP and before bringing interface up. +-+ */ +-+ err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); +-+ if (err < 0) { +-+ brcmf_err("Set Channel failed: chspec=%d, %d\n", +-+ chanspec, err); +-+ goto exit; +-+ } +-+ } +- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); +- if (err < 0) { +- brcmf_err("BRCMF_C_UP error (%d)\n", err); +-@@ -4545,7 +4550,13 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- goto exit; +- } +- brcmf_dbg(TRACE, "AP mode configuration complete\n"); +-- } else { +-+ } else if (dev_role == NL80211_IFTYPE_P2P_GO) { +-+ err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); +-+ if (err < 0) { +-+ brcmf_err("Set Channel failed: chspec=%d, %d\n", +-+ chanspec, err); +-+ goto exit; +-+ } +- err = brcmf_fil_bsscfg_data_set(ifp, "ssid", &ssid_le, +- sizeof(ssid_le)); +- if (err < 0) { +-@@ -4562,7 +4573,10 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- } +- +- brcmf_dbg(TRACE, "GO mode configuration complete\n"); +-+ } else { +-+ WARN_ON(1); +- } +-+ +- set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); +- brcmf_net_setcarrier(ifp, true); +- +diff --git a/package/kernel/mac80211/patches/351-0011-brcmfmac-don-t-remove-interface-on-link-down-firmwar.patch b/package/kernel/mac80211/patches/351-0011-brcmfmac-don-t-remove-interface-on-link-down-firmwar.patch +deleted file mode 100644 +index 167e434..0000000 +--- a/package/kernel/mac80211/patches/351-0011-brcmfmac-don-t-remove-interface-on-link-down-firmwar.patch ++++ /dev/null +@@ -1,60 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Mon, 30 May 2016 06:40:54 +0200 +-Subject: [PATCH] brcmfmac: don't remove interface on link down firmware event +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-There are two firmware events we handle similarly in brcmfmac: +-BRCMF_E_LINK and BRCMF_E_IF. The difference from firmware point of view +-is that the first one means BSS remains present in the firmware. Trying +-to (re)create it (e.g. when adding new virtual interface) will result in +-an error. +- +-Current code treats both events in a similar way. It removes Linux +-interface for each of them. It works OK with e.g. BCM43602. Its firmware +-generates both events for each interface. It means we get BRCMF_E_LINK +-and remove interface. That is soon followed by BRCMF_E_IF which means +-BSS was also removed in a firmware. The only downside of this is a +-harmless error like: +-[ 208.643180] brcmfmac: brcmf_fweh_call_event_handler: no interface object +- +-Unfortunately BCM4366 firmware doesn't automatically remove BSS and so +-it doesn't generate BRCMF_E_IF. In such case we incorrectly remove Linux +-interface on BRCMF_E_LINK as BSS is still present in the firmware. It +-results in an error when trying to re-create virtual interface, e.g.: +-> iw phy phy1 interface add wlan1-1 type __ap +-[ 3602.929199] brcmfmac: brcmf_ap_add_vif: timeout occurred +-command failed: I/O error (-5) +- +-With this patch we don't remove Linux interface while firmware keeps +-BSS. Thanks to this we keep a consistent states of host driver and +-device firmware. +- +-Further improvement should be to mark BSS as disabled and remove +-interface on BRCMF_E_LINK. Then we should add support for reusing +-BSS-es. +- +-Signed-off-by: RafaÅ‚ MiÅ‚ecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -5372,7 +5372,6 @@ brcmf_notify_connect_status_ap(struct br +- struct net_device *ndev, +- const struct brcmf_event_msg *e, void *data) +- { +-- struct brcmf_if *ifp = netdev_priv(ndev); +- static int generation; +- u32 event = e->event_code; +- u32 reason = e->reason; +-@@ -5383,8 +5382,6 @@ brcmf_notify_connect_status_ap(struct br +- ndev != cfg_to_ndev(cfg)) { +- brcmf_dbg(CONN, "AP mode link down\n"); +- complete(&cfg->vif_disabled); +-- if (ifp->vif->mbss) +-- brcmf_remove_interface(ifp); +- return 0; +- } +- +diff --git a/package/kernel/mac80211/patches/351-0017-brcmfmac-drop-unused-pm_block-vif-attribute.patch b/package/kernel/mac80211/patches/351-0017-brcmfmac-drop-unused-pm_block-vif-attribute.patch +deleted file mode 100644 +index 28ef3a6..0000000 +--- a/package/kernel/mac80211/patches/351-0017-brcmfmac-drop-unused-pm_block-vif-attribute.patch ++++ /dev/null +@@ -1,103 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Mon, 6 Jun 2016 23:03:55 +0200 +-Subject: [PATCH] brcmfmac: drop unused pm_block vif attribute +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This attribute was added 3 years ago by +-commit 3eacf866559c ("brcmfmac: introduce brcmf_cfg80211_vif structure") +-but it remains unused since then. It seems we can safely drop it. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -587,7 +587,7 @@ struct wireless_dev *brcmf_ap_add_vif(st +- +- brcmf_dbg(INFO, "Adding vif \"%s\"\n", name); +- +-- vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_AP, false); +-+ vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_AP); +- if (IS_ERR(vif)) +- return (struct wireless_dev *)vif; +- +-@@ -5098,8 +5098,7 @@ static struct cfg80211_ops brcmf_cfg8021 +- }; +- +- struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, +-- enum nl80211_iftype type, +-- bool pm_block) +-+ enum nl80211_iftype type) +- { +- struct brcmf_cfg80211_vif *vif_walk; +- struct brcmf_cfg80211_vif *vif; +-@@ -5114,8 +5113,6 @@ struct brcmf_cfg80211_vif *brcmf_alloc_v +- vif->wdev.wiphy = cfg->wiphy; +- vif->wdev.iftype = type; +- +-- vif->pm_block = pm_block; +-- +- brcmf_init_prof(&vif->profile); +- +- if (type == NL80211_IFTYPE_AP) { +-@@ -6754,7 +6751,7 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +- init_vif_event(&cfg->vif_event); +- INIT_LIST_HEAD(&cfg->vif_list); +- +-- vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_STATION, false); +-+ vif = brcmf_alloc_vif(cfg, NL80211_IFTYPE_STATION); +- if (IS_ERR(vif)) +- goto wiphy_out; +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -167,7 +167,6 @@ struct vif_saved_ie { +- * @wdev: wireless device. +- * @profile: profile information. +- * @sme_state: SME state using enum brcmf_vif_status bits. +-- * @pm_block: power-management blocked. +- * @list: linked list. +- * @mgmt_rx_reg: registered rx mgmt frame types. +- * @mbss: Multiple BSS type, set if not first AP (not relevant for P2P). +-@@ -177,7 +176,6 @@ struct brcmf_cfg80211_vif { +- struct wireless_dev wdev; +- struct brcmf_cfg80211_profile profile; +- unsigned long sme_state; +-- bool pm_block; +- struct vif_saved_ie saved_ie; +- struct list_head list; +- u16 mgmt_rx_reg; +-@@ -388,8 +386,7 @@ s32 brcmf_cfg80211_down(struct net_devic +- enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp); +- +- struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, +-- enum nl80211_iftype type, +-- bool pm_block); +-+ enum nl80211_iftype type); +- void brcmf_free_vif(struct brcmf_cfg80211_vif *vif); +- +- s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -2074,8 +2074,7 @@ static struct wireless_dev *brcmf_p2p_cr +- if (p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif) +- return ERR_PTR(-ENOSPC); +- +-- p2p_vif = brcmf_alloc_vif(p2p->cfg, NL80211_IFTYPE_P2P_DEVICE, +-- false); +-+ p2p_vif = brcmf_alloc_vif(p2p->cfg, NL80211_IFTYPE_P2P_DEVICE); +- if (IS_ERR(p2p_vif)) { +- brcmf_err("could not create discovery vif\n"); +- return (struct wireless_dev *)p2p_vif; +-@@ -2175,7 +2174,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s +- return ERR_PTR(-EOPNOTSUPP); +- } +- +-- vif = brcmf_alloc_vif(cfg, type, false); +-+ vif = brcmf_alloc_vif(cfg, type); +- if (IS_ERR(vif)) +- return (struct wireless_dev *)vif; +- brcmf_cfg80211_arm_vif_event(cfg, vif); +diff --git a/package/kernel/mac80211/patches/351-0018-brcmfmac-include-required-headers-in-cfg80211.h.patch b/package/kernel/mac80211/patches/351-0018-brcmfmac-include-required-headers-in-cfg80211.h.patch +deleted file mode 100644 +index 09547d8..0000000 +--- a/package/kernel/mac80211/patches/351-0018-brcmfmac-include-required-headers-in-cfg80211.h.patch ++++ /dev/null +@@ -1,37 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Tue, 7 Jun 2016 08:20:21 +0200 +-Subject: [PATCH] brcmfmac: include required headers in cfg80211.h +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Without this including cfg80211.h in a wrong order could result in: +- +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h:122:24: error: array type has incomplete element type +- struct brcmf_wsec_key key[BRCMF_MAX_DEFAULT_KEYS]; +- ^ +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h:291:24: error: field ‘p2p’ has incomplete type +- struct brcmf_p2p_info p2p; +- ^ +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h:297:27: error: field ‘pmk_list’ has incomplete type +- struct brcmf_pmk_list_le pmk_list; +- ^ +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h:317:28: error: field ‘assoclist’ has incomplete type +- struct brcmf_assoclist_le assoclist; +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -20,6 +20,9 @@ +- /* for brcmu_d11inf */ +- #include +- +-+#include "fwil_types.h" +-+#include "p2p.h" +-+ +- #define WL_NUM_SCAN_MAX 10 +- #define WL_TLV_INFO_MAX 1024 +- #define WL_BSS_INFO_MAX 2048 +diff --git a/package/kernel/mac80211/patches/351-0019-brcmfmac-slightly-simplify-building-interface-combin.patch b/package/kernel/mac80211/patches/351-0019-brcmfmac-slightly-simplify-building-interface-combin.patch +deleted file mode 100644 +index 461e3db..0000000 +--- a/package/kernel/mac80211/patches/351-0019-brcmfmac-slightly-simplify-building-interface-combin.patch ++++ /dev/null +@@ -1,108 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Tue, 7 Jun 2016 21:10:18 +0200 +-Subject: [PATCH] brcmfmac: slightly simplify building interface combinations +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This change reorders some operations in brcmf_setup_ifmodes in hope to +-make it simpler: +-1) It allocates arrays right before filling them. This way it's easier +- to follow requested array length as it's immediately followed by +- code filling it. It's easier to check e.g. why we need 4 entries for +- P2P. Other than that it deduplicates some checks (e.g. for P2P). +-2) It reorders code to first prepare limits and then define a new combo. +- Previously this was mixed (e.g. we were setting num of channels +- before preparing limits). +-3) It modifies mbss code to use i variable just like other combos do. +- +-Signed-off-by: Rafał Miłecki +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -6208,29 +6208,15 @@ static int brcmf_setup_ifmodes(struct wi +- if (!combo) +- goto err; +- +-- c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL); +-- if (!c0_limits) +-- goto err; +-- +-- if (p2p) { +-- p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); +-- if (!p2p_limits) +-- goto err; +-- } +-- +-- if (mbss) { +-- mbss_limits = kcalloc(1, sizeof(*mbss_limits), GFP_KERNEL); +-- if (!mbss_limits) +-- goto err; +-- } +-- +- wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | +- BIT(NL80211_IFTYPE_ADHOC) | +- BIT(NL80211_IFTYPE_AP); +- +- c = 0; +- i = 0; +-- combo[c].num_different_channels = 1; +-+ c0_limits = kcalloc(p2p ? 3 : 2, sizeof(*c0_limits), GFP_KERNEL); +-+ if (!c0_limits) +-+ goto err; +- c0_limits[i].max = 1; +- c0_limits[i++].types = BIT(NL80211_IFTYPE_STATION); +- if (p2p) { +-@@ -6248,6 +6234,7 @@ static int brcmf_setup_ifmodes(struct wi +- c0_limits[i].max = 1; +- c0_limits[i++].types = BIT(NL80211_IFTYPE_AP); +- } +-+ combo[c].num_different_channels = 1; +- combo[c].max_interfaces = i; +- combo[c].n_limits = i; +- combo[c].limits = c0_limits; +-@@ -6255,7 +6242,9 @@ static int brcmf_setup_ifmodes(struct wi +- if (p2p) { +- c++; +- i = 0; +-- combo[c].num_different_channels = 1; +-+ p2p_limits = kcalloc(4, sizeof(*p2p_limits), GFP_KERNEL); +-+ if (!p2p_limits) +-+ goto err; +- p2p_limits[i].max = 1; +- p2p_limits[i++].types = BIT(NL80211_IFTYPE_STATION); +- p2p_limits[i].max = 1; +-@@ -6264,6 +6253,7 @@ static int brcmf_setup_ifmodes(struct wi +- p2p_limits[i++].types = BIT(NL80211_IFTYPE_P2P_CLIENT); +- p2p_limits[i].max = 1; +- p2p_limits[i++].types = BIT(NL80211_IFTYPE_P2P_DEVICE); +-+ combo[c].num_different_channels = 1; +- combo[c].max_interfaces = i; +- combo[c].n_limits = i; +- combo[c].limits = p2p_limits; +-@@ -6271,14 +6261,19 @@ static int brcmf_setup_ifmodes(struct wi +- +- if (mbss) { +- c++; +-+ i = 0; +-+ mbss_limits = kcalloc(1, sizeof(*mbss_limits), GFP_KERNEL); +-+ if (!mbss_limits) +-+ goto err; +-+ mbss_limits[i].max = 4; +-+ mbss_limits[i++].types = BIT(NL80211_IFTYPE_AP); +- combo[c].beacon_int_infra_match = true; +- combo[c].num_different_channels = 1; +-- mbss_limits[0].max = 4; +-- mbss_limits[0].types = BIT(NL80211_IFTYPE_AP); +- combo[c].max_interfaces = 4; +-- combo[c].n_limits = 1; +-+ combo[c].n_limits = i; +- combo[c].limits = mbss_limits; +- } +-+ +- wiphy->n_iface_combinations = n_combos; +- wiphy->iface_combinations = combo; +- return 0; +diff --git a/package/kernel/mac80211/patches/351-0020-brcmfmac-fix-lockup-when-removing-P2P-interface-afte.patch b/package/kernel/mac80211/patches/351-0020-brcmfmac-fix-lockup-when-removing-P2P-interface-afte.patch +deleted file mode 100644 +index e991f32..0000000 +--- a/package/kernel/mac80211/patches/351-0020-brcmfmac-fix-lockup-when-removing-P2P-interface-afte.patch ++++ /dev/null +@@ -1,160 +0,0 @@ +-From b50ddfa8530e9b5f52e873fdd6ff04f327a88799 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 17 Jun 2016 12:29:21 +0200 +-Subject: [PATCH] brcmfmac: fix lockup when removing P2P interface after event +- timeout +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Removing P2P interface is handled by sending a proper request to the +-firmware. On success firmware triggers an event and driver's handler +-removes a matching interface. +- +-However on event timeout we remove interface directly from the cfg80211 +-callback. Current code doesn't handle this case correctly as it always +-assumes rtnl to be unlocked. +- +-Fix it by adding an extra rtnl_locked parameter to functions and calling +-unregister_netdevice when needed. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 29 +++++++++++++--------- +- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 +- +- .../wireless/broadcom/brcm80211/brcmfmac/fweh.c | 2 +- +- .../net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 4 +-- +- 4 files changed, 21 insertions(+), 16 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -548,12 +548,16 @@ fail: +- return -EBADE; +- } +- +--static void brcmf_net_detach(struct net_device *ndev) +-+static void brcmf_net_detach(struct net_device *ndev, bool rtnl_locked) +- { +-- if (ndev->reg_state == NETREG_REGISTERED) +-- unregister_netdev(ndev); +-- else +-+ if (ndev->reg_state == NETREG_REGISTERED) { +-+ if (rtnl_locked) +-+ unregister_netdevice(ndev); +-+ else +-+ unregister_netdev(ndev); +-+ } else { +- brcmf_cfg80211_free_netdev(ndev); +-+ } +- } +- +- void brcmf_net_setcarrier(struct brcmf_if *ifp, bool on) +-@@ -651,7 +655,7 @@ struct brcmf_if *brcmf_add_if(struct brc +- brcmf_err("ERROR: netdev:%s already exists\n", +- ifp->ndev->name); +- netif_stop_queue(ifp->ndev); +-- brcmf_net_detach(ifp->ndev); +-+ brcmf_net_detach(ifp->ndev, false); +- drvr->iflist[bsscfgidx] = NULL; +- } else { +- brcmf_dbg(INFO, "netdev:%s ignore IF event\n", +-@@ -699,7 +703,8 @@ struct brcmf_if *brcmf_add_if(struct brc +- return ifp; +- } +- +--static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx) +-+static void brcmf_del_if(struct brcmf_pub *drvr, s32 bsscfgidx, +-+ bool rtnl_locked) +- { +- struct brcmf_if *ifp; +- +-@@ -729,7 +734,7 @@ static void brcmf_del_if(struct brcmf_pu +- cancel_work_sync(&ifp->multicast_work); +- cancel_work_sync(&ifp->ndoffload_work); +- } +-- brcmf_net_detach(ifp->ndev); +-+ brcmf_net_detach(ifp->ndev, rtnl_locked); +- } else { +- /* Only p2p device interfaces which get dynamically created +- * end up here. In this case the p2p module should be informed +-@@ -743,14 +748,14 @@ static void brcmf_del_if(struct brcmf_pu +- } +- } +- +--void brcmf_remove_interface(struct brcmf_if *ifp) +-+void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked) +- { +- if (!ifp || WARN_ON(ifp->drvr->iflist[ifp->bsscfgidx] != ifp)) +- return; +- brcmf_dbg(TRACE, "Enter, bsscfgidx=%d, ifidx=%d\n", ifp->bsscfgidx, +- ifp->ifidx); +- brcmf_fws_del_interface(ifp); +-- brcmf_del_if(ifp->drvr, ifp->bsscfgidx); +-+ brcmf_del_if(ifp->drvr, ifp->bsscfgidx, rtnl_locked); +- } +- +- #ifdef CONFIG_INET +-@@ -1057,9 +1062,9 @@ fail: +- brcmf_fws_deinit(drvr); +- } +- if (ifp) +-- brcmf_net_detach(ifp->ndev); +-+ brcmf_net_detach(ifp->ndev, false); +- if (p2p_ifp) +-- brcmf_net_detach(p2p_ifp->ndev); +-+ brcmf_net_detach(p2p_ifp->ndev, false); +- drvr->iflist[0] = NULL; +- drvr->iflist[1] = NULL; +- if (drvr->settings->ignore_probe_fail) +-@@ -1128,7 +1133,7 @@ void brcmf_detach(struct device *dev) +- +- /* make sure primary interface removed last */ +- for (i = BRCMF_MAX_IFS-1; i > -1; i--) +-- brcmf_remove_interface(drvr->iflist[i]); +-+ brcmf_remove_interface(drvr->iflist[i], false); +- +- brcmf_cfg80211_detach(drvr->config); +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -216,7 +216,7 @@ struct brcmf_if *brcmf_get_ifp(struct br +- int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); +- struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, +- bool is_p2pdev, char *name, u8 *mac_addr); +--void brcmf_remove_interface(struct brcmf_if *ifp); +-+void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked); +- void brcmf_txflowblock_if(struct brcmf_if *ifp, +- enum brcmf_netif_stop_reason reason, bool state); +- void brcmf_txfinalize(struct brcmf_if *ifp, struct sk_buff *txp, bool success); +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-@@ -183,7 +183,7 @@ static void brcmf_fweh_handle_if_event(s +- err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data); +- +- if (ifp && ifevent->action == BRCMF_E_IF_DEL) +-- brcmf_remove_interface(ifp); +-+ brcmf_remove_interface(ifp, false); +- } +- +- /** +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -2289,7 +2289,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- err = 0; +- } +- if (err) +-- brcmf_remove_interface(vif->ifp); +-+ brcmf_remove_interface(vif->ifp, true); +- +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +- if (vif->wdev.iftype != NL80211_IFTYPE_P2P_DEVICE) +-@@ -2395,7 +2395,7 @@ void brcmf_p2p_detach(struct brcmf_p2p_i +- if (vif != NULL) { +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +-- brcmf_remove_interface(vif->ifp); +-+ brcmf_remove_interface(vif->ifp, false); +- } +- /* just set it all to zero */ +- memset(p2p, 0, sizeof(*p2p)); +diff --git a/package/kernel/mac80211/patches/351-0021-brcmfmac-use-const-char-for-interface-name-in-brcmf_.patch b/package/kernel/mac80211/patches/351-0021-brcmfmac-use-const-char-for-interface-name-in-brcmf_.patch +deleted file mode 100644 +index ed65f4d..0000000 +--- a/package/kernel/mac80211/patches/351-0021-brcmfmac-use-const-char-for-interface-name-in-brcmf_.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 17 Jun 2016 12:48:44 +0200 +-Subject: [PATCH] brcmfmac: use const char * for interface name in brcmf_add_if +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This function can work just fine with const pointer, it only calls +-alloc_netdev which take const as well. Moreover it makes this function +-more flexible as some cfg80211 callback may provide const char * as +-well, e.g. add_virtual_intf. This will be needed for more advanced +-interface management. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -638,7 +638,7 @@ fail: +- } +- +- struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, +-- bool is_p2pdev, char *name, u8 *mac_addr) +-+ bool is_p2pdev, const char *name, u8 *mac_addr) +- { +- struct brcmf_if *ifp; +- struct net_device *ndev; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -215,7 +215,7 @@ char *brcmf_ifname(struct brcmf_if *ifp) +- struct brcmf_if *brcmf_get_ifp(struct brcmf_pub *drvr, int ifidx); +- int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked); +- struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, +-- bool is_p2pdev, char *name, u8 *mac_addr); +-+ bool is_p2pdev, const char *name, u8 *mac_addr); +- void brcmf_remove_interface(struct brcmf_if *ifp, bool rtnl_locked); +- void brcmf_txflowblock_if(struct brcmf_if *ifp, +- enum brcmf_netif_stop_reason reason, bool state); +diff --git a/package/kernel/mac80211/patches/351-0022-brcmfmac-include-also-core.h-header-in-cfg80211.h.patch b/package/kernel/mac80211/patches/351-0022-brcmfmac-include-also-core.h-header-in-cfg80211.h.patch +deleted file mode 100644 +index ef35fab..0000000 +--- a/package/kernel/mac80211/patches/351-0022-brcmfmac-include-also-core.h-header-in-cfg80211.h.patch ++++ /dev/null +@@ -1,33 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Sat, 18 Jun 2016 18:49:38 +0200 +-Subject: [PATCH] brcmfmac: include also core.h header in cfg80211.h +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This header provides two inline functions using struct brcmf_if so we +-need core.h to avoid: +- +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h: In function ‘ndev_to_prof’: +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h:368:13: error: dereferencing pointer to incomplete type +- return &ifp->vif->profile; +- ^ +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h: In function ‘ndev_to_vif’: +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h:374:12: error: dereferencing pointer to incomplete type +- return ifp->vif; +- ^ +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -20,6 +20,7 @@ +- /* for brcmu_d11inf */ +- #include +- +-+#include "core.h" +- #include "fwil_types.h" +- #include "p2p.h" +- +diff --git a/package/kernel/mac80211/patches/351-0023-brcmfmac-add-missing-break-when-deleting-P2P_DEVICE.patch b/package/kernel/mac80211/patches/351-0023-brcmfmac-add-missing-break-when-deleting-P2P_DEVICE.patch +deleted file mode 100644 +index ab9a634..0000000 +--- a/package/kernel/mac80211/patches/351-0023-brcmfmac-add-missing-break-when-deleting-P2P_DEVICE.patch ++++ /dev/null +@@ -1,27 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Sun, 19 Jun 2016 01:55:57 +0200 +-Subject: [PATCH] brcmfmac: add missing break when deleting P2P_DEVICE +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-We obviously don't want to fall through in that switch. With this change +-1) We wait for event (triggered by p2p_disc) as expected +-2) We remove interface manually on timeout +-3) We return 0 on success instead of -ENOTSUPP +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -2263,6 +2263,8 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- return 0; +- brcmf_p2p_cancel_remain_on_channel(vif->ifp); +- brcmf_p2p_deinit_discovery(p2p); +-+ break; +-+ +- default: +- return -ENOTSUPP; +- } +diff --git a/package/kernel/mac80211/patches/351-0024-brcmfmac-delete-interface-directly-in-code-that-sent.patch b/package/kernel/mac80211/patches/351-0024-brcmfmac-delete-interface-directly-in-code-that-sent.patch +deleted file mode 100644 +index 6dd0c03..0000000 +--- a/package/kernel/mac80211/patches/351-0024-brcmfmac-delete-interface-directly-in-code-that-sent.patch ++++ /dev/null +@@ -1,75 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 29 Jun 2016 21:54:26 +0200 +-Subject: [PATCH] brcmfmac: delete interface directly in code that sent fw +- request +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-So far when receiving event about in-firmware-interface removal our +-event worker was notifying listener and afterwards it was removing Linux +-interface. +- +-First of all it was resulting in slightly unexpected order. The listener +-(del_virtual_intf callback) was (usually) returning with success before +-we even called unregister_netdev(ice). +- +-Please note this couldn't be simply fixed by changing order of calls in +-brcmf_fweh_handle_if_event as unregistering interface earlier could free +-struct brcmf_if. +- +-Another problem of current implementation are possible lockups. Focus on +-the time slot between calling event handler and removing Linux +-interface. During that time original caller may leave (unlocking rtnl +-semaphore) *and* another call to the same code may be done (locking it +-again). If that happens our event handler will stuck at removing Linux +-interface, it won't handle another event and will block process holding +-rtnl lock. +- +-This can be simply solved by unregistering interface in a proper +-callback, right after receiving confirmation event from firmware. This +-only required modifying worker to don't unregister on its own if there +-is someone waiting for the event. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +-@@ -18,6 +18,7 @@ +- #include "brcmu_wifi.h" +- #include "brcmu_utils.h" +- +-+#include "cfg80211.h" +- #include "core.h" +- #include "debug.h" +- #include "tracepoint.h" +-@@ -182,8 +183,13 @@ static void brcmf_fweh_handle_if_event(s +- +- err = brcmf_fweh_call_event_handler(ifp, emsg->event_code, emsg, data); +- +-- if (ifp && ifevent->action == BRCMF_E_IF_DEL) +-- brcmf_remove_interface(ifp, false); +-+ if (ifp && ifevent->action == BRCMF_E_IF_DEL) { +-+ bool armed = brcmf_cfg80211_vif_event_armed(drvr->config); +-+ +-+ /* Default handling in case no-one waits for this event */ +-+ if (!armed) +-+ brcmf_remove_interface(ifp, false); +-+ } +- } +- +- /** +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -2290,8 +2290,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- else +- err = 0; +- } +-- if (err) +-- brcmf_remove_interface(vif->ifp, true); +-+ brcmf_remove_interface(vif->ifp, true); +- +- brcmf_cfg80211_arm_vif_event(cfg, NULL); +- if (vif->wdev.iftype != NL80211_IFTYPE_P2P_DEVICE) +diff --git a/package/kernel/mac80211/patches/351-0025-brcmfmac-support-removing-AP-interfaces-with-interfa.patch b/package/kernel/mac80211/patches/351-0025-brcmfmac-support-removing-AP-interfaces-with-interfa.patch +deleted file mode 100644 +index 1929f0b..0000000 +--- a/package/kernel/mac80211/patches/351-0025-brcmfmac-support-removing-AP-interfaces-with-interfa.patch ++++ /dev/null +@@ -1,84 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 29 Jun 2016 21:54:27 +0200 +-Subject: [PATCH] brcmfmac: support removing AP interfaces with +- "interface_remove" +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-New firmwares (e.g. 10.10.69.36 for BCM4366) support "interface_remove" +-for removing interfaces. Try to use this method on cfg80211 request. In +-case of older firmwares (e.g. 7.35.177.56 for BCM43602 as I tested) this +-will just result in firmware rejecting command and this won't change any +-behavior. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -771,12 +771,48 @@ s32 brcmf_notify_escan_complete(struct b +- return err; +- } +- +-+static int brcmf_cfg80211_del_ap_iface(struct wiphy *wiphy, +-+ struct wireless_dev *wdev) +-+{ +-+ struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); +-+ struct net_device *ndev = wdev->netdev; +-+ struct brcmf_if *ifp = netdev_priv(ndev); +-+ int ret; +-+ int err; +-+ +-+ brcmf_cfg80211_arm_vif_event(cfg, ifp->vif); +-+ +-+ err = brcmf_fil_bsscfg_data_set(ifp, "interface_remove", NULL, 0); +-+ if (err) { +-+ brcmf_err("interface_remove failed %d\n", err); +-+ goto err_unarm; +-+ } +-+ +-+ /* wait for firmware event */ +-+ ret = brcmf_cfg80211_wait_vif_event(cfg, BRCMF_E_IF_DEL, +-+ BRCMF_VIF_EVENT_TIMEOUT); +-+ if (!ret) { +-+ brcmf_err("timeout occurred\n"); +-+ err = -EIO; +-+ goto err_unarm; +-+ } +-+ +-+ brcmf_remove_interface(ifp, true); +-+ +-+err_unarm: +-+ brcmf_cfg80211_arm_vif_event(cfg, NULL); +-+ return err; +-+} +-+ +- static +- int brcmf_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wdev) +- { +- struct brcmf_cfg80211_info *cfg = wiphy_priv(wiphy); +- struct net_device *ndev = wdev->netdev; +- +-+ if (ndev && ndev == cfg_to_ndev(cfg)) +-+ return -ENOTSUPP; +-+ +- /* vif event pending in firmware */ +- if (brcmf_cfg80211_vif_event_armed(cfg)) +- return -EBUSY; +-@@ -793,12 +829,13 @@ int brcmf_cfg80211_del_iface(struct wiph +- switch (wdev->iftype) { +- case NL80211_IFTYPE_ADHOC: +- case NL80211_IFTYPE_STATION: +-- case NL80211_IFTYPE_AP: +- case NL80211_IFTYPE_AP_VLAN: +- case NL80211_IFTYPE_WDS: +- case NL80211_IFTYPE_MONITOR: +- case NL80211_IFTYPE_MESH_POINT: +- return -EOPNOTSUPP; +-+ case NL80211_IFTYPE_AP: +-+ return brcmf_cfg80211_del_ap_iface(wiphy, wdev); +- case NL80211_IFTYPE_P2P_CLIENT: +- case NL80211_IFTYPE_P2P_GO: +- case NL80211_IFTYPE_P2P_DEVICE: +diff --git a/package/kernel/mac80211/patches/351-0026-brcmfmac-respect-hidden_ssid-for-AP-interfaces.patch b/package/kernel/mac80211/patches/351-0026-brcmfmac-respect-hidden_ssid-for-AP-interfaces.patch +deleted file mode 100644 +index ae458e7..0000000 +--- a/package/kernel/mac80211/patches/351-0026-brcmfmac-respect-hidden_ssid-for-AP-interfaces.patch ++++ /dev/null +@@ -1,43 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 6 Jul 2016 12:22:54 +0200 +-Subject: [PATCH] brcmfmac: respect hidden_ssid for AP interfaces +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This was succesfully tested with 4366B1. A small workaround is needed +-for the main interface otherwise it would stuck at the hidden state. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -4586,6 +4586,15 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- brcmf_err("SET SSID error (%d)\n", err); +- goto exit; +- } +-+ +-+ if (settings->hidden_ssid) { +-+ err = brcmf_fil_iovar_int_set(ifp, "closednet", 1); +-+ if (err) { +-+ brcmf_err("closednet error (%d)\n", err); +-+ goto exit; +-+ } +-+ } +-+ +- brcmf_dbg(TRACE, "AP mode configuration complete\n"); +- } else if (dev_role == NL80211_IFTYPE_P2P_GO) { +- err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); +-@@ -4644,6 +4653,10 @@ static int brcmf_cfg80211_stop_ap(struct +- return err; +- } +- +-+ /* First BSS doesn't get a full reset */ +-+ if (ifp->bsscfgidx == 0) +-+ brcmf_fil_iovar_int_set(ifp, "closednet", 0); +-+ +- memset(&join_params, 0, sizeof(join_params)); +- err = brcmf_fil_cmd_data_set(ifp, BRCMF_C_SET_SSID, +- &join_params, sizeof(join_params)); +diff --git a/package/kernel/mac80211/patches/351-0027-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch b/package/kernel/mac80211/patches/351-0027-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch +deleted file mode 100644 +index fcafa79..0000000 +--- a/package/kernel/mac80211/patches/351-0027-brcmfmac-restore-stopping-netdev-queue-when-bus-clog.patch ++++ /dev/null +@@ -1,53 +0,0 @@ +-From: Arend Van Spriel +-Date: Fri, 15 Jul 2016 12:16:12 +0200 +-Subject: [PATCH] brcmfmac: restore stopping netdev queue when bus clogs up +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-When the host-interface bus has hard time handling transmit packets +-it informs higher layer about this and it would stop the netdev +-queue when needed. However, since commit 9cd18359d31e ("brcmfmac: +-Make FWS queueing configurable.") this was broken. With this patch +-the behaviour is restored. +- +-Cc: stable@vger.kernel.org # v4.5, v4.6, v4.7 +-Fixes: 9cd18359d31e ("brcmfmac: Make FWS queueing configurable.") +-Tested-by: Per Förlin +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-@@ -2469,10 +2469,22 @@ void brcmf_fws_bustxfail(struct brcmf_fw +- void brcmf_fws_bus_blocked(struct brcmf_pub *drvr, bool flow_blocked) +- { +- struct brcmf_fws_info *fws = drvr->fws; +-+ struct brcmf_if *ifp; +-+ int i; +- +-- fws->bus_flow_blocked = flow_blocked; +-- if (!flow_blocked) +-- brcmf_fws_schedule_deq(fws); +-- else +-- fws->stats.bus_flow_block++; +-+ if (fws->avoid_queueing) { +-+ for (i = 0; i < BRCMF_MAX_IFS; i++) { +-+ ifp = drvr->iflist[i]; +-+ if (!ifp || !ifp->ndev) +-+ continue; +-+ brcmf_txflowblock_if(ifp, BRCMF_NETIF_STOP_REASON_FLOW, +-+ flow_blocked); +-+ } +-+ } else { +-+ fws->bus_flow_blocked = flow_blocked; +-+ if (!flow_blocked) +-+ brcmf_fws_schedule_deq(fws); +-+ else +-+ fws->stats.bus_flow_block++; +-+ } +- } +diff --git a/package/kernel/mac80211/patches/351-0028-brcmfmac-defer-DPC-processing-during-probe.patch b/package/kernel/mac80211/patches/351-0028-brcmfmac-defer-DPC-processing-during-probe.patch +deleted file mode 100644 +index a24c07f..0000000 +--- a/package/kernel/mac80211/patches/351-0028-brcmfmac-defer-DPC-processing-during-probe.patch ++++ /dev/null +@@ -1,42 +0,0 @@ +-From fd3ed33f51c2a586412d35b4f64803f019ab589f Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Fri, 15 Jul 2016 12:39:13 +0200 +-Subject: [PATCH] brcmfmac: defer DPC processing during probe +- +-The sdio dpc starts processing when in SDIOD_STATE_DATA. This state was +-entered right after firmware download. This patch moves that transition +-just before enabling sdio interrupt handling thus avoiding watchdog +-expiry which would put the bus to sleep while probing. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 7 +++---- +- 1 file changed, 3 insertions(+), 4 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -3304,10 +3304,6 @@ static int brcmf_sdio_download_firmware( +- goto err; +- } +- +-- /* Allow full data communication using DPC from now on. */ +-- brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA); +-- bcmerror = 0; +-- +- err: +- brcmf_sdio_clkctl(bus, CLK_SDONLY, false); +- sdio_release_host(bus->sdiodev->func[1]); +-@@ -4045,6 +4041,9 @@ static void brcmf_sdio_firmware_callback +- } +- +- if (err == 0) { +-+ /* Allow full data communication using DPC from now on. */ +-+ brcmf_sdiod_change_state(bus->sdiodev, BRCMF_SDIOD_DATA); +-+ +- err = brcmf_sdiod_intr_register(sdiodev); +- if (err != 0) +- brcmf_err("intr register failed:%d\n", err); +diff --git a/package/kernel/mac80211/patches/351-0029-brcmfmac-Fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch b/package/kernel/mac80211/patches/351-0029-brcmfmac-Fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch +deleted file mode 100644 +index ba9a349..0000000 +--- a/package/kernel/mac80211/patches/351-0029-brcmfmac-Fix-glob_skb-leak-in-brcmf_sdiod_recv_chain.patch ++++ /dev/null +@@ -1,32 +0,0 @@ +-From 3bdae810721b33061d2e541bd78a70f86ca42af3 Mon Sep 17 00:00:00 2001 +-From: Florian Fainelli +-Date: Mon, 18 Jul 2016 16:24:34 -0700 +-Subject: [PATCH] brcmfmac: Fix glob_skb leak in brcmf_sdiod_recv_chain +- +-In case brcmf_sdiod_recv_chain() cannot complete a succeful call to +-brcmf_sdiod_buffrw, we would be leaking glom_skb and not free it as we +-should, fix this. +- +-Reported-by: coverity (CID 1164856) +-Fixes: a413e39a38573 ("brcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support") +-Signed-off-by: Florian Fainelli +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 4 +++- +- 1 file changed, 3 insertions(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -722,8 +722,10 @@ int brcmf_sdiod_recv_chain(struct brcmf_ +- return -ENOMEM; +- err = brcmf_sdiod_buffrw(sdiodev, SDIO_FUNC_2, false, addr, +- glom_skb); +-- if (err) +-+ if (err) { +-+ brcmu_pkt_buf_free_skb(glom_skb); +- goto done; +-+ } +- +- skb_queue_walk(pktq, skb) { +- memcpy(skb->data, glom_skb->data, skb->len); +diff --git a/package/kernel/mac80211/patches/351-0030-net-wireless-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch b/package/kernel/mac80211/patches/351-0030-net-wireless-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch +deleted file mode 100644 +index 540b7f0..0000000 +--- a/package/kernel/mac80211/patches/351-0030-net-wireless-broadcom-brcm80211-brcmfmac-usb-don-t-p.patch ++++ /dev/null +@@ -1,34 +0,0 @@ +-From 938f89e50a41c2d56710805fb019ad7618cef84b Mon Sep 17 00:00:00 2001 +-From: Wolfram Sang +-Date: Thu, 11 Aug 2016 23:05:31 +0200 +-Subject: [PATCH] net: wireless: broadcom: brcm80211: brcmfmac: usb: don't +- print error when allocating urb fails +- +-kmalloc will print enough information in case of failure. +- +-Signed-off-by: Wolfram Sang +-Signed-off-by: David S. Miller +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 8 ++------ +- 1 file changed, 2 insertions(+), 6 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-@@ -1099,15 +1099,11 @@ struct brcmf_usbdev *brcmf_usb_attach(st +- devinfo->tx_freecount = ntxq; +- +- devinfo->ctl_urb = usb_alloc_urb(0, GFP_ATOMIC); +-- if (!devinfo->ctl_urb) { +-- brcmf_err("usb_alloc_urb (ctl) failed\n"); +-+ if (!devinfo->ctl_urb) +- goto error; +-- } +- devinfo->bulk_urb = usb_alloc_urb(0, GFP_ATOMIC); +-- if (!devinfo->bulk_urb) { +-- brcmf_err("usb_alloc_urb (bulk) failed\n"); +-+ if (!devinfo->bulk_urb) +- goto error; +-- } +- +- return &devinfo->bus_pub; +- +diff --git a/package/kernel/mac80211/patches/351-0031-brcmfmac-Check-rtnl_lock-is-locked-when-removing-int.patch b/package/kernel/mac80211/patches/351-0031-brcmfmac-Check-rtnl_lock-is-locked-when-removing-int.patch +deleted file mode 100644 +index b98b68a..0000000 +--- a/package/kernel/mac80211/patches/351-0031-brcmfmac-Check-rtnl_lock-is-locked-when-removing-int.patch ++++ /dev/null +@@ -1,111 +0,0 @@ +-From 15dacf880e49ce3ecee05eb1a0c6b8e363dbacdc Mon Sep 17 00:00:00 2001 +-From: "mhiramat@kernel.org" +-Date: Mon, 15 Aug 2016 18:40:57 +0900 +-Subject: [PATCH] brcmfmac: Check rtnl_lock is locked when removing interface +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Check rtnl_lock is locked in brcmf_p2p_ifp_removed() by passing +-rtnl_locked flag. Actually the caller brcmf_del_if() checks whether +-the rtnl_lock is locked, but doesn't pass it to brcmf_p2p_ifp_removed(). +- +-Without this fix, wpa_supplicant goes softlockup with rtnl_lock +-holding (this means all other process using netlink are locked up too) +- +-e.g. +-[ 4495.876627] INFO: task wpa_supplicant:7307 blocked for more than 10 seconds. +-[ 4495.876632] Tainted: G W 4.8.0-rc1+ #8 +-[ 4495.876635] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. +-[ 4495.876638] wpa_supplicant D ffff974c647b39a0 0 7307 1 0x00000000 +-[ 4495.876644] ffff974c647b39a0 0000000000000000 ffff974c00000000 ffff974c7dc59c58 +-[ 4495.876651] ffff974c6b7417c0 ffff974c645017c0 ffff974c647b4000 ffffffff86f16c08 +-[ 4495.876657] ffff974c645017c0 0000000000000246 00000000ffffffff ffff974c647b39b8 +-[ 4495.876664] Call Trace: +-[ 4495.876671] [] schedule+0x3c/0x90 +-[ 4495.876676] [] schedule_preempt_disabled+0x15/0x20 +-[ 4495.876682] [] mutex_lock_nested+0x176/0x3b0 +-[ 4495.876686] [] ? rtnl_lock+0x17/0x20 +-[ 4495.876690] [] rtnl_lock+0x17/0x20 +-[ 4495.876720] [] brcmf_p2p_ifp_removed+0x4d/0x70 [brcmfmac] +-[ 4495.876741] [] brcmf_remove_interface+0x196/0x1b0 [brcmfmac] +-[ 4495.876760] [] brcmf_p2p_del_vif+0x111/0x220 [brcmfmac] +-[ 4495.876777] [] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac] +-[ 4495.876820] [] nl80211_del_interface+0xfe/0x3a0 [cfg80211] +-[ 4495.876825] [] genl_family_rcv_msg+0x1b5/0x370 +-[ 4495.876832] [] ? trace_hardirqs_on+0xd/0x10 +-[ 4495.876836] [] genl_rcv_msg+0x7d/0xb0 +-[ 4495.876839] [] ? genl_family_rcv_msg+0x370/0x370 +-[ 4495.876846] [] netlink_rcv_skb+0x97/0xb0 +-[ 4495.876849] [] genl_rcv+0x28/0x40 +-[ 4495.876854] [] netlink_unicast+0x1d3/0x2f0 +-[ 4495.876860] [] ? netlink_unicast+0x14b/0x2f0 +-[ 4495.876866] [] netlink_sendmsg+0x2eb/0x3a0 +-[ 4495.876870] [] sock_sendmsg+0x38/0x50 +-[ 4495.876874] [] ___sys_sendmsg+0x27f/0x290 +-[ 4495.876882] [] ? mntput_no_expire+0x5/0x3f0 +-[ 4495.876888] [] ? mntput_no_expire+0x8e/0x3f0 +-[ 4495.876894] [] ? mntput_no_expire+0x5/0x3f0 +-[ 4495.876899] [] ? mntput+0x24/0x40 +-[ 4495.876904] [] ? __fput+0x190/0x200 +-[ 4495.876909] [] __sys_sendmsg+0x45/0x80 +-[ 4495.876914] [] SyS_sendmsg+0x12/0x20 +-[ 4495.876918] [] entry_SYSCALL_64_fastpath+0x23/0xc1 +-[ 4495.876924] [] ? trace_hardirqs_off_caller+0x1f/0xc0 +- +-Signed-off-by: Masami Hiramatsu +-Acked-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 2 +- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 8 +++++--- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h | 2 +- +- 3 files changed, 7 insertions(+), 5 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -743,7 +743,7 @@ static void brcmf_del_if(struct brcmf_pu +- * serious troublesome side effects. The p2p module will clean +- * up the ifp if needed. +- */ +-- brcmf_p2p_ifp_removed(ifp); +-+ brcmf_p2p_ifp_removed(ifp, rtnl_locked); +- kfree(ifp); +- } +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +-@@ -2299,7 +2299,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiph +- return err; +- } +- +--void brcmf_p2p_ifp_removed(struct brcmf_if *ifp) +-+void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked) +- { +- struct brcmf_cfg80211_info *cfg; +- struct brcmf_cfg80211_vif *vif; +-@@ -2308,9 +2308,11 @@ void brcmf_p2p_ifp_removed(struct brcmf_ +- vif = ifp->vif; +- cfg = wdev_to_cfg(&vif->wdev); +- cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; +-- rtnl_lock(); +-+ if (!rtnl_locked) +-+ rtnl_lock(); +- cfg80211_unregister_wdev(&vif->wdev); +-- rtnl_unlock(); +-+ if (!rtnl_locked) +-+ rtnl_unlock(); +- brcmf_free_vif(vif); +- } +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h +-@@ -155,7 +155,7 @@ struct wireless_dev *brcmf_p2p_add_vif(s +- int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev); +- int brcmf_p2p_ifchange(struct brcmf_cfg80211_info *cfg, +- enum brcmf_fil_p2p_if_types if_type); +--void brcmf_p2p_ifp_removed(struct brcmf_if *ifp); +-+void brcmf_p2p_ifp_removed(struct brcmf_if *ifp, bool rtnl_locked); +- int brcmf_p2p_start_device(struct wiphy *wiphy, struct wireless_dev *wdev); +- void brcmf_p2p_stop_device(struct wiphy *wiphy, struct wireless_dev *wdev); +- int brcmf_p2p_scan_prep(struct wiphy *wiphy, +diff --git a/package/kernel/mac80211/patches/351-0032-brcmfmac-Change-vif_event_lock-to-spinlock.patch b/package/kernel/mac80211/patches/351-0032-brcmfmac-Change-vif_event_lock-to-spinlock.patch +deleted file mode 100644 +index 30ca258..0000000 +--- a/package/kernel/mac80211/patches/351-0032-brcmfmac-Change-vif_event_lock-to-spinlock.patch ++++ /dev/null +@@ -1,175 +0,0 @@ +-From b64abcb7dae6060c67ab0e548da3ef923c49641d Mon Sep 17 00:00:00 2001 +-From: "mhiramat@kernel.org" +-Date: Mon, 15 Aug 2016 18:41:12 +0900 +-Subject: [PATCH] brcmfmac: Change vif_event_lock to spinlock +- +-Change vif_event_lock to spinlock from mutex, since this lock is +-used in wait_event_timeout() via vif_event_equals(). This caused +-a warning report as below. +- +-As far as I can see, this lock protects regions where updating +-structure members, not function calls. Also, since those +-regions are not called from interrupt handlers (of course, it +-was a mutex), spin_lock is used instead of spin_lock_irqsave. +- +-[ 186.678550] ------------[ cut here ]------------ +-[ 186.678556] WARNING: CPU: 2 PID: 7140 at /home/mhiramat/ksrc/linux/kernel/sched/core.c:7545 __might_sleep+0x7c/0x80 +-[ 186.678560] do not call blocking ops when !TASK_RUNNING; state=2 set at [] prepare_to_wait_event+0x60/0x100 +-[ 186.678560] Modules linked in: brcmfmac xt_CHECKSUM rfcomm ipt_MASQUERADE nf_nat_masquerade_ipv4 xt_addrtype br_netfilter xt_tcpudp ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 ipt_REJECT nf_reject_ipv4 xt_conntrack ip_set nfnetlink ebtable_nat ebtable_broute bridge stp llc ebtable_filter ebtables ip6table_raw ip6table_security ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv6 ip6table_mangle ip6table_filter ip6_tables iptable_raw iptable_security iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack iptable_mangle iptable_filter ip_tables x_tables bnep nls_iso8859_1 i2c_designware_platform i2c_designware_core snd_hda_codec_hdmi snd_hda_codec_realtek dcdbas snd_hda_codec_generic snd_hda_intel snd_hda_codec intel_rapl snd_hda_core x86_pkg_temp_thermal intel_powerclamp coretemp +-[ 186.678594] snd_pcm crct10dif_pclmul crc32_pclmul aesni_intel aes_x86_64 joydev glue_helper snd_hwdep lrw gf128mul uvcvideo ablk_helper snd_seq_midi cryptd snd_seq_midi_event snd_rawmidi videobuf2_vmalloc videobuf2_memops snd_seq input_leds videobuf2_v4l2 cfg80211 videobuf2_core snd_timer videodev serio_raw btusb snd_seq_device media btrtl rtsx_pci_ms snd mei_me memstick hid_multitouch mei soundcore brcmutil idma64 virt_dma intel_lpss_pci processor_thermal_device intel_soc_dts_iosf hci_uart btbcm btqca btintel bluetooth int3403_thermal dell_smo8800 intel_lpss_acpi intel_lpss int3402_thermal int340x_thermal_zone intel_hid mac_hid int3400_thermal shpchp sparse_keymap acpi_pad acpi_thermal_rel acpi_als kfifo_buf industrialio kvm_intel kvm irqbypass parport_pc ppdev lp parport autofs4 btrfs xor raid6_pq +-[ 186.678631] usbhid nouveau ttm i915 rtsx_pci_sdmmc mxm_wmi i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops psmouse drm ahci rtsx_pci nvme nvme_core libahci i2c_hid hid pinctrl_sunrisepoint video wmi pinctrl_intel fjes [last unloaded: brcmfmac] +-[ 186.678646] CPU: 2 PID: 7140 Comm: wpa_supplicant Not tainted 4.8.0-rc1+ #8 +-[ 186.678647] Hardware name: Dell Inc. XPS 15 9550/0N7TVV, BIOS 01.02.00 04/07/2016 +-[ 186.678648] 0000000000000000 ffff9d8c64b5b900 ffffffff98442f23 ffff9d8c64b5b950 +-[ 186.678651] 0000000000000000 ffff9d8c64b5b940 ffffffff9808b22b 00001d790000000d +-[ 186.678653] ffffffff98c75e78 000000000000026c 0000000000000000 ffff9d8c2706d058 +-[ 186.678655] Call Trace: +-[ 186.678659] [] dump_stack+0x85/0xc2 +-[ 186.678666] [] __warn+0xcb/0xf0 +-[ 186.678668] [] warn_slowpath_fmt+0x4f/0x60 +-[ 186.678671] [] ? prepare_to_wait_event+0x60/0x100 +-[ 186.678672] [] ? prepare_to_wait_event+0x60/0x100 +-[ 186.678674] [] __might_sleep+0x7c/0x80 +-[ 186.678680] [] mutex_lock_nested+0x33/0x3b0 +-[ 186.678682] [] ? trace_hardirqs_on+0xd/0x10 +-[ 186.678689] [] brcmf_cfg80211_wait_vif_event+0xcd/0x130 [brcmfmac] +-[ 186.678691] [] ? wake_atomic_t_function+0x60/0x60 +-[ 186.678697] [] brcmf_p2p_del_vif+0xf9/0x220 [brcmfmac] +-[ 186.678702] [] brcmf_cfg80211_del_iface+0x21b/0x270 [brcmfmac] +-[ 186.678716] [] nl80211_del_interface+0xfe/0x3a0 [cfg80211] +-[ 186.678718] [] genl_family_rcv_msg+0x1b5/0x370 +-[ 186.678720] [] ? trace_hardirqs_on+0xd/0x10 +-[ 186.678721] [] genl_rcv_msg+0x7d/0xb0 +-[ 186.678722] [] ? genl_family_rcv_msg+0x370/0x370 +-[ 186.678724] [] netlink_rcv_skb+0x97/0xb0 +-[ 186.678726] [] genl_rcv+0x28/0x40 +-[ 186.678727] [] netlink_unicast+0x1d3/0x2f0 +-[ 186.678729] [] ? netlink_unicast+0x14b/0x2f0 +-[ 186.678731] [] netlink_sendmsg+0x2eb/0x3a0 +-[ 186.678733] [] sock_sendmsg+0x38/0x50 +-[ 186.678734] [] ___sys_sendmsg+0x27f/0x290 +-[ 186.678737] [] ? mntput_no_expire+0x5/0x3f0 +-[ 186.678739] [] ? mntput_no_expire+0x8e/0x3f0 +-[ 186.678741] [] ? mntput_no_expire+0x5/0x3f0 +-[ 186.678743] [] ? mntput+0x24/0x40 +-[ 186.678744] [] ? __fput+0x190/0x200 +-[ 186.678746] [] __sys_sendmsg+0x45/0x80 +-[ 186.678748] [] SyS_sendmsg+0x12/0x20 +-[ 186.678749] [] entry_SYSCALL_64_fastpath+0x23/0xc1 +-[ 186.678751] [] ? trace_hardirqs_off_caller+0x1f/0xc0 +-[ 186.678752] ---[ end trace e224d66c5d8408b5 ]--- +- +-Signed-off-by: Masami Hiramatsu +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 26 +++++++++++----------- +- .../broadcom/brcm80211/brcmfmac/cfg80211.h | 2 +- +- 2 files changed, 14 insertions(+), 14 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -5555,7 +5555,7 @@ static s32 brcmf_notify_vif_event(struct +- ifevent->action, ifevent->flags, ifevent->ifidx, +- ifevent->bsscfgidx); +- +-- mutex_lock(&event->vif_event_lock); +-+ spin_lock(&event->vif_event_lock); +- event->action = ifevent->action; +- vif = event->vif; +- +-@@ -5563,7 +5563,7 @@ static s32 brcmf_notify_vif_event(struct +- case BRCMF_E_IF_ADD: +- /* waiting process may have timed out */ +- if (!cfg->vif_event.vif) { +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- return -EBADF; +- } +- +-@@ -5574,24 +5574,24 @@ static s32 brcmf_notify_vif_event(struct +- ifp->ndev->ieee80211_ptr = &vif->wdev; +- SET_NETDEV_DEV(ifp->ndev, wiphy_dev(cfg->wiphy)); +- } +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- wake_up(&event->vif_wq); +- return 0; +- +- case BRCMF_E_IF_DEL: +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- /* event may not be upon user request */ +- if (brcmf_cfg80211_vif_event_armed(cfg)) +- wake_up(&event->vif_wq); +- return 0; +- +- case BRCMF_E_IF_CHANGE: +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- wake_up(&event->vif_wq); +- return 0; +- +- default: +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- break; +- } +- return -EINVAL; +-@@ -5712,7 +5712,7 @@ static void wl_deinit_priv(struct brcmf_ +- static void init_vif_event(struct brcmf_cfg80211_vif_event *event) +- { +- init_waitqueue_head(&event->vif_wq); +-- mutex_init(&event->vif_event_lock); +-+ spin_lock_init(&event->vif_event_lock); +- } +- +- static s32 brcmf_dongle_roam(struct brcmf_if *ifp) +-@@ -6607,9 +6607,9 @@ static inline bool vif_event_equals(stru +- { +- u8 evt_action; +- +-- mutex_lock(&event->vif_event_lock); +-+ spin_lock(&event->vif_event_lock); +- evt_action = event->action; +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- return evt_action == action; +- } +- +-@@ -6618,10 +6618,10 @@ void brcmf_cfg80211_arm_vif_event(struct +- { +- struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; +- +-- mutex_lock(&event->vif_event_lock); +-+ spin_lock(&event->vif_event_lock); +- event->vif = vif; +- event->action = 0; +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- } +- +- bool brcmf_cfg80211_vif_event_armed(struct brcmf_cfg80211_info *cfg) +-@@ -6629,9 +6629,9 @@ bool brcmf_cfg80211_vif_event_armed(stru +- struct brcmf_cfg80211_vif_event *event = &cfg->vif_event; +- bool armed; +- +-- mutex_lock(&event->vif_event_lock); +-+ spin_lock(&event->vif_event_lock); +- armed = event->vif != NULL; +-- mutex_unlock(&event->vif_event_lock); +-+ spin_unlock(&event->vif_event_lock); +- +- return armed; +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h +-@@ -227,7 +227,7 @@ struct escan_info { +- */ +- struct brcmf_cfg80211_vif_event { +- wait_queue_head_t vif_wq; +-- struct mutex vif_event_lock; +-+ spinlock_t vif_event_lock; +- u8 action; +- struct brcmf_cfg80211_vif *vif; +- }; +diff --git a/package/kernel/mac80211/patches/351-0033-brcmfmac-add-missing-header-dependencies.patch b/package/kernel/mac80211/patches/351-0033-brcmfmac-add-missing-header-dependencies.patch +deleted file mode 100644 +index 1a7947b..0000000 +--- a/package/kernel/mac80211/patches/351-0033-brcmfmac-add-missing-header-dependencies.patch ++++ /dev/null +@@ -1,29 +0,0 @@ +-From 8af92af3f2d55db143417a5d401696f4b642009a Mon Sep 17 00:00:00 2001 +-From: Baoyou Xie +-Date: Mon, 29 Aug 2016 20:39:35 +0800 +-Subject: [PATCH] brcmfmac: add missing header dependencies +- +-We get 1 warning when building kernel with W=1: +- +-drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c:23:6: warning: no previous prototype for '__brcmf_err' [-Wmissing-prototypes] +- +-In fact, this function is declared in brcmfmac/debug.h, so this patch +-adds missing header dependencies. +- +-Signed-off-by: Baoyou Xie +-Acked-by: Arnd Bergmann +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c | 1 + +- 1 file changed, 1 insertion(+) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/tracepoint.c +-@@ -19,6 +19,7 @@ +- #ifndef __CHECKER__ +- #define CREATE_TRACE_POINTS +- #include "tracepoint.h" +-+#include "debug.h" +- +- void __brcmf_err(const char *func, const char *fmt, ...) +- { +diff --git a/package/kernel/mac80211/patches/351-0034-brcmfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch b/package/kernel/mac80211/patches/351-0034-brcmfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch +deleted file mode 100644 +index 24cd92a..0000000 +--- a/package/kernel/mac80211/patches/351-0034-brcmfmac-Add-USB-ID-for-Cisco-Linksys-AE1200.patch ++++ /dev/null +@@ -1,51 +0,0 @@ +-From bccf3ffc8c6d8e0251a15541bb4d12b423c4f729 Mon Sep 17 00:00:00 2001 +-From: Ismael Luceno +-Date: Mon, 22 Aug 2016 19:40:07 -0300 +-Subject: [PATCH] brcmfmac: Add USB ID for Cisco Linksys AE1200 +- +-The AE1200 comes with different revisions of the BCM43235 chipset, +-but all have the same USB ID. Only revision 3 can be supported. +- +-Signed-off-by: Ismael Luceno +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 4 ++++ +- drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h | 2 ++ +- 2 files changed, 6 insertions(+) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +-@@ -1456,11 +1456,15 @@ static int brcmf_usb_reset_resume(struct +- #define BRCMF_USB_DEVICE(dev_id) \ +- { USB_DEVICE(BRCM_USB_VENDOR_ID_BROADCOM, dev_id) } +- +-+#define LINKSYS_USB_DEVICE(dev_id) \ +-+ { USB_DEVICE(BRCM_USB_VENDOR_ID_LINKSYS, dev_id) } +-+ +- static struct usb_device_id brcmf_usb_devid_table[] = { +- BRCMF_USB_DEVICE(BRCM_USB_43143_DEVICE_ID), +- BRCMF_USB_DEVICE(BRCM_USB_43236_DEVICE_ID), +- BRCMF_USB_DEVICE(BRCM_USB_43242_DEVICE_ID), +- BRCMF_USB_DEVICE(BRCM_USB_43569_DEVICE_ID), +-+ LINKSYS_USB_DEVICE(BRCM_USB_43235_LINKSYS_DEVICE_ID), +- { USB_DEVICE(BRCM_USB_VENDOR_ID_LG, BRCM_USB_43242_LG_DEVICE_ID) }, +- /* special entry for device with firmware loaded and running */ +- BRCMF_USB_DEVICE(BRCM_USB_BCMFW_DEVICE_ID), +---- a/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/include/brcm_hw_ids.h +-@@ -22,6 +22,7 @@ +- +- #define BRCM_USB_VENDOR_ID_BROADCOM 0x0a5c +- #define BRCM_USB_VENDOR_ID_LG 0x043e +-+#define BRCM_USB_VENDOR_ID_LINKSYS 0x13b1 +- #define BRCM_PCIE_VENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM +- +- /* Chipcommon Core Chip IDs */ +-@@ -56,6 +57,7 @@ +- +- /* USB Device IDs */ +- #define BRCM_USB_43143_DEVICE_ID 0xbd1e +-+#define BRCM_USB_43235_LINKSYS_DEVICE_ID 0x0039 +- #define BRCM_USB_43236_DEVICE_ID 0xbd17 +- #define BRCM_USB_43242_DEVICE_ID 0xbd1f +- #define BRCM_USB_43242_LG_DEVICE_ID 0x3101 +diff --git a/package/kernel/mac80211/patches/351-0035-brcmfmac-fix-pmksa-bssid-usage.patch b/package/kernel/mac80211/patches/351-0035-brcmfmac-fix-pmksa-bssid-usage.patch +deleted file mode 100644 +index b58a266..0000000 +--- a/package/kernel/mac80211/patches/351-0035-brcmfmac-fix-pmksa-bssid-usage.patch ++++ /dev/null +@@ -1,51 +0,0 @@ +-From 7703773ef1d85b40433902a8da20167331597e4a Mon Sep 17 00:00:00 2001 +-From: Nicolas Iooss +-Date: Tue, 23 Aug 2016 11:37:17 +0200 +-Subject: [PATCH] brcmfmac: fix pmksa->bssid usage +- +-The struct cfg80211_pmksa defines its bssid field as: +- +- const u8 *bssid; +- +-contrary to struct brcmf_pmksa, which uses: +- +- u8 bssid[ETH_ALEN]; +- +-Therefore in brcmf_cfg80211_del_pmksa(), &pmksa->bssid takes the address +-of this field (of type u8**), not the one of its content (which would be +-u8*). Remove the & operator to make brcmf_dbg("%pM") and memcmp() +-behave as expected. +- +-This bug have been found using a custom static checker (which checks the +-usage of %p... attributes at build time). It has been introduced in +-commit 6c404f34f2bd ("brcmfmac: Cleanup pmksa cache handling code"), +-which replaced pmksa->bssid by &pmksa->bssid while refactoring the code, +-without modifying struct cfg80211_pmksa definition. +- +-Replace &pmk[i].bssid with pmk[i].bssid too to make the code clearer, +-this change does not affect the semantic. +- +-Fixes: 6c404f34f2bd ("brcmfmac: Cleanup pmksa cache handling code") +-Cc: stable@vger.kernel.org +-Signed-off-by: Nicolas Iooss +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4 ++-- +- 1 file changed, 2 insertions(+), 2 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -3804,11 +3804,11 @@ brcmf_cfg80211_del_pmksa(struct wiphy *w +- if (!check_vif_up(ifp->vif)) +- return -EIO; +- +-- brcmf_dbg(CONN, "del_pmksa - PMK bssid = %pM\n", &pmksa->bssid); +-+ brcmf_dbg(CONN, "del_pmksa - PMK bssid = %pM\n", pmksa->bssid); +- +- npmk = le32_to_cpu(cfg->pmk_list.npmk); +- for (i = 0; i < npmk; i++) +-- if (!memcmp(&pmksa->bssid, &pmk[i].bssid, ETH_ALEN)) +-+ if (!memcmp(pmksa->bssid, pmk[i].bssid, ETH_ALEN)) +- break; +- +- if ((npmk > 0) && (i < npmk)) { +diff --git a/package/kernel/mac80211/patches/351-0036-brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg.patch b/package/kernel/mac80211/patches/351-0036-brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg.patch +deleted file mode 100644 +index 760b6da..0000000 +--- a/package/kernel/mac80211/patches/351-0036-brcmfmac-avoid-potential-stack-overflow-in-brcmf_cfg.patch ++++ /dev/null +@@ -1,34 +0,0 @@ +-From ded89912156b1a47d940a0c954c43afbabd0c42c Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 5 Sep 2016 10:45:47 +0100 +-Subject: [PATCH] brcmfmac: avoid potential stack overflow in +- brcmf_cfg80211_start_ap() +- +-User-space can choose to omit NL80211_ATTR_SSID and only provide raw +-IE TLV data. When doing so it can provide SSID IE with length exceeding +-the allowed size. The driver further processes this IE copying it +-into a local variable without checking the length. Hence stack can be +-corrupted and used as exploit. +- +-Cc: stable@vger.kernel.org # v4.7 +-Reported-by: Daxing Guo +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -4447,7 +4447,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- (u8 *)&settings->beacon.head[ie_offset], +- settings->beacon.head_len - ie_offset, +- WLAN_EID_SSID); +-- if (!ssid_ie) +-+ if (!ssid_ie || ssid_ie->len > IEEE80211_MAX_SSID_LEN) +- return -EINVAL; +- +- memcpy(ssid_le.SSID, ssid_ie->data, ssid_ie->len); +diff --git a/package/kernel/mac80211/patches/351-0037-brcmfmac-add-support-for-bcm4339-chip-with-modalias-.patch b/package/kernel/mac80211/patches/351-0037-brcmfmac-add-support-for-bcm4339-chip-with-modalias-.patch +deleted file mode 100644 +index 1285b30..0000000 +--- a/package/kernel/mac80211/patches/351-0037-brcmfmac-add-support-for-bcm4339-chip-with-modalias-.patch ++++ /dev/null +@@ -1,55 +0,0 @@ +-From 634faf3686900ccdee87b77e2c56df8b2159912b Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 5 Sep 2016 11:42:12 +0100 +-Subject: [PATCH] brcmfmac: add support for bcm4339 chip with modalias +- sdio:c00v02D0d4339 +- +-The driver already supports the bcm4339 chipset but only for the variant +-that shares the same modalias as the bcm4335, ie. sdio:c00v02D0d4335. +-It turns out that there are also bcm4339 devices out there that have a +-more distiguishable modalias sdio:c00v02D0d4339. +- +-Reported-by: Steve deRosier +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 1 + +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 3 ++- +- include/linux/mmc/sdio_ids.h | 1 + +- 3 files changed, 4 insertions(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -1097,6 +1097,7 @@ static const struct sdio_device_id brcmf +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), +-+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4339), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4345), +- BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4354), +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -3756,7 +3756,8 @@ static u32 brcmf_sdio_buscore_read32(voi +- u32 val, rev; +- +- val = brcmf_sdiod_regrl(sdiodev, addr, NULL); +-- if (sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 && +-+ if ((sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4335_4339 || +-+ sdiodev->func[0]->device == SDIO_DEVICE_ID_BROADCOM_4339) && +- addr == CORE_CC_REG(SI_ENUM_BASE, chipid)) { +- rev = (val & CID_REV_MASK) >> CID_REV_SHIFT; +- if (rev >= 2) { +---- a/include/linux/mmc/sdio_ids.h +-+++ b/include/linux/mmc/sdio_ids.h +-@@ -32,6 +32,7 @@ +- #define SDIO_DEVICE_ID_BROADCOM_43340 0xa94c +- #define SDIO_DEVICE_ID_BROADCOM_43341 0xa94d +- #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 +-+#define SDIO_DEVICE_ID_BROADCOM_4339 0x4339 +- #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 +- #define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6 +- #define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 +diff --git a/package/kernel/mac80211/patches/351-0038-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch b/package/kernel/mac80211/patches/351-0038-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch +deleted file mode 100644 +index 1d5667e..0000000 +--- a/package/kernel/mac80211/patches/351-0038-brcmfmac-sdio-shorten-retry-loop-in-brcmf_sdio_kso_c.patch ++++ /dev/null +@@ -1,56 +0,0 @@ +-From 5251b6be8bb5c5675bdf12347c7b83937a5c91e5 Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 5 Sep 2016 11:42:13 +0100 +-Subject: [PATCH] brcmfmac: sdio: shorten retry loop in +- brcmf_sdio_kso_control() +- +-In brcmf_sdio_kso_control() there is a retry loop as hardware may take +-time to settle. However, when the call to brcmf_sdiod_regrb() returns +-an error it is due to SDIO access failure and it makes no sense to wait +-for hardware to settle. This patch aborts the loop after a number of +-subsequent access errors. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 11 +++++++++-- +- 1 file changed, 9 insertions(+), 2 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +-@@ -313,6 +313,7 @@ struct rte_console { +- +- #define KSO_WAIT_US 50 +- #define MAX_KSO_ATTEMPTS (PMU_MAX_TRANSITION_DLY/KSO_WAIT_US) +-+#define BRCMF_SDIO_MAX_ACCESS_ERRORS 5 +- +- /* +- * Conversion of 802.1D priority to precedence level +-@@ -675,6 +676,7 @@ brcmf_sdio_kso_control(struct brcmf_sdio +- { +- u8 wr_val = 0, rd_val, cmp_val, bmask; +- int err = 0; +-+ int err_cnt = 0; +- int try_cnt = 0; +- +- brcmf_dbg(TRACE, "Enter: on=%d\n", on); +-@@ -710,9 +712,14 @@ brcmf_sdio_kso_control(struct brcmf_sdio +- */ +- rd_val = brcmf_sdiod_regrb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, +- &err); +-- if (((rd_val & bmask) == cmp_val) && !err) +-+ if (!err) { +-+ if ((rd_val & bmask) == cmp_val) +-+ break; +-+ err_cnt = 0; +-+ } +-+ /* bail out upon subsequent access errors */ +-+ if (err && (err_cnt++ > BRCMF_SDIO_MAX_ACCESS_ERRORS)) +- break; +-- +- udelay(KSO_WAIT_US); +- brcmf_sdiod_regwb(bus->sdiodev, SBSDIO_FUNC1_SLEEPCSR, +- wr_val, &err); +diff --git a/package/kernel/mac80211/patches/351-0039-brcmfmac-ignore-11d-configuration-errors.patch b/package/kernel/mac80211/patches/351-0039-brcmfmac-ignore-11d-configuration-errors.patch +deleted file mode 100644 +index 1620e00..0000000 +--- a/package/kernel/mac80211/patches/351-0039-brcmfmac-ignore-11d-configuration-errors.patch ++++ /dev/null +@@ -1,84 +0,0 @@ +-From b3589dfe02123a0d0ea82076a9f8ef84a46852c0 Mon Sep 17 00:00:00 2001 +-From: Hante Meuleman +-Date: Mon, 19 Sep 2016 12:09:51 +0100 +-Subject: [PATCH] brcmfmac: ignore 11d configuration errors +- +-802.11d is not always supported by firmware anymore. Currently the +-AP configuration of 11d will cause an abort if the ioctl set is +-failing. This behavior is not correct and the error should be +-ignored. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 27 ++++++++++++---------- +- 1 file changed, 15 insertions(+), 12 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -4422,6 +4422,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- u16 chanspec = chandef_to_chanspec(&cfg->d11inf, &settings->chandef); +- bool mbss; +- int is_11d; +-+ bool supports_11d; +- +- brcmf_dbg(TRACE, "ctrlchn=%d, center=%d, bw=%d, beacon_interval=%d, dtim_period=%d,\n", +- settings->chandef.chan->hw_value, +-@@ -4434,11 +4435,16 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- mbss = ifp->vif->mbss; +- +- /* store current 11d setting */ +-- brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY, &ifp->vif->is_11d); +-- country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, +-- settings->beacon.tail_len, +-- WLAN_EID_COUNTRY); +-- is_11d = country_ie ? 1 : 0; +-+ if (brcmf_fil_cmd_int_get(ifp, BRCMF_C_GET_REGULATORY, +-+ &ifp->vif->is_11d)) { +-+ supports_11d = false; +-+ } else { +-+ country_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, +-+ settings->beacon.tail_len, +-+ WLAN_EID_COUNTRY); +-+ is_11d = country_ie ? 1 : 0; +-+ supports_11d = true; +-+ } +- +- memset(&ssid_le, 0, sizeof(ssid_le)); +- if (settings->ssid == NULL || settings->ssid_len == 0) { +-@@ -4497,7 +4503,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- +- /* Parameters shared by all radio interfaces */ +- if (!mbss) { +-- if (is_11d != ifp->vif->is_11d) { +-+ if ((supports_11d) && (is_11d != ifp->vif->is_11d)) { +- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, +- is_11d); +- if (err < 0) { +-@@ -4539,7 +4545,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wi +- brcmf_err("SET INFRA error %d\n", err); +- goto exit; +- } +-- } else if (WARN_ON(is_11d != ifp->vif->is_11d)) { +-+ } else if (WARN_ON(supports_11d && (is_11d != ifp->vif->is_11d))) { +- /* Multiple-BSS should use same 11d configuration */ +- err = -EINVAL; +- goto exit; +-@@ -4673,11 +4679,8 @@ static int brcmf_cfg80211_stop_ap(struct +- brcmf_err("setting INFRA mode failed %d\n", err); +- if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MBSS)) +- brcmf_fil_iovar_int_set(ifp, "mbss", 0); +-- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, +-- ifp->vif->is_11d); +-- if (err < 0) +-- brcmf_err("restoring REGULATORY setting failed %d\n", +-- err); +-+ brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_REGULATORY, +-+ ifp->vif->is_11d); +- /* Bring device back up so it can be used again */ +- err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_UP, 1); +- if (err < 0) +diff --git a/package/kernel/mac80211/patches/351-0040-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch b/package/kernel/mac80211/patches/351-0040-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch +deleted file mode 100644 +index 9461164..0000000 +--- a/package/kernel/mac80211/patches/351-0040-brcmfmac-rework-pointer-trickery-in-brcmf_proto_bcdc.patch ++++ /dev/null +@@ -1,32 +0,0 @@ +-From 704d1c6b56f4ee2ad6a5f012a72a278d17c1a223 Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 19 Sep 2016 12:09:52 +0100 +-Subject: [PATCH] brcmfmac: rework pointer trickery in +- brcmf_proto_bcdc_query_dcmd() +- +-The variable info is assigned to point to bcdc->msg[1], which is the +-same as pointing to bcdc->buf. As that is what we want to access +-make it clear by fixing the assignment. This also avoid out-of-bounds +-errors from static analyzers are bcdc->msg[1] is not in the structure +-definition. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcdc.c +-@@ -194,7 +194,7 @@ retry: +- } +- +- /* Check info buffer */ +-- info = (void *)&msg[1]; +-+ info = (void *)&bcdc->buf[0]; +- +- /* Copy info buffer */ +- if (buf) { +diff --git a/package/kernel/mac80211/patches/351-0041-brcmfmac-fix-memory-leak-in-brcmf_flowring_add_tdls_.patch b/package/kernel/mac80211/patches/351-0041-brcmfmac-fix-memory-leak-in-brcmf_flowring_add_tdls_.patch +deleted file mode 100644 +index 2ececdf..0000000 +--- a/package/kernel/mac80211/patches/351-0041-brcmfmac-fix-memory-leak-in-brcmf_flowring_add_tdls_.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From bc981641360183990de59da17f9f560f9150b801 Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 19 Sep 2016 12:09:53 +0100 +-Subject: [PATCH] brcmfmac: fix memory leak in brcmf_flowring_add_tdls_peer() +- +-In the error paths in brcmf_flowring_add_tdls_peer() the allocated +-resource should be freed. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 8 ++++++-- +- 1 file changed, 6 insertions(+), 2 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +-@@ -495,14 +495,18 @@ void brcmf_flowring_add_tdls_peer(struct +- } else { +- search = flow->tdls_entry; +- if (memcmp(search->mac, peer, ETH_ALEN) == 0) +-- return; +-+ goto free_entry; +- while (search->next) { +- search = search->next; +- if (memcmp(search->mac, peer, ETH_ALEN) == 0) +-- return; +-+ goto free_entry; +- } +- search->next = tdls_entry; +- } +- +- flow->tdls_active = true; +-+ return; +-+ +-+free_entry: +-+ kfree(tdls_entry); +- } +diff --git a/package/kernel/mac80211/patches/351-0042-brcmfmac-initialize-variable-in-brcmf_sdiod_regrl.patch b/package/kernel/mac80211/patches/351-0042-brcmfmac-initialize-variable-in-brcmf_sdiod_regrl.patch +deleted file mode 100644 +index 529cc8d..0000000 +--- a/package/kernel/mac80211/patches/351-0042-brcmfmac-initialize-variable-in-brcmf_sdiod_regrl.patch ++++ /dev/null +@@ -1,28 +0,0 @@ +-From 26305d3d7298d1ddf8fd4ce95a382aa90534f0a3 Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 19 Sep 2016 12:09:54 +0100 +-Subject: [PATCH] brcmfmac: initialize variable in brcmf_sdiod_regrl() +- +-In case of an error the variable returned is uninitialized. The caller +-will probably check the error code before using it, but better assure +-it is set to zero. +- +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +-@@ -416,7 +416,7 @@ u8 brcmf_sdiod_regrb(struct brcmf_sdio_d +- +- u32 brcmf_sdiod_regrl(struct brcmf_sdio_dev *sdiodev, u32 addr, int *ret) +- { +-- u32 data; +-+ u32 data = 0; +- int retval; +- +- brcmf_dbg(SDIO, "addr:0x%08x\n", addr); +diff --git a/package/kernel/mac80211/patches/351-0043-brcmfmac-remove-worker-from-.ndo_set_mac_address-cal.patch b/package/kernel/mac80211/patches/351-0043-brcmfmac-remove-worker-from-.ndo_set_mac_address-cal.patch +deleted file mode 100644 +index 67af30e..0000000 +--- a/package/kernel/mac80211/patches/351-0043-brcmfmac-remove-worker-from-.ndo_set_mac_address-cal.patch ++++ /dev/null +@@ -1,107 +0,0 @@ +-From 8fa5fdec09cd379c9ecb8972f344f8f308e0ccf3 Mon Sep 17 00:00:00 2001 +-From: Arend Van Spriel +-Date: Mon, 19 Sep 2016 12:09:55 +0100 +-Subject: [PATCH] brcmfmac: remove worker from .ndo_set_mac_address() callback +- +-As it turns out there is no need to use a worker for the callback +-because it is not called from atomic context. +- +-Reported-by: Dan Williams +-Reviewed-by: Hante Meuleman +-Reviewed-by: Pieter-Paul Giesberts +-Reviewed-by: Franky Lin +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- .../wireless/broadcom/brcm80211/brcmfmac/core.c | 39 ++++++++-------------- +- .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 -- +- 2 files changed, 13 insertions(+), 28 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -136,27 +136,6 @@ static void _brcmf_set_multicast_list(st +- err); +- } +- +--static void +--_brcmf_set_mac_address(struct work_struct *work) +--{ +-- struct brcmf_if *ifp; +-- s32 err; +-- +-- ifp = container_of(work, struct brcmf_if, setmacaddr_work); +-- +-- brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +-- +-- err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", ifp->mac_addr, +-- ETH_ALEN); +-- if (err < 0) { +-- brcmf_err("Setting cur_etheraddr failed, %d\n", err); +-- } else { +-- brcmf_dbg(TRACE, "MAC address updated to %pM\n", +-- ifp->mac_addr); +-- memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN); +-- } +--} +-- +- #if IS_ENABLED(CONFIG_IPV6) +- static void _brcmf_update_ndtable(struct work_struct *work) +- { +-@@ -190,10 +169,20 @@ static int brcmf_netdev_set_mac_address( +- { +- struct brcmf_if *ifp = netdev_priv(ndev); +- struct sockaddr *sa = (struct sockaddr *)addr; +-+ int err; +- +-- memcpy(&ifp->mac_addr, sa->sa_data, ETH_ALEN); +-- schedule_work(&ifp->setmacaddr_work); +-- return 0; +-+ brcmf_dbg(TRACE, "Enter, bsscfgidx=%d\n", ifp->bsscfgidx); +-+ +-+ err = brcmf_fil_iovar_data_set(ifp, "cur_etheraddr", sa->sa_data, +-+ ETH_ALEN); +-+ if (err < 0) { +-+ brcmf_err("Setting cur_etheraddr failed, %d\n", err); +-+ } else { +-+ brcmf_dbg(TRACE, "updated to %pM\n", sa->sa_data); +-+ memcpy(ifp->mac_addr, sa->sa_data, ETH_ALEN); +-+ memcpy(ifp->ndev->dev_addr, ifp->mac_addr, ETH_ALEN); +-+ } +-+ return err; +- } +- +- static void brcmf_netdev_set_multicast_list(struct net_device *ndev) +-@@ -525,7 +514,6 @@ int brcmf_net_attach(struct brcmf_if *if +- /* set the mac address */ +- memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN); +- +-- INIT_WORK(&ifp->setmacaddr_work, _brcmf_set_mac_address); +- INIT_WORK(&ifp->multicast_work, _brcmf_set_multicast_list); +- INIT_WORK(&ifp->ndoffload_work, _brcmf_update_ndtable); +- +-@@ -730,7 +718,6 @@ static void brcmf_del_if(struct brcmf_pu +- } +- +- if (ifp->ndev->netdev_ops == &brcmf_netdev_ops_pri) { +-- cancel_work_sync(&ifp->setmacaddr_work); +- cancel_work_sync(&ifp->multicast_work); +- cancel_work_sync(&ifp->ndoffload_work); +- } +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -176,7 +176,6 @@ enum brcmf_netif_stop_reason { +- * @vif: points to cfg80211 specific interface information. +- * @ndev: associated network device. +- * @stats: interface specific network statistics. +-- * @setmacaddr_work: worker object for setting mac address. +- * @multicast_work: worker object for multicast provisioning. +- * @ndoffload_work: worker object for neighbor discovery offload configuration. +- * @fws_desc: interface specific firmware-signalling descriptor. +-@@ -193,7 +192,6 @@ struct brcmf_if { +- struct brcmf_cfg80211_vif *vif; +- struct net_device *ndev; +- struct net_device_stats stats; +-- struct work_struct setmacaddr_work; +- struct work_struct multicast_work; +- struct work_struct ndoffload_work; +- struct brcmf_fws_mac_descriptor *fws_desc; +diff --git a/package/kernel/mac80211/patches/351-0044-brcmfmac-remove-unnecessary-null-pointer-check.patch b/package/kernel/mac80211/patches/351-0044-brcmfmac-remove-unnecessary-null-pointer-check.patch +deleted file mode 100644 +index 5a08479..0000000 +--- a/package/kernel/mac80211/patches/351-0044-brcmfmac-remove-unnecessary-null-pointer-check.patch ++++ /dev/null +@@ -1,31 +0,0 @@ +-From 835680b82f029818c813324aed3073cdcf63241f Mon Sep 17 00:00:00 2001 +-From: Hante Meuleman +-Date: Mon, 19 Sep 2016 12:09:56 +0100 +-Subject: [PATCH] brcmfmac: remove unnecessary null pointer check +- +-in the function brcmf_bus_start() in the exception handling a +-check is made to dermine whether ifp is null, though this is not +-possible. Removing the unnessary check. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 +-- +- 1 file changed, 1 insertion(+), 2 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -1048,8 +1048,7 @@ fail: +- brcmf_fws_del_interface(ifp); +- brcmf_fws_deinit(drvr); +- } +-- if (ifp) +-- brcmf_net_detach(ifp->ndev, false); +-+ brcmf_net_detach(ifp->ndev, false); +- if (p2p_ifp) +- brcmf_net_detach(p2p_ifp->ndev, false); +- drvr->iflist[0] = NULL; +diff --git a/package/kernel/mac80211/patches/351-0045-brcmfmac-fix-clearing-entry-IPv6-address.patch b/package/kernel/mac80211/patches/351-0045-brcmfmac-fix-clearing-entry-IPv6-address.patch +deleted file mode 100644 +index 0b3a23e..0000000 +--- a/package/kernel/mac80211/patches/351-0045-brcmfmac-fix-clearing-entry-IPv6-address.patch ++++ /dev/null +@@ -1,37 +0,0 @@ +-From 2b7425f3629b38c438f890c20c5faeca64b144ff Mon Sep 17 00:00:00 2001 +-From: Hante Meuleman +-Date: Mon, 19 Sep 2016 12:09:57 +0100 +-Subject: [PATCH] brcmfmac: fix clearing entry IPv6 address +- +-When IPv6 address is to be cleared there is a possible out of +-bound access. But also the clearing of the last entry and the +-adjustment of total number of stored IPv6 addresses is not +-updated. This patch fixes that bug. Bug was found using coverity. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 7 +++++-- +- 1 file changed, 5 insertions(+), 2 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -873,9 +873,12 @@ static int brcmf_inet6addr_changed(struc +- } +- break; +- case NETDEV_DOWN: +-- if (i < NDOL_MAX_ENTRIES) +-- for (; i < ifp->ipv6addr_idx; i++) +-+ if (i < NDOL_MAX_ENTRIES) { +-+ for (; i < ifp->ipv6addr_idx - 1; i++) +- table[i] = table[i + 1]; +-+ memset(&table[i], 0, sizeof(table[i])); +-+ ifp->ipv6addr_idx--; +-+ } +- break; +- default: +- break; +diff --git a/package/kernel/mac80211/patches/351-0046-brcmfmac-fix-out-of-bound-access-on-clearing-wowl-wa.patch b/package/kernel/mac80211/patches/351-0046-brcmfmac-fix-out-of-bound-access-on-clearing-wowl-wa.patch +deleted file mode 100644 +index a47cb32..0000000 +--- a/package/kernel/mac80211/patches/351-0046-brcmfmac-fix-out-of-bound-access-on-clearing-wowl-wa.patch ++++ /dev/null +@@ -1,44 +0,0 @@ +-From a7ed7828ecda0c2b5e0d7f55dedd4230afd4b583 Mon Sep 17 00:00:00 2001 +-From: Hante Meuleman +-Date: Mon, 19 Sep 2016 12:09:58 +0100 +-Subject: [PATCH] brcmfmac: fix out of bound access on clearing wowl wake +- indicator +- +-Clearing the wowl wakeindicator happens with a rather odd +-construction where the string "clear" is used to set the iovar +-wowl_wakeind. This was implemented incorrectly as it caused an +-out of bound access. Use an intermediate variable of correct +-length and copy string in that. Problem was found using coverity. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 6 ++++-- +- 1 file changed, 4 insertions(+), 2 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -3623,6 +3623,7 @@ static void brcmf_configure_wowl(struct +- struct cfg80211_wowlan *wowl) +- { +- u32 wowl_config; +-+ struct brcmf_wowl_wakeind_le wowl_wakeind; +- u32 i; +- +- brcmf_dbg(TRACE, "Suspend, wowl config.\n"); +-@@ -3664,8 +3665,9 @@ static void brcmf_configure_wowl(struct +- if (!test_bit(BRCMF_VIF_STATUS_CONNECTED, &ifp->vif->sme_state)) +- wowl_config |= BRCMF_WOWL_UNASSOC; +- +-- brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", "clear", +-- sizeof(struct brcmf_wowl_wakeind_le)); +-+ memcpy(&wowl_wakeind, "clear", 6); +-+ brcmf_fil_iovar_data_set(ifp, "wowl_wakeind", &wowl_wakeind, +-+ sizeof(wowl_wakeind)); +- brcmf_fil_iovar_int_set(ifp, "wowl", wowl_config); +- brcmf_fil_iovar_int_set(ifp, "wowl_activate", 1); +- brcmf_bus_wowl_config(cfg->pub->bus_if, true); +diff --git a/package/kernel/mac80211/patches/351-0047-brcmfmac-simplify-mapping-of-auth-type.patch b/package/kernel/mac80211/patches/351-0047-brcmfmac-simplify-mapping-of-auth-type.patch +deleted file mode 100644 +index a652ae6..0000000 +--- a/package/kernel/mac80211/patches/351-0047-brcmfmac-simplify-mapping-of-auth-type.patch ++++ /dev/null +@@ -1,39 +0,0 @@ +-From 92c313604711a0976def79dabb9e8da3cc2cc780 Mon Sep 17 00:00:00 2001 +-From: Hante Meuleman +-Date: Mon, 19 Sep 2016 12:09:59 +0100 +-Subject: [PATCH] brcmfmac: simplify mapping of auth type +- +-The 802.11 standard only has four valid auth type configurations of which +-our firmware only supports two, ie. Open System and Shared Key. Simplify +-the mapping falling back to automatic for other types specified by +-user-space. +- +-Reviewed-by: Arend Van Spriel +-Reviewed-by: Franky Lin +-Reviewed-by: Pieter-Paul Giesberts +-Signed-off-by: Hante Meuleman +-Signed-off-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 8 +------- +- 1 file changed, 1 insertion(+), 7 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -1577,15 +1577,9 @@ static s32 brcmf_set_auth_type(struct ne +- val = 1; +- brcmf_dbg(CONN, "shared key\n"); +- break; +-- case NL80211_AUTHTYPE_AUTOMATIC: +-- val = 2; +-- brcmf_dbg(CONN, "automatic\n"); +-- break; +-- case NL80211_AUTHTYPE_NETWORK_EAP: +-- brcmf_dbg(CONN, "network eap\n"); +- default: +- val = 2; +-- brcmf_err("invalid auth type (%d)\n", sme->auth_type); +-+ brcmf_dbg(CONN, "automatic, auth type (%d)\n", sme->auth_type); +- break; +- } +- +diff --git a/package/kernel/mac80211/patches/351-0048-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch b/package/kernel/mac80211/patches/351-0048-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch +deleted file mode 100644 +index a6fae37..0000000 +--- a/package/kernel/mac80211/patches/351-0048-brcmfmac-fix-memory-leak-in-brcmf_fill_bss_param.patch ++++ /dev/null +@@ -1,41 +0,0 @@ +-From 23e9c128adb2038c27a424a5f91136e7fa3e0dc6 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Wed, 21 Sep 2016 08:23:24 +0200 +-Subject: [PATCH] brcmfmac: fix memory leak in brcmf_fill_bss_param +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-This function is called from get_station callback which means that every +-time user space was getting/dumping station(s) we were leaking 2 KiB. +- +-Signed-off-by: Rafał Miłecki +-Fixes: 1f0dc59a6de ("brcmfmac: rework .get_station() callback") +-Cc: stable@vger.kernel.org # 4.2+ +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 5 ++++- +- 1 file changed, 4 insertions(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +-@@ -2463,7 +2463,7 @@ static void brcmf_fill_bss_param(struct +- WL_BSS_INFO_MAX); +- if (err) { +- brcmf_err("Failed to get bss info (%d)\n", err); +-- return; +-+ goto out_kfree; +- } +- si->filled |= BIT(NL80211_STA_INFO_BSS_PARAM); +- si->bss_param.beacon_interval = le16_to_cpu(buf->bss_le.beacon_period); +-@@ -2475,6 +2475,9 @@ static void brcmf_fill_bss_param(struct +- si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_PREAMBLE; +- if (capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) +- si->bss_param.flags |= BSS_PARAM_FLAGS_SHORT_SLOT_TIME; +-+ +-+out_kfree: +-+ kfree(buf); +- } +- +- static s32 +diff --git a/package/kernel/mac80211/patches/351-0049-brcmfmac-drop-unused-fields-from-struct-brcmf_pub.patch b/package/kernel/mac80211/patches/351-0049-brcmfmac-drop-unused-fields-from-struct-brcmf_pub.patch +deleted file mode 100644 +index 47af73a..0000000 +--- a/package/kernel/mac80211/patches/351-0049-brcmfmac-drop-unused-fields-from-struct-brcmf_pub.patch ++++ /dev/null +@@ -1,60 +0,0 @@ +-From 2df86ad959c9d1cdbeb2f23a0801857731156692 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Fri, 23 Sep 2016 15:27:46 +0200 +-Subject: [PATCH] brcmfmac: drop unused fields from struct brcmf_pub +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-They seem to be there from the first day. We calculate these values but +-never use them. +- +-Signed-off-by: Rafał Miłecki +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 --- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h | 4 ---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c | 2 -- +- 3 files changed, 9 deletions(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -508,9 +508,6 @@ int brcmf_net_attach(struct brcmf_if *if +- ndev->hard_header_len += drvr->hdrlen; +- ndev->ethtool_ops = &brcmf_ethtool_ops; +- +-- drvr->rxsz = ndev->mtu + ndev->hard_header_len + +-- drvr->hdrlen; +-- +- /* set the mac address */ +- memcpy(ndev->dev_addr, ifp->mac_addr, ETH_ALEN); +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +-@@ -112,15 +112,11 @@ struct brcmf_pub { +- +- /* Internal brcmf items */ +- uint hdrlen; /* Total BRCMF header length (proto + bus) */ +-- uint rxsz; /* Rx buffer size bus module should use */ +- +- /* Dongle media info */ +- char fwver[BRCMF_DRIVER_FIRMWARE_VERSION_LEN]; +- u8 mac[ETH_ALEN]; /* MAC address obtained from dongle */ +- +-- /* Multicast data packets sent to dongle */ +-- unsigned long tx_multicast; +-- +- struct mac_address addresses[BRCMF_MAX_IFS]; +- +- struct brcmf_if *iflist[BRCMF_MAX_IFS]; +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwsignal.c +-@@ -2104,8 +2104,6 @@ int brcmf_fws_process_skb(struct brcmf_i +- if (!skb->priority) +- skb->priority = cfg80211_classify8021d(skb, NULL); +- +-- drvr->tx_multicast += !!multicast; +-- +- if (fws->avoid_queueing) { +- rc = brcmf_proto_txdata(drvr, ifp->ifidx, 0, skb); +- if (rc < 0) +diff --git a/package/kernel/mac80211/patches/351-0050-brcmfmac-replace-WARNING-on-timeout-with-a-simple-er.patch b/package/kernel/mac80211/patches/351-0050-brcmfmac-replace-WARNING-on-timeout-with-a-simple-er.patch +deleted file mode 100644 +index ca4863a..0000000 +--- a/package/kernel/mac80211/patches/351-0050-brcmfmac-replace-WARNING-on-timeout-with-a-simple-er.patch ++++ /dev/null +@@ -1,38 +0,0 @@ +-From 2f0e56fa37cce60a5ac5d451bcadec51cd711436 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Tue, 27 Sep 2016 12:12:24 +0200 +-Subject: [PATCH] brcmfmac: replace WARNING on timeout with a simple error +- message +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Even with timeout increased to 950 ms we get WARNINGs from time to time. +-It mostly happens on A-MPDU stalls (e.g. when station goes out of +-range). It may take up to 5-10 secods for the firmware to recover and +-for that time it doesn't process packets. +- +-It's still useful to have a message on time out as it may indicate some +-firmware problem and incorrect key update. Raising a WARNING however +-wasn't really that necessary, it doesn't point to any driver bug anymore +-and backtrace wasn't much useful. +- +-Signed-off-by: Rafał Miłecki +-Acked-by: Arend van Spriel +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c | 3 ++- +- 1 file changed, 2 insertions(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +-@@ -1155,7 +1155,8 @@ int brcmf_netdev_wait_pend8021x(struct b +- !brcmf_get_pend_8021x_cnt(ifp), +- MAX_WAIT_FOR_8021X_TX); +- +-- WARN_ON(!err); +-+ if (!err) +-+ brcmf_err("Timed out waiting for no pending 802.1x packets\n"); +- +- return !err; +- } +diff --git a/package/kernel/mac80211/patches/351-0051-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch b/package/kernel/mac80211/patches/351-0051-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch +deleted file mode 100644 +index 6976359..0000000 +--- a/package/kernel/mac80211/patches/351-0051-brcmfmac-use-correct-skb-freeing-helper-when-deletin.patch ++++ /dev/null +@@ -1,58 +0,0 @@ +-From 7f00ee2bbc630900ba16fc2690473f3e2db0e264 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Tue, 27 Sep 2016 14:11:04 +0200 +-Subject: [PATCH] brcmfmac: use correct skb freeing helper when deleting +- flowring +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-Flowrings contain skbs waiting for transmission that were passed to us +-by netif. It means we checked every one of them looking for 802.1x +-Ethernet type. When deleting flowring we have to use freeing function +-that will check for 802.1x type as well. +- +-Freeing skbs without a proper check was leading to counter not being +-properly decreased. This was triggering a WARNING every time +-brcmf_netdev_wait_pend8021x was called. +- +-Signed-off-by: Rafał Miłecki +-Acked-by: Arend van Spriel +-Cc: stable@vger.kernel.org # 4.5+ +-Signed-off-by: Kalle Valo +---- +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c | 9 ++++++++- +- 1 file changed, 8 insertions(+), 1 deletion(-) +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/flowring.c +-@@ -234,13 +234,20 @@ static void brcmf_flowring_block(struct +- +- void brcmf_flowring_delete(struct brcmf_flowring *flow, u16 flowid) +- { +-+ struct brcmf_bus *bus_if = dev_get_drvdata(flow->dev); +- struct brcmf_flowring_ring *ring; +-+ struct brcmf_if *ifp; +- u16 hash_idx; +-+ u8 ifidx; +- struct sk_buff *skb; +- +- ring = flow->rings[flowid]; +- if (!ring) +- return; +-+ +-+ ifidx = brcmf_flowring_ifidx_get(flow, flowid); +-+ ifp = brcmf_get_ifp(bus_if->drvr, ifidx); +-+ +- brcmf_flowring_block(flow, flowid, false); +- hash_idx = ring->hash_id; +- flow->hash[hash_idx].ifidx = BRCMF_FLOWRING_INVALID_IFIDX; +-@@ -249,7 +256,7 @@ void brcmf_flowring_delete(struct brcmf_ +- +- skb = skb_dequeue(&ring->skblist); +- while (skb) { +-- brcmu_pkt_buf_free_skb(skb); +-+ brcmf_txfinalize(ifp, skb, false); +- skb = skb_dequeue(&ring->skblist); +- } +- diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/402-ath_regd_optional.patch index 7351353..4634283 100644 --- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch @@ -13545,6 +22300,38 @@ index 06c731f..f8f555f 100644 hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; +diff --git a/package/kernel/mac80211/patches/860-brcmfmac-add-missing-eth_type_trans-call.patch b/package/kernel/mac80211/patches/860-brcmfmac-add-missing-eth_type_trans-call.patch +deleted file mode 100644 +index e265354..0000000 +--- a/package/kernel/mac80211/patches/860-brcmfmac-add-missing-eth_type_trans-call.patch ++++ /dev/null +@@ -1,26 +0,0 @@ +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Subject: [PATCH] brcmfmac: add missing eth_type_trans call +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-There are 2 protocols supported by brcmfmac and msgbuf one was missing a +-proper skb setup before passing it to the netif. This was triggering +-"NULL pointer dereference". +- +-Fixes: 9c349892ccc9 ("brcmfmac: revise handling events in receive path") +-Signed-off-by: Rafał Miłecki +---- +- +---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +-@@ -1157,6 +1157,9 @@ brcmf_msgbuf_process_rx_complete(struct +- brcmu_pkt_buf_free_skb(skb); +- return; +- } +-+ +-+ skb->protocol = eth_type_trans(skb, ifp->ndev); +-+ +- brcmf_netif_rx(ifp, skb); +- } +- diff --git a/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/860-brcmfmac-register-wiphy-s-during-module_init.patch new file mode 100644 index 0000000..ae571c9 @@ -13650,7 +22437,7 @@ index 0000000..ae571c9 + int brcmf_fw_get_firmwares(struct device *dev, u16 flags, diff --git a/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch deleted file mode 100644 -index 00181f6..0000000 +index f7f44f5..0000000 --- a/package/kernel/mac80211/patches/861-brcmfmac-register-wiphy-s-during-module_init.patch +++ /dev/null @@ -1,97 +0,0 @@ @@ -13669,8 +22456,8 @@ index 00181f6..0000000 - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c --@@ -1332,6 +1332,7 @@ static int __init brcmfmac_module_init(v -- #endif +-@@ -1200,6 +1200,7 @@ int __init brcmf_core_init(void) +- { - if (!schedule_work(&brcmf_driver_work)) - return -EBUSY; -+ flush_work(&brcmf_driver_work); @@ -13842,7 +22629,7 @@ index 0000000..f301fe1 + diff --git a/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch deleted file mode 100644 -index 4295b4b..0000000 +index 1e440c0..0000000 --- a/package/kernel/mac80211/patches/862-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch +++ /dev/null @@ -1,50 +0,0 @@ @@ -13858,7 +22645,7 @@ index 4295b4b..0000000 - ---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c --@@ -615,9 +615,37 @@ static struct wireless_dev *brcmf_cfg802 +-@@ -651,9 +651,37 @@ static struct wireless_dev *brcmf_cfg802 - u32 *flags, - struct vif_params *params) - { @@ -13890,7 +22677,7 @@ index 4295b4b..0000000 -+ dev = dev_get_by_name(&init_net, name); -+ if (dev) { -+ dev_put(dev); --+ return ERR_PTR(-EEXIST); +-+ return ERR_PTR(-ENFILE); -+ } -+ - brcmf_dbg(TRACE, "enter: %s type %d\n", name, type); @@ -14074,14 +22861,14 @@ index e49dd48..bd851e6 100644 $(PKG_BUILD_DIR)/firmware/mt7662.bin \ $(1)/lib/firmware diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile -index 091928d..b36486d 100644 +index f59943d..b36486d 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi --PKG_VERSION:=10.3.0.16-20160105 +-PKG_VERSION:=10.3.0.18-20160804 +PKG_VERSION:=10.3.0.18-20160823-1 PKG_RELEASE=1 @@ -14090,7 +22877,7 @@ index 091928d..b36486d 100644 PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) --PKG_SOURCE_VERSION:=99d3879cc72f2a25d44fb4bee96fd84eca028b04 +-PKG_SOURCE_VERSION:=d48847cc83954930fdcd98818bbf33e75707b8e1 +PKG_SOURCE_VERSION:=af606563453c819fac156faf2b15b9caef844329 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz @@ -14104,129 +22891,6 @@ index 091928d..b36486d 100644 FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko AUTOLOAD:=$(call AutoLoad,50,mac80211 mwlwifi) endef -diff --git a/package/kernel/mwlwifi/patches/100-drop_old_api.patch b/package/kernel/mwlwifi/patches/100-drop_old_api.patch -deleted file mode 100644 -index d2e149e..0000000 ---- a/package/kernel/mwlwifi/patches/100-drop_old_api.patch -+++ /dev/null -@@ -1,92 +0,0 @@ ----- a/main.c --+++ b/main.c --@@ -418,11 +418,7 @@ static void mwl_set_ht_caps(struct mwl_p -- band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_20; -- band->ht_cap.cap |= IEEE80211_HT_CAP_SGI_40; -- ---#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) --- hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION; ---#else -- ieee80211_hw_set(hw, AMPDU_AGGREGATION); ---#endif -- band->ht_cap.ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; -- band->ht_cap.ampdu_density = IEEE80211_HT_MPDU_DENSITY_4; -- --@@ -524,29 +520,16 @@ static int mwl_wl_init(struct mwl_priv * -- hw->queues = SYSADPT_TX_WMM_QUEUES; -- -- /* Set rssi values to dBm */ ---#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) --- hw->flags |= IEEE80211_HW_SIGNAL_DBM | IEEE80211_HW_HAS_RATE_CONTROL; ---#else -- ieee80211_hw_set(hw, SIGNAL_DBM); -- ieee80211_hw_set(hw, HAS_RATE_CONTROL); ---#endif -- -- /* Ask mac80211 not to trigger PS mode -- * based on PM bit of incoming frames. -- */ ---#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) --- hw->flags |= IEEE80211_HW_AP_LINK_PS; ---#else -- ieee80211_hw_set(hw, AP_LINK_PS); ---#endif -- ---#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 2, 0) --- hw->flags |= IEEE80211_HW_SUPPORTS_PER_STA_GTK | --- IEEE80211_HW_MFP_CAPABLE; ---#else -- ieee80211_hw_set(hw, SUPPORTS_PER_STA_GTK); -- ieee80211_hw_set(hw, MFP_CAPABLE); ---#endif -- -- hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN; -- ----- a/dev.h --+++ b/dev.h --@@ -484,10 +484,6 @@ static inline struct mwl_sta *mwl_dev_ge -- return (struct mwl_sta *)&sta->drv_priv; -- } -- ---#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) ---#define ether_addr_copy(dst, src) memcpy(dst, src, ETH_ALEN) ---#endif --- -- /* Defined in mac80211.c. */ -- extern const struct ieee80211_ops mwl_mac80211_ops; -- ----- a/mac80211.c --+++ b/mac80211.c --@@ -572,19 +572,11 @@ static int mwl_mac80211_get_survey(struc -- return 0; -- } -- ---#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0) ---static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, --- struct ieee80211_vif *vif, --- enum ieee80211_ampdu_mlme_action action, --- struct ieee80211_sta *sta, --- u16 tid, u16 *ssn, u8 buf_size) ---#else -- static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, -- struct ieee80211_vif *vif, -- enum ieee80211_ampdu_mlme_action action, -- struct ieee80211_sta *sta, -- u16 tid, u16 *ssn, u8 buf_size, bool amsdu) ---#endif -- { -- int rc = 0; -- struct mwl_priv *priv = hw->priv; ----- a/rx.c --+++ b/rx.c --@@ -232,10 +232,8 @@ static inline void mwl_rx_prepare_status -- status->flag |= RX_FLAG_VHT; -- if (bw == RX_RATE_INFO_HT40) -- status->flag |= RX_FLAG_40MHZ; ---#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 18, 0) -- if (bw == RX_RATE_INFO_HT80) -- status->vht_flag |= RX_VHT_FLAG_80MHZ; ---#endif -- if (gi == RX_RATE_INFO_SHORT_INTERVAL) -- status->flag |= RX_FLAG_SHORT_GI; -- status->vht_nss = (nss + 1); -diff --git a/package/kernel/mwlwifi/patches/110-api_sync.patch b/package/kernel/mwlwifi/patches/110-api_sync.patch -deleted file mode 100644 -index ed3e06a..0000000 ---- a/package/kernel/mwlwifi/patches/110-api_sync.patch -+++ /dev/null -@@ -1,19 +0,0 @@ ----- a/mac80211.c --+++ b/mac80211.c --@@ -597,10 +597,13 @@ static int mwl_mac80211_get_survey(struc -- -- static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, -- struct ieee80211_vif *vif, --- enum ieee80211_ampdu_mlme_action action, --- struct ieee80211_sta *sta, --- u16 tid, u16 *ssn, u8 buf_size, bool amsdu) --+ struct ieee80211_ampdu_params *params) -- { --+ enum ieee80211_ampdu_mlme_action action = params->action; --+ struct ieee80211_sta *sta = params->sta; --+ u16 tid = params->tid; --+ u16 *ssn = ¶ms->ssn; --+ u8 buf_size = params->buf_size; -- int rc = 0; -- struct mwl_priv *priv = hw->priv; -- struct mwl_ampdu_stream *stream; diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index aee2a15..645888e 100644 --- a/package/network/services/hostapd/Config.in @@ -16525,6 +25189,60 @@ index 3088f6a..0000000 --- -1.9.1 - +diff --git a/package/network/services/hostapd/patches/014-nl80211-Try-running-without-mgmt-frame-subscription-.patch b/package/network/services/hostapd/patches/014-nl80211-Try-running-without-mgmt-frame-subscription-.patch +deleted file mode 100644 +index 25ba87d..0000000 +--- a/package/network/services/hostapd/patches/014-nl80211-Try-running-without-mgmt-frame-subscription-.patch ++++ /dev/null +@@ -1,48 +0,0 @@ +-From f4830bed661f4adff51f50a0d37c64ceb748e780 Mon Sep 17 00:00:00 2001 +-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +-Date: Mon, 25 Apr 2016 17:10:47 +0200 +-Subject: [PATCH] nl80211: Try running without mgmt frame subscription (driver +- AP SME) +-MIME-Version: 1.0 +-Content-Type: text/plain; charset=UTF-8 +-Content-Transfer-Encoding: 8bit +- +-One of supported code paths already allows this scenario. It is used if +-driver doesn't report NL80211_ATTR_DEVICE_AP_SME and doesn't support +-monitor interface. In such situation: +-1) We don't quit if subscribing for WLAN_FC_STYPE_PROBE_REQ fails +-2) We don't try subscribing for WLAN_FC_STYPE_ACTION +-3) We fallback to AP SME mode after failing to create monitor interface +-4) We don't quit if subscribing for WLAN_FC_STYPE_PROBE_REQ fails +-Above scenario is used, e.g., with brcmfmac. As you can see - thanks to +-events provided by cfg80211 - it's not really required to receive Probe +-Request or action frames. +- +-However, the previous implementation did not allow using hostapd with +-drivers that: +-1) Report NL80211_ATTR_DEVICE_AP_SME +-2) Don't support subscribing for PROBE_REQ and/or ACTION frames +-In case of using such a driver hostapd will cancel setup after failing +-to subscribe for WLAN_FC_STYPE_ACTION. I noticed it after setting flag +-WIPHY_FLAG_HAVE_AP_SME in brcmfmac driver for my experiments. +- +-This patch allows working with such drivers with just a small warning +-printed as debug message. +- +-Signed-off-by: RafaÅ‚ MiÅ‚ecki +---- +- src/drivers/driver_nl80211.c | 3 ++- +- 1 file changed, 2 insertions(+), 1 deletion(-) +- +---- a/src/drivers/driver_nl80211.c +-+++ b/src/drivers/driver_nl80211.c +-@@ -4108,7 +4108,8 @@ static int nl80211_setup_ap(struct i802_ +- +- if (drv->device_ap_sme && !drv->use_monitor) +- if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) +-- return -1; +-+ wpa_printf(MSG_DEBUG, +-+ "nl80211: Failed to subscribe for mgmt frames from SME driver - trying to run without it"); +- +- if (!drv->device_ap_sme && drv->use_monitor && +- nl80211_create_monitor_interface(drv) && diff --git a/package/network/services/hostapd/patches/100-mesh_mode_fix.patch b/package/network/services/hostapd/patches/100-mesh_mode_fix.patch new file mode 100644 index 0000000..ceb4c53 diff --git a/patches/openwrt/0013-fix-UBNT-XM-model-detection.patch b/patches/openwrt/0013-fix-UBNT-XM-model-detection.patch index 08240588..20832071 100644 --- a/patches/openwrt/0013-fix-UBNT-XM-model-detection.patch +++ b/patches/openwrt/0013-fix-UBNT-XM-model-detection.patch @@ -5,7 +5,7 @@ Subject: fix UBNT XM model detection Signed-off-by: Neal Oakey diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index dab4d2c..e7b3cd2 100755 +index 2f4b112..b220aad 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -64,6 +64,40 @@ wndr3700_board_detect() { @@ -64,7 +64,7 @@ index dab4d2c..e7b3cd2 100755 ;; *"Nanostation M XW") name="nanostation-m-xw" -@@ -667,6 +703,7 @@ ar71xx_board_detect() { +@@ -682,6 +718,7 @@ ar71xx_board_detect() { ;; *"Rocket M") name="rocket-m" diff --git a/patches/openwrt/0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch b/patches/openwrt/0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch index 77b47675..ce3fe9c7 100644 --- a/patches/openwrt/0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch +++ b/patches/openwrt/0019-ar71xx-check-both-HWID-and-HWREV-on-upgrades-of-TP-LINK-devices.patch @@ -10,7 +10,7 @@ Signed-off-by: Matthias Schiffer Backport of r49105 diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index d025632..c5c1871 100755 +index bf53169..ccccc17 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -66,6 +66,10 @@ tplink_get_image_hwid() { @@ -24,7 +24,7 @@ index d025632..c5c1871 100755 tplink_get_image_boot_size() { get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' } -@@ -366,13 +370,17 @@ platform_check_image() { +@@ -371,13 +375,17 @@ platform_check_image() { } local hwid diff --git a/patches/openwrt/0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch b/patches/openwrt/0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch index 70b3a004..23e69b37 100644 --- a/patches/openwrt/0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch +++ b/patches/openwrt/0020-ar71xx-avoid-AR71XX_MODEL-ending-with-a-space-on-some-TP-LINK-like-devices.patch @@ -11,7 +11,7 @@ Signed-off-by: Matthias Schiffer Backport of r49106 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index e7b3cd2..180a075 100755 +index b220aad..395a012 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -133,7 +133,7 @@ tplink_board_detect() { diff --git a/patches/openwrt/0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch b/patches/openwrt/0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch index 9330e547..b7e98439 100644 --- a/patches/openwrt/0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch +++ b/patches/openwrt/0021-ar71xx-fix-the-revision-of-a-few-TP-LINK-devices-in-AR71XX_MODEL-to-match-labels-image-names.patch @@ -12,7 +12,7 @@ Signed-off-by: Matthias Schiffer Backport of r49107 diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 180a075..ddd6611 100755 +index 395a012..131364c 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -162,6 +162,10 @@ tplink_board_detect() { diff --git a/patches/openwrt/0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch b/patches/openwrt/0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch index 5a225d7d..43e26317 100644 --- a/patches/openwrt/0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch +++ b/patches/openwrt/0022-ar71xx-build-image-for-TL-WR710N-v2.1.patch @@ -11,7 +11,7 @@ Signed off by: Norbert Wegener Backport of r47849 diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 9a7acbd..d42ceef 100644 +index 8551399..7184966 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -476,6 +476,15 @@ define Device/tl-wr710n-v2 diff --git a/patches/openwrt/0035-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch b/patches/openwrt/0032-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch similarity index 100% rename from patches/openwrt/0035-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch rename to patches/openwrt/0032-ath79-dev-eth-fix-QCA9561-set-phy-interface-mode-and-mask.patch diff --git a/patches/openwrt/0032-tools-pkg-config-fix-build-with-GCC-6.patch b/patches/openwrt/0032-tools-pkg-config-fix-build-with-GCC-6.patch deleted file mode 100644 index 840b8b60..00000000 --- a/patches/openwrt/0032-tools-pkg-config-fix-build-with-GCC-6.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 8 May 2016 15:53:14 +0200 -Subject: tools: pkg-config: fix build with GCC 6 - -Fixes the following error: - -gdate.c: In function ‘g_date_strftime’: -gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral] - tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm); - ^~~~~~ - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch b/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch -new file mode 100644 -index 0000000..6849299 ---- /dev/null -+++ b/tools/pkg-config/patches/001-glib-gdate-suppress-string-format-literal-warning.patch -@@ -0,0 +1,18 @@ -+--- a/glib/glib/gdate.c -++++ b/glib/glib/gdate.c -+@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d, -+ * -+ * Returns: number of characters written to the buffer, or 0 the buffer was too small -+ */ -++#pragma GCC diagnostic push -++#pragma GCC diagnostic ignored "-Wformat-nonliteral" -++ -+ gsize -+ g_date_strftime (gchar *s, -+ gsize slen, -+@@ -2549,3 +2552,5 @@ g_date_strftime (gchar *s, -+ return retval; -+ #endif -+ } -++ -++#pragma GCC diagnostic pop diff --git a/patches/openwrt/0036-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch b/patches/openwrt/0033-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch similarity index 100% rename from patches/openwrt/0036-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch rename to patches/openwrt/0033-ar71xx-use-correct-PLL-configuration-register-bitmask-for-QCA956x-SoC.patch diff --git a/patches/openwrt/0033-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch b/patches/openwrt/0033-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch deleted file mode 100644 index edca566c..00000000 --- a/patches/openwrt/0033-tools-mkimage-sync-include-linux-compiler-.h-with-u-boot-master.patch +++ /dev/null @@ -1,815 +0,0 @@ -From: Matthias Schiffer -Date: Sun, 8 May 2016 22:06:51 +0200 -Subject: tools: mkimage: sync include/linux/compiler*.h with u-boot master - -Fixes build with GCC 6. - -Signed-off-by: Matthias Schiffer - -diff --git a/tools/mkimage/patches/200-compiler-support.patch b/tools/mkimage/patches/200-compiler-support.patch -new file mode 100644 -index 0000000..ca9c5b5 ---- /dev/null -+++ b/tools/mkimage/patches/200-compiler-support.patch -@@ -0,0 +1,702 @@ -+diff --git b/include/linux/compiler-gcc.h a/include/linux/compiler-gcc.h -+index e057bd2..22ab246 100644 -+--- b/include/linux/compiler-gcc.h -++++ a/include/linux/compiler-gcc.h -+@@ -5,14 +5,28 @@ -+ /* -+ * Common definitions for all gcc versions go here. -+ */ -+-#define GCC_VERSION (__GNUC__ * 10000 \ -+- + __GNUC_MINOR__ * 100 \ -+- + __GNUC_PATCHLEVEL__) -+- -++#define GCC_VERSION (__GNUC__ * 10000 \ -++ + __GNUC_MINOR__ * 100 \ -++ + __GNUC_PATCHLEVEL__) -+ -+ /* Optimization barrier */ -++ -+ /* The "volatile" is due to gcc bugs */ -+ #define barrier() __asm__ __volatile__("": : :"memory") -++/* -++ * This version is i.e. to prevent dead stores elimination on @ptr -++ * where gcc and llvm may behave differently when otherwise using -++ * normal barrier(): while gcc behavior gets along with a normal -++ * barrier(), llvm needs an explicit input variable to be assumed -++ * clobbered. The issue is as follows: while the inline asm might -++ * access any memory it wants, the compiler could have fit all of -++ * @ptr into memory registers instead, and since @ptr never escaped -++ * from that, it proofed that the inline asm wasn't touching any of -++ * it. This version works well with both compilers, i.e. we're telling -++ * the compiler that the inline asm absolutely may see the contents -++ * of @ptr. See also: https://llvm.org/bugs/show_bug.cgi?id=15495 -++ */ -++#define barrier_data(ptr) __asm__ __volatile__("": :"r"(ptr) :"memory") -+ -+ /* -+ * This macro obfuscates arithmetic on a variable address so that gcc -+@@ -32,58 +46,63 @@ -+ * the inline assembly constraint from =g to =r, in this particular -+ * case either is valid. -+ */ -+-#define RELOC_HIDE(ptr, off) \ -+- ({ unsigned long __ptr; \ -+- __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ -+- (typeof(ptr)) (__ptr + (off)); }) -++#define RELOC_HIDE(ptr, off) \ -++({ \ -++ unsigned long __ptr; \ -++ __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \ -++ (typeof(ptr)) (__ptr + (off)); \ -++}) -+ -+ /* Make the optimizer believe the variable can be manipulated arbitrarily. */ -+-#define OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "=r" (var) : "0" (var)) -++#define OPTIMIZER_HIDE_VAR(var) \ -++ __asm__ ("" : "=r" (var) : "0" (var)) -+ -+ #ifdef __CHECKER__ -+-#define __must_be_array(arr) 0 -++#define __must_be_array(a) 0 -+ #else -+ /* &a[0] degrades to a pointer: a different type from an array */ -+-#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) -++#define __must_be_array(a) BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0])) -+ #endif -+ -+ /* -+ * Force always-inline if the user requests it so via the .config, -+ * or if gcc is too old: -+ */ -+-#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ -++#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ -+ !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) -+-# define inline inline __attribute__((always_inline)) notrace -+-# define __inline__ __inline__ __attribute__((always_inline)) notrace -+-# define __inline __inline __attribute__((always_inline)) notrace -++#define inline inline __attribute__((always_inline)) notrace -++#define __inline__ __inline__ __attribute__((always_inline)) notrace -++#define __inline __inline __attribute__((always_inline)) notrace -+ #else -+ /* A lot of inline functions can cause havoc with function tracing */ -+-# define inline inline notrace -+-# define __inline__ __inline__ notrace -+-# define __inline __inline notrace -++#define inline inline notrace -++#define __inline__ __inline__ notrace -++#define __inline __inline notrace -+ #endif -+ -+-#define __deprecated __attribute__((deprecated)) -+-#ifndef __packed -+-#define __packed __attribute__((packed)) -+-#endif -+-#ifndef __weak -+-#define __weak __attribute__((weak)) -+-#endif -++#define __always_inline inline __attribute__((always_inline)) -++#define noinline __attribute__((noinline)) -++ -++#define __deprecated __attribute__((deprecated)) -++#define __packed __attribute__((packed)) -++#define __weak __attribute__((weak)) -++#define __alias(symbol) __attribute__((alias(#symbol))) -+ -+ /* -+- * it doesn't make sense on ARM (currently the only user of __naked) to trace -+- * naked functions because then mcount is called without stack and frame pointer -+- * being set up and there is no chance to restore the lr register to the value -+- * before mcount was called. -++ * it doesn't make sense on ARM (currently the only user of __naked) -++ * to trace naked functions because then mcount is called without -++ * stack and frame pointer being set up and there is no chance to -++ * restore the lr register to the value before mcount was called. -++ * -++ * The asm() bodies of naked functions often depend on standard calling -++ * conventions, therefore they must be noinline and noclone. -+ * -+- * The asm() bodies of naked functions often depend on standard calling conventions, -+- * therefore they must be noinline and noclone. GCC 4.[56] currently fail to enforce -+- * this, so we must do so ourselves. See GCC PR44290. -++ * GCC 4.[56] currently fail to enforce this, so we must do so ourselves. -++ * See GCC PR44290. -+ */ -+-#define __naked __attribute__((naked)) noinline __noclone notrace -++#define __naked __attribute__((naked)) noinline __noclone notrace -+ -+-#define __noreturn __attribute__((noreturn)) -++#define __noreturn __attribute__((noreturn)) -+ -+ /* -+ * From the GCC manual: -+@@ -95,34 +114,170 @@ -+ * would be. -+ * [...] -+ */ -+-#ifndef __pure -+-#define __pure __attribute__((pure)) -++#define __pure __attribute__((pure)) -++#define __aligned(x) __attribute__((aligned(x))) -++#define __printf(a, b) __attribute__((format(printf, a, b))) -++#define __scanf(a, b) __attribute__((format(scanf, a, b))) -++#define __attribute_const__ __attribute__((__const__)) -++#define __maybe_unused __attribute__((unused)) -++#define __always_unused __attribute__((unused)) -++ -++/* gcc version specific checks */ -++ -++#if GCC_VERSION < 30200 -++# error Sorry, your compiler is too old - please upgrade it. -++#endif -++ -++#if GCC_VERSION < 30300 -++# define __used __attribute__((__unused__)) -++#else -++# define __used __attribute__((__used__)) -++#endif -++ -++#ifdef CONFIG_GCOV_KERNEL -++# if GCC_VERSION < 30400 -++# error "GCOV profiling support for gcc versions below 3.4 not included" -++# endif /* __GNUC_MINOR__ */ -++#endif /* CONFIG_GCOV_KERNEL */ -++ -++#if GCC_VERSION >= 30400 -++#define __must_check __attribute__((warn_unused_result)) -++#endif -++ -++#if GCC_VERSION >= 40000 -++ -++/* GCC 4.1.[01] miscompiles __weak */ -++#ifdef __KERNEL__ -++# if GCC_VERSION >= 40100 && GCC_VERSION <= 40101 -++# error Your version of gcc miscompiles the __weak directive -++# endif -++#endif -++ -++#define __used __attribute__((__used__)) -++#define __compiler_offsetof(a, b) \ -++ __builtin_offsetof(a, b) -++ -++#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 -++# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) -++#endif -++ -++#if GCC_VERSION >= 40300 -++/* Mark functions as cold. gcc will assume any path leading to a call -++ * to them will be unlikely. This means a lot of manual unlikely()s -++ * are unnecessary now for any paths leading to the usual suspects -++ * like BUG(), printk(), panic() etc. [but let's keep them for now for -++ * older compilers] -++ * -++ * Early snapshots of gcc 4.3 don't support this and we can't detect this -++ * in the preprocessor, but we can live with this because they're unreleased. -++ * Maketime probing would be overkill here. -++ * -++ * gcc also has a __attribute__((__hot__)) to move hot functions into -++ * a special section, but I don't see any sense in this right now in -++ * the kernel context -++ */ -++#define __cold __attribute__((__cold__)) -++ -++#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -++ -++#ifndef __CHECKER__ -++# define __compiletime_warning(message) __attribute__((warning(message))) -++# define __compiletime_error(message) __attribute__((error(message))) -++#endif /* __CHECKER__ */ -++#endif /* GCC_VERSION >= 40300 */ -++ -++#if GCC_VERSION >= 40500 -++/* -++ * Mark a position in code as unreachable. This can be used to -++ * suppress control flow warnings after asm blocks that transfer -++ * control elsewhere. -++ * -++ * Early snapshots of gcc 4.5 don't support this and we can't detect -++ * this in the preprocessor, but we can live with this because they're -++ * unreleased. Really, we need to have autoconf for the kernel. -++ */ -++#define unreachable() __builtin_unreachable() -++ -++/* Mark a function definition as prohibited from being cloned. */ -++#define __noclone __attribute__((__noclone__)) -++ -++#endif /* GCC_VERSION >= 40500 */ -++ -++#if GCC_VERSION >= 40600 -++/* -++ * When used with Link Time Optimization, gcc can optimize away C functions or -++ * variables which are referenced only from assembly code. __visible tells the -++ * optimizer that something else uses this function or variable, thus preventing -++ * this. -++ */ -++#define __visible __attribute__((externally_visible)) -+ #endif -+-#ifndef __aligned -+-#define __aligned(x) __attribute__((aligned(x))) -++ -++ -++#if GCC_VERSION >= 40900 && !defined(__CHECKER__) -++/* -++ * __assume_aligned(n, k): Tell the optimizer that the returned -++ * pointer can be assumed to be k modulo n. The second argument is -++ * optional (default 0), so we use a variadic macro to make the -++ * shorthand. -++ * -++ * Beware: Do not apply this to functions which may return -++ * ERR_PTRs. Also, it is probably unwise to apply it to functions -++ * returning extra information in the low bits (but in that case the -++ * compiler should see some alignment anyway, when the return value is -++ * massaged by 'flags = ptr & 3; ptr &= ~3;'). -++ */ -++#define __assume_aligned(a, ...) __attribute__((__assume_aligned__(a, ## __VA_ARGS__))) -+ #endif -+-#define __printf(a, b) __attribute__((format(printf, a, b))) -+-#define __scanf(a, b) __attribute__((format(scanf, a, b))) -+-#define noinline __attribute__((noinline)) -+-#define __attribute_const__ __attribute__((__const__)) -+-#define __maybe_unused __attribute__((unused)) -+-#define __always_unused __attribute__((unused)) -+ -+-#define __gcc_header(x) #x -+-#define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) -+-#define gcc_header(x) _gcc_header(x) -+-#include gcc_header(__GNUC__) -++/* -++ * GCC 'asm goto' miscompiles certain code sequences: -++ * -++ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -++ * -++ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -++ * -++ * (asm goto is automatically volatile - the naming reflects this.) -++ */ -++#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -++ -++#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -++#if GCC_VERSION >= 40400 -++#define __HAVE_BUILTIN_BSWAP32__ -++#define __HAVE_BUILTIN_BSWAP64__ -++#endif -++#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) -++#define __HAVE_BUILTIN_BSWAP16__ -++#endif -++#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ -++ -++#if GCC_VERSION >= 50000 -++#define KASAN_ABI_VERSION 4 -++#elif GCC_VERSION >= 40902 -++#define KASAN_ABI_VERSION 3 -++#endif -++ -++#if GCC_VERSION >= 40902 -++/* -++ * Tell the compiler that address safety instrumentation (KASAN) -++ * should not be applied to that function. -++ * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 -++ */ -++#define __no_sanitize_address __attribute__((no_sanitize_address)) -++#endif -++ -++#endif /* gcc version >= 40000 specific checks */ -+ -+ #if !defined(__noclone) -+ #define __noclone /* not needed */ -+ #endif -+ -++#if !defined(__no_sanitize_address) -++#define __no_sanitize_address -++#endif -++ -+ /* -+ * A trick to suppress uninitialized variable warning without generating any -+ * code -+ */ -+ #define uninitialized_var(x) x = x -+- -+-#ifndef __always_inline -+-#define __always_inline inline __attribute__((always_inline)) -+-#endif -+diff --git b/include/linux/compiler-gcc3.h a/include/linux/compiler-gcc3.h -+deleted file mode 100644 -+index 7d89feb..0000000 -+--- b/include/linux/compiler-gcc3.h -++++ /dev/null -+@@ -1,23 +0,0 @@ -+-#ifndef __LINUX_COMPILER_H -+-#error "Please don't include directly, include instead." -+-#endif -+- -+-#if GCC_VERSION < 30200 -+-# error Sorry, your compiler is too old - please upgrade it. -+-#endif -+- -+-#if GCC_VERSION >= 30300 -+-# define __used __attribute__((__used__)) -+-#else -+-# define __used __attribute__((__unused__)) -+-#endif -+- -+-#if GCC_VERSION >= 30400 -+-#define __must_check __attribute__((warn_unused_result)) -+-#endif -+- -+-#ifdef CONFIG_GCOV_KERNEL -+-# if GCC_VERSION < 30400 -+-# error "GCOV profiling support for gcc versions below 3.4 not included" -+-# endif /* __GNUC_MINOR__ */ -+-#endif /* CONFIG_GCOV_KERNEL */ -+diff --git b/include/linux/compiler-gcc4.h a/include/linux/compiler-gcc4.h -+deleted file mode 100644 -+index c982a09..0000000 -+--- b/include/linux/compiler-gcc4.h -++++ /dev/null -+@@ -1,81 +0,0 @@ -+-#ifndef __LINUX_COMPILER_H -+-#error "Please don't include directly, include instead." -+-#endif -+- -+-#define __used __attribute__((__used__)) -+-#define __must_check __attribute__((warn_unused_result)) -+-#define __compiler_offsetof(a,b) __builtin_offsetof(a,b) -+- -+-#if GCC_VERSION >= 40100 && GCC_VERSION < 40600 -+-# define __compiletime_object_size(obj) __builtin_object_size(obj, 0) -+-#endif -+- -+-#if GCC_VERSION >= 40300 -+-/* Mark functions as cold. gcc will assume any path leading to a call -+- to them will be unlikely. This means a lot of manual unlikely()s -+- are unnecessary now for any paths leading to the usual suspects -+- like BUG(), printk(), panic() etc. [but let's keep them for now for -+- older compilers] -+- -+- Early snapshots of gcc 4.3 don't support this and we can't detect this -+- in the preprocessor, but we can live with this because they're unreleased. -+- Maketime probing would be overkill here. -+- -+- gcc also has a __attribute__((__hot__)) to move hot functions into -+- a special section, but I don't see any sense in this right now in -+- the kernel context */ -+-#define __cold __attribute__((__cold__)) -+- -+-#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) -+- -+-#ifndef __CHECKER__ -+-# define __compiletime_warning(message) __attribute__((warning(message))) -+-# define __compiletime_error(message) __attribute__((error(message))) -+-#endif /* __CHECKER__ */ -+-#endif /* GCC_VERSION >= 40300 */ -+- -+-#if GCC_VERSION >= 40500 -+-/* -+- * Mark a position in code as unreachable. This can be used to -+- * suppress control flow warnings after asm blocks that transfer -+- * control elsewhere. -+- * -+- * Early snapshots of gcc 4.5 don't support this and we can't detect -+- * this in the preprocessor, but we can live with this because they're -+- * unreleased. Really, we need to have autoconf for the kernel. -+- */ -+-#define unreachable() __builtin_unreachable() -+- -+-/* Mark a function definition as prohibited from being cloned. */ -+-#define __noclone __attribute__((__noclone__)) -+- -+-#endif /* GCC_VERSION >= 40500 */ -+- -+-#if GCC_VERSION >= 40600 -+-/* -+- * Tell the optimizer that something else uses this function or variable. -+- */ -+-#define __visible __attribute__((externally_visible)) -+-#endif -+- -+-/* -+- * GCC 'asm goto' miscompiles certain code sequences: -+- * -+- * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 -+- * -+- * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. -+- * Fixed in GCC 4.8.2 and later versions. -+- * -+- * (asm goto is automatically volatile - the naming reflects this.) -+- */ -+-#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) -+- -+-#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP -+-#if GCC_VERSION >= 40400 -+-#define __HAVE_BUILTIN_BSWAP32__ -+-#define __HAVE_BUILTIN_BSWAP64__ -+-#endif -+-#if GCC_VERSION >= 40800 || (defined(__powerpc__) && GCC_VERSION >= 40600) -+-#define __HAVE_BUILTIN_BSWAP16__ -+-#endif -+-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ -+diff --git b/include/linux/compiler-intel.h a/include/linux/compiler-intel.h -+index ba147a1..d4c7113 100644 -+--- b/include/linux/compiler-intel.h -++++ a/include/linux/compiler-intel.h -+@@ -13,9 +13,14 @@ -+ /* Intel ECC compiler doesn't support gcc specific asm stmts. -+ * It uses intrinsics to do the equivalent things. -+ */ -++#undef barrier -++#undef barrier_data -+ #undef RELOC_HIDE -+ #undef OPTIMIZER_HIDE_VAR -+ -++#define barrier() __memory_barrier() -++#define barrier_data(ptr) barrier() -++ -+ #define RELOC_HIDE(ptr, off) \ -+ ({ unsigned long __ptr; \ -+ __ptr = (unsigned long) (ptr); \ -+diff --git b/include/linux/compiler.h a/include/linux/compiler.h -+index d5ad7b1..020ad16 100644 -+--- b/include/linux/compiler.h -++++ a/include/linux/compiler.h -+@@ -17,6 +17,7 @@ -+ # define __release(x) __context__(x,-1) -+ # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) -+ # define __percpu __attribute__((noderef, address_space(3))) -++# define __pmem __attribute__((noderef, address_space(5))) -+ #ifdef CONFIG_SPARSE_RCU_POINTER -+ # define __rcu __attribute__((noderef, address_space(4))) -+ #else -+@@ -42,6 +43,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); -+ # define __cond_lock(x,c) (c) -+ # define __percpu -+ # define __rcu -++# define __pmem -+ #endif -+ -+ /* Indirect macros required for expanded argument pasting, eg. __LINE__. */ -+@@ -54,7 +56,11 @@ extern void __chk_io_ptr(const volatile void __iomem *); -+ #include -+ #endif -+ -++#if defined(CC_USING_HOTPATCH) && !defined(__CHECKER__) -++#define notrace __attribute__((hotpatch(0,0))) -++#else -+ #define notrace __attribute__((no_instrument_function)) -++#endif -+ -+ /* Intel compiler defines __GNUC__. So we will overwrite implementations -+ * coming from above header files here -+@@ -138,7 +144,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); -+ */ -+ #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) -+ #define __trace_if(cond) \ -+- if (__builtin_constant_p((cond)) ? !!(cond) : \ -++ if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ -+ ({ \ -+ int ______r; \ -+ static struct ftrace_branch_data \ -+@@ -165,6 +171,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); -+ # define barrier() __memory_barrier() -+ #endif -+ -++#ifndef barrier_data -++# define barrier_data(ptr) barrier() -++#endif -++ -+ /* Unreachable code */ -+ #ifndef unreachable -+ # define unreachable() do { } while (1) -+@@ -186,6 +196,126 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); -+ # define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __LINE__) -+ #endif -+ -++#include -++ -++#define __READ_ONCE_SIZE \ -++({ \ -++ switch (size) { \ -++ case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \ -++ case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \ -++ case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \ -++ case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \ -++ default: \ -++ barrier(); \ -++ __builtin_memcpy((void *)res, (const void *)p, size); \ -++ barrier(); \ -++ } \ -++}) -++ -++static __always_inline -++void __read_once_size(const volatile void *p, void *res, int size) -++{ -++ __READ_ONCE_SIZE; -++} -++ -++#ifdef CONFIG_KASAN -++/* -++ * This function is not 'inline' because __no_sanitize_address confilcts -++ * with inlining. Attempt to inline it may cause a build failure. -++ * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 -++ * '__maybe_unused' allows us to avoid defined-but-not-used warnings. -++ */ -++static __no_sanitize_address __maybe_unused -++void __read_once_size_nocheck(const volatile void *p, void *res, int size) -++{ -++ __READ_ONCE_SIZE; -++} -++#else -++static __always_inline -++void __read_once_size_nocheck(const volatile void *p, void *res, int size) -++{ -++ __READ_ONCE_SIZE; -++} -++#endif -++ -++static __always_inline void __write_once_size(volatile void *p, void *res, int size) -++{ -++ switch (size) { -++ case 1: *(volatile __u8 *)p = *(__u8 *)res; break; -++ case 2: *(volatile __u16 *)p = *(__u16 *)res; break; -++ case 4: *(volatile __u32 *)p = *(__u32 *)res; break; -++ case 8: *(volatile __u64 *)p = *(__u64 *)res; break; -++ default: -++ barrier(); -++ __builtin_memcpy((void *)p, (const void *)res, size); -++ barrier(); -++ } -++} -++ -++/* -++ * Prevent the compiler from merging or refetching reads or writes. The -++ * compiler is also forbidden from reordering successive instances of -++ * READ_ONCE, WRITE_ONCE and ACCESS_ONCE (see below), but only when the -++ * compiler is aware of some particular ordering. One way to make the -++ * compiler aware of ordering is to put the two invocations of READ_ONCE, -++ * WRITE_ONCE or ACCESS_ONCE() in different C statements. -++ * -++ * In contrast to ACCESS_ONCE these two macros will also work on aggregate -++ * data types like structs or unions. If the size of the accessed data -++ * type exceeds the word size of the machine (e.g., 32 bits or 64 bits) -++ * READ_ONCE() and WRITE_ONCE() will fall back to memcpy and print a -++ * compile-time warning. -++ * -++ * Their two major use cases are: (1) Mediating communication between -++ * process-level code and irq/NMI handlers, all running on the same CPU, -++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise -++ * mutilate accesses that either do not require ordering or that interact -++ * with an explicit memory barrier or atomic instruction that provides the -++ * required ordering. -++ */ -++ -++#define __READ_ONCE(x, check) \ -++({ \ -++ union { typeof(x) __val; char __c[1]; } __u; \ -++ if (check) \ -++ __read_once_size(&(x), __u.__c, sizeof(x)); \ -++ else \ -++ __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ -++ __u.__val; \ -++}) -++#define READ_ONCE(x) __READ_ONCE(x, 1) -++ -++/* -++ * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need -++ * to hide memory access from KASAN. -++ */ -++#define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0) -++ -++#define WRITE_ONCE(x, val) \ -++({ \ -++ union { typeof(x) __val; char __c[1]; } __u = \ -++ { .__val = (__force typeof(x)) (val) }; \ -++ __write_once_size(&(x), __u.__c, sizeof(x)); \ -++ __u.__val; \ -++}) -++ -++/** -++ * smp_cond_acquire() - Spin wait for cond with ACQUIRE ordering -++ * @cond: boolean expression to wait for -++ * -++ * Equivalent to using smp_load_acquire() on the condition variable but employs -++ * the control dependency of the wait to reduce the barrier on many platforms. -++ * -++ * The control dependency provides a LOAD->STORE order, the additional RMB -++ * provides LOAD->LOAD order, together they provide LOAD->{LOAD,STORE} order, -++ * aka. ACQUIRE. -++ */ -++#define smp_cond_acquire(cond) do { \ -++ while (!(cond)) \ -++ cpu_relax(); \ -++ smp_rmb(); /* ctrl + rmb := acquire */ \ -++} while (0) -++ -+ #endif /* __KERNEL__ */ -+ -+ #endif /* __ASSEMBLY__ */ -+@@ -304,6 +434,14 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); -+ #define __visible -+ #endif -+ -++/* -++ * Assume alignment of return value. -++ */ -++#ifndef __assume_aligned -++#define __assume_aligned(a, ...) -++#endif -++ -++ -+ /* Are two types/vars the same type (ignoring qualifiers)? */ -+ #ifndef __same_type -+ # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) -+@@ -311,7 +449,7 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); -+ -+ /* Is this type a native word size -- useful for atomic operations */ -+ #ifndef __native_word -+-# define __native_word(t) (sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) -++# define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long)) -+ #endif -+ -+ /* Compile time object size, -1 for unknown */ -+@@ -373,12 +511,38 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); -+ * to make the compiler aware of ordering is to put the two invocations of -+ * ACCESS_ONCE() in different C statements. -+ * -+- * This macro does absolutely -nothing- to prevent the CPU from reordering, -+- * merging, or refetching absolutely anything at any time. Its main intended -+- * use is to mediate communication between process-level code and irq/NMI -+- * handlers, all running on the same CPU. -++ * ACCESS_ONCE will only work on scalar types. For union types, ACCESS_ONCE -++ * on a union member will work as long as the size of the member matches the -++ * size of the union and the size is smaller than word size. -++ * -++ * The major use cases of ACCESS_ONCE used to be (1) Mediating communication -++ * between process-level code and irq/NMI handlers, all running on the same CPU, -++ * and (2) Ensuring that the compiler does not fold, spindle, or otherwise -++ * mutilate accesses that either do not require ordering or that interact -++ * with an explicit memory barrier or atomic instruction that provides the -++ * required ordering. -++ * -++ * If possible use READ_ONCE()/WRITE_ONCE() instead. -++ */ -++#define __ACCESS_ONCE(x) ({ \ -++ __maybe_unused typeof(x) __var = (__force typeof(x)) 0; \ -++ (volatile typeof(x) *)&(x); }) -++#define ACCESS_ONCE(x) (*__ACCESS_ONCE(x)) -++ -++/** -++ * lockless_dereference() - safely load a pointer for later dereference -++ * @p: The pointer to load -++ * -++ * Similar to rcu_dereference(), but for situations where the pointed-to -++ * object's lifetime is managed by something other than RCU. That -++ * "something other" might be reference counting or simple immortality. -+ */ -+-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) -++#define lockless_dereference(p) \ -++({ \ -++ typeof(p) _________p1 = READ_ONCE(p); \ -++ smp_read_barrier_depends(); /* Dependency order vs. p above. */ \ -++ (_________p1); \ -++}) -+ -+ /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ -+ #ifdef CONFIG_KPROBES -diff --git a/tools/mkimage/patches/200-gcc5_compat.patch b/tools/mkimage/patches/200-gcc5_compat.patch -deleted file mode 100644 -index 4d55f00..0000000 ---- a/tools/mkimage/patches/200-gcc5_compat.patch -+++ /dev/null -@@ -1,93 +0,0 @@ --From 478b02f1a7043b673565075ea5016376f3293b23 Mon Sep 17 00:00:00 2001 --From: Hans de Goede --Date: Sat, 7 Feb 2015 22:52:40 +0100 --Subject: [PATCH] Add linux/compiler-gcc5.h to fix builds with gcc5 -- --Add linux/compiler-gcc5/h from the kernel sources at: -- --commit 5631b8fba640a4ab2f8a954f63a603fa34eda96b --Author: Steven Noonan --Date: Sat Oct 25 15:09:42 2014 -0700 -- -- compiler/gcc4+: Remove inaccurate comment about 'asm goto' miscompiles -- --Signed-off-by: Hans de Goede ----- -- include/linux/compiler-gcc5.h | 65 +++++++++++++++++++++++++++++++++++++++++ -- 1 file changed, 65 insertions(+) -- create mode 100644 include/linux/compiler-gcc5.h -- --diff --git a/include/linux/compiler-gcc5.h b/include/linux/compiler-gcc5.h --new file mode 100644 --index 0000000..c8c5659 ----- /dev/null --+++ b/include/linux/compiler-gcc5.h --@@ -0,0 +1,65 @@ --+#ifndef __LINUX_COMPILER_H --+#error "Please don't include directly, include instead." --+#endif --+ --+#define __used __attribute__((__used__)) --+#define __must_check __attribute__((warn_unused_result)) --+#define __compiler_offsetof(a, b) __builtin_offsetof(a, b) --+ --+/* Mark functions as cold. gcc will assume any path leading to a call --+ to them will be unlikely. This means a lot of manual unlikely()s --+ are unnecessary now for any paths leading to the usual suspects --+ like BUG(), printk(), panic() etc. [but let's keep them for now for --+ older compilers] --+ --+ Early snapshots of gcc 4.3 don't support this and we can't detect this --+ in the preprocessor, but we can live with this because they're unreleased. --+ Maketime probing would be overkill here. --+ --+ gcc also has a __attribute__((__hot__)) to move hot functions into --+ a special section, but I don't see any sense in this right now in --+ the kernel context */ --+#define __cold __attribute__((__cold__)) --+ --+#define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__) --+ --+#ifndef __CHECKER__ --+# define __compiletime_warning(message) __attribute__((warning(message))) --+# define __compiletime_error(message) __attribute__((error(message))) --+#endif /* __CHECKER__ */ --+ --+/* --+ * Mark a position in code as unreachable. This can be used to --+ * suppress control flow warnings after asm blocks that transfer --+ * control elsewhere. --+ * --+ * Early snapshots of gcc 4.5 don't support this and we can't detect --+ * this in the preprocessor, but we can live with this because they're --+ * unreleased. Really, we need to have autoconf for the kernel. --+ */ --+#define unreachable() __builtin_unreachable() --+ --+/* Mark a function definition as prohibited from being cloned. */ --+#define __noclone __attribute__((__noclone__)) --+ --+/* --+ * Tell the optimizer that something else uses this function or variable. --+ */ --+#define __visible __attribute__((externally_visible)) --+ --+/* --+ * GCC 'asm goto' miscompiles certain code sequences: --+ * --+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58670 --+ * --+ * Work it around via a compiler barrier quirk suggested by Jakub Jelinek. --+ * --+ * (asm goto is automatically volatile - the naming reflects this.) --+ */ --+#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0) --+ --+#ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP --+#define __HAVE_BUILTIN_BSWAP32__ --+#define __HAVE_BUILTIN_BSWAP64__ --+#define __HAVE_BUILTIN_BSWAP16__ --+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */ ---- --1.7.10.4 -- diff --git a/patches/openwrt/0037-ar71xx-update-QCA956x-support.patch b/patches/openwrt/0034-ar71xx-update-QCA956x-support.patch similarity index 89% rename from patches/openwrt/0037-ar71xx-update-QCA956x-support.patch rename to patches/openwrt/0034-ar71xx-update-QCA956x-support.patch index 3ae6c249..f93c9c75 100644 --- a/patches/openwrt/0037-ar71xx-update-QCA956x-support.patch +++ b/patches/openwrt/0034-ar71xx-update-QCA956x-support.patch @@ -379,3 +379,37 @@ index d3a14b2..61b8976 100644 +} + extern void __iomem *ath79_ddr_base; +diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +index a36b8c3..fa4eba2 100644 +--- a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch ++++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch +@@ -9,8 +9,8 @@ + + soc_is_qca955x()) + reg = AR71XX_GPIO_REG_FUNC; + else if (soc_is_ar934x() || +- soc_is_qca953x() || soc_is_qca956x()) +-@@ -185,15 +186,27 @@ void __init ath79_gpio_output_select(uns ++ soc_is_qca953x() || ++@@ -187,15 +188,31 @@ void __init ath79_gpio_output_select(uns + { + void __iomem *base = ath79_gpio_base; + unsigned long flags; +@@ -19,7 +19,7 @@ + + unsigned long gpio_count; + u32 t, s; + +-- BUG_ON(!soc_is_ar934x() && !soc_is_qca953x()); ++ BUG_ON(!soc_is_ar934x() && !soc_is_qca953x() && !soc_is_qca956x()); + + if (soc_is_ar934x()) { + + gpio_count = AR934X_GPIO_COUNT; + + reg_base = AR934X_GPIO_REG_OUT_FUNC0; +@@ -29,6 +29,9 @@ + + } else if (soc_is_qca955x()) { + + gpio_count = QCA955X_GPIO_COUNT; + + reg_base = QCA955X_GPIO_REG_OUT_FUNC0; +++ } else if (soc_is_qca956x()) { +++ gpio_count = QCA956X_GPIO_COUNT; +++ reg_base = QCA956X_GPIO_REG_OUT_FUNC0; + + } else { + + BUG(); + + } diff --git a/patches/openwrt/0034-toolchain-gcc-fix-build-with-GCC-6.patch b/patches/openwrt/0034-toolchain-gcc-fix-build-with-GCC-6.patch deleted file mode 100644 index e828631b..00000000 --- a/patches/openwrt/0034-toolchain-gcc-fix-build-with-GCC-6.patch +++ /dev/null @@ -1,144 +0,0 @@ -From: Matthias Schiffer -Date: Mon, 9 May 2016 00:16:38 +0200 -Subject: toolchain: gcc: fix build with GCC 6 - -At least for GCC 4.8, which is used by most targets. - -Signed-off-by: Matthias Schiffer - -diff --git a/toolchain/gcc/patches/4.8-linaro/030-gcc-6-compile.patch b/toolchain/gcc/patches/4.8-linaro/030-gcc-6-compile.patch -new file mode 100644 -index 0000000..c74f2aa ---- /dev/null -+++ b/toolchain/gcc/patches/4.8-linaro/030-gcc-6-compile.patch -@@ -0,0 +1,130 @@ -+Upstream commit r233721 -+ -+diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in -+index bd1c1d7..a0ea0d4 100644 -+--- a/gcc/cp/Make-lang.in -++++ b/gcc/cp/Make-lang.in -+@@ -111,7 +111,7 @@ else -+ # deleting the $(srcdir)/cp/cfns.h file. -+ $(srcdir)/cp/cfns.h: -+ endif -+- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ -++ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ -+ $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h -+ -+ # -+diff --git a/gcc/cp/cfns.gperf b/gcc/cp/cfns.gperf -+index 05ca753..d9b16b8 100644 -+--- a/gcc/cp/cfns.gperf -++++ b/gcc/cp/cfns.gperf -+@@ -1,3 +1,5 @@ -++%language=C++ -++%define class-name libc_name -+ %{ -+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc. -+ -+@@ -16,14 +18,6 @@ for more details. -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING3. If not see -+ . */ -+-#ifdef __GNUC__ -+-__inline -+-#endif -+-static unsigned int hash (const char *, unsigned int); -+-#ifdef __GNUC__ -+-__inline -+-#endif -+-const char * libc_name_p (const char *, unsigned int); -+ %} -+ %% -+ # The standard C library functions, for feeding to gperf; the result is used -+diff --git a/gcc/cp/cfns.h b/gcc/cp/cfns.h -+index c845ddf..65801d1 100644 -+--- a/gcc/cp/cfns.h -++++ b/gcc/cp/cfns.h -+@@ -1,5 +1,5 @@ -+-/* ANSI-C code produced by gperf version 3.0.3 */ -+-/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ -++/* C++ code produced by gperf version 3.0.4 */ -++/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ -+ -+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ -+ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ -+@@ -28,7 +28,7 @@ -+ #error "gperf generated tables don't work with this execution character set. Please report a bug to ." -+ #endif -+ -+-#line 1 "cfns.gperf" -++#line 3 "cfns.gperf" -+ -+ /* Copyright (C) 2000-2014 Free Software Foundation, Inc. -+ -+@@ -47,25 +47,18 @@ for more details. -+ You should have received a copy of the GNU General Public License -+ along with GCC; see the file COPYING3. If not see -+ . */ -+-#ifdef __GNUC__ -+-__inline -+-#endif -+-static unsigned int hash (const char *, unsigned int); -+-#ifdef __GNUC__ -+-__inline -+-#endif -+-const char * libc_name_p (const char *, unsigned int); -+ /* maximum key range = 391, duplicates = 0 */ -+ -+-#ifdef __GNUC__ -+-__inline -+-#else -+-#ifdef __cplusplus -+-inline -+-#endif -+-#endif -+-static unsigned int -+-hash (register const char *str, register unsigned int len) -++class libc_name -++{ -++private: -++ static inline unsigned int hash (const char *str, unsigned int len); -++public: -++ static const char *libc_name_p (const char *str, unsigned int len); -++}; -++ -++inline unsigned int -++libc_name::hash (register const char *str, register unsigned int len) -+ { -+ static const unsigned short asso_values[] = -+ { -+@@ -122,14 +115,8 @@ hash (register const char *str, register unsigned int len) -+ return hval + asso_values[(unsigned char)str[len - 1]]; -+ } -+ -+-#ifdef __GNUC__ -+-__inline -+-#ifdef __GNUC_STDC_INLINE__ -+-__attribute__ ((__gnu_inline__)) -+-#endif -+-#endif -+ const char * -+-libc_name_p (register const char *str, register unsigned int len) -++libc_name::libc_name_p (register const char *str, register unsigned int len) -+ { -+ enum -+ { -+diff --git a/gcc/cp/except.c b/gcc/cp/except.c -+index 221971a..32340f5 100644 -+--- a/gcc/cp/except.c -++++ b/gcc/cp/except.c -+@@ -1030,7 +1030,8 @@ nothrow_libfn_p (const_tree fn) -+ unless the system headers are playing rename tricks, and if -+ they are, we don't want to be confused by them. */ -+ id = DECL_NAME (fn); -+- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); -++ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), -++ IDENTIFIER_LENGTH (id)); -+ } -+ -+ /* Returns nonzero if an exception of type FROM will be caught by a -+-- -+1.7.1 -+ diff --git a/patches/openwrt/0038-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch b/patches/openwrt/0035-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch similarity index 100% rename from patches/openwrt/0038-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch rename to patches/openwrt/0035-ar71xx-fold-patch-622-MIPS-ath79-add-support-for-QCA956x-ethernet.patch-into-files.patch diff --git a/patches/openwrt/0039-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch b/patches/openwrt/0036-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch similarity index 100% rename from patches/openwrt/0039-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch rename to patches/openwrt/0036-ar71xx-fix-MDIO-bus-probe-on-QCA956x.patch diff --git a/patches/openwrt/0040-ar71xx-fix-qca956x-ethernet-initialization.patch b/patches/openwrt/0037-ar71xx-fix-qca956x-ethernet-initialization.patch similarity index 100% rename from patches/openwrt/0040-ar71xx-fix-qca956x-ethernet-initialization.patch rename to patches/openwrt/0037-ar71xx-fix-qca956x-ethernet-initialization.patch diff --git a/patches/openwrt/0041-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch b/patches/openwrt/0038-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch similarity index 97% rename from patches/openwrt/0041-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch rename to patches/openwrt/0038-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch index 21390fc7..bfb699d9 100644 --- a/patches/openwrt/0041-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch +++ b/patches/openwrt/0038-ar71xx-Support-for-Ubiquiti-UniFi-AP-AC-LITE.patch @@ -8,10 +8,10 @@ Signed-off-by: P.Wassi Backport of OpenWrt r48711 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index 5a184cd..8c6ac9a 100644 +index c5e39d0..e36c581 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -296,7 +296,8 @@ get_status_led() { +@@ -305,7 +305,8 @@ get_status_led() { unifi) status_led="ubnt:green:dome" ;; @@ -22,10 +22,10 @@ index 5a184cd..8c6ac9a 100644 ;; unifi-outdoor-plus) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index b2e15bb..e4a1473 100755 +index b2b182e..850eac9 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -366,6 +366,7 @@ tl-wa901nd-v3 |\ +@@ -368,6 +368,7 @@ tl-wa901nd-v3 |\ tl-wa901nd-v4 |\ tl-wr703n |\ tube2h |\ @@ -34,10 +34,10 @@ index b2e15bb..e4a1473 100755 mynet-rext |\ wp543) diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index ddd6611..8670583 100755 +index 131364c..ac77934 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -881,6 +881,9 @@ ar71xx_board_detect() { +@@ -896,6 +896,9 @@ ar71xx_board_detect() { *UniFi) name="unifi" ;; @@ -48,7 +48,7 @@ index ddd6611..8670583 100755 name="uap-pro" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index c5c1871..4c43166 100755 +index ccccc17..4793fa9 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -251,6 +251,7 @@ platform_check_image() { @@ -60,10 +60,10 @@ index c5c1871..4c43166 100755 carambola2 | \ weio ) diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 -index e2ff826..9a81911 100644 +index e4bed08..514f7d5 100644 --- a/target/linux/ar71xx/config-3.18 +++ b/target/linux/ar71xx/config-3.18 -@@ -137,6 +137,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y +@@ -140,6 +140,7 @@ CONFIG_ATH79_MACH_TL_WR941ND=y CONFIG_ATH79_MACH_TL_WR941ND_V6=y CONFIG_ATH79_MACH_TUBE2H=y CONFIG_ATH79_MACH_UBNT=y @@ -71,7 +71,7 @@ index e2ff826..9a81911 100644 CONFIG_ATH79_MACH_UBNT_XM=y CONFIG_ATH79_MACH_WEIO=y CONFIG_ATH79_MACH_WHR_HP_G300N=y -@@ -320,7 +321,7 @@ CONFIG_SOC_AR933X=y +@@ -323,7 +324,7 @@ CONFIG_SOC_AR933X=y CONFIG_SOC_AR934X=y CONFIG_SOC_QCA953X=y CONFIG_SOC_QCA955X=y @@ -218,7 +218,7 @@ index d8e24d0..94eff18 100644 NAME:=Ubiquiti UniFiAP Outdoor PACKAGES:= diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index d42ceef..dd59f2d 100644 +index 7184966..209eba4 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -740,6 +740,16 @@ define Device/oolite diff --git a/patches/openwrt/0042-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch b/patches/openwrt/0039-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch similarity index 100% rename from patches/openwrt/0042-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch rename to patches/openwrt/0039-ar71xx-Fix-eth0-support-for-Ubiquiti-UniFi-AP-AC.patch diff --git a/patches/openwrt/0043-ar71xx-Rename-unifiac-to-unifiac-lite.patch b/patches/openwrt/0040-ar71xx-Rename-unifiac-to-unifiac-lite.patch similarity index 95% rename from patches/openwrt/0043-ar71xx-Rename-unifiac-to-unifiac-lite.patch rename to patches/openwrt/0040-ar71xx-Rename-unifiac-to-unifiac-lite.patch index 19579875..688cf5c0 100644 --- a/patches/openwrt/0043-ar71xx-Rename-unifiac-to-unifiac-lite.patch +++ b/patches/openwrt/0040-ar71xx-Rename-unifiac-to-unifiac-lite.patch @@ -10,10 +10,10 @@ Signed-off-by: P.Wassi Backport of LEDE c855e70491fbd5d432915c4cbeb3b80f3a117e30 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index 8c6ac9a..3d711ca 100644 +index e36c581..23fd122 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -297,7 +297,7 @@ get_status_led() { +@@ -306,7 +306,7 @@ get_status_led() { status_led="ubnt:green:dome" ;; uap-pro | \ @@ -23,10 +23,10 @@ index 8c6ac9a..3d711ca 100644 ;; unifi-outdoor-plus) diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index e6fcec8..fa8a2c8 100644 +index f01c6d3..6c6b27a 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -75,7 +75,7 @@ case "$FIRMWARE" in +@@ -77,7 +77,7 @@ case "$FIRMWARE" in ath10kcal_extract "ART" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ;; @@ -36,10 +36,10 @@ index e6fcec8..fa8a2c8 100644 ;; esac diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index e4a1473..0269e6d 100755 +index 850eac9..cb31c69 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -366,7 +366,7 @@ tl-wa901nd-v3 |\ +@@ -368,7 +368,7 @@ tl-wa901nd-v3 |\ tl-wa901nd-v4 |\ tl-wr703n |\ tube2h |\ @@ -49,10 +49,10 @@ index e4a1473..0269e6d 100755 mynet-rext |\ wp543) diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 8670583..d3e6db9 100755 +index ac77934..f8dd719 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -881,8 +881,8 @@ ar71xx_board_detect() { +@@ -896,8 +896,8 @@ ar71xx_board_detect() { *UniFi) name="unifi" ;; @@ -64,7 +64,7 @@ index 8670583..d3e6db9 100755 *"UniFi AP Pro") name="uap-pro" diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 4c43166..a1b65b7 100755 +index 4793fa9..5aa59fd 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -251,7 +251,7 @@ platform_check_image() { @@ -143,7 +143,7 @@ index 94eff18..eac0240 100644 define Profile/UBNTUNIFIOUTDOOR NAME:=Ubiquiti UniFiAP Outdoor diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index dd59f2d..3efa2e1 100644 +index 209eba4..c9d6ed1 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -741,14 +741,19 @@ endef diff --git a/patches/openwrt/0044-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch b/patches/openwrt/0041-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch similarity index 96% rename from patches/openwrt/0044-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch rename to patches/openwrt/0041-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch index 1f28d0f4..50b613c8 100644 --- a/patches/openwrt/0044-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch +++ b/patches/openwrt/0041-ar71xx-Add-support-for-Ubiquiti-UniFi-AP-AC-PRO.patch @@ -8,10 +8,10 @@ Signed-off-by: P.Wassi Backport of LEDE 8307c2fe686ded345c80318359d5b6679e581fa2 diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index 3d711ca..775aac6 100644 +index 23fd122..f182d60 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -297,7 +297,8 @@ get_status_led() { +@@ -306,7 +306,8 @@ get_status_led() { status_led="ubnt:green:dome" ;; uap-pro | \ @@ -22,10 +22,10 @@ index 3d711ca..775aac6 100644 ;; unifi-outdoor-plus) diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index fa8a2c8..cde7aaf 100644 +index 6c6b27a..0e93feb 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -75,7 +75,8 @@ case "$FIRMWARE" in +@@ -77,7 +77,8 @@ case "$FIRMWARE" in ath10kcal_extract "ART" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ;; @@ -36,10 +36,10 @@ index fa8a2c8..cde7aaf 100644 ;; esac diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index 0269e6d..0a23756 100755 +index cb31c69..e5c64bb 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -398,6 +398,13 @@ wpj344) +@@ -400,6 +400,13 @@ wpj344) ucidef_add_switch_vlan "switch0" "2" "0t 2" ;; @@ -54,10 +54,10 @@ index 0269e6d..0a23756 100755 ucidef_set_interfaces_lan_wan "eth0" "eth1" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index d3e6db9..7fc951a 100755 +index f8dd719..348e0f6 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -884,6 +884,9 @@ ar71xx_board_detect() { +@@ -899,6 +899,9 @@ ar71xx_board_detect() { *"UniFi-AC-LITE") name="unifiac-lite" ;; @@ -68,7 +68,7 @@ index d3e6db9..7fc951a 100755 name="uap-pro" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index a1b65b7..0e9833d 100755 +index 5aa59fd..0f166eb 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -252,6 +252,7 @@ platform_check_image() { @@ -193,7 +193,7 @@ index eac0240..69b8398 100644 NAME:=Ubiquiti UniFiAP Outdoor PACKAGES:= diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 3efa2e1..58118f2 100644 +index c9d6ed1..0cf1df1 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -753,7 +753,13 @@ define Device/ubnt-unifiac-lite diff --git a/patches/openwrt/0079-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch b/patches/openwrt/0042-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch similarity index 100% rename from patches/openwrt/0079-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch rename to patches/openwrt/0042-libjson-c-Add-support-for-custom-format-strings-for-doubles.patch diff --git a/patches/openwrt/0080-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch b/patches/openwrt/0043-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch similarity index 100% rename from patches/openwrt/0080-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch rename to patches/openwrt/0043-ath9k-add-HSR-tuner-support-for-UniFi-Outdoor-Plus.patch diff --git a/patches/openwrt/0081-ar71xx-Send-power-to-USB-port-on-WNR2200.patch b/patches/openwrt/0044-ar71xx-Send-power-to-USB-port-on-WNR2200.patch similarity index 100% rename from patches/openwrt/0081-ar71xx-Send-power-to-USB-port-on-WNR2200.patch rename to patches/openwrt/0044-ar71xx-Send-power-to-USB-port-on-WNR2200.patch diff --git a/patches/openwrt/0045-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch b/patches/openwrt/0045-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch deleted file mode 100644 index 4f3580f5..00000000 --- a/patches/openwrt/0045-ar71xx-Generate-sysupgrade-images-for-OpenMesh-devices.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Sven Eckelmann -Date: Tue, 17 May 2016 16:38:29 +0200 -Subject: ar71xx: Generate sysupgrade images for OpenMesh devices - -Some OpenWrt based firmwares like Gluon expect that a sysupgrade image -exists when a device firmware can be updated via sysupgrade. This image -wasn't created until now because OpenMesh devices use the same image for -factory and sysupgrade flash. Copying the image from *factory.bin to -*sysupgrade.bin is therefore enough to make the sysupgrade functionality -visible. - -Reported-by: Matthias Schiffer -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/624172/ - -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 58118f2..7aee0c8 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -1877,6 +1877,9 @@ define Image/Build/OpenMesh - "$(BUILD_DIR)/fwupgrade.cfg-$(4)" "fwupgrade.cfg" \ - "$(KDIR_TMP)/vmlinux-$(2).uImage" "kernel" \ - "$(KDIR)/root.$(1)" "rootfs" -+ if [ -e "$(call factoryname,$(1),$(2))" ]; then \ -+ cp "$(call factoryname,$(1),$(2))" "$(call sysupname,$(1),$(2))"; \ -+ fi - endef - - diff --git a/patches/openwrt/0082-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch b/patches/openwrt/0045-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch similarity index 100% rename from patches/openwrt/0082-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch rename to patches/openwrt/0045-ar71xx-WNR2200-fix-for-random-WLAN-MAC.patch diff --git a/patches/openwrt/0083-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch b/patches/openwrt/0046-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch similarity index 99% rename from patches/openwrt/0083-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch rename to patches/openwrt/0046-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch index 853104ce..ec735029 100644 --- a/patches/openwrt/0083-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch +++ b/patches/openwrt/0046-ar71xx-WNR2200-enable-control-of-all-LEDs-and-buttons.patch @@ -10,10 +10,10 @@ Signed-off-by: Michal Cieslakiewicz Backport of r49101 diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index 9a768cd..ae17853 100644 +index d7dc9a1..337000c 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -590,6 +590,21 @@ wnr2000-v4) +@@ -592,6 +592,21 @@ wnr2000-v4) ucidef_set_led_usbdev "usb" "USB" "netgear:amber:status" "1-1" ;; diff --git a/patches/openwrt/0046-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch b/patches/openwrt/0046-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch deleted file mode 100644 index 35dcac61..00000000 --- a/patches/openwrt/0046-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750-board.patch +++ /dev/null @@ -1,202 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:10:43 +0000 -Subject: ar71xx: add kernel support for the OpenMesh MR1750 board - -Signed-off-by: Sven Eckelmann - -Backport of r46926 - -Forwarded: https://patchwork.ozlabs.org/patch/624173/ - -diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 -index 9a81911..c5a3c9a 100644 ---- a/target/linux/ar71xx/config-3.18 -+++ b/target/linux/ar71xx/config-3.18 -@@ -79,6 +79,7 @@ CONFIG_ATH79_MACH_JWAP003=y - CONFIG_ATH79_MACH_MC_MAC1200R=y - CONFIG_ATH79_MACH_MR16=y - CONFIG_ATH79_MACH_MR12=y -+CONFIG_ATH79_MACH_MR1750=y - CONFIG_ATH79_MACH_MR600=y - CONFIG_ATH79_MACH_MR900=y - CONFIG_ATH79_MACH_MYNET_N600=y -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -new file mode 100644 -index 0000000..8ace02f ---- /dev/null -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -@@ -0,0 +1,129 @@ -+/* -+ * MR1750 board support -+ * -+ * Copyright (c) 2012 Qualcomm Atheros -+ * Copyright (c) 2012-2013 Marek Lindner -+ * -+ * Permission to use, copy, modify, and/or distribute this software for any -+ * purpose with or without fee is hereby granted, provided that the above -+ * copyright notice and this permission notice appear in all copies. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -+ * -+ */ -+ -+#include -+#include -+ -+#include -+ -+#include "common.h" -+#include "dev-ap9x-pci.h" -+#include "dev-gpio-buttons.h" -+#include "dev-eth.h" -+#include "dev-leds-gpio.h" -+#include "dev-m25p80.h" -+#include "dev-wmac.h" -+#include "machtypes.h" -+#include "pci.h" -+ -+#define MR1750_GPIO_LED_LAN 12 -+#define MR1750_GPIO_LED_WLAN_2G 13 -+#define MR1750_GPIO_LED_STATUS_GREEN 19 -+#define MR1750_GPIO_LED_STATUS_RED 21 -+#define MR1750_GPIO_LED_POWER 22 -+#define MR1750_GPIO_LED_WLAN_5G 23 -+ -+#define MR1750_GPIO_BTN_RESET 17 -+ -+#define MR1750_KEYS_POLL_INTERVAL 20 /* msecs */ -+#define MR1750_KEYS_DEBOUNCE_INTERVAL (3 * MR1750_KEYS_POLL_INTERVAL) -+ -+#define MR1750_MAC0_OFFSET 0 -+#define MR1750_WMAC_CALDATA_OFFSET 0x1000 -+ -+static struct gpio_led mr1750_leds_gpio[] __initdata = { -+ { -+ .name = "mr1750:blue:power", -+ .gpio = MR1750_GPIO_LED_POWER, -+ .active_low = 1, -+ }, -+ { -+ .name = "mr1750:blue:wan", -+ .gpio = MR1750_GPIO_LED_LAN, -+ .active_low = 1, -+ }, -+ { -+ .name = "mr1750:blue:wlan24", -+ .gpio = MR1750_GPIO_LED_WLAN_2G, -+ .active_low = 1, -+ }, -+ { -+ .name = "mr1750:blue:wlan58", -+ .gpio = MR1750_GPIO_LED_WLAN_5G, -+ .active_low = 1, -+ }, -+ { -+ .name = "mr1750:green:status", -+ .gpio = MR1750_GPIO_LED_STATUS_GREEN, -+ .active_low = 1, -+ }, -+ { -+ .name = "mr1750:red:status", -+ .gpio = MR1750_GPIO_LED_STATUS_RED, -+ .active_low = 1, -+ }, -+}; -+ -+static struct gpio_keys_button mr1750_gpio_keys[] __initdata = { -+ { -+ .desc = "Reset button", -+ .type = EV_KEY, -+ .code = KEY_RESTART, -+ .debounce_interval = MR1750_KEYS_DEBOUNCE_INTERVAL, -+ .gpio = MR1750_GPIO_BTN_RESET, -+ .active_low = 1, -+ }, -+}; -+ -+static void __init mr1750_setup(void) -+{ -+ u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); -+ u8 mac[6]; -+ -+ ath79_eth0_pll_data.pll_1000 = 0xbe000101; -+ ath79_eth0_pll_data.pll_100 = 0x80000101; -+ ath79_eth0_pll_data.pll_10 = 0x80001313; -+ -+ ath79_register_m25p80(NULL); -+ -+ ath79_register_leds_gpio(-1, ARRAY_SIZE(mr1750_leds_gpio), -+ mr1750_leds_gpio); -+ ath79_register_gpio_keys_polled(-1, MR1750_KEYS_POLL_INTERVAL, -+ ARRAY_SIZE(mr1750_gpio_keys), -+ mr1750_gpio_keys); -+ -+ ath79_init_mac(mac, art + MR1750_MAC0_OFFSET, 1); -+ ath79_register_wmac(art + MR1750_WMAC_CALDATA_OFFSET, mac); -+ ath79_register_pci(); -+ -+ ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); -+ ath79_register_mdio(0, 0x0); -+ -+ ath79_init_mac(ath79_eth0_data.mac_addr, art + MR1750_MAC0_OFFSET, 0); -+ -+ /* GMAC0 is connected to the RMGII interface */ -+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; -+ ath79_eth0_data.phy_mask = BIT(5); -+ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; -+ -+ ath79_register_eth(0); -+} -+ -+MIPS_MACHINE(ATH79_MACH_MR1750, "MR1750", "OpenMesh MR1750", mr1750_setup); -diff --git a/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-mr1750-support.patch b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-mr1750-support.patch -new file mode 100644 -index 0000000..d802a12 ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-mr1750-support.patch -@@ -0,0 +1,39 @@ -+--- a/arch/mips/ath79/Kconfig -++++ b/arch/mips/ath79/Kconfig -+@@ -763,6 +763,16 @@ config ATH79_MACH_CAP4200AG -+ select ATH79_DEV_M25P80 -+ select ATH79_DEV_WMAC -+ -++config ATH79_MACH_MR1750 -++ bool "OpenMesh MR1750 board support" -++ select SOC_QCA955X -++ select ATH79_DEV_AP9X_PCI if PCI -++ select ATH79_DEV_ETH -++ select ATH79_DEV_GPIO_BUTTONS -++ select ATH79_DEV_LEDS_GPIO -++ select ATH79_DEV_M25P80 -++ select ATH79_DEV_WMAC -++ -+ config ATH79_MACH_MR900 -+ bool "OpenMesh MR900 board support" -+ select SOC_QCA955X -+--- a/arch/mips/ath79/Makefile -++++ b/arch/mips/ath79/Makefile -+@@ -80,6 +80,7 @@ obj-$(CONFIG_ATH79_MACH_HORNET_UB) += ma -+ obj-$(CONFIG_ATH79_MACH_MC_MAC1200R) += mach-mc-mac1200r.o -+ obj-$(CONFIG_ATH79_MACH_MR12) += mach-mr12.o -+ obj-$(CONFIG_ATH79_MACH_MR16) += mach-mr16.o -++obj-$(CONFIG_ATH79_MACH_MR1750) += mach-mr1750.o -+ obj-$(CONFIG_ATH79_MACH_MR600) += mach-mr600.o -+ obj-$(CONFIG_ATH79_MACH_MR900) += mach-mr900.o -+ obj-$(CONFIG_ATH79_MACH_MYNET_N600) += mach-mynet-n600.o -+--- a/arch/mips/ath79/machtypes.h -++++ b/arch/mips/ath79/machtypes.h -+@@ -69,6 +69,7 @@ enum ath79_mach_type { -+ ATH79_MACH_HORNET_UB, /* ALFA Networks Hornet-UB */ -+ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ -+ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ -++ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ -+ ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ -+ ATH79_MACH_MR600, /* OpenMesh MR600 */ -+ ATH79_MACH_MR900, /* OpenMesh MR900 */ diff --git a/patches/openwrt/0084-ar71xx-add-GL-AR150-support.patch b/patches/openwrt/0047-ar71xx-add-GL-AR150-support.patch similarity index 98% rename from patches/openwrt/0084-ar71xx-add-GL-AR150-support.patch rename to patches/openwrt/0047-ar71xx-add-GL-AR150-support.patch index bd6bf1aa..1fce6624 100644 --- a/patches/openwrt/0084-ar71xx-add-GL-AR150-support.patch +++ b/patches/openwrt/0047-ar71xx-add-GL-AR150-support.patch @@ -9,7 +9,7 @@ https://raw.githubusercontent.com/domino-team/OpenWrt-patches/master/AR150%2C%20 (and fixed indentation in target/linux/ar71xx/base-files/lib/ar71xx.sh) diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index ae17853..dc8b8d6 100644 +index 337000c..032acc9 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds @@ -181,6 +181,10 @@ dlan-pro-1200-ac) @@ -24,10 +24,10 @@ index ae17853..dc8b8d6 100644 ucidef_set_led_netdev "lan" "LAN" "gl-connect:green:lan" "eth1" ucidef_set_led_wlan "wlan" "WLAN" "gl-connect:red:wlan" "phy0tpt" diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index 4066506..89a2184 100755 +index e5c64bb..b8ae576 100755 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -381,6 +381,7 @@ dir-505-a1) +@@ -382,6 +382,7 @@ dir-505-a1) alfa-ap96 |\ alfa-nx |\ ap83 |\ @@ -36,7 +36,7 @@ index 4066506..89a2184 100755 jwap003 |\ pb42 |\ diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index fbf76c8..db908f9 100755 +index 348e0f6..5119b36 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -500,6 +500,9 @@ ar71xx_board_detect() { @@ -50,7 +50,7 @@ index fbf76c8..db908f9 100755 name="epg5000" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 4a4c476..aeb4577 100755 +index 0f166eb..f33419f 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -215,6 +215,7 @@ platform_check_image() { diff --git a/patches/openwrt/0047-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch b/patches/openwrt/0047-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch deleted file mode 100644 index 3e6363c7..00000000 --- a/patches/openwrt/0047-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750-board.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:11:01 +0000 -Subject: ar71xx: add user-space support for the OpenMesh MR1750 board - -Signed-off-by: Sven Eckelmann - -Backport of r46927 - -Forwarded: https://patchwork.ozlabs.org/patch/624174/ - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index 775aac6..44d2ddf 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -143,6 +143,9 @@ get_status_led() { - mr600v2) - status_led="mr600:blue:power" - ;; -+ mr1750) -+ status_led="mr1750:blue:power" -+ ;; - mr900 | \ - mr900v2) - status_led="mr900:blue:power" -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index a4b355a..c451124 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -239,6 +239,12 @@ mr600) - ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt" - ;; - -+mr1750) -+ ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0" -+ ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt" -+ ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt" -+ ;; -+ - mr900 | \ - mr900v2) - ucidef_set_led_netdev "lan" "LAN" "mr900:blue:wan" "eth0" -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index 0a23756..4066506 100755 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -334,6 +334,7 @@ eap300v2 |\ - eap7660d |\ - el-mini |\ - loco-m-xw |\ -+mr1750 |\ - mr600 |\ - mr600v2 |\ - mr900 |\ -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 7fc951a..587d029 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -562,6 +562,9 @@ ar71xx_board_detect() { - *MR600v2) - name="mr600v2" - ;; -+ *MR1750) -+ name="mr1750" -+ ;; - *MR600) - name="mr600" - ;; diff --git a/patches/openwrt/0086-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch b/patches/openwrt/0048-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch similarity index 100% rename from patches/openwrt/0086-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch rename to patches/openwrt/0048-build-don-t-add-j-for-parallel-builds-with-Make-4.2.patch diff --git a/patches/openwrt/0048-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch b/patches/openwrt/0048-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch deleted file mode 100644 index 66b0bc4f..00000000 --- a/patches/openwrt/0048-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-MR1750.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:11:18 +0000 -Subject: scripts/om-fwupgradecfg-gen.sh: add support for the MR1750 - -Signed-off-by: Sven Eckelmann - -Backport of r46928 - -Forwarded: https://patchwork.ozlabs.org/patch/624175/ - -diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh -index e132954..c790214 100644 ---- a/scripts/om-fwupgradecfg-gen.sh -+++ b/scripts/om-fwupgradecfg-gen.sh -@@ -7,7 +7,7 @@ - # - - usage() { -- echo "Usage: $0 " -+ echo "Usage: $0 " - rm -f $CFG_OUT - exit 1 - } -@@ -26,7 +26,7 @@ case $CE_TYPE in - FLASH_BS=262144 - MD5_SKIP_BLOCKS=1 - ;; -- OM5P|MR600|MR900) -+ OM5P|MR600|MR900|MR1750) - MAX_PART_SIZE=7808 - KERNEL_FLASH_ADDR=0xb0000 - FLASH_BS=65536 diff --git a/patches/openwrt/0049-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch b/patches/openwrt/0049-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch deleted file mode 100644 index dc595593..00000000 --- a/patches/openwrt/0049-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750.patch +++ /dev/null @@ -1,55 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:11:24 +0000 -Subject: ar71xx: enable sysupgrade for the OpenMesh MR1750 - -Signed-off-by: Sven Eckelmann - -Backport of r46929 - -Forwarded: https://patchwork.ozlabs.org/patch/624176/ - -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -index 547116e..9ca0f5b 100644 ---- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -@@ -72,6 +72,11 @@ platform_check_image_openmesh() - echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" - return 1 - ;; -+ MR1750) -+ [ "$board" = "mr1750" ] && break -+ echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" -+ return 1 -+ ;; - MR600) - [ "$board" = "mr600" ] && break - [ "$board" = "mr600v2" ] && break -@@ -157,7 +162,7 @@ platform_do_upgrade_openmesh() - kernel_start_addr1=0x9f1c0000 - kernel_start_addr2=0x9f8c0000 - ;; -- OM5P|MR600|MR900) -+ OM5P|MR600|MR900|MR1750) - block_size=$((64 * 1024)) - total_size=7995392 - kernel_start_addr1=0x9f0b0000 -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 0e9833d..ac060ea 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -296,6 +296,7 @@ platform_check_image() { - - return 0; - ;; -+ mr1750 | \ - mr600 | \ - mr600v2 | \ - mr900 | \ -@@ -528,6 +529,7 @@ platform_do_upgrade() { - tew-673gru) - platform_do_upgrade_dir825b "$ARGV" - ;; -+ mr1750 | \ - mr600 | \ - mr600v2 | \ - mr900 | \ diff --git a/patches/openwrt/0087-tools-cmake-fix-parallel-build-with-Make-4.2.patch b/patches/openwrt/0049-tools-cmake-fix-parallel-build-with-Make-4.2.patch similarity index 100% rename from patches/openwrt/0087-tools-cmake-fix-parallel-build-with-Make-4.2.patch rename to patches/openwrt/0049-tools-cmake-fix-parallel-build-with-Make-4.2.patch diff --git a/patches/openwrt/0088-linux-make-IPv6-builtin-if-selected-saves-30KB.patch b/patches/openwrt/0050-linux-make-IPv6-builtin-if-selected-saves-30KB.patch similarity index 100% rename from patches/openwrt/0088-linux-make-IPv6-builtin-if-selected-saves-30KB.patch rename to patches/openwrt/0050-linux-make-IPv6-builtin-if-selected-saves-30KB.patch diff --git a/patches/openwrt/0050-package-om-watchdog-add-OpenMesh-MR1750-support.patch b/patches/openwrt/0050-package-om-watchdog-add-OpenMesh-MR1750-support.patch deleted file mode 100644 index e16fb3ef..00000000 --- a/patches/openwrt/0050-package-om-watchdog-add-OpenMesh-MR1750-support.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:11:35 +0000 -Subject: package/om-watchdog: add OpenMesh MR1750 support - -Signed-off-by: Sven Eckelmann - -Backport of r46930 - -Forwarded: https://patchwork.ozlabs.org/patch/624177/ - -diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init -index 135fef7..c792968 100644 ---- a/package/kernel/om-watchdog/files/om-watchdog.init -+++ b/package/kernel/om-watchdog/files/om-watchdog.init -@@ -25,7 +25,7 @@ boot() { - "mr600v2") - service_start /sbin/om-watchdog 15 - ;; -- "mr900"|"mr900v2") -+ "mr900"|"mr900v2"|"mr1750") - service_start /sbin/om-watchdog 16 - ;; - esac diff --git a/patches/openwrt/0089-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch b/patches/openwrt/0051-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch similarity index 100% rename from patches/openwrt/0089-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch rename to patches/openwrt/0051-package-ipkg.mk-fix-Provides-for-packages-with-multiple-PROVIDES-entries.patch diff --git a/patches/openwrt/0051-package-uboot-envtools-add-OpenMesh-MR1750-support.patch b/patches/openwrt/0051-package-uboot-envtools-add-OpenMesh-MR1750-support.patch deleted file mode 100644 index 8e975a1c..00000000 --- a/patches/openwrt/0051-package-uboot-envtools-add-OpenMesh-MR1750-support.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:11:43 +0000 -Subject: package/uboot-envtools: add OpenMesh MR1750 support - -Signed-off-by: Sven Eckelmann - -Backport of r46931 - -Forwarded: https://patchwork.ozlabs.org/patch/624178/ - -diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx -index ec8541c..ef00f17 100644 ---- a/package/boot/uboot-envtools/files/ar71xx -+++ b/package/boot/uboot-envtools/files/ar71xx -@@ -21,6 +21,7 @@ carambola2 | \ - eap300v2 | \ - hornet-ub | \ - hornet-ub-x2 | \ -+mr1750 | \ - mr600 | \ - mr600v2 | \ - mr900 | \ diff --git a/patches/openwrt/0052-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch b/patches/openwrt/0052-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch deleted file mode 100644 index 1a846049..00000000 --- a/patches/openwrt/0052-ar71xx-create-profile-and-build-image-for-the-OpenMesh-MR1750-board.patch +++ /dev/null @@ -1,57 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:11:51 +0000 -Subject: ar71xx: create profile and build image for the OpenMesh MR1750 board - -Signed-off-by: Sven Eckelmann - -Backport of r46932 - -Forwarded: https://patchwork.ozlabs.org/patch/624179/ - -diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk -index 41b462e..06cf135 100644 ---- a/target/linux/ar71xx/generic/profiles/openmesh.mk -+++ b/target/linux/ar71xx/generic/profiles/openmesh.mk -@@ -49,9 +49,20 @@ endef - - $(eval $(call Profile,MR900)) - -+define Profile/MR1750 -+ NAME:=OpenMesh MR1750 -+ PACKAGES:=kmod-ath9k kmod-ath10k ath10k-firmware-qca988x -+endef -+ -+define Profile/MR1750/Description -+ Package set optimized for the OpenMesh MR1750. -+endef -+ -+$(eval $(call Profile,MR1750)) -+ - define Profile/OPENMESH - NAME:=OpenMesh products -- PACKAGES:=kmod-ath9k om-watchdog -+ PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog - endef - - define Profile/OPENMESH/Description -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 7aee0c8..0ebb7dc 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -2045,6 +2045,7 @@ $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900)) -+$(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750)) - - $(eval $(call SingleProfile,PB4X,128k,ALL0305,all0305,ALL0305,ttyS0,115200)) - $(eval $(call SingleProfile,PB4X,128k,EAP7660D,eap7660d,EAP7660D,ttyS0,115200)) -@@ -2138,7 +2139,7 @@ $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) - $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3)) - $(eval $(call MultiProfile,AP136,AP136_010 AP136_020)) - $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M)) --$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900)) -+$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750)) - $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) - $(eval $(call MultiProfile,TLMR3220,TLMR3220V1)) - $(eval $(call MultiProfile,TLMR3420,TLMR3420V1)) diff --git a/patches/openwrt/0090-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch b/patches/openwrt/0052-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch similarity index 100% rename from patches/openwrt/0090-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch rename to patches/openwrt/0052-kernel-remove-packaging-of-kmod-crypto-core-and-kmod-crypto-arc4.patch diff --git a/patches/openwrt/0053-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch b/patches/openwrt/0053-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch deleted file mode 100644 index efe4b609..00000000 --- a/patches/openwrt/0053-ar71xx-Extend-the-list-of-bits-in-QCA955X_GMAC_REG_ETH_CFG.patch +++ /dev/null @@ -1,47 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 16 Mar 2016 09:27:01 +0000 -Subject: ar71xx: Extend the list of bits in QCA955X_GMAC_REG_ETH_CFG - -Signed-off-by: Sven Eckelmann - -Backport of r49027 - -Forwarded: https://patchwork.ozlabs.org/patch/624180/ - -diff --git a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch -index 8bf7658..797977f 100644 ---- a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch -+++ b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch -@@ -207,7 +207,7 @@ - #define AR934X_GPIO_REG_FUNC 0x6c - - #define AR71XX_GPIO_COUNT 16 --@@ -560,4 +663,153 @@ -+@@ -560,4 +663,170 @@ - #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 - #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 - -@@ -358,6 +358,23 @@ - +#define QCA955X_GMAC_REG_ETH_CFG 0x00 - + - +#define QCA955X_ETH_CFG_RGMII_EN BIT(0) -++#define QCA955X_ETH_CFG_MII_GE0 BIT(1) -++#define QCA955X_ETH_CFG_GMII_GE0 BIT(2) -++#define QCA955X_ETH_CFG_MII_GE0_MASTER BIT(3) -++#define QCA955X_ETH_CFG_MII_GE0_SLAVE BIT(4) -++#define QCA955X_ETH_CFG_GE0_ERR_EN BIT(5) - +#define QCA955X_ETH_CFG_GE0_SGMII BIT(6) -++#define QCA955X_ETH_CFG_RMII_GE0 BIT(10) -++#define QCA955X_ETH_CFG_MII_CNTL_SPEED BIT(11) -++#define QCA955X_ETH_CFG_RMII_GE0_MASTER BIT(12) -++#define QCA955X_ETH_CFG_RXD_DELAY_MASK 0x3 -++#define QCA955X_ETH_CFG_RXD_DELAY_SHIFT 14 -++#define QCA955X_ETH_CFG_RDV_DELAY BIT(16) -++#define QCA955X_ETH_CFG_RDV_DELAY_MASK 0x3 -++#define QCA955X_ETH_CFG_RDV_DELAY_SHIFT 16 -++#define QCA955X_ETH_CFG_TXD_DELAY_MASK 0x3 -++#define QCA955X_ETH_CFG_TXD_DELAY_SHIFT 18 -++#define QCA955X_ETH_CFG_TXE_DELAY_MASK 0x3 -++#define QCA955X_ETH_CFG_TXE_DELAY_SHIFT 20 - + - #endif /* __ASM_MACH_AR71XX_REGS_H */ diff --git a/patches/openwrt/0104-x86-stop-relying-on-hexdump-for-image-build-signature.patch b/patches/openwrt/0053-x86-stop-relying-on-hexdump-for-image-build-signature.patch similarity index 100% rename from patches/openwrt/0104-x86-stop-relying-on-hexdump-for-image-build-signature.patch rename to patches/openwrt/0053-x86-stop-relying-on-hexdump-for-image-build-signature.patch diff --git a/patches/openwrt/0054-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch b/patches/openwrt/0054-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch deleted file mode 100644 index 43a876d2..00000000 --- a/patches/openwrt/0054-ar71xx-Use-_eth_cfg-helper-for-Open-Mesh-MR900-boards.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Sven Eckelmann -Date: Tue, 7 Jul 2015 13:47:39 +0000 -Subject: ar71xx: Use *_eth_cfg helper for Open Mesh MR900 boards - -Signed-off-by: Sven Eckelmann - -Backport of r46241 - -Forwarded: https://patchwork.ozlabs.org/patch/624181/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -index fe3e1fa..9c3164d 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -@@ -94,24 +94,6 @@ static struct gpio_keys_button mr900_gpio_keys[] __initdata = { - }, - }; - -- --static void __init mr900_gmac_setup(void) --{ -- void __iomem *base; -- u32 t; -- -- base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); -- -- t = __raw_readl(base + QCA955X_GMAC_REG_ETH_CFG); -- -- t &= ~(QCA955X_ETH_CFG_RGMII_EN | QCA955X_ETH_CFG_GE0_SGMII); -- t |= QCA955X_ETH_CFG_RGMII_EN; -- -- __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); -- -- iounmap(base); --} -- - static void __init mr900_setup(void) - { - u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); -@@ -141,8 +123,7 @@ static void __init mr900_setup(void) - } - pdata->use_eeprom = true; - -- mr900_gmac_setup(); -- -+ ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0); diff --git a/patches/openwrt/0105-mt76-fix-build-with-kernel-3.18.patch b/patches/openwrt/0054-mt76-fix-build-with-kernel-3.18.patch similarity index 100% rename from patches/openwrt/0105-mt76-fix-build-with-kernel-3.18.patch rename to patches/openwrt/0054-mt76-fix-build-with-kernel-3.18.patch diff --git a/patches/openwrt/0055-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch b/patches/openwrt/0055-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch deleted file mode 100644 index 137aa9d4..00000000 --- a/patches/openwrt/0055-ar71xx-Allow-to-use-ath79_gpio_output_select-on-QCA955x.patch +++ /dev/null @@ -1,79 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 24 Jul 2015 09:10:00 +0000 -Subject: ar71xx: Allow to use ath79_gpio_output_select on QCA955x - -Signed-off-by: Sven Eckelmann - -Backport of r46459 - -Forwarded: https://patchwork.ozlabs.org/patch/624182/ - -diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -new file mode 100644 -index 0000000..e71b6e2 ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -@@ -0,0 +1,63 @@ -+--- a/arch/mips/ath79/gpio.c -++++ b/arch/mips/ath79/gpio.c -+@@ -187,15 +187,30 @@ void __init ath79_gpio_output_select(uns -+ { -+ void __iomem *base = ath79_gpio_base; -+ unsigned long flags; -+- unsigned int reg; -++ unsigned int reg, reg_base; -++ unsigned long gpio_count; -+ u32 t, s; -+ -+- BUG_ON(!soc_is_ar934x() && !soc_is_qca953x() && !soc_is_qca956x()); -++ if (soc_is_ar934x()) { -++ gpio_count = AR934X_GPIO_COUNT; -++ reg_base = AR934X_GPIO_REG_OUT_FUNC0; -++ } else if (soc_is_qca953x()) { -++ gpio_count = QCA953X_GPIO_COUNT; -++ reg_base = QCA953X_GPIO_REG_OUT_FUNC0; -++ } else if (soc_is_qca955x()) { -++ gpio_count = QCA955X_GPIO_COUNT; -++ reg_base = QCA955X_GPIO_REG_OUT_FUNC0; -++ } else if (soc_is_qca956x()) { -++ gpio_count = QCA956X_GPIO_COUNT; -++ reg_base = QCA956X_GPIO_REG_OUT_FUNC0; -++ } else { -++ BUG(); -++ } -+ -+- if (gpio >= AR934X_GPIO_COUNT) -++ if (gpio >= gpio_count) -+ return; -+ -+- reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); -++ reg = reg_base + 4 * (gpio / 4); -+ s = 8 * (gpio % 4); -+ -+ spin_lock_irqsave(&ath79_gpio_lock, flags); -+--- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -++++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h -+@@ -875,6 +875,14 @@ -+ #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 -+ #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 -+ -++#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c -++#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 -++#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 -++#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 -++#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c -++#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 -++#define QCA955X_GPIO_REG_FUNC 0x6c -++ -+ #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c -+ #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 -+ #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 -+@@ -1014,6 +1022,8 @@ -+ #define AR934X_GPIO_OUT_EXT_LNA0 46 -+ #define AR934X_GPIO_OUT_EXT_LNA1 47 -+ -++#define QCA955X_GPIO_OUT_GPIO 0 -++ -+ /* -+ * MII_CTRL block -+ */ diff --git a/patches/openwrt/0106-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch b/patches/openwrt/0055-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch similarity index 100% rename from patches/openwrt/0106-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch rename to patches/openwrt/0055-ramips-Support-LEDs-on-D-Link-DIR-860L-B1.patch diff --git a/patches/openwrt/0056-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch b/patches/openwrt/0056-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch deleted file mode 100644 index 23b42cb6..00000000 --- a/patches/openwrt/0056-ar71xx-Add-support-for-ath79_gpio_function_-on-QCA955X.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 23 Mar 2016 12:52:27 +0000 -Subject: ar71xx: Add support for ath79_gpio_function_* on QCA955X - -Signed-off-by: Sven Eckelmann - -Backport of r49074 - -Forwarded: https://patchwork.ozlabs.org/patch/624183/ - -diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -index e71b6e2..0e87357 100644 ---- a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -@@ -1,6 +1,16 @@ - --- a/arch/mips/ath79/gpio.c - +++ b/arch/mips/ath79/gpio.c --@@ -187,15 +187,30 @@ void __init ath79_gpio_output_select(uns -+@@ -146,7 +146,8 @@ static void __iomem *ath79_gpio_get_func -+ if (soc_is_ar71xx() || -+ soc_is_ar724x() || -+ soc_is_ar913x() || -+- soc_is_ar933x()) -++ soc_is_ar933x() || -++ soc_is_qca955x()) -+ reg = AR71XX_GPIO_REG_FUNC; -+ else if (soc_is_ar934x() || -+ soc_is_qca953x() || -+@@ -187,15 +188,30 @@ void __init ath79_gpio_output_select(uns - { - void __iomem *base = ath79_gpio_base; - unsigned long flags; diff --git a/patches/openwrt/0107-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch b/patches/openwrt/0056-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch similarity index 100% rename from patches/openwrt/0107-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch rename to patches/openwrt/0056-ramips-add-button-support-and-make-LEDs-known-to-userspace-for-DIR-860L-B1.patch diff --git a/patches/openwrt/0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch b/patches/openwrt/0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch deleted file mode 100644 index ee3c3674..00000000 --- a/patches/openwrt/0057-ar71xx-Add-QCA955X-GPIO-mux-and-function-definitions.patch +++ /dev/null @@ -1,159 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 23 Mar 2016 12:52:31 +0000 -Subject: ar71xx: Add QCA955X GPIO mux and function definitions - -Signed-off-by: Sven Eckelmann - -Backport of r49075 - -Forwarded: https://patchwork.ozlabs.org/patch/624184/ - -diff --git a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch -index 797977f..0126f6a 100644 ---- a/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch -+++ b/target/linux/ar71xx/patches-3.18/601-MIPS-ath79-add-more-register-defines.patch -@@ -194,7 +194,7 @@ - #define AR933X_BOOTSTRAP_REF_CLK_40 BIT(0) - - #define AR934X_BOOTSTRAP_SW_OPTION8 BIT(23) --@@ -529,6 +626,12 @@ -+@@ -529,8 +626,22 @@ - #define AR71XX_GPIO_REG_INT_ENABLE 0x24 - #define AR71XX_GPIO_REG_FUNC 0x28 - -@@ -206,8 +206,18 @@ - +#define AR934X_GPIO_REG_OUT_FUNC5 0x40 - #define AR934X_GPIO_REG_FUNC 0x6c - -++#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c -++#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 -++#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 -++#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 -++#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c -++#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 -++#define QCA955X_GPIO_REG_FUNC 0x6c -++ - #define AR71XX_GPIO_COUNT 16 --@@ -560,4 +663,170 @@ -+ #define AR7240_GPIO_COUNT 18 -+ #define AR7241_GPIO_COUNT 20 -+@@ -560,4 +671,235 @@ - #define AR934X_SRIF_DPLL2_OUTDIV_SHIFT 13 - #define AR934X_SRIF_DPLL2_OUTDIV_MASK 0x7 - -@@ -288,6 +298,71 @@ - +#define AR934X_GPIO_OUT_EXT_LNA0 46 - +#define AR934X_GPIO_OUT_EXT_LNA1 47 - + -++#define QCA955X_GPIO_FUNC_CLK_OBS7_EN BIT(9) -++#define QCA955X_GPIO_FUNC_CLK_OBS6_EN BIT(8) -++#define QCA955X_GPIO_FUNC_CLK_OBS5_EN BIT(7) -++#define QCA955X_GPIO_FUNC_CLK_OBS4_EN BIT(6) -++#define QCA955X_GPIO_FUNC_CLK_OBS3_EN BIT(5) -++#define QCA955X_GPIO_FUNC_CLK_OBS2_EN BIT(4) -++#define QCA955X_GPIO_FUNC_CLK_OBS1_EN BIT(3) -++#define QCA955X_GPIO_FUNC_JTAG_DISABLE BIT(1) -++ -++#define QCA955X_GPIO_OUT_GPIO 0 -++#define QCA955X_MII_EXT_MDI 1 -++#define QCA955X_SLIC_DATA_OUT 3 -++#define QCA955X_SLIC_PCM_FS 4 -++#define QCA955X_SLIC_PCM_CLK 5 -++#define QCA955X_SPI_CLK 8 -++#define QCA955X_SPI_CS_0 9 -++#define QCA955X_SPI_CS_1 10 -++#define QCA955X_SPI_CS_2 11 -++#define QCA955X_SPI_MISO 12 -++#define QCA955X_I2S_CLK 13 -++#define QCA955X_I2S_WS 14 -++#define QCA955X_I2S_SD 15 -++#define QCA955X_I2S_MCK 16 -++#define QCA955X_SPDIF_OUT 17 -++#define QCA955X_UART1_TD 18 -++#define QCA955X_UART1_RTS 19 -++#define QCA955X_UART1_RD 20 -++#define QCA955X_UART1_CTS 21 -++#define QCA955X_UART0_SOUT 22 -++#define QCA955X_SPDIF2_OUT 23 -++#define QCA955X_LED_SGMII_SPEED0 24 -++#define QCA955X_LED_SGMII_SPEED1 25 -++#define QCA955X_LED_SGMII_DUPLEX 26 -++#define QCA955X_LED_SGMII_LINK_UP 27 -++#define QCA955X_SGMII_SPEED0_INVERT 28 -++#define QCA955X_SGMII_SPEED1_INVERT 29 -++#define QCA955X_SGMII_DUPLEX_INVERT 30 -++#define QCA955X_SGMII_LINK_UP_INVERT 31 -++#define QCA955X_GE1_MII_MDO 32 -++#define QCA955X_GE1_MII_MDC 33 -++#define QCA955X_SWCOM2 38 -++#define QCA955X_SWCOM3 39 -++#define QCA955X_MAC2_GPIO 40 -++#define QCA955X_MAC3_GPIO 41 -++#define QCA955X_ATT_LED 42 -++#define QCA955X_PWR_LED 43 -++#define QCA955X_TX_FRAME 44 -++#define QCA955X_RX_CLEAR_EXTERNAL 45 -++#define QCA955X_LED_NETWORK_EN 46 -++#define QCA955X_LED_POWER_EN 47 -++#define QCA955X_WMAC_GLUE_WOW 68 -++#define QCA955X_RX_CLEAR_EXTENSION 70 -++#define QCA955X_CP_NAND_CS1 73 -++#define QCA955X_USB_SUSPEND 74 -++#define QCA955X_ETH_TX_ERR 75 -++#define QCA955X_DDR_DQ_OE 76 -++#define QCA955X_CLKREQ_N_EP 77 -++#define QCA955X_CLKREQ_N_RC 78 -++#define QCA955X_CLK_OBS0 79 -++#define QCA955X_CLK_OBS1 80 -++#define QCA955X_CLK_OBS2 81 -++#define QCA955X_CLK_OBS3 82 -++#define QCA955X_CLK_OBS4 83 -++#define QCA955X_CLK_OBS5 84 -++ - +/* - + * MII_CTRL block - + */ -diff --git a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -index 0e87357..8a54859 100644 ---- a/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -+++ b/target/linux/ar71xx/patches-3.18/739-MIPS-ath79-add-gpio-func-register-for-QCA955x-SoC.patch -@@ -37,37 +37,12 @@ - + } - - - if (gpio >= AR934X_GPIO_COUNT) -+- return; - + if (gpio >= gpio_count) -- return; -++ return; - - - reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); - + reg = reg_base + 4 * (gpio / 4); - s = 8 * (gpio % 4); - - spin_lock_irqsave(&ath79_gpio_lock, flags); ----- a/arch/mips/include/asm/mach-ath79/ar71xx_regs.h --+++ b/arch/mips/include/asm/mach-ath79/ar71xx_regs.h --@@ -875,6 +875,14 @@ -- #define QCA953X_GPIO_OUT_MUX_LED_LINK4 44 -- #define QCA953X_GPIO_OUT_MUX_LED_LINK5 45 -- --+#define QCA955X_GPIO_REG_OUT_FUNC0 0x2c --+#define QCA955X_GPIO_REG_OUT_FUNC1 0x30 --+#define QCA955X_GPIO_REG_OUT_FUNC2 0x34 --+#define QCA955X_GPIO_REG_OUT_FUNC3 0x38 --+#define QCA955X_GPIO_REG_OUT_FUNC4 0x3c --+#define QCA955X_GPIO_REG_OUT_FUNC5 0x40 --+#define QCA955X_GPIO_REG_FUNC 0x6c --+ -- #define QCA956X_GPIO_REG_OUT_FUNC0 0x2c -- #define QCA956X_GPIO_REG_OUT_FUNC1 0x30 -- #define QCA956X_GPIO_REG_OUT_FUNC2 0x34 --@@ -1014,6 +1022,8 @@ -- #define AR934X_GPIO_OUT_EXT_LNA0 46 -- #define AR934X_GPIO_OUT_EXT_LNA1 47 -- --+#define QCA955X_GPIO_OUT_GPIO 0 --+ -- /* -- * MII_CTRL block -- */ diff --git a/patches/openwrt/0108-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch b/patches/openwrt/0057-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch similarity index 100% rename from patches/openwrt/0108-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch rename to patches/openwrt/0057-ramips-set-correct-LAN-WAN-MAC-addresses-on-DIR-860L-B1.patch diff --git a/patches/openwrt/0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch b/patches/openwrt/0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch deleted file mode 100644 index 6a32c80b..00000000 --- a/patches/openwrt/0058-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR900.patch +++ /dev/null @@ -1,78 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 16 Mar 2016 09:27:11 +0000 -Subject: ar71xx: Use PHY fixups for Open Mesh MR900 - -The delays of PHY/MAC on the MR900 are done by u-boot and OpenWrt in -different ways. u-boot only modifies the ETH_CFG of the QCA955x based on -the link speed. But OpenWrt can only modify the PHY delays based on the -link speed. - -This can lead to communication problems when u-boot initializes the ETH_CFG -for a specific link speed (e.g. 10BASE-T) but then OpenWrt the sets the PHY -delays to an incompatible value. - -Instead reset the ETH_CFG delay bits of the QCA955x to a specific value and -only rely on the AT803x PHY settings. - -Signed-off-by: Sven Eckelmann - -Backport of r49030 - -Forwarded: https://patchwork.ozlabs.org/patch/624185/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -index 9c3164d..3634bf0 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -@@ -23,6 +23,7 @@ - #include - - #include -+#include - - #include "common.h" - #include "dev-ap9x-pci.h" -@@ -94,15 +95,30 @@ static struct gpio_keys_button mr900_gpio_keys[] __initdata = { - }, - }; - -+static struct at803x_platform_data mr900_at803x_data = { -+ .disable_smarteee = 1, -+ .enable_rgmii_rx_delay = 1, -+ .enable_rgmii_tx_delay = 0, -+ .fixup_rgmii_tx_delay = 1, -+}; -+ -+static struct mdio_board_info mr900_mdio0_info[] = { -+ { -+ .bus_id = "ag71xx-mdio.0", -+ .phy_addr = 5, -+ .platform_data = &mr900_at803x_data, -+ }, -+}; -+ - static void __init mr900_setup(void) - { - u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); - u8 mac[6], pcie_mac[6]; - struct ath9k_platform_data *pdata; - -- ath79_eth0_pll_data.pll_1000 = 0xbe000101; -- ath79_eth0_pll_data.pll_100 = 0x80000101; -- ath79_eth0_pll_data.pll_10 = 0x80001313; -+ ath79_eth0_pll_data.pll_1000 = 0xae000000; -+ ath79_eth0_pll_data.pll_100 = 0xa0000101; -+ ath79_eth0_pll_data.pll_10 = 0xa0001313; - - ath79_register_m25p80(NULL); - -@@ -126,6 +142,9 @@ static void __init mr900_setup(void) - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); - ath79_register_mdio(0, 0x0); - -+ mdiobus_register_board_info(mr900_mdio0_info, -+ ARRAY_SIZE(mr900_mdio0_info)); -+ - ath79_init_mac(ath79_eth0_data.mac_addr, art + MR900_MAC0_OFFSET, 0); - - /* GMAC0 is connected to the RMGII interface */ diff --git a/patches/openwrt/0109-ar71xx-add-support-for-TP-LINK-TL-WR842N-ND-v3.patch b/patches/openwrt/0058-ar71xx-add-support-for-TP-LINK-TL-WR842N-ND-v3.patch similarity index 100% rename from patches/openwrt/0109-ar71xx-add-support-for-TP-LINK-TL-WR842N-ND-v3.patch rename to patches/openwrt/0058-ar71xx-add-support-for-TP-LINK-TL-WR842N-ND-v3.patch diff --git a/patches/openwrt/0110-ar71xx-Fix-TL-WR841N-v11-LEDs-use-separate-machine.patch b/patches/openwrt/0059-ar71xx-Fix-TL-WR841N-v11-LEDs-use-separate-machine.patch similarity index 100% rename from patches/openwrt/0110-ar71xx-Fix-TL-WR841N-v11-LEDs-use-separate-machine.patch rename to patches/openwrt/0059-ar71xx-Fix-TL-WR841N-v11-LEDs-use-separate-machine.patch diff --git a/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch b/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch deleted file mode 100644 index 50ff879c..00000000 --- a/patches/openwrt/0059-ar71xx-Use-PHY-fixups-for-Open-Mesh-MR1750.patch +++ /dev/null @@ -1,77 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 16 Mar 2016 09:27:14 +0000 -Subject: ar71xx: Use PHY fixups for Open Mesh MR1750 - -The delays of PHY/MAC on the MR1750 are done by u-boot and OpenWrt in -different ways. u-boot only modifies the ETH_CFG of the QCA955x based on -the link speed. But OpenWrt can only modify the PHY delays based on the -link speed. - -This can lead to communication problems when u-boot initializes the ETH_CFG -for a specific link speed (e.g. 10BASE-T) but then OpenWrt the sets the PHY -delays to an incompatible value. - -Instead reset the ETH_CFG delay bits of the QCA955x to a specific value and -only rely on the AT803x PHY settings. - -Signed-off-by: Sven Eckelmann - -Backport of r49031 - -Forwarded: https://patchwork.ozlabs.org/patch/624186/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -index 8ace02f..f9e45bd 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -@@ -22,6 +22,7 @@ - #include - - #include -+#include - - #include "common.h" - #include "dev-ap9x-pci.h" -@@ -92,14 +93,29 @@ static struct gpio_keys_button mr1750_gpio_keys[] __initdata = { - }, - }; - -+static struct at803x_platform_data mr1750_at803x_data = { -+ .disable_smarteee = 1, -+ .enable_rgmii_rx_delay = 1, -+ .enable_rgmii_tx_delay = 0, -+ .fixup_rgmii_tx_delay = 1, -+}; -+ -+static struct mdio_board_info mr1750_mdio0_info[] = { -+ { -+ .bus_id = "ag71xx-mdio.0", -+ .phy_addr = 5, -+ .platform_data = &mr1750_at803x_data, -+ }, -+}; -+ - static void __init mr1750_setup(void) - { - u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); - u8 mac[6]; - -- ath79_eth0_pll_data.pll_1000 = 0xbe000101; -- ath79_eth0_pll_data.pll_100 = 0x80000101; -- ath79_eth0_pll_data.pll_10 = 0x80001313; -+ ath79_eth0_pll_data.pll_1000 = 0xae000000; -+ ath79_eth0_pll_data.pll_100 = 0xa0000101; -+ ath79_eth0_pll_data.pll_10 = 0xa0001313; - - ath79_register_m25p80(NULL); - -@@ -116,6 +132,9 @@ static void __init mr1750_setup(void) - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); - ath79_register_mdio(0, 0x0); - -+ mdiobus_register_board_info(mr1750_mdio0_info, -+ ARRAY_SIZE(mr1750_mdio0_info)); -+ - ath79_init_mac(ath79_eth0_data.mac_addr, art + MR1750_MAC0_OFFSET, 0); - - /* GMAC0 is connected to the RMGII interface */ diff --git a/patches/openwrt/0060-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch b/patches/openwrt/0060-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch deleted file mode 100644 index 3567a32f..00000000 --- a/patches/openwrt/0060-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR900.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 23 Mar 2016 12:52:09 +0000 -Subject: ar71xx: Use private version of ath79_setup_qca955x_eth_cfg for MR900 - -The MR900 must unset some bits in ETH_CFG which were set by u-boot to work -correctly under OpenWrt. But the global function -ath79_setup_qca955x_eth_cfg will not unset all of them to increase the -backward compatiblity with older mach-* files. A private (simplified) -version for MR900 can be used instead. - -Signed-off-by: Sven Eckelmann - -Backport of r49069 - -Forwarded: https://patchwork.ozlabs.org/patch/624187/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -index 3634bf0..b439f58 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr900.c -@@ -110,6 +110,28 @@ static struct mdio_board_info mr900_mdio0_info[] = { - }, - }; - -+static void __init mr900_setup_qca955x_eth_cfg(u32 mask, -+ unsigned int rxd, -+ unsigned int rxdv, -+ unsigned int txd, -+ unsigned int txe) -+{ -+ void __iomem *base; -+ u32 t; -+ -+ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); -+ -+ t = mask; -+ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; -+ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; -+ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; -+ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; -+ -+ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); -+ -+ iounmap(base); -+} -+ - static void __init mr900_setup(void) - { - u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); -@@ -139,7 +161,7 @@ static void __init mr900_setup(void) - } - pdata->use_eeprom = true; - -- ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); -+ mr900_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); - ath79_register_mdio(0, 0x0); - - mdiobus_register_board_info(mr900_mdio0_info, diff --git a/patches/openwrt/0111-x86-generic-enable-CONFIG_SATA_VIA.patch b/patches/openwrt/0060-x86-generic-enable-CONFIG_SATA_VIA.patch similarity index 100% rename from patches/openwrt/0111-x86-generic-enable-CONFIG_SATA_VIA.patch rename to patches/openwrt/0060-x86-generic-enable-CONFIG_SATA_VIA.patch diff --git a/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch b/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch deleted file mode 100644 index 8ea16499..00000000 --- a/patches/openwrt/0061-ar71xx-Use-private-version-of-ath79_setup_qca955x_eth_cfg-for-MR1750.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: Sven Eckelmann -Date: Wed, 23 Mar 2016 12:52:12 +0000 -Subject: ar71xx: Use private version of ath79_setup_qca955x_eth_cfg for MR1750 - -The MR1750 must unset some bits in ETH_CFG which were set by u-boot to work -correctly under OpenWrt. But the global function -ath79_setup_qca955x_eth_cfg will not unset all of them to increase the -backward compatiblity with older mach-* files. A private (simplified) -version for MR1750 can be used instead. - -Signed-off-by: Sven Eckelmann - -Backport of r49070 - -Forwarded: https://patchwork.ozlabs.org/patch/624188/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -index f9e45bd..e3c04e7 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -@@ -108,6 +108,28 @@ static struct mdio_board_info mr1750_mdio0_info[] = { - }, - }; - -+static void __init mr1750_setup_qca955x_eth_cfg(u32 mask, -+ unsigned int rxd, -+ unsigned int rxdv, -+ unsigned int txd, -+ unsigned int txe) -+{ -+ void __iomem *base; -+ u32 t; -+ -+ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); -+ -+ t = mask; -+ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; -+ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; -+ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; -+ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; -+ -+ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); -+ -+ iounmap(base); -+} -+ - static void __init mr1750_setup(void) - { - u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); -@@ -129,7 +151,7 @@ static void __init mr1750_setup(void) - ath79_register_wmac(art + MR1750_WMAC_CALDATA_OFFSET, mac); - ath79_register_pci(); - -- ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN); -+ mr1750_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); - ath79_register_mdio(0, 0x0); - - mdiobus_register_board_info(mr1750_mdio0_info, diff --git a/patches/openwrt/0112-libpcap-fix-dependency-of-install-shared-so-make-target.patch b/patches/openwrt/0061-libpcap-fix-dependency-of-install-shared-so-make-target.patch similarity index 100% rename from patches/openwrt/0112-libpcap-fix-dependency-of-install-shared-so-make-target.patch rename to patches/openwrt/0061-libpcap-fix-dependency-of-install-shared-so-make-target.patch diff --git a/patches/openwrt/0113-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch b/patches/openwrt/0062-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch similarity index 100% rename from patches/openwrt/0113-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch rename to patches/openwrt/0062-ar71xx-add-revision-detection-for-D-Link-DIR-505-A1-A2.patch diff --git a/patches/openwrt/0062-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch b/patches/openwrt/0062-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch deleted file mode 100644 index 30658cdb..00000000 --- a/patches/openwrt/0062-scripts-om-fwupgradecfg-gen.sh-Fix-u-boot-image-md5sum-check.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Sven Eckelmann -Date: Mon, 14 Sep 2015 20:10:10 +0000 -Subject: scripts/om-fwupgradecfg-gen.sh: Fix u-boot image md5sum check - -The u-boot on Open Mesh devices checks the whole transfered image against a -md5sum. This is stored inside the option filemd5sum inside the -fwupgrade.cfg. The bootloader will not check it when this setting is -missing and could therefore write invalid images to the flash. - -Signed-off-by: Sven Eckelmann - -Backport of r46925 - -Forwarded: https://patchwork.ozlabs.org/patch/624189/ - -diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh -index c790214..fab1582 100644 ---- a/scripts/om-fwupgradecfg-gen.sh -+++ b/scripts/om-fwupgradecfg-gen.sh -@@ -48,6 +48,7 @@ ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); p - ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") - ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) - ROOTFS_MD5=$(md5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | md5sum); echo ${md5%% *}) -+ROOTFS_MD5_FULL=$(md5=$(md5sum $ROOTFS_PATH); echo ${md5%% *}) - ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) - ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE)) - -@@ -55,6 +56,7 @@ cat << EOF > $CFG_OUT - [vmlinux] - filename=kernel - md5sum=$KERNEL_MD5 -+filemd5sum=$KERNEL_MD5 - flashaddr=$KERNEL_FLASH_ADDR - checksize=0x0 - cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; saveenv -@@ -63,6 +65,7 @@ cmd_fail=reset - [rootfs] - filename=rootfs - md5sum=$ROOTFS_MD5 -+filemd5sum=$ROOTFS_MD5_FULL - flashaddr=$ROOTFS_FLASH_ADDR - checksize=$ROOTFS_CHECK_SIZE - cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; setenv rootfs_size_1 $ROOTFS_PART_SIZE; saveenv diff --git a/patches/openwrt/0114-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch b/patches/openwrt/0063-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch similarity index 100% rename from patches/openwrt/0114-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch rename to patches/openwrt/0063-ar71xx-don-t-use-D-Link-DIR-505-status-LED-as-ethernet-indicator.patch diff --git a/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch b/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch deleted file mode 100644 index 01bb37b5..00000000 --- a/patches/openwrt/0063-scripts-om-fwupgradecfg-gen.sh-Generate-sha256sum-for-uboot-verification.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:25:42 +0000 -Subject: scripts/om-fwupgradecfg-gen.sh: Generate sha256sum for uboot verification - -Future Open Mesh u-boot versions are changing the check of the image files -(vmlinux, rootfs) from md5 to sha256. Having both in them should be enough -to ensure backward and forward compatibility. - -Signed-off-by: Sven Eckelmann - -Backport of r49140 - -Forwarded: https://patchwork.ozlabs.org/patch/624190/ - -diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh -index fab1582..e208e6d 100644 ---- a/scripts/om-fwupgradecfg-gen.sh -+++ b/scripts/om-fwupgradecfg-gen.sh -@@ -42,6 +42,7 @@ CHECK_BS=65536 - - KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH") - KERNEL_MD5=$(md5=$(md5sum $KERNEL_PATH); echo ${md5%% *}) -+KERNEL_SHA256=$(openssl dgst -sha256 $KERNEL_PATH | awk '{print $2}') - KERNEL_PART_SIZE=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) - - ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); printf "0x%x" $addr) -@@ -49,6 +50,7 @@ ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") - ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) - ROOTFS_MD5=$(md5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | md5sum); echo ${md5%% *}) - ROOTFS_MD5_FULL=$(md5=$(md5sum $ROOTFS_PATH); echo ${md5%% *}) -+ROOTFS_SHA256_FULL=$(openssl dgst -sha256 $ROOTFS_PATH | awk '{print $2}') - ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) - ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE)) - -@@ -57,6 +59,7 @@ cat << EOF > $CFG_OUT - filename=kernel - md5sum=$KERNEL_MD5 - filemd5sum=$KERNEL_MD5 -+filesha256sum=$KERNEL_SHA256 - flashaddr=$KERNEL_FLASH_ADDR - checksize=0x0 - cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; saveenv -@@ -66,6 +69,7 @@ cmd_fail=reset - filename=rootfs - md5sum=$ROOTFS_MD5 - filemd5sum=$ROOTFS_MD5_FULL -+filesha256sum=$ROOTFS_SHA256_FULL - flashaddr=$ROOTFS_FLASH_ADDR - checksize=$ROOTFS_CHECK_SIZE - cmd_success=setenv bootseq 1,2; setenv kernel_size_1 $KERNEL_PART_SIZE; setenv rootfs_size_1 $ROOTFS_PART_SIZE; saveenv diff --git a/patches/openwrt/0064-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch b/patches/openwrt/0064-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch deleted file mode 100644 index f3f8b253..00000000 --- a/patches/openwrt/0064-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-AC-board.patch +++ /dev/null @@ -1,265 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:25:47 +0000 -Subject: ar71xx: add kernel support for the OpenMesh OM5P-AC board - -Signed-off-by: Sven Eckelmann - -Backport of r49141 - -Forwarded: https://patchwork.ozlabs.org/patch/624191/ - -diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 -index c5a3c9a..dd89357 100644 ---- a/target/linux/ar71xx/config-3.18 -+++ b/target/linux/ar71xx/config-3.18 -@@ -91,6 +91,7 @@ CONFIG_ATH79_MACH_NBG460N=y - CONFIG_ATH79_MACH_NBG6716=y - CONFIG_ATH79_MACH_OM2P=y - CONFIG_ATH79_MACH_OM5P=y -+CONFIG_ATH79_MACH_OM5P_AC=y - CONFIG_ATH79_MACH_ONION_OMEGA=y - CONFIG_ATH79_MACH_PB42=y - CONFIG_ATH79_MACH_PB44=y -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pac.c -new file mode 100644 -index 0000000..f6974af ---- /dev/null -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pac.c -@@ -0,0 +1,193 @@ -+/* -+ * OpenMesh OM5P-AC support -+ * -+ * Copyright (C) 2013 Marek Lindner -+ * Copyright (C) 2014 Sven Eckelmann -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published -+ * by the Free Software Foundation. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include "common.h" -+#include "dev-ap9x-pci.h" -+#include "dev-eth.h" -+#include "dev-leds-gpio.h" -+#include "dev-m25p80.h" -+#include "dev-wmac.h" -+#include "machtypes.h" -+#include "pci.h" -+ -+#define OM5PAC_GPIO_LED_POWER 18 -+#define OM5PAC_GPIO_LED_GREEN 21 -+#define OM5PAC_GPIO_LED_RED 23 -+#define OM5PAC_GPIO_LED_YELLOW 22 -+#define OM5PAC_GPIO_LED_LAN 20 -+#define OM5PAC_GPIO_LED_WAN 19 -+#define OM5PAC_GPIO_I2C_SCL 12 -+#define OM5PAC_GPIO_I2C_SDA 11 -+ -+#define OM5PAC_KEYS_POLL_INTERVAL 20 /* msecs */ -+#define OM5PAC_KEYS_DEBOUNCE_INTERVAL (3 * OM5PAC_KEYS_POLL_INTERVAL) -+ -+#define OM5PAC_WMAC_CALDATA_OFFSET 0x1000 -+ -+static struct gpio_led om5pac_leds_gpio[] __initdata = { -+ { -+ .name = "om5pac:blue:power", -+ .gpio = OM5PAC_GPIO_LED_POWER, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:red:wifi", -+ .gpio = OM5PAC_GPIO_LED_RED, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:yellow:wifi", -+ .gpio = OM5PAC_GPIO_LED_YELLOW, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:green:wifi", -+ .gpio = OM5PAC_GPIO_LED_GREEN, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:blue:lan", -+ .gpio = OM5PAC_GPIO_LED_LAN, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:blue:wan", -+ .gpio = OM5PAC_GPIO_LED_WAN, -+ .active_low = 1, -+ } -+}; -+ -+static struct flash_platform_data om5pac_flash_data = { -+ .type = "mx25l12805d", -+}; -+ -+static struct i2c_gpio_platform_data om5pac_i2c_device_platdata = { -+ .sda_pin = OM5PAC_GPIO_I2C_SDA, -+ .scl_pin = OM5PAC_GPIO_I2C_SCL, -+ .udelay = 10, -+ .sda_is_open_drain = 1, -+ .scl_is_open_drain = 1, -+}; -+ -+static struct platform_device om5pac_i2c_device = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &om5pac_i2c_device_platdata, -+ }, -+}; -+ -+static struct i2c_board_info om5pac_i2c_devs[] __initdata = { -+ { -+ I2C_BOARD_INFO("tmp423", 0x4c), -+ }, -+}; -+ -+static struct at803x_platform_data om5pac_at803x_data = { -+ .disable_smarteee = 1, -+ .enable_rgmii_rx_delay = 1, -+ .enable_rgmii_tx_delay = 1, -+}; -+ -+static struct mdio_board_info om5pac_mdio0_info[] = { -+ { -+ .bus_id = "ag71xx-mdio.0", -+ .phy_addr = 1, -+ .platform_data = &om5pac_at803x_data, -+ }, -+ { -+ .bus_id = "ag71xx-mdio.0", -+ .phy_addr = 2, -+ .platform_data = &om5pac_at803x_data, -+ }, -+}; -+ -+static void __init om5p_ac_setup_qca955x_eth_cfg(u32 mask, -+ unsigned int rxd, -+ unsigned int rxdv, -+ unsigned int txd, -+ unsigned int txe) -+{ -+ void __iomem *base; -+ u32 t; -+ -+ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); -+ -+ t = mask; -+ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; -+ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; -+ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; -+ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; -+ -+ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); -+ -+ iounmap(base); -+} -+ -+static void __init om5p_ac_setup(void) -+{ -+ u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); -+ u8 mac[6]; -+ -+ /* temperature sensor */ -+ platform_device_register(&om5pac_i2c_device); -+ i2c_register_board_info(0, om5pac_i2c_devs, -+ ARRAY_SIZE(om5pac_i2c_devs)); -+ -+ ath79_gpio_output_select(OM5PAC_GPIO_LED_WAN, QCA955X_GPIO_OUT_GPIO); -+ -+ ath79_register_m25p80(&om5pac_flash_data); -+ ath79_register_leds_gpio(-1, ARRAY_SIZE(om5pac_leds_gpio), -+ om5pac_leds_gpio); -+ -+ ath79_init_mac(mac, art, 0x02); -+ ath79_register_wmac(art + OM5PAC_WMAC_CALDATA_OFFSET, mac); -+ -+ om5p_ac_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 3, 3, 0, 0); -+ ath79_register_mdio(0, 0x0); -+ -+ mdiobus_register_board_info(om5pac_mdio0_info, -+ ARRAY_SIZE(om5pac_mdio0_info)); -+ -+ ath79_init_mac(ath79_eth0_data.mac_addr, art, 0x00); -+ ath79_init_mac(ath79_eth1_data.mac_addr, art, 0x01); -+ -+ /* GMAC0 is connected to the PHY1 */ -+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; -+ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; -+ ath79_eth0_data.phy_mask = BIT(1); -+ ath79_eth0_pll_data.pll_1000 = 0x82000101; -+ ath79_eth0_pll_data.pll_100 = 0x80000101; -+ ath79_eth0_pll_data.pll_10 = 0x80001313; -+ ath79_register_eth(0); -+ -+ /* GMAC1 is connected to MDIO1 in SGMII mode */ -+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; -+ ath79_eth1_data.mii_bus_dev = &ath79_mdio0_device.dev; -+ ath79_eth1_data.phy_mask = BIT(2); -+ ath79_eth1_pll_data.pll_1000 = 0x03000101; -+ ath79_eth1_pll_data.pll_100 = 0x80000101; -+ ath79_eth1_pll_data.pll_10 = 0x80001313; -+ ath79_eth1_data.speed = SPEED_1000; -+ ath79_eth1_data.duplex = DUPLEX_FULL; -+ ath79_register_eth(1); -+ -+ ath79_register_pci(); -+} -+ -+MIPS_MACHINE(ATH79_MACH_OM5P_AC, "OM5P-AC", "OpenMesh OM5P AC", om5p_ac_setup); -diff --git a/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-om5pac-support.patch b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-om5pac-support.patch -new file mode 100644 -index 0000000..4accd03 ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/815-MIPS-ath79-add-om5pac-support.patch -@@ -0,0 +1,38 @@ -+--- a/arch/mips/ath79/Kconfig -++++ b/arch/mips/ath79/Kconfig -+@@ -799,6 +799,15 @@ config ATH79_MACH_OM5P -+ select ATH79_DEV_M25P80 -+ select ATH79_DEV_WMAC -+ -++config ATH79_MACH_OM5P_AC -++ bool "OpenMesh OM5P-AC board support" -++ select SOC_QCA955X -++ select ATH79_DEV_AP9X_PCI if PCI -++ select ATH79_DEV_ETH -++ select ATH79_DEV_LEDS_GPIO -++ select ATH79_DEV_M25P80 -++ select ATH79_DEV_WMAC -++ -+ config ATH79_MACH_ONION_OMEGA -+ bool "ONION OMEGA support" -+ select SOC_AR933X -+--- a/arch/mips/ath79/Makefile -++++ b/arch/mips/ath79/Makefile -+@@ -100,6 +100,7 @@ obj-$(CONFIG_ATH79_MACH_MZK_W300NH) += m -+ obj-$(CONFIG_ATH79_MACH_NBG460N) += mach-nbg460n.o -+ obj-$(CONFIG_ATH79_MACH_OM2P) += mach-om2p.o -+ obj-$(CONFIG_ATH79_MACH_OM5P) += mach-om5p.o -++obj-$(CONFIG_ATH79_MACH_OM5P_AC) += mach-om5pac.o -+ obj-$(CONFIG_ATH79_MACH_ONION_OMEGA) += mach-onion-omega.o -+ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o -+ obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o -+--- a/arch/mips/ath79/machtypes.h -++++ b/arch/mips/ath79/machtypes.h -+@@ -95,6 +95,7 @@ enum ath79_mach_type { -+ ATH79_MACH_OM2P_LC, /* OpenMesh OM2P-LC */ -+ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ -+ ATH79_MACH_OM2P, /* OpenMesh OM2P */ -++ ATH79_MACH_OM5P_AC, /* OpenMesh OM5P-AC */ -+ ATH79_MACH_OM5P_AN, /* OpenMesh OM5P-AN */ -+ ATH79_MACH_OM5P, /* OpenMesh OM5P */ -+ ATH79_MACH_ONION_OMEGA, /* ONION OMEGA */ diff --git a/patches/openwrt/0115-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch b/patches/openwrt/0064-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch similarity index 100% rename from patches/openwrt/0115-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch rename to patches/openwrt/0064-ar71xx-cpe510-enable-LNA-for-CPE210-220-510-520.patch diff --git a/patches/openwrt/0065-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch b/patches/openwrt/0065-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch deleted file mode 100644 index 7161fdca..00000000 --- a/patches/openwrt/0065-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-AC.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:25:51 +0000 -Subject: ar71xx: add user-space support for the OpenMesh OM5P-AC - -Signed-off-by: Sven Eckelmann - -Backport of r49142 - -Forwarded: https://patchwork.ozlabs.org/patch/624192/ - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index 44d2ddf..a4051f2 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -178,6 +178,9 @@ get_status_led() { - om5p-an) - status_led="om5p:blue:power" - ;; -+ om5p-ac) -+ status_led="om5pac:blue:power" -+ ;; - onion-omega) - status_led="onion:amber:system" - ;; -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index c451124..9a768cd 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -304,6 +304,11 @@ om5p-an) - ucidef_set_led_netdev "port2" "port2" "om5p:blue:lan" "eth1" - ;; - -+om5p-ac) -+ ucidef_set_led_netdev "port1" "port1" "om5pac:blue:lan" "eth0" -+ ucidef_set_led_netdev "port2" "port2" "om5pac:blue:wan" "eth1" -+ ;; -+ - qihoo-c301) - ucidef_set_led_wlan "wlan2g" "WLAN2G" "qihoo:red:status" "phy1tpt" - ;; -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 587d029..10b8048 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -616,6 +616,9 @@ ar71xx_board_detect() { - *"OM5P AN") - name="om5p-an" - ;; -+ *"OM5P AC") -+ name="om5p-ac" -+ ;; - *"Onion Omega") - name="onion-omega" - ;; diff --git a/patches/openwrt/0116-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch b/patches/openwrt/0065-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch similarity index 100% rename from patches/openwrt/0116-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch rename to patches/openwrt/0065-ar71xx-cpe510-split-profile-into-2-profiles-cpe210-and-cpe510.patch diff --git a/patches/openwrt/0117-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch b/patches/openwrt/0066-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch similarity index 100% rename from patches/openwrt/0117-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch rename to patches/openwrt/0066-fw-utils-tplink-safeloader.c-Add-support-for-Archer-C2600.patch diff --git a/patches/openwrt/0066-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch b/patches/openwrt/0066-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch deleted file mode 100644 index 4b6311e2..00000000 --- a/patches/openwrt/0066-scripts-om-fwupgradecfg-gen.sh-add-support-for-the-OM5P-AC.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:25:54 +0000 -Subject: scripts/om-fwupgradecfg-gen.sh: add support for the OM5P-AC - -Signed-off-by: Sven Eckelmann - -Backport of r49143 - -Forwarded: https://patchwork.ozlabs.org/patch/624193/ - -diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh -index e208e6d..6c3b74c 100644 ---- a/scripts/om-fwupgradecfg-gen.sh -+++ b/scripts/om-fwupgradecfg-gen.sh -@@ -7,7 +7,7 @@ - # - - usage() { -- echo "Usage: $0 " -+ echo "Usage: $0 " - rm -f $CFG_OUT - exit 1 - } -@@ -26,7 +26,7 @@ case $CE_TYPE in - FLASH_BS=262144 - MD5_SKIP_BLOCKS=1 - ;; -- OM5P|MR600|MR900|MR1750) -+ OM5P|OM5PAC|MR600|MR900|MR1750) - MAX_PART_SIZE=7808 - KERNEL_FLASH_ADDR=0xb0000 - FLASH_BS=65536 diff --git a/patches/openwrt/0067-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch b/patches/openwrt/0067-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch deleted file mode 100644 index ae08198a..00000000 --- a/patches/openwrt/0067-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-AC.patch +++ /dev/null @@ -1,59 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:25:57 +0000 -Subject: ar71xx: enable sysupgrade for the OpenMesh OM5P-AC - -Signed-off-by: Sven Eckelmann - -Backport of r49144 - -Forwarded: https://patchwork.ozlabs.org/patch/624194/ - -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -index 9ca0f5b..1cfead9 100644 ---- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -@@ -72,6 +72,11 @@ platform_check_image_openmesh() - echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" - return 1 - ;; -+ OM5PAC) -+ [ "$board" = "om5p-ac" ] && break -+ echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" -+ return 1 -+ ;; - MR1750) - [ "$board" = "mr1750" ] && break - echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" -@@ -162,7 +167,7 @@ platform_do_upgrade_openmesh() - kernel_start_addr1=0x9f1c0000 - kernel_start_addr2=0x9f8c0000 - ;; -- OM5P|MR600|MR900|MR1750) -+ OM5P|OM5PAC|MR600|MR900|MR1750) - block_size=$((64 * 1024)) - total_size=7995392 - kernel_start_addr1=0x9f0b0000 -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index ac060ea..67c0661 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -307,7 +307,8 @@ platform_check_image() { - om2p-hsv2 | \ - om2p-lc | \ - om5p | \ -- om5p-an) -+ om5p-an | \ -+ om5p-ac) - platform_check_image_openmesh "$magic_long" "$1" && return 0 - return 1 - ;; -@@ -540,7 +541,8 @@ platform_do_upgrade() { - om2p-hsv2 | \ - om2p-lc | \ - om5p | \ -- om5p-an) -+ om5p-an | \ -+ om5p-ac) - platform_do_upgrade_openmesh "$ARGV" - ;; - unifi-outdoor-plus | \ diff --git a/patches/openwrt/0118-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch b/patches/openwrt/0067-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch similarity index 100% rename from patches/openwrt/0118-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch rename to patches/openwrt/0067-tools-tplink-safeloader-split-CPE210-from-CPE510-profile.patch diff --git a/patches/openwrt/0119-dropbear-update-to-LEDE-277f85c21ae0ede4e15e66cbd801b9fb502531df.patch b/patches/openwrt/0068-dropbear-update-to-LEDE-277f85c21ae0ede4e15e66cbd801b9fb502531df.patch similarity index 100% rename from patches/openwrt/0119-dropbear-update-to-LEDE-277f85c21ae0ede4e15e66cbd801b9fb502531df.patch rename to patches/openwrt/0068-dropbear-update-to-LEDE-277f85c21ae0ede4e15e66cbd801b9fb502531df.patch diff --git a/patches/openwrt/0068-om-watchdog-add-OpenMesh-OM5P-AC-support.patch b/patches/openwrt/0068-om-watchdog-add-OpenMesh-OM5P-AC-support.patch deleted file mode 100644 index c2d2e225..00000000 --- a/patches/openwrt/0068-om-watchdog-add-OpenMesh-OM5P-AC-support.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:01 +0000 -Subject: om-watchdog: add OpenMesh OM5P-AC support - -Signed-off-by: Sven Eckelmann - -Backport of r49145 - -Forwarded: https://patchwork.ozlabs.org/patch/624195/ - -diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init -index c792968..8cec13b 100644 ---- a/package/kernel/om-watchdog/files/om-watchdog.init -+++ b/package/kernel/om-watchdog/files/om-watchdog.init -@@ -22,6 +22,9 @@ boot() { - "om5p"|"om5p-an") - service_start /sbin/om-watchdog 11 - ;; -+ "om5p-ac") -+ service_start /sbin/om-watchdog 17 -+ ;; - "mr600v2") - service_start /sbin/om-watchdog 15 - ;; diff --git a/patches/openwrt/0120-ar71xx-Added-support-for-TL-WA801NDv3.patch b/patches/openwrt/0069-ar71xx-Added-support-for-TL-WA801NDv3.patch similarity index 100% rename from patches/openwrt/0120-ar71xx-Added-support-for-TL-WA801NDv3.patch rename to patches/openwrt/0069-ar71xx-Added-support-for-TL-WA801NDv3.patch diff --git a/patches/openwrt/0069-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch b/patches/openwrt/0069-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch deleted file mode 100644 index 0d7b312e..00000000 --- a/patches/openwrt/0069-uboot-envtools-add-OpenMesh-OM5P-AC-support.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:04 +0000 -Subject: uboot-envtools: add OpenMesh OM5P-AC support - -Signed-off-by: Sven Eckelmann - -Backport of r49146 - -Forwarded: https://patchwork.ozlabs.org/patch/624196/ - -diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx -index ef00f17..657b25f 100644 ---- a/package/boot/uboot-envtools/files/ar71xx -+++ b/package/boot/uboot-envtools/files/ar71xx -@@ -28,6 +28,7 @@ mr900 | \ - mr900v2 | \ - nbg6716 | \ - om5p-an | \ -+om5p-ac | \ - om5p | \ - tube2h | \ - wndr3700) diff --git a/patches/openwrt/0070-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch b/patches/openwrt/0070-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch deleted file mode 100644 index 0cd9fec5..00000000 --- a/patches/openwrt/0070-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-AC-board.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:08 +0000 -Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh OM5P-AC board - -Signed-off-by: Sven Eckelmann - -Backport of r49147 - -Forwarded: https://patchwork.ozlabs.org/patch/624197/ - -diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index cde7aaf..c1f4b85 100644 ---- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -96,6 +96,10 @@ case "$FIRMWARE" in - rb-911g-5hpacd) - ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 - ;; -+ om5p-ac) -+ ath10kcal_extract "ART" 20480 2116 -+ ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) -+ ;; - esac - ;; - *) diff --git a/patches/openwrt/0121-firmware-utils-mktplinkfw-backport-from-LEDE-a4fc62bc0ea4010ddbfbd738453c9db70988a57c.patch b/patches/openwrt/0070-firmware-utils-mktplinkfw-backport-from-LEDE-a4fc62bc0ea4010ddbfbd738453c9db70988a57c.patch similarity index 100% rename from patches/openwrt/0121-firmware-utils-mktplinkfw-backport-from-LEDE-a4fc62bc0ea4010ddbfbd738453c9db70988a57c.patch rename to patches/openwrt/0070-firmware-utils-mktplinkfw-backport-from-LEDE-a4fc62bc0ea4010ddbfbd738453c9db70988a57c.patch diff --git a/patches/openwrt/0122-ar71xx-backport-support-for-new-TP-Link-region-codes.patch b/patches/openwrt/0071-ar71xx-backport-support-for-new-TP-Link-region-codes.patch similarity index 100% rename from patches/openwrt/0122-ar71xx-backport-support-for-new-TP-Link-region-codes.patch rename to patches/openwrt/0071-ar71xx-backport-support-for-new-TP-Link-region-codes.patch diff --git a/patches/openwrt/0071-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch b/patches/openwrt/0071-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch deleted file mode 100644 index 170aba91..00000000 --- a/patches/openwrt/0071-ar71xx-create-profile-and-build-image-for-the-OpenMesh-OM5P-AC-board.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:11 +0000 -Subject: ar71xx: create profile and build image for the OpenMesh OM5P-AC board - -Signed-off-by: Sven Eckelmann - -Backport of r49148 - -Forwarded: https://patchwork.ozlabs.org/patch/624198/ - -diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk -index 06cf135..64aaa24 100644 ---- a/target/linux/ar71xx/generic/profiles/openmesh.mk -+++ b/target/linux/ar71xx/generic/profiles/openmesh.mk -@@ -27,6 +27,17 @@ endef - - $(eval $(call Profile,OM5P)) - -+define Profile/OM5PAC -+ NAME:=OpenMesh OM5P-AC -+ PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog ath10k-firmware-qca988x -+endef -+ -+define Profile/OM5PAC/Description -+ Package set optimized for the OpenMesh OM5P-AC. -+endef -+ -+$(eval $(call Profile,OM5PAC)) -+ - define Profile/MR600 - NAME:=OpenMesh MR600 - PACKAGES:=kmod-ath9k om-watchdog -diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile -index 0ebb7dc..0cf1df1 100644 ---- a/target/linux/ar71xx/image/Makefile -+++ b/target/linux/ar71xx/image/Makefile -@@ -2043,6 +2043,7 @@ $(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200, - - $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5P,om5p,,,,OM5P)) -+$(eval $(call SingleProfile,OpenMesh,squashfs-only,OM5PAC,om5pac,,,,OM5PAC)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR600,mr600,,,,MR600)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR900,mr900,,,,MR900)) - $(eval $(call SingleProfile,OpenMesh,squashfs-only,MR1750,mr1750,,,,MR1750)) -@@ -2139,7 +2140,7 @@ $(eval $(call MultiProfile,AP121,AP121_2M AP121_4M)) - $(eval $(call MultiProfile,DIR615IX,DIR615I1 DIR615I3)) - $(eval $(call MultiProfile,AP136,AP136_010 AP136_020)) - $(eval $(call MultiProfile,EWDORIN, EWDORINAP EWDORINRT EWDORIN16M)) --$(eval $(call MultiProfile,OPENMESH,OM2P OM5P MR600 MR900 MR1750)) -+$(eval $(call MultiProfile,OPENMESH,OM2P OM5P OM5PAC MR600 MR900 MR1750)) - $(eval $(call MultiProfile,TEW652BRP,TEW652BRP_FW TEW652BRP_RECOVERY)) - $(eval $(call MultiProfile,TLMR3220,TLMR3220V1)) - $(eval $(call MultiProfile,TLMR3420,TLMR3420V1)) diff --git a/patches/openwrt/0072-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch b/patches/openwrt/0072-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch deleted file mode 100644 index d2e2cd60..00000000 --- a/patches/openwrt/0072-ar71xx-add-kernel-support-for-the-OpenMesh-OM5P-ACv2-board.patch +++ /dev/null @@ -1,289 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:15 +0000 -Subject: ar71xx: add kernel support for the OpenMesh OM5P-ACv2 board - -Signed-off-by: Sven Eckelmann - -Backport of r49149 - -Forwarded: https://patchwork.ozlabs.org/patch/624199/ - -diff --git a/target/linux/ar71xx/config-3.18 b/target/linux/ar71xx/config-3.18 -index dd89357..514f7d5 100644 ---- a/target/linux/ar71xx/config-3.18 -+++ b/target/linux/ar71xx/config-3.18 -@@ -92,6 +92,7 @@ CONFIG_ATH79_MACH_NBG6716=y - CONFIG_ATH79_MACH_OM2P=y - CONFIG_ATH79_MACH_OM5P=y - CONFIG_ATH79_MACH_OM5P_AC=y -+CONFIG_ATH79_MACH_OM5P_ACv2=y - CONFIG_ATH79_MACH_ONION_OMEGA=y - CONFIG_ATH79_MACH_PB42=y - CONFIG_ATH79_MACH_PB44=y -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c -new file mode 100644 -index 0000000..587ca32 ---- /dev/null -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om5pacv2.c -@@ -0,0 +1,216 @@ -+/* -+ * OpenMesh OM5P-ACv2 support -+ * -+ * Copyright (C) 2013 Marek Lindner -+ * Copyright (C) 2014-2016 Sven Eckelmann -+ * Copyright (C) 2015 Open-Mesh - Jim Collar -+ * -+ * This program is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 as published -+ * by the Free Software Foundation. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include "common.h" -+#include "dev-ap9x-pci.h" -+#include "dev-eth.h" -+#include "dev-gpio-buttons.h" -+#include "dev-leds-gpio.h" -+#include "dev-m25p80.h" -+#include "dev-wmac.h" -+#include "machtypes.h" -+#include "pci.h" -+ -+#define OM5PACV2_GPIO_LED_POWER 14 -+#define OM5PACV2_GPIO_LED_GREEN 13 -+#define OM5PACV2_GPIO_LED_RED 23 -+#define OM5PACV2_GPIO_LED_YELLOW 15 -+#define OM5PACV2_GPIO_BTN_RESET 1 -+#define OM5PACV2_GPIO_I2C_SCL 18 -+#define OM5PACV2_GPIO_I2C_SDA 19 -+#define OM5PACV2_GPIO_PA_DCDC 2 -+#define OM5PACV2_GPIO_PA_HIGH 16 -+ -+#define OM5PACV2_KEYS_POLL_INTERVAL 20 /* msecs */ -+#define OM5PACV2_KEYS_DEBOUNCE_INTERVAL (3 * OM5PACV2_KEYS_POLL_INTERVAL) -+ -+#define OM5PACV2_WMAC_CALDATA_OFFSET 0x1000 -+ -+static struct gpio_led om5pacv2_leds_gpio[] __initdata = { -+ { -+ .name = "om5pac:blue:power", -+ .gpio = OM5PACV2_GPIO_LED_POWER, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:red:wifi", -+ .gpio = OM5PACV2_GPIO_LED_RED, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:yellow:wifi", -+ .gpio = OM5PACV2_GPIO_LED_YELLOW, -+ .active_low = 1, -+ }, { -+ .name = "om5pac:green:wifi", -+ .gpio = OM5PACV2_GPIO_LED_GREEN, -+ .active_low = 1, -+ } -+}; -+ -+static struct gpio_keys_button om5pacv2_gpio_keys[] __initdata = { -+ { -+ .desc = "reset", -+ .type = EV_KEY, -+ .code = KEY_RESTART, -+ .debounce_interval = OM5PACV2_KEYS_DEBOUNCE_INTERVAL, -+ .gpio = OM5PACV2_GPIO_BTN_RESET, -+ .active_low = 1, -+ } -+}; -+ -+static struct i2c_gpio_platform_data om5pacv2_i2c_device_platdata = { -+ .sda_pin = OM5PACV2_GPIO_I2C_SDA, -+ .scl_pin = OM5PACV2_GPIO_I2C_SCL, -+ .udelay = 10, -+ .sda_is_open_drain = 1, -+ .scl_is_open_drain = 1, -+}; -+ -+static struct platform_device om5pacv2_i2c_device = { -+ .name = "i2c-gpio", -+ .id = 0, -+ .dev = { -+ .platform_data = &om5pacv2_i2c_device_platdata, -+ }, -+}; -+ -+static struct i2c_board_info om5pacv2_i2c_devs[] __initdata = { -+ { -+ I2C_BOARD_INFO("tmp423", 0x4e), -+ }, -+}; -+ -+static struct flash_platform_data om5pacv2_flash_data = { -+ .type = "mx25l12805d", -+}; -+ -+static struct at803x_platform_data om5pacv2_an_at803x_data = { -+ .disable_smarteee = 1, -+ .enable_rgmii_rx_delay = 1, -+ .enable_rgmii_tx_delay = 1, -+}; -+ -+static struct at803x_platform_data om5pacv2_an_at8031_data = { -+ .disable_smarteee = 1, -+ .enable_rgmii_rx_delay = 1, -+ .enable_rgmii_tx_delay = 1, -+}; -+ -+static struct mdio_board_info om5pacv2_an_mdio0_info[] = { -+ { -+ .bus_id = "ag71xx-mdio.0", -+ .phy_addr = 4, -+ .platform_data = &om5pacv2_an_at803x_data, -+ }, -+ { -+ .bus_id = "ag71xx-mdio.1", -+ .phy_addr = 1, -+ .platform_data = &om5pacv2_an_at8031_data, -+ }, -+}; -+ -+static void __init om5p_acv2_setup_qca955x_eth_cfg(u32 mask, -+ unsigned int rxd, -+ unsigned int rxdv, -+ unsigned int txd, -+ unsigned int txe) -+{ -+ void __iomem *base; -+ u32 t; -+ -+ base = ioremap(QCA955X_GMAC_BASE, QCA955X_GMAC_SIZE); -+ -+ t = mask; -+ t |= rxd << QCA955X_ETH_CFG_RXD_DELAY_SHIFT; -+ t |= rxdv << QCA955X_ETH_CFG_RDV_DELAY_SHIFT; -+ t |= txd << QCA955X_ETH_CFG_TXD_DELAY_SHIFT; -+ t |= txe << QCA955X_ETH_CFG_TXE_DELAY_SHIFT; -+ -+ __raw_writel(t, base + QCA955X_GMAC_REG_ETH_CFG); -+ -+ iounmap(base); -+} -+ -+static void __init om5p_acv2_setup(void) -+{ -+ u8 *art = (u8 *)KSEG1ADDR(0x1fff0000); -+ u8 mac[6]; -+ -+ /* power amplifier high power, 4.2V at RFFM4203/4503 instead of 3.3 */ -+ ath79_gpio_function_enable(QCA955X_GPIO_FUNC_JTAG_DISABLE); -+ ath79_gpio_output_select(OM5PACV2_GPIO_PA_DCDC, QCA955X_GPIO_OUT_GPIO); -+ ath79_gpio_output_select(OM5PACV2_GPIO_PA_HIGH, QCA955X_GPIO_OUT_GPIO); -+ gpio_request_one(OM5PACV2_GPIO_PA_DCDC, GPIOF_OUT_INIT_HIGH, -+ "PA DC/DC"); -+ gpio_request_one(OM5PACV2_GPIO_PA_HIGH, GPIOF_OUT_INIT_HIGH, "PA HIGH"); -+ -+ /* temperature sensor */ -+ platform_device_register(&om5pacv2_i2c_device); -+ i2c_register_board_info(0, om5pacv2_i2c_devs, -+ ARRAY_SIZE(om5pacv2_i2c_devs)); -+ -+ ath79_register_m25p80(&om5pacv2_flash_data); -+ ath79_register_leds_gpio(-1, ARRAY_SIZE(om5pacv2_leds_gpio), -+ om5pacv2_leds_gpio); -+ ath79_register_gpio_keys_polled(-1, OM5PACV2_KEYS_POLL_INTERVAL, -+ ARRAY_SIZE(om5pacv2_gpio_keys), -+ om5pacv2_gpio_keys); -+ -+ ath79_init_mac(mac, art, 0x02); -+ ath79_register_wmac(art + OM5PACV2_WMAC_CALDATA_OFFSET, mac); -+ -+ om5p_acv2_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_RGMII_EN, 2, 2, 0, 0); -+ ath79_register_mdio(0, 0x0); -+ ath79_register_mdio(1, 0x0); -+ -+ mdiobus_register_board_info(om5pacv2_an_mdio0_info, -+ ARRAY_SIZE(om5pacv2_an_mdio0_info)); -+ -+ ath79_init_mac(ath79_eth0_data.mac_addr, art, 0x00); -+ ath79_init_mac(ath79_eth1_data.mac_addr, art, 0x01); -+ -+ /* GMAC0 is connected to the PHY4 */ -+ ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; -+ ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; -+ ath79_eth0_data.phy_mask = BIT(4); -+ ath79_eth0_pll_data.pll_1000 = 0x82000101; -+ ath79_eth0_pll_data.pll_100 = 0x80000101; -+ ath79_eth0_pll_data.pll_10 = 0x80001313; -+ ath79_register_eth(0); -+ -+ /* GMAC1 is connected to MDIO1 in SGMII mode */ -+ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; -+ ath79_eth1_data.mii_bus_dev = &ath79_mdio1_device.dev; -+ ath79_eth1_data.phy_mask = BIT(1); -+ ath79_eth1_pll_data.pll_1000 = 0x03000101; -+ ath79_eth1_pll_data.pll_100 = 0x80000101; -+ ath79_eth1_pll_data.pll_10 = 0x80001313; -+ ath79_eth1_data.speed = SPEED_1000; -+ ath79_eth1_data.duplex = DUPLEX_FULL; -+ ath79_register_eth(1); -+ -+ ath79_register_pci(); -+} -+ -+MIPS_MACHINE(ATH79_MACH_OM5P_ACv2, "OM5P-ACv2", "OpenMesh OM5P ACv2", om5p_acv2_setup); -diff --git a/target/linux/ar71xx/patches-3.18/816-MIPS-ath79-add-om5pacv-support.patch b/target/linux/ar71xx/patches-3.18/816-MIPS-ath79-add-om5pacv-support.patch -new file mode 100644 -index 0000000..fbbf171 ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/816-MIPS-ath79-add-om5pacv-support.patch -@@ -0,0 +1,39 @@ -+--- a/arch/mips/ath79/Kconfig -++++ b/arch/mips/ath79/Kconfig -+@@ -808,6 +808,16 @@ config ATH79_MACH_OM5P_AC -+ select ATH79_DEV_M25P80 -+ select ATH79_DEV_WMAC -+ -++config ATH79_MACH_OM5P_ACv2 -++ bool "OpenMesh OM5P-ACv2 board support" -++ select SOC_QCA955X -++ select ATH79_DEV_AP9X_PCI if PCI -++ select ATH79_DEV_ETH -++ select ATH79_DEV_GPIO_BUTTONS -++ select ATH79_DEV_LEDS_GPIO -++ select ATH79_DEV_M25P80 -++ select ATH79_DEV_WMAC -++ -+ config ATH79_MACH_ONION_OMEGA -+ bool "ONION OMEGA support" -+ select SOC_AR933X -+--- a/arch/mips/ath79/Makefile -++++ b/arch/mips/ath79/Makefile -+@@ -101,6 +101,7 @@ obj-$(CONFIG_ATH79_MACH_NBG460N) += mach -+ obj-$(CONFIG_ATH79_MACH_OM2P) += mach-om2p.o -+ obj-$(CONFIG_ATH79_MACH_OM5P) += mach-om5p.o -+ obj-$(CONFIG_ATH79_MACH_OM5P_AC) += mach-om5pac.o -++obj-$(CONFIG_ATH79_MACH_OM5P_ACv2) += mach-om5pacv2.o -+ obj-$(CONFIG_ATH79_MACH_ONION_OMEGA) += mach-onion-omega.o -+ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o -+ obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o -+--- a/arch/mips/ath79/machtypes.h -++++ b/arch/mips/ath79/machtypes.h -+@@ -96,6 +96,7 @@ enum ath79_mach_type { -+ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ -+ ATH79_MACH_OM2P, /* OpenMesh OM2P */ -+ ATH79_MACH_OM5P_AC, /* OpenMesh OM5P-AC */ -++ ATH79_MACH_OM5P_ACv2, /* OpenMesh OM5P-ACv2 */ -+ ATH79_MACH_OM5P_AN, /* OpenMesh OM5P-AN */ -+ ATH79_MACH_OM5P, /* OpenMesh OM5P */ -+ ATH79_MACH_ONION_OMEGA, /* ONION OMEGA */ diff --git a/patches/openwrt/0123-ath10k-firmware-add-ath10k-firmware-qca988x-11s.patch b/patches/openwrt/0072-ath10k-firmware-add-ath10k-firmware-qca988x-11s.patch similarity index 100% rename from patches/openwrt/0123-ath10k-firmware-add-ath10k-firmware-qca988x-11s.patch rename to patches/openwrt/0072-ath10k-firmware-add-ath10k-firmware-qca988x-11s.patch diff --git a/patches/openwrt/0073-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0073-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch deleted file mode 100644 index 2ea0cb6a..00000000 --- a/patches/openwrt/0073-ar71xx-add-user-space-support-for-the-OpenMesh-OM5P-ACv2.patch +++ /dev/null @@ -1,38 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:18 +0000 -Subject: ar71xx: add user-space support for the OpenMesh OM5P-ACv2 - -Signed-off-by: Sven Eckelmann - -Backport of r49150 - -Forwarded: https://patchwork.ozlabs.org/patch/624200/ - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index a4051f2..d4d8b4e 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -178,7 +178,8 @@ get_status_led() { - om5p-an) - status_led="om5p:blue:power" - ;; -- om5p-ac) -+ om5p-ac | \ -+ om5p-acv2) - status_led="om5pac:blue:power" - ;; - onion-omega) -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index 10b8048..fbf76c8 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -619,6 +619,9 @@ ar71xx_board_detect() { - *"OM5P AC") - name="om5p-ac" - ;; -+ *"OM5P ACv2") -+ name="om5p-acv2" -+ ;; - *"Onion Omega") - name="onion-omega" - ;; diff --git a/patches/openwrt/0124-mac80211-fix-packet-loss-on-fq-reordering.patch b/patches/openwrt/0073-mac80211-fix-packet-loss-on-fq-reordering.patch similarity index 100% rename from patches/openwrt/0124-mac80211-fix-packet-loss-on-fq-reordering.patch rename to patches/openwrt/0073-mac80211-fix-packet-loss-on-fq-reordering.patch diff --git a/patches/openwrt/0074-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch b/patches/openwrt/0074-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch deleted file mode 100644 index 0c4cf031..00000000 --- a/patches/openwrt/0074-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM5P-ACv2.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:22 +0000 -Subject: ar71xx: enable sysupgrade for the OpenMesh OM5P-ACv2 - -Signed-off-by: Sven Eckelmann - -Backport of r49151 - -Forwarded: https://patchwork.ozlabs.org/patch/624201/ - -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -index 1cfead9..209cdaa 100644 ---- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -@@ -74,6 +74,7 @@ platform_check_image_openmesh() - ;; - OM5PAC) - [ "$board" = "om5p-ac" ] && break -+ [ "$board" = "om5p-acv2" ] && break - echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" - return 1 - ;; -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 67c0661..4a4c476 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -308,7 +308,8 @@ platform_check_image() { - om2p-lc | \ - om5p | \ - om5p-an | \ -- om5p-ac) -+ om5p-ac | \ -+ om5p-acv2) - platform_check_image_openmesh "$magic_long" "$1" && return 0 - return 1 - ;; -@@ -542,7 +543,8 @@ platform_do_upgrade() { - om2p-lc | \ - om5p | \ - om5p-an | \ -- om5p-ac) -+ om5p-ac | \ -+ om5p-acv2) - platform_do_upgrade_openmesh "$ARGV" - ;; - unifi-outdoor-plus | \ diff --git a/patches/openwrt/0125-mac80211-fix-tx-issue-with-CCMP-PN-generated-in-hardware.patch b/patches/openwrt/0074-mac80211-fix-tx-issue-with-CCMP-PN-generated-in-hardware.patch similarity index 100% rename from patches/openwrt/0125-mac80211-fix-tx-issue-with-CCMP-PN-generated-in-hardware.patch rename to patches/openwrt/0074-mac80211-fix-tx-issue-with-CCMP-PN-generated-in-hardware.patch diff --git a/patches/openwrt/0126-ath9k-remove-patch-causing-stability-issues-with-powersave-devices-FS-176.patch b/patches/openwrt/0075-ath9k-remove-patch-causing-stability-issues-with-powersave-devices-FS-176.patch similarity index 100% rename from patches/openwrt/0126-ath9k-remove-patch-causing-stability-issues-with-powersave-devices-FS-176.patch rename to patches/openwrt/0075-ath9k-remove-patch-causing-stability-issues-with-powersave-devices-FS-176.patch diff --git a/patches/openwrt/0075-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch b/patches/openwrt/0075-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch deleted file mode 100644 index b3c8c8fc..00000000 --- a/patches/openwrt/0075-om-watchdog-add-OpenMesh-OM5P-ACv2-support.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:25 +0000 -Subject: om-watchdog: add OpenMesh OM5P-ACv2 support - -Signed-off-by: Sven Eckelmann - -Backport of r49152 - -Forwarded: https://patchwork.ozlabs.org/patch/624202/ - -diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init -index 8cec13b..6b96966 100644 ---- a/package/kernel/om-watchdog/files/om-watchdog.init -+++ b/package/kernel/om-watchdog/files/om-watchdog.init -@@ -13,7 +13,7 @@ boot() { - local board=$(ar71xx_board_name) - - case "$board" in -- "om2p"|"om2p-hs"|"om2p-hsv2") -+ "om2p"|"om2p-hs"|"om2p-hsv2"|"om5p-acv2") - service_start /sbin/om-watchdog 12 - ;; - "om2pv2"|"om2p-lc") diff --git a/patches/openwrt/0076-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch b/patches/openwrt/0076-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch deleted file mode 100644 index dd61c6fb..00000000 --- a/patches/openwrt/0076-uboot-envtools-add-OpenMesh-OM5P-ACv2-support.patch +++ /dev/null @@ -1,22 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:28 +0000 -Subject: uboot-envtools: add OpenMesh OM5P-ACv2 support - -Signed-off-by: Sven Eckelmann - -Backport of r49153 - -Forwarded: https://patchwork.ozlabs.org/patch/624203/ - -diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx -index 657b25f..9071c11 100644 ---- a/package/boot/uboot-envtools/files/ar71xx -+++ b/package/boot/uboot-envtools/files/ar71xx -@@ -29,6 +29,7 @@ mr900v2 | \ - nbg6716 | \ - om5p-an | \ - om5p-ac | \ -+om5p-acv2 | \ - om5p | \ - tube2h | \ - wndr3700) diff --git a/patches/openwrt/0077-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch b/patches/openwrt/0077-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch deleted file mode 100644 index 90b634ce..00000000 --- a/patches/openwrt/0077-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-OM5P-ACv2-board.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:31 +0000 -Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh OM5P-ACv2 board - -Signed-off-by: Sven Eckelmann - -Backport of r49154 - -Forwarded: https://patchwork.ozlabs.org/patch/624204/ - -diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index c1f4b85..d925a85 100644 ---- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -71,7 +71,8 @@ case "$FIRMWARE" in - ath10kcal_extract "caldata" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) - ;; -- mr1750) -+ mr1750 | \ -+ om5p-acv2) - ath10kcal_extract "ART" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) - ;; diff --git a/patches/openwrt/0078-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch b/patches/openwrt/0078-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch deleted file mode 100644 index d98a115f..00000000 --- a/patches/openwrt/0078-ar71xx-add-OM5P-ACv2-to-the-OM5P-AC-profile.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Sven Eckelmann -Date: Sat, 9 Apr 2016 10:26:34 +0000 -Subject: ar71xx: add OM5P-ACv2 to the OM5P-AC profile - -Signed-off-by: Sven Eckelmann - -Backport of r49155 - -Forwarded: https://patchwork.ozlabs.org/patch/624205/ - -diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk -index 64aaa24..c0919ed 100644 ---- a/target/linux/ar71xx/generic/profiles/openmesh.mk -+++ b/target/linux/ar71xx/generic/profiles/openmesh.mk -@@ -28,12 +28,12 @@ endef - $(eval $(call Profile,OM5P)) - - define Profile/OM5PAC -- NAME:=OpenMesh OM5P-AC -+ NAME:=OpenMesh OM5P-AC/OM5P-ACv2 - PACKAGES:=kmod-ath9k kmod-ath10k om-watchdog ath10k-firmware-qca988x - endef - - define Profile/OM5PAC/Description -- Package set optimized for the OpenMesh OM5P-AC. -+ Package set optimized for the OpenMesh OM5P-AC/OM5P-ACv2. - endef - - $(eval $(call Profile,OM5PAC)) diff --git a/patches/openwrt/0085-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch b/patches/openwrt/0085-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch deleted file mode 100644 index 94b0e4e3..00000000 --- a/patches/openwrt/0085-scripts-feeds-fix-version-detection-for-Make-4.2.1.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Matthias Schiffer -Date: Wed, 15 Jun 2016 19:31:08 +0200 -Subject: scripts: feeds: fix version detection for Make >= 4.2.1 - -Signed-off-by: Jo-Philipp Wich - -Backport of LEDE df18b3756fef6a28d9194368d3156f0cd85fae19 - -diff --git a/scripts/feeds b/scripts/feeds -index f8f29cd..908e56c 100755 ---- a/scripts/feeds -+++ b/scripts/feeds -@@ -22,7 +22,10 @@ my @mkver = split /\s+/, `$mk -v`, 4; - my $valid_mk = 1; - $mkver[0] =~ /^GNU/ or $valid_mk = 0; - $mkver[1] =~ /^Make/ or $valid_mk = 0; --$mkver[2] >= "3.81" or $valid_mk = 0; -+ -+my ($mkv1, $mkv2) = split /\./, $mkver[2]; -+($mkv1 >= 4 || ($mkv1 == 3 && $mkv2 >= 81)) or $valid_mk = 0; -+ - $valid_mk or die "Unsupported version of make found: $mk\n"; - - my @feeds; diff --git a/patches/openwrt/0091-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch b/patches/openwrt/0091-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch deleted file mode 100644 index 1bfdc8e3..00000000 --- a/patches/openwrt/0091-ar71xx-add-kernel-support-for-the-OpenMesh-OM2P-HSv3.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:48 +0200 -Subject: ar71xx: add kernel support for the OpenMesh OM2P-HSv3 - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637052/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c -index 6b0bdc3..3b282a3 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-om2p.c -@@ -223,3 +223,4 @@ static void __init om2p_hs_setup(void) - - MIPS_MACHINE(ATH79_MACH_OM2P_HS, "OM2P-HS", "OpenMesh OM2P HS", om2p_hs_setup); - MIPS_MACHINE(ATH79_MACH_OM2P_HSv2, "OM2P-HSv2", "OpenMesh OM2P HSv2", om2p_hs_setup); -+MIPS_MACHINE(ATH79_MACH_OM2P_HSv3, "OM2P-HSv3", "OpenMesh OM2P HSv3", om2p_hs_setup); -diff --git a/target/linux/ar71xx/patches-3.18/817-MIPS-ath79-add-om2phsv3-support.patch b/target/linux/ar71xx/patches-3.18/817-MIPS-ath79-add-om2phsv3-support.patch -new file mode 100644 -index 0000000..7305b2e ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/817-MIPS-ath79-add-om2phsv3-support.patch -@@ -0,0 +1,10 @@ -+--- a/arch/mips/ath79/machtypes.h -++++ b/arch/mips/ath79/machtypes.h -+@@ -88,6 +88,7 @@ enum ath79_mach_type { -+ ATH79_MACH_NBG460N, /* Zyxel NBG460N/550N/550NH */ -+ ATH79_MACH_NBG6716, /* Zyxel NBG6716 */ -+ ATH79_MACH_OM2P_HSv2, /* OpenMesh OM2P-HSv2 */ -++ ATH79_MACH_OM2P_HSv3, /* OpenMesh OM2P-HSv3 */ -+ ATH79_MACH_OM2P_HS, /* OpenMesh OM2P-HS */ -+ ATH79_MACH_OM2P_LC, /* OpenMesh OM2P-LC */ -+ ATH79_MACH_OM2Pv2, /* OpenMesh OM2Pv2 */ diff --git a/patches/openwrt/0092-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch b/patches/openwrt/0092-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch deleted file mode 100644 index ab3273a2..00000000 --- a/patches/openwrt/0092-ar71xx-add-user-space-support-for-the-OpenMesh-OM2P-HSv3.patch +++ /dev/null @@ -1,46 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:49 +0200 -Subject: ar71xx: add user-space support for the OpenMesh OM2P-HSv3 - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637053/ - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index d4d8b4e..aa02212 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -171,6 +171,7 @@ get_status_led() { - om2pv2 | \ - om2p-hs | \ - om2p-hsv2 | \ -+ om2p-hsv3 | \ - om2p-lc) - status_led="om2p:blue:power" - ;; -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index dc8b8d6..5767f48 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -297,6 +297,7 @@ om2p | \ - om2pv2 | \ - om2p-hs | \ - om2p-hsv2 | \ -+om2p-hsv3 | \ - om2p-lc) - ucidef_set_led_netdev "port1" "port1" "om2p:blue:wan" "eth0" - ucidef_set_led_netdev "port2" "port2" "om2p:blue:lan" "eth1" -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index db908f9..dc51b03 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -610,6 +610,9 @@ ar71xx_board_detect() { - *"OM2P HSv2") - name="om2p-hsv2" - ;; -+ *"OM2P HSv3") -+ name="om2p-hsv3" -+ ;; - *"OM2P LC") - name="om2p-lc" - ;; diff --git a/patches/openwrt/0093-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch b/patches/openwrt/0093-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch deleted file mode 100644 index ad60c151..00000000 --- a/patches/openwrt/0093-ar71xx-enable-sysupgrade-for-the-OpenMesh-OM2P-HSv3.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:50 +0200 -Subject: ar71xx: enable sysupgrade for the OpenMesh OM2P-HSv3 - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637054/ - -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -index 209cdaa..0e8ea27 100644 ---- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -@@ -63,6 +63,7 @@ platform_check_image_openmesh() - [ "$board" = "om2p-lc" ] && break - [ "$board" = "om2p-hs" ] && break - [ "$board" = "om2p-hsv2" ] && break -+ [ "$board" = "om2p-hsv3" ] && break - echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" - return 1 - ;; -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index aeb4577..9b26e73 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -306,6 +306,7 @@ platform_check_image() { - om2pv2 | \ - om2p-hs | \ - om2p-hsv2 | \ -+ om2p-hsv3 | \ - om2p-lc | \ - om5p | \ - om5p-an | \ -@@ -541,6 +542,7 @@ platform_do_upgrade() { - om2pv2 | \ - om2p-hs | \ - om2p-hsv2 | \ -+ om2p-hsv3 | \ - om2p-lc | \ - om5p | \ - om5p-an | \ diff --git a/patches/openwrt/0094-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch b/patches/openwrt/0094-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch deleted file mode 100644 index 95433670..00000000 --- a/patches/openwrt/0094-package-om-watchdog-add-OpenMesh-OM2P-HSv3-support.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:51 +0200 -Subject: package/om-watchdog: add OpenMesh OM2P-HSv3 support - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637055/ - -diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init -index 6b96966..bf8a124 100644 ---- a/package/kernel/om-watchdog/files/om-watchdog.init -+++ b/package/kernel/om-watchdog/files/om-watchdog.init -@@ -13,7 +13,7 @@ boot() { - local board=$(ar71xx_board_name) - - case "$board" in -- "om2p"|"om2p-hs"|"om2p-hsv2"|"om5p-acv2") -+ "om2p"|"om2p-hs"|"om2p-hsv2"|"om2p-hsv3"|"om5p-acv2") - service_start /sbin/om-watchdog 12 - ;; - "om2pv2"|"om2p-lc") diff --git a/patches/openwrt/0095-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch b/patches/openwrt/0095-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch deleted file mode 100644 index 1fee2332..00000000 --- a/patches/openwrt/0095-package-uboot-envtools-add-OpenMesh-OM2P-HSv3-support.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:52 +0200 -Subject: package/uboot-envtools: add OpenMesh OM2P-HSv3 support - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637056/ - -diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx -index 9071c11..81c6481 100644 ---- a/package/boot/uboot-envtools/files/ar71xx -+++ b/package/boot/uboot-envtools/files/ar71xx -@@ -41,6 +41,7 @@ om2p | \ - om2pv2 | \ - om2p-hs | \ - om2p-hsv2 | \ -+om2p-hsv3 | \ - om2p-lc) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" - ;; diff --git a/patches/openwrt/0096-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch b/patches/openwrt/0096-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch deleted file mode 100644 index 0ad77fc4..00000000 --- a/patches/openwrt/0096-ar71xx-add-OM2P-HSv3-to-the-OM2P-profile.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:53 +0200 -Subject: ar71xx: add OM2P-HSv3 to the OM2P profile - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637057/ - -diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk -index c0919ed..ddd3f8d 100644 ---- a/target/linux/ar71xx/generic/profiles/openmesh.mk -+++ b/target/linux/ar71xx/generic/profiles/openmesh.mk -@@ -6,12 +6,12 @@ - # - - define Profile/OM2P -- NAME:=OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-LC -+ NAME:=OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC - PACKAGES:=kmod-ath9k om-watchdog - endef - - define Profile/OM2P/Description -- Package set optimized for the OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-LC. -+ Package set optimized for the OpenMesh OM2P/OM2Pv2/OM2P-HS/OM2P-HSv2/OM2P-HSv3/OM2P-LC. - endef - - $(eval $(call Profile,OM2P)) diff --git a/patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch deleted file mode 100644 index 1122b7b9..00000000 --- a/patches/openwrt/0097-ar71xx-add-kernel-support-for-the-OpenMesh-MR1750v2.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:54 +0200 -Subject: ar71xx: add kernel support for the OpenMesh MR1750v2 - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637058/ - -diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -index e3c04e7..18101ce 100644 ---- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mr1750.c -@@ -168,3 +168,4 @@ static void __init mr1750_setup(void) - } - - MIPS_MACHINE(ATH79_MACH_MR1750, "MR1750", "OpenMesh MR1750", mr1750_setup); -+MIPS_MACHINE(ATH79_MACH_MR1750V2, "MR1750v2", "OpenMesh MR1750v2", mr1750_setup); -diff --git a/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch b/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch -new file mode 100644 -index 0000000..de732ec ---- /dev/null -+++ b/target/linux/ar71xx/patches-3.18/818-MIPS-ath79-add-mr1750v2-support.patch -@@ -0,0 +1,10 @@ -+--- a/arch/mips/ath79/machtypes.h -++++ b/arch/mips/ath79/machtypes.h -+@@ -76,6 +76,7 @@ enum ath79_mach_type { -+ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ -+ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ -+ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ -++ ATH79_MACH_MR1750V2, /* OpenMesh MR1750v2 */ -+ ATH79_MACH_MR600V2, /* OpenMesh MR600v2 */ -+ ATH79_MACH_MR600, /* OpenMesh MR600 */ -+ ATH79_MACH_MR900, /* OpenMesh MR900 */ diff --git a/patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch deleted file mode 100644 index 3c99224d..00000000 --- a/patches/openwrt/0098-ar71xx-add-user-space-support-for-the-OpenMesh-MR1750v2.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:55 +0200 -Subject: ar71xx: add user-space support for the OpenMesh MR1750v2 - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637059/ - -diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh -index aa02212..f182d60 100644 ---- a/target/linux/ar71xx/base-files/etc/diag.sh -+++ b/target/linux/ar71xx/base-files/etc/diag.sh -@@ -143,7 +143,8 @@ get_status_led() { - mr600v2) - status_led="mr600:blue:power" - ;; -- mr1750) -+ mr1750 | \ -+ mr1750v2) - status_led="mr1750:blue:power" - ;; - mr900 | \ -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -index 5767f48..032acc9 100644 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/01_leds -@@ -243,7 +243,8 @@ mr600) - ucidef_set_led_wlan "wlan58" "WLAN58" "mr600:green:wlan58" "phy0tpt" - ;; - --mr1750) -+mr1750 | \ -+mr1750v2) - ucidef_set_led_netdev "lan" "LAN" "mr1750:blue:wan" "eth0" - ucidef_set_led_wlan "wlan58" "WLAN58" "mr1750:blue:wlan58" "phy0tpt" - ucidef_set_led_wlan "wlan24" "WLAN24" "mr1750:blue:wlan24" "phy1tpt" -diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -index 89a2184..b8ae576 100755 ---- a/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -+++ b/target/linux/ar71xx/base-files/etc/uci-defaults/02_network -@@ -335,6 +335,7 @@ eap7660d |\ - el-mini |\ - loco-m-xw |\ - mr1750 |\ -+mr1750v2 |\ - mr600 |\ - mr600v2 |\ - mr900 |\ -diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh -index dc51b03..5119b36 100755 ---- a/target/linux/ar71xx/base-files/lib/ar71xx.sh -+++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh -@@ -568,6 +568,9 @@ ar71xx_board_detect() { - *MR1750) - name="mr1750" - ;; -+ *MR1750v2) -+ name="mr1750v2" -+ ;; - *MR600) - name="mr600" - ;; diff --git a/patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch b/patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch deleted file mode 100644 index 51ba8566..00000000 --- a/patches/openwrt/0099-ar71xx-enable-sysupgrade-for-the-OpenMesh-MR1750v2.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:56 +0200 -Subject: ar71xx: enable sysupgrade for the OpenMesh MR1750v2 - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637060/ - -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -index 0e8ea27..95d39bf 100644 ---- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh -@@ -81,6 +81,7 @@ platform_check_image_openmesh() - ;; - MR1750) - [ "$board" = "mr1750" ] && break -+ [ "$board" = "mr1750v2" ] && break - echo "Invalid image board target ($img_board_target) for this platform: $board. Use the correct image for this platform" - return 1 - ;; -diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -index 9b26e73..f33419f 100755 ---- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -+++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh -@@ -298,6 +298,7 @@ platform_check_image() { - return 0; - ;; - mr1750 | \ -+ mr1750v2 | \ - mr600 | \ - mr600v2 | \ - mr900 | \ -@@ -534,6 +535,7 @@ platform_do_upgrade() { - platform_do_upgrade_dir825b "$ARGV" - ;; - mr1750 | \ -+ mr1750v2 | \ - mr600 | \ - mr600v2 | \ - mr900 | \ diff --git a/patches/openwrt/0100-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch b/patches/openwrt/0100-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch deleted file mode 100644 index c5ee90df..00000000 --- a/patches/openwrt/0100-package-om-watchdog-add-OpenMesh-MR1750v2-support.patch +++ /dev/null @@ -1,21 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:57 +0200 -Subject: package/om-watchdog: add OpenMesh MR1750v2 support - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637062/ - -diff --git a/package/kernel/om-watchdog/files/om-watchdog.init b/package/kernel/om-watchdog/files/om-watchdog.init -index bf8a124..8a1b66e 100644 ---- a/package/kernel/om-watchdog/files/om-watchdog.init -+++ b/package/kernel/om-watchdog/files/om-watchdog.init -@@ -28,7 +28,7 @@ boot() { - "mr600v2") - service_start /sbin/om-watchdog 15 - ;; -- "mr900"|"mr900v2"|"mr1750") -+ "mr900"|"mr900v2"|"mr1750"|"mr1750v2") - service_start /sbin/om-watchdog 16 - ;; - esac diff --git a/patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch b/patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch deleted file mode 100644 index 5b51bfda..00000000 --- a/patches/openwrt/0101-package-uboot-envtools-add-OpenMesh-MR1750v2-support.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:58 +0200 -Subject: package/uboot-envtools: add OpenMesh MR1750v2 support - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637064/ - -diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx -index 81c6481..459e73d 100644 ---- a/package/boot/uboot-envtools/files/ar71xx -+++ b/package/boot/uboot-envtools/files/ar71xx -@@ -22,6 +22,7 @@ eap300v2 | \ - hornet-ub | \ - hornet-ub-x2 | \ - mr1750 | \ -+mr1750v2 | \ - mr600 | \ - mr600v2 | \ - mr900 | \ diff --git a/patches/openwrt/0102-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch b/patches/openwrt/0102-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch deleted file mode 100644 index ad8aaca9..00000000 --- a/patches/openwrt/0102-ar71xx-extract-ath10k-wifi-board.bin-for-the-OpenMesh-MR1750v2-board.patch +++ /dev/null @@ -1,20 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:03:59 +0200 -Subject: ar71xx: extract ath10k wifi board.bin for the OpenMesh MR1750v2 board - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637063/ - -diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -index d925a85..0e93feb 100644 ---- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -+++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata -@@ -72,6 +72,7 @@ case "$FIRMWARE" in - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) - ;; - mr1750 | \ -+ mr1750v2 | \ - om5p-acv2) - ath10kcal_extract "ART" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) diff --git a/patches/openwrt/0103-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch b/patches/openwrt/0103-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch deleted file mode 100644 index dfcb7b43..00000000 --- a/patches/openwrt/0103-ar71xx-add-MR1750v2-to-the-MR1750-profile.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: Sven Eckelmann -Date: Fri, 20 May 2016 18:04:00 +0200 -Subject: ar71xx: add MR1750v2 to the MR1750 profile - -Signed-off-by: Sven Eckelmann - -Forwarded: https://patchwork.ozlabs.org/patch/637065/ - -diff --git a/target/linux/ar71xx/generic/profiles/openmesh.mk b/target/linux/ar71xx/generic/profiles/openmesh.mk -index ddd3f8d..e245e6c 100644 ---- a/target/linux/ar71xx/generic/profiles/openmesh.mk -+++ b/target/linux/ar71xx/generic/profiles/openmesh.mk -@@ -61,12 +61,12 @@ endef - $(eval $(call Profile,MR900)) - - define Profile/MR1750 -- NAME:=OpenMesh MR1750 -+ NAME:=OpenMesh MR1750/MR1750v2 - PACKAGES:=kmod-ath9k kmod-ath10k ath10k-firmware-qca988x - endef - - define Profile/MR1750/Description -- Package set optimized for the OpenMesh MR1750. -+ Package set optimized for the OpenMesh MR1750/MR1750v2. - endef - - $(eval $(call Profile,MR1750))