From 1a7471a303f344ab018efaf31e2a6fb3054cece6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 26 Jul 2018 23:20:30 +0200 Subject: [PATCH 001/399] mac80211: brcmfmac: backport 4.19 patches preparing monitor mode support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Monitor mode isn't supported yet with brcmfmac, it's just an early work. This also prepares brcmfmac to work stable with new firmwares which use updated struct for passing STA info. Signed-off-by: Rafał Miłecki (cherry picked from commit c0608c6a27e74923dc94772072d4a279d652b3fc) --- ...firmware-support-for-monitor-interfa.patch | 59 ++++++++ ...firmware-support-for-radiotap-monito.patch | 51 +++++++ ...msgbuf-packets-marked-with-monitor-m.patch | 137 ++++++++++++++++++ ...more-bits-for-the-flags-of-struct-br.patch | 60 ++++++++ ...mac-update-STA-info-struct-to-the-v5.patch | 75 ++++++++++ ...-register-wiphy-s-during-module_init.patch | 2 +- 6 files changed, 383 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch create mode 100644 package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch create mode 100644 package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch create mode 100644 package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch create mode 100644 package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch diff --git a/package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch b/package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch new file mode 100644 index 00000000000..b0eec163f1a --- /dev/null +++ b/package/kernel/mac80211/patches/338-v4.19-0001-brcmfmac-detect-firmware-support-for-monitor-interfa.patch @@ -0,0 +1,59 @@ +From 01f69dfafdbe7deff58b58053bc3a4a75c6a570c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 24 Jun 2018 21:44:35 +0200 +Subject: [PATCH] brcmfmac: detect firmware support for monitor interface +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Many/most of firmwares support creating monitor interface but only the +most recent ones explicitly /announce/ it using a "monitor" entry in the +list of capabilities. + +Check for that entry and store internally info about monitor mode +support using a new feature flag. Once we sort out all details of +handling monitor interface it will be used when reporting available +interfaces to the cfg80211. + +Later some fallback detecion method may be added for older firmwares. +For now just stick to the "monitor" capability which should be 100% +reliable. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 + + drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +@@ -48,6 +48,7 @@ static const struct brcmf_feat_fwcap brc + { BRCMF_FEAT_MBSS, "mbss" }, + { BRCMF_FEAT_MCHAN, "mchan" }, + { BRCMF_FEAT_P2P, "p2p" }, ++ { BRCMF_FEAT_MONITOR, "monitor" }, + }; + + #ifdef DEBUG +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +@@ -33,6 +33,7 @@ + * MFP: 802.11w Management Frame Protection. + * GSCAN: enhanced scan offload feature. + * FWSUP: Firmware supplicant. ++ * MONITOR: firmware can pass monitor packets to host. + */ + #define BRCMF_FEAT_LIST \ + BRCMF_FEAT_DEF(MBSS) \ +@@ -48,7 +49,8 @@ + BRCMF_FEAT_DEF(WOWL_ARP_ND) \ + BRCMF_FEAT_DEF(MFP) \ + BRCMF_FEAT_DEF(GSCAN) \ +- BRCMF_FEAT_DEF(FWSUP) ++ BRCMF_FEAT_DEF(FWSUP) \ ++ BRCMF_FEAT_DEF(MONITOR) + + /* + * Quirks: diff --git a/package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch b/package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch new file mode 100644 index 00000000000..e733468bc3a --- /dev/null +++ b/package/kernel/mac80211/patches/338-v4.19-0002-brcmfmac-detect-firmware-support-for-radiotap-monito.patch @@ -0,0 +1,51 @@ +From e63410ac65e0ead2040bbd3927c116889edf87e4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 24 Jun 2018 21:44:36 +0200 +Subject: [PATCH] brcmfmac: detect firmware support for radiotap monitor frames +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Depending on used build-time options some firmwares may already include +radiotap header in passed monitor frames. Add a new feature flag to +store info about it. It's needed for proper handling of received frames +before passing them up. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 1 + + drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h | 4 +++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +@@ -49,6 +49,7 @@ static const struct brcmf_feat_fwcap brc + { BRCMF_FEAT_MCHAN, "mchan" }, + { BRCMF_FEAT_P2P, "p2p" }, + { BRCMF_FEAT_MONITOR, "monitor" }, ++ { BRCMF_FEAT_MONITOR_FMT_RADIOTAP, "rtap" }, + }; + + #ifdef DEBUG +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +@@ -34,6 +34,7 @@ + * GSCAN: enhanced scan offload feature. + * FWSUP: Firmware supplicant. + * MONITOR: firmware can pass monitor packets to host. ++ * MONITOR_FMT_RADIOTAP: firmware provides monitor packets with radiotap header + */ + #define BRCMF_FEAT_LIST \ + BRCMF_FEAT_DEF(MBSS) \ +@@ -50,7 +51,8 @@ + BRCMF_FEAT_DEF(MFP) \ + BRCMF_FEAT_DEF(GSCAN) \ + BRCMF_FEAT_DEF(FWSUP) \ +- BRCMF_FEAT_DEF(MONITOR) ++ BRCMF_FEAT_DEF(MONITOR) \ ++ BRCMF_FEAT_DEF(MONITOR_FMT_RADIOTAP) + + /* + * Quirks: diff --git a/package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch b/package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch new file mode 100644 index 00000000000..d640bcfecc2 --- /dev/null +++ b/package/kernel/mac80211/patches/338-v4.19-0003-brcmfmac-handle-msgbuf-packets-marked-with-monitor-m.patch @@ -0,0 +1,137 @@ +From a8d7631858aff156b72f807ee7cc062048e63836 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Sun, 24 Jun 2018 21:44:37 +0200 +Subject: [PATCH] brcmfmac: handle msgbuf packets marked with monitor mode flag +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +New Broadcom firmwares mark monitor mode packets using a newly defined +bit in the flags field. Use it to filter them out and pass to the +monitor interface. These defines were found in bcmmsgbuf.h from SDK. + +As not every firmware generates radiotap header this commit introduces +BRCMF_FEAT_MONITOR_FMT_RADIOTAP flag. It has to be has based on firmware +capabilities. If not present brcmf_netif_mon_rx() will assume packet is +a raw 802.11 frame and will prepend it with an empty radiotap header. + +This new code is limited to the msgbuf protocol at this point. Adding +support for SDIO/USB devices will require some extra work (possibly a +new firmware release). + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../wireless/broadcom/brcm80211/brcmfmac/core.c | 25 ++++++++++++++++++++++ + .../wireless/broadcom/brcm80211/brcmfmac/core.h | 2 ++ + .../wireless/broadcom/brcm80211/brcmfmac/msgbuf.c | 18 ++++++++++++++++ + 3 files changed, 45 insertions(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -404,6 +405,30 @@ void brcmf_netif_rx(struct brcmf_if *ifp + netif_rx_ni(skb); + } + ++void brcmf_netif_mon_rx(struct brcmf_if *ifp, struct sk_buff *skb) ++{ ++ if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_MONITOR_FMT_RADIOTAP)) { ++ /* Do nothing */ ++ } else { ++ struct ieee80211_radiotap_header *radiotap; ++ ++ /* TODO: use RX status to fill some radiotap data */ ++ radiotap = skb_push(skb, sizeof(*radiotap)); ++ memset(radiotap, 0, sizeof(*radiotap)); ++ radiotap->it_len = cpu_to_le16(sizeof(*radiotap)); ++ ++ /* TODO: 4 bytes with receive status? */ ++ skb->len -= 4; ++ } ++ ++ skb->dev = ifp->ndev; ++ skb_reset_mac_header(skb); ++ skb->pkt_type = PACKET_OTHERHOST; ++ skb->protocol = htons(ETH_P_802_2); ++ ++ brcmf_netif_rx(ifp, skb); ++} ++ + static int brcmf_rx_hdrpull(struct brcmf_pub *drvr, struct sk_buff *skb, + struct brcmf_if **ifp) + { +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +@@ -121,6 +121,7 @@ struct brcmf_pub { + + struct brcmf_if *iflist[BRCMF_MAX_IFS]; + s32 if2bss[BRCMF_MAX_IFS]; ++ struct brcmf_if *mon_if; + + struct mutex proto_block; + unsigned char proto_buf[BRCMF_DCMD_MAXLEN]; +@@ -216,6 +217,7 @@ void brcmf_txflowblock_if(struct brcmf_i + 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_mon_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/msgbuf.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/msgbuf.c +@@ -69,6 +69,8 @@ + #define BRCMF_MSGBUF_MAX_EVENTBUF_POST 8 + + #define BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_3 0x01 ++#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_11 0x02 ++#define BRCMF_MSGBUF_PKT_FLAGS_FRAME_MASK 0x07 + #define BRCMF_MSGBUF_PKT_FLAGS_PRIO_SHIFT 5 + + #define BRCMF_MSGBUF_TX_FLUSH_CNT1 32 +@@ -1128,6 +1130,7 @@ brcmf_msgbuf_process_rx_complete(struct + struct sk_buff *skb; + u16 data_offset; + u16 buflen; ++ u16 flags; + u32 idx; + struct brcmf_if *ifp; + +@@ -1137,6 +1140,7 @@ brcmf_msgbuf_process_rx_complete(struct + data_offset = le16_to_cpu(rx_complete->data_offset); + buflen = le16_to_cpu(rx_complete->data_len); + idx = le32_to_cpu(rx_complete->msg.request_id); ++ flags = le16_to_cpu(rx_complete->flags); + + skb = brcmf_msgbuf_get_pktid(msgbuf->drvr->bus_if->dev, + msgbuf->rx_pktids, idx); +@@ -1150,6 +1154,20 @@ brcmf_msgbuf_process_rx_complete(struct + + skb_trim(skb, buflen); + ++ if ((flags & BRCMF_MSGBUF_PKT_FLAGS_FRAME_MASK) == ++ BRCMF_MSGBUF_PKT_FLAGS_FRAME_802_11) { ++ ifp = msgbuf->drvr->mon_if; ++ ++ if (!ifp) { ++ brcmf_err("Received unexpected monitor pkt\n"); ++ brcmu_pkt_buf_free_skb(skb); ++ return; ++ } ++ ++ brcmf_netif_mon_rx(ifp, skb); ++ return; ++ } ++ + ifp = brcmf_get_ifp(msgbuf->drvr, rx_complete->msg.ifidx); + if (!ifp || !ifp->ndev) { + brcmf_err("Received pkt for invalid ifidx %d\n", diff --git a/package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch b/package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch new file mode 100644 index 00000000000..050370de465 --- /dev/null +++ b/package/kernel/mac80211/patches/339-v4.19-brcmfmac-define-more-bits-for-the-flags-of-struct-br.patch @@ -0,0 +1,60 @@ +From 4b4a8d808c58fc0defc32a26b2fea35d66692c45 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 28 Jun 2018 08:16:13 +0200 +Subject: [PATCH] brcmfmac: define more bits for the flags of struct + brcmf_sta_info_le +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +That struct is passed by a firmware when querying for STA info. Flags +are used to indicate what info could be obtained. + +These new defines may allow passing more info to the cfg80211 in the +future. They had been obtained from Broadcom's SDK file wlioctl_defs.h +used by DD-WRT. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Kalle Valo +--- + .../broadcom/brcm80211/brcmfmac/fwil_types.h | 29 ++++++++++++++++++---- + 1 file changed, 24 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +@@ -32,11 +32,30 @@ + #define BRCMF_BSS_INFO_VERSION 109 /* curr ver of brcmf_bss_info_le struct */ + #define BRCMF_BSS_RSSI_ON_CHANNEL 0x0002 + +-#define BRCMF_STA_WME 0x00000002 /* WMM association */ +-#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */ +-#define BRCMF_STA_ASSOC 0x00000010 /* Associated */ +-#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */ +-#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */ ++#define BRCMF_STA_BRCM 0x00000001 /* Running a Broadcom driver */ ++#define BRCMF_STA_WME 0x00000002 /* WMM association */ ++#define BRCMF_STA_NONERP 0x00000004 /* No ERP */ ++#define BRCMF_STA_AUTHE 0x00000008 /* Authenticated */ ++#define BRCMF_STA_ASSOC 0x00000010 /* Associated */ ++#define BRCMF_STA_AUTHO 0x00000020 /* Authorized */ ++#define BRCMF_STA_WDS 0x00000040 /* Wireless Distribution System */ ++#define BRCMF_STA_WDS_LINKUP 0x00000080 /* WDS traffic/probes flowing properly */ ++#define BRCMF_STA_PS 0x00000100 /* STA is in power save mode from AP's viewpoint */ ++#define BRCMF_STA_APSD_BE 0x00000200 /* APSD delv/trigger for AC_BE is default enabled */ ++#define BRCMF_STA_APSD_BK 0x00000400 /* APSD delv/trigger for AC_BK is default enabled */ ++#define BRCMF_STA_APSD_VI 0x00000800 /* APSD delv/trigger for AC_VI is default enabled */ ++#define BRCMF_STA_APSD_VO 0x00001000 /* APSD delv/trigger for AC_VO is default enabled */ ++#define BRCMF_STA_N_CAP 0x00002000 /* STA 802.11n capable */ ++#define BRCMF_STA_SCBSTATS 0x00004000 /* Per STA debug stats */ ++#define BRCMF_STA_AMPDU_CAP 0x00008000 /* STA AMPDU capable */ ++#define BRCMF_STA_AMSDU_CAP 0x00010000 /* STA AMSDU capable */ ++#define BRCMF_STA_MIMO_PS 0x00020000 /* mimo ps mode is enabled */ ++#define BRCMF_STA_MIMO_RTS 0x00040000 /* send rts in mimo ps mode */ ++#define BRCMF_STA_RIFS_CAP 0x00080000 /* rifs enabled */ ++#define BRCMF_STA_VHT_CAP 0x00100000 /* STA VHT(11ac) capable */ ++#define BRCMF_STA_WPS 0x00200000 /* WPS state */ ++#define BRCMF_STA_DWDS_CAP 0x01000000 /* DWDS CAP */ ++#define BRCMF_STA_DWDS 0x02000000 /* DWDS active */ + + /* size of brcmf_scan_params not including variable length array */ + #define BRCMF_SCAN_PARAMS_FIXED_SIZE 64 diff --git a/package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch b/package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch new file mode 100644 index 00000000000..e0fd8d9ea51 --- /dev/null +++ b/package/kernel/mac80211/patches/340-v4.19-brcmfmac-update-STA-info-struct-to-the-v5.patch @@ -0,0 +1,75 @@ +From 07b1ae46874949252625c96f309f96ca0f337020 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 28 Jun 2018 12:36:23 +0200 +Subject: [PATCH] brcmfmac: update STA info struct to the v5 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +That struct is used when querying firmware for the STA. It seem is has +been changing during the time. Luckily its format seems to be backward +compatible starting with v2 (the only breakage was v1 -> v2). + +The version that was supported by brcmfmac so far was v4. It was what +43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly) +were using. It also seems to be used by early 4366c0 firmwares +(10.10.69.6908 and 10.10.69.69017). + +The problem appears when switching to the 10.10.122.20 firmware. It uses +v5 and instead of falling back to v4 when submitted buffer isn't big +enough it fallbacks to the v3. + +To receive all v4 specific info with the newest firmware we have to +submit a struct (buffer) that matches v5. + +Signed-off-by: Rafał Miłecki +Acked-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +@@ -174,6 +174,8 @@ + #define BRCMF_MFP_CAPABLE 1 + #define BRCMF_MFP_REQUIRED 2 + ++#define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8 ++ + /* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each + * ioctl. It is relatively small because firmware has small maximum size input + * playload restriction for ioctls. +@@ -550,6 +552,8 @@ struct brcmf_sta_info_le { + /* w/hi bit set if basic */ + __le32 in; /* seconds elapsed since associated */ + __le32 listen_interval_inms; /* Min Listen interval in ms for STA */ ++ ++ /* Fields valid for ver >= 3 */ + __le32 tx_pkts; /* # of packets transmitted */ + __le32 tx_failures; /* # of packets failed */ + __le32 rx_ucast_pkts; /* # of unicast packets received */ +@@ -558,6 +562,8 @@ struct brcmf_sta_info_le { + __le32 rx_rate; /* Rate of last successful rx frame */ + __le32 rx_decrypt_succeeds; /* # of packet decrypted successfully */ + __le32 rx_decrypt_failures; /* # of packet decrypted failed */ ++ ++ /* Fields valid for ver >= 4 */ + __le32 tx_tot_pkts; /* # of tx pkts (ucast + mcast) */ + __le32 rx_tot_pkts; /* # of data packets recvd (uni + mcast) */ + __le32 tx_mcast_pkts; /* # of mcast pkts txed */ +@@ -594,6 +600,14 @@ struct brcmf_sta_info_le { + */ + __le32 rx_pkts_retried; /* # rx with retry bit set */ + __le32 tx_rate_fallback; /* lowest fallback TX rate */ ++ ++ /* Fields valid for ver >= 5 */ ++ struct { ++ __le32 count; /* # rates in this set */ ++ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */ ++ u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */ ++ __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */ ++ } rateset_adv; + }; + + struct brcmf_chanspec_list { 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 index 65782906a1c..e70738322d2 100644 --- 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 @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c -@@ -1322,6 +1322,7 @@ int __init brcmf_core_init(void) +@@ -1347,6 +1347,7 @@ int __init brcmf_core_init(void) { if (!schedule_work(&brcmf_driver_work)) return -EBUSY; From d3e9c8862ff97d20b5f90cc591a28b1fd523689a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 31 Jul 2018 09:44:19 +0200 Subject: [PATCH 002/399] mac80211: brcmfmac: backport patch for per-firmware features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows driver to support features that can't be dynamically discovered. Signed-off-by: Rafał Miłecki (cherry picked from commit fecbd91c7c12b5b1cfe894c2901083cc42863aae) --- ...y-some-features-per-firmware-version.patch | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch diff --git a/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch b/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch new file mode 100644 index 00000000000..6ebcdfdf29d --- /dev/null +++ b/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch @@ -0,0 +1,84 @@ +From 1e591c56a65fbbcd5754a4210a0ef0402d5e5f33 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Mon, 9 Jul 2018 06:55:43 +0200 +Subject: [PATCH] brcmfmac: specify some features per firmware version +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some features supported by firmware aren't advertised and there is no +way for a driver to query them. This includes e.g. monitor mode details. + +Most firmwares support monitor interface but only the latest ones +/announce/ it with a "monitor" flag in the "cap" iovar. There isn't any +reliable detection method for older firmwares (BRCMF_C_MONITOR was tried +but "it only indicates the core part of the stack supports"). + +Similarly support for tagging monitor frames and building radiotap +headers can't be reliably detected for all firmwares. + +This commit adds table that allows mapping features to firmware version. +It adds mappings for 43602a1 and 4366b1 firmwares from +linux-firmware.git. Both were confirmed to be passing monitor frames. + +Signed-off-by: Rafał Miłecki +Reviewed-by: Arend van Spriel +Signed-off-by: Kalle Valo +--- + .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 38 ++++++++++++++++++++++ + 1 file changed, 38 insertions(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +@@ -93,6 +93,42 @@ static int brcmf_feat_debugfs_read(struc + } + #endif /* DEBUG */ + ++struct brcmf_feat_fwfeat { ++ const char * const fwid; ++ u32 feat_flags; ++}; ++ ++static const struct brcmf_feat_fwfeat brcmf_feat_fwfeat_map[] = { ++ /* brcmfmac43602-pcie.ap.bin from linux-firmware.git commit ea1178515b88 */ ++ { "01-6cb8e269", BIT(BRCMF_FEAT_MONITOR) }, ++ /* brcmfmac4366b-pcie.bin from linux-firmware.git commit 52442afee990 */ ++ { "01-c47a91a4", BIT(BRCMF_FEAT_MONITOR) }, ++}; ++ ++static void brcmf_feat_firmware_overrides(struct brcmf_pub *drv) ++{ ++ const struct brcmf_feat_fwfeat *e; ++ u32 feat_flags = 0; ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(brcmf_feat_fwfeat_map); i++) { ++ e = &brcmf_feat_fwfeat_map[i]; ++ if (!strcmp(e->fwid, drv->fwver)) { ++ feat_flags = e->feat_flags; ++ break; ++ } ++ } ++ ++ if (!feat_flags) ++ return; ++ ++ for (i = 0; i < BRCMF_FEAT_LAST; i++) ++ if (feat_flags & BIT(i)) ++ brcmf_dbg(INFO, "enabling firmware feature: %s\n", ++ brcmf_feat_names[i]); ++ drv->feat_flags |= feat_flags; ++} ++ + /** + * brcmf_feat_iovar_int_get() - determine feature through iovar query. + * +@@ -253,6 +289,8 @@ void brcmf_feat_attach(struct brcmf_pub + } + brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_FWSUP, "sup_wpa"); + ++ brcmf_feat_firmware_overrides(drvr); ++ + /* set chip related quirks */ + switch (drvr->bus_if->chip) { + case BRCM_CC_43236_CHIP_ID: From 6f0ede54387e4a49fae8a94766e5ec06640bcb38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 12 Sep 2018 08:40:03 +0200 Subject: [PATCH 003/399] mac80211: brcmfmac: backport CYW89342 support & fixes from 4.20 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit b3d441c5f7c5247c1b0c3b6e9827d49a27093d50) --- ...cmfmac-add-CYW89342-mini-PCIe-device.patch | 25 ++++ ...001-brcmfmac-fix-wrong-strnchr-usage.patch | 38 ++++++ ...r-proper-support-of-160MHz-bandwidth.patch | 117 ++++++++++++++++++ ...e-buffer-for-obtaining-firmware-capa.patch | 28 +++++ 4 files changed, 208 insertions(+) create mode 100644 package/kernel/mac80211/patches/342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch create mode 100644 package/kernel/mac80211/patches/344-0001-brcmfmac-fix-wrong-strnchr-usage.patch create mode 100644 package/kernel/mac80211/patches/345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch create mode 100644 package/kernel/mac80211/patches/345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch diff --git a/package/kernel/mac80211/patches/342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch b/package/kernel/mac80211/patches/342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch new file mode 100644 index 00000000000..d0d9b203739 --- /dev/null +++ b/package/kernel/mac80211/patches/342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch @@ -0,0 +1,25 @@ +From 2fef681a4cf7994c882190fd2417b95f30510afb Mon Sep 17 00:00:00 2001 +From: Jia-Shyr Chuang +Date: Wed, 15 Aug 2018 04:23:09 -0500 +Subject: [PATCH] brcmfmac: add CYW89342 mini-PCIe device + +CYW89342 is a 2x2 MIMO, 802.11a/b/g/n/ac for WLAN. It is a member of +4355/4359 family. + +Signed-off-by: Jia-Shyr Chuang +Signed-off-by: Chi-Hsien Lin +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +@@ -2017,6 +2017,7 @@ static const struct dev_pm_ops brcmf_pci + + static const struct pci_device_id brcmf_pcie_devid_table[] = { + BRCMF_PCIE_DEVICE(BRCM_PCIE_4350_DEVICE_ID), ++ BRCMF_PCIE_DEVICE_SUB(0x4355, BRCM_PCIE_VENDOR_ID_BROADCOM, 0x4355), + BRCMF_PCIE_DEVICE(BRCM_PCIE_4356_DEVICE_ID), + BRCMF_PCIE_DEVICE(BRCM_PCIE_43567_DEVICE_ID), + BRCMF_PCIE_DEVICE(BRCM_PCIE_43570_DEVICE_ID), diff --git a/package/kernel/mac80211/patches/344-0001-brcmfmac-fix-wrong-strnchr-usage.patch b/package/kernel/mac80211/patches/344-0001-brcmfmac-fix-wrong-strnchr-usage.patch new file mode 100644 index 00000000000..8267b378640 --- /dev/null +++ b/package/kernel/mac80211/patches/344-0001-brcmfmac-fix-wrong-strnchr-usage.patch @@ -0,0 +1,38 @@ +From cb18e2e9ec71d42409a51b83546686c609780dde Mon Sep 17 00:00:00 2001 +From: Rasmus Villemoes +Date: Wed, 22 Aug 2018 15:22:15 +0200 +Subject: [PATCH] brcmfmac: fix wrong strnchr usage + +strnchr takes arguments in the order of its name: string, max bytes to +read, character to search for. Here we're passing '\n' aka 10 as the +buffer size, and searching for sizeof(buf) aka BRCMF_DCMD_SMLEN aka +256 (aka '\0', since it's implicitly converted to char) within those 10 +bytes. + +Just interchanging the last two arguments would still leave a bug, +because if we've been successful once, there are not sizeof(buf) +characters left after the new value of p. + +Since clmver is immediately afterwards passed as a %s argument, I assume +that it is actually a properly nul-terminated string. For that case, we +have strreplace(). + +Signed-off-by: Rasmus Villemoes +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +@@ -296,9 +296,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i + /* Replace all newline/linefeed characters with space + * character + */ +- ptr = clmver; +- while ((ptr = strnchr(ptr, '\n', sizeof(buf))) != NULL) +- *ptr = ' '; ++ strreplace(clmver, '\n', ' '); + + brcmf_dbg(INFO, "CLM version = %s\n", clmver); + } diff --git a/package/kernel/mac80211/patches/345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch b/package/kernel/mac80211/patches/345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch new file mode 100644 index 00000000000..6e965789907 --- /dev/null +++ b/package/kernel/mac80211/patches/345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch @@ -0,0 +1,117 @@ +From: Arend van Spriel +Date: Wed, 5 Sep 2018 09:48:58 +0200 +Subject: [PATCH] brcmfmac: fix for proper support of 160MHz bandwidth + +Decoding of firmware channel information was not complete for 160MHz +support. This resulted in the following warning: + + WARNING: CPU: 2 PID: 2222 at .../broadcom/brcm80211/brcmutil/d11.c:196 + brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil] + Modules linked in: brcmfmac(O) brcmutil(O) sha256_generic cfg80211 ... + CPU: 2 PID: 2222 Comm: kworker/2:0 Tainted: G O + 4.17.0-wt-testing-x64-00002-gf1bed50 #1 + Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011 + Workqueue: events request_firmware_work_func + RIP: 0010:brcmu_d11ac_decchspec+0x2e/0x100 [brcmutil] + RSP: 0018:ffffc90000047bd0 EFLAGS: 00010206 + RAX: 000000000000e832 RBX: ffff8801146fe910 RCX: ffff8801146fd3c0 + RDX: 0000000000002800 RSI: 0000000000000070 RDI: ffffc90000047c30 + RBP: ffffc90000047bd0 R08: 0000000000000000 R09: ffffffffa0798c80 + R10: ffff88012bca55e0 R11: ffff880110a4ea00 R12: ffff8801146f8000 + R13: ffffc90000047c30 R14: ffff8801146fe930 R15: ffff8801138e02e0 + FS: 0000000000000000(0000) GS:ffff88012bc80000(0000) knlGS:0000000000000000 + CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 + CR2: 00007f18ce8b8070 CR3: 000000000200a003 CR4: 00000000000206e0 + Call Trace: + brcmf_setup_wiphybands+0x212/0x780 [brcmfmac] + brcmf_cfg80211_attach+0xae2/0x11a0 [brcmfmac] + brcmf_attach+0x1fc/0x4b0 [brcmfmac] + ? __kmalloc+0x13c/0x1c0 + brcmf_pcie_setup+0x99b/0xe00 [brcmfmac] + brcmf_fw_request_done+0x16a/0x1f0 [brcmfmac] + request_firmware_work_func+0x36/0x60 + process_one_work+0x146/0x350 + worker_thread+0x4a/0x3b0 + kthread+0x102/0x140 + ? process_one_work+0x350/0x350 + ? kthread_bind+0x20/0x20 + ret_from_fork+0x35/0x40 + Code: 66 90 0f b7 07 55 48 89 e5 89 c2 88 47 02 88 47 03 66 81 e2 00 38 + 66 81 fa 00 18 74 6e 66 81 fa 00 20 74 39 66 81 fa 00 10 74 14 <0f> + 0b 66 25 00 c0 74 20 66 3d 00 c0 75 20 c6 47 04 01 5d c3 66 + ---[ end trace 550c46682415b26d ]--- + brcmfmac: brcmf_construct_chaninfo: Ignoring unexpected firmware channel 50 + +This patch adds the missing stuff to properly handle this. + +Reviewed-by: Hante Meuleman +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +--- + .../net/wireless/broadcom/brcm80211/brcmutil/d11.c | 34 +++++++++++++++++++++- + .../broadcom/brcm80211/include/brcmu_wifi.h | 2 ++ + 2 files changed, 35 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +@@ -77,6 +77,8 @@ static u16 d11ac_bw(enum brcmu_chan_bw b + return BRCMU_CHSPEC_D11AC_BW_40; + case BRCMU_CHAN_BW_80: + return BRCMU_CHSPEC_D11AC_BW_80; ++ case BRCMU_CHAN_BW_160: ++ return BRCMU_CHSPEC_D11AC_BW_160; + default: + WARN_ON(1); + } +@@ -190,8 +192,38 @@ static void brcmu_d11ac_decchspec(struct + break; + } + break; +- case BRCMU_CHSPEC_D11AC_BW_8080: + case BRCMU_CHSPEC_D11AC_BW_160: ++ switch (ch->sb) { ++ case BRCMU_CHAN_SB_LLL: ++ ch->control_ch_num -= CH_70MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_LLU: ++ ch->control_ch_num -= CH_50MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_LUL: ++ ch->control_ch_num -= CH_30MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_LUU: ++ ch->control_ch_num -= CH_10MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_ULL: ++ ch->control_ch_num += CH_10MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_ULU: ++ ch->control_ch_num += CH_30MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_UUL: ++ ch->control_ch_num += CH_50MHZ_APART; ++ break; ++ case BRCMU_CHAN_SB_UUU: ++ ch->control_ch_num += CH_70MHZ_APART; ++ break; ++ default: ++ WARN_ON_ONCE(1); ++ break; ++ } ++ break; ++ case BRCMU_CHSPEC_D11AC_BW_8080: + default: + WARN_ON_ONCE(1); + break; +--- a/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h ++++ b/drivers/net/wireless/broadcom/brcm80211/include/brcmu_wifi.h +@@ -29,6 +29,8 @@ + #define CH_UPPER_SB 0x01 + #define CH_LOWER_SB 0x02 + #define CH_EWA_VALID 0x04 ++#define CH_70MHZ_APART 14 ++#define CH_50MHZ_APART 10 + #define CH_30MHZ_APART 6 + #define CH_20MHZ_APART 4 + #define CH_10MHZ_APART 2 diff --git a/package/kernel/mac80211/patches/345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch b/package/kernel/mac80211/patches/345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch new file mode 100644 index 00000000000..11fb4bce453 --- /dev/null +++ b/package/kernel/mac80211/patches/345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch @@ -0,0 +1,28 @@ +From: Arend van Spriel +Date: Wed, 5 Sep 2018 09:48:59 +0200 +Subject: [PATCH] brcmfmac: increase buffer for obtaining firmware capabilities + +When obtaining the firmware capability a buffer is provided of 512 +bytes. However, if all features in firmware are supported the buffer +needs to be 565 bytes as otherwise truncated information is retrieved +from firmware. Increasing the buffer to 768 bytes on stack. + +Reviewed-by: Hante Meuleman +Reviewed-by: Pieter-Paul Giesberts +Reviewed-by: Franky Lin +Signed-off-by: Arend van Spriel +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +@@ -178,7 +178,7 @@ static void brcmf_feat_iovar_data_set(st + ifp->fwil_fwerr = false; + } + +-#define MAX_CAPS_BUFFER_SIZE 512 ++#define MAX_CAPS_BUFFER_SIZE 768 + static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp) + { + char caps[MAX_CAPS_BUFFER_SIZE]; From f14c321a0d26ee84192ff687ac2ee7d8ab664c8e Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sat, 28 Jul 2018 21:11:14 +0100 Subject: [PATCH 004/399] kmod-sched-cake: bump to 20180728 optional gso split Follow upstream kernel patch that restores always splitting gso packets by default whilst making the option configurable from (tc) userspace. No ABI/API change Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit fe077d20e3b484e55ad49d5711673d05d7a301de) --- package/kernel/kmod-sched-cake/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index 6ec9c03bd25..b32cad1c401 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2018-07-16 -PKG_SOURCE_VERSION:=f39ab9a402ad51d7c17d4cde18ca15b2b7022030 -PKG_MIRROR_HASH:=fc22fc6eb7a24f4595c2777f33758ebcf9a2a404c16d00aa37ae389cd7f9c78f +PKG_SOURCE_DATE:=2018-07-28 +PKG_SOURCE_VERSION:=ce7076ee201802053c47282feff7a180a2941824 +PKG_MIRROR_HASH:=18fde2515169476b214c7af3a9cc7bc5f1d3d84193d1c076d8ca624aeb408385 PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk From b2a042b5fe0c07af342981294126f0097dc84207 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sun, 29 Jul 2018 14:56:03 +0100 Subject: [PATCH 005/399] iproute2: cake: make gso/gro splitting configurable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch makes sch_cake's gso/gro splitting configurable from userspace. To disable breaking apart superpackets in sch_cake: tc qdisc replace dev whatever root cake no-split-gso to enable: tc qdisc replace dev whatever root cake split-gso Signed-off-by: Toke Høiland-Jørgensen Signed-off-by: Dave Taht [pulled from netdev list - no API/ABI change] Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 3e8a9389961cd866b867740a2f71c2a0af97ab56) --- package/network/utils/iproute2/Makefile | 2 +- .../utils/iproute2/patches/950-add-cake-to-tc.patch | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 54e0fdede24..f72b86d034e 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 PKG_VERSION:=4.16.0 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 05142fa95ec..1af47c587d9 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -776,7 +776,7 @@ TCMODULES += e_bpf.o --- /dev/null +++ b/tc/q_cake.c -@@ -0,0 +1,790 @@ +@@ -0,0 +1,799 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + +/* @@ -858,6 +858,7 @@ +" dual-srchost | dual-dsthost | triple-isolate* ]\n" +" [ nat | nonat* ]\n" +" [ wash | nowash* ]\n" ++" [ split-gso* | no-split-gso ]\n" +" [ ack-filter | ack-filter-aggressive | no-ack-filter* ]\n" +" [ memlimit LIMIT ]\n" +" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" @@ -887,6 +888,7 @@ + int nat = -1; + int atm = -1; + int mpu = 0; ++ int split_gso = -1; + + while (argc > 0) { + if (strcmp(*argv, "bandwidth") == 0) { @@ -934,6 +936,10 @@ + wash = 0; + } else if (strcmp(*argv, "wash") == 0) { + wash = 1; ++ } else if (strcmp(*argv, "split-gso") == 0) { ++ split_gso = 1; ++ } else if (strcmp(*argv, "no-split-gso") == 0) { ++ split_gso = 0; + } else if (strcmp(*argv, "flowblind") == 0) { + flowmode = CAKE_FLOW_NONE; + } else if (strcmp(*argv, "srchost") == 0) { @@ -1153,6 +1159,9 @@ + addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat)); + if (wash != -1) + addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash)); ++ if (split_gso != -1) ++ addattr_l(n, 1024, TCA_CAKE_SPLIT_GSO, &split_gso, ++ sizeof(split_gso)); + if (ingress != -1) + addattr_l(n, 1024, TCA_CAKE_INGRESS, &ingress, sizeof(ingress)); + if (ack_filter != -1) From f6bd1b306bbbd9afecac4f2f8b1edd68c324758f Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Mon, 13 Aug 2018 13:49:19 +0100 Subject: [PATCH 006/399] kmod-sched-cake: bump to 20180827 Expand filter flow mapping to include hosts as well Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit d14ffdc307d36bd9abe908b46ff7baece54c9551) (cherry picked from commit 721dfd4eb8a4a568c7c4320436a843d30413605e) --- package/kernel/kmod-sched-cake/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index b32cad1c401..56e95896b57 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2018-07-28 -PKG_SOURCE_VERSION:=ce7076ee201802053c47282feff7a180a2941824 -PKG_MIRROR_HASH:=18fde2515169476b214c7af3a9cc7bc5f1d3d84193d1c076d8ca624aeb408385 +PKG_SOURCE_DATE:=2018-08-25 +PKG_SOURCE_VERSION:=42175bfc76c5e7fbca5b50fd4c5cca7801f123f2 +PKG_MIRROR_HASH:=9b3748ee97e774f8ae63e808dd85de04d28b9b9a0abb0367d4e372129e5d8096 PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk From ae12852864879d91ac1f94193bfec5c76c702ca4 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Wed, 12 Sep 2018 05:10:55 +0100 Subject: [PATCH 007/399] kmod-sched-cake: fix 6in4/gso performance issue Bump to latest upstream cake: Add workaround for wrong skb->mac_len values after splitting GSO Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 66fd41ba79356b1b776ba29dd8191039abc23061) --- package/kernel/kmod-sched-cake/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index 56e95896b57..ce7ac272616 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2018-08-25 -PKG_SOURCE_VERSION:=42175bfc76c5e7fbca5b50fd4c5cca7801f123f2 -PKG_MIRROR_HASH:=9b3748ee97e774f8ae63e808dd85de04d28b9b9a0abb0367d4e372129e5d8096 +PKG_SOURCE_DATE:=2018-09-11 +PKG_SOURCE_VERSION:=42e87f12ea5c390bf5eeb658c942bc810046160a +PKG_MIRROR_HASH:=56c71ae079e4c64aef2564d42d2efd31621e7e9f5220844ad1ea795e2f1cb1fd PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk From 1fdf3b4a4440b8740212697add2bb60bbcb68f9c Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Mon, 27 Aug 2018 15:52:55 +0700 Subject: [PATCH 008/399] iproute2: update cake man page CAKE supports overriding of its internal classification of packets through the tc filter mechanism. Update the man page in our package, even though we don't build them. Someone may find the documentation useful. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 30598a05385b0ac2380dd4f30037a9f9d0318cf2) (cherry picked from commit dc9388ac5506f2d0ea0fee6967c003b9129c8ca5) --- package/network/utils/iproute2/Makefile | 2 +- .../iproute2/patches/950-add-cake-to-tc.patch | 82 ++++++++++++++++++- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index f72b86d034e..66192c7bac0 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 PKG_VERSION:=4.16.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 1af47c587d9..ea1f3c5516e 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -121,7 +121,7 @@ #endif --- /dev/null +++ b/man/man8/tc-cake.8 -@@ -0,0 +1,632 @@ +@@ -0,0 +1,710 @@ +.TH CAKE 8 "19 July 2018" "iproute2" "Linux" +.SH NAME +CAKE \- Common Applications Kept Enhanced (CAKE) @@ -197,6 +197,12 @@ +] +.br +[ ++.BR split-gso* ++| ++.BR no-split-gso ++] ++.br ++[ +.BR ack-filter +| +.BR ack-filter-aggressive @@ -670,6 +676,78 @@ +case for Comcast Cable, among others), it is best to use a single queue +"besteffort" mode with wash. + ++.PP ++.B split-gso ++ ++.br ++ This option controls whether CAKE will split General Segmentation ++Offload (GSO) super-packets into their on-the-wire components and ++dequeue them individually. ++ ++.br ++Super-packets are created by the networking stack to improve efficiency. ++However, because they are larger they take longer to dequeue, which ++translates to higher latency for competing flows, especially at lower ++bandwidths. CAKE defaults to splitting GSO packets to achieve the lowest ++possible latency. At link speeds higher than 10 Gbps, setting the ++no-split-gso parameter can increase the maximum achievable throughput by ++retaining the full GSO packets. ++ ++.SH OVERRIDING CLASSIFICATION WITH TC FILTERS ++ ++CAKE supports overriding of its internal classification of packets through the ++tc filter mechanism. Packets can be assigned to different priority tins by ++setting the ++.B priority ++field on the skb, and the flow hashing can be overridden by setting the ++.B classid ++parameter. ++ ++.PP ++.B Tin override ++ ++.br ++ To assign a priority tin, the major number of the priority field needs ++to match the qdisc handle of the cake instance; if it does, the minor number ++will be interpreted as the tin index. For example, to classify all ICMP packets ++as 'bulk', the following filter can be used: ++ ++.br ++ # tc qdisc replace dev eth0 handle 1: root cake diffserv3 ++ # tc filter add dev eth0 parent 1: protocol ip prio 1 \\ ++ u32 match icmp type 0 0 action skbedit priority 1:1 ++ ++.PP ++.B Flow hash override ++ ++.br ++ To override flow hashing, the classid can be set. CAKE will interpret ++the major number of the classid as the host hash used in host isolation mode, ++and the minor number as the flow hash used for flow-based queueing. One or both ++of those can be set, and will be used if the relevant flow isolation parameter ++is set (i.e., the major number will be ignored if CAKE is not configured in ++hosts mode, and the minor number will be ignored if CAKE is not configured in ++flows mode). ++ ++.br ++This example will assign all ICMP packets to the first queue: ++ ++.br ++ # tc qdisc replace dev eth0 handle 1: root cake ++ # tc filter add dev eth0 parent 1: protocol ip prio 1 \\ ++ u32 match icmp type 0 0 classid 0:1 ++ ++.br ++If only one of the host and flow overrides is set, CAKE will compute the other ++hash from the packet as normal. Note, however, that the host isolation mode ++works by assigning a host ID to the flow queue; so if overriding both host and ++flow, the same flow cannot have more than one host assigned. In addition, it is ++not possible to assign different source and destination host IDs through the ++override mechanism; if a host ID is assigned, it will be used as both source and ++destination host. ++ ++ ++ +.SH EXAMPLES +# tc qdisc delete root dev eth0 +.br @@ -879,6 +957,7 @@ + __u64 bandwidth = 0; + int ack_filter = -1; + struct rtattr *tail; ++ int split_gso = -1; + int unlimited = 0; + int flowmode = -1; + int autorate = -1; @@ -888,7 +967,6 @@ + int nat = -1; + int atm = -1; + int mpu = 0; -+ int split_gso = -1; + + while (argc > 0) { + if (strcmp(*argv, "bandwidth") == 0) { From a57062a90832b0941d4b55cbaca48bfc0c2f1d34 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Wed, 12 Sep 2018 08:24:37 +0100 Subject: [PATCH 009/399] iproute2: q_cake: Add printing of no-split-gso option When the GSO splitting was turned into dual split-gso/no-split-gso options, the printing of the latter was left out. Add that, so output is consistent with the options passed Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 8cac8572897c28e902218b445aa9bed82c40989f) --- package/network/utils/iproute2/Makefile | 2 +- .../network/utils/iproute2/patches/950-add-cake-to-tc.patch | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 66192c7bac0..91092b2f517 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 PKG_VERSION:=4.16.0 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index ea1f3c5516e..038ca233376 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -854,7 +854,7 @@ TCMODULES += e_bpf.o --- /dev/null +++ b/tc/q_cake.c -@@ -0,0 +1,799 @@ +@@ -0,0 +1,801 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + +/* @@ -1381,6 +1381,8 @@ + + if (split_gso) + print_string(PRINT_FP, NULL, "split-gso ", NULL); ++ else ++ print_string(PRINT_FP, NULL, "no-split-gso ", NULL); + print_bool(PRINT_JSON, "split_gso", NULL, split_gso); + + if (interval) From e60be1133036b5ccce94d73d21e159840143fd41 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 13 Sep 2018 09:26:44 +0200 Subject: [PATCH 010/399] toolchain/glibc: update to latest 2.26 commit c5c90b480e Fix segfault in maybe_script_execute. 174709d879 pthread_cond_broadcast: Fix waiters-after-spinning case [BZ #23538] c9570bd2f5 x86: Populate COMMON_CPUID_INDEX_80000001 for Intel CPUs [BZ #23459] 86e0996b1a x86: Correct index_cpu_LZCNT [BZ #23456] cf6deb084b conform/conformtest.pl: Escape literal braces in regular expressions b12bed3e06 stdio-common/tst-printf.c: Remove part under a non-free license [BZ #23363] 20dc7a909a libio: Add tst-vtables, tst-vtables-interposed 4b10e69b1f Synchronize support/ infrastructure with master 762e9d63d5 NEWS: Reorder out-of-order bugs 2781bd5a86 libio: Disable vtable validation in case of interposition [BZ #23313] 74d16a57a3 Check length of ifname before copying it into to ifreq structure. 3aaf8bda00 getifaddrs: Don't return ifa entries with NULL names [BZ #21812] f958b45d52 Use _STRUCT_TIMESPEC as guard in [BZ #23349] 81b994bd83 Fix parameter type in C++ version of iseqsig (bug 23171) 7b52c8ae05 libio: Avoid _allocate_buffer, _free_buffer function pointers [BZ #23236] 4df8479e6b Add NEWS entry for CVE-2018-11236 a5bc5ec967 Add references to CVE-2018-11236, CVE-2017-18269 58ad5f8a64 Add a test case for [BZ #23196] 6b4362f2cb Don't write beyond destination in __mempcpy_avx512_no_vzeroupper (bug 23196) Signed-off-by: Hans Dedecker --- toolchain/glibc/common.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 2de9596dcf3..a741bf84b29 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -11,8 +11,8 @@ PKG_VERSION:=2.26 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=af7519f7b35024224c163e32a89fb247b0c446fc -PKG_MIRROR_HASH:=7f4d0b9d55b5820b9e2feefed03206086b3d1ddef5f02358e587948f5bb9c516 +PKG_SOURCE_VERSION:=c5c90b480e4f21ed1d28e0e6d942b06b8d9e8bd7 +PKG_MIRROR_HASH:=f8e81f714fb5df5b142c0004d69aba87fc73235cffb86b1b1837e993e910bc13 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz From 4f6ad3c13ace1d341179ad82f417aa0ce5adf51d Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Fri, 14 Sep 2018 21:52:39 +0100 Subject: [PATCH 011/399] iproute2: q_cake: Also print nonat, nowash and no-ack-filter keywords Pull in latest upstream tweaks: Similar to the previous patch for no-split-gso, the negative keywords for 'nat', 'wash' and 'ack-filter' were not printed either. Add those as well. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 033f02b9b5580e67e2f1b623f62da60d645e7ba2) --- package/network/utils/iproute2/Makefile | 2 +- .../utils/iproute2/patches/950-add-cake-to-tc.patch | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 91092b2f517..2c13e276fbe 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 PKG_VERSION:=4.16.0 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 038ca233376..1eebb729c3c 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -854,7 +854,7 @@ TCMODULES += e_bpf.o --- /dev/null +++ b/tc/q_cake.c -@@ -0,0 +1,801 @@ +@@ -0,0 +1,805 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause + +/* @@ -1325,6 +1325,8 @@ + + if (nat) + print_string(PRINT_FP, NULL, "nat ", NULL); ++ else ++ print_string(PRINT_FP, NULL, "nonat ", NULL); + print_bool(PRINT_JSON, "nat", NULL, nat); + + if (tb[TCA_CAKE_WASH] && @@ -1365,6 +1367,8 @@ + + if (wash) + print_string(PRINT_FP, NULL, "wash ", NULL); ++ else ++ print_string(PRINT_FP, NULL, "nowash ", NULL); + print_bool(PRINT_JSON, "wash", NULL, wash); + + if (ingress) @@ -1377,7 +1381,7 @@ + else if (ack_filter == CAKE_ACK_FILTER) + print_string(PRINT_ANY, "ack-filter", "ack-filter ", "enabled"); + else -+ print_string(PRINT_JSON, "ack-filter", NULL, "disabled"); ++ print_string(PRINT_ANY, "ack-filter", "no-ack-filter ", "disabled"); + + if (split_gso) + print_string(PRINT_FP, NULL, "split-gso ", NULL); From b4f672c1f986c279853353868ff4bcb5f673ff0e Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Sun, 16 Sep 2018 17:28:53 +0200 Subject: [PATCH 012/399] kernel: bump 4.9 to 4.9.127 for 18.06 Refreshes patches and bumps 4.9 kernel to 4.9.127 for OpenWrt 18.06. Compile-tested on ar71xx. Signed-off-by: Stijn Segers --- include/kernel-version.mk | 4 ++-- .../090-net-generalize-napi_complete_done.patch | 2 +- .../linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch | 4 ++-- .../patches-4.9/804-crypto-support-layerscape.patch | 6 +++--- .../patches-4.9/810-iommu-support-layerscape.patch | 10 +++++----- .../patches-4.9/815-spi-support-layerscape.patch | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index c6108bead82..50aed02c4a5 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .125 +LINUX_VERSION-4.9 = .127 LINUX_VERSION-4.14 = .68 -LINUX_KERNEL_HASH-4.9.125 = a764deef61bebfac1d07b2ed6890f93a12a9ab6d3fc3c53e3d850ed4681111cb +LINUX_KERNEL_HASH-4.9.127 = 9477aeaded97589a40d7cbbfeebfa7a8f863130c0729a8dc5cdbcf48eb6fdd0f LINUX_KERNEL_HASH-4.14.68 = 791dbf1597033bf2b61e83307d78188ffc1ad4bdd1da3234876667edfdd28690 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 3268b3407ac..0e8e0660db5 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -1040,7 +1040,7 @@ Signed-off-by: David S. Miller writel(irq->mask, adpt->base + EMAC_INT_MASK); --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c -@@ -7577,7 +7577,7 @@ static int rtl8169_poll(struct napi_stru +@@ -7578,7 +7578,7 @@ static int rtl8169_poll(struct napi_stru } if (work_done < budget) { diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch index c510e42bb6d..8a6495b2221 100644 --- a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -18,7 +18,7 @@ uart->capabilities = up->capabilities; --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -2233,6 +2233,7 @@ uart_report_port(struct uart_driver *drv +@@ -2240,6 +2240,7 @@ uart_report_port(struct uart_driver *drv snprintf(address, sizeof(address), "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); break; @@ -26,7 +26,7 @@ case UPIO_MEM: case UPIO_MEM16: case UPIO_MEM32: -@@ -2897,6 +2898,7 @@ int uart_match_port(struct uart_port *po +@@ -2904,6 +2905,7 @@ int uart_match_port(struct uart_port *po case UPIO_HUB6: return (port1->iobase == port2->iobase) && (port1->hub6 == port2->hub6); diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index 2598cdedbb2..a143ad566b2 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -26382,7 +26382,7 @@ Signed-off-by: Yangbo Lu return ret; } -@@ -280,6 +291,36 @@ struct device *caam_jr_alloc(void) +@@ -281,6 +292,36 @@ struct device *caam_jr_alloc(void) EXPORT_SYMBOL(caam_jr_alloc); /** @@ -26419,7 +26419,7 @@ Signed-off-by: Yangbo Lu * caam_jr_free() - Free the Job Ring * @rdev - points to the dev that identifies the Job ring to * be released. -@@ -496,15 +537,28 @@ static int caam_jr_probe(struct platform +@@ -497,15 +538,28 @@ static int caam_jr_probe(struct platform return -ENOMEM; } @@ -26455,7 +26455,7 @@ Signed-off-by: Yangbo Lu /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); -@@ -524,10 +578,12 @@ static int caam_jr_probe(struct platform +@@ -525,10 +579,12 @@ static int caam_jr_probe(struct platform atomic_set(&jrpriv->tfm_count, 0); diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 050092905c7..816abbb9e78 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -987,7 +987,7 @@ Signed-off-by: Yangbo Lu } --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c -@@ -440,6 +440,7 @@ struct dmar_rmrr_unit { +@@ -441,6 +441,7 @@ struct dmar_rmrr_unit { u64 end_address; /* reserved end address */ struct dmar_dev_scope *devices; /* target devices */ int devices_cnt; /* target device count */ @@ -995,7 +995,7 @@ Signed-off-by: Yangbo Lu }; struct dmar_atsr_unit { -@@ -4251,27 +4252,40 @@ static inline void init_iommu_pm_ops(voi +@@ -4267,27 +4268,40 @@ static inline void init_iommu_pm_ops(voi int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) { struct acpi_dmar_reserved_memory *rmrr; @@ -1041,7 +1041,7 @@ Signed-off-by: Yangbo Lu } static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr) -@@ -4485,6 +4499,7 @@ static void intel_iommu_free_dmars(void) +@@ -4501,6 +4515,7 @@ static void intel_iommu_free_dmars(void) list_for_each_entry_safe(rmrru, rmrr_n, &dmar_rmrr_units, list) { list_del(&rmrru->list); dmar_free_dev_scope(&rmrru->devices, &rmrru->devices_cnt); @@ -1049,7 +1049,7 @@ Signed-off-by: Yangbo Lu kfree(rmrru); } -@@ -5220,6 +5235,45 @@ static void intel_iommu_remove_device(st +@@ -5236,6 +5251,45 @@ static void intel_iommu_remove_device(st iommu_device_unlink(iommu->iommu_dev, dev); } @@ -1095,7 +1095,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_INTEL_IOMMU_SVM #define MAX_NR_PASID_BITS (20) static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu) -@@ -5350,19 +5404,21 @@ struct intel_iommu *intel_svm_device_to_ +@@ -5366,19 +5420,21 @@ struct intel_iommu *intel_svm_device_to_ #endif /* CONFIG_INTEL_IOMMU_SVM */ static const struct iommu_ops intel_iommu_ops = { diff --git a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch index 22904eec9d5..b798a366b0f 100644 --- a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch @@ -402,10 +402,10 @@ Signed-off-by: Yangbo Lu + goto out_master_put; } - dspi_init(dspi); + dspi->clk = devm_clk_get(&pdev->dev, "dspi"); @@ -740,6 +1031,13 @@ static int dspi_probe(struct platform_de - if (ret) - goto out_master_put; + goto out_clk_put; + } + if (dspi->devtype_data->trans_mode == DSPI_DMA_MODE) { + if (dspi_request_dma(dspi, res->start)) { From de76cefd865c2f39bb611f6403bb8e86a23aae18 Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Sun, 16 Sep 2018 17:28:54 +0200 Subject: [PATCH 013/399] kernel: bump 4.14 to 4.14.70 for 18.06 Refreshes patches and bumps 4.14 kernel to 4.14.70 for OpenWrt 18.06. Compile-tested on ramips/mt7621, x86/64, imx6. Run-tested on ramips/mt7621, x86/64, imx6. Signed-off-by: Stijn Segers [added ubifs fix + tested on imx6] Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...conntrack-add-IPS_OFFLOAD-status-bit.patch | 6 +- ...attr-Don-t-operate-on-deleted-inodes.patch | 96 +++++++++++++++++++ ...erial-add-ugly-custom-baud-rate-hack.patch | 2 +- 4 files changed, 102 insertions(+), 6 deletions(-) create mode 100644 target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 50aed02c4a5..4c35b124a46 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .127 -LINUX_VERSION-4.14 = .68 +LINUX_VERSION-4.14 = .70 LINUX_KERNEL_HASH-4.9.127 = 9477aeaded97589a40d7cbbfeebfa7a8f863130c0729a8dc5cdbcf48eb6fdd0f -LINUX_KERNEL_HASH-4.14.68 = 791dbf1597033bf2b61e83307d78188ffc1ad4bdd1da3234876667edfdd28690 +LINUX_KERNEL_HASH-4.14.70 = c5dfd832477f8856b5b094ab62cc8c8491d04b76b2ec5ebb0126e554891ee32c remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch b/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch index 9d6ce980800..5aae823ed7f 100644 --- a/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch +++ b/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch @@ -90,7 +90,7 @@ Signed-off-by: Pablo Neira Ayuso expired_count++; --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c -@@ -1105,6 +1105,14 @@ static const struct nla_policy ct_nla_po +@@ -1120,6 +1120,14 @@ static const struct nla_policy ct_nla_po .len = NF_CT_LABELS_MAX_SIZE }, }; @@ -105,7 +105,7 @@ Signed-off-by: Pablo Neira Ayuso static int ctnetlink_flush_conntrack(struct net *net, const struct nlattr * const cda[], u32 portid, int report) -@@ -1117,7 +1125,7 @@ static int ctnetlink_flush_conntrack(str +@@ -1132,7 +1140,7 @@ static int ctnetlink_flush_conntrack(str return PTR_ERR(filter); } @@ -114,7 +114,7 @@ Signed-off-by: Pablo Neira Ayuso portid, report); kfree(filter); -@@ -1163,6 +1171,11 @@ static int ctnetlink_del_conntrack(struc +@@ -1178,6 +1186,11 @@ static int ctnetlink_del_conntrack(struc ct = nf_ct_tuplehash_to_ctrack(h); diff --git a/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch b/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch new file mode 100644 index 00000000000..cd9a758e373 --- /dev/null +++ b/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch @@ -0,0 +1,96 @@ +From a99708737f566c70651015332e89d0d3b1eb5529 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Mon, 17 Sep 2018 10:13:09 +0200 +Subject: [PATCH] Revert "ubifs: xattr: Don't operate on deleted inodes" + +This reverts commit 8a23348d76a1e7716da6e76383281ac82fc071cf. + +UBIFS wants to assert that xattr operations are only issued on files +with positive link count. The said patch made this operations return +-ENOENT for unlinked files such that the asserts will no longer trigger. +This was wrong since xattr operations are perfectly fine on unlinked +files. +Instead the assertions need to be fixed/removed. + +Fixes: 11a6fc3dc743 ("ubifs: xattr: Don't operate on deleted inodes") +Reported-by: Koen Vandeputte +Signed-off-by: Richard Weinberger +--- + fs/ubifs/xattr.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +--- a/fs/ubifs/xattr.c ++++ b/fs/ubifs/xattr.c +@@ -152,12 +152,6 @@ static int create_xattr(struct ubifs_inf + ui->data_len = size; + + mutex_lock(&host_ui->ui_mutex); +- +- if (!host->i_nlink) { +- err = -ENOENT; +- goto out_noent; +- } +- + host->i_ctime = current_time(host); + host_ui->xattr_cnt += 1; + host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); +@@ -189,7 +183,6 @@ out_cancel: + host_ui->xattr_size -= CALC_XATTR_BYTES(size); + host_ui->xattr_names -= fname_len(nm); + host_ui->flags &= ~UBIFS_CRYPT_FL; +-out_noent: + mutex_unlock(&host_ui->ui_mutex); + out_free: + make_bad_inode(inode); +@@ -241,12 +234,6 @@ static int change_xattr(struct ubifs_inf + mutex_unlock(&ui->ui_mutex); + + mutex_lock(&host_ui->ui_mutex); +- +- if (!host->i_nlink) { +- err = -ENOENT; +- goto out_noent; +- } +- + host->i_ctime = current_time(host); + host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); + host_ui->xattr_size += CALC_XATTR_BYTES(size); +@@ -268,7 +255,6 @@ static int change_xattr(struct ubifs_inf + out_cancel: + host_ui->xattr_size -= CALC_XATTR_BYTES(size); + host_ui->xattr_size += CALC_XATTR_BYTES(old_size); +-out_noent: + mutex_unlock(&host_ui->ui_mutex); + make_bad_inode(inode); + out_free: +@@ -497,12 +483,6 @@ static int remove_xattr(struct ubifs_inf + return err; + + mutex_lock(&host_ui->ui_mutex); +- +- if (!host->i_nlink) { +- err = -ENOENT; +- goto out_noent; +- } +- + host->i_ctime = current_time(host); + host_ui->xattr_cnt -= 1; + host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); +@@ -522,7 +502,6 @@ out_cancel: + host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); + host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); + host_ui->xattr_names += fname_len(nm); +-out_noent: + mutex_unlock(&host_ui->ui_mutex); + ubifs_release_budget(c, &req); + make_bad_inode(inode); +@@ -562,9 +541,6 @@ static int ubifs_xattr_remove(struct ino + + ubifs_assert(inode_is_locked(host)); + +- if (!host->i_nlink) +- return -ENOENT; +- + if (fname_len(&nm) > UBIFS_MAX_NLEN) + return -ENAMETOOLONG; + diff --git a/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch b/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch index b71d8f38e01..634033d18d3 100644 --- a/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch +++ b/target/linux/ramips/patches-4.14/0051-serial-add-ugly-custom-baud-rate-hack.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c -@@ -411,6 +411,9 @@ uart_get_baud_rate(struct uart_port *por +@@ -418,6 +418,9 @@ uart_get_baud_rate(struct uart_port *por break; } From 7347ea7453aed1f5e6bf222761e3e5bd6b5d13e7 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 15 Sep 2018 19:16:52 +0200 Subject: [PATCH 014/399] uqmi: pass-through ipXtable to child interfaces Allow setting specific routing tables via the ip4table and ip6table options also when ${ifname}_4 and ${ifname}_6 child interfaces are being created. Signed-off-by: Daniel Golle (cherry picked from commit e51aa699f7ca3ce83a0add622c0fd17d0caafc46) --- package/network/utils/uqmi/Makefile | 2 +- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 21b3c7eba69..640cbe4e1bb 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uqmi -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 05055b14842..c60cae653a4 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -29,9 +29,10 @@ proto_qmi_setup() { local interface="$1" local dataformat connstat local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS + local ip4table ip6table local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 - json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS + json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn ip4table ip6table $PROTO_DEFAULT_OPTIONS [ "$metric" = "" ] && metric="0" @@ -252,6 +253,7 @@ proto_qmi_setup() { json_add_string name "${interface}_6" json_add_string ifname "@$interface" json_add_string proto "dhcpv6" + [ -n "$ip6table" ] && json_add_string ip6table "$ip6table" proto_add_dynamic_defaults # RFC 7278: Extend an IPv6 /64 Prefix to LAN json_add_string extendprefix 1 @@ -265,6 +267,7 @@ proto_qmi_setup() { json_add_string name "${interface}_4" json_add_string ifname "@$interface" json_add_string proto "dhcp" + [ -n "$ip4table" ] && json_add_string ip4table "$ip4table" proto_add_dynamic_defaults json_close_object ubus call network add_dynamic "$(json_dump)" From f506de2cdaf92a5716298cf9d63cc686a1097a29 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 20 Sep 2018 10:06:49 +0200 Subject: [PATCH 015/399] ath9k: fix unloading the module Registering a GPIO chip with the ath9k device as parent prevents unload, because the gpiochip core increases the module use count. Unfortunately, the only way to avoid this at the moment seems to be to register the GPIO chip without a parent device Signed-off-by: Felix Fietkau --- .../patches/548-ath9k_enable_gpio_chip.patch | 17 ++++++----------- .../patches/549-ath9k_enable_gpio_buttons.patch | 8 ++++---- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch index 31dac29ad77..0b76d330c60 100644 --- a/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch +++ b/package/kernel/mac80211/patches/548-ath9k_enable_gpio_chip.patch @@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau #ifdef CPTCFG_ATH9K_DEBUGFS --- a/drivers/net/wireless/ath/ath9k/gpio.c +++ b/drivers/net/wireless/ath/ath9k/gpio.c -@@ -16,13 +16,135 @@ +@@ -16,13 +16,130 @@ #include "ath9k.h" #include @@ -126,11 +126,7 @@ Signed-off-by: Felix Fietkau + gc->sc = sc; + snprintf(gc->label, sizeof(gc->label), "ath9k-%s", + wiphy_name(sc->hw->wiphy)); -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0) -+ gc->gchip.parent = sc->dev; -+#else -+ gc->gchip.dev = sc->dev; -+#endif ++ + gc->gchip.label = gc->label; + gc->gchip.base = -1; /* determine base automatically */ + gc->gchip.ngpio = ah->caps.num_gpio_pins; @@ -145,7 +141,6 @@ Signed-off-by: Felix Fietkau + return; + } + -+ gc->gchip.owner = NULL; + sc->gpiochip = gc; +} + @@ -183,7 +178,7 @@ Signed-off-by: Felix Fietkau static void ath_fill_led_pin(struct ath_softc *sc) { struct ath_hw *ah = sc->sc_ah; -@@ -80,6 +202,12 @@ static int ath_add_led(struct ath_softc +@@ -80,6 +197,12 @@ static int ath_add_led(struct ath_softc else ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low); @@ -196,7 +191,7 @@ Signed-off-by: Felix Fietkau return 0; } -@@ -136,17 +264,24 @@ void ath_deinit_leds(struct ath_softc *s +@@ -136,17 +259,24 @@ void ath_deinit_leds(struct ath_softc *s while (!list_empty(&sc->leds)) { led = list_first_entry(&sc->leds, struct ath_led, list); @@ -221,7 +216,7 @@ Signed-off-by: Felix Fietkau char led_name[32]; const char *trigger; int i; -@@ -156,6 +291,15 @@ void ath_init_leds(struct ath_softc *sc) +@@ -156,6 +286,15 @@ void ath_init_leds(struct ath_softc *sc) if (AR_SREV_9100(sc->sc_ah)) return; @@ -237,7 +232,7 @@ Signed-off-by: Felix Fietkau ath_fill_led_pin(sc); if (pdata && pdata->leds && pdata->num_leds) -@@ -180,6 +324,7 @@ void ath_init_leds(struct ath_softc *sc) +@@ -180,6 +319,7 @@ void ath_init_leds(struct ath_softc *sc) ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); } diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch index e86e3e38bd6..e7282ab6b14 100644 --- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau #ifdef CPTCFG_MAC80211_LEDS -@@ -129,6 +131,67 @@ static void ath9k_unregister_gpio_chip(s +@@ -124,6 +126,67 @@ static void ath9k_unregister_gpio_chip(s sc->gpiochip = NULL; } @@ -97,7 +97,7 @@ Signed-off-by: Felix Fietkau #else /* CONFIG_GPIOLIB */ static inline void ath9k_register_gpio_chip(struct ath_softc *sc) -@@ -139,6 +202,14 @@ static inline void ath9k_unregister_gpio +@@ -134,6 +197,14 @@ static inline void ath9k_unregister_gpio { } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau #endif /* CONFIG_GPIOLIB */ /********************************/ -@@ -262,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s +@@ -257,6 +328,7 @@ void ath_deinit_leds(struct ath_softc *s { struct ath_led *led; @@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau while (!list_empty(&sc->leds)) { led = list_first_entry(&sc->leds, struct ath_led, list); #ifdef CONFIG_GPIOLIB -@@ -301,6 +373,7 @@ void ath_init_leds(struct ath_softc *sc) +@@ -296,6 +368,7 @@ void ath_init_leds(struct ath_softc *sc) } ath_fill_led_pin(sc); From 0d8d63c038a3f52ee3f537f454c71becd22e6b55 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 20 Sep 2018 14:35:27 +0200 Subject: [PATCH 016/399] kernel: bump 4.9 to 4.9.128 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 4c35b124a46..c6124d2809a 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .127 LINUX_VERSION-4.14 = .70 +LINUX_VERSION-4.9 = .128 -LINUX_KERNEL_HASH-4.9.127 = 9477aeaded97589a40d7cbbfeebfa7a8f863130c0729a8dc5cdbcf48eb6fdd0f LINUX_KERNEL_HASH-4.14.70 = c5dfd832477f8856b5b094ab62cc8c8491d04b76b2ec5ebb0126e554891ee32c +LINUX_KERNEL_HASH-4.9.128 = bdb76f48491a6aadc89c0f0f7fdc240d77cee54da5aac59da0b5d98e226b6f12 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch index 9725779c3ec..b424da8d32b 100644 --- a/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.9/159-cpu_fixes.patch @@ -396,7 +396,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -955,6 +967,8 @@ static void local_r4k_flush_cache_sigtra +@@ -957,6 +969,8 @@ static void local_r4k_flush_cache_sigtra } R4600_HIT_CACHEOP_WAR_IMPL; @@ -405,7 +405,7 @@ if (!cpu_has_ic_fills_f_dc) { if (dc_lsize) vaddr ? flush_dcache_line(addr & ~(dc_lsize - 1)) -@@ -1843,6 +1857,17 @@ static void coherency_setup(void) +@@ -1845,6 +1859,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -423,7 +423,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1889,6 +1914,15 @@ void r4k_cache_init(void) +@@ -1891,6 +1916,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -439,7 +439,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1966,7 +2000,15 @@ void r4k_cache_init(void) +@@ -1968,7 +2002,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); From 492bd8ddc906cec4a4fffe14f632622c808b90a5 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 20 Sep 2018 14:35:52 +0200 Subject: [PATCH 017/399] kernel: bump 4.14 to 4.14.71 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +-- .../brcm47xx/patches-4.14/159-cpu_fixes.patch | 8 ++--- ...etfilter-flow-table-support-for-IPv6.patch | 2 +- ...ipv6-make-ip6_dst_mtu_forward-inline.patch | 2 +- .../generic/hack-4.14/721-phy_packets.patch | 4 +-- .../generic/hack-4.14/902-debloat_proc.patch | 2 +- .../pending-4.14/655-increase_skb_pad.patch | 2 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 2 +- .../300-mvneta-tx-queue-workaround.patch | 4 +-- .../403-net-mvneta-convert-to-phylink.patch | 36 +++++++++---------- ...04-net-mvneta-hack-fix-phy_interface.patch | 2 +- ...le-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch | 4 +-- ...ta-add-module-EEPROM-reading-support.patch | 4 +-- ...eeprom-ethtool-access-into-netdev-co.patch | 4 +-- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index c6124d2809a..d61e951500f 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.14 = .70 LINUX_VERSION-4.9 = .128 +LINUX_VERSION-4.14 = .71 -LINUX_KERNEL_HASH-4.14.70 = c5dfd832477f8856b5b094ab62cc8c8491d04b76b2ec5ebb0126e554891ee32c LINUX_KERNEL_HASH-4.9.128 = bdb76f48491a6aadc89c0f0f7fdc240d77cee54da5aac59da0b5d98e226b6f12 +LINUX_KERNEL_HASH-4.14.71 = 76a4473dbcbd922c23a16130414829a36eb7e2f4e5859bd1b742fffdff907489 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch index ca5530ae976..96917f82a63 100644 --- a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch @@ -396,7 +396,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -955,6 +967,8 @@ static void local_r4k_flush_cache_sigtra +@@ -957,6 +969,8 @@ static void local_r4k_flush_cache_sigtra } R4600_HIT_CACHEOP_WAR_IMPL; @@ -405,7 +405,7 @@ if (!cpu_has_ic_fills_f_dc) { if (dc_lsize) vaddr ? flush_dcache_line(addr & ~(dc_lsize - 1)) -@@ -1849,6 +1863,17 @@ static void coherency_setup(void) +@@ -1851,6 +1865,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -423,7 +423,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1895,6 +1920,15 @@ void r4k_cache_init(void) +@@ -1897,6 +1922,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -439,7 +439,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1972,7 +2006,15 @@ void r4k_cache_init(void) +@@ -1974,7 +2008,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch b/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch index 2e8cb201637..cfb13231c62 100644 --- a/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch +++ b/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch @@ -15,7 +15,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/net/ipv6.h +++ b/include/net/ipv6.h -@@ -911,6 +911,8 @@ static inline struct sk_buff *ip6_finish +@@ -889,6 +889,8 @@ static inline struct sk_buff *ip6_finish &inet6_sk(sk)->cork); } diff --git a/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch b/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch index f90f4152399..f12366f5430 100644 --- a/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch +++ b/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/net/ipv6.h +++ b/include/net/ipv6.h -@@ -911,8 +911,6 @@ static inline struct sk_buff *ip6_finish +@@ -889,8 +889,6 @@ static inline struct sk_buff *ip6_finish &inet6_sk(sk)->cork); } diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index 86ff0fe123e..3caeeaa1929 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2491,6 +2491,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2496,6 +2496,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2621,16 +2625,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2626,16 +2630,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 65789d1b8c0..46c12e0c182 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -381,7 +381,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c -@@ -557,6 +557,9 @@ static __net_initdata struct pernet_oper +@@ -558,6 +558,9 @@ static __net_initdata struct pernet_oper int __init ip_misc_proc_init(void) { diff --git a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch index 88069581a16..71c3fc790b7 100644 --- a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2455,7 +2455,7 @@ static inline int pskb_network_may_pull( +@@ -2460,7 +2460,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 9de77dfcc2b..36c0fb57aee 100644 --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -777,6 +777,7 @@ struct sk_buff { +@@ -782,6 +782,7 @@ struct sk_buff { __u8 tc_redirected:1; __u8 tc_from_ingress:1; #endif diff --git a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch index 7ff586cd15e..f21f8083ee1 100644 --- a/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-4.14/300-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3962,6 +3962,15 @@ static int mvneta_ethtool_set_wol(struct +@@ -3961,6 +3961,15 @@ static int mvneta_ethtool_set_wol(struct return ret; } @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3972,6 +3981,7 @@ static const struct net_device_ops mvnet +@@ -3971,6 +3980,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, diff --git a/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch index 3549c8997e8..ea51cc2ef05 100644 --- a/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.14/403-net-mvneta-convert-to-phylink.patch @@ -278,7 +278,7 @@ Signed-off-by: Russell King if (!pp->neta_armada3700) { for_each_online_cpu(cpu) { -@@ -3252,103 +3209,232 @@ static int mvneta_set_mac_addr(struct ne +@@ -3251,103 +3208,232 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -585,7 +585,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3627,10 +3713,9 @@ static int mvneta_stop(struct net_device +@@ -3626,10 +3712,9 @@ static int mvneta_stop(struct net_device static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -598,7 +598,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3641,44 +3726,25 @@ mvneta_ethtool_set_link_ksettings(struct +@@ -3640,44 +3725,25 @@ mvneta_ethtool_set_link_ksettings(struct const struct ethtool_link_ksettings *cmd) { struct mvneta_port *pp = netdev_priv(ndev); @@ -657,7 +657,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3770,6 +3836,22 @@ static int mvneta_ethtool_set_ringparam( +@@ -3769,6 +3835,22 @@ static int mvneta_ethtool_set_ringparam( return 0; } @@ -680,7 +680,7 @@ Signed-off-by: Russell King static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset, u8 *data) { -@@ -3786,26 +3868,35 @@ static void mvneta_ethtool_update_stats( +@@ -3785,26 +3867,35 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -721,7 +721,7 @@ Signed-off-by: Russell King } } -@@ -3940,28 +4031,65 @@ static int mvneta_ethtool_get_rxfh(struc +@@ -3939,28 +4030,65 @@ static int mvneta_ethtool_get_rxfh(struc static void mvneta_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) { @@ -795,7 +795,7 @@ Signed-off-by: Russell King static u16 mvneta_select_queue(struct net_device *dev, struct sk_buff *skb, void *accel_priv, select_queue_fallback_t fallback) -@@ -3985,13 +4113,15 @@ static const struct net_device_ops mvnet +@@ -3984,13 +4112,15 @@ static const struct net_device_ops mvnet }; static const struct ethtool_ops mvneta_eth_tool_ops = { @@ -812,7 +812,7 @@ Signed-off-by: Russell King .get_strings = mvneta_ethtool_get_strings, .get_ethtool_stats = mvneta_ethtool_get_stats, .get_sset_count = mvneta_ethtool_get_sset_count, -@@ -3999,10 +4129,12 @@ static const struct ethtool_ops mvneta_e +@@ -3998,10 +4128,12 @@ static const struct ethtool_ops mvneta_e .get_rxnfc = mvneta_ethtool_get_rxnfc, .get_rxfh = mvneta_ethtool_get_rxfh, .set_rxfh = mvneta_ethtool_set_rxfh, @@ -826,7 +826,7 @@ Signed-off-by: Russell King }; /* Initialize hw */ -@@ -4147,14 +4279,13 @@ static int mvneta_probe(struct platform_ +@@ -4146,14 +4278,13 @@ static int mvneta_probe(struct platform_ { struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -842,7 +842,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -4170,31 +4301,11 @@ static int mvneta_probe(struct platform_ +@@ -4169,31 +4300,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -875,7 +875,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4205,12 +4316,7 @@ static int mvneta_probe(struct platform_ +@@ -4204,12 +4315,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -889,7 +889,7 @@ Signed-off-by: Russell King pp->rxq_def = rxq_def; -@@ -4232,7 +4338,7 @@ static int mvneta_probe(struct platform_ +@@ -4231,7 +4337,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -898,7 +898,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4358,6 +4464,14 @@ static int mvneta_probe(struct platform_ +@@ -4357,6 +4463,14 @@ static int mvneta_probe(struct platform_ /* 9676 == 9700 - 20 and rounding to 8 */ dev->max_mtu = 9676; @@ -913,7 +913,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4369,14 +4483,6 @@ static int mvneta_probe(struct platform_ +@@ -4368,14 +4482,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -928,7 +928,7 @@ Signed-off-by: Russell King return 0; err_netdev: -@@ -4387,16 +4493,14 @@ err_netdev: +@@ -4386,16 +4492,14 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -947,7 +947,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4408,7 +4512,6 @@ err_free_netdev: +@@ -4407,7 +4511,6 @@ err_free_netdev: static int mvneta_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); @@ -955,7 +955,7 @@ Signed-off-by: Russell King struct mvneta_port *pp = netdev_priv(dev); unregister_netdev(dev); -@@ -4416,10 +4519,8 @@ static int mvneta_remove(struct platform +@@ -4415,10 +4518,8 @@ static int mvneta_remove(struct platform clk_disable_unprepare(pp->clk); free_percpu(pp->ports); free_percpu(pp->stats); @@ -967,7 +967,7 @@ Signed-off-by: Russell King free_netdev(dev); if (pp->bm_priv) { -@@ -4471,9 +4572,6 @@ static int mvneta_resume(struct device * +@@ -4470,9 +4571,6 @@ static int mvneta_resume(struct device * return err; } diff --git a/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch index 88ea6973e13..906c163ac9b 100644 --- a/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch +++ b/target/linux/mvebu/patches-4.14/404-net-mvneta-hack-fix-phy_interface.patch @@ -18,7 +18,7 @@ Signed-off-by: Russell King struct device_node *dn; unsigned int tx_csum_limit; struct phylink *phylink; -@@ -4316,6 +4317,7 @@ static int mvneta_probe(struct platform_ +@@ -4315,6 +4316,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); diff --git a/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch index 6f9c4dd5964..7d02b0a93b6 100644 --- a/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch +++ b/target/linux/mvebu/patches-4.14/405-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch @@ -34,7 +34,7 @@ Signed-off-by: Russell King phylink_start(pp->phylink); netif_tx_start_all_queues(pp->dev); -@@ -3543,8 +3541,7 @@ static int mvneta_cpu_online(unsigned in +@@ -3542,8 +3540,7 @@ static int mvneta_cpu_online(unsigned in on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -44,7 +44,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); spin_unlock(&pp->lock); return 0; -@@ -3585,8 +3582,7 @@ static int mvneta_cpu_dead(unsigned int +@@ -3584,8 +3581,7 @@ static int mvneta_cpu_dead(unsigned int on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | diff --git a/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch index f359eb3d78e..39eb33ac2c1 100644 --- a/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch +++ b/target/linux/mvebu/patches-4.14/406-net-mvneta-add-module-EEPROM-reading-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4046,6 +4046,22 @@ static int mvneta_ethtool_set_wol(struct +@@ -4045,6 +4045,22 @@ static int mvneta_ethtool_set_wol(struct return ret; } @@ -33,7 +33,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4130,6 +4146,8 @@ static const struct ethtool_ops mvneta_e +@@ -4129,6 +4145,8 @@ static const struct ethtool_ops mvneta_e .set_link_ksettings = mvneta_ethtool_set_link_ksettings, .get_wol = mvneta_ethtool_get_wol, .set_wol = mvneta_ethtool_set_wol, diff --git a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch index 51b6a62ce46..9b8107cee82 100644 --- a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch +++ b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch @@ -15,7 +15,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -4046,22 +4046,6 @@ static int mvneta_ethtool_set_wol(struct +@@ -4045,22 +4045,6 @@ static int mvneta_ethtool_set_wol(struct return ret; } @@ -38,7 +38,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4146,8 +4130,6 @@ static const struct ethtool_ops mvneta_e +@@ -4145,8 +4129,6 @@ static const struct ethtool_ops mvneta_e .set_link_ksettings = mvneta_ethtool_set_link_ksettings, .get_wol = mvneta_ethtool_get_wol, .set_wol = mvneta_ethtool_set_wol, From 8a006c24809cf2e2a368fdd13d42c55c56b9772b Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 21 Sep 2018 13:48:53 +0200 Subject: [PATCH 018/399] mac80211: backport upstream fixes Backport most significant upstream fixes (excl. hwsim fixes) Refreshed all patches. Contains important fixes for CSA (Channel Switch Announcement) and A-MSDU frames. [slightly altered to apply cleanly] Signed-off-by: Koen Vandeputte --- ...00-use-TXOP_BACKOFF-for-probe-frames.patch | 3 - ...-teardown-code-before-de-registering.patch | 38 +++++++ ...x-HWMP-sequence-numbering-to-follow-.patch | 28 +++++ ...ernel-panic-when-building-AMSDU-from.patch | 102 ++++++++++++++++++ ..._update_ft_ies-to-validate-NL80211_A.patch | 27 +++++ ...convert-to-A-MSDU-if-frag-subframe-l.patch | 37 +++++++ ...ys-account-for-A-MSDU-header-changes.patch | 51 +++++++++ ...off-by-one-issue-in-A-MSDU-max_subfr.patch | 26 +++++ ...ype-issue-in-ieee80211_chandef_to_op.patch | 33 ++++++ ...a-race-between-restart-and-CSA-flows.patch | 86 +++++++++++++++ ...tion-bandwidth-setting-after-channel.patch | 96 +++++++++++++++++ ...x-a-deauth-frame-if-the-AP-forbade-T.patch | 78 ++++++++++++++ ...0211-shorten-the-IBSS-debug-messages.patch | 74 +++++++++++++ .../522-mac80211_configure_antenna_gain.patch | 2 +- .../602-rt2x00-introduce-rt2x00eeprom.patch | 2 +- ...rolling-support-for-various-chipsets.patch | 74 +++++-------- 16 files changed, 702 insertions(+), 55 deletions(-) create mode 100644 package/kernel/mac80211/patches/382-mac80211-Run-TXQ-teardown-code-before-de-registering.patch create mode 100644 package/kernel/mac80211/patches/383-mac80211-mesh-fix-HWMP-sequence-numbering-to-follow-.patch create mode 100644 package/kernel/mac80211/patches/384-mac80211-avoid-kernel-panic-when-building-AMSDU-from.patch create mode 100644 package/kernel/mac80211/patches/385-cfg80211-nl80211_update_ft_ies-to-validate-NL80211_A.patch create mode 100644 package/kernel/mac80211/patches/386-mac80211-do-not-convert-to-A-MSDU-if-frag-subframe-l.patch create mode 100644 package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch create mode 100644 package/kernel/mac80211/patches/388-mac80211-fix-an-off-by-one-issue-in-A-MSDU-max_subfr.patch create mode 100644 package/kernel/mac80211/patches/389-cfg80211-fix-a-type-issue-in-ieee80211_chandef_to_op.patch create mode 100644 package/kernel/mac80211/patches/390-mac80211-fix-a-race-between-restart-and-CSA-flows.patch create mode 100644 package/kernel/mac80211/patches/391-mac80211-Fix-station-bandwidth-setting-after-channel.patch create mode 100644 package/kernel/mac80211/patches/392-mac80211-don-t-Tx-a-deauth-frame-if-the-AP-forbade-T.patch create mode 100644 package/kernel/mac80211/patches/393-mac80211-shorten-the-IBSS-debug-messages.patch diff --git a/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch b/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch index 82a7cb6f466..57b4a727eba 100644 --- a/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch +++ b/package/kernel/mac80211/patches/090-Revert-rt2800-use-TXOP_BACKOFF-for-probe-frames.patch @@ -38,6 +38,3 @@ Signed-off-by: Kalle Valo txdesc->u.ht.txop = TXOP_BACKOFF; else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)) txdesc->u.ht.txop = TXOP_SIFS; --- -2.17.1 - diff --git a/package/kernel/mac80211/patches/382-mac80211-Run-TXQ-teardown-code-before-de-registering.patch b/package/kernel/mac80211/patches/382-mac80211-Run-TXQ-teardown-code-before-de-registering.patch new file mode 100644 index 00000000000..ad282f98925 --- /dev/null +++ b/package/kernel/mac80211/patches/382-mac80211-Run-TXQ-teardown-code-before-de-registering.patch @@ -0,0 +1,38 @@ +From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= +Date: Mon, 13 Aug 2018 14:16:25 +0200 +Subject: [PATCH] mac80211: Run TXQ teardown code before de-registering + interfaces +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The TXQ teardown code can reference the vif data structures that are +stored in the netdev private memory area if there are still packets on +the queue when it is being freed. Since the TXQ teardown code is run +after the netdevs are freed, this can lead to a use-after-free. Fix this +by moving the TXQ teardown code to earlier in ieee80211_unregister_hw(). + +Reported-by: Ben Greear +Tested-by: Ben Greear +Signed-off-by: Toke Høiland-Jørgensen +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -1172,6 +1172,7 @@ void ieee80211_unregister_hw(struct ieee + #if IS_ENABLED(__disabled__CONFIG_IPV6) + unregister_inet6addr_notifier(&local->ifa6_notifier); + #endif ++ ieee80211_txq_teardown_flows(local); + + rtnl_lock(); + +@@ -1200,7 +1201,6 @@ void ieee80211_unregister_hw(struct ieee + skb_queue_purge(&local->skb_queue); + skb_queue_purge(&local->skb_queue_unreliable); + skb_queue_purge(&local->skb_queue_tdls_chsw); +- ieee80211_txq_teardown_flows(local); + + destroy_workqueue(local->workqueue); + wiphy_unregister(local->hw.wiphy); diff --git a/package/kernel/mac80211/patches/383-mac80211-mesh-fix-HWMP-sequence-numbering-to-follow-.patch b/package/kernel/mac80211/patches/383-mac80211-mesh-fix-HWMP-sequence-numbering-to-follow-.patch new file mode 100644 index 00000000000..e7b279af55e --- /dev/null +++ b/package/kernel/mac80211/patches/383-mac80211-mesh-fix-HWMP-sequence-numbering-to-follow-.patch @@ -0,0 +1,28 @@ +From: Yuan-Chi Pang +Date: Wed, 29 Aug 2018 09:30:08 +0800 +Subject: [PATCH] mac80211: mesh: fix HWMP sequence numbering to follow + standard + +IEEE 802.11-2016 14.10.8.3 HWMP sequence numbering says: +If it is a target mesh STA, it shall update its own HWMP SN to +maximum (current HWMP SN, target HWMP SN in the PREQ element) + 1 +immediately before it generates a PREP element in response to a +PREQ element. + +Signed-off-by: Yuan-Chi Pang +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/mesh_hwmp.c ++++ b/net/mac80211/mesh_hwmp.c +@@ -572,6 +572,10 @@ static void hwmp_preq_frame_process(stru + forward = false; + reply = true; + target_metric = 0; ++ ++ if (SN_GT(target_sn, ifmsh->sn)) ++ ifmsh->sn = target_sn; ++ + if (time_after(jiffies, ifmsh->last_sn_update + + net_traversal_jiffies(sdata)) || + time_before(jiffies, ifmsh->last_sn_update)) { diff --git a/package/kernel/mac80211/patches/384-mac80211-avoid-kernel-panic-when-building-AMSDU-from.patch b/package/kernel/mac80211/patches/384-mac80211-avoid-kernel-panic-when-building-AMSDU-from.patch new file mode 100644 index 00000000000..66993839eef --- /dev/null +++ b/package/kernel/mac80211/patches/384-mac80211-avoid-kernel-panic-when-building-AMSDU-from.patch @@ -0,0 +1,102 @@ +From: Sara Sharon +Date: Wed, 29 Aug 2018 08:57:02 +0200 +Subject: [PATCH] mac80211: avoid kernel panic when building AMSDU from + non-linear SKB + +When building building AMSDU from non-linear SKB, we hit a +kernel panic when trying to push the padding to the tail. +Instead, put the padding at the head of the next subframe. +This also fixes the A-MSDU subframes to not have the padding +accounted in the length field and not have pad at all for +the last subframe, both required by the spec. + +Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") +Signed-off-by: Sara Sharon +Reviewed-by: Lorenzo Bianconi +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3064,27 +3064,18 @@ void ieee80211_clear_fast_xmit(struct st + } + + static bool ieee80211_amsdu_realloc_pad(struct ieee80211_local *local, +- struct sk_buff *skb, int headroom, +- int *subframe_len) ++ struct sk_buff *skb, int headroom) + { +- int amsdu_len = *subframe_len + sizeof(struct ethhdr); +- int padding = (4 - amsdu_len) & 3; +- +- if (skb_headroom(skb) < headroom || skb_tailroom(skb) < padding) { ++ if (skb_headroom(skb) < headroom) { + I802_DEBUG_INC(local->tx_expand_skb_head); + +- if (pskb_expand_head(skb, headroom, padding, GFP_ATOMIC)) { ++ if (pskb_expand_head(skb, headroom, 0, GFP_ATOMIC)) { + wiphy_debug(local->hw.wiphy, + "failed to reallocate TX buffer\n"); + return false; + } + } + +- if (padding) { +- *subframe_len += padding; +- skb_put_zero(skb, padding); +- } +- + return true; + } + +@@ -3108,8 +3099,7 @@ static bool ieee80211_amsdu_prepare_head + if (info->control.flags & IEEE80211_TX_CTRL_AMSDU) + return true; + +- if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr), +- &subframe_len)) ++ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(*amsdu_hdr))) + return false; + + data = skb_push(skb, sizeof(*amsdu_hdr)); +@@ -3176,7 +3166,8 @@ static bool ieee80211_amsdu_aggregate(st + void *data; + bool ret = false; + unsigned int orig_len; +- int n = 1, nfrags; ++ int n = 1, nfrags, pad = 0; ++ u16 hdrlen; + + if (!ieee80211_hw_check(&local->hw, TX_AMSDU)) + return false; +@@ -3228,8 +3219,19 @@ static bool ieee80211_amsdu_aggregate(st + if (max_frags && nfrags > max_frags) + goto out; + +- if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + 2, +- &subframe_len)) ++ /* ++ * Pad out the previous subframe to a multiple of 4 by adding the ++ * padding to the next one, that's being added. Note that head->len ++ * is the length of the full A-MSDU, but that works since each time ++ * we add a new subframe we pad out the previous one to a multiple ++ * of 4 and thus it no longer matters in the next round. ++ */ ++ hdrlen = fast_tx->hdr_len - sizeof(rfc1042_header); ++ if ((head->len - hdrlen) & 3) ++ pad = 4 - ((head->len - hdrlen) & 3); ++ ++ if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + ++ 2 + pad)) + goto out; + + ret = true; +@@ -3241,6 +3243,8 @@ static bool ieee80211_amsdu_aggregate(st + memcpy(data, &len, 2); + memcpy(data + 2, rfc1042_header, sizeof(rfc1042_header)); + ++ memset(skb_push(skb, pad), 0, pad); ++ + head->len += skb->len; + head->data_len += skb->len; + *frag_tail = skb; diff --git a/package/kernel/mac80211/patches/385-cfg80211-nl80211_update_ft_ies-to-validate-NL80211_A.patch b/package/kernel/mac80211/patches/385-cfg80211-nl80211_update_ft_ies-to-validate-NL80211_A.patch new file mode 100644 index 00000000000..f4b14506a62 --- /dev/null +++ b/package/kernel/mac80211/patches/385-cfg80211-nl80211_update_ft_ies-to-validate-NL80211_A.patch @@ -0,0 +1,27 @@ +From: Arunk Khandavalli +Date: Thu, 30 Aug 2018 00:40:16 +0300 +Subject: [PATCH] cfg80211: nl80211_update_ft_ies() to validate + NL80211_ATTR_IE + +nl80211_update_ft_ies() tried to validate NL80211_ATTR_IE with +is_valid_ie_attr() before dereferencing it, but that helper function +returns true in case of NULL pointer (i.e., attribute not included). +This can result to dereferencing a NULL pointer. Fix that by explicitly +checking that NL80211_ATTR_IE is included. + +Fixes: 355199e02b83 ("cfg80211: Extend support for IEEE 802.11r Fast BSS Transition") +Signed-off-by: Arunk Khandavalli +Signed-off-by: Jouni Malinen +Signed-off-by: Johannes Berg +--- + +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -11763,6 +11763,7 @@ static int nl80211_update_ft_ies(struct + return -EOPNOTSUPP; + + if (!info->attrs[NL80211_ATTR_MDID] || ++ !info->attrs[NL80211_ATTR_IE] || + !is_valid_ie_attr(info->attrs[NL80211_ATTR_IE])) + return -EINVAL; + diff --git a/package/kernel/mac80211/patches/386-mac80211-do-not-convert-to-A-MSDU-if-frag-subframe-l.patch b/package/kernel/mac80211/patches/386-mac80211-do-not-convert-to-A-MSDU-if-frag-subframe-l.patch new file mode 100644 index 00000000000..1d889022516 --- /dev/null +++ b/package/kernel/mac80211/patches/386-mac80211-do-not-convert-to-A-MSDU-if-frag-subframe-l.patch @@ -0,0 +1,37 @@ +From: Lorenzo Bianconi +Date: Wed, 29 Aug 2018 21:03:25 +0200 +Subject: [PATCH] mac80211: do not convert to A-MSDU if frag/subframe + limited + +Do not start to aggregate packets in a A-MSDU frame (converting the +first subframe to A-MSDU, adding the header) if max_tx_fragments or +max_amsdu_subframes limits are already exceeded by it. In particular, +this happens when drivers set the limit to 1 to avoid A-MSDUs at all. + +Signed-off-by: Lorenzo Bianconi +[reword commit message to be more precise] +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3201,9 +3201,6 @@ static bool ieee80211_amsdu_aggregate(st + if (skb->len + head->len > max_amsdu_len) + goto unlock; + +- if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) +- goto out; +- + nfrags = 1 + skb_shinfo(skb)->nr_frags; + nfrags += 1 + skb_shinfo(head)->nr_frags; + frag_tail = &skb_shinfo(head)->frag_list; +@@ -3219,6 +3216,9 @@ static bool ieee80211_amsdu_aggregate(st + if (max_frags && nfrags > max_frags) + goto out; + ++ if (!ieee80211_amsdu_prepare_head(sdata, fast_tx, head)) ++ goto out; ++ + /* + * Pad out the previous subframe to a multiple of 4 by adding the + * padding to the next one, that's being added. Note that head->len diff --git a/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch b/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch new file mode 100644 index 00000000000..47942116bc8 --- /dev/null +++ b/package/kernel/mac80211/patches/387-mac80211-always-account-for-A-MSDU-header-changes.patch @@ -0,0 +1,51 @@ +From: Johannes Berg +Date: Thu, 30 Aug 2018 10:55:49 +0200 +Subject: [PATCH] mac80211: always account for A-MSDU header changes + +In the error path of changing the SKB headroom of the second +A-MSDU subframe, we would not account for the already-changed +length of the first frame that just got converted to be in +A-MSDU format and thus is a bit longer now. + +Fix this by doing the necessary accounting. + +It would be possible to reorder the operations, but that would +make the code more complex (to calculate the necessary pad), +and the headroom expansion should not fail frequently enough +to make that worthwhile. + +Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") +Signed-off-by: Johannes Berg +Acked-by: Lorenzo Bianconi +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3232,7 +3232,7 @@ static bool ieee80211_amsdu_aggregate(st + + if (!ieee80211_amsdu_realloc_pad(local, skb, sizeof(rfc1042_header) + + 2 + pad)) +- goto out; ++ goto out_recalc; + + ret = true; + data = skb_push(skb, ETH_ALEN + 2); +@@ -3249,11 +3249,13 @@ static bool ieee80211_amsdu_aggregate(st + head->data_len += skb->len; + *frag_tail = skb; + +- flow->backlog += head->len - orig_len; +- tin->backlog_bytes += head->len - orig_len; +- +- fq_recalc_backlog(fq, tin, flow); ++out_recalc: ++ if (head->len != orig_len) { ++ flow->backlog += head->len - orig_len; ++ tin->backlog_bytes += head->len - orig_len; + ++ fq_recalc_backlog(fq, tin, flow); ++ } + out: + fq->memory_usage += head->truesize - orig_truesize; + diff --git a/package/kernel/mac80211/patches/388-mac80211-fix-an-off-by-one-issue-in-A-MSDU-max_subfr.patch b/package/kernel/mac80211/patches/388-mac80211-fix-an-off-by-one-issue-in-A-MSDU-max_subfr.patch new file mode 100644 index 00000000000..455fa298311 --- /dev/null +++ b/package/kernel/mac80211/patches/388-mac80211-fix-an-off-by-one-issue-in-A-MSDU-max_subfr.patch @@ -0,0 +1,26 @@ +From: Lorenzo Bianconi +Date: Fri, 31 Aug 2018 01:04:13 +0200 +Subject: [PATCH] mac80211: fix an off-by-one issue in A-MSDU + max_subframe computation + +Initialize 'n' to 2 in order to take into account also the first +packet in the estimation of max_subframe limit for a given A-MSDU +since frag_tail pointer is NULL when ieee80211_amsdu_aggregate +routine analyzes the second frame. + +Fixes: 6e0456b54545 ("mac80211: add A-MSDU tx support") +Signed-off-by: Lorenzo Bianconi +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3166,7 +3166,7 @@ static bool ieee80211_amsdu_aggregate(st + void *data; + bool ret = false; + unsigned int orig_len; +- int n = 1, nfrags, pad = 0; ++ int n = 2, nfrags, pad = 0; + u16 hdrlen; + + if (!ieee80211_hw_check(&local->hw, TX_AMSDU)) diff --git a/package/kernel/mac80211/patches/389-cfg80211-fix-a-type-issue-in-ieee80211_chandef_to_op.patch b/package/kernel/mac80211/patches/389-cfg80211-fix-a-type-issue-in-ieee80211_chandef_to_op.patch new file mode 100644 index 00000000000..8437aad6a62 --- /dev/null +++ b/package/kernel/mac80211/patches/389-cfg80211-fix-a-type-issue-in-ieee80211_chandef_to_op.patch @@ -0,0 +1,33 @@ +From: Dan Carpenter +Date: Fri, 31 Aug 2018 11:10:55 +0300 +Subject: [PATCH] cfg80211: fix a type issue in + ieee80211_chandef_to_operating_class() + +The "chandef->center_freq1" variable is a u32 but "freq" is a u16 so we +are truncating away the high bits. I noticed this bug because in commit +9cf0a0b4b64a ("cfg80211: Add support for 60GHz band channels 5 and 6") +we made "freq <= 56160 + 2160 * 6" a valid requency when before it was +only "freq <= 56160 + 2160 * 4" that was valid. It introduces a static +checker warning: + + net/wireless/util.c:1571 ieee80211_chandef_to_operating_class() + warn: always true condition '(freq <= 56160 + 2160 * 6) => (0-u16max <= 69120)' + +But really we probably shouldn't have been truncating the high bits +away to begin with. + +Signed-off-by: Dan Carpenter +Signed-off-by: Johannes Berg +--- + +--- a/net/wireless/util.c ++++ b/net/wireless/util.c +@@ -1377,7 +1377,7 @@ bool ieee80211_chandef_to_operating_clas + u8 *op_class) + { + u8 vht_opclass; +- u16 freq = chandef->center_freq1; ++ u32 freq = chandef->center_freq1; + + if (freq >= 2412 && freq <= 2472) { + if (chandef->width > NL80211_CHAN_WIDTH_40) diff --git a/package/kernel/mac80211/patches/390-mac80211-fix-a-race-between-restart-and-CSA-flows.patch b/package/kernel/mac80211/patches/390-mac80211-fix-a-race-between-restart-and-CSA-flows.patch new file mode 100644 index 00000000000..db2aa0443f7 --- /dev/null +++ b/package/kernel/mac80211/patches/390-mac80211-fix-a-race-between-restart-and-CSA-flows.patch @@ -0,0 +1,86 @@ +From: Emmanuel Grumbach +Date: Fri, 31 Aug 2018 11:31:06 +0300 +Subject: [PATCH] mac80211: fix a race between restart and CSA flows + +We hit a problem with iwlwifi that was caused by a bug in +mac80211. A bug in iwlwifi caused the firwmare to crash in +certain cases in channel switch. Because of that bug, +drv_pre_channel_switch would fail and trigger the restart +flow. +Now we had the hw restart worker which runs on the system's +workqueue and the csa_connection_drop_work worker that runs +on mac80211's workqueue that can run together. This is +obviously problematic since the restart work wants to +reconfigure the connection, while the csa_connection_drop_work +worker does the exact opposite: it tries to disconnect. + +Fix this by cancelling the csa_connection_drop_work worker +in the restart worker. + +Note that this can sound racy: we could have: + +driver iface_work CSA_work restart_work ++++++++++++++++++++++++++++++++++++++++++++++ + | + <--drv_cs ---| + +-CS FAILED--> + | | + | cancel_work(CSA) + schedule | + CSA work | + | | + Race between those 2 + +But this is not possible because we flush the workqueue +in the restart worker before we cancel the CSA worker. +That would be bullet proof if we could guarantee that +we schedule the CSA worker only from the iface_work +which runs on the workqueue (and not on the system's +workqueue), but unfortunately we do have an instance +in which we schedule the CSA work outside the context +of the workqueue (ieee80211_chswitch_done). + +Note also that we should probably cancel other workers +like beacon_connection_loss_work and possibly others +for different types of interfaces, at the very least, +IBSS should suffer from the exact same problem, but for +now, do the minimum to fix the actual bug that was actually +experienced and reproduced. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Luca Coelho +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/main.c ++++ b/net/mac80211/main.c +@@ -255,8 +255,27 @@ static void ieee80211_restart_work(struc + + flush_work(&local->radar_detected_work); + rtnl_lock(); +- list_for_each_entry(sdata, &local->interfaces, list) ++ list_for_each_entry(sdata, &local->interfaces, list) { ++ /* ++ * XXX: there may be more work for other vif types and even ++ * for station mode: a good thing would be to run most of ++ * the iface type's dependent _stop (ieee80211_mg_stop, ++ * ieee80211_ibss_stop) etc... ++ * For now, fix only the specific bug that was seen: race ++ * between csa_connection_drop_work and us. ++ */ ++ if (sdata->vif.type == NL80211_IFTYPE_STATION) { ++ /* ++ * This worker is scheduled from the iface worker that ++ * runs on mac80211's workqueue, so we can't be ++ * scheduling this worker after the cancel right here. ++ * The exception is ieee80211_chswitch_done. ++ * Then we can have a race... ++ */ ++ cancel_work_sync(&sdata->u.mgd.csa_connection_drop_work); ++ } + flush_delayed_work(&sdata->dec_tailroom_needed_wk); ++ } + ieee80211_scan_cancel(local); + + /* make sure any new ROC will consider local->in_reconfig */ diff --git a/package/kernel/mac80211/patches/391-mac80211-Fix-station-bandwidth-setting-after-channel.patch b/package/kernel/mac80211/patches/391-mac80211-Fix-station-bandwidth-setting-after-channel.patch new file mode 100644 index 00000000000..aa8db32e72e --- /dev/null +++ b/package/kernel/mac80211/patches/391-mac80211-Fix-station-bandwidth-setting-after-channel.patch @@ -0,0 +1,96 @@ +From: Ilan Peer +Date: Fri, 31 Aug 2018 11:31:10 +0300 +Subject: [PATCH] mac80211: Fix station bandwidth setting after channel + switch + +When performing a channel switch flow for a managed interface, the +flow did not update the bandwidth of the AP station and the rate +scale algorithm. In case of a channel width downgrade, this would +result with the rate scale algorithm using a bandwidth that does not +match the interface channel configuration. + +Fix this by updating the AP station bandwidth and rate scaling algorithm +before the actual channel change in case of a bandwidth downgrade, or +after the actual channel change in case of a bandwidth upgrade. + +Signed-off-by: Ilan Peer +Signed-off-by: Luca Coelho +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -975,6 +975,10 @@ static void ieee80211_chswitch_work(stru + */ + + if (sdata->reserved_chanctx) { ++ struct ieee80211_supported_band *sband = NULL; ++ struct sta_info *mgd_sta = NULL; ++ enum ieee80211_sta_rx_bandwidth bw = IEEE80211_STA_RX_BW_20; ++ + /* + * with multi-vif csa driver may call ieee80211_csa_finish() + * many times while waiting for other interfaces to use their +@@ -983,6 +987,48 @@ static void ieee80211_chswitch_work(stru + if (sdata->reserved_ready) + goto out; + ++ if (sdata->vif.bss_conf.chandef.width != ++ sdata->csa_chandef.width) { ++ /* ++ * For managed interface, we need to also update the AP ++ * station bandwidth and align the rate scale algorithm ++ * on the bandwidth change. Here we only consider the ++ * bandwidth of the new channel definition (as channel ++ * switch flow does not have the full HT/VHT/HE ++ * information), assuming that if additional changes are ++ * required they would be done as part of the processing ++ * of the next beacon from the AP. ++ */ ++ switch (sdata->csa_chandef.width) { ++ case NL80211_CHAN_WIDTH_20_NOHT: ++ case NL80211_CHAN_WIDTH_20: ++ default: ++ bw = IEEE80211_STA_RX_BW_20; ++ break; ++ case NL80211_CHAN_WIDTH_40: ++ bw = IEEE80211_STA_RX_BW_40; ++ break; ++ case NL80211_CHAN_WIDTH_80: ++ bw = IEEE80211_STA_RX_BW_80; ++ break; ++ case NL80211_CHAN_WIDTH_80P80: ++ case NL80211_CHAN_WIDTH_160: ++ bw = IEEE80211_STA_RX_BW_160; ++ break; ++ } ++ ++ mgd_sta = sta_info_get(sdata, ifmgd->bssid); ++ sband = ++ local->hw.wiphy->bands[sdata->csa_chandef.chan->band]; ++ } ++ ++ if (sdata->vif.bss_conf.chandef.width > ++ sdata->csa_chandef.width) { ++ mgd_sta->sta.bandwidth = bw; ++ rate_control_rate_update(local, sband, mgd_sta, ++ IEEE80211_RC_BW_CHANGED); ++ } ++ + ret = ieee80211_vif_use_reserved_context(sdata); + if (ret) { + sdata_info(sdata, +@@ -993,6 +1039,13 @@ static void ieee80211_chswitch_work(stru + goto out; + } + ++ if (sdata->vif.bss_conf.chandef.width < ++ sdata->csa_chandef.width) { ++ mgd_sta->sta.bandwidth = bw; ++ rate_control_rate_update(local, sband, mgd_sta, ++ IEEE80211_RC_BW_CHANGED); ++ } ++ + goto out; + } + diff --git a/package/kernel/mac80211/patches/392-mac80211-don-t-Tx-a-deauth-frame-if-the-AP-forbade-T.patch b/package/kernel/mac80211/patches/392-mac80211-don-t-Tx-a-deauth-frame-if-the-AP-forbade-T.patch new file mode 100644 index 00000000000..74dd3d3775a --- /dev/null +++ b/package/kernel/mac80211/patches/392-mac80211-don-t-Tx-a-deauth-frame-if-the-AP-forbade-T.patch @@ -0,0 +1,78 @@ +From: Emmanuel Grumbach +Date: Fri, 31 Aug 2018 11:31:12 +0300 +Subject: [PATCH] mac80211: don't Tx a deauth frame if the AP forbade Tx + +If the driver fails to properly prepare for the channel +switch, mac80211 will disconnect. If the CSA IE had mode +set to 1, it means that the clients are not allowed to send +any Tx on the current channel, and that includes the +deauthentication frame. + +Make sure that we don't send the deauthentication frame in +this case. + +In iwlwifi, this caused a failure to flush queues since the +firmware already closed the queues after having parsed the +CSA IE. Then mac80211 would wait until the deauthentication +frame would go out (drv_flush(drop=false)) and that would +never happen. + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Luca Coelho +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/mlme.c ++++ b/net/mac80211/mlme.c +@@ -1267,6 +1267,16 @@ ieee80211_sta_process_chanswitch(struct + cbss->beacon_interval)); + return; + drop_connection: ++ /* ++ * This is just so that the disconnect flow will know that ++ * we were trying to switch channel and failed. In case the ++ * mode is 1 (we are not allowed to Tx), we will know not to ++ * send a deauthentication frame. Those two fields will be ++ * reset when the disconnection worker runs. ++ */ ++ sdata->vif.csa_active = true; ++ sdata->csa_block_tx = csa_ie.mode; ++ + ieee80211_queue_work(&local->hw, &ifmgd->csa_connection_drop_work); + mutex_unlock(&local->chanctx_mtx); + mutex_unlock(&local->mtx); +@@ -2437,6 +2447,7 @@ static void __ieee80211_disconnect(struc + struct ieee80211_local *local = sdata->local; + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; + u8 frame_buf[IEEE80211_DEAUTH_FRAME_LEN]; ++ bool tx; + + sdata_lock(sdata); + if (!ifmgd->associated) { +@@ -2444,6 +2455,8 @@ static void __ieee80211_disconnect(struc + return; + } + ++ tx = !sdata->csa_block_tx; ++ + /* AP is probably out of range (or not reachable for another reason) so + * remove the bss struct for that AP. + */ +@@ -2451,7 +2464,7 @@ static void __ieee80211_disconnect(struc + + ieee80211_set_disassoc(sdata, IEEE80211_STYPE_DEAUTH, + WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY, +- true, frame_buf); ++ tx, frame_buf); + mutex_lock(&local->mtx); + sdata->vif.csa_active = false; + ifmgd->csa_waiting_bcn = false; +@@ -2462,7 +2475,7 @@ static void __ieee80211_disconnect(struc + } + mutex_unlock(&local->mtx); + +- ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, ++ ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), tx, + WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); + + sdata_unlock(sdata); diff --git a/package/kernel/mac80211/patches/393-mac80211-shorten-the-IBSS-debug-messages.patch b/package/kernel/mac80211/patches/393-mac80211-shorten-the-IBSS-debug-messages.patch new file mode 100644 index 00000000000..fb5b282d1d7 --- /dev/null +++ b/package/kernel/mac80211/patches/393-mac80211-shorten-the-IBSS-debug-messages.patch @@ -0,0 +1,74 @@ +From: Emmanuel Grumbach +Date: Fri, 31 Aug 2018 11:31:13 +0300 +Subject: [PATCH] mac80211: shorten the IBSS debug messages + +When tracing is enabled, all the debug messages are recorded and must +not exceed MAX_MSG_LEN (100) columns. Longer debug messages grant the +user with: + +WARNING: CPU: 3 PID: 32642 at /tmp/wifi-core-20180806094828/src/iwlwifi-stack-dev/net/mac80211/./trace_msg.h:32 trace_event_raw_event_mac80211_msg_event+0xab/0xc0 [mac80211] +Workqueue: phy1 ieee80211_iface_work [mac80211] + RIP: 0010:trace_event_raw_event_mac80211_msg_event+0xab/0xc0 [mac80211] + Call Trace: + __sdata_dbg+0xbd/0x120 [mac80211] + ieee80211_ibss_rx_queued_mgmt+0x15f/0x510 [mac80211] + ieee80211_iface_work+0x21d/0x320 [mac80211] + +Signed-off-by: Emmanuel Grumbach +Signed-off-by: Luca Coelho +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/ibss.c ++++ b/net/mac80211/ibss.c +@@ -947,8 +947,8 @@ static void ieee80211_rx_mgmt_deauth_ibs + if (len < IEEE80211_DEAUTH_FRAME_LEN) + return; + +- ibss_dbg(sdata, "RX DeAuth SA=%pM DA=%pM BSSID=%pM (reason: %d)\n", +- mgmt->sa, mgmt->da, mgmt->bssid, reason); ++ ibss_dbg(sdata, "RX DeAuth SA=%pM DA=%pM\n", mgmt->sa, mgmt->da); ++ ibss_dbg(sdata, "\tBSSID=%pM (reason: %d)\n", mgmt->bssid, reason); + sta_info_destroy_addr(sdata, mgmt->sa); + } + +@@ -966,9 +966,9 @@ static void ieee80211_rx_mgmt_auth_ibss( + auth_alg = le16_to_cpu(mgmt->u.auth.auth_alg); + auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); + +- ibss_dbg(sdata, +- "RX Auth SA=%pM DA=%pM BSSID=%pM (auth_transaction=%d)\n", +- mgmt->sa, mgmt->da, mgmt->bssid, auth_transaction); ++ ibss_dbg(sdata, "RX Auth SA=%pM DA=%pM\n", mgmt->sa, mgmt->da); ++ ibss_dbg(sdata, "\tBSSID=%pM (auth_transaction=%d)\n", ++ mgmt->bssid, auth_transaction); + + if (auth_alg != WLAN_AUTH_OPEN || auth_transaction != 1) + return; +@@ -1175,10 +1175,10 @@ static void ieee80211_rx_bss_info(struct + rx_timestamp = drv_get_tsf(local, sdata); + } + +- ibss_dbg(sdata, +- "RX beacon SA=%pM BSSID=%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n", ++ ibss_dbg(sdata, "RX beacon SA=%pM BSSID=%pM TSF=0x%llx\n", + mgmt->sa, mgmt->bssid, +- (unsigned long long)rx_timestamp, ++ (unsigned long long)rx_timestamp); ++ ibss_dbg(sdata, "\tBCN=0x%llx diff=%lld @%lu\n", + (unsigned long long)beacon_timestamp, + (unsigned long long)(rx_timestamp - beacon_timestamp), + jiffies); +@@ -1537,9 +1537,9 @@ static void ieee80211_rx_mgmt_probe_req( + + tx_last_beacon = drv_tx_last_beacon(local); + +- ibss_dbg(sdata, +- "RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n", +- mgmt->sa, mgmt->da, mgmt->bssid, tx_last_beacon); ++ ibss_dbg(sdata, "RX ProbeReq SA=%pM DA=%pM\n", mgmt->sa, mgmt->da); ++ ibss_dbg(sdata, "\tBSSID=%pM (tx_last_beacon=%d)\n", ++ mgmt->bssid, tx_last_beacon); + + if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da)) + return; diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch index 19f0ff2ae97..b815f5f22a6 100644 --- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch @@ -119,7 +119,7 @@ if (local->hw.conf.power_level != power) { changed |= IEEE80211_CONF_CHANGE_POWER; local->hw.conf.power_level = power; -@@ -592,6 +598,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -611,6 +617,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ IEEE80211_RADIOTAP_MCS_HAVE_BW; local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI | IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH; diff --git a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch index b0c5d5ba37b..f95fa9540c1 100644 --- a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -296,6 +296,7 @@ RT2X00_LIB_FIRMWARE= +@@ -298,6 +298,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= diff --git a/package/kernel/mac80211/patches/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index ee216529f67..fc7fe1edb04 100644 --- a/package/kernel/mac80211/patches/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -83,10 +83,8 @@ v13: 12 files changed, 314 insertions(+), 1 deletion(-) create mode 100644 drivers/net/wireless/ath/ath10k/leds.c create mode 100644 drivers/net/wireless/ath/ath10k/leds.h -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/Kconfig -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/Kconfig -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/Kconfig +--- a/drivers/net/wireless/ath/ath10k/Kconfig ++++ b/drivers/net/wireless/ath/ath10k/Kconfig @@ -56,6 +56,16 @@ config ATH10K_DEBUGFS If unsure, say Y to make it easier to debug problems. @@ -104,10 +102,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/Kconfig config ATH10K_SPECTRAL bool "Atheros ath10k spectral scan support" depends on ATH10K_DEBUGFS -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/Makefile -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/Makefile -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/Makefile +--- a/drivers/net/wireless/ath/ath10k/Makefile ++++ b/drivers/net/wireless/ath/ath10k/Makefile @@ -18,6 +18,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o @@ -116,10 +112,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/Makefile ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o ath10k_core-$(CONFIG_PM) += wow.o -Index: backports-2017-11-01/local-symbols -=================================================================== ---- backports-2017-11-01.orig/local-symbols -+++ backports-2017-11-01/local-symbols +--- a/local-symbols ++++ b/local-symbols @@ -143,6 +143,7 @@ ATH10K_USB= ATH10K_DEBUG= ATH10K_DEBUGFS= @@ -128,10 +122,8 @@ Index: backports-2017-11-01/local-symbols ATH10K_TRACING= ATH10K_DFS_CERTIFIED= WCN36XX= -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.c -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/core.c -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.c +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c @@ -32,6 +32,7 @@ #include "htt.h" #include "testmode.h" @@ -219,10 +211,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.c ath10k_thermal_unregister(ar); /* Stop spectral before unregistering from mac80211 to remove the * relayfs debugfs file cleanly. Otherwise the parent debugfs tree -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.h -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/core.h -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.h +--- a/drivers/net/wireless/ath/ath10k/core.h ++++ b/drivers/net/wireless/ath/ath10k/core.h @@ -24,6 +24,7 @@ #include #include @@ -253,10 +243,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/core.h /* protected by data_lock */ u32 fw_crash_counter; u32 fw_warm_reset_counter; -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/hw.h -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/hw.h -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/hw.h +--- a/drivers/net/wireless/ath/ath10k/hw.h ++++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -490,6 +490,7 @@ struct ath10k_hw_params { const char *name; u32 patch_load_addr; @@ -265,10 +253,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/hw.h u32 otp_exe_param; /* Type of hw cycle counter wraparound logic, for more info -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.c -=================================================================== --- /dev/null -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.c ++++ b/drivers/net/wireless/ath/ath10k/leds.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2005-2011 Atheros Communications Inc. @@ -373,10 +359,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.c + led_classdev_unregister(&ar->leds.cdev); +} + -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.h -=================================================================== --- /dev/null -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.h ++++ b/drivers/net/wireless/ath/ath10k/leds.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018, The Linux Foundation. All rights reserved. @@ -419,10 +403,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/leds.h + +#endif +#endif /* _LEDS_H_ */ -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/mac.c -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/mac.c -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/mac.c +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -32,6 +32,7 @@ #include "wmi-tlv.h" #include "wmi-ops.h" @@ -431,10 +413,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/mac.c /*********/ /* Rates */ -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-ops.h -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi-ops.h -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-ops.h +--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h ++++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -197,6 +197,10 @@ struct wmi_ops { (struct ath10k *ar, enum wmi_bss_survey_req_type type); @@ -482,10 +462,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-ops.h static inline int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level) { -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-tlv.c -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi-tlv.c -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-tlv.c +--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c ++++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -3619,6 +3619,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, @@ -495,10 +473,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi-tlv.c }; static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = { -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.c -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi.c -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.c +--- a/drivers/net/wireless/ath/ath10k/wmi.c ++++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -6580,6 +6580,49 @@ ath10k_wmi_op_gen_peer_set_param(struct return skb; } @@ -595,10 +571,8 @@ Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.c }; int ath10k_wmi_attach(struct ath10k *ar) -Index: backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.h -=================================================================== ---- backports-2017-11-01.orig/drivers/net/wireless/ath/ath10k/wmi.h -+++ backports-2017-11-01/drivers/net/wireless/ath/ath10k/wmi.h +--- a/drivers/net/wireless/ath/ath10k/wmi.h ++++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -2899,6 +2899,41 @@ enum wmi_10_4_feature_mask { }; From ca1d6c7d30cfdf3d4cab0f530baec9e818a31f7f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 22 Sep 2018 12:56:10 +0200 Subject: [PATCH 019/399] mt76: fix tx power issue for mt76x2 6e1898d mt76x2: fix tx power configuration for VHT mcs 9 Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 1e00aa78829..4f32799eb45 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-08-24 -PKG_SOURCE_VERSION:=30b8371ad7233c04fa825f318954791d3796c2bf -PKG_MIRROR_HASH:=388c95dbc7e6a971b3372654825c5641d9f92c8c2144768a87b00c02086ac7c8 +PKG_SOURCE_DATE:=2018-09-21 +PKG_SOURCE_VERSION:=6e1898d60a780c9d89dff9cbb3569f267db13e21 +PKG_MIRROR_HASH:=f2d8a17fa58f6f2ddd284922faeec9dd09c6727dde91caec54f4fdb280f4df1c PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From 609707cbe7cfce2038cf54a8deb6c341a06df1d8 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 22 Sep 2018 15:18:46 +0200 Subject: [PATCH 020/399] mac80211: fix tx queue allocation for active monitor interfaces Fixes a crash with drivers like ath9k Signed-off-by: Felix Fietkau --- ...e-TXQs-for-active-monitor-interfaces.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/kernel/mac80211/patches/394-mac80211-allocate-TXQs-for-active-monitor-interfaces.patch diff --git a/package/kernel/mac80211/patches/394-mac80211-allocate-TXQs-for-active-monitor-interfaces.patch b/package/kernel/mac80211/patches/394-mac80211-allocate-TXQs-for-active-monitor-interfaces.patch new file mode 100644 index 00000000000..c5c65866528 --- /dev/null +++ b/package/kernel/mac80211/patches/394-mac80211-allocate-TXQs-for-active-monitor-interfaces.patch @@ -0,0 +1,26 @@ +From: Felix Fietkau +Date: Sat, 22 Sep 2018 15:05:59 +0200 +Subject: [PATCH] mac80211: allocate TXQs for active monitor interfaces + +Monitor mode interfaces with the active flag are passed down to the driver. +Drivers using TXQ expect that all interfaces have allocated TXQs before +they get added. + +Fixes: 79af1f866193d ("mac80211: avoid allocating TXQs that won't be used") +Cc: stable@vger.kernel.org +Reported-by: Catrinel Catrinescu +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -1816,7 +1816,8 @@ int ieee80211_if_add(struct ieee80211_lo + + if (local->ops->wake_tx_queue && + type != NL80211_IFTYPE_AP_VLAN && +- type != NL80211_IFTYPE_MONITOR) ++ (type != NL80211_IFTYPE_MONITOR || ++ (params->flags & MONITOR_FLAG_ACTIVE))) + txq_size += sizeof(struct txq_info) + + local->hw.txq_data_size; + From cb352a7c4cf74fb9c0067bd62517fc59763ebc5a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 24 Sep 2018 11:02:30 +0200 Subject: [PATCH 021/399] build: drop buildbot toolchain rebuild check when not using git The check cleans and rebuilds the toolchain if it changed on update. When building from a source tarball, it is reasonable to expect that there will be no updates, so no rebuild check is necessary Signed-off-by: Felix Fietkau --- toolchain/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolchain/Makefile b/toolchain/Makefile index 409955c23a9..e4631bc7bff 100644 --- a/toolchain/Makefile +++ b/toolchain/Makefile @@ -70,6 +70,7 @@ endif endif ifdef CONFIG_BUILDBOT +ifneq ($(wildcard $(TOPDIR)/.git),) $(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check cmp -s $(TMP_DIR)/.ver_check $@ || { \ @@ -80,6 +81,7 @@ ifdef CONFIG_BUILDBOT $(TOOLCHAIN_DIR)/info.mk $(STAGING_DIR)/.prepared: $(TOOLCHAIN_DIR)/stamp/.ver_check endif +endif # prerequisites for the individual targets $(curdir)/ := .config prereq From 05606de1aa5bb84b7f60f2df15368268e4106acc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 24 Sep 2018 13:46:08 +0200 Subject: [PATCH 022/399] kernel: pick earlycon regression fixes from the stable-queue.git MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes regression introduced in kernel 4.14 and makes bcm53xx revert obsolete. Signed-off-by: Rafał Miłecki (cherry picked from commit 43d36606d668edf155da9d879110de2894df825a) --- ...initialise-baud-field-of-earlycon-de.patch | 33 -------------- ...lk-based-on-clock-frequency-property.patch | 45 +++++++++++++++++++ ...-initialization-in-of_setup_earlycon.patch | 40 +++++++++++++++++ 3 files changed, 85 insertions(+), 33 deletions(-) delete mode 100644 target/linux/bcm53xx/patches-4.14/910-Revert-earlycon-initialise-baud-field-of-earlycon-de.patch create mode 100644 target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch create mode 100644 target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch diff --git a/target/linux/bcm53xx/patches-4.14/910-Revert-earlycon-initialise-baud-field-of-earlycon-de.patch b/target/linux/bcm53xx/patches-4.14/910-Revert-earlycon-initialise-baud-field-of-earlycon-de.patch deleted file mode 100644 index c00cae2df39..00000000000 --- a/target/linux/bcm53xx/patches-4.14/910-Revert-earlycon-initialise-baud-field-of-earlycon-de.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH] Revert "earlycon: initialise baud field of earlycon device - structure" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit 31cb9a8575ca04f47ea113434d4782b695638b62. - -It broke earlycon on BCM5301X. Using: -1) uartclk 1843200 (BASE_BAUD * 16) -2) early_console_dev.baud 115200 -results in init_port() calculating UART divisor 1. That's a wrong value -(default one is 54) that breaks serial console output. - -Signed-off-by: Rafał Miłecki ---- - ---- a/drivers/tty/serial/earlycon.c -+++ b/drivers/tty/serial/earlycon.c -@@ -285,12 +285,7 @@ int __init of_setup_earlycon(const struc - } - } - -- val = of_get_flat_dt_prop(node, "current-speed", NULL); -- if (val) -- early_console_dev.baud = be32_to_cpu(*val); -- - if (options) { -- early_console_dev.baud = simple_strtoul(options, NULL, 0); - strlcpy(early_console_dev.options, options, - sizeof(early_console_dev.options)); - } diff --git a/target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch b/target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch new file mode 100644 index 00000000000..1b98958af4b --- /dev/null +++ b/target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch @@ -0,0 +1,45 @@ +From 814453adea7d081ad8917aa0f32d6a14165a3563 Mon Sep 17 00:00:00 2001 +From: Michal Simek +Date: Tue, 10 Apr 2018 15:32:28 +0200 +Subject: earlycon: Initialize port->uartclk based on clock-frequency property + +From: Michal Simek + +commit 814453adea7d081ad8917aa0f32d6a14165a3563 upstream. + +On DT based platforms when current-speed property is present baudrate +is setup. Also port->uartclk is initialized to bogus BASE_BAUD * 16 +value. Drivers like uartps/ns16550 contain logic when baudrate and +uartclk is used for baudrate calculation. + +The patch is reading optional clock-frequency property to replace bogus +BASE_BAUD * 16 calculation to have proper baudrate calculation. + +[-stable comment: commit 31cb9a8575ca ("earlycon: initialise baud field + of earlycon device structure") has changed 8250_early.c behavior which + now tries to setup UART speed. Ignoring clock-frequency results in + wrong value of calculated divisor & malformed early console output.] + +Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") +Signed-off-by: Michal Simek +[rmilecki: add -stable comment and Fixes tag] +Signed-off-by: Rafał Miłecki +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/tty/serial/earlycon.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/tty/serial/earlycon.c ++++ b/drivers/tty/serial/earlycon.c +@@ -289,6 +289,10 @@ int __init of_setup_earlycon(const struc + if (val) + early_console_dev.baud = be32_to_cpu(*val); + ++ val = of_get_flat_dt_prop(node, "clock-frequency", NULL); ++ if (val) ++ port->uartclk = be32_to_cpu(*val); ++ + if (options) { + early_console_dev.baud = simple_strtoul(options, NULL, 0); + strlcpy(early_console_dev.options, options, diff --git a/target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch b/target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch new file mode 100644 index 00000000000..a4df913840b --- /dev/null +++ b/target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch @@ -0,0 +1,40 @@ +From 182ead3e418a20328b73152b8e81fc8b4cac3b0b Mon Sep 17 00:00:00 2001 +From: Michal Simek +Date: Wed, 25 Apr 2018 15:48:42 +0200 +Subject: earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon + +From: Michal Simek + +commit 182ead3e418a20328b73152b8e81fc8b4cac3b0b upstream. + +There is no reason to initialize uartclk to BASE_BAUD * 16 for DT based +systems. + +[-stable comment: commit 31cb9a8575ca ("earlycon: initialise baud field + of earlycon device structure") has changed 8250_early.c behavior which + now tries to setup UART speed. + Already-backported upstream commit 0ff3ab701963 ("serial: 8250_early: + Only set divisor if valid clk & baud") handles properly uartclk not + being set but it still requires backporting fix for wrong uartclk val. + This fixes malformed early console output on arch-es with BASE_BAUD.] + +Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") +Signed-off-by: Michal Simek +Tested-by: Matt Redfearn +[rmilecki: add -stable comment and Fixes tag] +Signed-off-by: Rafał Miłecki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/earlycon.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/tty/serial/earlycon.c ++++ b/drivers/tty/serial/earlycon.c +@@ -254,7 +254,6 @@ int __init of_setup_earlycon(const struc + return -ENXIO; + } + port->mapbase = addr; +- port->uartclk = BASE_BAUD * 16; + + val = of_get_flat_dt_prop(node, "reg-offset", NULL); + if (val) From 2e946ca366c5d6c0e6dbf96431828de79529ed7d Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 26 Sep 2018 12:55:25 +0200 Subject: [PATCH 023/399] kernel: bump 4.9 to 4.9.129 Refreshed all patches. Removed upstreamed: - 203-MIPS-ath79-fix-restart.patch Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +-- .../203-MIPS-ath79-fix-restart.patch | 20 ------------- .../950-0031-Add-dwc_otg-driver.patch | 2 +- ...90-net-generalize-napi_complete_done.patch | 2 +- ...ng-comment-related-to-link-detection.patch | 4 +-- .../401-mtd-spi-nor-support-layerscape.patch | 2 +- .../810-iommu-support-layerscape.patch | 28 +++++++++---------- 7 files changed, 21 insertions(+), 41 deletions(-) delete mode 100644 target/linux/ar71xx/patches-4.9/203-MIPS-ath79-fix-restart.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index d61e951500f..2d2207b4d5e 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .128 LINUX_VERSION-4.14 = .71 +LINUX_VERSION-4.9 = .129 -LINUX_KERNEL_HASH-4.9.128 = bdb76f48491a6aadc89c0f0f7fdc240d77cee54da5aac59da0b5d98e226b6f12 LINUX_KERNEL_HASH-4.14.71 = 76a4473dbcbd922c23a16130414829a36eb7e2f4e5859bd1b742fffdff907489 +LINUX_KERNEL_HASH-4.9.129 = 6f5510d3fcfec1bf1e2d9c8e2fdcd7628c1886c6bdb29092adc5ccdf75e39318 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ar71xx/patches-4.9/203-MIPS-ath79-fix-restart.patch b/target/linux/ar71xx/patches-4.9/203-MIPS-ath79-fix-restart.patch deleted file mode 100644 index 48f4d95e746..00000000000 --- a/target/linux/ar71xx/patches-4.9/203-MIPS-ath79-fix-restart.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/arch/mips/ath79/setup.c -+++ b/arch/mips/ath79/setup.c -@@ -40,6 +40,7 @@ static char ath79_sys_type[ATH79_SYS_TYP - - static void ath79_restart(char *command) - { -+ local_irq_disable(); - ath79_device_reset_set(AR71XX_RESET_FULL_CHIP); - for (;;) - if (cpu_wait) ---- a/arch/mips/include/asm/mach-ath79/ath79.h -+++ b/arch/mips/include/asm/mach-ath79/ath79.h -@@ -135,6 +135,7 @@ static inline u32 ath79_pll_rr(unsigned - static inline void ath79_reset_wr(unsigned reg, u32 val) - { - __raw_writel(val, ath79_reset_base + reg); -+ (void) __raw_readl(ath79_reset_base + reg); /* flush */ - } - - static inline u32 ath79_reset_rr(unsigned reg) diff --git a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch index 1db23d7235d..12174919bb3 100644 --- a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch @@ -707,7 +707,7 @@ Signed-off-by: Noralf Trønnes msleep(100); /* Cool down */ --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c -@@ -1912,6 +1912,85 @@ free_interfaces: +@@ -1923,6 +1923,85 @@ free_interfaces: if (cp->string == NULL && !(dev->quirks & USB_QUIRK_CONFIG_INTF_STRINGS)) cp->string = usb_cache_string(dev, cp->desc.iConfiguration); diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 0e8e0660db5..393c4524e4d 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -1379,7 +1379,7 @@ Signed-off-by: David S. Miller */ --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c -@@ -1065,7 +1065,7 @@ err: +@@ -1064,7 +1064,7 @@ err: if (work_done < budget) { int more_to_do = 0; diff --git a/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch index 87b12b9cbe2..8899664fba9 100644 --- a/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch +++ b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch @@ -23,7 +23,7 @@ Tested-by: Aaron Brown --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -5078,7 +5078,7 @@ static bool e1000e_has_link(struct e1000 +@@ -5067,7 +5067,7 @@ static bool e1000e_has_link(struct e1000 /* get_link_status is set on LSC (link status) interrupt or * Rx sequence error interrupt. get_link_status will stay @@ -32,7 +32,7 @@ Tested-by: Aaron Brown * for copper adapters ONLY */ switch (hw->phy.media_type) { -@@ -5096,7 +5096,7 @@ static bool e1000e_has_link(struct e1000 +@@ -5085,7 +5085,7 @@ static bool e1000e_has_link(struct e1000 break; case e1000_media_type_internal_serdes: ret_val = hw->mac.ops.check_for_link(hw); diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch index 9d849686080..b6b6b92c3db 100644 --- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch @@ -25,7 +25,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c -@@ -451,7 +451,7 @@ static int mtdchar_readoob(struct file * +@@ -455,7 +455,7 @@ static int mtdchar_readoob(struct file * * data. For our userspace tools it is important to dump areas * with ECC errors! * For kernel internal usage it also might return -EUCLEAN diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 816abbb9e78..e31c7db3e81 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -214,7 +214,7 @@ Signed-off-by: Yangbo Lu for (i = 0; i < nent; ++i) { arm_smmu_write_strtab_ent(NULL, -1, strtab, &ste); -@@ -1364,8 +1374,6 @@ static bool arm_smmu_capable(enum iommu_ +@@ -1365,8 +1375,6 @@ static bool arm_smmu_capable(enum iommu_ switch (cap) { case IOMMU_CAP_CACHE_COHERENCY: return true; @@ -223,7 +223,7 @@ Signed-off-by: Yangbo Lu case IOMMU_CAP_NOEXEC: return true; default: -@@ -1377,7 +1385,9 @@ static struct iommu_domain *arm_smmu_dom +@@ -1378,7 +1386,9 @@ static struct iommu_domain *arm_smmu_dom { struct arm_smmu_domain *smmu_domain; @@ -234,7 +234,7 @@ Signed-off-by: Yangbo Lu return NULL; /* -@@ -1508,6 +1518,11 @@ static int arm_smmu_domain_finalise(stru +@@ -1509,6 +1519,11 @@ static int arm_smmu_domain_finalise(stru struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct arm_smmu_device *smmu = smmu_domain->smmu; @@ -246,7 +246,7 @@ Signed-off-by: Yangbo Lu /* Restrict the stage to what we can actually support */ if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1)) smmu_domain->stage = ARM_SMMU_DOMAIN_S2; -@@ -1580,7 +1595,7 @@ static __le64 *arm_smmu_get_step_for_sid +@@ -1581,7 +1596,7 @@ static __le64 *arm_smmu_get_step_for_sid return step; } @@ -255,7 +255,7 @@ Signed-off-by: Yangbo Lu { int i, j; struct arm_smmu_master_data *master = fwspec->iommu_priv; -@@ -1599,17 +1614,14 @@ static int arm_smmu_install_ste_for_dev( +@@ -1600,17 +1615,14 @@ static int arm_smmu_install_ste_for_dev( arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste); } @@ -275,7 +275,7 @@ Signed-off-by: Yangbo Lu } static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) -@@ -1628,7 +1640,7 @@ static int arm_smmu_attach_dev(struct io +@@ -1629,7 +1641,7 @@ static int arm_smmu_attach_dev(struct io ste = &master->ste; /* Already attached to a different domain? */ @@ -284,7 +284,7 @@ Signed-off-by: Yangbo Lu arm_smmu_detach_dev(dev); mutex_lock(&smmu_domain->init_mutex); -@@ -1649,10 +1661,12 @@ static int arm_smmu_attach_dev(struct io +@@ -1650,10 +1662,12 @@ static int arm_smmu_attach_dev(struct io goto out_unlock; } @@ -300,7 +300,7 @@ Signed-off-by: Yangbo Lu ste->s1_cfg = &smmu_domain->s1_cfg; ste->s2_cfg = NULL; arm_smmu_write_ctx_desc(smmu, ste->s1_cfg); -@@ -1661,10 +1675,7 @@ static int arm_smmu_attach_dev(struct io +@@ -1662,10 +1676,7 @@ static int arm_smmu_attach_dev(struct io ste->s2_cfg = &smmu_domain->s2_cfg; } @@ -312,7 +312,7 @@ Signed-off-by: Yangbo Lu out_unlock: mutex_unlock(&smmu_domain->init_mutex); return ret; -@@ -1712,6 +1723,9 @@ arm_smmu_iova_to_phys(struct iommu_domai +@@ -1713,6 +1724,9 @@ arm_smmu_iova_to_phys(struct iommu_domai struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops; @@ -322,7 +322,7 @@ Signed-off-by: Yangbo Lu if (!ops) return 0; -@@ -1810,7 +1824,7 @@ static void arm_smmu_remove_device(struc +@@ -1811,7 +1825,7 @@ static void arm_smmu_remove_device(struc return; master = fwspec->iommu_priv; @@ -331,7 +331,7 @@ Signed-off-by: Yangbo Lu arm_smmu_detach_dev(dev); iommu_group_remove_device(dev); kfree(master); -@@ -1839,6 +1853,9 @@ static int arm_smmu_domain_get_attr(stru +@@ -1840,6 +1854,9 @@ static int arm_smmu_domain_get_attr(stru { struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); @@ -341,7 +341,7 @@ Signed-off-by: Yangbo Lu switch (attr) { case DOMAIN_ATTR_NESTING: *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); -@@ -1854,6 +1871,9 @@ static int arm_smmu_domain_set_attr(stru +@@ -1855,6 +1872,9 @@ static int arm_smmu_domain_set_attr(stru int ret = 0; struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); @@ -351,7 +351,7 @@ Signed-off-by: Yangbo Lu mutex_lock(&smmu_domain->init_mutex); switch (attr) { -@@ -1883,6 +1903,31 @@ static int arm_smmu_of_xlate(struct devi +@@ -1884,6 +1904,31 @@ static int arm_smmu_of_xlate(struct devi return iommu_fwspec_add_ids(dev, args->args, 1); } @@ -383,7 +383,7 @@ Signed-off-by: Yangbo Lu static struct iommu_ops arm_smmu_ops = { .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, -@@ -1898,6 +1943,8 @@ static struct iommu_ops arm_smmu_ops = { +@@ -1899,6 +1944,8 @@ static struct iommu_ops arm_smmu_ops = { .domain_get_attr = arm_smmu_domain_get_attr, .domain_set_attr = arm_smmu_domain_set_attr, .of_xlate = arm_smmu_of_xlate, From 81b2bf8e3bd735500399cd9aed647bcdd0005d95 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 26 Sep 2018 12:57:03 +0200 Subject: [PATCH 024/399] kernel: bump 4.14 to 4.14.72 Refreshed all patches. Removed upstreamed: - 180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch - 181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon. patch - 700-1-6-e1000e-Remove-Other-from-EIAC.patch - 700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.patch - 700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.patch - 700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.patch Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- ...support-for-performing-fake-doorbell.patch | 6 +- ...lk-based-on-clock-frequency-property.patch | 45 ------ ...-initialization-in-of_setup_earlycon.patch | 40 ------ ...700-1-6-e1000e-Remove-Other-from-EIAC.diff | 66 --------- ...oid-receiver-overrun-interrupt-bursts.diff | 84 ----------- ...terrupt-re-raising-in-Other-interrupt.diff | 50 ------- ...-missed-interrupts-following-ICR-read.diff | 131 ------------------ ...ng-with-source-address-failed-policy.patch | 14 +- ...msm-fix-gpio-hog-related-boot-issues.patch | 2 +- ...e-scm_call-to-route-GPIO-irq-to-Apps.patch | 6 +- ...low-imod-interval-to-be-configurable.patch | 2 +- 13 files changed, 18 insertions(+), 434 deletions(-) delete mode 100644 target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch delete mode 100644 target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch delete mode 100644 target/linux/generic/backport-4.14/700-1-6-e1000e-Remove-Other-from-EIAC.diff delete mode 100644 target/linux/generic/backport-4.14/700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.diff delete mode 100644 target/linux/generic/backport-4.14/700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.diff delete mode 100644 target/linux/generic/backport-4.14/700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.diff diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 2d2207b4d5e..988bdb49a53 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.14 = .71 LINUX_VERSION-4.9 = .129 +LINUX_VERSION-4.14 = .72 -LINUX_KERNEL_HASH-4.14.71 = 76a4473dbcbd922c23a16130414829a36eb7e2f4e5859bd1b742fffdff907489 LINUX_KERNEL_HASH-4.9.129 = 6f5510d3fcfec1bf1e2d9c8e2fdcd7628c1886c6bdb29092adc5ccdf75e39318 +LINUX_KERNEL_HASH-4.14.72 = df925906250bbc40fcf0137d7ad0fb8edc528d926832634f1233b7540564557f remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index 1e781b5dae3..c09d1547bd5 100644 --- a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -24,7 +24,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -357,10 +357,14 @@ static int xhci_try_enable_msi(struct us +@@ -372,10 +372,14 @@ static int xhci_try_enable_msi(struct us free_irq(hcd->irq, hcd); hcd->irq = 0; diff --git a/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index ac622010fff..7ab5ffcb148 100644 --- a/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -40,7 +40,7 @@ it on BCM4708 family. /* called during probe() after chip reset completes */ --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -153,6 +153,49 @@ int xhci_start(struct xhci_hcd *xhci) +@@ -168,6 +168,49 @@ int xhci_start(struct xhci_hcd *xhci) return ret; } @@ -90,7 +90,7 @@ it on BCM4708 family. /* * Reset a halted HC. * -@@ -536,10 +579,20 @@ static int xhci_init(struct usb_hcd *hcd +@@ -551,10 +594,20 @@ static int xhci_init(struct usb_hcd *hcd static int xhci_run_finished(struct xhci_hcd *xhci) { @@ -114,7 +114,7 @@ it on BCM4708 family. xhci->shared_hcd->state = HC_STATE_RUNNING; xhci->cmd_ring_state = CMD_RING_STATE_RUNNING; -@@ -549,6 +602,10 @@ static int xhci_run_finished(struct xhci +@@ -564,6 +617,10 @@ static int xhci_run_finished(struct xhci xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_run for USB3 roothub"); return 0; diff --git a/target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch b/target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch deleted file mode 100644 index 1b98958af4b..00000000000 --- a/target/linux/generic/backport-4.14/180-earlycon-initialize-port-uartclk-based-on-clock-frequency-property.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 814453adea7d081ad8917aa0f32d6a14165a3563 Mon Sep 17 00:00:00 2001 -From: Michal Simek -Date: Tue, 10 Apr 2018 15:32:28 +0200 -Subject: earlycon: Initialize port->uartclk based on clock-frequency property - -From: Michal Simek - -commit 814453adea7d081ad8917aa0f32d6a14165a3563 upstream. - -On DT based platforms when current-speed property is present baudrate -is setup. Also port->uartclk is initialized to bogus BASE_BAUD * 16 -value. Drivers like uartps/ns16550 contain logic when baudrate and -uartclk is used for baudrate calculation. - -The patch is reading optional clock-frequency property to replace bogus -BASE_BAUD * 16 calculation to have proper baudrate calculation. - -[-stable comment: commit 31cb9a8575ca ("earlycon: initialise baud field - of earlycon device structure") has changed 8250_early.c behavior which - now tries to setup UART speed. Ignoring clock-frequency results in - wrong value of calculated divisor & malformed early console output.] - -Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") -Signed-off-by: Michal Simek -[rmilecki: add -stable comment and Fixes tag] -Signed-off-by: Rafał Miłecki -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/tty/serial/earlycon.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/tty/serial/earlycon.c -+++ b/drivers/tty/serial/earlycon.c -@@ -289,6 +289,10 @@ int __init of_setup_earlycon(const struc - if (val) - early_console_dev.baud = be32_to_cpu(*val); - -+ val = of_get_flat_dt_prop(node, "clock-frequency", NULL); -+ if (val) -+ port->uartclk = be32_to_cpu(*val); -+ - if (options) { - early_console_dev.baud = simple_strtoul(options, NULL, 0); - strlcpy(early_console_dev.options, options, diff --git a/target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch b/target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch deleted file mode 100644 index a4df913840b..00000000000 --- a/target/linux/generic/backport-4.14/181-earlycon-remove-hardcoded-port-uartclk-initialization-in-of_setup_earlycon.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 182ead3e418a20328b73152b8e81fc8b4cac3b0b Mon Sep 17 00:00:00 2001 -From: Michal Simek -Date: Wed, 25 Apr 2018 15:48:42 +0200 -Subject: earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon - -From: Michal Simek - -commit 182ead3e418a20328b73152b8e81fc8b4cac3b0b upstream. - -There is no reason to initialize uartclk to BASE_BAUD * 16 for DT based -systems. - -[-stable comment: commit 31cb9a8575ca ("earlycon: initialise baud field - of earlycon device structure") has changed 8250_early.c behavior which - now tries to setup UART speed. - Already-backported upstream commit 0ff3ab701963 ("serial: 8250_early: - Only set divisor if valid clk & baud") handles properly uartclk not - being set but it still requires backporting fix for wrong uartclk val. - This fixes malformed early console output on arch-es with BASE_BAUD.] - -Fixes: 31cb9a8575ca ("earlycon: initialise baud field of earlycon device structure") -Signed-off-by: Michal Simek -Tested-by: Matt Redfearn -[rmilecki: add -stable comment and Fixes tag] -Signed-off-by: Rafał Miłecki -Signed-off-by: Greg Kroah-Hartman ---- - drivers/tty/serial/earlycon.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/tty/serial/earlycon.c -+++ b/drivers/tty/serial/earlycon.c -@@ -254,7 +254,6 @@ int __init of_setup_earlycon(const struc - return -ENXIO; - } - port->mapbase = addr; -- port->uartclk = BASE_BAUD * 16; - - val = of_get_flat_dt_prop(node, "reg-offset", NULL); - if (val) diff --git a/target/linux/generic/backport-4.14/700-1-6-e1000e-Remove-Other-from-EIAC.diff b/target/linux/generic/backport-4.14/700-1-6-e1000e-Remove-Other-from-EIAC.diff deleted file mode 100644 index 9ce01aac5ed..00000000000 --- a/target/linux/generic/backport-4.14/700-1-6-e1000e-Remove-Other-from-EIAC.diff +++ /dev/null @@ -1,66 +0,0 @@ -From patchwork Mon Mar 5 21:40:25 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [net,v2,1/6] e1000e: Remove Other from EIAC -X-Patchwork-Submitter: "Kirsher, Jeffrey T" -X-Patchwork-Id: 881773 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <20180305214030.25141-2-jeffrey.t.kirsher@intel.com> -To: davem@davemloft.net -Cc: Benjamin Poirier , netdev@vger.kernel.org, - nhorman@redhat.com, sassmann@redhat.com, jogreene@redhat.com, - Jeff Kirsher -Date: Mon, 5 Mar 2018 13:40:25 -0800 -From: Jeff Kirsher -List-Id: - -From: Benjamin Poirier - -It was reported that emulated e1000e devices in vmware esxi 6.5 Build -7526125 do not link up after commit 4aea7a5c5e94 ("e1000e: Avoid receiver -overrun interrupt bursts", v4.15-rc1). Some tracing shows that after -e1000e_trigger_lsc() is called, ICR reads out as 0x0 in e1000_msix_other() -on emulated e1000e devices. In comparison, on real e1000e 82574 hardware, -icr=0x80000004 (_INT_ASSERTED | _LSC) in the same situation. - -Some experimentation showed that this flaw in vmware e1000e emulation can -be worked around by not setting Other in EIAC. This is how it was before -16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt", v4.5-rc1). - -Fixes: 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") -Signed-off-by: Benjamin Poirier -Tested-by: Aaron Brown -Signed-off-by: Jeff Kirsher ---- - drivers/net/ethernet/intel/e1000e/netdev.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -1914,6 +1914,8 @@ static irqreturn_t e1000_msix_other(int - bool enable = true; - - icr = er32(ICR); -+ ew32(ICR, E1000_ICR_OTHER); -+ - if (icr & E1000_ICR_RXO) { - ew32(ICR, E1000_ICR_RXO); - enable = false; -@@ -2036,7 +2038,6 @@ static void e1000_configure_msix(struct - hw->hw_addr + E1000_EITR_82574(vector)); - else - writel(1, hw->hw_addr + E1000_EITR_82574(vector)); -- adapter->eiac_mask |= E1000_IMS_OTHER; - - /* Cause Tx interrupts on every write back */ - ivar |= BIT(31); -@@ -2261,7 +2262,7 @@ static void e1000_irq_enable(struct e100 - - if (adapter->msix_entries) { - ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); -- ew32(IMS, adapter->eiac_mask | E1000_IMS_LSC); -+ ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); - } else if (hw->mac.type >= e1000_pch_lpt) { - ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER); - } else { diff --git a/target/linux/generic/backport-4.14/700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.diff b/target/linux/generic/backport-4.14/700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.diff deleted file mode 100644 index 2800e6f8d83..00000000000 --- a/target/linux/generic/backport-4.14/700-2-6-Partial-revert-e1000e-Avoid-receiver-overrun-interrupt-bursts.diff +++ /dev/null @@ -1,84 +0,0 @@ -From patchwork Mon Mar 5 21:40:26 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [net, v2, - 2/6] Partial revert "e1000e: Avoid receiver overrun interrupt bursts" -X-Patchwork-Submitter: "Kirsher, Jeffrey T" -X-Patchwork-Id: 881769 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <20180305214030.25141-3-jeffrey.t.kirsher@intel.com> -To: davem@davemloft.net -Cc: Benjamin Poirier , netdev@vger.kernel.org, - nhorman@redhat.com, sassmann@redhat.com, jogreene@redhat.com, - Jeff Kirsher -Date: Mon, 5 Mar 2018 13:40:26 -0800 -From: Jeff Kirsher -List-Id: - -From: Benjamin Poirier - -This partially reverts commit 4aea7a5c5e940c1723add439f4088844cd26196d. - -We keep the fix for the first part of the problem (1) described in the log -of that commit, that is to read ICR in the other interrupt handler. We -remove the fix for the second part of the problem (2), Other interrupt -throttling. - -Bursts of "Other" interrupts may once again occur during rxo (receive -overflow) traffic conditions. This is deemed acceptable in the interest of -avoiding unforeseen fallout from changes that are not strictly necessary. -As discussed, the e1000e driver should be in "maintenance mode". - -Link: https://www.spinics.net/lists/netdev/msg480675.html -Signed-off-by: Benjamin Poirier -Acked-by: Alexander Duyck -Tested-by: Aaron Brown -Signed-off-by: Jeff Kirsher ---- - drivers/net/ethernet/intel/e1000e/netdev.c | 16 ++-------------- - 1 file changed, 2 insertions(+), 14 deletions(-) - ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -1911,21 +1911,10 @@ static irqreturn_t e1000_msix_other(int - struct e1000_adapter *adapter = netdev_priv(netdev); - struct e1000_hw *hw = &adapter->hw; - u32 icr; -- bool enable = true; - - icr = er32(ICR); - ew32(ICR, E1000_ICR_OTHER); - -- if (icr & E1000_ICR_RXO) { -- ew32(ICR, E1000_ICR_RXO); -- enable = false; -- /* napi poll will re-enable Other, make sure it runs */ -- if (napi_schedule_prep(&adapter->napi)) { -- adapter->total_rx_bytes = 0; -- adapter->total_rx_packets = 0; -- __napi_schedule(&adapter->napi); -- } -- } - if (icr & E1000_ICR_LSC) { - ew32(ICR, E1000_ICR_LSC); - hw->mac.get_link_status = true; -@@ -1934,7 +1923,7 @@ static irqreturn_t e1000_msix_other(int - mod_timer(&adapter->watchdog_timer, jiffies + 1); - } - -- if (enable && !test_bit(__E1000_DOWN, &adapter->state)) -+ if (!test_bit(__E1000_DOWN, &adapter->state)) - ew32(IMS, E1000_IMS_OTHER); - - return IRQ_HANDLED; -@@ -2704,8 +2693,7 @@ static int e1000e_poll(struct napi_struc - napi_complete_done(napi, work_done); - if (!test_bit(__E1000_DOWN, &adapter->state)) { - if (adapter->msix_entries) -- ew32(IMS, adapter->rx_ring->ims_val | -- E1000_IMS_OTHER); -+ ew32(IMS, adapter->rx_ring->ims_val); - else - e1000_irq_enable(adapter); - } diff --git a/target/linux/generic/backport-4.14/700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.diff b/target/linux/generic/backport-4.14/700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.diff deleted file mode 100644 index 8ad13ba69a8..00000000000 --- a/target/linux/generic/backport-4.14/700-3-6-e1000e-Fix-queue-interrupt-re-raising-in-Other-interrupt.diff +++ /dev/null @@ -1,50 +0,0 @@ -From patchwork Mon Mar 5 21:40:27 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [net, v2, - 3/6] e1000e: Fix queue interrupt re-raising in Other interrupt -X-Patchwork-Submitter: "Kirsher, Jeffrey T" -X-Patchwork-Id: 881775 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <20180305214030.25141-4-jeffrey.t.kirsher@intel.com> -To: davem@davemloft.net -Cc: Benjamin Poirier , netdev@vger.kernel.org, - nhorman@redhat.com, sassmann@redhat.com, jogreene@redhat.com, - Jeff Kirsher -Date: Mon, 5 Mar 2018 13:40:27 -0800 -From: Jeff Kirsher -List-Id: - -From: Benjamin Poirier - -Restores the ICS write for Rx/Tx queue interrupts which was present before -commit 16ecba59bc33 ("e1000e: Do not read ICR in Other interrupt", v4.5-rc1) -but was not restored in commit 4aea7a5c5e94 -("e1000e: Avoid receiver overrun interrupt bursts", v4.15-rc1). - -This re-raises the queue interrupts in case the txq or rxq bits were set in -ICR and the Other interrupt handler read and cleared ICR before the queue -interrupt was raised. - -Fixes: 4aea7a5c5e94 ("e1000e: Avoid receiver overrun interrupt bursts") -Signed-off-by: Benjamin Poirier -Acked-by: Alexander Duyck -Tested-by: Aaron Brown -Signed-off-by: Jeff Kirsher ---- - drivers/net/ethernet/intel/e1000e/netdev.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -1915,6 +1915,9 @@ static irqreturn_t e1000_msix_other(int - icr = er32(ICR); - ew32(ICR, E1000_ICR_OTHER); - -+ if (icr & adapter->eiac_mask) -+ ew32(ICS, (icr & adapter->eiac_mask)); -+ - if (icr & E1000_ICR_LSC) { - ew32(ICR, E1000_ICR_LSC); - hw->mac.get_link_status = true; diff --git a/target/linux/generic/backport-4.14/700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.diff b/target/linux/generic/backport-4.14/700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.diff deleted file mode 100644 index f218f34d290..00000000000 --- a/target/linux/generic/backport-4.14/700-4-6-e1000e-Avoid-missed-interrupts-following-ICR-read.diff +++ /dev/null @@ -1,131 +0,0 @@ -From patchwork Mon Mar 5 21:40:28 2018 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [net,v2,4/6] e1000e: Avoid missed interrupts following ICR read -X-Patchwork-Submitter: "Kirsher, Jeffrey T" -X-Patchwork-Id: 881771 -X-Patchwork-Delegate: davem@davemloft.net -Message-Id: <20180305214030.25141-5-jeffrey.t.kirsher@intel.com> -To: davem@davemloft.net -Cc: Benjamin Poirier , netdev@vger.kernel.org, - nhorman@redhat.com, sassmann@redhat.com, jogreene@redhat.com, - Jeff Kirsher -Date: Mon, 5 Mar 2018 13:40:28 -0800 -From: Jeff Kirsher -List-Id: - -From: Benjamin Poirier - -The 82574 specification update errata 12 states that interrupts may be -missed if ICR is read while INT_ASSERTED is not set. Avoid that problem by -setting all bits related to events that can trigger the Other interrupt in -IMS. - -The Other interrupt is raised for such events regardless of whether or not -they are set in IMS. However, only when they are set is the INT_ASSERTED -bit also set in ICR. - -By doing this, we ensure that INT_ASSERTED is always set when we read ICR -in e1000_msix_other() and steer clear of the errata. This also ensures that -ICR will automatically be cleared on read, therefore we no longer need to -clear bits explicitly. - -Signed-off-by: Benjamin Poirier -Acked-by: Alexander Duyck -Tested-by: Aaron Brown -Signed-off-by: Jeff Kirsher ---- - drivers/net/ethernet/intel/e1000e/defines.h | 21 ++++++++++++++++++++- - drivers/net/ethernet/intel/e1000e/netdev.c | 11 ++++------- - 2 files changed, 24 insertions(+), 8 deletions(-) - ---- a/drivers/net/ethernet/intel/e1000e/defines.h -+++ b/drivers/net/ethernet/intel/e1000e/defines.h -@@ -400,6 +400,10 @@ - #define E1000_ICR_RXDMT0 0x00000010 /* Rx desc min. threshold (0) */ - #define E1000_ICR_RXO 0x00000040 /* Receiver Overrun */ - #define E1000_ICR_RXT0 0x00000080 /* Rx timer intr (ring 0) */ -+#define E1000_ICR_MDAC 0x00000200 /* MDIO Access Complete */ -+#define E1000_ICR_SRPD 0x00010000 /* Small Receive Packet Detected */ -+#define E1000_ICR_ACK 0x00020000 /* Receive ACK Frame Detected */ -+#define E1000_ICR_MNG 0x00040000 /* Manageability Event Detected */ - #define E1000_ICR_ECCER 0x00400000 /* Uncorrectable ECC Error */ - /* If this bit asserted, the driver should claim the interrupt */ - #define E1000_ICR_INT_ASSERTED 0x80000000 -@@ -407,7 +411,7 @@ - #define E1000_ICR_RXQ1 0x00200000 /* Rx Queue 1 Interrupt */ - #define E1000_ICR_TXQ0 0x00400000 /* Tx Queue 0 Interrupt */ - #define E1000_ICR_TXQ1 0x00800000 /* Tx Queue 1 Interrupt */ --#define E1000_ICR_OTHER 0x01000000 /* Other Interrupts */ -+#define E1000_ICR_OTHER 0x01000000 /* Other Interrupt */ - - /* PBA ECC Register */ - #define E1000_PBA_ECC_COUNTER_MASK 0xFFF00000 /* ECC counter mask */ -@@ -431,12 +435,27 @@ - E1000_IMS_RXSEQ | \ - E1000_IMS_LSC) - -+/* These are all of the events related to the OTHER interrupt. -+ */ -+#define IMS_OTHER_MASK ( \ -+ E1000_IMS_LSC | \ -+ E1000_IMS_RXO | \ -+ E1000_IMS_MDAC | \ -+ E1000_IMS_SRPD | \ -+ E1000_IMS_ACK | \ -+ E1000_IMS_MNG) -+ - /* Interrupt Mask Set */ - #define E1000_IMS_TXDW E1000_ICR_TXDW /* Transmit desc written back */ - #define E1000_IMS_LSC E1000_ICR_LSC /* Link Status Change */ - #define E1000_IMS_RXSEQ E1000_ICR_RXSEQ /* Rx sequence error */ - #define E1000_IMS_RXDMT0 E1000_ICR_RXDMT0 /* Rx desc min. threshold */ -+#define E1000_IMS_RXO E1000_ICR_RXO /* Receiver Overrun */ - #define E1000_IMS_RXT0 E1000_ICR_RXT0 /* Rx timer intr */ -+#define E1000_IMS_MDAC E1000_ICR_MDAC /* MDIO Access Complete */ -+#define E1000_IMS_SRPD E1000_ICR_SRPD /* Small Receive Packet */ -+#define E1000_IMS_ACK E1000_ICR_ACK /* Receive ACK Frame Detected */ -+#define E1000_IMS_MNG E1000_ICR_MNG /* Manageability Event */ - #define E1000_IMS_ECCER E1000_ICR_ECCER /* Uncorrectable ECC Error */ - #define E1000_IMS_RXQ0 E1000_ICR_RXQ0 /* Rx Queue 0 Interrupt */ - #define E1000_IMS_RXQ1 E1000_ICR_RXQ1 /* Rx Queue 1 Interrupt */ ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -1910,16 +1910,12 @@ static irqreturn_t e1000_msix_other(int - struct net_device *netdev = data; - struct e1000_adapter *adapter = netdev_priv(netdev); - struct e1000_hw *hw = &adapter->hw; -- u32 icr; -- -- icr = er32(ICR); -- ew32(ICR, E1000_ICR_OTHER); -+ u32 icr = er32(ICR); - - if (icr & adapter->eiac_mask) - ew32(ICS, (icr & adapter->eiac_mask)); - - if (icr & E1000_ICR_LSC) { -- ew32(ICR, E1000_ICR_LSC); - hw->mac.get_link_status = true; - /* guard against interrupt when we're going down */ - if (!test_bit(__E1000_DOWN, &adapter->state)) -@@ -1927,7 +1923,7 @@ static irqreturn_t e1000_msix_other(int - } - - if (!test_bit(__E1000_DOWN, &adapter->state)) -- ew32(IMS, E1000_IMS_OTHER); -+ ew32(IMS, E1000_IMS_OTHER | IMS_OTHER_MASK); - - return IRQ_HANDLED; - } -@@ -2254,7 +2250,8 @@ static void e1000_irq_enable(struct e100 - - if (adapter->msix_entries) { - ew32(EIAC_82574, adapter->eiac_mask & E1000_EIAC_MASK_82574); -- ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | E1000_IMS_LSC); -+ ew32(IMS, adapter->eiac_mask | E1000_IMS_OTHER | -+ IMS_OTHER_MASK); - } else if (hw->mac.type >= e1000_pch_lpt) { - ew32(IMS, IMS_ENABLE_MASK | E1000_IMS_ECCER); - } else { diff --git a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 74baa80cdd3..a5cb9579f77 100644 --- a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -181,7 +181,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -3494,6 +3528,9 @@ static int rt6_fill_node(struct net *net +@@ -3499,6 +3533,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3812,6 +3849,8 @@ static int ip6_route_dev_notify(struct n +@@ -3817,6 +3854,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3823,6 +3862,7 @@ static int ip6_route_dev_notify(struct n +@@ -3828,6 +3867,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -208,7 +208,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -4039,6 +4079,17 @@ static int __net_init ip6_route_net_init +@@ -4044,6 +4084,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -226,7 +226,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -4057,6 +4108,8 @@ out: +@@ -4062,6 +4113,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -4074,6 +4127,7 @@ static void __net_exit ip6_route_net_exi +@@ -4079,6 +4132,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -4147,6 +4201,9 @@ void __init ip6_route_init_special_entri +@@ -4152,6 +4206,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch b/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch index 57ed940fd15..294466ed0c0 100644 --- a/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch +++ b/target/linux/ipq40xx/patches-4.14/105-pinctrl-msm-fix-gpio-hog-related-boot-issues.patch @@ -71,7 +71,7 @@ Origin: other, https://patchwork.kernel.org/patch/10339127/ #interrupt-cells = <2>; --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c -@@ -831,11 +831,24 @@ static int msm_gpio_init(struct msm_pinc +@@ -839,11 +839,24 @@ static int msm_gpio_init(struct msm_pinc return ret; } diff --git a/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch b/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch index c92393495b0..4ecdf094e68 100644 --- a/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch +++ b/target/linux/ipq806x/patches-4.14/0073-pinctrl-qom-use-scm_call-to-route-GPIO-irq-to-Apps.patch @@ -112,7 +112,7 @@ Signed-off-by: Ajay Kishore #include "../core.h" #include "../pinconf.h" #include "pinctrl-msm.h" -@@ -638,6 +639,9 @@ static void msm_gpio_irq_ack(struct irq_ +@@ -646,6 +647,9 @@ static void msm_gpio_irq_ack(struct irq_ const struct msm_pingroup *g; unsigned long flags; u32 val; @@ -122,7 +122,7 @@ Signed-off-by: Ajay Kishore g = &pctrl->soc->groups[d->hwirq]; -@@ -676,11 +680,30 @@ static int msm_gpio_irq_set_type(struct +@@ -684,11 +688,30 @@ static int msm_gpio_irq_set_type(struct else clear_bit(d->hwirq, pctrl->dual_edge_irqs); @@ -157,7 +157,7 @@ Signed-off-by: Ajay Kishore /* Update configuration for gpio. * RAW_STATUS_EN is left on for all gpio irqs. Due to the -@@ -954,4 +977,3 @@ int msm_pinctrl_remove(struct platform_d +@@ -962,4 +985,3 @@ int msm_pinctrl_remove(struct platform_d return 0; } EXPORT_SYMBOL(msm_pinctrl_remove); diff --git a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch index ee260d2aabc..52304877392 100644 --- a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch +++ b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch @@ -112,7 +112,7 @@ Signed-off-by: Greg Kroah-Hartman ret = PTR_ERR(hcd->usb_phy); --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -597,11 +597,7 @@ int xhci_run(struct usb_hcd *hcd) +@@ -612,11 +612,7 @@ int xhci_run(struct usb_hcd *hcd) "// Set the interrupt modulation register"); temp = readl(&xhci->ir_set->irq_control); temp &= ~ER_IRQ_INTERVAL_MASK; From 3a783e59ae0e6599a615fe199768da05609f3da0 Mon Sep 17 00:00:00 2001 From: "Joseph C. Lehner" Date: Fri, 7 Sep 2018 16:22:09 +0200 Subject: [PATCH 025/399] ramips: ex2700: actually remove kmod-mt76* When building using the multiple devices option with per-device root filesystem, only the meta package mt76 is omitted but not the dependencies selected by the package. Explicitly exclude all 3 mt76 packages, plus the metapackage. Otherwise, these modules will be included in the build, wasting a few hundred kilobytes. Signed-off-by: Joseph C. Lehner [mention the root cause of the issue in the commit message] Signed-off-by: Mathias Kresin --- target/linux/ramips/image/mt7620.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index b6499c8806f..f043c141212 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -211,7 +211,7 @@ define Device/ex2700 KERNEL := $(KERNEL_DTB) | uImage lzma | pad-offset 64k 64 | append-uImage-fakehdr filesystem IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ netgear-dni - DEVICE_PACKAGES := -kmod-mt76 + DEVICE_PACKAGES := -kmod-mt76 -kmod-mt7603 -kmod-mt76x2 -kmod-mt76-core DEVICE_TITLE := Netgear EX2700 endef TARGET_DEVICES += ex2700 From e4678c6c01fac468f677633de1bc5116fafefc38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20F=C3=B6rster?= Date: Mon, 24 Sep 2018 22:37:22 +0200 Subject: [PATCH 026/399] ramips: fix Archer C20 sysupgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The sysupgrade image failed the check due to the wrong string in the supported devices. This patch provides the correct name by dropping the SUPPORTED_DEVICES to use the default generated name. Signed-off-by: Steffen Förster [drop the SUPPORTED_DEVICES, the old name was never used in a release] Signed-off-by: Mathias Kresin --- target/linux/ramips/image/mt7620.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index f043c141212..f627627192b 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -475,7 +475,6 @@ TARGET_DEVICES += tiny-ac define Device/tplink_c20-v1 $(Device/Archer) DTS := ArcherC20v1 - SUPPORTED_DEVICES := c20v1 TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0xc2000001 TPLINK_HWREV := 0x44 From 0b99f08a64c3c3a49b1c994a9884c6f1c8bf12a9 Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Mon, 24 Sep 2018 14:09:05 +0200 Subject: [PATCH 027/399] uboot-lantiq: fix compatibility with gcc7 Backport u-boot commit 704f3acfcf55343043bbed01c5fb0a0094a68e8a to fix compatibility with gcc7. Signed-off-by: Martin Schiller --- ...Use_packed_structures-for_networking.patch | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 package/boot/uboot-lantiq/patches/0029-net-Use_packed_structures-for_networking.patch diff --git a/package/boot/uboot-lantiq/patches/0029-net-Use_packed_structures-for_networking.patch b/package/boot/uboot-lantiq/patches/0029-net-Use_packed_structures-for_networking.patch new file mode 100644 index 00000000000..f2f77364e32 --- /dev/null +++ b/package/boot/uboot-lantiq/patches/0029-net-Use_packed_structures-for_networking.patch @@ -0,0 +1,142 @@ +From 704f3acfcf55343043bbed01c5fb0a0094a68e8a Mon Sep 17 00:00:00 2001 +From: Denis Pynkin +Date: Fri, 21 Jul 2017 19:28:42 +0300 +Subject: [PATCH] net: Use packed structures for networking + +PXE boot is broken with GCC 7.1 due option '-fstore-merging' enabled +by default for '-O2': + +BOOTP broadcast 1 +data abort +pc : [<8ff8bb30>] lr : [<00004f1f>] +reloc pc : [<17832b30>] lr : [<878abf1f>] +sp : 8f558bc0 ip : 00000000 fp : 8ffef5a4 +r10: 8ffed248 r9 : 8f558ee0 r8 : 8ffef594 +r7 : 0000000e r6 : 8ffed700 r5 : 00000000 r4 : 8ffed74e +r3 : 00060101 r2 : 8ffed230 r1 : 8ffed706 r0 : 00000ddd +Flags: nzcv IRQs off FIQs off Mode SVC_32 +Resetting CPU ... + +Core reason is usage of structures for network headers without packed +attribute. + +Reviewed-by: Yauheni Kaliuta +Signed-off-by: Denis Pynkin +Acked-by: Joe Hershberger +--- + include/net.h | 14 +++++++------- + net/bootp.h | 2 +- + net/dns.h | 2 +- + net/nfs.h | 2 +- + net/sntp.h | 2 +- + 5 files changed, 11 insertions(+), 11 deletions(-) + +--- a/include/net.h ++++ b/include/net.h +@@ -203,7 +203,7 @@ struct ethernet_hdr { + uchar et_dest[6]; /* Destination node */ + uchar et_src[6]; /* Source node */ + ushort et_protlen; /* Protocol or length */ +-}; ++} __attribute__((packed)); + + /* Ethernet header size */ + #define ETHER_HDR_SIZE (sizeof(struct ethernet_hdr)) +@@ -219,7 +219,7 @@ struct e802_hdr { + uchar et_snap2; + uchar et_snap3; + ushort et_prot; /* 802 protocol */ +-}; ++} __attribute__((packed)); + + /* 802 + SNAP + ethernet header size */ + #define E802_HDR_SIZE (sizeof(struct e802_hdr)) +@@ -233,7 +233,7 @@ struct vlan_ethernet_hdr { + ushort vet_vlan_type; /* PROT_VLAN */ + ushort vet_tag; /* TAG of VLAN */ + ushort vet_type; /* protocol type */ +-}; ++} __attribute__((packed)); + + /* VLAN Ethernet header size */ + #define VLAN_ETHER_HDR_SIZE (sizeof(struct vlan_ethernet_hdr)) +@@ -260,7 +260,7 @@ struct ip_hdr { + ushort ip_sum; /* checksum */ + IPaddr_t ip_src; /* Source IP address */ + IPaddr_t ip_dst; /* Destination IP address */ +-}; ++} __attribute__((packed)); + + #define IP_OFFS 0x1fff /* ip offset *= 8 */ + #define IP_FLAGS 0xe000 /* first 3 bits */ +@@ -288,7 +288,7 @@ struct ip_udp_hdr { + ushort udp_dst; /* UDP destination port */ + ushort udp_len; /* Length of UDP packet */ + ushort udp_xsum; /* Checksum */ +-}; ++} __attribute__((packed)); + + #define IP_UDP_HDR_SIZE (sizeof(struct ip_udp_hdr)) + #define UDP_HDR_SIZE (IP_UDP_HDR_SIZE - IP_HDR_SIZE) +@@ -327,7 +327,7 @@ struct arp_hdr { + uchar ar_tha[]; /* Target hardware address */ + uchar ar_tpa[]; /* Target protocol address */ + #endif /* 0 */ +-}; ++} __attribute__((packed)); + + #define ARP_HDR_SIZE (8+20) /* Size assuming ethernet */ + +@@ -362,7 +362,7 @@ struct icmp_hdr { + } frag; + uchar data[0]; + } un; +-}; ++} __attribute__((packed)); + + #define ICMP_HDR_SIZE (sizeof(struct icmp_hdr)) + #define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE) +--- a/net/bootp.h ++++ b/net/bootp.h +@@ -49,7 +49,7 @@ struct Bootp_t { + char bp_sname[64]; /* Server host name */ + char bp_file[128]; /* Boot file name */ + char bp_vend[OPT_FIELD_SIZE]; /* Vendor information */ +-}; ++} __attribute__((packed)); + + #define BOOTP_HDR_SIZE sizeof(struct Bootp_t) + +--- a/net/dns.h ++++ b/net/dns.h +@@ -29,7 +29,7 @@ struct header { + uint16_t nauth; /* Authority PRs */ + uint16_t nother; /* Other PRs */ + unsigned char data[1]; /* Data, variable length */ +-}; ++} __attribute__((packed)); + + extern void DnsStart(void); /* Begin DNS */ + +--- a/net/sntp.h ++++ b/net/sntp.h +@@ -51,7 +51,7 @@ struct sntp_pkt_t { + unsigned long long originate_timestamp; + unsigned long long receive_timestamp; + unsigned long long transmit_timestamp; +-}; ++} __attribute__((packed)); + + extern void SntpStart(void); /* Begin SNTP */ + +--- a/net/nfs.h ++++ b/net/nfs.h +@@ -68,7 +68,7 @@ struct rpc_t { + uint32_t data[19]; + } reply; + } u; +-}; ++} __attribute__((packed)); + extern void NfsStart(void); /* Begin NFS */ + + From 9f3cce2bfb3f98150a3ef5a2e4cfe2d4d3f3ae9b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 29 Sep 2018 13:32:13 +0200 Subject: [PATCH 028/399] mt76: update to the latest version from the 18.06 branch 497c304 mt7603: fix wcid for frames sent via drv_tx 27af7a5 mt76: fix handling ps-poll frames c3dba28 mt76: check aggregation sequence number for frames sent via drv_tx Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 4f32799eb45..63267102bd2 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-09-21 -PKG_SOURCE_VERSION:=6e1898d60a780c9d89dff9cbb3569f267db13e21 -PKG_MIRROR_HASH:=f2d8a17fa58f6f2ddd284922faeec9dd09c6727dde91caec54f4fdb280f4df1c +PKG_SOURCE_DATE:=2018-09-29 +PKG_SOURCE_VERSION:=c3dba2875902e5e76213acd92d69f69c708789e9 +PKG_MIRROR_HASH:=a568aeb63d94e6f7995ab9cbf21b8042b501ff678235472a008e4248d1353562 PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From b115fcaa8650b451e8e7f9c1c913be2652cfd10f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 29 Sep 2018 16:09:17 +0200 Subject: [PATCH 029/399] mac80211: fix management frame protection issue with mt76 (and possibly other drivers) Software crypto wasn't working for management frames because the flag indicating management frame crypto was missing Signed-off-by: Felix Fietkau --- ...ting-IEEE80211_KEY_FLAG_RX_MGMT-for-.patch | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package/kernel/mac80211/patches/395-mac80211-fix-setting-IEEE80211_KEY_FLAG_RX_MGMT-for-.patch diff --git a/package/kernel/mac80211/patches/395-mac80211-fix-setting-IEEE80211_KEY_FLAG_RX_MGMT-for-.patch b/package/kernel/mac80211/patches/395-mac80211-fix-setting-IEEE80211_KEY_FLAG_RX_MGMT-for-.patch new file mode 100644 index 00000000000..a42668d0691 --- /dev/null +++ b/package/kernel/mac80211/patches/395-mac80211-fix-setting-IEEE80211_KEY_FLAG_RX_MGMT-for-.patch @@ -0,0 +1,25 @@ +From: Felix Fietkau +Date: Sat, 29 Sep 2018 15:55:44 +0200 +Subject: [PATCH] mac80211: fix setting IEEE80211_KEY_FLAG_RX_MGMT for AP mode + keys + +key->sta is only valid after ieee80211_key_link, which is called later +in this function. Because of that, the IEEE80211_KEY_FLAG_RX_MGMT is +never set when management frame protection is enabled. + +Fixes: e548c49e6dc6b ("mac80211: add key flag for management keys") +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/cfg.c ++++ b/net/mac80211/cfg.c +@@ -426,7 +426,7 @@ static int ieee80211_add_key(struct wiph + case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_AP_VLAN: + /* Keys without a station are used for TX only */ +- if (key->sta && test_sta_flag(key->sta, WLAN_STA_MFP)) ++ if (sta && test_sta_flag(sta, WLAN_STA_MFP)) + key->conf.flags |= IEEE80211_KEY_FLAG_RX_MGMT; + break; + case NL80211_IFTYPE_ADHOC: From 2163b4936e2c71fd52579503b01c7fc4520d4520 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 1 Oct 2018 13:39:48 +0200 Subject: [PATCH 030/399] mt76: update to the latest version, fixes mt76x2 beacon issue 53e1110 mt76: mt76x2: fix multi-interface beacon configuration Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 63267102bd2..0a38a22c182 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-09-29 -PKG_SOURCE_VERSION:=c3dba2875902e5e76213acd92d69f69c708789e9 -PKG_MIRROR_HASH:=a568aeb63d94e6f7995ab9cbf21b8042b501ff678235472a008e4248d1353562 +PKG_SOURCE_DATE:=2018-10-01 +PKG_SOURCE_VERSION:=53e1110a354576210b60012cccd5d77af219c60d +PKG_MIRROR_HASH:=2ecc38b502b8875231a5b68d7fa244a89cc27a062cc189d81ab91970d827f05a PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From 23bd33c5a3e2c2fe69ed061bb69471fe84faced9 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 2 Oct 2018 11:13:48 +0200 Subject: [PATCH 031/399] kernel: bump 4.9 to 4.9.130 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch | 4 ++-- .../backport-4.9/090-net-generalize-napi_complete_done.patch | 2 +- .../layerscape/patches-4.9/702-pci-support-layerscape.patch | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 988bdb49a53..db6c87f6a2a 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .129 LINUX_VERSION-4.14 = .72 +LINUX_VERSION-4.9 = .130 -LINUX_KERNEL_HASH-4.9.129 = 6f5510d3fcfec1bf1e2d9c8e2fdcd7628c1886c6bdb29092adc5ccdf75e39318 LINUX_KERNEL_HASH-4.14.72 = df925906250bbc40fcf0137d7ad0fb8edc528d926832634f1233b7540564557f +LINUX_KERNEL_HASH-4.9.130 = 60db3e6a8b00230d5a7c0c8907ef6876702e99c89980bb624f7b649b638b0a7f remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 5c2a435c9f4..049ee78d339 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -303,7 +303,7 @@ #endif /* _LINUX_TYPES_H */ --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c -@@ -1318,8 +1318,8 @@ struct sk_buff **inet_gro_receive(struct +@@ -1319,8 +1319,8 @@ struct sk_buff **inet_gro_receive(struct if (unlikely(ip_fast_csum((u8 *)iph, 5))) goto out_unlock; @@ -567,7 +567,7 @@ goto next_ht; --- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c -@@ -220,7 +220,7 @@ static struct sk_buff **ipv6_gro_receive +@@ -221,7 +221,7 @@ static struct sk_buff **ipv6_gro_receive continue; iph2 = (struct ipv6hdr *)(p->data + off); diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 393c4524e4d..90a158ec82e 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -1379,7 +1379,7 @@ Signed-off-by: David S. Miller */ --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c -@@ -1064,7 +1064,7 @@ err: +@@ -1070,7 +1070,7 @@ err: if (work_done < budget) { int more_to_do = 0; diff --git a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch index 03c3fb7cb98..7ed375e094e 100644 --- a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch @@ -2060,7 +2060,7 @@ Signed-off-by: Yangbo Lu } --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -4679,3 +4679,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IN +@@ -4673,3 +4673,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2031, quirk_no_aersid); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2032, quirk_no_aersid); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2033, quirk_no_aersid); From 670f14ce6781ab59e359f5153556c668e032dbc7 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 2 Oct 2018 11:14:20 +0200 Subject: [PATCH 032/399] kerneL: bump 4.14 to 4.14.73 Refreshed all patches. Removed upstreamed: - 192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch Compile-tested on: cns3xxx, imx6, x86_64 Runtime-tested on: cns3xxx, imx6, x86_64 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...etfilter-flow-table-support-for-IPv6.patch | 4 +- ...ipv6-make-ip6_dst_mtu_forward-inline.patch | 2 +- ...attr-Don-t-operate-on-deleted-inodes.patch | 96 ------------------- ...-support-hardware-flow-table-offload.patch | 2 +- ...-device-to-the-same-MAX-payload-size.patch | 2 +- 6 files changed, 7 insertions(+), 103 deletions(-) delete mode 100644 target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index db6c87f6a2a..0948642793f 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.14 = .72 LINUX_VERSION-4.9 = .130 +LINUX_VERSION-4.14 = .73 -LINUX_KERNEL_HASH-4.14.72 = df925906250bbc40fcf0137d7ad0fb8edc528d926832634f1233b7540564557f LINUX_KERNEL_HASH-4.9.130 = 60db3e6a8b00230d5a7c0c8907ef6876702e99c89980bb624f7b649b638b0a7f +LINUX_KERNEL_HASH-4.14.73 = 999e38141ccc447df7bf7ce10b8803c12b32274b76d3d5400bf3fd88eee0e31e remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch b/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch index cfb13231c62..3e7db09068d 100644 --- a/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch +++ b/target/linux/generic/backport-4.14/324-v4.16-netfilter-flow-table-support-for-IPv6.patch @@ -26,7 +26,7 @@ Signed-off-by: Pablo Neira Ayuso struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -383,7 +383,7 @@ static inline int ip6_forward_finish(str +@@ -381,7 +381,7 @@ static inline int ip6_forward_finish(str return dst_output(net, sk, skb); } @@ -35,7 +35,7 @@ Signed-off-by: Pablo Neira Ayuso { unsigned int mtu; struct inet6_dev *idev; -@@ -403,6 +403,7 @@ static unsigned int ip6_dst_mtu_forward( +@@ -401,6 +401,7 @@ static unsigned int ip6_dst_mtu_forward( return mtu; } diff --git a/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch b/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch index f12366f5430..daa4d3b3d85 100644 --- a/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch +++ b/target/linux/generic/backport-4.14/350-v4.18-ipv6-make-ip6_dst_mtu_forward-inline.patch @@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau struct dst_entry *ip6_dst_lookup_flow(const struct sock *sk, struct flowi6 *fl6, --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -383,28 +383,6 @@ static inline int ip6_forward_finish(str +@@ -381,28 +381,6 @@ static inline int ip6_forward_finish(str return dst_output(net, sk, skb); } diff --git a/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch b/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch deleted file mode 100644 index cd9a758e373..00000000000 --- a/target/linux/generic/pending-4.14/192-Revert-ubifs-xattr-Don-t-operate-on-deleted-inodes.patch +++ /dev/null @@ -1,96 +0,0 @@ -From a99708737f566c70651015332e89d0d3b1eb5529 Mon Sep 17 00:00:00 2001 -From: Koen Vandeputte -Date: Mon, 17 Sep 2018 10:13:09 +0200 -Subject: [PATCH] Revert "ubifs: xattr: Don't operate on deleted inodes" - -This reverts commit 8a23348d76a1e7716da6e76383281ac82fc071cf. - -UBIFS wants to assert that xattr operations are only issued on files -with positive link count. The said patch made this operations return --ENOENT for unlinked files such that the asserts will no longer trigger. -This was wrong since xattr operations are perfectly fine on unlinked -files. -Instead the assertions need to be fixed/removed. - -Fixes: 11a6fc3dc743 ("ubifs: xattr: Don't operate on deleted inodes") -Reported-by: Koen Vandeputte -Signed-off-by: Richard Weinberger ---- - fs/ubifs/xattr.c | 24 ------------------------ - 1 file changed, 24 deletions(-) - ---- a/fs/ubifs/xattr.c -+++ b/fs/ubifs/xattr.c -@@ -152,12 +152,6 @@ static int create_xattr(struct ubifs_inf - ui->data_len = size; - - mutex_lock(&host_ui->ui_mutex); -- -- if (!host->i_nlink) { -- err = -ENOENT; -- goto out_noent; -- } -- - host->i_ctime = current_time(host); - host_ui->xattr_cnt += 1; - host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); -@@ -189,7 +183,6 @@ out_cancel: - host_ui->xattr_size -= CALC_XATTR_BYTES(size); - host_ui->xattr_names -= fname_len(nm); - host_ui->flags &= ~UBIFS_CRYPT_FL; --out_noent: - mutex_unlock(&host_ui->ui_mutex); - out_free: - make_bad_inode(inode); -@@ -241,12 +234,6 @@ static int change_xattr(struct ubifs_inf - mutex_unlock(&ui->ui_mutex); - - mutex_lock(&host_ui->ui_mutex); -- -- if (!host->i_nlink) { -- err = -ENOENT; -- goto out_noent; -- } -- - host->i_ctime = current_time(host); - host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); - host_ui->xattr_size += CALC_XATTR_BYTES(size); -@@ -268,7 +255,6 @@ static int change_xattr(struct ubifs_inf - out_cancel: - host_ui->xattr_size -= CALC_XATTR_BYTES(size); - host_ui->xattr_size += CALC_XATTR_BYTES(old_size); --out_noent: - mutex_unlock(&host_ui->ui_mutex); - make_bad_inode(inode); - out_free: -@@ -497,12 +483,6 @@ static int remove_xattr(struct ubifs_inf - return err; - - mutex_lock(&host_ui->ui_mutex); -- -- if (!host->i_nlink) { -- err = -ENOENT; -- goto out_noent; -- } -- - host->i_ctime = current_time(host); - host_ui->xattr_cnt -= 1; - host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); -@@ -522,7 +502,6 @@ out_cancel: - host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); - host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); - host_ui->xattr_names += fname_len(nm); --out_noent: - mutex_unlock(&host_ui->ui_mutex); - ubifs_release_budget(c, &req); - make_bad_inode(inode); -@@ -562,9 +541,6 @@ static int ubifs_xattr_remove(struct ino - - ubifs_assert(inode_is_locked(host)); - -- if (!host->i_nlink) -- return -ENOENT; -- - if (fname_len(&nm) > UBIFS_MAX_NLEN) - return -ENAMETOOLONG; - diff --git a/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch index 935b79d1dd5..edba04ccf6f 100644 --- a/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch +++ b/target/linux/generic/pending-4.14/644-net-pppoe-support-hardware-flow-table-offload.patch @@ -73,7 +73,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -974,8 +979,36 @@ static int pppoe_xmit(struct ppp_channel +@@ -977,8 +982,36 @@ static int pppoe_xmit(struct ppp_channel return __pppoe_xmit(sk, skb); } diff --git a/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch b/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch index 1847c44803a..74e78d3b54a 100644 --- a/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch +++ b/target/linux/mvebu/patches-4.14/524-PCI-aardvark-set-host-and-device-to-the-same-MAX-payload-size.patch @@ -126,7 +126,7 @@ Signed-off-by: Thomas Petazzoni static int advk_pcie_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; -@@ -959,6 +1014,9 @@ static int advk_pcie_probe(struct platfo +@@ -960,6 +1015,9 @@ static int advk_pcie_probe(struct platfo list_for_each_entry(child, &bus->children, node) pcie_bus_configure_settings(child); From cd12c91dde48dc4b73d4e5f6224adae61ad51900 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Fri, 28 Sep 2018 09:42:33 +0100 Subject: [PATCH 033/399] kmod-sched-cake: don't gso fixup on fixed kernels Kernels 4.14.73 & 4.9.140 include the gso fixup fix, so cake doesn't need to do it. Let's not waste cpu cycles by doing it in cake which could be really important on cpu constrained devices. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit b47614f9f18c7d1c24104ef1d53c8d1ac8920ba4) --- package/kernel/kmod-sched-cake/Makefile | 2 +- ...-remove-skb-max-fix-on-fixed-kernels.patch | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index ce7ac272616..3510437eb97 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=sched-cake -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git diff --git a/package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch b/package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch new file mode 100644 index 00000000000..5f1f3a916ab --- /dev/null +++ b/package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch @@ -0,0 +1,22 @@ +--- a/sch_cake.c ++++ b/sch_cake.c +@@ -1799,13 +1799,18 @@ static s32 cake_enqueue(struct sk_buff * + cobalt_set_enqueue_time(segs, now); + get_cobalt_cb(segs)->adjusted_len = cake_overhead(q, + segs); +- ++#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 124) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)) || \ ++ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 159) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) || \ ++ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 130) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) || \ ++ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 73) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)) || \ ++ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 11))) + /* For encapsulated packets, the mac_len may not be set + * correctly after GSO split. Fix this by resetting it; + * if skb_gso_segment() already does this correctly, + * this is will just recalculate the current value. + */ + skb_reset_mac_len(skb); ++#endif + + flow_queue_add(flow, segs); + From fca87a9871032b9e67fb2078885d93ed81b37876 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Tue, 2 Oct 2018 19:54:30 +0100 Subject: [PATCH 034/399] kmod-sched-cake: bump to 20181002 Revert "Add workaround for wrong skb->mac_len values after splitting GSO" Remove our local patch which did the same thing. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 885052fbfb0ea5ee49e6abc6878ae99ee011688b) --- package/kernel/kmod-sched-cake/Makefile | 8 +++---- ...-remove-skb-max-fix-on-fixed-kernels.patch | 22 ------------------- 2 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index 3510437eb97..c771081d782 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=sched-cake -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2018-09-11 -PKG_SOURCE_VERSION:=42e87f12ea5c390bf5eeb658c942bc810046160a -PKG_MIRROR_HASH:=56c71ae079e4c64aef2564d42d2efd31621e7e9f5220844ad1ea795e2f1cb1fd +PKG_SOURCE_DATE:=2018-10-02 +PKG_SOURCE_VERSION:=ddf4c95145f2fbcca16f19e01f3195d213ca760b +PKG_MIRROR_HASH:=c5fd914fa1129e1cbe46e3dff30077b3265446538831e3a668229c22c4cf497a PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch b/package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch deleted file mode 100644 index 5f1f3a916ab..00000000000 --- a/package/kernel/kmod-sched-cake/patches/100-remove-skb-max-fix-on-fixed-kernels.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/sch_cake.c -+++ b/sch_cake.c -@@ -1799,13 +1799,18 @@ static s32 cake_enqueue(struct sk_buff * - cobalt_set_enqueue_time(segs, now); - get_cobalt_cb(segs)->adjusted_len = cake_overhead(q, - segs); -- -+#if !((LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 124) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0)) || \ -+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 159) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)) || \ -+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 130) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) || \ -+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 73) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)) || \ -+ (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 11))) - /* For encapsulated packets, the mac_len may not be set - * correctly after GSO split. Fix this by resetting it; - * if skb_gso_segment() already does this correctly, - * this is will just recalculate the current value. - */ - skb_reset_mac_len(skb); -+#endif - - flow_queue_add(flow, segs); - From 8baadecb1647a125f5d8f9eaf521c1468543133a Mon Sep 17 00:00:00 2001 From: David Bauer Date: Tue, 11 Sep 2018 17:04:16 +0200 Subject: [PATCH 035/399] ar71xx: flag FritzBox 4020 buttons as active low Buttons of AVM FritzBox 4020 are incorrectly flagged as active high. This was an oversight as RFKill button was working as expected even with incorrectly flagged GPIO. Signed-off-by: David Bauer (cherry picked from commit cd02d4faf981bd4de0427cd23812b41192635d82) --- target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c index ed7f9a8b3ea..c00cf681b2d 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-fritz4020.c @@ -169,7 +169,7 @@ static struct gpio_keys_button fritz4020_gpio_keys[] __initdata = { .code = KEY_RFKILL, .debounce_interval = FRITZ4020_KEYS_DEBOUNCE_INTERVAL, .gpio = FRITZ4020_GPIO_BTN_WLAN, - .active_low = 0, + .active_low = 1, }, { .desc = "WPS button", @@ -177,7 +177,7 @@ static struct gpio_keys_button fritz4020_gpio_keys[] __initdata = { .code = KEY_WPS_BUTTON, .debounce_interval = FRITZ4020_KEYS_DEBOUNCE_INTERVAL, .gpio = FRITZ4020_GPIO_BTN_WPS, - .active_low = 0, + .active_low = 1, }, }; From d837c936234c37ff6d5a885a515b4ba145a6ff52 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 4 Oct 2018 11:27:39 +0200 Subject: [PATCH 036/399] kernel: bump 4.9 to 4.9.131 Refreshed all patches. Fixes CVE: - CVE-2018-10880 - CVE-2018-7755 Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../816-tty-serial-support-layerscape.patch | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 0948642793f..1debeba2e9d 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .130 LINUX_VERSION-4.14 = .73 +LINUX_VERSION-4.9 = .131 -LINUX_KERNEL_HASH-4.9.130 = 60db3e6a8b00230d5a7c0c8907ef6876702e99c89980bb624f7b649b638b0a7f LINUX_KERNEL_HASH-4.14.73 = 999e38141ccc447df7bf7ce10b8803c12b32274b76d3d5400bf3fd88eee0e31e +LINUX_KERNEL_HASH-4.9.131 = 57db3295469d3990af93703a97b07f1e8a14920bf3f5b68ce0330a02e7aa5d60 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/layerscape/patches-4.9/816-tty-serial-support-layerscape.patch b/target/linux/layerscape/patches-4.9/816-tty-serial-support-layerscape.patch index dd28ef6c04e..3271563f7f4 100644 --- a/target/linux/layerscape/patches-4.9/816-tty-serial-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/816-tty-serial-support-layerscape.patch @@ -24,7 +24,7 @@ Signed-off-by: Yangbo Lu struct lpuart_port { struct uart_port port; struct clk *clk; -@@ -1348,6 +1350,18 @@ lpuart_set_termios(struct uart_port *por +@@ -1349,6 +1351,18 @@ lpuart_set_termios(struct uart_port *por /* ask the core to calculate the divisor */ baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16); @@ -43,7 +43,7 @@ Signed-off-by: Yangbo Lu spin_lock_irqsave(&sport->port.lock, flags); sport->port.read_status_mask = 0; -@@ -1397,22 +1411,11 @@ lpuart_set_termios(struct uart_port *por +@@ -1398,22 +1412,11 @@ lpuart_set_termios(struct uart_port *por /* restore control register */ writeb(old_cr2, sport->port.membase + UARTCR2); @@ -69,7 +69,7 @@ Signed-off-by: Yangbo Lu } spin_unlock_irqrestore(&sport->port.lock, flags); -@@ -1640,6 +1643,13 @@ lpuart_console_write(struct console *co, +@@ -1641,6 +1644,13 @@ lpuart_console_write(struct console *co, { struct lpuart_port *sport = lpuart_ports[co->index]; unsigned char old_cr2, cr2; @@ -83,7 +83,7 @@ Signed-off-by: Yangbo Lu /* first save CR2 and then disable interrupts */ cr2 = old_cr2 = readb(sport->port.membase + UARTCR2); -@@ -1654,6 +1664,9 @@ lpuart_console_write(struct console *co, +@@ -1655,6 +1665,9 @@ lpuart_console_write(struct console *co, barrier(); writeb(old_cr2, sport->port.membase + UARTCR2); @@ -93,7 +93,7 @@ Signed-off-by: Yangbo Lu } static void -@@ -1661,6 +1674,13 @@ lpuart32_console_write(struct console *c +@@ -1662,6 +1675,13 @@ lpuart32_console_write(struct console *c { struct lpuart_port *sport = lpuart_ports[co->index]; unsigned long old_cr, cr; @@ -107,7 +107,7 @@ Signed-off-by: Yangbo Lu /* first save CR2 and then disable interrupts */ cr = old_cr = lpuart32_read(sport->port.membase + UARTCTRL); -@@ -1675,6 +1695,9 @@ lpuart32_console_write(struct console *c +@@ -1676,6 +1696,9 @@ lpuart32_console_write(struct console *c barrier(); lpuart32_write(old_cr, sport->port.membase + UARTCTRL); @@ -117,7 +117,7 @@ Signed-off-by: Yangbo Lu } /* -@@ -1899,13 +1922,13 @@ static int lpuart_probe(struct platform_ +@@ -1900,13 +1923,13 @@ static int lpuart_probe(struct platform_ ret = of_alias_get_id(np, "serial"); if (ret < 0) { @@ -137,7 +137,7 @@ Signed-off-by: Yangbo Lu sport->port.line = ret; sport->lpuart32 = of_device_is_compatible(np, "fsl,ls1021a-lpuart"); -@@ -1987,6 +2010,7 @@ static int lpuart_remove(struct platform +@@ -1988,6 +2011,7 @@ static int lpuart_remove(struct platform struct lpuart_port *sport = platform_get_drvdata(pdev); uart_remove_one_port(&lpuart_reg, &sport->port); @@ -145,7 +145,7 @@ Signed-off-by: Yangbo Lu clk_disable_unprepare(sport->clk); -@@ -2071,12 +2095,10 @@ static int lpuart_resume(struct device * +@@ -2072,12 +2096,10 @@ static int lpuart_resume(struct device * if (sport->lpuart_dma_rx_use) { if (sport->port.irq_wake) { From 149dcc26d132dffa6f0ee92878c5954bb95bfe79 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 4 Oct 2018 11:28:09 +0200 Subject: [PATCH 037/399] kernel: bump 4.14 to 4.14.74 Refreshed all patches. Fixes CVE: - CVE-2018-7755 Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../generic/hack-4.14/902-debloat_proc.patch | 2 +- ...2-tsens-support-configurable-interrupts.patch | 16 ++++++++-------- .../linux/mediatek/patches-4.14/0064-dts.patch | 2 +- .../0031-uvc-add-iPassion-iP2970-support.patch | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 1debeba2e9d..05cbc9a17e9 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.14 = .73 LINUX_VERSION-4.9 = .131 +LINUX_VERSION-4.14 = .74 -LINUX_KERNEL_HASH-4.14.73 = 999e38141ccc447df7bf7ce10b8803c12b32274b76d3d5400bf3fd88eee0e31e LINUX_KERNEL_HASH-4.9.131 = 57db3295469d3990af93703a97b07f1e8a14920bf3f5b68ce0330a02e7aa5d60 +LINUX_KERNEL_HASH-4.14.74 = 70e69189fd7b2f96fa33833735c7bcf3281dc0172c3734e2c5819e9d57015c72 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 46c12e0c182..e89786b47ab 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau --- a/fs/locks.c +++ b/fs/locks.c -@@ -2805,6 +2805,8 @@ static const struct file_operations proc +@@ -2812,6 +2812,8 @@ static const struct file_operations proc static int __init proc_locks_init(void) { diff --git a/target/linux/ipq806x/patches-4.14/0063-2-tsens-support-configurable-interrupts.patch b/target/linux/ipq806x/patches-4.14/0063-2-tsens-support-configurable-interrupts.patch index 4469896ae28..944d1e575bd 100644 --- a/target/linux/ipq806x/patches-4.14/0063-2-tsens-support-configurable-interrupts.patch +++ b/target/linux/ipq806x/patches-4.14/0063-2-tsens-support-configurable-interrupts.patch @@ -79,7 +79,7 @@ Signed-off-by: Rajith Cherian return -EINVAL; return data->ops->get_trend(data->sensor_data, trip, trend); -@@ -286,7 +290,9 @@ static int of_thermal_set_mode(struct th +@@ -289,7 +293,9 @@ static int of_thermal_set_mode(struct th mutex_unlock(&tz->lock); data->mode = mode; @@ -90,7 +90,7 @@ Signed-off-by: Rajith Cherian return 0; } -@@ -296,7 +302,8 @@ static int of_thermal_get_trip_type(stru +@@ -299,7 +305,8 @@ static int of_thermal_get_trip_type(stru { struct __thermal_zone *data = tz->devdata; @@ -100,7 +100,7 @@ Signed-off-by: Rajith Cherian return -EDOM; *type = data->trips[trip].type; -@@ -304,12 +311,39 @@ static int of_thermal_get_trip_type(stru +@@ -307,12 +314,39 @@ static int of_thermal_get_trip_type(stru return 0; } @@ -141,7 +141,7 @@ Signed-off-by: Rajith Cherian return -EDOM; *temp = data->trips[trip].temperature; -@@ -322,7 +356,8 @@ static int of_thermal_set_trip_temp(stru +@@ -325,7 +359,8 @@ static int of_thermal_set_trip_temp(stru { struct __thermal_zone *data = tz->devdata; @@ -151,7 +151,7 @@ Signed-off-by: Rajith Cherian return -EDOM; if (data->ops->set_trip_temp) { -@@ -344,7 +379,8 @@ static int of_thermal_get_trip_hyst(stru +@@ -347,7 +382,8 @@ static int of_thermal_get_trip_hyst(stru { struct __thermal_zone *data = tz->devdata; @@ -161,7 +161,7 @@ Signed-off-by: Rajith Cherian return -EDOM; *hyst = data->trips[trip].hysteresis; -@@ -357,7 +393,8 @@ static int of_thermal_set_trip_hyst(stru +@@ -360,7 +396,8 @@ static int of_thermal_set_trip_hyst(stru { struct __thermal_zone *data = tz->devdata; @@ -171,7 +171,7 @@ Signed-off-by: Rajith Cherian return -EDOM; /* thermal framework should take care of data->mask & (1 << trip) */ -@@ -432,6 +469,9 @@ thermal_zone_of_add_sensor(struct device +@@ -435,6 +472,9 @@ thermal_zone_of_add_sensor(struct device if (ops->set_emul_temp) tzd->ops->set_emul_temp = of_thermal_set_emul_temp; @@ -181,7 +181,7 @@ Signed-off-by: Rajith Cherian mutex_unlock(&tzd->lock); return tzd; -@@ -726,7 +766,10 @@ static const char * const trip_types[] = +@@ -729,7 +769,10 @@ static const char * const trip_types[] = [THERMAL_TRIP_ACTIVE] = "active", [THERMAL_TRIP_PASSIVE] = "passive", [THERMAL_TRIP_HOT] = "hot", diff --git a/target/linux/mediatek/patches-4.14/0064-dts.patch b/target/linux/mediatek/patches-4.14/0064-dts.patch index 08feb8d731e..a2f5000d4d1 100644 --- a/target/linux/mediatek/patches-4.14/0064-dts.patch +++ b/target/linux/mediatek/patches-4.14/0064-dts.patch @@ -579,7 +579,7 @@ + --- a/arch/arm/boot/dts/mt7623.dtsi +++ b/arch/arm/boot/dts/mt7623.dtsi -@@ -323,6 +323,7 @@ +@@ -326,6 +326,7 @@ "syscon"; reg = <0 0x10209000 0 0x1000>; #clock-cells = <1>; diff --git a/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch index 5829b2fdd0c..85a5c1310c1 100644 --- a/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch @@ -64,7 +64,7 @@ Signed-off-by: John Crispin #include -@@ -1081,9 +1086,149 @@ static void uvc_video_decode_data(struct +@@ -1093,9 +1098,149 @@ static void uvc_video_decode_data(struct } } @@ -214,7 +214,7 @@ Signed-off-by: John Crispin /* Mark the buffer as done if the EOF marker is set. */ if (data[1] & UVC_STREAM_EOF && buf->bytesused != 0) { uvc_trace(UVC_TRACE_FRAME, "Frame complete (EOF found).\n"); -@@ -1498,6 +1643,8 @@ static int uvc_init_video_isoc(struct uv +@@ -1510,6 +1655,8 @@ static int uvc_init_video_isoc(struct uv if (npackets == 0) return -ENOMEM; From b3c64797db86b4c2ff315a25ce063b983e4ae71c Mon Sep 17 00:00:00 2001 From: Amol Bhave Date: Tue, 2 Oct 2018 08:48:27 -0700 Subject: [PATCH 038/399] build: use CMAKE_SOURCE_SUBDIR variable to cmake.mk Sometimes, the CMakeLists.txt file is not in the root directory of a repo. In those cases, the CMAKE_SOURCE_SUBDIR variable can be specified to use CMakeLists.txt from a subdirectory instead. Signed-off-by: Amol Bhave --- include/cmake.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cmake.mk b/include/cmake.mk index 900dae1d4af..b66665d20ae 100644 --- a/include/cmake.mk +++ b/include/cmake.mk @@ -7,8 +7,8 @@ ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) endif CMAKE_BINARY_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_BINARY_SUBDIR),/$(CMAKE_BINARY_SUBDIR)) -CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR) -HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR) +CMAKE_SOURCE_DIR = $(PKG_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR)) +HOST_CMAKE_SOURCE_DIR = $(HOST_BUILD_DIR)$(if $(CMAKE_SOURCE_SUBDIR),/$(CMAKE_SOURCE_SUBDIR)) MAKE_PATH = $(firstword $(CMAKE_BINARY_SUBDIR) .) ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) From f3753a9ae0c725bd48b5d330d60f714325dc2d5d Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sun, 7 Oct 2018 15:33:29 +0200 Subject: [PATCH 039/399] netifd: fix segfault (FS#1875) d0fa124 iprule: fix segfault (FS#1875) Signed-off-by: Hans Dedecker --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 33276a90dd8..d77fe9b96e9 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2018-07-30 -PKG_SOURCE_VERSION:=a0a1e52eb300b574098ae18fc7e6849ff50c2e5e -PKG_MIRROR_HASH:=f2a556e0de1e04d4e7b6ca30d3e7c65710659201fc81efb10420cd895d72a307 +PKG_SOURCE_DATE:=2018-10-07 +PKG_SOURCE_VERSION:=d0fa124eac8bb0e35680d80ea719eada873267be +PKG_MIRROR_HASH:=eac9deaa3b422172751f7311d31b45bcebc329058e05c79d2ffa902258d4163c PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From 234b893a18a034e4ce7a07ae6264525bad949e82 Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 1 Oct 2018 11:48:04 +0200 Subject: [PATCH 040/399] base-files: Reintroduce sysupgrade_pre_upgrade hook The sysupgrade_pre_upgrade hook was removed with 6a27c2f4b1a4 ("base-files: drop fwtool_pre_upgrade") while there were still scripts using it: * target/linux/ar71xx/base-files/lib/upgrade/allnet.sh * target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh * target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh Not running the hooks can either prevent a successful upgrade or brick the device because the fw_setenv program cannot be started correctly. Fixes: 6a27c2f4b1a4 ("base-files: drop fwtool_pre_upgrade") Signed-off-by: Sven Eckelmann --- package/base-files/files/sbin/sysupgrade | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index a378b029500..2f579fb8743 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -137,6 +137,7 @@ add_overlayfiles() { # hooks sysupgrade_image_check="fwtool_check_image platform_check_image" +sysupgrade_pre_upgrade="" if [ $SAVE_OVERLAY = 1 ]; then [ ! -d /overlay/upper/etc ] && { @@ -263,6 +264,8 @@ else rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap fi +run_hooks "" $sysupgrade_pre_upgrade + install_bin /sbin/upgraded v "Commencing upgrade. Closing all shell sessions." From 95e2da836688469924df07f0009a94098e9c75fa Mon Sep 17 00:00:00 2001 From: Sven Eckelmann Date: Mon, 1 Oct 2018 12:27:25 +0200 Subject: [PATCH 041/399] ar71xx: Fix installation of fw_setenv in sysupgrade ramdisk The install_bin from /lib/upgrade/common.sh is no longer creating the symlinks when a secondary parameter is added. But the fw_setenv program was always copied this way to the ramdisk for the upgrade. Instead, just install fw_setenv and let install_bin handle the detection of the required dependencies. Fixes: 438dcbfe74a6 ("base-files: automatically handle paths and symlinks for RAMFS_COPY_BIN") Signed-off-by: Sven Eckelmann --- target/linux/ar71xx/base-files/lib/upgrade/allnet.sh | 6 +++--- target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh b/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh index 98b368d1505..c17024d127e 100644 --- a/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/allnet.sh @@ -6,7 +6,7 @@ # make sure we got uboot-envtools and fw_env.config copied over to the ramfs # create /var/lock for the lock "fw_setenv.lock" of fw_setenv platform_add_ramfs_ubootenv() { - [ -e /usr/sbin/fw_printenv ] && install_bin /usr/sbin/fw_printenv /usr/sbin/fw_setenv + [ -e /usr/sbin/fw_setenv ] && install_bin /usr/sbin/fw_setenv [ -e /etc/fw_env.config ] && install_file /etc/fw_env.config mkdir -p $RAM_ROOT/var/lock } @@ -71,8 +71,8 @@ platform_get_offset() { } platform_check_image_allnet() { - local fw_printenv=/usr/sbin/fw_printenv - [ ! -n "$fw_printenv" -o ! -x "$fw_printenv" ] && { + local fw_setenv=/usr/sbin/fw_setenv + [ ! -n "$fw_setenv" -o ! -x "$fw_setenv" ] && { echo "Please install uboot-envtools!" return 1 } diff --git a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh index 6085b300a00..650a6be6dc9 100644 --- a/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh @@ -30,7 +30,7 @@ cfg_value_get() # create /var/lock for the lock "fw_setenv.lock" of fw_setenv platform_add_ramfs_ubootenv() { - [ -e /usr/sbin/fw_printenv ] && install_bin /usr/sbin/fw_printenv /usr/sbin/fw_setenv + [ -e /usr/sbin/fw_setenv ] && install_bin /usr/sbin/fw_setenv [ -e /etc/fw_env.config ] && install_file /etc/fw_env.config mkdir -p $RAM_ROOT/var/lock } @@ -100,7 +100,7 @@ platform_check_image_openmesh() { local img_magic=$1 local img_path=$2 - local fw_printenv=/usr/sbin/fw_printenv + local fw_setenv=/usr/sbin/fw_setenv local img_board_target= img_num_files= i=0 local cfg_name= kernel_name= rootfs_name= @@ -144,7 +144,7 @@ platform_check_image_openmesh() return 1 } - [ ! -x "$fw_printenv" ] && { + [ ! -x "$fw_setenv" ] && { echo "Please install uboot-envtools!" return 1 } From 0dbe3d28f7e2716e568ef36c8fa4d3c0964239f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Sun, 7 Oct 2018 14:17:50 +0200 Subject: [PATCH 042/399] iperf: fix --daemon option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Support for -D got broken in the 2.0.11 release by the upstream commit 218d8c667944 ("first pass L2 mode w/UDP checks, v4 only"). After that commit clients were still able to connect but no traffic was passed. It was reported and is fixed now in the upstream git repository. Backport two patches to fix this. The first one is just a requirement for the later to apply. The second one is the real fix and it needed only a small adjustment to apply without backporing the commit 10887b59c7e7 ("fix --txstart-time report messages"). Fixes: 7d15f96eaf76 ("iperf: bump to 2.0.12") Signed-off-by: Rafał Miłecki (cherry picked from commit 87cd118794cc9375260ea213838e80ad5295e83c) --- package/network/utils/iperf/Makefile | 2 +- ...n-signal-handling-per-POSIX-calling-.patch | 43 +++++ ...rtup-fix-daemon-mode-per-redirecting.patch | 161 ++++++++++++++++++ 3 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch create mode 100644 package/network/utils/iperf/patches/0002-cleanup-main-startup-fix-daemon-mode-per-redirecting.patch diff --git a/package/network/utils/iperf/Makefile b/package/network/utils/iperf/Makefile index 3f7bfad9cc5..6facf7bea79 100644 --- a/package/network/utils/iperf/Makefile +++ b/package/network/utils/iperf/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf PKG_VERSION:=2.0.12 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_HASH:=367f651fb1264b13f6518e41b8a7e08ce3e41b2a1c80e99ff0347561eed32646 diff --git a/package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch b/package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch new file mode 100644 index 00000000000..a713e06b963 --- /dev/null +++ b/package/network/utils/iperf/patches/0001-fix-latent-bug-in-signal-handling-per-POSIX-calling-.patch @@ -0,0 +1,43 @@ +From 7c0ac64ebea38d0d9ff4d160db4d33bc087a3490 Mon Sep 17 00:00:00 2001 +From: Robert McMahon +Date: Mon, 16 Jul 2018 17:51:29 -0700 +Subject: [PATCH] fix latent bug in signal handling, per POSIX calling exit() + in signal handler is not safe. Use _exit() instead. Also, detect the user + signal SIGINT for the case of server needing two invocations to stop server + threads. Note: the server threads still need some work from graceful + termination with a single ctrl-c + +--- + +--- a/compat/signal.c ++++ b/compat/signal.c +@@ -171,7 +171,7 @@ void sig_exit( int inSigno ) { + static int num = 0; + if ( num++ == 0 ) { + fflush( 0 ); +- exit( 0 ); ++ _exit(0); + } + } /* end sig_exit */ + +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -268,7 +268,7 @@ void Sig_Interupt( int inSigno ) { + // We try to not allow a single interrupt handled by multiple threads + // to completely kill the app so we save off the first thread ID + // then that is the only thread that can supply the next interrupt +- if ( thread_equalid( sThread, thread_zeroid() ) ) { ++ if ( (inSigno == SIGINT) && thread_equalid( sThread, thread_zeroid() ) ) { + sThread = thread_getid(); + } else if ( thread_equalid( sThread, thread_getid() ) ) { + sig_exit( inSigno ); +@@ -420,9 +420,3 @@ VOID ServiceStop() { + } + + #endif +- +- +- +- +- +- diff --git a/package/network/utils/iperf/patches/0002-cleanup-main-startup-fix-daemon-mode-per-redirecting.patch b/package/network/utils/iperf/patches/0002-cleanup-main-startup-fix-daemon-mode-per-redirecting.patch new file mode 100644 index 00000000000..c8655c91421 --- /dev/null +++ b/package/network/utils/iperf/patches/0002-cleanup-main-startup-fix-daemon-mode-per-redirecting.patch @@ -0,0 +1,161 @@ +From 755be8bdb48d2536e39d2d7cf84e8a8f86b8776f Mon Sep 17 00:00:00 2001 +From: Robert McMahon +Date: Sat, 6 Oct 2018 13:36:52 -0700 +Subject: [PATCH] cleanup main startup, fix daemon mode per redirecting stdin, + stderr and stdout to /dev/null + +--- + +--- a/src/main.cpp ++++ b/src/main.cpp +@@ -167,67 +167,7 @@ int main( int argc, char **argv ) { + Settings_ParseCommandLine( argc, argv, ext_gSettings ); + + // Check for either having specified client or server +- if ( ext_gSettings->mThreadMode == kMode_Client +- || ext_gSettings->mThreadMode == kMode_Listener ) { +-#ifdef WIN32 +- // Start the server as a daemon +- if ( isDaemon( ext_gSettings )) { +- if (ext_gSettings->mThreadMode == kMode_Listener) { +- CmdInstallService(argc, argv); +- } else { +- fprintf(stderr, "Client cannot be run as a daemon\n"); +- } +- return 0; +- } +- +- // Remove the Windows service if requested +- if ( isRemoveService( ext_gSettings ) ) { +- // remove the service +- if ( CmdRemoveService() ) { +- fprintf(stderr, "IPerf Service is removed.\n"); +- return 0; +- } +- } +-#else +- if ( isDaemon( ext_gSettings ) ) { +- if (ext_gSettings->mThreadMode != kMode_Listener) { +- fprintf(stderr, "Iperf client cannot be run as a daemon\n"); +- return 0; +- } +- if (daemon(1, 1) < 0) { +- perror("daemon"); +- } +- fprintf( stderr, "Running Iperf Server as a daemon\n"); +- fprintf( stderr, "The Iperf daemon process ID : %d\n",((int)getpid())); +- fclose(stdout); +- fclose(stderr); +- fclose(stdin); +- } +-#endif +- // initialize client(s) +- if ( ext_gSettings->mThreadMode == kMode_Client ) { +- client_init( ext_gSettings ); +- } +- +-#ifdef HAVE_THREAD +- // start up the reporter and client(s) or listener +- { +- thread_Settings *into = NULL; +- // Create the settings structure for the reporter thread +- Settings_Copy( ext_gSettings, &into ); +- into->mThreadMode = kMode_Reporter; +- +- // Have the reporter launch the client or listener +- into->runNow = ext_gSettings; +- +- // Start all the threads that are ready to go +- thread_start( into ); +- } +-#else +- // No need to make a reporter thread because we don't have threads +- thread_start( ext_gSettings ); +-#endif +- } else { ++ if ((ext_gSettings->mThreadMode != kMode_Client) && (ext_gSettings->mThreadMode != kMode_Listener)) { + // neither server nor client mode was specified + // print usage and exit + +@@ -236,20 +176,75 @@ int main( int argc, char **argv ) { + // Starting in 2.0 to restart a previously defined service + // you must call iperf with "iperf -D" or using the environment variable + SERVICE_TABLE_ENTRY dispatchTable[] = +- { +- { (LPSTR)TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main}, +- { NULL, NULL} +- }; ++ { ++ { (LPSTR)TEXT(SZSERVICENAME), (LPSERVICE_MAIN_FUNCTION)service_main}, ++ { NULL, NULL} ++ }; + + // starting the service by SCM, there is no arguments will be passed in. + // the arguments will pass into Service_Main entry. + if (!StartServiceCtrlDispatcher(dispatchTable) ) + // If the service failed to start then print usage + #endif +- fprintf( stderr, usage_short, argv[0], argv[0] ); ++ fprintf( stderr, usage_short, argv[0], argv[0] ); ++ return 0; ++ } ++ ++ ++ switch (ext_gSettings->mThreadMode) { ++ case kMode_Client : ++ if ( isDaemon( ext_gSettings ) ) { ++ fprintf(stderr, "Iperf client cannot be run as a daemon\n"); ++ return 0; ++ } ++ // initialize client(s) ++ client_init( ext_gSettings ); ++ break; ++ case kMode_Listener : ++ if ( isDaemon( ext_gSettings ) ) { ++ fprintf( stderr, "Running Iperf Server as a daemon\n"); ++ // Start the server as a daemon ++#ifdef WIN32 ++ CmdInstallService(argc, argv); ++ // Remove the Windows service if requested ++ if ( isRemoveService( ext_gSettings ) ) { ++ // remove the service ++ if ( CmdRemoveService() ) { ++ fprintf(stderr, "IPerf Service is removed.\n"); ++ return 0; ++ } ++ } ++#else ++ fflush(stderr); ++ // redirect stdin, stdout and sterr to /dev/null (see dameon and no close flag) ++ if (daemon(1, 0) < 0) { ++ perror("daemon"); ++ } ++ } ++#endif ++ break; ++ default : ++ fprintf( stderr, "unknown mode"); ++ break; ++ } ++#ifdef HAVE_THREAD ++ // start up the reporter and client(s) or listener ++ { ++ thread_Settings *into = NULL; ++ // Create the settings structure for the reporter thread ++ Settings_Copy( ext_gSettings, &into ); ++ into->mThreadMode = kMode_Reporter; ++ ++ // Have the reporter launch the client or listener ++ into->runNow = ext_gSettings; + +- return 0; ++ // Start all the threads that are ready to go ++ thread_start( into ); + } ++#else ++ // No need to make a reporter thread because we don't have threads ++ thread_start( ext_gSettings ); ++#endif + + // wait for other (client, server) threads to complete + thread_joinall(); From 46a700e118060c1666a9a73cc6d6ee3062b12618 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 8 Oct 2018 16:57:01 +0200 Subject: [PATCH 043/399] e2fsprogs: fix glibc compile issue (FS#1749,FS#1796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following build error: .../toolchain-i386_pentium4_gcc-7.3.0_glibc/lib/gcc/i486-openwrt-linux-gnu/7.3.0/../../../../i486-openwrt-linux-gnu/bin/ld: ../lib/libcom_err.so: undefined reference to `sem_post’ .../toolchain-i386_pentium4_gcc-7.3.0_glibc/lib/gcc/i486-openwrt-linux-gnu/7.3.0/../../../../i486-openwrt-linux-gnu/bin/ld: ../lib/libcom_err.so: undefined reference to `sem_wait' .../toolchain-i386_pentium4_gcc-7.3.0_glibc/lib/gcc/i486-openwrt-linux-gnu/7.3.0/../../../../i486-openwrt-linux-gnu/bin/ld: ../lib/libcom_err.so: undefined reference to `sem_init’ .../toolchain-i386_pentium4_gcc-7.3.0_glibc/lib/gcc/i486-openwrt-linux-gnu/7.3.0/../../../../i486-openwrt-linux-gnu/bin/ld: ../lib/libcom_err.so: undefined reference to `sem_destroy’ Signed-off-by: Hans Dedecker --- package/utils/e2fsprogs/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile index 3411bea740d..0ef0dbca34d 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -133,6 +133,8 @@ endef TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections +TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt) + CONFIGURE_ARGS += \ --disable-testio-debug \ --enable-elf-shlibs \ From ae2a3a1d8078cbbc4655310828006a239de66616 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 9 Oct 2018 13:22:46 +0200 Subject: [PATCH 044/399] kernel: enable memory compaction Compaction is the only memory management component to form high order (larger physically contiguous) memory blocks reliably. The page allocator relies on compaction heavily and the lack of the feature can lead to unexpected OOM killer invocations for high order memory requests. You shouldn't disable this option unless there really is a strong reason for it. Signed-off-by: Felix Fietkau Signed-off-by: Michal Hrusecky --- target/linux/armvirt/config-4.14 | 1 + target/linux/at91/config-4.9 | 1 - target/linux/generic/config-4.14 | 2 +- target/linux/generic/config-4.9 | 2 +- target/linux/layerscape/armv8_32b/config-4.9 | 1 - target/linux/layerscape/armv8_64b/config-4.9 | 1 - target/linux/mediatek/mt7623/config-4.14 | 1 - target/linux/octeontx/config-4.14 | 1 - target/linux/oxnas/config-4.14 | 1 - target/linux/sunxi/config-4.14 | 1 - target/linux/sunxi/config-4.9 | 1 - target/linux/x86/64/config-default | 1 + target/linux/x86/generic/config-default | 1 + 13 files changed, 5 insertions(+), 10 deletions(-) diff --git a/target/linux/armvirt/config-4.14 b/target/linux/armvirt/config-4.14 index 64444d72fd9..a2d8bb4f20b 100644 --- a/target/linux/armvirt/config-4.14 +++ b/target/linux/armvirt/config-4.14 @@ -18,6 +18,7 @@ CONFIG_ARM_GIC_V2M=y CONFIG_ARM_GIC_V3=y CONFIG_ARM_PSCI_FW=y # CONFIG_ARM_SP805_WATCHDOG is not set +CONFIG_BALLOON_COMPACTION=y CONFIG_BLK_MQ_PCI=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_OF=y diff --git a/target/linux/at91/config-4.9 b/target/linux/at91/config-4.9 index e483d0f76d9..59a092b8569 100644 --- a/target/linux/at91/config-4.9 +++ b/target/linux/at91/config-4.9 @@ -71,7 +71,6 @@ CONFIG_CMA_AREAS=7 CONFIG_CMDLINE="console=ttyS0,115200 initrd=0x21100000,25165824 root=/dev/ram0 rw" CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_AT91=y -CONFIG_COMPACTION=y CONFIG_COMPAT_BRK=y CONFIG_CONFIGFS_FS=y CONFIG_CONSOLE_TRANSLATIONS=y diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index aa227ec6bfb..96916c0e43e 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -813,7 +813,7 @@ CONFIG_CMDLINE="" # CONFIG_COMMON_CLK_VERSATILE is not set # CONFIG_COMMON_CLK_XGENE is not set # CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_COMPACTION is not set +CONFIG_COMPACTION=y # CONFIG_COMPAL_LAPTOP is not set # CONFIG_COMPAT_BRK is not set # CONFIG_COMPILE_TEST is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 83abfdc8ff1..53955d9ae7f 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -766,7 +766,7 @@ CONFIG_CMDLINE="" # CONFIG_COMMON_CLK_SI5351 is not set # CONFIG_COMMON_CLK_SI570 is not set # CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set -# CONFIG_COMPACTION is not set +CONFIG_COMPACTION=y # CONFIG_COMPAL_LAPTOP is not set # CONFIG_COMPAT_BRK is not set # CONFIG_COMPILE_TEST is not set diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9 index 1ee8fdb0d75..44662a23831 100644 --- a/target/linux/layerscape/armv8_32b/config-4.9 +++ b/target/linux/layerscape/armv8_32b/config-4.9 @@ -185,7 +185,6 @@ CONFIG_COMMON_CLK_MAX77686=y # CONFIG_COMMON_CLK_PALMAS is not set # CONFIG_COMMON_CLK_RK808 is not set # CONFIG_COMMON_CLK_S2MPS11 is not set -CONFIG_COMPACTION=y CONFIG_COMPAT_BRK=y CONFIG_CONFIGFS_FS=y CONFIG_CONSOLE_TRANSLATIONS=y diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9 index 20758d41e2f..26c59dffe8a 100644 --- a/target/linux/layerscape/armv8_64b/config-4.9 +++ b/target/linux/layerscape/armv8_64b/config-4.9 @@ -204,7 +204,6 @@ CONFIG_COMMON_CLK_RK808=y CONFIG_COMMON_CLK_S2MPS11=y CONFIG_COMMON_CLK_VERSATILE=y CONFIG_COMMON_CLK_XGENE=y -CONFIG_COMPACTION=y CONFIG_COMPAT=y CONFIG_COMPAT_BINFMT_ELF=y CONFIG_COMPAT_NETLINK_MESSAGES=y diff --git a/target/linux/mediatek/mt7623/config-4.14 b/target/linux/mediatek/mt7623/config-4.14 index 9f709894102..05d99941cd3 100644 --- a/target/linux/mediatek/mt7623/config-4.14 +++ b/target/linux/mediatek/mt7623/config-4.14 @@ -75,7 +75,6 @@ CONFIG_COMMON_CLK_MT2701_VDECSYS=y # CONFIG_COMMON_CLK_MT7622 is not set # CONFIG_COMMON_CLK_MT8135 is not set # CONFIG_COMMON_CLK_MT8173 is not set -CONFIG_COMPACTION=y CONFIG_COREDUMP=y # CONFIG_CPUFREQ_DT is not set CONFIG_CPU_32v6K=y diff --git a/target/linux/octeontx/config-4.14 b/target/linux/octeontx/config-4.14 index fd627d6a261..09d22d517fe 100644 --- a/target/linux/octeontx/config-4.14 +++ b/target/linux/octeontx/config-4.14 @@ -120,7 +120,6 @@ CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_CS2000_CP=y # CONFIG_COMMON_CLK_VERSATILE is not set CONFIG_COMMON_CLK_XGENE=y -CONFIG_COMPACTION=y CONFIG_COMPAT=y CONFIG_COMPAT_BINFMT_ELF=y CONFIG_COMPAT_NETLINK_MESSAGES=y diff --git a/target/linux/oxnas/config-4.14 b/target/linux/oxnas/config-4.14 index 4d6943aea5e..56b54dd59d6 100644 --- a/target/linux/oxnas/config-4.14 +++ b/target/linux/oxnas/config-4.14 @@ -70,7 +70,6 @@ CONFIG_CMA_SIZE_SEL_MBYTES=y CONFIG_CMDLINE_PARTITION=y CONFIG_COMMON_CLK=y CONFIG_COMMON_CLK_OXNAS=y -CONFIG_COMPACTION=y CONFIG_COMPAT_BRK=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_CONTEXT_SWITCH_TRACER=y diff --git a/target/linux/sunxi/config-4.14 b/target/linux/sunxi/config-4.14 index 197e099ab47..708917ec50f 100644 --- a/target/linux/sunxi/config-4.14 +++ b/target/linux/sunxi/config-4.14 @@ -76,7 +76,6 @@ CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_MMIO=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y -CONFIG_COMPACTION=y CONFIG_CONFIGFS_FS=y CONFIG_CONNECTOR=y CONFIG_CONSOLE_TRANSLATIONS=y diff --git a/target/linux/sunxi/config-4.9 b/target/linux/sunxi/config-4.9 index 4a74fd1f4fb..c9059be3fab 100644 --- a/target/linux/sunxi/config-4.9 +++ b/target/linux/sunxi/config-4.9 @@ -71,7 +71,6 @@ CONFIG_CLKSRC_OF=y CONFIG_CLKSRC_PROBE=y CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y -CONFIG_COMPACTION=y CONFIG_CONFIGFS_FS=y CONFIG_CONNECTOR=y CONFIG_CONSOLE_TRANSLATIONS=y diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index f55423e1c50..12932e4a2ae 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -49,6 +49,7 @@ CONFIG_AUDIT_ARCH=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BALLOON_COMPACTION=y CONFIG_BLK_DEV_INTEGRITY=y CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index 327e7c647de..1e7cea801f3 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -47,6 +47,7 @@ CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y +CONFIG_BALLOON_COMPACTION=y CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_BLK_MQ_VIRTIO=y From 86a3d2604f2439d8cd94347ac3e4672b04c6d74a Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 10 Oct 2018 11:37:42 +0200 Subject: [PATCH 045/399] kernel: bump 4.9 to 4.9.132 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../lantiq/patches-4.9/0030-GPIO-add-named-gpio-exports.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 05cbc9a17e9..11b95e1eb78 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .131 +LINUX_VERSION-4.9 = .132 LINUX_VERSION-4.14 = .74 -LINUX_KERNEL_HASH-4.9.131 = 57db3295469d3990af93703a97b07f1e8a14920bf3f5b68ce0330a02e7aa5d60 +LINUX_KERNEL_HASH-4.9.132 = 67e66ae14595b3c93f228c417463e5436b9d64f5e9dfd3b92b7e24714d1ee5d3 LINUX_KERNEL_HASH-4.14.74 = 70e69189fd7b2f96fa33833735c7bcf3281dc0172c3734e2c5819e9d57015c72 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/lantiq/patches-4.9/0030-GPIO-add-named-gpio-exports.patch b/target/linux/lantiq/patches-4.9/0030-GPIO-add-named-gpio-exports.patch index e2a421b27ed..e205ed057dd 100644 --- a/target/linux/lantiq/patches-4.9/0030-GPIO-add-named-gpio-exports.patch +++ b/target/linux/lantiq/patches-4.9/0030-GPIO-add-named-gpio-exports.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" -@@ -538,3 +540,73 @@ void of_gpiochip_remove(struct gpio_chip +@@ -539,3 +541,73 @@ void of_gpiochip_remove(struct gpio_chip gpiochip_remove_pin_ranges(chip); of_node_put(chip->of_node); } From bba743458eb48f9b2ae73c3d173920062c9b3f00 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 10 Oct 2018 12:37:20 +0200 Subject: [PATCH 046/399] kernel: bump 4.14 to 4.14.75 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...les-remove-multihook-chains-and-fami.patch | 10 ++-- ...bles-add-flow-table-netlink-frontend.patch | 24 +++++----- ...les-remove-nhooks-field-from-struct-.patch | 2 +- ...les-fix-a-typo-in-nf_tables_getflowt.patch | 2 +- ...les-no-need-for-struct-nft_af_info-t.patch | 4 +- ...les-fix-potential-NULL-ptr-deref-in-.patch | 2 +- ...les-add-single-table-list-for-all-fa.patch | 38 +++++++-------- ...tfilter-exit_net-cleanup-check-added.patch | 4 +- ...nf_tables-get-rid-of-pernet-families.patch | 10 ++-- ...les-get-rid-of-struct-nft_af_info-ab.patch | 48 +++++++++---------- ...ow_offload-wait-for-garbage-collecto.patch | 2 +- ...tfilter-nf_tables-fix-flowtable-free.patch | 2 +- ...les-allocate-handle-and-delete-objec.patch | 22 ++++----- ...w_table-move-init-code-to-nf_flow_ta.patch | 4 +- ...w_table-fix-priv-pointer-for-netdev-.patch | 2 +- ...w_table-track-flow-tables-in-nf_flow.patch | 2 +- ...w_table-add-hardware-offload-support.patch | 6 +-- .../0066-GPIO-add-named-gpio-exports.patch | 2 +- .../0030-GPIO-add-named-gpio-exports.patch | 2 +- ...0-crypto-mxsdcp-provide-importexport.patch | 6 +-- .../0024-GPIO-add-named-gpio-exports.patch | 2 +- 22 files changed, 100 insertions(+), 100 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 11b95e1eb78..9c2741fdd2b 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .132 -LINUX_VERSION-4.14 = .74 +LINUX_VERSION-4.14 = .75 LINUX_KERNEL_HASH-4.9.132 = 67e66ae14595b3c93f228c417463e5436b9d64f5e9dfd3b92b7e24714d1ee5d3 -LINUX_KERNEL_HASH-4.14.74 = 70e69189fd7b2f96fa33833735c7bcf3281dc0172c3734e2c5819e9d57015c72 +LINUX_KERNEL_HASH-4.14.75 = 5093d7230b8f1c553450ca6c1ccd20a46a055d9277a7e161039a8642b3398120 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch b/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch index b279e8c30ad..0db6262fd93 100644 --- a/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch +++ b/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch @@ -264,7 +264,7 @@ Signed-off-by: Pablo Neira Ayuso } nft_chain_release_hook(&hook); } -@@ -5134,10 +5122,9 @@ static int nf_tables_commit(struct net * +@@ -5135,10 +5123,9 @@ static int nf_tables_commit(struct net * case NFT_MSG_DELCHAIN: list_del_rcu(&trans->ctx.chain->list); nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN); @@ -278,7 +278,7 @@ Signed-off-by: Pablo Neira Ayuso break; case NFT_MSG_NEWRULE: nft_clear(trans->ctx.net, nft_trans_rule(trans)); -@@ -5274,10 +5261,9 @@ static int nf_tables_abort(struct net *n +@@ -5275,10 +5262,9 @@ static int nf_tables_abort(struct net *n } else { trans->ctx.table->use--; list_del_rcu(&trans->ctx.chain->list); @@ -292,7 +292,7 @@ Signed-off-by: Pablo Neira Ayuso } break; case NFT_MSG_DELCHAIN: -@@ -5380,7 +5366,7 @@ int nft_chain_validate_hooks(const struc +@@ -5381,7 +5367,7 @@ int nft_chain_validate_hooks(const struc if (nft_is_base_chain(chain)) { basechain = nft_base_chain(chain); @@ -301,7 +301,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; return -EOPNOTSUPP; -@@ -5862,8 +5848,7 @@ int __nft_release_basechain(struct nft_c +@@ -5863,8 +5849,7 @@ int __nft_release_basechain(struct nft_c BUG_ON(!nft_is_base_chain(ctx->chain)); @@ -311,7 +311,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { list_del(&rule->list); ctx->chain->use--; -@@ -5892,8 +5877,7 @@ static void __nft_release_afinfo(struct +@@ -5893,8 +5878,7 @@ static void __nft_release_afinfo(struct list_for_each_entry_safe(table, nt, &afi->tables, list) { list_for_each_entry(chain, &table->chains, list) diff --git a/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch b/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch index 25b7ea224e4..1c16bbae4e0 100644 --- a/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch +++ b/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch @@ -292,7 +292,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) { err = nft_delobj(ctx, obj); if (err < 0) -@@ -4834,6 +4878,605 @@ static void nf_tables_obj_notify(const s +@@ -4835,6 +4879,605 @@ static void nf_tables_obj_notify(const s ctx->afi->family, ctx->report, GFP_KERNEL); } @@ -898,7 +898,7 @@ Signed-off-by: Pablo Neira Ayuso static int nf_tables_fill_gen_info(struct sk_buff *skb, struct net *net, u32 portid, u32 seq) { -@@ -4864,6 +5507,49 @@ nla_put_failure: +@@ -4865,6 +5508,49 @@ nla_put_failure: return -EMSGSIZE; } @@ -948,7 +948,7 @@ Signed-off-by: Pablo Neira Ayuso static void nf_tables_gen_notify(struct net *net, struct sk_buff *skb, int event) { -@@ -5016,6 +5702,21 @@ static const struct nfnl_callback nf_tab +@@ -5017,6 +5703,21 @@ static const struct nfnl_callback nf_tab .attr_count = NFTA_OBJ_MAX, .policy = nft_obj_policy, }, @@ -970,7 +970,7 @@ Signed-off-by: Pablo Neira Ayuso }; static void nft_chain_commit_update(struct nft_trans *trans) -@@ -5064,6 +5765,9 @@ static void nf_tables_commit_release(str +@@ -5065,6 +5766,9 @@ static void nf_tables_commit_release(str case NFT_MSG_DELOBJ: nft_obj_destroy(nft_trans_obj(trans)); break; @@ -980,7 +980,7 @@ Signed-off-by: Pablo Neira Ayuso } kfree(trans); } -@@ -5183,6 +5887,21 @@ static int nf_tables_commit(struct net * +@@ -5184,6 +5888,21 @@ static int nf_tables_commit(struct net * nf_tables_obj_notify(&trans->ctx, nft_trans_obj(trans), NFT_MSG_DELOBJ); break; @@ -1002,7 +1002,7 @@ Signed-off-by: Pablo Neira Ayuso } } -@@ -5220,6 +5939,9 @@ static void nf_tables_abort_release(stru +@@ -5221,6 +5940,9 @@ static void nf_tables_abort_release(stru case NFT_MSG_NEWOBJ: nft_obj_destroy(nft_trans_obj(trans)); break; @@ -1012,7 +1012,7 @@ Signed-off-by: Pablo Neira Ayuso } kfree(trans); } -@@ -5311,6 +6033,17 @@ static int nf_tables_abort(struct net *n +@@ -5312,6 +6034,17 @@ static int nf_tables_abort(struct net *n nft_clear(trans->ctx.net, nft_trans_obj(trans)); nft_trans_destroy(trans); break; @@ -1030,7 +1030,7 @@ Signed-off-by: Pablo Neira Ayuso } } -@@ -5861,6 +6594,7 @@ EXPORT_SYMBOL_GPL(__nft_release_basechai +@@ -5862,6 +6595,7 @@ EXPORT_SYMBOL_GPL(__nft_release_basechai /* Called by nft_unregister_afinfo() from __net_exit path, nfnl_lock is held. */ static void __nft_release_afinfo(struct net *net, struct nft_af_info *afi) { @@ -1038,7 +1038,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table, *nt; struct nft_chain *chain, *nc; struct nft_object *obj, *ne; -@@ -5874,6 +6608,9 @@ static void __nft_release_afinfo(struct +@@ -5875,6 +6609,9 @@ static void __nft_release_afinfo(struct list_for_each_entry_safe(table, nt, &afi->tables, list) { list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); @@ -1048,7 +1048,7 @@ Signed-off-by: Pablo Neira Ayuso /* No packets are walking on these chains anymore. */ ctx.table = table; list_for_each_entry(chain, &table->chains, list) { -@@ -5884,6 +6621,11 @@ static void __nft_release_afinfo(struct +@@ -5885,6 +6622,11 @@ static void __nft_release_afinfo(struct nf_tables_rule_release(&ctx, rule); } } @@ -1060,7 +1060,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(set, ns, &table->sets, list) { list_del(&set->list); table->use--; -@@ -5927,6 +6669,8 @@ static int __init nf_tables_module_init( +@@ -5928,6 +6670,8 @@ static int __init nf_tables_module_init( if (err < 0) goto err3; @@ -1069,7 +1069,7 @@ Signed-off-by: Pablo Neira Ayuso pr_info("nf_tables: (c) 2007-2009 Patrick McHardy \n"); return register_pernet_subsys(&nf_tables_net_ops); err3: -@@ -5941,6 +6685,7 @@ static void __exit nf_tables_module_exit +@@ -5942,6 +6686,7 @@ static void __exit nf_tables_module_exit { unregister_pernet_subsys(&nf_tables_net_ops); nfnetlink_subsys_unregister(&nf_tables_subsys); diff --git a/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch b/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch index ae30a984d5b..7d13a594242 100644 --- a/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch +++ b/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch @@ -82,7 +82,7 @@ Signed-off-by: Pablo Neira Ayuso hook->priority = ntohl(nla_get_be32(ha[NFTA_HOOK_PRIORITY])); type = chain_type[afi->family][NFT_CHAIN_T_DEFAULT]; -@@ -4986,7 +4983,7 @@ static int nf_tables_flowtable_parse_hoo +@@ -4987,7 +4984,7 @@ static int nf_tables_flowtable_parse_hoo return -EINVAL; hooknum = ntohl(nla_get_be32(tb[NFTA_FLOWTABLE_HOOK_NUM])); diff --git a/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch b/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch index 493ed1d27d6..62bca051104 100644 --- a/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch +++ b/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch @@ -11,7 +11,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5410,7 +5410,7 @@ static int nf_tables_getflowtable(struct +@@ -5411,7 +5411,7 @@ static int nf_tables_getflowtable(struct flowtable = nf_tables_flowtable_lookup(table, nla[NFTA_FLOWTABLE_NAME], genmask); diff --git a/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch b/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch index ddcdb78a6ff..35c75a201ee 100644 --- a/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch +++ b/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch @@ -62,7 +62,7 @@ Signed-off-by: Pablo Neira Ayuso if (ret >= 0) { ctx->table->flags &= ~NFT_TABLE_F_DORMANT; nft_trans_table_enable(trans) = true; -@@ -5791,7 +5784,6 @@ static int nf_tables_commit(struct net * +@@ -5792,7 +5785,6 @@ static int nf_tables_commit(struct net * if (nft_trans_table_update(trans)) { if (!nft_trans_table_enable(trans)) { nf_tables_table_disable(net, @@ -70,7 +70,7 @@ Signed-off-by: Pablo Neira Ayuso trans->ctx.table); trans->ctx.table->flags |= NFT_TABLE_F_DORMANT; } -@@ -5955,7 +5947,6 @@ static int nf_tables_abort(struct net *n +@@ -5956,7 +5948,6 @@ static int nf_tables_abort(struct net *n if (nft_trans_table_update(trans)) { if (nft_trans_table_enable(trans)) { nf_tables_table_disable(net, diff --git a/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch b/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch index 719c2d9940f..d140a335186 100644 --- a/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch +++ b/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch @@ -15,7 +15,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5329,8 +5329,10 @@ static int nf_tables_dump_flowtable_done +@@ -5330,8 +5330,10 @@ static int nf_tables_dump_flowtable_done if (!filter) return 0; diff --git a/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch b/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch index 0991f057005..59ec44a4823 100644 --- a/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch +++ b/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch @@ -868,7 +868,7 @@ Signed-off-by: Pablo Neira Ayuso .table = ctx->table, .chain = (struct nft_chain *)binding->chain, }; -@@ -4526,7 +4512,8 @@ static int nf_tables_newobj(struct net * +@@ -4527,7 +4513,8 @@ static int nf_tables_newobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -878,7 +878,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4544,7 +4531,7 @@ static int nf_tables_newobj(struct net * +@@ -4545,7 +4532,7 @@ static int nf_tables_newobj(struct net * return 0; } @@ -887,7 +887,7 @@ Signed-off-by: Pablo Neira Ayuso type = nft_obj_type_get(objtype); if (IS_ERR(type)) -@@ -4621,7 +4608,6 @@ struct nft_obj_filter { +@@ -4622,7 +4609,6 @@ struct nft_obj_filter { static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) { const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh); @@ -895,7 +895,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; unsigned int idx = 0, s_idx = cb->args[0]; struct nft_obj_filter *filter = cb->data; -@@ -4636,38 +4622,37 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4637,38 +4623,37 @@ static int nf_tables_dump_obj(struct sk_ rcu_read_lock(); cb->seq = net->nft.base_seq; @@ -960,7 +960,7 @@ Signed-off-by: Pablo Neira Ayuso } } done: -@@ -4754,7 +4739,8 @@ static int nf_tables_getobj(struct net * +@@ -4755,7 +4740,8 @@ static int nf_tables_getobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -970,7 +970,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4814,7 +4800,8 @@ static int nf_tables_delobj(struct net * +@@ -4815,7 +4801,8 @@ static int nf_tables_delobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -980,7 +980,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4825,7 +4812,7 @@ static int nf_tables_delobj(struct net * +@@ -4826,7 +4813,7 @@ static int nf_tables_delobj(struct net * if (obj->use > 0) return -EBUSY; @@ -989,7 +989,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delobj(&ctx, obj); } -@@ -4863,7 +4850,7 @@ static void nf_tables_obj_notify(const s +@@ -4864,7 +4851,7 @@ static void nf_tables_obj_notify(const s struct nft_object *obj, int event) { nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event, @@ -998,7 +998,7 @@ Signed-off-by: Pablo Neira Ayuso } /* -@@ -5053,7 +5040,7 @@ void nft_flow_table_iterate(struct net * +@@ -5054,7 +5041,7 @@ void nft_flow_table_iterate(struct net * rcu_read_lock(); list_for_each_entry_rcu(afi, &net->nft.af_info, list) { @@ -1007,7 +1007,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_rcu(flowtable, &table->flowtables, list) { iter(&flowtable->data, data); } -@@ -5101,7 +5088,8 @@ static int nf_tables_newflowtable(struct +@@ -5102,7 +5089,8 @@ static int nf_tables_newflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1017,7 +1017,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5118,7 +5106,7 @@ static int nf_tables_newflowtable(struct +@@ -5119,7 +5107,7 @@ static int nf_tables_newflowtable(struct return 0; } @@ -1026,7 +1026,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL); if (!flowtable) -@@ -5199,7 +5187,8 @@ static int nf_tables_delflowtable(struct +@@ -5200,7 +5188,8 @@ static int nf_tables_delflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1036,7 +1036,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5210,7 +5199,7 @@ static int nf_tables_delflowtable(struct +@@ -5211,7 +5200,7 @@ static int nf_tables_delflowtable(struct if (flowtable->use > 0) return -EBUSY; @@ -1045,7 +1045,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delflowtable(&ctx, flowtable); } -@@ -5279,40 +5268,37 @@ static int nf_tables_dump_flowtable(stru +@@ -5280,40 +5269,37 @@ static int nf_tables_dump_flowtable(stru struct net *net = sock_net(skb->sk); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1107,7 +1107,7 @@ Signed-off-by: Pablo Neira Ayuso } } done: -@@ -5397,7 +5383,8 @@ static int nf_tables_getflowtable(struct +@@ -5398,7 +5384,8 @@ static int nf_tables_getflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1117,7 +1117,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5440,7 +5427,7 @@ static void nf_tables_flowtable_notify(s +@@ -5441,7 +5428,7 @@ static void nf_tables_flowtable_notify(s err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid, ctx->seq, event, 0, @@ -1126,7 +1126,7 @@ Signed-off-by: Pablo Neira Ayuso if (err < 0) { kfree_skb(skb); goto err; -@@ -5518,17 +5505,14 @@ static int nf_tables_flowtable_event(str +@@ -5519,17 +5506,14 @@ static int nf_tables_flowtable_event(str struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct nft_flowtable *flowtable; struct nft_table *table; @@ -1147,7 +1147,7 @@ Signed-off-by: Pablo Neira Ayuso } } nfnl_unlock(NFNL_SUBSYS_NFTABLES); -@@ -6554,6 +6538,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump); +@@ -6555,6 +6539,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump); static int __net_init nf_tables_init_net(struct net *net) { INIT_LIST_HEAD(&net->nft.af_info); @@ -1155,7 +1155,7 @@ Signed-off-by: Pablo Neira Ayuso INIT_LIST_HEAD(&net->nft.commit_list); net->nft.base_seq = 1; return 0; -@@ -6590,10 +6575,10 @@ static void __nft_release_afinfo(struct +@@ -6591,10 +6576,10 @@ static void __nft_release_afinfo(struct struct nft_set *set, *ns; struct nft_ctx ctx = { .net = net, diff --git a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch index d71c8e0aba3..b1b876cf1d6 100644 --- a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch +++ b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch @@ -21,7 +21,7 @@ Signed-off-by: Pablo Neira Ayuso static struct pernet_operations clusterip_net_ops = { --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -6544,6 +6544,12 @@ static int __net_init nf_tables_init_net +@@ -6545,6 +6545,12 @@ static int __net_init nf_tables_init_net return 0; } @@ -34,7 +34,7 @@ Signed-off-by: Pablo Neira Ayuso int __nft_release_basechain(struct nft_ctx *ctx) { struct nft_rule *rule, *nr; -@@ -6621,6 +6627,7 @@ static void __nft_release_afinfo(struct +@@ -6622,6 +6628,7 @@ static void __nft_release_afinfo(struct static struct pernet_operations nf_tables_net_ops = { .init = nf_tables_init_net, diff --git a/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch b/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch index d1325de2d4b..de5c2409b3c 100644 --- a/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch +++ b/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch @@ -364,7 +364,7 @@ Signed-off-by: Pablo Neira Ayuso if (afi->family == family) return afi; } -@@ -5035,15 +5033,12 @@ void nft_flow_table_iterate(struct net * +@@ -5036,15 +5034,12 @@ void nft_flow_table_iterate(struct net * void *data) { struct nft_flowtable *flowtable; @@ -383,7 +383,7 @@ Signed-off-by: Pablo Neira Ayuso } } rcu_read_unlock(); -@@ -6535,21 +6530,6 @@ int nft_data_dump(struct sk_buff *skb, i +@@ -6536,21 +6531,6 @@ int nft_data_dump(struct sk_buff *skb, i } EXPORT_SYMBOL_GPL(nft_data_dump); @@ -405,7 +405,7 @@ Signed-off-by: Pablo Neira Ayuso int __nft_release_basechain(struct nft_ctx *ctx) { struct nft_rule *rule, *nr; -@@ -6570,8 +6550,7 @@ int __nft_release_basechain(struct nft_c +@@ -6571,8 +6551,7 @@ int __nft_release_basechain(struct nft_c } EXPORT_SYMBOL_GPL(__nft_release_basechain); @@ -415,7 +415,7 @@ Signed-off-by: Pablo Neira Ayuso { struct nft_flowtable *flowtable, *nf; struct nft_table *table, *nt; -@@ -6581,10 +6560,11 @@ static void __nft_release_afinfo(struct +@@ -6582,10 +6561,11 @@ static void __nft_release_afinfo(struct struct nft_set *set, *ns; struct nft_ctx ctx = { .net = net, @@ -428,7 +428,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); list_for_each_entry(flowtable, &table->flowtables, list) -@@ -6625,6 +6605,21 @@ static void __nft_release_afinfo(struct +@@ -6626,6 +6606,21 @@ static void __nft_release_afinfo(struct } } diff --git a/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch b/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch index 868f3e68e6f..e5ed45c1c6b 100644 --- a/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch +++ b/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch @@ -817,7 +817,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(net->nft.base_seq & 0xffff); -@@ -4494,7 +4361,6 @@ static int nf_tables_newobj(struct net * +@@ -4495,7 +4362,6 @@ static int nf_tables_newobj(struct net * const struct nft_object_type *type; u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -825,7 +825,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_object *obj; struct nft_ctx ctx; -@@ -4506,11 +4372,7 @@ static int nf_tables_newobj(struct net * +@@ -4507,11 +4373,7 @@ static int nf_tables_newobj(struct net * !nla[NFTA_OBJ_DATA]) return -EINVAL; @@ -838,7 +838,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4529,7 +4391,7 @@ static int nf_tables_newobj(struct net * +@@ -4530,7 +4392,7 @@ static int nf_tables_newobj(struct net * return 0; } @@ -847,7 +847,7 @@ Signed-off-by: Pablo Neira Ayuso type = nft_obj_type_get(objtype); if (IS_ERR(type)) -@@ -4621,7 +4483,7 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4622,7 +4484,7 @@ static int nf_tables_dump_obj(struct sk_ cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -856,7 +856,7 @@ Signed-off-by: Pablo Neira Ayuso continue; list_for_each_entry_rcu(obj, &table->objects, list) { -@@ -4644,7 +4506,7 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4645,7 +4507,7 @@ static int nf_tables_dump_obj(struct sk_ cb->nlh->nlmsg_seq, NFT_MSG_NEWOBJ, NLM_F_MULTI | NLM_F_APPEND, @@ -865,7 +865,7 @@ Signed-off-by: Pablo Neira Ayuso obj, reset) < 0) goto done; -@@ -4702,7 +4564,6 @@ static int nf_tables_getobj(struct net * +@@ -4703,7 +4565,6 @@ static int nf_tables_getobj(struct net * const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_cur(net); int family = nfmsg->nfgen_family; @@ -873,7 +873,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; struct nft_object *obj; struct sk_buff *skb2; -@@ -4733,11 +4594,7 @@ static int nf_tables_getobj(struct net * +@@ -4734,11 +4595,7 @@ static int nf_tables_getobj(struct net * !nla[NFTA_OBJ_TYPE]) return -EINVAL; @@ -886,7 +886,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4784,7 +4641,6 @@ static int nf_tables_delobj(struct net * +@@ -4785,7 +4642,6 @@ static int nf_tables_delobj(struct net * const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -894,7 +894,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_object *obj; struct nft_ctx ctx; -@@ -4794,11 +4650,7 @@ static int nf_tables_delobj(struct net * +@@ -4795,11 +4651,7 @@ static int nf_tables_delobj(struct net * !nla[NFTA_OBJ_NAME]) return -EINVAL; @@ -907,7 +907,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4810,7 +4662,7 @@ static int nf_tables_delobj(struct net * +@@ -4811,7 +4663,7 @@ static int nf_tables_delobj(struct net * if (obj->use > 0) return -EBUSY; @@ -916,7 +916,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delobj(&ctx, obj); } -@@ -4995,33 +4847,31 @@ err1: +@@ -4996,33 +4848,31 @@ err1: return err; } @@ -956,7 +956,7 @@ Signed-off-by: Pablo Neira Ayuso return ERR_PTR(-EAGAIN); } #endif -@@ -5069,7 +4919,6 @@ static int nf_tables_newflowtable(struct +@@ -5070,7 +4920,6 @@ static int nf_tables_newflowtable(struct u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -964,7 +964,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_ctx ctx; int err, i, k; -@@ -5079,12 +4928,8 @@ static int nf_tables_newflowtable(struct +@@ -5080,12 +4929,8 @@ static int nf_tables_newflowtable(struct !nla[NFTA_FLOWTABLE_HOOK]) return -EINVAL; @@ -978,7 +978,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5101,7 +4946,7 @@ static int nf_tables_newflowtable(struct +@@ -5102,7 +4947,7 @@ static int nf_tables_newflowtable(struct return 0; } @@ -987,7 +987,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL); if (!flowtable) -@@ -5114,7 +4959,7 @@ static int nf_tables_newflowtable(struct +@@ -5115,7 +4960,7 @@ static int nf_tables_newflowtable(struct goto err1; } @@ -996,7 +996,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(type)) { err = PTR_ERR(type); goto err2; -@@ -5174,16 +5019,11 @@ static int nf_tables_delflowtable(struct +@@ -5175,16 +5020,11 @@ static int nf_tables_delflowtable(struct u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1014,7 +1014,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5194,7 +5034,7 @@ static int nf_tables_delflowtable(struct +@@ -5195,7 +5035,7 @@ static int nf_tables_delflowtable(struct if (flowtable->use > 0) return -EBUSY; @@ -1023,7 +1023,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delflowtable(&ctx, flowtable); } -@@ -5269,7 +5109,7 @@ static int nf_tables_dump_flowtable(stru +@@ -5270,7 +5110,7 @@ static int nf_tables_dump_flowtable(stru cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -1032,7 +1032,7 @@ Signed-off-by: Pablo Neira Ayuso continue; list_for_each_entry_rcu(flowtable, &table->flowtables, list) { -@@ -5288,7 +5128,7 @@ static int nf_tables_dump_flowtable(stru +@@ -5289,7 +5129,7 @@ static int nf_tables_dump_flowtable(stru cb->nlh->nlmsg_seq, NFT_MSG_NEWFLOWTABLE, NLM_F_MULTI | NLM_F_APPEND, @@ -1041,7 +1041,7 @@ Signed-off-by: Pablo Neira Ayuso goto done; nl_dump_check_consistent(cb, nlmsg_hdr(skb)); -@@ -5348,7 +5188,6 @@ static int nf_tables_getflowtable(struct +@@ -5349,7 +5189,6 @@ static int nf_tables_getflowtable(struct u8 genmask = nft_genmask_cur(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1049,7 +1049,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; struct sk_buff *skb2; int err; -@@ -5374,12 +5213,8 @@ static int nf_tables_getflowtable(struct +@@ -5375,12 +5214,8 @@ static int nf_tables_getflowtable(struct if (!nla[NFTA_FLOWTABLE_NAME]) return -EINVAL; @@ -1063,7 +1063,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -6550,7 +6385,7 @@ int __nft_release_basechain(struct nft_c +@@ -6551,7 +6386,7 @@ int __nft_release_basechain(struct nft_c } EXPORT_SYMBOL_GPL(__nft_release_basechain); @@ -1072,7 +1072,7 @@ Signed-off-by: Pablo Neira Ayuso { struct nft_flowtable *flowtable, *nf; struct nft_table *table, *nt; -@@ -6563,7 +6398,7 @@ static void __nft_release_afinfo(struct +@@ -6564,7 +6399,7 @@ static void __nft_release_afinfo(struct }; list_for_each_entry_safe(table, nt, &net->nft.tables, list) { @@ -1081,7 +1081,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); -@@ -6615,7 +6450,7 @@ static int __net_init nf_tables_init_net +@@ -6616,7 +6451,7 @@ static int __net_init nf_tables_init_net static void __net_exit nf_tables_exit_net(struct net *net) { diff --git a/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch b/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch index 037759bdb73..4b4206502c5 100644 --- a/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch +++ b/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch @@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4885,13 +4885,13 @@ void nft_flow_table_iterate(struct net * +@@ -4886,13 +4886,13 @@ void nft_flow_table_iterate(struct net * struct nft_flowtable *flowtable; const struct nft_table *table; diff --git a/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch b/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch index 232f4b67a0d..670d2ca6d4c 100644 --- a/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch +++ b/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch @@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso }; --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5270,17 +5270,12 @@ err: +@@ -5271,17 +5271,12 @@ err: nfnetlink_set_err(ctx->net, ctx->portid, NFNLGRP_NFTABLES, -ENOBUFS); } diff --git a/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch b/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch index f4d5237ded5..98ec5d1b7ce 100644 --- a/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch +++ b/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch @@ -327,7 +327,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(set)) return PTR_ERR(set); -@@ -4249,6 +4321,21 @@ struct nft_object *nf_tables_obj_lookup( +@@ -4250,6 +4322,21 @@ struct nft_object *nf_tables_obj_lookup( } EXPORT_SYMBOL_GPL(nf_tables_obj_lookup); @@ -349,7 +349,7 @@ Signed-off-by: Pablo Neira Ayuso static const struct nla_policy nft_obj_policy[NFTA_OBJ_MAX + 1] = { [NFTA_OBJ_TABLE] = { .type = NLA_STRING, .len = NFT_TABLE_MAXNAMELEN - 1 }, -@@ -4256,6 +4343,7 @@ static const struct nla_policy nft_obj_p +@@ -4257,6 +4344,7 @@ static const struct nla_policy nft_obj_p .len = NFT_OBJ_MAXNAMELEN - 1 }, [NFTA_OBJ_TYPE] = { .type = NLA_U32 }, [NFTA_OBJ_DATA] = { .type = NLA_NESTED }, @@ -357,7 +357,7 @@ Signed-off-by: Pablo Neira Ayuso }; static struct nft_object *nft_obj_init(const struct nft_ctx *ctx, -@@ -4403,6 +4491,8 @@ static int nf_tables_newobj(struct net * +@@ -4404,6 +4492,8 @@ static int nf_tables_newobj(struct net * goto err1; } obj->table = table; @@ -366,7 +366,7 @@ Signed-off-by: Pablo Neira Ayuso obj->name = nla_strdup(nla[NFTA_OBJ_NAME], GFP_KERNEL); if (!obj->name) { err = -ENOMEM; -@@ -4449,7 +4539,9 @@ static int nf_tables_fill_obj_info(struc +@@ -4450,7 +4540,9 @@ static int nf_tables_fill_obj_info(struc nla_put_string(skb, NFTA_OBJ_NAME, obj->name) || nla_put_be32(skb, NFTA_OBJ_TYPE, htonl(obj->ops->type->type)) || nla_put_be32(skb, NFTA_OBJ_USE, htonl(obj->use)) || @@ -377,7 +377,7 @@ Signed-off-by: Pablo Neira Ayuso goto nla_put_failure; nlmsg_end(skb, nlh); -@@ -4647,7 +4739,7 @@ static int nf_tables_delobj(struct net * +@@ -4648,7 +4740,7 @@ static int nf_tables_delobj(struct net * u32 objtype; if (!nla[NFTA_OBJ_TYPE] || @@ -386,7 +386,7 @@ Signed-off-by: Pablo Neira Ayuso return -EINVAL; table = nf_tables_table_lookup(net, nla[NFTA_OBJ_TABLE], family, -@@ -4656,7 +4748,12 @@ static int nf_tables_delobj(struct net * +@@ -4657,7 +4749,12 @@ static int nf_tables_delobj(struct net * return PTR_ERR(table); objtype = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); @@ -400,7 +400,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(obj)) return PTR_ERR(obj); if (obj->use > 0) -@@ -4728,6 +4825,7 @@ static const struct nla_policy nft_flowt +@@ -4729,6 +4826,7 @@ static const struct nla_policy nft_flowt [NFTA_FLOWTABLE_NAME] = { .type = NLA_STRING, .len = NFT_NAME_MAXLEN - 1 }, [NFTA_FLOWTABLE_HOOK] = { .type = NLA_NESTED }, @@ -408,7 +408,7 @@ Signed-off-by: Pablo Neira Ayuso }; struct nft_flowtable *nf_tables_flowtable_lookup(const struct nft_table *table, -@@ -4745,6 +4843,20 @@ struct nft_flowtable *nf_tables_flowtabl +@@ -4746,6 +4844,20 @@ struct nft_flowtable *nf_tables_flowtabl } EXPORT_SYMBOL_GPL(nf_tables_flowtable_lookup); @@ -429,7 +429,7 @@ Signed-off-by: Pablo Neira Ayuso #define NFT_FLOWTABLE_DEVICE_MAX 8 static int nf_tables_parse_devices(const struct nft_ctx *ctx, -@@ -4953,6 +5065,8 @@ static int nf_tables_newflowtable(struct +@@ -4954,6 +5066,8 @@ static int nf_tables_newflowtable(struct return -ENOMEM; flowtable->table = table; @@ -438,7 +438,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable->name = nla_strdup(nla[NFTA_FLOWTABLE_NAME], GFP_KERNEL); if (!flowtable->name) { err = -ENOMEM; -@@ -5027,8 +5141,14 @@ static int nf_tables_delflowtable(struct +@@ -5028,8 +5142,14 @@ static int nf_tables_delflowtable(struct if (IS_ERR(table)) return PTR_ERR(table); @@ -455,7 +455,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(flowtable)) return PTR_ERR(flowtable); if (flowtable->use > 0) -@@ -5061,7 +5181,9 @@ static int nf_tables_fill_flowtable_info +@@ -5062,7 +5182,9 @@ static int nf_tables_fill_flowtable_info if (nla_put_string(skb, NFTA_FLOWTABLE_TABLE, flowtable->table->name) || nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || diff --git a/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch b/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch index 601df0cf951..2cf8cea23c7 100644 --- a/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch +++ b/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch @@ -236,7 +236,7 @@ Signed-off-by: Felix Fietkau .owner = THIS_MODULE, --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5080,40 +5080,38 @@ static int nf_tables_newflowtable(struct +@@ -5081,40 +5081,38 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -285,7 +285,7 @@ Signed-off-by: Felix Fietkau err3: module_put(type->owner); err2: -@@ -5394,10 +5392,8 @@ err: +@@ -5395,10 +5393,8 @@ err: static void nf_tables_flowtable_destroy(struct nft_flowtable *flowtable) { diff --git a/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch b/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch index f173b1c4f15..d978a076fd3 100644 --- a/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch +++ b/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4946,7 +4946,7 @@ static int nf_tables_flowtable_parse_hoo +@@ -4947,7 +4947,7 @@ static int nf_tables_flowtable_parse_hoo flowtable->ops[i].pf = NFPROTO_NETDEV; flowtable->ops[i].hooknum = hooknum; flowtable->ops[i].priority = priority; diff --git a/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch b/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch index 784368520db..84048a0be81 100644 --- a/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch +++ b/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau WARN_ON(!nf_flow_offload_gc_step(flow_table)); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4990,23 +4990,6 @@ static const struct nf_flowtable_type *n +@@ -4991,23 +4991,6 @@ static const struct nf_flowtable_type *n return ERR_PTR(-ENOENT); } diff --git a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index e6d33928384..e4a9ba7d961 100644 --- a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4933,6 +4933,14 @@ static int nf_tables_flowtable_parse_hoo +@@ -4934,6 +4934,14 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) goto err1; @@ -521,7 +521,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kzalloc(sizeof(struct nf_hook_ops) * n, GFP_KERNEL); if (!ops) { err = -ENOMEM; -@@ -5063,10 +5071,19 @@ static int nf_tables_newflowtable(struct +@@ -5064,10 +5072,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -541,7 +541,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -5164,7 +5181,8 @@ static int nf_tables_fill_flowtable_info +@@ -5165,7 +5182,8 @@ static int nf_tables_fill_flowtable_info nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) || nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle), diff --git a/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch b/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch index 026816d2e89..daeb8c0acdb 100644 --- a/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch +++ b/target/linux/ipq806x/patches-4.14/0066-GPIO-add-named-gpio-exports.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" -@@ -506,3 +508,69 @@ void of_gpiochip_remove(struct gpio_chip +@@ -507,3 +509,69 @@ void of_gpiochip_remove(struct gpio_chip gpiochip_remove_pin_ranges(chip); of_node_put(chip->of_node); } diff --git a/target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch b/target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch index 30b6a11818b..784786b7c87 100644 --- a/target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch +++ b/target/linux/lantiq/patches-4.14/0030-GPIO-add-named-gpio-exports.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" -@@ -506,3 +508,73 @@ void of_gpiochip_remove(struct gpio_chip +@@ -507,3 +509,73 @@ void of_gpiochip_remove(struct gpio_chip gpiochip_remove_pin_ranges(chip); of_node_put(chip->of_node); } diff --git a/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch b/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch index e8d8852b039..3be3e1a111e 100644 --- a/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch +++ b/target/linux/mxs/patches-4.14/110-crypto-mxsdcp-provide-importexport.patch @@ -1,6 +1,6 @@ --- a/drivers/crypto/mxs-dcp.c +++ b/drivers/crypto/mxs-dcp.c -@@ -770,6 +770,24 @@ static void dcp_sha_cra_exit(struct cryp +@@ -777,6 +777,24 @@ static void dcp_sha_cra_exit(struct cryp { } @@ -25,7 +25,7 @@ /* AES 128 ECB and AES 128 CBC */ static struct crypto_alg dcp_aes_algs[] = { { -@@ -829,8 +847,11 @@ static struct ahash_alg dcp_sha1_alg = { +@@ -836,8 +854,11 @@ static struct ahash_alg dcp_sha1_alg = { .final = dcp_sha_final, .finup = dcp_sha_finup, .digest = dcp_sha_digest, @@ -37,7 +37,7 @@ .base = { .cra_name = "sha1", .cra_driver_name = "sha1-dcp", -@@ -853,8 +874,11 @@ static struct ahash_alg dcp_sha256_alg = +@@ -860,8 +881,11 @@ static struct ahash_alg dcp_sha256_alg = .final = dcp_sha_final, .finup = dcp_sha_finup, .digest = dcp_sha_digest, diff --git a/target/linux/ramips/patches-4.14/0024-GPIO-add-named-gpio-exports.patch b/target/linux/ramips/patches-4.14/0024-GPIO-add-named-gpio-exports.patch index 0c1bc739268..da8ac96eb04 100644 --- a/target/linux/ramips/patches-4.14/0024-GPIO-add-named-gpio-exports.patch +++ b/target/linux/ramips/patches-4.14/0024-GPIO-add-named-gpio-exports.patch @@ -22,7 +22,7 @@ Signed-off-by: John Crispin #include "gpiolib.h" -@@ -506,3 +508,69 @@ void of_gpiochip_remove(struct gpio_chip +@@ -507,3 +509,69 @@ void of_gpiochip_remove(struct gpio_chip gpiochip_remove_pin_ranges(chip); of_node_put(chip->of_node); } From 70cb2d20c9f5dff7c1f3344812fd0d1ac06e911d Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 10 Oct 2018 17:31:40 +0200 Subject: [PATCH 047/399] netfilter: add missing dependency for kernel 4.14 Since kernel 4.14.75 commit ("netfilter: xt_cluster: add dependency on conntrack module") a dependency is required on kmod-nf-conntrack. It seems this was already present for kmod-ipt-clusterip but not yet for kmod-ipt-cluster Add it fixing a build error when including kmod-ipt-cluster: Package kmod-ipt-cluster is missing dependencies for the following libraries: nf_conntrack.ko modules/netfilter.mk:665: recipe for target '/mnt/ramdisk/koen/firmware/builds/openwrt/bin/targets/cns3xxx/generic/packages/kmod-ipt-cluster_4.14.75-1_arm_mpcore_vfp.ipk' failed make[3]: *** [/mnt/ramdisk/koen/firmware/builds/openwrt/bin/targets/cns3xxx/generic/packages/kmod-ipt-cluster_4.14.75-1_arm_mpcore_vfp.ipk] Error 1 make[3]: Leaving directory '/mnt/ramdisk/koen/firmware/builds/openwrt/package/kernel/linux' Command exited with non-zero status 2 time: package/kernel/linux/compile#1.80#0.05#2.07 package/Makefile:107: recipe for target 'package/kernel/linux/compile' failed make[2]: *** [package/kernel/linux/compile] Error 2 make[2]: Leaving directory '/mnt/ramdisk/koen/firmware/builds/openwrt' package/Makefile:103: recipe for target '/mnt/ramdisk/koen/firmware/builds/openwrt/staging_dir/target-arm_mpcore+vfp_musl_eabi/stamp/.package_compile' failed make[1]: *** [/mnt/ramdisk/koen/firmware/builds/openwrt/staging_dir/target-arm_mpcore+vfp_musl_eabi/stamp/.package_compile] Error 2 make[1]: Leaving directory '/mnt/ramdisk/koen/firmware/builds/openwrt' /mnt/ramdisk/koen/firmware/builds/openwrt/include/toplevel.mk:216: recipe for target 'world' failed make: *** [world] Error 2 Fixes: bba743458eb4 ("kernel: bump 4.14 to 4.14.75") Signed-off-by: Koen Vandeputte [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v4.14.75&id=b969656b46626a674232c0eadf92a394b89df07c --- package/kernel/linux/modules/netfilter.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 51f3544ed6d..55226bf6295 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -642,7 +642,7 @@ define KernelPackage/ipt-cluster KCONFIG:=$(KCONFIG_IPT_CLUSTER) FILES:=$(foreach mod,$(IPT_CLUSTER-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CLUSTER-m))) - $(call AddDepends/ipt) + $(call AddDepends/ipt,+kmod-nf-conntrack) endef define KernelPackage/ipt-cluster/description From 4fa4b5edaf79a3574e1485ebb04ba7e0d2289d63 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 11 Oct 2018 18:48:35 +0200 Subject: [PATCH 048/399] mac80211: fix A-MSDU packet handling with TCP retransmission Improves local TCP throughput and fixes use-after-free bugs that could lead to crashes. Signed-off-by: Felix Fietkau --- ...-skb-fraglist-before-freeing-the-skb.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/kernel/mac80211/patches/396-mac80211-free-skb-fraglist-before-freeing-the-skb.patch diff --git a/package/kernel/mac80211/patches/396-mac80211-free-skb-fraglist-before-freeing-the-skb.patch b/package/kernel/mac80211/patches/396-mac80211-free-skb-fraglist-before-freeing-the-skb.patch new file mode 100644 index 00000000000..4819dfc648b --- /dev/null +++ b/package/kernel/mac80211/patches/396-mac80211-free-skb-fraglist-before-freeing-the-skb.patch @@ -0,0 +1,31 @@ +From: Sara Sharon +Date: Thu, 11 Oct 2018 14:21:21 +0200 +Subject: [PATCH] mac80211: free skb fraglist before freeing the skb + +mac80211 uses the frag list to build AMSDU. When freeing +the skb, it may not be really freed, since someone is still +holding a reference to it. +In that case, when TCP skb is being retransmitted, the +pointer to the frag list is being reused, while the data +in there is no longer valid. +Since we will never get frag list from the network stack, +as mac80211 doesn't advertise the capability, we can safely +free and nullify it before releasing the SKB. + +Signed-off-by: Sara Sharon +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -550,6 +550,11 @@ static void ieee80211_report_used_skb(st + } + + ieee80211_led_tx(local); ++ ++ if (skb_has_frag_list(skb)) { ++ kfree_skb_list(skb_shinfo(skb)->frag_list); ++ skb_shinfo(skb)->frag_list = NULL; ++ } + } + + /* From 235148b077cb171a762e7aa66a7258c782f47104 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 15 Oct 2018 11:22:06 +0200 Subject: [PATCH 049/399] kernel: bump 4.9 to 4.9.133 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch | 4 ++-- target/linux/generic/hack-4.9/902-debloat_proc.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 9c2741fdd2b..fc20b65e328 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .132 +LINUX_VERSION-4.9 = .133 LINUX_VERSION-4.14 = .75 -LINUX_KERNEL_HASH-4.9.132 = 67e66ae14595b3c93f228c417463e5436b9d64f5e9dfd3b92b7e24714d1ee5d3 +LINUX_KERNEL_HASH-4.9.133 = 53730fc025ba330a6f4908a6a1e4cb86d821000c84167721680ccf1b37b26563 LINUX_KERNEL_HASH-4.14.75 = 5093d7230b8f1c553450ca6c1ccd20a46a055d9277a7e161039a8642b3398120 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/brcm2708/patches-4.9/950-0060-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch b/target/linux/brcm2708/patches-4.9/950-0060-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch index 016d9cd99eb..5dc823336d5 100644 --- a/target/linux/brcm2708/patches-4.9/950-0060-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch +++ b/target/linux/brcm2708/patches-4.9/950-0060-config-Enable-CONFIG_MEMCG-but-leave-it-disabled-due.patch @@ -10,7 +10,7 @@ Subject: [PATCH] config: Enable CONFIG_MEMCG, but leave it disabled (due to --- a/kernel/cgroup.c +++ b/kernel/cgroup.c -@@ -5632,7 +5632,7 @@ int __init cgroup_init_early(void) +@@ -5636,7 +5636,7 @@ int __init cgroup_init_early(void) return 0; } @@ -19,7 +19,7 @@ Subject: [PATCH] config: Enable CONFIG_MEMCG, but leave it disabled (due to /** * cgroup_init - cgroup initialization -@@ -6173,6 +6173,28 @@ static int __init cgroup_no_v1(char *str +@@ -6177,6 +6177,28 @@ static int __init cgroup_no_v1(char *str } __setup("cgroup_no_v1=", cgroup_no_v1); diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index cab7276d290..cff61680835 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1796,10 +1796,12 @@ static int __init setup_vmstat(void) +@@ -1799,10 +1799,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS From 9ac7eb4a86ec70666393c7cc366cdd3bade57aa3 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 15 Oct 2018 11:24:04 +0200 Subject: [PATCH 050/399] kernel: bump 4.14 to 4.14.76 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...b-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch | 6 +++--- .../patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- target/linux/generic/hack-4.14/902-debloat_proc.patch | 2 +- ...91-usb-xhci-allow-imod-interval-to-be-configurable.patch | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index fc20b65e328..7f94be04adb 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .133 -LINUX_VERSION-4.14 = .75 +LINUX_VERSION-4.14 = .76 LINUX_KERNEL_HASH-4.9.133 = 53730fc025ba330a6f4908a6a1e4cb86d821000c84167721680ccf1b37b26563 -LINUX_KERNEL_HASH-4.14.75 = 5093d7230b8f1c553450ca6c1ccd20a46a055d9277a7e161039a8642b3398120 +LINUX_KERNEL_HASH-4.14.76 = ee3f19a4ff8a42793c193e361e1d34fcc821a5ca9b58db41befb2b4df0e482be remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index e8154253a32..5d9b1f6061e 100644 --- a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -255,6 +257,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -257,6 +259,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -290,6 +744,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -292,6 +746,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter driver = (struct hc_driver *)id->driver_data; /* For some HW implementation, a XHCI reset is just not enough... */ -@@ -354,6 +824,16 @@ static void xhci_pci_remove(struct pci_d +@@ -356,6 +826,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index c09d1547bd5..141b839d680 100644 --- a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -213,7 +213,7 @@ static void xhci_pci_quirks(struct devic +@@ -215,7 +215,7 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_TRUST_TX_LENGTH; if (pdev->vendor == PCI_VENDOR_ID_RENESAS && pdev->device == 0x0015) diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index e89786b47ab..54c9bd40a0c 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1944,10 +1944,12 @@ void __init init_mm_internals(void) +@@ -1947,10 +1947,12 @@ void __init init_mm_internals(void) start_shepherd_timer(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch index 52304877392..ded3916c5c5 100644 --- a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch +++ b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch @@ -86,7 +86,7 @@ Signed-off-by: Greg Kroah-Hartman if (!xhci->shared_hcd) { --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -266,6 +266,9 @@ static int xhci_pci_setup(struct usb_hcd +@@ -268,6 +268,9 @@ static int xhci_pci_setup(struct usb_hcd if (!xhci->sbrn) pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn); From 486dc7583d8d6cc9f57d4bf9781ff5680181feee Mon Sep 17 00:00:00 2001 From: Fabio Bettoni Date: Wed, 17 Oct 2018 14:27:31 +0200 Subject: [PATCH 051/399] ar71xx: fix mtd corruption In commit 9e1530b2a35e ("kernel: bump 4.9 to 4.9.117 for 18.06") [1], the following patch for removed: - 403-mtd_fix_cfi_cmdset_0002_status_check.patch This patch contained fixes for both write and erase functions. While the chip-detects for erase got fixed upstream [2], some modifications are still required, even with the fixes applied. Not doing so results in following errors seen: Collected errors: * pkg_write_filelist: Failed to open //usr/lib/opkg/info/luci-lib-ip.list: I/O error. * opkg_install_pkg: Failed to extract data files for luci-lib-ip. Package debris may remain! * opkg_install_cmd: Cannot install package luci-ssl. * opkg_conf_write_status_files: Can't open status file //usr/lib/opkg/status: I/O error. [ 0.780920] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 8.406396] jffs2: notice: (415) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found. [ 8.423476] mount_root: switching to jffs2 overlay [ 270.902671] jffs2: Write of 1989 bytes at 0x005ce6f8 failed. returned -5, retlen 962 [ 270.931965] jffs2: Write of 1989 bytes at 0x005ceec0 failed. returned -5, retlen 0 [ 270.939631] jffs2: Not marking the space at 0x005ceec0 as dirty because the flash driver returned retlen zero [ 270.950397] jffs2: Write of 68 bytes at 0x005ceec0 failed. returned -5, retlen 0 [ 270.957838] jffs2: Not marking the space at 0x005ceec0 as dirty because the flash driver returned retlen zero [ 270.968584] jffs2: Write of 68 bytes at 0x005ceec0 failed. returned -5, retlen 0 [ 270.976027] jffs2: Not marking the space at 0x005ceec0 as dirty because the flash driver returned retlen zero [ 270.986735] jffs2: Write of 68 bytes at 0x005ceec0 failed. returned -5, retlen 0 [ 270.994225] jffs2: Not marking the space at 0x005ceec0 as dirty because the flash driver returned retlen zero [1] https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=fec8fe806963c96a6506c2aebc3572d3a11f285f [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v4.9.133&id=a0239d83e1cb60de5e78452d4708c083b9e3dcbe Fixes: 9e1530b2a35e ("kernel: bump 4.9 to 4.9.117 for 18.06") Signed-off-by: Fabio Bettoni Signed-off-by: Koen Vandeputte --- ...mtd_fix_cfi_cmdset_0002_status_check.patch | 64 +++++++++++++++++++ ...mtd-cfi_cmdset_0002-force-word-write.patch | 6 +- 2 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch diff --git a/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch b/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch new file mode 100644 index 00000000000..635e13d5ce7 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/403-mtd_fix_cfi_cmdset_0002_status_check.patch @@ -0,0 +1,64 @@ +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1631,8 +1631,8 @@ static int __xipram do_write_oneword(str + break; + } + +- if (chip_ready(map, adr)) +- break; ++ if (chip_good(map, adr, datum)) ++ goto enable_xip; + + /* Latency issues. Drop the lock, wait a while and retry */ + UDELAY(map, chip, adr, 1); +@@ -1648,6 +1648,8 @@ static int __xipram do_write_oneword(str + + ret = -EIO; + } ++ ++ enable_xip: + xip_enable(map, chip, adr); + op_done: + if (mode == FL_OTP_WRITE) +@@ -2226,7 +2228,6 @@ static int cfi_amdstd_panic_write(struct + return 0; + } + +- + /* + * Handle devices with one erase region, that only implement + * the chip erase command. +@@ -2294,7 +2295,7 @@ static int __xipram do_erase_chip(struct + } + + if (chip_good(map, adr, map_word_ff(map))) +- break; ++ goto op_done; + + if (time_after(jiffies, timeo)) { + printk(KERN_WARNING "MTD %s(): software timeout\n", +@@ -2318,6 +2319,7 @@ static int __xipram do_erase_chip(struct + } + } + ++ op_done: + chip->state = FL_READY; + xip_enable(map, chip, adr); + DISABLE_VPP(map); +@@ -2391,7 +2393,7 @@ static int __xipram do_erase_oneblock(st + + if (chip_good(map, adr, map_word_ff(map))) { + xip_enable(map, chip, adr); +- break; ++ goto op_done; + } + + if (time_after(jiffies, timeo)) { +@@ -2417,6 +2419,7 @@ static int __xipram do_erase_oneblock(st + } + } + ++ op_done: + chip->state = FL_READY; + DISABLE_VPP(map); + put_chip(map, chip, adr); diff --git a/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch b/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch index ddd69f17e1a..aa708e01af3 100644 --- a/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch +++ b/target/linux/ar71xx/patches-4.9/411-mtd-cfi_cmdset_0002-force-word-write.patch @@ -35,7 +35,7 @@ /* Atmel chips don't use the same PRI format as AMD chips */ static void fixup_convert_atmel_pri(struct mtd_info *mtd) -@@ -1788,6 +1792,7 @@ static int cfi_amdstd_write_words(struct +@@ -1790,6 +1794,7 @@ static int cfi_amdstd_write_words(struct /* * FIXME: interleaved mode not tested, and probably not supported! */ @@ -43,7 +43,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, unsigned long adr, const u_char *buf, int len) -@@ -1916,7 +1921,6 @@ static int __xipram do_write_buffer(stru +@@ -1918,7 +1923,6 @@ static int __xipram do_write_buffer(stru return ret; } @@ -51,7 +51,7 @@ static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf) { -@@ -1991,6 +1995,7 @@ static int cfi_amdstd_write_buffers(stru +@@ -1993,6 +1997,7 @@ static int cfi_amdstd_write_buffers(stru return 0; } From dbd067013d05d240b44f1c75fffde6573f8c86bd Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 18 Oct 2018 12:01:18 +0200 Subject: [PATCH 052/399] kernel: bump 4.9 to 4.9.134 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../910-unaligned_access_hacks.patch | 10 ++++---- ...c_page_frag-to-page_frag_alloc-and-_.patch | 2 +- ...90-net-generalize-napi_complete_done.patch | 4 ++-- .../generic/hack-4.9/721-phy_packets.patch | 6 ++--- .../generic/hack-4.9/902-debloat_proc.patch | 4 ++-- .../pending-4.9/655-increase_skb_pad.patch | 2 +- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 24 +++++++++---------- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 12 +++++----- .../202-core-linux-support-layerscape.patch | 6 ++--- .../patches-4.9/0050-stmmac-form-4-10.patch | 8 +++---- .../patches-4.9/0051-stmmac-form-4-11.patch | 10 ++++---- .../patches-4.9/0052-stmmac-form-4-12.patch | 8 +++---- .../patches-4.9/0053-stmmac-form-4-13.patch | 4 ++-- 14 files changed, 52 insertions(+), 52 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 7f94be04adb..f1f67a5a0a8 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .133 +LINUX_VERSION-4.9 = .134 LINUX_VERSION-4.14 = .76 -LINUX_KERNEL_HASH-4.9.133 = 53730fc025ba330a6f4908a6a1e4cb86d821000c84167721680ccf1b37b26563 +LINUX_KERNEL_HASH-4.9.134 = 6dfbe8d122021c874945c0f2ebeace2248e58eed93c10ce61e4a134e70997a77 LINUX_KERNEL_HASH-4.14.76 = ee3f19a4ff8a42793c193e361e1d34fcc821a5ca9b58db41befb2b4df0e482be remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 049ee78d339..7fb38784f78 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -621,7 +621,7 @@ #define IP6_MF 0x0001 #define IP6_OFFSET 0xFFF8 -@@ -443,8 +443,8 @@ static inline void __ipv6_addr_set_half( +@@ -436,8 +436,8 @@ static inline void __ipv6_addr_set_half( } #endif #endif @@ -632,7 +632,7 @@ } static inline void ipv6_addr_set(struct in6_addr *addr, -@@ -503,6 +503,8 @@ static inline bool ipv6_prefix_equal(con +@@ -496,6 +496,8 @@ static inline bool ipv6_prefix_equal(con const __be32 *a1 = addr1->s6_addr32; const __be32 *a2 = addr2->s6_addr32; unsigned int pdw, pbi; @@ -641,7 +641,7 @@ /* check complete u32 in prefix */ pdw = prefixlen >> 5; -@@ -511,7 +513,9 @@ static inline bool ipv6_prefix_equal(con +@@ -504,7 +506,9 @@ static inline bool ipv6_prefix_equal(con /* check incomplete u32 in prefix */ pbi = prefixlen & 0x1f; @@ -652,7 +652,7 @@ return false; return true; -@@ -655,13 +659,13 @@ static inline void ipv6_addr_set_v4mappe +@@ -633,13 +637,13 @@ static inline void ipv6_addr_set_v4mappe */ static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) { @@ -668,7 +668,7 @@ if (xb) return i * 32 + 31 - __fls(ntohl(xb)); } -@@ -830,17 +834,18 @@ static inline int ip6_default_np_autolab +@@ -808,17 +812,18 @@ static inline int ip6_default_np_autolab static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, __be32 flowlabel) { diff --git a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch index fbd33160162..ddf10eb6dd3 100644 --- a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch +++ b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch @@ -52,7 +52,7 @@ Signed-off-by: Linus Torvalds #define free_page(addr) free_pages((addr), 0) --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2471,7 +2471,7 @@ static inline struct sk_buff *netdev_all +@@ -2476,7 +2476,7 @@ static inline struct sk_buff *netdev_all static inline void skb_free_frag(void *addr) { diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 90a158ec82e..dffad0216f2 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -399,7 +399,7 @@ Signed-off-by: David S. Miller /* bnx2x_has_rx_work() reads the status block, --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c -@@ -1778,7 +1778,7 @@ static int bnxt_poll_nitroa0(struct napi +@@ -1781,7 +1781,7 @@ static int bnxt_poll_nitroa0(struct napi } if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) { @@ -819,7 +819,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c -@@ -5404,7 +5404,7 @@ static int mvpp2_poll(struct napi_struct +@@ -5406,7 +5406,7 @@ static int mvpp2_poll(struct napi_struct if (budget > 0) { cause_rx = 0; diff --git a/target/linux/generic/hack-4.9/721-phy_packets.patch b/target/linux/generic/hack-4.9/721-phy_packets.patch index fbf3c70cac6..b25fdec47a4 100644 --- a/target/linux/generic/hack-4.9/721-phy_packets.patch +++ b/target/linux/generic/hack-4.9/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2334,6 +2334,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2339,6 +2339,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2454,16 +2458,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2459,16 +2463,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2950,10 +2950,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2972,10 +2972,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index cff61680835..3095f832a27 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1799,10 +1799,12 @@ static int __init setup_vmstat(void) +@@ -1798,10 +1798,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS @@ -381,7 +381,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c -@@ -564,6 +564,9 @@ static __net_initdata struct pernet_oper +@@ -565,6 +565,9 @@ static __net_initdata struct pernet_oper int __init ip_misc_proc_init(void) { diff --git a/target/linux/generic/pending-4.9/655-increase_skb_pad.patch b/target/linux/generic/pending-4.9/655-increase_skb_pad.patch index ebd9893aa29..de96d9a41dc 100644 --- a/target/linux/generic/pending-4.9/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.9/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2298,7 +2298,7 @@ static inline int pskb_network_may_pull( +@@ -2303,7 +2303,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 38c2ae647f9..35ffce38ed3 100644 --- a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -300,15 +300,15 @@ Signed-off-by: Steven Barth /** * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own * @t: the outgoing tunnel device -@@ -1294,6 +1434,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1299,6 +1439,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str { struct ip6_tnl *t = netdev_priv(dev); - struct ipv6hdr *ipv6h = ipv6_hdr(skb); + struct ipv6hdr *ipv6h; + struct __ip6_tnl_fmr *fmr; int encap_limit = -1; __u16 offset; struct flowi6 fl6; -@@ -1352,6 +1493,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1361,6 +1502,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str fl6.flowi6_mark = skb->mark; } @@ -327,7 +327,7 @@ Signed-off-by: Steven Barth if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; -@@ -1479,6 +1632,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1488,6 +1641,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.flowinfo = p->flowinfo; t->parms.link = p->link; t->parms.proto = p->proto; @@ -342,7 +342,7 @@ Signed-off-by: Steven Barth dst_cache_reset(&t->dst_cache); ip6_tnl_link_config(t); return 0; -@@ -1517,6 +1678,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1526,6 +1687,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1894,6 +2056,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1903,6 +2065,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1928,6 +2099,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1937,6 +2108,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_COLLECT_METADATA]) parms->collect_md = true; @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2041,6 +2252,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2050,6 +2261,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2068,6 +2285,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2077,6 +2294,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(2) + /* IFLA_IPTUN_COLLECT_METADATA */ nla_total_size(0) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2075,6 +2310,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2084,6 +2319,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2083,9 +2321,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2092,9 +2330,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2123,6 +2379,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2132,6 +2388,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, diff --git a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 4d1f6c4c2b9..58518f9cfd2 100644 --- a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -742,7 +742,8 @@ struct sk_buff { +@@ -747,7 +747,8 @@ struct sk_buff { #ifdef CONFIG_NET_SWITCHDEV __u8 offload_fwd_mark:1; #endif @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4550,6 +4550,9 @@ static enum gro_result dev_gro_receive(s +@@ -4572,6 +4572,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5838,6 +5841,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5860,6 +5863,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -5910,6 +5955,7 @@ static int __netdev_upper_dev_link(struc +@@ -5932,6 +5977,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -6036,6 +6082,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6058,6 +6104,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -109,7 +109,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6636,6 +6683,7 @@ int dev_set_mac_address(struct net_devic +@@ -6660,6 +6707,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch index 3484fc398ec..3229da5321e 100644 --- a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch @@ -376,7 +376,7 @@ Signed-off-by: Yangbo Lu unsigned short min_header_len; --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb); +@@ -908,6 +908,7 @@ void kfree_skb(struct sk_buff *skb); void kfree_skb_list(struct sk_buff *segs); void skb_tx_error(struct sk_buff *skb); void consume_skb(struct sk_buff *skb); @@ -384,7 +384,7 @@ Signed-off-by: Yangbo Lu void __kfree_skb(struct sk_buff *skb); extern struct kmem_cache *skbuff_head_cache; -@@ -3059,6 +3060,7 @@ static inline void skb_free_datagram_loc +@@ -3081,6 +3082,7 @@ static inline void skb_free_datagram_loc } int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); @@ -421,7 +421,7 @@ Signed-off-by: Yangbo Lu * These are the defined Ethernet Protocol ID's. --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6630,9 +6630,18 @@ int dev_set_mtu(struct net_device *dev, +@@ -6652,9 +6652,18 @@ int dev_set_mtu(struct net_device *dev, if (new_mtu == dev->mtu) return 0; diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch index 22d62f09607..ddc8290205c 100644 --- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch +++ b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch @@ -3403,7 +3403,7 @@ --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -292,6 +292,7 @@ stmmac_probe_config_dt(struct platform_d +@@ -291,6 +291,7 @@ stmmac_probe_config_dt(struct platform_d if (of_device_is_compatible(np, "snps,dwmac-4.00") || of_device_is_compatible(np, "snps,dwmac-4.10a")) { plat->has_gmac4 = 1; @@ -3411,7 +3411,7 @@ plat->pmt = 1; plat->tso_en = of_property_read_bool(np, "snps,tso"); } -@@ -303,21 +304,25 @@ stmmac_probe_config_dt(struct platform_d +@@ -302,21 +303,25 @@ stmmac_probe_config_dt(struct platform_d plat->force_sf_dma_mode = 1; } @@ -3452,7 +3452,7 @@ plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode"); if (plat->force_thresh_dma_mode) { plat->force_sf_dma_mode = 0; -@@ -445,9 +450,7 @@ static int stmmac_pltfr_suspend(struct d +@@ -444,9 +449,7 @@ static int stmmac_pltfr_suspend(struct d struct platform_device *pdev = to_platform_device(dev); ret = stmmac_suspend(dev); @@ -3463,7 +3463,7 @@ priv->plat->exit(pdev, priv->plat->bsp_priv); return ret; -@@ -466,9 +469,7 @@ static int stmmac_pltfr_resume(struct de +@@ -465,9 +468,7 @@ static int stmmac_pltfr_resume(struct de struct stmmac_priv *priv = netdev_priv(ndev); struct platform_device *pdev = to_platform_device(dev); diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch index 2ce23e2eb5f..5f89e4b728f 100644 --- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch +++ b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch @@ -2132,7 +2132,7 @@ The full GNU General Public License is included in this distribution in the file called "COPYING". -@@ -121,7 +117,6 @@ static struct stmmac_axi *stmmac_axi_set +@@ -120,7 +116,6 @@ static struct stmmac_axi *stmmac_axi_set axi->axi_lpi_en = of_property_read_bool(np, "snps,lpi_en"); axi->axi_xit_frm = of_property_read_bool(np, "snps,xit_frm"); axi->axi_kbbe = of_property_read_bool(np, "snps,axi_kbbe"); @@ -2140,7 +2140,7 @@ axi->axi_fb = of_property_read_bool(np, "snps,axi_fb"); axi->axi_mb = of_property_read_bool(np, "snps,axi_mb"); axi->axi_rb = of_property_read_bool(np, "snps,axi_rb"); -@@ -181,10 +176,19 @@ static int stmmac_dt_phy(struct plat_stm +@@ -180,10 +175,19 @@ static int stmmac_dt_phy(struct plat_stm mdio = false; } @@ -2164,7 +2164,7 @@ } if (plat->mdio_node) { -@@ -249,6 +253,9 @@ stmmac_probe_config_dt(struct platform_d +@@ -248,6 +252,9 @@ stmmac_probe_config_dt(struct platform_d plat->force_sf_dma_mode = of_property_read_bool(np, "snps,force_sf_dma_mode"); @@ -2174,7 +2174,7 @@ /* Set the maxmtu to a default of JUMBO_LEN in case the * parameter is not present in the device tree. */ -@@ -333,7 +340,54 @@ stmmac_probe_config_dt(struct platform_d +@@ -332,7 +339,54 @@ stmmac_probe_config_dt(struct platform_d plat->axi = stmmac_axi_setup(pdev); @@ -2229,7 +2229,7 @@ } /** -@@ -357,7 +411,7 @@ void stmmac_remove_config_dt(struct plat +@@ -356,7 +410,7 @@ void stmmac_remove_config_dt(struct plat struct plat_stmmacenet_data * stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) { diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index a1b018186f5..8b7327d9153 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -5642,7 +5642,7 @@ --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -108,7 +108,7 @@ static struct stmmac_axi *stmmac_axi_set +@@ -107,7 +107,7 @@ static struct stmmac_axi *stmmac_axi_set if (!np) return NULL; @@ -5651,7 +5651,7 @@ if (!axi) { of_node_put(np); return ERR_PTR(-ENOMEM); -@@ -132,6 +132,155 @@ static struct stmmac_axi *stmmac_axi_set +@@ -131,6 +131,155 @@ static struct stmmac_axi *stmmac_axi_set } /** @@ -5807,7 +5807,7 @@ * stmmac_dt_phy - parse device-tree driver parameters to allocate PHY resources * @plat: driver data platform structure * @np: device tree node -@@ -340,6 +489,8 @@ stmmac_probe_config_dt(struct platform_d +@@ -339,6 +488,8 @@ stmmac_probe_config_dt(struct platform_d plat->axi = stmmac_axi_setup(pdev); @@ -5816,7 +5816,7 @@ /* clock setup */ plat->stmmac_clk = devm_clk_get(&pdev->dev, STMMAC_RESOURCE_NAME); -@@ -359,13 +510,12 @@ stmmac_probe_config_dt(struct platform_d +@@ -358,13 +509,12 @@ stmmac_probe_config_dt(struct platform_d clk_prepare_enable(plat->pclk); /* Fall-back to main clock in case of no PTP ref is passed */ diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch index abdc618e6bf..12b8ad04e18 100644 --- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch +++ b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch @@ -1879,7 +1879,7 @@ --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -309,6 +309,13 @@ static int stmmac_dt_phy(struct plat_stm +@@ -308,6 +308,13 @@ static int stmmac_dt_phy(struct plat_stm struct device_node *np, struct device *dev) { bool mdio = true; @@ -1893,7 +1893,7 @@ /* If phy-handle property is passed from DT, use it as the PHY */ plat->phy_node = of_parse_phandle(np, "phy-handle", 0); -@@ -325,8 +332,7 @@ static int stmmac_dt_phy(struct plat_stm +@@ -324,8 +331,7 @@ static int stmmac_dt_phy(struct plat_stm mdio = false; } From 47f68ca58615fa71d7905130fb28d3ffe51effa2 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 18 Oct 2018 12:11:27 +0200 Subject: [PATCH 053/399] kernel: bump 4.14 to 4.14.77 Refreshed all patches. Altered patches: - 666-Add-support-for-MAP-E-FMRs-mesh-mode.patch New symbol for arm targets: - HARDEN_BRANCH_PREDICTOR Compile-tested on: cns3xxx, imx6, x86_64 Runtime-tested on: cns3xxx, imx6, x86_64 Signed-off-by: Koen Vandeputte Tested-by: Stijn Tintel --- include/kernel-version.mk | 4 ++-- target/linux/armvirt/32/config-default | 1 + ...-arm_introduce-dma-fiq-irq-broadcast.patch | 2 +- .../patches-4.14/040-fiq_support.patch | 2 +- .../661-use_fq_codel_by_default.patch | 2 +- .../generic/hack-4.14/721-phy_packets.patch | 2 +- .../generic/hack-4.14/902-debloat_proc.patch | 2 +- ...s-negative-stack-offsets-on-stack-tr.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../pending-4.14/630-packet_socket_type.patch | 6 ++--- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 24 +++++++++---------- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 ++++---- target/linux/imx6/config-4.14 | 1 + target/linux/ipq40xx/config-4.14 | 1 + target/linux/ipq806x/config-4.14 | 1 + target/linux/mediatek/mt7623/config-4.14 | 1 + .../0048-net-core-add-RPS-balancer.patch | 6 ++--- target/linux/mvebu/cortexa9/config-default | 1 + target/linux/omap/config-4.14 | 1 + target/linux/sunxi/cortexa7/config-default | 1 + target/linux/sunxi/cortexa8/config-default | 1 + ...dwmac-mdio-MDIOs-are-automatically-r.patch | 2 +- 22 files changed, 42 insertions(+), 33 deletions(-) create mode 100644 target/linux/mvebu/cortexa9/config-default diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f1f67a5a0a8..3102130eb30 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .134 -LINUX_VERSION-4.14 = .76 +LINUX_VERSION-4.14 = .77 LINUX_KERNEL_HASH-4.9.134 = 6dfbe8d122021c874945c0f2ebeace2248e58eed93c10ce61e4a134e70997a77 -LINUX_KERNEL_HASH-4.14.76 = ee3f19a4ff8a42793c193e361e1d34fcc821a5ca9b58db41befb2b4df0e482be +LINUX_KERNEL_HASH-4.14.77 = 0496f4e194cadbe23f27e6f4b9c3cd264448983780b73b30f7f05c92273fa6f8 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/armvirt/32/config-default b/target/linux/armvirt/32/config-default index 96df547db70..a3530b0e77d 100644 --- a/target/linux/armvirt/32/config-default +++ b/target/linux/armvirt/32/config-default @@ -48,6 +48,7 @@ CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" # CONFIG_DEBUG_UART_8250 is not set # CONFIG_DEBUG_USER is not set CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HAVE_ARM_ARCH_TIMER=y CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_IDE=y diff --git a/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch b/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch index ca7148b3015..3841ca032b7 100644 --- a/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch +++ b/target/linux/cns3xxx/patches-4.14/010-arm_introduce-dma-fiq-irq-broadcast.patch @@ -20,7 +20,7 @@ #endif --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig -@@ -899,6 +899,17 @@ config DMA_CACHE_RWFO +@@ -922,6 +922,17 @@ config DMA_CACHE_RWFO in hardware, other workarounds are needed (e.g. cache maintenance broadcasting in software via FIQ). diff --git a/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch b/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch index a52c5545038..5a62eb38ac9 100644 --- a/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch +++ b/target/linux/cns3xxx/patches-4.14/040-fiq_support.patch @@ -29,7 +29,7 @@ */ --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig -@@ -882,7 +882,7 @@ config VDSO +@@ -905,7 +905,7 @@ config VDSO config DMA_CACHE_RWFO bool "Enable read/write for ownership DMA cache maintenance" diff --git a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch index 7c724c0af71..d1e92ae40af 100644 --- a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2014,7 +2014,7 @@ static int __init pktsched_init(void) +@@ -2028,7 +2028,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index 3caeeaa1929..ebe4787b681 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2982,10 +2982,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -3004,10 +3004,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 54c9bd40a0c..4e700ca0b72 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1947,10 +1947,12 @@ void __init init_mm_internals(void) +@@ -1951,10 +1951,12 @@ void __init init_mm_internals(void) start_shepherd_timer(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/pending-4.14/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch b/target/linux/generic/pending-4.14/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch index b3dc43ea68c..92e86b24e76 100644 --- a/target/linux/generic/pending-4.14/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch +++ b/target/linux/generic/pending-4.14/102-MIPS-only-process-negative-stack-offsets-on-stack-tr.patch @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c -@@ -358,6 +358,8 @@ static inline int is_sp_move_ins(union m +@@ -360,6 +360,8 @@ static inline int is_sp_move_ins(union m if (ip->i_format.opcode == addiu_op || ip->i_format.opcode == daddiu_op) { diff --git a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 44e7fa70a3a..bbcb7c23fa7 100644 --- a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6146,7 +6146,7 @@ static void __ref alloc_node_mem_map(str +@@ -6153,7 +6153,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch index e1736214f5e..d55d678549f 100644 --- a/target/linux/generic/pending-4.14/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3262,6 +3264,7 @@ static int packet_create(struct net *net +@@ -3265,6 +3267,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3875,6 +3878,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3878,6 +3881,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3927,6 +3940,13 @@ static int packet_getsockopt(struct sock +@@ -3930,6 +3943,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 3b69b6855e5..0b46ed9e47b 100644 --- a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -300,15 +300,15 @@ Signed-off-by: Steven Barth /** * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own * @t: the outgoing tunnel device -@@ -1299,6 +1439,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1304,6 +1444,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str { struct ip6_tnl *t = netdev_priv(dev); - struct ipv6hdr *ipv6h = ipv6_hdr(skb); + struct ipv6hdr *ipv6h; + struct __ip6_tnl_fmr *fmr; int encap_limit = -1; __u16 offset; struct flowi6 fl6; -@@ -1361,6 +1502,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1370,6 +1511,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); @@ -327,7 +327,7 @@ Signed-off-by: Steven Barth if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; -@@ -1489,6 +1642,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1498,6 +1651,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.link = p->link; t->parms.proto = p->proto; t->parms.fwmark = p->fwmark; @@ -342,7 +342,7 @@ Signed-off-by: Steven Barth dst_cache_reset(&t->dst_cache); ip6_tnl_link_config(t); return 0; -@@ -1527,6 +1688,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1536,6 +1697,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1913,6 +2075,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1922,6 +2084,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1950,6 +2121,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1959,6 +2130,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_FWMARK]) parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2065,6 +2276,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2074,6 +2285,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2094,6 +2311,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2103,6 +2320,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(0) + /* IFLA_IPTUN_FWMARK */ nla_total_size(4) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2101,6 +2336,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2110,6 +2345,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2110,9 +2348,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2119,9 +2357,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2152,6 +2408,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2161,6 +2417,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 36c0fb57aee..feeb7e70f8d 100644 --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4783,6 +4783,9 @@ static enum gro_result dev_gro_receive(s +@@ -4805,6 +4805,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -6253,6 +6256,48 @@ static void __netdev_adjacent_dev_unlink +@@ -6275,6 +6278,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -6291,6 +6336,7 @@ static int __netdev_upper_dev_link(struc +@@ -6313,6 +6358,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -6368,6 +6414,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6390,6 +6436,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6938,6 +6985,7 @@ int dev_set_mac_address(struct net_devic +@@ -6962,6 +7009,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/imx6/config-4.14 b/target/linux/imx6/config-4.14 index ea72d18f9da..7829b4b5072 100644 --- a/target/linux/imx6/config-4.14 +++ b/target/linux/imx6/config-4.14 @@ -218,6 +218,7 @@ CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GPIO_SYSFS=y # CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/ipq40xx/config-4.14 b/target/linux/ipq40xx/config-4.14 index fa52d58bed2..a9c1e6a92d1 100644 --- a/target/linux/ipq40xx/config-4.14 +++ b/target/linux/ipq40xx/config-4.14 @@ -191,6 +191,7 @@ CONFIG_GPIO_WATCHDOG=y # CONFIG_GPIO_WATCHDOG_ARCH_INITCALL is not set # CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/ipq806x/config-4.14 b/target/linux/ipq806x/config-4.14 index fda8f52d2c7..30736ae14e3 100644 --- a/target/linux/ipq806x/config-4.14 +++ b/target/linux/ipq806x/config-4.14 @@ -183,6 +183,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_SYSFS=y CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/mediatek/mt7623/config-4.14 b/target/linux/mediatek/mt7623/config-4.14 index 05d99941cd3..a38f02f2d19 100644 --- a/target/linux/mediatek/mt7623/config-4.14 +++ b/target/linux/mediatek/mt7623/config-4.14 @@ -193,6 +193,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIO_SYSFS=y # CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch b/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch index 6cb5fa74955..01589f224d9 100644 --- a/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch +++ b/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3636,6 +3636,58 @@ set_rps_cpu(struct net_device *dev, stru +@@ -3658,6 +3658,58 @@ set_rps_cpu(struct net_device *dev, stru return rflow; } @@ -69,7 +69,7 @@ Signed-off-by: John Crispin /* * get_rps_cpu is called from netif_receive_skb and returns the target * CPU from the RPS map of the receiving queue for a given skb. -@@ -3725,7 +3777,7 @@ static int get_rps_cpu(struct net_device +@@ -3747,7 +3799,7 @@ static int get_rps_cpu(struct net_device try_rps: if (map) { @@ -78,7 +78,7 @@ Signed-off-by: John Crispin if (cpu_online(tcpu)) { cpu = tcpu; goto done; -@@ -8810,6 +8862,9 @@ static int __init net_dev_init(void) +@@ -8834,6 +8886,9 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/mvebu/cortexa9/config-default b/target/linux/mvebu/cortexa9/config-default new file mode 100644 index 00000000000..c9f039ba96e --- /dev/null +++ b/target/linux/mvebu/cortexa9/config-default @@ -0,0 +1 @@ +CONFIG_HARDEN_BRANCH_PREDICTOR=y diff --git a/target/linux/omap/config-4.14 b/target/linux/omap/config-4.14 index d5f81715656..2f738182e6a 100644 --- a/target/linux/omap/config-4.14 +++ b/target/linux/omap/config-4.14 @@ -272,6 +272,7 @@ CONFIG_GPIO_TWL4030=y CONFIG_GPIO_TWL6040=y CONFIG_GRACE_PERIOD=y CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/sunxi/cortexa7/config-default b/target/linux/sunxi/cortexa7/config-default index cf41ddb4e65..9daf9c443a0 100644 --- a/target/linux/sunxi/cortexa7/config-default +++ b/target/linux/sunxi/cortexa7/config-default @@ -1,4 +1,5 @@ CONFIG_DWMAC_SUN8I=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y # CONFIG_MACH_SUN4I is not set # CONFIG_MACH_SUN5I is not set # CONFIG_PINCTRL_GR8 is not set diff --git a/target/linux/sunxi/cortexa8/config-default b/target/linux/sunxi/cortexa8/config-default index fa40deb6f82..aab7dec0af9 100644 --- a/target/linux/sunxi/cortexa8/config-default +++ b/target/linux/sunxi/cortexa8/config-default @@ -1,6 +1,7 @@ # CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set # CONFIG_ARM_ERRATA_643719 is not set # CONFIG_ARM_LPAE is not set +CONFIG_HARDEN_BRANCH_PREDICTOR=y # CONFIG_MACH_SUN6I is not set # CONFIG_MACH_SUN7I is not set # CONFIG_MACH_SUN8I is not set diff --git a/target/linux/sunxi/patches-4.14/001-net-stmmac-snps-dwmac-mdio-MDIOs-are-automatically-r.patch b/target/linux/sunxi/patches-4.14/001-net-stmmac-snps-dwmac-mdio-MDIOs-are-automatically-r.patch index 3a9668b6411..838b234717e 100644 --- a/target/linux/sunxi/patches-4.14/001-net-stmmac-snps-dwmac-mdio-MDIOs-are-automatically-r.patch +++ b/target/linux/sunxi/patches-4.14/001-net-stmmac-snps-dwmac-mdio-MDIOs-are-automatically-r.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -318,10 +318,6 @@ static int stmmac_dt_phy(struct plat_stm +@@ -317,10 +317,6 @@ static int stmmac_dt_phy(struct plat_stm bool mdio = true; static const struct of_device_id need_mdio_ids[] = { { .compatible = "snps,dwc-qos-ethernet-4.10" }, From 4dc42ef40eb51074d55c701c86ae5b49599c67b1 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 22 Oct 2018 11:51:07 +0200 Subject: [PATCH 054/399] kernel: bump 4.9 to 4.9.135 Refreshed all patches. Fixes: - CVE-2018-10883 Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../patches-4.9/810-iommu-support-layerscape.patch | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 3102130eb30..487039e53bc 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .134 +LINUX_VERSION-4.9 = .135 LINUX_VERSION-4.14 = .77 -LINUX_KERNEL_HASH-4.9.134 = 6dfbe8d122021c874945c0f2ebeace2248e58eed93c10ce61e4a134e70997a77 +LINUX_KERNEL_HASH-4.9.135 = e023b0bbe9ea7fc56aa57210342dd18ea3e0900ee207226df1523c6d7df154ce LINUX_KERNEL_HASH-4.14.77 = 0496f4e194cadbe23f27e6f4b9c3cd264448983780b73b30f7f05c92273fa6f8 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index e31c7db3e81..b072ccca11c 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -25,7 +25,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c -@@ -373,6 +373,8 @@ static struct iommu_group *acpihid_devic +@@ -379,6 +379,8 @@ static struct iommu_group *acpihid_devic if (!entry->group) entry->group = generic_device_group(dev); @@ -34,7 +34,7 @@ Signed-off-by: Yangbo Lu return entry->group; } -@@ -3160,9 +3162,10 @@ static bool amd_iommu_capable(enum iommu +@@ -3166,9 +3168,10 @@ static bool amd_iommu_capable(enum iommu return false; } @@ -47,7 +47,7 @@ Signed-off-by: Yangbo Lu struct unity_map_entry *entry; int devid; -@@ -3171,41 +3174,56 @@ static void amd_iommu_get_dm_regions(str +@@ -3177,41 +3180,56 @@ static void amd_iommu_get_dm_regions(str return; list_for_each_entry(entry, &amd_iommu_unity_map, list) { @@ -118,7 +118,7 @@ Signed-off-by: Yangbo Lu { struct dma_ops_domain *dma_dom = to_dma_ops_domain(to_pdomain(domain)); unsigned long start, end; -@@ -3229,9 +3247,9 @@ static const struct iommu_ops amd_iommu_ +@@ -3235,9 +3253,9 @@ static const struct iommu_ops amd_iommu_ .add_device = amd_iommu_add_device, .remove_device = amd_iommu_remove_device, .device_group = amd_iommu_device_group, From 270b9d30f68fe25f6b17dbe5160efdb540ecd185 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 22 Oct 2018 14:13:40 +0200 Subject: [PATCH 055/399] kernel: bump 4.14 to 4.14.78 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...30-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch | 4 ++-- .../patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 487039e53bc..f0ac2671ed1 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .135 -LINUX_VERSION-4.14 = .77 +LINUX_VERSION-4.14 = .78 LINUX_KERNEL_HASH-4.9.135 = e023b0bbe9ea7fc56aa57210342dd18ea3e0900ee207226df1523c6d7df154ce -LINUX_KERNEL_HASH-4.14.77 = 0496f4e194cadbe23f27e6f4b9c3cd264448983780b73b30f7f05c92273fa6f8 +LINUX_KERNEL_HASH-4.14.78 = f4da4dc0f079e420e1c1b8c71312eaa5415b08be847aa224a61d8af6a6e74c6c remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch index e4a722646e1..ba4fb5f7175 100644 --- a/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch +++ b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch @@ -47,7 +47,7 @@ Signed-off-by: Christian Lamparter } static inline void emac_tx_enable(struct emac_instance *dev) -@@ -2865,7 +2865,7 @@ static int emac_init_config(struct emac_ +@@ -2870,7 +2870,7 @@ static int emac_init_config(struct emac_ /* PHY mode needs some decoding */ dev->phy_mode = of_get_phy_mode(np); if (dev->phy_mode < 0) @@ -56,7 +56,7 @@ Signed-off-by: Christian Lamparter /* Check EMAC version */ if (of_device_is_compatible(np, "ibm,emac4sync")) { -@@ -3168,7 +3168,7 @@ static int emac_probe(struct platform_de +@@ -3173,7 +3173,7 @@ static int emac_probe(struct platform_de printk(KERN_INFO "%s: EMAC-%d %pOF, MAC %pM\n", ndev->name, dev->cell_index, np, ndev->dev_addr); diff --git a/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch index 7f630a3c2a2..ced284ee3b2 100644 --- a/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch +++ b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch @@ -30,7 +30,7 @@ #endif } -@@ -2879,6 +2888,7 @@ static int emac_init_config(struct emac_ +@@ -2884,6 +2893,7 @@ static int emac_init_config(struct emac_ if (of_device_is_compatible(np, "ibm,emac-apm821xx")) { dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE | EMAC_FTR_APM821XX_NO_HALF_DUPLEX | From 3a9aed24d1db62be8bb8d2c76e6bf208e8403f0c Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sun, 19 Aug 2018 20:52:00 +0200 Subject: [PATCH 056/399] dnsmasq: bump to v2.80 Cherry-picked & squashed from relevant commits from master: dnsmasq v2.80 release Change from rc1: 91421cb Fix compiler warning. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 6c4d3d705a0d6e508de94dc49736c250ecdae27c) dnsmasq: remove creation of /etc/ethers Remove creation of file /etc/ethers in dnsmasq init script as the file is now created by default in the base-files package by commit fa3301a28e Signed-off-by: Hans Dedecker (cherry picked from commit 6c227e45cb6a97c61d9fa2ffa35cebee2a048739) dnsmasq: bump to dnsmasq v2.80test5 Refresh patches Remove 240-ubus patch as upstream accepted. Add uci option ubus which allows to enable/disable ubus support (enabled by default) Upstream commits since last bump: da8b651 Implement --address=/example.com/# c5db8f9 Tidy 7f876b64c22b2b18412e2e3d8506ee33e42db7c 974a6d0 Add --caa-record b758b67 Improve logging of RRs from --dns-rr. 9bafdc6 Tidy up file parsing code. 97f876b Properly deal with unaligned addresses in DHCPv6 packets. cbfbd17 Fix broken DNSSEC records in previous. b6f926f Don't return NXDOMAIN to empty non-terminals. c822620 Add --dhcp-name-match 397c050 Handle case of --auth-zone but no --auth-server. 1682d15 Add missing EDNS0 section. EDNS0 section missing in replies to EDNS0-containing queries where answer generated from --local=// dd33e98 Fix crash parsing a --synth-domain with no prefix. Problem introduced in 2.79/6b2b564ac34cb3c862f168e6b1457f9f0b9ca69c c16d966 Add copyright to src/metrics.h 1dfed16 Remove C99 only code. 6f835ed Format fixes - ubus.c 9d6fd17 dnsmasq.c fix OPT_UBUS option usage 8c1b6a5 New metrics and ubus files. 8dcdb33 Add --enable-ubus option. aba8bbb Add collection of metrics caf4d57 Add OpenWRT ubus patch Signed-off-by: Hans Dedecker (cherry picked from commit 3d377f4375c6e4a66c6741bbd2549ad53ef671b3) dnsmasq: bump to dnsmasq 2.80test6 Refresh patches Changes since latest bump: af3bd07 Man page typo. d682099 Picky changes to 47b45b2967c931fed3c89a2e6a8df9f9183a5789 47b45b2 Fix lengths of interface names 2b38e38 Minor improvements in lease-tools 282eab7 Mark die function as never returning c346f61 Handle ANY queries in context of da8b6517decdac593e7ce24bde2824dd841725c8 03212e5 Manpage typo. Signed-off-by: Hans Dedecker (cherry picked from commit 43d4b8e89e68fcab00698ee3b70a58c74813a6a7) dnsmasq: Handle memory allocation failure in make_non_terminals() Backport upstream commit: ea6cc33 Handle memory allocation failure in make_non_terminals() Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 687168ccd9154b1fb7a470fa8f42ce64a135f51d) dnsmasq: Change behavior when RD bit unset in queries. Backport upstream commit Change anti cache-snooping behaviour with queries with the recursion-desired bit unset. Instead to returning SERVFAIL, we now always forward, and never answer from the cache. This allows "dig +trace" command to work. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 6c4cbe94bd940b5c061e27744eb78805764d6b34) dnsmasq: bump to v2.80test7 Bump to latest test release: 3a610a0 Finesse allocation of memory for "struct crec" cache entries. 48b090c Fix b6f926fbefcd2471699599e44f32b8d25b87b471 to not SEGV on startup (rarely). 4139298 Change behavior when RD bit unset in queries. 51cc10f Add warning about 0.0.0.0 and :: addresses to man page. ea6cc33 Handle memory allocation failure in make_non_terminals() ad03967 Add debian/tmpfiles.conf f4fd07d Debian bugfix. e3c08a3 Debian packaging fix. (restorecon) 118011f Debian packaging fix. (tmpfiles.d) Delete our own backports of ea6cc33 & 4139298, so the only real changes here, since we don't care about the Debian stuff are 48b090c & 3a610a0 Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit d9a37d8d1eb7d117d5aa44924064a4a3b5517ddd) dnsmasq: bump to v2.80test8 e1791f3 Fix logging of DNSSEC queries in TCP mode. Destination server address was misleading. 0fdf3c1 Fix dhcp-match-name to match hostname, not complete FQDN. ee1df06 Tweak strategy for confirming SLAAC addresses. 1e87eba Clarify manpage for --auth-sec-servers 0893347 Make interface spec optional in --auth-server. 7cbf497 Example config file fix for CERT Vulnerability VU#598349. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 30cc5b0bf4f3cdfe950ca7fc380a34c81dd9d7e4) dnsmasq: add dhcp-ignore-names support - CERT VU#598349 dnsmasq v2.80test8 adds the ability to ignore dhcp client's requests for specific hostnames. Clients claiming certain hostnames and thus claiming DNS namespace represent a potential security risk. e.g. a malicious host could claim 'wpad' for itself and redirect other web client requests to it for nefarious purpose. See CERT VU#598349 for more details. Some Samsung TVs are claiming the hostname 'localhost', it is believed not (yet) for nefarious purposes. /usr/share/dnsmasq/dhcpbogushostname.conf contains a list of hostnames in correct syntax to be excluded. e.g. dhcp-name-match=set:dhcp_bogus_hostname,localhost Inclusion of this file is controlled by uci option dhcpbogushostname which is enabled by default. To be absolutely clear, DHCP leases to these requesting hosts are still permitted, but they do NOT get to claim ownership of the hostname itself and hence put into DNS for other hosts to be confused/manipulate by. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit a45f4f50e16cd2d0370a4470c3ede0c6c7754ba9) dnsmasq: fix compile issue Fix compile issue in case HAVE_BROKEN_RTC is enabled Signed-off-by: Hans Dedecker (cherry picked from commit 39e5e17045aceb2bfbd6b5c6ecfd6cfbce2f3311) dnsmasq: bump to v2.80rc1 53792c9 fix typo df07182 Update German translation. Remove local patch 001-fix-typo which is a backport of the above 53792c9 There is no practical difference between our test8 release and this rc release, but this does at least say 'release candidate' Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit b8bc672f247a68bc6f72f08f9352cd7aaa5cb9c4) dnsmasq: fix dnsmasq failure to start when ujail'd This patch fixes jailed dnsmasq running into the following issue: |dnsmasq[1]: cannot read /usr/share/dnsmasq/dhcpbogushostname.conf: No such file or directory |dnsmasq[1]: FAILED to start up |procd: Instance dnsmasq::cfg01411c s in a crash loop 6 crashes, 0 seconds since last crash Fixes: a45f4f50e16 ("dnsmasq: add dhcp-ignore-names support - CERT VU#598349") Signed-off-by: Christian Lamparter [bump package release] Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 583466bb5b374b29b6b7cba6f065e97c4734f742) Signed-off-by: Kevin Darbyshire-Bryant --- package/network/services/dnsmasq/Makefile | 10 +- .../dnsmasq/files/dhcpbogushostname.conf | 8 ++ .../services/dnsmasq/files/dnsmasq.init | 14 +- ...0-fix-poll-h-include-warning-on-musl.patch | 2 +- .../services/dnsmasq/patches/240-ubus.patch | 128 ------------------ 5 files changed, 25 insertions(+), 137 deletions(-) create mode 100644 package/network/services/dnsmasq/files/dhcpbogushostname.conf delete mode 100644 package/network/services/dnsmasq/patches/240-ubus.patch diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 7b95d5dccff..5e76579e4b0 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq -PKG_VERSION:=2.80test3 +PKG_VERSION:=2.80 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/test-releases -PKG_HASH:=af9f6fd13e0d6c5a68059bcf8634c2784c0533017fd48fbaf59cd2955342d301 +PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq +PKG_HASH:=cdaba2785e92665cf090646cba6f94812760b9d7d8c8d0cfb07ac819377a63bb PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING @@ -124,7 +124,8 @@ Package/dnsmasq-full/conffiles = $(Package/dnsmasq/conffiles) TARGET_CFLAGS += -ffunction-sections -fdata-sections TARGET_LDFLAGS += -Wl,--gc-sections -COPTS = $(if $(CONFIG_IPV6),,-DNO_IPV6) +COPTS = -DHAVE_UBUS \ + $(if $(CONFIG_IPV6),,-DNO_IPV6) ifeq ($(BUILD_VARIANT),nodhcpv6) COPTS += -DNO_DHCP6 @@ -165,6 +166,7 @@ define Package/dnsmasq/install $(INSTALL_DIR) $(1)/etc/hotplug.d/tftp $(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec $(INSTALL_DIR) $(1)/usr/share/dnsmasq + $(INSTALL_DATA) ./files/dhcpbogushostname.conf $(1)/usr/share/dnsmasq/ $(INSTALL_DATA) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/ $(INSTALL_DIR) $(1)/usr/lib/dnsmasq $(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh diff --git a/package/network/services/dnsmasq/files/dhcpbogushostname.conf b/package/network/services/dnsmasq/files/dhcpbogushostname.conf new file mode 100644 index 00000000000..e83b6975d03 --- /dev/null +++ b/package/network/services/dnsmasq/files/dhcpbogushostname.conf @@ -0,0 +1,8 @@ +# dhcpbogushostname.conf included configuration file for dnsmasq +# +# includes a list of hostnames that should not be associated with dhcp leases +# in response to CERT VU#598349 +# file included by default, option dhcpbogushostname 0 to disable + +dhcp-name-match=set:dhcp_bogus_hostname,localhost +dhcp-name-match=set:dhcp_bogus_hostname,wpad diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index c1ae0934fd2..9c922eec6cf 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -16,6 +16,7 @@ BASEHOSTFILE="/tmp/hosts/dhcp" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" TIMEVALIDFILE="/var/state/dnsmasqsec" BASEDHCPSTAMPFILE="/var/run/dnsmasq" +DHCPBOGUSHOSTNAMEFILE="/usr/share/dnsmasq/dhcpbogushostname.conf" RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf" DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh" @@ -813,6 +814,7 @@ dnsmasq_start() append_bool "$cfg" localise_queries "--localise-queries" append_bool "$cfg" readethers "--read-ethers" append_bool "$cfg" dbus "--enable-dbus" + append_bool "$cfg" ubus "--enable-ubus" 1 append_bool "$cfg" expandhosts "--expand-hosts" config_get tftp_root "$cfg" "tftp_root" [ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp" @@ -869,9 +871,6 @@ dnsmasq_start() ADD_LOCAL_FQDN="$ADD_LOCAL_HOSTNAME" fi - config_get_bool readethers "$cfg" readethers - [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers - config_get user_dhcpscript $cfg dhcpscript if has_handler || [ -n "$user_dhcpscript" ]; then xappend "--dhcp-script=$DHCPSCRIPT" @@ -958,6 +957,13 @@ dnsmasq_start() config_foreach filter_dnsmasq host dhcp_host_add "$cfg" echo >> $CONFIGFILE_TMP + + config_get_bool dhcpbogushostname "$cfg" dhcpbogushostname 1 + [ "$dhcpbogushostname" -gt 0 ] && { + xappend "--dhcp-ignore-names=tag:dhcp_bogus_hostname" + [ -r "$DHCPBOGUSHOSTNAMEFILE" ] && xappend "--conf-file=$DHCPBOGUSHOSTNAMEFILE" + } + config_foreach filter_dnsmasq boot dhcp_boot_add "$cfg" config_foreach filter_dnsmasq mac dhcp_mac_add "$cfg" config_foreach filter_dnsmasq tag dhcp_tag_add "$cfg" @@ -1022,7 +1028,7 @@ dnsmasq_start() procd_set_param respawn procd_add_jail dnsmasq ubus log - procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT + procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE $DHCPBOGUSHOSTNAMEFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile procd_close_instance diff --git a/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch b/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch index 37b11abc1de..2501079b3fd 100644 --- a/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch +++ b/package/network/services/dnsmasq/patches/230-fix-poll-h-include-warning-on-musl.patch @@ -7,7 +7,7 @@ Signed-off-by: Kevin Darbyshire-Bryant --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -88,7 +88,7 @@ typedef unsigned long long u64; +@@ -95,7 +95,7 @@ typedef unsigned long long u64; #if defined(HAVE_SOLARIS_NETWORK) # include #endif diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch deleted file mode 100644 index 2fa9f48d128..00000000000 --- a/package/network/services/dnsmasq/patches/240-ubus.patch +++ /dev/null @@ -1,128 +0,0 @@ ---- a/src/dnsmasq.c -+++ b/src/dnsmasq.c -@@ -19,6 +19,8 @@ - - #include "dnsmasq.h" - -+#include -+ - struct daemon *daemon; - - static volatile pid_t pid = 0; -@@ -32,6 +34,64 @@ static void fatal_event(struct event_des - static int read_event(int fd, struct event_desc *evp, char **msg); - static void poll_resolv(int force, int do_reload, time_t now); - -+static struct ubus_context *ubus; -+static struct blob_buf b; -+ -+static struct ubus_object_type ubus_object_type = { -+ .name = "dnsmasq", -+}; -+ -+static struct ubus_object ubus_object = { -+ .name = "dnsmasq", -+ .type = &ubus_object_type, -+}; -+ -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface) -+{ -+ if (!ubus || !ubus_object.has_subscribers) -+ return; -+ -+ blob_buf_init(&b, 0); -+ if (mac) -+ blobmsg_add_string(&b, "mac", mac); -+ if (ip) -+ blobmsg_add_string(&b, "ip", ip); -+ if (name) -+ blobmsg_add_string(&b, "name", name); -+ if (interface) -+ blobmsg_add_string(&b, "interface", interface); -+ ubus_notify(ubus, &ubus_object, type, b.head, -1); -+} -+ -+static void set_ubus_listeners(void) -+{ -+ if (!ubus) -+ return; -+ -+ poll_listen(ubus->sock.fd, POLLIN); -+ poll_listen(ubus->sock.fd, POLLERR); -+ poll_listen(ubus->sock.fd, POLLHUP); -+} -+ -+static void check_ubus_listeners() -+{ -+ if (!ubus) { -+ ubus = ubus_connect(NULL); -+ if (ubus) -+ ubus_add_object(ubus, &ubus_object); -+ else -+ return; -+ } -+ -+ if (poll_check(ubus->sock.fd, POLLIN)) -+ ubus_handle_event(ubus); -+ -+ if (poll_check(ubus->sock.fd, POLLHUP)) { -+ ubus_free(ubus); -+ ubus = NULL; -+ } -+} -+ - int main (int argc, char **argv) - { - int bind_fallback = 0; -@@ -949,6 +1009,7 @@ int main (int argc, char **argv) - set_dbus_listeners(); - #endif - -+ set_ubus_listeners(); - #ifdef HAVE_DHCP - if (daemon->dhcp || daemon->relay4) - { -@@ -1079,6 +1140,8 @@ int main (int argc, char **argv) - check_dbus_listeners(); - #endif - -+ check_ubus_listeners(); -+ - check_dns_listeners(now); - - #ifdef HAVE_TFTP ---- a/Makefile -+++ b/Makefile -@@ -85,7 +85,7 @@ all : $(BUILDDIR) - @cd $(BUILDDIR) && $(MAKE) \ - top="$(top)" \ - build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ -- build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \ -+ build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) -lubox -lubus" \ - -f $(top)/Makefile dnsmasq - - mostly_clean : ---- a/src/dnsmasq.h -+++ b/src/dnsmasq.h -@@ -1445,6 +1445,8 @@ void emit_dbus_signal(int action, struct - # endif - #endif - -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); -+ - /* ipset.c */ - #ifdef HAVE_IPSET - void ipset_init(void); ---- a/src/rfc2131.c -+++ b/src/rfc2131.c -@@ -1636,6 +1636,10 @@ static void log_packet(char *type, void - daemon->namebuff, - string ? string : "", - err ? err : ""); -+ if (!strcmp(type, "DHCPACK")) -+ ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); -+ else if (!strcmp(type, "DHCPRELEASE")) -+ ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); - } - - static void log_options(unsigned char *start, u32 xid) From 1e2164aeb46e9ad04becdd67fd77399876660946 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 23 Oct 2018 10:52:27 +0200 Subject: [PATCH 057/399] kernel: add missing symbol for target bcm53xx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: 47f68ca58615 ("kernel: bump 4.14 to 4.14.77") Reported-by: Rafał Miłecki Signed-off-by: Koen Vandeputte --- target/linux/bcm53xx/config-4.14 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/bcm53xx/config-4.14 b/target/linux/bcm53xx/config-4.14 index e6f578c6dde..cb47faa413d 100644 --- a/target/linux/bcm53xx/config-4.14 +++ b/target/linux/bcm53xx/config-4.14 @@ -163,6 +163,7 @@ CONFIG_GPIO_74X164=y CONFIG_GPIO_SYSFS=y # CONFIG_GRO_CELLS is not set CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y From 2db4015285018fa728133e6a3965d4ed9c35f4e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 11 Oct 2018 10:01:45 +0200 Subject: [PATCH 058/399] bcm53xx: replace SPI revert with a fix sent upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of reverting whole commit it's enough to just revert a single line change. It seems the real problem with the regressing commit was a bump of read chunk size. Switching back to 256 B chunks is enough to fix the problem/regression. Signed-off-by: Rafał Miłecki (cherry picked from commit 92de28b751a473655fd0cf3d3a8b81ca1d27d758) --- ...tch-back-to-reading-flash-using-smal.patch | 42 +++++ ...spi-Fix-bcm_qspi_bspi_read-performan.patch | 146 ------------------ 2 files changed, 42 insertions(+), 146 deletions(-) create mode 100644 target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch delete mode 100644 target/linux/bcm53xx/patches-4.14/800-Revert-spi-bcm-qspi-Fix-bcm_qspi_bspi_read-performan.patch diff --git a/target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch b/target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch new file mode 100644 index 00000000000..4b3056591e9 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch @@ -0,0 +1,42 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 11 Oct 2018 09:07:31 +0200 +Subject: [PATCH FIX] spi: bcm-qspi: switch back to reading flash using smaller + chunks +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixing/optimizing bcm_qspi_bspi_read() performance introduced two +changes: +1) It added a loop to read all requested data using multiple BSPI ops. +2) It bumped max size of a single BSPI block request from 256 to 512 B. + +The later change resulted in occasional BSPI timeouts causing a +regression. + +For some unknown reason hardware doesn't always handle reads as expected +when using 512 B chunks. In such cases it may happen that BSPI returns +amount of requested bytes without the last 1-3 ones. It provides the +remaining bytes later but doesn't raise an interrupt until another LR +start. + +Switching back to 256 B reads fixes that problem and regression. + +Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance") +Signed-off-by: Rafał Miłecki +Cc: stable@vger.kernel.org # 4.11+ +--- + drivers/spi/spi-bcm-qspi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/spi/spi-bcm-qspi.c ++++ b/drivers/spi/spi-bcm-qspi.c +@@ -88,7 +88,7 @@ + #define BSPI_BPP_MODE_SELECT_MASK BIT(8) + #define BSPI_BPP_ADDR_SELECT_MASK BIT(16) + +-#define BSPI_READ_LENGTH 512 ++#define BSPI_READ_LENGTH 256 + + /* MSPI register offsets */ + #define MSPI_SPCR0_LSB 0x000 diff --git a/target/linux/bcm53xx/patches-4.14/800-Revert-spi-bcm-qspi-Fix-bcm_qspi_bspi_read-performan.patch b/target/linux/bcm53xx/patches-4.14/800-Revert-spi-bcm-qspi-Fix-bcm_qspi_bspi_read-performan.patch deleted file mode 100644 index 64f971d349f..00000000000 --- a/target/linux/bcm53xx/patches-4.14/800-Revert-spi-bcm-qspi-Fix-bcm_qspi_bspi_read-performan.patch +++ /dev/null @@ -1,146 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Subject: [PATCH] Revert "spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit 345309fa7c0c9206a5344d379b174499952d79d9. - -BSPI reads became unstable starting with above commit. There are BSPI -timeouts like this: -[ 15.637809] bcm_iproc 18029200.spi: timeout waiting for BSPI -(...) -[ 15.997809] bcm_iproc 18029200.spi: timeout waiting for BSPI -which cause filesystem stability problems. - -Before above commit every time that bcm_qspi_bspi_lr_l2_isr() called -bcm_qspi_bspi_lr_l2_isr() it was resulting in bspi_rf_msg_len becoming -0. -With that change it's not the case anymore which suggests there may be -some bug around that code. - -It has changed and the new behavior seems to be causing problems. - -Signed-off-by: Rafał Miłecki ---- - ---- a/drivers/spi/spi-bcm-qspi.c -+++ b/drivers/spi/spi-bcm-qspi.c -@@ -88,7 +88,7 @@ - #define BSPI_BPP_MODE_SELECT_MASK BIT(8) - #define BSPI_BPP_ADDR_SELECT_MASK BIT(16) - --#define BSPI_READ_LENGTH 512 -+#define BSPI_READ_LENGTH 256 - - /* MSPI register offsets */ - #define MSPI_SPCR0_LSB 0x000 -@@ -806,7 +806,7 @@ static int bcm_qspi_bspi_flash_read(stru - struct spi_flash_read_message *msg) - { - struct bcm_qspi *qspi = spi_master_get_devdata(spi->master); -- u32 addr = 0, len, rdlen, len_words; -+ u32 addr = 0, len, len_words; - int ret = 0; - unsigned long timeo = msecs_to_jiffies(100); - struct bcm_qspi_soc_intc *soc_intc = qspi->soc_intc; -@@ -819,7 +819,7 @@ static int bcm_qspi_bspi_flash_read(stru - bcm_qspi_write(qspi, MSPI, MSPI_WRITE_LOCK, 0); - - /* -- * when using flex mode we need to send -+ * when using flex mode mode we need to send - * the upper address byte to bspi - */ - if (bcm_qspi_bspi_ver_three(qspi) == false) { -@@ -833,56 +833,47 @@ static int bcm_qspi_bspi_flash_read(stru - else - addr = msg->from & 0x00ffffff; - -+ /* set BSPI RAF buffer max read length */ -+ len = msg->len; -+ if (len > BSPI_READ_LENGTH) -+ len = BSPI_READ_LENGTH; -+ - if (bcm_qspi_bspi_ver_three(qspi) == true) - addr = (addr + 0xc00000) & 0xffffff; - -- /* -- * read into the entire buffer by breaking the reads -- * into RAF buffer read lengths -- */ -- len = msg->len; -+ reinit_completion(&qspi->bspi_done); -+ bcm_qspi_enable_bspi(qspi); -+ len_words = (len + 3) >> 2; -+ qspi->bspi_rf_msg = msg; -+ qspi->bspi_rf_msg_status = 0; - qspi->bspi_rf_msg_idx = 0; -+ qspi->bspi_rf_msg_len = len; -+ dev_dbg(&qspi->pdev->dev, "bspi xfr addr 0x%x len 0x%x", addr, len); - -- do { -- if (len > BSPI_READ_LENGTH) -- rdlen = BSPI_READ_LENGTH; -- else -- rdlen = len; -- -- reinit_completion(&qspi->bspi_done); -- bcm_qspi_enable_bspi(qspi); -- len_words = (rdlen + 3) >> 2; -- qspi->bspi_rf_msg = msg; -- qspi->bspi_rf_msg_status = 0; -- qspi->bspi_rf_msg_len = rdlen; -- dev_dbg(&qspi->pdev->dev, -- "bspi xfr addr 0x%x len 0x%x", addr, rdlen); -- bcm_qspi_write(qspi, BSPI, BSPI_RAF_START_ADDR, addr); -- bcm_qspi_write(qspi, BSPI, BSPI_RAF_NUM_WORDS, len_words); -- bcm_qspi_write(qspi, BSPI, BSPI_RAF_WATERMARK, 0); -- if (qspi->soc_intc) { -- /* -- * clear soc MSPI and BSPI interrupts and enable -- * BSPI interrupts. -- */ -- soc_intc->bcm_qspi_int_ack(soc_intc, MSPI_BSPI_DONE); -- soc_intc->bcm_qspi_int_set(soc_intc, BSPI_DONE, true); -- } -+ bcm_qspi_write(qspi, BSPI, BSPI_RAF_START_ADDR, addr); -+ bcm_qspi_write(qspi, BSPI, BSPI_RAF_NUM_WORDS, len_words); -+ bcm_qspi_write(qspi, BSPI, BSPI_RAF_WATERMARK, 0); -+ -+ if (qspi->soc_intc) { -+ /* -+ * clear soc MSPI and BSPI interrupts and enable -+ * BSPI interrupts. -+ */ -+ soc_intc->bcm_qspi_int_ack(soc_intc, MSPI_BSPI_DONE); -+ soc_intc->bcm_qspi_int_set(soc_intc, BSPI_DONE, true); -+ } - -- /* Must flush previous writes before starting BSPI operation */ -- mb(); -- bcm_qspi_bspi_lr_start(qspi); -- if (!wait_for_completion_timeout(&qspi->bspi_done, timeo)) { -- dev_err(&qspi->pdev->dev, "timeout waiting for BSPI\n"); -- ret = -ETIMEDOUT; -- break; -- } -+ /* Must flush previous writes before starting BSPI operation */ -+ mb(); - -- /* set msg return length */ -- msg->retlen += rdlen; -- addr += rdlen; -- len -= rdlen; -- } while (len); -+ bcm_qspi_bspi_lr_start(qspi); -+ if (!wait_for_completion_timeout(&qspi->bspi_done, timeo)) { -+ dev_err(&qspi->pdev->dev, "timeout waiting for BSPI\n"); -+ ret = -ETIMEDOUT; -+ } else { -+ /* set the return length for the caller */ -+ msg->retlen = len; -+ } - - return ret; - } From 4fb73b61c0838ca6bbffb6b563f7cd0fdb074ac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 23 Oct 2018 09:42:00 +0200 Subject: [PATCH 059/399] bcm53xx: use upstream SPI controller fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This just moves patch to use 0xx prefix and includes maintainer's s-o-b. Signed-off-by: Rafał Miłecki (cherry picked from commit 9b385b24967a53e88c31aee04ba629d276c4e69d) --- ...cm-qspi-switch-back-to-reading-flash-using-smal.patch} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename target/linux/bcm53xx/patches-4.14/{180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch => 081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch} (83%) diff --git a/target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch b/target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch similarity index 83% rename from target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch rename to target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch index 4b3056591e9..91b06b19fea 100644 --- a/target/linux/bcm53xx/patches-4.14/180-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch +++ b/target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch @@ -1,6 +1,7 @@ +From 940ec770c295682993d1cccce3081fd7c74fece8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 11 Oct 2018 09:07:31 +0200 -Subject: [PATCH FIX] spi: bcm-qspi: switch back to reading flash using smaller +Date: Thu, 11 Oct 2018 09:42:17 +0200 +Subject: [PATCH] spi: bcm-qspi: switch back to reading flash using smaller chunks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -24,7 +25,8 @@ Switching back to 256 B reads fixes that problem and regression. Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance") Signed-off-by: Rafał Miłecki -Cc: stable@vger.kernel.org # 4.11+ +Signed-off-by: Mark Brown +Cc: stable@vger.kernel.org --- drivers/spi/spi-bcm-qspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) From 79989634289b25a09a533fb97b26e34cc7e81ea1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 26 Oct 2018 17:13:38 +0200 Subject: [PATCH 060/399] mt76: update to the latest version 199d6bf mt76x2: skip station tx status for non-sta wcid entries d83ac6e mt76: only override control->sta on sw-encrypted tx 23abe5d mt76: add support for reporting tx status with skb f8ce59e mt7603: use common tx status handling code Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 0a38a22c182..46777299405 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-01 -PKG_SOURCE_VERSION:=53e1110a354576210b60012cccd5d77af219c60d -PKG_MIRROR_HASH:=2ecc38b502b8875231a5b68d7fa244a89cc27a062cc189d81ab91970d827f05a +PKG_SOURCE_DATE:=2018-10-25 +PKG_SOURCE_VERSION:=f8ce59effd61993c17932a5a2bd7a71611eba2a9 +PKG_MIRROR_HASH:=5b5a48b5ad4fffe7a1cacdfd4e063a813966dbabee51024a8bc391acb2eae28c PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From 24ca1cda38fbc3c5ae1302e44ea9dba20cf01ea0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 27 Oct 2018 17:56:28 +0200 Subject: [PATCH 061/399] mt76: update to the latest version 71b7a4a mt76: fix regression in tx status handling Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 46777299405..1c35476f7b0 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-25 -PKG_SOURCE_VERSION:=f8ce59effd61993c17932a5a2bd7a71611eba2a9 -PKG_MIRROR_HASH:=5b5a48b5ad4fffe7a1cacdfd4e063a813966dbabee51024a8bc391acb2eae28c +PKG_SOURCE_DATE:=2018-10-27 +PKG_SOURCE_VERSION:=71b7a4a8e02f48370c09143016940f08f0e4492b +PKG_MIRROR_HASH:=a9facf108d1c38f8ea07ff3d49d44131054a5fba2600a5482bfdf959cfe2cd21 PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From f1a2b5bbbc46084b64c36f2b665a60f2317bddc0 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 18 Oct 2018 14:23:36 +0200 Subject: [PATCH 062/399] kernel: tolerate using UBI/UBIFS on MLC flash (FS#1830) starting from upstream commit 577b4eb23811 ("ubi: Reject MLC NAND") it is not allowed to use UBI and UBIFS on a MLC flavoured NAND flash chip. [1] According to David Oberhollenzer [2]: The real problem is that on MLC NAND, pages come in pairs. Multiple voltage levels inside a single, physical memory cell are used to encode more than one bit. Instead of just having pages that are twice as big, the flash exposes them as two different pages. Those pages are usually not ordered sequentially either, but according to a vendor/device specific pairing scheme. Within OpenWrt, devices utilizing this type of flash, combined with UBI(fs) will be bricked when a user upgrades from 17.01.4 to a newer version as the MLC will be refused. As these devices are currently advertised as supported by OpenWrt, we should at least maintain the original state during the lifecycle of the current releases. Support can be gracefully ended when a new release-branch is created. Signed-off-by: Koen Vandeputte Acked-by: Hauke Mehrtens [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v4.14.77&id=577b4eb23811dfc8e38924dc476dbc866be74253 [2] https://lore.kernel.org/patchwork/patch/920344/ --- .../hack-4.14/420-allow-ubi-mlc-support.patch | 13 +++++++++++++ .../hack-4.9/420-allow-ubi-mlc-support.patch | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch create mode 100644 target/linux/generic/hack-4.9/420-allow-ubi-mlc-support.patch diff --git a/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch b/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch new file mode 100644 index 00000000000..595936f1379 --- /dev/null +++ b/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch @@ -0,0 +1,13 @@ +--- a/drivers/mtd/ubi/build.c ++++ b/drivers/mtd/ubi/build.c +@@ -851,9 +851,8 @@ int ubi_attach_mtd_dev(struct mtd_info * + * will die soon and you will lose all your data. + */ + if (mtd->type == MTD_MLCNANDFLASH) { +- pr_err("ubi: refuse attaching mtd%d - MLC NAND is not supported\n", ++ pr_warn("ubi: mtd%d has been identified as a MLC NAND!! - MLC is not supported by UBI and UBIFS and _WILL_ cause corruption in the near future!\n", + mtd->index); +- return -EINVAL; + } + + if (ubi_num == UBI_DEV_NUM_AUTO) { diff --git a/target/linux/generic/hack-4.9/420-allow-ubi-mlc-support.patch b/target/linux/generic/hack-4.9/420-allow-ubi-mlc-support.patch new file mode 100644 index 00000000000..552ae5da75c --- /dev/null +++ b/target/linux/generic/hack-4.9/420-allow-ubi-mlc-support.patch @@ -0,0 +1,13 @@ +--- a/drivers/mtd/ubi/build.c ++++ b/drivers/mtd/ubi/build.c +@@ -900,9 +900,8 @@ int ubi_attach_mtd_dev(struct mtd_info * + * will die soon and you will lose all your data. + */ + if (mtd->type == MTD_MLCNANDFLASH) { +- pr_err("ubi: refuse attaching mtd%d - MLC NAND is not supported\n", ++ pr_warn("ubi: mtd%d has been identified as a MLC NAND!! - MLC is not supported by UBI and UBIFS and _WILL_ cause corruption in the near future!\n", + mtd->index); +- return -EINVAL; + } + + if (ubi_num == UBI_DEV_NUM_AUTO) { From 91a8bc1dd06719e9edd3ab0791f5a0f11af836cd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 1 Nov 2018 19:56:30 +0100 Subject: [PATCH 063/399] Revert "mt76: update to the latest version" This reverts the following commits: 24ca1cda38fbc3c5ae1302e44ea9dba20cf01ea0 79989634289b25a09a533fb97b26e34cc7e81ea1 The update was reported to cause stability issues. Revert until those are resolved Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 1c35476f7b0..0a38a22c182 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-27 -PKG_SOURCE_VERSION:=71b7a4a8e02f48370c09143016940f08f0e4492b -PKG_MIRROR_HASH:=a9facf108d1c38f8ea07ff3d49d44131054a5fba2600a5482bfdf959cfe2cd21 +PKG_SOURCE_DATE:=2018-10-01 +PKG_SOURCE_VERSION:=53e1110a354576210b60012cccd5d77af219c60d +PKG_MIRROR_HASH:=2ecc38b502b8875231a5b68d7fa244a89cc27a062cc189d81ab91970d827f05a PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From f9c79947b5c4e726ecf5afd1b04d99f0b4101755 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 5 Nov 2018 11:23:17 +0100 Subject: [PATCH 064/399] kernel: bump 4.14 to 4.14.79 Refreshed all patches. Compile-tested on: cns3xxx, imx6, x86_64 Runtime-tested on: cns3xxx, imx6, x86_64 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../ath25/patches-4.14/107-ar5312_gpio.patch | 2 +- ...ct-JEDEC-incompatible-w25q128-using-.patch | 2 +- ...PS-BCM63XX-add-clkdev-lookup-support.patch | 2 +- ...22-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch | 2 +- .../generic/hack-4.14/220-gc_sections.patch | 2 +- .../301-mips_image_cmdline_hack.patch | 2 +- .../661-use_fq_codel_by_default.patch | 2 +- .../pending-4.14/201-extra_optimization.patch | 2 +- .../300-mips_expose_boot_raw.patch | 4 ++-- .../pending-4.14/304-mips_disable_fpu.patch | 2 +- ...ove-no-op-dma_map_ops-where-possible.patch | 12 +++++----- ...w-NOR-driver-to-write-fewer-bytes-th.patch | 4 ++-- ...25p80-mx-disable-software-protection.patch | 2 +- ...or-fix-Spansion-regressions-aliased-.patch | 4 ++-- ...ort-limiting-4K-sectors-support-base.patch | 2 +- .../477-mtd-add-spi-nor-add-mx25u3235f.patch | 2 +- ...support-for-XM25QH64A-and-XM25QH128A.patch | 2 +- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 22 +++++++++---------- .../pending-4.14/701-phy_extension.patch | 2 +- ...dd-quirk-to-autoload-ubi-on-rt-ac58u.patch | 2 +- .../105-mtd-nor-add-mx25l25635f.patch | 2 +- .../lantiq/patches-4.14/0152-lantiq-VPE.patch | 2 +- .../patches-4.14/0052-net-phy-add-FC.patch | 2 +- ...or-support-mtd-name-from-device-tree.patch | 4 ++-- ...25-pinctrl-ralink-add-pinctrl-driver.patch | 2 +- ...IO-ralink-add-mt7621-gpio-controller.patch | 2 +- ...0031-uvc-add-iPassion-iP2970-support.patch | 2 +- ...d-spi-nor-add-w25q256-3b-mode-switch.patch | 12 +++++----- ...or-enable-4B-opcodes-for-mx66l51235l.patch | 2 +- 30 files changed, 55 insertions(+), 55 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f0ac2671ed1..320ecd5ce63 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .135 -LINUX_VERSION-4.14 = .78 +LINUX_VERSION-4.14 = .79 LINUX_KERNEL_HASH-4.9.135 = e023b0bbe9ea7fc56aa57210342dd18ea3e0900ee207226df1523c6d7df154ce -LINUX_KERNEL_HASH-4.14.78 = f4da4dc0f079e420e1c1b8c71312eaa5415b08be847aa224a61d8af6a6e74c6c +LINUX_KERNEL_HASH-4.14.79 = 5619071eceb27f903d2fce1784223796bfbe25528f9690273cdfe82fdd9b933a remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/ath25/patches-4.14/107-ar5312_gpio.patch b/target/linux/ath25/patches-4.14/107-ar5312_gpio.patch index 9b2bee1d737..e74e20b05a4 100644 --- a/target/linux/ath25/patches-4.14/107-ar5312_gpio.patch +++ b/target/linux/ath25/patches-4.14/107-ar5312_gpio.patch @@ -202,7 +202,7 @@ +subsys_initcall(ar5312_gpio_init); --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -174,6 +174,7 @@ config ATH25 +@@ -175,6 +175,7 @@ config ATH25 select CEVT_R4K select CSRC_R4K select DMA_NONCOHERENT diff --git a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch index 8eb70b4e53e..58cd1bf84da 100644 --- a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch +++ b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1209,6 +1209,18 @@ static const struct flash_info *spi_nor_ +@@ -1215,6 +1215,18 @@ static const struct flash_info *spi_nor_ } dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); diff --git a/target/linux/brcm63xx/patches-4.14/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch b/target/linux/brcm63xx/patches-4.14/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch index 68f64d17bfc..b6d755d29bc 100644 --- a/target/linux/brcm63xx/patches-4.14/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch +++ b/target/linux/brcm63xx/patches-4.14/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch @@ -16,7 +16,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -278,6 +278,7 @@ config BCM63XX +@@ -279,6 +279,7 @@ config BCM63XX select GPIOLIB select HAVE_CLK select MIPS_L1_CACHE_SHIFT_4 diff --git a/target/linux/brcm63xx/patches-4.14/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch b/target/linux/brcm63xx/patches-4.14/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch index 0e44117a350..d04d89cf624 100644 --- a/target/linux/brcm63xx/patches-4.14/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch +++ b/target/linux/brcm63xx/patches-4.14/322-MIPS-BCM63XX-switch-to-IRQ_DOMAIN.patch @@ -14,7 +14,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -271,6 +271,9 @@ config BCM63XX +@@ -272,6 +272,9 @@ config BCM63XX select SYNC_R4K select DMA_NONCOHERENT select IRQ_MIPS_CPU diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch index 79fdb6e8014..fd53dbd40d6 100644 --- a/target/linux/generic/hack-4.14/220-gc_sections.patch +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -171,7 +171,7 @@ Signed-off-by: Gabor Juhos .init.data : { --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -39,6 +39,7 @@ config MIPS +@@ -40,6 +40,7 @@ config MIPS select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS) select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS) select HAVE_CC_STACKPROTECTOR diff --git a/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch index 01caff5b89e..eb6011e813d 100644 --- a/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1157,6 +1157,10 @@ config SYNC_R4K +@@ -1158,6 +1158,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch index d1e92ae40af..8007e28301e 100644 --- a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2028,7 +2028,7 @@ static int __init pktsched_init(void) +@@ -2029,7 +2029,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch index 3c3353c7d16..42cd7f15852 100644 --- a/target/linux/generic/pending-4.14/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -650,12 +650,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -652,12 +652,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) diff --git a/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch index 9419e9916bb..5384be15ca0 100644 --- a/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch +++ b/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch @@ -9,7 +9,7 @@ Acked-by: Rob Landley --- --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1066,9 +1066,6 @@ config FW_ARC +@@ -1067,9 +1067,6 @@ config FW_ARC config ARCH_MAY_HAVE_PC_FDC bool @@ -19,7 +19,7 @@ Acked-by: Rob Landley config CEVT_BCM1480 bool -@@ -2966,6 +2963,18 @@ choice +@@ -2967,6 +2964,18 @@ choice bool "Extend builtin kernel arguments with bootloader arguments" endchoice diff --git a/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch index 1cfd3d7d7a9..22e2e86206c 100644 --- a/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch +++ b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch @@ -24,7 +24,7 @@ v2: incorporated changes suggested by Jonas Gorski --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2890,6 +2890,20 @@ config MIPS_O32_FP64_SUPPORT +@@ -2891,6 +2891,20 @@ config MIPS_O32_FP64_SUPPORT If unsure, say N. diff --git a/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch index 3cd87861a4e..de2dd65b179 100644 --- a/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch +++ b/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -220,6 +220,7 @@ config BMIPS_GENERIC +@@ -221,6 +221,7 @@ config BMIPS_GENERIC select BRCMSTB_L2_IRQ select IRQ_MIPS_CPU select DMA_NONCOHERENT @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau select SYS_SUPPORTS_32BIT_KERNEL select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_BIG_ENDIAN -@@ -345,6 +346,7 @@ config MACH_JAZZ +@@ -346,6 +347,7 @@ config MACH_JAZZ select CSRC_R4K select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN select GENERIC_ISA_DMA @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau select HAVE_PCSPKR_PLATFORM select IRQ_MIPS_CPU select I8253 -@@ -1127,6 +1129,9 @@ config DMA_NONCOHERENT +@@ -1128,6 +1130,9 @@ config DMA_NONCOHERENT bool select NEED_DMA_MAP_STATE @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau config NEED_DMA_MAP_STATE bool -@@ -1651,6 +1656,7 @@ config CPU_R10000 +@@ -1652,6 +1657,7 @@ config CPU_R10000 select CPU_SUPPORTS_64BIT_KERNEL select CPU_SUPPORTS_HIGHMEM select CPU_SUPPORTS_HUGEPAGES @@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau help MIPS Technologies R10000-series processors. -@@ -1899,9 +1905,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 +@@ -1900,9 +1906,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 bool config SYS_HAS_CPU_MIPS32_R5 @@ -60,7 +60,7 @@ Signed-off-by: Felix Fietkau bool config SYS_HAS_CPU_MIPS64_R1 -@@ -1911,6 +1919,7 @@ config SYS_HAS_CPU_MIPS64_R2 +@@ -1912,6 +1920,7 @@ config SYS_HAS_CPU_MIPS64_R2 bool config SYS_HAS_CPU_MIPS64_R6 diff --git a/target/linux/generic/pending-4.14/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch b/target/linux/generic/pending-4.14/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch index 50ed2be3d77..571c9b885f3 100644 --- a/target/linux/generic/pending-4.14/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch +++ b/target/linux/generic/pending-4.14/450-mtd-spi-nor-allow-NOR-driver-to-write-fewer-bytes-th.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1371,7 +1371,7 @@ static int spi_nor_write(struct mtd_info +@@ -1377,7 +1377,7 @@ static int spi_nor_write(struct mtd_info write_enable(nor); ret = nor->write(nor, addr, page_remain, buf + i); @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau goto write_err; written = ret; -@@ -1380,13 +1380,6 @@ static int spi_nor_write(struct mtd_info +@@ -1386,13 +1386,6 @@ static int spi_nor_write(struct mtd_info goto write_err; *retlen += written; i += written; diff --git a/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch index dc71e9d5427..b41710276ff 100644 --- a/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch +++ b/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch @@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2708,6 +2708,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2714,6 +2714,7 @@ int spi_nor_scan(struct spi_nor *nor, co if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || JEDEC_MFR(info) == SNOR_MFR_INTEL || diff --git a/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch index fc5cf623240..55d9709761c 100644 --- a/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch +++ b/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch @@ -17,7 +17,7 @@ Signed-off-by: Matthias Schiffer --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2710,6 +2710,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2716,6 +2716,7 @@ int spi_nor_scan(struct spi_nor *nor, co JEDEC_MFR(info) == SNOR_MFR_INTEL || JEDEC_MFR(info) == SNOR_MFR_MACRONIX || JEDEC_MFR(info) == SNOR_MFR_SST || @@ -25,7 +25,7 @@ Signed-off-by: Matthias Schiffer info->flags & SPI_NOR_HAS_LOCK) { write_enable(nor); write_sr(nor, 0); -@@ -2728,7 +2729,8 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2734,7 +2735,8 @@ int spi_nor_scan(struct spi_nor *nor, co /* NOR protection support for STmicro/Micron chips and similar */ if (JEDEC_MFR(info) == SNOR_MFR_MICRON || diff --git a/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch index 88775041ce8..231f9c21a4e 100644 --- a/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch +++ b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau depends on ARCH_AT91 || (ARM && COMPILE_TEST) --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2555,10 +2555,12 @@ static int spi_nor_select_erase(struct s +@@ -2561,10 +2561,12 @@ static int spi_nor_select_erase(struct s #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ diff --git a/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch b/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch index 191e01df7a5..2d94959c5c0 100644 --- a/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch +++ b/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch @@ -8,7 +8,7 @@ Signed-off-by: André Valentin --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1016,6 +1016,7 @@ static const struct flash_info spi_nor_i +@@ -1022,6 +1022,7 @@ static const struct flash_info spi_nor_i { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, diff --git a/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch index b7361d2ab50..b7c4f23a149 100644 --- a/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch +++ b/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch @@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1181,6 +1181,10 @@ static const struct flash_info spi_nor_i +@@ -1187,6 +1187,10 @@ static const struct flash_info spi_nor_i { "3S400AN", S3AN_INFO(0x1f2400, 256, 264) }, { "3S700AN", S3AN_INFO(0x1f2500, 512, 264) }, { "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) }, diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 0b46ed9e47b..7c60d7e7999 100644 --- a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -300,7 +300,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own * @t: the outgoing tunnel device -@@ -1304,6 +1444,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1305,6 +1445,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str { struct ip6_tnl *t = netdev_priv(dev); struct ipv6hdr *ipv6h; @@ -308,7 +308,7 @@ Signed-off-by: Steven Barth int encap_limit = -1; __u16 offset; struct flowi6 fl6; -@@ -1370,6 +1511,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1371,6 +1512,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); @@ -327,7 +327,7 @@ Signed-off-by: Steven Barth if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; -@@ -1498,6 +1651,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1499,6 +1652,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.link = p->link; t->parms.proto = p->proto; t->parms.fwmark = p->fwmark; @@ -342,7 +342,7 @@ Signed-off-by: Steven Barth dst_cache_reset(&t->dst_cache); ip6_tnl_link_config(t); return 0; -@@ -1536,6 +1697,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1537,6 +1698,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1922,6 +2084,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1923,6 +2085,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1959,6 +2130,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1960,6 +2131,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_FWMARK]) parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2074,6 +2285,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2075,6 +2286,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2103,6 +2320,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2104,6 +2321,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(0) + /* IFLA_IPTUN_FWMARK */ nla_total_size(4) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2110,6 +2345,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2111,6 +2346,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2119,9 +2357,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2120,9 +2358,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2161,6 +2417,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2162,6 +2418,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, diff --git a/target/linux/generic/pending-4.14/701-phy_extension.patch b/target/linux/generic/pending-4.14/701-phy_extension.patch index 1b380e24a9a..0f0b0e04677 100644 --- a/target/linux/generic/pending-4.14/701-phy_extension.patch +++ b/target/linux/generic/pending-4.14/701-phy_extension.patch @@ -85,7 +85,7 @@ Signed-off-by: John Crispin * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -905,6 +905,7 @@ void phy_ethtool_ksettings_get(struct ph +@@ -909,6 +909,7 @@ void phy_ethtool_ksettings_get(struct ph struct ethtool_link_ksettings *cmd); int phy_ethtool_ksettings_set(struct phy_device *phydev, const struct ethtool_link_ksettings *cmd); diff --git a/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch b/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch index 4ee79515c9a..9fa8a91e06f 100644 --- a/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch +++ b/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch @@ -17,7 +17,7 @@ Signed-off-by: Christian Lamparter --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1184,6 +1184,9 @@ static void __init ubi_auto_attach(void) +@@ -1183,6 +1183,9 @@ static void __init ubi_auto_attach(void) mtd = open_mtd_device("ubi"); if (IS_ERR(mtd)) mtd = open_mtd_device("data"); diff --git a/target/linux/ipq806x/patches-4.14/105-mtd-nor-add-mx25l25635f.patch b/target/linux/ipq806x/patches-4.14/105-mtd-nor-add-mx25l25635f.patch index 24a7fda2235..eee2b4c5ec9 100644 --- a/target/linux/ipq806x/patches-4.14/105-mtd-nor-add-mx25l25635f.patch +++ b/target/linux/ipq806x/patches-4.14/105-mtd-nor-add-mx25l25635f.patch @@ -11,7 +11,7 @@ the ubi volume created by the other. --- --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1023,7 +1023,7 @@ static const struct flash_info spi_nor_i +@@ -1029,7 +1029,7 @@ static const struct flash_info spi_nor_i { "mx25u6435f", INFO(0xc22537, 0, 64 * 1024, 128, SECT_4K) }, { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, diff --git a/target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch index c0639e137f8..fc4e414df5a 100644 --- a/target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-4.14/0152-lantiq-VPE.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2323,6 +2323,12 @@ config MIPS_VPE_LOADER +@@ -2324,6 +2324,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. diff --git a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch index 134d95d9926..c396e314a9f 100644 --- a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch +++ b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1926,7 +1926,7 @@ static struct phy_driver genphy_driver = +@@ -1943,7 +1943,7 @@ static struct phy_driver genphy_driver = .config_init = genphy_config_init, .features = PHY_GBIT_FEATURES | SUPPORTED_MII | SUPPORTED_AUI | SUPPORTED_FIBRE | diff --git a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch index eeb1e4dee88..47b6b177696 100644 --- a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2650,6 +2650,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2656,6 +2656,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -2725,7 +2726,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2731,7 +2732,12 @@ int spi_nor_scan(struct spi_nor *nor, co spi_nor_wait_till_ready(nor); } diff --git a/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch index 3e5dac53765..dd44a64bfda 100644 --- a/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.14/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -628,6 +628,8 @@ config RALINK +@@ -629,6 +629,8 @@ config RALINK select CLKDEV_LOOKUP select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER diff --git a/target/linux/ramips/patches-4.14/0028-GPIO-ralink-add-mt7621-gpio-controller.patch b/target/linux/ramips/patches-4.14/0028-GPIO-ralink-add-mt7621-gpio-controller.patch index d657274efe4..debeae28060 100644 --- a/target/linux/ramips/patches-4.14/0028-GPIO-ralink-add-mt7621-gpio-controller.patch +++ b/target/linux/ramips/patches-4.14/0028-GPIO-ralink-add-mt7621-gpio-controller.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -630,6 +630,9 @@ config RALINK +@@ -631,6 +631,9 @@ config RALINK select RESET_CONTROLLER select PINCTRL select PINCTRL_RT2880 diff --git a/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch index 85a5c1310c1..19bac1f64ff 100644 --- a/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-4.14/0031-uvc-add-iPassion-iP2970-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -2734,6 +2734,18 @@ static const struct usb_device_id uvc_id +@@ -2727,6 +2727,18 @@ static const struct usb_device_id uvc_id .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_QUIRK_FORCE_Y8 }, diff --git a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch index 2e7cc33c8f6..e7161af9595 100644 --- a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch +++ b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch @@ -116,7 +116,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); return ret; -@@ -1164,7 +1216,7 @@ static const struct flash_info spi_nor_i +@@ -1170,7 +1222,7 @@ static const struct flash_info spi_nor_i { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) }, -@@ -1224,6 +1276,9 @@ static int spi_nor_read(struct mtd_info +@@ -1230,6 +1282,9 @@ static int spi_nor_read(struct mtd_info if (ret) return ret; @@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau while (len) { loff_t addr = from; -@@ -1248,6 +1303,18 @@ static int spi_nor_read(struct mtd_info +@@ -1254,6 +1309,18 @@ static int spi_nor_read(struct mtd_info ret = 0; read_err: @@ -154,7 +154,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ); return ret; } -@@ -1349,6 +1416,10 @@ static int spi_nor_write(struct mtd_info +@@ -1355,6 +1422,10 @@ static int spi_nor_write(struct mtd_info if (ret) return ret; @@ -165,7 +165,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < len; ) { ssize_t written; loff_t addr = to + i; -@@ -1389,6 +1460,7 @@ static int spi_nor_write(struct mtd_info +@@ -1395,6 +1466,7 @@ static int spi_nor_write(struct mtd_info } write_err: @@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE); return ret; } -@@ -2805,8 +2877,10 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2811,8 +2883,10 @@ int spi_nor_scan(struct spi_nor *nor, co } else if (mtd->size > 0x1000000) { /* enable 4-byte addressing if the device exceeds 16MiB */ nor->addr_width = 4; diff --git a/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch b/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch index ea8d83d98e1..d959ddb097f 100644 --- a/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch +++ b/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1083,7 +1083,7 @@ static const struct flash_info spi_nor_i +@@ -1089,7 +1089,7 @@ static const struct flash_info spi_nor_i { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, From 779b89c7577de4d7615e2975341fc8ffc580ca09 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 5 Nov 2018 11:31:12 +0100 Subject: [PATCH 065/399] ath9k: fix dynack in IBSS mode Currently, dynack was only tested upstream using AP/STA mode. Testing it on IBSS, showed that late-ack detection was broken. This is caused due to dynack using Association Request/Response frames for late-ack detection, which IBSS does not use. Also allowing Authentication frames here solves this. A second issue also got fixed, which was also seen AP/STA mode: When a station was added, the estimated value would be exponentially averaged using 0 as a starting point. This means that on larger distances, the ack timeout was still not high enough before synchronizing would run out of late-ack's for estimation. Fix this by using the initial estimated value as a baseline and only start averaging in the following estimation rounds. Test setup: - 2x identical devices: RB912UAG-5HPnD + 19dB sector - IBSS - 2x2 802.11an (ar9340), HT20, long GI - RSSI's -70 / -71 - Real distance: 23910 meter Results (60s iperf runs): Fixed coverage class 54 (up to 24300m): * 21.5 Mbits/sec Dynack: * 28.9 Mbits/sec Signed-off-by: Koen Vandeputte --- ...-authentication-messages-for-late-ac.patch | 27 ++++ ...ve-debug-log-after-buffer-increments.patch | 88 +++++++++++ ...ck-da-enabled-first-in-sampling-rout.patch | 33 +++++ ...k-dynack-make-ewma-estimation-faster.patch | 139 ++++++++++++++++++ ...ath9k-dynack-remove-experimental-tag.patch | 22 +++ 5 files changed, 309 insertions(+) create mode 100644 package/kernel/mac80211/patches/552-ath9k-dynack-use-authentication-messages-for-late-ac.patch create mode 100644 package/kernel/mac80211/patches/553-ath9k-dynack-move-debug-log-after-buffer-increments.patch create mode 100644 package/kernel/mac80211/patches/554-ath9k-dynack-check-da-enabled-first-in-sampling-rout.patch create mode 100644 package/kernel/mac80211/patches/555-ath9k-dynack-make-ewma-estimation-faster.patch create mode 100644 package/kernel/mac80211/patches/556-ath9k-dynack-remove-experimental-tag.patch diff --git a/package/kernel/mac80211/patches/552-ath9k-dynack-use-authentication-messages-for-late-ac.patch b/package/kernel/mac80211/patches/552-ath9k-dynack-use-authentication-messages-for-late-ac.patch new file mode 100644 index 00000000000..831c5347626 --- /dev/null +++ b/package/kernel/mac80211/patches/552-ath9k-dynack-use-authentication-messages-for-late-ac.patch @@ -0,0 +1,27 @@ +From: Lorenzo Bianconi +Date: Fri, 2 Nov 2018 21:49:55 +0100 +Subject: [PATCH] ath9k: dynack: use authentication messages for 'late' ack + +In order to properly support dynack in ad-hoc mode running +wpa_supplicant, take into account authentication frames for +'late ack' detection. This patch has been tested on devices +mounted on offshore high-voltage stations connected through +~24Km link + +Reported-by: Koen Vandeputte +Tested-by: Koen Vandeputte +Signed-off-by: Lorenzo Bianconi +--- + +--- a/drivers/net/wireless/ath/ath9k/dynack.c ++++ b/drivers/net/wireless/ath/ath9k/dynack.c +@@ -187,7 +187,8 @@ void ath_dynack_sample_tx_ts(struct ath_ + /* late ACK */ + if (ts->ts_status & ATH9K_TXERR_XRETRY) { + if (ieee80211_is_assoc_req(hdr->frame_control) || +- ieee80211_is_assoc_resp(hdr->frame_control)) { ++ ieee80211_is_assoc_resp(hdr->frame_control) || ++ ieee80211_is_auth(hdr->frame_control)) { + ath_dbg(common, DYNACK, "late ack\n"); + ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2); + ath9k_hw_set_ack_timeout(ah, LATEACK_TO); diff --git a/package/kernel/mac80211/patches/553-ath9k-dynack-move-debug-log-after-buffer-increments.patch b/package/kernel/mac80211/patches/553-ath9k-dynack-move-debug-log-after-buffer-increments.patch new file mode 100644 index 00000000000..a1d612660bf --- /dev/null +++ b/package/kernel/mac80211/patches/553-ath9k-dynack-move-debug-log-after-buffer-increments.patch @@ -0,0 +1,88 @@ +From: Lorenzo Bianconi +Date: Fri, 2 Nov 2018 21:49:56 +0100 +Subject: [PATCH] ath9k: dynack: move debug log after buffer increments + +Move debug log in ath_dynack_sample_tx_ts and ath_dynack_sample_ack_ts +after timestamp buffer head/tail increments in order to make debugging +more user friendly + +Tested-by: Koen Vandeputte +Signed-off-by: Lorenzo Bianconi +--- + +--- a/drivers/net/wireless/ath/ath9k/dynack.c ++++ b/drivers/net/wireless/ath/ath9k/dynack.c +@@ -171,11 +171,12 @@ static void ath_dynack_compute_to(struct + void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, + struct ath_tx_status *ts) + { +- u8 ridx; + struct ieee80211_hdr *hdr; + struct ath_dynack *da = &ah->dynack; + struct ath_common *common = ath9k_hw_common(ah); + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ u32 dur = ts->duration; ++ u8 ridx; + + if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled) + return; +@@ -203,14 +204,13 @@ void ath_dynack_sample_tx_ts(struct ath_ + ridx = ts->ts_rateindex; + + da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp; +- da->st_rbf.ts[da->st_rbf.t_rb].dur = ts->duration; + ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_dest, hdr->addr1); + ether_addr_copy(da->st_rbf.addr[da->st_rbf.t_rb].h_src, hdr->addr2); + + if (!(info->status.rates[ridx].flags & IEEE80211_TX_RC_MCS)) { +- u32 phy, sifs; + const struct ieee80211_rate *rate; + struct ieee80211_tx_rate *rates = info->status.rates; ++ u32 phy; + + rate = &common->sbands[info->band].bitrates[rates[ridx].idx]; + if (info->band == NL80211_BAND_2GHZ && +@@ -219,19 +219,18 @@ void ath_dynack_sample_tx_ts(struct ath_ + else + phy = WLAN_RC_PHY_OFDM; + +- sifs = ath_dynack_get_sifs(ah, phy); +- da->st_rbf.ts[da->st_rbf.t_rb].dur -= sifs; ++ dur -= ath_dynack_get_sifs(ah, phy); + } +- +- ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n", +- hdr->addr1, da->st_rbf.ts[da->st_rbf.t_rb].tstamp, +- da->st_rbf.ts[da->st_rbf.t_rb].dur, da->st_rbf.h_rb, +- (da->st_rbf.t_rb + 1) % ATH_DYN_BUF); ++ da->st_rbf.ts[da->st_rbf.t_rb].dur = dur; + + INCR(da->st_rbf.t_rb, ATH_DYN_BUF); + if (da->st_rbf.t_rb == da->st_rbf.h_rb) + INCR(da->st_rbf.h_rb, ATH_DYN_BUF); + ++ ath_dbg(common, DYNACK, "{%pM} tx sample %u [dur %u][h %u-t %u]\n", ++ hdr->addr1, ts->ts_tstamp, dur, da->st_rbf.h_rb, ++ da->st_rbf.t_rb); ++ + ath_dynack_compute_to(ah); + + spin_unlock_bh(&da->qlock); +@@ -258,14 +257,13 @@ void ath_dynack_sample_ack_ts(struct ath + spin_lock_bh(&da->qlock); + da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts; + +- ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n", +- da->ack_rbf.tstamp[da->ack_rbf.t_rb], +- da->ack_rbf.h_rb, (da->ack_rbf.t_rb + 1) % ATH_DYN_BUF); +- + INCR(da->ack_rbf.t_rb, ATH_DYN_BUF); + if (da->ack_rbf.t_rb == da->ack_rbf.h_rb) + INCR(da->ack_rbf.h_rb, ATH_DYN_BUF); + ++ ath_dbg(common, DYNACK, "rx sample %u [h %u-t %u]\n", ++ ts, da->ack_rbf.h_rb, da->ack_rbf.t_rb); ++ + ath_dynack_compute_to(ah); + + spin_unlock_bh(&da->qlock); diff --git a/package/kernel/mac80211/patches/554-ath9k-dynack-check-da-enabled-first-in-sampling-rout.patch b/package/kernel/mac80211/patches/554-ath9k-dynack-check-da-enabled-first-in-sampling-rout.patch new file mode 100644 index 00000000000..cc5cdf9233c --- /dev/null +++ b/package/kernel/mac80211/patches/554-ath9k-dynack-check-da-enabled-first-in-sampling-rout.patch @@ -0,0 +1,33 @@ +From: Lorenzo Bianconi +Date: Fri, 2 Nov 2018 21:49:57 +0100 +Subject: [PATCH] ath9k: dynack: check da->enabled first in sampling + routines + +Check da->enabled flag first in ath_dynack_sample_tx_ts and +ath_dynack_sample_ack_ts routines in order to avoid useless +processing + +Tested-by: Koen Vandeputte +Signed-off-by: Lorenzo Bianconi +--- + +--- a/drivers/net/wireless/ath/ath9k/dynack.c ++++ b/drivers/net/wireless/ath/ath9k/dynack.c +@@ -178,7 +178,7 @@ void ath_dynack_sample_tx_ts(struct ath_ + u32 dur = ts->duration; + u8 ridx; + +- if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || !da->enabled) ++ if (!da->enabled || (info->flags & IEEE80211_TX_CTL_NO_ACK)) + return; + + spin_lock_bh(&da->qlock); +@@ -251,7 +251,7 @@ void ath_dynack_sample_ack_ts(struct ath + struct ath_common *common = ath9k_hw_common(ah); + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; + +- if (!ath_dynack_bssidmask(ah, hdr->addr1) || !da->enabled) ++ if (!da->enabled || !ath_dynack_bssidmask(ah, hdr->addr1)) + return; + + spin_lock_bh(&da->qlock); diff --git a/package/kernel/mac80211/patches/555-ath9k-dynack-make-ewma-estimation-faster.patch b/package/kernel/mac80211/patches/555-ath9k-dynack-make-ewma-estimation-faster.patch new file mode 100644 index 00000000000..7735c9782d4 --- /dev/null +++ b/package/kernel/mac80211/patches/555-ath9k-dynack-make-ewma-estimation-faster.patch @@ -0,0 +1,139 @@ +From: Lorenzo Bianconi +Date: Fri, 2 Nov 2018 21:49:58 +0100 +Subject: [PATCH] ath9k: dynack: make ewma estimation faster + +In order to make propagation time estimation faster, +use current sample as ewma output value during 'late ack' +tracking + +Tested-by: Koen Vandeputte +Signed-off-by: Lorenzo Bianconi +--- + +--- a/drivers/net/wireless/ath/ath9k/ath9k.h ++++ b/drivers/net/wireless/ath/ath9k/ath9k.h +@@ -273,7 +273,7 @@ struct ath_node { + #endif + u8 key_idx[4]; + +- u32 ackto; ++ int ackto; + struct list_head list; + }; + +--- a/drivers/net/wireless/ath/ath9k/dynack.c ++++ b/drivers/net/wireless/ath/ath9k/dynack.c +@@ -29,9 +29,13 @@ + * ath_dynack_ewma - EWMA (Exponentially Weighted Moving Average) calculation + * + */ +-static inline u32 ath_dynack_ewma(u32 old, u32 new) ++static inline int ath_dynack_ewma(int old, int new) + { +- return (new * (EWMA_DIV - EWMA_LEVEL) + old * EWMA_LEVEL) / EWMA_DIV; ++ if (old > 0) ++ return (new * (EWMA_DIV - EWMA_LEVEL) + ++ old * EWMA_LEVEL) / EWMA_DIV; ++ else ++ return new; + } + + /** +@@ -82,10 +86,10 @@ static inline bool ath_dynack_bssidmask( + */ + static void ath_dynack_compute_ackto(struct ath_hw *ah) + { +- struct ath_node *an; +- u32 to = 0; +- struct ath_dynack *da = &ah->dynack; + struct ath_common *common = ath9k_hw_common(ah); ++ struct ath_dynack *da = &ah->dynack; ++ struct ath_node *an; ++ int to = 0; + + list_for_each_entry(an, &da->nodes, list) + if (an->ackto > to) +@@ -144,7 +148,8 @@ static void ath_dynack_compute_to(struct + an->ackto = ath_dynack_ewma(an->ackto, + ackto); + ath_dbg(ath9k_hw_common(ah), DYNACK, +- "%pM to %u\n", dst, an->ackto); ++ "%pM to %d [%u]\n", dst, ++ an->ackto, ackto); + if (time_is_before_jiffies(da->lto)) { + ath_dynack_compute_ackto(ah); + da->lto = jiffies + COMPUTE_TO; +@@ -166,10 +171,12 @@ static void ath_dynack_compute_to(struct + * @ah: ath hw + * @skb: socket buffer + * @ts: tx status info ++ * @sta: station pointer + * + */ + void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, +- struct ath_tx_status *ts) ++ struct ath_tx_status *ts, ++ struct ieee80211_sta *sta) + { + struct ieee80211_hdr *hdr; + struct ath_dynack *da = &ah->dynack; +@@ -191,9 +198,16 @@ void ath_dynack_sample_tx_ts(struct ath_ + ieee80211_is_assoc_resp(hdr->frame_control) || + ieee80211_is_auth(hdr->frame_control)) { + ath_dbg(common, DYNACK, "late ack\n"); ++ + ath9k_hw_setslottime(ah, (LATEACK_TO - 3) / 2); + ath9k_hw_set_ack_timeout(ah, LATEACK_TO); + ath9k_hw_set_cts_timeout(ah, LATEACK_TO); ++ if (sta) { ++ struct ath_node *an; ++ ++ an = (struct ath_node *)sta->drv_priv; ++ an->ackto = -1; ++ } + da->lto = jiffies + LATEACK_DELAY; + } + +--- a/drivers/net/wireless/ath/ath9k/dynack.h ++++ b/drivers/net/wireless/ath/ath9k/dynack.h +@@ -86,7 +86,8 @@ void ath_dynack_node_deinit(struct ath_h + void ath_dynack_init(struct ath_hw *ah); + void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, u32 ts); + void ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, +- struct ath_tx_status *ts); ++ struct ath_tx_status *ts, ++ struct ieee80211_sta *sta); + #else + static inline void ath_dynack_init(struct ath_hw *ah) {} + static inline void ath_dynack_node_init(struct ath_hw *ah, +@@ -97,7 +98,8 @@ static inline void ath_dynack_sample_ack + struct sk_buff *skb, u32 ts) {} + static inline void ath_dynack_sample_tx_ts(struct ath_hw *ah, + struct sk_buff *skb, +- struct ath_tx_status *ts) {} ++ struct ath_tx_status *ts, ++ struct ieee80211_sta *sta) {} + #endif + + #endif /* DYNACK_H */ +--- a/drivers/net/wireless/ath/ath9k/xmit.c ++++ b/drivers/net/wireless/ath/ath9k/xmit.c +@@ -629,7 +629,7 @@ static void ath_tx_complete_aggr(struct + if (bf == bf->bf_lastbf) + ath_dynack_sample_tx_ts(sc->sc_ah, + bf->bf_mpdu, +- ts); ++ ts, sta); + } + + ath_tx_complete_buf(sc, bf, txq, &bf_head, sta, ts, +@@ -773,7 +773,8 @@ static void ath_tx_process_buffer(struct + memcpy(info->control.rates, bf->rates, + sizeof(info->control.rates)); + ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); +- ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts); ++ ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts, ++ sta); + } + ath_tx_complete_buf(sc, bf, txq, bf_head, sta, ts, txok); + } else diff --git a/package/kernel/mac80211/patches/556-ath9k-dynack-remove-experimental-tag.patch b/package/kernel/mac80211/patches/556-ath9k-dynack-remove-experimental-tag.patch new file mode 100644 index 00000000000..2e4cffd1fa2 --- /dev/null +++ b/package/kernel/mac80211/patches/556-ath9k-dynack-remove-experimental-tag.patch @@ -0,0 +1,22 @@ +From: Lorenzo Bianconi +Date: Fri, 2 Nov 2018 21:49:59 +0100 +Subject: [PATCH] ath9k: dynack: remove 'experimental' tag + +Remove experimental tag from dynack Kconfig entry since it has +been tested on outdoor 25Km links + +Tested-by: Koen Vandeputte +Signed-off-by: Lorenzo Bianconi +--- + +--- a/drivers/net/wireless/ath/ath9k/Kconfig ++++ b/drivers/net/wireless/ath/ath9k/Kconfig +@@ -132,7 +132,7 @@ config ATH9K_DFS_CERTIFIED + except increase code size. + + config ATH9K_DYNACK +- bool "Atheros ath9k ACK timeout estimation algorithm (EXPERIMENTAL)" ++ bool "Atheros ath9k ACK timeout estimation algorithm" + depends on ATH9K + default n + ---help--- From 44084d89f2b0f60ba6d0d480ebf4d944c1ebe57d Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 5 Nov 2018 17:41:00 +0100 Subject: [PATCH 066/399] imx6: fix DMA transaction errors Following errors were seen in the past on imx6 when using serial: [ 22.617622] imx-uart 2020000.serial: DMA transaction error. [ 22.623228] imx-uart 2020000.serial: DMA transaction error. [ 22.628826] imx-uart 2020000.serial: DMA transaction error. [ 22.648951] imx-uart 2020000.serial: DMA transaction error. [ 22.654558] imx-uart 2020000.serial: DMA transaction error. [ 22.660156] imx-uart 2020000.serial: DMA transaction error. Which is the reason why DMA for the serial ports got disabled in commits: efb362cd93b0 ("imx6: disable dma on uart") 3b4241071dd4 ("imx6: disable UART dma") As indicated on mailinglist discussion, the cause seems to be the usage of very old SDMA firmware which is present in the soc: [ 0.624302] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2 [ 0.624318] imx-sdma 20ec000.sdma: Falling back to user helper [ 64.531607] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware This patch adds the new firmware binary. (2196 bytes) It is required to embed the binary into the kernel image, as it gets loaded very early in the boot process where the rootfs is not available yet: [ 0.622966] imx-sdma 20ec000.sdma: loaded firmware 3.3 Extended testing shows that the DMA errors are not seen anymore when using this newer firmware version. Signed-off-by: Koen Vandeputte --- target/linux/imx6/config-4.14 | 2 ++ .../files/firmware/imx/sdma/sdma-imx6q.bin | Bin 0 -> 2196 bytes .../patches-4.14/210-disable-uart-dma.patch | 23 ------------------ 3 files changed, 2 insertions(+), 23 deletions(-) create mode 100644 target/linux/imx6/files/firmware/imx/sdma/sdma-imx6q.bin delete mode 100644 target/linux/imx6/patches-4.14/210-disable-uart-dma.patch diff --git a/target/linux/imx6/config-4.14 b/target/linux/imx6/config-4.14 index 7829b4b5072..52a98a0ba8e 100644 --- a/target/linux/imx6/config-4.14 +++ b/target/linux/imx6/config-4.14 @@ -178,6 +178,8 @@ CONFIG_EXT4_FS_ENCRYPTION=y CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_SECURITY=y CONFIG_EXTCON=y +CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx6q.bin" +CONFIG_EXTRA_FIRMWARE_DIR="firmware" CONFIG_FEC=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y diff --git a/target/linux/imx6/files/firmware/imx/sdma/sdma-imx6q.bin b/target/linux/imx6/files/firmware/imx/sdma/sdma-imx6q.bin new file mode 100644 index 0000000000000000000000000000000000000000..f0b5252a6fc5f85aced28a5c43e7268340fe4d73 GIT binary patch literal 2196 zcmb7_U2GIp6oAj%ou8fA*8b77mX_9vODX>XQ3(MNVlZLROuNt)x70BW?a*%fX3@Db z!DuX2+h}>1-A%QLCYTtWG{F!O`jf~IF-q1}aV1FBhhm|U)CXlB)^lff+a-ZSx;ZoF zoVoYhZ_b%>+O#jQ#{&RNs!`UWOrZQE0lZBB(*N`Cg{sWjdEE1LWk&xb>zlyf`C-1y z#(gW#e}D%FqvWs4>45Q$pe#HN5LgK?hjHJ*JM$+e6NeX7PEV|nSJOJ<1Yd3}9O@7SDtB%*6>W>T)>gEQrrf#SEEP(H zv&7NYSe`oAf5+HklL1+C^ylqzAOlKPW4aIZ6~>L;Qp=KLno@Z@J+3<%-{`nJ0P{fz zNc0{uinat-x(d3=rj#kpzBb9YlSh-t{)9e~$Cx^lp=_jEkh0F`_mz0&o1mz}!&sj| z*6pT+tWP8B<}7Q6M5x&Ip6zd2V{x^Ndd}Tf*7OB3^GGkY$(q0I3|h=q&{mdg=JBD& zhaSnuFpJ2XJggyehWMz>ILexOB+j@tnQDJuJnm|X?TOZS%LrG@6+JfuJ15uCi8klR z!O1nopy!mBd^KHIBBX0B2)iT*RMLKL37D8Eio6Z#4f`K8(R_hiA+lk(o;mcyGad^3 ztUUx1s?*duIZJ_jYp1;z!IH}9AirGE5mJi3^p0NzV(gO2BA=7%gixlnqp<7~!^X-l zs;OpOdX^$T)gs3wYII9H?ZQ*J#~LG}EwlKI48v$}To?_Fi@lOa!;+7Z0TSdxyCW<^ zOsl`oBEi+68Uqe`F_wptV1@Zogb%H-PKl$hzmx_bs=DW(lNk6diVycm^$*9!FEXoG&w;1k?7DR2 z1^6B~<0L-0<33TQ_C}ZUn;|D^H>p8xQQc3(HbyL}2T-$Jt%E3r?HAQBd6LR{jmx&0 zeuWV$+=zcfbByBxTUCs!6pO3-7c(a!Ap{EDynU9Xym=pGgZ{UrOpQm^C)hj}^h@2# zQ!zKU%dz6CaBe$VgV`bGDqQc@w${B?yEFSQV`Yrh7QbQ5r&poQGzB$wU#cZe=D5mv zNel3|qpX%0i{tktZbdWmE^$1%+32D0)G1`mXm?Tf;C0T$k@y zg*kJa_abFqsZ?V4jun|XOEIqZd9AD6ToK#hu{aL+)|doo{GS4(HFi0hx0HG*uUj5H ibKm4;?%Y!5&OJ19gR%U~-Aue2dz8%m{(#I~jr|8{yblQg literal 0 HcmV?d00001 diff --git a/target/linux/imx6/patches-4.14/210-disable-uart-dma.patch b/target/linux/imx6/patches-4.14/210-disable-uart-dma.patch deleted file mode 100644 index 6abbb933018..00000000000 --- a/target/linux/imx6/patches-4.14/210-disable-uart-dma.patch +++ /dev/null @@ -1,23 +0,0 @@ -Based on following upstream patch by Tim Harvey (Gateworks): - -https://github.com/Gateworks/openwrt/commit/80a01b6582f94c4547f39d3a25e0a1e9b6eb9877 - -TX complete DMA messages are getting missed. -This is also currently an issue in mainline. -For now we will disable DMA in serial/imx.c. - -This resolves an issue encountered with RS485 transmit. - ---- a/drivers/tty/serial/imx.c -+++ b/drivers/tty/serial/imx.c -@@ -1268,10 +1268,6 @@ static int imx_startup(struct uart_port - - writel(temp & ~UCR4_DREN, sport->port.membase + UCR4); - -- /* Can we enable the DMA support? */ -- if (!uart_console(port) && !sport->dma_is_inited) -- imx_uart_dma_init(sport); -- - spin_lock_irqsave(&sport->port.lock, flags); - /* Reset fifo's and state machines */ - i = 100; From aa0aa47aa176133ff302c4a5cea785d971bc26b3 Mon Sep 17 00:00:00 2001 From: Baptiste Jonglez Date: Thu, 18 Oct 2018 11:08:20 +0200 Subject: [PATCH 067/399] kernel: Add support for Winbond w25q128jv SPI NOR flash Newer batches of several Mikrotik boards contain this yet-unsupported flash chip, for instance: - rb941-2nd (hAP lite) - rb952ui-5ac2nd (hAP ac lite) - RBM33G and probably other Mikrotik boards need this patch as well. The patch was submitted upstream by Robert Marko: https://patchwork.ozlabs.org/patch/934181/ Closes: FS#1715 Signed-off-by: Baptiste Jonglez Cc: Robert Marko [Rebased + refreshed on current kernels] Signed-off-by: Koen Vandeputte --- ...ct-JEDEC-incompatible-w25q128-using-.patch | 2 +- ...pi-nor-Add-Winbond-w25q128jv-support.patch | 34 +++++++++++++++++++ ...support-for-XM25QH64A-and-XM25QH128A.patch | 2 +- ...pi-nor-Add-Winbond-w25q128jv-support.patch | 34 +++++++++++++++++++ ...support-for-XM25QH64A-and-XM25QH128A.patch | 2 +- .../401-mtd-spi-nor-support-layerscape.patch | 14 ++++---- ...or-support-mtd-name-from-device-tree.patch | 4 +-- ...d-spi-nor-add-w25q256-3b-mode-switch.patch | 12 +++---- 8 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch create mode 100644 target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch diff --git a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch index 58cd1bf84da..1dcf094468c 100644 --- a/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch +++ b/target/linux/bcm53xx/patches-4.14/400-mtd-spi-nor-detect-JEDEC-incompatible-w25q128-using-.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1215,6 +1215,18 @@ static const struct flash_info *spi_nor_ +@@ -1220,6 +1220,18 @@ static const struct flash_info *spi_nor_ } dev_err(nor->dev, "unrecognized JEDEC id bytes: %02x, %02x, %02x\n", id[0], id[1], id[2]); diff --git a/target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch b/target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch new file mode 100644 index 00000000000..f751bfd3b24 --- /dev/null +++ b/target/linux/generic/pending-4.14/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch @@ -0,0 +1,34 @@ +From: Robert Marko +To: linux-mtd@lists.infradead.org +Subject: mtd: spi-nor: Add Winbond w25q128jv support +Date: Mon, 25 Jun 2018 13:17:48 +0200 + +Datasheet: +http://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf + +Testing done on Mikrotik Routerboard wAP R board. +It does not support Dual or Quad modes. + +Signed-off-by: Robert Marko +--- + +Changes in v2: + - Correct the title +--- + drivers/mtd/spi-nor/spi-nor.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1165,6 +1165,11 @@ static const struct flash_info spi_nor_i + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, ++ { ++ "w25q128jv", INFO(0xef7018, 0, 64 * 1024, 256, ++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | ++ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) ++ }, + { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, diff --git a/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch index b7c4f23a149..4ecf53621d3 100644 --- a/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch +++ b/target/linux/generic/pending-4.14/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch @@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1187,6 +1187,10 @@ static const struct flash_info spi_nor_i +@@ -1192,6 +1192,10 @@ static const struct flash_info spi_nor_i { "3S400AN", S3AN_INFO(0x1f2400, 256, 264) }, { "3S700AN", S3AN_INFO(0x1f2500, 512, 264) }, { "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) }, diff --git a/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch b/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch new file mode 100644 index 00000000000..87f0325fbc0 --- /dev/null +++ b/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch @@ -0,0 +1,34 @@ +From: Robert Marko +To: linux-mtd@lists.infradead.org +Subject: mtd: spi-nor: Add Winbond w25q128jv support +Date: Mon, 25 Jun 2018 13:17:48 +0200 + +Datasheet: +http://www.winbond.com/resource-files/w25q128jv%20revf%2003272018%20plus.pdf + +Testing done on Mikrotik Routerboard wAP R board. +It does not support Dual or Quad modes. + +Signed-off-by: Robert Marko +--- + +Changes in v2: + - Correct the title +--- + drivers/mtd/spi-nor/spi-nor.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1146,6 +1146,11 @@ static const struct flash_info spi_nor_i + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) + }, ++ { ++ "w25q128jv", INFO(0xef7018, 0, 64 * 1024, 256, ++ SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | ++ SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) ++ }, + { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, diff --git a/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch index 585d678815d..39e78b23431 100644 --- a/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch +++ b/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch @@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1166,6 +1166,10 @@ static const struct flash_info spi_nor_i +@@ -1171,6 +1171,10 @@ static const struct flash_info spi_nor_i { "3S400AN", S3AN_INFO(0x1f2400, 256, 264) }, { "3S700AN", S3AN_INFO(0x1f2500, 512, 264) }, { "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) }, diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch index b6b6b92c3db..45f1bfce477 100644 --- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch @@ -768,7 +768,7 @@ Signed-off-by: Yangbo Lu { "w25q32", INFO(0xef4016, 0, 64 * 1024, 64, SECT_4K) }, { "w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64, -@@ -1196,6 +1220,53 @@ static const struct flash_info *spi_nor_ +@@ -1201,6 +1225,53 @@ static const struct flash_info *spi_nor_ id[0], id[1], id[2]); return ERR_PTR(-ENODEV); } @@ -822,7 +822,7 @@ Signed-off-by: Yangbo Lu static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) -@@ -1415,7 +1486,7 @@ static int macronix_quad_enable(struct s +@@ -1420,7 +1491,7 @@ static int macronix_quad_enable(struct s * Write status Register and configuration register with 2 bytes * The first byte will be written to the status register, while the * second byte will be written to the configuration register. @@ -831,7 +831,7 @@ Signed-off-by: Yangbo Lu */ static int write_sr_cr(struct spi_nor *nor, u16 val) { -@@ -1463,6 +1534,24 @@ static int spansion_quad_enable(struct s +@@ -1468,6 +1539,24 @@ static int spansion_quad_enable(struct s return 0; } @@ -856,7 +856,7 @@ Signed-off-by: Yangbo Lu static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info) { int status; -@@ -1609,9 +1698,25 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1614,9 +1703,25 @@ int spi_nor_scan(struct spi_nor *nor, co write_sr(nor, 0); spi_nor_wait_till_ready(nor); } @@ -882,7 +882,7 @@ Signed-off-by: Yangbo Lu mtd->priv = nor; mtd->type = MTD_NORFLASH; mtd->writesize = 1; -@@ -1645,6 +1750,8 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1650,6 +1755,8 @@ int spi_nor_scan(struct spi_nor *nor, co nor->flags |= SNOR_F_USE_FSR; if (info->flags & SPI_NOR_HAS_TB) nor->flags |= SNOR_F_HAS_SR_TB; @@ -891,7 +891,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ -@@ -1684,9 +1791,15 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1689,9 +1796,15 @@ int spi_nor_scan(struct spi_nor *nor, co /* Some devices cannot do fast-read, no matter what DT tells us */ if (info->flags & SPI_NOR_NO_FR) nor->flash_read = SPI_NOR_NORMAL; @@ -910,7 +910,7 @@ Signed-off-by: Yangbo Lu ret = set_quad_mode(nor, info); if (ret) { dev_err(dev, "quad mode not supported\n"); -@@ -1699,6 +1812,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1704,6 +1817,9 @@ int spi_nor_scan(struct spi_nor *nor, co /* Default commands */ switch (nor->flash_read) { diff --git a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch index 47b6b177696..59d9e74d455 100644 --- a/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch +++ b/target/linux/pistachio/patches-4.14/401-mtd-nor-support-mtd-name-from-device-tree.patch @@ -10,7 +10,7 @@ Signed-off-by: Abhimanyu Vishwakarma --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -2656,6 +2656,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2661,6 +2661,7 @@ int spi_nor_scan(struct spi_nor *nor, co struct device *dev = nor->dev; struct mtd_info *mtd = &nor->mtd; struct device_node *np = spi_nor_get_flash_node(nor); @@ -18,7 +18,7 @@ Signed-off-by: Abhimanyu Vishwakarma int ret; int i; -@@ -2731,7 +2732,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2736,7 +2737,12 @@ int spi_nor_scan(struct spi_nor *nor, co spi_nor_wait_till_ready(nor); } diff --git a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch index e7161af9595..02b6ffbc2a0 100644 --- a/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch +++ b/target/linux/ramips/patches-4.14/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch @@ -116,7 +116,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); return ret; -@@ -1170,7 +1222,7 @@ static const struct flash_info spi_nor_i +@@ -1175,7 +1227,7 @@ static const struct flash_info spi_nor_i { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) }, -@@ -1230,6 +1282,9 @@ static int spi_nor_read(struct mtd_info +@@ -1235,6 +1287,9 @@ static int spi_nor_read(struct mtd_info if (ret) return ret; @@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau while (len) { loff_t addr = from; -@@ -1254,6 +1309,18 @@ static int spi_nor_read(struct mtd_info +@@ -1259,6 +1314,18 @@ static int spi_nor_read(struct mtd_info ret = 0; read_err: @@ -154,7 +154,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ); return ret; } -@@ -1355,6 +1422,10 @@ static int spi_nor_write(struct mtd_info +@@ -1360,6 +1427,10 @@ static int spi_nor_write(struct mtd_info if (ret) return ret; @@ -165,7 +165,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < len; ) { ssize_t written; loff_t addr = to + i; -@@ -1395,6 +1466,7 @@ static int spi_nor_write(struct mtd_info +@@ -1400,6 +1471,7 @@ static int spi_nor_write(struct mtd_info } write_err: @@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE); return ret; } -@@ -2811,8 +2883,10 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2816,8 +2888,10 @@ int spi_nor_scan(struct spi_nor *nor, co } else if (mtd->size > 0x1000000) { /* enable 4-byte addressing if the device exceeds 16MiB */ nor->addr_width = 4; From 156f6e63c4d9583b1e31bf623574c683376b9e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 4 Sep 2018 15:20:34 +0200 Subject: [PATCH 068/399] mac80211: add iw command wrapper with error logging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently it's close to impossible to tell what part of mac80211 setup went wrong. Errors logged into system log look like this: radio0 (6155): command failed: No error information (-524) radio0 (6155): command failed: Not supported (-95) radio0 (6155): command failed: I/O error (-5) radio0 (6155): command failed: Too many open files in system (-23) With this commit change it's getting clear: command failed: No error information (-524) Failed command: iw dev wlan0 del command failed: Not supported (-95) Failed command: iw phy phy0 set antenna_gain 0 command failed: I/O error (-5) Failed command: iw phy phy0 set distance 0 command failed: Too many open files in system (-23) Failed command: iw phy phy0 interface add wlan0 type __ap Signed-off-by: Rafał Miłecki (cherry picked from commit ffa80bf5a784a34b81e32144669f30560780bdb6) --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 244260a2dd8..e7d442f8ef1 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -14,6 +14,10 @@ MP_CONFIG_INT="mesh_retry_timeout mesh_confirm_timeout mesh_holding_timeout mesh MP_CONFIG_BOOL="mesh_auto_open_plinks mesh_fwding" MP_CONFIG_STRING="mesh_power_mode" +iw() { + command iw $@ || logger -t mac80211 "Failed command: iw $@" +} + drv_mac80211_init_device_config() { hostapd_common_add_device_config From 5195136002fe3a53676cfef38aaa923b7014aca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 7 Nov 2018 12:02:43 +0100 Subject: [PATCH 069/399] mac80211: brcmfmac: rename 4.20 backport patches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Include kernel version to help tracking changes. Signed-off-by: Rafał Miłecki (cherry picked from commit f7a3459ab9c4d8f5102c8ae0861ca481571703f7) --- ...> 342-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch} | 0 ...atch => 344-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch} | 0 ...001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch} | 0 ...02-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename package/kernel/mac80211/patches/{342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch => 342-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch} (100%) rename package/kernel/mac80211/patches/{344-0001-brcmfmac-fix-wrong-strnchr-usage.patch => 344-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch} (100%) rename package/kernel/mac80211/patches/{345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch => 345-v4.20-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch} (100%) rename package/kernel/mac80211/patches/{345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch => 345-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch} (100%) diff --git a/package/kernel/mac80211/patches/342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch b/package/kernel/mac80211/patches/342-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch similarity index 100% rename from package/kernel/mac80211/patches/342-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch rename to package/kernel/mac80211/patches/342-v4.20-0001-brcmfmac-add-CYW89342-mini-PCIe-device.patch diff --git a/package/kernel/mac80211/patches/344-0001-brcmfmac-fix-wrong-strnchr-usage.patch b/package/kernel/mac80211/patches/344-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch similarity index 100% rename from package/kernel/mac80211/patches/344-0001-brcmfmac-fix-wrong-strnchr-usage.patch rename to package/kernel/mac80211/patches/344-v4.20-0001-brcmfmac-fix-wrong-strnchr-usage.patch diff --git a/package/kernel/mac80211/patches/345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch b/package/kernel/mac80211/patches/345-v4.20-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch similarity index 100% rename from package/kernel/mac80211/patches/345-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch rename to package/kernel/mac80211/patches/345-v4.20-0001-brcmfmac-fix-for-proper-support-of-160MHz-bandwidth.patch diff --git a/package/kernel/mac80211/patches/345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch b/package/kernel/mac80211/patches/345-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch similarity index 100% rename from package/kernel/mac80211/patches/345-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch rename to package/kernel/mac80211/patches/345-v4.20-0002-brcmfmac-increase-buffer-for-obtaining-firmware-capa.patch From 941256c004009cd093b234f7e9bc6e04d7b71458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 7 Nov 2018 09:01:32 +0100 Subject: [PATCH 070/399] mac80211: brcmfmac: backport the latest 4.20 changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (cherry picked from commit b50f162b3cce3d95874e4394f4765413f58765f1) --- ...set-but-not-used-variables-sfdoff-an.patch | 57 +++++++++++++ ...reduce-timeout-for-action-frame-scan.patch | 67 ++++++++++++++++ ...l-timeout-waiting-for-action-frame-o.patch | 79 +++++++++++++++++++ ...fix-decoding-channel-info-for-160-MH.patch | 41 ++++++++++ 4 files changed, 244 insertions(+) create mode 100644 package/kernel/mac80211/patches/346--v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch create mode 100644 package/kernel/mac80211/patches/347-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch create mode 100644 package/kernel/mac80211/patches/347-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch create mode 100644 package/kernel/mac80211/patches/348-v4.20-0001-brcmutil-really-fix-decoding-channel-info-for-160-MH.patch diff --git a/package/kernel/mac80211/patches/346--v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch b/package/kernel/mac80211/patches/346--v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch new file mode 100644 index 00000000000..192ed1a7704 --- /dev/null +++ b/package/kernel/mac80211/patches/346--v4.20-0001-brcmfmac-remove-set-but-not-used-variables-sfdoff-an.patch @@ -0,0 +1,57 @@ +From a8254fa4ba60b85829b6e5ede6564f81cd70d59f Mon Sep 17 00:00:00 2001 +From: YueHaibing +Date: Tue, 11 Sep 2018 11:24:04 +0800 +Subject: [PATCH] brcmfmac: remove set but not used variables 'sfdoff' and + 'pad_size' + +Fixes gcc '-Wunused-but-set-variable' warning: + +drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function 'brcmf_sdio_rxglom': +drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:1466:11: warning: + variable 'sfdoff' set but not used [-Wunused-but-set-variable] + +drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c: In function 'brcmf_sdio_bus_preinit': +drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c:3408:7: warning: + variable 'pad_size' set but not used [-Wunused-but-set-variable] + +Signed-off-by: YueHaibing +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +@@ -1463,7 +1463,7 @@ static u8 brcmf_sdio_rxglom(struct brcmf + struct sk_buff *pfirst, *pnext; + + int errcode; +- u8 doff, sfdoff; ++ u8 doff; + + struct brcmf_sdio_hdrinfo rd_new; + +@@ -1597,7 +1597,6 @@ static u8 brcmf_sdio_rxglom(struct brcmf + + /* Remove superframe header, remember offset */ + skb_pull(pfirst, rd_new.dat_offset); +- sfdoff = rd_new.dat_offset; + num = 0; + + /* Validate all the subframe headers */ +@@ -3405,7 +3404,6 @@ static int brcmf_sdio_bus_preinit(struct + struct brcmf_sdio_dev *sdiodev = bus_if->bus_priv.sdio; + struct brcmf_sdio *bus = sdiodev->bus; + struct brcmf_core *core = bus->sdio_core; +- uint pad_size; + u32 value; + int err; + +@@ -3448,7 +3446,6 @@ static int brcmf_sdio_bus_preinit(struct + if (sdiodev->sg_support) { + bus->txglom = false; + value = 1; +- pad_size = bus->sdiodev->func2->cur_blksize << 1; + err = brcmf_iovar_data_set(bus->sdiodev->dev, "bus:rxglom", + &value, sizeof(u32)); + if (err < 0) { diff --git a/package/kernel/mac80211/patches/347-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch b/package/kernel/mac80211/patches/347-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch new file mode 100644 index 00000000000..a71c1aee03f --- /dev/null +++ b/package/kernel/mac80211/patches/347-v4.20-0001-brcmfmac-reduce-timeout-for-action-frame-scan.patch @@ -0,0 +1,67 @@ +From edb6d6885bef82d1eac432dbeca9fbf4ec349d7e Mon Sep 17 00:00:00 2001 +From: Chung-Hsien Hsu +Date: Thu, 27 Sep 2018 14:59:44 +0000 +Subject: [PATCH] brcmfmac: reduce timeout for action frame scan + +Finding a common channel to send an action frame out is required for +some action types. Since a loop with several scan retry is used to find +the channel, a short wait time could be considered for each attempt. +This patch reduces the wait time from 1500 to 450 msec for each action +frame scan. + +This patch fixes the WFA p2p certification 5.1.20 failure caused by the +long action frame send time. + +Signed-off-by: Chung-Hsien Hsu +Signed-off-by: Chi-Hsien Lin +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +@@ -74,7 +74,7 @@ + #define P2P_AF_MAX_WAIT_TIME msecs_to_jiffies(2000) + #define P2P_INVALID_CHANNEL -1 + #define P2P_CHANNEL_SYNC_RETRY 5 +-#define P2P_AF_FRM_SCAN_MAX_WAIT msecs_to_jiffies(1500) ++#define P2P_AF_FRM_SCAN_MAX_WAIT msecs_to_jiffies(450) + #define P2P_DEFAULT_SLEEP_TIME_VSDB 200 + + /* WiFi P2P Public Action Frame OUI Subtypes */ +@@ -1134,7 +1134,6 @@ static s32 brcmf_p2p_af_searching_channe + { + struct afx_hdl *afx_hdl = &p2p->afx_hdl; + struct brcmf_cfg80211_vif *pri_vif; +- unsigned long duration; + s32 retry; + + brcmf_dbg(TRACE, "Enter\n"); +@@ -1150,7 +1149,6 @@ static s32 brcmf_p2p_af_searching_channe + * pending action frame tx is cancelled. + */ + retry = 0; +- duration = msecs_to_jiffies(P2P_AF_FRM_SCAN_MAX_WAIT); + while ((retry < P2P_CHANNEL_SYNC_RETRY) && + (afx_hdl->peer_chan == P2P_INVALID_CHANNEL)) { + afx_hdl->is_listen = false; +@@ -1158,7 +1156,8 @@ static s32 brcmf_p2p_af_searching_channe + retry); + /* search peer on peer's listen channel */ + schedule_work(&afx_hdl->afx_work); +- wait_for_completion_timeout(&afx_hdl->act_frm_scan, duration); ++ wait_for_completion_timeout(&afx_hdl->act_frm_scan, ++ P2P_AF_FRM_SCAN_MAX_WAIT); + if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) || + (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL, + &p2p->status))) +@@ -1171,7 +1170,7 @@ static s32 brcmf_p2p_af_searching_channe + afx_hdl->is_listen = true; + schedule_work(&afx_hdl->afx_work); + wait_for_completion_timeout(&afx_hdl->act_frm_scan, +- duration); ++ P2P_AF_FRM_SCAN_MAX_WAIT); + } + if ((afx_hdl->peer_chan != P2P_INVALID_CHANNEL) || + (!test_bit(BRCMF_P2P_STATUS_FINDING_COMMON_CHANNEL, diff --git a/package/kernel/mac80211/patches/347-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch b/package/kernel/mac80211/patches/347-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch new file mode 100644 index 00000000000..ef2d0934fcc --- /dev/null +++ b/package/kernel/mac80211/patches/347-v4.20-0002-brcmfmac-fix-full-timeout-waiting-for-action-frame-o.patch @@ -0,0 +1,79 @@ +From fbf07000960d9c8a13fdc17c6de0230d681c7543 Mon Sep 17 00:00:00 2001 +From: Chung-Hsien Hsu +Date: Thu, 27 Sep 2018 14:59:49 +0000 +Subject: [PATCH] brcmfmac: fix full timeout waiting for action frame + on-channel tx + +The driver sends an action frame down and waits for a completion signal +triggered by the received BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE event +to continue the process. However, the action frame could be transmitted +either on the current channel or on an off channel. For the on-channel +case, only BRCMF_E_ACTION_FRAME_COMPLETE event will be received when +the frame is transmitted, which make the driver always wait a full +timeout duration. This patch has the completion signal be triggered by +receiving the BRCMF_E_ACTION_FRAME_COMPLETE event for the on-channel +case. + +This change fixes WFA p2p certification 5.1.19 failure. + +Signed-off-by: Chung-Hsien Hsu +Signed-off-by: Chi-Hsien Lin +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 17 +++++++++++++++-- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h | 2 ++ + 2 files changed, 17 insertions(+), 2 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +@@ -1457,10 +1457,12 @@ int brcmf_p2p_notify_action_tx_complete( + return 0; + + if (e->event_code == BRCMF_E_ACTION_FRAME_COMPLETE) { +- if (e->status == BRCMF_E_STATUS_SUCCESS) ++ if (e->status == BRCMF_E_STATUS_SUCCESS) { + set_bit(BRCMF_P2P_STATUS_ACTION_TX_COMPLETED, + &p2p->status); +- else { ++ if (!p2p->wait_for_offchan_complete) ++ complete(&p2p->send_af_done); ++ } else { + set_bit(BRCMF_P2P_STATUS_ACTION_TX_NOACK, &p2p->status); + /* If there is no ack, we don't need to wait for + * WLC_E_ACTION_FRAME_OFFCHAN_COMPLETE event +@@ -1511,6 +1513,17 @@ static s32 brcmf_p2p_tx_action_frame(str + p2p->af_sent_channel = le32_to_cpu(af_params->channel); + p2p->af_tx_sent_jiffies = jiffies; + ++ if (test_bit(BRCMF_P2P_STATUS_DISCOVER_LISTEN, &p2p->status) && ++ p2p->af_sent_channel == ++ ieee80211_frequency_to_channel(p2p->remain_on_channel.center_freq)) ++ p2p->wait_for_offchan_complete = false; ++ else ++ p2p->wait_for_offchan_complete = true; ++ ++ brcmf_dbg(TRACE, "Waiting for %s tx completion event\n", ++ (p2p->wait_for_offchan_complete) ? ++ "off-channel" : "on-channel"); ++ + timeout = wait_for_completion_timeout(&p2p->send_af_done, + P2P_AF_MAX_WAIT_TIME); + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.h +@@ -124,6 +124,7 @@ struct afx_hdl { + * @gon_req_action: about to send go negotiation requets frame. + * @block_gon_req_tx: drop tx go negotiation requets frame. + * @p2pdev_dynamically: is p2p device if created by module param or supplicant. ++ * @wait_for_offchan_complete: wait for off-channel tx completion event. + */ + struct brcmf_p2p_info { + struct brcmf_cfg80211_info *cfg; +@@ -144,6 +145,7 @@ struct brcmf_p2p_info { + bool gon_req_action; + bool block_gon_req_tx; + bool p2pdev_dynamically; ++ bool wait_for_offchan_complete; + }; + + s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg, bool p2pdev_forced); diff --git a/package/kernel/mac80211/patches/348-v4.20-0001-brcmutil-really-fix-decoding-channel-info-for-160-MH.patch b/package/kernel/mac80211/patches/348-v4.20-0001-brcmutil-really-fix-decoding-channel-info-for-160-MH.patch new file mode 100644 index 00000000000..154664c8547 --- /dev/null +++ b/package/kernel/mac80211/patches/348-v4.20-0001-brcmutil-really-fix-decoding-channel-info-for-160-MH.patch @@ -0,0 +1,41 @@ +From 3401d42c7ea2d064d15c66698ff8eb96553179ce Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 26 Oct 2018 12:50:39 +0200 +Subject: [PATCH] brcmutil: really fix decoding channel info for 160 MHz + bandwidth +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Previous commit /adding/ support for 160 MHz chanspecs was incomplete. +It didn't set bandwidth info and didn't extract control channel info. As +the result it was also using uninitialized "sb" var. + +This change has been tested for two chanspecs found to be reported by +some devices/firmwares: +1) 60/160 (0xee32) + Before: chnum:50 control_ch_num:36 + After: chnum:50 control_ch_num:60 +2) 120/160 (0xed72) + Before: chnum:114 control_ch_num:100 + After: chnum:114 control_ch_num:120 + +Fixes: 330994e8e8ec ("brcmfmac: fix for proper support of 160MHz bandwidth") +Signed-off-by: Rafał Miłecki +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +@@ -193,6 +193,9 @@ static void brcmu_d11ac_decchspec(struct + } + break; + case BRCMU_CHSPEC_D11AC_BW_160: ++ ch->bw = BRCMU_CHAN_BW_160; ++ ch->sb = brcmu_maskget16(ch->chspec, BRCMU_CHSPEC_D11AC_SB_MASK, ++ BRCMU_CHSPEC_D11AC_SB_SHIFT); + switch (ch->sb) { + case BRCMU_CHAN_SB_LLL: + ch->control_ch_num -= CH_70MHZ_APART; From 2e54de4e54d8a6b4180c69da53f2eb6e80e575ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 7 Nov 2018 12:21:59 +0100 Subject: [PATCH 071/399] mac80211: brcmutil: backport chanspec debugging patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It helps debugging possible WARN-ings. Signed-off-by: Rafał Miłecki --- ...print-invalid-chanspec-when-WARN-ing.patch | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 package/kernel/mac80211/patches/349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch diff --git a/package/kernel/mac80211/patches/349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch b/package/kernel/mac80211/patches/349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch new file mode 100644 index 00000000000..566336cbc32 --- /dev/null +++ b/package/kernel/mac80211/patches/349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch @@ -0,0 +1,83 @@ +From ae5848cb4511bbbfe0306fcdbe5d9a95cd9546a9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 26 Oct 2018 13:22:32 +0200 +Subject: [PATCH] brcmutil: print invalid chanspec when WARN-ing +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On one of my devices I got WARNINGs when brcmfmac tried to decode +chanspec. I couldn't tell if it was some unsupported format or just a +malformed value passed by a firmware. + +Print chanspec value so it's possible to debug a possible problem. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmutil/d11.c +@@ -128,7 +128,7 @@ static void brcmu_d11n_decchspec(struct + } + break; + default: +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + break; + } + +@@ -140,7 +140,7 @@ static void brcmu_d11n_decchspec(struct + ch->band = BRCMU_CHAN_BAND_2G; + break; + default: +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + break; + } + } +@@ -167,7 +167,7 @@ static void brcmu_d11ac_decchspec(struct + ch->sb = BRCMU_CHAN_SB_U; + ch->control_ch_num += CH_10MHZ_APART; + } else { +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + } + break; + case BRCMU_CHSPEC_D11AC_BW_80: +@@ -188,7 +188,7 @@ static void brcmu_d11ac_decchspec(struct + ch->control_ch_num += CH_30MHZ_APART; + break; + default: +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + break; + } + break; +@@ -222,13 +222,13 @@ static void brcmu_d11ac_decchspec(struct + ch->control_ch_num += CH_70MHZ_APART; + break; + default: +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + break; + } + break; + case BRCMU_CHSPEC_D11AC_BW_8080: + default: +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + break; + } + +@@ -240,7 +240,7 @@ static void brcmu_d11ac_decchspec(struct + ch->band = BRCMU_CHAN_BAND_2G; + break; + default: +- WARN_ON_ONCE(1); ++ WARN_ONCE(1, "Invalid chanspec 0x%04x\n", ch->chspec); + break; + } + } From 55d078b249427380fe9cc3684f7657ccc2b1405c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 8 Nov 2018 11:52:33 +0100 Subject: [PATCH 072/399] script: ipkg-build: honour $SOURCE_DATE_EPOCH When the SOURCE_DATE_EPOCH environment variable is set, use it to override the timestamps of .ipk archive contents. This ensures that .ipk archives built in environments without SCM metadata (mainly the SDK) are reproducible between different runs. Ref: https://github.com/openwrt/packages/issues/6954 Signed-off-by: Jo-Philipp Wich (cherry picked from commit d157a76c67bcb821d3ec8dcd4312390ef129a95a) --- scripts/ipkg-build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/ipkg-build b/scripts/ipkg-build index 845a6ed04e6..d38ba20af30 100755 --- a/scripts/ipkg-build +++ b/scripts/ipkg-build @@ -15,8 +15,12 @@ FIND="${FIND:-$(which gfind)}" TAR="${TAR:-$(which tar)}" GZIP="$(which gzip)" +# try to use fixed source epoch +if [ -n "$SOURCE_DATE_EPOCH" ]; then + TIMESTAMP=$(date --date="@$SOURCE_DATE_EPOCH") + # look up date of last commit -if [ -d "$TOPDIR/.git" ]; then +elif [ -d "$TOPDIR/.git" ]; then GIT="$(which git)" TIMESTAMP=$(cd $TOPDIR; $GIT log -1 -s --format=%ci) elif [ -d "$TOPDIR/.svn" ]; then From e6971b8defdfac6490d2336e073d87db895d2b9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 11 Oct 2018 13:55:57 +0200 Subject: [PATCH 073/399] bcm53xx: add pending pinctrl driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's required to support devices using adjustable SoC pins for some specific purpose (e.g. I2C, PWM, UART1). Signed-off-by: Rafał Miłecki (cherry picked from commit f00cb94f7ced064d74839892116c3a0b8f10c872) --- target/linux/bcm53xx/config-4.14 | 1 + ...182-pinctrl-bcm-add-Northstar-driver.patch | 426 ++++++++++++++++++ 2 files changed, 427 insertions(+) create mode 100644 target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch diff --git a/target/linux/bcm53xx/config-4.14 b/target/linux/bcm53xx/config-4.14 index cb47faa413d..45ca7b4a06c 100644 --- a/target/linux/bcm53xx/config-4.14 +++ b/target/linux/bcm53xx/config-4.14 @@ -294,6 +294,7 @@ CONFIG_PHYLIB=y # CONFIG_PHY_NS2_USB_DRD is not set CONFIG_PINCTRL=y # CONFIG_PINCTRL_IPROC_GPIO is not set +CONFIG_PINCTRL_NS=y # CONFIG_PINCTRL_NS2_MUX is not set # CONFIG_PL310_ERRATA_588369 is not set # CONFIG_PL310_ERRATA_727915 is not set diff --git a/target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch b/target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch new file mode 100644 index 00000000000..35c83422a96 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch @@ -0,0 +1,426 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Wed, 26 Sep 2018 21:31:03 +0200 +Subject: [PATCH] pinctrl: bcm: add Northstar driver +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This driver provides support for Northstar mux controller. It differs +from Northstar Plus one so a new binding and driver were needed. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/Kconfig | 13 ++ + drivers/pinctrl/bcm/Makefile | 1 + + drivers/pinctrl/bcm/pinctrl-ns.c | 372 +++++++++++++++++++++++++++++++++++++++ + 3 files changed, 386 insertions(+) + create mode 100644 drivers/pinctrl/bcm/pinctrl-ns.c + +--- a/drivers/pinctrl/bcm/Kconfig ++++ b/drivers/pinctrl/bcm/Kconfig +@@ -72,6 +72,19 @@ config PINCTRL_CYGNUS_MUX + configuration, with the exception that certain individual pins + can be overridden to GPIO function + ++config PINCTRL_NS ++ bool "Broadcom Northstar pins driver" ++ depends on OF && (ARCH_BCM_5301X || COMPILE_TEST) ++ select PINMUX ++ select GENERIC_PINCONF ++ default ARCH_BCM_5301X ++ help ++ Say yes here to enable the Broadcom NS SoC pins driver. ++ ++ The Broadcom Northstar pins driver supports muxing multi-purpose pins ++ that can be used for various functions (e.g. SPI, I2C, UART) as well ++ as GPIOs. ++ + config PINCTRL_NSP_GPIO + bool "Broadcom NSP GPIO (with PINCONF) driver" + depends on OF_GPIO && (ARCH_BCM_NSP || COMPILE_TEST) +--- a/drivers/pinctrl/bcm/Makefile ++++ b/drivers/pinctrl/bcm/Makefile +@@ -5,6 +5,7 @@ obj-$(CONFIG_PINCTRL_BCM281XX) += pinct + obj-$(CONFIG_PINCTRL_BCM2835) += pinctrl-bcm2835.o + obj-$(CONFIG_PINCTRL_IPROC_GPIO) += pinctrl-iproc-gpio.o + obj-$(CONFIG_PINCTRL_CYGNUS_MUX) += pinctrl-cygnus-mux.o ++obj-$(CONFIG_PINCTRL_NS) += pinctrl-ns.o + obj-$(CONFIG_PINCTRL_NSP_GPIO) += pinctrl-nsp-gpio.o + obj-$(CONFIG_PINCTRL_NS2_MUX) += pinctrl-ns2-mux.o + obj-$(CONFIG_PINCTRL_NSP_MUX) += pinctrl-nsp-mux.o +--- /dev/null ++++ b/drivers/pinctrl/bcm/pinctrl-ns.c +@@ -0,0 +1,372 @@ ++// SPDX-License-Identifier: GPL-2.0 ++/* ++ * Copyright (C) 2018 Rafał Miłecki ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define FLAG_BCM4708 BIT(1) ++#define FLAG_BCM4709 BIT(2) ++#define FLAG_BCM53012 BIT(3) ++ ++struct ns_pinctrl { ++ struct device *dev; ++ unsigned int chipset_flag; ++ struct pinctrl_dev *pctldev; ++ void __iomem *base; ++ ++ struct pinctrl_desc pctldesc; ++ struct ns_pinctrl_group *groups; ++ unsigned int num_groups; ++ struct ns_pinctrl_function *functions; ++ unsigned int num_functions; ++}; ++ ++/* ++ * Pins ++ */ ++ ++static const struct pinctrl_pin_desc ns_pinctrl_pins[] = { ++ { 0, "spi_clk", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 1, "spi_ss", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 2, "spi_mosi", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 3, "spi_miso", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 4, "i2c_scl", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 5, "i2c_sda", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 6, "mdc", (void *)(FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 7, "mdio", (void *)(FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 8, "pwm0", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 9, "pwm1", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 10, "pwm2", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 11, "pwm3", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 12, "uart1_rx", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 13, "uart1_tx", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 14, "uart1_cts", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 15, "uart1_rts", (void *)(FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 16, "uart2_rx", (void *)(FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 17, "uart2_tx", (void *)(FLAG_BCM4709 | FLAG_BCM53012) }, ++/* TODO { ??, "xtal_out", (void *)(FLAG_BCM4709) }, */ ++ { 22, "sdio_pwr", (void *)(FLAG_BCM4709 | FLAG_BCM53012) }, ++ { 23, "sdio_en_1p8v", (void *)(FLAG_BCM4709 | FLAG_BCM53012) }, ++}; ++ ++/* ++ * Groups ++ */ ++ ++struct ns_pinctrl_group { ++ const char *name; ++ const unsigned int *pins; ++ const unsigned int num_pins; ++ unsigned int chipsets; ++}; ++ ++static const unsigned int spi_pins[] = { 0, 1, 2, 3 }; ++static const unsigned int i2c_pins[] = { 4, 5 }; ++static const unsigned int mdio_pins[] = { 6, 7 }; ++static const unsigned int pwm0_pins[] = { 8 }; ++static const unsigned int pwm1_pins[] = { 9 }; ++static const unsigned int pwm2_pins[] = { 10 }; ++static const unsigned int pwm3_pins[] = { 11 }; ++static const unsigned int uart1_pins[] = { 12, 13, 14, 15 }; ++static const unsigned int uart2_pins[] = { 16, 17 }; ++static const unsigned int sdio_pwr_pins[] = { 22 }; ++static const unsigned int sdio_1p8v_pins[] = { 23 }; ++ ++#define NS_GROUP(_name, _pins, _chipsets) \ ++{ \ ++ .name = _name, \ ++ .pins = _pins, \ ++ .num_pins = ARRAY_SIZE(_pins), \ ++ .chipsets = _chipsets, \ ++} ++ ++static const struct ns_pinctrl_group ns_pinctrl_groups[] = { ++ NS_GROUP("spi_grp", spi_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("i2c_grp", i2c_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("mdio_grp", mdio_pins, FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("pwm0_grp", pwm0_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("pwm1_grp", pwm1_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("pwm2_grp", pwm2_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("pwm3_grp", pwm3_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("uart1_grp", uart1_pins, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("uart2_grp", uart2_pins, FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("sdio_pwr_grp", sdio_pwr_pins, FLAG_BCM4709 | FLAG_BCM53012), ++ NS_GROUP("sdio_1p8v_grp", sdio_1p8v_pins, FLAG_BCM4709 | FLAG_BCM53012), ++}; ++ ++/* ++ * Functions ++ */ ++ ++struct ns_pinctrl_function { ++ const char *name; ++ const char * const *groups; ++ const unsigned int num_groups; ++ unsigned int chipsets; ++}; ++ ++static const char * const spi_groups[] = { "spi_grp" }; ++static const char * const i2c_groups[] = { "i2c_grp" }; ++static const char * const mdio_groups[] = { "mdio_grp" }; ++static const char * const pwm_groups[] = { "pwm0_grp", "pwm1_grp", "pwm2_grp", ++ "pwm3_grp" }; ++static const char * const uart1_groups[] = { "uart1_grp" }; ++static const char * const uart2_groups[] = { "uart2_grp" }; ++static const char * const sdio_groups[] = { "sdio_pwr_grp", "sdio_1p8v_grp" }; ++ ++#define NS_FUNCTION(_name, _groups, _chipsets) \ ++{ \ ++ .name = _name, \ ++ .groups = _groups, \ ++ .num_groups = ARRAY_SIZE(_groups), \ ++ .chipsets = _chipsets, \ ++} ++ ++static const struct ns_pinctrl_function ns_pinctrl_functions[] = { ++ NS_FUNCTION("spi", spi_groups, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_FUNCTION("i2c", i2c_groups, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_FUNCTION("mdio", mdio_groups, FLAG_BCM4709 | FLAG_BCM53012), ++ NS_FUNCTION("pwm", pwm_groups, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_FUNCTION("uart1", uart1_groups, FLAG_BCM4708 | FLAG_BCM4709 | FLAG_BCM53012), ++ NS_FUNCTION("uart2", uart2_groups, FLAG_BCM4709 | FLAG_BCM53012), ++ NS_FUNCTION("sdio", sdio_groups, FLAG_BCM4709 | FLAG_BCM53012), ++}; ++ ++/* ++ * Groups code ++ */ ++ ++static int ns_pinctrl_get_groups_count(struct pinctrl_dev *pctrl_dev) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ ++ return ns_pinctrl->num_groups; ++} ++ ++static const char *ns_pinctrl_get_group_name(struct pinctrl_dev *pctrl_dev, ++ unsigned int selector) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ ++ return ns_pinctrl->groups[selector].name; ++} ++ ++static int ns_pinctrl_get_group_pins(struct pinctrl_dev *pctrl_dev, ++ unsigned int selector, ++ const unsigned int **pins, ++ unsigned int *num_pins) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ ++ *pins = ns_pinctrl->groups[selector].pins; ++ *num_pins = ns_pinctrl->groups[selector].num_pins; ++ ++ return 0; ++} ++ ++static const struct pinctrl_ops ns_pinctrl_ops = { ++ .get_groups_count = ns_pinctrl_get_groups_count, ++ .get_group_name = ns_pinctrl_get_group_name, ++ .get_group_pins = ns_pinctrl_get_group_pins, ++ .dt_node_to_map = pinconf_generic_dt_node_to_map_group, ++ .dt_free_map = pinconf_generic_dt_free_map, ++}; ++ ++/* ++ * Functions code ++ */ ++ ++static int ns_pinctrl_get_functions_count(struct pinctrl_dev *pctrl_dev) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ ++ return ns_pinctrl->num_functions; ++} ++ ++static const char *ns_pinctrl_get_function_name(struct pinctrl_dev *pctrl_dev, ++ unsigned int selector) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ ++ return ns_pinctrl->functions[selector].name; ++} ++ ++static int ns_pinctrl_get_function_groups(struct pinctrl_dev *pctrl_dev, ++ unsigned int selector, ++ const char * const **groups, ++ unsigned * const num_groups) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ ++ *groups = ns_pinctrl->functions[selector].groups; ++ *num_groups = ns_pinctrl->functions[selector].num_groups; ++ ++ return 0; ++} ++ ++static int ns_pinctrl_set_mux(struct pinctrl_dev *pctrl_dev, ++ unsigned int func_select, ++ unsigned int grp_select) ++{ ++ struct ns_pinctrl *ns_pinctrl = pinctrl_dev_get_drvdata(pctrl_dev); ++ u32 unset = 0; ++ u32 tmp; ++ int i; ++ ++ for (i = 0; i < ns_pinctrl->groups[grp_select].num_pins; i++) { ++ int pin_number = ns_pinctrl->groups[grp_select].pins[i]; ++ ++ unset |= BIT(pin_number); ++ } ++ ++ tmp = readl(ns_pinctrl->base); ++ tmp &= ~unset; ++ writel(tmp, ns_pinctrl->base); ++ ++ return 0; ++} ++ ++static const struct pinmux_ops ns_pinctrl_pmxops = { ++ .get_functions_count = ns_pinctrl_get_functions_count, ++ .get_function_name = ns_pinctrl_get_function_name, ++ .get_function_groups = ns_pinctrl_get_function_groups, ++ .set_mux = ns_pinctrl_set_mux, ++}; ++ ++/* ++ * Controller code ++ */ ++ ++static struct pinctrl_desc ns_pinctrl_desc = { ++ .name = "pinctrl-ns", ++ .pctlops = &ns_pinctrl_ops, ++ .pmxops = &ns_pinctrl_pmxops, ++}; ++ ++static const struct of_device_id ns_pinctrl_of_match_table[] = { ++ { .compatible = "brcm,bcm4708-pinmux", .data = (void *)FLAG_BCM4708, }, ++ { .compatible = "brcm,bcm4709-pinmux", .data = (void *)FLAG_BCM4709, }, ++ { .compatible = "brcm,bcm53012-pinmux", .data = (void *)FLAG_BCM53012, }, ++ { } ++}; ++ ++static int ns_pinctrl_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ const struct of_device_id *of_id; ++ struct ns_pinctrl *ns_pinctrl; ++ struct pinctrl_desc *pctldesc; ++ struct pinctrl_pin_desc *pin; ++ struct ns_pinctrl_group *group; ++ struct ns_pinctrl_function *function; ++ struct resource *res; ++ int i; ++ ++ ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL); ++ if (!ns_pinctrl) ++ return -ENOMEM; ++ pctldesc = &ns_pinctrl->pctldesc; ++ platform_set_drvdata(pdev, ns_pinctrl); ++ ++ /* Set basic properties */ ++ ++ ns_pinctrl->dev = dev; ++ ++ of_id = of_match_device(ns_pinctrl_of_match_table, dev); ++ if (!of_id) ++ return -EINVAL; ++ ns_pinctrl->chipset_flag = (unsigned int)of_id->data; ++ ++ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, ++ "cru_gpio_control"); ++ ns_pinctrl->base = devm_ioremap_resource(dev, res); ++ if (IS_ERR(ns_pinctrl->base)) { ++ dev_err(dev, "Failed to map pinctrl regs\n"); ++ return PTR_ERR(ns_pinctrl->base); ++ } ++ ++ memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc)); ++ ++ /* Set pinctrl properties */ ++ ++ pctldesc->pins = devm_kcalloc(dev, ARRAY_SIZE(ns_pinctrl_pins), ++ sizeof(struct pinctrl_pin_desc), ++ GFP_KERNEL); ++ if (!pctldesc->pins) ++ return -ENOMEM; ++ for (i = 0, pin = (struct pinctrl_pin_desc *)&pctldesc->pins[0]; ++ i < ARRAY_SIZE(ns_pinctrl_pins); i++) { ++ const struct pinctrl_pin_desc *src = &ns_pinctrl_pins[i]; ++ unsigned int chipsets = (unsigned int)src->drv_data; ++ ++ if (chipsets & ns_pinctrl->chipset_flag) { ++ memcpy(pin++, src, sizeof(*src)); ++ pctldesc->npins++; ++ } ++ } ++ ++ ns_pinctrl->groups = devm_kcalloc(dev, ARRAY_SIZE(ns_pinctrl_groups), ++ sizeof(struct ns_pinctrl_group), ++ GFP_KERNEL); ++ if (!ns_pinctrl->groups) ++ return -ENOMEM; ++ for (i = 0, group = &ns_pinctrl->groups[0]; ++ i < ARRAY_SIZE(ns_pinctrl_groups); i++) { ++ const struct ns_pinctrl_group *src = &ns_pinctrl_groups[i]; ++ ++ if (src->chipsets & ns_pinctrl->chipset_flag) { ++ memcpy(group++, src, sizeof(*src)); ++ ns_pinctrl->num_groups++; ++ } ++ } ++ ++ ns_pinctrl->functions = devm_kcalloc(dev, ++ ARRAY_SIZE(ns_pinctrl_functions), ++ sizeof(struct ns_pinctrl_function), ++ GFP_KERNEL); ++ if (!ns_pinctrl->functions) ++ return -ENOMEM; ++ for (i = 0, function = &ns_pinctrl->functions[0]; ++ i < ARRAY_SIZE(ns_pinctrl_functions); i++) { ++ const struct ns_pinctrl_function *src = &ns_pinctrl_functions[i]; ++ ++ if (src->chipsets & ns_pinctrl->chipset_flag) { ++ memcpy(function++, src, sizeof(*src)); ++ ns_pinctrl->num_functions++; ++ } ++ } ++ ++ /* Register */ ++ ++ ns_pinctrl->pctldev = devm_pinctrl_register(dev, pctldesc, ns_pinctrl); ++ if (IS_ERR(ns_pinctrl->pctldev)) { ++ dev_err(dev, "Failed to register pinctrl\n"); ++ return PTR_ERR(ns_pinctrl->pctldev); ++ } ++ ++ return 0; ++} ++ ++static struct platform_driver ns_pinctrl_driver = { ++ .probe = ns_pinctrl_probe, ++ .driver = { ++ .name = "ns-pinmux", ++ .of_match_table = ns_pinctrl_of_match_table, ++ }, ++}; ++ ++module_platform_driver(ns_pinctrl_driver); ++ ++MODULE_AUTHOR("Rafał Miłecki"); ++MODULE_LICENSE("GPL v2"); ++MODULE_DEVICE_TABLE(of, ns_pinctrl_of_match_table); From f9e50a9468d73f2d22c347557040ec158d6ae625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 9 Nov 2018 07:40:42 +0100 Subject: [PATCH 074/399] bcm53xx: update pinctrl driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's upstream now with a one trivial fix. Signed-off-by: Rafał Miłecki (cherry picked from commit f975ab8f4e3d5b8a8e81870c70d427f9d84b203b) --- ...82-pinctrl-bcm-add-Northstar-driver.patch} | 1 + ...cm-ns-Use-uintptr_t-for-casting-data.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) rename target/linux/bcm53xx/patches-4.14/{182-pinctrl-bcm-add-Northstar-driver.patch => 082-pinctrl-bcm-add-Northstar-driver.patch} (99%) create mode 100644 target/linux/bcm53xx/patches-4.14/083-pinctrl-bcm-ns-Use-uintptr_t-for-casting-data.patch diff --git a/target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch b/target/linux/bcm53xx/patches-4.14/082-pinctrl-bcm-add-Northstar-driver.patch similarity index 99% rename from target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch rename to target/linux/bcm53xx/patches-4.14/082-pinctrl-bcm-add-Northstar-driver.patch index 35c83422a96..1d1b038b411 100644 --- a/target/linux/bcm53xx/patches-4.14/182-pinctrl-bcm-add-Northstar-driver.patch +++ b/target/linux/bcm53xx/patches-4.14/082-pinctrl-bcm-add-Northstar-driver.patch @@ -1,3 +1,4 @@ +From c12fb1774deaa9c9408b19db8d43d3612f6e47a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 26 Sep 2018 21:31:03 +0200 Subject: [PATCH] pinctrl: bcm: add Northstar driver diff --git a/target/linux/bcm53xx/patches-4.14/083-pinctrl-bcm-ns-Use-uintptr_t-for-casting-data.patch b/target/linux/bcm53xx/patches-4.14/083-pinctrl-bcm-ns-Use-uintptr_t-for-casting-data.patch new file mode 100644 index 00000000000..afaed68d055 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/083-pinctrl-bcm-ns-Use-uintptr_t-for-casting-data.patch @@ -0,0 +1,38 @@ +From ce7bdb957b8e3f1cbf0a3358f1deef385dff6502 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 11 Oct 2018 13:23:40 +0200 +Subject: [PATCH] pinctrl: bcm: ns: Use uintptr_t for casting data +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fix up a compiler error on 64bit architectures where pointers +and integers differ in size. + +Suggested-by: Arnd Bergmann +Signed-off-by: Rafał Miłecki +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/pinctrl-ns.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/pinctrl/bcm/pinctrl-ns.c ++++ b/drivers/pinctrl/bcm/pinctrl-ns.c +@@ -285,7 +285,7 @@ static int ns_pinctrl_probe(struct platf + of_id = of_match_device(ns_pinctrl_of_match_table, dev); + if (!of_id) + return -EINVAL; +- ns_pinctrl->chipset_flag = (unsigned int)of_id->data; ++ ns_pinctrl->chipset_flag = (uintptr_t)of_id->data; + + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "cru_gpio_control"); +@@ -307,7 +307,7 @@ static int ns_pinctrl_probe(struct platf + for (i = 0, pin = (struct pinctrl_pin_desc *)&pctldesc->pins[0]; + i < ARRAY_SIZE(ns_pinctrl_pins); i++) { + const struct pinctrl_pin_desc *src = &ns_pinctrl_pins[i]; +- unsigned int chipsets = (unsigned int)src->drv_data; ++ unsigned int chipsets = (uintptr_t)src->drv_data; + + if (chipsets & ns_pinctrl->chipset_flag) { + memcpy(pin++, src, sizeof(*src)); From 057893024e161d9670e5e2e1a265c3557d8e889f Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 6 Sep 2018 13:30:24 +0200 Subject: [PATCH 075/399] mac80211: backport sg_init_marker() Signed-off-by: Felix Fietkau --- .../patches/009-backport_sg_init_marker.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 package/kernel/mac80211/patches/009-backport_sg_init_marker.patch diff --git a/package/kernel/mac80211/patches/009-backport_sg_init_marker.patch b/package/kernel/mac80211/patches/009-backport_sg_init_marker.patch new file mode 100644 index 00000000000..d7c20daf166 --- /dev/null +++ b/package/kernel/mac80211/patches/009-backport_sg_init_marker.patch @@ -0,0 +1,30 @@ +--- a/backport-include/linux/scatterlist.h ++++ b/backport-include/linux/scatterlist.h +@@ -102,4 +102,27 @@ size_t sg_pcopy_from_buffer(struct scatt + + #endif /* LINUX_VERSION_IS_LESS(3, 11, 0) */ + ++#if LINUX_VERSION_IS_LESS(4, 17, 0) ++ ++#define sg_init_marker LINUX_BACKPORT(sg_init_marker) ++/** ++ * sg_init_marker - Initialize markers in sg table ++ * @sgl: The SG table ++ * @nents: Number of entries in table ++ * ++ **/ ++static inline void sg_init_marker(struct scatterlist *sgl, ++ unsigned int nents) ++{ ++#ifdef CONFIG_DEBUG_SG ++ unsigned int i; ++ ++ for (i = 0; i < nents; i++) ++ sgl[i].sg_magic = SG_MAGIC; ++#endif ++ sg_mark_end(&sgl[nents - 1]); ++} ++ ++#endif /* LINUX_VERSION_IS_LESS(4, 17, 0) */ ++ + #endif /* __BACKPORT_SCATTERLIST_H */ From 3589915a43a9763a2f146b9824e99aaf099cdb56 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 12 Sep 2018 16:58:32 +0200 Subject: [PATCH 076/399] kernel: backport and include linux/overflow.h Signed-off-by: Felix Fietkau --- .../patches/011-backport-overflow_h.patch | 322 ++++++++++++++++++ 1 file changed, 322 insertions(+) create mode 100644 package/kernel/mac80211/patches/011-backport-overflow_h.patch diff --git a/package/kernel/mac80211/patches/011-backport-overflow_h.patch b/package/kernel/mac80211/patches/011-backport-overflow_h.patch new file mode 100644 index 00000000000..169d3bab15d --- /dev/null +++ b/package/kernel/mac80211/patches/011-backport-overflow_h.patch @@ -0,0 +1,322 @@ +--- a/backport-include/linux/slab.h ++++ b/backport-include/linux/slab.h +@@ -1,6 +1,7 @@ + #ifndef __BACKPORT_SLAB_H + #define __BACKPORT_SLAB_H + #include_next ++#include + #include + + #if LINUX_VERSION_IS_LESS(3,4,0) +--- /dev/null ++++ b/include/linux/overflow.h +@@ -0,0 +1,309 @@ ++/* SPDX-License-Identifier: GPL-2.0 OR MIT */ ++#ifndef __LINUX_OVERFLOW_H ++#define __LINUX_OVERFLOW_H ++ ++#include ++ ++/* ++ * In the fallback code below, we need to compute the minimum and ++ * maximum values representable in a given type. These macros may also ++ * be useful elsewhere, so we provide them outside the ++ * COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW block. ++ * ++ * It would seem more obvious to do something like ++ * ++ * #define type_min(T) (T)(is_signed_type(T) ? (T)1 << (8*sizeof(T)-1) : 0) ++ * #define type_max(T) (T)(is_signed_type(T) ? ((T)1 << (8*sizeof(T)-1)) - 1 : ~(T)0) ++ * ++ * Unfortunately, the middle expressions, strictly speaking, have ++ * undefined behaviour, and at least some versions of gcc warn about ++ * the type_max expression (but not if -fsanitize=undefined is in ++ * effect; in that case, the warning is deferred to runtime...). ++ * ++ * The slightly excessive casting in type_min is to make sure the ++ * macros also produce sensible values for the exotic type _Bool. [The ++ * overflow checkers only almost work for _Bool, but that's ++ * a-feature-not-a-bug, since people shouldn't be doing arithmetic on ++ * _Bools. Besides, the gcc builtins don't allow _Bool* as third ++ * argument.] ++ * ++ * Idea stolen from ++ * https://mail-index.netbsd.org/tech-misc/2007/02/05/0000.html - ++ * credit to Christian Biere. ++ */ ++#define is_signed_type(type) (((type)(-1)) < (type)1) ++#define __type_half_max(type) ((type)1 << (8*sizeof(type) - 1 - is_signed_type(type))) ++#define type_max(T) ((T)((__type_half_max(T) - 1) + __type_half_max(T))) ++#define type_min(T) ((T)((T)-type_max(T)-(T)1)) ++ ++ ++#ifdef COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW ++/* ++ * For simplicity and code hygiene, the fallback code below insists on ++ * a, b and *d having the same type (similar to the min() and max() ++ * macros), whereas gcc's type-generic overflow checkers accept ++ * different types. Hence we don't just make check_add_overflow an ++ * alias for __builtin_add_overflow, but add type checks similar to ++ * below. ++ */ ++#define check_add_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ __builtin_add_overflow(__a, __b, __d); \ ++}) ++ ++#define check_sub_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ __builtin_sub_overflow(__a, __b, __d); \ ++}) ++ ++#define check_mul_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ __builtin_mul_overflow(__a, __b, __d); \ ++}) ++ ++#else ++ ++ ++/* Checking for unsigned overflow is relatively easy without causing UB. */ ++#define __unsigned_add_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ *__d = __a + __b; \ ++ *__d < __a; \ ++}) ++#define __unsigned_sub_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ *__d = __a - __b; \ ++ __a < __b; \ ++}) ++/* ++ * If one of a or b is a compile-time constant, this avoids a division. ++ */ ++#define __unsigned_mul_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ *__d = __a * __b; \ ++ __builtin_constant_p(__b) ? \ ++ __b > 0 && __a > type_max(typeof(__a)) / __b : \ ++ __a > 0 && __b > type_max(typeof(__b)) / __a; \ ++}) ++ ++/* ++ * For signed types, detecting overflow is much harder, especially if ++ * we want to avoid UB. But the interface of these macros is such that ++ * we must provide a result in *d, and in fact we must produce the ++ * result promised by gcc's builtins, which is simply the possibly ++ * wrapped-around value. Fortunately, we can just formally do the ++ * operations in the widest relevant unsigned type (u64) and then ++ * truncate the result - gcc is smart enough to generate the same code ++ * with and without the (u64) casts. ++ */ ++ ++/* ++ * Adding two signed integers can overflow only if they have the same ++ * sign, and overflow has happened iff the result has the opposite ++ * sign. ++ */ ++#define __signed_add_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ *__d = (u64)__a + (u64)__b; \ ++ (((~(__a ^ __b)) & (*__d ^ __a)) \ ++ & type_min(typeof(__a))) != 0; \ ++}) ++ ++/* ++ * Subtraction is similar, except that overflow can now happen only ++ * when the signs are opposite. In this case, overflow has happened if ++ * the result has the opposite sign of a. ++ */ ++#define __signed_sub_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ *__d = (u64)__a - (u64)__b; \ ++ ((((__a ^ __b)) & (*__d ^ __a)) \ ++ & type_min(typeof(__a))) != 0; \ ++}) ++ ++/* ++ * Signed multiplication is rather hard. gcc always follows C99, so ++ * division is truncated towards 0. This means that we can write the ++ * overflow check like this: ++ * ++ * (a > 0 && (b > MAX/a || b < MIN/a)) || ++ * (a < -1 && (b > MIN/a || b < MAX/a) || ++ * (a == -1 && b == MIN) ++ * ++ * The redundant casts of -1 are to silence an annoying -Wtype-limits ++ * (included in -Wextra) warning: When the type is u8 or u16, the ++ * __b_c_e in check_mul_overflow obviously selects ++ * __unsigned_mul_overflow, but unfortunately gcc still parses this ++ * code and warns about the limited range of __b. ++ */ ++ ++#define __signed_mul_overflow(a, b, d) ({ \ ++ typeof(a) __a = (a); \ ++ typeof(b) __b = (b); \ ++ typeof(d) __d = (d); \ ++ typeof(a) __tmax = type_max(typeof(a)); \ ++ typeof(a) __tmin = type_min(typeof(a)); \ ++ (void) (&__a == &__b); \ ++ (void) (&__a == __d); \ ++ *__d = (u64)__a * (u64)__b; \ ++ (__b > 0 && (__a > __tmax/__b || __a < __tmin/__b)) || \ ++ (__b < (typeof(__b))-1 && (__a > __tmin/__b || __a < __tmax/__b)) || \ ++ (__b == (typeof(__b))-1 && __a == __tmin); \ ++}) ++ ++ ++#define check_add_overflow(a, b, d) \ ++ __builtin_choose_expr(is_signed_type(typeof(a)), \ ++ __signed_add_overflow(a, b, d), \ ++ __unsigned_add_overflow(a, b, d)) ++ ++#define check_sub_overflow(a, b, d) \ ++ __builtin_choose_expr(is_signed_type(typeof(a)), \ ++ __signed_sub_overflow(a, b, d), \ ++ __unsigned_sub_overflow(a, b, d)) ++ ++#define check_mul_overflow(a, b, d) \ ++ __builtin_choose_expr(is_signed_type(typeof(a)), \ ++ __signed_mul_overflow(a, b, d), \ ++ __unsigned_mul_overflow(a, b, d)) ++ ++ ++#endif /* COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW */ ++ ++/** check_shl_overflow() - Calculate a left-shifted value and check overflow ++ * ++ * @a: Value to be shifted ++ * @s: How many bits left to shift ++ * @d: Pointer to where to store the result ++ * ++ * Computes *@d = (@a << @s) ++ * ++ * Returns true if '*d' cannot hold the result or when 'a << s' doesn't ++ * make sense. Example conditions: ++ * - 'a << s' causes bits to be lost when stored in *d. ++ * - 's' is garbage (e.g. negative) or so large that the result of ++ * 'a << s' is guaranteed to be 0. ++ * - 'a' is negative. ++ * - 'a << s' sets the sign bit, if any, in '*d'. ++ * ++ * '*d' will hold the results of the attempted shift, but is not ++ * considered "safe for use" if false is returned. ++ */ ++#define check_shl_overflow(a, s, d) ({ \ ++ typeof(a) _a = a; \ ++ typeof(s) _s = s; \ ++ typeof(d) _d = d; \ ++ u64 _a_full = _a; \ ++ unsigned int _to_shift = \ ++ _s >= 0 && _s < 8 * sizeof(*d) ? _s : 0; \ ++ *_d = (_a_full << _to_shift); \ ++ (_to_shift != _s || *_d < 0 || _a < 0 || \ ++ (*_d >> _to_shift) != _a); \ ++}) ++ ++/** ++ * array_size() - Calculate size of 2-dimensional array. ++ * ++ * @a: dimension one ++ * @b: dimension two ++ * ++ * Calculates size of 2-dimensional array: @a * @b. ++ * ++ * Returns: number of bytes needed to represent the array or SIZE_MAX on ++ * overflow. ++ */ ++static inline __must_check size_t array_size(size_t a, size_t b) ++{ ++ size_t bytes; ++ ++ if (check_mul_overflow(a, b, &bytes)) ++ return SIZE_MAX; ++ ++ return bytes; ++} ++ ++/** ++ * array3_size() - Calculate size of 3-dimensional array. ++ * ++ * @a: dimension one ++ * @b: dimension two ++ * @c: dimension three ++ * ++ * Calculates size of 3-dimensional array: @a * @b * @c. ++ * ++ * Returns: number of bytes needed to represent the array or SIZE_MAX on ++ * overflow. ++ */ ++static inline __must_check size_t array3_size(size_t a, size_t b, size_t c) ++{ ++ size_t bytes; ++ ++ if (check_mul_overflow(a, b, &bytes)) ++ return SIZE_MAX; ++ if (check_mul_overflow(bytes, c, &bytes)) ++ return SIZE_MAX; ++ ++ return bytes; ++} ++ ++static inline __must_check size_t __ab_c_size(size_t n, size_t size, size_t c) ++{ ++ size_t bytes; ++ ++ if (check_mul_overflow(n, size, &bytes)) ++ return SIZE_MAX; ++ if (check_add_overflow(bytes, c, &bytes)) ++ return SIZE_MAX; ++ ++ return bytes; ++} ++ ++/** ++ * struct_size() - Calculate size of structure with trailing array. ++ * @p: Pointer to the structure. ++ * @member: Name of the array member. ++ * @n: Number of elements in the array. ++ * ++ * Calculates size of memory needed for structure @p followed by an ++ * array of @n @member elements. ++ * ++ * Return: number of bytes needed or SIZE_MAX on overflow. ++ */ ++#define struct_size(p, member, n) \ ++ __ab_c_size(n, \ ++ sizeof(*(p)->member) + __must_be_array((p)->member),\ ++ sizeof(*(p))) ++ ++#endif /* __LINUX_OVERFLOW_H */ From e4b0704a519169385b4e38391b6e952faa79c5be Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 9 Nov 2018 15:20:21 +0100 Subject: [PATCH 077/399] mac80211: backport firmware_request_nowarn and firmware_request_cache Required for an mt76 update to the latest version from master Signed-off-by: Felix Fietkau --- ...013-backport-firmware_request_nowarn.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 package/kernel/mac80211/patches/013-backport-firmware_request_nowarn.patch diff --git a/package/kernel/mac80211/patches/013-backport-firmware_request_nowarn.patch b/package/kernel/mac80211/patches/013-backport-firmware_request_nowarn.patch new file mode 100644 index 00000000000..f71e40bf104 --- /dev/null +++ b/package/kernel/mac80211/patches/013-backport-firmware_request_nowarn.patch @@ -0,0 +1,19 @@ +--- a/backport-include/linux/firmware.h ++++ b/backport-include/linux/firmware.h +@@ -5,5 +5,16 @@ + #if LINUX_VERSION_IS_LESS(3,14,0) + #define request_firmware_direct(fw, name, device) request_firmware(fw, name, device) + #endif ++#if LINUX_VERSION_IS_LESS(4,18,0) ++#define firmware_request_nowarn(fw, name, device) request_firmware(fw, name, device) ++#endif ++ ++#if LINUX_VERSION_IS_LESS(4,17,0) ++#define firmware_request_cache LINUX_BACKPORT(firmware_request_cache) ++static inline int firmware_request_cache(struct device *device, const char *name) ++{ ++ return 0; ++} ++#endif + + #endif /* __BACKPORT_LINUX_FIRMWARE_H */ From 33731ccff36a8ccb95871bf92457d492190b649d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 9 Nov 2018 22:28:31 +0100 Subject: [PATCH 078/399] bcm53xx: add DT patch describing pins mux controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's needed to support new devices that use specific pin functions. Signed-off-by: Rafał Miłecki (cherry picked from commit 0cf32de17c47c7625c7ee9cc7d21c3489d86311b) --- ...-Describe-Northstar-pins-mux-control.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch diff --git a/target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch b/target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch new file mode 100644 index 00000000000..7b2904acbcc --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch @@ -0,0 +1,73 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Fri, 9 Nov 2018 09:53:56 +0100 +Subject: [PATCH] ARM: dts: BCM5301X: Describe Northstar pins mux controller +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This describes hardware & will allow referencing pin functions. The +first usage is UART1 which allows supporting devices using it. + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -37,6 +37,8 @@ + reg = <0x0400 0x100>; + interrupts = ; + clocks = <&iprocslow>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinmux_uart1>; + status = "disabled"; + }; + }; +@@ -391,6 +393,48 @@ + status = "disabled"; + }; + ++ dmu@1800c000 { ++ compatible = "simple-bus"; ++ ranges = <0 0x1800c000 0x1000>; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ cru@100 { ++ compatible = "simple-bus"; ++ reg = <0x100 0x1a4>; ++ ranges; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ ++ pin-controller@1c0 { ++ compatible = "brcm,bcm4708-pinmux"; ++ reg = <0x1c0 0x24>; ++ reg-names = "cru_gpio_control"; ++ ++ spi-pins { ++ groups = "spi_grp"; ++ function = "spi"; ++ }; ++ ++ i2c { ++ groups = "i2c_grp"; ++ function = "i2c"; ++ }; ++ ++ pwm { ++ groups = "pwm0_grp", "pwm1_grp", ++ "pwm2_grp", "pwm3_grp"; ++ function = "pwm"; ++ }; ++ ++ pinmux_uart1: uart1 { ++ groups = "uart1_grp"; ++ function = "uart1"; ++ }; ++ }; ++ }; ++ }; ++ + lcpll0: lcpll0@1800c100 { + #clock-cells = <1>; + compatible = "brcm,nsp-lcpll0"; From f2a6d39b95b279a50db834cfe6d7fc9396be1c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Fri, 9 Nov 2018 23:01:11 +0100 Subject: [PATCH 079/399] mac80211: brcmfmac: add 2 more recent changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit First one is a fix for reporting channels to the user space. Important for users as they could try setting invalid channel and fail to start an interface. Later is a support for newer FullMAC chipset firmwares. Signed-off-by: Rafał Miłecki --- ...porting-support-for-160-MHz-channels.patch | 34 ++++++++ ...rint-invalid-chanspec-when-WARN-ing.patch} | 0 ...-brcmfmac-support-STA-info-struct-v7.patch | 78 +++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 package/kernel/mac80211/patches/349-v4.20-brcmfmac-fix-reporting-support-for-160-MHz-channels.patch rename package/kernel/mac80211/patches/{349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch => 380-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch} (100%) create mode 100644 package/kernel/mac80211/patches/381-v4.21-0001-brcmfmac-support-STA-info-struct-v7.patch diff --git a/package/kernel/mac80211/patches/349-v4.20-brcmfmac-fix-reporting-support-for-160-MHz-channels.patch b/package/kernel/mac80211/patches/349-v4.20-brcmfmac-fix-reporting-support-for-160-MHz-channels.patch new file mode 100644 index 00000000000..699ea6e481e --- /dev/null +++ b/package/kernel/mac80211/patches/349-v4.20-brcmfmac-fix-reporting-support-for-160-MHz-channels.patch @@ -0,0 +1,34 @@ +From 8eefb59de817125eeedde2a2cc1e4ac3660062f9 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 8 Nov 2018 16:08:29 +0100 +Subject: [PATCH] brcmfmac: fix reporting support for 160 MHz channels +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Driver can report IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ so it's +important to provide valid & complete info about supported bands for +each channel. By default no support for 160 MHz should be assumed unless +firmware reports it for a given channel later. + +This fixes info passed to the userspace. Without that change userspace +could try to use invalid channel and fail to start an interface. + +Signed-off-by: Rafał Miłecki +Cc: stable@vger.kernel.org +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +@@ -5992,7 +5992,8 @@ static int brcmf_construct_chaninfo(stru + * for subsequent chanspecs. + */ + channel->flags = IEEE80211_CHAN_NO_HT40 | +- IEEE80211_CHAN_NO_80MHZ; ++ IEEE80211_CHAN_NO_80MHZ | ++ IEEE80211_CHAN_NO_160MHZ; + ch.bw = BRCMU_CHAN_BW_20; + cfg->d11inf.encchspec(&ch); + chaninfo = ch.chspec; diff --git a/package/kernel/mac80211/patches/349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch b/package/kernel/mac80211/patches/380-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch similarity index 100% rename from package/kernel/mac80211/patches/349-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch rename to package/kernel/mac80211/patches/380-v4.21-0001-brcmutil-print-invalid-chanspec-when-WARN-ing.patch diff --git a/package/kernel/mac80211/patches/381-v4.21-0001-brcmfmac-support-STA-info-struct-v7.patch b/package/kernel/mac80211/patches/381-v4.21-0001-brcmfmac-support-STA-info-struct-v7.patch new file mode 100644 index 00000000000..271994dae67 --- /dev/null +++ b/package/kernel/mac80211/patches/381-v4.21-0001-brcmfmac-support-STA-info-struct-v7.patch @@ -0,0 +1,78 @@ +From a4dad0334732f62c67058037d9edb17945bec598 Mon Sep 17 00:00:00 2001 +From: Dan Haab +Date: Fri, 9 Nov 2018 09:38:55 -0700 +Subject: [PATCH] brcmfmac: support STA info struct v7 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The newest firmwares provide STA info using v7 of the struct. As v7 +isn't backward compatible, a union is needed. + +Even though brcmfmac does not use any of the new info it's important to +provide the proper struct buffer. Without this change new firmwares will +fallback to the very limited v3 instead of something in between such as +v4. + +Signed-off-by: Dan Haab +Reviewed-by: Rafał Miłecki +--- + .../broadcom/brcm80211/brcmfmac/fwil_types.h | 40 ++++++++++++++++++---- + 1 file changed, 33 insertions(+), 7 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +@@ -176,6 +176,8 @@ + + #define BRCMF_VHT_CAP_MCS_MAP_NSS_MAX 8 + ++#define BRCMF_HE_CAP_MCS_MAP_NSS_MAX 8 ++ + /* MAX_CHUNK_LEN is the maximum length for data passing to firmware in each + * ioctl. It is relatively small because firmware has small maximum size input + * playload restriction for ioctls. +@@ -601,13 +603,37 @@ struct brcmf_sta_info_le { + __le32 rx_pkts_retried; /* # rx with retry bit set */ + __le32 tx_rate_fallback; /* lowest fallback TX rate */ + +- /* Fields valid for ver >= 5 */ +- struct { +- __le32 count; /* # rates in this set */ +- u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */ +- u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */ +- __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */ +- } rateset_adv; ++ union { ++ struct { ++ struct { ++ __le32 count; /* # rates in this set */ ++ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */ ++ u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */ ++ __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */ ++ } rateset_adv; ++ } v5; ++ ++ struct { ++ __le32 rx_dur_total; /* total user RX duration (estimated) */ ++ __le16 chanspec; /** chanspec this sta is on */ ++ __le16 pad_1; ++ struct { ++ __le16 version; /* version */ ++ __le16 len; /* length */ ++ __le32 count; /* # rates in this set */ ++ u8 rates[BRCMF_MAXRATES_IN_SET]; /* rates in 500kbps units w/hi bit set if basic */ ++ u8 mcs[BRCMF_MCSSET_LEN]; /* supported mcs index bit map */ ++ __le16 vht_mcs[BRCMF_VHT_CAP_MCS_MAP_NSS_MAX]; /* supported mcs index bit map per nss */ ++ __le16 he_mcs[BRCMF_HE_CAP_MCS_MAP_NSS_MAX]; /* supported he mcs index bit map per nss */ ++ } rateset_adv; /* rateset along with mcs index bitmap */ ++ __le16 wpauth; /* authentication type */ ++ u8 algo; /* crypto algorithm */ ++ u8 pad_2; ++ __le32 tx_rspec; /* Rate of last successful tx frame */ ++ __le32 rx_rspec; /* Rate of last successful rx frame */ ++ __le32 wnm_cap; /* wnm capabilities */ ++ } v7; ++ }; + }; + + struct brcmf_chanspec_list { From 4f40d4ca73a6da3c88804c46f8c7ab0096cdabf1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 4 Nov 2018 18:22:33 +0100 Subject: [PATCH 080/399] oxnas: squash-pick commits from master branch 4f017c871d oxnas: switch to generic board detect ef9b169df0 oxnas: remove stray kernel config symbols cf7896117b oxnas: enable image metadata by setting SUPPORTED_DEVICES 9bcc08958b oxnas: add console=ttyS0,115200 argument to bootargs b831eb5363 oxnas: kd20: correct memory size to 256MB 217fe505b6 oxnas: remove superseded sysupgrade image check Signed-off-by: Daniel Golle --- .../oxnas/base-files/etc/board.d/01_leds | 8 +-- .../oxnas/base-files/etc/board.d/02_network | 27 +++++++- target/linux/oxnas/base-files/etc/diag.sh | 8 +-- target/linux/oxnas/base-files/lib/oxnas.sh | 66 ------------------- .../lib/preinit/01_preinit_do_oxnas.sh | 9 --- .../oxnas/base-files/lib/upgrade/platform.sh | 11 +--- target/linux/oxnas/config-4.14 | 10 --- .../arm/boot/dts/ox820-akitio-mycloud.dts | 2 +- .../dts/ox820-cloudengines-pogoplug-pro.dts | 2 +- .../arm/boot/dts/ox820-mitrastar-stg212.dts | 2 +- .../arch/arm/boot/dts/ox820-shuttle-kd20.dts | 6 +- target/linux/oxnas/image/ox820.mk | 5 ++ ...0-add-console-to-pogoplogv3-bootargs.patch | 11 ++++ 13 files changed, 56 insertions(+), 111 deletions(-) delete mode 100755 target/linux/oxnas/base-files/lib/oxnas.sh delete mode 100644 target/linux/oxnas/base-files/lib/preinit/01_preinit_do_oxnas.sh create mode 100644 target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch diff --git a/target/linux/oxnas/base-files/etc/board.d/01_leds b/target/linux/oxnas/base-files/etc/board.d/01_leds index 5d665093f67..66a24e108d9 100755 --- a/target/linux/oxnas/base-files/etc/board.d/01_leds +++ b/target/linux/oxnas/base-files/etc/board.d/01_leds @@ -6,17 +6,17 @@ board=$(board_name) board_config_update case $board in - akitio) + "akitio,myloud") ucidef_set_led_default "status" "status" "akitio:red:status" "0" ;; - stg212) + "mitrastar,stg-212") ucidef_set_led_default "power" "power" "zyxel:blue:status" "1" ucidef_set_led_usbdev "usb" "USB" "zyxel:orange:copy" "1-1" ;; - kd20) + "shuttle,kd20") ucidef_set_led_default "power" "power" "kd20:blue:status" "1" ;; - pogoplug-pro | pogoplug-v3) + "cloudengines,pogoplug"*) ucidef_set_led_default "power" "power" "pogoplug:blue:internal" "1" ;; diff --git a/target/linux/oxnas/base-files/etc/board.d/02_network b/target/linux/oxnas/base-files/etc/board.d/02_network index 7ecaed51bfe..7b657cd108c 100755 --- a/target/linux/oxnas/base-files/etc/board.d/02_network +++ b/target/linux/oxnas/base-files/etc/board.d/02_network @@ -2,14 +2,37 @@ . /lib/functions/uci-defaults.sh . /lib/functions/system.sh -. /lib/oxnas.sh board_config_update lan_mac="" +bootloader_cmdline_var() { + local param + local pval + for arg in $(cat /proc/device-tree/chosen/bootloader-args); do + param="$(echo $arg | cut -d'=' -f 1)" + pval="$(echo $arg | cut -d'=' -f 2-)" + + if [ "$param" = "$1" ]; then + echo "$pval" + fi + done +} + +legacy_boot_mac_adr() { + local macstr + local oIFS + macstr="$(bootloader_cmdline_var mac_adr)" + oIFS="$IFS" + IFS="," + set -- $macstr + printf "%02x:%02x:%02x:%02x:%02x:%02x" $1 $2 $3 $4 $5 $6 + IFS="$oIFS" +} + case "$(board_name)" in - kd20) + "shuttle,kd20") lan_mac="$(legacy_boot_mac_adr)" ;; esac diff --git a/target/linux/oxnas/base-files/etc/diag.sh b/target/linux/oxnas/base-files/etc/diag.sh index fd3bc3b3366..b8a51c2769c 100644 --- a/target/linux/oxnas/base-files/etc/diag.sh +++ b/target/linux/oxnas/base-files/etc/diag.sh @@ -6,16 +6,16 @@ get_status_led() { case $(board_name) in - akitio) + "akitio,mycloud") status_led="akitio:red:status" ;; - stg212) + "mitrastar,stg-212") status_led="zyxel:blue:status" ;; - kd20) + "shuttle,kd20") status_led="kd20:blue:status" ;; - pogoplug-pro | pogoplug-v3) + "cloudengines,pogoplug"*) status_led="pogoplug:blue:internal" ;; esac diff --git a/target/linux/oxnas/base-files/lib/oxnas.sh b/target/linux/oxnas/base-files/lib/oxnas.sh deleted file mode 100755 index 671dd05fa25..00000000000 --- a/target/linux/oxnas/base-files/lib/oxnas.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 OpenWrt.org -# - -OXNAS_BOARD_NAME= -OXNAS_MODEL= - -bootloader_cmdline_var() { - local param - local pval - for arg in $(cat /proc/device-tree/chosen/bootloader-args); do - param="$(echo $arg | cut -d'=' -f 1)" - pval="$(echo $arg | cut -d'=' -f 2-)" - - if [ "$param" = "$1" ]; then - echo "$pval" - fi - done -} - -legacy_boot_mac_adr() { - local macstr - local oIFS - macstr="$(bootloader_cmdline_var mac_adr)" - oIFS="$IFS" - IFS="," - set -- $macstr - printf "%02x:%02x:%02x:%02x:%02x:%02x" $1 $2 $3 $4 $5 $6 - IFS="$oIFS" -} - -oxnas_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - *"Akitio MyCloud mini"*) - name="akitio" - ;; - *"MitraStar Technology Corp. STG-212"*) - name="stg212" - ;; - *"Shuttle KD20"*) - name="kd20" - ;; - *"Pogoplug Pro"*) - name="pogoplug-pro" - ;; - *"Pogoplug V3"*) - name="pogoplug-v3" - ;; - esac - - [ -z "$name" ] && name="unknown" - - [ -z "$OXNAS_BOARD_NAME" ] && OXNAS_BOARD_NAME="$name" - [ -z "$OXNAS_MODEL" ] && OXNAS_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$OXNAS_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$OXNAS_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/oxnas/base-files/lib/preinit/01_preinit_do_oxnas.sh b/target/linux/oxnas/base-files/lib/preinit/01_preinit_do_oxnas.sh deleted file mode 100644 index ca7bce10542..00000000000 --- a/target/linux/oxnas/base-files/lib/preinit/01_preinit_do_oxnas.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_oxnas() { - . /lib/oxnas.sh - - oxnas_board_detect -} - -boot_hook_add preinit_main do_oxnas diff --git a/target/linux/oxnas/base-files/lib/upgrade/platform.sh b/target/linux/oxnas/base-files/lib/upgrade/platform.sh index 059d75f9a90..9e8a94b5014 100644 --- a/target/linux/oxnas/base-files/lib/upgrade/platform.sh +++ b/target/linux/oxnas/base-files/lib/upgrade/platform.sh @@ -1,16 +1,7 @@ -# -# Copyright (C) 2014 OpenWrt.org -# - REQUIRE_IMAGE_METADATA=1 platform_check_image() { - local board=$(board_name) - - [ "$ARGC" -gt 1 ] && return 1 - - nand_do_platform_check $board $1 - return $? + return 0 } platform_do_upgrade() { diff --git a/target/linux/oxnas/config-4.14 b/target/linux/oxnas/config-4.14 index 56b54dd59d6..49201b6875d 100644 --- a/target/linux/oxnas/config-4.14 +++ b/target/linux/oxnas/config-4.14 @@ -80,16 +80,6 @@ CONFIG_CRC16=y # CONFIG_CRC32_SARWATE is not set CONFIG_CRC32_SLICEBY8=y CONFIG_CROSS_MEMORY_ATTACH=y -CONFIG_CRYPTO_ACOMP2=y -# CONFIG_CRYPTO_ARC4 is not set -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_DEFLATE=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_LZO=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DEBUG_ALIGN_RODATA=y CONFIG_DEBUG_BUGVERBOSE=y # CONFIG_DEBUG_USER is not set diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio-mycloud.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio-mycloud.dts index c0bf34c3f40..90ea15d400a 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio-mycloud.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-akitio-mycloud.dts @@ -10,7 +10,7 @@ compatible = "akitio,mycloud", "oxsemi,ox820"; chosen { - bootargs = "earlyprintk"; + bootargs = "earlyprintk console=ttyS0,115200"; stdout-path = "serial0:115200n8"; }; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-cloudengines-pogoplug-pro.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-cloudengines-pogoplug-pro.dts index 363fd30d203..2872d40e3d4 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-cloudengines-pogoplug-pro.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-cloudengines-pogoplug-pro.dts @@ -15,7 +15,7 @@ compatible = "cloudengines,pogoplugpro", "oxsemi,ox820"; chosen { - bootargs = "earlyprintk"; + bootargs = "earlyprintk console=ttyS0,115200"; stdout-path = "serial0:115200n8"; }; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-mitrastar-stg212.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-mitrastar-stg212.dts index 834ea77653d..cc8d640ee0a 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-mitrastar-stg212.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-mitrastar-stg212.dts @@ -10,7 +10,7 @@ compatible = "mitrastar,stg-212", "oxsemi,ox820"; chosen { - bootargs = "earlyprintk"; + bootargs = "earlyprintk console=ttyS0,115200"; stdout-path = "serial0:115200n8"; }; diff --git a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts index badfa2578e3..9186d085855 100644 --- a/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts +++ b/target/linux/oxnas/files/arch/arm/boot/dts/ox820-shuttle-kd20.dts @@ -10,13 +10,13 @@ compatible = "shuttle,kd20", "oxsemi,ox820"; chosen { - bootargs = "earlyprintk"; + bootargs = "earlyprintk console=ttyS0,115200"; stdout-path = "serial0:115200n8"; }; memory { - /* 128Mbytes DDR */ - reg = <0x60000000 0x8000000>; + /* 256Mbytes DDR */ + reg = <0x60000000 0x10000000>; }; aliases { diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk index 9d41270a37d..60f85d11da5 100644 --- a/target/linux/oxnas/image/ox820.mk +++ b/target/linux/oxnas/image/ox820.mk @@ -39,6 +39,7 @@ endef define Device/akitio-mycloud DEVICE_DTS := ox820-akitio-mycloud DEVICE_TITLE := Akition myCloud (mini) / SilverStone DC01 + SUPPORTED_DEVICES := akitio,mycloud akitio DEVICE_PACKAGES := kmod-usb2-oxnas kmod-ata-oxnas-sata kmod-ledtrig-usbdev \ kmod-i2c-gpio kmod-rtc-ds1307 endef @@ -47,6 +48,7 @@ TARGET_DEVICES += akitio-mycloud define Device/cloudengines-pogoplug-pro DEVICE_DTS := ox820-cloudengines-pogoplug-pro DEVICE_TITLE := Cloud Engines PogoPlug Pro (with mPCIe) + SUPPORTED_DEVICES := cloudengines,pogoplugpro pogoplug-pro DEVICE_PACKAGES := kmod-usb2-oxnas kmod-ledtrig-usbdev endef TARGET_DEVICES += cloudengines-pogoplug-pro @@ -54,6 +56,7 @@ TARGET_DEVICES += cloudengines-pogoplug-pro define Device/cloudengines-pogoplug-series-3 DEVICE_DTS := ox820-cloudengines-pogoplug-series-3 DEVICE_TITLE := Cloud Engines PogoPlug Series V3 (without mPCIe) + SUPPORTED_DEVICES := cloudengines,pogoplugv3 pogoplug-v3 DEVICE_PACKAGES := kmod-usb2-oxnas kmod-ledtrig-usbdev endef TARGET_DEVICES += cloudengines-pogoplug-series-3 @@ -61,6 +64,7 @@ TARGET_DEVICES += cloudengines-pogoplug-series-3 define Device/shuttle-kd20 DEVICE_DTS := ox820-shuttle-kd20 DEVICE_TITLE := Shuttle KD20 + SUPPORTED_DEVICES := shuttle,kd20 kd20 KERNEL := kernel-bin | append-dtb | uImage none KERNEL_INITRAMFS_PREFIX = $$(IMAGE_PREFIX)-factory KERNEL_INITRAMFS_SUFFIX := .tar.gz @@ -75,6 +79,7 @@ TARGET_DEVICES += shuttle-kd20 define Device/mitrastar-stg212 DEVICE_DTS := ox820-mitrastar-stg212 DEVICE_TITLE := MitraStar STG-212 + SUPPORTED_DEVICES := mitrastar,stg-212 stg212 KERNEL := kernel-bin | append-dtb | uImage none DEVICE_PACKAGES := kmod-usb2-oxnas kmod-ata-oxnas-sata kmod-ledtrig-usbdev endef diff --git a/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch b/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch new file mode 100644 index 00000000000..56e0eaf19cf --- /dev/null +++ b/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts 2018-08-14 18:03:56.542679083 +0200 ++++ b/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts 2018-11-04 18:19:35.154886643 +0100 +@@ -15,7 +15,7 @@ + compatible = "cloudengines,pogoplugv3", "oxsemi,ox820"; + + chosen { +- bootargs = "earlyprintk"; ++ bootargs = "earlyprintk console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + From 514ad059ef40b747c93c363403cb49b45dd86e41 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 13 Nov 2018 00:58:21 +0100 Subject: [PATCH 081/399] mt76: update to the latest version, sync with master - adds new drivers for mt76x2u, mt76x0u and mt76x0e - adds back fixed version of the tx status fixes - improves mt7603e stability Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 157 ++++++++++++++++++++++++++++++++--- 1 file changed, 147 insertions(+), 10 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 0a38a22c182..47134599726 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -1,20 +1,30 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mt76 -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-01 -PKG_SOURCE_VERSION:=53e1110a354576210b60012cccd5d77af219c60d -PKG_MIRROR_HASH:=2ecc38b502b8875231a5b68d7fa244a89cc27a062cc189d81ab91970d827f05a +PKG_SOURCE_DATE:=2018-11-09 +PKG_SOURCE_VERSION:=ffccb48c5082b2c6f43a0235b77b62ca388810f0 +PKG_MIRROR_HASH:=bff0063db1a1b1353f59aad16abad4dd93ceeb4c672811ad864cebe0e39c7d8d PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 +PKG_CONFIG_DEPENDS += \ + CONFIG_PACKAGE_kmod-mt76-usb \ + CONFIG_PACKAGE_kmod-mt76x02-common \ + CONFIG_PACKAGE_kmod-mt76x0-common \ + CONFIG_PACKAGE_kmod-mt76x0u \ + CONFIG_PACKAGE_kmod-mt76x2-common \ + CONFIG_PACKAGE_kmod-mt76x2 \ + CONFIG_PACKAGE_kmod-mt76x2u \ + CONFIG_PACKAGE_kmod-mt7603 + STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h include $(INCLUDE_DIR)/kernel.mk @@ -23,7 +33,7 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/mt76-default SUBMENU:=Wireless Drivers DEPENDS:= \ - +kmod-mac80211 @PCI_SUPPORT @!LINUX_3_18 \ + +kmod-mac80211 @!LINUX_3_18 \ +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT endef @@ -37,25 +47,94 @@ endef define KernelPackage/mt76-core $(KernelPackage/mt76-default) TITLE:=MediaTek MT76xx wireless driver + HIDDEN:=1 FILES:=\ $(PKG_BUILD_DIR)/mt76.ko endef +define KernelPackage/mt76-usb + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76xx wireless driver USB support + DEPENDS += +kmod-usb-core +kmod-mt76-core + HIDDEN:=1 + FILES:=\ + $(PKG_BUILD_DIR)/mt76-usb.ko +endef + +define KernelPackage/mt76x02-usb + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x0/MT76x2 USB wireless driver common code + DEPENDS+=+kmod-mt76-usb +kmod-mt76x02-common + HIDDEN:=1 + FILES:=$(PKG_BUILD_DIR)/mt76x02-usb.ko +endef + +define KernelPackage/mt76x02-common + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x0/MT76x2 wireless driver common code + DEPENDS+=+kmod-mt76-core + HIDDEN:=1 + FILES:=$(PKG_BUILD_DIR)/mt76x02-lib.ko +endef + +define KernelPackage/mt76x0-common + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x0 wireless driver common code + DEPENDS+=+kmod-mt76x02-common +kmod-mt76x02-usb + HIDDEN:=1 + FILES:=$(PKG_BUILD_DIR)/mt76x0/mt76x0-common.ko +endef + +define KernelPackage/mt76x0e + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x0E wireless driver + DEPENDS+=@PCI_SUPPORT +kmod-mt76x0-common + FILES:=\ + $(PKG_BUILD_DIR)/mt76x0/mt76x0e.ko + AUTOLOAD:=$(call AutoProbe,mt76x0e) +endef + +define KernelPackage/mt76x0u + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x0U wireless driver + DEPENDS+=+kmod-mt76x0-common +kmod-mt76x02-usb + FILES:=\ + $(PKG_BUILD_DIR)/mt76x0/mt76x0u.ko + AUTOLOAD:=$(call AutoProbe,mt76x0u) +endef + +define KernelPackage/mt76x2-common + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x2 wireless driver common code + DEPENDS+=+kmod-mt76-core +kmod-mt76x02-common + HIDDEN:=1 + FILES:=$(PKG_BUILD_DIR)/mt76x2/mt76x2-common.ko +endef + +define KernelPackage/mt76x2u + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT76x2U wireless driver + DEPENDS+=+kmod-mt76x2-common +kmod-mt76x02-usb + FILES:=\ + $(PKG_BUILD_DIR)/mt76x2/mt76x2u.ko + AUTOLOAD:=$(call AutoProbe,mt76x2u) +endef + define KernelPackage/mt76x2 $(KernelPackage/mt76-default) TITLE:=MediaTek MT76x2 wireless driver - DEPENDS+=+kmod-mt76-core + DEPENDS+=@PCI_SUPPORT +kmod-mt76x2-common FILES:=\ - $(PKG_BUILD_DIR)/mt76x2e.ko + $(PKG_BUILD_DIR)/mt76x2/mt76x2e.ko AUTOLOAD:=$(call AutoProbe,mt76x2e) endef define KernelPackage/mt7603 $(KernelPackage/mt76-default) TITLE:=MediaTek MT7603 wireless driver - DEPENDS+=+kmod-mt76-core + DEPENDS+=@PCI_SUPPORT +kmod-mt76-core FILES:=\ - $(PKG_BUILD_DIR)/mt7603e.ko + $(PKG_BUILD_DIR)/mt7603/mt7603e.ko AUTOLOAD:=$(call AutoProbe,mt7603e) endef @@ -72,9 +151,41 @@ ifdef CONFIG_PACKAGE_MAC80211_MESH NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH endif +ifdef CONFIG_PACKAGE_kmod-mt76-usb + PKG_MAKE_FLAGS += CONFIG_MT76_USB=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x02-common + PKG_MAKE_FLAGS += CONFIG_MT76x02_LIB=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x02-usb + PKG_MAKE_FLAGS += CONFIG_MT76x02_USB=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x0-common + PKG_MAKE_FLAGS += CONFIG_MT76x0_COMMON=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x0e + PKG_MAKE_FLAGS += CONFIG_MT76x0E=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x0u + PKG_MAKE_FLAGS += CONFIG_MT76x0U=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x2-common + PKG_MAKE_FLAGS += CONFIG_MT76x2_COMMON=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x2 + PKG_MAKE_FLAGS += CONFIG_MT76x2E=m +endif +ifdef CONFIG_PACKAGE_kmod-mt76x2u + PKG_MAKE_FLAGS += CONFIG_MT76x2U=m +endif +ifdef CONFIG_PACKAGE_kmod-mt7603 + PKG_MAKE_FLAGS += CONFIG_MT7603E=m +endif + define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ $(KERNEL_MAKE_FLAGS) \ + $(PKG_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules @@ -84,7 +195,14 @@ define Package/kmod-mt76/install true endef -define KernelPackage/mt76x2/install +define KernelPackage/mt76x0-common/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek + cp \ + $(PKG_BUILD_DIR)/firmware/mt7610e.bin \ + $(1)/lib/firmware/mediatek +endef + +define KernelPackage/mt76x2-common/install $(INSTALL_DIR) $(1)/lib/firmware cp \ $(PKG_BUILD_DIR)/firmware/mt7662_rom_patch.bin \ @@ -92,6 +210,17 @@ define KernelPackage/mt76x2/install $(1)/lib/firmware endef +define KernelPackage/mt76x0u/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek + ln -sf mt7610e.bin $(1)/lib/firmware/mediatek/mt7610u.bin +endef + +define KernelPackage/mt76x2u/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek + ln -sf ../mt7662.bin $(1)/lib/firmware/mediatek/mt7662u.bin + ln -sf ../mt7662_rom_patch.bin $(1)/lib/firmware/mediatek/mt7662u_rom_patch.bin +endef + define KernelPackage/mt7603/install $(INSTALL_DIR) $(1)/lib/firmware cp $(if $(CONFIG_TARGET_ramips_mt76x8), \ @@ -105,6 +234,14 @@ define KernelPackage/mt7603/install endef $(eval $(call KernelPackage,mt76-core)) +$(eval $(call KernelPackage,mt76-usb)) +$(eval $(call KernelPackage,mt76x02-usb)) +$(eval $(call KernelPackage,mt76x02-common)) +$(eval $(call KernelPackage,mt76x0-common)) +$(eval $(call KernelPackage,mt76x0e)) +$(eval $(call KernelPackage,mt76x0u)) +$(eval $(call KernelPackage,mt76x2-common)) +$(eval $(call KernelPackage,mt76x2u)) $(eval $(call KernelPackage,mt76x2)) $(eval $(call KernelPackage,mt7603)) $(eval $(call KernelPackage,mt76)) From 76574f19e2c660f7a312e1e6d7fcd21daf3afb33 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 19 Jul 2018 20:07:38 +0300 Subject: [PATCH 082/399] tcpdump: explicitly disable libcap-ng support If libcap-ng is detected during tcpdump build, support for it is enabled and the binary is linked against it. Explicitly disable libcap-ng support to avoid build failing due to a missing depndency. Signed-off-by: Stijn Tintel --- package/network/utils/tcpdump/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index 50919819b63..712617fd25f 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -47,6 +47,7 @@ define Package/tcpdump-mini endef CONFIGURE_ARGS += \ + --without-cap-ng \ --without-crypto ifeq ($(CONFIG_IPV6),y) From eb89dcaf4a09bcd1fc89335dc7e3dae8c92f3603 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 12 Nov 2018 19:58:36 +0200 Subject: [PATCH 083/399] kernel: bump 4.14 to 4.14.80 Refresh patches. Compile-tested: cns3xxx, imx6, x86/64 Runtime-tested: cns3xxx, imx6, x86/64 Signed-off-by: Stijn Tintel Tested-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 320ecd5ce63..d5179572956 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .135 -LINUX_VERSION-4.14 = .79 +LINUX_VERSION-4.14 = .80 LINUX_KERNEL_HASH-4.9.135 = e023b0bbe9ea7fc56aa57210342dd18ea3e0900ee207226df1523c6d7df154ce -LINUX_KERNEL_HASH-4.14.79 = 5619071eceb27f903d2fce1784223796bfbe25528f9690273cdfe82fdd9b933a +LINUX_KERNEL_HASH-4.14.80 = 9ddc7bc11cbea6475ac5abf18e01a143d7d506bece591e0dcb15c9452d3ed7d2 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index c2e6d0990e7..4201ab17442 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -1923,7 +1923,8 @@ static const struct usb_device_id option +@@ -1927,7 +1927,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, From 9d07678d359e05866abf8a69972ad8ae41ff62d2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 13 Nov 2018 20:34:35 +0100 Subject: [PATCH 084/399] mac80211: fix spurious disconnections with powersave clients Affects all drivers using ieee80211_tx_status_noskb, e.g. ath9k and mt76 Signed-off-by: Felix Fietkau --- ...tx-status-for-PS-stations-in-ieee802.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 package/kernel/mac80211/patches/397-mac80211-ignore-tx-status-for-PS-stations-in-ieee802.patch diff --git a/package/kernel/mac80211/patches/397-mac80211-ignore-tx-status-for-PS-stations-in-ieee802.patch b/package/kernel/mac80211/patches/397-mac80211-ignore-tx-status-for-PS-stations-in-ieee802.patch new file mode 100644 index 00000000000..0269da126d2 --- /dev/null +++ b/package/kernel/mac80211/patches/397-mac80211-ignore-tx-status-for-PS-stations-in-ieee802.patch @@ -0,0 +1,26 @@ +From: Felix Fietkau +Date: Tue, 13 Nov 2018 20:29:03 +0100 +Subject: [PATCH] mac80211: ignore tx status for PS stations in + ieee80211_tx_status_ext + +Make it behave like regular ieee80211_tx_status calls, except for the lack of +filtered frame processing. +This fixes spurious low-ack triggered disconnections with powersave clients +connected to an AP. + +Fixes: f027c2aca0cf4 ("mac80211: add ieee80211_tx_status_noskb") +Cc: stable@vger.kernel.org +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -976,6 +976,8 @@ void ieee80211_tx_status_ext(struct ieee + /* Track when last TDLS packet was ACKed */ + if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH)) + sta->status_stats.last_tdls_pkt_time = jiffies; ++ } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { ++ return; + } else { + ieee80211_lost_packet(sta, info); + } From b0d08ec3aef3cc4fb105f1d65681907ebef9be0f Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 14 Nov 2018 12:30:43 +0100 Subject: [PATCH 085/399] sunxi: remove kernel 4.9 support This target has been on 4.14 for a long time now. Remove these leftovers as it interferes with kernel bumping. Signed-off-by: Koen Vandeputte --- target/linux/sunxi/config-4.9 | 573 -- ...xi-ng-Rename-the-internal-structures.patch | 239 - ...ove-the-use-of-rational-computations.patch | 239 - ...ish-to-convert-to-structures-for-arg.patch | 182 - ...-minimums-for-all-the-relevant-struc.patch | 256 - ...ng-Implement-minimum-for-multipliers.patch | 132 - .../0007-clk-sunxi-ng-Add-A64-clocks.patch | 1295 ---- ...rm64-dts-add-Allwinner-A64-SoC-.dtsi.patch | 311 - .../0011-arm64-dts-add-Pine64-support.patch | 176 - ...ild-errors-from-missing-dependencies.patch | 134 - ...ner-add-USB1-related-nodes-of-Allwin.patch | 84 - ...ner-sort-the-nodes-in-sun50i-a64-pin.patch | 40 - ...ner-enable-EHCI1-OHCI1-and-USB-PHY-n.patch | 47 - ...-add-MUSB-node-to-Allwinner-A64-dtsi.patch | 42 - ...-the-MUSB-controller-of-Pine64-in-ho.patch | 32 - ...ner-Remove-no-longer-used-pinctrl-su.patch | 31 - ...19-arm64-allwinner-a64-Add-MMC-nodes.patch | 69 - ...-allwinner-a64-Add-MMC-pinctrl-nodes.patch | 50 - ...m64-allwinner-pine64-add-MMC-support.patch | 62 - ...64-allwinner-a64-add-UART1-pin-nodes.patch | 35 - ...4-arm64-allwinner-a64-add-r_ccu-node.patch | 52 - ...allwinner-a64-add-R_PIO-pinctrl-node.patch | 35 - ...winner-a64-add-pmu0-regs-for-USB-PHY.patch | 29 - ...a64-Add-PLL_PERIPH0-clock-to-the-R_C.patch | 32 - ...-Rework-the-pin-config-building-code.patch | 251 - ...e-macros-from-bindings-header-file-f.patch | 38 - ...32-pinctrl-sunxi-Handle-bias-disable.patch | 42 - ...inctrl-sunxi-Support-generic-binding.patch | 106 - ...ctrl-sunxi-Deal-with-configless-pins.patch | 128 - ...ke-bool-drivers-explicitly-non-modul.patch | 437 -- ...ee-configs-in-pinctrl_map-only-if-it.patch | 51 - ...x-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch | 40 - ...d-support-for-fetching-pinconf-setti.patch | 158 - ...ke-sunxi_pconf_group_set-use-sunxi_p.patch | 122 - ...Add-support-for-interrupt-debouncing.patch | 171 - ...x-theoretical-uninitialized-variable.patch | 40 - ...trl-sunxi-Testing-the-wrong-variable.patch | 35 - ...i-Don-t-enforce-bias-disable-for-now.patch | 42 - ...add-common-dtsi-file-for-nanopi-SBCs.patch | 160 - .../patches-4.9/0050-stmmac-form-4-10.patch | 3497 ---------- .../patches-4.9/0051-stmmac-form-4-11.patch | 2296 ------- .../patches-4.9/0052-stmmac-form-4-12.patch | 5904 ----------------- .../patches-4.9/0053-stmmac-form-4-13.patch | 1923 ------ ...-ss_support_the_Security_System_PRNG.patch | 206 - ...sun50i-a64-Add-dt-node-for-the-sysco.patch | 33 - ...sun50i-a64-add-dwmac-sun8i-Ethernet-.patch | 69 - ...-allwinner-pine64-Enable-dwmac-sun8i.patch | 46 - ...inner-pine64-plus-Enable-dwmac-sun8i.patch | 38 - ...sun50i-a64-Correct-emac-register-siz.patch | 26 - ...a64-pine64-add-missing-ethernet0-ali.patch | 29 - ...h3-h5-Add-dt-node-for-the-syscon-con.patch | 32 - ...h3-h5-add-dwmac-sun8i-ethernet-drive.patch | 67 - ...-sun8i-orangepi-2-Enable-dwmac-sun8i.patch | 40 - ...n8i-orangepi-plus-Enable-dwmac-sun8i.patch | 64 - ...nxi-h3-h5-Correct-emac-register-size.patch | 26 - ...-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch | 24 - ...nopi-neo-enable-UART-USB-and-I2C-pin.patch | 80 - .../patches-4.9/090-sunxi-mmc-from-4-13.patch | 288 - .../115-musb-ignore-vbus-errors.patch | 26 - .../patches-4.9/131-reset-add-h3-resets.patch | 92 - ...i-add-support-for-Orange-Pi-R1-board.patch | 196 - ...add-support-for-nanopi-m1-plus-board.patch | 168 - 62 files changed, 21168 deletions(-) delete mode 100644 target/linux/sunxi/config-4.9 delete mode 100644 target/linux/sunxi/patches-4.9/0002-clk-sunxi-ng-Rename-the-internal-structures.patch delete mode 100644 target/linux/sunxi/patches-4.9/0003-clk-sunxi-ng-Remove-the-use-of-rational-computations.patch delete mode 100644 target/linux/sunxi/patches-4.9/0004-clk-sunxi-ng-Finish-to-convert-to-structures-for-arg.patch delete mode 100644 target/linux/sunxi/patches-4.9/0005-clk-sunxi-ng-Add-minimums-for-all-the-relevant-struc.patch delete mode 100644 target/linux/sunxi/patches-4.9/0006-clk-sunxi-ng-Implement-minimum-for-multipliers.patch delete mode 100644 target/linux/sunxi/patches-4.9/0007-clk-sunxi-ng-Add-A64-clocks.patch delete mode 100644 target/linux/sunxi/patches-4.9/0010-arm64-dts-add-Allwinner-A64-SoC-.dtsi.patch delete mode 100644 target/linux/sunxi/patches-4.9/0011-arm64-dts-add-Pine64-support.patch delete mode 100644 target/linux/sunxi/patches-4.9/0012-arm64-dts-fix-build-errors-from-missing-dependencies.patch delete mode 100644 target/linux/sunxi/patches-4.9/0013-arm64-dts-allwinner-add-USB1-related-nodes-of-Allwin.patch delete mode 100644 target/linux/sunxi/patches-4.9/0014-arm64-dts-allwinner-sort-the-nodes-in-sun50i-a64-pin.patch delete mode 100644 target/linux/sunxi/patches-4.9/0015-arm64-dts-allwinner-enable-EHCI1-OHCI1-and-USB-PHY-n.patch delete mode 100644 target/linux/sunxi/patches-4.9/0016-arm64-dts-add-MUSB-node-to-Allwinner-A64-dtsi.patch delete mode 100644 target/linux/sunxi/patches-4.9/0017-arm64-dts-enable-the-MUSB-controller-of-Pine64-in-ho.patch delete mode 100644 target/linux/sunxi/patches-4.9/0018-arm64-dts-allwinner-Remove-no-longer-used-pinctrl-su.patch delete mode 100644 target/linux/sunxi/patches-4.9/0019-arm64-allwinner-a64-Add-MMC-nodes.patch delete mode 100644 target/linux/sunxi/patches-4.9/0020-arm64-allwinner-a64-Add-MMC-pinctrl-nodes.patch delete mode 100644 target/linux/sunxi/patches-4.9/0022-arm64-allwinner-pine64-add-MMC-support.patch delete mode 100644 target/linux/sunxi/patches-4.9/0023-arm64-allwinner-a64-add-UART1-pin-nodes.patch delete mode 100644 target/linux/sunxi/patches-4.9/0024-arm64-allwinner-a64-add-r_ccu-node.patch delete mode 100644 target/linux/sunxi/patches-4.9/0025-arm64-allwinner-a64-add-R_PIO-pinctrl-node.patch delete mode 100644 target/linux/sunxi/patches-4.9/0026-arm64-allwinner-a64-add-pmu0-regs-for-USB-PHY.patch delete mode 100644 target/linux/sunxi/patches-4.9/0027-arm64-allwinner-a64-Add-PLL_PERIPH0-clock-to-the-R_C.patch delete mode 100644 target/linux/sunxi/patches-4.9/0030-pinctrl-sunxi-Rework-the-pin-config-building-code.patch delete mode 100644 target/linux/sunxi/patches-4.9/0031-pinctrl-sunxi-Use-macros-from-bindings-header-file-f.patch delete mode 100644 target/linux/sunxi/patches-4.9/0032-pinctrl-sunxi-Handle-bias-disable.patch delete mode 100644 target/linux/sunxi/patches-4.9/0033-pinctrl-sunxi-Support-generic-binding.patch delete mode 100644 target/linux/sunxi/patches-4.9/0034-pinctrl-sunxi-Deal-with-configless-pins.patch delete mode 100644 target/linux/sunxi/patches-4.9/0035-pinctrl-sunxi-make-bool-drivers-explicitly-non-modul.patch delete mode 100644 target/linux/sunxi/patches-4.9/0036-pinctrl-sunxi-Free-configs-in-pinctrl_map-only-if-it.patch delete mode 100644 target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch delete mode 100644 target/linux/sunxi/patches-4.9/0038-pinctrl-sunxi-Add-support-for-fetching-pinconf-setti.patch delete mode 100644 target/linux/sunxi/patches-4.9/0039-pinctrl-sunxi-Make-sunxi_pconf_group_set-use-sunxi_p.patch delete mode 100644 target/linux/sunxi/patches-4.9/0040-pinctrl-sunxi-Add-support-for-interrupt-debouncing.patch delete mode 100644 target/linux/sunxi/patches-4.9/0041-pinctrl-sunxi-fix-theoretical-uninitialized-variable.patch delete mode 100644 target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch delete mode 100644 target/linux/sunxi/patches-4.9/0043-pinctrl-sunxi-Don-t-enforce-bias-disable-for-now.patch delete mode 100644 target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch delete mode 100644 target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch delete mode 100644 target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch delete mode 100644 target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch delete mode 100644 target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch delete mode 100644 target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch delete mode 100644 target/linux/sunxi/patches-4.9/0060-arm64-allwinner-sun50i-a64-Add-dt-node-for-the-sysco.patch delete mode 100644 target/linux/sunxi/patches-4.9/0061-arm64-allwinner-sun50i-a64-add-dwmac-sun8i-Ethernet-.patch delete mode 100644 target/linux/sunxi/patches-4.9/0062-arm64-allwinner-pine64-Enable-dwmac-sun8i.patch delete mode 100644 target/linux/sunxi/patches-4.9/0063-arm64-allwinner-pine64-plus-Enable-dwmac-sun8i.patch delete mode 100644 target/linux/sunxi/patches-4.9/0064-arm64-allwinner-sun50i-a64-Correct-emac-register-siz.patch delete mode 100644 target/linux/sunxi/patches-4.9/0065-arm64-allwinner-a64-pine64-add-missing-ethernet0-ali.patch delete mode 100644 target/linux/sunxi/patches-4.9/0070-arm-sun8i-sunxi-h3-h5-Add-dt-node-for-the-syscon-con.patch delete mode 100644 target/linux/sunxi/patches-4.9/0071-arm-sun8i-sunxi-h3-h5-add-dwmac-sun8i-ethernet-drive.patch delete mode 100644 target/linux/sunxi/patches-4.9/0072-arm-sun8i-orangepi-2-Enable-dwmac-sun8i.patch delete mode 100644 target/linux/sunxi/patches-4.9/0073-ARM-sun8i-orangepi-plus-Enable-dwmac-sun8i.patch delete mode 100644 target/linux/sunxi/patches-4.9/0074-ARM-dts-sunxi-h3-h5-Correct-emac-register-size.patch delete mode 100644 target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch delete mode 100644 target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch delete mode 100644 target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch delete mode 100644 target/linux/sunxi/patches-4.9/115-musb-ignore-vbus-errors.patch delete mode 100644 target/linux/sunxi/patches-4.9/131-reset-add-h3-resets.patch delete mode 100644 target/linux/sunxi/patches-4.9/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch delete mode 100644 target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch diff --git a/target/linux/sunxi/config-4.9 b/target/linux/sunxi/config-4.9 deleted file mode 100644 index c9059be3fab..00000000000 --- a/target/linux/sunxi/config-4.9 +++ /dev/null @@ -1,573 +0,0 @@ -# CONFIG_AHCI_SUNXI is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_ARCH_AXXIA is not set -CONFIG_ARCH_CLOCKSOURCE_DATA=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_RESET_CONTROLLER=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_NR_GPIO=416 -CONFIG_ARCH_PHYS_ADDR_T_64BIT=y -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUNXI=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARM=y -CONFIG_ARM_APPENDED_DTB=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_ERRATA_643719=y -CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_ARM_HEAVY_MB=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_LPAE=y -CONFIG_ARM_PATCH_IDIV=y -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_ARM_PMU=y -CONFIG_ARM_PSCI=y -CONFIG_ARM_PSCI_FW=y -CONFIG_ARM_THUMB=y -# CONFIG_ARM_THUMBEE is not set -CONFIG_ARM_UNWIND=y -CONFIG_ARM_VIRT_EXT=y -CONFIG_ATA=y -CONFIG_ATAGS=y -# CONFIG_ATA_SFF is not set -CONFIG_AUTO_ZRELADDR=y -CONFIG_AXP20X_POWER=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_PWM=y -CONFIG_BINFMT_MISC=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BOUNCE=y -# CONFIG_BPF_SYSCALL is not set -CONFIG_CACHE_L2X0=y -CONFIG_CAN=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -CONFIG_CONFIGFS_FS=y -CONFIG_CONNECTOR=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_COREDUMP=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_CPUFREQ_DT=y -CONFIG_CPUFREQ_DT_PLATDEV=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -# CONFIG_CPU_BIG_ENDIAN is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_ATTR_SET=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_HAS_ASID=y -# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_PM=y -CONFIG_CPU_RMAP=y -CONFIG_CPU_THERMAL=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_V7=y -CONFIG_CRC16=y -CONFIG_CRC_T10DIF=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CRC32=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_DEV_SUN4I_SS=y -CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_DEBUG_MEMORY_INIT=y -# CONFIG_DEBUG_UART_8250 is not set -# CONFIG_DEBUG_USER is not set -CONFIG_DEFAULT_CFQ=y -# CONFIG_DEFAULT_DEADLINE is not set -CONFIG_DEFAULT_IOSCHED="cfq" -CONFIG_DMADEVICES=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_SUN4I=y -CONFIG_DMA_SUN6I=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DNOTIFY=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -# CONFIG_DWMAC_DWC_QOS_ETH is not set -CONFIG_DWMAC_GENERIC=y -# CONFIG_DWMAC_SUN8I is not set -CONFIG_DWMAC_SUNXI=y -CONFIG_DYNAMIC_DEBUG=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_ELF_CORE=y -# CONFIG_EMBEDDED is not set -CONFIG_ENABLE_MUST_CHECK=y -# CONFIG_ENABLE_WARN_DEPRECATED is not set -CONFIG_EXT4_FS=y -CONFIG_EXTCON=y -# CONFIG_F2FS_CHECK_FS is not set -CONFIG_F2FS_FS=y -# CONFIG_F2FS_FS_SECURITY is not set -CONFIG_F2FS_FS_XATTR=y -CONFIG_F2FS_STAT_FS=y -CONFIG_FAT_FS=y -CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_FOREIGN_ENDIAN=y -CONFIG_FB_LITTLE_ENDIAN=y -CONFIG_FB_MODE_HELPERS=y -CONFIG_FB_SIMPLE=y -CONFIG_FB_TILEBLITTING=y -CONFIG_FIXED_PHY=y -CONFIG_FIX_EARLYCON_MEM=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x16=y -CONFIG_FONT_8x8=y -CONFIG_FONT_SUPPORT=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -CONFIG_FRAME_WARN=2048 -CONFIG_FREEZER=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_EARLY_IOREMAP=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GLOB=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_AXP209=y -CONFIG_GPIO_SYSFS=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARM_ARCH_TIMER=y -CONFIG_HAVE_ARM_SMCCC=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_CBPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_GENERIC_RCU_GUP=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL=y -CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y -CONFIG_HAVE_KVM_EVENTFD=y -CONFIG_HAVE_KVM_IRQCHIP=y -CONFIG_HAVE_KVM_IRQFD=y -CONFIG_HAVE_KVM_IRQ_ROUTING=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_RCU_TABLE_FREE=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HOTPLUG_CPU=y -# CONFIG_HUGETLBFS is not set -CONFIG_HWMON=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_TIMERIOMEM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_MV64XXX=y -CONFIG_I2C_SUN6I_P2WI=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -CONFIG_INPUT_AXP20X_PEK=y -CONFIG_INPUT_KEYBOARD=y -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -CONFIG_INPUT_TOUCHSCREEN=y -CONFIG_IOMMU_HELPER=y -CONFIG_IOSCHED_CFQ=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -# CONFIG_KERNEL_MODE_NEON is not set -CONFIG_KEYBOARD_SUN4I_LRADC=y -CONFIG_KSM=y -CONFIG_KVM=y -CONFIG_KVM_ARM_HOST=y -CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y -CONFIG_KVM_MMIO=y -CONFIG_KVM_VFIO=y -CONFIG_LCD_CLASS_DEVICE=y -CONFIG_LCD_PLATFORM=y -CONFIG_LEDS_GPIO=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LIBFDT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_CLUT224=y -CONFIG_LOGO_LINUX_MONO=y -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_MACH_SUN4I=y -CONFIG_MACH_SUN5I=y -CONFIG_MACH_SUN6I=y -CONFIG_MACH_SUN7I=y -CONFIG_MACH_SUN8I=y -CONFIG_MACH_SUN9I=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_MDIO_BOARDINFO=y -CONFIG_MDIO_SUN4I=y -CONFIG_MEDIA_SUPPORT=y -# CONFIG_MFD_AC100 is not set -CONFIG_MFD_AXP20X=y -CONFIG_MFD_AXP20X_I2C=y -CONFIG_MFD_AXP20X_RSB=y -CONFIG_MFD_CORE=y -CONFIG_MFD_SUN6I_PRCM=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -# CONFIG_MMC_BLOCK_BOUNCE is not set -CONFIG_MMC_SUNXI=y -CONFIG_MMU_NOTIFIER=y -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MTD is not set -CONFIG_MULTI_IRQ_HANDLER=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEON=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_VENDOR_ALLWINNER=y -CONFIG_NLS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NO_BOOTMEM=y -CONFIG_NO_HZ=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=8 -CONFIG_NVMEM=y -CONFIG_NVMEM_SUNXI_SID=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_PADATA=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PARTITION_ADVANCED is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYLIB=y -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PHY_SUN4I_USB=y -CONFIG_PHY_SUN9I_USB=y -CONFIG_PINCTRL=y -CONFIG_PINCTRL_GR8=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PINCTRL_SUN4I_A10=y -CONFIG_PINCTRL_SUN5I_A10S=y -CONFIG_PINCTRL_SUN5I_A13=y -CONFIG_PINCTRL_SUN6I_A31=y -CONFIG_PINCTRL_SUN6I_A31S=y -CONFIG_PINCTRL_SUN6I_A31_R=y -CONFIG_PINCTRL_SUN7I_A20=y -CONFIG_PINCTRL_SUN8I_A23=y -CONFIG_PINCTRL_SUN8I_A23_R=y -CONFIG_PINCTRL_SUN8I_A33=y -CONFIG_PINCTRL_SUN8I_A83T=y -CONFIG_PINCTRL_SUN8I_H3=y -CONFIG_PINCTRL_SUN8I_H3_R=y -CONFIG_PINCTRL_SUN9I_A80=y -CONFIG_PINCTRL_SUN9I_A80_R=y -CONFIG_PINCTRL_SUNXI=y -# CONFIG_PL310_ERRATA_588369 is not set -# CONFIG_PL310_ERRATA_727915 is not set -# CONFIG_PL310_ERRATA_753970 is not set -# CONFIG_PL310_ERRATA_769419 is not set -CONFIG_PM=y -CONFIG_PM_CLK=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_OPP=y -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_POWER_RESET=y -CONFIG_POWER_SUPPLY=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_NOTIFIERS=y -CONFIG_PREEMPT_RCU=y -CONFIG_PRINTK_TIME=y -CONFIG_PROC_EVENTS=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PWM=y -CONFIG_PWM_SUN4I=y -CONFIG_PWM_SYSFS=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_IRQ=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPI=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_AXP20X=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_GPIO=y -CONFIG_RELAY=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RESET_SUNXI=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_SATA_PMP=y -# CONFIG_SCHED_INFO is not set -CONFIG_SCSI=y -CONFIG_SDIO_UART=y -CONFIG_SECURITYFS=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_NR_UARTS=8 -CONFIG_SERIAL_8250_RUNTIME_UARTS=8 -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -CONFIG_SG_POOL=y -CONFIG_SMP=y -CONFIG_SMP_ON_UP=y -CONFIG_SND=y -CONFIG_SND_COMPRESS_OFFLOAD=y -CONFIG_SND_JACK=y -CONFIG_SND_JACK_INPUT_DEV=y -CONFIG_SND_PCM=y -CONFIG_SND_SOC=y -CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_SND_SUN4I_I2S is not set -# CONFIG_SND_SUN4I_SPDIF is not set -CONFIG_SOUND=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_SUN4I=y -CONFIG_SPI_SUN6I=y -CONFIG_SRCU=y -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_STRICT_DEVMEM=y -# CONFIG_SUN4I_EMAC is not set -CONFIG_SUN4I_TIMER=y -# CONFIG_SUN50I_A64_CCU is not set -CONFIG_SUN5I_HSTIMER=y -CONFIG_SUN6I_A31_CCU=y -CONFIG_SUN8I_A23_CCU=y -CONFIG_SUN8I_A33_CCU=y -CONFIG_SUN8I_H3_CCU=y -CONFIG_SUNXI_CCU=y -CONFIG_SUNXI_CCU_DIV=y -CONFIG_SUNXI_CCU_FRAC=y -CONFIG_SUNXI_CCU_GATE=y -CONFIG_SUNXI_CCU_MP=y -CONFIG_SUNXI_CCU_MULT=y -CONFIG_SUNXI_CCU_MUX=y -CONFIG_SUNXI_CCU_NK=y -CONFIG_SUNXI_CCU_NKM=y -CONFIG_SUNXI_CCU_NKMP=y -CONFIG_SUNXI_CCU_NM=y -CONFIG_SUNXI_CCU_PHASE=y -CONFIG_SUNXI_RSB=y -CONFIG_SUNXI_SRAM=y -CONFIG_SUNXI_WATCHDOG=y -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_SWCONFIG=y -CONFIG_SWCONFIG_B53=y -# CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set -CONFIG_SWCONFIG_B53_PHY_DRIVER=y -CONFIG_SWCONFIG_B53_PHY_FIXUP=y -# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set -CONFIG_SWIOTLB=y -CONFIG_SWPHY=y -CONFIG_SWP_EMULATE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -# CONFIG_THUMB2_KERNEL is not set -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TOUCHSCREEN_PROPERTIES=y -CONFIG_TOUCHSCREEN_SUN4I=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -CONFIG_USB_COMMON=y -CONFIG_USB_DWC2=y -CONFIG_USB_DWC2_HOST=y -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -CONFIG_USB_GADGET=y -CONFIG_USB_NET_DRIVERS=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USERIO=y -CONFIG_USE_OF=y -CONFIG_VDSO=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VFAT_FS=y -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_VHOST=y -CONFIG_VHOST_NET=y -CONFIG_VIRTUALIZATION=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_CONSOLE_SLEEP=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_XPS=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ZBOOT_ROM_TEXT=0 diff --git a/target/linux/sunxi/patches-4.9/0002-clk-sunxi-ng-Rename-the-internal-structures.patch b/target/linux/sunxi/patches-4.9/0002-clk-sunxi-ng-Rename-the-internal-structures.patch deleted file mode 100644 index f3e485d88a7..00000000000 --- a/target/linux/sunxi/patches-4.9/0002-clk-sunxi-ng-Rename-the-internal-structures.patch +++ /dev/null @@ -1,239 +0,0 @@ -From a501a14e38cc4d8e9c91bb508cdca7032d53f717 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 30 Sep 2016 10:05:32 +0200 -Subject: clk: sunxi-ng: Rename the internal structures - -Rename the structures meant to be embedded in other structures to make it -consistent with the mux structure name - -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - drivers/clk/sunxi-ng/ccu_div.h | 6 +++--- - drivers/clk/sunxi-ng/ccu_frac.c | 12 ++++++------ - drivers/clk/sunxi-ng/ccu_frac.h | 14 +++++++------- - drivers/clk/sunxi-ng/ccu_mp.h | 4 ++-- - drivers/clk/sunxi-ng/ccu_mult.h | 4 ++-- - drivers/clk/sunxi-ng/ccu_nk.h | 4 ++-- - drivers/clk/sunxi-ng/ccu_nkm.h | 6 +++--- - drivers/clk/sunxi-ng/ccu_nkmp.h | 8 ++++---- - drivers/clk/sunxi-ng/ccu_nm.h | 6 +++--- - 9 files changed, 32 insertions(+), 32 deletions(-) - ---- a/drivers/clk/sunxi-ng/ccu_div.h -+++ b/drivers/clk/sunxi-ng/ccu_div.h -@@ -20,7 +20,7 @@ - #include "ccu_mux.h" - - /** -- * struct _ccu_div - Internal divider description -+ * struct ccu_div_internal - Internal divider description - * @shift: Bit offset of the divider in its register - * @width: Width of the divider field in its register - * @max: Maximum value allowed for that divider. This is the -@@ -36,7 +36,7 @@ - * It is basically a wrapper around the clk_divider functions - * arguments. - */ --struct _ccu_div { -+struct ccu_div_internal { - u8 shift; - u8 width; - -@@ -78,7 +78,7 @@ struct _ccu_div { - struct ccu_div { - u32 enable; - -- struct _ccu_div div; -+ struct ccu_div_internal div; - struct ccu_mux_internal mux; - struct ccu_common common; - }; ---- a/drivers/clk/sunxi-ng/ccu_frac.c -+++ b/drivers/clk/sunxi-ng/ccu_frac.c -@@ -14,7 +14,7 @@ - #include "ccu_frac.h" - - bool ccu_frac_helper_is_enabled(struct ccu_common *common, -- struct _ccu_frac *cf) -+ struct ccu_frac_internal *cf) - { - if (!(common->features & CCU_FEATURE_FRACTIONAL)) - return false; -@@ -23,7 +23,7 @@ bool ccu_frac_helper_is_enabled(struct c - } - - void ccu_frac_helper_enable(struct ccu_common *common, -- struct _ccu_frac *cf) -+ struct ccu_frac_internal *cf) - { - unsigned long flags; - u32 reg; -@@ -38,7 +38,7 @@ void ccu_frac_helper_enable(struct ccu_c - } - - void ccu_frac_helper_disable(struct ccu_common *common, -- struct _ccu_frac *cf) -+ struct ccu_frac_internal *cf) - { - unsigned long flags; - u32 reg; -@@ -53,7 +53,7 @@ void ccu_frac_helper_disable(struct ccu_ - } - - bool ccu_frac_helper_has_rate(struct ccu_common *common, -- struct _ccu_frac *cf, -+ struct ccu_frac_internal *cf, - unsigned long rate) - { - if (!(common->features & CCU_FEATURE_FRACTIONAL)) -@@ -63,7 +63,7 @@ bool ccu_frac_helper_has_rate(struct ccu - } - - unsigned long ccu_frac_helper_read_rate(struct ccu_common *common, -- struct _ccu_frac *cf) -+ struct ccu_frac_internal *cf) - { - u32 reg; - -@@ -84,7 +84,7 @@ unsigned long ccu_frac_helper_read_rate( - } - - int ccu_frac_helper_set_rate(struct ccu_common *common, -- struct _ccu_frac *cf, -+ struct ccu_frac_internal *cf, - unsigned long rate) - { - unsigned long flags; ---- a/drivers/clk/sunxi-ng/ccu_frac.h -+++ b/drivers/clk/sunxi-ng/ccu_frac.h -@@ -18,7 +18,7 @@ - - #include "ccu_common.h" - --struct _ccu_frac { -+struct ccu_frac_internal { - u32 enable; - u32 select; - -@@ -33,21 +33,21 @@ struct _ccu_frac { - } - - bool ccu_frac_helper_is_enabled(struct ccu_common *common, -- struct _ccu_frac *cf); -+ struct ccu_frac_internal *cf); - void ccu_frac_helper_enable(struct ccu_common *common, -- struct _ccu_frac *cf); -+ struct ccu_frac_internal *cf); - void ccu_frac_helper_disable(struct ccu_common *common, -- struct _ccu_frac *cf); -+ struct ccu_frac_internal *cf); - - bool ccu_frac_helper_has_rate(struct ccu_common *common, -- struct _ccu_frac *cf, -+ struct ccu_frac_internal *cf, - unsigned long rate); - - unsigned long ccu_frac_helper_read_rate(struct ccu_common *common, -- struct _ccu_frac *cf); -+ struct ccu_frac_internal *cf); - - int ccu_frac_helper_set_rate(struct ccu_common *common, -- struct _ccu_frac *cf, -+ struct ccu_frac_internal *cf, - unsigned long rate); - - #endif /* _CCU_FRAC_H_ */ ---- a/drivers/clk/sunxi-ng/ccu_mp.h -+++ b/drivers/clk/sunxi-ng/ccu_mp.h -@@ -29,8 +29,8 @@ - struct ccu_mp { - u32 enable; - -- struct _ccu_div m; -- struct _ccu_div p; -+ struct ccu_div_internal m; -+ struct ccu_div_internal p; - struct ccu_mux_internal mux; - struct ccu_common common; - }; ---- a/drivers/clk/sunxi-ng/ccu_mult.h -+++ b/drivers/clk/sunxi-ng/ccu_mult.h -@@ -4,7 +4,7 @@ - #include "ccu_common.h" - #include "ccu_mux.h" - --struct _ccu_mult { -+struct ccu_mult_internal { - u8 shift; - u8 width; - }; -@@ -18,7 +18,7 @@ struct _ccu_mult { - struct ccu_mult { - u32 enable; - -- struct _ccu_mult mult; -+ struct ccu_mult_internal mult; - struct ccu_mux_internal mux; - struct ccu_common common; - }; ---- a/drivers/clk/sunxi-ng/ccu_nk.h -+++ b/drivers/clk/sunxi-ng/ccu_nk.h -@@ -30,8 +30,8 @@ struct ccu_nk { - u32 enable; - u32 lock; - -- struct _ccu_mult n; -- struct _ccu_mult k; -+ struct ccu_mult_internal n; -+ struct ccu_mult_internal k; - - unsigned int fixed_post_div; - ---- a/drivers/clk/sunxi-ng/ccu_nkm.h -+++ b/drivers/clk/sunxi-ng/ccu_nkm.h -@@ -29,9 +29,9 @@ struct ccu_nkm { - u32 enable; - u32 lock; - -- struct _ccu_mult n; -- struct _ccu_mult k; -- struct _ccu_div m; -+ struct ccu_mult_internal n; -+ struct ccu_mult_internal k; -+ struct ccu_div_internal m; - struct ccu_mux_internal mux; - - struct ccu_common common; ---- a/drivers/clk/sunxi-ng/ccu_nkmp.h -+++ b/drivers/clk/sunxi-ng/ccu_nkmp.h -@@ -29,10 +29,10 @@ struct ccu_nkmp { - u32 enable; - u32 lock; - -- struct _ccu_mult n; -- struct _ccu_mult k; -- struct _ccu_div m; -- struct _ccu_div p; -+ struct ccu_mult_internal n; -+ struct ccu_mult_internal k; -+ struct ccu_div_internal m; -+ struct ccu_div_internal p; - - struct ccu_common common; - }; ---- a/drivers/clk/sunxi-ng/ccu_nm.h -+++ b/drivers/clk/sunxi-ng/ccu_nm.h -@@ -30,9 +30,9 @@ struct ccu_nm { - u32 enable; - u32 lock; - -- struct _ccu_mult n; -- struct _ccu_div m; -- struct _ccu_frac frac; -+ struct ccu_mult_internal n; -+ struct ccu_div_internal m; -+ struct ccu_frac_internal frac; - - struct ccu_common common; - }; diff --git a/target/linux/sunxi/patches-4.9/0003-clk-sunxi-ng-Remove-the-use-of-rational-computations.patch b/target/linux/sunxi/patches-4.9/0003-clk-sunxi-ng-Remove-the-use-of-rational-computations.patch deleted file mode 100644 index 9146a2bb42d..00000000000 --- a/target/linux/sunxi/patches-4.9/0003-clk-sunxi-ng-Remove-the-use-of-rational-computations.patch +++ /dev/null @@ -1,239 +0,0 @@ -From ee28648cb2b4d4ab5c2eb8199ea86675fe19016b Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 29 Sep 2016 22:53:12 +0200 -Subject: clk: sunxi-ng: Remove the use of rational computations - -While the rational library works great, it doesn't really allow us to add -more constraints, like the minimum. - -Remove that in order to be able to deal with the constraints we'll need. - -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - drivers/clk/sunxi-ng/Kconfig | 3 --- - drivers/clk/sunxi-ng/ccu_nkm.c | 31 ++++++++++++----------- - drivers/clk/sunxi-ng/ccu_nkmp.c | 37 ++++++++++++++-------------- - drivers/clk/sunxi-ng/ccu_nm.c | 54 +++++++++++++++++++++++++++++++---------- - 4 files changed, 74 insertions(+), 51 deletions(-) - ---- a/drivers/clk/sunxi-ng/Kconfig -+++ b/drivers/clk/sunxi-ng/Kconfig -@@ -36,17 +36,14 @@ config SUNXI_CCU_NK - - config SUNXI_CCU_NKM - bool -- select RATIONAL - select SUNXI_CCU_GATE - - config SUNXI_CCU_NKMP - bool -- select RATIONAL - select SUNXI_CCU_GATE - - config SUNXI_CCU_NM - bool -- select RATIONAL - select SUNXI_CCU_FRAC - select SUNXI_CCU_GATE - ---- a/drivers/clk/sunxi-ng/ccu_nkm.c -+++ b/drivers/clk/sunxi-ng/ccu_nkm.c -@@ -9,7 +9,6 @@ - */ - - #include --#include - - #include "ccu_gate.h" - #include "ccu_nkm.h" -@@ -28,21 +27,21 @@ static void ccu_nkm_find_best(unsigned l - unsigned long _n, _k, _m; - - for (_k = 1; _k <= nkm->max_k; _k++) { -- unsigned long tmp_rate; -- -- rational_best_approximation(rate / _k, parent, -- nkm->max_n, nkm->max_m, &_n, &_m); -- -- tmp_rate = parent * _n * _k / _m; -- -- if (tmp_rate > rate) -- continue; -- -- if ((rate - tmp_rate) < (rate - best_rate)) { -- best_rate = tmp_rate; -- best_n = _n; -- best_k = _k; -- best_m = _m; -+ for (_n = 1; _n <= nkm->max_n; _n++) { -+ for (_m = 1; _n <= nkm->max_m; _m++) { -+ unsigned long tmp_rate; -+ -+ tmp_rate = parent * _n * _k / _m; -+ -+ if (tmp_rate > rate) -+ continue; -+ if ((rate - tmp_rate) < (rate - best_rate)) { -+ best_rate = tmp_rate; -+ best_n = _n; -+ best_k = _k; -+ best_m = _m; -+ } -+ } - } - } - ---- a/drivers/clk/sunxi-ng/ccu_nkmp.c -+++ b/drivers/clk/sunxi-ng/ccu_nkmp.c -@@ -9,7 +9,6 @@ - */ - - #include --#include - - #include "ccu_gate.h" - #include "ccu_nkmp.h" -@@ -29,24 +28,24 @@ static void ccu_nkmp_find_best(unsigned - unsigned long _n, _k, _m, _p; - - for (_k = 1; _k <= nkmp->max_k; _k++) { -- for (_p = 1; _p <= nkmp->max_p; _p <<= 1) { -- unsigned long tmp_rate; -- -- rational_best_approximation(rate / _k, parent / _p, -- nkmp->max_n, nkmp->max_m, -- &_n, &_m); -- -- tmp_rate = parent * _n * _k / (_m * _p); -- -- if (tmp_rate > rate) -- continue; -- -- if ((rate - tmp_rate) < (rate - best_rate)) { -- best_rate = tmp_rate; -- best_n = _n; -- best_k = _k; -- best_m = _m; -- best_p = _p; -+ for (_n = 1; _n <= nkmp->max_n; _n++) { -+ for (_m = 1; _n <= nkmp->max_m; _m++) { -+ for (_p = 1; _p <= nkmp->max_p; _p <<= 1) { -+ unsigned long tmp_rate; -+ -+ tmp_rate = parent * _n * _k / (_m * _p); -+ -+ if (tmp_rate > rate) -+ continue; -+ -+ if ((rate - tmp_rate) < (rate - best_rate)) { -+ best_rate = tmp_rate; -+ best_n = _n; -+ best_k = _k; -+ best_m = _m; -+ best_p = _p; -+ } -+ } - } - } - } ---- a/drivers/clk/sunxi-ng/ccu_nm.c -+++ b/drivers/clk/sunxi-ng/ccu_nm.c -@@ -9,12 +9,42 @@ - */ - - #include --#include - - #include "ccu_frac.h" - #include "ccu_gate.h" - #include "ccu_nm.h" - -+struct _ccu_nm { -+ unsigned long n, max_n; -+ unsigned long m, max_m; -+}; -+ -+static void ccu_nm_find_best(unsigned long parent, unsigned long rate, -+ struct _ccu_nm *nm) -+{ -+ unsigned long best_rate = 0; -+ unsigned long best_n = 0, best_m = 0; -+ unsigned long _n, _m; -+ -+ for (_n = 1; _n <= nm->max_n; _n++) { -+ for (_m = 1; _n <= nm->max_m; _m++) { -+ unsigned long tmp_rate = parent * _n / _m; -+ -+ if (tmp_rate > rate) -+ continue; -+ -+ if ((rate - tmp_rate) < (rate - best_rate)) { -+ best_rate = tmp_rate; -+ best_n = _n; -+ best_m = _m; -+ } -+ } -+ } -+ -+ nm->n = best_n; -+ nm->m = best_m; -+} -+ - static void ccu_nm_disable(struct clk_hw *hw) - { - struct ccu_nm *nm = hw_to_ccu_nm(hw); -@@ -61,24 +91,22 @@ static long ccu_nm_round_rate(struct clk - unsigned long *parent_rate) - { - struct ccu_nm *nm = hw_to_ccu_nm(hw); -- unsigned long max_n, max_m; -- unsigned long n, m; -+ struct _ccu_nm _nm; - -- max_n = 1 << nm->n.width; -- max_m = nm->m.max ?: 1 << nm->m.width; -+ _nm.max_n = 1 << nm->n.width; -+ _nm.max_m = nm->m.max ?: 1 << nm->m.width; - -- rational_best_approximation(rate, *parent_rate, max_n, max_m, &n, &m); -+ ccu_nm_find_best(*parent_rate, rate, &_nm); - -- return *parent_rate * n / m; -+ return *parent_rate * _nm.n / _nm.m; - } - - static int ccu_nm_set_rate(struct clk_hw *hw, unsigned long rate, - unsigned long parent_rate) - { - struct ccu_nm *nm = hw_to_ccu_nm(hw); -+ struct _ccu_nm _nm; - unsigned long flags; -- unsigned long max_n, max_m; -- unsigned long n, m; - u32 reg; - - if (ccu_frac_helper_has_rate(&nm->common, &nm->frac, rate)) -@@ -86,10 +114,10 @@ static int ccu_nm_set_rate(struct clk_hw - else - ccu_frac_helper_disable(&nm->common, &nm->frac); - -- max_n = 1 << nm->n.width; -- max_m = nm->m.max ?: 1 << nm->m.width; -+ _nm.max_n = 1 << nm->n.width; -+ _nm.max_m = nm->m.max ?: 1 << nm->m.width; - -- rational_best_approximation(rate, parent_rate, max_n, max_m, &n, &m); -+ ccu_nm_find_best(parent_rate, rate, &_nm); - - spin_lock_irqsave(nm->common.lock, flags); - -@@ -97,7 +125,7 @@ static int ccu_nm_set_rate(struct clk_hw - reg &= ~GENMASK(nm->n.width + nm->n.shift - 1, nm->n.shift); - reg &= ~GENMASK(nm->m.width + nm->m.shift - 1, nm->m.shift); - -- writel(reg | ((m - 1) << nm->m.shift) | ((n - 1) << nm->n.shift), -+ writel(reg | ((_nm.m - 1) << nm->m.shift) | ((_nm.n - 1) << nm->n.shift), - nm->common.base + nm->common.reg); - - spin_unlock_irqrestore(nm->common.lock, flags); diff --git a/target/linux/sunxi/patches-4.9/0004-clk-sunxi-ng-Finish-to-convert-to-structures-for-arg.patch b/target/linux/sunxi/patches-4.9/0004-clk-sunxi-ng-Finish-to-convert-to-structures-for-arg.patch deleted file mode 100644 index 4b91892b81c..00000000000 --- a/target/linux/sunxi/patches-4.9/0004-clk-sunxi-ng-Finish-to-convert-to-structures-for-arg.patch +++ /dev/null @@ -1,182 +0,0 @@ -From b8302c7267dedaeeb1bf38143f099defbf16dce8 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 29 Sep 2016 23:50:21 +0200 -Subject: clk: sunxi-ng: Finish to convert to structures for arguments - -Some clocks still use an explicit list of arguments, which make it a bit -more tedious to add new parameters. - -Convert those over to a structure pointer argument to add as many -arguments as possible without having to many noise in our patches, or a -very long list of arguments. - -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - drivers/clk/sunxi-ng/ccu_mult.c | 28 ++++++++++++++++++++-------- - drivers/clk/sunxi-ng/ccu_nk.c | 39 ++++++++++++++++++++++----------------- - 2 files changed, 42 insertions(+), 25 deletions(-) - ---- a/drivers/clk/sunxi-ng/ccu_mult.c -+++ b/drivers/clk/sunxi-ng/ccu_mult.c -@@ -13,10 +13,20 @@ - #include "ccu_gate.h" - #include "ccu_mult.h" - -+struct _ccu_mult { -+ unsigned long mult, max; -+}; -+ - static void ccu_mult_find_best(unsigned long parent, unsigned long rate, -- unsigned int max_n, unsigned int *n) -+ struct _ccu_mult *mult) - { -- *n = rate / parent; -+ int _mult; -+ -+ _mult = rate / parent; -+ if (_mult > mult->max) -+ _mult = mult->max; -+ -+ mult->mult = _mult; - } - - static unsigned long ccu_mult_round_rate(struct ccu_mux_internal *mux, -@@ -25,11 +35,12 @@ static unsigned long ccu_mult_round_rate - void *data) - { - struct ccu_mult *cm = data; -- unsigned int n; -+ struct _ccu_mult _cm; - -- ccu_mult_find_best(parent_rate, rate, 1 << cm->mult.width, &n); -+ _cm.max = 1 << cm->mult.width; -+ ccu_mult_find_best(parent_rate, rate, &_cm); - -- return parent_rate * n; -+ return parent_rate * _cm.mult; - } - - static void ccu_mult_disable(struct clk_hw *hw) -@@ -83,21 +94,22 @@ static int ccu_mult_set_rate(struct clk_ - unsigned long parent_rate) - { - struct ccu_mult *cm = hw_to_ccu_mult(hw); -+ struct _ccu_mult _cm; - unsigned long flags; -- unsigned int n; - u32 reg; - - ccu_mux_helper_adjust_parent_for_prediv(&cm->common, &cm->mux, -1, - &parent_rate); - -- ccu_mult_find_best(parent_rate, rate, 1 << cm->mult.width, &n); -+ _cm.max = 1 << cm->mult.width; -+ ccu_mult_find_best(parent_rate, rate, &_cm); - - spin_lock_irqsave(cm->common.lock, flags); - - reg = readl(cm->common.base + cm->common.reg); - reg &= ~GENMASK(cm->mult.width + cm->mult.shift - 1, cm->mult.shift); - -- writel(reg | ((n - 1) << cm->mult.shift), -+ writel(reg | ((_cm.mult - 1) << cm->mult.shift), - cm->common.base + cm->common.reg); - - spin_unlock_irqrestore(cm->common.lock, flags); ---- a/drivers/clk/sunxi-ng/ccu_nk.c -+++ b/drivers/clk/sunxi-ng/ccu_nk.c -@@ -9,21 +9,24 @@ - */ - - #include --#include - - #include "ccu_gate.h" - #include "ccu_nk.h" - -+struct _ccu_nk { -+ unsigned long n, max_n; -+ unsigned long k, max_k; -+}; -+ - static void ccu_nk_find_best(unsigned long parent, unsigned long rate, -- unsigned int max_n, unsigned int max_k, -- unsigned int *n, unsigned int *k) -+ struct _ccu_nk *nk) - { - unsigned long best_rate = 0; - unsigned int best_k = 0, best_n = 0; - unsigned int _k, _n; - -- for (_k = 1; _k <= max_k; _k++) { -- for (_n = 1; _n <= max_n; _n++) { -+ for (_k = 1; _k <= nk->max_k; _k++) { -+ for (_n = 1; _n <= nk->max_n; _n++) { - unsigned long tmp_rate = parent * _n * _k; - - if (tmp_rate > rate) -@@ -37,8 +40,8 @@ static void ccu_nk_find_best(unsigned lo - } - } - -- *k = best_k; -- *n = best_n; -+ nk->k = best_k; -+ nk->n = best_n; - } - - static void ccu_nk_disable(struct clk_hw *hw) -@@ -89,16 +92,17 @@ static long ccu_nk_round_rate(struct clk - unsigned long *parent_rate) - { - struct ccu_nk *nk = hw_to_ccu_nk(hw); -- unsigned int n, k; -+ struct _ccu_nk _nk; - - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate *= nk->fixed_post_div; - -- ccu_nk_find_best(*parent_rate, rate, -- 1 << nk->n.width, 1 << nk->k.width, -- &n, &k); -+ _nk.max_n = 1 << nk->n.width; -+ _nk.max_k = 1 << nk->k.width; -+ -+ ccu_nk_find_best(*parent_rate, rate, &_nk); -+ rate = *parent_rate * _nk.n * _nk.k; - -- rate = *parent_rate * n * k; - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate = rate / nk->fixed_post_div; - -@@ -110,15 +114,16 @@ static int ccu_nk_set_rate(struct clk_hw - { - struct ccu_nk *nk = hw_to_ccu_nk(hw); - unsigned long flags; -- unsigned int n, k; -+ struct _ccu_nk _nk; - u32 reg; - - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate = rate * nk->fixed_post_div; - -- ccu_nk_find_best(parent_rate, rate, -- 1 << nk->n.width, 1 << nk->k.width, -- &n, &k); -+ _nk.max_n = 1 << nk->n.width; -+ _nk.max_k = 1 << nk->k.width; -+ -+ ccu_nk_find_best(parent_rate, rate, &_nk); - - spin_lock_irqsave(nk->common.lock, flags); - -@@ -126,7 +131,7 @@ static int ccu_nk_set_rate(struct clk_hw - reg &= ~GENMASK(nk->n.width + nk->n.shift - 1, nk->n.shift); - reg &= ~GENMASK(nk->k.width + nk->k.shift - 1, nk->k.shift); - -- writel(reg | ((k - 1) << nk->k.shift) | ((n - 1) << nk->n.shift), -+ writel(reg | ((_nk.k - 1) << nk->k.shift) | ((_nk.n - 1) << nk->n.shift), - nk->common.base + nk->common.reg); - - spin_unlock_irqrestore(nk->common.lock, flags); diff --git a/target/linux/sunxi/patches-4.9/0005-clk-sunxi-ng-Add-minimums-for-all-the-relevant-struc.patch b/target/linux/sunxi/patches-4.9/0005-clk-sunxi-ng-Add-minimums-for-all-the-relevant-struc.patch deleted file mode 100644 index 0165ade1386..00000000000 --- a/target/linux/sunxi/patches-4.9/0005-clk-sunxi-ng-Add-minimums-for-all-the-relevant-struc.patch +++ /dev/null @@ -1,256 +0,0 @@ -From 6e0d50daa97f4bf9706e343b4f71171e88921209 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 29 Sep 2016 22:57:26 +0200 -Subject: clk: sunxi-ng: Add minimums for all the relevant structures and - clocks - -Modify the current clocks we have to be able to specify the minimum for -each clocks we support, just like we support the max. - -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - drivers/clk/sunxi-ng/ccu_mult.c | 7 ++++++- - drivers/clk/sunxi-ng/ccu_nk.c | 12 ++++++++---- - drivers/clk/sunxi-ng/ccu_nkm.c | 18 ++++++++++++------ - drivers/clk/sunxi-ng/ccu_nkmp.c | 24 ++++++++++++++++-------- - drivers/clk/sunxi-ng/ccu_nm.c | 12 ++++++++---- - 5 files changed, 50 insertions(+), 23 deletions(-) - ---- a/drivers/clk/sunxi-ng/ccu_mult.c -+++ b/drivers/clk/sunxi-ng/ccu_mult.c -@@ -14,7 +14,7 @@ - #include "ccu_mult.h" - - struct _ccu_mult { -- unsigned long mult, max; -+ unsigned long mult, min, max; - }; - - static void ccu_mult_find_best(unsigned long parent, unsigned long rate, -@@ -23,6 +23,9 @@ static void ccu_mult_find_best(unsigned - int _mult; - - _mult = rate / parent; -+ if (_mult < mult->min) -+ _mult = mult->min; -+ - if (_mult > mult->max) - _mult = mult->max; - -@@ -37,6 +40,7 @@ static unsigned long ccu_mult_round_rate - struct ccu_mult *cm = data; - struct _ccu_mult _cm; - -+ _cm.min = 1; - _cm.max = 1 << cm->mult.width; - ccu_mult_find_best(parent_rate, rate, &_cm); - -@@ -101,6 +105,7 @@ static int ccu_mult_set_rate(struct clk_ - ccu_mux_helper_adjust_parent_for_prediv(&cm->common, &cm->mux, -1, - &parent_rate); - -+ _cm.min = 1; - _cm.max = 1 << cm->mult.width; - ccu_mult_find_best(parent_rate, rate, &_cm); - ---- a/drivers/clk/sunxi-ng/ccu_nk.c -+++ b/drivers/clk/sunxi-ng/ccu_nk.c -@@ -14,8 +14,8 @@ - #include "ccu_nk.h" - - struct _ccu_nk { -- unsigned long n, max_n; -- unsigned long k, max_k; -+ unsigned long n, min_n, max_n; -+ unsigned long k, min_k, max_k; - }; - - static void ccu_nk_find_best(unsigned long parent, unsigned long rate, -@@ -25,8 +25,8 @@ static void ccu_nk_find_best(unsigned lo - unsigned int best_k = 0, best_n = 0; - unsigned int _k, _n; - -- for (_k = 1; _k <= nk->max_k; _k++) { -- for (_n = 1; _n <= nk->max_n; _n++) { -+ for (_k = nk->min_k; _k <= nk->max_k; _k++) { -+ for (_n = nk->min_n; _n <= nk->max_n; _n++) { - unsigned long tmp_rate = parent * _n * _k; - - if (tmp_rate > rate) -@@ -97,7 +97,9 @@ static long ccu_nk_round_rate(struct clk - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate *= nk->fixed_post_div; - -+ _nk.min_n = 1; - _nk.max_n = 1 << nk->n.width; -+ _nk.min_k = 1; - _nk.max_k = 1 << nk->k.width; - - ccu_nk_find_best(*parent_rate, rate, &_nk); -@@ -120,7 +122,9 @@ static int ccu_nk_set_rate(struct clk_hw - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate = rate * nk->fixed_post_div; - -+ _nk.min_n = 1; - _nk.max_n = 1 << nk->n.width; -+ _nk.min_k = 1; - _nk.max_k = 1 << nk->k.width; - - ccu_nk_find_best(parent_rate, rate, &_nk); ---- a/drivers/clk/sunxi-ng/ccu_nkm.c -+++ b/drivers/clk/sunxi-ng/ccu_nkm.c -@@ -14,9 +14,9 @@ - #include "ccu_nkm.h" - - struct _ccu_nkm { -- unsigned long n, max_n; -- unsigned long k, max_k; -- unsigned long m, max_m; -+ unsigned long n, min_n, max_n; -+ unsigned long k, min_k, max_k; -+ unsigned long m, min_m, max_m; - }; - - static void ccu_nkm_find_best(unsigned long parent, unsigned long rate, -@@ -26,9 +26,9 @@ static void ccu_nkm_find_best(unsigned l - unsigned long best_n = 0, best_k = 0, best_m = 0; - unsigned long _n, _k, _m; - -- for (_k = 1; _k <= nkm->max_k; _k++) { -- for (_n = 1; _n <= nkm->max_n; _n++) { -- for (_m = 1; _n <= nkm->max_m; _m++) { -+ for (_k = nkm->min_k; _k <= nkm->max_k; _k++) { -+ for (_n = nkm->min_n; _n <= nkm->max_n; _n++) { -+ for (_m = nkm->min_m; _m <= nkm->max_m; _m++) { - unsigned long tmp_rate; - - tmp_rate = parent * _n * _k / _m; -@@ -100,8 +100,11 @@ static unsigned long ccu_nkm_round_rate( - struct ccu_nkm *nkm = data; - struct _ccu_nkm _nkm; - -+ _nkm.min_n = 1; - _nkm.max_n = 1 << nkm->n.width; -+ _nkm.min_k = 1; - _nkm.max_k = 1 << nkm->k.width; -+ _nkm.min_m = 1; - _nkm.max_m = nkm->m.max ?: 1 << nkm->m.width; - - ccu_nkm_find_best(parent_rate, rate, &_nkm); -@@ -126,8 +129,11 @@ static int ccu_nkm_set_rate(struct clk_h - unsigned long flags; - u32 reg; - -+ _nkm.min_n = 1; - _nkm.max_n = 1 << nkm->n.width; -+ _nkm.min_k = 1; - _nkm.max_k = 1 << nkm->k.width; -+ _nkm.min_m = 1; - _nkm.max_m = nkm->m.max ?: 1 << nkm->m.width; - - ccu_nkm_find_best(parent_rate, rate, &_nkm); ---- a/drivers/clk/sunxi-ng/ccu_nkmp.c -+++ b/drivers/clk/sunxi-ng/ccu_nkmp.c -@@ -14,10 +14,10 @@ - #include "ccu_nkmp.h" - - struct _ccu_nkmp { -- unsigned long n, max_n; -- unsigned long k, max_k; -- unsigned long m, max_m; -- unsigned long p, max_p; -+ unsigned long n, min_n, max_n; -+ unsigned long k, min_k, max_k; -+ unsigned long m, min_m, max_m; -+ unsigned long p, min_p, max_p; - }; - - static void ccu_nkmp_find_best(unsigned long parent, unsigned long rate, -@@ -27,10 +27,10 @@ static void ccu_nkmp_find_best(unsigned - unsigned long best_n = 0, best_k = 0, best_m = 0, best_p = 0; - unsigned long _n, _k, _m, _p; - -- for (_k = 1; _k <= nkmp->max_k; _k++) { -- for (_n = 1; _n <= nkmp->max_n; _n++) { -- for (_m = 1; _n <= nkmp->max_m; _m++) { -- for (_p = 1; _p <= nkmp->max_p; _p <<= 1) { -+ for (_k = nkmp->min_k; _k <= nkmp->max_k; _k++) { -+ for (_n = nkmp->min_n; _n <= nkmp->max_n; _n++) { -+ for (_m = nkmp->min_m; _m <= nkmp->max_m; _m++) { -+ for (_p = nkmp->min_p; _p <= nkmp->max_p; _p <<= 1) { - unsigned long tmp_rate; - - tmp_rate = parent * _n * _k / (_m * _p); -@@ -107,9 +107,13 @@ static long ccu_nkmp_round_rate(struct c - struct ccu_nkmp *nkmp = hw_to_ccu_nkmp(hw); - struct _ccu_nkmp _nkmp; - -+ _nkmp.min_n = 1; - _nkmp.max_n = 1 << nkmp->n.width; -+ _nkmp.min_k = 1; - _nkmp.max_k = 1 << nkmp->k.width; -+ _nkmp.min_m = 1; - _nkmp.max_m = nkmp->m.max ?: 1 << nkmp->m.width; -+ _nkmp.min_p = 1; - _nkmp.max_p = nkmp->p.max ?: 1 << ((1 << nkmp->p.width) - 1); - - ccu_nkmp_find_best(*parent_rate, rate, &_nkmp); -@@ -125,9 +129,13 @@ static int ccu_nkmp_set_rate(struct clk_ - unsigned long flags; - u32 reg; - -+ _nkmp.min_n = 1; - _nkmp.max_n = 1 << nkmp->n.width; -+ _nkmp.min_k = 1; - _nkmp.max_k = 1 << nkmp->k.width; -+ _nkmp.min_m = 1; - _nkmp.max_m = nkmp->m.max ?: 1 << nkmp->m.width; -+ _nkmp.min_p = 1; - _nkmp.max_p = nkmp->p.max ?: 1 << ((1 << nkmp->p.width) - 1); - - ccu_nkmp_find_best(parent_rate, rate, &_nkmp); ---- a/drivers/clk/sunxi-ng/ccu_nm.c -+++ b/drivers/clk/sunxi-ng/ccu_nm.c -@@ -15,8 +15,8 @@ - #include "ccu_nm.h" - - struct _ccu_nm { -- unsigned long n, max_n; -- unsigned long m, max_m; -+ unsigned long n, min_n, max_n; -+ unsigned long m, min_m, max_m; - }; - - static void ccu_nm_find_best(unsigned long parent, unsigned long rate, -@@ -26,8 +26,8 @@ static void ccu_nm_find_best(unsigned lo - unsigned long best_n = 0, best_m = 0; - unsigned long _n, _m; - -- for (_n = 1; _n <= nm->max_n; _n++) { -- for (_m = 1; _n <= nm->max_m; _m++) { -+ for (_n = nm->min_n; _n <= nm->max_n; _n++) { -+ for (_m = nm->min_m; _m <= nm->max_m; _m++) { - unsigned long tmp_rate = parent * _n / _m; - - if (tmp_rate > rate) -@@ -93,7 +93,9 @@ static long ccu_nm_round_rate(struct clk - struct ccu_nm *nm = hw_to_ccu_nm(hw); - struct _ccu_nm _nm; - -+ _nm.min_n = 1; - _nm.max_n = 1 << nm->n.width; -+ _nm.min_m = 1; - _nm.max_m = nm->m.max ?: 1 << nm->m.width; - - ccu_nm_find_best(*parent_rate, rate, &_nm); -@@ -114,7 +116,9 @@ static int ccu_nm_set_rate(struct clk_hw - else - ccu_frac_helper_disable(&nm->common, &nm->frac); - -+ _nm.min_n = 1; - _nm.max_n = 1 << nm->n.width; -+ _nm.min_m = 1; - _nm.max_m = nm->m.max ?: 1 << nm->m.width; - - ccu_nm_find_best(parent_rate, rate, &_nm); diff --git a/target/linux/sunxi/patches-4.9/0006-clk-sunxi-ng-Implement-minimum-for-multipliers.patch b/target/linux/sunxi/patches-4.9/0006-clk-sunxi-ng-Implement-minimum-for-multipliers.patch deleted file mode 100644 index 668d596493e..00000000000 --- a/target/linux/sunxi/patches-4.9/0006-clk-sunxi-ng-Implement-minimum-for-multipliers.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 2beaa601c849e72683a2dd0fe6fd77763f19f051 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Fri, 30 Sep 2016 22:16:51 +0200 -Subject: clk: sunxi-ng: Implement minimum for multipliers - -Allow the CCU drivers to specify a multiplier for their clocks. - -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - drivers/clk/sunxi-ng/ccu_mult.c | 2 +- - drivers/clk/sunxi-ng/ccu_mult.h | 13 +++++++++---- - drivers/clk/sunxi-ng/ccu_nk.c | 8 ++++---- - drivers/clk/sunxi-ng/ccu_nkm.c | 8 ++++---- - drivers/clk/sunxi-ng/ccu_nkmp.c | 4 ++-- - drivers/clk/sunxi-ng/ccu_nm.c | 2 +- - 6 files changed, 21 insertions(+), 16 deletions(-) - ---- a/drivers/clk/sunxi-ng/ccu_mult.c -+++ b/drivers/clk/sunxi-ng/ccu_mult.c -@@ -105,7 +105,7 @@ static int ccu_mult_set_rate(struct clk_ - ccu_mux_helper_adjust_parent_for_prediv(&cm->common, &cm->mux, -1, - &parent_rate); - -- _cm.min = 1; -+ _cm.min = cm->mult.min; - _cm.max = 1 << cm->mult.width; - ccu_mult_find_best(parent_rate, rate, &_cm); - ---- a/drivers/clk/sunxi-ng/ccu_mult.h -+++ b/drivers/clk/sunxi-ng/ccu_mult.h -@@ -7,14 +7,19 @@ - struct ccu_mult_internal { - u8 shift; - u8 width; -+ u8 min; - }; - --#define _SUNXI_CCU_MULT(_shift, _width) \ -- { \ -- .shift = _shift, \ -- .width = _width, \ -+#define _SUNXI_CCU_MULT_MIN(_shift, _width, _min) \ -+ { \ -+ .shift = _shift, \ -+ .width = _width, \ -+ .min = _min, \ - } - -+#define _SUNXI_CCU_MULT(_shift, _width) \ -+ _SUNXI_CCU_MULT_MIN(_shift, _width, 1) -+ - struct ccu_mult { - u32 enable; - ---- a/drivers/clk/sunxi-ng/ccu_nk.c -+++ b/drivers/clk/sunxi-ng/ccu_nk.c -@@ -97,9 +97,9 @@ static long ccu_nk_round_rate(struct clk - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate *= nk->fixed_post_div; - -- _nk.min_n = 1; -+ _nk.min_n = nk->n.min; - _nk.max_n = 1 << nk->n.width; -- _nk.min_k = 1; -+ _nk.min_k = nk->k.min; - _nk.max_k = 1 << nk->k.width; - - ccu_nk_find_best(*parent_rate, rate, &_nk); -@@ -122,9 +122,9 @@ static int ccu_nk_set_rate(struct clk_hw - if (nk->common.features & CCU_FEATURE_FIXED_POSTDIV) - rate = rate * nk->fixed_post_div; - -- _nk.min_n = 1; -+ _nk.min_n = nk->n.min; - _nk.max_n = 1 << nk->n.width; -- _nk.min_k = 1; -+ _nk.min_k = nk->k.min; - _nk.max_k = 1 << nk->k.width; - - ccu_nk_find_best(parent_rate, rate, &_nk); ---- a/drivers/clk/sunxi-ng/ccu_nkm.c -+++ b/drivers/clk/sunxi-ng/ccu_nkm.c -@@ -100,9 +100,9 @@ static unsigned long ccu_nkm_round_rate( - struct ccu_nkm *nkm = data; - struct _ccu_nkm _nkm; - -- _nkm.min_n = 1; -+ _nkm.min_n = nkm->n.min; - _nkm.max_n = 1 << nkm->n.width; -- _nkm.min_k = 1; -+ _nkm.min_k = nkm->k.min; - _nkm.max_k = 1 << nkm->k.width; - _nkm.min_m = 1; - _nkm.max_m = nkm->m.max ?: 1 << nkm->m.width; -@@ -129,9 +129,9 @@ static int ccu_nkm_set_rate(struct clk_h - unsigned long flags; - u32 reg; - -- _nkm.min_n = 1; -+ _nkm.min_n = nkm->n.min; - _nkm.max_n = 1 << nkm->n.width; -- _nkm.min_k = 1; -+ _nkm.min_k = nkm->k.min; - _nkm.max_k = 1 << nkm->k.width; - _nkm.min_m = 1; - _nkm.max_m = nkm->m.max ?: 1 << nkm->m.width; ---- a/drivers/clk/sunxi-ng/ccu_nkmp.c -+++ b/drivers/clk/sunxi-ng/ccu_nkmp.c -@@ -107,9 +107,9 @@ static long ccu_nkmp_round_rate(struct c - struct ccu_nkmp *nkmp = hw_to_ccu_nkmp(hw); - struct _ccu_nkmp _nkmp; - -- _nkmp.min_n = 1; -+ _nkmp.min_n = nkmp->n.min; - _nkmp.max_n = 1 << nkmp->n.width; -- _nkmp.min_k = 1; -+ _nkmp.min_k = nkmp->k.min; - _nkmp.max_k = 1 << nkmp->k.width; - _nkmp.min_m = 1; - _nkmp.max_m = nkmp->m.max ?: 1 << nkmp->m.width; ---- a/drivers/clk/sunxi-ng/ccu_nm.c -+++ b/drivers/clk/sunxi-ng/ccu_nm.c -@@ -93,7 +93,7 @@ static long ccu_nm_round_rate(struct clk - struct ccu_nm *nm = hw_to_ccu_nm(hw); - struct _ccu_nm _nm; - -- _nm.min_n = 1; -+ _nm.min_n = nm->n.min; - _nm.max_n = 1 << nm->n.width; - _nm.min_m = 1; - _nm.max_m = nm->m.max ?: 1 << nm->m.width; diff --git a/target/linux/sunxi/patches-4.9/0007-clk-sunxi-ng-Add-A64-clocks.patch b/target/linux/sunxi/patches-4.9/0007-clk-sunxi-ng-Add-A64-clocks.patch deleted file mode 100644 index 1039a83b414..00000000000 --- a/target/linux/sunxi/patches-4.9/0007-clk-sunxi-ng-Add-A64-clocks.patch +++ /dev/null @@ -1,1295 +0,0 @@ -From c6a0637460c29799f1e63a6a4a65bda22caf4a54 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Wed, 6 Jul 2016 08:31:34 +0200 -Subject: clk: sunxi-ng: Add A64 clocks - -Add the A64 CCU clocks set. - -Acked-by: Rob Herring -Acked-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - .../devicetree/bindings/clock/sunxi-ccu.txt | 1 + - drivers/clk/sunxi-ng/Kconfig | 11 + - drivers/clk/sunxi-ng/Makefile | 1 + - drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 915 +++++++++++++++++++++ - drivers/clk/sunxi-ng/ccu-sun50i-a64.h | 72 ++ - include/dt-bindings/clock/sun50i-a64-ccu.h | 134 +++ - include/dt-bindings/reset/sun50i-a64-ccu.h | 98 +++ - 7 files changed, 1232 insertions(+) - create mode 100644 drivers/clk/sunxi-ng/ccu-sun50i-a64.c - create mode 100644 drivers/clk/sunxi-ng/ccu-sun50i-a64.h - create mode 100644 include/dt-bindings/clock/sun50i-a64-ccu.h - create mode 100644 include/dt-bindings/reset/sun50i-a64-ccu.h - ---- a/Documentation/devicetree/bindings/clock/sunxi-ccu.txt -+++ b/Documentation/devicetree/bindings/clock/sunxi-ccu.txt -@@ -7,6 +7,7 @@ Required properties : - - "allwinner,sun8i-a23-ccu" - - "allwinner,sun8i-a33-ccu" - - "allwinner,sun8i-h3-ccu" -+ - "allwinner,sun50i-a64-ccu" - - - reg: Must contain the registers base address and length - - clocks: phandle to the oscillators feeding the CCU. Two are needed: ---- a/drivers/clk/sunxi-ng/Kconfig -+++ b/drivers/clk/sunxi-ng/Kconfig -@@ -54,6 +54,17 @@ config SUNXI_CCU_MP - - # SoC Drivers - -+config SUN50I_A64_CCU -+ bool "Support for the Allwinner A64 CCU" -+ select SUNXI_CCU_DIV -+ select SUNXI_CCU_NK -+ select SUNXI_CCU_NKM -+ select SUNXI_CCU_NKMP -+ select SUNXI_CCU_NM -+ select SUNXI_CCU_MP -+ select SUNXI_CCU_PHASE -+ default ARM64 && ARCH_SUNXI -+ - config SUN6I_A31_CCU - bool "Support for the Allwinner A31/A31s CCU" - select SUNXI_CCU_DIV ---- a/drivers/clk/sunxi-ng/Makefile -+++ b/drivers/clk/sunxi-ng/Makefile -@@ -18,6 +18,7 @@ obj-$(CONFIG_SUNXI_CCU_NM) += ccu_nm.o - obj-$(CONFIG_SUNXI_CCU_MP) += ccu_mp.o - - # SoC support -+obj-$(CONFIG_SUN50I_A64_CCU) += ccu-sun50i-a64.o - obj-$(CONFIG_SUN6I_A31_CCU) += ccu-sun6i-a31.o - obj-$(CONFIG_SUN8I_A23_CCU) += ccu-sun8i-a23.o - obj-$(CONFIG_SUN8I_A33_CCU) += ccu-sun8i-a33.o ---- /dev/null -+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c -@@ -0,0 +1,915 @@ -+/* -+ * Copyright (c) 2016 Maxime Ripard. All rights reserved. -+ * -+ * This software is licensed under the terms of the GNU General Public -+ * License version 2, as published by the Free Software Foundation, and -+ * may be copied, distributed, and modified under those terms. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+ -+#include "ccu_common.h" -+#include "ccu_reset.h" -+ -+#include "ccu_div.h" -+#include "ccu_gate.h" -+#include "ccu_mp.h" -+#include "ccu_mult.h" -+#include "ccu_nk.h" -+#include "ccu_nkm.h" -+#include "ccu_nkmp.h" -+#include "ccu_nm.h" -+#include "ccu_phase.h" -+ -+#include "ccu-sun50i-a64.h" -+ -+static struct ccu_nkmp pll_cpux_clk = { -+ .enable = BIT(31), -+ .lock = BIT(28), -+ .n = _SUNXI_CCU_MULT(8, 5), -+ .k = _SUNXI_CCU_MULT(4, 2), -+ .m = _SUNXI_CCU_DIV(0, 2), -+ .p = _SUNXI_CCU_DIV_MAX(16, 2, 4), -+ .common = { -+ .reg = 0x000, -+ .hw.init = CLK_HW_INIT("pll-cpux", -+ "osc24M", -+ &ccu_nkmp_ops, -+ CLK_SET_RATE_UNGATE), -+ }, -+}; -+ -+/* -+ * The Audio PLL is supposed to have 4 outputs: 3 fixed factors from -+ * the base (2x, 4x and 8x), and one variable divider (the one true -+ * pll audio). -+ * -+ * We don't have any need for the variable divider for now, so we just -+ * hardcode it to match with the clock names -+ */ -+#define SUN50I_A64_PLL_AUDIO_REG 0x008 -+ -+static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_audio_base_clk, "pll-audio-base", -+ "osc24M", 0x008, -+ 8, 7, /* N */ -+ 0, 5, /* M */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video0_clk, "pll-video0", -+ "osc24M", 0x010, -+ 8, 7, /* N */ -+ 0, 4, /* M */ -+ BIT(24), /* frac enable */ -+ BIT(25), /* frac select */ -+ 270000000, /* frac rate 0 */ -+ 297000000, /* frac rate 1 */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_ve_clk, "pll-ve", -+ "osc24M", 0x018, -+ 8, 7, /* N */ -+ 0, 4, /* M */ -+ BIT(24), /* frac enable */ -+ BIT(25), /* frac select */ -+ 270000000, /* frac rate 0 */ -+ 297000000, /* frac rate 1 */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static SUNXI_CCU_NKM_WITH_GATE_LOCK(pll_ddr0_clk, "pll-ddr0", -+ "osc24M", 0x020, -+ 8, 5, /* N */ -+ 4, 2, /* K */ -+ 0, 2, /* M */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static struct ccu_nk pll_periph0_clk = { -+ .enable = BIT(31), -+ .lock = BIT(28), -+ .n = _SUNXI_CCU_MULT(8, 5), -+ .k = _SUNXI_CCU_MULT_MIN(4, 2, 2), -+ .fixed_post_div = 2, -+ .common = { -+ .reg = 0x028, -+ .features = CCU_FEATURE_FIXED_POSTDIV, -+ .hw.init = CLK_HW_INIT("pll-periph0", "osc24M", -+ &ccu_nk_ops, CLK_SET_RATE_UNGATE), -+ }, -+}; -+ -+static struct ccu_nk pll_periph1_clk = { -+ .enable = BIT(31), -+ .lock = BIT(28), -+ .n = _SUNXI_CCU_MULT(8, 5), -+ .k = _SUNXI_CCU_MULT_MIN(4, 2, 2), -+ .fixed_post_div = 2, -+ .common = { -+ .reg = 0x02c, -+ .features = CCU_FEATURE_FIXED_POSTDIV, -+ .hw.init = CLK_HW_INIT("pll-periph1", "osc24M", -+ &ccu_nk_ops, CLK_SET_RATE_UNGATE), -+ }, -+}; -+ -+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_video1_clk, "pll-video1", -+ "osc24M", 0x030, -+ 8, 7, /* N */ -+ 0, 4, /* M */ -+ BIT(24), /* frac enable */ -+ BIT(25), /* frac select */ -+ 270000000, /* frac rate 0 */ -+ 297000000, /* frac rate 1 */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu", -+ "osc24M", 0x038, -+ 8, 7, /* N */ -+ 0, 4, /* M */ -+ BIT(24), /* frac enable */ -+ BIT(25), /* frac select */ -+ 270000000, /* frac rate 0 */ -+ 297000000, /* frac rate 1 */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+/* -+ * The output function can be changed to something more complex that -+ * we do not handle yet. -+ * -+ * Hardcode the mode so that we don't fall in that case. -+ */ -+#define SUN50I_A64_PLL_MIPI_REG 0x040 -+ -+struct ccu_nkm pll_mipi_clk = { -+ .enable = BIT(31), -+ .lock = BIT(28), -+ .n = _SUNXI_CCU_MULT(8, 4), -+ .k = _SUNXI_CCU_MULT_MIN(4, 2, 2), -+ .m = _SUNXI_CCU_DIV(0, 4), -+ .common = { -+ .reg = 0x040, -+ .hw.init = CLK_HW_INIT("pll-mipi", "pll-video0", -+ &ccu_nkm_ops, CLK_SET_RATE_UNGATE), -+ }, -+}; -+ -+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_hsic_clk, "pll-hsic", -+ "osc24M", 0x044, -+ 8, 7, /* N */ -+ 0, 4, /* M */ -+ BIT(24), /* frac enable */ -+ BIT(25), /* frac select */ -+ 270000000, /* frac rate 0 */ -+ 297000000, /* frac rate 1 */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_de_clk, "pll-de", -+ "osc24M", 0x048, -+ 8, 7, /* N */ -+ 0, 4, /* M */ -+ BIT(24), /* frac enable */ -+ BIT(25), /* frac select */ -+ 270000000, /* frac rate 0 */ -+ 297000000, /* frac rate 1 */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static SUNXI_CCU_NM_WITH_GATE_LOCK(pll_ddr1_clk, "pll-ddr1", -+ "osc24M", 0x04c, -+ 8, 7, /* N */ -+ 0, 2, /* M */ -+ BIT(31), /* gate */ -+ BIT(28), /* lock */ -+ CLK_SET_RATE_UNGATE); -+ -+static const char * const cpux_parents[] = { "osc32k", "osc24M", -+ "pll-cpux" , "pll-cpux" }; -+static SUNXI_CCU_MUX(cpux_clk, "cpux", cpux_parents, -+ 0x050, 16, 2, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); -+ -+static SUNXI_CCU_M(axi_clk, "axi", "cpux", 0x050, 0, 2, 0); -+ -+static const char * const ahb1_parents[] = { "osc32k", "osc24M", -+ "axi" , "pll-periph0" }; -+static struct ccu_div ahb1_clk = { -+ .div = _SUNXI_CCU_DIV_FLAGS(4, 2, CLK_DIVIDER_POWER_OF_TWO), -+ -+ .mux = { -+ .shift = 12, -+ .width = 2, -+ -+ .variable_prediv = { -+ .index = 3, -+ .shift = 6, -+ .width = 2, -+ }, -+ }, -+ -+ .common = { -+ .reg = 0x054, -+ .features = CCU_FEATURE_VARIABLE_PREDIV, -+ .hw.init = CLK_HW_INIT_PARENTS("ahb1", -+ ahb1_parents, -+ &ccu_div_ops, -+ 0), -+ }, -+}; -+ -+static struct clk_div_table apb1_div_table[] = { -+ { .val = 0, .div = 2 }, -+ { .val = 1, .div = 2 }, -+ { .val = 2, .div = 4 }, -+ { .val = 3, .div = 8 }, -+ { /* Sentinel */ }, -+}; -+static SUNXI_CCU_DIV_TABLE(apb1_clk, "apb1", "ahb1", -+ 0x054, 8, 2, apb1_div_table, 0); -+ -+static const char * const apb2_parents[] = { "osc32k", "osc24M", -+ "pll-periph0-2x" , -+ "pll-periph0-2x" }; -+static SUNXI_CCU_MP_WITH_MUX(apb2_clk, "apb2", apb2_parents, 0x058, -+ 0, 5, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ 0); -+ -+static const char * const ahb2_parents[] = { "ahb1" , "pll-periph0" }; -+static const struct ccu_mux_fixed_prediv ahb2_fixed_predivs[] = { -+ { .index = 1, .div = 2 }, -+}; -+static struct ccu_mux ahb2_clk = { -+ .mux = { -+ .shift = 0, -+ .width = 1, -+ .fixed_predivs = ahb2_fixed_predivs, -+ .n_predivs = ARRAY_SIZE(ahb2_fixed_predivs), -+ }, -+ -+ .common = { -+ .reg = 0x05c, -+ .features = CCU_FEATURE_FIXED_PREDIV, -+ .hw.init = CLK_HW_INIT_PARENTS("ahb2", -+ ahb2_parents, -+ &ccu_mux_ops, -+ 0), -+ }, -+}; -+ -+static SUNXI_CCU_GATE(bus_mipi_dsi_clk, "bus-mipi-dsi", "ahb1", -+ 0x060, BIT(1), 0); -+static SUNXI_CCU_GATE(bus_ce_clk, "bus-ce", "ahb1", -+ 0x060, BIT(5), 0); -+static SUNXI_CCU_GATE(bus_dma_clk, "bus-dma", "ahb1", -+ 0x060, BIT(6), 0); -+static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb1", -+ 0x060, BIT(8), 0); -+static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb1", -+ 0x060, BIT(9), 0); -+static SUNXI_CCU_GATE(bus_mmc2_clk, "bus-mmc2", "ahb1", -+ 0x060, BIT(10), 0); -+static SUNXI_CCU_GATE(bus_nand_clk, "bus-nand", "ahb1", -+ 0x060, BIT(13), 0); -+static SUNXI_CCU_GATE(bus_dram_clk, "bus-dram", "ahb1", -+ 0x060, BIT(14), 0); -+static SUNXI_CCU_GATE(bus_emac_clk, "bus-emac", "ahb2", -+ 0x060, BIT(17), 0); -+static SUNXI_CCU_GATE(bus_ts_clk, "bus-ts", "ahb1", -+ 0x060, BIT(18), 0); -+static SUNXI_CCU_GATE(bus_hstimer_clk, "bus-hstimer", "ahb1", -+ 0x060, BIT(19), 0); -+static SUNXI_CCU_GATE(bus_spi0_clk, "bus-spi0", "ahb1", -+ 0x060, BIT(20), 0); -+static SUNXI_CCU_GATE(bus_spi1_clk, "bus-spi1", "ahb1", -+ 0x060, BIT(21), 0); -+static SUNXI_CCU_GATE(bus_otg_clk, "bus-otg", "ahb1", -+ 0x060, BIT(23), 0); -+static SUNXI_CCU_GATE(bus_ehci0_clk, "bus-ehci0", "ahb1", -+ 0x060, BIT(24), 0); -+static SUNXI_CCU_GATE(bus_ehci1_clk, "bus-ehci1", "ahb2", -+ 0x060, BIT(25), 0); -+static SUNXI_CCU_GATE(bus_ohci0_clk, "bus-ohci0", "ahb1", -+ 0x060, BIT(28), 0); -+static SUNXI_CCU_GATE(bus_ohci1_clk, "bus-ohci1", "ahb2", -+ 0x060, BIT(29), 0); -+ -+static SUNXI_CCU_GATE(bus_ve_clk, "bus-ve", "ahb1", -+ 0x064, BIT(0), 0); -+static SUNXI_CCU_GATE(bus_tcon0_clk, "bus-tcon0", "ahb1", -+ 0x064, BIT(3), 0); -+static SUNXI_CCU_GATE(bus_tcon1_clk, "bus-tcon1", "ahb1", -+ 0x064, BIT(4), 0); -+static SUNXI_CCU_GATE(bus_deinterlace_clk, "bus-deinterlace", "ahb1", -+ 0x064, BIT(5), 0); -+static SUNXI_CCU_GATE(bus_csi_clk, "bus-csi", "ahb1", -+ 0x064, BIT(8), 0); -+static SUNXI_CCU_GATE(bus_hdmi_clk, "bus-hdmi", "ahb1", -+ 0x064, BIT(11), 0); -+static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "ahb1", -+ 0x064, BIT(12), 0); -+static SUNXI_CCU_GATE(bus_gpu_clk, "bus-gpu", "ahb1", -+ 0x064, BIT(20), 0); -+static SUNXI_CCU_GATE(bus_msgbox_clk, "bus-msgbox", "ahb1", -+ 0x064, BIT(21), 0); -+static SUNXI_CCU_GATE(bus_spinlock_clk, "bus-spinlock", "ahb1", -+ 0x064, BIT(22), 0); -+ -+static SUNXI_CCU_GATE(bus_codec_clk, "bus-codec", "apb1", -+ 0x068, BIT(0), 0); -+static SUNXI_CCU_GATE(bus_spdif_clk, "bus-spdif", "apb1", -+ 0x068, BIT(1), 0); -+static SUNXI_CCU_GATE(bus_pio_clk, "bus-pio", "apb1", -+ 0x068, BIT(5), 0); -+static SUNXI_CCU_GATE(bus_ths_clk, "bus-ths", "apb1", -+ 0x068, BIT(8), 0); -+static SUNXI_CCU_GATE(bus_i2s0_clk, "bus-i2s0", "apb1", -+ 0x068, BIT(12), 0); -+static SUNXI_CCU_GATE(bus_i2s1_clk, "bus-i2s1", "apb1", -+ 0x068, BIT(13), 0); -+static SUNXI_CCU_GATE(bus_i2s2_clk, "bus-i2s2", "apb1", -+ 0x068, BIT(14), 0); -+ -+static SUNXI_CCU_GATE(bus_i2c0_clk, "bus-i2c0", "apb2", -+ 0x06c, BIT(0), 0); -+static SUNXI_CCU_GATE(bus_i2c1_clk, "bus-i2c1", "apb2", -+ 0x06c, BIT(1), 0); -+static SUNXI_CCU_GATE(bus_i2c2_clk, "bus-i2c2", "apb2", -+ 0x06c, BIT(2), 0); -+static SUNXI_CCU_GATE(bus_scr_clk, "bus-scr", "apb2", -+ 0x06c, BIT(5), 0); -+static SUNXI_CCU_GATE(bus_uart0_clk, "bus-uart0", "apb2", -+ 0x06c, BIT(16), 0); -+static SUNXI_CCU_GATE(bus_uart1_clk, "bus-uart1", "apb2", -+ 0x06c, BIT(17), 0); -+static SUNXI_CCU_GATE(bus_uart2_clk, "bus-uart2", "apb2", -+ 0x06c, BIT(18), 0); -+static SUNXI_CCU_GATE(bus_uart3_clk, "bus-uart3", "apb2", -+ 0x06c, BIT(19), 0); -+static SUNXI_CCU_GATE(bus_uart4_clk, "bus-uart4", "apb2", -+ 0x06c, BIT(20), 0); -+ -+static SUNXI_CCU_GATE(bus_dbg_clk, "bus-dbg", "ahb1", -+ 0x070, BIT(7), 0); -+ -+static struct clk_div_table ths_div_table[] = { -+ { .val = 0, .div = 1 }, -+ { .val = 1, .div = 2 }, -+ { .val = 2, .div = 4 }, -+ { .val = 3, .div = 6 }, -+}; -+static const char * const ths_parents[] = { "osc24M" }; -+static struct ccu_div ths_clk = { -+ .enable = BIT(31), -+ .div = _SUNXI_CCU_DIV_TABLE(0, 2, ths_div_table), -+ .mux = _SUNXI_CCU_MUX(24, 2), -+ .common = { -+ .reg = 0x074, -+ .hw.init = CLK_HW_INIT_PARENTS("ths", -+ ths_parents, -+ &ccu_div_ops, -+ 0), -+ }, -+}; -+ -+static const char * const mod0_default_parents[] = { "osc24M", "pll-periph0", -+ "pll-periph1" }; -+static SUNXI_CCU_MP_WITH_MUX_GATE(nand_clk, "nand", mod0_default_parents, 0x080, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static const char * const mmc_default_parents[] = { "osc24M", "pll-periph0-2x", -+ "pll-periph1-2x" }; -+static SUNXI_CCU_MP_WITH_MUX_GATE(mmc0_clk, "mmc0", mmc_default_parents, 0x088, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static SUNXI_CCU_MP_WITH_MUX_GATE(mmc1_clk, "mmc1", mmc_default_parents, 0x08c, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static SUNXI_CCU_MP_WITH_MUX_GATE(mmc2_clk, "mmc2", mmc_default_parents, 0x090, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static const char * const ts_parents[] = { "osc24M", "pll-periph0", }; -+static SUNXI_CCU_MP_WITH_MUX_GATE(ts_clk, "ts", ts_parents, 0x098, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 4, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static SUNXI_CCU_MP_WITH_MUX_GATE(ce_clk, "ce", mmc_default_parents, 0x09c, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static SUNXI_CCU_MP_WITH_MUX_GATE(spi0_clk, "spi0", mod0_default_parents, 0x0a0, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static SUNXI_CCU_MP_WITH_MUX_GATE(spi1_clk, "spi1", mod0_default_parents, 0x0a4, -+ 0, 4, /* M */ -+ 16, 2, /* P */ -+ 24, 2, /* mux */ -+ BIT(31), /* gate */ -+ 0); -+ -+static const char * const i2s_parents[] = { "pll-audio-8x", "pll-audio-4x", -+ "pll-audio-2x", "pll-audio" }; -+static SUNXI_CCU_MUX_WITH_GATE(i2s0_clk, "i2s0", i2s_parents, -+ 0x0b0, 16, 2, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_MUX_WITH_GATE(i2s1_clk, "i2s1", i2s_parents, -+ 0x0b4, 16, 2, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_MUX_WITH_GATE(i2s2_clk, "i2s2", i2s_parents, -+ 0x0b8, 16, 2, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_M_WITH_GATE(spdif_clk, "spdif", "pll-audio", -+ 0x0c0, 0, 4, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", -+ 0x0cc, BIT(8), 0); -+static SUNXI_CCU_GATE(usb_phy1_clk, "usb-phy1", "osc24M", -+ 0x0cc, BIT(9), 0); -+static SUNXI_CCU_GATE(usb_hsic_clk, "usb-hsic", "pll-hsic", -+ 0x0cc, BIT(10), 0); -+static SUNXI_CCU_GATE(usb_hsic_12m_clk, "usb-hsic-12M", "osc12M", -+ 0x0cc, BIT(11), 0); -+static SUNXI_CCU_GATE(usb_ohci0_clk, "usb-ohci0", "osc12M", -+ 0x0cc, BIT(16), 0); -+static SUNXI_CCU_GATE(usb_ohci1_clk, "usb-ohci1", "usb-ohci0", -+ 0x0cc, BIT(17), 0); -+ -+static const char * const dram_parents[] = { "pll-ddr0", "pll-ddr1" }; -+static SUNXI_CCU_M_WITH_MUX(dram_clk, "dram", dram_parents, -+ 0x0f4, 0, 4, 20, 2, CLK_IS_CRITICAL); -+ -+static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "dram", -+ 0x100, BIT(0), 0); -+static SUNXI_CCU_GATE(dram_csi_clk, "dram-csi", "dram", -+ 0x100, BIT(1), 0); -+static SUNXI_CCU_GATE(dram_deinterlace_clk, "dram-deinterlace", "dram", -+ 0x100, BIT(2), 0); -+static SUNXI_CCU_GATE(dram_ts_clk, "dram-ts", "dram", -+ 0x100, BIT(3), 0); -+ -+static const char * const de_parents[] = { "pll-periph0-2x", "pll-de" }; -+static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, -+ 0x104, 0, 4, 24, 3, BIT(31), 0); -+ -+static const char * const tcon0_parents[] = { "pll-mipi", "pll-video0-2x" }; -+static const u8 tcon0_table[] = { 0, 2, }; -+static SUNXI_CCU_MUX_TABLE_WITH_GATE(tcon0_clk, "tcon0", tcon0_parents, -+ tcon0_table, 0x118, 24, 3, BIT(31), -+ CLK_SET_RATE_PARENT); -+ -+static const char * const tcon1_parents[] = { "pll-video0", "pll-video1" }; -+static const u8 tcon1_table[] = { 0, 2, }; -+struct ccu_div tcon1_clk = { -+ .enable = BIT(31), -+ .div = _SUNXI_CCU_DIV(0, 4), -+ .mux = _SUNXI_CCU_MUX_TABLE(24, 2, tcon1_table), -+ .common = { -+ .reg = 0x11c, -+ .hw.init = CLK_HW_INIT_PARENTS("tcon1", -+ tcon1_parents, -+ &ccu_div_ops, -+ CLK_SET_RATE_PARENT), -+ }, -+}; -+ -+static const char * const deinterlace_parents[] = { "pll-periph0", "pll-periph1" }; -+static SUNXI_CCU_M_WITH_MUX_GATE(deinterlace_clk, "deinterlace", deinterlace_parents, -+ 0x124, 0, 4, 24, 3, BIT(31), 0); -+ -+static SUNXI_CCU_GATE(csi_misc_clk, "csi-misc", "osc24M", -+ 0x130, BIT(31), 0); -+ -+static const char * const csi_sclk_parents[] = { "pll-periph0", "pll-periph1" }; -+static SUNXI_CCU_M_WITH_MUX_GATE(csi_sclk_clk, "csi-sclk", csi_sclk_parents, -+ 0x134, 16, 4, 24, 3, BIT(31), 0); -+ -+static const char * const csi_mclk_parents[] = { "osc24M", "pll-video1", "pll-periph1" }; -+static SUNXI_CCU_M_WITH_MUX_GATE(csi_mclk_clk, "csi-mclk", csi_mclk_parents, -+ 0x134, 0, 5, 8, 3, BIT(15), 0); -+ -+static SUNXI_CCU_M_WITH_GATE(ve_clk, "ve", "pll-ve", -+ 0x13c, 16, 3, BIT(31), 0); -+ -+static SUNXI_CCU_GATE(ac_dig_clk, "ac-dig", "pll-audio", -+ 0x140, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_GATE(ac_dig_4x_clk, "ac-dig-4x", "pll-audio-4x", -+ 0x140, BIT(30), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_GATE(avs_clk, "avs", "osc24M", -+ 0x144, BIT(31), 0); -+ -+static const char * const hdmi_parents[] = { "pll-video0", "pll-video1" }; -+static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", hdmi_parents, -+ 0x150, 0, 4, 24, 2, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_GATE(hdmi_ddc_clk, "hdmi-ddc", "osc24M", -+ 0x154, BIT(31), 0); -+ -+static const char * const mbus_parents[] = { "osc24M", "pll-periph0-2x", -+ "pll-ddr0", "pll-ddr1" }; -+static SUNXI_CCU_M_WITH_MUX_GATE(mbus_clk, "mbus", mbus_parents, -+ 0x15c, 0, 3, 24, 2, BIT(31), CLK_IS_CRITICAL); -+ -+static const char * const dsi_dphy_parents[] = { "pll-video0", "pll-periph0" }; -+static const u8 dsi_dphy_table[] = { 0, 2, }; -+static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(dsi_dphy_clk, "dsi-dphy", -+ dsi_dphy_parents, dsi_dphy_table, -+ 0x168, 0, 4, 8, 2, BIT(31), CLK_SET_RATE_PARENT); -+ -+static SUNXI_CCU_M_WITH_GATE(gpu_clk, "gpu", "pll-gpu", -+ 0x1a0, 0, 3, BIT(31), CLK_SET_RATE_PARENT); -+ -+/* Fixed Factor clocks */ -+static CLK_FIXED_FACTOR(osc12M_clk, "osc12M", "osc24M", 1, 2, 0); -+ -+/* We hardcode the divider to 4 for now */ -+static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio", -+ "pll-audio-base", 4, 1, CLK_SET_RATE_PARENT); -+static CLK_FIXED_FACTOR(pll_audio_2x_clk, "pll-audio-2x", -+ "pll-audio-base", 2, 1, CLK_SET_RATE_PARENT); -+static CLK_FIXED_FACTOR(pll_audio_4x_clk, "pll-audio-4x", -+ "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT); -+static CLK_FIXED_FACTOR(pll_audio_8x_clk, "pll-audio-8x", -+ "pll-audio-base", 1, 2, CLK_SET_RATE_PARENT); -+static CLK_FIXED_FACTOR(pll_periph0_2x_clk, "pll-periph0-2x", -+ "pll-periph0", 1, 2, 0); -+static CLK_FIXED_FACTOR(pll_periph1_2x_clk, "pll-periph1-2x", -+ "pll-periph1", 1, 2, 0); -+static CLK_FIXED_FACTOR(pll_video0_2x_clk, "pll-video0-2x", -+ "pll-video0", 1, 2, CLK_SET_RATE_PARENT); -+ -+static struct ccu_common *sun50i_a64_ccu_clks[] = { -+ &pll_cpux_clk.common, -+ &pll_audio_base_clk.common, -+ &pll_video0_clk.common, -+ &pll_ve_clk.common, -+ &pll_ddr0_clk.common, -+ &pll_periph0_clk.common, -+ &pll_periph1_clk.common, -+ &pll_video1_clk.common, -+ &pll_gpu_clk.common, -+ &pll_mipi_clk.common, -+ &pll_hsic_clk.common, -+ &pll_de_clk.common, -+ &pll_ddr1_clk.common, -+ &cpux_clk.common, -+ &axi_clk.common, -+ &ahb1_clk.common, -+ &apb1_clk.common, -+ &apb2_clk.common, -+ &ahb2_clk.common, -+ &bus_mipi_dsi_clk.common, -+ &bus_ce_clk.common, -+ &bus_dma_clk.common, -+ &bus_mmc0_clk.common, -+ &bus_mmc1_clk.common, -+ &bus_mmc2_clk.common, -+ &bus_nand_clk.common, -+ &bus_dram_clk.common, -+ &bus_emac_clk.common, -+ &bus_ts_clk.common, -+ &bus_hstimer_clk.common, -+ &bus_spi0_clk.common, -+ &bus_spi1_clk.common, -+ &bus_otg_clk.common, -+ &bus_ehci0_clk.common, -+ &bus_ehci1_clk.common, -+ &bus_ohci0_clk.common, -+ &bus_ohci1_clk.common, -+ &bus_ve_clk.common, -+ &bus_tcon0_clk.common, -+ &bus_tcon1_clk.common, -+ &bus_deinterlace_clk.common, -+ &bus_csi_clk.common, -+ &bus_hdmi_clk.common, -+ &bus_de_clk.common, -+ &bus_gpu_clk.common, -+ &bus_msgbox_clk.common, -+ &bus_spinlock_clk.common, -+ &bus_codec_clk.common, -+ &bus_spdif_clk.common, -+ &bus_pio_clk.common, -+ &bus_ths_clk.common, -+ &bus_i2s0_clk.common, -+ &bus_i2s1_clk.common, -+ &bus_i2s2_clk.common, -+ &bus_i2c0_clk.common, -+ &bus_i2c1_clk.common, -+ &bus_i2c2_clk.common, -+ &bus_scr_clk.common, -+ &bus_uart0_clk.common, -+ &bus_uart1_clk.common, -+ &bus_uart2_clk.common, -+ &bus_uart3_clk.common, -+ &bus_uart4_clk.common, -+ &bus_dbg_clk.common, -+ &ths_clk.common, -+ &nand_clk.common, -+ &mmc0_clk.common, -+ &mmc1_clk.common, -+ &mmc2_clk.common, -+ &ts_clk.common, -+ &ce_clk.common, -+ &spi0_clk.common, -+ &spi1_clk.common, -+ &i2s0_clk.common, -+ &i2s1_clk.common, -+ &i2s2_clk.common, -+ &spdif_clk.common, -+ &usb_phy0_clk.common, -+ &usb_phy1_clk.common, -+ &usb_hsic_clk.common, -+ &usb_hsic_12m_clk.common, -+ &usb_ohci0_clk.common, -+ &usb_ohci1_clk.common, -+ &dram_clk.common, -+ &dram_ve_clk.common, -+ &dram_csi_clk.common, -+ &dram_deinterlace_clk.common, -+ &dram_ts_clk.common, -+ &de_clk.common, -+ &tcon0_clk.common, -+ &tcon1_clk.common, -+ &deinterlace_clk.common, -+ &csi_misc_clk.common, -+ &csi_sclk_clk.common, -+ &csi_mclk_clk.common, -+ &ve_clk.common, -+ &ac_dig_clk.common, -+ &ac_dig_4x_clk.common, -+ &avs_clk.common, -+ &hdmi_clk.common, -+ &hdmi_ddc_clk.common, -+ &mbus_clk.common, -+ &dsi_dphy_clk.common, -+ &gpu_clk.common, -+}; -+ -+static struct clk_hw_onecell_data sun50i_a64_hw_clks = { -+ .hws = { -+ [CLK_OSC_12M] = &osc12M_clk.hw, -+ [CLK_PLL_CPUX] = &pll_cpux_clk.common.hw, -+ [CLK_PLL_AUDIO_BASE] = &pll_audio_base_clk.common.hw, -+ [CLK_PLL_AUDIO] = &pll_audio_clk.hw, -+ [CLK_PLL_AUDIO_2X] = &pll_audio_2x_clk.hw, -+ [CLK_PLL_AUDIO_4X] = &pll_audio_4x_clk.hw, -+ [CLK_PLL_AUDIO_8X] = &pll_audio_8x_clk.hw, -+ [CLK_PLL_VIDEO0] = &pll_video0_clk.common.hw, -+ [CLK_PLL_VIDEO0_2X] = &pll_video0_2x_clk.hw, -+ [CLK_PLL_VE] = &pll_ve_clk.common.hw, -+ [CLK_PLL_DDR0] = &pll_ddr0_clk.common.hw, -+ [CLK_PLL_PERIPH0] = &pll_periph0_clk.common.hw, -+ [CLK_PLL_PERIPH0_2X] = &pll_periph0_2x_clk.hw, -+ [CLK_PLL_PERIPH1] = &pll_periph1_clk.common.hw, -+ [CLK_PLL_PERIPH1_2X] = &pll_periph1_2x_clk.hw, -+ [CLK_PLL_VIDEO1] = &pll_video1_clk.common.hw, -+ [CLK_PLL_GPU] = &pll_gpu_clk.common.hw, -+ [CLK_PLL_MIPI] = &pll_mipi_clk.common.hw, -+ [CLK_PLL_HSIC] = &pll_hsic_clk.common.hw, -+ [CLK_PLL_DE] = &pll_de_clk.common.hw, -+ [CLK_PLL_DDR1] = &pll_ddr1_clk.common.hw, -+ [CLK_CPUX] = &cpux_clk.common.hw, -+ [CLK_AXI] = &axi_clk.common.hw, -+ [CLK_AHB1] = &ahb1_clk.common.hw, -+ [CLK_APB1] = &apb1_clk.common.hw, -+ [CLK_APB2] = &apb2_clk.common.hw, -+ [CLK_AHB2] = &ahb2_clk.common.hw, -+ [CLK_BUS_MIPI_DSI] = &bus_mipi_dsi_clk.common.hw, -+ [CLK_BUS_CE] = &bus_ce_clk.common.hw, -+ [CLK_BUS_DMA] = &bus_dma_clk.common.hw, -+ [CLK_BUS_MMC0] = &bus_mmc0_clk.common.hw, -+ [CLK_BUS_MMC1] = &bus_mmc1_clk.common.hw, -+ [CLK_BUS_MMC2] = &bus_mmc2_clk.common.hw, -+ [CLK_BUS_NAND] = &bus_nand_clk.common.hw, -+ [CLK_BUS_DRAM] = &bus_dram_clk.common.hw, -+ [CLK_BUS_EMAC] = &bus_emac_clk.common.hw, -+ [CLK_BUS_TS] = &bus_ts_clk.common.hw, -+ [CLK_BUS_HSTIMER] = &bus_hstimer_clk.common.hw, -+ [CLK_BUS_SPI0] = &bus_spi0_clk.common.hw, -+ [CLK_BUS_SPI1] = &bus_spi1_clk.common.hw, -+ [CLK_BUS_OTG] = &bus_otg_clk.common.hw, -+ [CLK_BUS_EHCI0] = &bus_ehci0_clk.common.hw, -+ [CLK_BUS_EHCI1] = &bus_ehci1_clk.common.hw, -+ [CLK_BUS_OHCI0] = &bus_ohci0_clk.common.hw, -+ [CLK_BUS_OHCI1] = &bus_ohci1_clk.common.hw, -+ [CLK_BUS_VE] = &bus_ve_clk.common.hw, -+ [CLK_BUS_TCON0] = &bus_tcon0_clk.common.hw, -+ [CLK_BUS_TCON1] = &bus_tcon1_clk.common.hw, -+ [CLK_BUS_DEINTERLACE] = &bus_deinterlace_clk.common.hw, -+ [CLK_BUS_CSI] = &bus_csi_clk.common.hw, -+ [CLK_BUS_HDMI] = &bus_hdmi_clk.common.hw, -+ [CLK_BUS_DE] = &bus_de_clk.common.hw, -+ [CLK_BUS_GPU] = &bus_gpu_clk.common.hw, -+ [CLK_BUS_MSGBOX] = &bus_msgbox_clk.common.hw, -+ [CLK_BUS_SPINLOCK] = &bus_spinlock_clk.common.hw, -+ [CLK_BUS_CODEC] = &bus_codec_clk.common.hw, -+ [CLK_BUS_SPDIF] = &bus_spdif_clk.common.hw, -+ [CLK_BUS_PIO] = &bus_pio_clk.common.hw, -+ [CLK_BUS_THS] = &bus_ths_clk.common.hw, -+ [CLK_BUS_I2S0] = &bus_i2s0_clk.common.hw, -+ [CLK_BUS_I2S1] = &bus_i2s1_clk.common.hw, -+ [CLK_BUS_I2S2] = &bus_i2s2_clk.common.hw, -+ [CLK_BUS_I2C0] = &bus_i2c0_clk.common.hw, -+ [CLK_BUS_I2C1] = &bus_i2c1_clk.common.hw, -+ [CLK_BUS_I2C2] = &bus_i2c2_clk.common.hw, -+ [CLK_BUS_UART0] = &bus_uart0_clk.common.hw, -+ [CLK_BUS_UART1] = &bus_uart1_clk.common.hw, -+ [CLK_BUS_UART2] = &bus_uart2_clk.common.hw, -+ [CLK_BUS_UART3] = &bus_uart3_clk.common.hw, -+ [CLK_BUS_UART4] = &bus_uart4_clk.common.hw, -+ [CLK_BUS_SCR] = &bus_scr_clk.common.hw, -+ [CLK_BUS_DBG] = &bus_dbg_clk.common.hw, -+ [CLK_THS] = &ths_clk.common.hw, -+ [CLK_NAND] = &nand_clk.common.hw, -+ [CLK_MMC0] = &mmc0_clk.common.hw, -+ [CLK_MMC1] = &mmc1_clk.common.hw, -+ [CLK_MMC2] = &mmc2_clk.common.hw, -+ [CLK_TS] = &ts_clk.common.hw, -+ [CLK_CE] = &ce_clk.common.hw, -+ [CLK_SPI0] = &spi0_clk.common.hw, -+ [CLK_SPI1] = &spi1_clk.common.hw, -+ [CLK_I2S0] = &i2s0_clk.common.hw, -+ [CLK_I2S1] = &i2s1_clk.common.hw, -+ [CLK_I2S2] = &i2s2_clk.common.hw, -+ [CLK_SPDIF] = &spdif_clk.common.hw, -+ [CLK_USB_PHY0] = &usb_phy0_clk.common.hw, -+ [CLK_USB_PHY1] = &usb_phy1_clk.common.hw, -+ [CLK_USB_HSIC] = &usb_hsic_clk.common.hw, -+ [CLK_USB_HSIC_12M] = &usb_hsic_12m_clk.common.hw, -+ [CLK_USB_OHCI0] = &usb_ohci0_clk.common.hw, -+ [CLK_USB_OHCI1] = &usb_ohci1_clk.common.hw, -+ [CLK_DRAM] = &dram_clk.common.hw, -+ [CLK_DRAM_VE] = &dram_ve_clk.common.hw, -+ [CLK_DRAM_CSI] = &dram_csi_clk.common.hw, -+ [CLK_DRAM_DEINTERLACE] = &dram_deinterlace_clk.common.hw, -+ [CLK_DRAM_TS] = &dram_ts_clk.common.hw, -+ [CLK_DE] = &de_clk.common.hw, -+ [CLK_TCON0] = &tcon0_clk.common.hw, -+ [CLK_TCON1] = &tcon1_clk.common.hw, -+ [CLK_DEINTERLACE] = &deinterlace_clk.common.hw, -+ [CLK_CSI_MISC] = &csi_misc_clk.common.hw, -+ [CLK_CSI_SCLK] = &csi_sclk_clk.common.hw, -+ [CLK_CSI_MCLK] = &csi_mclk_clk.common.hw, -+ [CLK_VE] = &ve_clk.common.hw, -+ [CLK_AC_DIG] = &ac_dig_clk.common.hw, -+ [CLK_AC_DIG_4X] = &ac_dig_4x_clk.common.hw, -+ [CLK_AVS] = &avs_clk.common.hw, -+ [CLK_HDMI] = &hdmi_clk.common.hw, -+ [CLK_HDMI_DDC] = &hdmi_ddc_clk.common.hw, -+ [CLK_MBUS] = &mbus_clk.common.hw, -+ [CLK_DSI_DPHY] = &dsi_dphy_clk.common.hw, -+ [CLK_GPU] = &gpu_clk.common.hw, -+ }, -+ .num = CLK_NUMBER, -+}; -+ -+static struct ccu_reset_map sun50i_a64_ccu_resets[] = { -+ [RST_USB_PHY0] = { 0x0cc, BIT(0) }, -+ [RST_USB_PHY1] = { 0x0cc, BIT(1) }, -+ [RST_USB_HSIC] = { 0x0cc, BIT(2) }, -+ -+ [RST_DRAM] = { 0x0f4, BIT(31) }, -+ [RST_MBUS] = { 0x0fc, BIT(31) }, -+ -+ [RST_BUS_MIPI_DSI] = { 0x2c0, BIT(1) }, -+ [RST_BUS_CE] = { 0x2c0, BIT(5) }, -+ [RST_BUS_DMA] = { 0x2c0, BIT(6) }, -+ [RST_BUS_MMC0] = { 0x2c0, BIT(8) }, -+ [RST_BUS_MMC1] = { 0x2c0, BIT(9) }, -+ [RST_BUS_MMC2] = { 0x2c0, BIT(10) }, -+ [RST_BUS_NAND] = { 0x2c0, BIT(13) }, -+ [RST_BUS_DRAM] = { 0x2c0, BIT(14) }, -+ [RST_BUS_EMAC] = { 0x2c0, BIT(17) }, -+ [RST_BUS_TS] = { 0x2c0, BIT(18) }, -+ [RST_BUS_HSTIMER] = { 0x2c0, BIT(19) }, -+ [RST_BUS_SPI0] = { 0x2c0, BIT(20) }, -+ [RST_BUS_SPI1] = { 0x2c0, BIT(21) }, -+ [RST_BUS_OTG] = { 0x2c0, BIT(23) }, -+ [RST_BUS_EHCI0] = { 0x2c0, BIT(24) }, -+ [RST_BUS_EHCI1] = { 0x2c0, BIT(25) }, -+ [RST_BUS_OHCI0] = { 0x2c0, BIT(28) }, -+ [RST_BUS_OHCI1] = { 0x2c0, BIT(29) }, -+ -+ [RST_BUS_VE] = { 0x2c4, BIT(0) }, -+ [RST_BUS_TCON0] = { 0x2c4, BIT(3) }, -+ [RST_BUS_TCON1] = { 0x2c4, BIT(4) }, -+ [RST_BUS_DEINTERLACE] = { 0x2c4, BIT(5) }, -+ [RST_BUS_CSI] = { 0x2c4, BIT(8) }, -+ [RST_BUS_HDMI0] = { 0x2c4, BIT(10) }, -+ [RST_BUS_HDMI1] = { 0x2c4, BIT(11) }, -+ [RST_BUS_DE] = { 0x2c4, BIT(12) }, -+ [RST_BUS_GPU] = { 0x2c4, BIT(20) }, -+ [RST_BUS_MSGBOX] = { 0x2c4, BIT(21) }, -+ [RST_BUS_SPINLOCK] = { 0x2c4, BIT(22) }, -+ [RST_BUS_DBG] = { 0x2c4, BIT(31) }, -+ -+ [RST_BUS_LVDS] = { 0x2c8, BIT(0) }, -+ -+ [RST_BUS_CODEC] = { 0x2d0, BIT(0) }, -+ [RST_BUS_SPDIF] = { 0x2d0, BIT(1) }, -+ [RST_BUS_THS] = { 0x2d0, BIT(8) }, -+ [RST_BUS_I2S0] = { 0x2d0, BIT(12) }, -+ [RST_BUS_I2S1] = { 0x2d0, BIT(13) }, -+ [RST_BUS_I2S2] = { 0x2d0, BIT(14) }, -+ -+ [RST_BUS_I2C0] = { 0x2d8, BIT(0) }, -+ [RST_BUS_I2C1] = { 0x2d8, BIT(1) }, -+ [RST_BUS_I2C2] = { 0x2d8, BIT(2) }, -+ [RST_BUS_SCR] = { 0x2d8, BIT(5) }, -+ [RST_BUS_UART0] = { 0x2d8, BIT(16) }, -+ [RST_BUS_UART1] = { 0x2d8, BIT(17) }, -+ [RST_BUS_UART2] = { 0x2d8, BIT(18) }, -+ [RST_BUS_UART3] = { 0x2d8, BIT(19) }, -+ [RST_BUS_UART4] = { 0x2d8, BIT(20) }, -+}; -+ -+static const struct sunxi_ccu_desc sun50i_a64_ccu_desc = { -+ .ccu_clks = sun50i_a64_ccu_clks, -+ .num_ccu_clks = ARRAY_SIZE(sun50i_a64_ccu_clks), -+ -+ .hw_clks = &sun50i_a64_hw_clks, -+ -+ .resets = sun50i_a64_ccu_resets, -+ .num_resets = ARRAY_SIZE(sun50i_a64_ccu_resets), -+}; -+ -+static int sun50i_a64_ccu_probe(struct platform_device *pdev) -+{ -+ struct resource *res; -+ void __iomem *reg; -+ u32 val; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ reg = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(reg)) -+ return PTR_ERR(reg); -+ -+ /* Force the PLL-Audio-1x divider to 4 */ -+ val = readl(reg + SUN50I_A64_PLL_AUDIO_REG); -+ val &= ~GENMASK(19, 16); -+ writel(val | (3 << 16), reg + SUN50I_A64_PLL_AUDIO_REG); -+ -+ writel(0x515, reg + SUN50I_A64_PLL_MIPI_REG); -+ -+ return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_a64_ccu_desc); -+} -+ -+static const struct of_device_id sun50i_a64_ccu_ids[] = { -+ { .compatible = "allwinner,sun50i-a64-ccu" }, -+ { } -+}; -+ -+static struct platform_driver sun50i_a64_ccu_driver = { -+ .probe = sun50i_a64_ccu_probe, -+ .driver = { -+ .name = "sun50i-a64-ccu", -+ .of_match_table = sun50i_a64_ccu_ids, -+ }, -+}; -+builtin_platform_driver(sun50i_a64_ccu_driver); ---- /dev/null -+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.h -@@ -0,0 +1,72 @@ -+/* -+ * Copyright 2016 Maxime Ripard -+ * -+ * Maxime Ripard -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ */ -+ -+#ifndef _CCU_SUN50I_A64_H_ -+#define _CCU_SUN50I_A64_H_ -+ -+#include -+#include -+ -+#define CLK_OSC_12M 0 -+#define CLK_PLL_CPUX 1 -+#define CLK_PLL_AUDIO_BASE 2 -+#define CLK_PLL_AUDIO 3 -+#define CLK_PLL_AUDIO_2X 4 -+#define CLK_PLL_AUDIO_4X 5 -+#define CLK_PLL_AUDIO_8X 6 -+#define CLK_PLL_VIDEO0 7 -+#define CLK_PLL_VIDEO0_2X 8 -+#define CLK_PLL_VE 9 -+#define CLK_PLL_DDR0 10 -+#define CLK_PLL_PERIPH0 11 -+#define CLK_PLL_PERIPH0_2X 12 -+#define CLK_PLL_PERIPH1 13 -+#define CLK_PLL_PERIPH1_2X 14 -+#define CLK_PLL_VIDEO1 15 -+#define CLK_PLL_GPU 16 -+#define CLK_PLL_MIPI 17 -+#define CLK_PLL_HSIC 18 -+#define CLK_PLL_DE 19 -+#define CLK_PLL_DDR1 20 -+#define CLK_CPUX 21 -+#define CLK_AXI 22 -+#define CLK_APB 23 -+#define CLK_AHB1 24 -+#define CLK_APB1 25 -+#define CLK_APB2 26 -+#define CLK_AHB2 27 -+ -+/* All the bus gates are exported */ -+ -+/* The first bunch of module clocks are exported */ -+ -+#define CLK_USB_OHCI0_12M 90 -+ -+#define CLK_USB_OHCI1_12M 92 -+ -+#define CLK_DRAM 94 -+ -+/* All the DRAM gates are exported */ -+ -+/* Some more module clocks are exported */ -+ -+#define CLK_MBUS 112 -+ -+/* And the DSI and GPU module clock is exported */ -+ -+#define CLK_NUMBER (CLK_GPU + 1) -+ -+#endif /* _CCU_SUN50I_A64_H_ */ ---- /dev/null -+++ b/include/dt-bindings/clock/sun50i-a64-ccu.h -@@ -0,0 +1,134 @@ -+/* -+ * Copyright (C) 2016 Maxime Ripard -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DT_BINDINGS_CLK_SUN50I_A64_H_ -+#define _DT_BINDINGS_CLK_SUN50I_A64_H_ -+ -+#define CLK_BUS_MIPI_DSI 28 -+#define CLK_BUS_CE 29 -+#define CLK_BUS_DMA 30 -+#define CLK_BUS_MMC0 31 -+#define CLK_BUS_MMC1 32 -+#define CLK_BUS_MMC2 33 -+#define CLK_BUS_NAND 34 -+#define CLK_BUS_DRAM 35 -+#define CLK_BUS_EMAC 36 -+#define CLK_BUS_TS 37 -+#define CLK_BUS_HSTIMER 38 -+#define CLK_BUS_SPI0 39 -+#define CLK_BUS_SPI1 40 -+#define CLK_BUS_OTG 41 -+#define CLK_BUS_EHCI0 42 -+#define CLK_BUS_EHCI1 43 -+#define CLK_BUS_OHCI0 44 -+#define CLK_BUS_OHCI1 45 -+#define CLK_BUS_VE 46 -+#define CLK_BUS_TCON0 47 -+#define CLK_BUS_TCON1 48 -+#define CLK_BUS_DEINTERLACE 49 -+#define CLK_BUS_CSI 50 -+#define CLK_BUS_HDMI 51 -+#define CLK_BUS_DE 52 -+#define CLK_BUS_GPU 53 -+#define CLK_BUS_MSGBOX 54 -+#define CLK_BUS_SPINLOCK 55 -+#define CLK_BUS_CODEC 56 -+#define CLK_BUS_SPDIF 57 -+#define CLK_BUS_PIO 58 -+#define CLK_BUS_THS 59 -+#define CLK_BUS_I2S0 60 -+#define CLK_BUS_I2S1 61 -+#define CLK_BUS_I2S2 62 -+#define CLK_BUS_I2C0 63 -+#define CLK_BUS_I2C1 64 -+#define CLK_BUS_I2C2 65 -+#define CLK_BUS_SCR 66 -+#define CLK_BUS_UART0 67 -+#define CLK_BUS_UART1 68 -+#define CLK_BUS_UART2 69 -+#define CLK_BUS_UART3 70 -+#define CLK_BUS_UART4 71 -+#define CLK_BUS_DBG 72 -+#define CLK_THS 73 -+#define CLK_NAND 74 -+#define CLK_MMC0 75 -+#define CLK_MMC1 76 -+#define CLK_MMC2 77 -+#define CLK_TS 78 -+#define CLK_CE 79 -+#define CLK_SPI0 80 -+#define CLK_SPI1 81 -+#define CLK_I2S0 82 -+#define CLK_I2S1 83 -+#define CLK_I2S2 84 -+#define CLK_SPDIF 85 -+#define CLK_USB_PHY0 86 -+#define CLK_USB_PHY1 87 -+#define CLK_USB_HSIC 88 -+#define CLK_USB_HSIC_12M 89 -+ -+#define CLK_USB_OHCI0 91 -+ -+#define CLK_USB_OHCI1 93 -+ -+#define CLK_DRAM_VE 95 -+#define CLK_DRAM_CSI 96 -+#define CLK_DRAM_DEINTERLACE 97 -+#define CLK_DRAM_TS 98 -+#define CLK_DE 99 -+#define CLK_TCON0 100 -+#define CLK_TCON1 101 -+#define CLK_DEINTERLACE 102 -+#define CLK_CSI_MISC 103 -+#define CLK_CSI_SCLK 104 -+#define CLK_CSI_MCLK 105 -+#define CLK_VE 106 -+#define CLK_AC_DIG 107 -+#define CLK_AC_DIG_4X 108 -+#define CLK_AVS 109 -+#define CLK_HDMI 110 -+#define CLK_HDMI_DDC 111 -+ -+#define CLK_DSI_DPHY 113 -+#define CLK_GPU 114 -+ -+#endif /* _DT_BINDINGS_CLK_SUN50I_H_ */ ---- /dev/null -+++ b/include/dt-bindings/reset/sun50i-a64-ccu.h -@@ -0,0 +1,98 @@ -+/* -+ * Copyright (C) 2016 Maxime Ripard -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef _DT_BINDINGS_RST_SUN50I_A64_H_ -+#define _DT_BINDINGS_RST_SUN50I_A64_H_ -+ -+#define RST_USB_PHY0 0 -+#define RST_USB_PHY1 1 -+#define RST_USB_HSIC 2 -+#define RST_DRAM 3 -+#define RST_MBUS 4 -+#define RST_BUS_MIPI_DSI 5 -+#define RST_BUS_CE 6 -+#define RST_BUS_DMA 7 -+#define RST_BUS_MMC0 8 -+#define RST_BUS_MMC1 9 -+#define RST_BUS_MMC2 10 -+#define RST_BUS_NAND 11 -+#define RST_BUS_DRAM 12 -+#define RST_BUS_EMAC 13 -+#define RST_BUS_TS 14 -+#define RST_BUS_HSTIMER 15 -+#define RST_BUS_SPI0 16 -+#define RST_BUS_SPI1 17 -+#define RST_BUS_OTG 18 -+#define RST_BUS_EHCI0 19 -+#define RST_BUS_EHCI1 20 -+#define RST_BUS_OHCI0 21 -+#define RST_BUS_OHCI1 22 -+#define RST_BUS_VE 23 -+#define RST_BUS_TCON0 24 -+#define RST_BUS_TCON1 25 -+#define RST_BUS_DEINTERLACE 26 -+#define RST_BUS_CSI 27 -+#define RST_BUS_HDMI0 28 -+#define RST_BUS_HDMI1 29 -+#define RST_BUS_DE 30 -+#define RST_BUS_GPU 31 -+#define RST_BUS_MSGBOX 32 -+#define RST_BUS_SPINLOCK 33 -+#define RST_BUS_DBG 34 -+#define RST_BUS_LVDS 35 -+#define RST_BUS_CODEC 36 -+#define RST_BUS_SPDIF 37 -+#define RST_BUS_THS 38 -+#define RST_BUS_I2S0 39 -+#define RST_BUS_I2S1 40 -+#define RST_BUS_I2S2 41 -+#define RST_BUS_I2C0 42 -+#define RST_BUS_I2C1 43 -+#define RST_BUS_I2C2 44 -+#define RST_BUS_SCR 45 -+#define RST_BUS_UART0 46 -+#define RST_BUS_UART1 47 -+#define RST_BUS_UART2 48 -+#define RST_BUS_UART3 49 -+#define RST_BUS_UART4 50 -+ -+#endif /* _DT_BINDINGS_RST_SUN50I_A64_H_ */ diff --git a/target/linux/sunxi/patches-4.9/0010-arm64-dts-add-Allwinner-A64-SoC-.dtsi.patch b/target/linux/sunxi/patches-4.9/0010-arm64-dts-add-Allwinner-A64-SoC-.dtsi.patch deleted file mode 100644 index eaaba96fc11..00000000000 --- a/target/linux/sunxi/patches-4.9/0010-arm64-dts-add-Allwinner-A64-SoC-.dtsi.patch +++ /dev/null @@ -1,311 +0,0 @@ -From 6bc37fac30cf01c39feb17834090089304bd1d31 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Mon, 18 Jan 2016 10:24:31 +0000 -Subject: arm64: dts: add Allwinner A64 SoC .dtsi - -The Allwinner A64 SoC is a low-cost chip with 4 ARM Cortex-A53 cores -and the typical tablet / TV box peripherals. -The SoC is based on the (32-bit) Allwinner H3 chip, sharing most of -the peripherals and the memory map. -Although the cores are proper 64-bit ones, the whole SoC is actually -limited to 4GB (including all the supported DRAM), so we use 32-bit -address and size cells. This has the nice feature of us being able to -reuse the DT for 32-bit kernels as well. -This .dtsi lists the hardware that we support so far. - -Signed-off-by: Andre Przywara -Acked-by: Rob Herring -Acked-by: Chen-Yu Tsai -[Maxime: Convert to CCU binding, drop the MMC support for now] -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/arm/sunxi.txt | 1 + - MAINTAINERS | 1 + - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 263 ++++++++++++++++++++++++ - 3 files changed, 265 insertions(+) - create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi - ---- a/Documentation/devicetree/bindings/arm/sunxi.txt -+++ b/Documentation/devicetree/bindings/arm/sunxi.txt -@@ -14,4 +14,5 @@ using one of the following compatible st - allwinner,sun8i-a83t - allwinner,sun8i-h3 - allwinner,sun9i-a80 -+ allwinner,sun50i-a64 - nextthing,gr8 ---- a/MAINTAINERS -+++ b/MAINTAINERS -@@ -1026,6 +1026,7 @@ L: linux-arm-kernel@lists.infradead.org - S: Maintained - N: sun[x456789]i - F: arch/arm/boot/dts/ntc-gr8* -+F: arch/arm64/boot/dts/allwinner/ - - ARM/Allwinner SoC Clock Support - M: Emilio López ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -0,0 +1,263 @@ -+/* -+ * Copyright (C) 2016 ARM Ltd. -+ * based on the Allwinner H3 dtsi: -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include -+#include -+#include -+#include -+ -+/ { -+ interrupt-parent = <&gic>; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ -+ cpus { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ cpu0: cpu@0 { -+ compatible = "arm,cortex-a53", "arm,armv8"; -+ device_type = "cpu"; -+ reg = <0>; -+ enable-method = "psci"; -+ }; -+ -+ cpu1: cpu@1 { -+ compatible = "arm,cortex-a53", "arm,armv8"; -+ device_type = "cpu"; -+ reg = <1>; -+ enable-method = "psci"; -+ }; -+ -+ cpu2: cpu@2 { -+ compatible = "arm,cortex-a53", "arm,armv8"; -+ device_type = "cpu"; -+ reg = <2>; -+ enable-method = "psci"; -+ }; -+ -+ cpu3: cpu@3 { -+ compatible = "arm,cortex-a53", "arm,armv8"; -+ device_type = "cpu"; -+ reg = <3>; -+ enable-method = "psci"; -+ }; -+ }; -+ -+ osc24M: osc24M_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <24000000>; -+ clock-output-names = "osc24M"; -+ }; -+ -+ osc32k: osc32k_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <32768>; -+ clock-output-names = "osc32k"; -+ }; -+ -+ psci { -+ compatible = "arm,psci-0.2"; -+ method = "smc"; -+ }; -+ -+ timer { -+ compatible = "arm,armv8-timer"; -+ interrupts = , -+ , -+ , -+ ; -+ }; -+ -+ soc { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ ccu: clock@01c20000 { -+ compatible = "allwinner,sun50i-a64-ccu"; -+ reg = <0x01c20000 0x400>; -+ clocks = <&osc24M>, <&osc32k>; -+ clock-names = "hosc", "losc"; -+ #clock-cells = <1>; -+ #reset-cells = <1>; -+ }; -+ -+ pio: pinctrl@1c20800 { -+ compatible = "allwinner,sun50i-a64-pinctrl"; -+ reg = <0x01c20800 0x400>; -+ interrupts = , -+ , -+ ; -+ clocks = <&ccu CLK_BUS_PIO>; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ -+ i2c1_pins: i2c1_pins { -+ pins = "PH2", "PH3"; -+ function = "i2c1"; -+ }; -+ -+ uart0_pins_a: uart0@0 { -+ pins = "PB8", "PB9"; -+ function = "uart0"; -+ }; -+ }; -+ -+ uart0: serial@1c28000 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28000 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&ccu CLK_BUS_UART0>; -+ resets = <&ccu RST_BUS_UART0>; -+ status = "disabled"; -+ }; -+ -+ uart1: serial@1c28400 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28400 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&ccu CLK_BUS_UART1>; -+ resets = <&ccu RST_BUS_UART1>; -+ status = "disabled"; -+ }; -+ -+ uart2: serial@1c28800 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28800 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&ccu CLK_BUS_UART2>; -+ resets = <&ccu RST_BUS_UART2>; -+ status = "disabled"; -+ }; -+ -+ uart3: serial@1c28c00 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28c00 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&ccu CLK_BUS_UART3>; -+ resets = <&ccu RST_BUS_UART3>; -+ status = "disabled"; -+ }; -+ -+ uart4: serial@1c29000 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c29000 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&ccu CLK_BUS_UART4>; -+ resets = <&ccu RST_BUS_UART4>; -+ status = "disabled"; -+ }; -+ -+ i2c0: i2c@1c2ac00 { -+ compatible = "allwinner,sun6i-a31-i2c"; -+ reg = <0x01c2ac00 0x400>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_I2C0>; -+ resets = <&ccu RST_BUS_I2C0>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ i2c1: i2c@1c2b000 { -+ compatible = "allwinner,sun6i-a31-i2c"; -+ reg = <0x01c2b000 0x400>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_I2C1>; -+ resets = <&ccu RST_BUS_I2C1>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ i2c2: i2c@1c2b400 { -+ compatible = "allwinner,sun6i-a31-i2c"; -+ reg = <0x01c2b400 0x400>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_I2C2>; -+ resets = <&ccu RST_BUS_I2C2>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ gic: interrupt-controller@1c81000 { -+ compatible = "arm,gic-400"; -+ reg = <0x01c81000 0x1000>, -+ <0x01c82000 0x2000>, -+ <0x01c84000 0x2000>, -+ <0x01c86000 0x2000>; -+ interrupts = ; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ }; -+ -+ rtc: rtc@1f00000 { -+ compatible = "allwinner,sun6i-a31-rtc"; -+ reg = <0x01f00000 0x54>; -+ interrupts = , -+ ; -+ }; -+ }; -+}; diff --git a/target/linux/sunxi/patches-4.9/0011-arm64-dts-add-Pine64-support.patch b/target/linux/sunxi/patches-4.9/0011-arm64-dts-add-Pine64-support.patch deleted file mode 100644 index 9960588ab89..00000000000 --- a/target/linux/sunxi/patches-4.9/0011-arm64-dts-add-Pine64-support.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 4e3886081848b7ea16452a92c4324acaab644d49 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Tue, 19 Jan 2016 10:36:39 +0000 -Subject: arm64: dts: add Pine64 support - -The Pine64 is a cost-efficient development board based on the -Allwinner A64 SoC. -There are three models: the basic version with Fast Ethernet and -512 MB of DRAM (Pine64) and two Pine64+ versions, which both -feature Gigabit Ethernet and additional connectors for touchscreens -and a camera. Or as my son put it: "Those are smaller and these are -missing." ;-) -The two Pine64+ models just differ in the amount of DRAM -(1GB vs. 2GB). Since U-Boot will figure out the right size for us and -patches the DT accordingly we just need to provide one DT for the -Pine64+. - -Signed-off-by: Andre Przywara -[Maxime: Removed the common DTSI and include directly the pine64 DTS] -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/Makefile | 1 + - arch/arm64/boot/dts/allwinner/Makefile | 5 ++ - .../boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 50 +++++++++++++++ - .../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 74 ++++++++++++++++++++++ - 4 files changed, 130 insertions(+) - create mode 100644 arch/arm64/boot/dts/allwinner/Makefile - create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts - create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts - ---- a/arch/arm64/boot/dts/Makefile -+++ b/arch/arm64/boot/dts/Makefile -@@ -1,4 +1,5 @@ - dts-dirs += al -+dts-dirs += allwinner - dts-dirs += altera - dts-dirs += amd - dts-dirs += amlogic ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/Makefile -@@ -0,0 +1,5 @@ -+dtb-$(CONFIG_ARCH_SUNXI) += sun50i-a64-pine64-plus.dtb sun50i-a64-pine64.dtb -+ -+always := $(dtb-y) -+subdir-y := $(dts-dirs) -+clean-files := *.dtb ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts -@@ -0,0 +1,50 @@ -+/* -+ * Copyright (c) 2016 ARM Ltd. -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "sun50i-a64-pine64.dts" -+ -+/ { -+ model = "Pine64+"; -+ compatible = "pine64,pine64-plus", "allwinner,sun50i-a64"; -+ -+ /* TODO: Camera, Ethernet PHY, touchscreen, etc. */ -+}; ---- /dev/null -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -0,0 +1,74 @@ -+/* -+ * Copyright (c) 2016 ARM Ltd. -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+ -+#include "sun50i-a64.dtsi" -+ -+/ { -+ model = "Pine64"; -+ compatible = "pine64,pine64", "allwinner,sun50i-a64"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins>; -+ status = "okay"; -+}; -+ -+&i2c1_pins { -+ bias-pull-up; -+}; diff --git a/target/linux/sunxi/patches-4.9/0012-arm64-dts-fix-build-errors-from-missing-dependencies.patch b/target/linux/sunxi/patches-4.9/0012-arm64-dts-fix-build-errors-from-missing-dependencies.patch deleted file mode 100644 index 1719b682b36..00000000000 --- a/target/linux/sunxi/patches-4.9/0012-arm64-dts-fix-build-errors-from-missing-dependencies.patch +++ /dev/null @@ -1,134 +0,0 @@ -From f98121f3ef3d36f4d040b11ab38f15387f6eefa2 Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Wed, 30 Nov 2016 15:08:55 +0100 -Subject: arm64: dts: fix build errors from missing dependencies - -Two branches were incorrectly sent without having the necessary -header file changes. Rather than back those out now, I'm replacing -the symbolic names for the clks and resets with the numeric -values to get 'make allmodconfig dtbs' back to work. - -After the header file changes are merged, we can revert this -patch. - -Fixes: 6bc37fa ("arm64: dts: add Allwinner A64 SoC .dtsi") -Fixes: 50784e6 ("dts: arm64: db820c: add pmic pins specific dts file") -Acked-by: Andre Przywara -Acked-by: Maxime Ripard -Acked-by: Srinivas Kandagatla -Signed-off-by: Arnd Bergmann ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 36 ++++++++++------------ - .../boot/dts/qcom/apq8096-db820c-pmic-pins.dtsi | 2 +- - 2 files changed, 18 insertions(+), 20 deletions(-) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -42,10 +42,8 @@ - * OTHER DEALINGS IN THE SOFTWARE. - */ - --#include - #include - #include --#include - - / { - interrupt-parent = <&gic>; -@@ -137,7 +135,7 @@ - interrupts = , - , - ; -- clocks = <&ccu CLK_BUS_PIO>; -+ clocks = <&ccu 58>; - gpio-controller; - #gpio-cells = <3>; - interrupt-controller; -@@ -160,8 +158,8 @@ - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&ccu CLK_BUS_UART0>; -- resets = <&ccu RST_BUS_UART0>; -+ clocks = <&ccu 67>; -+ resets = <&ccu 46>; - status = "disabled"; - }; - -@@ -171,8 +169,8 @@ - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&ccu CLK_BUS_UART1>; -- resets = <&ccu RST_BUS_UART1>; -+ clocks = <&ccu 68>; -+ resets = <&ccu 47>; - status = "disabled"; - }; - -@@ -182,8 +180,8 @@ - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&ccu CLK_BUS_UART2>; -- resets = <&ccu RST_BUS_UART2>; -+ clocks = <&ccu 69>; -+ resets = <&ccu 48>; - status = "disabled"; - }; - -@@ -193,8 +191,8 @@ - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&ccu CLK_BUS_UART3>; -- resets = <&ccu RST_BUS_UART3>; -+ clocks = <&ccu 70>; -+ resets = <&ccu 49>; - status = "disabled"; - }; - -@@ -204,8 +202,8 @@ - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&ccu CLK_BUS_UART4>; -- resets = <&ccu RST_BUS_UART4>; -+ clocks = <&ccu 71>; -+ resets = <&ccu 50>; - status = "disabled"; - }; - -@@ -213,8 +211,8 @@ - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01c2ac00 0x400>; - interrupts = ; -- clocks = <&ccu CLK_BUS_I2C0>; -- resets = <&ccu RST_BUS_I2C0>; -+ clocks = <&ccu 63>; -+ resets = <&ccu 42>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; -@@ -224,8 +222,8 @@ - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01c2b000 0x400>; - interrupts = ; -- clocks = <&ccu CLK_BUS_I2C1>; -- resets = <&ccu RST_BUS_I2C1>; -+ clocks = <&ccu 64>; -+ resets = <&ccu 43>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; -@@ -235,8 +233,8 @@ - compatible = "allwinner,sun6i-a31-i2c"; - reg = <0x01c2b400 0x400>; - interrupts = ; -- clocks = <&ccu CLK_BUS_I2C2>; -- resets = <&ccu RST_BUS_I2C2>; -+ clocks = <&ccu 65>; -+ resets = <&ccu 44>; - status = "disabled"; - #address-cells = <1>; - #size-cells = <0>; diff --git a/target/linux/sunxi/patches-4.9/0013-arm64-dts-allwinner-add-USB1-related-nodes-of-Allwin.patch b/target/linux/sunxi/patches-4.9/0013-arm64-dts-allwinner-add-USB1-related-nodes-of-Allwin.patch deleted file mode 100644 index f96570c858a..00000000000 --- a/target/linux/sunxi/patches-4.9/0013-arm64-dts-allwinner-add-USB1-related-nodes-of-Allwin.patch +++ /dev/null @@ -1,84 +0,0 @@ -From a004ee350177ece3c059831ea49293d62aea7ca6 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Tue, 22 Nov 2016 23:58:29 +0800 -Subject: arm64: dts: allwinner: add USB1-related nodes of Allwinner A64 - -Allwinner A64 have two HCI USB controllers, a OTG controller and a USB -PHY device which have two ports. One of the port is wired to both a HCI -USB controller and the OTG controller, which is currently not supported. -The another one is only wired to a HCI controller, and the device node of -OHCI/EHCI controller of the port can be added now. - -Also the A64 USB PHY device node is also added for the HCI controllers to -work. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 46 +++++++++++++++++++++++++++ - 1 file changed, 46 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -42,8 +42,10 @@ - * OTHER DEALINGS IN THE SOFTWARE. - */ - -+#include - #include - #include -+#include - - / { - interrupt-parent = <&gic>; -@@ -120,6 +122,50 @@ - #size-cells = <1>; - ranges; - -+ usbphy: phy@01c19400 { -+ compatible = "allwinner,sun50i-a64-usb-phy"; -+ reg = <0x01c19400 0x14>, -+ <0x01c1b800 0x4>; -+ reg-names = "phy_ctrl", -+ "pmu1"; -+ clocks = <&ccu CLK_USB_PHY0>, -+ <&ccu CLK_USB_PHY1>; -+ clock-names = "usb0_phy", -+ "usb1_phy"; -+ resets = <&ccu RST_USB_PHY0>, -+ <&ccu RST_USB_PHY1>; -+ reset-names = "usb0_reset", -+ "usb1_reset"; -+ status = "disabled"; -+ #phy-cells = <1>; -+ }; -+ -+ ehci1: usb@01c1b000 { -+ compatible = "allwinner,sun50i-a64-ehci", "generic-ehci"; -+ reg = <0x01c1b000 0x100>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_OHCI1>, -+ <&ccu CLK_BUS_EHCI1>, -+ <&ccu CLK_USB_OHCI1>; -+ resets = <&ccu RST_BUS_OHCI1>, -+ <&ccu RST_BUS_EHCI1>; -+ phys = <&usbphy 1>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci1: usb@01c1b400 { -+ compatible = "allwinner,sun50i-a64-ohci", "generic-ohci"; -+ reg = <0x01c1b400 0x100>; -+ interrupts = ; -+ clocks = <&ccu CLK_BUS_OHCI1>, -+ <&ccu CLK_USB_OHCI1>; -+ resets = <&ccu RST_BUS_OHCI1>; -+ phys = <&usbphy 1>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ - ccu: clock@01c20000 { - compatible = "allwinner,sun50i-a64-ccu"; - reg = <0x01c20000 0x400>; diff --git a/target/linux/sunxi/patches-4.9/0014-arm64-dts-allwinner-sort-the-nodes-in-sun50i-a64-pin.patch b/target/linux/sunxi/patches-4.9/0014-arm64-dts-allwinner-sort-the-nodes-in-sun50i-a64-pin.patch deleted file mode 100644 index 4c7d6dafe2a..00000000000 --- a/target/linux/sunxi/patches-4.9/0014-arm64-dts-allwinner-sort-the-nodes-in-sun50i-a64-pin.patch +++ /dev/null @@ -1,40 +0,0 @@ -From ac93c09cdbaf1229c21f67a5db1c3c6df7d503e5 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Tue, 22 Nov 2016 23:58:30 +0800 -Subject: arm64: dts: allwinner: sort the nodes in sun50i-a64-pine64.dts - -In this dts file, uart0 node is put before i2c1. - -Move the uart0 node to the end to satisfy alphebetical order. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -57,12 +57,6 @@ - }; - }; - --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -- status = "okay"; --}; -- - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; -@@ -72,3 +66,9 @@ - &i2c1_pins { - bias-pull-up; - }; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.9/0015-arm64-dts-allwinner-enable-EHCI1-OHCI1-and-USB-PHY-n.patch b/target/linux/sunxi/patches-4.9/0015-arm64-dts-allwinner-enable-EHCI1-OHCI1-and-USB-PHY-n.patch deleted file mode 100644 index 451ec595c94..00000000000 --- a/target/linux/sunxi/patches-4.9/0015-arm64-dts-allwinner-enable-EHCI1-OHCI1-and-USB-PHY-n.patch +++ /dev/null @@ -1,47 +0,0 @@ -From d49f9dbc8f0c4521fa56477d051a3bd1158f2595 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Tue, 22 Nov 2016 23:58:31 +0800 -Subject: arm64: dts: allwinner: enable EHCI1, OHCI1 and USB PHY nodes in - Pine64 - -Pine64 have two USB Type-A ports, which are wired to the two ports of -A64 USB PHY, and the lower port is the EHCI/OHCI1 port. - -Enable the necessary nodes to enable the lower USB port to work. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -57,6 +57,10 @@ - }; - }; - -+&ehci1 { -+ status = "okay"; -+}; -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; -@@ -67,8 +71,16 @@ - bias-pull-up; - }; - -+&ohci1 { -+ status = "okay"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; - }; -+ -+&usbphy { -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.9/0016-arm64-dts-add-MUSB-node-to-Allwinner-A64-dtsi.patch b/target/linux/sunxi/patches-4.9/0016-arm64-dts-add-MUSB-node-to-Allwinner-A64-dtsi.patch deleted file mode 100644 index 804d00521b1..00000000000 --- a/target/linux/sunxi/patches-4.9/0016-arm64-dts-add-MUSB-node-to-Allwinner-A64-dtsi.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 972a3ecdf27f3ebdd1ce0dccd1b548ef3c04b8ed Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Wed, 23 Nov 2016 00:59:01 +0800 -Subject: arm64: dts: add MUSB node to Allwinner A64 dtsi - -Allwinner A64 SoC has a MUSB controller like the one in A33, so add -a node for it, just use the compatible of A33 MUSB. - -Host mode is tested to work properly on Pine64 and will be added into -the device tree of Pine64 in next patch. - -Peripheral mode is also tested on Pine64, by changing dr_mode property -of usb_otg node and use a non-standard USB Type-A to Type-A cable. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 13 +++++++++++++ - 1 file changed, 13 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -122,6 +122,19 @@ - #size-cells = <1>; - ranges; - -+ usb_otg: usb@01c19000 { -+ compatible = "allwinner,sun8i-a33-musb"; -+ reg = <0x01c19000 0x0400>; -+ clocks = <&ccu CLK_BUS_OTG>; -+ resets = <&ccu RST_BUS_OTG>; -+ interrupts = ; -+ interrupt-names = "mc"; -+ phys = <&usbphy 0>; -+ phy-names = "usb"; -+ extcon = <&usbphy 0>; -+ status = "disabled"; -+ }; -+ - usbphy: phy@01c19400 { - compatible = "allwinner,sun50i-a64-usb-phy"; - reg = <0x01c19400 0x14>, diff --git a/target/linux/sunxi/patches-4.9/0017-arm64-dts-enable-the-MUSB-controller-of-Pine64-in-ho.patch b/target/linux/sunxi/patches-4.9/0017-arm64-dts-enable-the-MUSB-controller-of-Pine64-in-ho.patch deleted file mode 100644 index 3992ab6510d..00000000000 --- a/target/linux/sunxi/patches-4.9/0017-arm64-dts-enable-the-MUSB-controller-of-Pine64-in-ho.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f57e8384c5d2417fd8707c577d8e622fc1570b6c Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Wed, 23 Nov 2016 00:59:02 +0800 -Subject: arm64: dts: enable the MUSB controller of Pine64 in host-only mode - -A64 has a MUSB controller wired to the USB PHY 0, which is connected -to the upper USB Type-A port of Pine64. - -As the port is a Type-A female port, enable it in host-only mode in the -device tree, which makes devices with USB Type-A male port can work on -this port (which is originally designed by Pine64 team). - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -81,6 +81,11 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ - &usbphy { - status = "okay"; - }; diff --git a/target/linux/sunxi/patches-4.9/0018-arm64-dts-allwinner-Remove-no-longer-used-pinctrl-su.patch b/target/linux/sunxi/patches-4.9/0018-arm64-dts-allwinner-Remove-no-longer-used-pinctrl-su.patch deleted file mode 100644 index d2d54e937f1..00000000000 --- a/target/linux/sunxi/patches-4.9/0018-arm64-dts-allwinner-Remove-no-longer-used-pinctrl-su.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 4f9758302ccaf753cd4ba6a5eb740392a4d24773 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Tue, 24 Jan 2017 10:32:29 +0800 -Subject: arm64: dts: allwinner: Remove no longer used pinctrl/sun4i-a10.h - header - -All dts files for the sunxi platform have been switched to the generic -pinconf bindings. As a result, the sunxi specific pinctrl macros are -no longer used. - -Remove the #include entry with the following command: - - sed -i -e '/pinctrl\/sun4i-a10.h/D' \ - arch/arm64/boot/dts/allwinner/*.dts? - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 1 - - 1 file changed, 1 deletion(-) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -44,7 +44,6 @@ - - #include - #include --#include - #include - - / { diff --git a/target/linux/sunxi/patches-4.9/0019-arm64-allwinner-a64-Add-MMC-nodes.patch b/target/linux/sunxi/patches-4.9/0019-arm64-allwinner-a64-Add-MMC-nodes.patch deleted file mode 100644 index 1f91e9bead4..00000000000 --- a/target/linux/sunxi/patches-4.9/0019-arm64-allwinner-a64-Add-MMC-nodes.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f3dff3478a8a7b09f9a92023955a151584658893 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Thu, 6 Oct 2016 02:25:22 +0100 -Subject: arm64: allwinner: a64: Add MMC nodes - -The A64 has 3 MMC controllers, one of them being especially targeted to -eMMC. Among other things, it has a data strobe signal and a 8 bits data -width. - -The two other are more usual controllers that will have a 4 bits width at -most and no data strobe signal, which limits it to more usual SD or MMC -peripherals. - -Signed-off-by: Andre Przywara -Signed-off-by: Maxime Ripard -Tested-by: Florian Vaussard -Acked-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 39 +++++++++++++++++++++++++++ - 1 file changed, 39 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -121,6 +121,45 @@ - #size-cells = <1>; - ranges; - -+ mmc0: mmc@1c0f000 { -+ compatible = "allwinner,sun50i-a64-mmc"; -+ reg = <0x01c0f000 0x1000>; -+ clocks = <&ccu CLK_BUS_MMC0>, <&ccu CLK_MMC0>; -+ clock-names = "ahb", "mmc"; -+ resets = <&ccu RST_BUS_MMC0>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ mmc1: mmc@1c10000 { -+ compatible = "allwinner,sun50i-a64-mmc"; -+ reg = <0x01c10000 0x1000>; -+ clocks = <&ccu CLK_BUS_MMC1>, <&ccu CLK_MMC1>; -+ clock-names = "ahb", "mmc"; -+ resets = <&ccu RST_BUS_MMC1>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ mmc2: mmc@1c11000 { -+ compatible = "allwinner,sun50i-a64-emmc"; -+ reg = <0x01c11000 0x1000>; -+ clocks = <&ccu CLK_BUS_MMC2>, <&ccu CLK_MMC2>; -+ clock-names = "ahb", "mmc"; -+ resets = <&ccu RST_BUS_MMC2>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ - usb_otg: usb@01c19000 { - compatible = "allwinner,sun8i-a33-musb"; - reg = <0x01c19000 0x0400>; diff --git a/target/linux/sunxi/patches-4.9/0020-arm64-allwinner-a64-Add-MMC-pinctrl-nodes.patch b/target/linux/sunxi/patches-4.9/0020-arm64-allwinner-a64-Add-MMC-pinctrl-nodes.patch deleted file mode 100644 index f5af0f819ac..00000000000 --- a/target/linux/sunxi/patches-4.9/0020-arm64-allwinner-a64-Add-MMC-pinctrl-nodes.patch +++ /dev/null @@ -1,50 +0,0 @@ -From a3e8f4926248b3c12933aacec4432e9b6de004bb Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 9 Jan 2017 16:39:15 +0100 -Subject: arm64: allwinner: a64: Add MMC pinctrl nodes - -The A64 only has a single set of pins for each MMC controller. Since we -already have boards that require all of them, let's add them to the DTSI. - -Reviewed-by: Andre Przywara -Signed-off-by: Maxime Ripard -Tested-by: Florian Vaussard -Acked-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -243,6 +243,31 @@ - function = "i2c1"; - }; - -+ mmc0_pins: mmc0-pins { -+ pins = "PF0", "PF1", "PF2", "PF3", -+ "PF4", "PF5"; -+ function = "mmc0"; -+ drive-strength = <30>; -+ bias-pull-up; -+ }; -+ -+ mmc1_pins: mmc1-pins { -+ pins = "PG0", "PG1", "PG2", "PG3", -+ "PG4", "PG5"; -+ function = "mmc1"; -+ drive-strength = <30>; -+ bias-pull-up; -+ }; -+ -+ mmc2_pins: mmc2-pins { -+ pins = "PC1", "PC5", "PC6", "PC8", "PC9", -+ "PC10","PC11", "PC12", "PC13", -+ "PC14", "PC15", "PC16"; -+ function = "mmc2"; -+ drive-strength = <30>; -+ bias-pull-up; -+ }; -+ - uart0_pins_a: uart0@0 { - pins = "PB8", "PB9"; - function = "uart0"; diff --git a/target/linux/sunxi/patches-4.9/0022-arm64-allwinner-pine64-add-MMC-support.patch b/target/linux/sunxi/patches-4.9/0022-arm64-allwinner-pine64-add-MMC-support.patch deleted file mode 100644 index c60e5104cf5..00000000000 --- a/target/linux/sunxi/patches-4.9/0022-arm64-allwinner-pine64-add-MMC-support.patch +++ /dev/null @@ -1,62 +0,0 @@ -From ebe3ae29c6314217edf40d9ee23c36d610ff0fb8 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Tue, 10 Jan 2017 01:22:31 +0000 -Subject: arm64: allwinner: pine64: add MMC support - -All Pine64 boards connect an micro-SD card slot to the first MMC -controller. -Enable the respective DT node and specify the (always-on) regulator -and card-detect pin. -As a micro-SD slot does not feature a write-protect switch, we disable -this feature. - -Signed-off-by: Andre Przywara -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -44,6 +44,8 @@ - - #include "sun50i-a64.dtsi" - -+#include -+ - / { - model = "Pine64"; - compatible = "pine64,pine64", "allwinner,sun50i-a64"; -@@ -55,6 +57,13 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ reg_vcc3v3: vcc3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "vcc3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ }; - }; - - &ehci1 { -@@ -71,6 +80,17 @@ - bias-pull-up; - }; - -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins>; -+ vmmc-supply = <®_vcc3v3>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; -+ cd-inverted; -+ disable-wp; -+ bus-width = <4>; -+ status = "okay"; -+}; -+ - &ohci1 { - status = "okay"; - }; diff --git a/target/linux/sunxi/patches-4.9/0023-arm64-allwinner-a64-add-UART1-pin-nodes.patch b/target/linux/sunxi/patches-4.9/0023-arm64-allwinner-a64-add-UART1-pin-nodes.patch deleted file mode 100644 index 998d51435fd..00000000000 --- a/target/linux/sunxi/patches-4.9/0023-arm64-allwinner-a64-add-UART1-pin-nodes.patch +++ /dev/null @@ -1,35 +0,0 @@ -From e7ba733d32cc9487b62b07219ad911c77764a681 Mon Sep 17 00:00:00 2001 -From: Andre Przywara -Date: Tue, 10 Jan 2017 01:22:32 +0000 -Subject: arm64: allwinner: a64: add UART1 pin nodes - -On many boards UART1 connects to a Bluetooth chip, so add the pinctrl -nodes for the only pins providing access to that UART. That includes -those pins for hardware flow control (RTS/CTS). - -Signed-off-by: Andre Przywara -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 10 ++++++++++ - 1 file changed, 10 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -272,6 +272,16 @@ - pins = "PB8", "PB9"; - function = "uart0"; - }; -+ -+ uart1_pins: uart1_pins { -+ pins = "PG6", "PG7"; -+ function = "uart1"; -+ }; -+ -+ uart1_rts_cts_pins: uart1_rts_cts_pins { -+ pins = "PG8", "PG9"; -+ function = "uart1"; -+ }; - }; - - uart0: serial@1c28000 { diff --git a/target/linux/sunxi/patches-4.9/0024-arm64-allwinner-a64-add-r_ccu-node.patch b/target/linux/sunxi/patches-4.9/0024-arm64-allwinner-a64-add-r_ccu-node.patch deleted file mode 100644 index 19a3589708a..00000000000 --- a/target/linux/sunxi/patches-4.9/0024-arm64-allwinner-a64-add-r_ccu-node.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 791a9e001d3ba3b552888b0bf3c592a50b71f57e Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Tue, 4 Apr 2017 17:50:58 +0800 -Subject: arm64: allwinner: a64: add r_ccu node - -A64 SoC have a CCU (r_ccu) in PRCM block. - -Add the device node for it. - -The mux 3 of R_CCU is an internal oscillator, which is 16MHz according -to the user manual, and has only 30% accuracy based on our experience -on older SoCs. The real mesaured value of it on two Pine64 boards is -around 11MHz, which is around 70% of 16MHz. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -98,6 +98,14 @@ - clock-output-names = "osc32k"; - }; - -+ iosc: internal-osc-clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <16000000>; -+ clock-accuracy = <300000000>; -+ clock-output-names = "iosc"; -+ }; -+ - psci { - compatible = "arm,psci-0.2"; - method = "smc"; -@@ -389,5 +397,14 @@ - interrupts = , - ; - }; -+ -+ r_ccu: clock@1f01400 { -+ compatible = "allwinner,sun50i-a64-r-ccu"; -+ reg = <0x01f01400 0x100>; -+ clocks = <&osc24M>, <&osc32k>, <&iosc>; -+ clock-names = "hosc", "losc", "iosc"; -+ #clock-cells = <1>; -+ #reset-cells = <1>; -+ }; - }; - }; diff --git a/target/linux/sunxi/patches-4.9/0025-arm64-allwinner-a64-add-R_PIO-pinctrl-node.patch b/target/linux/sunxi/patches-4.9/0025-arm64-allwinner-a64-add-R_PIO-pinctrl-node.patch deleted file mode 100644 index ff541ce63e3..00000000000 --- a/target/linux/sunxi/patches-4.9/0025-arm64-allwinner-a64-add-R_PIO-pinctrl-node.patch +++ /dev/null @@ -1,35 +0,0 @@ -From ec4279053a6434f685246e022be95d2a62f8c608 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Tue, 4 Apr 2017 17:51:00 +0800 -Subject: arm64: allwinner: a64: add R_PIO pinctrl node - -Allwinner A64 have a dedicated pin controller to manage the PL pin bank. -As the driver and the required clock support are added, add the device -node for it. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -406,5 +406,17 @@ - #clock-cells = <1>; - #reset-cells = <1>; - }; -+ -+ r_pio: pinctrl@01f02c00 { -+ compatible = "allwinner,sun50i-a64-r-pinctrl"; -+ reg = <0x01f02c00 0x400>; -+ interrupts = ; -+ clocks = <&r_ccu 3>, <&osc24M>, <&osc32k>; -+ clock-names = "apb", "hosc", "losc"; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ }; - }; - }; diff --git a/target/linux/sunxi/patches-4.9/0026-arm64-allwinner-a64-add-pmu0-regs-for-USB-PHY.patch b/target/linux/sunxi/patches-4.9/0026-arm64-allwinner-a64-add-pmu0-regs-for-USB-PHY.patch deleted file mode 100644 index 0d7803775e4..00000000000 --- a/target/linux/sunxi/patches-4.9/0026-arm64-allwinner-a64-add-pmu0-regs-for-USB-PHY.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 0d98479738b950e30bb4f782d60099d44076ad67 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Wed, 5 Apr 2017 22:30:34 +0800 -Subject: arm64: allwinner: a64: add pmu0 regs for USB PHY - -The USB PHY in A64 has a "pmu0" region, which controls the EHCI/OHCI -controller pair that can be connected to the PHY0. - -Add the MMIO region for PHY node. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -184,8 +184,10 @@ - usbphy: phy@01c19400 { - compatible = "allwinner,sun50i-a64-usb-phy"; - reg = <0x01c19400 0x14>, -+ <0x01c1a800 0x4>, - <0x01c1b800 0x4>; - reg-names = "phy_ctrl", -+ "pmu0", - "pmu1"; - clocks = <&ccu CLK_USB_PHY0>, - <&ccu CLK_USB_PHY1>; diff --git a/target/linux/sunxi/patches-4.9/0027-arm64-allwinner-a64-Add-PLL_PERIPH0-clock-to-the-R_C.patch b/target/linux/sunxi/patches-4.9/0027-arm64-allwinner-a64-Add-PLL_PERIPH0-clock-to-the-R_C.patch deleted file mode 100644 index 319dba6591e..00000000000 --- a/target/linux/sunxi/patches-4.9/0027-arm64-allwinner-a64-Add-PLL_PERIPH0-clock-to-the-R_C.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f74994a94063bc85ac1d6ad677ed06b5279c101f Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Wed, 31 May 2017 15:58:24 +0800 -Subject: arm64: allwinner: a64: Add PLL_PERIPH0 clock to the R_CCU - -The AR100 clock within the R_CCU (PRCM) has the PLL_PERIPH0 as one of -its parents. - -This adds the reference in the device tree describing this relationship. -This patch uses a raw number for the clock index to ease merging by -avoiding cross tree dependencies. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -403,8 +403,9 @@ - r_ccu: clock@1f01400 { - compatible = "allwinner,sun50i-a64-r-ccu"; - reg = <0x01f01400 0x100>; -- clocks = <&osc24M>, <&osc32k>, <&iosc>; -- clock-names = "hosc", "losc", "iosc"; -+ clocks = <&osc24M>, <&osc32k>, <&iosc>, -+ <&ccu 11>; -+ clock-names = "hosc", "losc", "iosc", "pll-periph"; - #clock-cells = <1>; - #reset-cells = <1>; - }; diff --git a/target/linux/sunxi/patches-4.9/0030-pinctrl-sunxi-Rework-the-pin-config-building-code.patch b/target/linux/sunxi/patches-4.9/0030-pinctrl-sunxi-Rework-the-pin-config-building-code.patch deleted file mode 100644 index 498581712dc..00000000000 --- a/target/linux/sunxi/patches-4.9/0030-pinctrl-sunxi-Rework-the-pin-config-building-code.patch +++ /dev/null @@ -1,251 +0,0 @@ -From f233dbca6227703eaae2f67d6d9c79819773f16b Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 11 Oct 2016 17:45:59 +0200 -Subject: pinctrl: sunxi: Rework the pin config building code - -In order to support more easily the generic pinctrl properties, rework the -pinctrl maps configuration and split it into several sub-functions. - -One of the side-effects from that rework is that we only parse the pin -configuration once, since it's going to be common to every pin, instead of -having to parsing once for each pin. - -Signed-off-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 178 +++++++++++++++++++++++++--------- - 1 file changed, 130 insertions(+), 48 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -145,6 +145,110 @@ static int sunxi_pctrl_get_group_pins(st - return 0; - } - -+static bool sunxi_pctrl_has_bias_prop(struct device_node *node) -+{ -+ return of_find_property(node, "allwinner,pull", NULL); -+} -+ -+static bool sunxi_pctrl_has_drive_prop(struct device_node *node) -+{ -+ return of_find_property(node, "allwinner,drive", NULL); -+} -+ -+static int sunxi_pctrl_parse_bias_prop(struct device_node *node) -+{ -+ u32 val; -+ -+ if (of_property_read_u32(node, "allwinner,pull", &val)) -+ return -EINVAL; -+ -+ switch (val) { -+ case 1: -+ return PIN_CONFIG_BIAS_PULL_UP; -+ case 2: -+ return PIN_CONFIG_BIAS_PULL_DOWN; -+ } -+ -+ return -EINVAL; -+} -+ -+static int sunxi_pctrl_parse_drive_prop(struct device_node *node) -+{ -+ u32 val; -+ -+ if (of_property_read_u32(node, "allwinner,drive", &val)) -+ return -EINVAL; -+ -+ return (val + 1) * 10; -+} -+ -+static const char *sunxi_pctrl_parse_function_prop(struct device_node *node) -+{ -+ const char *function; -+ int ret; -+ -+ ret = of_property_read_string(node, "allwinner,function", &function); -+ if (!ret) -+ return function; -+ -+ return NULL; -+} -+ -+static const char *sunxi_pctrl_find_pins_prop(struct device_node *node, -+ int *npins) -+{ -+ int count; -+ -+ count = of_property_count_strings(node, "allwinner,pins"); -+ if (count > 0) { -+ *npins = count; -+ return "allwinner,pins"; -+ } -+ -+ return NULL; -+} -+ -+static unsigned long *sunxi_pctrl_build_pin_config(struct device_node *node, -+ unsigned int *len) -+{ -+ unsigned long *pinconfig; -+ unsigned int configlen = 0, idx = 0; -+ -+ if (sunxi_pctrl_has_drive_prop(node)) -+ configlen++; -+ if (sunxi_pctrl_has_bias_prop(node)) -+ configlen++; -+ -+ pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); -+ if (!pinconfig) -+ return NULL; -+ -+ if (sunxi_pctrl_has_drive_prop(node)) { -+ int drive = sunxi_pctrl_parse_drive_prop(node); -+ if (drive < 0) -+ goto err_free; -+ -+ pinconfig[idx++] = pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, -+ drive); -+ } -+ -+ if (sunxi_pctrl_has_bias_prop(node)) { -+ int pull = sunxi_pctrl_parse_bias_prop(node); -+ if (pull < 0) -+ goto err_free; -+ -+ pinconfig[idx++] = pinconf_to_config_packed(pull, 0); -+ } -+ -+ -+ *len = configlen; -+ return pinconfig; -+ -+err_free: -+ kfree(pinconfig); -+ return NULL; -+} -+ - static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, - struct device_node *node, - struct pinctrl_map **map, -@@ -153,38 +257,45 @@ static int sunxi_pctrl_dt_node_to_map(st - struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); - unsigned long *pinconfig; - struct property *prop; -- const char *function; -+ const char *function, *pin_prop; - const char *group; -- int ret, nmaps, i = 0; -- u32 val; -+ int ret, npins, nmaps, configlen = 0, i = 0; - - *map = NULL; - *num_maps = 0; - -- ret = of_property_read_string(node, "allwinner,function", &function); -- if (ret) { -- dev_err(pctl->dev, -- "missing allwinner,function property in node %s\n", -+ function = sunxi_pctrl_parse_function_prop(node); -+ if (!function) { -+ dev_err(pctl->dev, "missing function property in node %s\n", - node->name); - return -EINVAL; - } - -- nmaps = of_property_count_strings(node, "allwinner,pins") * 2; -- if (nmaps < 0) { -- dev_err(pctl->dev, -- "missing allwinner,pins property in node %s\n", -+ pin_prop = sunxi_pctrl_find_pins_prop(node, &npins); -+ if (!pin_prop) { -+ dev_err(pctl->dev, "missing pins property in node %s\n", - node->name); - return -EINVAL; - } - -+ /* -+ * We have two maps for each pin: one for the function, one -+ * for the configuration (bias, strength, etc) -+ */ -+ nmaps = npins * 2; - *map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL); - if (!*map) - return -ENOMEM; - -- of_property_for_each_string(node, "allwinner,pins", prop, group) { -+ pinconfig = sunxi_pctrl_build_pin_config(node, &configlen); -+ if (!pinconfig) { -+ ret = -EINVAL; -+ goto err_free_map; -+ } -+ -+ of_property_for_each_string(node, pin_prop, prop, group) { - struct sunxi_pinctrl_group *grp = - sunxi_pinctrl_find_group_by_name(pctl, group); -- int j = 0, configlen = 0; - - if (!grp) { - dev_err(pctl->dev, "unknown pin %s", group); -@@ -207,34 +318,6 @@ static int sunxi_pctrl_dt_node_to_map(st - - (*map)[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; - (*map)[i].data.configs.group_or_pin = group; -- -- if (of_find_property(node, "allwinner,drive", NULL)) -- configlen++; -- if (of_find_property(node, "allwinner,pull", NULL)) -- configlen++; -- -- pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); -- if (!pinconfig) { -- kfree(*map); -- return -ENOMEM; -- } -- -- if (!of_property_read_u32(node, "allwinner,drive", &val)) { -- u16 strength = (val + 1) * 10; -- pinconfig[j++] = -- pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, -- strength); -- } -- -- if (!of_property_read_u32(node, "allwinner,pull", &val)) { -- enum pin_config_param pull = PIN_CONFIG_END; -- if (val == 1) -- pull = PIN_CONFIG_BIAS_PULL_UP; -- else if (val == 2) -- pull = PIN_CONFIG_BIAS_PULL_DOWN; -- pinconfig[j++] = pinconf_to_config_packed(pull, 0); -- } -- - (*map)[i].data.configs.configs = pinconfig; - (*map)[i].data.configs.num_configs = configlen; - -@@ -244,19 +327,18 @@ static int sunxi_pctrl_dt_node_to_map(st - *num_maps = nmaps; - - return 0; -+ -+err_free_map: -+ kfree(map); -+ return ret; - } - - static void sunxi_pctrl_dt_free_map(struct pinctrl_dev *pctldev, - struct pinctrl_map *map, - unsigned num_maps) - { -- int i; -- -- for (i = 0; i < num_maps; i++) { -- if (map[i].type == PIN_MAP_TYPE_CONFIGS_GROUP) -- kfree(map[i].data.configs.configs); -- } -- -+ /* All the maps have the same pin config, free only the first one */ -+ kfree(map[0].data.configs.configs); - kfree(map); - } - diff --git a/target/linux/sunxi/patches-4.9/0031-pinctrl-sunxi-Use-macros-from-bindings-header-file-f.patch b/target/linux/sunxi/patches-4.9/0031-pinctrl-sunxi-Use-macros-from-bindings-header-file-f.patch deleted file mode 100644 index 39be965422d..00000000000 --- a/target/linux/sunxi/patches-4.9/0031-pinctrl-sunxi-Use-macros-from-bindings-header-file-f.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 42676fa4aa87eda4fc762df495d4bde2ddc4bfce Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 11 Oct 2016 17:46:00 +0200 -Subject: pinctrl: sunxi: Use macros from bindings header file for DT parsing - -Since we have some bindings header for our hardcoded flags, let's use them -when we can. - -Acked-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -28,6 +28,8 @@ - #include - #include - -+#include -+ - #include "../core.h" - #include "pinctrl-sunxi.h" - -@@ -163,9 +165,9 @@ static int sunxi_pctrl_parse_bias_prop(s - return -EINVAL; - - switch (val) { -- case 1: -+ case SUN4I_PINCTRL_PULL_UP: - return PIN_CONFIG_BIAS_PULL_UP; -- case 2: -+ case SUN4I_PINCTRL_PULL_DOWN: - return PIN_CONFIG_BIAS_PULL_DOWN; - } - diff --git a/target/linux/sunxi/patches-4.9/0032-pinctrl-sunxi-Handle-bias-disable.patch b/target/linux/sunxi/patches-4.9/0032-pinctrl-sunxi-Handle-bias-disable.patch deleted file mode 100644 index 61d6102c926..00000000000 --- a/target/linux/sunxi/patches-4.9/0032-pinctrl-sunxi-Handle-bias-disable.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 07fe64ba213f36ca8f6ffd8c4d5893f022744fdb Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Tue, 11 Oct 2016 17:46:01 +0200 -Subject: pinctrl: sunxi: Handle bias disable - -So far, putting NO_PULL in allwinner,pull was ignored, behaving like if -that property was not there at all. - -Obviously, this is not the right thing to do, and in that case, we really -need to just disable the bias. - -Acked-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -165,6 +165,8 @@ static int sunxi_pctrl_parse_bias_prop(s - return -EINVAL; - - switch (val) { -+ case SUN4I_PINCTRL_NO_PULL: -+ return PIN_CONFIG_BIAS_DISABLE; - case SUN4I_PINCTRL_PULL_UP: - return PIN_CONFIG_BIAS_PULL_UP; - case SUN4I_PINCTRL_PULL_DOWN: -@@ -401,6 +403,12 @@ static int sunxi_pconf_group_set(struct - | dlevel << sunxi_dlevel_offset(pin), - pctl->membase + sunxi_dlevel_reg(pin)); - break; -+ case PIN_CONFIG_BIAS_DISABLE: -+ val = readl(pctl->membase + sunxi_pull_reg(pin)); -+ mask = PULL_PINS_MASK << sunxi_pull_offset(pin); -+ writel((val & ~mask), -+ pctl->membase + sunxi_pull_reg(pin)); -+ break; - case PIN_CONFIG_BIAS_PULL_UP: - val = readl(pctl->membase + sunxi_pull_reg(pin)); - mask = PULL_PINS_MASK << sunxi_pull_offset(pin); diff --git a/target/linux/sunxi/patches-4.9/0033-pinctrl-sunxi-Support-generic-binding.patch b/target/linux/sunxi/patches-4.9/0033-pinctrl-sunxi-Support-generic-binding.patch deleted file mode 100644 index 35c68768129..00000000000 --- a/target/linux/sunxi/patches-4.9/0033-pinctrl-sunxi-Support-generic-binding.patch +++ /dev/null @@ -1,106 +0,0 @@ -From cefbf1a1b29531a970bc2908a50a75d6474fcc38 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 20 Oct 2016 15:49:03 +0200 -Subject: pinctrl: sunxi: Support generic binding - -Our bindings are mostly irrelevant now that we have generic pinctrl -bindings that cover exactly the same uses cases. - -Add support for the new ones, and obviously keep our old binding support in -order to keep the ABI stable. - -Acked-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 48 +++++++++++++++++++++++++++++++++-- - 1 file changed, 46 insertions(+), 2 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -149,18 +149,33 @@ static int sunxi_pctrl_get_group_pins(st - - static bool sunxi_pctrl_has_bias_prop(struct device_node *node) - { -- return of_find_property(node, "allwinner,pull", NULL); -+ return of_find_property(node, "bias-pull-up", NULL) || -+ of_find_property(node, "bias-pull-down", NULL) || -+ of_find_property(node, "bias-disable", NULL) || -+ of_find_property(node, "allwinner,pull", NULL); - } - - static bool sunxi_pctrl_has_drive_prop(struct device_node *node) - { -- return of_find_property(node, "allwinner,drive", NULL); -+ return of_find_property(node, "drive-strength", NULL) || -+ of_find_property(node, "allwinner,drive", NULL); - } - - static int sunxi_pctrl_parse_bias_prop(struct device_node *node) - { - u32 val; - -+ /* Try the new style binding */ -+ if (of_find_property(node, "bias-pull-up", NULL)) -+ return PIN_CONFIG_BIAS_PULL_UP; -+ -+ if (of_find_property(node, "bias-pull-down", NULL)) -+ return PIN_CONFIG_BIAS_PULL_DOWN; -+ -+ if (of_find_property(node, "bias-disable", NULL)) -+ return PIN_CONFIG_BIAS_DISABLE; -+ -+ /* And fall back to the old binding */ - if (of_property_read_u32(node, "allwinner,pull", &val)) - return -EINVAL; - -@@ -180,6 +195,21 @@ static int sunxi_pctrl_parse_drive_prop( - { - u32 val; - -+ /* Try the new style binding */ -+ if (!of_property_read_u32(node, "drive-strength", &val)) { -+ /* We can't go below 10mA ... */ -+ if (val < 10) -+ return -EINVAL; -+ -+ /* ... and only up to 40 mA ... */ -+ if (val > 40) -+ val = 40; -+ -+ /* by steps of 10 mA */ -+ return rounddown(val, 10); -+ } -+ -+ /* And then fall back to the old binding */ - if (of_property_read_u32(node, "allwinner,drive", &val)) - return -EINVAL; - -@@ -191,6 +221,12 @@ static const char *sunxi_pctrl_parse_fun - const char *function; - int ret; - -+ /* Try the generic binding */ -+ ret = of_property_read_string(node, "function", &function); -+ if (!ret) -+ return function; -+ -+ /* And fall back to our legacy one */ - ret = of_property_read_string(node, "allwinner,function", &function); - if (!ret) - return function; -@@ -203,6 +239,14 @@ static const char *sunxi_pctrl_find_pins - { - int count; - -+ /* Try the generic binding */ -+ count = of_property_count_strings(node, "pins"); -+ if (count > 0) { -+ *npins = count; -+ return "pins"; -+ } -+ -+ /* And fall back to our legacy one */ - count = of_property_count_strings(node, "allwinner,pins"); - if (count > 0) { - *npins = count; diff --git a/target/linux/sunxi/patches-4.9/0034-pinctrl-sunxi-Deal-with-configless-pins.patch b/target/linux/sunxi/patches-4.9/0034-pinctrl-sunxi-Deal-with-configless-pins.patch deleted file mode 100644 index 119ab2b8f95..00000000000 --- a/target/linux/sunxi/patches-4.9/0034-pinctrl-sunxi-Deal-with-configless-pins.patch +++ /dev/null @@ -1,128 +0,0 @@ -From e11dee2e98f8abc99ad5336796576a827853ccfa Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Thu, 20 Oct 2016 15:49:02 +0200 -Subject: pinctrl: sunxi: Deal with configless pins - -Even though the our binding had the assumption that the allwinner,pull and -allwinner,drive properties were optional, the code never took that into -account. - -Fix that. - -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 51 +++++++++++++++++++++++++---------- - 1 file changed, 37 insertions(+), 14 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -261,20 +261,29 @@ static unsigned long *sunxi_pctrl_build_ - { - unsigned long *pinconfig; - unsigned int configlen = 0, idx = 0; -+ int ret; - - if (sunxi_pctrl_has_drive_prop(node)) - configlen++; - if (sunxi_pctrl_has_bias_prop(node)) - configlen++; - -+ /* -+ * If we don't have any configuration, bail out -+ */ -+ if (!configlen) -+ return NULL; -+ - pinconfig = kzalloc(configlen * sizeof(*pinconfig), GFP_KERNEL); - if (!pinconfig) -- return NULL; -+ return ERR_PTR(-ENOMEM); - - if (sunxi_pctrl_has_drive_prop(node)) { - int drive = sunxi_pctrl_parse_drive_prop(node); -- if (drive < 0) -+ if (drive < 0) { -+ ret = drive; - goto err_free; -+ } - - pinconfig[idx++] = pinconf_to_config_packed(PIN_CONFIG_DRIVE_STRENGTH, - drive); -@@ -282,8 +291,10 @@ static unsigned long *sunxi_pctrl_build_ - - if (sunxi_pctrl_has_bias_prop(node)) { - int pull = sunxi_pctrl_parse_bias_prop(node); -- if (pull < 0) -+ if (pull < 0) { -+ ret = pull; - goto err_free; -+ } - - pinconfig[idx++] = pinconf_to_config_packed(pull, 0); - } -@@ -294,7 +305,7 @@ static unsigned long *sunxi_pctrl_build_ - - err_free: - kfree(pinconfig); -- return NULL; -+ return ERR_PTR(ret); - } - - static int sunxi_pctrl_dt_node_to_map(struct pinctrl_dev *pctldev, -@@ -328,7 +339,10 @@ static int sunxi_pctrl_dt_node_to_map(st - - /* - * We have two maps for each pin: one for the function, one -- * for the configuration (bias, strength, etc) -+ * for the configuration (bias, strength, etc). -+ * -+ * We might be slightly overshooting, since we might not have -+ * any configuration. - */ - nmaps = npins * 2; - *map = kmalloc(nmaps * sizeof(struct pinctrl_map), GFP_KERNEL); -@@ -336,8 +350,8 @@ static int sunxi_pctrl_dt_node_to_map(st - return -ENOMEM; - - pinconfig = sunxi_pctrl_build_pin_config(node, &configlen); -- if (!pinconfig) { -- ret = -EINVAL; -+ if (IS_ERR(pinconfig)) { -+ ret = PTR_ERR(pinconfig); - goto err_free_map; - } - -@@ -364,15 +378,24 @@ static int sunxi_pctrl_dt_node_to_map(st - - i++; - -- (*map)[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; -- (*map)[i].data.configs.group_or_pin = group; -- (*map)[i].data.configs.configs = pinconfig; -- (*map)[i].data.configs.num_configs = configlen; -- -- i++; -+ if (pinconfig) { -+ (*map)[i].type = PIN_MAP_TYPE_CONFIGS_GROUP; -+ (*map)[i].data.configs.group_or_pin = group; -+ (*map)[i].data.configs.configs = pinconfig; -+ (*map)[i].data.configs.num_configs = configlen; -+ i++; -+ } - } - -- *num_maps = nmaps; -+ *num_maps = i; -+ -+ /* -+ * We know have the number of maps we need, we can resize our -+ * map array -+ */ -+ *map = krealloc(*map, i * sizeof(struct pinctrl_map), GFP_KERNEL); -+ if (!map) -+ return -ENOMEM; - - return 0; - diff --git a/target/linux/sunxi/patches-4.9/0035-pinctrl-sunxi-make-bool-drivers-explicitly-non-modul.patch b/target/linux/sunxi/patches-4.9/0035-pinctrl-sunxi-make-bool-drivers-explicitly-non-modul.patch deleted file mode 100644 index 8ab535c30f3..00000000000 --- a/target/linux/sunxi/patches-4.9/0035-pinctrl-sunxi-make-bool-drivers-explicitly-non-modul.patch +++ /dev/null @@ -1,437 +0,0 @@ -From 0c8c6ba00cbf2c0a6164aa41d43d017d65caf321 Mon Sep 17 00:00:00 2001 -From: Paul Gortmaker -Date: Sat, 29 Oct 2016 20:00:30 -0400 -Subject: pinctrl: sunxi: make bool drivers explicitly non-modular - -None of the Kconfigs for any of these drivers are tristate, -meaning that they currently are not being built as a module by anyone. - -Lets remove the modular code that is essentially orphaned, so that -when reading the drivers there is no doubt they are builtin-only. All -drivers get essentially the same change, so they are handled in batch. - -Changes are (1) use builtin_platform_driver, (2) use init.h header -(3) delete module_exit related code, (4) delete MODULE_DEVICE_TABLE, -and (5) delete MODULE_LICENCE/MODULE_AUTHOR and associated tags. - -Since module_platform_driver() uses the same init level priority as -builtin_platform_driver() the init ordering remains unchanged with -this commit. - -Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code. - -We do delete the MODULE_LICENSE etc. tags since all that information -is already contained at the top of each file in the comments. - -Cc: Boris Brezillon -Cc: Chen-Yu Tsai -Cc: Hans de Goede -Cc: Linus Walleij -Cc: Patrice Chotard -Cc: Hongzhou Yang -Cc: Fabian Frederick -Cc: Maxime Coquelin -Cc: Vishnu Patekar -Cc: Mylene Josserand -Cc: linux-gpio@vger.kernel.org -Cc: linux-arm-kernel@lists.infradead.org -Signed-off-by: Paul Gortmaker -Acked-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-gr8.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 10 ++-------- - drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c | 11 ++--------- - drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c | 10 ++-------- - drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c | 9 ++------- - drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 9 ++------- - 13 files changed, 26 insertions(+), 95 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-gr8.c -+++ b/drivers/pinctrl/sunxi/pinctrl-gr8.c -@@ -12,7 +12,7 @@ - * warranty of any kind, whether express or implied. - */ - --#include -+#include - #include - #include - #include -@@ -525,7 +525,6 @@ static const struct of_device_id sun5i_g - { .compatible = "nextthing,gr8-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun5i_gr8_pinctrl_match); - - static struct platform_driver sun5i_gr8_pinctrl_driver = { - .probe = sun5i_gr8_pinctrl_probe, -@@ -534,8 +533,4 @@ static struct platform_driver sun5i_gr8_ - .of_match_table = sun5i_gr8_pinctrl_match, - }, - }; --module_platform_driver(sun5i_gr8_pinctrl_driver); -- --MODULE_AUTHOR("Mylene Josserand -+#include - #include - #include - #include -@@ -1036,7 +1036,6 @@ static const struct of_device_id sun4i_a - { .compatible = "allwinner,sun4i-a10-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun4i_a10_pinctrl_match); - - static struct platform_driver sun4i_a10_pinctrl_driver = { - .probe = sun4i_a10_pinctrl_probe, -@@ -1045,8 +1044,4 @@ static struct platform_driver sun4i_a10_ - .of_match_table = sun4i_a10_pinctrl_match, - }, - }; --module_platform_driver(sun4i_a10_pinctrl_driver); -- --MODULE_AUTHOR("Maxime Ripard -+#include - #include - #include - #include -@@ -674,7 +674,6 @@ static const struct of_device_id sun5i_a - { .compatible = "allwinner,sun5i-a10s-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun5i_a10s_pinctrl_match); - - static struct platform_driver sun5i_a10s_pinctrl_driver = { - .probe = sun5i_a10s_pinctrl_probe, -@@ -683,8 +682,4 @@ static struct platform_driver sun5i_a10s - .of_match_table = sun5i_a10s_pinctrl_match, - }, - }; --module_platform_driver(sun5i_a10s_pinctrl_driver); -- --MODULE_AUTHOR("Maxime Ripard -+#include - #include - #include - #include -@@ -392,7 +392,6 @@ static const struct of_device_id sun5i_a - { .compatible = "allwinner,sun5i-a13-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun5i_a13_pinctrl_match); - - static struct platform_driver sun5i_a13_pinctrl_driver = { - .probe = sun5i_a13_pinctrl_probe, -@@ -401,8 +400,4 @@ static struct platform_driver sun5i_a13_ - .of_match_table = sun5i_a13_pinctrl_match, - }, - }; --module_platform_driver(sun5i_a13_pinctrl_driver); -- --MODULE_AUTHOR("Maxime Ripard -+#include - #include - #include - #include -@@ -136,7 +136,6 @@ static const struct of_device_id sun6i_a - { .compatible = "allwinner,sun6i-a31-r-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun6i_a31_r_pinctrl_match); - - static struct platform_driver sun6i_a31_r_pinctrl_driver = { - .probe = sun6i_a31_r_pinctrl_probe, -@@ -145,9 +144,4 @@ static struct platform_driver sun6i_a31_ - .of_match_table = sun6i_a31_r_pinctrl_match, - }, - }; --module_platform_driver(sun6i_a31_r_pinctrl_driver); -- --MODULE_AUTHOR("Boris Brezillon -+#include - #include - #include - #include -@@ -934,7 +934,6 @@ static const struct of_device_id sun6i_a - { .compatible = "allwinner,sun6i-a31-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun6i_a31_pinctrl_match); - - static struct platform_driver sun6i_a31_pinctrl_driver = { - .probe = sun6i_a31_pinctrl_probe, -@@ -943,8 +942,4 @@ static struct platform_driver sun6i_a31_ - .of_match_table = sun6i_a31_pinctrl_match, - }, - }; --module_platform_driver(sun6i_a31_pinctrl_driver); -- --MODULE_AUTHOR("Maxime Ripard -+#include - #include - #include - #include -@@ -798,7 +798,6 @@ static const struct of_device_id sun6i_a - { .compatible = "allwinner,sun6i-a31s-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun6i_a31s_pinctrl_match); - - static struct platform_driver sun6i_a31s_pinctrl_driver = { - .probe = sun6i_a31s_pinctrl_probe, -@@ -807,8 +806,4 @@ static struct platform_driver sun6i_a31s - .of_match_table = sun6i_a31s_pinctrl_match, - }, - }; --module_platform_driver(sun6i_a31s_pinctrl_driver); -- --MODULE_AUTHOR("Hans de Goede "); --MODULE_DESCRIPTION("Allwinner A31s pinctrl driver"); --MODULE_LICENSE("GPL"); -+builtin_platform_driver(sun6i_a31s_pinctrl_driver); ---- a/drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c -@@ -10,7 +10,7 @@ - * warranty of any kind, whether express or implied. - */ - --#include -+#include - #include - #include - #include -@@ -1045,7 +1045,6 @@ static const struct of_device_id sun7i_a - { .compatible = "allwinner,sun7i-a20-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun7i_a20_pinctrl_match); - - static struct platform_driver sun7i_a20_pinctrl_driver = { - .probe = sun7i_a20_pinctrl_probe, -@@ -1054,8 +1053,4 @@ static struct platform_driver sun7i_a20_ - .of_match_table = sun7i_a20_pinctrl_match, - }, - }; --module_platform_driver(sun7i_a20_pinctrl_driver); -- --MODULE_AUTHOR("Maxime Ripard -+#include - #include - #include - #include -@@ -123,7 +123,6 @@ static const struct of_device_id sun8i_a - { .compatible = "allwinner,sun8i-a23-r-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun8i_a23_r_pinctrl_match); - - static struct platform_driver sun8i_a23_r_pinctrl_driver = { - .probe = sun8i_a23_r_pinctrl_probe, -@@ -132,10 +131,4 @@ static struct platform_driver sun8i_a23_ - .of_match_table = sun8i_a23_r_pinctrl_match, - }, - }; --module_platform_driver(sun8i_a23_r_pinctrl_driver); -- --MODULE_AUTHOR("Chen-Yu Tsai "); --MODULE_AUTHOR("Boris Brezillon -+#include - #include - #include - #include -@@ -575,7 +575,6 @@ static const struct of_device_id sun8i_a - { .compatible = "allwinner,sun8i-a23-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun8i_a23_pinctrl_match); - - static struct platform_driver sun8i_a23_pinctrl_driver = { - .probe = sun8i_a23_pinctrl_probe, -@@ -584,9 +583,4 @@ static struct platform_driver sun8i_a23_ - .of_match_table = sun8i_a23_pinctrl_match, - }, - }; --module_platform_driver(sun8i_a23_pinctrl_driver); -- --MODULE_AUTHOR("Chen-Yu Tsai "); --MODULE_AUTHOR("Maxime Ripard -+#include - #include - #include - #include -@@ -498,7 +498,6 @@ static const struct of_device_id sun8i_a - { .compatible = "allwinner,sun8i-a33-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun8i_a33_pinctrl_match); - - static struct platform_driver sun8i_a33_pinctrl_driver = { - .probe = sun8i_a33_pinctrl_probe, -@@ -507,8 +506,4 @@ static struct platform_driver sun8i_a33_ - .of_match_table = sun8i_a33_pinctrl_match, - }, - }; --module_platform_driver(sun8i_a33_pinctrl_driver); -- --MODULE_AUTHOR("Vishnu Patekar "); --MODULE_DESCRIPTION("Allwinner a33 pinctrl driver"); --MODULE_LICENSE("GPL"); -+builtin_platform_driver(sun8i_a33_pinctrl_driver); ---- a/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c -@@ -12,7 +12,7 @@ - * warranty of any kind, whether express or implied. - */ - --#include -+#include - #include - #include - #include -@@ -587,7 +587,6 @@ static const struct of_device_id sun8i_a - { .compatible = "allwinner,sun8i-a83t-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun8i_a83t_pinctrl_match); - - static struct platform_driver sun8i_a83t_pinctrl_driver = { - .probe = sun8i_a83t_pinctrl_probe, -@@ -596,8 +595,4 @@ static struct platform_driver sun8i_a83t - .of_match_table = sun8i_a83t_pinctrl_match, - }, - }; --module_platform_driver(sun8i_a83t_pinctrl_driver); -- --MODULE_AUTHOR("Vishnu Patekar "); --MODULE_DESCRIPTION("Allwinner a83t pinctrl driver"); --MODULE_LICENSE("GPL"); -+builtin_platform_driver(sun8i_a83t_pinctrl_driver); ---- a/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c -@@ -10,7 +10,7 @@ - * warranty of any kind, whether express or implied. - */ - --#include -+#include - #include - #include - #include -@@ -733,7 +733,6 @@ static const struct of_device_id sun9i_a - { .compatible = "allwinner,sun9i-a80-pinctrl", }, - {} - }; --MODULE_DEVICE_TABLE(of, sun9i_a80_pinctrl_match); - - static struct platform_driver sun9i_a80_pinctrl_driver = { - .probe = sun9i_a80_pinctrl_probe, -@@ -742,8 +741,4 @@ static struct platform_driver sun9i_a80_ - .of_match_table = sun9i_a80_pinctrl_match, - }, - }; --module_platform_driver(sun9i_a80_pinctrl_driver); -- --MODULE_AUTHOR("Maxime Ripard "); --MODULE_DESCRIPTION("Allwinner A80 pinctrl driver"); --MODULE_LICENSE("GPL"); -+builtin_platform_driver(sun9i_a80_pinctrl_driver); diff --git a/target/linux/sunxi/patches-4.9/0036-pinctrl-sunxi-Free-configs-in-pinctrl_map-only-if-it.patch b/target/linux/sunxi/patches-4.9/0036-pinctrl-sunxi-Free-configs-in-pinctrl_map-only-if-it.patch deleted file mode 100644 index 02c5f568c8d..00000000000 --- a/target/linux/sunxi/patches-4.9/0036-pinctrl-sunxi-Free-configs-in-pinctrl_map-only-if-it.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 88f01a1bd0e0dbd01b65907023dbe53cf524ea2a Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Fri, 11 Nov 2016 10:35:10 +0800 -Subject: pinctrl: sunxi: Free configs in pinctrl_map only if it is a config - map - -In the recently refactored sunxi pinctrl library, we are only allocating -one set of pin configs for each pinmux setting node. When the pinctrl_map -structure is freed, the pin configs should also be freed. However the -code assumed the first map would contain the configs, which actually -never happens, as the mux function map gets added first. - -The proper way to do this is to look through all the maps and free the -first one whose type is actually PIN_MAP_TYPE_CONFIGS_GROUP. - -Also slightly expand the comment explaining this. - -Fixes: f233dbca6227 ("pinctrl: sunxi: Rework the pin config building code") -Signed-off-by: Chen-Yu Tsai -Acked-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 17 +++++++++++++++-- - 1 file changed, 15 insertions(+), 2 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -408,8 +408,21 @@ static void sunxi_pctrl_dt_free_map(stru - struct pinctrl_map *map, - unsigned num_maps) - { -- /* All the maps have the same pin config, free only the first one */ -- kfree(map[0].data.configs.configs); -+ int i; -+ -+ /* pin config is never in the first map */ -+ for (i = 1; i < num_maps; i++) { -+ if (map[i].type != PIN_MAP_TYPE_CONFIGS_GROUP) -+ continue; -+ -+ /* -+ * All the maps share the same pin config, -+ * free only the first one we find. -+ */ -+ kfree(map[i].data.configs.configs); -+ break; -+ } -+ - kfree(map); - } - diff --git a/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch b/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch deleted file mode 100644 index 4921240f79f..00000000000 --- a/target/linux/sunxi/patches-4.9/0037-pinctrl-sunxi-Fix-PIN_CONFIG_BIAS_PULL_-DOWN-UP-argu.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 223dba00b4072efc590c7d648f230db1b44186b9 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Fri, 11 Nov 2016 17:50:34 +0800 -Subject: pinctrl: sunxi: Fix PIN_CONFIG_BIAS_PULL_{DOWN,UP} argument - -According to pinconf-generic.h, the argument for -PIN_CONFIG_BIAS_PULL_{DOWN,UP} is non-zero if the bias is enabled -with a pull up/down resistor, zero if it is directly connected -to VDD or ground. - -Since Allwinner hardware uses a weak pull resistor internally, -the argument should be 1. - -Signed-off-by: Chen-Yu Tsai -Acked-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -291,12 +291,16 @@ static unsigned long *sunxi_pctrl_build_ - - if (sunxi_pctrl_has_bias_prop(node)) { - int pull = sunxi_pctrl_parse_bias_prop(node); -+ int arg = 0; - if (pull < 0) { - ret = pull; - goto err_free; - } - -- pinconfig[idx++] = pinconf_to_config_packed(pull, 0); -+ if (pull != PIN_CONFIG_BIAS_DISABLE) -+ arg = 1; /* hardware uses weak pull resistors */ -+ -+ pinconfig[idx++] = pinconf_to_config_packed(pull, arg); - } - - diff --git a/target/linux/sunxi/patches-4.9/0038-pinctrl-sunxi-Add-support-for-fetching-pinconf-setti.patch b/target/linux/sunxi/patches-4.9/0038-pinctrl-sunxi-Add-support-for-fetching-pinconf-setti.patch deleted file mode 100644 index d7972197ff5..00000000000 --- a/target/linux/sunxi/patches-4.9/0038-pinctrl-sunxi-Add-support-for-fetching-pinconf-setti.patch +++ /dev/null @@ -1,158 +0,0 @@ -From c5fda170e87a4bdaeb278f7e50f7a1f654e94eb5 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Fri, 11 Nov 2016 17:50:35 +0800 -Subject: pinctrl: sunxi: Add support for fetching pinconf settings from - hardware - -The sunxi pinctrl driver only caches whatever pinconf setting was last -set on a given pingroup. This is not particularly helpful, nor is it -correct. - -Fix this by actually reading the hardware registers and returning -the correct results or error codes. Also filter out unsupported -pinconf settings. Since this driver has a peculiar setup of 1 pin -per group, we can support both pin and pingroup pinconf setting -read back with the same code. The sunxi_pconf_reg helper and code -structure is inspired by pinctrl-msm. - -With this done we can also claim to support generic pinconf, by -setting .is_generic = true in pinconf_ops. - -Also remove the cached config value. The behavior of this was never -correct, as it only cached 1 setting instead of all of them. Since -we can now read back settings directly from the hardware, it is no -longer required. - -Signed-off-by: Chen-Yu Tsai -Acked-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 86 +++++++++++++++++++++++++++++++++-- - drivers/pinctrl/sunxi/pinctrl-sunxi.h | 1 - - 2 files changed, 81 insertions(+), 6 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -438,15 +438,91 @@ static const struct pinctrl_ops sunxi_pc - .get_group_pins = sunxi_pctrl_get_group_pins, - }; - -+static int sunxi_pconf_reg(unsigned pin, enum pin_config_param param, -+ u32 *offset, u32 *shift, u32 *mask) -+{ -+ switch (param) { -+ case PIN_CONFIG_DRIVE_STRENGTH: -+ *offset = sunxi_dlevel_reg(pin); -+ *shift = sunxi_dlevel_offset(pin); -+ *mask = DLEVEL_PINS_MASK; -+ break; -+ -+ case PIN_CONFIG_BIAS_PULL_UP: -+ case PIN_CONFIG_BIAS_PULL_DOWN: -+ case PIN_CONFIG_BIAS_DISABLE: -+ *offset = sunxi_pull_reg(pin); -+ *shift = sunxi_pull_offset(pin); -+ *mask = PULL_PINS_MASK; -+ break; -+ -+ default: -+ return -ENOTSUPP; -+ } -+ -+ return 0; -+} -+ -+static int sunxi_pconf_get(struct pinctrl_dev *pctldev, unsigned pin, -+ unsigned long *config) -+{ -+ struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); -+ enum pin_config_param param = pinconf_to_config_param(*config); -+ u32 offset, shift, mask, val; -+ u16 arg; -+ int ret; -+ -+ pin -= pctl->desc->pin_base; -+ -+ ret = sunxi_pconf_reg(pin, param, &offset, &shift, &mask); -+ if (ret < 0) -+ return ret; -+ -+ val = (readl(pctl->membase + offset) >> shift) & mask; -+ -+ switch (pinconf_to_config_param(*config)) { -+ case PIN_CONFIG_DRIVE_STRENGTH: -+ arg = (val + 1) * 10; -+ break; -+ -+ case PIN_CONFIG_BIAS_PULL_UP: -+ if (val != SUN4I_PINCTRL_PULL_UP) -+ return -EINVAL; -+ arg = 1; /* hardware is weak pull-up */ -+ break; -+ -+ case PIN_CONFIG_BIAS_PULL_DOWN: -+ if (val != SUN4I_PINCTRL_PULL_DOWN) -+ return -EINVAL; -+ arg = 1; /* hardware is weak pull-down */ -+ break; -+ -+ case PIN_CONFIG_BIAS_DISABLE: -+ if (val != SUN4I_PINCTRL_NO_PULL) -+ return -EINVAL; -+ arg = 0; -+ break; -+ -+ default: -+ /* sunxi_pconf_reg should catch anything unsupported */ -+ WARN_ON(1); -+ return -ENOTSUPP; -+ } -+ -+ *config = pinconf_to_config_packed(param, arg); -+ -+ return 0; -+} -+ - static int sunxi_pconf_group_get(struct pinctrl_dev *pctldev, - unsigned group, - unsigned long *config) - { - struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); -+ struct sunxi_pinctrl_group *g = &pctl->groups[group]; - -- *config = pctl->groups[group].config; -- -- return 0; -+ /* We only support 1 pin per group. Chain it to the pin callback */ -+ return sunxi_pconf_get(pctldev, g->pin, config); - } - - static int sunxi_pconf_group_set(struct pinctrl_dev *pctldev, -@@ -508,8 +584,6 @@ static int sunxi_pconf_group_set(struct - default: - break; - } -- /* cache the config value */ -- g->config = configs[i]; - } /* for each config */ - - spin_unlock_irqrestore(&pctl->lock, flags); -@@ -518,6 +592,8 @@ static int sunxi_pconf_group_set(struct - } - - static const struct pinconf_ops sunxi_pconf_ops = { -+ .is_generic = true, -+ .pin_config_get = sunxi_pconf_get, - .pin_config_group_get = sunxi_pconf_group_get, - .pin_config_group_set = sunxi_pconf_group_set, - }; ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h -@@ -109,7 +109,6 @@ struct sunxi_pinctrl_function { - - struct sunxi_pinctrl_group { - const char *name; -- unsigned long config; - unsigned pin; - }; - diff --git a/target/linux/sunxi/patches-4.9/0039-pinctrl-sunxi-Make-sunxi_pconf_group_set-use-sunxi_p.patch b/target/linux/sunxi/patches-4.9/0039-pinctrl-sunxi-Make-sunxi_pconf_group_set-use-sunxi_p.patch deleted file mode 100644 index 7555933f633..00000000000 --- a/target/linux/sunxi/patches-4.9/0039-pinctrl-sunxi-Make-sunxi_pconf_group_set-use-sunxi_p.patch +++ /dev/null @@ -1,122 +0,0 @@ -From 51814827190214986c452a166718bf12d32211c7 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Fri, 11 Nov 2016 17:50:36 +0800 -Subject: pinctrl: sunxi: Make sunxi_pconf_group_set use sunxi_pconf_reg helper - -The sunxi_pconf_reg helper introduced in the last patch gives us the -chance to rework sunxi_pconf_group_set to have it match the structure -of sunxi_pconf_(group_)get and make it easier to understand. - -For each config to set, it: - - 1. checks if the parameter is supported. - 2. checks if the argument is within limits. - 3. converts argument to the register value. - 4. writes to the register with spinlock held. - -As a result the function now blocks unsupported config parameters, -instead of silently ignoring them. - -Signed-off-by: Chen-Yu Tsai -Acked-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 64 +++++++++++++++++------------------ - 1 file changed, 32 insertions(+), 32 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -532,23 +532,27 @@ static int sunxi_pconf_group_set(struct - { - struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev); - struct sunxi_pinctrl_group *g = &pctl->groups[group]; -- unsigned long flags; - unsigned pin = g->pin - pctl->desc->pin_base; -- u32 val, mask; -- u16 strength; -- u8 dlevel; - int i; - -- spin_lock_irqsave(&pctl->lock, flags); -- - for (i = 0; i < num_configs; i++) { -- switch (pinconf_to_config_param(configs[i])) { -+ enum pin_config_param param; -+ unsigned long flags; -+ u32 offset, shift, mask, reg; -+ u16 arg, val; -+ int ret; -+ -+ param = pinconf_to_config_param(configs[i]); -+ arg = pinconf_to_config_argument(configs[i]); -+ -+ ret = sunxi_pconf_reg(pin, param, &offset, &shift, &mask); -+ if (ret < 0) -+ return ret; -+ -+ switch (param) { - case PIN_CONFIG_DRIVE_STRENGTH: -- strength = pinconf_to_config_argument(configs[i]); -- if (strength > 40) { -- spin_unlock_irqrestore(&pctl->lock, flags); -+ if (arg < 10 || arg > 40) - return -EINVAL; -- } - /* - * We convert from mA to what the register expects: - * 0: 10mA -@@ -556,37 +560,33 @@ static int sunxi_pconf_group_set(struct - * 2: 30mA - * 3: 40mA - */ -- dlevel = strength / 10 - 1; -- val = readl(pctl->membase + sunxi_dlevel_reg(pin)); -- mask = DLEVEL_PINS_MASK << sunxi_dlevel_offset(pin); -- writel((val & ~mask) -- | dlevel << sunxi_dlevel_offset(pin), -- pctl->membase + sunxi_dlevel_reg(pin)); -+ val = arg / 10 - 1; - break; - case PIN_CONFIG_BIAS_DISABLE: -- val = readl(pctl->membase + sunxi_pull_reg(pin)); -- mask = PULL_PINS_MASK << sunxi_pull_offset(pin); -- writel((val & ~mask), -- pctl->membase + sunxi_pull_reg(pin)); -+ val = 0; - break; - case PIN_CONFIG_BIAS_PULL_UP: -- val = readl(pctl->membase + sunxi_pull_reg(pin)); -- mask = PULL_PINS_MASK << sunxi_pull_offset(pin); -- writel((val & ~mask) | 1 << sunxi_pull_offset(pin), -- pctl->membase + sunxi_pull_reg(pin)); -+ if (arg == 0) -+ return -EINVAL; -+ val = 1; - break; - case PIN_CONFIG_BIAS_PULL_DOWN: -- val = readl(pctl->membase + sunxi_pull_reg(pin)); -- mask = PULL_PINS_MASK << sunxi_pull_offset(pin); -- writel((val & ~mask) | 2 << sunxi_pull_offset(pin), -- pctl->membase + sunxi_pull_reg(pin)); -+ if (arg == 0) -+ return -EINVAL; -+ val = 2; - break; - default: -- break; -+ /* sunxi_pconf_reg should catch anything unsupported */ -+ WARN_ON(1); -+ return -ENOTSUPP; - } -- } /* for each config */ - -- spin_unlock_irqrestore(&pctl->lock, flags); -+ spin_lock_irqsave(&pctl->lock, flags); -+ reg = readl(pctl->membase + offset); -+ reg &= ~(mask << shift); -+ writel(reg | val << shift, pctl->membase + offset); -+ spin_unlock_irqrestore(&pctl->lock, flags); -+ } /* for each config */ - - return 0; - } diff --git a/target/linux/sunxi/patches-4.9/0040-pinctrl-sunxi-Add-support-for-interrupt-debouncing.patch b/target/linux/sunxi/patches-4.9/0040-pinctrl-sunxi-Add-support-for-interrupt-debouncing.patch deleted file mode 100644 index 01cbe31bef1..00000000000 --- a/target/linux/sunxi/patches-4.9/0040-pinctrl-sunxi-Add-support-for-interrupt-debouncing.patch +++ /dev/null @@ -1,171 +0,0 @@ -From 7c926492d38a3feef4b4b29c91b7c03eb1b8b546 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 14 Nov 2016 21:53:03 +0100 -Subject: pinctrl: sunxi: Add support for interrupt debouncing - -The pin controller found in the Allwinner SoCs has support for interrupts -debouncing. - -However, this is not done per-pin, preventing us from using the generic -pinconf binding for that, but per irq bank, which, depending on the SoC, -ranges from one to five. - -Introduce a device-wide property to deal with this using a microsecond -resolution. We can re-use the per-pin input-debounce property for that, so -let's do it! - -Signed-off-by: Maxime Ripard -Acked-by: Rob Herring -Signed-off-by: Linus Walleij ---- - .../bindings/pinctrl/allwinner,sunxi-pinctrl.txt | 14 ++++ - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 84 ++++++++++++++++++++++ - drivers/pinctrl/sunxi/pinctrl-sunxi.h | 7 ++ - 3 files changed, 105 insertions(+) - ---- a/Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt -+++ b/Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt -@@ -28,6 +28,20 @@ Required properties: - - reg: Should contain the register physical address and length for the - pin controller. - -+- clocks: phandle to the clocks feeding the pin controller: -+ - "apb": the gated APB parent clock -+ - "hosc": the high frequency oscillator in the system -+ - "losc": the low frequency oscillator in the system -+ -+Note: For backward compatibility reasons, the hosc and losc clocks are only -+required if you need to use the optional input-debounce property. Any new -+device tree should set them. -+ -+Optional properties: -+ - input-debounce: Array of debouncing periods in microseconds. One period per -+ irq bank found in the controller. 0 if no setup required. -+ -+ - Please refer to pinctrl-bindings.txt in this directory for details of the - common pinctrl bindings used by client devices. - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -1122,6 +1122,88 @@ static int sunxi_pinctrl_build_state(str - return 0; - } - -+static int sunxi_pinctrl_get_debounce_div(struct clk *clk, int freq, int *diff) -+{ -+ unsigned long clock = clk_get_rate(clk); -+ unsigned int best_diff = ~0, best_div; -+ int i; -+ -+ for (i = 0; i < 8; i++) { -+ int cur_diff = abs(freq - (clock >> i)); -+ -+ if (cur_diff < best_diff) { -+ best_diff = cur_diff; -+ best_div = i; -+ } -+ } -+ -+ *diff = best_diff; -+ return best_div; -+} -+ -+static int sunxi_pinctrl_setup_debounce(struct sunxi_pinctrl *pctl, -+ struct device_node *node) -+{ -+ unsigned int hosc_diff, losc_diff; -+ unsigned int hosc_div, losc_div; -+ struct clk *hosc, *losc; -+ u8 div, src; -+ int i, ret; -+ -+ /* Deal with old DTs that didn't have the oscillators */ -+ if (of_count_phandle_with_args(node, "clocks", "#clock-cells") != 3) -+ return 0; -+ -+ /* If we don't have any setup, bail out */ -+ if (!of_find_property(node, "input-debounce", NULL)) -+ return 0; -+ -+ losc = devm_clk_get(pctl->dev, "losc"); -+ if (IS_ERR(losc)) -+ return PTR_ERR(losc); -+ -+ hosc = devm_clk_get(pctl->dev, "hosc"); -+ if (IS_ERR(hosc)) -+ return PTR_ERR(hosc); -+ -+ for (i = 0; i < pctl->desc->irq_banks; i++) { -+ unsigned long debounce_freq; -+ u32 debounce; -+ -+ ret = of_property_read_u32_index(node, "input-debounce", -+ i, &debounce); -+ if (ret) -+ return ret; -+ -+ if (!debounce) -+ continue; -+ -+ debounce_freq = DIV_ROUND_CLOSEST(USEC_PER_SEC, debounce); -+ losc_div = sunxi_pinctrl_get_debounce_div(losc, -+ debounce_freq, -+ &losc_diff); -+ -+ hosc_div = sunxi_pinctrl_get_debounce_div(hosc, -+ debounce_freq, -+ &hosc_diff); -+ -+ if (hosc_diff < losc_diff) { -+ div = hosc_div; -+ src = 1; -+ } else { -+ div = losc_div; -+ src = 0; -+ } -+ -+ writel(src | div << 4, -+ pctl->membase + -+ sunxi_irq_debounce_reg_from_bank(i, -+ pctl->desc->irq_bank_base)); -+ } -+ -+ return 0; -+} -+ - int sunxi_pinctrl_init(struct platform_device *pdev, - const struct sunxi_pinctrl_desc *desc) - { -@@ -1284,6 +1366,8 @@ int sunxi_pinctrl_init(struct platform_d - pctl); - } - -+ sunxi_pinctrl_setup_debounce(pctl, node); -+ - dev_info(&pdev->dev, "initialized sunXi PIO driver\n"); - - return 0; ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.h -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.h -@@ -69,6 +69,8 @@ - #define IRQ_STATUS_IRQ_BITS 1 - #define IRQ_STATUS_IRQ_MASK ((1 << IRQ_STATUS_IRQ_BITS) - 1) - -+#define IRQ_DEBOUNCE_REG 0x218 -+ - #define IRQ_MEM_SIZE 0x20 - - #define IRQ_EDGE_RISING 0x00 -@@ -265,6 +267,11 @@ static inline u32 sunxi_irq_ctrl_offset( - return irq_num * IRQ_CTRL_IRQ_BITS; - } - -+static inline u32 sunxi_irq_debounce_reg_from_bank(u8 bank, unsigned bank_base) -+{ -+ return IRQ_DEBOUNCE_REG + (bank_base + bank) * IRQ_MEM_SIZE; -+} -+ - static inline u32 sunxi_irq_status_reg_from_bank(u8 bank, unsigned bank_base) - { - return IRQ_STATUS_REG + (bank_base + bank) * IRQ_MEM_SIZE; diff --git a/target/linux/sunxi/patches-4.9/0041-pinctrl-sunxi-fix-theoretical-uninitialized-variable.patch b/target/linux/sunxi/patches-4.9/0041-pinctrl-sunxi-fix-theoretical-uninitialized-variable.patch deleted file mode 100644 index 69de015b677..00000000000 --- a/target/linux/sunxi/patches-4.9/0041-pinctrl-sunxi-fix-theoretical-uninitialized-variable.patch +++ /dev/null @@ -1,40 +0,0 @@ -From d8a22212737314cc02692cc90eda7d844fa20257 Mon Sep 17 00:00:00 2001 -From: Arnd Bergmann -Date: Wed, 16 Nov 2016 15:18:18 +0100 -Subject: pinctrl: sunxi: fix theoretical uninitialized variable access - -gcc warns about a way that it could use an uninitialized variable: - -drivers/pinctrl/sunxi/pinctrl-sunxi.c: In function 'sunxi_pinctrl_init': -drivers/pinctrl/sunxi/pinctrl-sunxi.c:1191:8: error: 'best_div' may be used uninitialized in this function [-Werror=maybe-uninitialized] - -This cannot really happen except if 'freq' is UINT_MAX and 'clock' is -zero, and both of these are forbidden. To shut up the warning anyway, -this changes the logic to initialize the return code to the first -divider value before looking at the others. - -Fixes: 7c926492d38a ("pinctrl: sunxi: Add support for interrupt debouncing") -Signed-off-by: Arnd Bergmann -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -1125,10 +1125,13 @@ static int sunxi_pinctrl_build_state(str - static int sunxi_pinctrl_get_debounce_div(struct clk *clk, int freq, int *diff) - { - unsigned long clock = clk_get_rate(clk); -- unsigned int best_diff = ~0, best_div; -+ unsigned int best_diff, best_div; - int i; - -- for (i = 0; i < 8; i++) { -+ best_diff = abs(freq - clock); -+ best_div = 0; -+ -+ for (i = 1; i < 8; i++) { - int cur_diff = abs(freq - (clock >> i)); - - if (cur_diff < best_diff) { diff --git a/target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch b/target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch deleted file mode 100644 index 8ed4f27b4c6..00000000000 --- a/target/linux/sunxi/patches-4.9/0042-pinctrl-sunxi-Testing-the-wrong-variable.patch +++ /dev/null @@ -1,35 +0,0 @@ -From b3cde198b17f504643cc1eeffc4623f03326f436 Mon Sep 17 00:00:00 2001 -From: Dan Carpenter -Date: Fri, 18 Nov 2016 14:35:57 +0300 -Subject: pinctrl: sunxi: Testing the wrong variable - -Smatch complains that we dereference "map" before testing it for NULL -which is true. We should be testing "*map" instead. Also on the error -path, we should free *map and set it to NULL. - -Signed-off-by: Dan Carpenter -Acked-by: Maxime Ripard -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -398,13 +398,14 @@ static int sunxi_pctrl_dt_node_to_map(st - * map array - */ - *map = krealloc(*map, i * sizeof(struct pinctrl_map), GFP_KERNEL); -- if (!map) -+ if (!*map) - return -ENOMEM; - - return 0; - - err_free_map: -- kfree(map); -+ kfree(*map); -+ *map = NULL; - return ret; - } - diff --git a/target/linux/sunxi/patches-4.9/0043-pinctrl-sunxi-Don-t-enforce-bias-disable-for-now.patch b/target/linux/sunxi/patches-4.9/0043-pinctrl-sunxi-Don-t-enforce-bias-disable-for-now.patch deleted file mode 100644 index d6e639af528..00000000000 --- a/target/linux/sunxi/patches-4.9/0043-pinctrl-sunxi-Don-t-enforce-bias-disable-for-now.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 2154d94b40ea2a5de05245521371d0461bb0d669 Mon Sep 17 00:00:00 2001 -From: Maxime Ripard -Date: Mon, 23 Jan 2017 09:21:30 +0100 -Subject: pinctrl: sunxi: Don't enforce bias disable (for now) - -Commit 07fe64ba213f ("pinctrl: sunxi: Handle bias disable") actually -enforced enforced the disabling of the pull up/down resistors instead of -ignoring it like it was done before. - -This was part of a wider rework to switch to the generic pinconf bindings, -and was meant to be merged together with DT patches that were switching to -it, and removing what was considered default values by both the binding and -the boards. This included no bias on a pin. - -However, those DT patches were delayed to 4.11, which would be fine only -for a significant number boards having the bias setup wrong, which in turns -break the MMC on those boards (and possibly other devices too). - -In order to avoid conflicts as much as possible, bring back the old -behaviour for 4.10, and we'll revert that commit once all the DT bits will -have landed. - -Tested-by: Priit Laes -Signed-off-by: Maxime Ripard -Acked-by: Chen-Yu Tsai -Signed-off-by: Linus Walleij ---- - drivers/pinctrl/sunxi/pinctrl-sunxi.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c -+++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c -@@ -564,8 +564,7 @@ static int sunxi_pconf_group_set(struct - val = arg / 10 - 1; - break; - case PIN_CONFIG_BIAS_DISABLE: -- val = 0; -- break; -+ continue; - case PIN_CONFIG_BIAS_PULL_UP: - if (arg == 0) - return -EINVAL; diff --git a/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch b/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch deleted file mode 100644 index c304f7937f3..00000000000 --- a/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch +++ /dev/null @@ -1,160 +0,0 @@ -From 49f01c9e14b3476cbdf9623c4812c43f6485830b Mon Sep 17 00:00:00 2001 -From: Milo Kim -Date: Fri, 28 Oct 2016 15:59:01 +0900 -Subject: ARM: dts: sun8i: Add common dtsi file for NanoPi SBCs - -(backported from kernel 4.13) - -This patch provides a common file for NanoPi M1 and Neo SBC. - -Those have common features below. - * UART0 - * 2 LEDs - * USB host (EHCI3, OHCI3) and PHY - * MicroSD - * GPIO key switch - -Cc: James Pettigrew -Signed-off-by: Milo Kim -Signed-off-by: Maxime Ripard - ---- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi -@@ -0,0 +1,137 @@ -+/* -+ * Copyright (C) 2016 James Pettigrew -+ * Copyright (C) 2016 Milo Kim -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun8i-h3.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_npi>, <&leds_r_npi>; -+ -+ status { -+ label = "nanopi:blue:status"; -+ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; -+ linux,default-trigger = "heartbeat"; -+ }; -+ -+ pwr { -+ label = "nanopi:green:pwr"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "k1"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_npi>; -+ -+ k1@0 { -+ label = "k1"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&ehci3 { -+ status = "okay"; -+}; -+ -+&mmc0 { -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; -+ cd-inverted; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -+ status = "okay"; -+ vmmc-supply = <®_vcc3v3>; -+}; -+ -+&ohci3 { -+ status = "okay"; -+}; -+ -+&pio { -+ leds_npi: led_pins@0 { -+ pins = "PA10"; -+ function = "gpio_out"; -+ }; -+}; -+ -+&r_pio { -+ leds_r_npi: led_pins@0 { -+ pins = "PL10"; -+ function = "gpio_out"; -+ }; -+ -+ sw_r_npi: key_pins@0 { -+ pins = "PL3"; -+ function = "gpio_in"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch deleted file mode 100644 index ddc8290205c..00000000000 --- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch +++ /dev/null @@ -1,3497 +0,0 @@ ---- a/Documentation/devicetree/bindings/net/stmmac.txt -+++ b/Documentation/devicetree/bindings/net/stmmac.txt -@@ -1,7 +1,7 @@ - * STMicroelectronics 10/100/1000 Ethernet driver (GMAC) - - Required properties: --- compatible: Should be "snps,dwmac-" "snps,dwmac" -+- compatible: Should be "snps,dwmac-", "snps,dwmac" - For backwards compatibility: "st,spear600-gmac" is also supported. - - reg: Address and length of the register set for the device - - interrupt-parent: Should be the phandle for the interrupt controller -@@ -34,7 +34,13 @@ Optional properties: - platforms. - - tx-fifo-depth: See ethernet.txt file in the same directory - - rx-fifo-depth: See ethernet.txt file in the same directory --- snps,pbl Programmable Burst Length -+- snps,pbl Programmable Burst Length (tx and rx) -+- snps,txpbl Tx Programmable Burst Length. Only for GMAC and newer. -+ If set, DMA tx will use this value rather than snps,pbl. -+- snps,rxpbl Rx Programmable Burst Length. Only for GMAC and newer. -+ If set, DMA rx will use this value rather than snps,pbl. -+- snps,no-pbl-x8 Don't multiply the pbl/txpbl/rxpbl values by 8. -+ For core rev < 3.50, don't multiply the values by 4. - - snps,aal Address-Aligned Beats - - snps,fixed-burst Program the DMA to use the fixed burst mode - - snps,mixed-burst Program the DMA to use the mixed burst mode -@@ -50,6 +56,8 @@ Optional properties: - - snps,ps-speed: port selection speed that can be passed to the core when - PCS is supported. For example, this is used in case of SGMII - and MAC2MAC connection. -+- snps,tso: this enables the TSO feature otherwise it will be managed by -+ MAC HW capability register. Only for GMAC4 and newer. - - AXI BUS Mode parameters: below the list of all the parameters to program the - AXI register inside the DMA module: - - snps,lpi_en: enable Low Power Interface -@@ -62,8 +70,6 @@ Optional properties: - - snps,fb: fixed-burst - - snps,mb: mixed-burst - - snps,rb: rebuild INCRx Burst -- - snps,tso: this enables the TSO feature otherwise it will be managed by -- MAC HW capability register. - - mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus. - - Examples: ---- a/drivers/net/ethernet/stmicro/stmmac/Kconfig -+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig -@@ -69,6 +69,17 @@ config DWMAC_MESON - the stmmac device driver. This driver is used for Meson6, - Meson8, Meson8b and GXBB SoCs. - -+config DWMAC_OXNAS -+ tristate "Oxford Semiconductor OXNAS dwmac support" -+ default ARCH_OXNAS -+ depends on OF && COMMON_CLK && (ARCH_OXNAS || COMPILE_TEST) -+ select MFD_SYSCON -+ help -+ Support for Ethernet controller on Oxford Semiconductor OXNAS SoCs. -+ -+ This selects the Oxford Semiconductor OXNASSoC glue layer support for -+ the stmmac device driver. This driver is used for OX820. -+ - config DWMAC_ROCKCHIP - tristate "Rockchip dwmac support" - default ARCH_ROCKCHIP ---- a/drivers/net/ethernet/stmicro/stmmac/Makefile -+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile -@@ -10,6 +10,7 @@ obj-$(CONFIG_STMMAC_PLATFORM) += stmmac- - obj-$(CONFIG_DWMAC_IPQ806X) += dwmac-ipq806x.o - obj-$(CONFIG_DWMAC_LPC18XX) += dwmac-lpc18xx.o - obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o -+obj-$(CONFIG_DWMAC_OXNAS) += dwmac-oxnas.o - obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o - obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o - obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o ---- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c -+++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c -@@ -34,7 +34,7 @@ static int stmmac_jumbo_frm(void *p, str - unsigned int entry = priv->cur_tx; - struct dma_desc *desc = priv->dma_tx + entry; - unsigned int nopaged_len = skb_headlen(skb); -- unsigned int bmax; -+ unsigned int bmax, des2; - unsigned int i = 1, len; - - if (priv->plat->enh_desc) -@@ -44,11 +44,12 @@ static int stmmac_jumbo_frm(void *p, str - - len = nopaged_len - bmax; - -- desc->des2 = dma_map_single(priv->device, skb->data, -- bmax, DMA_TO_DEVICE); -- if (dma_mapping_error(priv->device, desc->des2)) -+ des2 = dma_map_single(priv->device, skb->data, -+ bmax, DMA_TO_DEVICE); -+ desc->des2 = cpu_to_le32(des2); -+ if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = desc->des2; -+ priv->tx_skbuff_dma[entry].buf = des2; - priv->tx_skbuff_dma[entry].len = bmax; - /* do not close the descriptor and do not set own bit */ - priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, STMMAC_CHAIN_MODE, -@@ -60,12 +61,13 @@ static int stmmac_jumbo_frm(void *p, str - desc = priv->dma_tx + entry; - - if (len > bmax) { -- desc->des2 = dma_map_single(priv->device, -- (skb->data + bmax * i), -- bmax, DMA_TO_DEVICE); -- if (dma_mapping_error(priv->device, desc->des2)) -+ des2 = dma_map_single(priv->device, -+ (skb->data + bmax * i), -+ bmax, DMA_TO_DEVICE); -+ desc->des2 = cpu_to_le32(des2); -+ if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = desc->des2; -+ priv->tx_skbuff_dma[entry].buf = des2; - priv->tx_skbuff_dma[entry].len = bmax; - priv->hw->desc->prepare_tx_desc(desc, 0, bmax, csum, - STMMAC_CHAIN_MODE, 1, -@@ -73,12 +75,13 @@ static int stmmac_jumbo_frm(void *p, str - len -= bmax; - i++; - } else { -- desc->des2 = dma_map_single(priv->device, -- (skb->data + bmax * i), len, -- DMA_TO_DEVICE); -- if (dma_mapping_error(priv->device, desc->des2)) -+ des2 = dma_map_single(priv->device, -+ (skb->data + bmax * i), len, -+ DMA_TO_DEVICE); -+ desc->des2 = cpu_to_le32(des2); -+ if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = desc->des2; -+ priv->tx_skbuff_dma[entry].buf = des2; - priv->tx_skbuff_dma[entry].len = len; - /* last descriptor can be set now */ - priv->hw->desc->prepare_tx_desc(desc, 0, len, csum, -@@ -119,19 +122,19 @@ static void stmmac_init_dma_chain(void * - struct dma_extended_desc *p = (struct dma_extended_desc *)des; - for (i = 0; i < (size - 1); i++) { - dma_phy += sizeof(struct dma_extended_desc); -- p->basic.des3 = (unsigned int)dma_phy; -+ p->basic.des3 = cpu_to_le32((unsigned int)dma_phy); - p++; - } -- p->basic.des3 = (unsigned int)phy_addr; -+ p->basic.des3 = cpu_to_le32((unsigned int)phy_addr); - - } else { - struct dma_desc *p = (struct dma_desc *)des; - for (i = 0; i < (size - 1); i++) { - dma_phy += sizeof(struct dma_desc); -- p->des3 = (unsigned int)dma_phy; -+ p->des3 = cpu_to_le32((unsigned int)dma_phy); - p++; - } -- p->des3 = (unsigned int)phy_addr; -+ p->des3 = cpu_to_le32((unsigned int)phy_addr); - } - } - -@@ -144,10 +147,10 @@ static void stmmac_refill_desc3(void *pr - * 1588-2002 time stamping is enabled, hence reinitialize it - * to keep explicit chaining in the descriptor. - */ -- p->des3 = (unsigned int)(priv->dma_rx_phy + -- (((priv->dirty_rx) + 1) % -- DMA_RX_SIZE) * -- sizeof(struct dma_desc)); -+ p->des3 = cpu_to_le32((unsigned int)(priv->dma_rx_phy + -+ (((priv->dirty_rx) + 1) % -+ DMA_RX_SIZE) * -+ sizeof(struct dma_desc))); - } - - static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) -@@ -161,9 +164,9 @@ static void stmmac_clean_desc3(void *pri - * 1588-2002 time stamping is enabled, hence reinitialize it - * to keep explicit chaining in the descriptor. - */ -- p->des3 = (unsigned int)((priv->dma_tx_phy + -- ((priv->dirty_tx + 1) % DMA_TX_SIZE)) -- * sizeof(struct dma_desc)); -+ p->des3 = cpu_to_le32((unsigned int)((priv->dma_tx_phy + -+ ((priv->dirty_tx + 1) % DMA_TX_SIZE)) -+ * sizeof(struct dma_desc))); - } - - const struct stmmac_mode_ops chain_mode_ops = { ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -44,6 +44,7 @@ - #define DWMAC_CORE_4_00 0x40 - #define STMMAC_CHAN0 0 /* Always supported and default for all chips */ - -+/* These need to be power of two, and >= 4 */ - #define DMA_TX_SIZE 512 - #define DMA_RX_SIZE 512 - #define STMMAC_GET_ENTRY(x, size) ((x + 1) & (size - 1)) -@@ -411,8 +412,8 @@ extern const struct stmmac_desc_ops ndes - struct stmmac_dma_ops { - /* DMA core initialization */ - int (*reset)(void __iomem *ioaddr); -- void (*init)(void __iomem *ioaddr, int pbl, int fb, int mb, -- int aal, u32 dma_tx, u32 dma_rx, int atds); -+ void (*init)(void __iomem *ioaddr, struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx, u32 dma_rx, int atds); - /* Configure the AXI Bus Mode Register */ - void (*axi)(void __iomem *ioaddr, struct stmmac_axi *axi); - /* Dump DMA registers */ -@@ -506,6 +507,12 @@ struct mac_link { - struct mii_regs { - unsigned int addr; /* MII Address */ - unsigned int data; /* MII Data */ -+ unsigned int addr_shift; /* MII address shift */ -+ unsigned int reg_shift; /* MII reg shift */ -+ unsigned int addr_mask; /* MII address mask */ -+ unsigned int reg_mask; /* MII reg mask */ -+ unsigned int clk_csr_shift; -+ unsigned int clk_csr_mask; - }; - - /* Helpers to manage the descriptors for chain and ring modes */ ---- a/drivers/net/ethernet/stmicro/stmmac/descs.h -+++ b/drivers/net/ethernet/stmicro/stmmac/descs.h -@@ -87,7 +87,7 @@ - #define TDES0_ERROR_SUMMARY BIT(15) - #define TDES0_IP_HEADER_ERROR BIT(16) - #define TDES0_TIME_STAMP_STATUS BIT(17) --#define TDES0_OWN BIT(31) -+#define TDES0_OWN ((u32)BIT(31)) /* silence sparse */ - /* TDES1 */ - #define TDES1_BUFFER1_SIZE_MASK GENMASK(10, 0) - #define TDES1_BUFFER2_SIZE_MASK GENMASK(21, 11) -@@ -130,7 +130,7 @@ - #define ETDES0_FIRST_SEGMENT BIT(28) - #define ETDES0_LAST_SEGMENT BIT(29) - #define ETDES0_INTERRUPT BIT(30) --#define ETDES0_OWN BIT(31) -+#define ETDES0_OWN ((u32)BIT(31)) /* silence sparse */ - /* TDES1 */ - #define ETDES1_BUFFER1_SIZE_MASK GENMASK(12, 0) - #define ETDES1_BUFFER2_SIZE_MASK GENMASK(28, 16) -@@ -170,19 +170,19 @@ - - /* Basic descriptor structure for normal and alternate descriptors */ - struct dma_desc { -- unsigned int des0; -- unsigned int des1; -- unsigned int des2; -- unsigned int des3; -+ __le32 des0; -+ __le32 des1; -+ __le32 des2; -+ __le32 des3; - }; - - /* Extended descriptor structure (e.g. >= databook 3.50a) */ - struct dma_extended_desc { - struct dma_desc basic; /* Basic descriptors */ -- unsigned int des4; /* Extended Status */ -- unsigned int des5; /* Reserved */ -- unsigned int des6; /* Tx/Rx Timestamp Low */ -- unsigned int des7; /* Tx/Rx Timestamp High */ -+ __le32 des4; /* Extended Status */ -+ __le32 des5; /* Reserved */ -+ __le32 des6; /* Tx/Rx Timestamp Low */ -+ __le32 des7; /* Tx/Rx Timestamp High */ - }; - - /* Transmit checksum insertion control */ ---- a/drivers/net/ethernet/stmicro/stmmac/descs_com.h -+++ b/drivers/net/ethernet/stmicro/stmmac/descs_com.h -@@ -35,47 +35,50 @@ - /* Enhanced descriptors */ - static inline void ehn_desc_rx_set_on_ring(struct dma_desc *p, int end) - { -- p->des1 |= ((BUF_SIZE_8KiB - 1) << ERDES1_BUFFER2_SIZE_SHIFT) -- & ERDES1_BUFFER2_SIZE_MASK; -+ p->des1 |= cpu_to_le32(((BUF_SIZE_8KiB - 1) -+ << ERDES1_BUFFER2_SIZE_SHIFT) -+ & ERDES1_BUFFER2_SIZE_MASK); - - if (end) -- p->des1 |= ERDES1_END_RING; -+ p->des1 |= cpu_to_le32(ERDES1_END_RING); - } - - static inline void enh_desc_end_tx_desc_on_ring(struct dma_desc *p, int end) - { - if (end) -- p->des0 |= ETDES0_END_RING; -+ p->des0 |= cpu_to_le32(ETDES0_END_RING); - else -- p->des0 &= ~ETDES0_END_RING; -+ p->des0 &= cpu_to_le32(~ETDES0_END_RING); - } - - static inline void enh_set_tx_desc_len_on_ring(struct dma_desc *p, int len) - { - if (unlikely(len > BUF_SIZE_4KiB)) { -- p->des1 |= (((len - BUF_SIZE_4KiB) << ETDES1_BUFFER2_SIZE_SHIFT) -+ p->des1 |= cpu_to_le32((((len - BUF_SIZE_4KiB) -+ << ETDES1_BUFFER2_SIZE_SHIFT) - & ETDES1_BUFFER2_SIZE_MASK) | (BUF_SIZE_4KiB -- & ETDES1_BUFFER1_SIZE_MASK); -+ & ETDES1_BUFFER1_SIZE_MASK)); - } else -- p->des1 |= (len & ETDES1_BUFFER1_SIZE_MASK); -+ p->des1 |= cpu_to_le32((len & ETDES1_BUFFER1_SIZE_MASK)); - } - - /* Normal descriptors */ - static inline void ndesc_rx_set_on_ring(struct dma_desc *p, int end) - { -- p->des1 |= ((BUF_SIZE_2KiB - 1) << RDES1_BUFFER2_SIZE_SHIFT) -- & RDES1_BUFFER2_SIZE_MASK; -+ p->des1 |= cpu_to_le32(((BUF_SIZE_2KiB - 1) -+ << RDES1_BUFFER2_SIZE_SHIFT) -+ & RDES1_BUFFER2_SIZE_MASK); - - if (end) -- p->des1 |= RDES1_END_RING; -+ p->des1 |= cpu_to_le32(RDES1_END_RING); - } - - static inline void ndesc_end_tx_desc_on_ring(struct dma_desc *p, int end) - { - if (end) -- p->des1 |= TDES1_END_RING; -+ p->des1 |= cpu_to_le32(TDES1_END_RING); - else -- p->des1 &= ~TDES1_END_RING; -+ p->des1 &= cpu_to_le32(~TDES1_END_RING); - } - - static inline void norm_set_tx_desc_len_on_ring(struct dma_desc *p, int len) -@@ -83,10 +86,11 @@ static inline void norm_set_tx_desc_len_ - if (unlikely(len > BUF_SIZE_2KiB)) { - unsigned int buffer1 = (BUF_SIZE_2KiB - 1) - & TDES1_BUFFER1_SIZE_MASK; -- p->des1 |= ((((len - buffer1) << TDES1_BUFFER2_SIZE_SHIFT) -- & TDES1_BUFFER2_SIZE_MASK) | buffer1); -+ p->des1 |= cpu_to_le32((((len - buffer1) -+ << TDES1_BUFFER2_SIZE_SHIFT) -+ & TDES1_BUFFER2_SIZE_MASK) | buffer1); - } else -- p->des1 |= (len & TDES1_BUFFER1_SIZE_MASK); -+ p->des1 |= cpu_to_le32((len & TDES1_BUFFER1_SIZE_MASK)); - } - - /* Specific functions used for Chain mode */ -@@ -94,32 +98,32 @@ static inline void norm_set_tx_desc_len_ - /* Enhanced descriptors */ - static inline void ehn_desc_rx_set_on_chain(struct dma_desc *p) - { -- p->des1 |= ERDES1_SECOND_ADDRESS_CHAINED; -+ p->des1 |= cpu_to_le32(ERDES1_SECOND_ADDRESS_CHAINED); - } - - static inline void enh_desc_end_tx_desc_on_chain(struct dma_desc *p) - { -- p->des0 |= ETDES0_SECOND_ADDRESS_CHAINED; -+ p->des0 |= cpu_to_le32(ETDES0_SECOND_ADDRESS_CHAINED); - } - - static inline void enh_set_tx_desc_len_on_chain(struct dma_desc *p, int len) - { -- p->des1 |= (len & ETDES1_BUFFER1_SIZE_MASK); -+ p->des1 |= cpu_to_le32(len & ETDES1_BUFFER1_SIZE_MASK); - } - - /* Normal descriptors */ - static inline void ndesc_rx_set_on_chain(struct dma_desc *p, int end) - { -- p->des1 |= RDES1_SECOND_ADDRESS_CHAINED; -+ p->des1 |= cpu_to_le32(RDES1_SECOND_ADDRESS_CHAINED); - } - - static inline void ndesc_tx_set_on_chain(struct dma_desc *p) - { -- p->des1 |= TDES1_SECOND_ADDRESS_CHAINED; -+ p->des1 |= cpu_to_le32(TDES1_SECOND_ADDRESS_CHAINED); - } - - static inline void norm_set_tx_desc_len_on_chain(struct dma_desc *p, int len) - { -- p->des1 |= len & TDES1_BUFFER1_SIZE_MASK; -+ p->des1 |= cpu_to_le32(len & TDES1_BUFFER1_SIZE_MASK); - } - #endif /* __DESC_COM_H__ */ ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-generic.c -@@ -71,9 +71,12 @@ err_remove_config_dt: - - static const struct of_device_id dwmac_generic_match[] = { - { .compatible = "st,spear600-gmac"}, -+ { .compatible = "snps,dwmac-3.50a"}, - { .compatible = "snps,dwmac-3.610"}, - { .compatible = "snps,dwmac-3.70a"}, - { .compatible = "snps,dwmac-3.710"}, -+ { .compatible = "snps,dwmac-4.00"}, -+ { .compatible = "snps,dwmac-4.10a"}, - { .compatible = "snps,dwmac"}, - { } - }; ---- /dev/null -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-oxnas.c -@@ -0,0 +1,194 @@ -+/* -+ * Oxford Semiconductor OXNAS DWMAC glue layer -+ * -+ * Copyright (C) 2016 Neil Armstrong -+ * Copyright (C) 2014 Daniel Golle -+ * Copyright (C) 2013 Ma Haijun -+ * Copyright (C) 2012 John Crispin -+ * -+ * 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. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "stmmac_platform.h" -+ -+/* System Control regmap offsets */ -+#define OXNAS_DWMAC_CTRL_REGOFFSET 0x78 -+#define OXNAS_DWMAC_DELAY_REGOFFSET 0x100 -+ -+/* Control Register */ -+#define DWMAC_CKEN_RX_IN 14 -+#define DWMAC_CKEN_RXN_OUT 13 -+#define DWMAC_CKEN_RX_OUT 12 -+#define DWMAC_CKEN_TX_IN 10 -+#define DWMAC_CKEN_TXN_OUT 9 -+#define DWMAC_CKEN_TX_OUT 8 -+#define DWMAC_RX_SOURCE 7 -+#define DWMAC_TX_SOURCE 6 -+#define DWMAC_LOW_TX_SOURCE 4 -+#define DWMAC_AUTO_TX_SOURCE 3 -+#define DWMAC_RGMII 2 -+#define DWMAC_SIMPLE_MUX 1 -+#define DWMAC_CKEN_GTX 0 -+ -+/* Delay register */ -+#define DWMAC_TX_VARDELAY_SHIFT 0 -+#define DWMAC_TXN_VARDELAY_SHIFT 8 -+#define DWMAC_RX_VARDELAY_SHIFT 16 -+#define DWMAC_RXN_VARDELAY_SHIFT 24 -+#define DWMAC_TX_VARDELAY(d) ((d) << DWMAC_TX_VARDELAY_SHIFT) -+#define DWMAC_TXN_VARDELAY(d) ((d) << DWMAC_TXN_VARDELAY_SHIFT) -+#define DWMAC_RX_VARDELAY(d) ((d) << DWMAC_RX_VARDELAY_SHIFT) -+#define DWMAC_RXN_VARDELAY(d) ((d) << DWMAC_RXN_VARDELAY_SHIFT) -+ -+struct oxnas_dwmac { -+ struct device *dev; -+ struct clk *clk; -+ struct regmap *regmap; -+}; -+ -+static int oxnas_dwmac_init(struct platform_device *pdev, void *priv) -+{ -+ struct oxnas_dwmac *dwmac = priv; -+ unsigned int value; -+ int ret; -+ -+ /* Reset HW here before changing the glue configuration */ -+ ret = device_reset(dwmac->dev); -+ if (ret) -+ return ret; -+ -+ ret = clk_prepare_enable(dwmac->clk); -+ if (ret) -+ return ret; -+ -+ ret = regmap_read(dwmac->regmap, OXNAS_DWMAC_CTRL_REGOFFSET, &value); -+ if (ret < 0) { -+ clk_disable_unprepare(dwmac->clk); -+ return ret; -+ } -+ -+ /* Enable GMII_GTXCLK to follow GMII_REFCLK, required for gigabit PHY */ -+ value |= BIT(DWMAC_CKEN_GTX) | -+ /* Use simple mux for 25/125 Mhz clock switching */ -+ BIT(DWMAC_SIMPLE_MUX) | -+ /* set auto switch tx clock source */ -+ BIT(DWMAC_AUTO_TX_SOURCE) | -+ /* enable tx & rx vardelay */ -+ BIT(DWMAC_CKEN_TX_OUT) | -+ BIT(DWMAC_CKEN_TXN_OUT) | -+ BIT(DWMAC_CKEN_TX_IN) | -+ BIT(DWMAC_CKEN_RX_OUT) | -+ BIT(DWMAC_CKEN_RXN_OUT) | -+ BIT(DWMAC_CKEN_RX_IN); -+ regmap_write(dwmac->regmap, OXNAS_DWMAC_CTRL_REGOFFSET, value); -+ -+ /* set tx & rx vardelay */ -+ value = DWMAC_TX_VARDELAY(4) | -+ DWMAC_TXN_VARDELAY(2) | -+ DWMAC_RX_VARDELAY(10) | -+ DWMAC_RXN_VARDELAY(8); -+ regmap_write(dwmac->regmap, OXNAS_DWMAC_DELAY_REGOFFSET, value); -+ -+ return 0; -+} -+ -+static void oxnas_dwmac_exit(struct platform_device *pdev, void *priv) -+{ -+ struct oxnas_dwmac *dwmac = priv; -+ -+ clk_disable_unprepare(dwmac->clk); -+} -+ -+static int oxnas_dwmac_probe(struct platform_device *pdev) -+{ -+ struct plat_stmmacenet_data *plat_dat; -+ struct stmmac_resources stmmac_res; -+ struct oxnas_dwmac *dwmac; -+ int ret; -+ -+ ret = stmmac_get_platform_resources(pdev, &stmmac_res); -+ if (ret) -+ return ret; -+ -+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac); -+ if (IS_ERR(plat_dat)) -+ return PTR_ERR(plat_dat); -+ -+ dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac), GFP_KERNEL); -+ if (!dwmac) { -+ ret = -ENOMEM; -+ goto err_remove_config_dt; -+ } -+ -+ dwmac->dev = &pdev->dev; -+ plat_dat->bsp_priv = dwmac; -+ plat_dat->init = oxnas_dwmac_init; -+ plat_dat->exit = oxnas_dwmac_exit; -+ -+ dwmac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, -+ "oxsemi,sys-ctrl"); -+ if (IS_ERR(dwmac->regmap)) { -+ dev_err(&pdev->dev, "failed to have sysctrl regmap\n"); -+ ret = PTR_ERR(dwmac->regmap); -+ goto err_remove_config_dt; -+ } -+ -+ dwmac->clk = devm_clk_get(&pdev->dev, "gmac"); -+ if (IS_ERR(dwmac->clk)) { -+ ret = PTR_ERR(dwmac->clk); -+ goto err_remove_config_dt; -+ } -+ -+ ret = oxnas_dwmac_init(pdev, plat_dat->bsp_priv); -+ if (ret) -+ goto err_remove_config_dt; -+ -+ ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); -+ if (ret) -+ goto err_dwmac_exit; -+ -+ -+ return 0; -+ -+err_dwmac_exit: -+ oxnas_dwmac_exit(pdev, plat_dat->bsp_priv); -+err_remove_config_dt: -+ stmmac_remove_config_dt(pdev, plat_dat); -+ -+ return ret; -+} -+ -+static const struct of_device_id oxnas_dwmac_match[] = { -+ { .compatible = "oxsemi,ox820-dwmac" }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, oxnas_dwmac_match); -+ -+static struct platform_driver oxnas_dwmac_driver = { -+ .probe = oxnas_dwmac_probe, -+ .remove = stmmac_pltfr_remove, -+ .driver = { -+ .name = "oxnas-dwmac", -+ .pm = &stmmac_pltfr_pm_ops, -+ .of_match_table = oxnas_dwmac_match, -+ }, -+}; -+module_platform_driver(oxnas_dwmac_driver); -+ -+MODULE_AUTHOR("Neil Armstrong "); -+MODULE_DESCRIPTION("Oxford Semiconductor OXNAS DWMAC glue layer"); -+MODULE_LICENSE("GPL v2"); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -@@ -864,6 +864,10 @@ static int rk_gmac_powerup(struct rk_pri - int ret; - struct device *dev = &bsp_priv->pdev->dev; - -+ ret = gmac_clk_enable(bsp_priv, true); -+ if (ret) -+ return ret; -+ - /*rmii or rgmii*/ - if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) { - dev_info(dev, "init for RGMII\n"); -@@ -880,10 +884,6 @@ static int rk_gmac_powerup(struct rk_pri - if (ret) - return ret; - -- ret = gmac_clk_enable(bsp_priv, true); -- if (ret) -- return ret; -- - pm_runtime_enable(dev); - pm_runtime_get_sync(dev); - -@@ -901,44 +901,6 @@ static void rk_gmac_powerdown(struct rk_ - gmac_clk_enable(gmac, false); - } - --static int rk_gmac_init(struct platform_device *pdev, void *priv) --{ -- struct rk_priv_data *bsp_priv = priv; -- -- return rk_gmac_powerup(bsp_priv); --} -- --static void rk_gmac_exit(struct platform_device *pdev, void *priv) --{ -- struct rk_priv_data *bsp_priv = priv; -- -- rk_gmac_powerdown(bsp_priv); --} -- --static void rk_gmac_suspend(struct platform_device *pdev, void *priv) --{ -- struct rk_priv_data *bsp_priv = priv; -- -- /* Keep the PHY up if we use Wake-on-Lan. */ -- if (device_may_wakeup(&pdev->dev)) -- return; -- -- rk_gmac_powerdown(bsp_priv); -- bsp_priv->suspended = true; --} -- --static void rk_gmac_resume(struct platform_device *pdev, void *priv) --{ -- struct rk_priv_data *bsp_priv = priv; -- -- /* The PHY was up for Wake-on-Lan. */ -- if (!bsp_priv->suspended) -- return; -- -- rk_gmac_powerup(bsp_priv); -- bsp_priv->suspended = false; --} -- - static void rk_fix_speed(void *priv, unsigned int speed) - { - struct rk_priv_data *bsp_priv = priv; -@@ -974,11 +936,7 @@ static int rk_gmac_probe(struct platform - return PTR_ERR(plat_dat); - - plat_dat->has_gmac = true; -- plat_dat->init = rk_gmac_init; -- plat_dat->exit = rk_gmac_exit; - plat_dat->fix_mac_speed = rk_fix_speed; -- plat_dat->suspend = rk_gmac_suspend; -- plat_dat->resume = rk_gmac_resume; - - plat_dat->bsp_priv = rk_gmac_setup(pdev, data); - if (IS_ERR(plat_dat->bsp_priv)) { -@@ -986,24 +944,65 @@ static int rk_gmac_probe(struct platform - goto err_remove_config_dt; - } - -- ret = rk_gmac_init(pdev, plat_dat->bsp_priv); -+ ret = rk_gmac_powerup(plat_dat->bsp_priv); - if (ret) - goto err_remove_config_dt; - - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) -- goto err_gmac_exit; -+ goto err_gmac_powerdown; - - return 0; - --err_gmac_exit: -- rk_gmac_exit(pdev, plat_dat->bsp_priv); -+err_gmac_powerdown: -+ rk_gmac_powerdown(plat_dat->bsp_priv); - err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; - } - -+static int rk_gmac_remove(struct platform_device *pdev) -+{ -+ struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(&pdev->dev); -+ int ret = stmmac_dvr_remove(&pdev->dev); -+ -+ rk_gmac_powerdown(bsp_priv); -+ -+ return ret; -+} -+ -+#ifdef CONFIG_PM_SLEEP -+static int rk_gmac_suspend(struct device *dev) -+{ -+ struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(dev); -+ int ret = stmmac_suspend(dev); -+ -+ /* Keep the PHY up if we use Wake-on-Lan. */ -+ if (!device_may_wakeup(dev)) { -+ rk_gmac_powerdown(bsp_priv); -+ bsp_priv->suspended = true; -+ } -+ -+ return ret; -+} -+ -+static int rk_gmac_resume(struct device *dev) -+{ -+ struct rk_priv_data *bsp_priv = get_stmmac_bsp_priv(dev); -+ -+ /* The PHY was up for Wake-on-Lan. */ -+ if (bsp_priv->suspended) { -+ rk_gmac_powerup(bsp_priv); -+ bsp_priv->suspended = false; -+ } -+ -+ return stmmac_resume(dev); -+} -+#endif /* CONFIG_PM_SLEEP */ -+ -+static SIMPLE_DEV_PM_OPS(rk_gmac_pm_ops, rk_gmac_suspend, rk_gmac_resume); -+ - static const struct of_device_id rk_gmac_dwmac_match[] = { - { .compatible = "rockchip,rk3228-gmac", .data = &rk3228_ops }, - { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_ops }, -@@ -1016,10 +1015,10 @@ MODULE_DEVICE_TABLE(of, rk_gmac_dwmac_ma - - static struct platform_driver rk_gmac_dwmac_driver = { - .probe = rk_gmac_probe, -- .remove = stmmac_pltfr_remove, -+ .remove = rk_gmac_remove, - .driver = { - .name = "rk_gmac-dwmac", -- .pm = &stmmac_pltfr_pm_ops, -+ .pm = &rk_gmac_pm_ops, - .of_match_table = rk_gmac_dwmac_match, - }, - }; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c -@@ -390,8 +390,8 @@ static int socfpga_dwmac_resume(struct d - * control register 0, and can be modified by the phy driver - * framework. - */ -- if (priv->phydev) -- phy_resume(priv->phydev); -+ if (ndev->phydev) -+ phy_resume(ndev->phydev); - - return stmmac_resume(dev); - } ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c -@@ -126,8 +126,8 @@ struct sti_dwmac { - struct clk *clk; /* PHY clock */ - u32 ctrl_reg; /* GMAC glue-logic control register */ - int clk_sel_reg; /* GMAC ext clk selection register */ -- struct device *dev; - struct regmap *regmap; -+ bool gmac_en; - u32 speed; - void (*fix_retime_src)(void *priv, unsigned int speed); - }; -@@ -191,7 +191,7 @@ static void stih4xx_fix_retime_src(void - } - } - -- if (src == TX_RETIME_SRC_CLKGEN && dwmac->clk && freq) -+ if (src == TX_RETIME_SRC_CLKGEN && freq) - clk_set_rate(dwmac->clk, freq); - - regmap_update_bits(dwmac->regmap, reg, STIH4XX_RETIME_SRC_MASK, -@@ -222,26 +222,20 @@ static void stid127_fix_retime_src(void - freq = DWMAC_2_5MHZ; - } - -- if (dwmac->clk && freq) -+ if (freq) - clk_set_rate(dwmac->clk, freq); - - regmap_update_bits(dwmac->regmap, reg, STID127_RETIME_SRC_MASK, val); - } - --static int sti_dwmac_init(struct platform_device *pdev, void *priv) -+static int sti_dwmac_set_mode(struct sti_dwmac *dwmac) - { -- struct sti_dwmac *dwmac = priv; - struct regmap *regmap = dwmac->regmap; - int iface = dwmac->interface; -- struct device *dev = dwmac->dev; -- struct device_node *np = dev->of_node; - u32 reg = dwmac->ctrl_reg; - u32 val; - -- if (dwmac->clk) -- clk_prepare_enable(dwmac->clk); -- -- if (of_property_read_bool(np, "st,gmac_en")) -+ if (dwmac->gmac_en) - regmap_update_bits(regmap, reg, EN_MASK, EN); - - regmap_update_bits(regmap, reg, MII_PHY_SEL_MASK, phy_intf_sels[iface]); -@@ -249,18 +243,11 @@ static int sti_dwmac_init(struct platfor - val = (iface == PHY_INTERFACE_MODE_REVMII) ? 0 : ENMII; - regmap_update_bits(regmap, reg, ENMII_MASK, val); - -- dwmac->fix_retime_src(priv, dwmac->speed); -+ dwmac->fix_retime_src(dwmac, dwmac->speed); - - return 0; - } - --static void sti_dwmac_exit(struct platform_device *pdev, void *priv) --{ -- struct sti_dwmac *dwmac = priv; -- -- if (dwmac->clk) -- clk_disable_unprepare(dwmac->clk); --} - static int sti_dwmac_parse_data(struct sti_dwmac *dwmac, - struct platform_device *pdev) - { -@@ -270,9 +257,6 @@ static int sti_dwmac_parse_data(struct s - struct regmap *regmap; - int err; - -- if (!np) -- return -EINVAL; -- - /* clk selection from extra syscfg register */ - dwmac->clk_sel_reg = -ENXIO; - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sti-clkconf"); -@@ -289,9 +273,9 @@ static int sti_dwmac_parse_data(struct s - return err; - } - -- dwmac->dev = dev; - dwmac->interface = of_get_phy_mode(np); - dwmac->regmap = regmap; -+ dwmac->gmac_en = of_property_read_bool(np, "st,gmac_en"); - dwmac->ext_phyclk = of_property_read_bool(np, "st,ext-phyclk"); - dwmac->tx_retime_src = TX_RETIME_SRC_NA; - dwmac->speed = SPEED_100; -@@ -359,28 +343,65 @@ static int sti_dwmac_probe(struct platfo - dwmac->fix_retime_src = data->fix_retime_src; - - plat_dat->bsp_priv = dwmac; -- plat_dat->init = sti_dwmac_init; -- plat_dat->exit = sti_dwmac_exit; - plat_dat->fix_mac_speed = data->fix_retime_src; - -- ret = sti_dwmac_init(pdev, plat_dat->bsp_priv); -+ ret = clk_prepare_enable(dwmac->clk); - if (ret) - goto err_remove_config_dt; - -+ ret = sti_dwmac_set_mode(dwmac); -+ if (ret) -+ goto disable_clk; -+ - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) -- goto err_dwmac_exit; -+ goto disable_clk; - - return 0; - --err_dwmac_exit: -- sti_dwmac_exit(pdev, plat_dat->bsp_priv); -+disable_clk: -+ clk_disable_unprepare(dwmac->clk); - err_remove_config_dt: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; - } - -+static int sti_dwmac_remove(struct platform_device *pdev) -+{ -+ struct sti_dwmac *dwmac = get_stmmac_bsp_priv(&pdev->dev); -+ int ret = stmmac_dvr_remove(&pdev->dev); -+ -+ clk_disable_unprepare(dwmac->clk); -+ -+ return ret; -+} -+ -+#ifdef CONFIG_PM_SLEEP -+static int sti_dwmac_suspend(struct device *dev) -+{ -+ struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev); -+ int ret = stmmac_suspend(dev); -+ -+ clk_disable_unprepare(dwmac->clk); -+ -+ return ret; -+} -+ -+static int sti_dwmac_resume(struct device *dev) -+{ -+ struct sti_dwmac *dwmac = get_stmmac_bsp_priv(dev); -+ -+ clk_prepare_enable(dwmac->clk); -+ sti_dwmac_set_mode(dwmac); -+ -+ return stmmac_resume(dev); -+} -+#endif /* CONFIG_PM_SLEEP */ -+ -+static SIMPLE_DEV_PM_OPS(sti_dwmac_pm_ops, sti_dwmac_suspend, -+ sti_dwmac_resume); -+ - static const struct sti_dwmac_of_data stih4xx_dwmac_data = { - .fix_retime_src = stih4xx_fix_retime_src, - }; -@@ -400,10 +421,10 @@ MODULE_DEVICE_TABLE(of, sti_dwmac_match) - - static struct platform_driver sti_dwmac_driver = { - .probe = sti_dwmac_probe, -- .remove = stmmac_pltfr_remove, -+ .remove = sti_dwmac_remove, - .driver = { - .name = "sti-dwmac", -- .pm = &stmmac_pltfr_pm_ops, -+ .pm = &sti_dwmac_pm_ops, - .of_match_table = sti_dwmac_match, - }, - }; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h -@@ -225,7 +225,7 @@ enum rx_tx_priority_ratio { - - #define DMA_BUS_MODE_FB 0x00010000 /* Fixed burst */ - #define DMA_BUS_MODE_MB 0x04000000 /* Mixed burst */ --#define DMA_BUS_MODE_RPBL_MASK 0x003e0000 /* Rx-Programmable Burst Len */ -+#define DMA_BUS_MODE_RPBL_MASK 0x007e0000 /* Rx-Programmable Burst Len */ - #define DMA_BUS_MODE_RPBL_SHIFT 17 - #define DMA_BUS_MODE_USP 0x00800000 - #define DMA_BUS_MODE_MAXPBL 0x01000000 ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -@@ -538,6 +538,12 @@ struct mac_device_info *dwmac1000_setup( - mac->link.speed = GMAC_CONTROL_FES; - mac->mii.addr = GMAC_MII_ADDR; - mac->mii.data = GMAC_MII_DATA; -+ mac->mii.addr_shift = 11; -+ mac->mii.addr_mask = 0x0000F800; -+ mac->mii.reg_shift = 6; -+ mac->mii.reg_mask = 0x000007C0; -+ mac->mii.clk_csr_shift = 2; -+ mac->mii.clk_csr_mask = GENMASK(5, 2); - - /* Get and dump the chip ID */ - *synopsys_id = stmmac_get_synopsys_id(hwid); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -@@ -84,37 +84,39 @@ static void dwmac1000_dma_axi(void __iom - writel(value, ioaddr + DMA_AXI_BUS_MODE); - } - --static void dwmac1000_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb, -- int aal, u32 dma_tx, u32 dma_rx, int atds) -+static void dwmac1000_dma_init(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx, u32 dma_rx, int atds) - { - u32 value = readl(ioaddr + DMA_BUS_MODE); -+ int txpbl = dma_cfg->txpbl ?: dma_cfg->pbl; -+ int rxpbl = dma_cfg->rxpbl ?: dma_cfg->pbl; - - /* - * Set the DMA PBL (Programmable Burst Length) mode. - * - * Note: before stmmac core 3.50 this mode bit was 4xPBL, and - * post 3.5 mode bit acts as 8*PBL. -- * -- * This configuration doesn't take care about the Separate PBL -- * so only the bits: 13-8 are programmed with the PBL passed from the -- * platform. - */ -- value |= DMA_BUS_MODE_MAXPBL; -- value &= ~DMA_BUS_MODE_PBL_MASK; -- value |= (pbl << DMA_BUS_MODE_PBL_SHIFT); -+ if (dma_cfg->pblx8) -+ value |= DMA_BUS_MODE_MAXPBL; -+ value |= DMA_BUS_MODE_USP; -+ value &= ~(DMA_BUS_MODE_PBL_MASK | DMA_BUS_MODE_RPBL_MASK); -+ value |= (txpbl << DMA_BUS_MODE_PBL_SHIFT); -+ value |= (rxpbl << DMA_BUS_MODE_RPBL_SHIFT); - - /* Set the Fixed burst mode */ -- if (fb) -+ if (dma_cfg->fixed_burst) - value |= DMA_BUS_MODE_FB; - - /* Mixed Burst has no effect when fb is set */ -- if (mb) -+ if (dma_cfg->mixed_burst) - value |= DMA_BUS_MODE_MB; - - if (atds) - value |= DMA_BUS_MODE_ATDS; - -- if (aal) -+ if (dma_cfg->aal) - value |= DMA_BUS_MODE_AAL; - - writel(value, ioaddr + DMA_BUS_MODE); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -@@ -192,6 +192,13 @@ struct mac_device_info *dwmac100_setup(v - mac->link.speed = 0; - mac->mii.addr = MAC_MII_ADDR; - mac->mii.data = MAC_MII_DATA; -+ mac->mii.addr_shift = 11; -+ mac->mii.addr_mask = 0x0000F800; -+ mac->mii.reg_shift = 6; -+ mac->mii.reg_mask = 0x000007C0; -+ mac->mii.clk_csr_shift = 2; -+ mac->mii.clk_csr_mask = GENMASK(5, 2); -+ - /* Synopsys Id is not available on old chips */ - *synopsys_id = 0; - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c -@@ -32,11 +32,12 @@ - #include "dwmac100.h" - #include "dwmac_dma.h" - --static void dwmac100_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb, -- int aal, u32 dma_tx, u32 dma_rx, int atds) -+static void dwmac100_dma_init(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx, u32 dma_rx, int atds) - { - /* Enable Application Access by writing to DMA CSR0 */ -- writel(DMA_BUS_MODE_DEFAULT | (pbl << DMA_BUS_MODE_PBL_SHIFT), -+ writel(DMA_BUS_MODE_DEFAULT | (dma_cfg->pbl << DMA_BUS_MODE_PBL_SHIFT), - ioaddr + DMA_BUS_MODE); - - /* Mask interrupts by writing to CSR7 */ ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h -@@ -155,8 +155,11 @@ enum power_event { - #define MTL_CHAN_RX_DEBUG(x) (MTL_CHANX_BASE_ADDR(x) + 0x38) - - #define MTL_OP_MODE_RSF BIT(5) -+#define MTL_OP_MODE_TXQEN BIT(3) - #define MTL_OP_MODE_TSF BIT(1) - -+#define MTL_OP_MODE_TQS_MASK GENMASK(24, 16) -+ - #define MTL_OP_MODE_TTC_MASK 0x70 - #define MTL_OP_MODE_TTC_SHIFT 4 - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -@@ -430,6 +430,12 @@ struct mac_device_info *dwmac4_setup(voi - mac->link.speed = GMAC_CONFIG_FES; - mac->mii.addr = GMAC_MDIO_ADDR; - mac->mii.data = GMAC_MDIO_DATA; -+ mac->mii.addr_shift = 21; -+ mac->mii.addr_mask = GENMASK(25, 21); -+ mac->mii.reg_shift = 16; -+ mac->mii.reg_mask = GENMASK(20, 16); -+ mac->mii.clk_csr_shift = 8; -+ mac->mii.clk_csr_mask = GENMASK(11, 8); - - /* Get and dump the chip ID */ - *synopsys_id = stmmac_get_synopsys_id(hwid); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c -@@ -23,7 +23,7 @@ static int dwmac4_wrback_get_tx_status(v - unsigned int tdes3; - int ret = tx_done; - -- tdes3 = p->des3; -+ tdes3 = le32_to_cpu(p->des3); - - /* Get tx owner first */ - if (unlikely(tdes3 & TDES3_OWN)) -@@ -77,9 +77,9 @@ static int dwmac4_wrback_get_rx_status(v - struct dma_desc *p) - { - struct net_device_stats *stats = (struct net_device_stats *)data; -- unsigned int rdes1 = p->des1; -- unsigned int rdes2 = p->des2; -- unsigned int rdes3 = p->des3; -+ unsigned int rdes1 = le32_to_cpu(p->des1); -+ unsigned int rdes2 = le32_to_cpu(p->des2); -+ unsigned int rdes3 = le32_to_cpu(p->des3); - int message_type; - int ret = good_frame; - -@@ -176,47 +176,48 @@ static int dwmac4_wrback_get_rx_status(v - - static int dwmac4_rd_get_tx_len(struct dma_desc *p) - { -- return (p->des2 & TDES2_BUFFER1_SIZE_MASK); -+ return (le32_to_cpu(p->des2) & TDES2_BUFFER1_SIZE_MASK); - } - - static int dwmac4_get_tx_owner(struct dma_desc *p) - { -- return (p->des3 & TDES3_OWN) >> TDES3_OWN_SHIFT; -+ return (le32_to_cpu(p->des3) & TDES3_OWN) >> TDES3_OWN_SHIFT; - } - - static void dwmac4_set_tx_owner(struct dma_desc *p) - { -- p->des3 |= TDES3_OWN; -+ p->des3 |= cpu_to_le32(TDES3_OWN); - } - - static void dwmac4_set_rx_owner(struct dma_desc *p) - { -- p->des3 |= RDES3_OWN; -+ p->des3 |= cpu_to_le32(RDES3_OWN); - } - - static int dwmac4_get_tx_ls(struct dma_desc *p) - { -- return (p->des3 & TDES3_LAST_DESCRIPTOR) >> TDES3_LAST_DESCRIPTOR_SHIFT; -+ return (le32_to_cpu(p->des3) & TDES3_LAST_DESCRIPTOR) -+ >> TDES3_LAST_DESCRIPTOR_SHIFT; - } - - static int dwmac4_wrback_get_rx_frame_len(struct dma_desc *p, int rx_coe) - { -- return (p->des3 & RDES3_PACKET_SIZE_MASK); -+ return (le32_to_cpu(p->des3) & RDES3_PACKET_SIZE_MASK); - } - - static void dwmac4_rd_enable_tx_timestamp(struct dma_desc *p) - { -- p->des2 |= TDES2_TIMESTAMP_ENABLE; -+ p->des2 |= cpu_to_le32(TDES2_TIMESTAMP_ENABLE); - } - - static int dwmac4_wrback_get_tx_timestamp_status(struct dma_desc *p) - { - /* Context type from W/B descriptor must be zero */ -- if (p->des3 & TDES3_CONTEXT_TYPE) -+ if (le32_to_cpu(p->des3) & TDES3_CONTEXT_TYPE) - return -EINVAL; - - /* Tx Timestamp Status is 1 so des0 and des1'll have valid values */ -- if (p->des3 & TDES3_TIMESTAMP_STATUS) -+ if (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS) - return 0; - - return 1; -@@ -227,9 +228,9 @@ static inline u64 dwmac4_get_timestamp(v - struct dma_desc *p = (struct dma_desc *)desc; - u64 ns; - -- ns = p->des0; -+ ns = le32_to_cpu(p->des0); - /* convert high/sec time stamp value to nanosecond */ -- ns += p->des1 * 1000000000ULL; -+ ns += le32_to_cpu(p->des1) * 1000000000ULL; - - return ns; - } -@@ -264,7 +265,7 @@ static int dwmac4_wrback_get_rx_timestam - - /* Get the status from normal w/b descriptor */ - if (likely(p->des3 & TDES3_RS1V)) { -- if (likely(p->des1 & RDES1_TIMESTAMP_AVAILABLE)) { -+ if (likely(le32_to_cpu(p->des1) & RDES1_TIMESTAMP_AVAILABLE)) { - int i = 0; - - /* Check if timestamp is OK from context descriptor */ -@@ -287,10 +288,10 @@ exit: - static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic, - int mode, int end) - { -- p->des3 = RDES3_OWN | RDES3_BUFFER1_VALID_ADDR; -+ p->des3 = cpu_to_le32(RDES3_OWN | RDES3_BUFFER1_VALID_ADDR); - - if (!disable_rx_ic) -- p->des3 |= RDES3_INT_ON_COMPLETION_EN; -+ p->des3 |= cpu_to_le32(RDES3_INT_ON_COMPLETION_EN); - } - - static void dwmac4_rd_init_tx_desc(struct dma_desc *p, int mode, int end) -@@ -305,9 +306,9 @@ static void dwmac4_rd_prepare_tx_desc(st - bool csum_flag, int mode, bool tx_own, - bool ls) - { -- unsigned int tdes3 = p->des3; -+ unsigned int tdes3 = le32_to_cpu(p->des3); - -- p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK); -+ p->des2 |= cpu_to_le32(len & TDES2_BUFFER1_SIZE_MASK); - - if (is_fs) - tdes3 |= TDES3_FIRST_DESCRIPTOR; -@@ -333,9 +334,9 @@ static void dwmac4_rd_prepare_tx_desc(st - * descriptors for the same frame has to be set before, to - * avoid race condition. - */ -- wmb(); -+ dma_wmb(); - -- p->des3 = tdes3; -+ p->des3 = cpu_to_le32(tdes3); - } - - static void dwmac4_rd_prepare_tso_tx_desc(struct dma_desc *p, int is_fs, -@@ -343,14 +344,14 @@ static void dwmac4_rd_prepare_tso_tx_des - bool ls, unsigned int tcphdrlen, - unsigned int tcppayloadlen) - { -- unsigned int tdes3 = p->des3; -+ unsigned int tdes3 = le32_to_cpu(p->des3); - - if (len1) -- p->des2 |= (len1 & TDES2_BUFFER1_SIZE_MASK); -+ p->des2 |= cpu_to_le32((len1 & TDES2_BUFFER1_SIZE_MASK)); - - if (len2) -- p->des2 |= (len2 << TDES2_BUFFER2_SIZE_MASK_SHIFT) -- & TDES2_BUFFER2_SIZE_MASK; -+ p->des2 |= cpu_to_le32((len2 << TDES2_BUFFER2_SIZE_MASK_SHIFT) -+ & TDES2_BUFFER2_SIZE_MASK); - - if (is_fs) { - tdes3 |= TDES3_FIRST_DESCRIPTOR | -@@ -376,9 +377,9 @@ static void dwmac4_rd_prepare_tso_tx_des - * descriptors for the same frame has to be set before, to - * avoid race condition. - */ -- wmb(); -+ dma_wmb(); - -- p->des3 = tdes3; -+ p->des3 = cpu_to_le32(tdes3); - } - - static void dwmac4_release_tx_desc(struct dma_desc *p, int mode) -@@ -389,7 +390,7 @@ static void dwmac4_release_tx_desc(struc - - static void dwmac4_rd_set_tx_ic(struct dma_desc *p) - { -- p->des2 |= TDES2_INTERRUPT_ON_COMPLETION; -+ p->des2 |= cpu_to_le32(TDES2_INTERRUPT_ON_COMPLETION); - } - - static void dwmac4_display_ring(void *head, unsigned int size, bool rx) -@@ -402,7 +403,8 @@ static void dwmac4_display_ring(void *he - for (i = 0; i < size; i++) { - pr_info("%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", - i, (unsigned int)virt_to_phys(p), -- p->des0, p->des1, p->des2, p->des3); -+ le32_to_cpu(p->des0), le32_to_cpu(p->des1), -+ le32_to_cpu(p->des2), le32_to_cpu(p->des3)); - p++; - } - } -@@ -411,8 +413,8 @@ static void dwmac4_set_mss_ctxt(struct d - { - p->des0 = 0; - p->des1 = 0; -- p->des2 = mss; -- p->des3 = TDES3_CONTEXT_TYPE | TDES3_CTXT_TCMSSV; -+ p->des2 = cpu_to_le32(mss); -+ p->des3 = cpu_to_le32(TDES3_CONTEXT_TYPE | TDES3_CTXT_TCMSSV); - } - - const struct stmmac_desc_ops dwmac4_desc_ops = { ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -@@ -71,25 +71,29 @@ static void dwmac4_dma_axi(void __iomem - writel(value, ioaddr + DMA_SYS_BUS_MODE); - } - --static void dwmac4_dma_init_channel(void __iomem *ioaddr, int pbl, -+static void dwmac4_dma_init_channel(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, - u32 dma_tx_phy, u32 dma_rx_phy, - u32 channel) - { - u32 value; -+ int txpbl = dma_cfg->txpbl ?: dma_cfg->pbl; -+ int rxpbl = dma_cfg->rxpbl ?: dma_cfg->pbl; - - /* set PBL for each channels. Currently we affect same configuration - * on each channel - */ - value = readl(ioaddr + DMA_CHAN_CONTROL(channel)); -- value = value | DMA_BUS_MODE_PBL; -+ if (dma_cfg->pblx8) -+ value = value | DMA_BUS_MODE_PBL; - writel(value, ioaddr + DMA_CHAN_CONTROL(channel)); - - value = readl(ioaddr + DMA_CHAN_TX_CONTROL(channel)); -- value = value | (pbl << DMA_BUS_MODE_PBL_SHIFT); -+ value = value | (txpbl << DMA_BUS_MODE_PBL_SHIFT); - writel(value, ioaddr + DMA_CHAN_TX_CONTROL(channel)); - - value = readl(ioaddr + DMA_CHAN_RX_CONTROL(channel)); -- value = value | (pbl << DMA_BUS_MODE_RPBL_SHIFT); -+ value = value | (rxpbl << DMA_BUS_MODE_RPBL_SHIFT); - writel(value, ioaddr + DMA_CHAN_RX_CONTROL(channel)); - - /* Mask interrupts by writing to CSR7 */ -@@ -99,27 +103,28 @@ static void dwmac4_dma_init_channel(void - writel(dma_rx_phy, ioaddr + DMA_CHAN_RX_BASE_ADDR(channel)); - } - --static void dwmac4_dma_init(void __iomem *ioaddr, int pbl, int fb, int mb, -- int aal, u32 dma_tx, u32 dma_rx, int atds) -+static void dwmac4_dma_init(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx, u32 dma_rx, int atds) - { - u32 value = readl(ioaddr + DMA_SYS_BUS_MODE); - int i; - - /* Set the Fixed burst mode */ -- if (fb) -+ if (dma_cfg->fixed_burst) - value |= DMA_SYS_BUS_FB; - - /* Mixed Burst has no effect when fb is set */ -- if (mb) -+ if (dma_cfg->mixed_burst) - value |= DMA_SYS_BUS_MB; - -- if (aal) -+ if (dma_cfg->aal) - value |= DMA_SYS_BUS_AAL; - - writel(value, ioaddr + DMA_SYS_BUS_MODE); - - for (i = 0; i < DMA_CHANNEL_NB_MAX; i++) -- dwmac4_dma_init_channel(ioaddr, pbl, dma_tx, dma_rx, i); -+ dwmac4_dma_init_channel(ioaddr, dma_cfg, dma_tx, dma_rx, i); - } - - static void _dwmac4_dump_dma_regs(void __iomem *ioaddr, u32 channel) -@@ -215,7 +220,17 @@ static void dwmac4_dma_chan_op_mode(void - else - mtl_tx_op |= MTL_OP_MODE_TTC_512; - } -- -+ /* For an IP with DWC_EQOS_NUM_TXQ == 1, the fields TXQEN and TQS are RO -+ * with reset values: TXQEN on, TQS == DWC_EQOS_TXFIFO_SIZE. -+ * For an IP with DWC_EQOS_NUM_TXQ > 1, the fields TXQEN and TQS are R/W -+ * with reset values: TXQEN off, TQS 256 bytes. -+ * -+ * Write the bits in both cases, since it will have no effect when RO. -+ * For DWC_EQOS_NUM_TXQ > 1, the top bits in MTL_OP_MODE_TQS_MASK might -+ * be RO, however, writing the whole TQS field will result in a value -+ * equal to DWC_EQOS_TXFIFO_SIZE, just like for DWC_EQOS_NUM_TXQ == 1. -+ */ -+ mtl_tx_op |= MTL_OP_MODE_TXQEN | MTL_OP_MODE_TQS_MASK; - writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel)); - - mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel)); ---- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c -+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c -@@ -30,7 +30,7 @@ static int enh_desc_get_tx_status(void * - struct dma_desc *p, void __iomem *ioaddr) - { - struct net_device_stats *stats = (struct net_device_stats *)data; -- unsigned int tdes0 = p->des0; -+ unsigned int tdes0 = le32_to_cpu(p->des0); - int ret = tx_done; - - /* Get tx owner first */ -@@ -95,7 +95,7 @@ static int enh_desc_get_tx_status(void * - - static int enh_desc_get_tx_len(struct dma_desc *p) - { -- return (p->des1 & ETDES1_BUFFER1_SIZE_MASK); -+ return (le32_to_cpu(p->des1) & ETDES1_BUFFER1_SIZE_MASK); - } - - static int enh_desc_coe_rdes0(int ipc_err, int type, int payload_err) -@@ -134,8 +134,8 @@ static int enh_desc_coe_rdes0(int ipc_er - static void enh_desc_get_ext_status(void *data, struct stmmac_extra_stats *x, - struct dma_extended_desc *p) - { -- unsigned int rdes0 = p->basic.des0; -- unsigned int rdes4 = p->des4; -+ unsigned int rdes0 = le32_to_cpu(p->basic.des0); -+ unsigned int rdes4 = le32_to_cpu(p->des4); - - if (unlikely(rdes0 & ERDES0_RX_MAC_ADDR)) { - int message_type = (rdes4 & ERDES4_MSG_TYPE_MASK) >> 8; -@@ -199,7 +199,7 @@ static int enh_desc_get_rx_status(void * - struct dma_desc *p) - { - struct net_device_stats *stats = (struct net_device_stats *)data; -- unsigned int rdes0 = p->des0; -+ unsigned int rdes0 = le32_to_cpu(p->des0); - int ret = good_frame; - - if (unlikely(rdes0 & RDES0_OWN)) -@@ -265,8 +265,8 @@ static int enh_desc_get_rx_status(void * - static void enh_desc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, - int mode, int end) - { -- p->des0 |= RDES0_OWN; -- p->des1 |= ((BUF_SIZE_8KiB - 1) & ERDES1_BUFFER1_SIZE_MASK); -+ p->des0 |= cpu_to_le32(RDES0_OWN); -+ p->des1 |= cpu_to_le32((BUF_SIZE_8KiB - 1) & ERDES1_BUFFER1_SIZE_MASK); - - if (mode == STMMAC_CHAIN_MODE) - ehn_desc_rx_set_on_chain(p); -@@ -274,12 +274,12 @@ static void enh_desc_init_rx_desc(struct - ehn_desc_rx_set_on_ring(p, end); - - if (disable_rx_ic) -- p->des1 |= ERDES1_DISABLE_IC; -+ p->des1 |= cpu_to_le32(ERDES1_DISABLE_IC); - } - - static void enh_desc_init_tx_desc(struct dma_desc *p, int mode, int end) - { -- p->des0 &= ~ETDES0_OWN; -+ p->des0 &= cpu_to_le32(~ETDES0_OWN); - if (mode == STMMAC_CHAIN_MODE) - enh_desc_end_tx_desc_on_chain(p); - else -@@ -288,27 +288,27 @@ static void enh_desc_init_tx_desc(struct - - static int enh_desc_get_tx_owner(struct dma_desc *p) - { -- return (p->des0 & ETDES0_OWN) >> 31; -+ return (le32_to_cpu(p->des0) & ETDES0_OWN) >> 31; - } - - static void enh_desc_set_tx_owner(struct dma_desc *p) - { -- p->des0 |= ETDES0_OWN; -+ p->des0 |= cpu_to_le32(ETDES0_OWN); - } - - static void enh_desc_set_rx_owner(struct dma_desc *p) - { -- p->des0 |= RDES0_OWN; -+ p->des0 |= cpu_to_le32(RDES0_OWN); - } - - static int enh_desc_get_tx_ls(struct dma_desc *p) - { -- return (p->des0 & ETDES0_LAST_SEGMENT) >> 29; -+ return (le32_to_cpu(p->des0) & ETDES0_LAST_SEGMENT) >> 29; - } - - static void enh_desc_release_tx_desc(struct dma_desc *p, int mode) - { -- int ter = (p->des0 & ETDES0_END_RING) >> 21; -+ int ter = (le32_to_cpu(p->des0) & ETDES0_END_RING) >> 21; - - memset(p, 0, offsetof(struct dma_desc, des2)); - if (mode == STMMAC_CHAIN_MODE) -@@ -321,7 +321,7 @@ static void enh_desc_prepare_tx_desc(str - bool csum_flag, int mode, bool tx_own, - bool ls) - { -- unsigned int tdes0 = p->des0; -+ unsigned int tdes0 = le32_to_cpu(p->des0); - - if (mode == STMMAC_CHAIN_MODE) - enh_set_tx_desc_len_on_chain(p, len); -@@ -350,14 +350,14 @@ static void enh_desc_prepare_tx_desc(str - * descriptors for the same frame has to be set before, to - * avoid race condition. - */ -- wmb(); -+ dma_wmb(); - -- p->des0 = tdes0; -+ p->des0 = cpu_to_le32(tdes0); - } - - static void enh_desc_set_tx_ic(struct dma_desc *p) - { -- p->des0 |= ETDES0_INTERRUPT; -+ p->des0 |= cpu_to_le32(ETDES0_INTERRUPT); - } - - static int enh_desc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) -@@ -372,18 +372,18 @@ static int enh_desc_get_rx_frame_len(str - if (rx_coe_type == STMMAC_RX_COE_TYPE1) - csum = 2; - -- return (((p->des0 & RDES0_FRAME_LEN_MASK) >> RDES0_FRAME_LEN_SHIFT) - -- csum); -+ return (((le32_to_cpu(p->des0) & RDES0_FRAME_LEN_MASK) -+ >> RDES0_FRAME_LEN_SHIFT) - csum); - } - - static void enh_desc_enable_tx_timestamp(struct dma_desc *p) - { -- p->des0 |= ETDES0_TIME_STAMP_ENABLE; -+ p->des0 |= cpu_to_le32(ETDES0_TIME_STAMP_ENABLE); - } - - static int enh_desc_get_tx_timestamp_status(struct dma_desc *p) - { -- return (p->des0 & ETDES0_TIME_STAMP_STATUS) >> 17; -+ return (le32_to_cpu(p->des0) & ETDES0_TIME_STAMP_STATUS) >> 17; - } - - static u64 enh_desc_get_timestamp(void *desc, u32 ats) -@@ -392,13 +392,13 @@ static u64 enh_desc_get_timestamp(void * - - if (ats) { - struct dma_extended_desc *p = (struct dma_extended_desc *)desc; -- ns = p->des6; -+ ns = le32_to_cpu(p->des6); - /* convert high/sec time stamp value to nanosecond */ -- ns += p->des7 * 1000000000ULL; -+ ns += le32_to_cpu(p->des7) * 1000000000ULL; - } else { - struct dma_desc *p = (struct dma_desc *)desc; -- ns = p->des2; -- ns += p->des3 * 1000000000ULL; -+ ns = le32_to_cpu(p->des2); -+ ns += le32_to_cpu(p->des3) * 1000000000ULL; - } - - return ns; -@@ -408,10 +408,11 @@ static int enh_desc_get_rx_timestamp_sta - { - if (ats) { - struct dma_extended_desc *p = (struct dma_extended_desc *)desc; -- return (p->basic.des0 & RDES0_IPC_CSUM_ERROR) >> 7; -+ return (le32_to_cpu(p->basic.des0) & RDES0_IPC_CSUM_ERROR) >> 7; - } else { - struct dma_desc *p = (struct dma_desc *)desc; -- if ((p->des2 == 0xffffffff) && (p->des3 == 0xffffffff)) -+ if ((le32_to_cpu(p->des2) == 0xffffffff) && -+ (le32_to_cpu(p->des3) == 0xffffffff)) - /* timestamp is corrupted, hence don't store it */ - return 0; - else ---- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c -+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c -@@ -30,8 +30,8 @@ static int ndesc_get_tx_status(void *dat - struct dma_desc *p, void __iomem *ioaddr) - { - struct net_device_stats *stats = (struct net_device_stats *)data; -- unsigned int tdes0 = p->des0; -- unsigned int tdes1 = p->des1; -+ unsigned int tdes0 = le32_to_cpu(p->des0); -+ unsigned int tdes1 = le32_to_cpu(p->des1); - int ret = tx_done; - - /* Get tx owner first */ -@@ -77,7 +77,7 @@ static int ndesc_get_tx_status(void *dat - - static int ndesc_get_tx_len(struct dma_desc *p) - { -- return (p->des1 & RDES1_BUFFER1_SIZE_MASK); -+ return (le32_to_cpu(p->des1) & RDES1_BUFFER1_SIZE_MASK); - } - - /* This function verifies if each incoming frame has some errors -@@ -88,7 +88,7 @@ static int ndesc_get_rx_status(void *dat - struct dma_desc *p) - { - int ret = good_frame; -- unsigned int rdes0 = p->des0; -+ unsigned int rdes0 = le32_to_cpu(p->des0); - struct net_device_stats *stats = (struct net_device_stats *)data; - - if (unlikely(rdes0 & RDES0_OWN)) -@@ -141,8 +141,8 @@ static int ndesc_get_rx_status(void *dat - static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, - int end) - { -- p->des0 |= RDES0_OWN; -- p->des1 |= (BUF_SIZE_2KiB - 1) & RDES1_BUFFER1_SIZE_MASK; -+ p->des0 |= cpu_to_le32(RDES0_OWN); -+ p->des1 |= cpu_to_le32((BUF_SIZE_2KiB - 1) & RDES1_BUFFER1_SIZE_MASK); - - if (mode == STMMAC_CHAIN_MODE) - ndesc_rx_set_on_chain(p, end); -@@ -150,12 +150,12 @@ static void ndesc_init_rx_desc(struct dm - ndesc_rx_set_on_ring(p, end); - - if (disable_rx_ic) -- p->des1 |= RDES1_DISABLE_IC; -+ p->des1 |= cpu_to_le32(RDES1_DISABLE_IC); - } - - static void ndesc_init_tx_desc(struct dma_desc *p, int mode, int end) - { -- p->des0 &= ~TDES0_OWN; -+ p->des0 &= cpu_to_le32(~TDES0_OWN); - if (mode == STMMAC_CHAIN_MODE) - ndesc_tx_set_on_chain(p); - else -@@ -164,27 +164,27 @@ static void ndesc_init_tx_desc(struct dm - - static int ndesc_get_tx_owner(struct dma_desc *p) - { -- return (p->des0 & TDES0_OWN) >> 31; -+ return (le32_to_cpu(p->des0) & TDES0_OWN) >> 31; - } - - static void ndesc_set_tx_owner(struct dma_desc *p) - { -- p->des0 |= TDES0_OWN; -+ p->des0 |= cpu_to_le32(TDES0_OWN); - } - - static void ndesc_set_rx_owner(struct dma_desc *p) - { -- p->des0 |= RDES0_OWN; -+ p->des0 |= cpu_to_le32(RDES0_OWN); - } - - static int ndesc_get_tx_ls(struct dma_desc *p) - { -- return (p->des1 & TDES1_LAST_SEGMENT) >> 30; -+ return (le32_to_cpu(p->des1) & TDES1_LAST_SEGMENT) >> 30; - } - - static void ndesc_release_tx_desc(struct dma_desc *p, int mode) - { -- int ter = (p->des1 & TDES1_END_RING) >> 25; -+ int ter = (le32_to_cpu(p->des1) & TDES1_END_RING) >> 25; - - memset(p, 0, offsetof(struct dma_desc, des2)); - if (mode == STMMAC_CHAIN_MODE) -@@ -197,7 +197,7 @@ static void ndesc_prepare_tx_desc(struct - bool csum_flag, int mode, bool tx_own, - bool ls) - { -- unsigned int tdes1 = p->des1; -+ unsigned int tdes1 = le32_to_cpu(p->des1); - - if (is_fs) - tdes1 |= TDES1_FIRST_SEGMENT; -@@ -212,7 +212,7 @@ static void ndesc_prepare_tx_desc(struct - if (ls) - tdes1 |= TDES1_LAST_SEGMENT; - -- p->des1 = tdes1; -+ p->des1 = cpu_to_le32(tdes1); - - if (mode == STMMAC_CHAIN_MODE) - norm_set_tx_desc_len_on_chain(p, len); -@@ -220,12 +220,12 @@ static void ndesc_prepare_tx_desc(struct - norm_set_tx_desc_len_on_ring(p, len); - - if (tx_own) -- p->des0 |= TDES0_OWN; -+ p->des0 |= cpu_to_le32(TDES0_OWN); - } - - static void ndesc_set_tx_ic(struct dma_desc *p) - { -- p->des1 |= TDES1_INTERRUPT; -+ p->des1 |= cpu_to_le32(TDES1_INTERRUPT); - } - - static int ndesc_get_rx_frame_len(struct dma_desc *p, int rx_coe_type) -@@ -241,19 +241,20 @@ static int ndesc_get_rx_frame_len(struct - if (rx_coe_type == STMMAC_RX_COE_TYPE1) - csum = 2; - -- return (((p->des0 & RDES0_FRAME_LEN_MASK) >> RDES0_FRAME_LEN_SHIFT) - -+ return (((le32_to_cpu(p->des0) & RDES0_FRAME_LEN_MASK) -+ >> RDES0_FRAME_LEN_SHIFT) - - csum); - - } - - static void ndesc_enable_tx_timestamp(struct dma_desc *p) - { -- p->des1 |= TDES1_TIME_STAMP_ENABLE; -+ p->des1 |= cpu_to_le32(TDES1_TIME_STAMP_ENABLE); - } - - static int ndesc_get_tx_timestamp_status(struct dma_desc *p) - { -- return (p->des0 & TDES0_TIME_STAMP_STATUS) >> 17; -+ return (le32_to_cpu(p->des0) & TDES0_TIME_STAMP_STATUS) >> 17; - } - - static u64 ndesc_get_timestamp(void *desc, u32 ats) -@@ -261,9 +262,9 @@ static u64 ndesc_get_timestamp(void *des - struct dma_desc *p = (struct dma_desc *)desc; - u64 ns; - -- ns = p->des2; -+ ns = le32_to_cpu(p->des2); - /* convert high/sec time stamp value to nanosecond */ -- ns += p->des3 * 1000000000ULL; -+ ns += le32_to_cpu(p->des3) * 1000000000ULL; - - return ns; - } -@@ -272,7 +273,8 @@ static int ndesc_get_rx_timestamp_status - { - struct dma_desc *p = (struct dma_desc *)desc; - -- if ((p->des2 == 0xffffffff) && (p->des3 == 0xffffffff)) -+ if ((le32_to_cpu(p->des2) == 0xffffffff) && -+ (le32_to_cpu(p->des3) == 0xffffffff)) - /* timestamp is corrupted, hence don't store it */ - return 0; - else ---- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c -+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c -@@ -34,7 +34,7 @@ static int stmmac_jumbo_frm(void *p, str - unsigned int entry = priv->cur_tx; - struct dma_desc *desc; - unsigned int nopaged_len = skb_headlen(skb); -- unsigned int bmax, len; -+ unsigned int bmax, len, des2; - - if (priv->extend_desc) - desc = (struct dma_desc *)(priv->dma_etx + entry); -@@ -50,16 +50,17 @@ static int stmmac_jumbo_frm(void *p, str - - if (nopaged_len > BUF_SIZE_8KiB) { - -- desc->des2 = dma_map_single(priv->device, skb->data, -- bmax, DMA_TO_DEVICE); -- if (dma_mapping_error(priv->device, desc->des2)) -+ des2 = dma_map_single(priv->device, skb->data, bmax, -+ DMA_TO_DEVICE); -+ desc->des2 = cpu_to_le32(des2); -+ if (dma_mapping_error(priv->device, des2)) - return -1; - -- priv->tx_skbuff_dma[entry].buf = desc->des2; -+ priv->tx_skbuff_dma[entry].buf = des2; - priv->tx_skbuff_dma[entry].len = bmax; - priv->tx_skbuff_dma[entry].is_jumbo = true; - -- desc->des3 = desc->des2 + BUF_SIZE_4KiB; -+ desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); - priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, - STMMAC_RING_MODE, 0, false); - priv->tx_skbuff[entry] = NULL; -@@ -70,26 +71,28 @@ static int stmmac_jumbo_frm(void *p, str - else - desc = priv->dma_tx + entry; - -- desc->des2 = dma_map_single(priv->device, skb->data + bmax, -- len, DMA_TO_DEVICE); -- if (dma_mapping_error(priv->device, desc->des2)) -+ des2 = dma_map_single(priv->device, skb->data + bmax, len, -+ DMA_TO_DEVICE); -+ desc->des2 = cpu_to_le32(des2); -+ if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = desc->des2; -+ priv->tx_skbuff_dma[entry].buf = des2; - priv->tx_skbuff_dma[entry].len = len; - priv->tx_skbuff_dma[entry].is_jumbo = true; - -- desc->des3 = desc->des2 + BUF_SIZE_4KiB; -+ desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); - priv->hw->desc->prepare_tx_desc(desc, 0, len, csum, - STMMAC_RING_MODE, 1, true); - } else { -- desc->des2 = dma_map_single(priv->device, skb->data, -- nopaged_len, DMA_TO_DEVICE); -- if (dma_mapping_error(priv->device, desc->des2)) -+ des2 = dma_map_single(priv->device, skb->data, -+ nopaged_len, DMA_TO_DEVICE); -+ desc->des2 = cpu_to_le32(des2); -+ if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = desc->des2; -+ priv->tx_skbuff_dma[entry].buf = des2; - priv->tx_skbuff_dma[entry].len = nopaged_len; - priv->tx_skbuff_dma[entry].is_jumbo = true; -- desc->des3 = desc->des2 + BUF_SIZE_4KiB; -+ desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); - priv->hw->desc->prepare_tx_desc(desc, 1, nopaged_len, csum, - STMMAC_RING_MODE, 0, true); - } -@@ -115,13 +118,13 @@ static void stmmac_refill_desc3(void *pr - - /* Fill DES3 in case of RING mode */ - if (priv->dma_buf_sz >= BUF_SIZE_8KiB) -- p->des3 = p->des2 + BUF_SIZE_8KiB; -+ p->des3 = cpu_to_le32(le32_to_cpu(p->des2) + BUF_SIZE_8KiB); - } - - /* In ring mode we need to fill the desc3 because it is used as buffer */ - static void stmmac_init_desc3(struct dma_desc *p) - { -- p->des3 = p->des2 + BUF_SIZE_8KiB; -+ p->des3 = cpu_to_le32(le32_to_cpu(p->des2) + BUF_SIZE_8KiB); - } - - static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h -@@ -64,7 +64,6 @@ struct stmmac_priv { - dma_addr_t dma_tx_phy; - int tx_coalesce; - int hwts_tx_en; -- spinlock_t tx_lock; - bool tx_path_in_lpi_mode; - struct timer_list txtimer; - bool tso; -@@ -90,7 +89,6 @@ struct stmmac_priv { - struct mac_device_info *hw; - spinlock_t lock; - -- struct phy_device *phydev ____cacheline_aligned_in_smp; - int oldlink; - int speed; - int oldduplex; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -@@ -263,7 +263,7 @@ static void stmmac_ethtool_getdrvinfo(st - { - struct stmmac_priv *priv = netdev_priv(dev); - -- if (priv->plat->has_gmac) -+ if (priv->plat->has_gmac || priv->plat->has_gmac4) - strlcpy(info->driver, GMAC_ETHTOOL_NAME, sizeof(info->driver)); - else - strlcpy(info->driver, MAC100_ETHTOOL_NAME, -@@ -272,25 +272,26 @@ static void stmmac_ethtool_getdrvinfo(st - strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version)); - } - --static int stmmac_ethtool_getsettings(struct net_device *dev, -- struct ethtool_cmd *cmd) -+static int stmmac_ethtool_get_link_ksettings(struct net_device *dev, -+ struct ethtool_link_ksettings *cmd) - { - struct stmmac_priv *priv = netdev_priv(dev); -- struct phy_device *phy = priv->phydev; -+ struct phy_device *phy = dev->phydev; - int rc; - - if (priv->hw->pcs & STMMAC_PCS_RGMII || - priv->hw->pcs & STMMAC_PCS_SGMII) { - struct rgmii_adv adv; -+ u32 supported, advertising, lp_advertising; - - if (!priv->xstats.pcs_link) { -- ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN); -- cmd->duplex = DUPLEX_UNKNOWN; -+ cmd->base.speed = SPEED_UNKNOWN; -+ cmd->base.duplex = DUPLEX_UNKNOWN; - return 0; - } -- cmd->duplex = priv->xstats.pcs_duplex; -+ cmd->base.duplex = priv->xstats.pcs_duplex; - -- ethtool_cmd_speed_set(cmd, priv->xstats.pcs_speed); -+ cmd->base.speed = priv->xstats.pcs_speed; - - /* Get and convert ADV/LP_ADV from the HW AN registers */ - if (!priv->hw->mac->pcs_get_adv_lp) -@@ -300,45 +301,59 @@ static int stmmac_ethtool_getsettings(st - - /* Encoding of PSE bits is defined in 802.3z, 37.2.1.4 */ - -+ ethtool_convert_link_mode_to_legacy_u32( -+ &supported, cmd->link_modes.supported); -+ ethtool_convert_link_mode_to_legacy_u32( -+ &advertising, cmd->link_modes.advertising); -+ ethtool_convert_link_mode_to_legacy_u32( -+ &lp_advertising, cmd->link_modes.lp_advertising); -+ - if (adv.pause & STMMAC_PCS_PAUSE) -- cmd->advertising |= ADVERTISED_Pause; -+ advertising |= ADVERTISED_Pause; - if (adv.pause & STMMAC_PCS_ASYM_PAUSE) -- cmd->advertising |= ADVERTISED_Asym_Pause; -+ advertising |= ADVERTISED_Asym_Pause; - if (adv.lp_pause & STMMAC_PCS_PAUSE) -- cmd->lp_advertising |= ADVERTISED_Pause; -+ lp_advertising |= ADVERTISED_Pause; - if (adv.lp_pause & STMMAC_PCS_ASYM_PAUSE) -- cmd->lp_advertising |= ADVERTISED_Asym_Pause; -+ lp_advertising |= ADVERTISED_Asym_Pause; - - /* Reg49[3] always set because ANE is always supported */ -- cmd->autoneg = ADVERTISED_Autoneg; -- cmd->supported |= SUPPORTED_Autoneg; -- cmd->advertising |= ADVERTISED_Autoneg; -- cmd->lp_advertising |= ADVERTISED_Autoneg; -+ cmd->base.autoneg = ADVERTISED_Autoneg; -+ supported |= SUPPORTED_Autoneg; -+ advertising |= ADVERTISED_Autoneg; -+ lp_advertising |= ADVERTISED_Autoneg; - - if (adv.duplex) { -- cmd->supported |= (SUPPORTED_1000baseT_Full | -- SUPPORTED_100baseT_Full | -- SUPPORTED_10baseT_Full); -- cmd->advertising |= (ADVERTISED_1000baseT_Full | -- ADVERTISED_100baseT_Full | -- ADVERTISED_10baseT_Full); -+ supported |= (SUPPORTED_1000baseT_Full | -+ SUPPORTED_100baseT_Full | -+ SUPPORTED_10baseT_Full); -+ advertising |= (ADVERTISED_1000baseT_Full | -+ ADVERTISED_100baseT_Full | -+ ADVERTISED_10baseT_Full); - } else { -- cmd->supported |= (SUPPORTED_1000baseT_Half | -- SUPPORTED_100baseT_Half | -- SUPPORTED_10baseT_Half); -- cmd->advertising |= (ADVERTISED_1000baseT_Half | -- ADVERTISED_100baseT_Half | -- ADVERTISED_10baseT_Half); -+ supported |= (SUPPORTED_1000baseT_Half | -+ SUPPORTED_100baseT_Half | -+ SUPPORTED_10baseT_Half); -+ advertising |= (ADVERTISED_1000baseT_Half | -+ ADVERTISED_100baseT_Half | -+ ADVERTISED_10baseT_Half); - } - if (adv.lp_duplex) -- cmd->lp_advertising |= (ADVERTISED_1000baseT_Full | -- ADVERTISED_100baseT_Full | -- ADVERTISED_10baseT_Full); -+ lp_advertising |= (ADVERTISED_1000baseT_Full | -+ ADVERTISED_100baseT_Full | -+ ADVERTISED_10baseT_Full); - else -- cmd->lp_advertising |= (ADVERTISED_1000baseT_Half | -- ADVERTISED_100baseT_Half | -- ADVERTISED_10baseT_Half); -- cmd->port = PORT_OTHER; -+ lp_advertising |= (ADVERTISED_1000baseT_Half | -+ ADVERTISED_100baseT_Half | -+ ADVERTISED_10baseT_Half); -+ cmd->base.port = PORT_OTHER; -+ -+ ethtool_convert_legacy_u32_to_link_mode( -+ cmd->link_modes.supported, supported); -+ ethtool_convert_legacy_u32_to_link_mode( -+ cmd->link_modes.advertising, advertising); -+ ethtool_convert_legacy_u32_to_link_mode( -+ cmd->link_modes.lp_advertising, lp_advertising); - - return 0; - } -@@ -353,16 +368,16 @@ static int stmmac_ethtool_getsettings(st - "link speed / duplex setting\n", dev->name); - return -EBUSY; - } -- cmd->transceiver = XCVR_INTERNAL; -- rc = phy_ethtool_gset(phy, cmd); -+ rc = phy_ethtool_ksettings_get(phy, cmd); - return rc; - } - --static int stmmac_ethtool_setsettings(struct net_device *dev, -- struct ethtool_cmd *cmd) -+static int -+stmmac_ethtool_set_link_ksettings(struct net_device *dev, -+ const struct ethtool_link_ksettings *cmd) - { - struct stmmac_priv *priv = netdev_priv(dev); -- struct phy_device *phy = priv->phydev; -+ struct phy_device *phy = dev->phydev; - int rc; - - if (priv->hw->pcs & STMMAC_PCS_RGMII || -@@ -370,7 +385,7 @@ static int stmmac_ethtool_setsettings(st - u32 mask = ADVERTISED_Autoneg | ADVERTISED_Pause; - - /* Only support ANE */ -- if (cmd->autoneg != AUTONEG_ENABLE) -+ if (cmd->base.autoneg != AUTONEG_ENABLE) - return -EINVAL; - - mask &= (ADVERTISED_1000baseT_Half | -@@ -391,9 +406,7 @@ static int stmmac_ethtool_setsettings(st - return 0; - } - -- spin_lock(&priv->lock); -- rc = phy_ethtool_sset(phy, cmd); -- spin_unlock(&priv->lock); -+ rc = phy_ethtool_ksettings_set(phy, cmd); - - return rc; - } -@@ -433,7 +446,7 @@ static void stmmac_ethtool_gregs(struct - - memset(reg_space, 0x0, REG_SPACE_SIZE); - -- if (!priv->plat->has_gmac) { -+ if (!(priv->plat->has_gmac || priv->plat->has_gmac4)) { - /* MAC registers */ - for (i = 0; i < 12; i++) - reg_space[i] = readl(priv->ioaddr + (i * 4)); -@@ -471,12 +484,12 @@ stmmac_get_pauseparam(struct net_device - if (!adv_lp.pause) - return; - } else { -- if (!(priv->phydev->supported & SUPPORTED_Pause) || -- !(priv->phydev->supported & SUPPORTED_Asym_Pause)) -+ if (!(netdev->phydev->supported & SUPPORTED_Pause) || -+ !(netdev->phydev->supported & SUPPORTED_Asym_Pause)) - return; - } - -- pause->autoneg = priv->phydev->autoneg; -+ pause->autoneg = netdev->phydev->autoneg; - - if (priv->flow_ctrl & FLOW_RX) - pause->rx_pause = 1; -@@ -490,7 +503,7 @@ stmmac_set_pauseparam(struct net_device - struct ethtool_pauseparam *pause) - { - struct stmmac_priv *priv = netdev_priv(netdev); -- struct phy_device *phy = priv->phydev; -+ struct phy_device *phy = netdev->phydev; - int new_pause = FLOW_OFF; - - if (priv->hw->pcs && priv->hw->mac->pcs_get_adv_lp) { -@@ -550,7 +563,7 @@ static void stmmac_get_ethtool_stats(str - } - } - if (priv->eee_enabled) { -- int val = phy_get_eee_err(priv->phydev); -+ int val = phy_get_eee_err(dev->phydev); - if (val) - priv->xstats.phy_eee_wakeup_error_n = val; - } -@@ -669,7 +682,7 @@ static int stmmac_ethtool_op_get_eee(str - edata->eee_active = priv->eee_active; - edata->tx_lpi_timer = priv->tx_lpi_timer; - -- return phy_ethtool_get_eee(priv->phydev, edata); -+ return phy_ethtool_get_eee(dev->phydev, edata); - } - - static int stmmac_ethtool_op_set_eee(struct net_device *dev, -@@ -694,7 +707,7 @@ static int stmmac_ethtool_op_set_eee(str - priv->tx_lpi_timer = edata->tx_lpi_timer; - } - -- return phy_ethtool_set_eee(priv->phydev, edata); -+ return phy_ethtool_set_eee(dev->phydev, edata); - } - - static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv) -@@ -853,8 +866,6 @@ static int stmmac_set_tunable(struct net - static const struct ethtool_ops stmmac_ethtool_ops = { - .begin = stmmac_check_if_running, - .get_drvinfo = stmmac_ethtool_getdrvinfo, -- .get_settings = stmmac_ethtool_getsettings, -- .set_settings = stmmac_ethtool_setsettings, - .get_msglevel = stmmac_ethtool_getmsglevel, - .set_msglevel = stmmac_ethtool_setmsglevel, - .get_regs = stmmac_ethtool_gregs, -@@ -874,6 +885,8 @@ static const struct ethtool_ops stmmac_e - .set_coalesce = stmmac_set_coalesce, - .get_tunable = stmmac_get_tunable, - .set_tunable = stmmac_set_tunable, -+ .get_link_ksettings = stmmac_ethtool_get_link_ksettings, -+ .set_link_ksettings = stmmac_ethtool_set_link_ksettings, - }; - - void stmmac_set_ethtool_ops(struct net_device *netdev) ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -105,8 +105,8 @@ module_param(eee_timer, int, S_IRUGO | S - MODULE_PARM_DESC(eee_timer, "LPI tx expiration time in msec"); - #define STMMAC_LPI_T(x) (jiffies + msecs_to_jiffies(x)) - --/* By default the driver will use the ring mode to manage tx and rx descriptors -- * but passing this value so user can force to use the chain instead of the ring -+/* By default the driver will use the ring mode to manage tx and rx descriptors, -+ * but allow user to force to use the chain instead of the ring - */ - static unsigned int chain_mode; - module_param(chain_mode, int, S_IRUGO); -@@ -221,7 +221,8 @@ static inline u32 stmmac_rx_dirty(struct - */ - static inline void stmmac_hw_fix_mac_speed(struct stmmac_priv *priv) - { -- struct phy_device *phydev = priv->phydev; -+ struct net_device *ndev = priv->dev; -+ struct phy_device *phydev = ndev->phydev; - - if (likely(priv->plat->fix_mac_speed)) - priv->plat->fix_mac_speed(priv->plat->bsp_priv, phydev->speed); -@@ -279,6 +280,7 @@ static void stmmac_eee_ctrl_timer(unsign - */ - bool stmmac_eee_init(struct stmmac_priv *priv) - { -+ struct net_device *ndev = priv->dev; - unsigned long flags; - int interface = priv->plat->interface; - bool ret = false; -@@ -301,7 +303,7 @@ bool stmmac_eee_init(struct stmmac_priv - int tx_lpi_timer = priv->tx_lpi_timer; - - /* Check if the PHY supports EEE */ -- if (phy_init_eee(priv->phydev, 1)) { -+ if (phy_init_eee(ndev->phydev, 1)) { - /* To manage at run-time if the EEE cannot be supported - * anymore (for example because the lp caps have been - * changed). -@@ -309,7 +311,7 @@ bool stmmac_eee_init(struct stmmac_priv - */ - spin_lock_irqsave(&priv->lock, flags); - if (priv->eee_active) { -- pr_debug("stmmac: disable EEE\n"); -+ netdev_dbg(priv->dev, "disable EEE\n"); - del_timer_sync(&priv->eee_ctrl_timer); - priv->hw->mac->set_eee_timer(priv->hw, 0, - tx_lpi_timer); -@@ -333,12 +335,12 @@ bool stmmac_eee_init(struct stmmac_priv - tx_lpi_timer); - } - /* Set HW EEE according to the speed */ -- priv->hw->mac->set_eee_pls(priv->hw, priv->phydev->link); -+ priv->hw->mac->set_eee_pls(priv->hw, ndev->phydev->link); - - ret = true; - spin_unlock_irqrestore(&priv->lock, flags); - -- pr_debug("stmmac: Energy-Efficient Ethernet initialized\n"); -+ netdev_dbg(priv->dev, "Energy-Efficient Ethernet initialized\n"); - } - out: - return ret; -@@ -456,8 +458,8 @@ static int stmmac_hwtstamp_ioctl(struct - sizeof(struct hwtstamp_config))) - return -EFAULT; - -- pr_debug("%s config flags:0x%x, tx_type:0x%x, rx_filter:0x%x\n", -- __func__, config.flags, config.tx_type, config.rx_filter); -+ netdev_dbg(priv->dev, "%s config flags:0x%x, tx_type:0x%x, rx_filter:0x%x\n", -+ __func__, config.flags, config.tx_type, config.rx_filter); - - /* reserved for future extensions */ - if (config.flags) -@@ -712,7 +714,7 @@ static void stmmac_release_ptp(struct st - static void stmmac_adjust_link(struct net_device *dev) - { - struct stmmac_priv *priv = netdev_priv(dev); -- struct phy_device *phydev = priv->phydev; -+ struct phy_device *phydev = dev->phydev; - unsigned long flags; - int new_state = 0; - unsigned int fc = priv->flow_ctrl, pause_time = priv->pause; -@@ -765,9 +767,9 @@ static void stmmac_adjust_link(struct ne - stmmac_hw_fix_mac_speed(priv); - break; - default: -- if (netif_msg_link(priv)) -- pr_warn("%s: Speed (%d) not 10/100\n", -- dev->name, phydev->speed); -+ netif_warn(priv, link, priv->dev, -+ "Speed (%d) not 10/100\n", -+ phydev->speed); - break; - } - -@@ -820,10 +822,10 @@ static void stmmac_check_pcs_mode(struct - (interface == PHY_INTERFACE_MODE_RGMII_ID) || - (interface == PHY_INTERFACE_MODE_RGMII_RXID) || - (interface == PHY_INTERFACE_MODE_RGMII_TXID)) { -- pr_debug("STMMAC: PCS RGMII support enable\n"); -+ netdev_dbg(priv->dev, "PCS RGMII support enabled\n"); - priv->hw->pcs = STMMAC_PCS_RGMII; - } else if (interface == PHY_INTERFACE_MODE_SGMII) { -- pr_debug("STMMAC: PCS SGMII support enable\n"); -+ netdev_dbg(priv->dev, "PCS SGMII support enabled\n"); - priv->hw->pcs = STMMAC_PCS_SGMII; - } - } -@@ -858,15 +860,15 @@ static int stmmac_init_phy(struct net_de - - snprintf(phy_id_fmt, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, - priv->plat->phy_addr); -- pr_debug("stmmac_init_phy: trying to attach to %s\n", -- phy_id_fmt); -+ netdev_dbg(priv->dev, "%s: trying to attach to %s\n", __func__, -+ phy_id_fmt); - - phydev = phy_connect(dev, phy_id_fmt, &stmmac_adjust_link, - interface); - } - - if (IS_ERR_OR_NULL(phydev)) { -- pr_err("%s: Could not attach to PHY\n", dev->name); -+ netdev_err(priv->dev, "Could not attach to PHY\n"); - if (!phydev) - return -ENODEV; - -@@ -899,10 +901,8 @@ static int stmmac_init_phy(struct net_de - if (phydev->is_pseudo_fixed_link) - phydev->irq = PHY_POLL; - -- pr_debug("stmmac_init_phy: %s: attached to PHY (UID 0x%x)" -- " Link = %d\n", dev->name, phydev->phy_id, phydev->link); -- -- priv->phydev = phydev; -+ netdev_dbg(priv->dev, "%s: attached to PHY (UID 0x%x) Link = %d\n", -+ __func__, phydev->phy_id, phydev->link); - - return 0; - } -@@ -988,7 +988,8 @@ static int stmmac_init_rx_buffers(struct - - skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags); - if (!skb) { -- pr_err("%s: Rx init fails; skb is NULL\n", __func__); -+ netdev_err(priv->dev, -+ "%s: Rx init fails; skb is NULL\n", __func__); - return -ENOMEM; - } - priv->rx_skbuff[i] = skb; -@@ -996,15 +997,15 @@ static int stmmac_init_rx_buffers(struct - priv->dma_buf_sz, - DMA_FROM_DEVICE); - if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[i])) { -- pr_err("%s: DMA mapping error\n", __func__); -+ netdev_err(priv->dev, "%s: DMA mapping error\n", __func__); - dev_kfree_skb_any(skb); - return -EINVAL; - } - - if (priv->synopsys_id >= DWMAC_CORE_4_00) -- p->des0 = priv->rx_skbuff_dma[i]; -+ p->des0 = cpu_to_le32(priv->rx_skbuff_dma[i]); - else -- p->des2 = priv->rx_skbuff_dma[i]; -+ p->des2 = cpu_to_le32(priv->rx_skbuff_dma[i]); - - if ((priv->hw->mode->init_desc3) && - (priv->dma_buf_sz == BUF_SIZE_16KiB)) -@@ -1046,13 +1047,14 @@ static int init_dma_desc_rings(struct ne - - priv->dma_buf_sz = bfsize; - -- if (netif_msg_probe(priv)) { -- pr_debug("(%s) dma_rx_phy=0x%08x dma_tx_phy=0x%08x\n", __func__, -- (u32) priv->dma_rx_phy, (u32) priv->dma_tx_phy); -+ netif_dbg(priv, probe, priv->dev, -+ "(%s) dma_rx_phy=0x%08x dma_tx_phy=0x%08x\n", -+ __func__, (u32)priv->dma_rx_phy, (u32)priv->dma_tx_phy); -+ -+ /* RX INITIALIZATION */ -+ netif_dbg(priv, probe, priv->dev, -+ "SKB addresses:\nskb\t\tskb data\tdma data\n"); - -- /* RX INITIALIZATION */ -- pr_debug("\tSKB addresses:\nskb\t\tskb data\tdma data\n"); -- } - for (i = 0; i < DMA_RX_SIZE; i++) { - struct dma_desc *p; - if (priv->extend_desc) -@@ -1064,10 +1066,9 @@ static int init_dma_desc_rings(struct ne - if (ret) - goto err_init_rx_buffers; - -- if (netif_msg_probe(priv)) -- pr_debug("[%p]\t[%p]\t[%x]\n", priv->rx_skbuff[i], -- priv->rx_skbuff[i]->data, -- (unsigned int)priv->rx_skbuff_dma[i]); -+ netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n", -+ priv->rx_skbuff[i], priv->rx_skbuff[i]->data, -+ (unsigned int)priv->rx_skbuff_dma[i]); - } - priv->cur_rx = 0; - priv->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); -@@ -1322,7 +1323,7 @@ static void stmmac_tx_clean(struct stmma - unsigned int bytes_compl = 0, pkts_compl = 0; - unsigned int entry = priv->dirty_tx; - -- spin_lock(&priv->tx_lock); -+ netif_tx_lock(priv->dev); - - priv->xstats.tx_clean++; - -@@ -1398,22 +1399,17 @@ static void stmmac_tx_clean(struct stmma - netdev_completed_queue(priv->dev, pkts_compl, bytes_compl); - - if (unlikely(netif_queue_stopped(priv->dev) && -- stmmac_tx_avail(priv) > STMMAC_TX_THRESH)) { -- netif_tx_lock(priv->dev); -- if (netif_queue_stopped(priv->dev) && -- stmmac_tx_avail(priv) > STMMAC_TX_THRESH) { -- if (netif_msg_tx_done(priv)) -- pr_debug("%s: restart transmit\n", __func__); -- netif_wake_queue(priv->dev); -- } -- netif_tx_unlock(priv->dev); -+ stmmac_tx_avail(priv) > STMMAC_TX_THRESH)) { -+ netif_dbg(priv, tx_done, priv->dev, -+ "%s: restart transmit\n", __func__); -+ netif_wake_queue(priv->dev); - } - - if ((priv->eee_enabled) && (!priv->tx_path_in_lpi_mode)) { - stmmac_enable_eee_mode(priv); - mod_timer(&priv->eee_ctrl_timer, STMMAC_LPI_T(eee_timer)); - } -- spin_unlock(&priv->tx_lock); -+ netif_tx_unlock(priv->dev); - } - - static inline void stmmac_enable_dma_irq(struct stmmac_priv *priv) -@@ -1517,7 +1513,7 @@ static void stmmac_mmc_setup(struct stmm - dwmac_mmc_ctrl(priv->mmcaddr, mode); - memset(&priv->mmc, 0, sizeof(struct stmmac_counters)); - } else -- pr_info(" No MAC Management Counters available\n"); -+ netdev_info(priv->dev, "No MAC Management Counters available\n"); - } - - /** -@@ -1530,18 +1526,18 @@ static void stmmac_mmc_setup(struct stmm - static void stmmac_selec_desc_mode(struct stmmac_priv *priv) - { - if (priv->plat->enh_desc) { -- pr_info(" Enhanced/Alternate descriptors\n"); -+ dev_info(priv->device, "Enhanced/Alternate descriptors\n"); - - /* GMAC older than 3.50 has no extended descriptors */ - if (priv->synopsys_id >= DWMAC_CORE_3_50) { -- pr_info("\tEnabled extended descriptors\n"); -+ dev_info(priv->device, "Enabled extended descriptors\n"); - priv->extend_desc = 1; - } else -- pr_warn("Extended descriptors not supported\n"); -+ dev_warn(priv->device, "Extended descriptors not supported\n"); - - priv->hw->desc = &enh_desc_ops; - } else { -- pr_info(" Normal descriptors\n"); -+ dev_info(priv->device, "Normal descriptors\n"); - priv->hw->desc = &ndesc_ops; - } - } -@@ -1582,8 +1578,8 @@ static void stmmac_check_ether_addr(stru - priv->dev->dev_addr, 0); - if (!is_valid_ether_addr(priv->dev->dev_addr)) - eth_hw_addr_random(priv->dev); -- pr_info("%s: device MAC address %pM\n", priv->dev->name, -- priv->dev->dev_addr); -+ netdev_info(priv->dev, "device MAC address %pM\n", -+ priv->dev->dev_addr); - } - } - -@@ -1597,16 +1593,12 @@ static void stmmac_check_ether_addr(stru - */ - static int stmmac_init_dma_engine(struct stmmac_priv *priv) - { -- int pbl = DEFAULT_DMA_PBL, fixed_burst = 0, aal = 0; -- int mixed_burst = 0; - int atds = 0; - int ret = 0; - -- if (priv->plat->dma_cfg) { -- pbl = priv->plat->dma_cfg->pbl; -- fixed_burst = priv->plat->dma_cfg->fixed_burst; -- mixed_burst = priv->plat->dma_cfg->mixed_burst; -- aal = priv->plat->dma_cfg->aal; -+ if (!priv->plat->dma_cfg || !priv->plat->dma_cfg->pbl) { -+ dev_err(priv->device, "Invalid DMA configuration\n"); -+ return -EINVAL; - } - - if (priv->extend_desc && (priv->mode == STMMAC_RING_MODE)) -@@ -1618,8 +1610,8 @@ static int stmmac_init_dma_engine(struct - return ret; - } - -- priv->hw->dma->init(priv->ioaddr, pbl, fixed_burst, mixed_burst, -- aal, priv->dma_tx_phy, priv->dma_rx_phy, atds); -+ priv->hw->dma->init(priv->ioaddr, priv->plat->dma_cfg, -+ priv->dma_tx_phy, priv->dma_rx_phy, atds); - - if (priv->synopsys_id >= DWMAC_CORE_4_00) { - priv->rx_tail_addr = priv->dma_rx_phy + -@@ -1691,7 +1683,8 @@ static int stmmac_hw_setup(struct net_de - /* DMA initialization and SW reset */ - ret = stmmac_init_dma_engine(priv); - if (ret < 0) { -- pr_err("%s: DMA engine initialization failed\n", __func__); -+ netdev_err(priv->dev, "%s: DMA engine initialization failed\n", -+ __func__); - return ret; - } - -@@ -1720,7 +1713,7 @@ static int stmmac_hw_setup(struct net_de - - ret = priv->hw->mac->rx_ipc(priv->hw); - if (!ret) { -- pr_warn(" RX IPC Checksum Offload disabled\n"); -+ netdev_warn(priv->dev, "RX IPC Checksum Offload disabled\n"); - priv->plat->rx_coe = STMMAC_RX_COE_NONE; - priv->hw->rx_csum = 0; - } -@@ -1745,10 +1738,11 @@ static int stmmac_hw_setup(struct net_de - #ifdef CONFIG_DEBUG_FS - ret = stmmac_init_fs(dev); - if (ret < 0) -- pr_warn("%s: failed debugFS registration\n", __func__); -+ netdev_warn(priv->dev, "%s: failed debugFS registration\n", -+ __func__); - #endif - /* Start the ball rolling... */ -- pr_debug("%s: DMA RX/TX processes started...\n", dev->name); -+ netdev_dbg(priv->dev, "DMA RX/TX processes started...\n"); - priv->hw->dma->start_tx(priv->ioaddr); - priv->hw->dma->start_rx(priv->ioaddr); - -@@ -1803,8 +1797,9 @@ static int stmmac_open(struct net_device - priv->hw->pcs != STMMAC_PCS_RTBI) { - ret = stmmac_init_phy(dev); - if (ret) { -- pr_err("%s: Cannot attach to PHY (error: %d)\n", -- __func__, ret); -+ netdev_err(priv->dev, -+ "%s: Cannot attach to PHY (error: %d)\n", -+ __func__, ret); - return ret; - } - } -@@ -1819,33 +1814,36 @@ static int stmmac_open(struct net_device - - ret = alloc_dma_desc_resources(priv); - if (ret < 0) { -- pr_err("%s: DMA descriptors allocation failed\n", __func__); -+ netdev_err(priv->dev, "%s: DMA descriptors allocation failed\n", -+ __func__); - goto dma_desc_error; - } - - ret = init_dma_desc_rings(dev, GFP_KERNEL); - if (ret < 0) { -- pr_err("%s: DMA descriptors initialization failed\n", __func__); -+ netdev_err(priv->dev, "%s: DMA descriptors initialization failed\n", -+ __func__); - goto init_error; - } - - ret = stmmac_hw_setup(dev, true); - if (ret < 0) { -- pr_err("%s: Hw setup failed\n", __func__); -+ netdev_err(priv->dev, "%s: Hw setup failed\n", __func__); - goto init_error; - } - - stmmac_init_tx_coalesce(priv); - -- if (priv->phydev) -- phy_start(priv->phydev); -+ if (dev->phydev) -+ phy_start(dev->phydev); - - /* Request the IRQ lines */ - ret = request_irq(dev->irq, stmmac_interrupt, - IRQF_SHARED, dev->name, dev); - if (unlikely(ret < 0)) { -- pr_err("%s: ERROR: allocating the IRQ %d (error: %d)\n", -- __func__, dev->irq, ret); -+ netdev_err(priv->dev, -+ "%s: ERROR: allocating the IRQ %d (error: %d)\n", -+ __func__, dev->irq, ret); - goto init_error; - } - -@@ -1854,8 +1852,9 @@ static int stmmac_open(struct net_device - ret = request_irq(priv->wol_irq, stmmac_interrupt, - IRQF_SHARED, dev->name, dev); - if (unlikely(ret < 0)) { -- pr_err("%s: ERROR: allocating the WoL IRQ %d (%d)\n", -- __func__, priv->wol_irq, ret); -+ netdev_err(priv->dev, -+ "%s: ERROR: allocating the WoL IRQ %d (%d)\n", -+ __func__, priv->wol_irq, ret); - goto wolirq_error; - } - } -@@ -1865,8 +1864,9 @@ static int stmmac_open(struct net_device - ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED, - dev->name, dev); - if (unlikely(ret < 0)) { -- pr_err("%s: ERROR: allocating the LPI IRQ %d (%d)\n", -- __func__, priv->lpi_irq, ret); -+ netdev_err(priv->dev, -+ "%s: ERROR: allocating the LPI IRQ %d (%d)\n", -+ __func__, priv->lpi_irq, ret); - goto lpiirq_error; - } - } -@@ -1885,8 +1885,8 @@ wolirq_error: - init_error: - free_dma_desc_resources(priv); - dma_desc_error: -- if (priv->phydev) -- phy_disconnect(priv->phydev); -+ if (dev->phydev) -+ phy_disconnect(dev->phydev); - - return ret; - } -@@ -1905,10 +1905,9 @@ static int stmmac_release(struct net_dev - del_timer_sync(&priv->eee_ctrl_timer); - - /* Stop and disconnect the PHY */ -- if (priv->phydev) { -- phy_stop(priv->phydev); -- phy_disconnect(priv->phydev); -- priv->phydev = NULL; -+ if (dev->phydev) { -+ phy_stop(dev->phydev); -+ phy_disconnect(dev->phydev); - } - - netif_stop_queue(dev); -@@ -1968,13 +1967,13 @@ static void stmmac_tso_allocator(struct - priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); - desc = priv->dma_tx + priv->cur_tx; - -- desc->des0 = des + (total_len - tmp_len); -+ desc->des0 = cpu_to_le32(des + (total_len - tmp_len)); - buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ? - TSO_MAX_BUFF_SIZE : tmp_len; - - priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size, - 0, 1, -- (last_segment) && (tmp_len <= TSO_MAX_BUFF_SIZE), -+ (last_segment) && (buff_size < TSO_MAX_BUFF_SIZE), - 0, 0); - - tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -2019,8 +2018,6 @@ static netdev_tx_t stmmac_tso_xmit(struc - u8 proto_hdr_len; - int i; - -- spin_lock(&priv->tx_lock); -- - /* Compute header lengths */ - proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); - -@@ -2030,9 +2027,10 @@ static netdev_tx_t stmmac_tso_xmit(struc - if (!netif_queue_stopped(dev)) { - netif_stop_queue(dev); - /* This is a hard error, log it. */ -- pr_err("%s: Tx Ring full when queue awake\n", __func__); -+ netdev_err(priv->dev, -+ "%s: Tx Ring full when queue awake\n", -+ __func__); - } -- spin_unlock(&priv->tx_lock); - return NETDEV_TX_BUSY; - } - -@@ -2070,11 +2068,11 @@ static netdev_tx_t stmmac_tso_xmit(struc - priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb); - priv->tx_skbuff[first_entry] = skb; - -- first->des0 = des; -+ first->des0 = cpu_to_le32(des); - - /* Fill start of payload in buff2 of first descriptor */ - if (pay_len) -- first->des1 = des + proto_hdr_len; -+ first->des1 = cpu_to_le32(des + proto_hdr_len); - - /* If needed take extra descriptors to fill the remaining payload */ - tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; -@@ -2103,8 +2101,8 @@ static netdev_tx_t stmmac_tso_xmit(struc - priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); - - if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { -- if (netif_msg_hw(priv)) -- pr_debug("%s: stop transmitted packets\n", __func__); -+ netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n", -+ __func__); - netif_stop_queue(dev); - } - -@@ -2155,7 +2153,7 @@ static netdev_tx_t stmmac_tso_xmit(struc - * descriptor and then barrier is needed to make sure that - * all is coherent before granting the DMA engine. - */ -- smp_wmb(); -+ dma_wmb(); - - if (netif_msg_pktdata(priv)) { - pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", -@@ -2174,11 +2172,9 @@ static netdev_tx_t stmmac_tso_xmit(struc - priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, - STMMAC_CHAN0); - -- spin_unlock(&priv->tx_lock); - return NETDEV_TX_OK; - - dma_map_err: -- spin_unlock(&priv->tx_lock); - dev_err(priv->device, "Tx dma map failed\n"); - dev_kfree_skb(skb); - priv->dev->stats.tx_dropped++; -@@ -2210,14 +2206,13 @@ static netdev_tx_t stmmac_xmit(struct sk - return stmmac_tso_xmit(skb, dev); - } - -- spin_lock(&priv->tx_lock); -- - if (unlikely(stmmac_tx_avail(priv) < nfrags + 1)) { -- spin_unlock(&priv->tx_lock); - if (!netif_queue_stopped(dev)) { - netif_stop_queue(dev); - /* This is a hard error, log it. */ -- pr_err("%s: Tx Ring full when queue awake\n", __func__); -+ netdev_err(priv->dev, -+ "%s: Tx Ring full when queue awake\n", -+ __func__); - } - return NETDEV_TX_BUSY; - } -@@ -2270,13 +2265,11 @@ static netdev_tx_t stmmac_xmit(struct sk - - priv->tx_skbuff[entry] = NULL; - -- if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { -- desc->des0 = des; -- priv->tx_skbuff_dma[entry].buf = desc->des0; -- } else { -- desc->des2 = des; -- priv->tx_skbuff_dma[entry].buf = desc->des2; -- } -+ priv->tx_skbuff_dma[entry].buf = des; -+ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) -+ desc->des0 = cpu_to_le32(des); -+ else -+ desc->des2 = cpu_to_le32(des); - - priv->tx_skbuff_dma[entry].map_as_page = true; - priv->tx_skbuff_dma[entry].len = len; -@@ -2294,9 +2287,10 @@ static netdev_tx_t stmmac_xmit(struct sk - if (netif_msg_pktdata(priv)) { - void *tx_head; - -- pr_debug("%s: curr=%d dirty=%d f=%d, e=%d, first=%p, nfrags=%d", -- __func__, priv->cur_tx, priv->dirty_tx, first_entry, -- entry, first, nfrags); -+ netdev_dbg(priv->dev, -+ "%s: curr=%d dirty=%d f=%d, e=%d, first=%p, nfrags=%d", -+ __func__, priv->cur_tx, priv->dirty_tx, first_entry, -+ entry, first, nfrags); - - if (priv->extend_desc) - tx_head = (void *)priv->dma_etx; -@@ -2305,13 +2299,13 @@ static netdev_tx_t stmmac_xmit(struct sk - - priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); - -- pr_debug(">>> frame to be transmitted: "); -+ netdev_dbg(priv->dev, ">>> frame to be transmitted: "); - print_pkt(skb->data, skb->len); - } - - if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { -- if (netif_msg_hw(priv)) -- pr_debug("%s: stop transmitted packets\n", __func__); -+ netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n", -+ __func__); - netif_stop_queue(dev); - } - -@@ -2347,13 +2341,11 @@ static netdev_tx_t stmmac_xmit(struct sk - if (dma_mapping_error(priv->device, des)) - goto dma_map_err; - -- if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { -- first->des0 = des; -- priv->tx_skbuff_dma[first_entry].buf = first->des0; -- } else { -- first->des2 = des; -- priv->tx_skbuff_dma[first_entry].buf = first->des2; -- } -+ priv->tx_skbuff_dma[first_entry].buf = des; -+ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) -+ first->des0 = cpu_to_le32(des); -+ else -+ first->des2 = cpu_to_le32(des); - - priv->tx_skbuff_dma[first_entry].len = nopaged_len; - priv->tx_skbuff_dma[first_entry].last_segment = last_segment; -@@ -2374,7 +2366,7 @@ static netdev_tx_t stmmac_xmit(struct sk - * descriptor and then barrier is needed to make sure that - * all is coherent before granting the DMA engine. - */ -- smp_wmb(); -+ dma_wmb(); - } - - netdev_sent_queue(dev, skb->len); -@@ -2385,12 +2377,10 @@ static netdev_tx_t stmmac_xmit(struct sk - priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, - STMMAC_CHAN0); - -- spin_unlock(&priv->tx_lock); - return NETDEV_TX_OK; - - dma_map_err: -- spin_unlock(&priv->tx_lock); -- dev_err(priv->device, "Tx dma map failed\n"); -+ netdev_err(priv->dev, "Tx DMA map failed\n"); - dev_kfree_skb(skb); - priv->dev->stats.tx_dropped++; - return NETDEV_TX_OK; -@@ -2461,16 +2451,16 @@ static inline void stmmac_rx_refill(stru - DMA_FROM_DEVICE); - if (dma_mapping_error(priv->device, - priv->rx_skbuff_dma[entry])) { -- dev_err(priv->device, "Rx dma map failed\n"); -+ netdev_err(priv->dev, "Rx DMA map failed\n"); - dev_kfree_skb(skb); - break; - } - - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { -- p->des0 = priv->rx_skbuff_dma[entry]; -+ p->des0 = cpu_to_le32(priv->rx_skbuff_dma[entry]); - p->des1 = 0; - } else { -- p->des2 = priv->rx_skbuff_dma[entry]; -+ p->des2 = cpu_to_le32(priv->rx_skbuff_dma[entry]); - } - if (priv->hw->mode->refill_desc3) - priv->hw->mode->refill_desc3(priv, p); -@@ -2478,17 +2468,17 @@ static inline void stmmac_rx_refill(stru - if (priv->rx_zeroc_thresh > 0) - priv->rx_zeroc_thresh--; - -- if (netif_msg_rx_status(priv)) -- pr_debug("\trefill entry #%d\n", entry); -+ netif_dbg(priv, rx_status, priv->dev, -+ "refill entry #%d\n", entry); - } -- wmb(); -+ dma_wmb(); - - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) - priv->hw->desc->init_rx_desc(p, priv->use_riwt, 0, 0); - else - priv->hw->desc->set_rx_owner(p); - -- wmb(); -+ dma_wmb(); - - entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); - } -@@ -2512,7 +2502,7 @@ static int stmmac_rx(struct stmmac_priv - if (netif_msg_rx_status(priv)) { - void *rx_head; - -- pr_info(">>>>>> %s: descriptor ring:\n", __func__); -+ netdev_dbg(priv->dev, "%s: descriptor ring:\n", __func__); - if (priv->extend_desc) - rx_head = (void *)priv->dma_erx; - else -@@ -2574,9 +2564,9 @@ static int stmmac_rx(struct stmmac_priv - unsigned int des; - - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) -- des = p->des0; -+ des = le32_to_cpu(p->des0); - else -- des = p->des2; -+ des = le32_to_cpu(p->des2); - - frame_len = priv->hw->desc->get_rx_frame_len(p, coe); - -@@ -2585,9 +2575,9 @@ static int stmmac_rx(struct stmmac_priv - * ignored - */ - if (frame_len > priv->dma_buf_sz) { -- pr_err("%s: len %d larger than size (%d)\n", -- priv->dev->name, frame_len, -- priv->dma_buf_sz); -+ netdev_err(priv->dev, -+ "len %d larger than size (%d)\n", -+ frame_len, priv->dma_buf_sz); - priv->dev->stats.rx_length_errors++; - break; - } -@@ -2599,11 +2589,11 @@ static int stmmac_rx(struct stmmac_priv - frame_len -= ETH_FCS_LEN; - - if (netif_msg_rx_status(priv)) { -- pr_info("\tdesc: %p [entry %d] buff=0x%x\n", -- p, entry, des); -+ netdev_dbg(priv->dev, "\tdesc: %p [entry %d] buff=0x%x\n", -+ p, entry, des); - if (frame_len > ETH_FRAME_LEN) -- pr_debug("\tframe size %d, COE: %d\n", -- frame_len, status); -+ netdev_dbg(priv->dev, "frame size %d, COE: %d\n", -+ frame_len, status); - } - - /* The zero-copy is always used for all the sizes -@@ -2640,8 +2630,9 @@ static int stmmac_rx(struct stmmac_priv - } else { - skb = priv->rx_skbuff[entry]; - if (unlikely(!skb)) { -- pr_err("%s: Inconsistent Rx chain\n", -- priv->dev->name); -+ netdev_err(priv->dev, -+ "%s: Inconsistent Rx chain\n", -+ priv->dev->name); - priv->dev->stats.rx_dropped++; - break; - } -@@ -2657,7 +2648,8 @@ static int stmmac_rx(struct stmmac_priv - } - - if (netif_msg_pktdata(priv)) { -- pr_debug("frame received (%dbytes)", frame_len); -+ netdev_dbg(priv->dev, "frame received (%dbytes)", -+ frame_len); - print_pkt(skb->data, frame_len); - } - -@@ -2760,7 +2752,7 @@ static int stmmac_change_mtu(struct net_ - int max_mtu; - - if (netif_running(dev)) { -- pr_err("%s: must be stopped to change its MTU\n", dev->name); -+ netdev_err(priv->dev, "must be stopped to change its MTU\n"); - return -EBUSY; - } - -@@ -2852,7 +2844,7 @@ static irqreturn_t stmmac_interrupt(int - pm_wakeup_event(priv->device, 0); - - if (unlikely(!dev)) { -- pr_err("%s: invalid dev pointer\n", __func__); -+ netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__); - return IRQ_NONE; - } - -@@ -2910,7 +2902,6 @@ static void stmmac_poll_controller(struc - */ - static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) - { -- struct stmmac_priv *priv = netdev_priv(dev); - int ret = -EOPNOTSUPP; - - if (!netif_running(dev)) -@@ -2920,9 +2911,9 @@ static int stmmac_ioctl(struct net_devic - case SIOCGMIIPHY: - case SIOCGMIIREG: - case SIOCSMIIREG: -- if (!priv->phydev) -+ if (!dev->phydev) - return -EINVAL; -- ret = phy_mii_ioctl(priv->phydev, rq, cmd); -+ ret = phy_mii_ioctl(dev->phydev, rq, cmd); - break; - case SIOCSHWTSTAMP: - ret = stmmac_hwtstamp_ioctl(dev, rq); -@@ -2950,14 +2941,17 @@ static void sysfs_display_ring(void *hea - x = *(u64 *) ep; - seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", - i, (unsigned int)virt_to_phys(ep), -- ep->basic.des0, ep->basic.des1, -- ep->basic.des2, ep->basic.des3); -+ le32_to_cpu(ep->basic.des0), -+ le32_to_cpu(ep->basic.des1), -+ le32_to_cpu(ep->basic.des2), -+ le32_to_cpu(ep->basic.des3)); - ep++; - } else { - x = *(u64 *) p; - seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", - i, (unsigned int)virt_to_phys(ep), -- p->des0, p->des1, p->des2, p->des3); -+ le32_to_cpu(p->des0), le32_to_cpu(p->des1), -+ le32_to_cpu(p->des2), le32_to_cpu(p->des3)); - p++; - } - seq_printf(seq, "\n"); -@@ -2989,6 +2983,8 @@ static int stmmac_sysfs_ring_open(struct - return single_open(file, stmmac_sysfs_ring_read, inode->i_private); - } - -+/* Debugfs files, should appear in /sys/kernel/debug/stmmaceth/eth0 */ -+ - static const struct file_operations stmmac_rings_status_fops = { - .owner = THIS_MODULE, - .open = stmmac_sysfs_ring_open, -@@ -3011,11 +3007,11 @@ static int stmmac_sysfs_dma_cap_read(str - seq_printf(seq, "\tDMA HW features\n"); - seq_printf(seq, "==============================\n"); - -- seq_printf(seq, "\t10/100 Mbps %s\n", -+ seq_printf(seq, "\t10/100 Mbps: %s\n", - (priv->dma_cap.mbps_10_100) ? "Y" : "N"); -- seq_printf(seq, "\t1000 Mbps %s\n", -+ seq_printf(seq, "\t1000 Mbps: %s\n", - (priv->dma_cap.mbps_1000) ? "Y" : "N"); -- seq_printf(seq, "\tHalf duple %s\n", -+ seq_printf(seq, "\tHalf duplex: %s\n", - (priv->dma_cap.half_duplex) ? "Y" : "N"); - seq_printf(seq, "\tHash Filter: %s\n", - (priv->dma_cap.hash_filter) ? "Y" : "N"); -@@ -3033,9 +3029,9 @@ static int stmmac_sysfs_dma_cap_read(str - (priv->dma_cap.rmon) ? "Y" : "N"); - seq_printf(seq, "\tIEEE 1588-2002 Time Stamp: %s\n", - (priv->dma_cap.time_stamp) ? "Y" : "N"); -- seq_printf(seq, "\tIEEE 1588-2008 Advanced Time Stamp:%s\n", -+ seq_printf(seq, "\tIEEE 1588-2008 Advanced Time Stamp: %s\n", - (priv->dma_cap.atime_stamp) ? "Y" : "N"); -- seq_printf(seq, "\t802.3az - Energy-Efficient Ethernet (EEE) %s\n", -+ seq_printf(seq, "\t802.3az - Energy-Efficient Ethernet (EEE): %s\n", - (priv->dma_cap.eee) ? "Y" : "N"); - seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); - seq_printf(seq, "\tChecksum Offload in TX: %s\n", -@@ -3082,8 +3078,7 @@ static int stmmac_init_fs(struct net_dev - priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir); - - if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) { -- pr_err("ERROR %s/%s, debugfs create directory failed\n", -- STMMAC_RESOURCE_NAME, dev->name); -+ netdev_err(priv->dev, "ERROR failed to create debugfs directory\n"); - - return -ENOMEM; - } -@@ -3095,7 +3090,7 @@ static int stmmac_init_fs(struct net_dev - &stmmac_rings_status_fops); - - if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) { -- pr_info("ERROR creating stmmac ring debugfs file\n"); -+ netdev_err(priv->dev, "ERROR creating stmmac ring debugfs file\n"); - debugfs_remove_recursive(priv->dbgfs_dir); - - return -ENOMEM; -@@ -3107,7 +3102,7 @@ static int stmmac_init_fs(struct net_dev - dev, &stmmac_dma_cap_fops); - - if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) { -- pr_info("ERROR creating stmmac MMC debugfs file\n"); -+ netdev_err(priv->dev, "ERROR creating stmmac MMC debugfs file\n"); - debugfs_remove_recursive(priv->dbgfs_dir); - - return -ENOMEM; -@@ -3179,11 +3174,11 @@ static int stmmac_hw_init(struct stmmac_ - } else { - if (chain_mode) { - priv->hw->mode = &chain_mode_ops; -- pr_info(" Chain mode enabled\n"); -+ dev_info(priv->device, "Chain mode enabled\n"); - priv->mode = STMMAC_CHAIN_MODE; - } else { - priv->hw->mode = &ring_mode_ops; -- pr_info(" Ring mode enabled\n"); -+ dev_info(priv->device, "Ring mode enabled\n"); - priv->mode = STMMAC_RING_MODE; - } - } -@@ -3191,7 +3186,7 @@ static int stmmac_hw_init(struct stmmac_ - /* Get the HW capability (new GMAC newer than 3.50a) */ - priv->hw_cap_support = stmmac_get_hw_features(priv); - if (priv->hw_cap_support) { -- pr_info(" DMA HW capability register supported"); -+ dev_info(priv->device, "DMA HW capability register supported\n"); - - /* We can override some gmac/dma configuration fields: e.g. - * enh_desc, tx_coe (e.g. that are passed through the -@@ -3216,8 +3211,9 @@ static int stmmac_hw_init(struct stmmac_ - else if (priv->dma_cap.rx_coe_type1) - priv->plat->rx_coe = STMMAC_RX_COE_TYPE1; - -- } else -- pr_info(" No HW DMA feature register supported"); -+ } else { -+ dev_info(priv->device, "No HW DMA feature register supported\n"); -+ } - - /* To use alternate (extended), normal or GMAC4 descriptor structures */ - if (priv->synopsys_id >= DWMAC_CORE_4_00) -@@ -3227,20 +3223,20 @@ static int stmmac_hw_init(struct stmmac_ - - if (priv->plat->rx_coe) { - priv->hw->rx_csum = priv->plat->rx_coe; -- pr_info(" RX Checksum Offload Engine supported\n"); -+ dev_info(priv->device, "RX Checksum Offload Engine supported\n"); - if (priv->synopsys_id < DWMAC_CORE_4_00) -- pr_info("\tCOE Type %d\n", priv->hw->rx_csum); -+ dev_info(priv->device, "COE Type %d\n", priv->hw->rx_csum); - } - if (priv->plat->tx_coe) -- pr_info(" TX Checksum insertion supported\n"); -+ dev_info(priv->device, "TX Checksum insertion supported\n"); - - if (priv->plat->pmt) { -- pr_info(" Wake-Up On Lan supported\n"); -+ dev_info(priv->device, "Wake-Up On Lan supported\n"); - device_set_wakeup_capable(priv->device, 1); - } - - if (priv->dma_cap.tsoen) -- pr_info(" TSO supported\n"); -+ dev_info(priv->device, "TSO supported\n"); - - return 0; - } -@@ -3299,8 +3295,8 @@ int stmmac_dvr_probe(struct device *devi - - priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME); - if (IS_ERR(priv->stmmac_clk)) { -- dev_warn(priv->device, "%s: warning: cannot get CSR clock\n", -- __func__); -+ netdev_warn(priv->dev, "%s: warning: cannot get CSR clock\n", -+ __func__); - /* If failed to obtain stmmac_clk and specific clk_csr value - * is NOT passed from the platform, probe fail. - */ -@@ -3349,7 +3345,7 @@ int stmmac_dvr_probe(struct device *devi - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { - ndev->hw_features |= NETIF_F_TSO; - priv->tso = true; -- pr_info(" TSO feature enabled\n"); -+ dev_info(priv->device, "TSO feature enabled\n"); - } - ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; - ndev->watchdog_timeo = msecs_to_jiffies(watchdog); -@@ -3369,13 +3365,13 @@ int stmmac_dvr_probe(struct device *devi - */ - if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) { - priv->use_riwt = 1; -- pr_info(" Enable RX Mitigation via HW Watchdog Timer\n"); -+ dev_info(priv->device, -+ "Enable RX Mitigation via HW Watchdog Timer\n"); - } - - netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); - - spin_lock_init(&priv->lock); -- spin_lock_init(&priv->tx_lock); - - /* If a specific clk_csr value is passed from the platform - * this means that the CSR Clock Range selection cannot be -@@ -3396,15 +3392,17 @@ int stmmac_dvr_probe(struct device *devi - /* MDIO bus Registration */ - ret = stmmac_mdio_register(ndev); - if (ret < 0) { -- pr_debug("%s: MDIO bus (id: %d) registration failed", -- __func__, priv->plat->bus_id); -- goto error_napi_register; -+ dev_err(priv->device, -+ "%s: MDIO bus (id: %d) registration failed", -+ __func__, priv->plat->bus_id); -+ goto error_mdio_register; - } - } - - ret = register_netdev(ndev); - if (ret) { -- pr_err("%s: ERROR %i registering the device\n", __func__, ret); -+ dev_err(priv->device, "%s: ERROR %i registering the device\n", -+ __func__, ret); - goto error_netdev_register; - } - -@@ -3415,7 +3413,7 @@ error_netdev_register: - priv->hw->pcs != STMMAC_PCS_TBI && - priv->hw->pcs != STMMAC_PCS_RTBI) - stmmac_mdio_unregister(ndev); --error_napi_register: -+error_mdio_register: - netif_napi_del(&priv->napi); - error_hw_init: - clk_disable_unprepare(priv->pclk); -@@ -3439,7 +3437,7 @@ int stmmac_dvr_remove(struct device *dev - struct net_device *ndev = dev_get_drvdata(dev); - struct stmmac_priv *priv = netdev_priv(ndev); - -- pr_info("%s:\n\tremoving driver", __func__); -+ netdev_info(priv->dev, "%s: removing driver", __func__); - - priv->hw->dma->stop_rx(priv->ioaddr); - priv->hw->dma->stop_tx(priv->ioaddr); -@@ -3477,8 +3475,8 @@ int stmmac_suspend(struct device *dev) - if (!ndev || !netif_running(ndev)) - return 0; - -- if (priv->phydev) -- phy_stop(priv->phydev); -+ if (ndev->phydev) -+ phy_stop(ndev->phydev); - - spin_lock_irqsave(&priv->lock, flags); - -@@ -3572,8 +3570,8 @@ int stmmac_resume(struct device *dev) - - spin_unlock_irqrestore(&priv->lock, flags); - -- if (priv->phydev) -- phy_start(priv->phydev); -+ if (ndev->phydev) -+ phy_start(ndev->phydev); - - return 0; - } ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c -@@ -42,13 +42,6 @@ - #define MII_GMAC4_WRITE (1 << MII_GMAC4_GOC_SHIFT) - #define MII_GMAC4_READ (3 << MII_GMAC4_GOC_SHIFT) - --#define MII_PHY_ADDR_GMAC4_SHIFT 21 --#define MII_PHY_ADDR_GMAC4_MASK GENMASK(25, 21) --#define MII_PHY_REG_GMAC4_SHIFT 16 --#define MII_PHY_REG_GMAC4_MASK GENMASK(20, 16) --#define MII_CSR_CLK_GMAC4_SHIFT 8 --#define MII_CSR_CLK_GMAC4_MASK GENMASK(11, 8) -- - static int stmmac_mdio_busy_wait(void __iomem *ioaddr, unsigned int mii_addr) - { - unsigned long curr; -@@ -68,8 +61,8 @@ static int stmmac_mdio_busy_wait(void __ - /** - * stmmac_mdio_read - * @bus: points to the mii_bus structure -- * @phyaddr: MII addr reg bits 15-11 -- * @phyreg: MII addr reg bits 10-6 -+ * @phyaddr: MII addr -+ * @phyreg: MII reg - * Description: it reads data from the MII register from within the phy device. - * For the 7111 GMAC, we must set the bit 0 in the MII address register while - * accessing the PHY registers. -@@ -83,14 +76,20 @@ static int stmmac_mdio_read(struct mii_b - unsigned int mii_data = priv->hw->mii.data; - - int data; -- u16 regValue = (((phyaddr << 11) & (0x0000F800)) | -- ((phyreg << 6) & (0x000007C0))); -- regValue |= MII_BUSY | ((priv->clk_csr & 0xF) << 2); -+ u32 value = MII_BUSY; -+ -+ value |= (phyaddr << priv->hw->mii.addr_shift) -+ & priv->hw->mii.addr_mask; -+ value |= (phyreg << priv->hw->mii.reg_shift) & priv->hw->mii.reg_mask; -+ value |= (priv->clk_csr << priv->hw->mii.clk_csr_shift) -+ & priv->hw->mii.clk_csr_mask; -+ if (priv->plat->has_gmac4) -+ value |= MII_GMAC4_READ; - - if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) - return -EBUSY; - -- writel(regValue, priv->ioaddr + mii_address); -+ writel(value, priv->ioaddr + mii_address); - - if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) - return -EBUSY; -@@ -104,8 +103,8 @@ static int stmmac_mdio_read(struct mii_b - /** - * stmmac_mdio_write - * @bus: points to the mii_bus structure -- * @phyaddr: MII addr reg bits 15-11 -- * @phyreg: MII addr reg bits 10-6 -+ * @phyaddr: MII addr -+ * @phyreg: MII reg - * @phydata: phy data - * Description: it writes the data into the MII register from within the device. - */ -@@ -117,85 +116,18 @@ static int stmmac_mdio_write(struct mii_ - unsigned int mii_address = priv->hw->mii.addr; - unsigned int mii_data = priv->hw->mii.data; - -- u16 value = -- (((phyaddr << 11) & (0x0000F800)) | ((phyreg << 6) & (0x000007C0))) -- | MII_WRITE; -- -- value |= MII_BUSY | ((priv->clk_csr & 0xF) << 2); -- -- /* Wait until any existing MII operation is complete */ -- if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -- return -EBUSY; -- -- /* Set the MII address register to write */ -- writel(phydata, priv->ioaddr + mii_data); -- writel(value, priv->ioaddr + mii_address); -- -- /* Wait until any existing MII operation is complete */ -- return stmmac_mdio_busy_wait(priv->ioaddr, mii_address); --} -- --/** -- * stmmac_mdio_read_gmac4 -- * @bus: points to the mii_bus structure -- * @phyaddr: MII addr reg bits 25-21 -- * @phyreg: MII addr reg bits 20-16 -- * Description: it reads data from the MII register of GMAC4 from within -- * the phy device. -- */ --static int stmmac_mdio_read_gmac4(struct mii_bus *bus, int phyaddr, int phyreg) --{ -- struct net_device *ndev = bus->priv; -- struct stmmac_priv *priv = netdev_priv(ndev); -- unsigned int mii_address = priv->hw->mii.addr; -- unsigned int mii_data = priv->hw->mii.data; -- int data; -- u32 value = (((phyaddr << MII_PHY_ADDR_GMAC4_SHIFT) & -- (MII_PHY_ADDR_GMAC4_MASK)) | -- ((phyreg << MII_PHY_REG_GMAC4_SHIFT) & -- (MII_PHY_REG_GMAC4_MASK))) | MII_GMAC4_READ; -- -- value |= MII_BUSY | ((priv->clk_csr & MII_CSR_CLK_GMAC4_MASK) -- << MII_CSR_CLK_GMAC4_SHIFT); -- -- if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -- return -EBUSY; -- -- writel(value, priv->ioaddr + mii_address); -- -- if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -- return -EBUSY; -- -- /* Read the data from the MII data register */ -- data = (int)readl(priv->ioaddr + mii_data); -- -- return data; --} -- --/** -- * stmmac_mdio_write_gmac4 -- * @bus: points to the mii_bus structure -- * @phyaddr: MII addr reg bits 25-21 -- * @phyreg: MII addr reg bits 20-16 -- * @phydata: phy data -- * Description: it writes the data into the MII register of GMAC4 from within -- * the device. -- */ --static int stmmac_mdio_write_gmac4(struct mii_bus *bus, int phyaddr, int phyreg, -- u16 phydata) --{ -- struct net_device *ndev = bus->priv; -- struct stmmac_priv *priv = netdev_priv(ndev); -- unsigned int mii_address = priv->hw->mii.addr; -- unsigned int mii_data = priv->hw->mii.data; -- -- u32 value = (((phyaddr << MII_PHY_ADDR_GMAC4_SHIFT) & -- (MII_PHY_ADDR_GMAC4_MASK)) | -- ((phyreg << MII_PHY_REG_GMAC4_SHIFT) & -- (MII_PHY_REG_GMAC4_MASK))) | MII_GMAC4_WRITE; -+ u32 value = MII_BUSY; - -- value |= MII_BUSY | ((priv->clk_csr & MII_CSR_CLK_GMAC4_MASK) -- << MII_CSR_CLK_GMAC4_SHIFT); -+ value |= (phyaddr << priv->hw->mii.addr_shift) -+ & priv->hw->mii.addr_mask; -+ value |= (phyreg << priv->hw->mii.reg_shift) & priv->hw->mii.reg_mask; -+ -+ value |= (priv->clk_csr << priv->hw->mii.clk_csr_shift) -+ & priv->hw->mii.clk_csr_mask; -+ if (priv->plat->has_gmac4) -+ value |= MII_GMAC4_WRITE; -+ else -+ value |= MII_WRITE; - - /* Wait until any existing MII operation is complete */ - if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -@@ -260,7 +192,7 @@ int stmmac_mdio_reset(struct mii_bus *bu - #endif - - if (data->phy_reset) { -- pr_debug("stmmac_mdio_reset: calling phy_reset\n"); -+ netdev_dbg(ndev, "stmmac_mdio_reset: calling phy_reset\n"); - data->phy_reset(priv->plat->bsp_priv); - } - -@@ -305,13 +237,8 @@ int stmmac_mdio_register(struct net_devi - #endif - - new_bus->name = "stmmac"; -- if (priv->plat->has_gmac4) { -- new_bus->read = &stmmac_mdio_read_gmac4; -- new_bus->write = &stmmac_mdio_write_gmac4; -- } else { -- new_bus->read = &stmmac_mdio_read; -- new_bus->write = &stmmac_mdio_write; -- } -+ new_bus->read = &stmmac_mdio_read; -+ new_bus->write = &stmmac_mdio_write; - - new_bus->reset = &stmmac_mdio_reset; - snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x", -@@ -325,7 +252,7 @@ int stmmac_mdio_register(struct net_devi - else - err = mdiobus_register(new_bus); - if (err != 0) { -- pr_err("%s: Cannot register as MDIO bus\n", new_bus->name); -+ netdev_err(ndev, "Cannot register the MDIO bus\n"); - goto bus_register_fail; - } - -@@ -372,16 +299,16 @@ int stmmac_mdio_register(struct net_devi - irq_str = irq_num; - break; - } -- pr_info("%s: PHY ID %08x at %d IRQ %s (%s)%s\n", -- ndev->name, phydev->phy_id, addr, -- irq_str, phydev_name(phydev), -- act ? " active" : ""); -+ netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n", -+ phydev->phy_id, addr, -+ irq_str, phydev_name(phydev), -+ act ? " active" : ""); - found = 1; - } - } - - if (!found && !mdio_node) { -- pr_warn("%s: No PHY found\n", ndev->name); -+ netdev_warn(ndev, "No PHY found\n"); - mdiobus_unregister(new_bus); - mdiobus_free(new_bus); - return -ENODEV; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -@@ -81,6 +81,7 @@ static void stmmac_default_data(struct p - plat->mdio_bus_data->phy_mask = 0; - - plat->dma_cfg->pbl = 32; -+ plat->dma_cfg->pblx8 = true; - /* TODO: AXI */ - - /* Set default value for multicast hash bins */ -@@ -88,6 +89,9 @@ static void stmmac_default_data(struct p - - /* Set default value for unicast filter entries */ - plat->unicast_filter_entries = 1; -+ -+ /* Set the maxmtu to a default of JUMBO_LEN */ -+ plat->maxmtu = JUMBO_LEN; - } - - static int quark_default_data(struct plat_stmmacenet_data *plat, -@@ -115,6 +119,7 @@ static int quark_default_data(struct pla - plat->mdio_bus_data->phy_mask = 0; - - plat->dma_cfg->pbl = 16; -+ plat->dma_cfg->pblx8 = true; - plat->dma_cfg->fixed_burst = 1; - /* AXI (TODO) */ - -@@ -124,6 +129,9 @@ static int quark_default_data(struct pla - /* Set default value for unicast filter entries */ - plat->unicast_filter_entries = 1; - -+ /* Set the maxmtu to a default of JUMBO_LEN */ -+ plat->maxmtu = JUMBO_LEN; -+ - return 0; - } - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -291,6 +291,7 @@ stmmac_probe_config_dt(struct platform_d - if (of_device_is_compatible(np, "snps,dwmac-4.00") || - of_device_is_compatible(np, "snps,dwmac-4.10a")) { - plat->has_gmac4 = 1; -+ plat->has_gmac = 0; - plat->pmt = 1; - plat->tso_en = of_property_read_bool(np, "snps,tso"); - } -@@ -302,21 +303,25 @@ stmmac_probe_config_dt(struct platform_d - plat->force_sf_dma_mode = 1; - } - -- if (of_find_property(np, "snps,pbl", NULL)) { -- dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), -- GFP_KERNEL); -- if (!dma_cfg) { -- stmmac_remove_config_dt(pdev, plat); -- return ERR_PTR(-ENOMEM); -- } -- plat->dma_cfg = dma_cfg; -- of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); -- dma_cfg->aal = of_property_read_bool(np, "snps,aal"); -- dma_cfg->fixed_burst = -- of_property_read_bool(np, "snps,fixed-burst"); -- dma_cfg->mixed_burst = -- of_property_read_bool(np, "snps,mixed-burst"); -- } -+ dma_cfg = devm_kzalloc(&pdev->dev, sizeof(*dma_cfg), -+ GFP_KERNEL); -+ if (!dma_cfg) { -+ stmmac_remove_config_dt(pdev, plat); -+ return ERR_PTR(-ENOMEM); -+ } -+ plat->dma_cfg = dma_cfg; -+ -+ of_property_read_u32(np, "snps,pbl", &dma_cfg->pbl); -+ if (!dma_cfg->pbl) -+ dma_cfg->pbl = DEFAULT_DMA_PBL; -+ of_property_read_u32(np, "snps,txpbl", &dma_cfg->txpbl); -+ of_property_read_u32(np, "snps,rxpbl", &dma_cfg->rxpbl); -+ dma_cfg->pblx8 = !of_property_read_bool(np, "snps,no-pbl-x8"); -+ -+ dma_cfg->aal = of_property_read_bool(np, "snps,aal"); -+ dma_cfg->fixed_burst = of_property_read_bool(np, "snps,fixed-burst"); -+ dma_cfg->mixed_burst = of_property_read_bool(np, "snps,mixed-burst"); -+ - plat->force_thresh_dma_mode = of_property_read_bool(np, "snps,force_thresh_dma_mode"); - if (plat->force_thresh_dma_mode) { - plat->force_sf_dma_mode = 0; -@@ -444,9 +449,7 @@ static int stmmac_pltfr_suspend(struct d - struct platform_device *pdev = to_platform_device(dev); - - ret = stmmac_suspend(dev); -- if (priv->plat->suspend) -- priv->plat->suspend(pdev, priv->plat->bsp_priv); -- else if (priv->plat->exit) -+ if (priv->plat->exit) - priv->plat->exit(pdev, priv->plat->bsp_priv); - - return ret; -@@ -465,9 +468,7 @@ static int stmmac_pltfr_resume(struct de - struct stmmac_priv *priv = netdev_priv(ndev); - struct platform_device *pdev = to_platform_device(dev); - -- if (priv->plat->resume) -- priv->plat->resume(pdev, priv->plat->bsp_priv); -- else if (priv->plat->init) -+ if (priv->plat->init) - priv->plat->init(pdev, priv->plat->bsp_priv); - - return stmmac_resume(dev); ---- a/include/linux/stmmac.h -+++ b/include/linux/stmmac.h -@@ -88,6 +88,9 @@ struct stmmac_mdio_bus_data { - - struct stmmac_dma_cfg { - int pbl; -+ int txpbl; -+ int rxpbl; -+ bool pblx8; - int fixed_burst; - int mixed_burst; - bool aal; -@@ -135,8 +138,6 @@ struct plat_stmmacenet_data { - void (*bus_setup)(void __iomem *ioaddr); - int (*init)(struct platform_device *pdev, void *priv); - void (*exit)(struct platform_device *pdev, void *priv); -- void (*suspend)(struct platform_device *pdev, void *priv); -- void (*resume)(struct platform_device *pdev, void *priv); - void *bsp_priv; - struct stmmac_axi *axi; - int has_gmac4; diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch deleted file mode 100644 index 5f89e4b728f..00000000000 --- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch +++ /dev/null @@ -1,2296 +0,0 @@ ---- a/Documentation/devicetree/bindings/net/stmmac.txt -+++ b/Documentation/devicetree/bindings/net/stmmac.txt -@@ -49,6 +49,8 @@ Optional properties: - - snps,force_sf_dma_mode Force DMA to use the Store and Forward - mode for both tx and rx. This flag is - ignored if force_thresh_dma_mode is set. -+- snps,en-tx-lpi-clockgating Enable gating of the MAC TX clock during -+ TX low-power mode - - snps,multicast-filter-bins: Number of multicast filter hash bins - supported by this device instance - - snps,perfect-filter-entries: Number of perfect filter entries supported -@@ -65,7 +67,6 @@ Optional properties: - - snps,wr_osr_lmt: max write outstanding req. limit - - snps,rd_osr_lmt: max read outstanding req. limit - - snps,kbbe: do not cross 1KiB boundary. -- - snps,axi_all: align address - - snps,blen: this is a vector of supported burst length. - - snps,fb: fixed-burst - - snps,mb: mixed-burst ---- a/drivers/net/ethernet/stmicro/stmmac/Kconfig -+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig -@@ -1,5 +1,5 @@ - config STMMAC_ETH -- tristate "STMicroelectronics 10/100/1000 Ethernet driver" -+ tristate "STMicroelectronics 10/100/1000/EQOS Ethernet driver" - depends on HAS_IOMEM && HAS_DMA - select MII - select PHYLIB -@@ -7,9 +7,8 @@ config STMMAC_ETH - select PTP_1588_CLOCK - select RESET_CONTROLLER - ---help--- -- This is the driver for the Ethernet IPs are built around a -- Synopsys IP Core and only tested on the STMicroelectronics -- platforms. -+ This is the driver for the Ethernet IPs built around a -+ Synopsys IP Core. - - if STMMAC_ETH - -@@ -29,6 +28,15 @@ config STMMAC_PLATFORM - - if STMMAC_PLATFORM - -+config DWMAC_DWC_QOS_ETH -+ tristate "Support for snps,dwc-qos-ethernet.txt DT binding." -+ select PHYLIB -+ select CRC32 -+ select MII -+ depends on OF && HAS_DMA -+ help -+ Support for chips using the snps,dwc-qos-ethernet.txt DT binding. -+ - config DWMAC_GENERIC - tristate "Generic driver for DWMAC" - default STMMAC_PLATFORM -@@ -143,11 +151,11 @@ config STMMAC_PCI - tristate "STMMAC PCI bus support" - depends on STMMAC_ETH && PCI - ---help--- -- This is to select the Synopsys DWMAC available on PCI devices, -- if you have a controller with this interface, say Y or M here. -+ This selects the platform specific bus support for the stmmac driver. -+ This driver was tested on XLINX XC2V3000 FF1152AMT0221 -+ D1215994A VIRTEX FPGA board and SNPS QoS IPK Prototyping Kit. - -- This PCI support is tested on XLINX XC2V3000 FF1152AMT0221 -- D1215994A VIRTEX FPGA board. -+ If you have a controller with this interface, say Y or M here. - - If unsure, say N. - endif ---- a/drivers/net/ethernet/stmicro/stmmac/Makefile -+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile -@@ -16,6 +16,7 @@ obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-alt - obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o - obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o - obj-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o -+obj-$(CONFIG_DWMAC_DWC_QOS_ETH) += dwmac-dwc-qos-eth.o - obj-$(CONFIG_DWMAC_GENERIC) += dwmac-generic.o - stmmac-platform-objs:= stmmac_platform.o - dwmac-altr-socfpga-objs := altr_tse_pcs.o dwmac-socfpga.o ---- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c -+++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c -@@ -16,10 +16,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -71,7 +67,7 @@ struct stmmac_extra_stats { - unsigned long overflow_error; - unsigned long ipc_csum_error; - unsigned long rx_collision; -- unsigned long rx_crc; -+ unsigned long rx_crc_errors; - unsigned long dribbling_bit; - unsigned long rx_length; - unsigned long rx_mii; -@@ -323,6 +319,9 @@ struct dma_features { - /* TX and RX number of channels */ - unsigned int number_rx_channel; - unsigned int number_tx_channel; -+ /* TX and RX number of queues */ -+ unsigned int number_rx_queues; -+ unsigned int number_tx_queues; - /* Alternate (enhanced) DESC mode */ - unsigned int enh_desc; - }; -@@ -340,7 +339,7 @@ struct dma_features { - /* Common MAC defines */ - #define MAC_CTRL_REG 0x00000000 /* MAC Control */ - #define MAC_ENABLE_TX 0x00000008 /* Transmitter Enable */ --#define MAC_RNABLE_RX 0x00000004 /* Receiver Enable */ -+#define MAC_ENABLE_RX 0x00000004 /* Receiver Enable */ - - /* Default LPI timers */ - #define STMMAC_DEFAULT_LIT_LS 0x3E8 -@@ -417,7 +416,7 @@ struct stmmac_dma_ops { - /* Configure the AXI Bus Mode Register */ - void (*axi)(void __iomem *ioaddr, struct stmmac_axi *axi); - /* Dump DMA registers */ -- void (*dump_regs) (void __iomem *ioaddr); -+ void (*dump_regs)(void __iomem *ioaddr, u32 *reg_space); - /* Set tx/rx threshold in the csr6 register - * An invalid value enables the store-and-forward mode */ - void (*dma_mode)(void __iomem *ioaddr, int txmode, int rxmode, -@@ -454,8 +453,10 @@ struct stmmac_ops { - void (*core_init)(struct mac_device_info *hw, int mtu); - /* Enable and verify that the IPC module is supported */ - int (*rx_ipc)(struct mac_device_info *hw); -+ /* Enable RX Queues */ -+ void (*rx_queue_enable)(struct mac_device_info *hw, u32 queue); - /* Dump MAC registers */ -- void (*dump_regs)(struct mac_device_info *hw); -+ void (*dump_regs)(struct mac_device_info *hw, u32 *reg_space); - /* Handle extra events on specific interrupts hw dependent */ - int (*host_irq_status)(struct mac_device_info *hw, - struct stmmac_extra_stats *x); -@@ -471,7 +472,8 @@ struct stmmac_ops { - unsigned int reg_n); - void (*get_umac_addr)(struct mac_device_info *hw, unsigned char *addr, - unsigned int reg_n); -- void (*set_eee_mode)(struct mac_device_info *hw); -+ void (*set_eee_mode)(struct mac_device_info *hw, -+ bool en_tx_lpi_clockgating); - void (*reset_eee_mode)(struct mac_device_info *hw); - void (*set_eee_timer)(struct mac_device_info *hw, int ls, int tw); - void (*set_eee_pls)(struct mac_device_info *hw, int link); ---- a/drivers/net/ethernet/stmicro/stmmac/descs.h -+++ b/drivers/net/ethernet/stmicro/stmmac/descs.h -@@ -11,10 +11,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/descs_com.h -+++ b/drivers/net/ethernet/stmicro/stmmac/descs_com.h -@@ -17,10 +17,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- /dev/null -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c -@@ -0,0 +1,202 @@ -+/* -+ * Synopsys DWC Ethernet Quality-of-Service v4.10a linux driver -+ * -+ * Copyright (C) 2016 Joao Pinto -+ * -+ * 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. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program. If not, see . -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "stmmac_platform.h" -+ -+static int dwc_eth_dwmac_config_dt(struct platform_device *pdev, -+ struct plat_stmmacenet_data *plat_dat) -+{ -+ struct device_node *np = pdev->dev.of_node; -+ u32 burst_map = 0; -+ u32 bit_index = 0; -+ u32 a_index = 0; -+ -+ if (!plat_dat->axi) { -+ plat_dat->axi = kzalloc(sizeof(struct stmmac_axi), GFP_KERNEL); -+ -+ if (!plat_dat->axi) -+ return -ENOMEM; -+ } -+ -+ plat_dat->axi->axi_lpi_en = of_property_read_bool(np, "snps,en-lpi"); -+ if (of_property_read_u32(np, "snps,write-requests", -+ &plat_dat->axi->axi_wr_osr_lmt)) { -+ /** -+ * Since the register has a reset value of 1, if property -+ * is missing, default to 1. -+ */ -+ plat_dat->axi->axi_wr_osr_lmt = 1; -+ } else { -+ /** -+ * If property exists, to keep the behavior from dwc_eth_qos, -+ * subtract one after parsing. -+ */ -+ plat_dat->axi->axi_wr_osr_lmt--; -+ } -+ -+ if (of_property_read_u32(np, "read,read-requests", -+ &plat_dat->axi->axi_rd_osr_lmt)) { -+ /** -+ * Since the register has a reset value of 1, if property -+ * is missing, default to 1. -+ */ -+ plat_dat->axi->axi_rd_osr_lmt = 1; -+ } else { -+ /** -+ * If property exists, to keep the behavior from dwc_eth_qos, -+ * subtract one after parsing. -+ */ -+ plat_dat->axi->axi_rd_osr_lmt--; -+ } -+ of_property_read_u32(np, "snps,burst-map", &burst_map); -+ -+ /* converts burst-map bitmask to burst array */ -+ for (bit_index = 0; bit_index < 7; bit_index++) { -+ if (burst_map & (1 << bit_index)) { -+ switch (bit_index) { -+ case 0: -+ plat_dat->axi->axi_blen[a_index] = 4; break; -+ case 1: -+ plat_dat->axi->axi_blen[a_index] = 8; break; -+ case 2: -+ plat_dat->axi->axi_blen[a_index] = 16; break; -+ case 3: -+ plat_dat->axi->axi_blen[a_index] = 32; break; -+ case 4: -+ plat_dat->axi->axi_blen[a_index] = 64; break; -+ case 5: -+ plat_dat->axi->axi_blen[a_index] = 128; break; -+ case 6: -+ plat_dat->axi->axi_blen[a_index] = 256; break; -+ default: -+ break; -+ } -+ a_index++; -+ } -+ } -+ -+ /* dwc-qos needs GMAC4, AAL, TSO and PMT */ -+ plat_dat->has_gmac4 = 1; -+ plat_dat->dma_cfg->aal = 1; -+ plat_dat->tso_en = 1; -+ plat_dat->pmt = 1; -+ -+ return 0; -+} -+ -+static int dwc_eth_dwmac_probe(struct platform_device *pdev) -+{ -+ struct plat_stmmacenet_data *plat_dat; -+ struct stmmac_resources stmmac_res; -+ struct resource *res; -+ int ret; -+ -+ memset(&stmmac_res, 0, sizeof(struct stmmac_resources)); -+ -+ /** -+ * Since stmmac_platform supports name IRQ only, basic platform -+ * resource initialization is done in the glue logic. -+ */ -+ stmmac_res.irq = platform_get_irq(pdev, 0); -+ if (stmmac_res.irq < 0) { -+ if (stmmac_res.irq != -EPROBE_DEFER) -+ dev_err(&pdev->dev, -+ "IRQ configuration information not found\n"); -+ -+ return stmmac_res.irq; -+ } -+ stmmac_res.wol_irq = stmmac_res.irq; -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ stmmac_res.addr = devm_ioremap_resource(&pdev->dev, res); -+ if (IS_ERR(stmmac_res.addr)) -+ return PTR_ERR(stmmac_res.addr); -+ -+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac); -+ if (IS_ERR(plat_dat)) -+ return PTR_ERR(plat_dat); -+ -+ plat_dat->stmmac_clk = devm_clk_get(&pdev->dev, "apb_pclk"); -+ if (IS_ERR(plat_dat->stmmac_clk)) { -+ dev_err(&pdev->dev, "apb_pclk clock not found.\n"); -+ ret = PTR_ERR(plat_dat->stmmac_clk); -+ plat_dat->stmmac_clk = NULL; -+ goto err_remove_config_dt; -+ } -+ clk_prepare_enable(plat_dat->stmmac_clk); -+ -+ plat_dat->pclk = devm_clk_get(&pdev->dev, "phy_ref_clk"); -+ if (IS_ERR(plat_dat->pclk)) { -+ dev_err(&pdev->dev, "phy_ref_clk clock not found.\n"); -+ ret = PTR_ERR(plat_dat->pclk); -+ plat_dat->pclk = NULL; -+ goto err_out_clk_dis_phy; -+ } -+ clk_prepare_enable(plat_dat->pclk); -+ -+ ret = dwc_eth_dwmac_config_dt(pdev, plat_dat); -+ if (ret) -+ goto err_out_clk_dis_aper; -+ -+ ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); -+ if (ret) -+ goto err_out_clk_dis_aper; -+ -+ return 0; -+ -+err_out_clk_dis_aper: -+ clk_disable_unprepare(plat_dat->pclk); -+err_out_clk_dis_phy: -+ clk_disable_unprepare(plat_dat->stmmac_clk); -+err_remove_config_dt: -+ stmmac_remove_config_dt(pdev, plat_dat); -+ -+ return ret; -+} -+ -+static int dwc_eth_dwmac_remove(struct platform_device *pdev) -+{ -+ return stmmac_pltfr_remove(pdev); -+} -+ -+static const struct of_device_id dwc_eth_dwmac_match[] = { -+ { .compatible = "snps,dwc-qos-ethernet-4.10", }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, dwc_eth_dwmac_match); -+ -+static struct platform_driver dwc_eth_dwmac_driver = { -+ .probe = dwc_eth_dwmac_probe, -+ .remove = dwc_eth_dwmac_remove, -+ .driver = { -+ .name = "dwc-eth-dwmac", -+ .of_match_table = dwc_eth_dwmac_match, -+ }, -+}; -+module_platform_driver(dwc_eth_dwmac_driver); -+ -+MODULE_AUTHOR("Joao Pinto "); -+MODULE_DESCRIPTION("Synopsys DWC Ethernet Quality-of-Service v4.10a driver"); -+MODULE_LICENSE("GPL v2"); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-meson8b.c -@@ -35,10 +35,6 @@ - - #define PRG_ETH0_TXDLY_SHIFT 5 - #define PRG_ETH0_TXDLY_MASK GENMASK(6, 5) --#define PRG_ETH0_TXDLY_OFF (0x0 << PRG_ETH0_TXDLY_SHIFT) --#define PRG_ETH0_TXDLY_QUARTER (0x1 << PRG_ETH0_TXDLY_SHIFT) --#define PRG_ETH0_TXDLY_HALF (0x2 << PRG_ETH0_TXDLY_SHIFT) --#define PRG_ETH0_TXDLY_THREE_QUARTERS (0x3 << PRG_ETH0_TXDLY_SHIFT) - - /* divider for the result of m250_sel */ - #define PRG_ETH0_CLK_M250_DIV_SHIFT 7 -@@ -69,6 +65,8 @@ struct meson8b_dwmac { - - struct clk_divider m25_div; - struct clk *m25_div_clk; -+ -+ u32 tx_delay_ns; - }; - - static void meson8b_dwmac_mask_bits(struct meson8b_dwmac *dwmac, u32 reg, -@@ -181,11 +179,19 @@ static int meson8b_init_prg_eth(struct m - { - int ret; - unsigned long clk_rate; -+ u8 tx_dly_val = 0; - - switch (dwmac->phy_mode) { - case PHY_INTERFACE_MODE_RGMII: -- case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RGMII_RXID: -+ /* TX clock delay in ns = "8ns / 4 * tx_dly_val" (where -+ * 8ns are exactly one cycle of the 125MHz RGMII TX clock): -+ * 0ns = 0x0, 2ns = 0x1, 4ns = 0x2, 6ns = 0x3 -+ */ -+ tx_dly_val = dwmac->tx_delay_ns >> 1; -+ /* fall through */ -+ -+ case PHY_INTERFACE_MODE_RGMII_ID: - case PHY_INTERFACE_MODE_RGMII_TXID: - /* Generate a 25MHz clock for the PHY */ - clk_rate = 25 * 1000 * 1000; -@@ -198,9 +204,8 @@ static int meson8b_init_prg_eth(struct m - meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, - PRG_ETH0_INVERTED_RMII_CLK, 0); - -- /* TX clock delay - all known boards use a 1/4 cycle delay */ - meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, PRG_ETH0_TXDLY_MASK, -- PRG_ETH0_TXDLY_QUARTER); -+ tx_dly_val << PRG_ETH0_TXDLY_SHIFT); - break; - - case PHY_INTERFACE_MODE_RMII: -@@ -286,6 +291,11 @@ static int meson8b_dwmac_probe(struct pl - goto err_remove_config_dt; - } - -+ /* use 2ns as fallback since this value was previously hardcoded */ -+ if (of_property_read_u32(pdev->dev.of_node, "amlogic,tx-delay-ns", -+ &dwmac->tx_delay_ns)) -+ dwmac->tx_delay_ns = 2; -+ - ret = meson8b_init_clk(dwmac); - if (ret) - goto err_remove_config_dt; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -@@ -302,6 +302,122 @@ static const struct rk_gmac_ops rk3288_o - .set_rmii_speed = rk3288_set_rmii_speed, - }; - -+#define RK3328_GRF_MAC_CON0 0x0900 -+#define RK3328_GRF_MAC_CON1 0x0904 -+ -+/* RK3328_GRF_MAC_CON0 */ -+#define RK3328_GMAC_CLK_RX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 7) -+#define RK3328_GMAC_CLK_TX_DL_CFG(val) HIWORD_UPDATE(val, 0x7F, 0) -+ -+/* RK3328_GRF_MAC_CON1 */ -+#define RK3328_GMAC_PHY_INTF_SEL_RGMII \ -+ (GRF_BIT(4) | GRF_CLR_BIT(5) | GRF_CLR_BIT(6)) -+#define RK3328_GMAC_PHY_INTF_SEL_RMII \ -+ (GRF_CLR_BIT(4) | GRF_CLR_BIT(5) | GRF_BIT(6)) -+#define RK3328_GMAC_FLOW_CTRL GRF_BIT(3) -+#define RK3328_GMAC_FLOW_CTRL_CLR GRF_CLR_BIT(3) -+#define RK3328_GMAC_SPEED_10M GRF_CLR_BIT(2) -+#define RK3328_GMAC_SPEED_100M GRF_BIT(2) -+#define RK3328_GMAC_RMII_CLK_25M GRF_BIT(7) -+#define RK3328_GMAC_RMII_CLK_2_5M GRF_CLR_BIT(7) -+#define RK3328_GMAC_CLK_125M (GRF_CLR_BIT(11) | GRF_CLR_BIT(12)) -+#define RK3328_GMAC_CLK_25M (GRF_BIT(11) | GRF_BIT(12)) -+#define RK3328_GMAC_CLK_2_5M (GRF_CLR_BIT(11) | GRF_BIT(12)) -+#define RK3328_GMAC_RMII_MODE GRF_BIT(9) -+#define RK3328_GMAC_RMII_MODE_CLR GRF_CLR_BIT(9) -+#define RK3328_GMAC_TXCLK_DLY_ENABLE GRF_BIT(0) -+#define RK3328_GMAC_TXCLK_DLY_DISABLE GRF_CLR_BIT(0) -+#define RK3328_GMAC_RXCLK_DLY_ENABLE GRF_BIT(1) -+#define RK3328_GMAC_RXCLK_DLY_DISABLE GRF_CLR_BIT(0) -+ -+static void rk3328_set_to_rgmii(struct rk_priv_data *bsp_priv, -+ int tx_delay, int rx_delay) -+{ -+ struct device *dev = &bsp_priv->pdev->dev; -+ -+ if (IS_ERR(bsp_priv->grf)) { -+ dev_err(dev, "Missing rockchip,grf property\n"); -+ return; -+ } -+ -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_PHY_INTF_SEL_RGMII | -+ RK3328_GMAC_RMII_MODE_CLR | -+ RK3328_GMAC_RXCLK_DLY_ENABLE | -+ RK3328_GMAC_TXCLK_DLY_ENABLE); -+ -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON0, -+ RK3328_GMAC_CLK_RX_DL_CFG(rx_delay) | -+ RK3328_GMAC_CLK_TX_DL_CFG(tx_delay)); -+} -+ -+static void rk3328_set_to_rmii(struct rk_priv_data *bsp_priv) -+{ -+ struct device *dev = &bsp_priv->pdev->dev; -+ -+ if (IS_ERR(bsp_priv->grf)) { -+ dev_err(dev, "Missing rockchip,grf property\n"); -+ return; -+ } -+ -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_PHY_INTF_SEL_RMII | -+ RK3328_GMAC_RMII_MODE); -+ -+ /* set MAC to RMII mode */ -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, GRF_BIT(11)); -+} -+ -+static void rk3328_set_rgmii_speed(struct rk_priv_data *bsp_priv, int speed) -+{ -+ struct device *dev = &bsp_priv->pdev->dev; -+ -+ if (IS_ERR(bsp_priv->grf)) { -+ dev_err(dev, "Missing rockchip,grf property\n"); -+ return; -+ } -+ -+ if (speed == 10) -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_CLK_2_5M); -+ else if (speed == 100) -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_CLK_25M); -+ else if (speed == 1000) -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_CLK_125M); -+ else -+ dev_err(dev, "unknown speed value for RGMII! speed=%d", speed); -+} -+ -+static void rk3328_set_rmii_speed(struct rk_priv_data *bsp_priv, int speed) -+{ -+ struct device *dev = &bsp_priv->pdev->dev; -+ -+ if (IS_ERR(bsp_priv->grf)) { -+ dev_err(dev, "Missing rockchip,grf property\n"); -+ return; -+ } -+ -+ if (speed == 10) -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_RMII_CLK_2_5M | -+ RK3328_GMAC_SPEED_10M); -+ else if (speed == 100) -+ regmap_write(bsp_priv->grf, RK3328_GRF_MAC_CON1, -+ RK3328_GMAC_RMII_CLK_25M | -+ RK3328_GMAC_SPEED_100M); -+ else -+ dev_err(dev, "unknown speed value for RMII! speed=%d", speed); -+} -+ -+static const struct rk_gmac_ops rk3328_ops = { -+ .set_to_rgmii = rk3328_set_to_rgmii, -+ .set_to_rmii = rk3328_set_to_rmii, -+ .set_rgmii_speed = rk3328_set_rgmii_speed, -+ .set_rmii_speed = rk3328_set_rmii_speed, -+}; -+ - #define RK3366_GRF_SOC_CON6 0x0418 - #define RK3366_GRF_SOC_CON7 0x041c - -@@ -1006,6 +1122,7 @@ static SIMPLE_DEV_PM_OPS(rk_gmac_pm_ops, - static const struct of_device_id rk_gmac_dwmac_match[] = { - { .compatible = "rockchip,rk3228-gmac", .data = &rk3228_ops }, - { .compatible = "rockchip,rk3288-gmac", .data = &rk3288_ops }, -+ { .compatible = "rockchip,rk3328-gmac", .data = &rk3328_ops }, - { .compatible = "rockchip,rk3366-gmac", .data = &rk3366_ops }, - { .compatible = "rockchip,rk3368-gmac", .data = &rk3368_ops }, - { .compatible = "rockchip,rk3399-gmac", .data = &rk3399_ops }, ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c -@@ -351,7 +351,7 @@ static int socfpga_dwmac_probe(struct pl - * mode. Create a copy of the core reset handle so it can be used by - * the driver later. - */ -- dwmac->stmmac_rst = stpriv->stmmac_rst; -+ dwmac->stmmac_rst = stpriv->plat->stmmac_rst; - - ret = socfpga_dwmac_set_phy_mode(dwmac); - if (ret) ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100.h -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000.h -@@ -10,10 +10,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -@@ -16,10 +16,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -96,17 +92,13 @@ static int dwmac1000_rx_ipc_enable(struc - return !!(value & GMAC_CONTROL_IPC); - } - --static void dwmac1000_dump_regs(struct mac_device_info *hw) -+static void dwmac1000_dump_regs(struct mac_device_info *hw, u32 *reg_space) - { - void __iomem *ioaddr = hw->pcsr; - int i; -- pr_info("\tDWMAC1000 regs (base addr = 0x%p)\n", ioaddr); - -- for (i = 0; i < 55; i++) { -- int offset = i * 4; -- pr_info("\tReg No. %d (offset 0x%x): 0x%08x\n", i, -- offset, readl(ioaddr + offset)); -- } -+ for (i = 0; i < 55; i++) -+ reg_space[i] = readl(ioaddr + i * 4); - } - - static void dwmac1000_set_umac_addr(struct mac_device_info *hw, -@@ -347,11 +339,14 @@ static int dwmac1000_irq_status(struct m - return ret; - } - --static void dwmac1000_set_eee_mode(struct mac_device_info *hw) -+static void dwmac1000_set_eee_mode(struct mac_device_info *hw, -+ bool en_tx_lpi_clockgating) - { - void __iomem *ioaddr = hw->pcsr; - u32 value; - -+ /*TODO - en_tx_lpi_clockgating treatment */ -+ - /* Enable the link status receive on RGMII, SGMII ore SMII - * receive path and instruct the transmit to enter in LPI - * state. ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -@@ -16,10 +16,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -205,18 +201,14 @@ static void dwmac1000_dma_operation_mode - writel(csr6, ioaddr + DMA_CONTROL); - } - --static void dwmac1000_dump_dma_regs(void __iomem *ioaddr) -+static void dwmac1000_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space) - { - int i; -- pr_info(" DMA registers\n"); -- for (i = 0; i < 22; i++) { -- if ((i < 9) || (i > 17)) { -- int offset = i * 4; -- pr_err("\t Reg No. %d (offset 0x%x): 0x%08x\n", i, -- (DMA_BUS_MODE + offset), -- readl(ioaddr + DMA_BUS_MODE + offset)); -- } -- } -+ -+ for (i = 0; i < 22; i++) -+ if ((i < 9) || (i > 17)) -+ reg_space[DMA_BUS_MODE / 4 + i] = -+ readl(ioaddr + DMA_BUS_MODE + i * 4); - } - - static void dwmac1000_get_hw_feature(void __iomem *ioaddr, ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -@@ -18,10 +18,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -44,28 +40,18 @@ static void dwmac100_core_init(struct ma - #endif - } - --static void dwmac100_dump_mac_regs(struct mac_device_info *hw) -+static void dwmac100_dump_mac_regs(struct mac_device_info *hw, u32 *reg_space) - { - void __iomem *ioaddr = hw->pcsr; -- pr_info("\t----------------------------------------------\n" -- "\t DWMAC 100 CSR (base addr = 0x%p)\n" -- "\t----------------------------------------------\n", ioaddr); -- pr_info("\tcontrol reg (offset 0x%x): 0x%08x\n", MAC_CONTROL, -- readl(ioaddr + MAC_CONTROL)); -- pr_info("\taddr HI (offset 0x%x): 0x%08x\n ", MAC_ADDR_HIGH, -- readl(ioaddr + MAC_ADDR_HIGH)); -- pr_info("\taddr LO (offset 0x%x): 0x%08x\n", MAC_ADDR_LOW, -- readl(ioaddr + MAC_ADDR_LOW)); -- pr_info("\tmulticast hash HI (offset 0x%x): 0x%08x\n", -- MAC_HASH_HIGH, readl(ioaddr + MAC_HASH_HIGH)); -- pr_info("\tmulticast hash LO (offset 0x%x): 0x%08x\n", -- MAC_HASH_LOW, readl(ioaddr + MAC_HASH_LOW)); -- pr_info("\tflow control (offset 0x%x): 0x%08x\n", -- MAC_FLOW_CTRL, readl(ioaddr + MAC_FLOW_CTRL)); -- pr_info("\tVLAN1 tag (offset 0x%x): 0x%08x\n", MAC_VLAN1, -- readl(ioaddr + MAC_VLAN1)); -- pr_info("\tVLAN2 tag (offset 0x%x): 0x%08x\n", MAC_VLAN2, -- readl(ioaddr + MAC_VLAN2)); -+ -+ reg_space[MAC_CONTROL / 4] = readl(ioaddr + MAC_CONTROL); -+ reg_space[MAC_ADDR_HIGH / 4] = readl(ioaddr + MAC_ADDR_HIGH); -+ reg_space[MAC_ADDR_LOW / 4] = readl(ioaddr + MAC_ADDR_LOW); -+ reg_space[MAC_HASH_HIGH / 4] = readl(ioaddr + MAC_HASH_HIGH); -+ reg_space[MAC_HASH_LOW / 4] = readl(ioaddr + MAC_HASH_LOW); -+ reg_space[MAC_FLOW_CTRL / 4] = readl(ioaddr + MAC_FLOW_CTRL); -+ reg_space[MAC_VLAN1 / 4] = readl(ioaddr + MAC_VLAN1); -+ reg_space[MAC_VLAN2 / 4] = readl(ioaddr + MAC_VLAN2); - } - - static int dwmac100_rx_ipc_enable(struct mac_device_info *hw) ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c -@@ -18,10 +18,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -70,19 +66,18 @@ static void dwmac100_dma_operation_mode( - writel(csr6, ioaddr + DMA_CONTROL); - } - --static void dwmac100_dump_dma_regs(void __iomem *ioaddr) -+static void dwmac100_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space) - { - int i; - -- pr_debug("DWMAC 100 DMA CSR\n"); - for (i = 0; i < 9; i++) -- pr_debug("\t CSR%d (offset 0x%x): 0x%08x\n", i, -- (DMA_BUS_MODE + i * 4), -- readl(ioaddr + DMA_BUS_MODE + i * 4)); -- -- pr_debug("\tCSR20 (0x%x): 0x%08x, CSR21 (0x%x): 0x%08x\n", -- DMA_CUR_TX_BUF_ADDR, readl(ioaddr + DMA_CUR_TX_BUF_ADDR), -- DMA_CUR_RX_BUF_ADDR, readl(ioaddr + DMA_CUR_RX_BUF_ADDR)); -+ reg_space[DMA_BUS_MODE / 4 + i] = -+ readl(ioaddr + DMA_BUS_MODE + i * 4); -+ -+ reg_space[DMA_CUR_TX_BUF_ADDR / 4] = -+ readl(ioaddr + DMA_CUR_TX_BUF_ADDR); -+ reg_space[DMA_CUR_RX_BUF_ADDR / 4] = -+ readl(ioaddr + DMA_CUR_RX_BUF_ADDR); - } - - /* DMA controller has two counters to track the number of the missed frames. */ ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h -@@ -22,6 +22,7 @@ - #define GMAC_HASH_TAB_32_63 0x00000014 - #define GMAC_RX_FLOW_CTRL 0x00000090 - #define GMAC_QX_TX_FLOW_CTRL(x) (0x70 + x * 4) -+#define GMAC_RXQ_CTRL0 0x000000a0 - #define GMAC_INT_STATUS 0x000000b0 - #define GMAC_INT_EN 0x000000b4 - #define GMAC_PCS_BASE 0x000000e0 -@@ -44,6 +45,11 @@ - - #define GMAC_MAX_PERFECT_ADDRESSES 128 - -+/* MAC RX Queue Enable */ -+#define GMAC_RX_QUEUE_CLEAR(queue) ~(GENMASK(1, 0) << ((queue) * 2)) -+#define GMAC_RX_AV_QUEUE_ENABLE(queue) BIT((queue) * 2) -+#define GMAC_RX_DCB_QUEUE_ENABLE(queue) BIT(((queue) * 2) + 1) -+ - /* MAC Flow Control RX */ - #define GMAC_RX_FLOW_CTRL_RFE BIT(0) - -@@ -84,6 +90,19 @@ enum power_event { - power_down = 0x00000001, - }; - -+/* Energy Efficient Ethernet (EEE) for GMAC4 -+ * -+ * LPI status, timer and control register offset -+ */ -+#define GMAC4_LPI_CTRL_STATUS 0xd0 -+#define GMAC4_LPI_TIMER_CTRL 0xd4 -+ -+/* LPI control and status defines */ -+#define GMAC4_LPI_CTRL_STATUS_LPITCSE BIT(21) /* LPI Tx Clock Stop Enable */ -+#define GMAC4_LPI_CTRL_STATUS_LPITXA BIT(19) /* Enable LPI TX Automate */ -+#define GMAC4_LPI_CTRL_STATUS_PLS BIT(17) /* PHY Link Status */ -+#define GMAC4_LPI_CTRL_STATUS_LPIEN BIT(16) /* LPI Enable */ -+ - /* MAC Debug bitmap */ - #define GMAC_DEBUG_TFCSTS_MASK GENMASK(18, 17) - #define GMAC_DEBUG_TFCSTS_SHIFT 17 -@@ -133,6 +152,8 @@ enum power_event { - /* MAC HW features2 bitmap */ - #define GMAC_HW_FEAT_TXCHCNT GENMASK(21, 18) - #define GMAC_HW_FEAT_RXCHCNT GENMASK(15, 12) -+#define GMAC_HW_FEAT_TXQCNT GENMASK(9, 6) -+#define GMAC_HW_FEAT_RXQCNT GENMASK(3, 0) - - /* MAC HW ADDR regs */ - #define GMAC_HI_DCS GENMASK(18, 16) ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -@@ -59,19 +59,24 @@ static void dwmac4_core_init(struct mac_ - writel(value, ioaddr + GMAC_INT_EN); - } - --static void dwmac4_dump_regs(struct mac_device_info *hw) -+static void dwmac4_rx_queue_enable(struct mac_device_info *hw, u32 queue) - { - void __iomem *ioaddr = hw->pcsr; -- int i; -+ u32 value = readl(ioaddr + GMAC_RXQ_CTRL0); - -- pr_debug("\tDWMAC4 regs (base addr = 0x%p)\n", ioaddr); -+ value &= GMAC_RX_QUEUE_CLEAR(queue); -+ value |= GMAC_RX_AV_QUEUE_ENABLE(queue); - -- for (i = 0; i < GMAC_REG_NUM; i++) { -- int offset = i * 4; -+ writel(value, ioaddr + GMAC_RXQ_CTRL0); -+} - -- pr_debug("\tReg No. %d (offset 0x%x): 0x%08x\n", i, -- offset, readl(ioaddr + offset)); -- } -+static void dwmac4_dump_regs(struct mac_device_info *hw, u32 *reg_space) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ int i; -+ -+ for (i = 0; i < GMAC_REG_NUM; i++) -+ reg_space[i] = readl(ioaddr + i * 4); - } - - static int dwmac4_rx_ipc_enable(struct mac_device_info *hw) -@@ -126,6 +131,65 @@ static void dwmac4_get_umac_addr(struct - GMAC_ADDR_LOW(reg_n)); - } - -+static void dwmac4_set_eee_mode(struct mac_device_info *hw, -+ bool en_tx_lpi_clockgating) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value; -+ -+ /* Enable the link status receive on RGMII, SGMII ore SMII -+ * receive path and instruct the transmit to enter in LPI -+ * state. -+ */ -+ value = readl(ioaddr + GMAC4_LPI_CTRL_STATUS); -+ value |= GMAC4_LPI_CTRL_STATUS_LPIEN | GMAC4_LPI_CTRL_STATUS_LPITXA; -+ -+ if (en_tx_lpi_clockgating) -+ value |= GMAC4_LPI_CTRL_STATUS_LPITCSE; -+ -+ writel(value, ioaddr + GMAC4_LPI_CTRL_STATUS); -+} -+ -+static void dwmac4_reset_eee_mode(struct mac_device_info *hw) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value; -+ -+ value = readl(ioaddr + GMAC4_LPI_CTRL_STATUS); -+ value &= ~(GMAC4_LPI_CTRL_STATUS_LPIEN | GMAC4_LPI_CTRL_STATUS_LPITXA); -+ writel(value, ioaddr + GMAC4_LPI_CTRL_STATUS); -+} -+ -+static void dwmac4_set_eee_pls(struct mac_device_info *hw, int link) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value; -+ -+ value = readl(ioaddr + GMAC4_LPI_CTRL_STATUS); -+ -+ if (link) -+ value |= GMAC4_LPI_CTRL_STATUS_PLS; -+ else -+ value &= ~GMAC4_LPI_CTRL_STATUS_PLS; -+ -+ writel(value, ioaddr + GMAC4_LPI_CTRL_STATUS); -+} -+ -+static void dwmac4_set_eee_timer(struct mac_device_info *hw, int ls, int tw) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ int value = ((tw & 0xffff)) | ((ls & 0x3ff) << 16); -+ -+ /* Program the timers in the LPI timer control register: -+ * LS: minimum time (ms) for which the link -+ * status from PHY should be ok before transmitting -+ * the LPI pattern. -+ * TW: minimum time (us) for which the core waits -+ * after it has stopped transmitting the LPI pattern. -+ */ -+ writel(value, ioaddr + GMAC4_LPI_TIMER_CTRL); -+} -+ - static void dwmac4_set_filter(struct mac_device_info *hw, - struct net_device *dev) - { -@@ -392,12 +456,17 @@ static void dwmac4_debug(void __iomem *i - static const struct stmmac_ops dwmac4_ops = { - .core_init = dwmac4_core_init, - .rx_ipc = dwmac4_rx_ipc_enable, -+ .rx_queue_enable = dwmac4_rx_queue_enable, - .dump_regs = dwmac4_dump_regs, - .host_irq_status = dwmac4_irq_status, - .flow_ctrl = dwmac4_flow_ctrl, - .pmt = dwmac4_pmt, - .set_umac_addr = dwmac4_set_umac_addr, - .get_umac_addr = dwmac4_get_umac_addr, -+ .set_eee_mode = dwmac4_set_eee_mode, -+ .reset_eee_mode = dwmac4_reset_eee_mode, -+ .set_eee_timer = dwmac4_set_eee_timer, -+ .set_eee_pls = dwmac4_set_eee_pls, - .pcs_ctrl_ane = dwmac4_ctrl_ane, - .pcs_rane = dwmac4_rane, - .pcs_get_adv_lp = dwmac4_get_adv_lp, ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c -@@ -103,7 +103,7 @@ static int dwmac4_wrback_get_rx_status(v - x->rx_mii++; - - if (unlikely(rdes3 & RDES3_CRC_ERROR)) { -- x->rx_crc++; -+ x->rx_crc_errors++; - stats->rx_crc_errors++; - } - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -@@ -127,53 +127,51 @@ static void dwmac4_dma_init(void __iomem - dwmac4_dma_init_channel(ioaddr, dma_cfg, dma_tx, dma_rx, i); - } - --static void _dwmac4_dump_dma_regs(void __iomem *ioaddr, u32 channel) -+static void _dwmac4_dump_dma_regs(void __iomem *ioaddr, u32 channel, -+ u32 *reg_space) - { -- pr_debug(" Channel %d\n", channel); -- pr_debug("\tDMA_CHAN_CONTROL, offset: 0x%x, val: 0x%x\n", 0, -- readl(ioaddr + DMA_CHAN_CONTROL(channel))); -- pr_debug("\tDMA_CHAN_TX_CONTROL, offset: 0x%x, val: 0x%x\n", 0x4, -- readl(ioaddr + DMA_CHAN_TX_CONTROL(channel))); -- pr_debug("\tDMA_CHAN_RX_CONTROL, offset: 0x%x, val: 0x%x\n", 0x8, -- readl(ioaddr + DMA_CHAN_RX_CONTROL(channel))); -- pr_debug("\tDMA_CHAN_TX_BASE_ADDR, offset: 0x%x, val: 0x%x\n", 0x14, -- readl(ioaddr + DMA_CHAN_TX_BASE_ADDR(channel))); -- pr_debug("\tDMA_CHAN_RX_BASE_ADDR, offset: 0x%x, val: 0x%x\n", 0x1c, -- readl(ioaddr + DMA_CHAN_RX_BASE_ADDR(channel))); -- pr_debug("\tDMA_CHAN_TX_END_ADDR, offset: 0x%x, val: 0x%x\n", 0x20, -- readl(ioaddr + DMA_CHAN_TX_END_ADDR(channel))); -- pr_debug("\tDMA_CHAN_RX_END_ADDR, offset: 0x%x, val: 0x%x\n", 0x28, -- readl(ioaddr + DMA_CHAN_RX_END_ADDR(channel))); -- pr_debug("\tDMA_CHAN_TX_RING_LEN, offset: 0x%x, val: 0x%x\n", 0x2c, -- readl(ioaddr + DMA_CHAN_TX_RING_LEN(channel))); -- pr_debug("\tDMA_CHAN_RX_RING_LEN, offset: 0x%x, val: 0x%x\n", 0x30, -- readl(ioaddr + DMA_CHAN_RX_RING_LEN(channel))); -- pr_debug("\tDMA_CHAN_INTR_ENA, offset: 0x%x, val: 0x%x\n", 0x34, -- readl(ioaddr + DMA_CHAN_INTR_ENA(channel))); -- pr_debug("\tDMA_CHAN_RX_WATCHDOG, offset: 0x%x, val: 0x%x\n", 0x38, -- readl(ioaddr + DMA_CHAN_RX_WATCHDOG(channel))); -- pr_debug("\tDMA_CHAN_SLOT_CTRL_STATUS, offset: 0x%x, val: 0x%x\n", 0x3c, -- readl(ioaddr + DMA_CHAN_SLOT_CTRL_STATUS(channel))); -- pr_debug("\tDMA_CHAN_CUR_TX_DESC, offset: 0x%x, val: 0x%x\n", 0x44, -- readl(ioaddr + DMA_CHAN_CUR_TX_DESC(channel))); -- pr_debug("\tDMA_CHAN_CUR_RX_DESC, offset: 0x%x, val: 0x%x\n", 0x4c, -- readl(ioaddr + DMA_CHAN_CUR_RX_DESC(channel))); -- pr_debug("\tDMA_CHAN_CUR_TX_BUF_ADDR, offset: 0x%x, val: 0x%x\n", 0x54, -- readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR(channel))); -- pr_debug("\tDMA_CHAN_CUR_RX_BUF_ADDR, offset: 0x%x, val: 0x%x\n", 0x5c, -- readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR(channel))); -- pr_debug("\tDMA_CHAN_STATUS, offset: 0x%x, val: 0x%x\n", 0x60, -- readl(ioaddr + DMA_CHAN_STATUS(channel))); -+ reg_space[DMA_CHAN_CONTROL(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_CONTROL(channel)); -+ reg_space[DMA_CHAN_TX_CONTROL(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_TX_CONTROL(channel)); -+ reg_space[DMA_CHAN_RX_CONTROL(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_RX_CONTROL(channel)); -+ reg_space[DMA_CHAN_TX_BASE_ADDR(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_TX_BASE_ADDR(channel)); -+ reg_space[DMA_CHAN_RX_BASE_ADDR(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_RX_BASE_ADDR(channel)); -+ reg_space[DMA_CHAN_TX_END_ADDR(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_TX_END_ADDR(channel)); -+ reg_space[DMA_CHAN_RX_END_ADDR(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_RX_END_ADDR(channel)); -+ reg_space[DMA_CHAN_TX_RING_LEN(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_TX_RING_LEN(channel)); -+ reg_space[DMA_CHAN_RX_RING_LEN(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_RX_RING_LEN(channel)); -+ reg_space[DMA_CHAN_INTR_ENA(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_INTR_ENA(channel)); -+ reg_space[DMA_CHAN_RX_WATCHDOG(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_RX_WATCHDOG(channel)); -+ reg_space[DMA_CHAN_SLOT_CTRL_STATUS(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_SLOT_CTRL_STATUS(channel)); -+ reg_space[DMA_CHAN_CUR_TX_DESC(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_CUR_TX_DESC(channel)); -+ reg_space[DMA_CHAN_CUR_RX_DESC(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_CUR_RX_DESC(channel)); -+ reg_space[DMA_CHAN_CUR_TX_BUF_ADDR(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_CUR_TX_BUF_ADDR(channel)); -+ reg_space[DMA_CHAN_CUR_RX_BUF_ADDR(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_CUR_RX_BUF_ADDR(channel)); -+ reg_space[DMA_CHAN_STATUS(channel) / 4] = -+ readl(ioaddr + DMA_CHAN_STATUS(channel)); - } - --static void dwmac4_dump_dma_regs(void __iomem *ioaddr) -+static void dwmac4_dump_dma_regs(void __iomem *ioaddr, u32 *reg_space) - { - int i; - -- pr_debug(" GMAC4 DMA registers\n"); -- - for (i = 0; i < DMA_CHANNEL_NB_MAX; i++) -- _dwmac4_dump_dma_regs(ioaddr, i); -+ _dwmac4_dump_dma_regs(ioaddr, i, reg_space); - } - - static void dwmac4_rx_watchdog(void __iomem *ioaddr, u32 riwt) -@@ -303,6 +301,11 @@ static void dwmac4_get_hw_feature(void _ - ((hw_cap & GMAC_HW_FEAT_RXCHCNT) >> 12) + 1; - dma_cap->number_tx_channel = - ((hw_cap & GMAC_HW_FEAT_TXCHCNT) >> 18) + 1; -+ /* TX and RX number of queues */ -+ dma_cap->number_rx_queues = -+ ((hw_cap & GMAC_HW_FEAT_RXQCNT) >> 0) + 1; -+ dma_cap->number_tx_queues = -+ ((hw_cap & GMAC_HW_FEAT_TXQCNT) >> 6) + 1; - - /* IEEE 1588-2002 */ - dma_cap->time_stamp = 0; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c -@@ -10,10 +10,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -21,6 +17,7 @@ - *******************************************************************************/ - - #include -+#include - #include "common.h" - #include "dwmac_dma.h" - -@@ -29,19 +26,16 @@ - int dwmac_dma_reset(void __iomem *ioaddr) - { - u32 value = readl(ioaddr + DMA_BUS_MODE); -- int limit; -+ int err; - - /* DMA SW reset */ - value |= DMA_BUS_MODE_SFT_RESET; - writel(value, ioaddr + DMA_BUS_MODE); -- limit = 10; -- while (limit--) { -- if (!(readl(ioaddr + DMA_BUS_MODE) & DMA_BUS_MODE_SFT_RESET)) -- break; -- mdelay(10); -- } - -- if (limit < 0) -+ err = readl_poll_timeout(ioaddr + DMA_BUS_MODE, value, -+ !(value & DMA_BUS_MODE_SFT_RESET), -+ 100000, 10000); -+ if (err) - return -EBUSY; - - return 0; -@@ -102,7 +96,7 @@ static void show_tx_process_state(unsign - pr_debug("- TX (Stopped): Reset or Stop command\n"); - break; - case 1: -- pr_debug("- TX (Running):Fetching the Tx desc\n"); -+ pr_debug("- TX (Running): Fetching the Tx desc\n"); - break; - case 2: - pr_debug("- TX (Running): Waiting for end of tx\n"); -@@ -136,7 +130,7 @@ static void show_rx_process_state(unsign - pr_debug("- RX (Running): Fetching the Rx desc\n"); - break; - case 2: -- pr_debug("- RX (Running):Checking for end of pkt\n"); -+ pr_debug("- RX (Running): Checking for end of pkt\n"); - break; - case 3: - pr_debug("- RX (Running): Waiting for Rx pkt\n"); -@@ -246,7 +240,7 @@ void stmmac_set_mac_addr(void __iomem *i - unsigned long data; - - data = (addr[5] << 8) | addr[4]; -- /* For MAC Addr registers se have to set the Address Enable (AE) -+ /* For MAC Addr registers we have to set the Address Enable (AE) - * bit that has no effect on the High Reg 0 where the bit 31 (MO) - * is RO. - */ -@@ -261,9 +255,9 @@ void stmmac_set_mac(void __iomem *ioaddr - u32 value = readl(ioaddr + MAC_CTRL_REG); - - if (enable) -- value |= MAC_RNABLE_RX | MAC_ENABLE_TX; -+ value |= MAC_ENABLE_RX | MAC_ENABLE_TX; - else -- value &= ~(MAC_ENABLE_TX | MAC_RNABLE_RX); -+ value &= ~(MAC_ENABLE_TX | MAC_ENABLE_RX); - - writel(value, ioaddr + MAC_CTRL_REG); - } ---- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c -+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -225,7 +221,7 @@ static int enh_desc_get_rx_status(void * - x->rx_mii++; - - if (unlikely(rdes0 & RDES0_CRC_ERROR)) { -- x->rx_crc++; -+ x->rx_crc_errors++; - stats->rx_crc_errors++; - } - ret = discard_frame; ---- a/drivers/net/ethernet/stmicro/stmmac/mmc.h -+++ b/drivers/net/ethernet/stmicro/stmmac/mmc.h -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/mmc_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/mmc_core.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c -+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -115,7 +111,7 @@ static int ndesc_get_rx_status(void *dat - stats->collisions++; - } - if (unlikely(rdes0 & RDES0_CRC_ERROR)) { -- x->rx_crc++; -+ x->rx_crc_errors++; - stats->rx_crc_errors++; - } - ret = discard_frame; ---- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c -+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c -@@ -16,10 +16,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h -@@ -10,10 +10,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -106,9 +102,6 @@ struct stmmac_priv { - u32 msg_enable; - int wolopts; - int wol_irq; -- struct clk *stmmac_clk; -- struct clk *pclk; -- struct reset_control *stmmac_rst; - int clk_csr; - struct timer_list eee_ctrl_timer; - int lpi_irq; -@@ -120,8 +113,6 @@ struct stmmac_priv { - struct ptp_clock *ptp_clock; - struct ptp_clock_info ptp_clock_ops; - unsigned int default_addend; -- struct clk *clk_ptp_ref; -- unsigned int clk_ptp_rate; - u32 adv_ts; - int use_riwt; - int irq_wake; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -65,7 +61,7 @@ static const struct stmmac_stats stmmac_ - STMMAC_STAT(overflow_error), - STMMAC_STAT(ipc_csum_error), - STMMAC_STAT(rx_collision), -- STMMAC_STAT(rx_crc), -+ STMMAC_STAT(rx_crc_errors), - STMMAC_STAT(dribbling_bit), - STMMAC_STAT(rx_length), - STMMAC_STAT(rx_mii), -@@ -439,32 +435,14 @@ static int stmmac_ethtool_get_regs_len(s - static void stmmac_ethtool_gregs(struct net_device *dev, - struct ethtool_regs *regs, void *space) - { -- int i; - u32 *reg_space = (u32 *) space; - - struct stmmac_priv *priv = netdev_priv(dev); - - memset(reg_space, 0x0, REG_SPACE_SIZE); - -- if (!(priv->plat->has_gmac || priv->plat->has_gmac4)) { -- /* MAC registers */ -- for (i = 0; i < 12; i++) -- reg_space[i] = readl(priv->ioaddr + (i * 4)); -- /* DMA registers */ -- for (i = 0; i < 9; i++) -- reg_space[i + 12] = -- readl(priv->ioaddr + (DMA_BUS_MODE + (i * 4))); -- reg_space[22] = readl(priv->ioaddr + DMA_CUR_TX_BUF_ADDR); -- reg_space[23] = readl(priv->ioaddr + DMA_CUR_RX_BUF_ADDR); -- } else { -- /* MAC registers */ -- for (i = 0; i < 55; i++) -- reg_space[i] = readl(priv->ioaddr + (i * 4)); -- /* DMA registers */ -- for (i = 0; i < 22; i++) -- reg_space[i + 55] = -- readl(priv->ioaddr + (DMA_BUS_MODE + (i * 4))); -- } -+ priv->hw->mac->dump_regs(priv->hw, reg_space); -+ priv->hw->dma->dump_regs(priv->ioaddr, reg_space); - } - - static void -@@ -712,7 +690,7 @@ static int stmmac_ethtool_op_set_eee(str - - static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv) - { -- unsigned long clk = clk_get_rate(priv->stmmac_clk); -+ unsigned long clk = clk_get_rate(priv->plat->stmmac_clk); - - if (!clk) - return 0; -@@ -722,7 +700,7 @@ static u32 stmmac_usec2riwt(u32 usec, st - - static u32 stmmac_riwt2usec(u32 riwt, struct stmmac_priv *priv) - { -- unsigned long clk = clk_get_rate(priv->stmmac_clk); -+ unsigned long clk = clk_get_rate(priv->plat->stmmac_clk); - - if (!clk) - return 0; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -13,10 +13,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -158,7 +154,7 @@ static void stmmac_clk_csr_set(struct st - { - u32 clk_rate; - -- clk_rate = clk_get_rate(priv->stmmac_clk); -+ clk_rate = clk_get_rate(priv->plat->stmmac_clk); - - /* Platform provided default clk_csr would be assumed valid - * for all other cases except for the below mentioned ones. -@@ -191,7 +187,7 @@ static void print_pkt(unsigned char *buf - - static inline u32 stmmac_tx_avail(struct stmmac_priv *priv) - { -- unsigned avail; -+ u32 avail; - - if (priv->dirty_tx > priv->cur_tx) - avail = priv->dirty_tx - priv->cur_tx - 1; -@@ -203,7 +199,7 @@ static inline u32 stmmac_tx_avail(struct - - static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv) - { -- unsigned dirty; -+ u32 dirty; - - if (priv->dirty_rx <= priv->cur_rx) - dirty = priv->cur_rx - priv->dirty_rx; -@@ -216,7 +212,7 @@ static inline u32 stmmac_rx_dirty(struct - /** - * stmmac_hw_fix_mac_speed - callback for speed selection - * @priv: driver private structure -- * Description: on some platforms (e.g. ST), some HW system configuraton -+ * Description: on some platforms (e.g. ST), some HW system configuration - * registers have to be set according to the link speed negotiated. - */ - static inline void stmmac_hw_fix_mac_speed(struct stmmac_priv *priv) -@@ -239,7 +235,8 @@ static void stmmac_enable_eee_mode(struc - /* Check and enter in LPI mode */ - if ((priv->dirty_tx == priv->cur_tx) && - (priv->tx_path_in_lpi_mode == false)) -- priv->hw->mac->set_eee_mode(priv->hw); -+ priv->hw->mac->set_eee_mode(priv->hw, -+ priv->plat->en_tx_lpi_clockgating); - } - - /** -@@ -421,7 +418,7 @@ static void stmmac_get_rx_hwtstamp(struc - /** - * stmmac_hwtstamp_ioctl - control hardware timestamping. - * @dev: device pointer. -- * @ifr: An IOCTL specefic structure, that can contain a pointer to -+ * @ifr: An IOCTL specific structure, that can contain a pointer to - * a proprietary structure used to pass information to the driver. - * Description: - * This function configures the MAC to enable/disable both outgoing(TX) -@@ -621,7 +618,7 @@ static int stmmac_hwtstamp_ioctl(struct - - /* program Sub Second Increment reg */ - sec_inc = priv->hw->ptp->config_sub_second_increment( -- priv->ptpaddr, priv->clk_ptp_rate, -+ priv->ptpaddr, priv->plat->clk_ptp_rate, - priv->plat->has_gmac4); - temp = div_u64(1000000000ULL, sec_inc); - -@@ -631,7 +628,7 @@ static int stmmac_hwtstamp_ioctl(struct - * where, freq_div_ratio = 1e9ns/sec_inc - */ - temp = (u64)(temp << 32); -- priv->default_addend = div_u64(temp, priv->clk_ptp_rate); -+ priv->default_addend = div_u64(temp, priv->plat->clk_ptp_rate); - priv->hw->ptp->config_addend(priv->ptpaddr, - priv->default_addend); - -@@ -659,18 +656,6 @@ static int stmmac_init_ptp(struct stmmac - if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) - return -EOPNOTSUPP; - -- /* Fall-back to main clock in case of no PTP ref is passed */ -- priv->clk_ptp_ref = devm_clk_get(priv->device, "clk_ptp_ref"); -- if (IS_ERR(priv->clk_ptp_ref)) { -- priv->clk_ptp_rate = clk_get_rate(priv->stmmac_clk); -- priv->clk_ptp_ref = NULL; -- netdev_dbg(priv->dev, "PTP uses main clock\n"); -- } else { -- clk_prepare_enable(priv->clk_ptp_ref); -- priv->clk_ptp_rate = clk_get_rate(priv->clk_ptp_ref); -- netdev_dbg(priv->dev, "PTP rate %d\n", priv->clk_ptp_rate); -- } -- - priv->adv_ts = 0; - /* Check if adv_ts can be enabled for dwmac 4.x core */ - if (priv->plat->has_gmac4 && priv->dma_cap.atime_stamp) -@@ -697,8 +682,8 @@ static int stmmac_init_ptp(struct stmmac - - static void stmmac_release_ptp(struct stmmac_priv *priv) - { -- if (priv->clk_ptp_ref) -- clk_disable_unprepare(priv->clk_ptp_ref); -+ if (priv->plat->clk_ptp_ref) -+ clk_disable_unprepare(priv->plat->clk_ptp_ref); - stmmac_ptp_unregister(priv); - } - -@@ -719,7 +704,7 @@ static void stmmac_adjust_link(struct ne - int new_state = 0; - unsigned int fc = priv->flow_ctrl, pause_time = priv->pause; - -- if (phydev == NULL) -+ if (!phydev) - return; - - spin_lock_irqsave(&priv->lock, flags); -@@ -746,33 +731,36 @@ static void stmmac_adjust_link(struct ne - new_state = 1; - switch (phydev->speed) { - case 1000: -- if (likely((priv->plat->has_gmac) || -- (priv->plat->has_gmac4))) -+ if (priv->plat->has_gmac || -+ priv->plat->has_gmac4) - ctrl &= ~priv->hw->link.port; -- stmmac_hw_fix_mac_speed(priv); - break; - case 100: -+ if (priv->plat->has_gmac || -+ priv->plat->has_gmac4) { -+ ctrl |= priv->hw->link.port; -+ ctrl |= priv->hw->link.speed; -+ } else { -+ ctrl &= ~priv->hw->link.port; -+ } -+ break; - case 10: -- if (likely((priv->plat->has_gmac) || -- (priv->plat->has_gmac4))) { -+ if (priv->plat->has_gmac || -+ priv->plat->has_gmac4) { - ctrl |= priv->hw->link.port; -- if (phydev->speed == SPEED_100) { -- ctrl |= priv->hw->link.speed; -- } else { -- ctrl &= ~(priv->hw->link.speed); -- } -+ ctrl &= ~(priv->hw->link.speed); - } else { - ctrl &= ~priv->hw->link.port; - } -- stmmac_hw_fix_mac_speed(priv); - break; - default: - netif_warn(priv, link, priv->dev, -- "Speed (%d) not 10/100\n", -- phydev->speed); -+ "broken speed: %d\n", phydev->speed); -+ phydev->speed = SPEED_UNKNOWN; - break; - } -- -+ if (phydev->speed != SPEED_UNKNOWN) -+ stmmac_hw_fix_mac_speed(priv); - priv->speed = phydev->speed; - } - -@@ -785,8 +773,8 @@ static void stmmac_adjust_link(struct ne - } else if (priv->oldlink) { - new_state = 1; - priv->oldlink = 0; -- priv->speed = 0; -- priv->oldduplex = -1; -+ priv->speed = SPEED_UNKNOWN; -+ priv->oldduplex = DUPLEX_UNKNOWN; - } - - if (new_state && netif_msg_link(priv)) -@@ -848,8 +836,8 @@ static int stmmac_init_phy(struct net_de - int interface = priv->plat->interface; - int max_speed = priv->plat->max_speed; - priv->oldlink = 0; -- priv->speed = 0; -- priv->oldduplex = -1; -+ priv->speed = SPEED_UNKNOWN; -+ priv->oldduplex = DUPLEX_UNKNOWN; - - if (priv->plat->phy_node) { - phydev = of_phy_connect(dev, priv->plat->phy_node, -@@ -901,9 +889,7 @@ static int stmmac_init_phy(struct net_de - if (phydev->is_pseudo_fixed_link) - phydev->irq = PHY_POLL; - -- netdev_dbg(priv->dev, "%s: attached to PHY (UID 0x%x) Link = %d\n", -- __func__, phydev->phy_id, phydev->link); -- -+ phy_attached_info(phydev); - return 0; - } - -@@ -1029,7 +1015,7 @@ static void stmmac_free_rx_buffers(struc - * @dev: net device structure - * @flags: gfp flag. - * Description: this function initializes the DMA RX/TX descriptors -- * and allocates the socket buffers. It suppors the chained and ring -+ * and allocates the socket buffers. It supports the chained and ring - * modes. - */ - static int init_dma_desc_rings(struct net_device *dev, gfp_t flags) -@@ -1142,13 +1128,6 @@ static void dma_free_tx_skbufs(struct st - int i; - - for (i = 0; i < DMA_TX_SIZE; i++) { -- struct dma_desc *p; -- -- if (priv->extend_desc) -- p = &((priv->dma_etx + i)->basic); -- else -- p = priv->dma_tx + i; -- - if (priv->tx_skbuff_dma[i].buf) { - if (priv->tx_skbuff_dma[i].map_as_page) - dma_unmap_page(priv->device, -@@ -1162,7 +1141,7 @@ static void dma_free_tx_skbufs(struct st - DMA_TO_DEVICE); - } - -- if (priv->tx_skbuff[i] != NULL) { -+ if (priv->tx_skbuff[i]) { - dev_kfree_skb_any(priv->tx_skbuff[i]); - priv->tx_skbuff[i] = NULL; - priv->tx_skbuff_dma[i].buf = 0; -@@ -1286,6 +1265,28 @@ static void free_dma_desc_resources(stru - } - - /** -+ * stmmac_mac_enable_rx_queues - Enable MAC rx queues -+ * @priv: driver private structure -+ * Description: It is used for enabling the rx queues in the MAC -+ */ -+static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) -+{ -+ int rx_count = priv->dma_cap.number_rx_queues; -+ int queue = 0; -+ -+ /* If GMAC does not have multiple queues, then this is not necessary*/ -+ if (rx_count == 1) -+ return; -+ -+ /** -+ * If the core is synthesized with multiple rx queues / multiple -+ * dma channels, then rx queues will be disabled by default. -+ * For now only rx queue 0 is enabled. -+ */ -+ priv->hw->mac->rx_queue_enable(priv->hw, queue); -+} -+ -+/** - * stmmac_dma_operation_mode - HW DMA operation mode - * @priv: driver private structure - * Description: it is used for configuring the DMA operation mode register in -@@ -1691,10 +1692,6 @@ static int stmmac_hw_setup(struct net_de - /* Copy the MAC addr into the HW */ - priv->hw->mac->set_umac_addr(priv->hw, dev->dev_addr, 0); - -- /* If required, perform hw setup of the bus. */ -- if (priv->plat->bus_setup) -- priv->plat->bus_setup(priv->ioaddr); -- - /* PS and related bits will be programmed according to the speed */ - if (priv->hw->pcs) { - int speed = priv->plat->mac_port_sel_speed; -@@ -1711,6 +1708,10 @@ static int stmmac_hw_setup(struct net_de - /* Initialize the MAC Core */ - priv->hw->mac->core_init(priv->hw, dev->mtu); - -+ /* Initialize MAC RX Queues */ -+ if (priv->hw->mac->rx_queue_enable) -+ stmmac_mac_enable_rx_queues(priv); -+ - ret = priv->hw->mac->rx_ipc(priv->hw); - if (!ret) { - netdev_warn(priv->dev, "RX IPC Checksum Offload disabled\n"); -@@ -1731,8 +1732,10 @@ static int stmmac_hw_setup(struct net_de - - if (init_ptp) { - ret = stmmac_init_ptp(priv); -- if (ret) -- netdev_warn(priv->dev, "fail to init PTP.\n"); -+ if (ret == -EOPNOTSUPP) -+ netdev_warn(priv->dev, "PTP not supported by HW\n"); -+ else if (ret) -+ netdev_warn(priv->dev, "PTP init failed\n"); - } - - #ifdef CONFIG_DEBUG_FS -@@ -1746,11 +1749,6 @@ static int stmmac_hw_setup(struct net_de - priv->hw->dma->start_tx(priv->ioaddr); - priv->hw->dma->start_rx(priv->ioaddr); - -- /* Dump DMA/MAC registers */ -- if (netif_msg_hw(priv)) { -- priv->hw->mac->dump_regs(priv->hw); -- priv->hw->dma->dump_regs(priv->ioaddr); -- } - priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; - - if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) { -@@ -2547,7 +2545,7 @@ static int stmmac_rx(struct stmmac_priv - if (unlikely(status == discard_frame)) { - priv->dev->stats.rx_errors++; - if (priv->hwts_rx_en && !priv->extend_desc) { -- /* DESC2 & DESC3 will be overwitten by device -+ /* DESC2 & DESC3 will be overwritten by device - * with timestamp value, hence reinitialize - * them in stmmac_rx_refill() function so that - * device can reuse it. -@@ -2570,7 +2568,7 @@ static int stmmac_rx(struct stmmac_priv - - frame_len = priv->hw->desc->get_rx_frame_len(p, coe); - -- /* If frame length is greather than skb buffer size -+ /* If frame length is greater than skb buffer size - * (preallocated during init) then the packet is - * ignored - */ -@@ -2790,7 +2788,7 @@ static netdev_features_t stmmac_fix_feat - /* Some GMAC devices have a bugged Jumbo frame support that - * needs to have the Tx COE disabled for oversized frames - * (due to limited buffer sizes). In this case we disable -- * the TX csum insertionin the TDES and not use SF. -+ * the TX csum insertion in the TDES and not use SF. - */ - if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) - features &= ~NETIF_F_CSUM_MASK; -@@ -2936,9 +2934,7 @@ static void sysfs_display_ring(void *hea - struct dma_desc *p = (struct dma_desc *)head; - - for (i = 0; i < size; i++) { -- u64 x; - if (extend_desc) { -- x = *(u64 *) ep; - seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", - i, (unsigned int)virt_to_phys(ep), - le32_to_cpu(ep->basic.des0), -@@ -2947,7 +2943,6 @@ static void sysfs_display_ring(void *hea - le32_to_cpu(ep->basic.des3)); - ep++; - } else { -- x = *(u64 *) p; - seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", - i, (unsigned int)virt_to_phys(ep), - le32_to_cpu(p->des0), le32_to_cpu(p->des1), -@@ -3017,7 +3012,7 @@ static int stmmac_sysfs_dma_cap_read(str - (priv->dma_cap.hash_filter) ? "Y" : "N"); - seq_printf(seq, "\tMultiple MAC address registers: %s\n", - (priv->dma_cap.multi_addr) ? "Y" : "N"); -- seq_printf(seq, "\tPCS (TBI/SGMII/RTBI PHY interfatces): %s\n", -+ seq_printf(seq, "\tPCS (TBI/SGMII/RTBI PHY interfaces): %s\n", - (priv->dma_cap.pcs) ? "Y" : "N"); - seq_printf(seq, "\tSMA (MDIO) Interface: %s\n", - (priv->dma_cap.sma_mdio) ? "Y" : "N"); -@@ -3293,44 +3288,8 @@ int stmmac_dvr_probe(struct device *devi - if ((phyaddr >= 0) && (phyaddr <= 31)) - priv->plat->phy_addr = phyaddr; - -- priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME); -- if (IS_ERR(priv->stmmac_clk)) { -- netdev_warn(priv->dev, "%s: warning: cannot get CSR clock\n", -- __func__); -- /* If failed to obtain stmmac_clk and specific clk_csr value -- * is NOT passed from the platform, probe fail. -- */ -- if (!priv->plat->clk_csr) { -- ret = PTR_ERR(priv->stmmac_clk); -- goto error_clk_get; -- } else { -- priv->stmmac_clk = NULL; -- } -- } -- clk_prepare_enable(priv->stmmac_clk); -- -- priv->pclk = devm_clk_get(priv->device, "pclk"); -- if (IS_ERR(priv->pclk)) { -- if (PTR_ERR(priv->pclk) == -EPROBE_DEFER) { -- ret = -EPROBE_DEFER; -- goto error_pclk_get; -- } -- priv->pclk = NULL; -- } -- clk_prepare_enable(priv->pclk); -- -- priv->stmmac_rst = devm_reset_control_get(priv->device, -- STMMAC_RESOURCE_NAME); -- if (IS_ERR(priv->stmmac_rst)) { -- if (PTR_ERR(priv->stmmac_rst) == -EPROBE_DEFER) { -- ret = -EPROBE_DEFER; -- goto error_hw_init; -- } -- dev_info(priv->device, "no reset control found\n"); -- priv->stmmac_rst = NULL; -- } -- if (priv->stmmac_rst) -- reset_control_deassert(priv->stmmac_rst); -+ if (priv->plat->stmmac_rst) -+ reset_control_deassert(priv->plat->stmmac_rst); - - /* Init MAC and get the capabilities */ - ret = stmmac_hw_init(priv); -@@ -3416,10 +3375,6 @@ error_netdev_register: - error_mdio_register: - netif_napi_del(&priv->napi); - error_hw_init: -- clk_disable_unprepare(priv->pclk); --error_pclk_get: -- clk_disable_unprepare(priv->stmmac_clk); --error_clk_get: - free_netdev(ndev); - - return ret; -@@ -3445,10 +3400,10 @@ int stmmac_dvr_remove(struct device *dev - stmmac_set_mac(priv->ioaddr, false); - netif_carrier_off(ndev); - unregister_netdev(ndev); -- if (priv->stmmac_rst) -- reset_control_assert(priv->stmmac_rst); -- clk_disable_unprepare(priv->pclk); -- clk_disable_unprepare(priv->stmmac_clk); -+ if (priv->plat->stmmac_rst) -+ reset_control_assert(priv->plat->stmmac_rst); -+ clk_disable_unprepare(priv->plat->pclk); -+ clk_disable_unprepare(priv->plat->stmmac_clk); - if (priv->hw->pcs != STMMAC_PCS_RGMII && - priv->hw->pcs != STMMAC_PCS_TBI && - priv->hw->pcs != STMMAC_PCS_RTBI) -@@ -3497,14 +3452,14 @@ int stmmac_suspend(struct device *dev) - stmmac_set_mac(priv->ioaddr, false); - pinctrl_pm_select_sleep_state(priv->device); - /* Disable clock in case of PWM is off */ -- clk_disable(priv->pclk); -- clk_disable(priv->stmmac_clk); -+ clk_disable(priv->plat->pclk); -+ clk_disable(priv->plat->stmmac_clk); - } - spin_unlock_irqrestore(&priv->lock, flags); - - priv->oldlink = 0; -- priv->speed = 0; -- priv->oldduplex = -1; -+ priv->speed = SPEED_UNKNOWN; -+ priv->oldduplex = DUPLEX_UNKNOWN; - return 0; - } - EXPORT_SYMBOL_GPL(stmmac_suspend); -@@ -3537,9 +3492,9 @@ int stmmac_resume(struct device *dev) - priv->irq_wake = 0; - } else { - pinctrl_pm_select_default_state(priv->device); -- /* enable the clk prevously disabled */ -- clk_enable(priv->stmmac_clk); -- clk_enable(priv->pclk); -+ /* enable the clk previously disabled */ -+ clk_enable(priv->plat->stmmac_clk); -+ clk_enable(priv->plat->pclk); - /* reset the phy so that it's ready */ - if (priv->mii) - stmmac_mdio_reset(priv->mii); ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c -@@ -13,10 +13,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -24,13 +20,14 @@ - Maintainer: Giuseppe Cavallaro - *******************************************************************************/ - -+#include -+#include - #include --#include --#include - #include - #include - #include --#include -+#include -+#include - - #include "stmmac.h" - -@@ -42,22 +39,6 @@ - #define MII_GMAC4_WRITE (1 << MII_GMAC4_GOC_SHIFT) - #define MII_GMAC4_READ (3 << MII_GMAC4_GOC_SHIFT) - --static int stmmac_mdio_busy_wait(void __iomem *ioaddr, unsigned int mii_addr) --{ -- unsigned long curr; -- unsigned long finish = jiffies + 3 * HZ; -- -- do { -- curr = jiffies; -- if (readl(ioaddr + mii_addr) & MII_BUSY) -- cpu_relax(); -- else -- return 0; -- } while (!time_after_eq(curr, finish)); -- -- return -EBUSY; --} -- - /** - * stmmac_mdio_read - * @bus: points to the mii_bus structure -@@ -74,7 +55,7 @@ static int stmmac_mdio_read(struct mii_b - struct stmmac_priv *priv = netdev_priv(ndev); - unsigned int mii_address = priv->hw->mii.addr; - unsigned int mii_data = priv->hw->mii.data; -- -+ u32 v; - int data; - u32 value = MII_BUSY; - -@@ -86,12 +67,14 @@ static int stmmac_mdio_read(struct mii_b - if (priv->plat->has_gmac4) - value |= MII_GMAC4_READ; - -- if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -+ if (readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY), -+ 100, 10000)) - return -EBUSY; - - writel(value, priv->ioaddr + mii_address); - -- if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -+ if (readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY), -+ 100, 10000)) - return -EBUSY; - - /* Read the data from the MII data register */ -@@ -115,7 +98,7 @@ static int stmmac_mdio_write(struct mii_ - struct stmmac_priv *priv = netdev_priv(ndev); - unsigned int mii_address = priv->hw->mii.addr; - unsigned int mii_data = priv->hw->mii.data; -- -+ u32 v; - u32 value = MII_BUSY; - - value |= (phyaddr << priv->hw->mii.addr_shift) -@@ -130,7 +113,8 @@ static int stmmac_mdio_write(struct mii_ - value |= MII_WRITE; - - /* Wait until any existing MII operation is complete */ -- if (stmmac_mdio_busy_wait(priv->ioaddr, mii_address)) -+ if (readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY), -+ 100, 10000)) - return -EBUSY; - - /* Set the MII address register to write */ -@@ -138,7 +122,8 @@ static int stmmac_mdio_write(struct mii_ - writel(value, priv->ioaddr + mii_address); - - /* Wait until any existing MII operation is complete */ -- return stmmac_mdio_busy_wait(priv->ioaddr, mii_address); -+ return readl_poll_timeout(priv->ioaddr + mii_address, v, !(v & MII_BUSY), -+ 100, 10000); - } - - /** -@@ -156,9 +141,9 @@ int stmmac_mdio_reset(struct mii_bus *bu - - #ifdef CONFIG_OF - if (priv->device->of_node) { -- - if (data->reset_gpio < 0) { - struct device_node *np = priv->device->of_node; -+ - if (!np) - return 0; - -@@ -198,7 +183,7 @@ int stmmac_mdio_reset(struct mii_bus *bu - - /* This is a workaround for problems with the STE101P PHY. - * It doesn't complete its reset until at least one clock cycle -- * on MDC, so perform a dummy mdio read. To be upadted for GMAC4 -+ * on MDC, so perform a dummy mdio read. To be updated for GMAC4 - * if needed. - */ - if (!priv->plat->has_gmac4) -@@ -225,7 +210,7 @@ int stmmac_mdio_register(struct net_devi - return 0; - - new_bus = mdiobus_alloc(); -- if (new_bus == NULL) -+ if (!new_bus) - return -ENOMEM; - - if (mdio_bus_data->irqs) -@@ -262,49 +247,48 @@ int stmmac_mdio_register(struct net_devi - found = 0; - for (addr = 0; addr < PHY_MAX_ADDR; addr++) { - struct phy_device *phydev = mdiobus_get_phy(new_bus, addr); -- if (phydev) { -- int act = 0; -- char irq_num[4]; -- char *irq_str; -- -- /* -- * If an IRQ was provided to be assigned after -- * the bus probe, do it here. -- */ -- if ((mdio_bus_data->irqs == NULL) && -- (mdio_bus_data->probed_phy_irq > 0)) { -- new_bus->irq[addr] = -- mdio_bus_data->probed_phy_irq; -- phydev->irq = mdio_bus_data->probed_phy_irq; -- } -- -- /* -- * If we're going to bind the MAC to this PHY bus, -- * and no PHY number was provided to the MAC, -- * use the one probed here. -- */ -- if (priv->plat->phy_addr == -1) -- priv->plat->phy_addr = addr; -- -- act = (priv->plat->phy_addr == addr); -- switch (phydev->irq) { -- case PHY_POLL: -- irq_str = "POLL"; -- break; -- case PHY_IGNORE_INTERRUPT: -- irq_str = "IGNORE"; -- break; -- default: -- sprintf(irq_num, "%d", phydev->irq); -- irq_str = irq_num; -- break; -- } -- netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n", -- phydev->phy_id, addr, -- irq_str, phydev_name(phydev), -- act ? " active" : ""); -- found = 1; -+ int act = 0; -+ char irq_num[4]; -+ char *irq_str; -+ -+ if (!phydev) -+ continue; -+ -+ /* -+ * If an IRQ was provided to be assigned after -+ * the bus probe, do it here. -+ */ -+ if (!mdio_bus_data->irqs && -+ (mdio_bus_data->probed_phy_irq > 0)) { -+ new_bus->irq[addr] = mdio_bus_data->probed_phy_irq; -+ phydev->irq = mdio_bus_data->probed_phy_irq; -+ } -+ -+ /* -+ * If we're going to bind the MAC to this PHY bus, -+ * and no PHY number was provided to the MAC, -+ * use the one probed here. -+ */ -+ if (priv->plat->phy_addr == -1) -+ priv->plat->phy_addr = addr; -+ -+ act = (priv->plat->phy_addr == addr); -+ switch (phydev->irq) { -+ case PHY_POLL: -+ irq_str = "POLL"; -+ break; -+ case PHY_IGNORE_INTERRUPT: -+ irq_str = "IGNORE"; -+ break; -+ default: -+ sprintf(irq_num, "%d", phydev->irq); -+ irq_str = irq_num; -+ break; - } -+ netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n", -+ phydev->phy_id, addr, irq_str, phydev_name(phydev), -+ act ? " active" : ""); -+ found = 1; - } - - if (!found && !mdio_node) { ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - -@@ -120,7 +116,6 @@ static struct stmmac_axi *stmmac_axi_set - axi->axi_lpi_en = of_property_read_bool(np, "snps,lpi_en"); - axi->axi_xit_frm = of_property_read_bool(np, "snps,xit_frm"); - axi->axi_kbbe = of_property_read_bool(np, "snps,axi_kbbe"); -- axi->axi_axi_all = of_property_read_bool(np, "snps,axi_all"); - axi->axi_fb = of_property_read_bool(np, "snps,axi_fb"); - axi->axi_mb = of_property_read_bool(np, "snps,axi_mb"); - axi->axi_rb = of_property_read_bool(np, "snps,axi_rb"); -@@ -180,10 +175,19 @@ static int stmmac_dt_phy(struct plat_stm - mdio = false; - } - -- /* If snps,dwmac-mdio is passed from DT, always register the MDIO */ -- for_each_child_of_node(np, plat->mdio_node) { -- if (of_device_is_compatible(plat->mdio_node, "snps,dwmac-mdio")) -- break; -+ /* exception for dwmac-dwc-qos-eth glue logic */ -+ if (of_device_is_compatible(np, "snps,dwc-qos-ethernet-4.10")) { -+ plat->mdio_node = of_get_child_by_name(np, "mdio"); -+ } else { -+ /** -+ * If snps,dwmac-mdio is passed from DT, always register -+ * the MDIO -+ */ -+ for_each_child_of_node(np, plat->mdio_node) { -+ if (of_device_is_compatible(plat->mdio_node, -+ "snps,dwmac-mdio")) -+ break; -+ } - } - - if (plat->mdio_node) { -@@ -248,6 +252,9 @@ stmmac_probe_config_dt(struct platform_d - plat->force_sf_dma_mode = - of_property_read_bool(np, "snps,force_sf_dma_mode"); - -+ plat->en_tx_lpi_clockgating = -+ of_property_read_bool(np, "snps,en-tx-lpi-clockgating"); -+ - /* Set the maxmtu to a default of JUMBO_LEN in case the - * parameter is not present in the device tree. - */ -@@ -332,7 +339,54 @@ stmmac_probe_config_dt(struct platform_d - - plat->axi = stmmac_axi_setup(pdev); - -+ /* clock setup */ -+ plat->stmmac_clk = devm_clk_get(&pdev->dev, -+ STMMAC_RESOURCE_NAME); -+ if (IS_ERR(plat->stmmac_clk)) { -+ dev_warn(&pdev->dev, "Cannot get CSR clock\n"); -+ plat->stmmac_clk = NULL; -+ } -+ clk_prepare_enable(plat->stmmac_clk); -+ -+ plat->pclk = devm_clk_get(&pdev->dev, "pclk"); -+ if (IS_ERR(plat->pclk)) { -+ if (PTR_ERR(plat->pclk) == -EPROBE_DEFER) -+ goto error_pclk_get; -+ -+ plat->pclk = NULL; -+ } -+ clk_prepare_enable(plat->pclk); -+ -+ /* Fall-back to main clock in case of no PTP ref is passed */ -+ plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "clk_ptp_ref"); -+ if (IS_ERR(plat->clk_ptp_ref)) { -+ plat->clk_ptp_rate = clk_get_rate(plat->stmmac_clk); -+ plat->clk_ptp_ref = NULL; -+ dev_warn(&pdev->dev, "PTP uses main clock\n"); -+ } else { -+ clk_prepare_enable(plat->clk_ptp_ref); -+ plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref); -+ dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate); -+ } -+ -+ plat->stmmac_rst = devm_reset_control_get(&pdev->dev, -+ STMMAC_RESOURCE_NAME); -+ if (IS_ERR(plat->stmmac_rst)) { -+ if (PTR_ERR(plat->stmmac_rst) == -EPROBE_DEFER) -+ goto error_hw_init; -+ -+ dev_info(&pdev->dev, "no reset control found\n"); -+ plat->stmmac_rst = NULL; -+ } -+ - return plat; -+ -+error_hw_init: -+ clk_disable_unprepare(plat->pclk); -+error_pclk_get: -+ clk_disable_unprepare(plat->stmmac_clk); -+ -+ return ERR_PTR(-EPROBE_DEFER); - } - - /** -@@ -356,7 +410,7 @@ void stmmac_remove_config_dt(struct plat - struct plat_stmmacenet_data * - stmmac_probe_config_dt(struct platform_device *pdev, const char **mac) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-EINVAL); - } - - void stmmac_remove_config_dt(struct platform_device *pdev, ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h -@@ -12,10 +12,6 @@ - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - -- You should have received a copy of the GNU General Public License along with -- this program; if not, write to the Free Software Foundation, Inc., -- 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -- - The full GNU General Public License is included in this distribution in - the file called "COPYING". - ---- a/include/linux/stmmac.h -+++ b/include/linux/stmmac.h -@@ -103,7 +103,6 @@ struct stmmac_axi { - u32 axi_wr_osr_lmt; - u32 axi_rd_osr_lmt; - bool axi_kbbe; -- bool axi_axi_all; - u32 axi_blen[AXI_BLEN]; - bool axi_fb; - bool axi_mb; -@@ -135,13 +134,18 @@ struct plat_stmmacenet_data { - int tx_fifo_size; - int rx_fifo_size; - void (*fix_mac_speed)(void *priv, unsigned int speed); -- void (*bus_setup)(void __iomem *ioaddr); - int (*init)(struct platform_device *pdev, void *priv); - void (*exit)(struct platform_device *pdev, void *priv); - void *bsp_priv; -+ struct clk *stmmac_clk; -+ struct clk *pclk; -+ struct clk *clk_ptp_ref; -+ unsigned int clk_ptp_rate; -+ struct reset_control *stmmac_rst; - struct stmmac_axi *axi; - int has_gmac4; - bool tso_en; - int mac_port_sel_speed; -+ bool en_tx_lpi_clockgating; - }; - #endif diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch deleted file mode 100644 index 8b7327d9153..00000000000 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ /dev/null @@ -1,5904 +0,0 @@ ---- a/Documentation/devicetree/bindings/net/stmmac.txt -+++ b/Documentation/devicetree/bindings/net/stmmac.txt -@@ -7,9 +7,12 @@ Required properties: - - interrupt-parent: Should be the phandle for the interrupt controller - that services interrupts for this device - - interrupts: Should contain the STMMAC interrupts --- interrupt-names: Should contain the interrupt names "macirq" -- "eth_wake_irq" if this interrupt is supported in the "interrupts" -- property -+- interrupt-names: Should contain a list of interrupt names corresponding to -+ the interrupts in the interrupts property, if available. -+ Valid interrupt names are: -+ - "macirq" (combined signal for various interrupt events) -+ - "eth_wake_irq" (the interrupt to manage the remote wake-up packet detection) -+ - "eth_lpi" (the interrupt that occurs when Tx or Rx enters/exits LPI state) - - phy-mode: See ethernet.txt file in the same directory. - - snps,reset-gpio gpio number for phy reset. - - snps,reset-active-low boolean flag to indicate if phy reset is active low. -@@ -28,9 +31,9 @@ Optional properties: - clocks may be specified in derived bindings. - - clock-names: One name for each entry in the clocks property, the - first one should be "stmmaceth" and the second one should be "pclk". --- clk_ptp_ref: this is the PTP reference clock; in case of the PTP is -- available this clock is used for programming the Timestamp Addend Register. -- If not passed then the system clock will be used and this is fine on some -+- ptp_ref: this is the PTP reference clock; in case of the PTP is available -+ this clock is used for programming the Timestamp Addend Register. If not -+ passed then the system clock will be used and this is fine on some - platforms. - - tx-fifo-depth: See ethernet.txt file in the same directory - - rx-fifo-depth: See ethernet.txt file in the same directory -@@ -72,7 +75,45 @@ Optional properties: - - snps,mb: mixed-burst - - snps,rb: rebuild INCRx Burst - - mdio: with compatible = "snps,dwmac-mdio", create and register mdio bus. -- -+- Multiple RX Queues parameters: below the list of all the parameters to -+ configure the multiple RX queues: -+ - snps,rx-queues-to-use: number of RX queues to be used in the driver -+ - Choose one of these RX scheduling algorithms: -+ - snps,rx-sched-sp: Strict priority -+ - snps,rx-sched-wsp: Weighted Strict priority -+ - For each RX queue -+ - Choose one of these modes: -+ - snps,dcb-algorithm: Queue to be enabled as DCB -+ - snps,avb-algorithm: Queue to be enabled as AVB -+ - snps,map-to-dma-channel: Channel to map -+ - Specifiy specific packet routing: -+ - snps,route-avcp: AV Untagged Control packets -+ - snps,route-ptp: PTP Packets -+ - snps,route-dcbcp: DCB Control Packets -+ - snps,route-up: Untagged Packets -+ - snps,route-multi-broad: Multicast & Broadcast Packets -+ - snps,priority: RX queue priority (Range: 0x0 to 0xF) -+- Multiple TX Queues parameters: below the list of all the parameters to -+ configure the multiple TX queues: -+ - snps,tx-queues-to-use: number of TX queues to be used in the driver -+ - Choose one of these TX scheduling algorithms: -+ - snps,tx-sched-wrr: Weighted Round Robin -+ - snps,tx-sched-wfq: Weighted Fair Queuing -+ - snps,tx-sched-dwrr: Deficit Weighted Round Robin -+ - snps,tx-sched-sp: Strict priority -+ - For each TX queue -+ - snps,weight: TX queue weight (if using a DCB weight algorithm) -+ - Choose one of these modes: -+ - snps,dcb-algorithm: TX queue will be working in DCB -+ - snps,avb-algorithm: TX queue will be working in AVB -+ [Attention] Queue 0 is reserved for legacy traffic -+ and so no AVB is available in this queue. -+ - Configure Credit Base Shaper (if AVB Mode selected): -+ - snps,send_slope: enable Low Power Interface -+ - snps,idle_slope: unlock on WoL -+ - snps,high_credit: max write outstanding req. limit -+ - snps,low_credit: max read outstanding req. limit -+ - snps,priority: TX queue priority (Range: 0x0 to 0xF) - Examples: - - stmmac_axi_setup: stmmac-axi-config { -@@ -81,12 +122,41 @@ Examples: - snps,blen = <256 128 64 32 0 0 0>; - }; - -+ mtl_rx_setup: rx-queues-config { -+ snps,rx-queues-to-use = <1>; -+ snps,rx-sched-sp; -+ queue0 { -+ snps,dcb-algorithm; -+ snps,map-to-dma-channel = <0x0>; -+ snps,priority = <0x0>; -+ }; -+ }; -+ -+ mtl_tx_setup: tx-queues-config { -+ snps,tx-queues-to-use = <2>; -+ snps,tx-sched-wrr; -+ queue0 { -+ snps,weight = <0x10>; -+ snps,dcb-algorithm; -+ snps,priority = <0x0>; -+ }; -+ -+ queue1 { -+ snps,avb-algorithm; -+ snps,send_slope = <0x1000>; -+ snps,idle_slope = <0x1000>; -+ snps,high_credit = <0x3E800>; -+ snps,low_credit = <0xFFC18000>; -+ snps,priority = <0x1>; -+ }; -+ }; -+ - gmac0: ethernet@e0800000 { - compatible = "st,spear600-gmac"; - reg = <0xe0800000 0x8000>; - interrupt-parent = <&vic1>; -- interrupts = <24 23>; -- interrupt-names = "macirq", "eth_wake_irq"; -+ interrupts = <24 23 22>; -+ interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; - mac-address = [000000000000]; /* Filled in by U-Boot */ - max-frame-size = <3800>; - phy-mode = "gmii"; -@@ -104,4 +174,6 @@ Examples: - phy1: ethernet-phy@0 { - }; - }; -+ snps,mtl-rx-config = <&mtl_rx_setup>; -+ snps,mtl-tx-config = <&mtl_tx_setup>; - }; ---- a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c -+++ b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c -@@ -37,6 +37,7 @@ - #define TSE_PCS_CONTROL_AN_EN_MASK BIT(12) - #define TSE_PCS_CONTROL_REG 0x00 - #define TSE_PCS_CONTROL_RESTART_AN_MASK BIT(9) -+#define TSE_PCS_CTRL_AUTONEG_SGMII 0x1140 - #define TSE_PCS_IF_MODE_REG 0x28 - #define TSE_PCS_LINK_TIMER_0_REG 0x24 - #define TSE_PCS_LINK_TIMER_1_REG 0x26 -@@ -65,6 +66,7 @@ - #define TSE_PCS_SW_RESET_TIMEOUT 100 - #define TSE_PCS_USE_SGMII_AN_MASK BIT(1) - #define TSE_PCS_USE_SGMII_ENA BIT(0) -+#define TSE_PCS_IF_USE_SGMII 0x03 - - #define SGMII_ADAPTER_CTRL_REG 0x00 - #define SGMII_ADAPTER_DISABLE 0x0001 -@@ -101,7 +103,9 @@ int tse_pcs_init(void __iomem *base, str - { - int ret = 0; - -- writew(TSE_PCS_USE_SGMII_ENA, base + TSE_PCS_IF_MODE_REG); -+ writew(TSE_PCS_IF_USE_SGMII, base + TSE_PCS_IF_MODE_REG); -+ -+ writew(TSE_PCS_CTRL_AUTONEG_SGMII, base + TSE_PCS_CONTROL_REG); - - writew(TSE_PCS_SGMII_LINK_TIMER_0, base + TSE_PCS_LINK_TIMER_0_REG); - writew(TSE_PCS_SGMII_LINK_TIMER_1, base + TSE_PCS_LINK_TIMER_1_REG); ---- a/drivers/net/ethernet/stmicro/stmmac/chain_mode.c -+++ b/drivers/net/ethernet/stmicro/stmmac/chain_mode.c -@@ -26,12 +26,15 @@ - - static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) - { -- struct stmmac_priv *priv = (struct stmmac_priv *)p; -- unsigned int entry = priv->cur_tx; -- struct dma_desc *desc = priv->dma_tx + entry; -+ struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)p; - unsigned int nopaged_len = skb_headlen(skb); -+ struct stmmac_priv *priv = tx_q->priv_data; -+ unsigned int entry = tx_q->cur_tx; - unsigned int bmax, des2; - unsigned int i = 1, len; -+ struct dma_desc *desc; -+ -+ desc = tx_q->dma_tx + entry; - - if (priv->plat->enh_desc) - bmax = BUF_SIZE_8KiB; -@@ -45,16 +48,16 @@ static int stmmac_jumbo_frm(void *p, str - desc->des2 = cpu_to_le32(des2); - if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = des2; -- priv->tx_skbuff_dma[entry].len = bmax; -+ tx_q->tx_skbuff_dma[entry].buf = des2; -+ tx_q->tx_skbuff_dma[entry].len = bmax; - /* do not close the descriptor and do not set own bit */ - priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, STMMAC_CHAIN_MODE, -- 0, false); -+ 0, false, skb->len); - - while (len != 0) { -- priv->tx_skbuff[entry] = NULL; -+ tx_q->tx_skbuff[entry] = NULL; - entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); -- desc = priv->dma_tx + entry; -+ desc = tx_q->dma_tx + entry; - - if (len > bmax) { - des2 = dma_map_single(priv->device, -@@ -63,11 +66,11 @@ static int stmmac_jumbo_frm(void *p, str - desc->des2 = cpu_to_le32(des2); - if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = des2; -- priv->tx_skbuff_dma[entry].len = bmax; -+ tx_q->tx_skbuff_dma[entry].buf = des2; -+ tx_q->tx_skbuff_dma[entry].len = bmax; - priv->hw->desc->prepare_tx_desc(desc, 0, bmax, csum, - STMMAC_CHAIN_MODE, 1, -- false); -+ false, skb->len); - len -= bmax; - i++; - } else { -@@ -77,17 +80,17 @@ static int stmmac_jumbo_frm(void *p, str - desc->des2 = cpu_to_le32(des2); - if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = des2; -- priv->tx_skbuff_dma[entry].len = len; -+ tx_q->tx_skbuff_dma[entry].buf = des2; -+ tx_q->tx_skbuff_dma[entry].len = len; - /* last descriptor can be set now */ - priv->hw->desc->prepare_tx_desc(desc, 0, len, csum, - STMMAC_CHAIN_MODE, 1, -- true); -+ true, skb->len); - len = 0; - } - } - -- priv->cur_tx = entry; -+ tx_q->cur_tx = entry; - - return entry; - } -@@ -136,32 +139,34 @@ static void stmmac_init_dma_chain(void * - - static void stmmac_refill_desc3(void *priv_ptr, struct dma_desc *p) - { -- struct stmmac_priv *priv = (struct stmmac_priv *)priv_ptr; -+ struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)priv_ptr; -+ struct stmmac_priv *priv = rx_q->priv_data; - - if (priv->hwts_rx_en && !priv->extend_desc) - /* NOTE: Device will overwrite des3 with timestamp value if - * 1588-2002 time stamping is enabled, hence reinitialize it - * to keep explicit chaining in the descriptor. - */ -- p->des3 = cpu_to_le32((unsigned int)(priv->dma_rx_phy + -- (((priv->dirty_rx) + 1) % -+ p->des3 = cpu_to_le32((unsigned int)(rx_q->dma_rx_phy + -+ (((rx_q->dirty_rx) + 1) % - DMA_RX_SIZE) * - sizeof(struct dma_desc))); - } - - static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) - { -- struct stmmac_priv *priv = (struct stmmac_priv *)priv_ptr; -- unsigned int entry = priv->dirty_tx; -+ struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)priv_ptr; -+ struct stmmac_priv *priv = tx_q->priv_data; -+ unsigned int entry = tx_q->dirty_tx; - -- if (priv->tx_skbuff_dma[entry].last_segment && !priv->extend_desc && -+ if (tx_q->tx_skbuff_dma[entry].last_segment && !priv->extend_desc && - priv->hwts_tx_en) - /* NOTE: Device will overwrite des3 with timestamp value if - * 1588-2002 time stamping is enabled, hence reinitialize it - * to keep explicit chaining in the descriptor. - */ -- p->des3 = cpu_to_le32((unsigned int)((priv->dma_tx_phy + -- ((priv->dirty_tx + 1) % DMA_TX_SIZE)) -+ p->des3 = cpu_to_le32((unsigned int)((tx_q->dma_tx_phy + -+ ((tx_q->dirty_tx + 1) % DMA_TX_SIZE)) - * sizeof(struct dma_desc))); - } - ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -246,6 +246,15 @@ struct stmmac_extra_stats { - #define STMMAC_TX_MAX_FRAMES 256 - #define STMMAC_TX_FRAMES 64 - -+/* Packets types */ -+enum packets_types { -+ PACKET_AVCPQ = 0x1, /* AV Untagged Control packets */ -+ PACKET_PTPQ = 0x2, /* PTP Packets */ -+ PACKET_DCBCPQ = 0x3, /* DCB Control Packets */ -+ PACKET_UPQ = 0x4, /* Untagged Packets */ -+ PACKET_MCBCQ = 0x5, /* Multicast & Broadcast Packets */ -+}; -+ - /* Rx IPC status */ - enum rx_frame_status { - good_frame = 0x0, -@@ -324,6 +333,9 @@ struct dma_features { - unsigned int number_tx_queues; - /* Alternate (enhanced) DESC mode */ - unsigned int enh_desc; -+ /* TX and RX FIFO sizes */ -+ unsigned int tx_fifo_size; -+ unsigned int rx_fifo_size; - }; - - /* GMAC TX FIFO is 8K, Rx FIFO is 16K */ -@@ -361,7 +373,7 @@ struct stmmac_desc_ops { - /* Invoked by the xmit function to prepare the tx descriptor */ - void (*prepare_tx_desc) (struct dma_desc *p, int is_fs, int len, - bool csum_flag, int mode, bool tx_own, -- bool ls); -+ bool ls, unsigned int tot_pkt_len); - void (*prepare_tso_tx_desc)(struct dma_desc *p, int is_fs, int len1, - int len2, bool tx_own, bool ls, - unsigned int tcphdrlen, -@@ -413,6 +425,14 @@ struct stmmac_dma_ops { - int (*reset)(void __iomem *ioaddr); - void (*init)(void __iomem *ioaddr, struct stmmac_dma_cfg *dma_cfg, - u32 dma_tx, u32 dma_rx, int atds); -+ void (*init_chan)(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, u32 chan); -+ void (*init_rx_chan)(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_rx_phy, u32 chan); -+ void (*init_tx_chan)(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx_phy, u32 chan); - /* Configure the AXI Bus Mode Register */ - void (*axi)(void __iomem *ioaddr, struct stmmac_axi *axi); - /* Dump DMA registers */ -@@ -421,25 +441,28 @@ struct stmmac_dma_ops { - * An invalid value enables the store-and-forward mode */ - void (*dma_mode)(void __iomem *ioaddr, int txmode, int rxmode, - int rxfifosz); -+ void (*dma_rx_mode)(void __iomem *ioaddr, int mode, u32 channel, -+ int fifosz); -+ void (*dma_tx_mode)(void __iomem *ioaddr, int mode, u32 channel); - /* To track extra statistic (if supported) */ - void (*dma_diagnostic_fr) (void *data, struct stmmac_extra_stats *x, - void __iomem *ioaddr); - void (*enable_dma_transmission) (void __iomem *ioaddr); -- void (*enable_dma_irq) (void __iomem *ioaddr); -- void (*disable_dma_irq) (void __iomem *ioaddr); -- void (*start_tx) (void __iomem *ioaddr); -- void (*stop_tx) (void __iomem *ioaddr); -- void (*start_rx) (void __iomem *ioaddr); -- void (*stop_rx) (void __iomem *ioaddr); -+ void (*enable_dma_irq)(void __iomem *ioaddr, u32 chan); -+ void (*disable_dma_irq)(void __iomem *ioaddr, u32 chan); -+ void (*start_tx)(void __iomem *ioaddr, u32 chan); -+ void (*stop_tx)(void __iomem *ioaddr, u32 chan); -+ void (*start_rx)(void __iomem *ioaddr, u32 chan); -+ void (*stop_rx)(void __iomem *ioaddr, u32 chan); - int (*dma_interrupt) (void __iomem *ioaddr, -- struct stmmac_extra_stats *x); -+ struct stmmac_extra_stats *x, u32 chan); - /* If supported then get the optional core features */ - void (*get_hw_feature)(void __iomem *ioaddr, - struct dma_features *dma_cap); - /* Program the HW RX Watchdog */ -- void (*rx_watchdog) (void __iomem *ioaddr, u32 riwt); -- void (*set_tx_ring_len)(void __iomem *ioaddr, u32 len); -- void (*set_rx_ring_len)(void __iomem *ioaddr, u32 len); -+ void (*rx_watchdog)(void __iomem *ioaddr, u32 riwt, u32 number_chan); -+ void (*set_tx_ring_len)(void __iomem *ioaddr, u32 len, u32 chan); -+ void (*set_rx_ring_len)(void __iomem *ioaddr, u32 len, u32 chan); - void (*set_rx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); - void (*set_tx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan); - void (*enable_tso)(void __iomem *ioaddr, bool en, u32 chan); -@@ -451,20 +474,44 @@ struct mac_device_info; - struct stmmac_ops { - /* MAC core initialization */ - void (*core_init)(struct mac_device_info *hw, int mtu); -+ /* Enable the MAC RX/TX */ -+ void (*set_mac)(void __iomem *ioaddr, bool enable); - /* Enable and verify that the IPC module is supported */ - int (*rx_ipc)(struct mac_device_info *hw); - /* Enable RX Queues */ -- void (*rx_queue_enable)(struct mac_device_info *hw, u32 queue); -+ void (*rx_queue_enable)(struct mac_device_info *hw, u8 mode, u32 queue); -+ /* RX Queues Priority */ -+ void (*rx_queue_prio)(struct mac_device_info *hw, u32 prio, u32 queue); -+ /* TX Queues Priority */ -+ void (*tx_queue_prio)(struct mac_device_info *hw, u32 prio, u32 queue); -+ /* RX Queues Routing */ -+ void (*rx_queue_routing)(struct mac_device_info *hw, u8 packet, -+ u32 queue); -+ /* Program RX Algorithms */ -+ void (*prog_mtl_rx_algorithms)(struct mac_device_info *hw, u32 rx_alg); -+ /* Program TX Algorithms */ -+ void (*prog_mtl_tx_algorithms)(struct mac_device_info *hw, u32 tx_alg); -+ /* Set MTL TX queues weight */ -+ void (*set_mtl_tx_queue_weight)(struct mac_device_info *hw, -+ u32 weight, u32 queue); -+ /* RX MTL queue to RX dma mapping */ -+ void (*map_mtl_to_dma)(struct mac_device_info *hw, u32 queue, u32 chan); -+ /* Configure AV Algorithm */ -+ void (*config_cbs)(struct mac_device_info *hw, u32 send_slope, -+ u32 idle_slope, u32 high_credit, u32 low_credit, -+ u32 queue); - /* Dump MAC registers */ - void (*dump_regs)(struct mac_device_info *hw, u32 *reg_space); - /* Handle extra events on specific interrupts hw dependent */ - int (*host_irq_status)(struct mac_device_info *hw, - struct stmmac_extra_stats *x); -+ /* Handle MTL interrupts */ -+ int (*host_mtl_irq_status)(struct mac_device_info *hw, u32 chan); - /* Multicast filter setting */ - void (*set_filter)(struct mac_device_info *hw, struct net_device *dev); - /* Flow control setting */ - void (*flow_ctrl)(struct mac_device_info *hw, unsigned int duplex, -- unsigned int fc, unsigned int pause_time); -+ unsigned int fc, unsigned int pause_time, u32 tx_cnt); - /* Set power management mode (e.g. magic frame) */ - void (*pmt)(struct mac_device_info *hw, unsigned long mode); - /* Set/Get Unicast MAC addresses */ -@@ -477,7 +524,8 @@ struct stmmac_ops { - void (*reset_eee_mode)(struct mac_device_info *hw); - void (*set_eee_timer)(struct mac_device_info *hw, int ls, int tw); - void (*set_eee_pls)(struct mac_device_info *hw, int link); -- void (*debug)(void __iomem *ioaddr, struct stmmac_extra_stats *x); -+ void (*debug)(void __iomem *ioaddr, struct stmmac_extra_stats *x, -+ u32 rx_queues, u32 tx_queues); - /* PCS calls */ - void (*pcs_ctrl_ane)(void __iomem *ioaddr, bool ane, bool srgmi_ral, - bool loopback); -@@ -547,6 +595,11 @@ struct mac_device_info { - unsigned int ps; - }; - -+struct stmmac_rx_routing { -+ u32 reg_mask; -+ u32 reg_shift; -+}; -+ - struct mac_device_info *dwmac1000_setup(void __iomem *ioaddr, int mcbins, - int perfect_uc_entries, - int *synopsys_id); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c -@@ -14,16 +14,34 @@ - #include - #include - #include -+#include - #include - #include -+#include - #include - #include -+#include - #include - #include - #include -+#include - #include - - #include "stmmac_platform.h" -+#include "dwmac4.h" -+ -+struct tegra_eqos { -+ struct device *dev; -+ void __iomem *regs; -+ -+ struct reset_control *rst; -+ struct clk *clk_master; -+ struct clk *clk_slave; -+ struct clk *clk_tx; -+ struct clk *clk_rx; -+ -+ struct gpio_desc *reset; -+}; - - static int dwc_eth_dwmac_config_dt(struct platform_device *pdev, - struct plat_stmmacenet_data *plat_dat) -@@ -106,13 +124,309 @@ static int dwc_eth_dwmac_config_dt(struc - return 0; - } - -+static void *dwc_qos_probe(struct platform_device *pdev, -+ struct plat_stmmacenet_data *plat_dat, -+ struct stmmac_resources *stmmac_res) -+{ -+ int err; -+ -+ plat_dat->stmmac_clk = devm_clk_get(&pdev->dev, "apb_pclk"); -+ if (IS_ERR(plat_dat->stmmac_clk)) { -+ dev_err(&pdev->dev, "apb_pclk clock not found.\n"); -+ return ERR_CAST(plat_dat->stmmac_clk); -+ } -+ -+ err = clk_prepare_enable(plat_dat->stmmac_clk); -+ if (err < 0) { -+ dev_err(&pdev->dev, "failed to enable apb_pclk clock: %d\n", -+ err); -+ return ERR_PTR(err); -+ } -+ -+ plat_dat->pclk = devm_clk_get(&pdev->dev, "phy_ref_clk"); -+ if (IS_ERR(plat_dat->pclk)) { -+ dev_err(&pdev->dev, "phy_ref_clk clock not found.\n"); -+ err = PTR_ERR(plat_dat->pclk); -+ goto disable; -+ } -+ -+ err = clk_prepare_enable(plat_dat->pclk); -+ if (err < 0) { -+ dev_err(&pdev->dev, "failed to enable phy_ref clock: %d\n", -+ err); -+ goto disable; -+ } -+ -+ return NULL; -+ -+disable: -+ clk_disable_unprepare(plat_dat->stmmac_clk); -+ return ERR_PTR(err); -+} -+ -+static int dwc_qos_remove(struct platform_device *pdev) -+{ -+ struct net_device *ndev = platform_get_drvdata(pdev); -+ struct stmmac_priv *priv = netdev_priv(ndev); -+ -+ clk_disable_unprepare(priv->plat->pclk); -+ clk_disable_unprepare(priv->plat->stmmac_clk); -+ -+ return 0; -+} -+ -+#define SDMEMCOMPPADCTRL 0x8800 -+#define SDMEMCOMPPADCTRL_PAD_E_INPUT_OR_E_PWRD BIT(31) -+ -+#define AUTO_CAL_CONFIG 0x8804 -+#define AUTO_CAL_CONFIG_START BIT(31) -+#define AUTO_CAL_CONFIG_ENABLE BIT(29) -+ -+#define AUTO_CAL_STATUS 0x880c -+#define AUTO_CAL_STATUS_ACTIVE BIT(31) -+ -+static void tegra_eqos_fix_speed(void *priv, unsigned int speed) -+{ -+ struct tegra_eqos *eqos = priv; -+ unsigned long rate = 125000000; -+ bool needs_calibration = false; -+ u32 value; -+ int err; -+ -+ switch (speed) { -+ case SPEED_1000: -+ needs_calibration = true; -+ rate = 125000000; -+ break; -+ -+ case SPEED_100: -+ needs_calibration = true; -+ rate = 25000000; -+ break; -+ -+ case SPEED_10: -+ rate = 2500000; -+ break; -+ -+ default: -+ dev_err(eqos->dev, "invalid speed %u\n", speed); -+ break; -+ } -+ -+ if (needs_calibration) { -+ /* calibrate */ -+ value = readl(eqos->regs + SDMEMCOMPPADCTRL); -+ value |= SDMEMCOMPPADCTRL_PAD_E_INPUT_OR_E_PWRD; -+ writel(value, eqos->regs + SDMEMCOMPPADCTRL); -+ -+ udelay(1); -+ -+ value = readl(eqos->regs + AUTO_CAL_CONFIG); -+ value |= AUTO_CAL_CONFIG_START | AUTO_CAL_CONFIG_ENABLE; -+ writel(value, eqos->regs + AUTO_CAL_CONFIG); -+ -+ err = readl_poll_timeout_atomic(eqos->regs + AUTO_CAL_STATUS, -+ value, -+ value & AUTO_CAL_STATUS_ACTIVE, -+ 1, 10); -+ if (err < 0) { -+ dev_err(eqos->dev, "calibration did not start\n"); -+ goto failed; -+ } -+ -+ err = readl_poll_timeout_atomic(eqos->regs + AUTO_CAL_STATUS, -+ value, -+ (value & AUTO_CAL_STATUS_ACTIVE) == 0, -+ 20, 200); -+ if (err < 0) { -+ dev_err(eqos->dev, "calibration didn't finish\n"); -+ goto failed; -+ } -+ -+ failed: -+ value = readl(eqos->regs + SDMEMCOMPPADCTRL); -+ value &= ~SDMEMCOMPPADCTRL_PAD_E_INPUT_OR_E_PWRD; -+ writel(value, eqos->regs + SDMEMCOMPPADCTRL); -+ } else { -+ value = readl(eqos->regs + AUTO_CAL_CONFIG); -+ value &= ~AUTO_CAL_CONFIG_ENABLE; -+ writel(value, eqos->regs + AUTO_CAL_CONFIG); -+ } -+ -+ err = clk_set_rate(eqos->clk_tx, rate); -+ if (err < 0) -+ dev_err(eqos->dev, "failed to set TX rate: %d\n", err); -+} -+ -+static int tegra_eqos_init(struct platform_device *pdev, void *priv) -+{ -+ struct tegra_eqos *eqos = priv; -+ unsigned long rate; -+ u32 value; -+ -+ rate = clk_get_rate(eqos->clk_slave); -+ -+ value = (rate / 1000000) - 1; -+ writel(value, eqos->regs + GMAC_1US_TIC_COUNTER); -+ -+ return 0; -+} -+ -+static void *tegra_eqos_probe(struct platform_device *pdev, -+ struct plat_stmmacenet_data *data, -+ struct stmmac_resources *res) -+{ -+ struct tegra_eqos *eqos; -+ int err; -+ -+ eqos = devm_kzalloc(&pdev->dev, sizeof(*eqos), GFP_KERNEL); -+ if (!eqos) { -+ err = -ENOMEM; -+ goto error; -+ } -+ -+ eqos->dev = &pdev->dev; -+ eqos->regs = res->addr; -+ -+ eqos->clk_master = devm_clk_get(&pdev->dev, "master_bus"); -+ if (IS_ERR(eqos->clk_master)) { -+ err = PTR_ERR(eqos->clk_master); -+ goto error; -+ } -+ -+ err = clk_prepare_enable(eqos->clk_master); -+ if (err < 0) -+ goto error; -+ -+ eqos->clk_slave = devm_clk_get(&pdev->dev, "slave_bus"); -+ if (IS_ERR(eqos->clk_slave)) { -+ err = PTR_ERR(eqos->clk_slave); -+ goto disable_master; -+ } -+ -+ data->stmmac_clk = eqos->clk_slave; -+ -+ err = clk_prepare_enable(eqos->clk_slave); -+ if (err < 0) -+ goto disable_master; -+ -+ eqos->clk_rx = devm_clk_get(&pdev->dev, "rx"); -+ if (IS_ERR(eqos->clk_rx)) { -+ err = PTR_ERR(eqos->clk_rx); -+ goto disable_slave; -+ } -+ -+ err = clk_prepare_enable(eqos->clk_rx); -+ if (err < 0) -+ goto disable_slave; -+ -+ eqos->clk_tx = devm_clk_get(&pdev->dev, "tx"); -+ if (IS_ERR(eqos->clk_tx)) { -+ err = PTR_ERR(eqos->clk_tx); -+ goto disable_rx; -+ } -+ -+ err = clk_prepare_enable(eqos->clk_tx); -+ if (err < 0) -+ goto disable_rx; -+ -+ eqos->reset = devm_gpiod_get(&pdev->dev, "phy-reset", GPIOD_OUT_HIGH); -+ if (IS_ERR(eqos->reset)) { -+ err = PTR_ERR(eqos->reset); -+ goto disable_tx; -+ } -+ -+ usleep_range(2000, 4000); -+ gpiod_set_value(eqos->reset, 0); -+ -+ eqos->rst = devm_reset_control_get(&pdev->dev, "eqos"); -+ if (IS_ERR(eqos->rst)) { -+ err = PTR_ERR(eqos->rst); -+ goto reset_phy; -+ } -+ -+ err = reset_control_assert(eqos->rst); -+ if (err < 0) -+ goto reset_phy; -+ -+ usleep_range(2000, 4000); -+ -+ err = reset_control_deassert(eqos->rst); -+ if (err < 0) -+ goto reset_phy; -+ -+ usleep_range(2000, 4000); -+ -+ data->fix_mac_speed = tegra_eqos_fix_speed; -+ data->init = tegra_eqos_init; -+ data->bsp_priv = eqos; -+ -+ err = tegra_eqos_init(pdev, eqos); -+ if (err < 0) -+ goto reset; -+ -+out: -+ return eqos; -+ -+reset: -+ reset_control_assert(eqos->rst); -+reset_phy: -+ gpiod_set_value(eqos->reset, 1); -+disable_tx: -+ clk_disable_unprepare(eqos->clk_tx); -+disable_rx: -+ clk_disable_unprepare(eqos->clk_rx); -+disable_slave: -+ clk_disable_unprepare(eqos->clk_slave); -+disable_master: -+ clk_disable_unprepare(eqos->clk_master); -+error: -+ eqos = ERR_PTR(err); -+ goto out; -+} -+ -+static int tegra_eqos_remove(struct platform_device *pdev) -+{ -+ struct tegra_eqos *eqos = get_stmmac_bsp_priv(&pdev->dev); -+ -+ reset_control_assert(eqos->rst); -+ gpiod_set_value(eqos->reset, 1); -+ clk_disable_unprepare(eqos->clk_tx); -+ clk_disable_unprepare(eqos->clk_rx); -+ clk_disable_unprepare(eqos->clk_slave); -+ clk_disable_unprepare(eqos->clk_master); -+ -+ return 0; -+} -+ -+struct dwc_eth_dwmac_data { -+ void *(*probe)(struct platform_device *pdev, -+ struct plat_stmmacenet_data *data, -+ struct stmmac_resources *res); -+ int (*remove)(struct platform_device *pdev); -+}; -+ -+static const struct dwc_eth_dwmac_data dwc_qos_data = { -+ .probe = dwc_qos_probe, -+ .remove = dwc_qos_remove, -+}; -+ -+static const struct dwc_eth_dwmac_data tegra_eqos_data = { -+ .probe = tegra_eqos_probe, -+ .remove = tegra_eqos_remove, -+}; -+ - static int dwc_eth_dwmac_probe(struct platform_device *pdev) - { -+ const struct dwc_eth_dwmac_data *data; - struct plat_stmmacenet_data *plat_dat; - struct stmmac_resources stmmac_res; - struct resource *res; -+ void *priv; - int ret; - -+ data = of_device_get_match_data(&pdev->dev); -+ - memset(&stmmac_res, 0, sizeof(struct stmmac_resources)); - - /** -@@ -138,39 +452,26 @@ static int dwc_eth_dwmac_probe(struct pl - if (IS_ERR(plat_dat)) - return PTR_ERR(plat_dat); - -- plat_dat->stmmac_clk = devm_clk_get(&pdev->dev, "apb_pclk"); -- if (IS_ERR(plat_dat->stmmac_clk)) { -- dev_err(&pdev->dev, "apb_pclk clock not found.\n"); -- ret = PTR_ERR(plat_dat->stmmac_clk); -- plat_dat->stmmac_clk = NULL; -- goto err_remove_config_dt; -+ priv = data->probe(pdev, plat_dat, &stmmac_res); -+ if (IS_ERR(priv)) { -+ ret = PTR_ERR(priv); -+ dev_err(&pdev->dev, "failed to probe subdriver: %d\n", ret); -+ goto remove_config; - } -- clk_prepare_enable(plat_dat->stmmac_clk); -- -- plat_dat->pclk = devm_clk_get(&pdev->dev, "phy_ref_clk"); -- if (IS_ERR(plat_dat->pclk)) { -- dev_err(&pdev->dev, "phy_ref_clk clock not found.\n"); -- ret = PTR_ERR(plat_dat->pclk); -- plat_dat->pclk = NULL; -- goto err_out_clk_dis_phy; -- } -- clk_prepare_enable(plat_dat->pclk); - - ret = dwc_eth_dwmac_config_dt(pdev, plat_dat); - if (ret) -- goto err_out_clk_dis_aper; -+ goto remove; - - ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); - if (ret) -- goto err_out_clk_dis_aper; -+ goto remove; - -- return 0; -+ return ret; - --err_out_clk_dis_aper: -- clk_disable_unprepare(plat_dat->pclk); --err_out_clk_dis_phy: -- clk_disable_unprepare(plat_dat->stmmac_clk); --err_remove_config_dt: -+remove: -+ data->remove(pdev); -+remove_config: - stmmac_remove_config_dt(pdev, plat_dat); - - return ret; -@@ -178,11 +479,29 @@ err_remove_config_dt: - - static int dwc_eth_dwmac_remove(struct platform_device *pdev) - { -- return stmmac_pltfr_remove(pdev); -+ struct net_device *ndev = platform_get_drvdata(pdev); -+ struct stmmac_priv *priv = netdev_priv(ndev); -+ const struct dwc_eth_dwmac_data *data; -+ int err; -+ -+ data = of_device_get_match_data(&pdev->dev); -+ -+ err = stmmac_dvr_remove(&pdev->dev); -+ if (err < 0) -+ dev_err(&pdev->dev, "failed to remove platform: %d\n", err); -+ -+ err = data->remove(pdev); -+ if (err < 0) -+ dev_err(&pdev->dev, "failed to remove subdriver: %d\n", err); -+ -+ stmmac_remove_config_dt(pdev, priv->plat); -+ -+ return err; - } - - static const struct of_device_id dwc_eth_dwmac_match[] = { -- { .compatible = "snps,dwc-qos-ethernet-4.10", }, -+ { .compatible = "snps,dwc-qos-ethernet-4.10", .data = &dwc_qos_data }, -+ { .compatible = "nvidia,tegra186-eqos", .data = &tegra_eqos_data }, - { } - }; - MODULE_DEVICE_TABLE(of, dwc_eth_dwmac_match); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c -@@ -74,6 +74,10 @@ struct rk_priv_data { - #define GRF_BIT(nr) (BIT(nr) | BIT(nr+16)) - #define GRF_CLR_BIT(nr) (BIT(nr+16)) - -+#define DELAY_ENABLE(soc, tx, rx) \ -+ (((tx) ? soc##_GMAC_TXCLK_DLY_ENABLE : soc##_GMAC_TXCLK_DLY_DISABLE) | \ -+ ((rx) ? soc##_GMAC_RXCLK_DLY_ENABLE : soc##_GMAC_RXCLK_DLY_DISABLE)) -+ - #define RK3228_GRF_MAC_CON0 0x0900 - #define RK3228_GRF_MAC_CON1 0x0904 - -@@ -115,8 +119,7 @@ static void rk3228_set_to_rgmii(struct r - regmap_write(bsp_priv->grf, RK3228_GRF_MAC_CON1, - RK3228_GMAC_PHY_INTF_SEL_RGMII | - RK3228_GMAC_RMII_MODE_CLR | -- RK3228_GMAC_RXCLK_DLY_ENABLE | -- RK3228_GMAC_TXCLK_DLY_ENABLE); -+ DELAY_ENABLE(RK3228, tx_delay, rx_delay)); - - regmap_write(bsp_priv->grf, RK3228_GRF_MAC_CON0, - RK3228_GMAC_CLK_RX_DL_CFG(rx_delay) | -@@ -232,8 +235,7 @@ static void rk3288_set_to_rgmii(struct r - RK3288_GMAC_PHY_INTF_SEL_RGMII | - RK3288_GMAC_RMII_MODE_CLR); - regmap_write(bsp_priv->grf, RK3288_GRF_SOC_CON3, -- RK3288_GMAC_RXCLK_DLY_ENABLE | -- RK3288_GMAC_TXCLK_DLY_ENABLE | -+ DELAY_ENABLE(RK3288, tx_delay, rx_delay) | - RK3288_GMAC_CLK_RX_DL_CFG(rx_delay) | - RK3288_GMAC_CLK_TX_DL_CFG(tx_delay)); - } -@@ -460,8 +462,7 @@ static void rk3366_set_to_rgmii(struct r - RK3366_GMAC_PHY_INTF_SEL_RGMII | - RK3366_GMAC_RMII_MODE_CLR); - regmap_write(bsp_priv->grf, RK3366_GRF_SOC_CON7, -- RK3366_GMAC_RXCLK_DLY_ENABLE | -- RK3366_GMAC_TXCLK_DLY_ENABLE | -+ DELAY_ENABLE(RK3366, tx_delay, rx_delay) | - RK3366_GMAC_CLK_RX_DL_CFG(rx_delay) | - RK3366_GMAC_CLK_TX_DL_CFG(tx_delay)); - } -@@ -572,8 +573,7 @@ static void rk3368_set_to_rgmii(struct r - RK3368_GMAC_PHY_INTF_SEL_RGMII | - RK3368_GMAC_RMII_MODE_CLR); - regmap_write(bsp_priv->grf, RK3368_GRF_SOC_CON16, -- RK3368_GMAC_RXCLK_DLY_ENABLE | -- RK3368_GMAC_TXCLK_DLY_ENABLE | -+ DELAY_ENABLE(RK3368, tx_delay, rx_delay) | - RK3368_GMAC_CLK_RX_DL_CFG(rx_delay) | - RK3368_GMAC_CLK_TX_DL_CFG(tx_delay)); - } -@@ -684,8 +684,7 @@ static void rk3399_set_to_rgmii(struct r - RK3399_GMAC_PHY_INTF_SEL_RGMII | - RK3399_GMAC_RMII_MODE_CLR); - regmap_write(bsp_priv->grf, RK3399_GRF_SOC_CON6, -- RK3399_GMAC_RXCLK_DLY_ENABLE | -- RK3399_GMAC_TXCLK_DLY_ENABLE | -+ DELAY_ENABLE(RK3399, tx_delay, rx_delay) | - RK3399_GMAC_CLK_RX_DL_CFG(rx_delay) | - RK3399_GMAC_CLK_TX_DL_CFG(tx_delay)); - } -@@ -985,14 +984,29 @@ static int rk_gmac_powerup(struct rk_pri - return ret; - - /*rmii or rgmii*/ -- if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) { -+ switch (bsp_priv->phy_iface) { -+ case PHY_INTERFACE_MODE_RGMII: - dev_info(dev, "init for RGMII\n"); - bsp_priv->ops->set_to_rgmii(bsp_priv, bsp_priv->tx_delay, - bsp_priv->rx_delay); -- } else if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII) { -+ break; -+ case PHY_INTERFACE_MODE_RGMII_ID: -+ dev_info(dev, "init for RGMII_ID\n"); -+ bsp_priv->ops->set_to_rgmii(bsp_priv, 0, 0); -+ break; -+ case PHY_INTERFACE_MODE_RGMII_RXID: -+ dev_info(dev, "init for RGMII_RXID\n"); -+ bsp_priv->ops->set_to_rgmii(bsp_priv, bsp_priv->tx_delay, 0); -+ break; -+ case PHY_INTERFACE_MODE_RGMII_TXID: -+ dev_info(dev, "init for RGMII_TXID\n"); -+ bsp_priv->ops->set_to_rgmii(bsp_priv, 0, bsp_priv->rx_delay); -+ break; -+ case PHY_INTERFACE_MODE_RMII: - dev_info(dev, "init for RMII\n"); - bsp_priv->ops->set_to_rmii(bsp_priv); -- } else { -+ break; -+ default: - dev_err(dev, "NO interface defined!\n"); - } - -@@ -1022,12 +1036,19 @@ static void rk_fix_speed(void *priv, uns - struct rk_priv_data *bsp_priv = priv; - struct device *dev = &bsp_priv->pdev->dev; - -- if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RGMII) -+ switch (bsp_priv->phy_iface) { -+ case PHY_INTERFACE_MODE_RGMII: -+ case PHY_INTERFACE_MODE_RGMII_ID: -+ case PHY_INTERFACE_MODE_RGMII_RXID: -+ case PHY_INTERFACE_MODE_RGMII_TXID: - bsp_priv->ops->set_rgmii_speed(bsp_priv, speed); -- else if (bsp_priv->phy_iface == PHY_INTERFACE_MODE_RMII) -+ break; -+ case PHY_INTERFACE_MODE_RMII: - bsp_priv->ops->set_rmii_speed(bsp_priv, speed); -- else -+ break; -+ default: - dev_err(dev, "unsupported interface %d", bsp_priv->phy_iface); -+ } - } - - static int rk_gmac_probe(struct platform_device *pdev) ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -@@ -216,7 +216,8 @@ static void dwmac1000_set_filter(struct - - - static void dwmac1000_flow_ctrl(struct mac_device_info *hw, unsigned int duplex, -- unsigned int fc, unsigned int pause_time) -+ unsigned int fc, unsigned int pause_time, -+ u32 tx_cnt) - { - void __iomem *ioaddr = hw->pcsr; - /* Set flow such that DZPQ in Mac Register 6 is 0, -@@ -412,7 +413,8 @@ static void dwmac1000_get_adv_lp(void __ - dwmac_get_adv_lp(ioaddr, GMAC_PCS_BASE, adv); - } - --static void dwmac1000_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x) -+static void dwmac1000_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x, -+ u32 rx_queues, u32 tx_queues) - { - u32 value = readl(ioaddr + GMAC_DEBUG); - -@@ -488,6 +490,7 @@ static void dwmac1000_debug(void __iomem - - static const struct stmmac_ops dwmac1000_ops = { - .core_init = dwmac1000_core_init, -+ .set_mac = stmmac_set_mac, - .rx_ipc = dwmac1000_rx_ipc_enable, - .dump_regs = dwmac1000_dump_regs, - .host_irq_status = dwmac1000_irq_status, ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -@@ -247,7 +247,8 @@ static void dwmac1000_get_hw_feature(voi - dma_cap->enh_desc = (hw_cap & DMA_HW_FEAT_ENHDESSEL) >> 24; - } - --static void dwmac1000_rx_watchdog(void __iomem *ioaddr, u32 riwt) -+static void dwmac1000_rx_watchdog(void __iomem *ioaddr, u32 riwt, -+ u32 number_chan) - { - writel(riwt, ioaddr + DMA_RX_WATCHDOG); - } ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -@@ -131,7 +131,8 @@ static void dwmac100_set_filter(struct m - } - - static void dwmac100_flow_ctrl(struct mac_device_info *hw, unsigned int duplex, -- unsigned int fc, unsigned int pause_time) -+ unsigned int fc, unsigned int pause_time, -+ u32 tx_cnt) - { - void __iomem *ioaddr = hw->pcsr; - unsigned int flow = MAC_FLOW_CTRL_ENABLE; -@@ -149,6 +150,7 @@ static void dwmac100_pmt(struct mac_devi - - static const struct stmmac_ops dwmac100_ops = { - .core_init = dwmac100_core_init, -+ .set_mac = stmmac_set_mac, - .rx_ipc = dwmac100_rx_ipc_enable, - .dump_regs = dwmac100_dump_mac_regs, - .host_irq_status = dwmac100_irq_status, ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h -@@ -22,9 +22,15 @@ - #define GMAC_HASH_TAB_32_63 0x00000014 - #define GMAC_RX_FLOW_CTRL 0x00000090 - #define GMAC_QX_TX_FLOW_CTRL(x) (0x70 + x * 4) -+#define GMAC_TXQ_PRTY_MAP0 0x98 -+#define GMAC_TXQ_PRTY_MAP1 0x9C - #define GMAC_RXQ_CTRL0 0x000000a0 -+#define GMAC_RXQ_CTRL1 0x000000a4 -+#define GMAC_RXQ_CTRL2 0x000000a8 -+#define GMAC_RXQ_CTRL3 0x000000ac - #define GMAC_INT_STATUS 0x000000b0 - #define GMAC_INT_EN 0x000000b4 -+#define GMAC_1US_TIC_COUNTER 0x000000dc - #define GMAC_PCS_BASE 0x000000e0 - #define GMAC_PHYIF_CONTROL_STATUS 0x000000f8 - #define GMAC_PMT 0x000000c0 -@@ -38,6 +44,22 @@ - #define GMAC_ADDR_HIGH(reg) (0x300 + reg * 8) - #define GMAC_ADDR_LOW(reg) (0x304 + reg * 8) - -+/* RX Queues Routing */ -+#define GMAC_RXQCTRL_AVCPQ_MASK GENMASK(2, 0) -+#define GMAC_RXQCTRL_AVCPQ_SHIFT 0 -+#define GMAC_RXQCTRL_PTPQ_MASK GENMASK(6, 4) -+#define GMAC_RXQCTRL_PTPQ_SHIFT 4 -+#define GMAC_RXQCTRL_DCBCPQ_MASK GENMASK(10, 8) -+#define GMAC_RXQCTRL_DCBCPQ_SHIFT 8 -+#define GMAC_RXQCTRL_UPQ_MASK GENMASK(14, 12) -+#define GMAC_RXQCTRL_UPQ_SHIFT 12 -+#define GMAC_RXQCTRL_MCBCQ_MASK GENMASK(18, 16) -+#define GMAC_RXQCTRL_MCBCQ_SHIFT 16 -+#define GMAC_RXQCTRL_MCBCQEN BIT(20) -+#define GMAC_RXQCTRL_MCBCQEN_SHIFT 20 -+#define GMAC_RXQCTRL_TACPQE BIT(21) -+#define GMAC_RXQCTRL_TACPQE_SHIFT 21 -+ - /* MAC Packet Filtering */ - #define GMAC_PACKET_FILTER_PR BIT(0) - #define GMAC_PACKET_FILTER_HMC BIT(2) -@@ -53,6 +75,14 @@ - /* MAC Flow Control RX */ - #define GMAC_RX_FLOW_CTRL_RFE BIT(0) - -+/* RX Queues Priorities */ -+#define GMAC_RXQCTRL_PSRQX_MASK(x) GENMASK(7 + ((x) * 8), 0 + ((x) * 8)) -+#define GMAC_RXQCTRL_PSRQX_SHIFT(x) ((x) * 8) -+ -+/* TX Queues Priorities */ -+#define GMAC_TXQCTRL_PSTQX_MASK(x) GENMASK(7 + ((x) * 8), 0 + ((x) * 8)) -+#define GMAC_TXQCTRL_PSTQX_SHIFT(x) ((x) * 8) -+ - /* MAC Flow Control TX */ - #define GMAC_TX_FLOW_CTRL_TFE BIT(1) - #define GMAC_TX_FLOW_CTRL_PT_SHIFT 16 -@@ -148,6 +178,8 @@ enum power_event { - /* MAC HW features1 bitmap */ - #define GMAC_HW_FEAT_AVSEL BIT(20) - #define GMAC_HW_TSOEN BIT(18) -+#define GMAC_HW_TXFIFOSIZE GENMASK(10, 6) -+#define GMAC_HW_RXFIFOSIZE GENMASK(4, 0) - - /* MAC HW features2 bitmap */ - #define GMAC_HW_FEAT_TXCHCNT GENMASK(21, 18) -@@ -161,8 +193,25 @@ enum power_event { - #define GMAC_HI_REG_AE BIT(31) - - /* MTL registers */ -+#define MTL_OPERATION_MODE 0x00000c00 -+#define MTL_OPERATION_SCHALG_MASK GENMASK(6, 5) -+#define MTL_OPERATION_SCHALG_WRR (0x0 << 5) -+#define MTL_OPERATION_SCHALG_WFQ (0x1 << 5) -+#define MTL_OPERATION_SCHALG_DWRR (0x2 << 5) -+#define MTL_OPERATION_SCHALG_SP (0x3 << 5) -+#define MTL_OPERATION_RAA BIT(2) -+#define MTL_OPERATION_RAA_SP (0x0 << 2) -+#define MTL_OPERATION_RAA_WSP (0x1 << 2) -+ - #define MTL_INT_STATUS 0x00000c20 --#define MTL_INT_Q0 BIT(0) -+#define MTL_INT_QX(x) BIT(x) -+ -+#define MTL_RXQ_DMA_MAP0 0x00000c30 /* queue 0 to 3 */ -+#define MTL_RXQ_DMA_MAP1 0x00000c34 /* queue 4 to 7 */ -+#define MTL_RXQ_DMA_Q04MDMACH_MASK GENMASK(3, 0) -+#define MTL_RXQ_DMA_Q04MDMACH(x) ((x) << 0) -+#define MTL_RXQ_DMA_QXMDMACH_MASK(x) GENMASK(11 + (8 * ((x) - 1)), 8 * (x)) -+#define MTL_RXQ_DMA_QXMDMACH(chan, q) ((chan) << (8 * (q))) - - #define MTL_CHAN_BASE_ADDR 0x00000d00 - #define MTL_CHAN_BASE_OFFSET 0x40 -@@ -180,6 +229,7 @@ enum power_event { - #define MTL_OP_MODE_TSF BIT(1) - - #define MTL_OP_MODE_TQS_MASK GENMASK(24, 16) -+#define MTL_OP_MODE_TQS_SHIFT 16 - - #define MTL_OP_MODE_TTC_MASK 0x70 - #define MTL_OP_MODE_TTC_SHIFT 4 -@@ -193,6 +243,17 @@ enum power_event { - #define MTL_OP_MODE_TTC_384 (6 << MTL_OP_MODE_TTC_SHIFT) - #define MTL_OP_MODE_TTC_512 (7 << MTL_OP_MODE_TTC_SHIFT) - -+#define MTL_OP_MODE_RQS_MASK GENMASK(29, 20) -+#define MTL_OP_MODE_RQS_SHIFT 20 -+ -+#define MTL_OP_MODE_RFD_MASK GENMASK(19, 14) -+#define MTL_OP_MODE_RFD_SHIFT 14 -+ -+#define MTL_OP_MODE_RFA_MASK GENMASK(13, 8) -+#define MTL_OP_MODE_RFA_SHIFT 8 -+ -+#define MTL_OP_MODE_EHFC BIT(7) -+ - #define MTL_OP_MODE_RTC_MASK 0x18 - #define MTL_OP_MODE_RTC_SHIFT 3 - -@@ -201,6 +262,46 @@ enum power_event { - #define MTL_OP_MODE_RTC_96 (2 << MTL_OP_MODE_RTC_SHIFT) - #define MTL_OP_MODE_RTC_128 (3 << MTL_OP_MODE_RTC_SHIFT) - -+/* MTL ETS Control register */ -+#define MTL_ETS_CTRL_BASE_ADDR 0x00000d10 -+#define MTL_ETS_CTRL_BASE_OFFSET 0x40 -+#define MTL_ETSX_CTRL_BASE_ADDR(x) (MTL_ETS_CTRL_BASE_ADDR + \ -+ ((x) * MTL_ETS_CTRL_BASE_OFFSET)) -+ -+#define MTL_ETS_CTRL_CC BIT(3) -+#define MTL_ETS_CTRL_AVALG BIT(2) -+ -+/* MTL Queue Quantum Weight */ -+#define MTL_TXQ_WEIGHT_BASE_ADDR 0x00000d18 -+#define MTL_TXQ_WEIGHT_BASE_OFFSET 0x40 -+#define MTL_TXQX_WEIGHT_BASE_ADDR(x) (MTL_TXQ_WEIGHT_BASE_ADDR + \ -+ ((x) * MTL_TXQ_WEIGHT_BASE_OFFSET)) -+#define MTL_TXQ_WEIGHT_ISCQW_MASK GENMASK(20, 0) -+ -+/* MTL sendSlopeCredit register */ -+#define MTL_SEND_SLP_CRED_BASE_ADDR 0x00000d1c -+#define MTL_SEND_SLP_CRED_OFFSET 0x40 -+#define MTL_SEND_SLP_CREDX_BASE_ADDR(x) (MTL_SEND_SLP_CRED_BASE_ADDR + \ -+ ((x) * MTL_SEND_SLP_CRED_OFFSET)) -+ -+#define MTL_SEND_SLP_CRED_SSC_MASK GENMASK(13, 0) -+ -+/* MTL hiCredit register */ -+#define MTL_HIGH_CRED_BASE_ADDR 0x00000d20 -+#define MTL_HIGH_CRED_OFFSET 0x40 -+#define MTL_HIGH_CREDX_BASE_ADDR(x) (MTL_HIGH_CRED_BASE_ADDR + \ -+ ((x) * MTL_HIGH_CRED_OFFSET)) -+ -+#define MTL_HIGH_CRED_HC_MASK GENMASK(28, 0) -+ -+/* MTL loCredit register */ -+#define MTL_LOW_CRED_BASE_ADDR 0x00000d24 -+#define MTL_LOW_CRED_OFFSET 0x40 -+#define MTL_LOW_CREDX_BASE_ADDR(x) (MTL_LOW_CRED_BASE_ADDR + \ -+ ((x) * MTL_LOW_CRED_OFFSET)) -+ -+#define MTL_HIGH_CRED_LC_MASK GENMASK(28, 0) -+ - /* MTL debug */ - #define MTL_DEBUG_TXSTSFSTS BIT(5) - #define MTL_DEBUG_TXFSTS BIT(4) ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -@@ -59,17 +59,211 @@ static void dwmac4_core_init(struct mac_ - writel(value, ioaddr + GMAC_INT_EN); - } - --static void dwmac4_rx_queue_enable(struct mac_device_info *hw, u32 queue) -+static void dwmac4_rx_queue_enable(struct mac_device_info *hw, -+ u8 mode, u32 queue) - { - void __iomem *ioaddr = hw->pcsr; - u32 value = readl(ioaddr + GMAC_RXQ_CTRL0); - - value &= GMAC_RX_QUEUE_CLEAR(queue); -- value |= GMAC_RX_AV_QUEUE_ENABLE(queue); -+ if (mode == MTL_QUEUE_AVB) -+ value |= GMAC_RX_AV_QUEUE_ENABLE(queue); -+ else if (mode == MTL_QUEUE_DCB) -+ value |= GMAC_RX_DCB_QUEUE_ENABLE(queue); - - writel(value, ioaddr + GMAC_RXQ_CTRL0); - } - -+static void dwmac4_rx_queue_priority(struct mac_device_info *hw, -+ u32 prio, u32 queue) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 base_register; -+ u32 value; -+ -+ base_register = (queue < 4) ? GMAC_RXQ_CTRL2 : GMAC_RXQ_CTRL3; -+ -+ value = readl(ioaddr + base_register); -+ -+ value &= ~GMAC_RXQCTRL_PSRQX_MASK(queue); -+ value |= (prio << GMAC_RXQCTRL_PSRQX_SHIFT(queue)) & -+ GMAC_RXQCTRL_PSRQX_MASK(queue); -+ writel(value, ioaddr + base_register); -+} -+ -+static void dwmac4_tx_queue_priority(struct mac_device_info *hw, -+ u32 prio, u32 queue) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 base_register; -+ u32 value; -+ -+ base_register = (queue < 4) ? GMAC_TXQ_PRTY_MAP0 : GMAC_TXQ_PRTY_MAP1; -+ -+ value = readl(ioaddr + base_register); -+ -+ value &= ~GMAC_TXQCTRL_PSTQX_MASK(queue); -+ value |= (prio << GMAC_TXQCTRL_PSTQX_SHIFT(queue)) & -+ GMAC_TXQCTRL_PSTQX_MASK(queue); -+ -+ writel(value, ioaddr + base_register); -+} -+ -+static void dwmac4_tx_queue_routing(struct mac_device_info *hw, -+ u8 packet, u32 queue) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value; -+ -+ const struct stmmac_rx_routing route_possibilities[] = { -+ { GMAC_RXQCTRL_AVCPQ_MASK, GMAC_RXQCTRL_AVCPQ_SHIFT }, -+ { GMAC_RXQCTRL_PTPQ_MASK, GMAC_RXQCTRL_PTPQ_SHIFT }, -+ { GMAC_RXQCTRL_DCBCPQ_MASK, GMAC_RXQCTRL_DCBCPQ_SHIFT }, -+ { GMAC_RXQCTRL_UPQ_MASK, GMAC_RXQCTRL_UPQ_SHIFT }, -+ { GMAC_RXQCTRL_MCBCQ_MASK, GMAC_RXQCTRL_MCBCQ_SHIFT }, -+ }; -+ -+ value = readl(ioaddr + GMAC_RXQ_CTRL1); -+ -+ /* routing configuration */ -+ value &= ~route_possibilities[packet - 1].reg_mask; -+ value |= (queue << route_possibilities[packet-1].reg_shift) & -+ route_possibilities[packet - 1].reg_mask; -+ -+ /* some packets require extra ops */ -+ if (packet == PACKET_AVCPQ) { -+ value &= ~GMAC_RXQCTRL_TACPQE; -+ value |= 0x1 << GMAC_RXQCTRL_TACPQE_SHIFT; -+ } else if (packet == PACKET_MCBCQ) { -+ value &= ~GMAC_RXQCTRL_MCBCQEN; -+ value |= 0x1 << GMAC_RXQCTRL_MCBCQEN_SHIFT; -+ } -+ -+ writel(value, ioaddr + GMAC_RXQ_CTRL1); -+} -+ -+static void dwmac4_prog_mtl_rx_algorithms(struct mac_device_info *hw, -+ u32 rx_alg) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value = readl(ioaddr + MTL_OPERATION_MODE); -+ -+ value &= ~MTL_OPERATION_RAA; -+ switch (rx_alg) { -+ case MTL_RX_ALGORITHM_SP: -+ value |= MTL_OPERATION_RAA_SP; -+ break; -+ case MTL_RX_ALGORITHM_WSP: -+ value |= MTL_OPERATION_RAA_WSP; -+ break; -+ default: -+ break; -+ } -+ -+ writel(value, ioaddr + MTL_OPERATION_MODE); -+} -+ -+static void dwmac4_prog_mtl_tx_algorithms(struct mac_device_info *hw, -+ u32 tx_alg) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value = readl(ioaddr + MTL_OPERATION_MODE); -+ -+ value &= ~MTL_OPERATION_SCHALG_MASK; -+ switch (tx_alg) { -+ case MTL_TX_ALGORITHM_WRR: -+ value |= MTL_OPERATION_SCHALG_WRR; -+ break; -+ case MTL_TX_ALGORITHM_WFQ: -+ value |= MTL_OPERATION_SCHALG_WFQ; -+ break; -+ case MTL_TX_ALGORITHM_DWRR: -+ value |= MTL_OPERATION_SCHALG_DWRR; -+ break; -+ case MTL_TX_ALGORITHM_SP: -+ value |= MTL_OPERATION_SCHALG_SP; -+ break; -+ default: -+ break; -+ } -+} -+ -+static void dwmac4_set_mtl_tx_queue_weight(struct mac_device_info *hw, -+ u32 weight, u32 queue) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value = readl(ioaddr + MTL_TXQX_WEIGHT_BASE_ADDR(queue)); -+ -+ value &= ~MTL_TXQ_WEIGHT_ISCQW_MASK; -+ value |= weight & MTL_TXQ_WEIGHT_ISCQW_MASK; -+ writel(value, ioaddr + MTL_TXQX_WEIGHT_BASE_ADDR(queue)); -+} -+ -+static void dwmac4_map_mtl_dma(struct mac_device_info *hw, u32 queue, u32 chan) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value; -+ -+ if (queue < 4) -+ value = readl(ioaddr + MTL_RXQ_DMA_MAP0); -+ else -+ value = readl(ioaddr + MTL_RXQ_DMA_MAP1); -+ -+ if (queue == 0 || queue == 4) { -+ value &= ~MTL_RXQ_DMA_Q04MDMACH_MASK; -+ value |= MTL_RXQ_DMA_Q04MDMACH(chan); -+ } else { -+ value &= ~MTL_RXQ_DMA_QXMDMACH_MASK(queue); -+ value |= MTL_RXQ_DMA_QXMDMACH(chan, queue); -+ } -+ -+ if (queue < 4) -+ writel(value, ioaddr + MTL_RXQ_DMA_MAP0); -+ else -+ writel(value, ioaddr + MTL_RXQ_DMA_MAP1); -+} -+ -+static void dwmac4_config_cbs(struct mac_device_info *hw, -+ u32 send_slope, u32 idle_slope, -+ u32 high_credit, u32 low_credit, u32 queue) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 value; -+ -+ pr_debug("Queue %d configured as AVB. Parameters:\n", queue); -+ pr_debug("\tsend_slope: 0x%08x\n", send_slope); -+ pr_debug("\tidle_slope: 0x%08x\n", idle_slope); -+ pr_debug("\thigh_credit: 0x%08x\n", high_credit); -+ pr_debug("\tlow_credit: 0x%08x\n", low_credit); -+ -+ /* enable AV algorithm */ -+ value = readl(ioaddr + MTL_ETSX_CTRL_BASE_ADDR(queue)); -+ value |= MTL_ETS_CTRL_AVALG; -+ value |= MTL_ETS_CTRL_CC; -+ writel(value, ioaddr + MTL_ETSX_CTRL_BASE_ADDR(queue)); -+ -+ /* configure send slope */ -+ value = readl(ioaddr + MTL_SEND_SLP_CREDX_BASE_ADDR(queue)); -+ value &= ~MTL_SEND_SLP_CRED_SSC_MASK; -+ value |= send_slope & MTL_SEND_SLP_CRED_SSC_MASK; -+ writel(value, ioaddr + MTL_SEND_SLP_CREDX_BASE_ADDR(queue)); -+ -+ /* configure idle slope (same register as tx weight) */ -+ dwmac4_set_mtl_tx_queue_weight(hw, idle_slope, queue); -+ -+ /* configure high credit */ -+ value = readl(ioaddr + MTL_HIGH_CREDX_BASE_ADDR(queue)); -+ value &= ~MTL_HIGH_CRED_HC_MASK; -+ value |= high_credit & MTL_HIGH_CRED_HC_MASK; -+ writel(value, ioaddr + MTL_HIGH_CREDX_BASE_ADDR(queue)); -+ -+ /* configure high credit */ -+ value = readl(ioaddr + MTL_LOW_CREDX_BASE_ADDR(queue)); -+ value &= ~MTL_HIGH_CRED_LC_MASK; -+ value |= low_credit & MTL_HIGH_CRED_LC_MASK; -+ writel(value, ioaddr + MTL_LOW_CREDX_BASE_ADDR(queue)); -+} -+ - static void dwmac4_dump_regs(struct mac_device_info *hw, u32 *reg_space) - { - void __iomem *ioaddr = hw->pcsr; -@@ -251,11 +445,12 @@ static void dwmac4_set_filter(struct mac - } - - static void dwmac4_flow_ctrl(struct mac_device_info *hw, unsigned int duplex, -- unsigned int fc, unsigned int pause_time) -+ unsigned int fc, unsigned int pause_time, -+ u32 tx_cnt) - { - void __iomem *ioaddr = hw->pcsr; -- u32 channel = STMMAC_CHAN0; /* FIXME */ - unsigned int flow = 0; -+ u32 queue = 0; - - pr_debug("GMAC Flow-Control:\n"); - if (fc & FLOW_RX) { -@@ -265,13 +460,18 @@ static void dwmac4_flow_ctrl(struct mac_ - } - if (fc & FLOW_TX) { - pr_debug("\tTransmit Flow-Control ON\n"); -- flow |= GMAC_TX_FLOW_CTRL_TFE; -- writel(flow, ioaddr + GMAC_QX_TX_FLOW_CTRL(channel)); - -- if (duplex) { -+ if (duplex) - pr_debug("\tduplex mode: PAUSE %d\n", pause_time); -- flow |= (pause_time << GMAC_TX_FLOW_CTRL_PT_SHIFT); -- writel(flow, ioaddr + GMAC_QX_TX_FLOW_CTRL(channel)); -+ -+ for (queue = 0; queue < tx_cnt; queue++) { -+ flow |= GMAC_TX_FLOW_CTRL_TFE; -+ -+ if (duplex) -+ flow |= -+ (pause_time << GMAC_TX_FLOW_CTRL_PT_SHIFT); -+ -+ writel(flow, ioaddr + GMAC_QX_TX_FLOW_CTRL(queue)); - } - } - } -@@ -325,11 +525,34 @@ static void dwmac4_phystatus(void __iome - } - } - -+static int dwmac4_irq_mtl_status(struct mac_device_info *hw, u32 chan) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 mtl_int_qx_status; -+ int ret = 0; -+ -+ mtl_int_qx_status = readl(ioaddr + MTL_INT_STATUS); -+ -+ /* Check MTL Interrupt */ -+ if (mtl_int_qx_status & MTL_INT_QX(chan)) { -+ /* read Queue x Interrupt status */ -+ u32 status = readl(ioaddr + MTL_CHAN_INT_CTRL(chan)); -+ -+ if (status & MTL_RX_OVERFLOW_INT) { -+ /* clear Interrupt */ -+ writel(status | MTL_RX_OVERFLOW_INT, -+ ioaddr + MTL_CHAN_INT_CTRL(chan)); -+ ret = CORE_IRQ_MTL_RX_OVERFLOW; -+ } -+ } -+ -+ return ret; -+} -+ - static int dwmac4_irq_status(struct mac_device_info *hw, - struct stmmac_extra_stats *x) - { - void __iomem *ioaddr = hw->pcsr; -- u32 mtl_int_qx_status; - u32 intr_status; - int ret = 0; - -@@ -348,20 +571,6 @@ static int dwmac4_irq_status(struct mac_ - x->irq_receive_pmt_irq_n++; - } - -- mtl_int_qx_status = readl(ioaddr + MTL_INT_STATUS); -- /* Check MTL Interrupt: Currently only one queue is used: Q0. */ -- if (mtl_int_qx_status & MTL_INT_Q0) { -- /* read Queue 0 Interrupt status */ -- u32 status = readl(ioaddr + MTL_CHAN_INT_CTRL(STMMAC_CHAN0)); -- -- if (status & MTL_RX_OVERFLOW_INT) { -- /* clear Interrupt */ -- writel(status | MTL_RX_OVERFLOW_INT, -- ioaddr + MTL_CHAN_INT_CTRL(STMMAC_CHAN0)); -- ret = CORE_IRQ_MTL_RX_OVERFLOW; -- } -- } -- - dwmac_pcs_isr(ioaddr, GMAC_PCS_BASE, intr_status, x); - if (intr_status & PCS_RGSMIIIS_IRQ) - dwmac4_phystatus(ioaddr, x); -@@ -369,64 +578,69 @@ static int dwmac4_irq_status(struct mac_ - return ret; - } - --static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x) -+static void dwmac4_debug(void __iomem *ioaddr, struct stmmac_extra_stats *x, -+ u32 rx_queues, u32 tx_queues) - { - u32 value; -+ u32 queue; - -- /* Currently only channel 0 is supported */ -- value = readl(ioaddr + MTL_CHAN_TX_DEBUG(STMMAC_CHAN0)); -+ for (queue = 0; queue < tx_queues; queue++) { -+ value = readl(ioaddr + MTL_CHAN_TX_DEBUG(queue)); - -- if (value & MTL_DEBUG_TXSTSFSTS) -- x->mtl_tx_status_fifo_full++; -- if (value & MTL_DEBUG_TXFSTS) -- x->mtl_tx_fifo_not_empty++; -- if (value & MTL_DEBUG_TWCSTS) -- x->mmtl_fifo_ctrl++; -- if (value & MTL_DEBUG_TRCSTS_MASK) { -- u32 trcsts = (value & MTL_DEBUG_TRCSTS_MASK) -- >> MTL_DEBUG_TRCSTS_SHIFT; -- if (trcsts == MTL_DEBUG_TRCSTS_WRITE) -- x->mtl_tx_fifo_read_ctrl_write++; -- else if (trcsts == MTL_DEBUG_TRCSTS_TXW) -- x->mtl_tx_fifo_read_ctrl_wait++; -- else if (trcsts == MTL_DEBUG_TRCSTS_READ) -- x->mtl_tx_fifo_read_ctrl_read++; -- else -- x->mtl_tx_fifo_read_ctrl_idle++; -+ if (value & MTL_DEBUG_TXSTSFSTS) -+ x->mtl_tx_status_fifo_full++; -+ if (value & MTL_DEBUG_TXFSTS) -+ x->mtl_tx_fifo_not_empty++; -+ if (value & MTL_DEBUG_TWCSTS) -+ x->mmtl_fifo_ctrl++; -+ if (value & MTL_DEBUG_TRCSTS_MASK) { -+ u32 trcsts = (value & MTL_DEBUG_TRCSTS_MASK) -+ >> MTL_DEBUG_TRCSTS_SHIFT; -+ if (trcsts == MTL_DEBUG_TRCSTS_WRITE) -+ x->mtl_tx_fifo_read_ctrl_write++; -+ else if (trcsts == MTL_DEBUG_TRCSTS_TXW) -+ x->mtl_tx_fifo_read_ctrl_wait++; -+ else if (trcsts == MTL_DEBUG_TRCSTS_READ) -+ x->mtl_tx_fifo_read_ctrl_read++; -+ else -+ x->mtl_tx_fifo_read_ctrl_idle++; -+ } -+ if (value & MTL_DEBUG_TXPAUSED) -+ x->mac_tx_in_pause++; - } -- if (value & MTL_DEBUG_TXPAUSED) -- x->mac_tx_in_pause++; - -- value = readl(ioaddr + MTL_CHAN_RX_DEBUG(STMMAC_CHAN0)); -+ for (queue = 0; queue < rx_queues; queue++) { -+ value = readl(ioaddr + MTL_CHAN_RX_DEBUG(queue)); - -- if (value & MTL_DEBUG_RXFSTS_MASK) { -- u32 rxfsts = (value & MTL_DEBUG_RXFSTS_MASK) -- >> MTL_DEBUG_RRCSTS_SHIFT; -- -- if (rxfsts == MTL_DEBUG_RXFSTS_FULL) -- x->mtl_rx_fifo_fill_level_full++; -- else if (rxfsts == MTL_DEBUG_RXFSTS_AT) -- x->mtl_rx_fifo_fill_above_thresh++; -- else if (rxfsts == MTL_DEBUG_RXFSTS_BT) -- x->mtl_rx_fifo_fill_below_thresh++; -- else -- x->mtl_rx_fifo_fill_level_empty++; -- } -- if (value & MTL_DEBUG_RRCSTS_MASK) { -- u32 rrcsts = (value & MTL_DEBUG_RRCSTS_MASK) >> -- MTL_DEBUG_RRCSTS_SHIFT; -- -- if (rrcsts == MTL_DEBUG_RRCSTS_FLUSH) -- x->mtl_rx_fifo_read_ctrl_flush++; -- else if (rrcsts == MTL_DEBUG_RRCSTS_RSTAT) -- x->mtl_rx_fifo_read_ctrl_read_data++; -- else if (rrcsts == MTL_DEBUG_RRCSTS_RDATA) -- x->mtl_rx_fifo_read_ctrl_status++; -- else -- x->mtl_rx_fifo_read_ctrl_idle++; -+ if (value & MTL_DEBUG_RXFSTS_MASK) { -+ u32 rxfsts = (value & MTL_DEBUG_RXFSTS_MASK) -+ >> MTL_DEBUG_RRCSTS_SHIFT; -+ -+ if (rxfsts == MTL_DEBUG_RXFSTS_FULL) -+ x->mtl_rx_fifo_fill_level_full++; -+ else if (rxfsts == MTL_DEBUG_RXFSTS_AT) -+ x->mtl_rx_fifo_fill_above_thresh++; -+ else if (rxfsts == MTL_DEBUG_RXFSTS_BT) -+ x->mtl_rx_fifo_fill_below_thresh++; -+ else -+ x->mtl_rx_fifo_fill_level_empty++; -+ } -+ if (value & MTL_DEBUG_RRCSTS_MASK) { -+ u32 rrcsts = (value & MTL_DEBUG_RRCSTS_MASK) >> -+ MTL_DEBUG_RRCSTS_SHIFT; -+ -+ if (rrcsts == MTL_DEBUG_RRCSTS_FLUSH) -+ x->mtl_rx_fifo_read_ctrl_flush++; -+ else if (rrcsts == MTL_DEBUG_RRCSTS_RSTAT) -+ x->mtl_rx_fifo_read_ctrl_read_data++; -+ else if (rrcsts == MTL_DEBUG_RRCSTS_RDATA) -+ x->mtl_rx_fifo_read_ctrl_status++; -+ else -+ x->mtl_rx_fifo_read_ctrl_idle++; -+ } -+ if (value & MTL_DEBUG_RWCSTS) -+ x->mtl_rx_fifo_ctrl_active++; - } -- if (value & MTL_DEBUG_RWCSTS) -- x->mtl_rx_fifo_ctrl_active++; - - /* GMAC debug */ - value = readl(ioaddr + GMAC_DEBUG); -@@ -455,10 +669,51 @@ static void dwmac4_debug(void __iomem *i - - static const struct stmmac_ops dwmac4_ops = { - .core_init = dwmac4_core_init, -+ .set_mac = stmmac_set_mac, - .rx_ipc = dwmac4_rx_ipc_enable, - .rx_queue_enable = dwmac4_rx_queue_enable, -+ .rx_queue_prio = dwmac4_rx_queue_priority, -+ .tx_queue_prio = dwmac4_tx_queue_priority, -+ .rx_queue_routing = dwmac4_tx_queue_routing, -+ .prog_mtl_rx_algorithms = dwmac4_prog_mtl_rx_algorithms, -+ .prog_mtl_tx_algorithms = dwmac4_prog_mtl_tx_algorithms, -+ .set_mtl_tx_queue_weight = dwmac4_set_mtl_tx_queue_weight, -+ .map_mtl_to_dma = dwmac4_map_mtl_dma, -+ .config_cbs = dwmac4_config_cbs, - .dump_regs = dwmac4_dump_regs, - .host_irq_status = dwmac4_irq_status, -+ .host_mtl_irq_status = dwmac4_irq_mtl_status, -+ .flow_ctrl = dwmac4_flow_ctrl, -+ .pmt = dwmac4_pmt, -+ .set_umac_addr = dwmac4_set_umac_addr, -+ .get_umac_addr = dwmac4_get_umac_addr, -+ .set_eee_mode = dwmac4_set_eee_mode, -+ .reset_eee_mode = dwmac4_reset_eee_mode, -+ .set_eee_timer = dwmac4_set_eee_timer, -+ .set_eee_pls = dwmac4_set_eee_pls, -+ .pcs_ctrl_ane = dwmac4_ctrl_ane, -+ .pcs_rane = dwmac4_rane, -+ .pcs_get_adv_lp = dwmac4_get_adv_lp, -+ .debug = dwmac4_debug, -+ .set_filter = dwmac4_set_filter, -+}; -+ -+static const struct stmmac_ops dwmac410_ops = { -+ .core_init = dwmac4_core_init, -+ .set_mac = stmmac_dwmac4_set_mac, -+ .rx_ipc = dwmac4_rx_ipc_enable, -+ .rx_queue_enable = dwmac4_rx_queue_enable, -+ .rx_queue_prio = dwmac4_rx_queue_priority, -+ .tx_queue_prio = dwmac4_tx_queue_priority, -+ .rx_queue_routing = dwmac4_tx_queue_routing, -+ .prog_mtl_rx_algorithms = dwmac4_prog_mtl_rx_algorithms, -+ .prog_mtl_tx_algorithms = dwmac4_prog_mtl_tx_algorithms, -+ .set_mtl_tx_queue_weight = dwmac4_set_mtl_tx_queue_weight, -+ .map_mtl_to_dma = dwmac4_map_mtl_dma, -+ .config_cbs = dwmac4_config_cbs, -+ .dump_regs = dwmac4_dump_regs, -+ .host_irq_status = dwmac4_irq_status, -+ .host_mtl_irq_status = dwmac4_irq_mtl_status, - .flow_ctrl = dwmac4_flow_ctrl, - .pmt = dwmac4_pmt, - .set_umac_addr = dwmac4_set_umac_addr, -@@ -492,8 +747,6 @@ struct mac_device_info *dwmac4_setup(voi - if (mac->multicast_filter_bins) - mac->mcast_bits_log2 = ilog2(mac->multicast_filter_bins); - -- mac->mac = &dwmac4_ops; -- - mac->link.port = GMAC_CONFIG_PS; - mac->link.duplex = GMAC_CONFIG_DM; - mac->link.speed = GMAC_CONFIG_FES; -@@ -514,5 +767,10 @@ struct mac_device_info *dwmac4_setup(voi - else - mac->dma = &dwmac4_dma_ops; - -+ if (*synopsys_id >= DWMAC_CORE_4_00) -+ mac->mac = &dwmac410_ops; -+ else -+ mac->mac = &dwmac4_ops; -+ - return mac; - } ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c -@@ -214,13 +214,13 @@ static int dwmac4_wrback_get_tx_timestam - { - /* Context type from W/B descriptor must be zero */ - if (le32_to_cpu(p->des3) & TDES3_CONTEXT_TYPE) -- return -EINVAL; -+ return 0; - - /* Tx Timestamp Status is 1 so des0 and des1'll have valid values */ - if (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS) -- return 0; -+ return 1; - -- return 1; -+ return 0; - } - - static inline u64 dwmac4_get_timestamp(void *desc, u32 ats) -@@ -282,7 +282,10 @@ static int dwmac4_wrback_get_rx_timestam - } - } - exit: -- return ret; -+ if (likely(ret == 0)) -+ return 1; -+ -+ return 0; - } - - static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic, -@@ -304,12 +307,13 @@ static void dwmac4_rd_init_tx_desc(struc - - static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, - bool csum_flag, int mode, bool tx_own, -- bool ls) -+ bool ls, unsigned int tot_pkt_len) - { - unsigned int tdes3 = le32_to_cpu(p->des3); - - p->des2 |= cpu_to_le32(len & TDES2_BUFFER1_SIZE_MASK); - -+ tdes3 |= tot_pkt_len & TDES3_PACKET_SIZE_MASK; - if (is_fs) - tdes3 |= TDES3_FIRST_DESCRIPTOR; - else ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -@@ -71,36 +71,48 @@ static void dwmac4_dma_axi(void __iomem - writel(value, ioaddr + DMA_SYS_BUS_MODE); - } - --static void dwmac4_dma_init_channel(void __iomem *ioaddr, -- struct stmmac_dma_cfg *dma_cfg, -- u32 dma_tx_phy, u32 dma_rx_phy, -- u32 channel) -+void dwmac4_dma_init_rx_chan(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_rx_phy, u32 chan) - { - u32 value; -- int txpbl = dma_cfg->txpbl ?: dma_cfg->pbl; -- int rxpbl = dma_cfg->rxpbl ?: dma_cfg->pbl; -+ u32 rxpbl = dma_cfg->rxpbl ?: dma_cfg->pbl; - -- /* set PBL for each channels. Currently we affect same configuration -- * on each channel -- */ -- value = readl(ioaddr + DMA_CHAN_CONTROL(channel)); -- if (dma_cfg->pblx8) -- value = value | DMA_BUS_MODE_PBL; -- writel(value, ioaddr + DMA_CHAN_CONTROL(channel)); -+ value = readl(ioaddr + DMA_CHAN_RX_CONTROL(chan)); -+ value = value | (rxpbl << DMA_BUS_MODE_RPBL_SHIFT); -+ writel(value, ioaddr + DMA_CHAN_RX_CONTROL(chan)); -+ -+ writel(dma_rx_phy, ioaddr + DMA_CHAN_RX_BASE_ADDR(chan)); -+} - -- value = readl(ioaddr + DMA_CHAN_TX_CONTROL(channel)); -+void dwmac4_dma_init_tx_chan(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx_phy, u32 chan) -+{ -+ u32 value; -+ u32 txpbl = dma_cfg->txpbl ?: dma_cfg->pbl; -+ -+ value = readl(ioaddr + DMA_CHAN_TX_CONTROL(chan)); - value = value | (txpbl << DMA_BUS_MODE_PBL_SHIFT); -- writel(value, ioaddr + DMA_CHAN_TX_CONTROL(channel)); -+ writel(value, ioaddr + DMA_CHAN_TX_CONTROL(chan)); - -- value = readl(ioaddr + DMA_CHAN_RX_CONTROL(channel)); -- value = value | (rxpbl << DMA_BUS_MODE_RPBL_SHIFT); -- writel(value, ioaddr + DMA_CHAN_RX_CONTROL(channel)); -+ writel(dma_tx_phy, ioaddr + DMA_CHAN_TX_BASE_ADDR(chan)); -+} - -- /* Mask interrupts by writing to CSR7 */ -- writel(DMA_CHAN_INTR_DEFAULT_MASK, ioaddr + DMA_CHAN_INTR_ENA(channel)); -+void dwmac4_dma_init_channel(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, u32 chan) -+{ -+ u32 value; -+ -+ /* common channel control register config */ -+ value = readl(ioaddr + DMA_CHAN_CONTROL(chan)); -+ if (dma_cfg->pblx8) -+ value = value | DMA_BUS_MODE_PBL; -+ writel(value, ioaddr + DMA_CHAN_CONTROL(chan)); - -- writel(dma_tx_phy, ioaddr + DMA_CHAN_TX_BASE_ADDR(channel)); -- writel(dma_rx_phy, ioaddr + DMA_CHAN_RX_BASE_ADDR(channel)); -+ /* Mask interrupts by writing to CSR7 */ -+ writel(DMA_CHAN_INTR_DEFAULT_MASK, -+ ioaddr + DMA_CHAN_INTR_ENA(chan)); - } - - static void dwmac4_dma_init(void __iomem *ioaddr, -@@ -108,7 +120,6 @@ static void dwmac4_dma_init(void __iomem - u32 dma_tx, u32 dma_rx, int atds) - { - u32 value = readl(ioaddr + DMA_SYS_BUS_MODE); -- int i; - - /* Set the Fixed burst mode */ - if (dma_cfg->fixed_burst) -@@ -122,9 +133,6 @@ static void dwmac4_dma_init(void __iomem - value |= DMA_SYS_BUS_AAL; - - writel(value, ioaddr + DMA_SYS_BUS_MODE); -- -- for (i = 0; i < DMA_CHANNEL_NB_MAX; i++) -- dwmac4_dma_init_channel(ioaddr, dma_cfg, dma_tx, dma_rx, i); - } - - static void _dwmac4_dump_dma_regs(void __iomem *ioaddr, u32 channel, -@@ -174,46 +182,121 @@ static void dwmac4_dump_dma_regs(void __ - _dwmac4_dump_dma_regs(ioaddr, i, reg_space); - } - --static void dwmac4_rx_watchdog(void __iomem *ioaddr, u32 riwt) -+static void dwmac4_rx_watchdog(void __iomem *ioaddr, u32 riwt, u32 number_chan) - { -- int i; -+ u32 chan; - -- for (i = 0; i < DMA_CHANNEL_NB_MAX; i++) -- writel(riwt, ioaddr + DMA_CHAN_RX_WATCHDOG(i)); -+ for (chan = 0; chan < number_chan; chan++) -+ writel(riwt, ioaddr + DMA_CHAN_RX_WATCHDOG(chan)); - } - --static void dwmac4_dma_chan_op_mode(void __iomem *ioaddr, int txmode, -- int rxmode, u32 channel) -+static void dwmac4_dma_rx_chan_op_mode(void __iomem *ioaddr, int mode, -+ u32 channel, int fifosz) - { -- u32 mtl_tx_op, mtl_rx_op, mtl_rx_int; -+ unsigned int rqs = fifosz / 256 - 1; -+ u32 mtl_rx_op, mtl_rx_int; - -- /* Following code only done for channel 0, other channels not yet -- * supported. -- */ -- mtl_tx_op = readl(ioaddr + MTL_CHAN_TX_OP_MODE(channel)); -+ mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel)); -+ -+ if (mode == SF_DMA_MODE) { -+ pr_debug("GMAC: enable RX store and forward mode\n"); -+ mtl_rx_op |= MTL_OP_MODE_RSF; -+ } else { -+ pr_debug("GMAC: disable RX SF mode (threshold %d)\n", mode); -+ mtl_rx_op &= ~MTL_OP_MODE_RSF; -+ mtl_rx_op &= MTL_OP_MODE_RTC_MASK; -+ if (mode <= 32) -+ mtl_rx_op |= MTL_OP_MODE_RTC_32; -+ else if (mode <= 64) -+ mtl_rx_op |= MTL_OP_MODE_RTC_64; -+ else if (mode <= 96) -+ mtl_rx_op |= MTL_OP_MODE_RTC_96; -+ else -+ mtl_rx_op |= MTL_OP_MODE_RTC_128; -+ } -+ -+ mtl_rx_op &= ~MTL_OP_MODE_RQS_MASK; -+ mtl_rx_op |= rqs << MTL_OP_MODE_RQS_SHIFT; -+ -+ /* enable flow control only if each channel gets 4 KiB or more FIFO */ -+ if (fifosz >= 4096) { -+ unsigned int rfd, rfa; -+ -+ mtl_rx_op |= MTL_OP_MODE_EHFC; -+ -+ /* Set Threshold for Activating Flow Control to min 2 frames, -+ * i.e. 1500 * 2 = 3000 bytes. -+ * -+ * Set Threshold for Deactivating Flow Control to min 1 frame, -+ * i.e. 1500 bytes. -+ */ -+ switch (fifosz) { -+ case 4096: -+ /* This violates the above formula because of FIFO size -+ * limit therefore overflow may occur in spite of this. -+ */ -+ rfd = 0x03; /* Full-2.5K */ -+ rfa = 0x01; /* Full-1.5K */ -+ break; -+ -+ case 8192: -+ rfd = 0x06; /* Full-4K */ -+ rfa = 0x0a; /* Full-6K */ -+ break; -+ -+ case 16384: -+ rfd = 0x06; /* Full-4K */ -+ rfa = 0x12; /* Full-10K */ -+ break; -+ -+ default: -+ rfd = 0x06; /* Full-4K */ -+ rfa = 0x1e; /* Full-16K */ -+ break; -+ } - -- if (txmode == SF_DMA_MODE) { -+ mtl_rx_op &= ~MTL_OP_MODE_RFD_MASK; -+ mtl_rx_op |= rfd << MTL_OP_MODE_RFD_SHIFT; -+ -+ mtl_rx_op &= ~MTL_OP_MODE_RFA_MASK; -+ mtl_rx_op |= rfa << MTL_OP_MODE_RFA_SHIFT; -+ } -+ -+ writel(mtl_rx_op, ioaddr + MTL_CHAN_RX_OP_MODE(channel)); -+ -+ /* Enable MTL RX overflow */ -+ mtl_rx_int = readl(ioaddr + MTL_CHAN_INT_CTRL(channel)); -+ writel(mtl_rx_int | MTL_RX_OVERFLOW_INT_EN, -+ ioaddr + MTL_CHAN_INT_CTRL(channel)); -+} -+ -+static void dwmac4_dma_tx_chan_op_mode(void __iomem *ioaddr, int mode, -+ u32 channel) -+{ -+ u32 mtl_tx_op = readl(ioaddr + MTL_CHAN_TX_OP_MODE(channel)); -+ -+ if (mode == SF_DMA_MODE) { - pr_debug("GMAC: enable TX store and forward mode\n"); - /* Transmit COE type 2 cannot be done in cut-through mode. */ - mtl_tx_op |= MTL_OP_MODE_TSF; - } else { -- pr_debug("GMAC: disabling TX SF (threshold %d)\n", txmode); -+ pr_debug("GMAC: disabling TX SF (threshold %d)\n", mode); - mtl_tx_op &= ~MTL_OP_MODE_TSF; - mtl_tx_op &= MTL_OP_MODE_TTC_MASK; - /* Set the transmit threshold */ -- if (txmode <= 32) -+ if (mode <= 32) - mtl_tx_op |= MTL_OP_MODE_TTC_32; -- else if (txmode <= 64) -+ else if (mode <= 64) - mtl_tx_op |= MTL_OP_MODE_TTC_64; -- else if (txmode <= 96) -+ else if (mode <= 96) - mtl_tx_op |= MTL_OP_MODE_TTC_96; -- else if (txmode <= 128) -+ else if (mode <= 128) - mtl_tx_op |= MTL_OP_MODE_TTC_128; -- else if (txmode <= 192) -+ else if (mode <= 192) - mtl_tx_op |= MTL_OP_MODE_TTC_192; -- else if (txmode <= 256) -+ else if (mode <= 256) - mtl_tx_op |= MTL_OP_MODE_TTC_256; -- else if (txmode <= 384) -+ else if (mode <= 384) - mtl_tx_op |= MTL_OP_MODE_TTC_384; - else - mtl_tx_op |= MTL_OP_MODE_TTC_512; -@@ -230,39 +313,6 @@ static void dwmac4_dma_chan_op_mode(void - */ - mtl_tx_op |= MTL_OP_MODE_TXQEN | MTL_OP_MODE_TQS_MASK; - writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel)); -- -- mtl_rx_op = readl(ioaddr + MTL_CHAN_RX_OP_MODE(channel)); -- -- if (rxmode == SF_DMA_MODE) { -- pr_debug("GMAC: enable RX store and forward mode\n"); -- mtl_rx_op |= MTL_OP_MODE_RSF; -- } else { -- pr_debug("GMAC: disable RX SF mode (threshold %d)\n", rxmode); -- mtl_rx_op &= ~MTL_OP_MODE_RSF; -- mtl_rx_op &= MTL_OP_MODE_RTC_MASK; -- if (rxmode <= 32) -- mtl_rx_op |= MTL_OP_MODE_RTC_32; -- else if (rxmode <= 64) -- mtl_rx_op |= MTL_OP_MODE_RTC_64; -- else if (rxmode <= 96) -- mtl_rx_op |= MTL_OP_MODE_RTC_96; -- else -- mtl_rx_op |= MTL_OP_MODE_RTC_128; -- } -- -- writel(mtl_rx_op, ioaddr + MTL_CHAN_RX_OP_MODE(channel)); -- -- /* Enable MTL RX overflow */ -- mtl_rx_int = readl(ioaddr + MTL_CHAN_INT_CTRL(channel)); -- writel(mtl_rx_int | MTL_RX_OVERFLOW_INT_EN, -- ioaddr + MTL_CHAN_INT_CTRL(channel)); --} -- --static void dwmac4_dma_operation_mode(void __iomem *ioaddr, int txmode, -- int rxmode, int rxfifosz) --{ -- /* Only Channel 0 is actually configured and used */ -- dwmac4_dma_chan_op_mode(ioaddr, txmode, rxmode, 0); - } - - static void dwmac4_get_hw_feature(void __iomem *ioaddr, -@@ -294,6 +344,11 @@ static void dwmac4_get_hw_feature(void _ - hw_cap = readl(ioaddr + GMAC_HW_FEATURE1); - dma_cap->av = (hw_cap & GMAC_HW_FEAT_AVSEL) >> 20; - dma_cap->tsoen = (hw_cap & GMAC_HW_TSOEN) >> 18; -+ /* RX and TX FIFO sizes are encoded as log2(n / 128). Undo that by -+ * shifting and store the sizes in bytes. -+ */ -+ dma_cap->tx_fifo_size = 128 << ((hw_cap & GMAC_HW_TXFIFOSIZE) >> 6); -+ dma_cap->rx_fifo_size = 128 << ((hw_cap & GMAC_HW_RXFIFOSIZE) >> 0); - /* MAC HW feature2 */ - hw_cap = readl(ioaddr + GMAC_HW_FEATURE2); - /* TX and RX number of channels */ -@@ -332,9 +387,13 @@ static void dwmac4_enable_tso(void __iom - const struct stmmac_dma_ops dwmac4_dma_ops = { - .reset = dwmac4_dma_reset, - .init = dwmac4_dma_init, -+ .init_chan = dwmac4_dma_init_channel, -+ .init_rx_chan = dwmac4_dma_init_rx_chan, -+ .init_tx_chan = dwmac4_dma_init_tx_chan, - .axi = dwmac4_dma_axi, - .dump_regs = dwmac4_dump_dma_regs, -- .dma_mode = dwmac4_dma_operation_mode, -+ .dma_rx_mode = dwmac4_dma_rx_chan_op_mode, -+ .dma_tx_mode = dwmac4_dma_tx_chan_op_mode, - .enable_dma_irq = dwmac4_enable_dma_irq, - .disable_dma_irq = dwmac4_disable_dma_irq, - .start_tx = dwmac4_dma_start_tx, -@@ -354,9 +413,13 @@ const struct stmmac_dma_ops dwmac4_dma_o - const struct stmmac_dma_ops dwmac410_dma_ops = { - .reset = dwmac4_dma_reset, - .init = dwmac4_dma_init, -+ .init_chan = dwmac4_dma_init_channel, -+ .init_rx_chan = dwmac4_dma_init_rx_chan, -+ .init_tx_chan = dwmac4_dma_init_tx_chan, - .axi = dwmac4_dma_axi, - .dump_regs = dwmac4_dump_dma_regs, -- .dma_mode = dwmac4_dma_operation_mode, -+ .dma_rx_mode = dwmac4_dma_rx_chan_op_mode, -+ .dma_tx_mode = dwmac4_dma_tx_chan_op_mode, - .enable_dma_irq = dwmac410_enable_dma_irq, - .disable_dma_irq = dwmac4_disable_dma_irq, - .start_tx = dwmac4_dma_start_tx, ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h -@@ -185,17 +185,17 @@ - - int dwmac4_dma_reset(void __iomem *ioaddr); - void dwmac4_enable_dma_transmission(void __iomem *ioaddr, u32 tail_ptr); --void dwmac4_enable_dma_irq(void __iomem *ioaddr); --void dwmac410_enable_dma_irq(void __iomem *ioaddr); --void dwmac4_disable_dma_irq(void __iomem *ioaddr); --void dwmac4_dma_start_tx(void __iomem *ioaddr); --void dwmac4_dma_stop_tx(void __iomem *ioaddr); --void dwmac4_dma_start_rx(void __iomem *ioaddr); --void dwmac4_dma_stop_rx(void __iomem *ioaddr); -+void dwmac4_enable_dma_irq(void __iomem *ioaddr, u32 chan); -+void dwmac410_enable_dma_irq(void __iomem *ioaddr, u32 chan); -+void dwmac4_disable_dma_irq(void __iomem *ioaddr, u32 chan); -+void dwmac4_dma_start_tx(void __iomem *ioaddr, u32 chan); -+void dwmac4_dma_stop_tx(void __iomem *ioaddr, u32 chan); -+void dwmac4_dma_start_rx(void __iomem *ioaddr, u32 chan); -+void dwmac4_dma_stop_rx(void __iomem *ioaddr, u32 chan); - int dwmac4_dma_interrupt(void __iomem *ioaddr, -- struct stmmac_extra_stats *x); --void dwmac4_set_rx_ring_len(void __iomem *ioaddr, u32 len); --void dwmac4_set_tx_ring_len(void __iomem *ioaddr, u32 len); -+ struct stmmac_extra_stats *x, u32 chan); -+void dwmac4_set_rx_ring_len(void __iomem *ioaddr, u32 len, u32 chan); -+void dwmac4_set_tx_ring_len(void __iomem *ioaddr, u32 len, u32 chan); - void dwmac4_set_rx_tail_ptr(void __iomem *ioaddr, u32 tail_ptr, u32 chan); - void dwmac4_set_tx_tail_ptr(void __iomem *ioaddr, u32 tail_ptr, u32 chan); - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_lib.c -@@ -37,96 +37,96 @@ int dwmac4_dma_reset(void __iomem *ioadd - - void dwmac4_set_rx_tail_ptr(void __iomem *ioaddr, u32 tail_ptr, u32 chan) - { -- writel(tail_ptr, ioaddr + DMA_CHAN_RX_END_ADDR(0)); -+ writel(tail_ptr, ioaddr + DMA_CHAN_RX_END_ADDR(chan)); - } - - void dwmac4_set_tx_tail_ptr(void __iomem *ioaddr, u32 tail_ptr, u32 chan) - { -- writel(tail_ptr, ioaddr + DMA_CHAN_TX_END_ADDR(0)); -+ writel(tail_ptr, ioaddr + DMA_CHAN_TX_END_ADDR(chan)); - } - --void dwmac4_dma_start_tx(void __iomem *ioaddr) -+void dwmac4_dma_start_tx(void __iomem *ioaddr, u32 chan) - { -- u32 value = readl(ioaddr + DMA_CHAN_TX_CONTROL(STMMAC_CHAN0)); -+ u32 value = readl(ioaddr + DMA_CHAN_TX_CONTROL(chan)); - - value |= DMA_CONTROL_ST; -- writel(value, ioaddr + DMA_CHAN_TX_CONTROL(STMMAC_CHAN0)); -+ writel(value, ioaddr + DMA_CHAN_TX_CONTROL(chan)); - - value = readl(ioaddr + GMAC_CONFIG); - value |= GMAC_CONFIG_TE; - writel(value, ioaddr + GMAC_CONFIG); - } - --void dwmac4_dma_stop_tx(void __iomem *ioaddr) -+void dwmac4_dma_stop_tx(void __iomem *ioaddr, u32 chan) - { -- u32 value = readl(ioaddr + DMA_CHAN_TX_CONTROL(STMMAC_CHAN0)); -+ u32 value = readl(ioaddr + DMA_CHAN_TX_CONTROL(chan)); - - value &= ~DMA_CONTROL_ST; -- writel(value, ioaddr + DMA_CHAN_TX_CONTROL(STMMAC_CHAN0)); -+ writel(value, ioaddr + DMA_CHAN_TX_CONTROL(chan)); - - value = readl(ioaddr + GMAC_CONFIG); - value &= ~GMAC_CONFIG_TE; - writel(value, ioaddr + GMAC_CONFIG); - } - --void dwmac4_dma_start_rx(void __iomem *ioaddr) -+void dwmac4_dma_start_rx(void __iomem *ioaddr, u32 chan) - { -- u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(STMMAC_CHAN0)); -+ u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(chan)); - - value |= DMA_CONTROL_SR; - -- writel(value, ioaddr + DMA_CHAN_RX_CONTROL(STMMAC_CHAN0)); -+ writel(value, ioaddr + DMA_CHAN_RX_CONTROL(chan)); - - value = readl(ioaddr + GMAC_CONFIG); - value |= GMAC_CONFIG_RE; - writel(value, ioaddr + GMAC_CONFIG); - } - --void dwmac4_dma_stop_rx(void __iomem *ioaddr) -+void dwmac4_dma_stop_rx(void __iomem *ioaddr, u32 chan) - { -- u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(STMMAC_CHAN0)); -+ u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(chan)); - - value &= ~DMA_CONTROL_SR; -- writel(value, ioaddr + DMA_CHAN_RX_CONTROL(STMMAC_CHAN0)); -+ writel(value, ioaddr + DMA_CHAN_RX_CONTROL(chan)); - - value = readl(ioaddr + GMAC_CONFIG); - value &= ~GMAC_CONFIG_RE; - writel(value, ioaddr + GMAC_CONFIG); - } - --void dwmac4_set_tx_ring_len(void __iomem *ioaddr, u32 len) -+void dwmac4_set_tx_ring_len(void __iomem *ioaddr, u32 len, u32 chan) - { -- writel(len, ioaddr + DMA_CHAN_TX_RING_LEN(STMMAC_CHAN0)); -+ writel(len, ioaddr + DMA_CHAN_TX_RING_LEN(chan)); - } - --void dwmac4_set_rx_ring_len(void __iomem *ioaddr, u32 len) -+void dwmac4_set_rx_ring_len(void __iomem *ioaddr, u32 len, u32 chan) - { -- writel(len, ioaddr + DMA_CHAN_RX_RING_LEN(STMMAC_CHAN0)); -+ writel(len, ioaddr + DMA_CHAN_RX_RING_LEN(chan)); - } - --void dwmac4_enable_dma_irq(void __iomem *ioaddr) -+void dwmac4_enable_dma_irq(void __iomem *ioaddr, u32 chan) - { - writel(DMA_CHAN_INTR_DEFAULT_MASK, ioaddr + -- DMA_CHAN_INTR_ENA(STMMAC_CHAN0)); -+ DMA_CHAN_INTR_ENA(chan)); - } - --void dwmac410_enable_dma_irq(void __iomem *ioaddr) -+void dwmac410_enable_dma_irq(void __iomem *ioaddr, u32 chan) - { - writel(DMA_CHAN_INTR_DEFAULT_MASK_4_10, -- ioaddr + DMA_CHAN_INTR_ENA(STMMAC_CHAN0)); -+ ioaddr + DMA_CHAN_INTR_ENA(chan)); - } - --void dwmac4_disable_dma_irq(void __iomem *ioaddr) -+void dwmac4_disable_dma_irq(void __iomem *ioaddr, u32 chan) - { -- writel(0, ioaddr + DMA_CHAN_INTR_ENA(STMMAC_CHAN0)); -+ writel(0, ioaddr + DMA_CHAN_INTR_ENA(chan)); - } - - int dwmac4_dma_interrupt(void __iomem *ioaddr, -- struct stmmac_extra_stats *x) -+ struct stmmac_extra_stats *x, u32 chan) - { - int ret = 0; - -- u32 intr_status = readl(ioaddr + DMA_CHAN_STATUS(0)); -+ u32 intr_status = readl(ioaddr + DMA_CHAN_STATUS(chan)); - - /* ABNORMAL interrupts */ - if (unlikely(intr_status & DMA_CHAN_STATUS_AIS)) { -@@ -153,7 +153,7 @@ int dwmac4_dma_interrupt(void __iomem *i - if (likely(intr_status & DMA_CHAN_STATUS_RI)) { - u32 value; - -- value = readl(ioaddr + DMA_CHAN_INTR_ENA(STMMAC_CHAN0)); -+ value = readl(ioaddr + DMA_CHAN_INTR_ENA(chan)); - /* to schedule NAPI on real RIE event. */ - if (likely(value & DMA_CHAN_INTR_ENA_RIE)) { - x->rx_normal_irq_n++; -@@ -172,7 +172,7 @@ int dwmac4_dma_interrupt(void __iomem *i - * status [21-0] expect reserved bits [5-3] - */ - writel((intr_status & 0x3fffc7), -- ioaddr + DMA_CHAN_STATUS(STMMAC_CHAN0)); -+ ioaddr + DMA_CHAN_STATUS(chan)); - - return ret; - } ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h -@@ -137,13 +137,14 @@ - #define DMA_CONTROL_FTF 0x00100000 /* Flush transmit FIFO */ - - void dwmac_enable_dma_transmission(void __iomem *ioaddr); --void dwmac_enable_dma_irq(void __iomem *ioaddr); --void dwmac_disable_dma_irq(void __iomem *ioaddr); --void dwmac_dma_start_tx(void __iomem *ioaddr); --void dwmac_dma_stop_tx(void __iomem *ioaddr); --void dwmac_dma_start_rx(void __iomem *ioaddr); --void dwmac_dma_stop_rx(void __iomem *ioaddr); --int dwmac_dma_interrupt(void __iomem *ioaddr, struct stmmac_extra_stats *x); -+void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan); -+void dwmac_disable_dma_irq(void __iomem *ioaddr, u32 chan); -+void dwmac_dma_start_tx(void __iomem *ioaddr, u32 chan); -+void dwmac_dma_stop_tx(void __iomem *ioaddr, u32 chan); -+void dwmac_dma_start_rx(void __iomem *ioaddr, u32 chan); -+void dwmac_dma_stop_rx(void __iomem *ioaddr, u32 chan); -+int dwmac_dma_interrupt(void __iomem *ioaddr, struct stmmac_extra_stats *x, -+ u32 chan); - int dwmac_dma_reset(void __iomem *ioaddr); - - #endif /* __DWMAC_DMA_H__ */ ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c -@@ -47,38 +47,38 @@ void dwmac_enable_dma_transmission(void - writel(1, ioaddr + DMA_XMT_POLL_DEMAND); - } - --void dwmac_enable_dma_irq(void __iomem *ioaddr) -+void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan) - { - writel(DMA_INTR_DEFAULT_MASK, ioaddr + DMA_INTR_ENA); - } - --void dwmac_disable_dma_irq(void __iomem *ioaddr) -+void dwmac_disable_dma_irq(void __iomem *ioaddr, u32 chan) - { - writel(0, ioaddr + DMA_INTR_ENA); - } - --void dwmac_dma_start_tx(void __iomem *ioaddr) -+void dwmac_dma_start_tx(void __iomem *ioaddr, u32 chan) - { - u32 value = readl(ioaddr + DMA_CONTROL); - value |= DMA_CONTROL_ST; - writel(value, ioaddr + DMA_CONTROL); - } - --void dwmac_dma_stop_tx(void __iomem *ioaddr) -+void dwmac_dma_stop_tx(void __iomem *ioaddr, u32 chan) - { - u32 value = readl(ioaddr + DMA_CONTROL); - value &= ~DMA_CONTROL_ST; - writel(value, ioaddr + DMA_CONTROL); - } - --void dwmac_dma_start_rx(void __iomem *ioaddr) -+void dwmac_dma_start_rx(void __iomem *ioaddr, u32 chan) - { - u32 value = readl(ioaddr + DMA_CONTROL); - value |= DMA_CONTROL_SR; - writel(value, ioaddr + DMA_CONTROL); - } - --void dwmac_dma_stop_rx(void __iomem *ioaddr) -+void dwmac_dma_stop_rx(void __iomem *ioaddr, u32 chan) - { - u32 value = readl(ioaddr + DMA_CONTROL); - value &= ~DMA_CONTROL_SR; -@@ -156,7 +156,7 @@ static void show_rx_process_state(unsign - #endif - - int dwmac_dma_interrupt(void __iomem *ioaddr, -- struct stmmac_extra_stats *x) -+ struct stmmac_extra_stats *x, u32 chan) - { - int ret = 0; - /* read the status register (CSR5) */ ---- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c -+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c -@@ -315,7 +315,7 @@ static void enh_desc_release_tx_desc(str - - static void enh_desc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, - bool csum_flag, int mode, bool tx_own, -- bool ls) -+ bool ls, unsigned int tot_pkt_len) - { - unsigned int tdes0 = le32_to_cpu(p->des0); - ---- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c -+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c -@@ -191,7 +191,7 @@ static void ndesc_release_tx_desc(struct - - static void ndesc_prepare_tx_desc(struct dma_desc *p, int is_fs, int len, - bool csum_flag, int mode, bool tx_own, -- bool ls) -+ bool ls, unsigned int tot_pkt_len) - { - unsigned int tdes1 = le32_to_cpu(p->des1); - ---- a/drivers/net/ethernet/stmicro/stmmac/ring_mode.c -+++ b/drivers/net/ethernet/stmicro/stmmac/ring_mode.c -@@ -26,16 +26,17 @@ - - static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum) - { -- struct stmmac_priv *priv = (struct stmmac_priv *)p; -- unsigned int entry = priv->cur_tx; -- struct dma_desc *desc; -+ struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)p; - unsigned int nopaged_len = skb_headlen(skb); -+ struct stmmac_priv *priv = tx_q->priv_data; -+ unsigned int entry = tx_q->cur_tx; - unsigned int bmax, len, des2; -+ struct dma_desc *desc; - - if (priv->extend_desc) -- desc = (struct dma_desc *)(priv->dma_etx + entry); -+ desc = (struct dma_desc *)(tx_q->dma_etx + entry); - else -- desc = priv->dma_tx + entry; -+ desc = tx_q->dma_tx + entry; - - if (priv->plat->enh_desc) - bmax = BUF_SIZE_8KiB; -@@ -52,48 +53,51 @@ static int stmmac_jumbo_frm(void *p, str - if (dma_mapping_error(priv->device, des2)) - return -1; - -- priv->tx_skbuff_dma[entry].buf = des2; -- priv->tx_skbuff_dma[entry].len = bmax; -- priv->tx_skbuff_dma[entry].is_jumbo = true; -+ tx_q->tx_skbuff_dma[entry].buf = des2; -+ tx_q->tx_skbuff_dma[entry].len = bmax; -+ tx_q->tx_skbuff_dma[entry].is_jumbo = true; - - desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); - priv->hw->desc->prepare_tx_desc(desc, 1, bmax, csum, -- STMMAC_RING_MODE, 0, false); -- priv->tx_skbuff[entry] = NULL; -+ STMMAC_RING_MODE, 0, -+ false, skb->len); -+ tx_q->tx_skbuff[entry] = NULL; - entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); - - if (priv->extend_desc) -- desc = (struct dma_desc *)(priv->dma_etx + entry); -+ desc = (struct dma_desc *)(tx_q->dma_etx + entry); - else -- desc = priv->dma_tx + entry; -+ desc = tx_q->dma_tx + entry; - - des2 = dma_map_single(priv->device, skb->data + bmax, len, - DMA_TO_DEVICE); - desc->des2 = cpu_to_le32(des2); - if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = des2; -- priv->tx_skbuff_dma[entry].len = len; -- priv->tx_skbuff_dma[entry].is_jumbo = true; -+ tx_q->tx_skbuff_dma[entry].buf = des2; -+ tx_q->tx_skbuff_dma[entry].len = len; -+ tx_q->tx_skbuff_dma[entry].is_jumbo = true; - - desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); - priv->hw->desc->prepare_tx_desc(desc, 0, len, csum, -- STMMAC_RING_MODE, 1, true); -+ STMMAC_RING_MODE, 1, -+ true, skb->len); - } else { - des2 = dma_map_single(priv->device, skb->data, - nopaged_len, DMA_TO_DEVICE); - desc->des2 = cpu_to_le32(des2); - if (dma_mapping_error(priv->device, des2)) - return -1; -- priv->tx_skbuff_dma[entry].buf = des2; -- priv->tx_skbuff_dma[entry].len = nopaged_len; -- priv->tx_skbuff_dma[entry].is_jumbo = true; -+ tx_q->tx_skbuff_dma[entry].buf = des2; -+ tx_q->tx_skbuff_dma[entry].len = nopaged_len; -+ tx_q->tx_skbuff_dma[entry].is_jumbo = true; - desc->des3 = cpu_to_le32(des2 + BUF_SIZE_4KiB); - priv->hw->desc->prepare_tx_desc(desc, 1, nopaged_len, csum, -- STMMAC_RING_MODE, 0, true); -+ STMMAC_RING_MODE, 0, -+ true, skb->len); - } - -- priv->cur_tx = entry; -+ tx_q->cur_tx = entry; - - return entry; - } -@@ -125,12 +129,13 @@ static void stmmac_init_desc3(struct dma - - static void stmmac_clean_desc3(void *priv_ptr, struct dma_desc *p) - { -- struct stmmac_priv *priv = (struct stmmac_priv *)priv_ptr; -- unsigned int entry = priv->dirty_tx; -+ struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)priv_ptr; -+ struct stmmac_priv *priv = tx_q->priv_data; -+ unsigned int entry = tx_q->dirty_tx; - - /* des3 is only used for jumbo frames tx or time stamping */ -- if (unlikely(priv->tx_skbuff_dma[entry].is_jumbo || -- (priv->tx_skbuff_dma[entry].last_segment && -+ if (unlikely(tx_q->tx_skbuff_dma[entry].is_jumbo || -+ (tx_q->tx_skbuff_dma[entry].last_segment && - !priv->extend_desc && priv->hwts_tx_en))) - p->des3 = 0; - } ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h -@@ -46,38 +46,51 @@ struct stmmac_tx_info { - bool is_jumbo; - }; - --struct stmmac_priv { -- /* Frequently used values are kept adjacent for cache effect */ -+/* Frequently used values are kept adjacent for cache effect */ -+struct stmmac_tx_queue { -+ u32 queue_index; -+ struct stmmac_priv *priv_data; - struct dma_extended_desc *dma_etx ____cacheline_aligned_in_smp; - struct dma_desc *dma_tx; - struct sk_buff **tx_skbuff; -+ struct stmmac_tx_info *tx_skbuff_dma; - unsigned int cur_tx; - unsigned int dirty_tx; -+ dma_addr_t dma_tx_phy; -+ u32 tx_tail_addr; -+}; -+ -+struct stmmac_rx_queue { -+ u32 queue_index; -+ struct stmmac_priv *priv_data; -+ struct dma_extended_desc *dma_erx; -+ struct dma_desc *dma_rx ____cacheline_aligned_in_smp; -+ struct sk_buff **rx_skbuff; -+ dma_addr_t *rx_skbuff_dma; -+ unsigned int cur_rx; -+ unsigned int dirty_rx; -+ u32 rx_zeroc_thresh; -+ dma_addr_t dma_rx_phy; -+ u32 rx_tail_addr; -+ struct napi_struct napi ____cacheline_aligned_in_smp; -+}; -+ -+struct stmmac_priv { -+ /* Frequently used values are kept adjacent for cache effect */ - u32 tx_count_frames; - u32 tx_coal_frames; - u32 tx_coal_timer; -- struct stmmac_tx_info *tx_skbuff_dma; -- dma_addr_t dma_tx_phy; -+ - int tx_coalesce; - int hwts_tx_en; - bool tx_path_in_lpi_mode; - struct timer_list txtimer; - bool tso; - -- struct dma_desc *dma_rx ____cacheline_aligned_in_smp; -- struct dma_extended_desc *dma_erx; -- struct sk_buff **rx_skbuff; -- unsigned int cur_rx; -- unsigned int dirty_rx; - unsigned int dma_buf_sz; - unsigned int rx_copybreak; -- unsigned int rx_zeroc_thresh; - u32 rx_riwt; - int hwts_rx_en; -- dma_addr_t *rx_skbuff_dma; -- dma_addr_t dma_rx_phy; -- -- struct napi_struct napi ____cacheline_aligned_in_smp; - - void __iomem *ioaddr; - struct net_device *dev; -@@ -85,6 +98,12 @@ struct stmmac_priv { - struct mac_device_info *hw; - spinlock_t lock; - -+ /* RX Queue */ -+ struct stmmac_rx_queue rx_queue[MTL_MAX_RX_QUEUES]; -+ -+ /* TX Queue */ -+ struct stmmac_tx_queue tx_queue[MTL_MAX_TX_QUEUES]; -+ - int oldlink; - int speed; - int oldduplex; -@@ -119,8 +138,6 @@ struct stmmac_priv { - spinlock_t ptp_lock; - void __iomem *mmcaddr; - void __iomem *ptpaddr; -- u32 rx_tail_addr; -- u32 tx_tail_addr; - u32 mss; - - #ifdef CONFIG_DEBUG_FS ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -@@ -481,6 +481,7 @@ stmmac_set_pauseparam(struct net_device - struct ethtool_pauseparam *pause) - { - struct stmmac_priv *priv = netdev_priv(netdev); -+ u32 tx_cnt = priv->plat->tx_queues_to_use; - struct phy_device *phy = netdev->phydev; - int new_pause = FLOW_OFF; - -@@ -511,7 +512,7 @@ stmmac_set_pauseparam(struct net_device - } - - priv->hw->mac->flow_ctrl(priv->hw, phy->duplex, priv->flow_ctrl, -- priv->pause); -+ priv->pause, tx_cnt); - return 0; - } - -@@ -519,6 +520,8 @@ static void stmmac_get_ethtool_stats(str - struct ethtool_stats *dummy, u64 *data) - { - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ u32 tx_queues_count = priv->plat->tx_queues_to_use; - int i, j = 0; - - /* Update the DMA HW counters for dwmac10/100 */ -@@ -549,7 +552,8 @@ static void stmmac_get_ethtool_stats(str - if ((priv->hw->mac->debug) && - (priv->synopsys_id >= DWMAC_CORE_3_50)) - priv->hw->mac->debug(priv->ioaddr, -- (void *)&priv->xstats); -+ (void *)&priv->xstats, -+ rx_queues_count, tx_queues_count); - } - for (i = 0; i < STMMAC_STATS_LEN; i++) { - char *p = (char *)priv + stmmac_gstrings_stats[i].stat_offset; -@@ -726,6 +730,7 @@ static int stmmac_set_coalesce(struct ne - struct ethtool_coalesce *ec) - { - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 rx_cnt = priv->plat->rx_queues_to_use; - unsigned int rx_riwt; - - /* Check not supported parameters */ -@@ -764,7 +769,7 @@ static int stmmac_set_coalesce(struct ne - priv->tx_coal_frames = ec->tx_max_coalesced_frames; - priv->tx_coal_timer = ec->tx_coalesce_usecs; - priv->rx_riwt = rx_riwt; -- priv->hw->dma->rx_watchdog(priv->ioaddr, priv->rx_riwt); -+ priv->hw->dma->rx_watchdog(priv->ioaddr, priv->rx_riwt, rx_cnt); - - return 0; - } ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -139,6 +139,64 @@ static void stmmac_verify_args(void) - } - - /** -+ * stmmac_disable_all_queues - Disable all queues -+ * @priv: driver private structure -+ */ -+static void stmmac_disable_all_queues(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_cnt = priv->plat->rx_queues_to_use; -+ u32 queue; -+ -+ for (queue = 0; queue < rx_queues_cnt; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ napi_disable(&rx_q->napi); -+ } -+} -+ -+/** -+ * stmmac_enable_all_queues - Enable all queues -+ * @priv: driver private structure -+ */ -+static void stmmac_enable_all_queues(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_cnt = priv->plat->rx_queues_to_use; -+ u32 queue; -+ -+ for (queue = 0; queue < rx_queues_cnt; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ napi_enable(&rx_q->napi); -+ } -+} -+ -+/** -+ * stmmac_stop_all_queues - Stop all queues -+ * @priv: driver private structure -+ */ -+static void stmmac_stop_all_queues(struct stmmac_priv *priv) -+{ -+ u32 tx_queues_cnt = priv->plat->tx_queues_to_use; -+ u32 queue; -+ -+ for (queue = 0; queue < tx_queues_cnt; queue++) -+ netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue)); -+} -+ -+/** -+ * stmmac_start_all_queues - Start all queues -+ * @priv: driver private structure -+ */ -+static void stmmac_start_all_queues(struct stmmac_priv *priv) -+{ -+ u32 tx_queues_cnt = priv->plat->tx_queues_to_use; -+ u32 queue; -+ -+ for (queue = 0; queue < tx_queues_cnt; queue++) -+ netif_tx_start_queue(netdev_get_tx_queue(priv->dev, queue)); -+} -+ -+/** - * stmmac_clk_csr_set - dynamically set the MDC clock - * @priv: driver private structure - * Description: this is to dynamically set the MDC clock according to the csr -@@ -185,26 +243,33 @@ static void print_pkt(unsigned char *buf - print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len); - } - --static inline u32 stmmac_tx_avail(struct stmmac_priv *priv) -+static inline u32 stmmac_tx_avail(struct stmmac_priv *priv, u32 queue) - { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; - u32 avail; - -- if (priv->dirty_tx > priv->cur_tx) -- avail = priv->dirty_tx - priv->cur_tx - 1; -+ if (tx_q->dirty_tx > tx_q->cur_tx) -+ avail = tx_q->dirty_tx - tx_q->cur_tx - 1; - else -- avail = DMA_TX_SIZE - priv->cur_tx + priv->dirty_tx - 1; -+ avail = DMA_TX_SIZE - tx_q->cur_tx + tx_q->dirty_tx - 1; - - return avail; - } - --static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv) -+/** -+ * stmmac_rx_dirty - Get RX queue dirty -+ * @priv: driver private structure -+ * @queue: RX queue index -+ */ -+static inline u32 stmmac_rx_dirty(struct stmmac_priv *priv, u32 queue) - { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - u32 dirty; - -- if (priv->dirty_rx <= priv->cur_rx) -- dirty = priv->cur_rx - priv->dirty_rx; -+ if (rx_q->dirty_rx <= rx_q->cur_rx) -+ dirty = rx_q->cur_rx - rx_q->dirty_rx; - else -- dirty = DMA_RX_SIZE - priv->dirty_rx + priv->cur_rx; -+ dirty = DMA_RX_SIZE - rx_q->dirty_rx + rx_q->cur_rx; - - return dirty; - } -@@ -232,9 +297,19 @@ static inline void stmmac_hw_fix_mac_spe - */ - static void stmmac_enable_eee_mode(struct stmmac_priv *priv) - { -+ u32 tx_cnt = priv->plat->tx_queues_to_use; -+ u32 queue; -+ -+ /* check if all TX queues have the work finished */ -+ for (queue = 0; queue < tx_cnt; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ if (tx_q->dirty_tx != tx_q->cur_tx) -+ return; /* still unfinished work */ -+ } -+ - /* Check and enter in LPI mode */ -- if ((priv->dirty_tx == priv->cur_tx) && -- (priv->tx_path_in_lpi_mode == false)) -+ if (!priv->tx_path_in_lpi_mode) - priv->hw->mac->set_eee_mode(priv->hw, - priv->plat->en_tx_lpi_clockgating); - } -@@ -365,14 +440,14 @@ static void stmmac_get_tx_hwtstamp(struc - return; - - /* check tx tstamp status */ -- if (!priv->hw->desc->get_tx_timestamp_status(p)) { -+ if (priv->hw->desc->get_tx_timestamp_status(p)) { - /* get the valid tstamp */ - ns = priv->hw->desc->get_timestamp(p, priv->adv_ts); - - memset(&shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps)); - shhwtstamp.hwtstamp = ns_to_ktime(ns); - -- netdev_info(priv->dev, "get valid TX hw timestamp %llu\n", ns); -+ netdev_dbg(priv->dev, "get valid TX hw timestamp %llu\n", ns); - /* pass tstamp to stack */ - skb_tstamp_tx(skb, &shhwtstamp); - } -@@ -399,19 +474,19 @@ static void stmmac_get_rx_hwtstamp(struc - return; - - /* Check if timestamp is available */ -- if (!priv->hw->desc->get_rx_timestamp_status(p, priv->adv_ts)) { -+ if (priv->hw->desc->get_rx_timestamp_status(p, priv->adv_ts)) { - /* For GMAC4, the valid timestamp is from CTX next desc. */ - if (priv->plat->has_gmac4) - ns = priv->hw->desc->get_timestamp(np, priv->adv_ts); - else - ns = priv->hw->desc->get_timestamp(p, priv->adv_ts); - -- netdev_info(priv->dev, "get valid RX hw timestamp %llu\n", ns); -+ netdev_dbg(priv->dev, "get valid RX hw timestamp %llu\n", ns); - shhwtstamp = skb_hwtstamps(skb); - memset(shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps)); - shhwtstamp->hwtstamp = ns_to_ktime(ns); - } else { -- netdev_err(priv->dev, "cannot get RX hw timestamp\n"); -+ netdev_dbg(priv->dev, "cannot get RX hw timestamp\n"); - } - } - -@@ -688,6 +763,19 @@ static void stmmac_release_ptp(struct st - } - - /** -+ * stmmac_mac_flow_ctrl - Configure flow control in all queues -+ * @priv: driver private structure -+ * Description: It is used for configuring the flow control in all queues -+ */ -+static void stmmac_mac_flow_ctrl(struct stmmac_priv *priv, u32 duplex) -+{ -+ u32 tx_cnt = priv->plat->tx_queues_to_use; -+ -+ priv->hw->mac->flow_ctrl(priv->hw, duplex, priv->flow_ctrl, -+ priv->pause, tx_cnt); -+} -+ -+/** - * stmmac_adjust_link - adjusts the link parameters - * @dev: net device structure - * Description: this is the helper called by the physical abstraction layer -@@ -702,7 +790,6 @@ static void stmmac_adjust_link(struct ne - struct phy_device *phydev = dev->phydev; - unsigned long flags; - int new_state = 0; -- unsigned int fc = priv->flow_ctrl, pause_time = priv->pause; - - if (!phydev) - return; -@@ -724,8 +811,7 @@ static void stmmac_adjust_link(struct ne - } - /* Flow Control operation */ - if (phydev->pause) -- priv->hw->mac->flow_ctrl(priv->hw, phydev->duplex, -- fc, pause_time); -+ stmmac_mac_flow_ctrl(priv, phydev->duplex); - - if (phydev->speed != priv->speed) { - new_state = 1; -@@ -893,22 +979,56 @@ static int stmmac_init_phy(struct net_de - return 0; - } - --static void stmmac_display_rings(struct stmmac_priv *priv) -+static void stmmac_display_rx_rings(struct stmmac_priv *priv) - { -- void *head_rx, *head_tx; -+ u32 rx_cnt = priv->plat->rx_queues_to_use; -+ void *head_rx; -+ u32 queue; - -- if (priv->extend_desc) { -- head_rx = (void *)priv->dma_erx; -- head_tx = (void *)priv->dma_etx; -- } else { -- head_rx = (void *)priv->dma_rx; -- head_tx = (void *)priv->dma_tx; -+ /* Display RX rings */ -+ for (queue = 0; queue < rx_cnt; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ pr_info("\tRX Queue %u rings\n", queue); -+ -+ if (priv->extend_desc) -+ head_rx = (void *)rx_q->dma_erx; -+ else -+ head_rx = (void *)rx_q->dma_rx; -+ -+ /* Display RX ring */ -+ priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); -+ } -+} -+ -+static void stmmac_display_tx_rings(struct stmmac_priv *priv) -+{ -+ u32 tx_cnt = priv->plat->tx_queues_to_use; -+ void *head_tx; -+ u32 queue; -+ -+ /* Display TX rings */ -+ for (queue = 0; queue < tx_cnt; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ pr_info("\tTX Queue %d rings\n", queue); -+ -+ if (priv->extend_desc) -+ head_tx = (void *)tx_q->dma_etx; -+ else -+ head_tx = (void *)tx_q->dma_tx; -+ -+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); - } -+} -+ -+static void stmmac_display_rings(struct stmmac_priv *priv) -+{ -+ /* Display RX ring */ -+ stmmac_display_rx_rings(priv); - -- /* Display Rx ring */ -- priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); -- /* Display Tx ring */ -- priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); -+ /* Display TX ring */ -+ stmmac_display_tx_rings(priv); - } - - static int stmmac_set_bfsize(int mtu, int bufsize) -@@ -928,48 +1048,88 @@ static int stmmac_set_bfsize(int mtu, in - } - - /** -- * stmmac_clear_descriptors - clear descriptors -+ * stmmac_clear_rx_descriptors - clear RX descriptors - * @priv: driver private structure -- * Description: this function is called to clear the tx and rx descriptors -+ * @queue: RX queue index -+ * Description: this function is called to clear the RX descriptors - * in case of both basic and extended descriptors are used. - */ --static void stmmac_clear_descriptors(struct stmmac_priv *priv) -+static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue) - { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - int i; - -- /* Clear the Rx/Tx descriptors */ -+ /* Clear the RX descriptors */ - for (i = 0; i < DMA_RX_SIZE; i++) - if (priv->extend_desc) -- priv->hw->desc->init_rx_desc(&priv->dma_erx[i].basic, -+ priv->hw->desc->init_rx_desc(&rx_q->dma_erx[i].basic, - priv->use_riwt, priv->mode, - (i == DMA_RX_SIZE - 1)); - else -- priv->hw->desc->init_rx_desc(&priv->dma_rx[i], -+ priv->hw->desc->init_rx_desc(&rx_q->dma_rx[i], - priv->use_riwt, priv->mode, - (i == DMA_RX_SIZE - 1)); -+} -+ -+/** -+ * stmmac_clear_tx_descriptors - clear tx descriptors -+ * @priv: driver private structure -+ * @queue: TX queue index. -+ * Description: this function is called to clear the TX descriptors -+ * in case of both basic and extended descriptors are used. -+ */ -+static void stmmac_clear_tx_descriptors(struct stmmac_priv *priv, u32 queue) -+{ -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ int i; -+ -+ /* Clear the TX descriptors */ - for (i = 0; i < DMA_TX_SIZE; i++) - if (priv->extend_desc) -- priv->hw->desc->init_tx_desc(&priv->dma_etx[i].basic, -+ priv->hw->desc->init_tx_desc(&tx_q->dma_etx[i].basic, - priv->mode, - (i == DMA_TX_SIZE - 1)); - else -- priv->hw->desc->init_tx_desc(&priv->dma_tx[i], -+ priv->hw->desc->init_tx_desc(&tx_q->dma_tx[i], - priv->mode, - (i == DMA_TX_SIZE - 1)); - } - - /** -+ * stmmac_clear_descriptors - clear descriptors -+ * @priv: driver private structure -+ * Description: this function is called to clear the TX and RX descriptors -+ * in case of both basic and extended descriptors are used. -+ */ -+static void stmmac_clear_descriptors(struct stmmac_priv *priv) -+{ -+ u32 rx_queue_cnt = priv->plat->rx_queues_to_use; -+ u32 tx_queue_cnt = priv->plat->tx_queues_to_use; -+ u32 queue; -+ -+ /* Clear the RX descriptors */ -+ for (queue = 0; queue < rx_queue_cnt; queue++) -+ stmmac_clear_rx_descriptors(priv, queue); -+ -+ /* Clear the TX descriptors */ -+ for (queue = 0; queue < tx_queue_cnt; queue++) -+ stmmac_clear_tx_descriptors(priv, queue); -+} -+ -+/** - * stmmac_init_rx_buffers - init the RX descriptor buffer. - * @priv: driver private structure - * @p: descriptor pointer - * @i: descriptor index -- * @flags: gfp flag. -+ * @flags: gfp flag -+ * @queue: RX queue index - * Description: this function is called to allocate a receive buffer, perform - * the DMA mapping and init the descriptor. - */ - static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p, -- int i, gfp_t flags) -+ int i, gfp_t flags, u32 queue) - { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - struct sk_buff *skb; - - skb = __netdev_alloc_skb_ip_align(priv->dev, priv->dma_buf_sz, flags); -@@ -978,20 +1138,20 @@ static int stmmac_init_rx_buffers(struct - "%s: Rx init fails; skb is NULL\n", __func__); - return -ENOMEM; - } -- priv->rx_skbuff[i] = skb; -- priv->rx_skbuff_dma[i] = dma_map_single(priv->device, skb->data, -+ rx_q->rx_skbuff[i] = skb; -+ rx_q->rx_skbuff_dma[i] = dma_map_single(priv->device, skb->data, - priv->dma_buf_sz, - DMA_FROM_DEVICE); -- if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[i])) { -+ if (dma_mapping_error(priv->device, rx_q->rx_skbuff_dma[i])) { - netdev_err(priv->dev, "%s: DMA mapping error\n", __func__); - dev_kfree_skb_any(skb); - return -EINVAL; - } - - if (priv->synopsys_id >= DWMAC_CORE_4_00) -- p->des0 = cpu_to_le32(priv->rx_skbuff_dma[i]); -+ p->des0 = cpu_to_le32(rx_q->rx_skbuff_dma[i]); - else -- p->des2 = cpu_to_le32(priv->rx_skbuff_dma[i]); -+ p->des2 = cpu_to_le32(rx_q->rx_skbuff_dma[i]); - - if ((priv->hw->mode->init_desc3) && - (priv->dma_buf_sz == BUF_SIZE_16KiB)) -@@ -1000,30 +1160,71 @@ static int stmmac_init_rx_buffers(struct - return 0; - } - --static void stmmac_free_rx_buffers(struct stmmac_priv *priv, int i) -+/** -+ * stmmac_free_rx_buffer - free RX dma buffers -+ * @priv: private structure -+ * @queue: RX queue index -+ * @i: buffer index. -+ */ -+static void stmmac_free_rx_buffer(struct stmmac_priv *priv, u32 queue, int i) - { -- if (priv->rx_skbuff[i]) { -- dma_unmap_single(priv->device, priv->rx_skbuff_dma[i], -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ if (rx_q->rx_skbuff[i]) { -+ dma_unmap_single(priv->device, rx_q->rx_skbuff_dma[i], - priv->dma_buf_sz, DMA_FROM_DEVICE); -- dev_kfree_skb_any(priv->rx_skbuff[i]); -+ dev_kfree_skb_any(rx_q->rx_skbuff[i]); - } -- priv->rx_skbuff[i] = NULL; -+ rx_q->rx_skbuff[i] = NULL; - } - - /** -- * init_dma_desc_rings - init the RX/TX descriptor rings -+ * stmmac_free_tx_buffer - free RX dma buffers -+ * @priv: private structure -+ * @queue: RX queue index -+ * @i: buffer index. -+ */ -+static void stmmac_free_tx_buffer(struct stmmac_priv *priv, u32 queue, int i) -+{ -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ if (tx_q->tx_skbuff_dma[i].buf) { -+ if (tx_q->tx_skbuff_dma[i].map_as_page) -+ dma_unmap_page(priv->device, -+ tx_q->tx_skbuff_dma[i].buf, -+ tx_q->tx_skbuff_dma[i].len, -+ DMA_TO_DEVICE); -+ else -+ dma_unmap_single(priv->device, -+ tx_q->tx_skbuff_dma[i].buf, -+ tx_q->tx_skbuff_dma[i].len, -+ DMA_TO_DEVICE); -+ } -+ -+ if (tx_q->tx_skbuff[i]) { -+ dev_kfree_skb_any(tx_q->tx_skbuff[i]); -+ tx_q->tx_skbuff[i] = NULL; -+ tx_q->tx_skbuff_dma[i].buf = 0; -+ tx_q->tx_skbuff_dma[i].map_as_page = false; -+ } -+} -+ -+/** -+ * init_dma_rx_desc_rings - init the RX descriptor rings - * @dev: net device structure - * @flags: gfp flag. -- * Description: this function initializes the DMA RX/TX descriptors -+ * Description: this function initializes the DMA RX descriptors - * and allocates the socket buffers. It supports the chained and ring - * modes. - */ --static int init_dma_desc_rings(struct net_device *dev, gfp_t flags) -+static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags) - { -- int i; - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 rx_count = priv->plat->rx_queues_to_use; - unsigned int bfsize = 0; - int ret = -ENOMEM; -+ int queue; -+ int i; - - if (priv->hw->mode->set_16kib_bfsize) - bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu); -@@ -1033,235 +1234,409 @@ static int init_dma_desc_rings(struct ne - - priv->dma_buf_sz = bfsize; - -- netif_dbg(priv, probe, priv->dev, -- "(%s) dma_rx_phy=0x%08x dma_tx_phy=0x%08x\n", -- __func__, (u32)priv->dma_rx_phy, (u32)priv->dma_tx_phy); -- - /* RX INITIALIZATION */ - netif_dbg(priv, probe, priv->dev, - "SKB addresses:\nskb\t\tskb data\tdma data\n"); - -- for (i = 0; i < DMA_RX_SIZE; i++) { -- struct dma_desc *p; -- if (priv->extend_desc) -- p = &((priv->dma_erx + i)->basic); -- else -- p = priv->dma_rx + i; -+ for (queue = 0; queue < rx_count; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - -- ret = stmmac_init_rx_buffers(priv, p, i, flags); -- if (ret) -- goto err_init_rx_buffers; -+ netif_dbg(priv, probe, priv->dev, -+ "(%s) dma_rx_phy=0x%08x\n", __func__, -+ (u32)rx_q->dma_rx_phy); - -- netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n", -- priv->rx_skbuff[i], priv->rx_skbuff[i]->data, -- (unsigned int)priv->rx_skbuff_dma[i]); -+ for (i = 0; i < DMA_RX_SIZE; i++) { -+ struct dma_desc *p; -+ -+ if (priv->extend_desc) -+ p = &((rx_q->dma_erx + i)->basic); -+ else -+ p = rx_q->dma_rx + i; -+ -+ ret = stmmac_init_rx_buffers(priv, p, i, flags, -+ queue); -+ if (ret) -+ goto err_init_rx_buffers; -+ -+ netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n", -+ rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data, -+ (unsigned int)rx_q->rx_skbuff_dma[i]); -+ } -+ -+ rx_q->cur_rx = 0; -+ rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); -+ -+ stmmac_clear_rx_descriptors(priv, queue); -+ -+ /* Setup the chained descriptor addresses */ -+ if (priv->mode == STMMAC_CHAIN_MODE) { -+ if (priv->extend_desc) -+ priv->hw->mode->init(rx_q->dma_erx, -+ rx_q->dma_rx_phy, -+ DMA_RX_SIZE, 1); -+ else -+ priv->hw->mode->init(rx_q->dma_rx, -+ rx_q->dma_rx_phy, -+ DMA_RX_SIZE, 0); -+ } - } -- priv->cur_rx = 0; -- priv->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); -+ - buf_sz = bfsize; - -- /* Setup the chained descriptor addresses */ -- if (priv->mode == STMMAC_CHAIN_MODE) { -- if (priv->extend_desc) { -- priv->hw->mode->init(priv->dma_erx, priv->dma_rx_phy, -- DMA_RX_SIZE, 1); -- priv->hw->mode->init(priv->dma_etx, priv->dma_tx_phy, -- DMA_TX_SIZE, 1); -- } else { -- priv->hw->mode->init(priv->dma_rx, priv->dma_rx_phy, -- DMA_RX_SIZE, 0); -- priv->hw->mode->init(priv->dma_tx, priv->dma_tx_phy, -- DMA_TX_SIZE, 0); -- } -+ return 0; -+ -+err_init_rx_buffers: -+ while (queue >= 0) { -+ while (--i >= 0) -+ stmmac_free_rx_buffer(priv, queue, i); -+ -+ if (queue == 0) -+ break; -+ -+ i = DMA_RX_SIZE; -+ queue--; - } - -- /* TX INITIALIZATION */ -- for (i = 0; i < DMA_TX_SIZE; i++) { -- struct dma_desc *p; -- if (priv->extend_desc) -- p = &((priv->dma_etx + i)->basic); -- else -- p = priv->dma_tx + i; -+ return ret; -+} - -- if (priv->synopsys_id >= DWMAC_CORE_4_00) { -- p->des0 = 0; -- p->des1 = 0; -- p->des2 = 0; -- p->des3 = 0; -- } else { -- p->des2 = 0; -+/** -+ * init_dma_tx_desc_rings - init the TX descriptor rings -+ * @dev: net device structure. -+ * Description: this function initializes the DMA TX descriptors -+ * and allocates the socket buffers. It supports the chained and ring -+ * modes. -+ */ -+static int init_dma_tx_desc_rings(struct net_device *dev) -+{ -+ struct stmmac_priv *priv = netdev_priv(dev); -+ u32 tx_queue_cnt = priv->plat->tx_queues_to_use; -+ u32 queue; -+ int i; -+ -+ for (queue = 0; queue < tx_queue_cnt; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ netif_dbg(priv, probe, priv->dev, -+ "(%s) dma_tx_phy=0x%08x\n", __func__, -+ (u32)tx_q->dma_tx_phy); -+ -+ /* Setup the chained descriptor addresses */ -+ if (priv->mode == STMMAC_CHAIN_MODE) { -+ if (priv->extend_desc) -+ priv->hw->mode->init(tx_q->dma_etx, -+ tx_q->dma_tx_phy, -+ DMA_TX_SIZE, 1); -+ else -+ priv->hw->mode->init(tx_q->dma_tx, -+ tx_q->dma_tx_phy, -+ DMA_TX_SIZE, 0); -+ } -+ -+ for (i = 0; i < DMA_TX_SIZE; i++) { -+ struct dma_desc *p; -+ if (priv->extend_desc) -+ p = &((tx_q->dma_etx + i)->basic); -+ else -+ p = tx_q->dma_tx + i; -+ -+ if (priv->synopsys_id >= DWMAC_CORE_4_00) { -+ p->des0 = 0; -+ p->des1 = 0; -+ p->des2 = 0; -+ p->des3 = 0; -+ } else { -+ p->des2 = 0; -+ } -+ -+ tx_q->tx_skbuff_dma[i].buf = 0; -+ tx_q->tx_skbuff_dma[i].map_as_page = false; -+ tx_q->tx_skbuff_dma[i].len = 0; -+ tx_q->tx_skbuff_dma[i].last_segment = false; -+ tx_q->tx_skbuff[i] = NULL; - } - -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- priv->tx_skbuff_dma[i].len = 0; -- priv->tx_skbuff_dma[i].last_segment = false; -- priv->tx_skbuff[i] = NULL; -+ tx_q->dirty_tx = 0; -+ tx_q->cur_tx = 0; -+ -+ netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, queue)); - } - -- priv->dirty_tx = 0; -- priv->cur_tx = 0; -- netdev_reset_queue(priv->dev); -+ return 0; -+} -+ -+/** -+ * init_dma_desc_rings - init the RX/TX descriptor rings -+ * @dev: net device structure -+ * @flags: gfp flag. -+ * Description: this function initializes the DMA RX/TX descriptors -+ * and allocates the socket buffers. It supports the chained and ring -+ * modes. -+ */ -+static int init_dma_desc_rings(struct net_device *dev, gfp_t flags) -+{ -+ struct stmmac_priv *priv = netdev_priv(dev); -+ int ret; -+ -+ ret = init_dma_rx_desc_rings(dev, flags); -+ if (ret) -+ return ret; -+ -+ ret = init_dma_tx_desc_rings(dev); - - stmmac_clear_descriptors(priv); - - if (netif_msg_hw(priv)) - stmmac_display_rings(priv); - -- return 0; --err_init_rx_buffers: -- while (--i >= 0) -- stmmac_free_rx_buffers(priv, i); - return ret; - } - --static void dma_free_rx_skbufs(struct stmmac_priv *priv) -+/** -+ * dma_free_rx_skbufs - free RX dma buffers -+ * @priv: private structure -+ * @queue: RX queue index -+ */ -+static void dma_free_rx_skbufs(struct stmmac_priv *priv, u32 queue) - { - int i; - - for (i = 0; i < DMA_RX_SIZE; i++) -- stmmac_free_rx_buffers(priv, i); -+ stmmac_free_rx_buffer(priv, queue, i); - } - --static void dma_free_tx_skbufs(struct stmmac_priv *priv) -+/** -+ * dma_free_tx_skbufs - free TX dma buffers -+ * @priv: private structure -+ * @queue: TX queue index -+ */ -+static void dma_free_tx_skbufs(struct stmmac_priv *priv, u32 queue) - { - int i; - -- for (i = 0; i < DMA_TX_SIZE; i++) { -- if (priv->tx_skbuff_dma[i].buf) { -- if (priv->tx_skbuff_dma[i].map_as_page) -- dma_unmap_page(priv->device, -- priv->tx_skbuff_dma[i].buf, -- priv->tx_skbuff_dma[i].len, -- DMA_TO_DEVICE); -- else -- dma_unmap_single(priv->device, -- priv->tx_skbuff_dma[i].buf, -- priv->tx_skbuff_dma[i].len, -- DMA_TO_DEVICE); -- } -+ for (i = 0; i < DMA_TX_SIZE; i++) -+ stmmac_free_tx_buffer(priv, queue, i); -+} - -- if (priv->tx_skbuff[i]) { -- dev_kfree_skb_any(priv->tx_skbuff[i]); -- priv->tx_skbuff[i] = NULL; -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- } -+/** -+ * free_dma_rx_desc_resources - free RX dma desc resources -+ * @priv: private structure -+ */ -+static void free_dma_rx_desc_resources(struct stmmac_priv *priv) -+{ -+ u32 rx_count = priv->plat->rx_queues_to_use; -+ u32 queue; -+ -+ /* Free RX queue resources */ -+ for (queue = 0; queue < rx_count; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ /* Release the DMA RX socket buffers */ -+ dma_free_rx_skbufs(priv, queue); -+ -+ /* Free DMA regions of consistent memory previously allocated */ -+ if (!priv->extend_desc) -+ dma_free_coherent(priv->device, -+ DMA_RX_SIZE * sizeof(struct dma_desc), -+ rx_q->dma_rx, rx_q->dma_rx_phy); -+ else -+ dma_free_coherent(priv->device, DMA_RX_SIZE * -+ sizeof(struct dma_extended_desc), -+ rx_q->dma_erx, rx_q->dma_rx_phy); -+ -+ kfree(rx_q->rx_skbuff_dma); -+ kfree(rx_q->rx_skbuff); - } - } - - /** -- * alloc_dma_desc_resources - alloc TX/RX resources. -+ * free_dma_tx_desc_resources - free TX dma desc resources -+ * @priv: private structure -+ */ -+static void free_dma_tx_desc_resources(struct stmmac_priv *priv) -+{ -+ u32 tx_count = priv->plat->tx_queues_to_use; -+ u32 queue = 0; -+ -+ /* Free TX queue resources */ -+ for (queue = 0; queue < tx_count; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ /* Release the DMA TX socket buffers */ -+ dma_free_tx_skbufs(priv, queue); -+ -+ /* Free DMA regions of consistent memory previously allocated */ -+ if (!priv->extend_desc) -+ dma_free_coherent(priv->device, -+ DMA_TX_SIZE * sizeof(struct dma_desc), -+ tx_q->dma_tx, tx_q->dma_tx_phy); -+ else -+ dma_free_coherent(priv->device, DMA_TX_SIZE * -+ sizeof(struct dma_extended_desc), -+ tx_q->dma_etx, tx_q->dma_tx_phy); -+ -+ kfree(tx_q->tx_skbuff_dma); -+ kfree(tx_q->tx_skbuff); -+ } -+} -+ -+/** -+ * alloc_dma_rx_desc_resources - alloc RX resources. - * @priv: private structure - * Description: according to which descriptor can be used (extend or basic) - * this function allocates the resources for TX and RX paths. In case of - * reception, for example, it pre-allocated the RX socket buffer in order to - * allow zero-copy mechanism. - */ --static int alloc_dma_desc_resources(struct stmmac_priv *priv) -+static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv) - { -+ u32 rx_count = priv->plat->rx_queues_to_use; - int ret = -ENOMEM; -+ u32 queue; - -- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), -- GFP_KERNEL); -- if (!priv->rx_skbuff_dma) -- return -ENOMEM; -+ /* RX queues buffers and DMA */ -+ for (queue = 0; queue < rx_count; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - -- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->rx_skbuff) -- goto err_rx_skbuff; -- -- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, -- sizeof(*priv->tx_skbuff_dma), -- GFP_KERNEL); -- if (!priv->tx_skbuff_dma) -- goto err_tx_skbuff_dma; -- -- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->tx_skbuff) -- goto err_tx_skbuff; -- -- if (priv->extend_desc) { -- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_erx) -- goto err_dma; -+ rx_q->queue_index = queue; -+ rx_q->priv_data = priv; - -- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_tx_phy, -+ rx_q->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, -+ sizeof(dma_addr_t), - GFP_KERNEL); -- if (!priv->dma_etx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_extended_desc), -- priv->dma_erx, priv->dma_rx_phy); -- goto err_dma; -- } -- } else { -- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_rx) -- goto err_dma; -+ if (!rx_q->rx_skbuff_dma) -+ return -ENOMEM; - -- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_tx_phy, -- GFP_KERNEL); -- if (!priv->dma_tx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- priv->dma_rx, priv->dma_rx_phy); -+ rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE, -+ sizeof(struct sk_buff *), -+ GFP_KERNEL); -+ if (!rx_q->rx_skbuff) - goto err_dma; -+ -+ if (priv->extend_desc) { -+ rx_q->dma_erx = dma_zalloc_coherent(priv->device, -+ DMA_RX_SIZE * -+ sizeof(struct -+ dma_extended_desc), -+ &rx_q->dma_rx_phy, -+ GFP_KERNEL); -+ if (!rx_q->dma_erx) -+ goto err_dma; -+ -+ } else { -+ rx_q->dma_rx = dma_zalloc_coherent(priv->device, -+ DMA_RX_SIZE * -+ sizeof(struct -+ dma_desc), -+ &rx_q->dma_rx_phy, -+ GFP_KERNEL); -+ if (!rx_q->dma_rx) -+ goto err_dma; - } - } - - return 0; - - err_dma: -- kfree(priv->tx_skbuff); --err_tx_skbuff: -- kfree(priv->tx_skbuff_dma); --err_tx_skbuff_dma: -- kfree(priv->rx_skbuff); --err_rx_skbuff: -- kfree(priv->rx_skbuff_dma); -+ free_dma_rx_desc_resources(priv); -+ -+ return ret; -+} -+ -+/** -+ * alloc_dma_tx_desc_resources - alloc TX resources. -+ * @priv: private structure -+ * Description: according to which descriptor can be used (extend or basic) -+ * this function allocates the resources for TX and RX paths. In case of -+ * reception, for example, it pre-allocated the RX socket buffer in order to -+ * allow zero-copy mechanism. -+ */ -+static int alloc_dma_tx_desc_resources(struct stmmac_priv *priv) -+{ -+ u32 tx_count = priv->plat->tx_queues_to_use; -+ int ret = -ENOMEM; -+ u32 queue; -+ -+ /* TX queues buffers and DMA */ -+ for (queue = 0; queue < tx_count; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ tx_q->queue_index = queue; -+ tx_q->priv_data = priv; -+ -+ tx_q->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, -+ sizeof(*tx_q->tx_skbuff_dma), -+ GFP_KERNEL); -+ if (!tx_q->tx_skbuff_dma) -+ return -ENOMEM; -+ -+ tx_q->tx_skbuff = kmalloc_array(DMA_TX_SIZE, -+ sizeof(struct sk_buff *), -+ GFP_KERNEL); -+ if (!tx_q->tx_skbuff) -+ goto err_dma_buffers; -+ -+ if (priv->extend_desc) { -+ tx_q->dma_etx = dma_zalloc_coherent(priv->device, -+ DMA_TX_SIZE * -+ sizeof(struct -+ dma_extended_desc), -+ &tx_q->dma_tx_phy, -+ GFP_KERNEL); -+ if (!tx_q->dma_etx) -+ goto err_dma_buffers; -+ } else { -+ tx_q->dma_tx = dma_zalloc_coherent(priv->device, -+ DMA_TX_SIZE * -+ sizeof(struct -+ dma_desc), -+ &tx_q->dma_tx_phy, -+ GFP_KERNEL); -+ if (!tx_q->dma_tx) -+ goto err_dma_buffers; -+ } -+ } -+ -+ return 0; -+ -+err_dma_buffers: -+ free_dma_tx_desc_resources(priv); -+ -+ return ret; -+} -+ -+/** -+ * alloc_dma_desc_resources - alloc TX/RX resources. -+ * @priv: private structure -+ * Description: according to which descriptor can be used (extend or basic) -+ * this function allocates the resources for TX and RX paths. In case of -+ * reception, for example, it pre-allocated the RX socket buffer in order to -+ * allow zero-copy mechanism. -+ */ -+static int alloc_dma_desc_resources(struct stmmac_priv *priv) -+{ -+ /* RX Allocation */ -+ int ret = alloc_dma_rx_desc_resources(priv); -+ -+ if (ret) -+ return ret; -+ -+ ret = alloc_dma_tx_desc_resources(priv); -+ - return ret; - } - -+/** -+ * free_dma_desc_resources - free dma desc resources -+ * @priv: private structure -+ */ - static void free_dma_desc_resources(struct stmmac_priv *priv) - { -- /* Release the DMA TX/RX socket buffers */ -- dma_free_rx_skbufs(priv); -- dma_free_tx_skbufs(priv); -- -- /* Free DMA regions of consistent memory previously allocated */ -- if (!priv->extend_desc) { -- dma_free_coherent(priv->device, -- DMA_TX_SIZE * sizeof(struct dma_desc), -- priv->dma_tx, priv->dma_tx_phy); -- dma_free_coherent(priv->device, -- DMA_RX_SIZE * sizeof(struct dma_desc), -- priv->dma_rx, priv->dma_rx_phy); -- } else { -- dma_free_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct dma_extended_desc), -- priv->dma_etx, priv->dma_tx_phy); -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_extended_desc), -- priv->dma_erx, priv->dma_rx_phy); -- } -- kfree(priv->rx_skbuff_dma); -- kfree(priv->rx_skbuff); -- kfree(priv->tx_skbuff_dma); -- kfree(priv->tx_skbuff); -+ /* Release the DMA RX socket buffers */ -+ free_dma_rx_desc_resources(priv); -+ -+ /* Release the DMA TX socket buffers */ -+ free_dma_tx_desc_resources(priv); - } - - /** -@@ -1271,19 +1646,104 @@ static void free_dma_desc_resources(stru - */ - static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) - { -- int rx_count = priv->dma_cap.number_rx_queues; -- int queue = 0; -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ int queue; -+ u8 mode; - -- /* If GMAC does not have multiple queues, then this is not necessary*/ -- if (rx_count == 1) -- return; -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; -+ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); -+ } -+} - -- /** -- * If the core is synthesized with multiple rx queues / multiple -- * dma channels, then rx queues will be disabled by default. -- * For now only rx queue 0 is enabled. -- */ -- priv->hw->mac->rx_queue_enable(priv->hw, queue); -+/** -+ * stmmac_start_rx_dma - start RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This starts a RX DMA channel -+ */ -+static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); -+ priv->hw->dma->start_rx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_start_tx_dma - start TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This starts a TX DMA channel -+ */ -+static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); -+ priv->hw->dma->start_tx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_stop_rx_dma - stop RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This stops a RX DMA channel -+ */ -+static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_rx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_stop_tx_dma - stop TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This stops a TX DMA channel -+ */ -+static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_tx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_start_all_dma - start all RX and TX DMA channels -+ * @priv: driver private structure -+ * Description: -+ * This starts all the RX and TX DMA channels -+ */ -+static void stmmac_start_all_dma(struct stmmac_priv *priv) -+{ -+ u32 rx_channels_count = priv->plat->rx_queues_to_use; -+ u32 tx_channels_count = priv->plat->tx_queues_to_use; -+ u32 chan = 0; -+ -+ for (chan = 0; chan < rx_channels_count; chan++) -+ stmmac_start_rx_dma(priv, chan); -+ -+ for (chan = 0; chan < tx_channels_count; chan++) -+ stmmac_start_tx_dma(priv, chan); -+} -+ -+/** -+ * stmmac_stop_all_dma - stop all RX and TX DMA channels -+ * @priv: driver private structure -+ * Description: -+ * This stops the RX and TX DMA channels -+ */ -+static void stmmac_stop_all_dma(struct stmmac_priv *priv) -+{ -+ u32 rx_channels_count = priv->plat->rx_queues_to_use; -+ u32 tx_channels_count = priv->plat->tx_queues_to_use; -+ u32 chan = 0; -+ -+ for (chan = 0; chan < rx_channels_count; chan++) -+ stmmac_stop_rx_dma(priv, chan); -+ -+ for (chan = 0; chan < tx_channels_count; chan++) -+ stmmac_stop_tx_dma(priv, chan); - } - - /** -@@ -1294,11 +1754,20 @@ static void stmmac_mac_enable_rx_queues( - */ - static void stmmac_dma_operation_mode(struct stmmac_priv *priv) - { -+ u32 rx_channels_count = priv->plat->rx_queues_to_use; -+ u32 tx_channels_count = priv->plat->tx_queues_to_use; - int rxfifosz = priv->plat->rx_fifo_size; -- -- if (priv->plat->force_thresh_dma_mode) -- priv->hw->dma->dma_mode(priv->ioaddr, tc, tc, rxfifosz); -- else if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) { -+ u32 txmode = 0; -+ u32 rxmode = 0; -+ u32 chan = 0; -+ -+ if (rxfifosz == 0) -+ rxfifosz = priv->dma_cap.rx_fifo_size; -+ -+ if (priv->plat->force_thresh_dma_mode) { -+ txmode = tc; -+ rxmode = tc; -+ } else if (priv->plat->force_sf_dma_mode || priv->plat->tx_coe) { - /* - * In case of GMAC, SF mode can be enabled - * to perform the TX COE in HW. This depends on: -@@ -1306,37 +1775,53 @@ static void stmmac_dma_operation_mode(st - * 2) There is no bugged Jumbo frame support - * that needs to not insert csum in the TDES. - */ -- priv->hw->dma->dma_mode(priv->ioaddr, SF_DMA_MODE, SF_DMA_MODE, -- rxfifosz); -+ txmode = SF_DMA_MODE; -+ rxmode = SF_DMA_MODE; - priv->xstats.threshold = SF_DMA_MODE; -- } else -- priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE, -+ } else { -+ txmode = tc; -+ rxmode = SF_DMA_MODE; -+ } -+ -+ /* configure all channels */ -+ if (priv->synopsys_id >= DWMAC_CORE_4_00) { -+ for (chan = 0; chan < rx_channels_count; chan++) -+ priv->hw->dma->dma_rx_mode(priv->ioaddr, rxmode, chan, -+ rxfifosz); -+ -+ for (chan = 0; chan < tx_channels_count; chan++) -+ priv->hw->dma->dma_tx_mode(priv->ioaddr, txmode, chan); -+ } else { -+ priv->hw->dma->dma_mode(priv->ioaddr, txmode, rxmode, - rxfifosz); -+ } - } - - /** - * stmmac_tx_clean - to manage the transmission completion - * @priv: driver private structure -+ * @queue: TX queue index - * Description: it reclaims the transmit resources after transmission completes. - */ --static void stmmac_tx_clean(struct stmmac_priv *priv) -+static void stmmac_tx_clean(struct stmmac_priv *priv, u32 queue) - { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; - unsigned int bytes_compl = 0, pkts_compl = 0; -- unsigned int entry = priv->dirty_tx; -+ unsigned int entry = tx_q->dirty_tx; - - netif_tx_lock(priv->dev); - - priv->xstats.tx_clean++; - -- while (entry != priv->cur_tx) { -- struct sk_buff *skb = priv->tx_skbuff[entry]; -+ while (entry != tx_q->cur_tx) { -+ struct sk_buff *skb = tx_q->tx_skbuff[entry]; - struct dma_desc *p; - int status; - - if (priv->extend_desc) -- p = (struct dma_desc *)(priv->dma_etx + entry); -+ p = (struct dma_desc *)(tx_q->dma_etx + entry); - else -- p = priv->dma_tx + entry; -+ p = tx_q->dma_tx + entry; - - status = priv->hw->desc->tx_status(&priv->dev->stats, - &priv->xstats, p, -@@ -1362,48 +1847,51 @@ static void stmmac_tx_clean(struct stmma - stmmac_get_tx_hwtstamp(priv, p, skb); - } - -- if (likely(priv->tx_skbuff_dma[entry].buf)) { -- if (priv->tx_skbuff_dma[entry].map_as_page) -+ if (likely(tx_q->tx_skbuff_dma[entry].buf)) { -+ if (tx_q->tx_skbuff_dma[entry].map_as_page) - dma_unmap_page(priv->device, -- priv->tx_skbuff_dma[entry].buf, -- priv->tx_skbuff_dma[entry].len, -+ tx_q->tx_skbuff_dma[entry].buf, -+ tx_q->tx_skbuff_dma[entry].len, - DMA_TO_DEVICE); - else - dma_unmap_single(priv->device, -- priv->tx_skbuff_dma[entry].buf, -- priv->tx_skbuff_dma[entry].len, -+ tx_q->tx_skbuff_dma[entry].buf, -+ tx_q->tx_skbuff_dma[entry].len, - DMA_TO_DEVICE); -- priv->tx_skbuff_dma[entry].buf = 0; -- priv->tx_skbuff_dma[entry].len = 0; -- priv->tx_skbuff_dma[entry].map_as_page = false; -+ tx_q->tx_skbuff_dma[entry].buf = 0; -+ tx_q->tx_skbuff_dma[entry].len = 0; -+ tx_q->tx_skbuff_dma[entry].map_as_page = false; - } - - if (priv->hw->mode->clean_desc3) -- priv->hw->mode->clean_desc3(priv, p); -+ priv->hw->mode->clean_desc3(tx_q, p); - -- priv->tx_skbuff_dma[entry].last_segment = false; -- priv->tx_skbuff_dma[entry].is_jumbo = false; -+ tx_q->tx_skbuff_dma[entry].last_segment = false; -+ tx_q->tx_skbuff_dma[entry].is_jumbo = false; - - if (likely(skb != NULL)) { - pkts_compl++; - bytes_compl += skb->len; - dev_consume_skb_any(skb); -- priv->tx_skbuff[entry] = NULL; -+ tx_q->tx_skbuff[entry] = NULL; - } - - priv->hw->desc->release_tx_desc(p, priv->mode); - - entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); - } -- priv->dirty_tx = entry; -+ tx_q->dirty_tx = entry; -+ -+ netdev_tx_completed_queue(netdev_get_tx_queue(priv->dev, queue), -+ pkts_compl, bytes_compl); - -- netdev_completed_queue(priv->dev, pkts_compl, bytes_compl); -+ if (unlikely(netif_tx_queue_stopped(netdev_get_tx_queue(priv->dev, -+ queue))) && -+ stmmac_tx_avail(priv, queue) > STMMAC_TX_THRESH) { - -- if (unlikely(netif_queue_stopped(priv->dev) && -- stmmac_tx_avail(priv) > STMMAC_TX_THRESH)) { - netif_dbg(priv, tx_done, priv->dev, - "%s: restart transmit\n", __func__); -- netif_wake_queue(priv->dev); -+ netif_tx_wake_queue(netdev_get_tx_queue(priv->dev, queue)); - } - - if ((priv->eee_enabled) && (!priv->tx_path_in_lpi_mode)) { -@@ -1413,45 +1901,76 @@ static void stmmac_tx_clean(struct stmma - netif_tx_unlock(priv->dev); - } - --static inline void stmmac_enable_dma_irq(struct stmmac_priv *priv) -+static inline void stmmac_enable_dma_irq(struct stmmac_priv *priv, u32 chan) - { -- priv->hw->dma->enable_dma_irq(priv->ioaddr); -+ priv->hw->dma->enable_dma_irq(priv->ioaddr, chan); - } - --static inline void stmmac_disable_dma_irq(struct stmmac_priv *priv) -+static inline void stmmac_disable_dma_irq(struct stmmac_priv *priv, u32 chan) - { -- priv->hw->dma->disable_dma_irq(priv->ioaddr); -+ priv->hw->dma->disable_dma_irq(priv->ioaddr, chan); - } - - /** - * stmmac_tx_err - to manage the tx error - * @priv: driver private structure -+ * @chan: channel index - * Description: it cleans the descriptors and restarts the transmission - * in case of transmission errors. - */ --static void stmmac_tx_err(struct stmmac_priv *priv) -+static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan) - { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[chan]; - int i; -- netif_stop_queue(priv->dev); - -- priv->hw->dma->stop_tx(priv->ioaddr); -- dma_free_tx_skbufs(priv); -+ netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan)); -+ -+ stmmac_stop_tx_dma(priv, chan); -+ dma_free_tx_skbufs(priv, chan); - for (i = 0; i < DMA_TX_SIZE; i++) - if (priv->extend_desc) -- priv->hw->desc->init_tx_desc(&priv->dma_etx[i].basic, -+ priv->hw->desc->init_tx_desc(&tx_q->dma_etx[i].basic, - priv->mode, - (i == DMA_TX_SIZE - 1)); - else -- priv->hw->desc->init_tx_desc(&priv->dma_tx[i], -+ priv->hw->desc->init_tx_desc(&tx_q->dma_tx[i], - priv->mode, - (i == DMA_TX_SIZE - 1)); -- priv->dirty_tx = 0; -- priv->cur_tx = 0; -- netdev_reset_queue(priv->dev); -- priv->hw->dma->start_tx(priv->ioaddr); -+ tx_q->dirty_tx = 0; -+ tx_q->cur_tx = 0; -+ netdev_tx_reset_queue(netdev_get_tx_queue(priv->dev, chan)); -+ stmmac_start_tx_dma(priv, chan); - - priv->dev->stats.tx_errors++; -- netif_wake_queue(priv->dev); -+ netif_tx_wake_queue(netdev_get_tx_queue(priv->dev, chan)); -+} -+ -+/** -+ * stmmac_set_dma_operation_mode - Set DMA operation mode by channel -+ * @priv: driver private structure -+ * @txmode: TX operating mode -+ * @rxmode: RX operating mode -+ * @chan: channel index -+ * Description: it is used for configuring of the DMA operation mode in -+ * runtime in order to program the tx/rx DMA thresholds or Store-And-Forward -+ * mode. -+ */ -+static void stmmac_set_dma_operation_mode(struct stmmac_priv *priv, u32 txmode, -+ u32 rxmode, u32 chan) -+{ -+ int rxfifosz = priv->plat->rx_fifo_size; -+ -+ if (rxfifosz == 0) -+ rxfifosz = priv->dma_cap.rx_fifo_size; -+ -+ if (priv->synopsys_id >= DWMAC_CORE_4_00) { -+ priv->hw->dma->dma_rx_mode(priv->ioaddr, rxmode, chan, -+ rxfifosz); -+ priv->hw->dma->dma_tx_mode(priv->ioaddr, txmode, chan); -+ } else { -+ priv->hw->dma->dma_mode(priv->ioaddr, txmode, rxmode, -+ rxfifosz); -+ } - } - - /** -@@ -1463,31 +1982,43 @@ static void stmmac_tx_err(struct stmmac_ - */ - static void stmmac_dma_interrupt(struct stmmac_priv *priv) - { -+ u32 tx_channel_count = priv->plat->tx_queues_to_use; - int status; -- int rxfifosz = priv->plat->rx_fifo_size; -+ u32 chan; -+ -+ for (chan = 0; chan < tx_channel_count; chan++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[chan]; - -- status = priv->hw->dma->dma_interrupt(priv->ioaddr, &priv->xstats); -- if (likely((status & handle_rx)) || (status & handle_tx)) { -- if (likely(napi_schedule_prep(&priv->napi))) { -- stmmac_disable_dma_irq(priv); -- __napi_schedule(&priv->napi); -+ status = priv->hw->dma->dma_interrupt(priv->ioaddr, -+ &priv->xstats, chan); -+ if (likely((status & handle_rx)) || (status & handle_tx)) { -+ if (likely(napi_schedule_prep(&rx_q->napi))) { -+ stmmac_disable_dma_irq(priv, chan); -+ __napi_schedule(&rx_q->napi); -+ } - } -- } -- if (unlikely(status & tx_hard_error_bump_tc)) { -- /* Try to bump up the dma threshold on this failure */ -- if (unlikely(priv->xstats.threshold != SF_DMA_MODE) && -- (tc <= 256)) { -- tc += 64; -- if (priv->plat->force_thresh_dma_mode) -- priv->hw->dma->dma_mode(priv->ioaddr, tc, tc, -- rxfifosz); -- else -- priv->hw->dma->dma_mode(priv->ioaddr, tc, -- SF_DMA_MODE, rxfifosz); -- priv->xstats.threshold = tc; -+ -+ if (unlikely(status & tx_hard_error_bump_tc)) { -+ /* Try to bump up the dma threshold on this failure */ -+ if (unlikely(priv->xstats.threshold != SF_DMA_MODE) && -+ (tc <= 256)) { -+ tc += 64; -+ if (priv->plat->force_thresh_dma_mode) -+ stmmac_set_dma_operation_mode(priv, -+ tc, -+ tc, -+ chan); -+ else -+ stmmac_set_dma_operation_mode(priv, -+ tc, -+ SF_DMA_MODE, -+ chan); -+ priv->xstats.threshold = tc; -+ } -+ } else if (unlikely(status == tx_hard_error)) { -+ stmmac_tx_err(priv, chan); - } -- } else if (unlikely(status == tx_hard_error)) -- stmmac_tx_err(priv); -+ } - } - - /** -@@ -1594,6 +2125,13 @@ static void stmmac_check_ether_addr(stru - */ - static int stmmac_init_dma_engine(struct stmmac_priv *priv) - { -+ u32 rx_channels_count = priv->plat->rx_queues_to_use; -+ u32 tx_channels_count = priv->plat->tx_queues_to_use; -+ struct stmmac_rx_queue *rx_q; -+ struct stmmac_tx_queue *tx_q; -+ u32 dummy_dma_rx_phy = 0; -+ u32 dummy_dma_tx_phy = 0; -+ u32 chan = 0; - int atds = 0; - int ret = 0; - -@@ -1611,19 +2149,49 @@ static int stmmac_init_dma_engine(struct - return ret; - } - -- priv->hw->dma->init(priv->ioaddr, priv->plat->dma_cfg, -- priv->dma_tx_phy, priv->dma_rx_phy, atds); -- - if (priv->synopsys_id >= DWMAC_CORE_4_00) { -- priv->rx_tail_addr = priv->dma_rx_phy + -- (DMA_RX_SIZE * sizeof(struct dma_desc)); -- priv->hw->dma->set_rx_tail_ptr(priv->ioaddr, priv->rx_tail_addr, -- STMMAC_CHAN0); -- -- priv->tx_tail_addr = priv->dma_tx_phy + -- (DMA_TX_SIZE * sizeof(struct dma_desc)); -- priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, -- STMMAC_CHAN0); -+ /* DMA Configuration */ -+ priv->hw->dma->init(priv->ioaddr, priv->plat->dma_cfg, -+ dummy_dma_tx_phy, dummy_dma_rx_phy, atds); -+ -+ /* DMA RX Channel Configuration */ -+ for (chan = 0; chan < rx_channels_count; chan++) { -+ rx_q = &priv->rx_queue[chan]; -+ -+ priv->hw->dma->init_rx_chan(priv->ioaddr, -+ priv->plat->dma_cfg, -+ rx_q->dma_rx_phy, chan); -+ -+ rx_q->rx_tail_addr = rx_q->dma_rx_phy + -+ (DMA_RX_SIZE * sizeof(struct dma_desc)); -+ priv->hw->dma->set_rx_tail_ptr(priv->ioaddr, -+ rx_q->rx_tail_addr, -+ chan); -+ } -+ -+ /* DMA TX Channel Configuration */ -+ for (chan = 0; chan < tx_channels_count; chan++) { -+ tx_q = &priv->tx_queue[chan]; -+ -+ priv->hw->dma->init_chan(priv->ioaddr, -+ priv->plat->dma_cfg, -+ chan); -+ -+ priv->hw->dma->init_tx_chan(priv->ioaddr, -+ priv->plat->dma_cfg, -+ tx_q->dma_tx_phy, chan); -+ -+ tx_q->tx_tail_addr = tx_q->dma_tx_phy + -+ (DMA_TX_SIZE * sizeof(struct dma_desc)); -+ priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, -+ tx_q->tx_tail_addr, -+ chan); -+ } -+ } else { -+ rx_q = &priv->rx_queue[chan]; -+ tx_q = &priv->tx_queue[chan]; -+ priv->hw->dma->init(priv->ioaddr, priv->plat->dma_cfg, -+ tx_q->dma_tx_phy, rx_q->dma_rx_phy, atds); - } - - if (priv->plat->axi && priv->hw->dma->axi) -@@ -1641,8 +2209,12 @@ static int stmmac_init_dma_engine(struct - static void stmmac_tx_timer(unsigned long data) - { - struct stmmac_priv *priv = (struct stmmac_priv *)data; -+ u32 tx_queues_count = priv->plat->tx_queues_to_use; -+ u32 queue; - -- stmmac_tx_clean(priv); -+ /* let's scan all the tx queues */ -+ for (queue = 0; queue < tx_queues_count; queue++) -+ stmmac_tx_clean(priv, queue); - } - - /** -@@ -1664,6 +2236,196 @@ static void stmmac_init_tx_coalesce(stru - add_timer(&priv->txtimer); - } - -+static void stmmac_set_rings_length(struct stmmac_priv *priv) -+{ -+ u32 rx_channels_count = priv->plat->rx_queues_to_use; -+ u32 tx_channels_count = priv->plat->tx_queues_to_use; -+ u32 chan; -+ -+ /* set TX ring length */ -+ if (priv->hw->dma->set_tx_ring_len) { -+ for (chan = 0; chan < tx_channels_count; chan++) -+ priv->hw->dma->set_tx_ring_len(priv->ioaddr, -+ (DMA_TX_SIZE - 1), chan); -+ } -+ -+ /* set RX ring length */ -+ if (priv->hw->dma->set_rx_ring_len) { -+ for (chan = 0; chan < rx_channels_count; chan++) -+ priv->hw->dma->set_rx_ring_len(priv->ioaddr, -+ (DMA_RX_SIZE - 1), chan); -+ } -+} -+ -+/** -+ * stmmac_set_tx_queue_weight - Set TX queue weight -+ * @priv: driver private structure -+ * Description: It is used for setting TX queues weight -+ */ -+static void stmmac_set_tx_queue_weight(struct stmmac_priv *priv) -+{ -+ u32 tx_queues_count = priv->plat->tx_queues_to_use; -+ u32 weight; -+ u32 queue; -+ -+ for (queue = 0; queue < tx_queues_count; queue++) { -+ weight = priv->plat->tx_queues_cfg[queue].weight; -+ priv->hw->mac->set_mtl_tx_queue_weight(priv->hw, weight, queue); -+ } -+} -+ -+/** -+ * stmmac_configure_cbs - Configure CBS in TX queue -+ * @priv: driver private structure -+ * Description: It is used for configuring CBS in AVB TX queues -+ */ -+static void stmmac_configure_cbs(struct stmmac_priv *priv) -+{ -+ u32 tx_queues_count = priv->plat->tx_queues_to_use; -+ u32 mode_to_use; -+ u32 queue; -+ -+ /* queue 0 is reserved for legacy traffic */ -+ for (queue = 1; queue < tx_queues_count; queue++) { -+ mode_to_use = priv->plat->tx_queues_cfg[queue].mode_to_use; -+ if (mode_to_use == MTL_QUEUE_DCB) -+ continue; -+ -+ priv->hw->mac->config_cbs(priv->hw, -+ priv->plat->tx_queues_cfg[queue].send_slope, -+ priv->plat->tx_queues_cfg[queue].idle_slope, -+ priv->plat->tx_queues_cfg[queue].high_credit, -+ priv->plat->tx_queues_cfg[queue].low_credit, -+ queue); -+ } -+} -+ -+/** -+ * stmmac_rx_queue_dma_chan_map - Map RX queue to RX dma channel -+ * @priv: driver private structure -+ * Description: It is used for mapping RX queues to RX dma channels -+ */ -+static void stmmac_rx_queue_dma_chan_map(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ u32 queue; -+ u32 chan; -+ -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ chan = priv->plat->rx_queues_cfg[queue].chan; -+ priv->hw->mac->map_mtl_to_dma(priv->hw, queue, chan); -+ } -+} -+ -+/** -+ * stmmac_mac_config_rx_queues_prio - Configure RX Queue priority -+ * @priv: driver private structure -+ * Description: It is used for configuring the RX Queue Priority -+ */ -+static void stmmac_mac_config_rx_queues_prio(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ u32 queue; -+ u32 prio; -+ -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ if (!priv->plat->rx_queues_cfg[queue].use_prio) -+ continue; -+ -+ prio = priv->plat->rx_queues_cfg[queue].prio; -+ priv->hw->mac->rx_queue_prio(priv->hw, prio, queue); -+ } -+} -+ -+/** -+ * stmmac_mac_config_tx_queues_prio - Configure TX Queue priority -+ * @priv: driver private structure -+ * Description: It is used for configuring the TX Queue Priority -+ */ -+static void stmmac_mac_config_tx_queues_prio(struct stmmac_priv *priv) -+{ -+ u32 tx_queues_count = priv->plat->tx_queues_to_use; -+ u32 queue; -+ u32 prio; -+ -+ for (queue = 0; queue < tx_queues_count; queue++) { -+ if (!priv->plat->tx_queues_cfg[queue].use_prio) -+ continue; -+ -+ prio = priv->plat->tx_queues_cfg[queue].prio; -+ priv->hw->mac->tx_queue_prio(priv->hw, prio, queue); -+ } -+} -+ -+/** -+ * stmmac_mac_config_rx_queues_routing - Configure RX Queue Routing -+ * @priv: driver private structure -+ * Description: It is used for configuring the RX queue routing -+ */ -+static void stmmac_mac_config_rx_queues_routing(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ u32 queue; -+ u8 packet; -+ -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ /* no specific packet type routing specified for the queue */ -+ if (priv->plat->rx_queues_cfg[queue].pkt_route == 0x0) -+ continue; -+ -+ packet = priv->plat->rx_queues_cfg[queue].pkt_route; -+ priv->hw->mac->rx_queue_prio(priv->hw, packet, queue); -+ } -+} -+ -+/** -+ * stmmac_mtl_configuration - Configure MTL -+ * @priv: driver private structure -+ * Description: It is used for configurring MTL -+ */ -+static void stmmac_mtl_configuration(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ u32 tx_queues_count = priv->plat->tx_queues_to_use; -+ -+ if (tx_queues_count > 1 && priv->hw->mac->set_mtl_tx_queue_weight) -+ stmmac_set_tx_queue_weight(priv); -+ -+ /* Configure MTL RX algorithms */ -+ if (rx_queues_count > 1 && priv->hw->mac->prog_mtl_rx_algorithms) -+ priv->hw->mac->prog_mtl_rx_algorithms(priv->hw, -+ priv->plat->rx_sched_algorithm); -+ -+ /* Configure MTL TX algorithms */ -+ if (tx_queues_count > 1 && priv->hw->mac->prog_mtl_tx_algorithms) -+ priv->hw->mac->prog_mtl_tx_algorithms(priv->hw, -+ priv->plat->tx_sched_algorithm); -+ -+ /* Configure CBS in AVB TX queues */ -+ if (tx_queues_count > 1 && priv->hw->mac->config_cbs) -+ stmmac_configure_cbs(priv); -+ -+ /* Map RX MTL to DMA channels */ -+ if (priv->hw->mac->map_mtl_to_dma) -+ stmmac_rx_queue_dma_chan_map(priv); -+ -+ /* Enable MAC RX Queues */ -+ if (priv->hw->mac->rx_queue_enable) -+ stmmac_mac_enable_rx_queues(priv); -+ -+ /* Set RX priorities */ -+ if (rx_queues_count > 1 && priv->hw->mac->rx_queue_prio) -+ stmmac_mac_config_rx_queues_prio(priv); -+ -+ /* Set TX priorities */ -+ if (tx_queues_count > 1 && priv->hw->mac->tx_queue_prio) -+ stmmac_mac_config_tx_queues_prio(priv); -+ -+ /* Set RX routing */ -+ if (rx_queues_count > 1 && priv->hw->mac->rx_queue_routing) -+ stmmac_mac_config_rx_queues_routing(priv); -+} -+ - /** - * stmmac_hw_setup - setup mac in a usable state. - * @dev : pointer to the device structure. -@@ -1679,6 +2441,9 @@ static void stmmac_init_tx_coalesce(stru - static int stmmac_hw_setup(struct net_device *dev, bool init_ptp) - { - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 rx_cnt = priv->plat->rx_queues_to_use; -+ u32 tx_cnt = priv->plat->tx_queues_to_use; -+ u32 chan; - int ret; - - /* DMA initialization and SW reset */ -@@ -1708,9 +2473,9 @@ static int stmmac_hw_setup(struct net_de - /* Initialize the MAC Core */ - priv->hw->mac->core_init(priv->hw, dev->mtu); - -- /* Initialize MAC RX Queues */ -- if (priv->hw->mac->rx_queue_enable) -- stmmac_mac_enable_rx_queues(priv); -+ /* Initialize MTL*/ -+ if (priv->synopsys_id >= DWMAC_CORE_4_00) -+ stmmac_mtl_configuration(priv); - - ret = priv->hw->mac->rx_ipc(priv->hw); - if (!ret) { -@@ -1720,10 +2485,7 @@ static int stmmac_hw_setup(struct net_de - } - - /* Enable the MAC Rx/Tx */ -- if (priv->synopsys_id >= DWMAC_CORE_4_00) -- stmmac_dwmac4_set_mac(priv->ioaddr, true); -- else -- stmmac_set_mac(priv->ioaddr, true); -+ priv->hw->mac->set_mac(priv->ioaddr, true); - - /* Set the HW DMA mode and the COE */ - stmmac_dma_operation_mode(priv); -@@ -1731,6 +2493,10 @@ static int stmmac_hw_setup(struct net_de - stmmac_mmc_setup(priv); - - if (init_ptp) { -+ ret = clk_prepare_enable(priv->plat->clk_ptp_ref); -+ if (ret < 0) -+ netdev_warn(priv->dev, "failed to enable PTP reference clock: %d\n", ret); -+ - ret = stmmac_init_ptp(priv); - if (ret == -EOPNOTSUPP) - netdev_warn(priv->dev, "PTP not supported by HW\n"); -@@ -1745,35 +2511,37 @@ static int stmmac_hw_setup(struct net_de - __func__); - #endif - /* Start the ball rolling... */ -- netdev_dbg(priv->dev, "DMA RX/TX processes started...\n"); -- priv->hw->dma->start_tx(priv->ioaddr); -- priv->hw->dma->start_rx(priv->ioaddr); -+ stmmac_start_all_dma(priv); - - priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; - - if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) { - priv->rx_riwt = MAX_DMA_RIWT; -- priv->hw->dma->rx_watchdog(priv->ioaddr, MAX_DMA_RIWT); -+ priv->hw->dma->rx_watchdog(priv->ioaddr, MAX_DMA_RIWT, rx_cnt); - } - - if (priv->hw->pcs && priv->hw->mac->pcs_ctrl_ane) - priv->hw->mac->pcs_ctrl_ane(priv->hw, 1, priv->hw->ps, 0); - -- /* set TX ring length */ -- if (priv->hw->dma->set_tx_ring_len) -- priv->hw->dma->set_tx_ring_len(priv->ioaddr, -- (DMA_TX_SIZE - 1)); -- /* set RX ring length */ -- if (priv->hw->dma->set_rx_ring_len) -- priv->hw->dma->set_rx_ring_len(priv->ioaddr, -- (DMA_RX_SIZE - 1)); -+ /* set TX and RX rings length */ -+ stmmac_set_rings_length(priv); -+ - /* Enable TSO */ -- if (priv->tso) -- priv->hw->dma->enable_tso(priv->ioaddr, 1, STMMAC_CHAN0); -+ if (priv->tso) { -+ for (chan = 0; chan < tx_cnt; chan++) -+ priv->hw->dma->enable_tso(priv->ioaddr, 1, chan); -+ } - - return 0; - } - -+static void stmmac_hw_teardown(struct net_device *dev) -+{ -+ struct stmmac_priv *priv = netdev_priv(dev); -+ -+ clk_disable_unprepare(priv->plat->clk_ptp_ref); -+} -+ - /** - * stmmac_open - open entry point of the driver - * @dev : pointer to the device structure. -@@ -1842,7 +2610,7 @@ static int stmmac_open(struct net_device - netdev_err(priv->dev, - "%s: ERROR: allocating the IRQ %d (error: %d)\n", - __func__, dev->irq, ret); -- goto init_error; -+ goto irq_error; - } - - /* Request the Wake IRQ in case of another line is used for WoL */ -@@ -1869,8 +2637,8 @@ static int stmmac_open(struct net_device - } - } - -- napi_enable(&priv->napi); -- netif_start_queue(dev); -+ stmmac_enable_all_queues(priv); -+ stmmac_start_all_queues(priv); - - return 0; - -@@ -1879,7 +2647,12 @@ lpiirq_error: - free_irq(priv->wol_irq, dev); - wolirq_error: - free_irq(dev->irq, dev); -+irq_error: -+ if (dev->phydev) -+ phy_stop(dev->phydev); - -+ del_timer_sync(&priv->txtimer); -+ stmmac_hw_teardown(dev); - init_error: - free_dma_desc_resources(priv); - dma_desc_error: -@@ -1908,9 +2681,9 @@ static int stmmac_release(struct net_dev - phy_disconnect(dev->phydev); - } - -- netif_stop_queue(dev); -+ stmmac_stop_all_queues(priv); - -- napi_disable(&priv->napi); -+ stmmac_disable_all_queues(priv); - - del_timer_sync(&priv->txtimer); - -@@ -1922,14 +2695,13 @@ static int stmmac_release(struct net_dev - free_irq(priv->lpi_irq, dev); - - /* Stop TX/RX DMA and clear the descriptors */ -- priv->hw->dma->stop_tx(priv->ioaddr); -- priv->hw->dma->stop_rx(priv->ioaddr); -+ stmmac_stop_all_dma(priv); - - /* Release and free the Rx/Tx resources */ - free_dma_desc_resources(priv); - - /* Disable the MAC Rx/Tx */ -- stmmac_set_mac(priv->ioaddr, false); -+ priv->hw->mac->set_mac(priv->ioaddr, false); - - netif_carrier_off(dev); - -@@ -1948,22 +2720,24 @@ static int stmmac_release(struct net_dev - * @des: buffer start address - * @total_len: total length to fill in descriptors - * @last_segmant: condition for the last descriptor -+ * @queue: TX queue index - * Description: - * This function fills descriptor and request new descriptors according to - * buffer length to fill - */ - static void stmmac_tso_allocator(struct stmmac_priv *priv, unsigned int des, -- int total_len, bool last_segment) -+ int total_len, bool last_segment, u32 queue) - { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; - struct dma_desc *desc; -- int tmp_len; - u32 buff_size; -+ int tmp_len; - - tmp_len = total_len; - - while (tmp_len > 0) { -- priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); -- desc = priv->dma_tx + priv->cur_tx; -+ tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx, DMA_TX_SIZE); -+ desc = tx_q->dma_tx + tx_q->cur_tx; - - desc->des0 = cpu_to_le32(des + (total_len - tmp_len)); - buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ? -@@ -1971,7 +2745,7 @@ static void stmmac_tso_allocator(struct - - priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size, - 0, 1, -- (last_segment) && (buff_size < TSO_MAX_BUFF_SIZE), -+ (last_segment) && (tmp_len <= TSO_MAX_BUFF_SIZE), - 0, 0); - - tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -2007,23 +2781,28 @@ static void stmmac_tso_allocator(struct - */ - static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) - { -- u32 pay_len, mss; -- int tmp_pay_len = 0; -+ struct dma_desc *desc, *first, *mss_desc = NULL; - struct stmmac_priv *priv = netdev_priv(dev); - int nfrags = skb_shinfo(skb)->nr_frags; -+ u32 queue = skb_get_queue_mapping(skb); - unsigned int first_entry, des; -- struct dma_desc *desc, *first, *mss_desc = NULL; -+ struct stmmac_tx_queue *tx_q; -+ int tmp_pay_len = 0; -+ u32 pay_len, mss; - u8 proto_hdr_len; - int i; - -+ tx_q = &priv->tx_queue[queue]; -+ - /* Compute header lengths */ - proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); - - /* Desc availability based on threshold should be enough safe */ -- if (unlikely(stmmac_tx_avail(priv) < -+ if (unlikely(stmmac_tx_avail(priv, queue) < - (((skb->len - proto_hdr_len) / TSO_MAX_BUFF_SIZE + 1)))) { -- if (!netif_queue_stopped(dev)) { -- netif_stop_queue(dev); -+ if (!netif_tx_queue_stopped(netdev_get_tx_queue(dev, queue))) { -+ netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, -+ queue)); - /* This is a hard error, log it. */ - netdev_err(priv->dev, - "%s: Tx Ring full when queue awake\n", -@@ -2038,10 +2817,10 @@ static netdev_tx_t stmmac_tso_xmit(struc - - /* set new MSS value if needed */ - if (mss != priv->mss) { -- mss_desc = priv->dma_tx + priv->cur_tx; -+ mss_desc = tx_q->dma_tx + tx_q->cur_tx; - priv->hw->desc->set_mss(mss_desc, mss); - priv->mss = mss; -- priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); -+ tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx, DMA_TX_SIZE); - } - - if (netif_msg_tx_queued(priv)) { -@@ -2051,9 +2830,9 @@ static netdev_tx_t stmmac_tso_xmit(struc - skb->data_len); - } - -- first_entry = priv->cur_tx; -+ first_entry = tx_q->cur_tx; - -- desc = priv->dma_tx + first_entry; -+ desc = tx_q->dma_tx + first_entry; - first = desc; - - /* first descriptor: fill Headers on Buf1 */ -@@ -2062,9 +2841,8 @@ static netdev_tx_t stmmac_tso_xmit(struc - if (dma_mapping_error(priv->device, des)) - goto dma_map_err; - -- priv->tx_skbuff_dma[first_entry].buf = des; -- priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb); -- priv->tx_skbuff[first_entry] = skb; -+ tx_q->tx_skbuff_dma[first_entry].buf = des; -+ tx_q->tx_skbuff_dma[first_entry].len = skb_headlen(skb); - - first->des0 = cpu_to_le32(des); - -@@ -2075,7 +2853,7 @@ static netdev_tx_t stmmac_tso_xmit(struc - /* If needed take extra descriptors to fill the remaining payload */ - tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; - -- stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0)); -+ stmmac_tso_allocator(priv, des, tmp_pay_len, (nfrags == 0), queue); - - /* Prepare fragments */ - for (i = 0; i < nfrags; i++) { -@@ -2084,24 +2862,34 @@ static netdev_tx_t stmmac_tso_xmit(struc - des = skb_frag_dma_map(priv->device, frag, 0, - skb_frag_size(frag), - DMA_TO_DEVICE); -+ if (dma_mapping_error(priv->device, des)) -+ goto dma_map_err; - - stmmac_tso_allocator(priv, des, skb_frag_size(frag), -- (i == nfrags - 1)); -+ (i == nfrags - 1), queue); - -- priv->tx_skbuff_dma[priv->cur_tx].buf = des; -- priv->tx_skbuff_dma[priv->cur_tx].len = skb_frag_size(frag); -- priv->tx_skbuff[priv->cur_tx] = NULL; -- priv->tx_skbuff_dma[priv->cur_tx].map_as_page = true; -+ tx_q->tx_skbuff_dma[tx_q->cur_tx].buf = des; -+ tx_q->tx_skbuff_dma[tx_q->cur_tx].len = skb_frag_size(frag); -+ tx_q->tx_skbuff[tx_q->cur_tx] = NULL; -+ tx_q->tx_skbuff_dma[tx_q->cur_tx].map_as_page = true; - } - -- priv->tx_skbuff_dma[priv->cur_tx].last_segment = true; -+ tx_q->tx_skbuff_dma[tx_q->cur_tx].last_segment = true; -+ -+ /* Only the last descriptor gets to point to the skb. */ -+ tx_q->tx_skbuff[tx_q->cur_tx] = skb; - -- priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); -+ /* We've used all descriptors we need for this skb, however, -+ * advance cur_tx so that it references a fresh descriptor. -+ * ndo_start_xmit will fill this descriptor the next time it's -+ * called and stmmac_tx_clean may clean up to this descriptor. -+ */ -+ tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx, DMA_TX_SIZE); - -- if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { -+ if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) { - netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n", - __func__); -- netif_stop_queue(dev); -+ netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue)); - } - - dev->stats.tx_bytes += skb->len; -@@ -2133,7 +2921,7 @@ static netdev_tx_t stmmac_tso_xmit(struc - priv->hw->desc->prepare_tso_tx_desc(first, 1, - proto_hdr_len, - pay_len, -- 1, priv->tx_skbuff_dma[first_entry].last_segment, -+ 1, tx_q->tx_skbuff_dma[first_entry].last_segment, - tcp_hdrlen(skb) / 4, (skb->len - proto_hdr_len)); - - /* If context desc is used to change MSS */ -@@ -2155,20 +2943,20 @@ static netdev_tx_t stmmac_tso_xmit(struc - - if (netif_msg_pktdata(priv)) { - pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", -- __func__, priv->cur_tx, priv->dirty_tx, first_entry, -- priv->cur_tx, first, nfrags); -+ __func__, tx_q->cur_tx, tx_q->dirty_tx, first_entry, -+ tx_q->cur_tx, first, nfrags); - -- priv->hw->desc->display_ring((void *)priv->dma_tx, DMA_TX_SIZE, -+ priv->hw->desc->display_ring((void *)tx_q->dma_tx, DMA_TX_SIZE, - 0); - - pr_info(">>> frame to be transmitted: "); - print_pkt(skb->data, skb_headlen(skb)); - } - -- netdev_sent_queue(dev, skb->len); -+ netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len); - -- priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, -- STMMAC_CHAN0); -+ priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, tx_q->tx_tail_addr, -+ queue); - - return NETDEV_TX_OK; - -@@ -2192,21 +2980,27 @@ static netdev_tx_t stmmac_xmit(struct sk - struct stmmac_priv *priv = netdev_priv(dev); - unsigned int nopaged_len = skb_headlen(skb); - int i, csum_insertion = 0, is_jumbo = 0; -+ u32 queue = skb_get_queue_mapping(skb); - int nfrags = skb_shinfo(skb)->nr_frags; -- unsigned int entry, first_entry; -+ int entry; -+ unsigned int first_entry; - struct dma_desc *desc, *first; -+ struct stmmac_tx_queue *tx_q; - unsigned int enh_desc; - unsigned int des; - -+ tx_q = &priv->tx_queue[queue]; -+ - /* Manage oversized TCP frames for GMAC4 device */ - if (skb_is_gso(skb) && priv->tso) { - if (ip_hdr(skb)->protocol == IPPROTO_TCP) - return stmmac_tso_xmit(skb, dev); - } - -- if (unlikely(stmmac_tx_avail(priv) < nfrags + 1)) { -- if (!netif_queue_stopped(dev)) { -- netif_stop_queue(dev); -+ if (unlikely(stmmac_tx_avail(priv, queue) < nfrags + 1)) { -+ if (!netif_tx_queue_stopped(netdev_get_tx_queue(dev, queue))) { -+ netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, -+ queue)); - /* This is a hard error, log it. */ - netdev_err(priv->dev, - "%s: Tx Ring full when queue awake\n", -@@ -2218,20 +3012,18 @@ static netdev_tx_t stmmac_xmit(struct sk - if (priv->tx_path_in_lpi_mode) - stmmac_disable_eee_mode(priv); - -- entry = priv->cur_tx; -+ entry = tx_q->cur_tx; - first_entry = entry; - - csum_insertion = (skb->ip_summed == CHECKSUM_PARTIAL); - - if (likely(priv->extend_desc)) -- desc = (struct dma_desc *)(priv->dma_etx + entry); -+ desc = (struct dma_desc *)(tx_q->dma_etx + entry); - else -- desc = priv->dma_tx + entry; -+ desc = tx_q->dma_tx + entry; - - first = desc; - -- priv->tx_skbuff[first_entry] = skb; -- - enh_desc = priv->plat->enh_desc; - /* To program the descriptors according to the size of the frame */ - if (enh_desc) -@@ -2239,7 +3031,7 @@ static netdev_tx_t stmmac_xmit(struct sk - - if (unlikely(is_jumbo) && likely(priv->synopsys_id < - DWMAC_CORE_4_00)) { -- entry = priv->hw->mode->jumbo_frm(priv, skb, csum_insertion); -+ entry = priv->hw->mode->jumbo_frm(tx_q, skb, csum_insertion); - if (unlikely(entry < 0)) - goto dma_map_err; - } -@@ -2252,48 +3044,56 @@ static netdev_tx_t stmmac_xmit(struct sk - entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); - - if (likely(priv->extend_desc)) -- desc = (struct dma_desc *)(priv->dma_etx + entry); -+ desc = (struct dma_desc *)(tx_q->dma_etx + entry); - else -- desc = priv->dma_tx + entry; -+ desc = tx_q->dma_tx + entry; - - des = skb_frag_dma_map(priv->device, frag, 0, len, - DMA_TO_DEVICE); - if (dma_mapping_error(priv->device, des)) - goto dma_map_err; /* should reuse desc w/o issues */ - -- priv->tx_skbuff[entry] = NULL; -+ tx_q->tx_skbuff[entry] = NULL; - -- priv->tx_skbuff_dma[entry].buf = des; -+ tx_q->tx_skbuff_dma[entry].buf = des; - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) - desc->des0 = cpu_to_le32(des); - else - desc->des2 = cpu_to_le32(des); - -- priv->tx_skbuff_dma[entry].map_as_page = true; -- priv->tx_skbuff_dma[entry].len = len; -- priv->tx_skbuff_dma[entry].last_segment = last_segment; -+ tx_q->tx_skbuff_dma[entry].map_as_page = true; -+ tx_q->tx_skbuff_dma[entry].len = len; -+ tx_q->tx_skbuff_dma[entry].last_segment = last_segment; - - /* Prepare the descriptor and set the own bit too */ - priv->hw->desc->prepare_tx_desc(desc, 0, len, csum_insertion, -- priv->mode, 1, last_segment); -+ priv->mode, 1, last_segment, -+ skb->len); - } - -- entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); -+ /* Only the last descriptor gets to point to the skb. */ -+ tx_q->tx_skbuff[entry] = skb; - -- priv->cur_tx = entry; -+ /* We've used all descriptors we need for this skb, however, -+ * advance cur_tx so that it references a fresh descriptor. -+ * ndo_start_xmit will fill this descriptor the next time it's -+ * called and stmmac_tx_clean may clean up to this descriptor. -+ */ -+ entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); -+ tx_q->cur_tx = entry; - - if (netif_msg_pktdata(priv)) { - void *tx_head; - - netdev_dbg(priv->dev, - "%s: curr=%d dirty=%d f=%d, e=%d, first=%p, nfrags=%d", -- __func__, priv->cur_tx, priv->dirty_tx, first_entry, -+ __func__, tx_q->cur_tx, tx_q->dirty_tx, first_entry, - entry, first, nfrags); - - if (priv->extend_desc) -- tx_head = (void *)priv->dma_etx; -+ tx_head = (void *)tx_q->dma_etx; - else -- tx_head = (void *)priv->dma_tx; -+ tx_head = (void *)tx_q->dma_tx; - - priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); - -@@ -2301,10 +3101,10 @@ static netdev_tx_t stmmac_xmit(struct sk - print_pkt(skb->data, skb->len); - } - -- if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { -+ if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) { - netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n", - __func__); -- netif_stop_queue(dev); -+ netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue)); - } - - dev->stats.tx_bytes += skb->len; -@@ -2339,14 +3139,14 @@ static netdev_tx_t stmmac_xmit(struct sk - if (dma_mapping_error(priv->device, des)) - goto dma_map_err; - -- priv->tx_skbuff_dma[first_entry].buf = des; -+ tx_q->tx_skbuff_dma[first_entry].buf = des; - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) - first->des0 = cpu_to_le32(des); - else - first->des2 = cpu_to_le32(des); - -- priv->tx_skbuff_dma[first_entry].len = nopaged_len; -- priv->tx_skbuff_dma[first_entry].last_segment = last_segment; -+ tx_q->tx_skbuff_dma[first_entry].len = nopaged_len; -+ tx_q->tx_skbuff_dma[first_entry].last_segment = last_segment; - - if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && - priv->hwts_tx_en)) { -@@ -2358,7 +3158,7 @@ static netdev_tx_t stmmac_xmit(struct sk - /* Prepare the first descriptor setting the OWN bit too */ - priv->hw->desc->prepare_tx_desc(first, 1, nopaged_len, - csum_insertion, priv->mode, 1, -- last_segment); -+ last_segment, skb->len); - - /* The own bit must be the latest setting done when prepare the - * descriptor and then barrier is needed to make sure that -@@ -2367,13 +3167,13 @@ static netdev_tx_t stmmac_xmit(struct sk - dma_wmb(); - } - -- netdev_sent_queue(dev, skb->len); -+ netdev_tx_sent_queue(netdev_get_tx_queue(dev, queue), skb->len); - - if (priv->synopsys_id < DWMAC_CORE_4_00) - priv->hw->dma->enable_dma_transmission(priv->ioaddr); - else -- priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, -- STMMAC_CHAN0); -+ priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, tx_q->tx_tail_addr, -+ queue); - - return NETDEV_TX_OK; - -@@ -2401,9 +3201,9 @@ static void stmmac_rx_vlan(struct net_de - } - - --static inline int stmmac_rx_threshold_count(struct stmmac_priv *priv) -+static inline int stmmac_rx_threshold_count(struct stmmac_rx_queue *rx_q) - { -- if (priv->rx_zeroc_thresh < STMMAC_RX_THRESH) -+ if (rx_q->rx_zeroc_thresh < STMMAC_RX_THRESH) - return 0; - - return 1; -@@ -2412,30 +3212,33 @@ static inline int stmmac_rx_threshold_co - /** - * stmmac_rx_refill - refill used skb preallocated buffers - * @priv: driver private structure -+ * @queue: RX queue index - * Description : this is to reallocate the skb for the reception process - * that is based on zero-copy. - */ --static inline void stmmac_rx_refill(struct stmmac_priv *priv) -+static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue) - { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ int dirty = stmmac_rx_dirty(priv, queue); -+ unsigned int entry = rx_q->dirty_rx; -+ - int bfsize = priv->dma_buf_sz; -- unsigned int entry = priv->dirty_rx; -- int dirty = stmmac_rx_dirty(priv); - - while (dirty-- > 0) { - struct dma_desc *p; - - if (priv->extend_desc) -- p = (struct dma_desc *)(priv->dma_erx + entry); -+ p = (struct dma_desc *)(rx_q->dma_erx + entry); - else -- p = priv->dma_rx + entry; -+ p = rx_q->dma_rx + entry; - -- if (likely(priv->rx_skbuff[entry] == NULL)) { -+ if (likely(!rx_q->rx_skbuff[entry])) { - struct sk_buff *skb; - - skb = netdev_alloc_skb_ip_align(priv->dev, bfsize); - if (unlikely(!skb)) { - /* so for a while no zero-copy! */ -- priv->rx_zeroc_thresh = STMMAC_RX_THRESH; -+ rx_q->rx_zeroc_thresh = STMMAC_RX_THRESH; - if (unlikely(net_ratelimit())) - dev_err(priv->device, - "fail to alloc skb entry %d\n", -@@ -2443,28 +3246,28 @@ static inline void stmmac_rx_refill(stru - break; - } - -- priv->rx_skbuff[entry] = skb; -- priv->rx_skbuff_dma[entry] = -+ rx_q->rx_skbuff[entry] = skb; -+ rx_q->rx_skbuff_dma[entry] = - dma_map_single(priv->device, skb->data, bfsize, - DMA_FROM_DEVICE); - if (dma_mapping_error(priv->device, -- priv->rx_skbuff_dma[entry])) { -+ rx_q->rx_skbuff_dma[entry])) { - netdev_err(priv->dev, "Rx DMA map failed\n"); - dev_kfree_skb(skb); - break; - } - - if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) { -- p->des0 = cpu_to_le32(priv->rx_skbuff_dma[entry]); -+ p->des0 = cpu_to_le32(rx_q->rx_skbuff_dma[entry]); - p->des1 = 0; - } else { -- p->des2 = cpu_to_le32(priv->rx_skbuff_dma[entry]); -+ p->des2 = cpu_to_le32(rx_q->rx_skbuff_dma[entry]); - } - if (priv->hw->mode->refill_desc3) -- priv->hw->mode->refill_desc3(priv, p); -+ priv->hw->mode->refill_desc3(rx_q, p); - -- if (priv->rx_zeroc_thresh > 0) -- priv->rx_zeroc_thresh--; -+ if (rx_q->rx_zeroc_thresh > 0) -+ rx_q->rx_zeroc_thresh--; - - netif_dbg(priv, rx_status, priv->dev, - "refill entry #%d\n", entry); -@@ -2480,31 +3283,33 @@ static inline void stmmac_rx_refill(stru - - entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); - } -- priv->dirty_rx = entry; -+ rx_q->dirty_rx = entry; - } - - /** - * stmmac_rx - manage the receive process - * @priv: driver private structure -- * @limit: napi bugget. -+ * @limit: napi bugget -+ * @queue: RX queue index. - * Description : this the function called by the napi poll method. - * It gets all the frames inside the ring. - */ --static int stmmac_rx(struct stmmac_priv *priv, int limit) -+static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) - { -- unsigned int entry = priv->cur_rx; -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ unsigned int entry = rx_q->cur_rx; -+ int coe = priv->hw->rx_csum; - unsigned int next_entry; - unsigned int count = 0; -- int coe = priv->hw->rx_csum; - - if (netif_msg_rx_status(priv)) { - void *rx_head; - - netdev_dbg(priv->dev, "%s: descriptor ring:\n", __func__); - if (priv->extend_desc) -- rx_head = (void *)priv->dma_erx; -+ rx_head = (void *)rx_q->dma_erx; - else -- rx_head = (void *)priv->dma_rx; -+ rx_head = (void *)rx_q->dma_rx; - - priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true); - } -@@ -2514,9 +3319,9 @@ static int stmmac_rx(struct stmmac_priv - struct dma_desc *np; - - if (priv->extend_desc) -- p = (struct dma_desc *)(priv->dma_erx + entry); -+ p = (struct dma_desc *)(rx_q->dma_erx + entry); - else -- p = priv->dma_rx + entry; -+ p = rx_q->dma_rx + entry; - - /* read the status of the incoming frame */ - status = priv->hw->desc->rx_status(&priv->dev->stats, -@@ -2527,20 +3332,20 @@ static int stmmac_rx(struct stmmac_priv - - count++; - -- priv->cur_rx = STMMAC_GET_ENTRY(priv->cur_rx, DMA_RX_SIZE); -- next_entry = priv->cur_rx; -+ rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx, DMA_RX_SIZE); -+ next_entry = rx_q->cur_rx; - - if (priv->extend_desc) -- np = (struct dma_desc *)(priv->dma_erx + next_entry); -+ np = (struct dma_desc *)(rx_q->dma_erx + next_entry); - else -- np = priv->dma_rx + next_entry; -+ np = rx_q->dma_rx + next_entry; - - prefetch(np); - - if ((priv->extend_desc) && (priv->hw->desc->rx_extended_status)) - priv->hw->desc->rx_extended_status(&priv->dev->stats, - &priv->xstats, -- priv->dma_erx + -+ rx_q->dma_erx + - entry); - if (unlikely(status == discard_frame)) { - priv->dev->stats.rx_errors++; -@@ -2550,9 +3355,9 @@ static int stmmac_rx(struct stmmac_priv - * them in stmmac_rx_refill() function so that - * device can reuse it. - */ -- priv->rx_skbuff[entry] = NULL; -+ rx_q->rx_skbuff[entry] = NULL; - dma_unmap_single(priv->device, -- priv->rx_skbuff_dma[entry], -+ rx_q->rx_skbuff_dma[entry], - priv->dma_buf_sz, - DMA_FROM_DEVICE); - } -@@ -2600,7 +3405,7 @@ static int stmmac_rx(struct stmmac_priv - */ - if (unlikely(!priv->plat->has_gmac4 && - ((frame_len < priv->rx_copybreak) || -- stmmac_rx_threshold_count(priv)))) { -+ stmmac_rx_threshold_count(rx_q)))) { - skb = netdev_alloc_skb_ip_align(priv->dev, - frame_len); - if (unlikely(!skb)) { -@@ -2612,21 +3417,21 @@ static int stmmac_rx(struct stmmac_priv - } - - dma_sync_single_for_cpu(priv->device, -- priv->rx_skbuff_dma -+ rx_q->rx_skbuff_dma - [entry], frame_len, - DMA_FROM_DEVICE); - skb_copy_to_linear_data(skb, -- priv-> -+ rx_q-> - rx_skbuff[entry]->data, - frame_len); - - skb_put(skb, frame_len); - dma_sync_single_for_device(priv->device, -- priv->rx_skbuff_dma -+ rx_q->rx_skbuff_dma - [entry], frame_len, - DMA_FROM_DEVICE); - } else { -- skb = priv->rx_skbuff[entry]; -+ skb = rx_q->rx_skbuff[entry]; - if (unlikely(!skb)) { - netdev_err(priv->dev, - "%s: Inconsistent Rx chain\n", -@@ -2635,12 +3440,12 @@ static int stmmac_rx(struct stmmac_priv - break; - } - prefetch(skb->data - NET_IP_ALIGN); -- priv->rx_skbuff[entry] = NULL; -- priv->rx_zeroc_thresh++; -+ rx_q->rx_skbuff[entry] = NULL; -+ rx_q->rx_zeroc_thresh++; - - skb_put(skb, frame_len); - dma_unmap_single(priv->device, -- priv->rx_skbuff_dma[entry], -+ rx_q->rx_skbuff_dma[entry], - priv->dma_buf_sz, - DMA_FROM_DEVICE); - } -@@ -2662,7 +3467,7 @@ static int stmmac_rx(struct stmmac_priv - else - skb->ip_summed = CHECKSUM_UNNECESSARY; - -- napi_gro_receive(&priv->napi, skb); -+ napi_gro_receive(&rx_q->napi, skb); - - priv->dev->stats.rx_packets++; - priv->dev->stats.rx_bytes += frame_len; -@@ -2670,7 +3475,7 @@ static int stmmac_rx(struct stmmac_priv - entry = next_entry; - } - -- stmmac_rx_refill(priv); -+ stmmac_rx_refill(priv, queue); - - priv->xstats.rx_pkt_n += count; - -@@ -2687,16 +3492,24 @@ static int stmmac_rx(struct stmmac_priv - */ - static int stmmac_poll(struct napi_struct *napi, int budget) - { -- struct stmmac_priv *priv = container_of(napi, struct stmmac_priv, napi); -+ struct stmmac_rx_queue *rx_q = -+ container_of(napi, struct stmmac_rx_queue, napi); -+ struct stmmac_priv *priv = rx_q->priv_data; -+ u32 tx_count = priv->plat->tx_queues_to_use; -+ u32 chan = rx_q->queue_index; - int work_done = 0; -+ u32 queue; - - priv->xstats.napi_poll++; -- stmmac_tx_clean(priv); - -- work_done = stmmac_rx(priv, budget); -+ /* check all the queues */ -+ for (queue = 0; queue < tx_count; queue++) -+ stmmac_tx_clean(priv, queue); -+ -+ work_done = stmmac_rx(priv, budget, rx_q->queue_index); - if (work_done < budget) { - napi_complete_done(napi, work_done); -- stmmac_enable_dma_irq(priv); -+ stmmac_enable_dma_irq(priv, chan); - } - return work_done; - } -@@ -2712,9 +3525,12 @@ static int stmmac_poll(struct napi_struc - static void stmmac_tx_timeout(struct net_device *dev) - { - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 tx_count = priv->plat->tx_queues_to_use; -+ u32 chan; - - /* Clear Tx resources and restart transmitting again */ -- stmmac_tx_err(priv); -+ for (chan = 0; chan < tx_count; chan++) -+ stmmac_tx_err(priv, chan); - } - - /** -@@ -2837,6 +3653,12 @@ static irqreturn_t stmmac_interrupt(int - { - struct net_device *dev = (struct net_device *)dev_id; - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 rx_cnt = priv->plat->rx_queues_to_use; -+ u32 tx_cnt = priv->plat->tx_queues_to_use; -+ u32 queues_count; -+ u32 queue; -+ -+ queues_count = (rx_cnt > tx_cnt) ? rx_cnt : tx_cnt; - - if (priv->irq_wake) - pm_wakeup_event(priv->device, 0); -@@ -2850,16 +3672,30 @@ static irqreturn_t stmmac_interrupt(int - if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) { - int status = priv->hw->mac->host_irq_status(priv->hw, - &priv->xstats); -+ - if (unlikely(status)) { - /* For LPI we need to save the tx status */ - if (status & CORE_IRQ_TX_PATH_IN_LPI_MODE) - priv->tx_path_in_lpi_mode = true; - if (status & CORE_IRQ_TX_PATH_EXIT_LPI_MODE) - priv->tx_path_in_lpi_mode = false; -- if (status & CORE_IRQ_MTL_RX_OVERFLOW && priv->hw->dma->set_rx_tail_ptr) -- priv->hw->dma->set_rx_tail_ptr(priv->ioaddr, -- priv->rx_tail_addr, -- STMMAC_CHAN0); -+ } -+ -+ if (priv->synopsys_id >= DWMAC_CORE_4_00) { -+ for (queue = 0; queue < queues_count; queue++) { -+ struct stmmac_rx_queue *rx_q = -+ &priv->rx_queue[queue]; -+ -+ status |= -+ priv->hw->mac->host_mtl_irq_status(priv->hw, -+ queue); -+ -+ if (status & CORE_IRQ_MTL_RX_OVERFLOW && -+ priv->hw->dma->set_rx_tail_ptr) -+ priv->hw->dma->set_rx_tail_ptr(priv->ioaddr, -+ rx_q->rx_tail_addr, -+ queue); -+ } - } - - /* PCS link status */ -@@ -2944,7 +3780,7 @@ static void sysfs_display_ring(void *hea - ep++; - } else { - seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", -- i, (unsigned int)virt_to_phys(ep), -+ i, (unsigned int)virt_to_phys(p), - le32_to_cpu(p->des0), le32_to_cpu(p->des1), - le32_to_cpu(p->des2), le32_to_cpu(p->des3)); - p++; -@@ -2957,17 +3793,40 @@ static int stmmac_sysfs_ring_read(struct - { - struct net_device *dev = seq->private; - struct stmmac_priv *priv = netdev_priv(dev); -+ u32 rx_count = priv->plat->rx_queues_to_use; -+ u32 tx_count = priv->plat->tx_queues_to_use; -+ u32 queue; - -- if (priv->extend_desc) { -- seq_printf(seq, "Extended RX descriptor ring:\n"); -- sysfs_display_ring((void *)priv->dma_erx, DMA_RX_SIZE, 1, seq); -- seq_printf(seq, "Extended TX descriptor ring:\n"); -- sysfs_display_ring((void *)priv->dma_etx, DMA_TX_SIZE, 1, seq); -- } else { -- seq_printf(seq, "RX descriptor ring:\n"); -- sysfs_display_ring((void *)priv->dma_rx, DMA_RX_SIZE, 0, seq); -- seq_printf(seq, "TX descriptor ring:\n"); -- sysfs_display_ring((void *)priv->dma_tx, DMA_TX_SIZE, 0, seq); -+ for (queue = 0; queue < rx_count; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ seq_printf(seq, "RX Queue %d:\n", queue); -+ -+ if (priv->extend_desc) { -+ seq_printf(seq, "Extended descriptor ring:\n"); -+ sysfs_display_ring((void *)rx_q->dma_erx, -+ DMA_RX_SIZE, 1, seq); -+ } else { -+ seq_printf(seq, "Descriptor ring:\n"); -+ sysfs_display_ring((void *)rx_q->dma_rx, -+ DMA_RX_SIZE, 0, seq); -+ } -+ } -+ -+ for (queue = 0; queue < tx_count; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ seq_printf(seq, "TX Queue %d:\n", queue); -+ -+ if (priv->extend_desc) { -+ seq_printf(seq, "Extended descriptor ring:\n"); -+ sysfs_display_ring((void *)tx_q->dma_etx, -+ DMA_TX_SIZE, 1, seq); -+ } else { -+ seq_printf(seq, "Descriptor ring:\n"); -+ sysfs_display_ring((void *)tx_q->dma_tx, -+ DMA_TX_SIZE, 0, seq); -+ } - } - - return 0; -@@ -3250,11 +4109,14 @@ int stmmac_dvr_probe(struct device *devi - struct plat_stmmacenet_data *plat_dat, - struct stmmac_resources *res) - { -- int ret = 0; - struct net_device *ndev = NULL; - struct stmmac_priv *priv; -+ int ret = 0; -+ u32 queue; - -- ndev = alloc_etherdev(sizeof(struct stmmac_priv)); -+ ndev = alloc_etherdev_mqs(sizeof(struct stmmac_priv), -+ MTL_MAX_TX_QUEUES, -+ MTL_MAX_RX_QUEUES); - if (!ndev) - return -ENOMEM; - -@@ -3296,6 +4158,10 @@ int stmmac_dvr_probe(struct device *devi - if (ret) - goto error_hw_init; - -+ /* Configure real RX and TX queues */ -+ netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use); -+ netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use); -+ - ndev->netdev_ops = &stmmac_netdev_ops; - - ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | -@@ -3328,7 +4194,12 @@ int stmmac_dvr_probe(struct device *devi - "Enable RX Mitigation via HW Watchdog Timer\n"); - } - -- netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); -+ for (queue = 0; queue < priv->plat->rx_queues_to_use; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ netif_napi_add(ndev, &rx_q->napi, stmmac_poll, -+ (8 * priv->plat->rx_queues_to_use)); -+ } - - spin_lock_init(&priv->lock); - -@@ -3373,7 +4244,11 @@ error_netdev_register: - priv->hw->pcs != STMMAC_PCS_RTBI) - stmmac_mdio_unregister(ndev); - error_mdio_register: -- netif_napi_del(&priv->napi); -+ for (queue = 0; queue < priv->plat->rx_queues_to_use; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ netif_napi_del(&rx_q->napi); -+ } - error_hw_init: - free_netdev(ndev); - -@@ -3394,10 +4269,9 @@ int stmmac_dvr_remove(struct device *dev - - netdev_info(priv->dev, "%s: removing driver", __func__); - -- priv->hw->dma->stop_rx(priv->ioaddr); -- priv->hw->dma->stop_tx(priv->ioaddr); -+ stmmac_stop_all_dma(priv); - -- stmmac_set_mac(priv->ioaddr, false); -+ priv->hw->mac->set_mac(priv->ioaddr, false); - netif_carrier_off(ndev); - unregister_netdev(ndev); - if (priv->plat->stmmac_rst) -@@ -3436,20 +4310,19 @@ int stmmac_suspend(struct device *dev) - spin_lock_irqsave(&priv->lock, flags); - - netif_device_detach(ndev); -- netif_stop_queue(ndev); -+ stmmac_stop_all_queues(priv); - -- napi_disable(&priv->napi); -+ stmmac_disable_all_queues(priv); - - /* Stop TX/RX DMA */ -- priv->hw->dma->stop_tx(priv->ioaddr); -- priv->hw->dma->stop_rx(priv->ioaddr); -+ stmmac_stop_all_dma(priv); - - /* Enable Power down mode by programming the PMT regs */ - if (device_may_wakeup(priv->device)) { - priv->hw->mac->pmt(priv->hw, priv->wolopts); - priv->irq_wake = 1; - } else { -- stmmac_set_mac(priv->ioaddr, false); -+ priv->hw->mac->set_mac(priv->ioaddr, false); - pinctrl_pm_select_sleep_state(priv->device); - /* Disable clock in case of PWM is off */ - clk_disable(priv->plat->pclk); -@@ -3465,6 +4338,31 @@ int stmmac_suspend(struct device *dev) - EXPORT_SYMBOL_GPL(stmmac_suspend); - - /** -+ * stmmac_reset_queues_param - reset queue parameters -+ * @dev: device pointer -+ */ -+static void stmmac_reset_queues_param(struct stmmac_priv *priv) -+{ -+ u32 rx_cnt = priv->plat->rx_queues_to_use; -+ u32 tx_cnt = priv->plat->tx_queues_to_use; -+ u32 queue; -+ -+ for (queue = 0; queue < rx_cnt; queue++) { -+ struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ -+ rx_q->cur_rx = 0; -+ rx_q->dirty_rx = 0; -+ } -+ -+ for (queue = 0; queue < tx_cnt; queue++) { -+ struct stmmac_tx_queue *tx_q = &priv->tx_queue[queue]; -+ -+ tx_q->cur_tx = 0; -+ tx_q->dirty_tx = 0; -+ } -+} -+ -+/** - * stmmac_resume - resume callback - * @dev: device pointer - * Description: when resume this function is invoked to setup the DMA and CORE -@@ -3504,10 +4402,8 @@ int stmmac_resume(struct device *dev) - - spin_lock_irqsave(&priv->lock, flags); - -- priv->cur_rx = 0; -- priv->dirty_rx = 0; -- priv->dirty_tx = 0; -- priv->cur_tx = 0; -+ stmmac_reset_queues_param(priv); -+ - /* reset private mss value to force mss context settings at - * next tso xmit (only used for gmac4). - */ -@@ -3519,9 +4415,9 @@ int stmmac_resume(struct device *dev) - stmmac_init_tx_coalesce(priv); - stmmac_set_rx_mode(ndev); - -- napi_enable(&priv->napi); -+ stmmac_enable_all_queues(priv); - -- netif_start_queue(ndev); -+ stmmac_start_all_queues(priv); - - spin_unlock_irqrestore(&priv->lock, flags); - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -@@ -32,6 +32,7 @@ - */ - struct stmmac_pci_dmi_data { - const char *name; -+ const char *asset_tag; - unsigned int func; - int phy_addr; - }; -@@ -46,6 +47,7 @@ struct stmmac_pci_info { - static int stmmac_pci_find_phy_addr(struct stmmac_pci_info *info) - { - const char *name = dmi_get_system_info(DMI_BOARD_NAME); -+ const char *asset_tag = dmi_get_system_info(DMI_BOARD_ASSET_TAG); - unsigned int func = PCI_FUNC(info->pdev->devfn); - struct stmmac_pci_dmi_data *dmi; - -@@ -57,18 +59,19 @@ static int stmmac_pci_find_phy_addr(stru - return 1; - - for (dmi = info->dmi; dmi->name && *dmi->name; dmi++) { -- if (!strcmp(dmi->name, name) && dmi->func == func) -+ if (!strcmp(dmi->name, name) && dmi->func == func) { -+ /* If asset tag is provided, match on it as well. */ -+ if (dmi->asset_tag && strcmp(dmi->asset_tag, asset_tag)) -+ continue; - return dmi->phy_addr; -+ } - } - - return -ENODEV; - } - --static void stmmac_default_data(struct plat_stmmacenet_data *plat) -+static void common_default_data(struct plat_stmmacenet_data *plat) - { -- plat->bus_id = 1; -- plat->phy_addr = 0; -- plat->interface = PHY_INTERFACE_MODE_GMII; - plat->clk_csr = 2; /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */ - plat->has_gmac = 1; - plat->force_sf_dma_mode = 1; -@@ -76,10 +79,6 @@ static void stmmac_default_data(struct p - plat->mdio_bus_data->phy_reset = NULL; - plat->mdio_bus_data->phy_mask = 0; - -- plat->dma_cfg->pbl = 32; -- plat->dma_cfg->pblx8 = true; -- /* TODO: AXI */ -- - /* Set default value for multicast hash bins */ - plat->multicast_filter_bins = HASH_TABLE_SIZE; - -@@ -88,6 +87,31 @@ static void stmmac_default_data(struct p - - /* Set the maxmtu to a default of JUMBO_LEN */ - plat->maxmtu = JUMBO_LEN; -+ -+ /* Set default number of RX and TX queues to use */ -+ plat->tx_queues_to_use = 1; -+ plat->rx_queues_to_use = 1; -+ -+ /* Disable Priority config by default */ -+ plat->tx_queues_cfg[0].use_prio = false; -+ plat->rx_queues_cfg[0].use_prio = false; -+ -+ /* Disable RX queues routing by default */ -+ plat->rx_queues_cfg[0].pkt_route = 0x0; -+} -+ -+static void stmmac_default_data(struct plat_stmmacenet_data *plat) -+{ -+ /* Set common default data first */ -+ common_default_data(plat); -+ -+ plat->bus_id = 1; -+ plat->phy_addr = 0; -+ plat->interface = PHY_INTERFACE_MODE_GMII; -+ -+ plat->dma_cfg->pbl = 32; -+ plat->dma_cfg->pblx8 = true; -+ /* TODO: AXI */ - } - - static int quark_default_data(struct plat_stmmacenet_data *plat, -@@ -96,6 +120,9 @@ static int quark_default_data(struct pla - struct pci_dev *pdev = info->pdev; - int ret; - -+ /* Set common default data first */ -+ common_default_data(plat); -+ - /* - * Refuse to load the driver and register net device if MAC controller - * does not connect to any PHY interface. -@@ -107,27 +134,12 @@ static int quark_default_data(struct pla - plat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn); - plat->phy_addr = ret; - plat->interface = PHY_INTERFACE_MODE_RMII; -- plat->clk_csr = 2; -- plat->has_gmac = 1; -- plat->force_sf_dma_mode = 1; -- -- plat->mdio_bus_data->phy_reset = NULL; -- plat->mdio_bus_data->phy_mask = 0; - - plat->dma_cfg->pbl = 16; - plat->dma_cfg->pblx8 = true; - plat->dma_cfg->fixed_burst = 1; - /* AXI (TODO) */ - -- /* Set default value for multicast hash bins */ -- plat->multicast_filter_bins = HASH_TABLE_SIZE; -- -- /* Set default value for unicast filter entries */ -- plat->unicast_filter_entries = 1; -- -- /* Set the maxmtu to a default of JUMBO_LEN */ -- plat->maxmtu = JUMBO_LEN; -- - return 0; - } - -@@ -142,6 +154,24 @@ static struct stmmac_pci_dmi_data quark_ - .func = 6, - .phy_addr = 1, - }, -+ { -+ .name = "SIMATIC IOT2000", -+ .asset_tag = "6ES7647-0AA00-0YA2", -+ .func = 6, -+ .phy_addr = 1, -+ }, -+ { -+ .name = "SIMATIC IOT2000", -+ .asset_tag = "6ES7647-0AA00-1YA2", -+ .func = 6, -+ .phy_addr = 1, -+ }, -+ { -+ .name = "SIMATIC IOT2000", -+ .asset_tag = "6ES7647-0AA00-1YA2", -+ .func = 7, -+ .phy_addr = 1, -+ }, - {} - }; - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -107,7 +107,7 @@ static struct stmmac_axi *stmmac_axi_set - if (!np) - return NULL; - -- axi = kzalloc(sizeof(*axi), GFP_KERNEL); -+ axi = devm_kzalloc(&pdev->dev, sizeof(*axi), GFP_KERNEL); - if (!axi) { - of_node_put(np); - return ERR_PTR(-ENOMEM); -@@ -131,6 +131,155 @@ static struct stmmac_axi *stmmac_axi_set - } - - /** -+ * stmmac_mtl_setup - parse DT parameters for multiple queues configuration -+ * @pdev: platform device -+ */ -+static void stmmac_mtl_setup(struct platform_device *pdev, -+ struct plat_stmmacenet_data *plat) -+{ -+ struct device_node *q_node; -+ struct device_node *rx_node; -+ struct device_node *tx_node; -+ u8 queue = 0; -+ -+ /* For backwards-compatibility with device trees that don't have any -+ * snps,mtl-rx-config or snps,mtl-tx-config properties, we fall back -+ * to one RX and TX queues each. -+ */ -+ plat->rx_queues_to_use = 1; -+ plat->tx_queues_to_use = 1; -+ -+ rx_node = of_parse_phandle(pdev->dev.of_node, "snps,mtl-rx-config", 0); -+ if (!rx_node) -+ return; -+ -+ tx_node = of_parse_phandle(pdev->dev.of_node, "snps,mtl-tx-config", 0); -+ if (!tx_node) { -+ of_node_put(rx_node); -+ return; -+ } -+ -+ /* Processing RX queues common config */ -+ if (of_property_read_u8(rx_node, "snps,rx-queues-to-use", -+ &plat->rx_queues_to_use)) -+ plat->rx_queues_to_use = 1; -+ -+ if (of_property_read_bool(rx_node, "snps,rx-sched-sp")) -+ plat->rx_sched_algorithm = MTL_RX_ALGORITHM_SP; -+ else if (of_property_read_bool(rx_node, "snps,rx-sched-wsp")) -+ plat->rx_sched_algorithm = MTL_RX_ALGORITHM_WSP; -+ else -+ plat->rx_sched_algorithm = MTL_RX_ALGORITHM_SP; -+ -+ /* Processing individual RX queue config */ -+ for_each_child_of_node(rx_node, q_node) { -+ if (queue >= plat->rx_queues_to_use) -+ break; -+ -+ if (of_property_read_bool(q_node, "snps,dcb-algorithm")) -+ plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; -+ else if (of_property_read_bool(q_node, "snps,avb-algorithm")) -+ plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_AVB; -+ else -+ plat->rx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; -+ -+ if (of_property_read_u8(q_node, "snps,map-to-dma-channel", -+ &plat->rx_queues_cfg[queue].chan)) -+ plat->rx_queues_cfg[queue].chan = queue; -+ /* TODO: Dynamic mapping to be included in the future */ -+ -+ if (of_property_read_u32(q_node, "snps,priority", -+ &plat->rx_queues_cfg[queue].prio)) { -+ plat->rx_queues_cfg[queue].prio = 0; -+ plat->rx_queues_cfg[queue].use_prio = false; -+ } else { -+ plat->rx_queues_cfg[queue].use_prio = true; -+ } -+ -+ /* RX queue specific packet type routing */ -+ if (of_property_read_bool(q_node, "snps,route-avcp")) -+ plat->rx_queues_cfg[queue].pkt_route = PACKET_AVCPQ; -+ else if (of_property_read_bool(q_node, "snps,route-ptp")) -+ plat->rx_queues_cfg[queue].pkt_route = PACKET_PTPQ; -+ else if (of_property_read_bool(q_node, "snps,route-dcbcp")) -+ plat->rx_queues_cfg[queue].pkt_route = PACKET_DCBCPQ; -+ else if (of_property_read_bool(q_node, "snps,route-up")) -+ plat->rx_queues_cfg[queue].pkt_route = PACKET_UPQ; -+ else if (of_property_read_bool(q_node, "snps,route-multi-broad")) -+ plat->rx_queues_cfg[queue].pkt_route = PACKET_MCBCQ; -+ else -+ plat->rx_queues_cfg[queue].pkt_route = 0x0; -+ -+ queue++; -+ } -+ -+ /* Processing TX queues common config */ -+ if (of_property_read_u8(tx_node, "snps,tx-queues-to-use", -+ &plat->tx_queues_to_use)) -+ plat->tx_queues_to_use = 1; -+ -+ if (of_property_read_bool(tx_node, "snps,tx-sched-wrr")) -+ plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WRR; -+ else if (of_property_read_bool(tx_node, "snps,tx-sched-wfq")) -+ plat->tx_sched_algorithm = MTL_TX_ALGORITHM_WFQ; -+ else if (of_property_read_bool(tx_node, "snps,tx-sched-dwrr")) -+ plat->tx_sched_algorithm = MTL_TX_ALGORITHM_DWRR; -+ else if (of_property_read_bool(tx_node, "snps,tx-sched-sp")) -+ plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP; -+ else -+ plat->tx_sched_algorithm = MTL_TX_ALGORITHM_SP; -+ -+ queue = 0; -+ -+ /* Processing individual TX queue config */ -+ for_each_child_of_node(tx_node, q_node) { -+ if (queue >= plat->tx_queues_to_use) -+ break; -+ -+ if (of_property_read_u8(q_node, "snps,weight", -+ &plat->tx_queues_cfg[queue].weight)) -+ plat->tx_queues_cfg[queue].weight = 0x10 + queue; -+ -+ if (of_property_read_bool(q_node, "snps,dcb-algorithm")) { -+ plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; -+ } else if (of_property_read_bool(q_node, -+ "snps,avb-algorithm")) { -+ plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_AVB; -+ -+ /* Credit Base Shaper parameters used by AVB */ -+ if (of_property_read_u32(q_node, "snps,send_slope", -+ &plat->tx_queues_cfg[queue].send_slope)) -+ plat->tx_queues_cfg[queue].send_slope = 0x0; -+ if (of_property_read_u32(q_node, "snps,idle_slope", -+ &plat->tx_queues_cfg[queue].idle_slope)) -+ plat->tx_queues_cfg[queue].idle_slope = 0x0; -+ if (of_property_read_u32(q_node, "snps,high_credit", -+ &plat->tx_queues_cfg[queue].high_credit)) -+ plat->tx_queues_cfg[queue].high_credit = 0x0; -+ if (of_property_read_u32(q_node, "snps,low_credit", -+ &plat->tx_queues_cfg[queue].low_credit)) -+ plat->tx_queues_cfg[queue].low_credit = 0x0; -+ } else { -+ plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB; -+ } -+ -+ if (of_property_read_u32(q_node, "snps,priority", -+ &plat->tx_queues_cfg[queue].prio)) { -+ plat->tx_queues_cfg[queue].prio = 0; -+ plat->tx_queues_cfg[queue].use_prio = false; -+ } else { -+ plat->tx_queues_cfg[queue].use_prio = true; -+ } -+ -+ queue++; -+ } -+ -+ of_node_put(rx_node); -+ of_node_put(tx_node); -+ of_node_put(q_node); -+} -+ -+/** - * stmmac_dt_phy - parse device-tree driver parameters to allocate PHY resources - * @plat: driver data platform structure - * @np: device tree node -@@ -339,6 +488,8 @@ stmmac_probe_config_dt(struct platform_d - - plat->axi = stmmac_axi_setup(pdev); - -+ stmmac_mtl_setup(pdev, plat); -+ - /* clock setup */ - plat->stmmac_clk = devm_clk_get(&pdev->dev, - STMMAC_RESOURCE_NAME); -@@ -358,13 +509,12 @@ stmmac_probe_config_dt(struct platform_d - clk_prepare_enable(plat->pclk); - - /* Fall-back to main clock in case of no PTP ref is passed */ -- plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "clk_ptp_ref"); -+ plat->clk_ptp_ref = devm_clk_get(&pdev->dev, "ptp_ref"); - if (IS_ERR(plat->clk_ptp_ref)) { - plat->clk_ptp_rate = clk_get_rate(plat->stmmac_clk); - plat->clk_ptp_ref = NULL; - dev_warn(&pdev->dev, "PTP uses main clock\n"); - } else { -- clk_prepare_enable(plat->clk_ptp_ref); - plat->clk_ptp_rate = clk_get_rate(plat->clk_ptp_ref); - dev_dbg(&pdev->dev, "PTP rate %d\n", plat->clk_ptp_rate); - } ---- a/include/linux/stmmac.h -+++ b/include/linux/stmmac.h -@@ -28,6 +28,9 @@ - - #include - -+#define MTL_MAX_RX_QUEUES 8 -+#define MTL_MAX_TX_QUEUES 8 -+ - #define STMMAC_RX_COE_NONE 0 - #define STMMAC_RX_COE_TYPE1 1 - #define STMMAC_RX_COE_TYPE2 2 -@@ -44,6 +47,18 @@ - #define STMMAC_CSR_150_250M 0x4 /* MDC = clk_scr_i/102 */ - #define STMMAC_CSR_250_300M 0x5 /* MDC = clk_scr_i/122 */ - -+/* MTL algorithms identifiers */ -+#define MTL_TX_ALGORITHM_WRR 0x0 -+#define MTL_TX_ALGORITHM_WFQ 0x1 -+#define MTL_TX_ALGORITHM_DWRR 0x2 -+#define MTL_TX_ALGORITHM_SP 0x3 -+#define MTL_RX_ALGORITHM_SP 0x4 -+#define MTL_RX_ALGORITHM_WSP 0x5 -+ -+/* RX/TX Queue Mode */ -+#define MTL_QUEUE_AVB 0x0 -+#define MTL_QUEUE_DCB 0x1 -+ - /* The MDC clock could be set higher than the IEEE 802.3 - * specified frequency limit 0f 2.5 MHz, by programming a clock divider - * of value different than the above defined values. The resultant MDIO -@@ -109,6 +124,26 @@ struct stmmac_axi { - bool axi_rb; - }; - -+struct stmmac_rxq_cfg { -+ u8 mode_to_use; -+ u8 chan; -+ u8 pkt_route; -+ bool use_prio; -+ u32 prio; -+}; -+ -+struct stmmac_txq_cfg { -+ u8 weight; -+ u8 mode_to_use; -+ /* Credit Base Shaper parameters */ -+ u32 send_slope; -+ u32 idle_slope; -+ u32 high_credit; -+ u32 low_credit; -+ bool use_prio; -+ u32 prio; -+}; -+ - struct plat_stmmacenet_data { - int bus_id; - int phy_addr; -@@ -133,6 +168,12 @@ struct plat_stmmacenet_data { - int unicast_filter_entries; - int tx_fifo_size; - int rx_fifo_size; -+ u8 rx_queues_to_use; -+ u8 tx_queues_to_use; -+ u8 rx_sched_algorithm; -+ u8 tx_sched_algorithm; -+ struct stmmac_rxq_cfg rx_queues_cfg[MTL_MAX_RX_QUEUES]; -+ struct stmmac_txq_cfg tx_queues_cfg[MTL_MAX_TX_QUEUES]; - void (*fix_mac_speed)(void *priv, unsigned int speed); - int (*init)(struct platform_device *pdev, void *priv); - void (*exit)(struct platform_device *pdev, void *priv); diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch deleted file mode 100644 index 12b8ad04e18..00000000000 --- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch +++ /dev/null @@ -1,1923 +0,0 @@ ---- a/drivers/net/ethernet/stmicro/stmmac/Kconfig -+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig -@@ -145,6 +145,17 @@ config DWMAC_SUNXI - This selects Allwinner SoC glue layer support for the - stmmac device driver. This driver is used for A20/A31 - GMAC ethernet controller. -+ -+config DWMAC_SUN8I -+ tristate "Allwinner sun8i GMAC support" -+ default ARCH_SUNXI -+ depends on OF && (ARCH_SUNXI || COMPILE_TEST) -+ ---help--- -+ Support for Allwinner H3 A83T A64 EMAC ethernet controllers. -+ -+ This selects Allwinner SoC glue layer support for the -+ stmmac device driver. This driver is used for H3/A83T/A64 -+ EMAC ethernet controller. - endif - - config STMMAC_PCI ---- a/drivers/net/ethernet/stmicro/stmmac/Makefile -+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile -@@ -16,6 +16,7 @@ obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-alt - obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o - obj-$(CONFIG_DWMAC_STM32) += dwmac-stm32.o - obj-$(CONFIG_DWMAC_SUNXI) += dwmac-sunxi.o -+obj-$(CONFIG_DWMAC_SUN8I) += dwmac-sun8i.o - obj-$(CONFIG_DWMAC_DWC_QOS_ETH) += dwmac-dwc-qos-eth.o - obj-$(CONFIG_DWMAC_GENERIC) += dwmac-generic.o - stmmac-platform-objs:= stmmac_platform.o ---- a/drivers/net/ethernet/stmicro/stmmac/common.h -+++ b/drivers/net/ethernet/stmicro/stmmac/common.h -@@ -549,9 +549,11 @@ extern const struct stmmac_hwtimestamp s - extern const struct stmmac_mode_ops dwmac4_ring_mode_ops; - - struct mac_link { -- int port; -- int duplex; -- int speed; -+ u32 speed_mask; -+ u32 speed10; -+ u32 speed100; -+ u32 speed1000; -+ u32 duplex; - }; - - struct mii_regs { ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c -@@ -270,7 +270,10 @@ static int socfpga_dwmac_set_phy_mode(st - ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift); - ctrl |= val << reg_shift; - -- if (dwmac->f2h_ptp_ref_clk) { -+ if (dwmac->f2h_ptp_ref_clk || -+ phymode == PHY_INTERFACE_MODE_MII || -+ phymode == PHY_INTERFACE_MODE_GMII || -+ phymode == PHY_INTERFACE_MODE_SGMII) { - ctrl |= SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift / 2); - regmap_read(sys_mgr_base_addr, SYSMGR_FPGAGRP_MODULE_REG, - &module); ---- /dev/null -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c -@@ -0,0 +1,1007 @@ -+/* -+ * dwmac-sun8i.c - Allwinner sun8i DWMAC specific glue layer -+ * -+ * Copyright (C) 2017 Corentin Labbe -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include "stmmac.h" -+#include "stmmac_platform.h" -+ -+/* General notes on dwmac-sun8i: -+ * Locking: no locking is necessary in this file because all necessary locking -+ * is done in the "stmmac files" -+ */ -+ -+/* struct emac_variant - Descrive dwmac-sun8i hardware variant -+ * @default_syscon_value: The default value of the EMAC register in syscon -+ * This value is used for disabling properly EMAC -+ * and used as a good starting value in case of the -+ * boot process(uboot) leave some stuff. -+ * @internal_phy: Does the MAC embed an internal PHY -+ * @support_mii: Does the MAC handle MII -+ * @support_rmii: Does the MAC handle RMII -+ * @support_rgmii: Does the MAC handle RGMII -+ */ -+struct emac_variant { -+ u32 default_syscon_value; -+ int internal_phy; -+ bool support_mii; -+ bool support_rmii; -+ bool support_rgmii; -+}; -+ -+/* struct sunxi_priv_data - hold all sunxi private data -+ * @tx_clk: reference to MAC TX clock -+ * @ephy_clk: reference to the optional EPHY clock for the internal PHY -+ * @regulator: reference to the optional regulator -+ * @rst_ephy: reference to the optional EPHY reset for the internal PHY -+ * @variant: reference to the current board variant -+ * @regmap: regmap for using the syscon -+ * @use_internal_phy: Does the current PHY choice imply using the internal PHY -+ */ -+struct sunxi_priv_data { -+ struct clk *tx_clk; -+ struct clk *ephy_clk; -+ struct regulator *regulator; -+ struct reset_control *rst_ephy; -+ const struct emac_variant *variant; -+ struct regmap *regmap; -+ bool use_internal_phy; -+}; -+ -+static const struct emac_variant emac_variant_h3 = { -+ .default_syscon_value = 0x58000, -+ .internal_phy = PHY_INTERFACE_MODE_MII, -+ .support_mii = true, -+ .support_rmii = true, -+ .support_rgmii = true -+}; -+ -+static const struct emac_variant emac_variant_v3s = { -+ .default_syscon_value = 0x38000, -+ .internal_phy = PHY_INTERFACE_MODE_MII, -+ .support_mii = true -+}; -+ -+static const struct emac_variant emac_variant_a83t = { -+ .default_syscon_value = 0, -+ .internal_phy = 0, -+ .support_mii = true, -+ .support_rgmii = true -+}; -+ -+static const struct emac_variant emac_variant_a64 = { -+ .default_syscon_value = 0, -+ .internal_phy = 0, -+ .support_mii = true, -+ .support_rmii = true, -+ .support_rgmii = true -+}; -+ -+#define EMAC_BASIC_CTL0 0x00 -+#define EMAC_BASIC_CTL1 0x04 -+#define EMAC_INT_STA 0x08 -+#define EMAC_INT_EN 0x0C -+#define EMAC_TX_CTL0 0x10 -+#define EMAC_TX_CTL1 0x14 -+#define EMAC_TX_FLOW_CTL 0x1C -+#define EMAC_TX_DESC_LIST 0x20 -+#define EMAC_RX_CTL0 0x24 -+#define EMAC_RX_CTL1 0x28 -+#define EMAC_RX_DESC_LIST 0x34 -+#define EMAC_RX_FRM_FLT 0x38 -+#define EMAC_MDIO_CMD 0x48 -+#define EMAC_MDIO_DATA 0x4C -+#define EMAC_MACADDR_HI(reg) (0x50 + (reg) * 8) -+#define EMAC_MACADDR_LO(reg) (0x54 + (reg) * 8) -+#define EMAC_TX_DMA_STA 0xB0 -+#define EMAC_TX_CUR_DESC 0xB4 -+#define EMAC_TX_CUR_BUF 0xB8 -+#define EMAC_RX_DMA_STA 0xC0 -+#define EMAC_RX_CUR_DESC 0xC4 -+#define EMAC_RX_CUR_BUF 0xC8 -+ -+/* Use in EMAC_BASIC_CTL0 */ -+#define EMAC_DUPLEX_FULL BIT(0) -+#define EMAC_LOOPBACK BIT(1) -+#define EMAC_SPEED_1000 0 -+#define EMAC_SPEED_100 (0x03 << 2) -+#define EMAC_SPEED_10 (0x02 << 2) -+ -+/* Use in EMAC_BASIC_CTL1 */ -+#define EMAC_BURSTLEN_SHIFT 24 -+ -+/* Used in EMAC_RX_FRM_FLT */ -+#define EMAC_FRM_FLT_RXALL BIT(0) -+#define EMAC_FRM_FLT_CTL BIT(13) -+#define EMAC_FRM_FLT_MULTICAST BIT(16) -+ -+/* Used in RX_CTL1*/ -+#define EMAC_RX_MD BIT(1) -+#define EMAC_RX_TH_MASK GENMASK(4, 5) -+#define EMAC_RX_TH_32 0 -+#define EMAC_RX_TH_64 (0x1 << 4) -+#define EMAC_RX_TH_96 (0x2 << 4) -+#define EMAC_RX_TH_128 (0x3 << 4) -+#define EMAC_RX_DMA_EN BIT(30) -+#define EMAC_RX_DMA_START BIT(31) -+ -+/* Used in TX_CTL1*/ -+#define EMAC_TX_MD BIT(1) -+#define EMAC_TX_NEXT_FRM BIT(2) -+#define EMAC_TX_TH_MASK GENMASK(8, 10) -+#define EMAC_TX_TH_64 0 -+#define EMAC_TX_TH_128 (0x1 << 8) -+#define EMAC_TX_TH_192 (0x2 << 8) -+#define EMAC_TX_TH_256 (0x3 << 8) -+#define EMAC_TX_DMA_EN BIT(30) -+#define EMAC_TX_DMA_START BIT(31) -+ -+/* Used in RX_CTL0 */ -+#define EMAC_RX_RECEIVER_EN BIT(31) -+#define EMAC_RX_DO_CRC BIT(27) -+#define EMAC_RX_FLOW_CTL_EN BIT(16) -+ -+/* Used in TX_CTL0 */ -+#define EMAC_TX_TRANSMITTER_EN BIT(31) -+ -+/* Used in EMAC_TX_FLOW_CTL */ -+#define EMAC_TX_FLOW_CTL_EN BIT(0) -+ -+/* Used in EMAC_INT_STA */ -+#define EMAC_TX_INT BIT(0) -+#define EMAC_TX_DMA_STOP_INT BIT(1) -+#define EMAC_TX_BUF_UA_INT BIT(2) -+#define EMAC_TX_TIMEOUT_INT BIT(3) -+#define EMAC_TX_UNDERFLOW_INT BIT(4) -+#define EMAC_TX_EARLY_INT BIT(5) -+#define EMAC_RX_INT BIT(8) -+#define EMAC_RX_BUF_UA_INT BIT(9) -+#define EMAC_RX_DMA_STOP_INT BIT(10) -+#define EMAC_RX_TIMEOUT_INT BIT(11) -+#define EMAC_RX_OVERFLOW_INT BIT(12) -+#define EMAC_RX_EARLY_INT BIT(13) -+#define EMAC_RGMII_STA_INT BIT(16) -+ -+#define MAC_ADDR_TYPE_DST BIT(31) -+ -+/* H3 specific bits for EPHY */ -+#define H3_EPHY_ADDR_SHIFT 20 -+#define H3_EPHY_CLK_SEL BIT(18) /* 1: 24MHz, 0: 25MHz */ -+#define H3_EPHY_LED_POL BIT(17) /* 1: active low, 0: active high */ -+#define H3_EPHY_SHUTDOWN BIT(16) /* 1: shutdown, 0: power up */ -+#define H3_EPHY_SELECT BIT(15) /* 1: internal PHY, 0: external PHY */ -+ -+/* H3/A64 specific bits */ -+#define SYSCON_RMII_EN BIT(13) /* 1: enable RMII (overrides EPIT) */ -+ -+/* Generic system control EMAC_CLK bits */ -+#define SYSCON_ETXDC_MASK GENMASK(2, 0) -+#define SYSCON_ETXDC_SHIFT 10 -+#define SYSCON_ERXDC_MASK GENMASK(4, 0) -+#define SYSCON_ERXDC_SHIFT 5 -+/* EMAC PHY Interface Type */ -+#define SYSCON_EPIT BIT(2) /* 1: RGMII, 0: MII */ -+#define SYSCON_ETCS_MASK GENMASK(1, 0) -+#define SYSCON_ETCS_MII 0x0 -+#define SYSCON_ETCS_EXT_GMII 0x1 -+#define SYSCON_ETCS_INT_GMII 0x2 -+#define SYSCON_EMAC_REG 0x30 -+ -+/* sun8i_dwmac_dma_reset() - reset the EMAC -+ * Called from stmmac via stmmac_dma_ops->reset -+ */ -+static int sun8i_dwmac_dma_reset(void __iomem *ioaddr) -+{ -+ writel(0, ioaddr + EMAC_RX_CTL1); -+ writel(0, ioaddr + EMAC_TX_CTL1); -+ writel(0, ioaddr + EMAC_RX_FRM_FLT); -+ writel(0, ioaddr + EMAC_RX_DESC_LIST); -+ writel(0, ioaddr + EMAC_TX_DESC_LIST); -+ writel(0, ioaddr + EMAC_INT_EN); -+ writel(0x1FFFFFF, ioaddr + EMAC_INT_STA); -+ return 0; -+} -+ -+/* sun8i_dwmac_dma_init() - initialize the EMAC -+ * Called from stmmac via stmmac_dma_ops->init -+ */ -+static void sun8i_dwmac_dma_init(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx, u32 dma_rx, int atds) -+{ -+ /* Write TX and RX descriptors address */ -+ writel(dma_rx, ioaddr + EMAC_RX_DESC_LIST); -+ writel(dma_tx, ioaddr + EMAC_TX_DESC_LIST); -+ -+ writel(EMAC_RX_INT | EMAC_TX_INT, ioaddr + EMAC_INT_EN); -+ writel(0x1FFFFFF, ioaddr + EMAC_INT_STA); -+} -+ -+/* sun8i_dwmac_dump_regs() - Dump EMAC address space -+ * Called from stmmac_dma_ops->dump_regs -+ * Used for ethtool -+ */ -+static void sun8i_dwmac_dump_regs(void __iomem *ioaddr, u32 *reg_space) -+{ -+ int i; -+ -+ for (i = 0; i < 0xC8; i += 4) { -+ if (i == 0x32 || i == 0x3C) -+ continue; -+ reg_space[i / 4] = readl(ioaddr + i); -+ } -+} -+ -+/* sun8i_dwmac_dump_mac_regs() - Dump EMAC address space -+ * Called from stmmac_ops->dump_regs -+ * Used for ethtool -+ */ -+static void sun8i_dwmac_dump_mac_regs(struct mac_device_info *hw, -+ u32 *reg_space) -+{ -+ int i; -+ void __iomem *ioaddr = hw->pcsr; -+ -+ for (i = 0; i < 0xC8; i += 4) { -+ if (i == 0x32 || i == 0x3C) -+ continue; -+ reg_space[i / 4] = readl(ioaddr + i); -+ } -+} -+ -+static void sun8i_dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan) -+{ -+ writel(EMAC_RX_INT | EMAC_TX_INT, ioaddr + EMAC_INT_EN); -+} -+ -+static void sun8i_dwmac_disable_dma_irq(void __iomem *ioaddr, u32 chan) -+{ -+ writel(0, ioaddr + EMAC_INT_EN); -+} -+ -+static void sun8i_dwmac_dma_start_tx(void __iomem *ioaddr, u32 chan) -+{ -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_TX_CTL1); -+ v |= EMAC_TX_DMA_START; -+ v |= EMAC_TX_DMA_EN; -+ writel(v, ioaddr + EMAC_TX_CTL1); -+} -+ -+static void sun8i_dwmac_enable_dma_transmission(void __iomem *ioaddr) -+{ -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_TX_CTL1); -+ v |= EMAC_TX_DMA_START; -+ v |= EMAC_TX_DMA_EN; -+ writel(v, ioaddr + EMAC_TX_CTL1); -+} -+ -+static void sun8i_dwmac_dma_stop_tx(void __iomem *ioaddr, u32 chan) -+{ -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_TX_CTL1); -+ v &= ~EMAC_TX_DMA_EN; -+ writel(v, ioaddr + EMAC_TX_CTL1); -+} -+ -+static void sun8i_dwmac_dma_start_rx(void __iomem *ioaddr, u32 chan) -+{ -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_RX_CTL1); -+ v |= EMAC_RX_DMA_START; -+ v |= EMAC_RX_DMA_EN; -+ writel(v, ioaddr + EMAC_RX_CTL1); -+} -+ -+static void sun8i_dwmac_dma_stop_rx(void __iomem *ioaddr, u32 chan) -+{ -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_RX_CTL1); -+ v &= ~EMAC_RX_DMA_EN; -+ writel(v, ioaddr + EMAC_RX_CTL1); -+} -+ -+static int sun8i_dwmac_dma_interrupt(void __iomem *ioaddr, -+ struct stmmac_extra_stats *x, u32 chan) -+{ -+ u32 v; -+ int ret = 0; -+ -+ v = readl(ioaddr + EMAC_INT_STA); -+ -+ if (v & EMAC_TX_INT) { -+ ret |= handle_tx; -+ x->tx_normal_irq_n++; -+ } -+ -+ if (v & EMAC_TX_DMA_STOP_INT) -+ x->tx_process_stopped_irq++; -+ -+ if (v & EMAC_TX_BUF_UA_INT) -+ x->tx_process_stopped_irq++; -+ -+ if (v & EMAC_TX_TIMEOUT_INT) -+ ret |= tx_hard_error; -+ -+ if (v & EMAC_TX_UNDERFLOW_INT) { -+ ret |= tx_hard_error; -+ x->tx_undeflow_irq++; -+ } -+ -+ if (v & EMAC_TX_EARLY_INT) -+ x->tx_early_irq++; -+ -+ if (v & EMAC_RX_INT) { -+ ret |= handle_rx; -+ x->rx_normal_irq_n++; -+ } -+ -+ if (v & EMAC_RX_BUF_UA_INT) -+ x->rx_buf_unav_irq++; -+ -+ if (v & EMAC_RX_DMA_STOP_INT) -+ x->rx_process_stopped_irq++; -+ -+ if (v & EMAC_RX_TIMEOUT_INT) -+ ret |= tx_hard_error; -+ -+ if (v & EMAC_RX_OVERFLOW_INT) { -+ ret |= tx_hard_error; -+ x->rx_overflow_irq++; -+ } -+ -+ if (v & EMAC_RX_EARLY_INT) -+ x->rx_early_irq++; -+ -+ if (v & EMAC_RGMII_STA_INT) -+ x->irq_rgmii_n++; -+ -+ writel(v, ioaddr + EMAC_INT_STA); -+ -+ return ret; -+} -+ -+static void sun8i_dwmac_dma_operation_mode(void __iomem *ioaddr, int txmode, -+ int rxmode, int rxfifosz) -+{ -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_TX_CTL1); -+ if (txmode == SF_DMA_MODE) { -+ v |= EMAC_TX_MD; -+ /* Undocumented bit (called TX_NEXT_FRM in BSP), the original -+ * comment is -+ * "Operating on second frame increase the performance -+ * especially when transmit store-and-forward is used." -+ */ -+ v |= EMAC_TX_NEXT_FRM; -+ } else { -+ v &= ~EMAC_TX_MD; -+ v &= ~EMAC_TX_TH_MASK; -+ if (txmode < 64) -+ v |= EMAC_TX_TH_64; -+ else if (txmode < 128) -+ v |= EMAC_TX_TH_128; -+ else if (txmode < 192) -+ v |= EMAC_TX_TH_192; -+ else if (txmode < 256) -+ v |= EMAC_TX_TH_256; -+ } -+ writel(v, ioaddr + EMAC_TX_CTL1); -+ -+ v = readl(ioaddr + EMAC_RX_CTL1); -+ if (rxmode == SF_DMA_MODE) { -+ v |= EMAC_RX_MD; -+ } else { -+ v &= ~EMAC_RX_MD; -+ v &= ~EMAC_RX_TH_MASK; -+ if (rxmode < 32) -+ v |= EMAC_RX_TH_32; -+ else if (rxmode < 64) -+ v |= EMAC_RX_TH_64; -+ else if (rxmode < 96) -+ v |= EMAC_RX_TH_96; -+ else if (rxmode < 128) -+ v |= EMAC_RX_TH_128; -+ } -+ writel(v, ioaddr + EMAC_RX_CTL1); -+} -+ -+static const struct stmmac_dma_ops sun8i_dwmac_dma_ops = { -+ .reset = sun8i_dwmac_dma_reset, -+ .init = sun8i_dwmac_dma_init, -+ .dump_regs = sun8i_dwmac_dump_regs, -+ .dma_mode = sun8i_dwmac_dma_operation_mode, -+ .enable_dma_transmission = sun8i_dwmac_enable_dma_transmission, -+ .enable_dma_irq = sun8i_dwmac_enable_dma_irq, -+ .disable_dma_irq = sun8i_dwmac_disable_dma_irq, -+ .start_tx = sun8i_dwmac_dma_start_tx, -+ .stop_tx = sun8i_dwmac_dma_stop_tx, -+ .start_rx = sun8i_dwmac_dma_start_rx, -+ .stop_rx = sun8i_dwmac_dma_stop_rx, -+ .dma_interrupt = sun8i_dwmac_dma_interrupt, -+}; -+ -+static int sun8i_dwmac_init(struct platform_device *pdev, void *priv) -+{ -+ struct sunxi_priv_data *gmac = priv; -+ int ret; -+ -+ if (gmac->regulator) { -+ ret = regulator_enable(gmac->regulator); -+ if (ret) { -+ dev_err(&pdev->dev, "Fail to enable regulator\n"); -+ return ret; -+ } -+ } -+ -+ ret = clk_prepare_enable(gmac->tx_clk); -+ if (ret) { -+ if (gmac->regulator) -+ regulator_disable(gmac->regulator); -+ dev_err(&pdev->dev, "Could not enable AHB clock\n"); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static void sun8i_dwmac_core_init(struct mac_device_info *hw, int mtu) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 v; -+ -+ v = (8 << EMAC_BURSTLEN_SHIFT); /* burst len */ -+ writel(v, ioaddr + EMAC_BASIC_CTL1); -+} -+ -+static void sun8i_dwmac_set_mac(void __iomem *ioaddr, bool enable) -+{ -+ u32 t, r; -+ -+ t = readl(ioaddr + EMAC_TX_CTL0); -+ r = readl(ioaddr + EMAC_RX_CTL0); -+ if (enable) { -+ t |= EMAC_TX_TRANSMITTER_EN; -+ r |= EMAC_RX_RECEIVER_EN; -+ } else { -+ t &= ~EMAC_TX_TRANSMITTER_EN; -+ r &= ~EMAC_RX_RECEIVER_EN; -+ } -+ writel(t, ioaddr + EMAC_TX_CTL0); -+ writel(r, ioaddr + EMAC_RX_CTL0); -+} -+ -+/* Set MAC address at slot reg_n -+ * All slot > 0 need to be enabled with MAC_ADDR_TYPE_DST -+ * If addr is NULL, clear the slot -+ */ -+static void sun8i_dwmac_set_umac_addr(struct mac_device_info *hw, -+ unsigned char *addr, -+ unsigned int reg_n) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 v; -+ -+ if (!addr) { -+ writel(0, ioaddr + EMAC_MACADDR_HI(reg_n)); -+ return; -+ } -+ -+ stmmac_set_mac_addr(ioaddr, addr, EMAC_MACADDR_HI(reg_n), -+ EMAC_MACADDR_LO(reg_n)); -+ if (reg_n > 0) { -+ v = readl(ioaddr + EMAC_MACADDR_HI(reg_n)); -+ v |= MAC_ADDR_TYPE_DST; -+ writel(v, ioaddr + EMAC_MACADDR_HI(reg_n)); -+ } -+} -+ -+static void sun8i_dwmac_get_umac_addr(struct mac_device_info *hw, -+ unsigned char *addr, -+ unsigned int reg_n) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ -+ stmmac_get_mac_addr(ioaddr, addr, EMAC_MACADDR_HI(reg_n), -+ EMAC_MACADDR_LO(reg_n)); -+} -+ -+/* caution this function must return non 0 to work */ -+static int sun8i_dwmac_rx_ipc_enable(struct mac_device_info *hw) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_RX_CTL0); -+ v |= EMAC_RX_DO_CRC; -+ writel(v, ioaddr + EMAC_RX_CTL0); -+ -+ return 1; -+} -+ -+static void sun8i_dwmac_set_filter(struct mac_device_info *hw, -+ struct net_device *dev) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 v; -+ int i = 1; -+ struct netdev_hw_addr *ha; -+ int macaddrs = netdev_uc_count(dev) + netdev_mc_count(dev) + 1; -+ -+ v = EMAC_FRM_FLT_CTL; -+ -+ if (dev->flags & IFF_PROMISC) { -+ v = EMAC_FRM_FLT_RXALL; -+ } else if (dev->flags & IFF_ALLMULTI) { -+ v |= EMAC_FRM_FLT_MULTICAST; -+ } else if (macaddrs <= hw->unicast_filter_entries) { -+ if (!netdev_mc_empty(dev)) { -+ netdev_for_each_mc_addr(ha, dev) { -+ sun8i_dwmac_set_umac_addr(hw, ha->addr, i); -+ i++; -+ } -+ } -+ if (!netdev_uc_empty(dev)) { -+ netdev_for_each_uc_addr(ha, dev) { -+ sun8i_dwmac_set_umac_addr(hw, ha->addr, i); -+ i++; -+ } -+ } -+ } else { -+ netdev_info(dev, "Too many address, switching to promiscuous\n"); -+ v = EMAC_FRM_FLT_RXALL; -+ } -+ -+ /* Disable unused address filter slots */ -+ while (i < hw->unicast_filter_entries) -+ sun8i_dwmac_set_umac_addr(hw, NULL, i++); -+ -+ writel(v, ioaddr + EMAC_RX_FRM_FLT); -+} -+ -+static void sun8i_dwmac_flow_ctrl(struct mac_device_info *hw, -+ unsigned int duplex, unsigned int fc, -+ unsigned int pause_time, u32 tx_cnt) -+{ -+ void __iomem *ioaddr = hw->pcsr; -+ u32 v; -+ -+ v = readl(ioaddr + EMAC_RX_CTL0); -+ if (fc == FLOW_AUTO) -+ v |= EMAC_RX_FLOW_CTL_EN; -+ else -+ v &= ~EMAC_RX_FLOW_CTL_EN; -+ writel(v, ioaddr + EMAC_RX_CTL0); -+ -+ v = readl(ioaddr + EMAC_TX_FLOW_CTL); -+ if (fc == FLOW_AUTO) -+ v |= EMAC_TX_FLOW_CTL_EN; -+ else -+ v &= ~EMAC_TX_FLOW_CTL_EN; -+ writel(v, ioaddr + EMAC_TX_FLOW_CTL); -+} -+ -+static int sun8i_dwmac_reset(struct stmmac_priv *priv) -+{ -+ u32 v; -+ int err; -+ -+ v = readl(priv->ioaddr + EMAC_BASIC_CTL1); -+ writel(v | 0x01, priv->ioaddr + EMAC_BASIC_CTL1); -+ -+ /* The timeout was previoulsy set to 10ms, but some board (OrangePI0) -+ * need more if no cable plugged. 100ms seems OK -+ */ -+ err = readl_poll_timeout(priv->ioaddr + EMAC_BASIC_CTL1, v, -+ !(v & 0x01), 100, 100000); -+ -+ if (err) { -+ dev_err(priv->device, "EMAC reset timeout\n"); -+ return -EFAULT; -+ } -+ return 0; -+} -+ -+static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv) -+{ -+ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; -+ struct device_node *node = priv->device->of_node; -+ int ret; -+ u32 reg, val; -+ -+ regmap_read(gmac->regmap, SYSCON_EMAC_REG, &val); -+ reg = gmac->variant->default_syscon_value; -+ if (reg != val) -+ dev_warn(priv->device, -+ "Current syscon value is not the default %x (expect %x)\n", -+ val, reg); -+ -+ if (gmac->variant->internal_phy) { -+ if (!gmac->use_internal_phy) { -+ /* switch to external PHY interface */ -+ reg &= ~H3_EPHY_SELECT; -+ } else { -+ reg |= H3_EPHY_SELECT; -+ reg &= ~H3_EPHY_SHUTDOWN; -+ dev_dbg(priv->device, "Select internal_phy %x\n", reg); -+ -+ if (of_property_read_bool(priv->plat->phy_node, -+ "allwinner,leds-active-low")) -+ reg |= H3_EPHY_LED_POL; -+ else -+ reg &= ~H3_EPHY_LED_POL; -+ -+ /* Force EPHY xtal frequency to 24MHz. */ -+ reg |= H3_EPHY_CLK_SEL; -+ -+ ret = of_mdio_parse_addr(priv->device, -+ priv->plat->phy_node); -+ if (ret < 0) { -+ dev_err(priv->device, "Could not parse MDIO addr\n"); -+ return ret; -+ } -+ /* of_mdio_parse_addr returns a valid (0 ~ 31) PHY -+ * address. No need to mask it again. -+ */ -+ reg |= ret << H3_EPHY_ADDR_SHIFT; -+ } -+ } -+ -+ if (!of_property_read_u32(node, "allwinner,tx-delay-ps", &val)) { -+ if (val % 100) { -+ dev_err(priv->device, "tx-delay must be a multiple of 100\n"); -+ return -EINVAL; -+ } -+ val /= 100; -+ dev_dbg(priv->device, "set tx-delay to %x\n", val); -+ if (val <= SYSCON_ETXDC_MASK) { -+ reg &= ~(SYSCON_ETXDC_MASK << SYSCON_ETXDC_SHIFT); -+ reg |= (val << SYSCON_ETXDC_SHIFT); -+ } else { -+ dev_err(priv->device, "Invalid TX clock delay: %d\n", -+ val); -+ return -EINVAL; -+ } -+ } -+ -+ if (!of_property_read_u32(node, "allwinner,rx-delay-ps", &val)) { -+ if (val % 100) { -+ dev_err(priv->device, "rx-delay must be a multiple of 100\n"); -+ return -EINVAL; -+ } -+ val /= 100; -+ dev_dbg(priv->device, "set rx-delay to %x\n", val); -+ if (val <= SYSCON_ERXDC_MASK) { -+ reg &= ~(SYSCON_ERXDC_MASK << SYSCON_ERXDC_SHIFT); -+ reg |= (val << SYSCON_ERXDC_SHIFT); -+ } else { -+ dev_err(priv->device, "Invalid RX clock delay: %d\n", -+ val); -+ return -EINVAL; -+ } -+ } -+ -+ /* Clear interface mode bits */ -+ reg &= ~(SYSCON_ETCS_MASK | SYSCON_EPIT); -+ if (gmac->variant->support_rmii) -+ reg &= ~SYSCON_RMII_EN; -+ -+ switch (priv->plat->interface) { -+ case PHY_INTERFACE_MODE_MII: -+ /* default */ -+ break; -+ case PHY_INTERFACE_MODE_RGMII: -+ reg |= SYSCON_EPIT | SYSCON_ETCS_INT_GMII; -+ break; -+ case PHY_INTERFACE_MODE_RMII: -+ reg |= SYSCON_RMII_EN | SYSCON_ETCS_EXT_GMII; -+ break; -+ default: -+ dev_err(priv->device, "Unsupported interface mode: %s", -+ phy_modes(priv->plat->interface)); -+ return -EINVAL; -+ } -+ -+ regmap_write(gmac->regmap, SYSCON_EMAC_REG, reg); -+ -+ return 0; -+} -+ -+static void sun8i_dwmac_unset_syscon(struct sunxi_priv_data *gmac) -+{ -+ u32 reg = gmac->variant->default_syscon_value; -+ -+ regmap_write(gmac->regmap, SYSCON_EMAC_REG, reg); -+} -+ -+static int sun8i_dwmac_power_internal_phy(struct stmmac_priv *priv) -+{ -+ struct sunxi_priv_data *gmac = priv->plat->bsp_priv; -+ int ret; -+ -+ if (!gmac->use_internal_phy) -+ return 0; -+ -+ ret = clk_prepare_enable(gmac->ephy_clk); -+ if (ret) { -+ dev_err(priv->device, "Cannot enable ephy\n"); -+ return ret; -+ } -+ -+ /* Make sure the EPHY is properly reseted, as U-Boot may leave -+ * it at deasserted state, and thus it may fail to reset EMAC. -+ */ -+ reset_control_assert(gmac->rst_ephy); -+ -+ ret = reset_control_deassert(gmac->rst_ephy); -+ if (ret) { -+ dev_err(priv->device, "Cannot deassert ephy\n"); -+ clk_disable_unprepare(gmac->ephy_clk); -+ return ret; -+ } -+ -+ return 0; -+} -+ -+static int sun8i_dwmac_unpower_internal_phy(struct sunxi_priv_data *gmac) -+{ -+ if (!gmac->use_internal_phy) -+ return 0; -+ -+ clk_disable_unprepare(gmac->ephy_clk); -+ reset_control_assert(gmac->rst_ephy); -+ return 0; -+} -+ -+/* sun8i_power_phy() - Activate the PHY: -+ * In case of error, no need to call sun8i_unpower_phy(), -+ * it will be called anyway by sun8i_dwmac_exit() -+ */ -+static int sun8i_power_phy(struct stmmac_priv *priv) -+{ -+ int ret; -+ -+ ret = sun8i_dwmac_power_internal_phy(priv); -+ if (ret) -+ return ret; -+ -+ ret = sun8i_dwmac_set_syscon(priv); -+ if (ret) -+ return ret; -+ -+ /* After changing syscon value, the MAC need reset or it will use -+ * the last value (and so the last PHY set. -+ */ -+ ret = sun8i_dwmac_reset(priv); -+ if (ret) -+ return ret; -+ return 0; -+} -+ -+static void sun8i_unpower_phy(struct sunxi_priv_data *gmac) -+{ -+ sun8i_dwmac_unset_syscon(gmac); -+ sun8i_dwmac_unpower_internal_phy(gmac); -+} -+ -+static void sun8i_dwmac_exit(struct platform_device *pdev, void *priv) -+{ -+ struct sunxi_priv_data *gmac = priv; -+ -+ sun8i_unpower_phy(gmac); -+ -+ clk_disable_unprepare(gmac->tx_clk); -+ -+ if (gmac->regulator) -+ regulator_disable(gmac->regulator); -+} -+ -+static const struct stmmac_ops sun8i_dwmac_ops = { -+ .core_init = sun8i_dwmac_core_init, -+ .set_mac = sun8i_dwmac_set_mac, -+ .dump_regs = sun8i_dwmac_dump_mac_regs, -+ .rx_ipc = sun8i_dwmac_rx_ipc_enable, -+ .set_filter = sun8i_dwmac_set_filter, -+ .flow_ctrl = sun8i_dwmac_flow_ctrl, -+ .set_umac_addr = sun8i_dwmac_set_umac_addr, -+ .get_umac_addr = sun8i_dwmac_get_umac_addr, -+}; -+ -+static struct mac_device_info *sun8i_dwmac_setup(void *ppriv) -+{ -+ struct mac_device_info *mac; -+ struct stmmac_priv *priv = ppriv; -+ int ret; -+ -+ mac = devm_kzalloc(priv->device, sizeof(*mac), GFP_KERNEL); -+ if (!mac) -+ return NULL; -+ -+ ret = sun8i_power_phy(priv); -+ if (ret) -+ return NULL; -+ -+ mac->pcsr = priv->ioaddr; -+ mac->mac = &sun8i_dwmac_ops; -+ mac->dma = &sun8i_dwmac_dma_ops; -+ -+ /* The loopback bit seems to be re-set when link change -+ * Simply mask it each time -+ * Speed 10/100/1000 are set in BIT(2)/BIT(3) -+ */ -+ mac->link.speed_mask = GENMASK(3, 2) | EMAC_LOOPBACK; -+ mac->link.speed10 = EMAC_SPEED_10; -+ mac->link.speed100 = EMAC_SPEED_100; -+ mac->link.speed1000 = EMAC_SPEED_1000; -+ mac->link.duplex = EMAC_DUPLEX_FULL; -+ mac->mii.addr = EMAC_MDIO_CMD; -+ mac->mii.data = EMAC_MDIO_DATA; -+ mac->mii.reg_shift = 4; -+ mac->mii.reg_mask = GENMASK(8, 4); -+ mac->mii.addr_shift = 12; -+ mac->mii.addr_mask = GENMASK(16, 12); -+ mac->mii.clk_csr_shift = 20; -+ mac->mii.clk_csr_mask = GENMASK(22, 20); -+ mac->unicast_filter_entries = 8; -+ -+ /* Synopsys Id is not available */ -+ priv->synopsys_id = 0; -+ -+ return mac; -+} -+ -+static int sun8i_dwmac_probe(struct platform_device *pdev) -+{ -+ struct plat_stmmacenet_data *plat_dat; -+ struct stmmac_resources stmmac_res; -+ struct sunxi_priv_data *gmac; -+ struct device *dev = &pdev->dev; -+ int ret; -+ -+ ret = stmmac_get_platform_resources(pdev, &stmmac_res); -+ if (ret) -+ return ret; -+ -+ plat_dat = stmmac_probe_config_dt(pdev, &stmmac_res.mac); -+ if (IS_ERR(plat_dat)) -+ return PTR_ERR(plat_dat); -+ -+ gmac = devm_kzalloc(dev, sizeof(*gmac), GFP_KERNEL); -+ if (!gmac) -+ return -ENOMEM; -+ -+ gmac->variant = of_device_get_match_data(&pdev->dev); -+ if (!gmac->variant) { -+ dev_err(&pdev->dev, "Missing dwmac-sun8i variant\n"); -+ return -EINVAL; -+ } -+ -+ gmac->tx_clk = devm_clk_get(dev, "stmmaceth"); -+ if (IS_ERR(gmac->tx_clk)) { -+ dev_err(dev, "Could not get TX clock\n"); -+ return PTR_ERR(gmac->tx_clk); -+ } -+ -+ /* Optional regulator for PHY */ -+ gmac->regulator = devm_regulator_get_optional(dev, "phy"); -+ if (IS_ERR(gmac->regulator)) { -+ if (PTR_ERR(gmac->regulator) == -EPROBE_DEFER) -+ return -EPROBE_DEFER; -+ dev_info(dev, "No regulator found\n"); -+ gmac->regulator = NULL; -+ } -+ -+ gmac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, -+ "syscon"); -+ if (IS_ERR(gmac->regmap)) { -+ ret = PTR_ERR(gmac->regmap); -+ dev_err(&pdev->dev, "Unable to map syscon: %d\n", ret); -+ return ret; -+ } -+ -+ plat_dat->interface = of_get_phy_mode(dev->of_node); -+ if (plat_dat->interface == gmac->variant->internal_phy) { -+ dev_info(&pdev->dev, "Will use internal PHY\n"); -+ gmac->use_internal_phy = true; -+ gmac->ephy_clk = of_clk_get(plat_dat->phy_node, 0); -+ if (IS_ERR(gmac->ephy_clk)) { -+ ret = PTR_ERR(gmac->ephy_clk); -+ dev_err(&pdev->dev, "Cannot get EPHY clock: %d\n", ret); -+ return -EINVAL; -+ } -+ -+ gmac->rst_ephy = of_reset_control_get(plat_dat->phy_node, NULL); -+ if (IS_ERR(gmac->rst_ephy)) { -+ ret = PTR_ERR(gmac->rst_ephy); -+ if (ret == -EPROBE_DEFER) -+ return ret; -+ dev_err(&pdev->dev, "No EPHY reset control found %d\n", -+ ret); -+ return -EINVAL; -+ } -+ } else { -+ dev_info(&pdev->dev, "Will use external PHY\n"); -+ gmac->use_internal_phy = false; -+ } -+ -+ /* platform data specifying hardware features and callbacks. -+ * hardware features were copied from Allwinner drivers. -+ */ -+ plat_dat->rx_coe = STMMAC_RX_COE_TYPE2; -+ plat_dat->tx_coe = 1; -+ plat_dat->has_sun8i = true; -+ plat_dat->bsp_priv = gmac; -+ plat_dat->init = sun8i_dwmac_init; -+ plat_dat->exit = sun8i_dwmac_exit; -+ plat_dat->setup = sun8i_dwmac_setup; -+ -+ ret = sun8i_dwmac_init(pdev, plat_dat->bsp_priv); -+ if (ret) -+ return ret; -+ -+ ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); -+ if (ret) -+ sun8i_dwmac_exit(pdev, plat_dat->bsp_priv); -+ -+ return ret; -+} -+ -+static const struct of_device_id sun8i_dwmac_match[] = { -+ { .compatible = "allwinner,sun8i-h3-emac", -+ .data = &emac_variant_h3 }, -+ { .compatible = "allwinner,sun8i-v3s-emac", -+ .data = &emac_variant_v3s }, -+ { .compatible = "allwinner,sun8i-a83t-emac", -+ .data = &emac_variant_a83t }, -+ { .compatible = "allwinner,sun50i-a64-emac", -+ .data = &emac_variant_a64 }, -+ { } -+}; -+MODULE_DEVICE_TABLE(of, sun8i_dwmac_match); -+ -+static struct platform_driver sun8i_dwmac_driver = { -+ .probe = sun8i_dwmac_probe, -+ .remove = stmmac_pltfr_remove, -+ .driver = { -+ .name = "dwmac-sun8i", -+ .pm = &stmmac_pltfr_pm_ops, -+ .of_match_table = sun8i_dwmac_match, -+ }, -+}; -+module_platform_driver(sun8i_dwmac_driver); -+ -+MODULE_AUTHOR("Corentin Labbe "); -+MODULE_DESCRIPTION("Allwinner sun8i DWMAC specific glue layer"); -+MODULE_LICENSE("GPL"); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c -@@ -45,15 +45,17 @@ static void dwmac1000_core_init(struct m - if (hw->ps) { - value |= GMAC_CONTROL_TE; - -- if (hw->ps == SPEED_1000) { -- value &= ~GMAC_CONTROL_PS; -- } else { -- value |= GMAC_CONTROL_PS; -- -- if (hw->ps == SPEED_10) -- value &= ~GMAC_CONTROL_FES; -- else -- value |= GMAC_CONTROL_FES; -+ value &= ~hw->link.speed_mask; -+ switch (hw->ps) { -+ case SPEED_1000: -+ value |= hw->link.speed1000; -+ break; -+ case SPEED_100: -+ value |= hw->link.speed100; -+ break; -+ case SPEED_10: -+ value |= hw->link.speed10; -+ break; - } - } - -@@ -531,9 +533,11 @@ struct mac_device_info *dwmac1000_setup( - mac->mac = &dwmac1000_ops; - mac->dma = &dwmac1000_dma_ops; - -- mac->link.port = GMAC_CONTROL_PS; - mac->link.duplex = GMAC_CONTROL_DM; -- mac->link.speed = GMAC_CONTROL_FES; -+ mac->link.speed10 = GMAC_CONTROL_PS; -+ mac->link.speed100 = GMAC_CONTROL_PS | GMAC_CONTROL_FES; -+ mac->link.speed1000 = 0; -+ mac->link.speed_mask = GMAC_CONTROL_PS | GMAC_CONTROL_FES; - mac->mii.addr = GMAC_MII_ADDR; - mac->mii.data = GMAC_MII_DATA; - mac->mii.addr_shift = 11; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c -@@ -205,8 +205,8 @@ static void dwmac1000_dump_dma_regs(void - { - int i; - -- for (i = 0; i < 22; i++) -- if ((i < 9) || (i > 17)) -+ for (i = 0; i < NUM_DWMAC1000_DMA_REGS; i++) -+ if ((i < 12) || (i > 17)) - reg_space[DMA_BUS_MODE / 4 + i] = - readl(ioaddr + DMA_BUS_MODE + i * 4); - } ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c -@@ -175,9 +175,11 @@ struct mac_device_info *dwmac100_setup(v - mac->mac = &dwmac100_ops; - mac->dma = &dwmac100_dma_ops; - -- mac->link.port = MAC_CONTROL_PS; - mac->link.duplex = MAC_CONTROL_F; -- mac->link.speed = 0; -+ mac->link.speed10 = 0; -+ mac->link.speed100 = 0; -+ mac->link.speed1000 = 0; -+ mac->link.speed_mask = MAC_CONTROL_PS; - mac->mii.addr = MAC_MII_ADDR; - mac->mii.data = MAC_MII_DATA; - mac->mii.addr_shift = 11; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c -@@ -70,7 +70,7 @@ static void dwmac100_dump_dma_regs(void - { - int i; - -- for (i = 0; i < 9; i++) -+ for (i = 0; i < NUM_DWMAC100_DMA_REGS; i++) - reg_space[DMA_BUS_MODE / 4 + i] = - readl(ioaddr + DMA_BUS_MODE + i * 4); - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c -@@ -35,15 +35,17 @@ static void dwmac4_core_init(struct mac_ - if (hw->ps) { - value |= GMAC_CONFIG_TE; - -- if (hw->ps == SPEED_1000) { -- value &= ~GMAC_CONFIG_PS; -- } else { -- value |= GMAC_CONFIG_PS; -- -- if (hw->ps == SPEED_10) -- value &= ~GMAC_CONFIG_FES; -- else -- value |= GMAC_CONFIG_FES; -+ value &= hw->link.speed_mask; -+ switch (hw->ps) { -+ case SPEED_1000: -+ value |= hw->link.speed1000; -+ break; -+ case SPEED_100: -+ value |= hw->link.speed100; -+ break; -+ case SPEED_10: -+ value |= hw->link.speed10; -+ break; - } - } - -@@ -115,7 +117,7 @@ static void dwmac4_tx_queue_routing(stru - void __iomem *ioaddr = hw->pcsr; - u32 value; - -- const struct stmmac_rx_routing route_possibilities[] = { -+ static const struct stmmac_rx_routing route_possibilities[] = { - { GMAC_RXQCTRL_AVCPQ_MASK, GMAC_RXQCTRL_AVCPQ_SHIFT }, - { GMAC_RXQCTRL_PTPQ_MASK, GMAC_RXQCTRL_PTPQ_SHIFT }, - { GMAC_RXQCTRL_DCBCPQ_MASK, GMAC_RXQCTRL_DCBCPQ_SHIFT }, -@@ -747,9 +749,11 @@ struct mac_device_info *dwmac4_setup(voi - if (mac->multicast_filter_bins) - mac->mcast_bits_log2 = ilog2(mac->multicast_filter_bins); - -- mac->link.port = GMAC_CONFIG_PS; - mac->link.duplex = GMAC_CONFIG_DM; -- mac->link.speed = GMAC_CONFIG_FES; -+ mac->link.speed10 = GMAC_CONFIG_PS; -+ mac->link.speed100 = GMAC_CONFIG_FES | GMAC_CONFIG_PS; -+ mac->link.speed1000 = 0; -+ mac->link.speed_mask = GMAC_CONFIG_FES | GMAC_CONFIG_PS; - mac->mii.addr = GMAC_MDIO_ADDR; - mac->mii.data = GMAC_MDIO_DATA; - mac->mii.addr_shift = 21; ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c -@@ -71,9 +71,9 @@ static void dwmac4_dma_axi(void __iomem - writel(value, ioaddr + DMA_SYS_BUS_MODE); - } - --void dwmac4_dma_init_rx_chan(void __iomem *ioaddr, -- struct stmmac_dma_cfg *dma_cfg, -- u32 dma_rx_phy, u32 chan) -+static void dwmac4_dma_init_rx_chan(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_rx_phy, u32 chan) - { - u32 value; - u32 rxpbl = dma_cfg->rxpbl ?: dma_cfg->pbl; -@@ -85,9 +85,9 @@ void dwmac4_dma_init_rx_chan(void __iome - writel(dma_rx_phy, ioaddr + DMA_CHAN_RX_BASE_ADDR(chan)); - } - --void dwmac4_dma_init_tx_chan(void __iomem *ioaddr, -- struct stmmac_dma_cfg *dma_cfg, -- u32 dma_tx_phy, u32 chan) -+static void dwmac4_dma_init_tx_chan(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, -+ u32 dma_tx_phy, u32 chan) - { - u32 value; - u32 txpbl = dma_cfg->txpbl ?: dma_cfg->pbl; -@@ -99,8 +99,8 @@ void dwmac4_dma_init_tx_chan(void __iome - writel(dma_tx_phy, ioaddr + DMA_CHAN_TX_BASE_ADDR(chan)); - } - --void dwmac4_dma_init_channel(void __iomem *ioaddr, -- struct stmmac_dma_cfg *dma_cfg, u32 chan) -+static void dwmac4_dma_init_channel(void __iomem *ioaddr, -+ struct stmmac_dma_cfg *dma_cfg, u32 chan) - { - u32 value; - ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h -@@ -136,6 +136,9 @@ - #define DMA_STATUS_TI 0x00000001 /* Transmit Interrupt */ - #define DMA_CONTROL_FTF 0x00100000 /* Flush transmit FIFO */ - -+#define NUM_DWMAC100_DMA_REGS 9 -+#define NUM_DWMAC1000_DMA_REGS 23 -+ - void dwmac_enable_dma_transmission(void __iomem *ioaddr); - void dwmac_enable_dma_irq(void __iomem *ioaddr, u32 chan); - void dwmac_disable_dma_irq(void __iomem *ioaddr, u32 chan); ---- a/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c -+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c -@@ -248,6 +248,7 @@ void stmmac_set_mac_addr(void __iomem *i - data = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0]; - writel(data, ioaddr + low); - } -+EXPORT_SYMBOL_GPL(stmmac_set_mac_addr); - - /* Enable disable MAC RX/TX */ - void stmmac_set_mac(void __iomem *ioaddr, bool enable) -@@ -279,4 +280,4 @@ void stmmac_get_mac_addr(void __iomem *i - addr[4] = hi_addr & 0xff; - addr[5] = (hi_addr >> 8) & 0xff; - } -- -+EXPORT_SYMBOL_GPL(stmmac_get_mac_addr); ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h -@@ -104,7 +104,7 @@ struct stmmac_priv { - /* TX Queue */ - struct stmmac_tx_queue tx_queue[MTL_MAX_TX_QUEUES]; - -- int oldlink; -+ bool oldlink; - int speed; - int oldduplex; - unsigned int flow_ctrl; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c -@@ -29,10 +29,12 @@ - #include "stmmac.h" - #include "dwmac_dma.h" - --#define REG_SPACE_SIZE 0x1054 -+#define REG_SPACE_SIZE 0x1060 - #define MAC100_ETHTOOL_NAME "st_mac100" - #define GMAC_ETHTOOL_NAME "st_gmac" - -+#define ETHTOOL_DMA_OFFSET 55 -+ - struct stmmac_stats { - char stat_string[ETH_GSTRING_LEN]; - int sizeof_stat; -@@ -273,7 +275,6 @@ static int stmmac_ethtool_get_link_ksett - { - struct stmmac_priv *priv = netdev_priv(dev); - struct phy_device *phy = dev->phydev; -- int rc; - - if (priv->hw->pcs & STMMAC_PCS_RGMII || - priv->hw->pcs & STMMAC_PCS_SGMII) { -@@ -364,8 +365,8 @@ static int stmmac_ethtool_get_link_ksett - "link speed / duplex setting\n", dev->name); - return -EBUSY; - } -- rc = phy_ethtool_ksettings_get(phy, cmd); -- return rc; -+ phy_ethtool_ksettings_get(phy, cmd); -+ return 0; - } - - static int -@@ -443,6 +444,9 @@ static void stmmac_ethtool_gregs(struct - - priv->hw->mac->dump_regs(priv->hw, reg_space); - priv->hw->dma->dump_regs(priv->ioaddr, reg_space); -+ /* Copy DMA registers to where ethtool expects them */ -+ memcpy(®_space[ETHTOOL_DMA_OFFSET], ®_space[DMA_BUS_MODE / 4], -+ NUM_DWMAC1000_DMA_REGS * 4); - } - - static void ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -235,6 +235,17 @@ static void stmmac_clk_csr_set(struct st - else if ((clk_rate >= CSR_F_250M) && (clk_rate < CSR_F_300M)) - priv->clk_csr = STMMAC_CSR_250_300M; - } -+ -+ if (priv->plat->has_sun8i) { -+ if (clk_rate > 160000000) -+ priv->clk_csr = 0x03; -+ else if (clk_rate > 80000000) -+ priv->clk_csr = 0x02; -+ else if (clk_rate > 40000000) -+ priv->clk_csr = 0x01; -+ else -+ priv->clk_csr = 0; -+ } - } - - static void print_pkt(unsigned char *buf, int len) -@@ -789,7 +800,7 @@ static void stmmac_adjust_link(struct ne - struct stmmac_priv *priv = netdev_priv(dev); - struct phy_device *phydev = dev->phydev; - unsigned long flags; -- int new_state = 0; -+ bool new_state = false; - - if (!phydev) - return; -@@ -802,8 +813,8 @@ static void stmmac_adjust_link(struct ne - /* Now we make sure that we can be in full duplex mode. - * If not, we operate in half-duplex mode. */ - if (phydev->duplex != priv->oldduplex) { -- new_state = 1; -- if (!(phydev->duplex)) -+ new_state = true; -+ if (!phydev->duplex) - ctrl &= ~priv->hw->link.duplex; - else - ctrl |= priv->hw->link.duplex; -@@ -814,30 +825,17 @@ static void stmmac_adjust_link(struct ne - stmmac_mac_flow_ctrl(priv, phydev->duplex); - - if (phydev->speed != priv->speed) { -- new_state = 1; -+ new_state = true; -+ ctrl &= ~priv->hw->link.speed_mask; - switch (phydev->speed) { -- case 1000: -- if (priv->plat->has_gmac || -- priv->plat->has_gmac4) -- ctrl &= ~priv->hw->link.port; -+ case SPEED_1000: -+ ctrl |= priv->hw->link.speed1000; - break; -- case 100: -- if (priv->plat->has_gmac || -- priv->plat->has_gmac4) { -- ctrl |= priv->hw->link.port; -- ctrl |= priv->hw->link.speed; -- } else { -- ctrl &= ~priv->hw->link.port; -- } -+ case SPEED_100: -+ ctrl |= priv->hw->link.speed100; - break; -- case 10: -- if (priv->plat->has_gmac || -- priv->plat->has_gmac4) { -- ctrl |= priv->hw->link.port; -- ctrl &= ~(priv->hw->link.speed); -- } else { -- ctrl &= ~priv->hw->link.port; -- } -+ case SPEED_10: -+ ctrl |= priv->hw->link.speed10; - break; - default: - netif_warn(priv, link, priv->dev, -@@ -853,12 +851,12 @@ static void stmmac_adjust_link(struct ne - writel(ctrl, priv->ioaddr + MAC_CTRL_REG); - - if (!priv->oldlink) { -- new_state = 1; -- priv->oldlink = 1; -+ new_state = true; -+ priv->oldlink = true; - } - } else if (priv->oldlink) { -- new_state = 1; -- priv->oldlink = 0; -+ new_state = true; -+ priv->oldlink = false; - priv->speed = SPEED_UNKNOWN; - priv->oldduplex = DUPLEX_UNKNOWN; - } -@@ -921,7 +919,7 @@ static int stmmac_init_phy(struct net_de - char bus_id[MII_BUS_ID_SIZE]; - int interface = priv->plat->interface; - int max_speed = priv->plat->max_speed; -- priv->oldlink = 0; -+ priv->oldlink = false; - priv->speed = SPEED_UNKNOWN; - priv->oldduplex = DUPLEX_UNKNOWN; - -@@ -1456,7 +1454,7 @@ static void free_dma_rx_desc_resources(s - static void free_dma_tx_desc_resources(struct stmmac_priv *priv) - { - u32 tx_count = priv->plat->tx_queues_to_use; -- u32 queue = 0; -+ u32 queue; - - /* Free TX queue resources */ - for (queue = 0; queue < tx_count; queue++) { -@@ -1505,7 +1503,7 @@ static int alloc_dma_rx_desc_resources(s - sizeof(dma_addr_t), - GFP_KERNEL); - if (!rx_q->rx_skbuff_dma) -- return -ENOMEM; -+ goto err_dma; - - rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE, - sizeof(struct sk_buff *), -@@ -1568,13 +1566,13 @@ static int alloc_dma_tx_desc_resources(s - sizeof(*tx_q->tx_skbuff_dma), - GFP_KERNEL); - if (!tx_q->tx_skbuff_dma) -- return -ENOMEM; -+ goto err_dma; - - tx_q->tx_skbuff = kmalloc_array(DMA_TX_SIZE, - sizeof(struct sk_buff *), - GFP_KERNEL); - if (!tx_q->tx_skbuff) -- goto err_dma_buffers; -+ goto err_dma; - - if (priv->extend_desc) { - tx_q->dma_etx = dma_zalloc_coherent(priv->device, -@@ -1584,7 +1582,7 @@ static int alloc_dma_tx_desc_resources(s - &tx_q->dma_tx_phy, - GFP_KERNEL); - if (!tx_q->dma_etx) -- goto err_dma_buffers; -+ goto err_dma; - } else { - tx_q->dma_tx = dma_zalloc_coherent(priv->device, - DMA_TX_SIZE * -@@ -1593,13 +1591,13 @@ static int alloc_dma_tx_desc_resources(s - &tx_q->dma_tx_phy, - GFP_KERNEL); - if (!tx_q->dma_tx) -- goto err_dma_buffers; -+ goto err_dma; - } - } - - return 0; - --err_dma_buffers: -+err_dma: - free_dma_tx_desc_resources(priv); - - return ret; -@@ -2907,8 +2905,7 @@ static netdev_tx_t stmmac_tso_xmit(struc - priv->xstats.tx_set_ic_bit++; - } - -- if (!priv->hwts_tx_en) -- skb_tx_timestamp(skb); -+ skb_tx_timestamp(skb); - - if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && - priv->hwts_tx_en)) { -@@ -2993,7 +2990,7 @@ static netdev_tx_t stmmac_xmit(struct sk - - /* Manage oversized TCP frames for GMAC4 device */ - if (skb_is_gso(skb) && priv->tso) { -- if (ip_hdr(skb)->protocol == IPPROTO_TCP) -+ if (skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) - return stmmac_tso_xmit(skb, dev); - } - -@@ -3124,8 +3121,7 @@ static netdev_tx_t stmmac_xmit(struct sk - priv->xstats.tx_set_ic_bit++; - } - -- if (!priv->hwts_tx_en) -- skb_tx_timestamp(skb); -+ skb_tx_timestamp(skb); - - /* Ready to fill the first descriptor and set the OWN bit w/o any - * problems because all the descriptors are actually ready to be -@@ -4002,7 +3998,9 @@ static int stmmac_hw_init(struct stmmac_ - struct mac_device_info *mac; - - /* Identify the MAC HW device */ -- if (priv->plat->has_gmac) { -+ if (priv->plat->setup) { -+ mac = priv->plat->setup(priv); -+ } else if (priv->plat->has_gmac) { - priv->dev->priv_flags |= IFF_UNICAST_FLT; - mac = dwmac1000_setup(priv->ioaddr, - priv->plat->multicast_filter_bins, -@@ -4022,6 +4020,10 @@ static int stmmac_hw_init(struct stmmac_ - - priv->hw = mac; - -+ /* dwmac-sun8i only work in chain mode */ -+ if (priv->plat->has_sun8i) -+ chain_mode = 1; -+ - /* To use the chained or ring mode */ - if (priv->synopsys_id >= DWMAC_CORE_4_00) { - priv->hw->mode = &dwmac4_ring_mode_ops; -@@ -4150,8 +4152,15 @@ int stmmac_dvr_probe(struct device *devi - if ((phyaddr >= 0) && (phyaddr <= 31)) - priv->plat->phy_addr = phyaddr; - -- if (priv->plat->stmmac_rst) -+ if (priv->plat->stmmac_rst) { -+ ret = reset_control_assert(priv->plat->stmmac_rst); - reset_control_deassert(priv->plat->stmmac_rst); -+ /* Some reset controllers have only reset callback instead of -+ * assert + deassert callbacks pair. -+ */ -+ if (ret == -ENOTSUPP) -+ reset_control_reset(priv->plat->stmmac_rst); -+ } - - /* Init MAC and get the capabilities */ - ret = stmmac_hw_init(priv); -@@ -4168,7 +4177,7 @@ int stmmac_dvr_probe(struct device *devi - NETIF_F_RXCSUM; - - if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { -- ndev->hw_features |= NETIF_F_TSO; -+ ndev->hw_features |= NETIF_F_TSO | NETIF_F_TSO6; - priv->tso = true; - dev_info(priv->device, "TSO feature enabled\n"); - } -@@ -4330,7 +4339,7 @@ int stmmac_suspend(struct device *dev) - } - spin_unlock_irqrestore(&priv->lock, flags); - -- priv->oldlink = 0; -+ priv->oldlink = false; - priv->speed = SPEED_UNKNOWN; - priv->oldduplex = DUPLEX_UNKNOWN; - return 0; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c -@@ -204,6 +204,7 @@ int stmmac_mdio_register(struct net_devi - struct stmmac_priv *priv = netdev_priv(ndev); - struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data; - struct device_node *mdio_node = priv->plat->mdio_node; -+ struct device *dev = ndev->dev.parent; - int addr, found; - - if (!mdio_bus_data) -@@ -237,7 +238,7 @@ int stmmac_mdio_register(struct net_devi - else - err = mdiobus_register(new_bus); - if (err != 0) { -- netdev_err(ndev, "Cannot register the MDIO bus\n"); -+ dev_err(dev, "Cannot register the MDIO bus\n"); - goto bus_register_fail; - } - -@@ -292,7 +293,7 @@ int stmmac_mdio_register(struct net_devi - } - - if (!found && !mdio_node) { -- netdev_warn(ndev, "No PHY found\n"); -+ dev_warn(dev, "No PHY found\n"); - mdiobus_unregister(new_bus); - mdiobus_free(new_bus); - return -ENODEV; ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c -@@ -30,42 +30,39 @@ - * negative value of the address means that MAC controller is not connected - * with PHY. - */ --struct stmmac_pci_dmi_data { -- const char *name; -- const char *asset_tag; -+struct stmmac_pci_func_data { - unsigned int func; - int phy_addr; - }; - -+struct stmmac_pci_dmi_data { -+ const struct stmmac_pci_func_data *func; -+ size_t nfuncs; -+}; -+ - struct stmmac_pci_info { -- struct pci_dev *pdev; -- int (*setup)(struct plat_stmmacenet_data *plat, -- struct stmmac_pci_info *info); -- struct stmmac_pci_dmi_data *dmi; -+ int (*setup)(struct pci_dev *pdev, struct plat_stmmacenet_data *plat); - }; - --static int stmmac_pci_find_phy_addr(struct stmmac_pci_info *info) -+static int stmmac_pci_find_phy_addr(struct pci_dev *pdev, -+ const struct dmi_system_id *dmi_list) - { -- const char *name = dmi_get_system_info(DMI_BOARD_NAME); -- const char *asset_tag = dmi_get_system_info(DMI_BOARD_ASSET_TAG); -- unsigned int func = PCI_FUNC(info->pdev->devfn); -- struct stmmac_pci_dmi_data *dmi; -- -- /* -- * Galileo boards with old firmware don't support DMI. We always return -- * 1 here, so at least first found MAC controller would be probed. -- */ -- if (!name) -- return 1; -- -- for (dmi = info->dmi; dmi->name && *dmi->name; dmi++) { -- if (!strcmp(dmi->name, name) && dmi->func == func) { -- /* If asset tag is provided, match on it as well. */ -- if (dmi->asset_tag && strcmp(dmi->asset_tag, asset_tag)) -- continue; -- return dmi->phy_addr; -- } -- } -+ const struct stmmac_pci_func_data *func_data; -+ const struct stmmac_pci_dmi_data *dmi_data; -+ const struct dmi_system_id *dmi_id; -+ int func = PCI_FUNC(pdev->devfn); -+ size_t n; -+ -+ dmi_id = dmi_first_match(dmi_list); -+ if (!dmi_id) -+ return -ENODEV; -+ -+ dmi_data = dmi_id->driver_data; -+ func_data = dmi_data->func; -+ -+ for (n = 0; n < dmi_data->nfuncs; n++, func_data++) -+ if (func_data->func == func) -+ return func_data->phy_addr; - - return -ENODEV; - } -@@ -100,7 +97,8 @@ static void common_default_data(struct p - plat->rx_queues_cfg[0].pkt_route = 0x0; - } - --static void stmmac_default_data(struct plat_stmmacenet_data *plat) -+static int stmmac_default_data(struct pci_dev *pdev, -+ struct plat_stmmacenet_data *plat) - { - /* Set common default data first */ - common_default_data(plat); -@@ -112,12 +110,77 @@ static void stmmac_default_data(struct p - plat->dma_cfg->pbl = 32; - plat->dma_cfg->pblx8 = true; - /* TODO: AXI */ -+ -+ return 0; - } - --static int quark_default_data(struct plat_stmmacenet_data *plat, -- struct stmmac_pci_info *info) -+static const struct stmmac_pci_info stmmac_pci_info = { -+ .setup = stmmac_default_data, -+}; -+ -+static const struct stmmac_pci_func_data galileo_stmmac_func_data[] = { -+ { -+ .func = 6, -+ .phy_addr = 1, -+ }, -+}; -+ -+static const struct stmmac_pci_dmi_data galileo_stmmac_dmi_data = { -+ .func = galileo_stmmac_func_data, -+ .nfuncs = ARRAY_SIZE(galileo_stmmac_func_data), -+}; -+ -+static const struct stmmac_pci_func_data iot2040_stmmac_func_data[] = { -+ { -+ .func = 6, -+ .phy_addr = 1, -+ }, -+ { -+ .func = 7, -+ .phy_addr = 1, -+ }, -+}; -+ -+static const struct stmmac_pci_dmi_data iot2040_stmmac_dmi_data = { -+ .func = iot2040_stmmac_func_data, -+ .nfuncs = ARRAY_SIZE(iot2040_stmmac_func_data), -+}; -+ -+static const struct dmi_system_id quark_pci_dmi[] = { -+ { -+ .matches = { -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "Galileo"), -+ }, -+ .driver_data = (void *)&galileo_stmmac_dmi_data, -+ }, -+ { -+ .matches = { -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "GalileoGen2"), -+ }, -+ .driver_data = (void *)&galileo_stmmac_dmi_data, -+ }, -+ { -+ .matches = { -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"), -+ DMI_EXACT_MATCH(DMI_BOARD_ASSET_TAG, -+ "6ES7647-0AA00-0YA2"), -+ }, -+ .driver_data = (void *)&galileo_stmmac_dmi_data, -+ }, -+ { -+ .matches = { -+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"), -+ DMI_EXACT_MATCH(DMI_BOARD_ASSET_TAG, -+ "6ES7647-0AA00-1YA2"), -+ }, -+ .driver_data = (void *)&iot2040_stmmac_dmi_data, -+ }, -+ {} -+}; -+ -+static int quark_default_data(struct pci_dev *pdev, -+ struct plat_stmmacenet_data *plat) - { -- struct pci_dev *pdev = info->pdev; - int ret; - - /* Set common default data first */ -@@ -127,9 +190,19 @@ static int quark_default_data(struct pla - * Refuse to load the driver and register net device if MAC controller - * does not connect to any PHY interface. - */ -- ret = stmmac_pci_find_phy_addr(info); -- if (ret < 0) -- return ret; -+ ret = stmmac_pci_find_phy_addr(pdev, quark_pci_dmi); -+ if (ret < 0) { -+ /* Return error to the caller on DMI enabled boards. */ -+ if (dmi_get_system_info(DMI_BOARD_NAME)) -+ return ret; -+ -+ /* -+ * Galileo boards with old firmware don't support DMI. We always -+ * use 1 here as PHY address, so at least the first found MAC -+ * controller would be probed. -+ */ -+ ret = 1; -+ } - - plat->bus_id = PCI_DEVID(pdev->bus->number, pdev->devfn); - plat->phy_addr = ret; -@@ -143,41 +216,8 @@ static int quark_default_data(struct pla - return 0; - } - --static struct stmmac_pci_dmi_data quark_pci_dmi_data[] = { -- { -- .name = "Galileo", -- .func = 6, -- .phy_addr = 1, -- }, -- { -- .name = "GalileoGen2", -- .func = 6, -- .phy_addr = 1, -- }, -- { -- .name = "SIMATIC IOT2000", -- .asset_tag = "6ES7647-0AA00-0YA2", -- .func = 6, -- .phy_addr = 1, -- }, -- { -- .name = "SIMATIC IOT2000", -- .asset_tag = "6ES7647-0AA00-1YA2", -- .func = 6, -- .phy_addr = 1, -- }, -- { -- .name = "SIMATIC IOT2000", -- .asset_tag = "6ES7647-0AA00-1YA2", -- .func = 7, -- .phy_addr = 1, -- }, -- {} --}; -- --static struct stmmac_pci_info quark_pci_info = { -+static const struct stmmac_pci_info quark_pci_info = { - .setup = quark_default_data, -- .dmi = quark_pci_dmi_data, - }; - - /** -@@ -236,15 +276,9 @@ static int stmmac_pci_probe(struct pci_d - - pci_set_master(pdev); - -- if (info) { -- info->pdev = pdev; -- if (info->setup) { -- ret = info->setup(plat, info); -- if (ret) -- return ret; -- } -- } else -- stmmac_default_data(plat); -+ ret = info->setup(pdev, plat); -+ if (ret) -+ return ret; - - pci_enable_msi(pdev); - -@@ -306,14 +340,21 @@ static int stmmac_pci_resume(struct devi - - static SIMPLE_DEV_PM_OPS(stmmac_pm_ops, stmmac_pci_suspend, stmmac_pci_resume); - --#define STMMAC_VENDOR_ID 0x700 -+/* synthetic ID, no official vendor */ -+#define PCI_VENDOR_ID_STMMAC 0x700 -+ - #define STMMAC_QUARK_ID 0x0937 - #define STMMAC_DEVICE_ID 0x1108 - -+#define STMMAC_DEVICE(vendor_id, dev_id, info) { \ -+ PCI_VDEVICE(vendor_id, dev_id), \ -+ .driver_data = (kernel_ulong_t)&info \ -+ } -+ - static const struct pci_device_id stmmac_id_table[] = { -- {PCI_DEVICE(STMMAC_VENDOR_ID, STMMAC_DEVICE_ID)}, -- {PCI_DEVICE(PCI_VENDOR_ID_STMICRO, PCI_DEVICE_ID_STMICRO_MAC)}, -- {PCI_VDEVICE(INTEL, STMMAC_QUARK_ID), (kernel_ulong_t)&quark_pci_info}, -+ STMMAC_DEVICE(STMMAC, STMMAC_DEVICE_ID, stmmac_pci_info), -+ STMMAC_DEVICE(STMICRO, PCI_DEVICE_ID_STMICRO_MAC, stmmac_pci_info), -+ STMMAC_DEVICE(INTEL, STMMAC_QUARK_ID, quark_pci_info), - {} - }; - ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c -@@ -308,6 +308,13 @@ static int stmmac_dt_phy(struct plat_stm - struct device_node *np, struct device *dev) - { - bool mdio = true; -+ static const struct of_device_id need_mdio_ids[] = { -+ { .compatible = "snps,dwc-qos-ethernet-4.10" }, -+ { .compatible = "allwinner,sun8i-a83t-emac" }, -+ { .compatible = "allwinner,sun8i-h3-emac" }, -+ { .compatible = "allwinner,sun8i-v3s-emac" }, -+ { .compatible = "allwinner,sun50i-a64-emac" }, -+ }; - - /* If phy-handle property is passed from DT, use it as the PHY */ - plat->phy_node = of_parse_phandle(np, "phy-handle", 0); -@@ -324,8 +331,7 @@ static int stmmac_dt_phy(struct plat_stm - mdio = false; - } - -- /* exception for dwmac-dwc-qos-eth glue logic */ -- if (of_device_is_compatible(np, "snps,dwc-qos-ethernet-4.10")) { -+ if (of_match_node(need_mdio_ids, np)) { - plat->mdio_node = of_get_child_by_name(np, "mdio"); - } else { - /** ---- a/include/linux/stmmac.h -+++ b/include/linux/stmmac.h -@@ -177,6 +177,7 @@ struct plat_stmmacenet_data { - void (*fix_mac_speed)(void *priv, unsigned int speed); - int (*init)(struct platform_device *pdev, void *priv); - void (*exit)(struct platform_device *pdev, void *priv); -+ struct mac_device_info *(*setup)(void *priv); - void *bsp_priv; - struct clk *stmmac_clk; - struct clk *pclk; -@@ -185,6 +186,7 @@ struct plat_stmmacenet_data { - struct reset_control *stmmac_rst; - struct stmmac_axi *axi; - int has_gmac4; -+ bool has_sun8i; - bool tso_en; - int mac_port_sel_speed; - bool en_tx_lpi_clockgating; diff --git a/target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch b/target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch deleted file mode 100644 index f2bac1fde0b..00000000000 --- a/target/linux/sunxi/patches-4.9/0054-crypto-sun4i-ss_support_the_Security_System_PRNG.patch +++ /dev/null @@ -1,206 +0,0 @@ -From b8ae5c7387ad075ee61e8c8774ce2bca46bc9236 Mon Sep 17 00:00:00 2001 -From: Corentin LABBE -Date: Mon, 3 Jul 2017 20:48:48 +0200 -Subject: crypto: sun4i-ss - support the Security System PRNG - -The Security System has a PRNG, this patch adds support for it via -crypto_rng. - -Signed-off-by: Corentin Labbe -Signed-off-by: Herbert Xu ---- - drivers/crypto/Kconfig | 8 +++++ - drivers/crypto/sunxi-ss/Makefile | 1 + - drivers/crypto/sunxi-ss/sun4i-ss-core.c | 30 ++++++++++++++++++ - drivers/crypto/sunxi-ss/sun4i-ss-prng.c | 56 +++++++++++++++++++++++++++++++++ - drivers/crypto/sunxi-ss/sun4i-ss.h | 11 +++++++ - 5 files changed, 106 insertions(+) - create mode 100644 drivers/crypto/sunxi-ss/sun4i-ss-prng.c - ---- a/drivers/crypto/Kconfig -+++ b/drivers/crypto/Kconfig -@@ -538,6 +538,14 @@ config CRYPTO_DEV_SUN4I_SS - To compile this driver as a module, choose M here: the module - will be called sun4i-ss. - -+config CRYPTO_DEV_SUN4I_SS_PRNG -+ bool "Support for Allwinner Security System PRNG" -+ depends on CRYPTO_DEV_SUN4I_SS -+ select CRYPTO_RNG -+ help -+ Select this option if you want to provide kernel-side support for -+ the Pseudo-Random Number Generator found in the Security System. -+ - config CRYPTO_DEV_ROCKCHIP - tristate "Rockchip's Cryptographic Engine driver" - depends on OF && ARCH_ROCKCHIP ---- a/drivers/crypto/sunxi-ss/Makefile -+++ b/drivers/crypto/sunxi-ss/Makefile -@@ -1,2 +1,3 @@ - obj-$(CONFIG_CRYPTO_DEV_SUN4I_SS) += sun4i-ss.o - sun4i-ss-y += sun4i-ss-core.o sun4i-ss-hash.o sun4i-ss-cipher.o -+sun4i-ss-$(CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG) += sun4i-ss-prng.o ---- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c -+++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c -@@ -214,6 +214,23 @@ static struct sun4i_ss_alg_template ss_a - } - } - }, -+#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG -+{ -+ .type = CRYPTO_ALG_TYPE_RNG, -+ .alg.rng = { -+ .base = { -+ .cra_name = "stdrng", -+ .cra_driver_name = "sun4i_ss_rng", -+ .cra_priority = 300, -+ .cra_ctxsize = 0, -+ .cra_module = THIS_MODULE, -+ }, -+ .generate = sun4i_ss_prng_generate, -+ .seed = sun4i_ss_prng_seed, -+ .seedsize = SS_SEED_LEN / BITS_PER_BYTE, -+ } -+}, -+#endif - }; - - static int sun4i_ss_probe(struct platform_device *pdev) -@@ -356,6 +373,13 @@ static int sun4i_ss_probe(struct platfor - goto error_alg; - } - break; -+ case CRYPTO_ALG_TYPE_RNG: -+ err = crypto_register_rng(&ss_algs[i].alg.rng); -+ if (err) { -+ dev_err(ss->dev, "Fail to register %s\n", -+ ss_algs[i].alg.rng.base.cra_name); -+ } -+ break; - } - } - platform_set_drvdata(pdev, ss); -@@ -370,6 +394,9 @@ error_alg: - case CRYPTO_ALG_TYPE_AHASH: - crypto_unregister_ahash(&ss_algs[i].alg.hash); - break; -+ case CRYPTO_ALG_TYPE_RNG: -+ crypto_unregister_rng(&ss_algs[i].alg.rng); -+ break; - } - } - if (ss->reset) -@@ -394,6 +421,9 @@ static int sun4i_ss_remove(struct platfo - case CRYPTO_ALG_TYPE_AHASH: - crypto_unregister_ahash(&ss_algs[i].alg.hash); - break; -+ case CRYPTO_ALG_TYPE_RNG: -+ crypto_unregister_rng(&ss_algs[i].alg.rng); -+ break; - } - } - ---- /dev/null -+++ b/drivers/crypto/sunxi-ss/sun4i-ss-prng.c -@@ -0,0 +1,56 @@ -+#include "sun4i-ss.h" -+ -+int sun4i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, -+ unsigned int slen) -+{ -+ struct sun4i_ss_alg_template *algt; -+ struct rng_alg *alg = crypto_rng_alg(tfm); -+ -+ algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng); -+ memcpy(algt->ss->seed, seed, slen); -+ -+ return 0; -+} -+ -+int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src, -+ unsigned int slen, u8 *dst, unsigned int dlen) -+{ -+ struct sun4i_ss_alg_template *algt; -+ struct rng_alg *alg = crypto_rng_alg(tfm); -+ int i; -+ u32 v; -+ u32 *data = (u32 *)dst; -+ const u32 mode = SS_OP_PRNG | SS_PRNG_CONTINUE | SS_ENABLED; -+ size_t len; -+ struct sun4i_ss_ctx *ss; -+ unsigned int todo = (dlen / 4) * 4; -+ -+ algt = container_of(alg, struct sun4i_ss_alg_template, alg.rng); -+ ss = algt->ss; -+ -+ spin_lock(&ss->slock); -+ -+ writel(mode, ss->base + SS_CTL); -+ -+ while (todo > 0) { -+ /* write the seed */ -+ for (i = 0; i < SS_SEED_LEN / BITS_PER_LONG; i++) -+ writel(ss->seed[i], ss->base + SS_KEY0 + i * 4); -+ -+ /* Read the random data */ -+ len = min_t(size_t, SS_DATA_LEN / BITS_PER_BYTE, todo); -+ readsl(ss->base + SS_TXFIFO, data, len / 4); -+ data += len / 4; -+ todo -= len; -+ -+ /* Update the seed */ -+ for (i = 0; i < SS_SEED_LEN / BITS_PER_LONG; i++) { -+ v = readl(ss->base + SS_KEY0 + i * 4); -+ ss->seed[i] = v; -+ } -+ } -+ -+ writel(0, ss->base + SS_CTL); -+ spin_unlock(&ss->slock); -+ return dlen; -+} ---- a/drivers/crypto/sunxi-ss/sun4i-ss.h -+++ b/drivers/crypto/sunxi-ss/sun4i-ss.h -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #define SS_CTL 0x00 - #define SS_KEY0 0x04 -@@ -125,6 +126,9 @@ - #define SS_RXFIFO_EMP_INT_ENABLE (1 << 2) - #define SS_TXFIFO_AVA_INT_ENABLE (1 << 0) - -+#define SS_SEED_LEN 192 -+#define SS_DATA_LEN 160 -+ - struct sun4i_ss_ctx { - void __iomem *base; - int irq; -@@ -134,6 +138,9 @@ struct sun4i_ss_ctx { - struct device *dev; - struct resource *res; - spinlock_t slock; /* control the use of the device */ -+#ifdef CONFIG_CRYPTO_DEV_SUN4I_SS_PRNG -+ u32 seed[SS_SEED_LEN / BITS_PER_LONG]; -+#endif - }; - - struct sun4i_ss_alg_template { -@@ -142,6 +149,7 @@ struct sun4i_ss_alg_template { - union { - struct crypto_alg crypto; - struct ahash_alg hash; -+ struct rng_alg rng; - } alg; - struct sun4i_ss_ctx *ss; - }; -@@ -199,3 +207,6 @@ int sun4i_ss_des_setkey(struct crypto_ab - unsigned int keylen); - int sun4i_ss_des3_setkey(struct crypto_ablkcipher *tfm, const u8 *key, - unsigned int keylen); -+int sun4i_ss_prng_generate(struct crypto_rng *tfm, const u8 *src, -+ unsigned int slen, u8 *dst, unsigned int dlen); -+int sun4i_ss_prng_seed(struct crypto_rng *tfm, const u8 *seed, unsigned int slen); diff --git a/target/linux/sunxi/patches-4.9/0060-arm64-allwinner-sun50i-a64-Add-dt-node-for-the-sysco.patch b/target/linux/sunxi/patches-4.9/0060-arm64-allwinner-sun50i-a64-Add-dt-node-for-the-sysco.patch deleted file mode 100644 index 911ea49967c..00000000000 --- a/target/linux/sunxi/patches-4.9/0060-arm64-allwinner-sun50i-a64-Add-dt-node-for-the-sysco.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 79b953605ded6a9a995040a1c8cc665127a6411a Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:45 +0200 -Subject: arm64: allwinner: sun50i-a64: Add dt node for the syscon control - module - -This patch add the dt node for the syscon register present on the -Allwinner A64. - -Only two register are present in this syscon and the only one useful is -the one dedicated to EMAC clock. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -129,6 +129,12 @@ - #size-cells = <1>; - ranges; - -+ syscon: syscon@1c00000 { -+ compatible = "allwinner,sun50i-a64-system-controller", -+ "syscon"; -+ reg = <0x01c00000 0x1000>; -+ }; -+ - mmc0: mmc@1c0f000 { - compatible = "allwinner,sun50i-a64-mmc"; - reg = <0x01c0f000 0x1000>; diff --git a/target/linux/sunxi/patches-4.9/0061-arm64-allwinner-sun50i-a64-add-dwmac-sun8i-Ethernet-.patch b/target/linux/sunxi/patches-4.9/0061-arm64-allwinner-sun50i-a64-add-dwmac-sun8i-Ethernet-.patch deleted file mode 100644 index e59c3e87354..00000000000 --- a/target/linux/sunxi/patches-4.9/0061-arm64-allwinner-sun50i-a64-add-dwmac-sun8i-Ethernet-.patch +++ /dev/null @@ -1,69 +0,0 @@ -From e53f67e981bcc5547857475241b3a4a066955f8c Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:46 +0200 -Subject: arm64: allwinner: sun50i-a64: add dwmac-sun8i Ethernet driver - -The dwmac-sun8i is an Ethernet MAC that supports 10/100/1000 Mbit -connections. It is very similar to the device found in the Allwinner -H3, but lacks the internal 100 Mbit PHY and its associated control -bits. -This adds the necessary bits to the Allwinner A64 SoC .dtsi, but keeps -it disabled at this level. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 35 +++++++++++++++++++++++++++ - 1 file changed, 35 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -284,6 +284,21 @@ - bias-pull-up; - }; - -+ rmii_pins: rmii_pins { -+ pins = "PD10", "PD11", "PD13", "PD14", "PD17", -+ "PD18", "PD19", "PD20", "PD22", "PD23"; -+ function = "emac"; -+ drive-strength = <40>; -+ }; -+ -+ rgmii_pins: rgmii_pins { -+ pins = "PD8", "PD9", "PD10", "PD11", "PD12", -+ "PD13", "PD15", "PD16", "PD17", "PD18", -+ "PD19", "PD20", "PD21", "PD22", "PD23"; -+ function = "emac"; -+ drive-strength = <40>; -+ }; -+ - uart0_pins_a: uart0@0 { - pins = "PB8", "PB9"; - function = "uart0"; -@@ -388,6 +403,26 @@ - #size-cells = <0>; - }; - -+ emac: ethernet@1c30000 { -+ compatible = "allwinner,sun50i-a64-emac"; -+ syscon = <&syscon>; -+ reg = <0x01c30000 0x100>; -+ interrupts = ; -+ interrupt-names = "macirq"; -+ resets = <&ccu RST_BUS_EMAC>; -+ reset-names = "stmmaceth"; -+ clocks = <&ccu CLK_BUS_EMAC>; -+ clock-names = "stmmaceth"; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ mdio: mdio { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ }; -+ - gic: interrupt-controller@1c81000 { - compatible = "arm,gic-400"; - reg = <0x01c81000 0x1000>, diff --git a/target/linux/sunxi/patches-4.9/0062-arm64-allwinner-pine64-Enable-dwmac-sun8i.patch b/target/linux/sunxi/patches-4.9/0062-arm64-allwinner-pine64-Enable-dwmac-sun8i.patch deleted file mode 100644 index d9a825490d5..00000000000 --- a/target/linux/sunxi/patches-4.9/0062-arm64-allwinner-pine64-Enable-dwmac-sun8i.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 97023943749367111b9a88e09d1b9bd157dd3326 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:47 +0200 -Subject: arm64: allwinner: pine64: Enable dwmac-sun8i - -The dwmac-sun8i hardware is present on the pine64 -It uses an external PHY via RMII. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -70,6 +70,15 @@ - status = "okay"; - }; - -+&emac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rmii_pins>; -+ phy-mode = "rmii"; -+ phy-handle = <&ext_rmii_phy1>; -+ status = "okay"; -+ -+}; -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins>; -@@ -80,6 +89,13 @@ - bias-pull-up; - }; - -+&mdio { -+ ext_rmii_phy1: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins>; diff --git a/target/linux/sunxi/patches-4.9/0063-arm64-allwinner-pine64-plus-Enable-dwmac-sun8i.patch b/target/linux/sunxi/patches-4.9/0063-arm64-allwinner-pine64-plus-Enable-dwmac-sun8i.patch deleted file mode 100644 index f89b842790f..00000000000 --- a/target/linux/sunxi/patches-4.9/0063-arm64-allwinner-pine64-plus-Enable-dwmac-sun8i.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 94dcfdc77fc55ed1956011ceea341911c6e760a0 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:48 +0200 -Subject: arm64: allwinner: pine64-plus: Enable dwmac-sun8i - -The dwmac-sun8i hardware is present on the pine64 plus. -It uses an external PHY rtl8211e via RGMII. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - .../arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts | 17 ++++++++++++++++- - 1 file changed, 16 insertions(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-plus.dts -@@ -46,5 +46,20 @@ - model = "Pine64+"; - compatible = "pine64,pine64-plus", "allwinner,sun50i-a64"; - -- /* TODO: Camera, Ethernet PHY, touchscreen, etc. */ -+ /* TODO: Camera, touchscreen, etc. */ -+}; -+ -+&emac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&rgmii_pins>; -+ phy-mode = "rgmii"; -+ phy-handle = <&ext_rgmii_phy>; -+ status = "okay"; -+}; -+ -+&mdio { -+ ext_rgmii_phy: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ }; - }; diff --git a/target/linux/sunxi/patches-4.9/0064-arm64-allwinner-sun50i-a64-Correct-emac-register-siz.patch b/target/linux/sunxi/patches-4.9/0064-arm64-allwinner-sun50i-a64-Correct-emac-register-siz.patch deleted file mode 100644 index 924c8752887..00000000000 --- a/target/linux/sunxi/patches-4.9/0064-arm64-allwinner-sun50i-a64-Correct-emac-register-siz.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3a4bae5fd44aa1cf49780dd25b3a89e6a39e8560 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Mon, 10 Jul 2017 20:44:40 +0200 -Subject: arm64: allwinner: sun50i-a64: Correct emac register size - -The datasheet said that emac register size is 0x10000 not 0x100 - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard -[wens@csie.org: Fixed commit subject prefix] -Signed-off-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi -@@ -406,7 +406,7 @@ - emac: ethernet@1c30000 { - compatible = "allwinner,sun50i-a64-emac"; - syscon = <&syscon>; -- reg = <0x01c30000 0x100>; -+ reg = <0x01c30000 0x10000>; - interrupts = ; - interrupt-names = "macirq"; - resets = <&ccu RST_BUS_EMAC>; diff --git a/target/linux/sunxi/patches-4.9/0065-arm64-allwinner-a64-pine64-add-missing-ethernet0-ali.patch b/target/linux/sunxi/patches-4.9/0065-arm64-allwinner-a64-pine64-add-missing-ethernet0-ali.patch deleted file mode 100644 index f892219fa3d..00000000000 --- a/target/linux/sunxi/patches-4.9/0065-arm64-allwinner-a64-pine64-add-missing-ethernet0-ali.patch +++ /dev/null @@ -1,29 +0,0 @@ -From dff751c68904cf587d918cfb6b2f5b0112f73bc9 Mon Sep 17 00:00:00 2001 -From: Icenowy Zheng -Date: Sat, 22 Jul 2017 10:28:51 +0800 -Subject: arm64: allwinner: a64: pine64: add missing ethernet0 alias - -The EMAC Ethernet controller was enabled, but an accompanying alias -was not added. This results in unstable numbering if other Ethernet -devices, such as a USB dongle, are present. Also, the bootloader uses -the alias to assign a generated stable MAC address to the device node. - -Signed-off-by: Icenowy Zheng -Signed-off-by: Maxime Ripard -Fixes: 970239437493 ("arm64: allwinner: pine64: Enable dwmac-sun8i") -[wens@csie.org: Rewrite commit log as fixing a previous patch with Fixes] -Signed-off-by: Chen-Yu Tsai ---- - arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts -@@ -51,6 +51,7 @@ - compatible = "pine64,pine64", "allwinner,sun50i-a64"; - - aliases { -+ ethernet0 = &emac; - serial0 = &uart0; - }; - diff --git a/target/linux/sunxi/patches-4.9/0070-arm-sun8i-sunxi-h3-h5-Add-dt-node-for-the-syscon-con.patch b/target/linux/sunxi/patches-4.9/0070-arm-sun8i-sunxi-h3-h5-Add-dt-node-for-the-syscon-con.patch deleted file mode 100644 index 88d431d319c..00000000000 --- a/target/linux/sunxi/patches-4.9/0070-arm-sun8i-sunxi-h3-h5-Add-dt-node-for-the-syscon-con.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d91d3daf5de90e0118227d8ddcb7bb4ff40c1b91 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:37 +0200 -Subject: arm: sun8i: sunxi-h3-h5: Add dt node for the syscon control module - -This patch add the dt node for the syscon register present on the -Allwinner H3/H5 - -Only two register are present in this syscon and the only one useful is -the one dedicated to EMAC clock.. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -140,6 +140,12 @@ - #size-cells = <1>; - ranges; - -+ syscon: syscon@1c00000 { -+ compatible = "allwinner,sun8i-h3-system-controller", -+ "syscon"; -+ reg = <0x01c00000 0x1000>; -+ }; -+ - dma: dma-controller@01c02000 { - compatible = "allwinner,sun8i-h3-dma"; - reg = <0x01c02000 0x1000>; diff --git a/target/linux/sunxi/patches-4.9/0071-arm-sun8i-sunxi-h3-h5-add-dwmac-sun8i-ethernet-drive.patch b/target/linux/sunxi/patches-4.9/0071-arm-sun8i-sunxi-h3-h5-add-dwmac-sun8i-ethernet-drive.patch deleted file mode 100644 index 7054e3dc0f2..00000000000 --- a/target/linux/sunxi/patches-4.9/0071-arm-sun8i-sunxi-h3-h5-add-dwmac-sun8i-ethernet-drive.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 0eba511a3cac29d6338b22b5b727f40cf8d163df Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:38 +0200 -Subject: arm: sun8i: sunxi-h3-h5: add dwmac-sun8i ethernet driver - -The dwmac-sun8i is an ethernet MAC hardware that support 10/100/1000 -speed. - -This patch enable the dwmac-sun8i on Allwinner H3/H5 SoC Device-tree. -SoC H3/H5 have an internal PHY, so optionals syscon and ephy are set. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 34 ++++++++++++++++++++++++++++++++++ - 1 file changed, 34 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -333,6 +333,14 @@ - interrupt-controller; - #interrupt-cells = <3>; - -+ emac_rgmii_pins: emac0 { -+ pins = "PD0", "PD1", "PD2", "PD3", "PD4", -+ "PD5", "PD7", "PD8", "PD9", "PD10", -+ "PD12", "PD13", "PD15", "PD16", "PD17"; -+ function = "emac"; -+ drive-strength = <40>; -+ }; -+ - i2c0_pins: i2c0 { - allwinner,pins = "PA11", "PA12"; - allwinner,function = "i2c0"; -@@ -431,6 +439,32 @@ - clocks = <&osc24M>; - }; - -+ emac: ethernet@1c30000 { -+ compatible = "allwinner,sun8i-h3-emac"; -+ syscon = <&syscon>; -+ reg = <0x01c30000 0x104>; -+ interrupts = ; -+ interrupt-names = "macirq"; -+ resets = <&ccu RST_BUS_EMAC>; -+ reset-names = "stmmaceth"; -+ clocks = <&ccu CLK_BUS_EMAC>; -+ clock-names = "stmmaceth"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ -+ mdio: mdio { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ int_mii_phy: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <1>; -+ clocks = <&ccu CLK_BUS_EPHY>; -+ resets = <&ccu RST_BUS_EPHY>; -+ }; -+ }; -+ }; -+ - wdt0: watchdog@01c20ca0 { - compatible = "allwinner,sun6i-a31-wdt"; - reg = <0x01c20ca0 0x20>; diff --git a/target/linux/sunxi/patches-4.9/0072-arm-sun8i-orangepi-2-Enable-dwmac-sun8i.patch b/target/linux/sunxi/patches-4.9/0072-arm-sun8i-orangepi-2-Enable-dwmac-sun8i.patch deleted file mode 100644 index 450d5bc2bef..00000000000 --- a/target/linux/sunxi/patches-4.9/0072-arm-sun8i-orangepi-2-Enable-dwmac-sun8i.patch +++ /dev/null @@ -1,40 +0,0 @@ -From a9992f2dd1890112643a93d621ff5a4c97c55d53 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Wed, 31 May 2017 09:18:42 +0200 -Subject: arm: sun8i: orangepi-2: Enable dwmac-sun8i - -The dwmac-sun8i hardware is present on the Orange PI 2. -It uses the internal PHY. - -This patch create the needed emac node. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun8i-h3-orangepi-2.dts | 8 ++++++++ - 1 file changed, 8 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts -+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-2.dts -@@ -55,6 +55,7 @@ - aliases { - serial0 = &uart0; - /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ -+ ethernet0 = &emac; - ethernet1 = &rtl8189; - }; - -@@ -109,6 +110,13 @@ - status = "okay"; - }; - -+&emac { -+ phy-handle = <&int_mii_phy>; -+ phy-mode = "mii"; -+ allwinner,leds-active-low; -+ status = "okay"; -+}; -+ - &ir { - pinctrl-names = "default"; - pinctrl-0 = <&ir_pins_a>; diff --git a/target/linux/sunxi/patches-4.9/0073-ARM-sun8i-orangepi-plus-Enable-dwmac-sun8i.patch b/target/linux/sunxi/patches-4.9/0073-ARM-sun8i-orangepi-plus-Enable-dwmac-sun8i.patch deleted file mode 100644 index 375d119d55b..00000000000 --- a/target/linux/sunxi/patches-4.9/0073-ARM-sun8i-orangepi-plus-Enable-dwmac-sun8i.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 1dcd0095019aca7533eaeed9475d995a4eb30137 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Mon, 5 Jun 2017 21:21:26 +0200 -Subject: ARM: sun8i: orangepi-plus: Enable dwmac-sun8i - -The dwmac-sun8i hardware is present on the Orange PI plus. -It uses an external PHY rtl8211e via RGMII. - -This patch create the needed regulator, emac and phy nodes. - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 32 ++++++++++++++++++++++++++++ - 1 file changed, 32 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -@@ -47,6 +47,20 @@ - model = "Xunlong Orange Pi Plus / Plus 2"; - compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3"; - -+ aliases { -+ ethernet0 = &emac; -+ }; -+ -+ reg_gmac_3v3: gmac-3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "gmac-3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <100000>; -+ enable-active-high; -+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; -+ }; -+ - reg_usb3_vbus: usb3-vbus { - compatible = "regulator-fixed"; - pinctrl-names = "default"; -@@ -64,6 +78,24 @@ - status = "okay"; - }; - -+&emac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emac_rgmii_pins>; -+ phy-supply = <®_gmac_3v3>; -+ phy-handle = <&ext_rgmii_phy>; -+ phy-mode = "rgmii"; -+ -+ allwinner,leds-active-low; -+ status = "okay"; -+}; -+ -+&mdio { -+ ext_rgmii_phy: ethernet-phy@1 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <0>; -+ }; -+}; -+ - &mmc2 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc2_8bit_pins>; diff --git a/target/linux/sunxi/patches-4.9/0074-ARM-dts-sunxi-h3-h5-Correct-emac-register-size.patch b/target/linux/sunxi/patches-4.9/0074-ARM-dts-sunxi-h3-h5-Correct-emac-register-size.patch deleted file mode 100644 index 50877a53018..00000000000 --- a/target/linux/sunxi/patches-4.9/0074-ARM-dts-sunxi-h3-h5-Correct-emac-register-size.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 072b6e3692532b6281bf781ded1c7a986ac17471 Mon Sep 17 00:00:00 2001 -From: Corentin Labbe -Date: Thu, 6 Jul 2017 10:53:34 +0200 -Subject: ARM: dts: sunxi: h3/h5: Correct emac register size - -The datasheet said that emac register size is 0x10000 not 0x104 - -Signed-off-by: Corentin Labbe -Signed-off-by: Maxime Ripard -[wens@csie.org: Fixed commit subject prefix] -Signed-off-by: Chen-Yu Tsai ---- - arch/arm/boot/dts/sunxi-h3-h5.dtsi | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -442,7 +442,7 @@ - emac: ethernet@1c30000 { - compatible = "allwinner,sun8i-h3-emac"; - syscon = <&syscon>; -- reg = <0x01c30000 0x104>; -+ reg = <0x01c30000 0x10000>; - interrupts = ; - interrupt-names = "macirq"; - resets = <&ccu RST_BUS_EMAC>; diff --git a/target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch b/target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch deleted file mode 100644 index 4de2fd2e853..00000000000 --- a/target/linux/sunxi/patches-4.9/0080-ARM-dts-sunxi-nanopi-neo-Enable-dwmac-sun8i.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts -+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts -@@ -53,6 +53,7 @@ - - aliases { - serial0 = &uart0; -+ ethernet0 = &emac; - }; - - chosen { -@@ -81,6 +82,13 @@ - status = "okay"; - }; - -+&emac { -+ phy-handle = <&int_mii_phy>; -+ phy-mode = "mii"; -+ allwinner,leds-active-low; -+ status = "okay"; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; diff --git a/target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch b/target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch deleted file mode 100644 index b815f7263bb..00000000000 --- a/target/linux/sunxi/patches-4.9/0081-ARM-dts-sun8i-nanopi-neo-enable-UART-USB-and-I2C-pin.patch +++ /dev/null @@ -1,80 +0,0 @@ -From e036def69972b9db9d2695f45cbf4e84c707b3c5 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Fri, 23 Dec 2016 07:28:51 +0100 -Subject: [PATCH] ARM: dts: sun8i: nanopi-neo: enable UART, USB and I2C pins - ---- - arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts | 43 ++++++++++++++++++++++++++++--- - 1 file changed, 40 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts -+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts -@@ -78,10 +78,30 @@ - }; - }; - -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&ehci2 { -+ status = "okay"; -+}; -+ -+&ohci2 { -+ status = "okay"; -+}; -+ - &ehci3 { - status = "okay"; - }; - -+&ohci3 { -+ status = "okay"; -+}; -+ - &emac { - phy-handle = <&int_mii_phy>; - phy-mode = "mii"; -@@ -99,9 +119,6 @@ - status = "okay"; - }; - --&ohci3 { -- status = "okay"; --}; - - &pio { - leds_opc: led-pins { -@@ -127,7 +144,27 @@ - status = "okay"; - }; - -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1_pins>; -+ status = "okay"; -+}; -+ -+&uart2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart2_pins>; -+ status = "okay"; -+}; -+ - &usbphy { - /* USB VBUS is always on */ - status = "okay"; - }; -+ -+&i2c0 { -+ status = "okay"; -+}; -+ -+&i2c1 { -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch b/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch deleted file mode 100644 index e64581ff836..00000000000 --- a/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch +++ /dev/null @@ -1,288 +0,0 @@ ---- a/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt -+++ b/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt -@@ -13,6 +13,7 @@ Required properties: - * "allwinner,sun5i-a13-mmc" - * "allwinner,sun7i-a20-mmc" - * "allwinner,sun9i-a80-mmc" -+ * "allwinner,sun50i-a64-emmc" - * "allwinner,sun50i-a64-mmc" - - reg : mmc controller base registers - - clocks : a list with 4 phandle + clock specifier pairs ---- a/drivers/mmc/host/sunxi-mmc.c -+++ b/drivers/mmc/host/sunxi-mmc.c -@@ -5,6 +5,7 @@ - * (C) Copyright 2013-2014 O2S GmbH - * (C) Copyright 2013-2014 David Lanzend�rfer - * (C) Copyright 2013-2014 Hans de Goede -+ * (C) Copyright 2017 Sootech SA - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as -@@ -101,6 +102,7 @@ - (SDXC_SOFT_RESET | SDXC_FIFO_RESET | SDXC_DMA_RESET) - - /* clock control bits */ -+#define SDXC_MASK_DATA0 BIT(31) - #define SDXC_CARD_CLOCK_ON BIT(16) - #define SDXC_LOW_POWER_ON BIT(17) - -@@ -253,6 +255,11 @@ struct sunxi_mmc_cfg { - - /* does the IP block support autocalibration? */ - bool can_calibrate; -+ -+ /* Does DATA0 needs to be masked while the clock is updated */ -+ bool mask_data0; -+ -+ bool needs_new_timings; - }; - - struct sunxi_mmc_host { -@@ -482,7 +489,7 @@ static void sunxi_mmc_dump_errinfo(struc - cmd->opcode == SD_IO_RW_DIRECT)) - return; - -- dev_err(mmc_dev(host->mmc), -+ dev_dbg(mmc_dev(host->mmc), - "smc %d err, cmd %d,%s%s%s%s%s%s%s%s%s%s !!\n", - host->mmc->index, cmd->opcode, - data ? (data->flags & MMC_DATA_WRITE ? " WR" : " RD") : "", -@@ -654,11 +661,16 @@ static int sunxi_mmc_oclk_onoff(struct s - unsigned long expire = jiffies + msecs_to_jiffies(750); - u32 rval; - -+ dev_dbg(mmc_dev(host->mmc), "%sabling the clock\n", -+ oclk_en ? "en" : "dis"); -+ - rval = mmc_readl(host, REG_CLKCR); -- rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON); -+ rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON | SDXC_MASK_DATA0); - - if (oclk_en) - rval |= SDXC_CARD_CLOCK_ON; -+ if (host->cfg->mask_data0) -+ rval |= SDXC_MASK_DATA0; - - mmc_writel(host, REG_CLKCR, rval); - -@@ -678,46 +690,29 @@ static int sunxi_mmc_oclk_onoff(struct s - return -EIO; - } - -+ if (host->cfg->mask_data0) { -+ rval = mmc_readl(host, REG_CLKCR); -+ mmc_writel(host, REG_CLKCR, rval & ~SDXC_MASK_DATA0); -+ } -+ - return 0; - } - - static int sunxi_mmc_calibrate(struct sunxi_mmc_host *host, int reg_off) - { -- u32 reg = readl(host->reg_base + reg_off); -- u32 delay; -- unsigned long timeout; -- - if (!host->cfg->can_calibrate) - return 0; - -- reg &= ~(SDXC_CAL_DL_MASK << SDXC_CAL_DL_SW_SHIFT); -- reg &= ~SDXC_CAL_DL_SW_EN; -- -- writel(reg | SDXC_CAL_START, host->reg_base + reg_off); -- -- dev_dbg(mmc_dev(host->mmc), "calibration started\n"); -- -- timeout = jiffies + HZ * SDXC_CAL_TIMEOUT; -- -- while (!((reg = readl(host->reg_base + reg_off)) & SDXC_CAL_DONE)) { -- if (time_before(jiffies, timeout)) -- cpu_relax(); -- else { -- reg &= ~SDXC_CAL_START; -- writel(reg, host->reg_base + reg_off); -- -- return -ETIMEDOUT; -- } -- } -- -- delay = (reg >> SDXC_CAL_DL_SHIFT) & SDXC_CAL_DL_MASK; -- -- reg &= ~SDXC_CAL_START; -- reg |= (delay << SDXC_CAL_DL_SW_SHIFT) | SDXC_CAL_DL_SW_EN; -- -- writel(reg, host->reg_base + reg_off); -- -- dev_dbg(mmc_dev(host->mmc), "calibration ended, reg is 0x%x\n", reg); -+ /* -+ * FIXME: -+ * This is not clear how the calibration is supposed to work -+ * yet. The best rate have been obtained by simply setting the -+ * delay to 0, as Allwinner does in its BSP. -+ * -+ * The only mode that doesn't have such a delay is HS400, that -+ * is in itself a TODO. -+ */ -+ writel(SDXC_CAL_DL_SW_EN, host->reg_base + reg_off); - - return 0; - } -@@ -745,6 +740,7 @@ static int sunxi_mmc_clk_set_phase(struc - index = SDXC_CLK_50M_DDR; - } - } else { -+ dev_dbg(mmc_dev(host->mmc), "Invalid clock... returning\n"); - return -EINVAL; - } - -@@ -757,10 +753,21 @@ static int sunxi_mmc_clk_set_phase(struc - static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host, - struct mmc_ios *ios) - { -+ struct mmc_host *mmc = host->mmc; - long rate; - u32 rval, clock = ios->clock; - int ret; - -+ ret = sunxi_mmc_oclk_onoff(host, 0); -+ if (ret) -+ return ret; -+ -+ /* Our clock is gated now */ -+ mmc->actual_clock = 0; -+ -+ if (!ios->clock) -+ return 0; -+ - /* 8 bit DDR requires a higher module clock */ - if (ios->timing == MMC_TIMING_MMC_DDR52 && - ios->bus_width == MMC_BUS_WIDTH_8) -@@ -768,25 +775,21 @@ static int sunxi_mmc_clk_set_rate(struct - - rate = clk_round_rate(host->clk_mmc, clock); - if (rate < 0) { -- dev_err(mmc_dev(host->mmc), "error rounding clk to %d: %ld\n", -+ dev_err(mmc_dev(mmc), "error rounding clk to %d: %ld\n", - clock, rate); - return rate; - } -- dev_dbg(mmc_dev(host->mmc), "setting clk to %d, rounded %ld\n", -+ dev_dbg(mmc_dev(mmc), "setting clk to %d, rounded %ld\n", - clock, rate); - - /* setting clock rate */ - ret = clk_set_rate(host->clk_mmc, rate); - if (ret) { -- dev_err(mmc_dev(host->mmc), "error setting clk to %ld: %d\n", -+ dev_err(mmc_dev(mmc), "error setting clk to %ld: %d\n", - rate, ret); - return ret; - } - -- ret = sunxi_mmc_oclk_onoff(host, 0); -- if (ret) -- return ret; -- - /* clear internal divider */ - rval = mmc_readl(host, REG_CLKCR); - rval &= ~0xff; -@@ -798,6 +801,13 @@ static int sunxi_mmc_clk_set_rate(struct - } - mmc_writel(host, REG_CLKCR, rval); - -+ if (host->cfg->needs_new_timings) { -+ /* Don't touch the delay bits */ -+ rval = mmc_readl(host, REG_SD_NTSR); -+ rval |= SDXC_2X_TIMING_MODE; -+ mmc_writel(host, REG_SD_NTSR, rval); -+ } -+ - ret = sunxi_mmc_clk_set_phase(host, ios, rate); - if (ret) - return ret; -@@ -806,9 +816,22 @@ static int sunxi_mmc_clk_set_rate(struct - if (ret) - return ret; - -- /* TODO: enable calibrate on sdc2 SDXC_REG_DS_DL_REG of A64 */ -+ /* -+ * FIXME: -+ * -+ * In HS400 we'll also need to calibrate the data strobe -+ * signal. This should only happen on the MMC2 controller (at -+ * least on the A64). -+ */ -+ -+ ret = sunxi_mmc_oclk_onoff(host, 1); -+ if (ret) -+ return ret; - -- return sunxi_mmc_oclk_onoff(host, 1); -+ /* And we just enabled our clock back */ -+ mmc->actual_clock = rate; -+ -+ return 0; - } - - static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) -@@ -822,10 +845,13 @@ static void sunxi_mmc_set_ios(struct mmc - break; - - case MMC_POWER_UP: -- host->ferror = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, -- ios->vdd); -- if (host->ferror) -- return; -+ if (!IS_ERR(mmc->supply.vmmc)) { -+ host->ferror = mmc_regulator_set_ocr(mmc, -+ mmc->supply.vmmc, -+ ios->vdd); -+ if (host->ferror) -+ return; -+ } - - if (!IS_ERR(mmc->supply.vqmmc)) { - host->ferror = regulator_enable(mmc->supply.vqmmc); -@@ -847,7 +873,9 @@ static void sunxi_mmc_set_ios(struct mmc - case MMC_POWER_OFF: - dev_dbg(mmc_dev(mmc), "power off!\n"); - sunxi_mmc_reset_host(host); -- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); -+ if (!IS_ERR(mmc->supply.vmmc)) -+ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); -+ - if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) - regulator_disable(mmc->supply.vqmmc); - host->vqmmc_enabled = false; -@@ -877,7 +905,7 @@ static void sunxi_mmc_set_ios(struct mmc - mmc_writel(host, REG_GCTRL, rval); - - /* set up clock */ -- if (ios->clock && ios->power_mode) { -+ if (ios->power_mode) { - host->ferror = sunxi_mmc_clk_set_rate(host, ios); - /* Android code had a usleep_range(50000, 55000); here */ - } -@@ -1084,6 +1112,14 @@ static const struct sunxi_mmc_cfg sun50i - .idma_des_size_bits = 16, - .clk_delays = NULL, - .can_calibrate = true, -+ .mask_data0 = true, -+ .needs_new_timings = true, -+}; -+ -+static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = { -+ .idma_des_size_bits = 13, -+ .clk_delays = NULL, -+ .can_calibrate = true, - }; - - static const struct of_device_id sunxi_mmc_of_match[] = { -@@ -1092,6 +1128,7 @@ static const struct of_device_id sunxi_m - { .compatible = "allwinner,sun7i-a20-mmc", .data = &sun7i_a20_cfg }, - { .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg }, - { .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg }, -+ { .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg }, - { /* sentinel */ } - }; - MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match); diff --git a/target/linux/sunxi/patches-4.9/115-musb-ignore-vbus-errors.patch b/target/linux/sunxi/patches-4.9/115-musb-ignore-vbus-errors.patch deleted file mode 100644 index 460aec078c3..00000000000 --- a/target/linux/sunxi/patches-4.9/115-musb-ignore-vbus-errors.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fce20ac5d8c98f1a8ea5298051d9fa669e455f04 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 4 Aug 2015 23:22:45 +0200 -Subject: [PATCH] musb: sunxi: Ignore VBus errors in host-only mode - -For some unclear reason sometimes we get VBus errors in host-only mode, -even though we do not have any vbus-detection then. Ignore these. - -Signed-off-by: Hans de Goede ---- - drivers/usb/musb/sunxi.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/usb/musb/sunxi.c -+++ b/drivers/usb/musb/sunxi.c -@@ -202,6 +202,10 @@ static irqreturn_t sunxi_musb_interrupt( - musb_writeb(musb->mregs, MUSB_FADDR, 0); - } - -+ /* Ignore Vbus errors when in host only mode */ -+ if (musb->port_mode == MUSB_PORT_MODE_HOST) -+ musb->int_usb &= ~MUSB_INTR_VBUSERROR; -+ - musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX); - if (musb->int_tx) - writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX); diff --git a/target/linux/sunxi/patches-4.9/131-reset-add-h3-resets.patch b/target/linux/sunxi/patches-4.9/131-reset-add-h3-resets.patch deleted file mode 100644 index dee01dc0202..00000000000 --- a/target/linux/sunxi/patches-4.9/131-reset-add-h3-resets.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5f0bb9d0bc545ef53a83f7bd176fdc0736eed8e5 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 27 Oct 2015 17:50:24 +0100 -Subject: [PATCH] reset: sunxi: Add Allwinner H3 bus resets - -The H3 bus resets have some holes between the registers, so we add -an of_xlate() function to skip them according to the datasheet. - -Signed-off-by: Jens Kuske ---- - .../bindings/reset/allwinner,sunxi-clock-reset.txt | 1 + - drivers/reset/reset-sunxi.c | 30 +++++++++++++++++++--- - 2 files changed, 28 insertions(+), 3 deletions(-) - ---- a/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt -+++ b/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt -@@ -8,6 +8,7 @@ Required properties: - - compatible: Should be one of the following: - "allwinner,sun6i-a31-ahb1-reset" - "allwinner,sun6i-a31-clock-reset" -+ "allwinner,sun8i-h3-bus-reset" - - reg: should be register base and length as documented in the - datasheet - - #reset-cells: 1, see below ---- a/drivers/reset/reset-sunxi.c -+++ b/drivers/reset/reset-sunxi.c -@@ -75,7 +75,9 @@ static const struct reset_control_ops su - .deassert = sunxi_reset_deassert, - }; - --static int sunxi_reset_init(struct device_node *np) -+static int sunxi_reset_init(struct device_node *np, -+ int (*of_xlate)(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec)) - { - struct sunxi_reset_data *data; - struct resource res; -@@ -108,6 +110,7 @@ static int sunxi_reset_init(struct devic - data->rcdev.nr_resets = size * 32; - data->rcdev.ops = &sunxi_reset_ops; - data->rcdev.of_node = np; -+ data->rcdev.of_xlate = of_xlate; - - return reset_controller_register(&data->rcdev); - -@@ -116,6 +119,21 @@ err_alloc: - return ret; - }; - -+static int sun8i_h3_bus_reset_xlate(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec) -+{ -+ unsigned int index = reset_spec->args[0]; -+ -+ if (index < 96) -+ return index; -+ else if (index < 128) -+ return index + 32; -+ else if (index < 160) -+ return index + 64; -+ else -+ return -EINVAL; -+} -+ - /* - * These are the reset controller we need to initialize early on in - * our system, before we can even think of using a regular device -@@ -123,15 +141,21 @@ err_alloc: - */ - static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = { - { .compatible = "allwinner,sun6i-a31-ahb1-reset", }, -+ { .compatible = "allwinner,sun8i-h3-bus-reset", .data = sun8i_h3_bus_reset_xlate, }, - { /* sentinel */ }, - }; - - void __init sun6i_reset_init(void) - { - struct device_node *np; -- -- for_each_matching_node(np, sunxi_early_reset_dt_ids) -- sunxi_reset_init(np); -+ const struct of_device_id *match; -+ int (*of_xlate)(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec); -+ -+ for_each_matching_node_and_match(np, sunxi_early_reset_dt_ids, &match) { -+ of_xlate = match->data; -+ sunxi_reset_init(np, of_xlate); -+ } - } - - /* diff --git a/target/linux/sunxi/patches-4.9/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch b/target/linux/sunxi/patches-4.9/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch deleted file mode 100644 index 7e92a565fa9..00000000000 --- a/target/linux/sunxi/patches-4.9/200-ARM-dts-sunxi-add-support-for-Orange-Pi-R1-board.patch +++ /dev/null @@ -1,196 +0,0 @@ -From daf75255fb67bf44db178e4c95a803b7972ed670 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 26 Sep 2017 22:29:06 +0200 -Subject: ARM: dts: sunxi: add support for Orange Pi R1 board - -Signed-off-by: Hauke Mehrtens ---- - arch/arm/boot/dts/Makefile | 1 + - arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts | 171 ++++++++++++++++++++++++ - 2 files changed, 172 insertions(+) - create mode 100644 arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -819,6 +819,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ - sun8i-a33-sinlinx-sina33.dtb \ - sun8i-a83t-allwinner-h8homlet-v2.dtb \ - sun8i-a83t-cubietruck-plus.dtb \ -+ sun8i-h2-plus-orangepi-r1.dtb \ - sun8i-h3-bananapi-m2-plus.dtb \ - sun8i-h3-nanopi-neo.dtb \ - sun8i-h3-orangepi-2.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h2-plus-orangepi-r1.dts -@@ -0,0 +1,171 @@ -+/* -+ * Copyright (C) 2017 Hauke Mehrtens -+ * -+ * Based on sun8i-h2-plus-orangepi-zero.dts, which is: -+ * Copyright (C) 2016 Icenowy Zheng -+ * -+ * Based on sun8i-h3-orangepi-one.dts, which is: -+ * Copyright (C) 2016 Hans de Goede -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun8i-h3.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "Xunlong Orange Pi R1"; -+ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; -+ -+ aliases { -+ serial0 = &uart0; -+ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ -+ ethernet0 = &emac; -+ ethernet1 = &xr819; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ pwr_led { -+ label = "orangepi:green:pwr"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ -+ status_led { -+ label = "orangepi:red:status"; -+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ reg_vcc_wifi: reg_vcc_wifi { -+ compatible = "regulator-fixed"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+ enable-active-high; -+ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ wifi_pwrseq: wifi_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; -+ post-power-on-delay-ms = <200>; -+ }; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&emac { -+ phy-handle = <&int_mii_phy>; -+ phy-mode = "mii"; -+ allwinner,leds-active-low; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc1_pins_a>; -+ vmmc-supply = <®_vcc_wifi>; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ /* -+ * Explicitly define the sdio device, so that we can add an ethernet -+ * alias for it (which e.g. makes u-boot set a mac-address). -+ */ -+ xr819: sdio_wifi@1 { -+ reg = <1>; -+ }; -+}; -+ -+&mmc1_pins_a { -+ bias-pull-up; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&uart1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart1_pins>; -+ status = "disabled"; -+}; -+ -+&uart2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart2_pins>; -+ status = "disabled"; -+}; -+ -+&usbphy { -+ /* USB VBUS is always on */ -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch b/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch deleted file mode 100644 index d0ee8edd14a..00000000000 --- a/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 2ed2388bc0c5b7d04c7b079d673ce61a0333c818 Mon Sep 17 00:00:00 2001 -From: Jagan Teki -Date: Tue, 30 May 2017 17:42:50 +0000 -Subject: ARM: dts: sun8i: h3: Add initial NanoPi M1 Plus support - -Backported support from kernel 4.13 with the following changes: -- Added WiFi node -- Added Ethernet node -- Added eMMC node - -Original commit message: -NanoPi M1 Plus is designed and developed by FriendlyElec -for professionals, enterprise users, makers and hobbyists -using the Allwinner H3 SOC. - -NanoPi M1 Plus key features -- Allwinner H3, Quad-core Cortex-A7@1.2GHz -- 1GB DDR3 RAM -- 8GB eMMC -- microSD slot -- 10/100/1000M Ethernet -- Serial Debug Port -- 5V 2A DC power-supply - -Signed-off-by: Jagan Teki -Signed-off-by: Maxime Ripard ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -821,6 +821,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ - sun8i-a83t-cubietruck-plus.dtb \ - sun8i-h2-plus-orangepi-r1.dtb \ - sun8i-h3-bananapi-m2-plus.dtb \ -+ sun8i-h3-nanopi-m1-plus.dtb \ - sun8i-h3-nanopi-neo.dtb \ - sun8i-h3-orangepi-2.dtb \ - sun8i-h3-orangepi-lite.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts -@@ -0,0 +1,129 @@ -+/* -+ * Copyright (C) 2017 Jagan Teki -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "sun8i-h3-nanopi.dtsi" -+ -+/ { -+ model = "FriendlyArm NanoPi M1 Plus"; -+ compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3"; -+ -+ aliases { -+ ethernet0 = &emac; -+ }; -+ -+ pwrseq_wifi: pwrseq0 { -+ compatible = "mmc-pwrseq-simple"; -+ pinctrl-names = "default"; -+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ -+ }; -+ -+ reg_gmac_3v3: gmac-3v3 { -+ compatible = "regulator-fixed"; -+ regulator-name = "gmac-3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <100000>; -+ enable-active-high; -+ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ -+ }; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ehci2 { -+ status = "okay"; -+}; -+ -+&emac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&emac_rgmii_pins>; -+ phy-supply = <®_gmac_3v3>; -+ phy-handle = <&ext_rgmii_phy>; -+ phy-mode = "rgmii"; -+ status = "okay"; -+}; -+ -+&mdio { -+ ext_rgmii_phy: ethernet-phy@7 { -+ compatible = "ethernet-phy-ieee802.3-c22"; -+ reg = <7>; -+ }; -+}; -+ -+&mmc1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc1_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ vqmmc-supply = <®_vcc3v3>; -+ mmc-pwrseq = <&pwrseq_wifi>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ brcmf: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ interrupt-parent = <&pio>; -+ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ -+ interrupt-names = "host-wake"; -+ }; -+}; -+ -+&mmc2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc2_8bit_pins>; -+ vmmc-supply = <®_vcc3v3>; -+ vqmmc-supply = <®_vcc3v3>; -+ bus-width = <8>; -+ non-removable; -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&ohci2 { -+ status = "okay"; -+}; From 6f388adef82057675c61b24afb7b2e0d8136c3fd Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 14 Nov 2018 12:32:49 +0100 Subject: [PATCH 086/399] kernel: bump 4.9 to 4.9.137 Refreshed all patches. Removed upstreamed hunks: - 703-phy-support-layerscape.patch Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...Define-standard-pinctrl-groups-in-th.patch | 2 +- ...add-thermal-node-to-device-tree-of-b.patch | 2 +- ...bcm283x-Add-VEC-node-in-bcm283x.dtsi.patch | 2 +- ...smsx95xx-fix-crimes-against-truesize.patch | 4 ++-- ...ental-Enable-turbo_mode-and-packetsi.patch | 2 +- ...ow-mac-address-to-be-set-in-smsc95xx.patch | 4 ++-- ...ect-against-unexpected-TXW-RXR-inter.patch | 4 ++-- ...e-dev_dbg-logging-on-transfer-errors.patch | 2 +- ...m2835-Can-t-support-I2C_M_IGNORE_NAK.patch | 2 +- ...support-for-Repeated-Start-Condition.patch | 6 ++--- ...35-Support-i2c-dev-ioctl-I2C_TIMEOUT.patch | 2 +- ...cm2835-Add-support-for-dynamic-clock.patch | 8 +++---- ...0-0113-i2c-bcm2835-Add-debug-support.patch | 6 ++--- ...i-bcm2835-Disable-forced-software-CS.patch | 2 +- ...-Add-the-DSI-module-nodes-and-clocks.patch | 6 ++--- .../patches-4.9/940-bcm47xx-yenta.patch | 8 +++---- .../021-bridge-multicast-to-unicast.patch | 24 +++++++++---------- ...kb_cow_head-to-deal-with-cloned-skbs.patch | 2 +- ...Macronix-mx25u25635f-to-list-of-know.patch | 2 +- ...mtd-spi-nor-fix-spansion-quad-enable.patch | 2 +- ...-mtd-spi-nor-fix-flags-for-s25fl128s.patch | 2 +- ...td-spi-nor-add-support-for-s25fl208k.patch | 2 +- ...mtd-spi-nor-Add-support-for-N25Q016A.patch | 2 +- ...Add-support-for-S3AN-spi-nor-devices.patch | 14 +++++------ ...spi-nor-improve-macronix_quad_enable.patch | 2 +- ...ve-WARN_ONCE-message-in-spi_nor_writ.patch | 2 +- ...me-SPINOR_OP_-macros-of-the-4-byte-a.patch | 2 +- ...a-stateless-method-to-support-memory.patch | 2 +- ...le-stateless-4b-op-codes-for-mx25u25.patch | 2 +- ...90-net-generalize-napi_complete_done.patch | 4 ++-- ...issing-tunnel-encapsulation-limit-op.patch | 4 ++-- ...25p80-mx-disable-software-protection.patch | 2 +- ...or-fix-Spansion-regressions-aliased-.patch | 4 ++-- ...ort-limiting-4K-sectors-support-base.patch | 2 +- ...pi-nor-Add-Winbond-w25q128jv-support.patch | 2 +- .../477-mtd-add-spi-nor-add-mx25u3235f.patch | 2 +- ...support-for-XM25QH64A-and-XM25QH128A.patch | 2 +- .../530-jffs2_make_lzma_available.patch | 2 +- ...ng-with-source-address-failed-policy.patch | 18 +++++++------- .../810-pci_disable_common_quirks.patch | 2 +- .../401-mtd-spi-nor-support-layerscape.patch | 22 ++++++++--------- .../702-pci-support-layerscape.patch | 2 +- .../703-phy-support-layerscape.patch | 11 --------- .../804-crypto-support-layerscape.patch | 12 +++++----- .../817-usb-support-layerscape.patch | 2 +- 46 files changed, 104 insertions(+), 115 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index d5179572956..09501233ebd 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .135 +LINUX_VERSION-4.9 = .137 LINUX_VERSION-4.14 = .80 -LINUX_KERNEL_HASH-4.9.135 = e023b0bbe9ea7fc56aa57210342dd18ea3e0900ee207226df1523c6d7df154ce +LINUX_KERNEL_HASH-4.9.137 = 6db2512a9094bf4c830124641d1275635600b052962a7db3556da18914ea2589 LINUX_KERNEL_HASH-4.14.80 = 9ddc7bc11cbea6475ac5abf18e01a143d7d506bece591e0dcb15c9452d3ed7d2 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/brcm2708/patches-4.9/031-v4.10-0001-ARM-dts-bcm283x-Define-standard-pinctrl-groups-in-th.patch b/target/linux/brcm2708/patches-4.9/031-v4.10-0001-ARM-dts-bcm283x-Define-standard-pinctrl-groups-in-th.patch index 6173d943d2e..ac9bd2ba03c 100644 --- a/target/linux/brcm2708/patches-4.9/031-v4.10-0001-ARM-dts-bcm283x-Define-standard-pinctrl-groups-in-th.patch +++ b/target/linux/brcm2708/patches-4.9/031-v4.10-0001-ARM-dts-bcm283x-Define-standard-pinctrl-groups-in-th.patch @@ -23,7 +23,7 @@ Acked-by: Stefan Wahren --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -132,6 +132,209 @@ +@@ -137,6 +137,209 @@ interrupt-controller; #interrupt-cells = <2>; diff --git a/target/linux/brcm2708/patches-4.9/031-v4.10-0008-ARM-bcm2835-dts-add-thermal-node-to-device-tree-of-b.patch b/target/linux/brcm2708/patches-4.9/031-v4.10-0008-ARM-bcm2835-dts-add-thermal-node-to-device-tree-of-b.patch index 4c541a76690..e561e058e53 100644 --- a/target/linux/brcm2708/patches-4.9/031-v4.10-0008-ARM-bcm2835-dts-add-thermal-node-to-device-tree-of-b.patch +++ b/target/linux/brcm2708/patches-4.9/031-v4.10-0008-ARM-bcm2835-dts-add-thermal-node-to-device-tree-of-b.patch @@ -51,7 +51,7 @@ Signed-off-by: Eric Anholt +}; --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -390,6 +390,13 @@ +@@ -395,6 +395,13 @@ interrupts = <2 14>; /* pwa1 */ }; diff --git a/target/linux/brcm2708/patches-4.9/032-v4.11-0001-ARM-dts-bcm283x-Add-VEC-node-in-bcm283x.dtsi.patch b/target/linux/brcm2708/patches-4.9/032-v4.11-0001-ARM-dts-bcm283x-Add-VEC-node-in-bcm283x.dtsi.patch index c0d43870eca..17e9b3e3f55 100644 --- a/target/linux/brcm2708/patches-4.9/032-v4.11-0001-ARM-dts-bcm283x-Add-VEC-node-in-bcm283x.dtsi.patch +++ b/target/linux/brcm2708/patches-4.9/032-v4.11-0001-ARM-dts-bcm283x-Add-VEC-node-in-bcm283x.dtsi.patch @@ -13,7 +13,7 @@ Signed-off-by: Eric Anholt --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -476,6 +476,14 @@ +@@ -481,6 +481,14 @@ status = "disabled"; }; diff --git a/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch index a5737e3c835..8916e52741d 100644 --- a/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch @@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1951,7 +1955,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1954,7 +1958,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning return 1; } -@@ -1969,7 +1974,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1972,7 +1977,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ diff --git a/target/linux/brcm2708/patches-4.9/950-0002-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch b/target/linux/brcm2708/patches-4.9/950-0002-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch index fc7ac4d8b9b..763b5c7375c 100644 --- a/target/linux/brcm2708/patches-4.9/950-0002-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch +++ b/target/linux/brcm2708/patches-4.9/950-0002-smsc95xx-Experimental-Enable-turbo_mode-and-packetsi.patch @@ -22,7 +22,7 @@ See: http://forum.kodi.tv/showthread.php?tid=285288 static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1106,13 +1110,13 @@ static int smsc95xx_reset(struct usbnet +@@ -1109,13 +1113,13 @@ static int smsc95xx_reset(struct usbnet if (!turbo_mode) { burst_cap = 0; diff --git a/target/linux/brcm2708/patches-4.9/950-0003-Allow-mac-address-to-be-set-in-smsc95xx.patch b/target/linux/brcm2708/patches-4.9/950-0003-Allow-mac-address-to-be-set-in-smsc95xx.patch index 8075dff2f34..fdf5fc86d70 100644 --- a/target/linux/brcm2708/patches-4.9/950-0003-Allow-mac-address-to-be-set-in-smsc95xx.patch +++ b/target/linux/brcm2708/patches-4.9/950-0003-Allow-mac-address-to-be-set-in-smsc95xx.patch @@ -29,7 +29,7 @@ Signed-off-by: popcornmix static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -918,6 +923,53 @@ static int smsc95xx_ioctl(struct net_dev +@@ -921,6 +926,53 @@ static int smsc95xx_ioctl(struct net_dev return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL); } @@ -83,7 +83,7 @@ Signed-off-by: popcornmix static void smsc95xx_init_mac_address(struct usbnet *dev) { const u8 *mac_addr; -@@ -939,6 +991,10 @@ static void smsc95xx_init_mac_address(st +@@ -942,6 +994,10 @@ static void smsc95xx_init_mac_address(st } } diff --git a/target/linux/brcm2708/patches-4.9/950-0107-i2c-bcm2835-Protect-against-unexpected-TXW-RXR-inter.patch b/target/linux/brcm2708/patches-4.9/950-0107-i2c-bcm2835-Protect-against-unexpected-TXW-RXR-inter.patch index 6646d77944e..0d9b165aba6 100644 --- a/target/linux/brcm2708/patches-4.9/950-0107-i2c-bcm2835-Protect-against-unexpected-TXW-RXR-inter.patch +++ b/target/linux/brcm2708/patches-4.9/950-0107-i2c-bcm2835-Protect-against-unexpected-TXW-RXR-inter.patch @@ -70,7 +70,7 @@ Reviewed-by: Eric Anholt } if (val & BCM2835_I2C_S_DONE) { -@@ -137,21 +141,38 @@ static irqreturn_t bcm2835_i2c_isr(int t +@@ -139,21 +143,38 @@ static irqreturn_t bcm2835_i2c_isr(int t i2c_dev->msg_err = BCM2835_I2C_S_LEN; else i2c_dev->msg_err = 0; @@ -111,7 +111,7 @@ Reviewed-by: Eric Anholt } static int bcm2835_i2c_xfer_msg(struct bcm2835_i2c_dev *i2c_dev, -@@ -181,8 +202,9 @@ static int bcm2835_i2c_xfer_msg(struct b +@@ -183,8 +204,9 @@ static int bcm2835_i2c_xfer_msg(struct b time_left = wait_for_completion_timeout(&i2c_dev->completion, BCM2835_I2C_TIMEOUT); diff --git a/target/linux/brcm2708/patches-4.9/950-0108-i2c-bcm2835-Use-dev_dbg-logging-on-transfer-errors.patch b/target/linux/brcm2708/patches-4.9/950-0108-i2c-bcm2835-Use-dev_dbg-logging-on-transfer-errors.patch index acc2ade0a35..a3c68467be5 100644 --- a/target/linux/brcm2708/patches-4.9/950-0108-i2c-bcm2835-Use-dev_dbg-logging-on-transfer-errors.patch +++ b/target/linux/brcm2708/patches-4.9/950-0108-i2c-bcm2835-Use-dev_dbg-logging-on-transfer-errors.patch @@ -21,7 +21,7 @@ Reviewed-by: Eric Anholt --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -216,7 +216,7 @@ static int bcm2835_i2c_xfer_msg(struct b +@@ -218,7 +218,7 @@ static int bcm2835_i2c_xfer_msg(struct b (msg->flags & I2C_M_IGNORE_NAK)) return 0; diff --git a/target/linux/brcm2708/patches-4.9/950-0109-i2c-bcm2835-Can-t-support-I2C_M_IGNORE_NAK.patch b/target/linux/brcm2708/patches-4.9/950-0109-i2c-bcm2835-Can-t-support-I2C_M_IGNORE_NAK.patch index a913c50082b..65bf08fe8a9 100644 --- a/target/linux/brcm2708/patches-4.9/950-0109-i2c-bcm2835-Can-t-support-I2C_M_IGNORE_NAK.patch +++ b/target/linux/brcm2708/patches-4.9/950-0109-i2c-bcm2835-Can-t-support-I2C_M_IGNORE_NAK.patch @@ -31,7 +31,7 @@ Reviewed-by: Eric Anholt --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -212,10 +212,6 @@ static int bcm2835_i2c_xfer_msg(struct b +@@ -214,10 +214,6 @@ static int bcm2835_i2c_xfer_msg(struct b if (likely(!i2c_dev->msg_err)) return 0; diff --git a/target/linux/brcm2708/patches-4.9/950-0110-i2c-bcm2835-Add-support-for-Repeated-Start-Condition.patch b/target/linux/brcm2708/patches-4.9/950-0110-i2c-bcm2835-Add-support-for-Repeated-Start-Condition.patch index 0cd5aa46934..9ae16e426ae 100644 --- a/target/linux/brcm2708/patches-4.9/950-0110-i2c-bcm2835-Add-support-for-Repeated-Start-Condition.patch +++ b/target/linux/brcm2708/patches-4.9/950-0110-i2c-bcm2835-Add-support-for-Repeated-Start-Condition.patch @@ -86,7 +86,7 @@ Acked-by: Eric Anholt * Note about I2C_C_CLEAR on error: * The I2C_C_CLEAR on errors will take some time to resolve -- if you were in * non-idle state and I2C_C_READ, it sets an abort_rx flag and runs through -@@ -151,6 +191,12 @@ static irqreturn_t bcm2835_i2c_isr(int t +@@ -153,6 +193,12 @@ static irqreturn_t bcm2835_i2c_isr(int t } bcm2835_fill_txfifo(i2c_dev); @@ -99,7 +99,7 @@ Acked-by: Eric Anholt return IRQ_HANDLED; } -@@ -175,30 +221,25 @@ complete: +@@ -177,30 +223,25 @@ complete: return IRQ_HANDLED; } @@ -144,7 +144,7 @@ Acked-by: Eric Anholt time_left = wait_for_completion_timeout(&i2c_dev->completion, BCM2835_I2C_TIMEOUT); -@@ -209,31 +250,15 @@ static int bcm2835_i2c_xfer_msg(struct b +@@ -211,31 +252,15 @@ static int bcm2835_i2c_xfer_msg(struct b return -ETIMEDOUT; } diff --git a/target/linux/brcm2708/patches-4.9/950-0111-i2c-bcm2835-Support-i2c-dev-ioctl-I2C_TIMEOUT.patch b/target/linux/brcm2708/patches-4.9/950-0111-i2c-bcm2835-Support-i2c-dev-ioctl-I2C_TIMEOUT.patch index 07016d97822..d939c1d6f8e 100644 --- a/target/linux/brcm2708/patches-4.9/950-0111-i2c-bcm2835-Support-i2c-dev-ioctl-I2C_TIMEOUT.patch +++ b/target/linux/brcm2708/patches-4.9/950-0111-i2c-bcm2835-Support-i2c-dev-ioctl-I2C_TIMEOUT.patch @@ -26,7 +26,7 @@ Reviewed-by: Eric Anholt struct bcm2835_i2c_dev { struct device *dev; void __iomem *regs; -@@ -242,7 +240,7 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -244,7 +242,7 @@ static int bcm2835_i2c_xfer(struct i2c_a bcm2835_i2c_start_transfer(i2c_dev); time_left = wait_for_completion_timeout(&i2c_dev->completion, diff --git a/target/linux/brcm2708/patches-4.9/950-0112-i2c-bcm2835-Add-support-for-dynamic-clock.patch b/target/linux/brcm2708/patches-4.9/950-0112-i2c-bcm2835-Add-support-for-dynamic-clock.patch index afe2b2297c6..d287ae2cb77 100644 --- a/target/linux/brcm2708/patches-4.9/950-0112-i2c-bcm2835-Add-support-for-dynamic-clock.patch +++ b/target/linux/brcm2708/patches-4.9/950-0112-i2c-bcm2835-Add-support-for-dynamic-clock.patch @@ -56,7 +56,7 @@ Reviewed-by: Martin Sperl static void bcm2835_fill_txfifo(struct bcm2835_i2c_dev *i2c_dev) { u32 val; -@@ -224,7 +249,7 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -226,7 +251,7 @@ static int bcm2835_i2c_xfer(struct i2c_a { struct bcm2835_i2c_dev *i2c_dev = i2c_get_adapdata(adap); unsigned long time_left; @@ -65,7 +65,7 @@ Reviewed-by: Martin Sperl for (i = 0; i < (num - 1); i++) if (msgs[i].flags & I2C_M_RD) { -@@ -233,6 +258,10 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -235,6 +260,10 @@ static int bcm2835_i2c_xfer(struct i2c_a return -EOPNOTSUPP; } @@ -76,7 +76,7 @@ Reviewed-by: Martin Sperl i2c_dev->curr_msg = msgs; i2c_dev->num_msgs = num; reinit_completion(&i2c_dev->completion); -@@ -282,7 +311,6 @@ static int bcm2835_i2c_probe(struct plat +@@ -284,7 +313,6 @@ static int bcm2835_i2c_probe(struct plat { struct bcm2835_i2c_dev *i2c_dev; struct resource *mem, *irq; @@ -84,7 +84,7 @@ Reviewed-by: Martin Sperl int ret; struct i2c_adapter *adap; -@@ -306,28 +334,13 @@ static int bcm2835_i2c_probe(struct plat +@@ -308,28 +336,13 @@ static int bcm2835_i2c_probe(struct plat } ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency", diff --git a/target/linux/brcm2708/patches-4.9/950-0113-i2c-bcm2835-Add-debug-support.patch b/target/linux/brcm2708/patches-4.9/950-0113-i2c-bcm2835-Add-debug-support.patch index f69a48f623c..8e31bcc5e7a 100644 --- a/target/linux/brcm2708/patches-4.9/950-0113-i2c-bcm2835-Add-debug-support.patch +++ b/target/linux/brcm2708/patches-4.9/950-0113-i2c-bcm2835-Add-debug-support.patch @@ -151,7 +151,7 @@ Signed-off-by: Noralf Trønnes err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR); if (err) { -@@ -251,6 +335,13 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -253,6 +337,13 @@ static int bcm2835_i2c_xfer(struct i2c_a unsigned long time_left; int i, ret; @@ -165,7 +165,7 @@ Signed-off-by: Noralf Trønnes for (i = 0; i < (num - 1); i++) if (msgs[i].flags & I2C_M_RD) { dev_warn_once(i2c_dev->dev, -@@ -270,6 +361,10 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -272,6 +363,10 @@ static int bcm2835_i2c_xfer(struct i2c_a time_left = wait_for_completion_timeout(&i2c_dev->completion, adap->timeout); @@ -176,7 +176,7 @@ Signed-off-by: Noralf Trønnes if (!time_left) { bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -@@ -280,7 +375,9 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -282,7 +377,9 @@ static int bcm2835_i2c_xfer(struct i2c_a if (!i2c_dev->msg_err) return num; diff --git a/target/linux/brcm2708/patches-4.9/950-0126-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/brcm2708/patches-4.9/950-0126-spi-bcm2835-Disable-forced-software-CS.patch index 34acd201ba0..1d2bd29ab6b 100644 --- a/target/linux/brcm2708/patches-4.9/950-0126-spi-bcm2835-Disable-forced-software-CS.patch +++ b/target/linux/brcm2708/patches-4.9/950-0126-spi-bcm2835-Disable-forced-software-CS.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -366,6 +366,7 @@ +@@ -371,6 +371,7 @@ #address-cells = <1>; #size-cells = <0>; status = "disabled"; diff --git a/target/linux/brcm2708/patches-4.9/950-0160-ARM-bcm2835-dt-Add-the-DSI-module-nodes-and-clocks.patch b/target/linux/brcm2708/patches-4.9/950-0160-ARM-bcm2835-dt-Add-the-DSI-module-nodes-and-clocks.patch index 00703579e50..285a7b35303 100644 --- a/target/linux/brcm2708/patches-4.9/950-0160-ARM-bcm2835-dt-Add-the-DSI-module-nodes-and-clocks.patch +++ b/target/linux/brcm2708/patches-4.9/950-0160-ARM-bcm2835-dt-Add-the-DSI-module-nodes-and-clocks.patch @@ -28,7 +28,7 @@ Signed-off-by: Eric Anholt +}; --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi -@@ -93,10 +93,13 @@ +@@ -98,10 +98,13 @@ #clock-cells = <1>; reg = <0x7e101000 0x2000>; @@ -45,7 +45,7 @@ Signed-off-by: Eric Anholt }; rng@7e104000 { -@@ -398,6 +401,26 @@ +@@ -403,6 +406,26 @@ status = "disabled"; }; @@ -72,7 +72,7 @@ Signed-off-by: Eric Anholt aux: aux@0x7e215000 { compatible = "brcm,bcm2835-aux"; #clock-cells = <1>; -@@ -457,6 +480,26 @@ +@@ -462,6 +485,26 @@ interrupts = <2 1>; }; diff --git a/target/linux/brcm47xx/patches-4.9/940-bcm47xx-yenta.patch b/target/linux/brcm47xx/patches-4.9/940-bcm47xx-yenta.patch index 00a44d6317d..bda27d16c4a 100644 --- a/target/linux/brcm47xx/patches-4.9/940-bcm47xx-yenta.patch +++ b/target/linux/brcm47xx/patches-4.9/940-bcm47xx-yenta.patch @@ -1,6 +1,6 @@ --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c -@@ -919,6 +919,8 @@ static unsigned int yenta_probe_irq(stru +@@ -920,6 +920,8 @@ static unsigned int yenta_probe_irq(stru * Probe for usable interrupts using the force * register to generate bogus card status events. */ @@ -9,7 +9,7 @@ cb_writel(socket, CB_SOCKET_EVENT, -1); cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); reg = exca_readb(socket, I365_CSCINT); -@@ -934,6 +936,7 @@ static unsigned int yenta_probe_irq(stru +@@ -935,6 +937,7 @@ static unsigned int yenta_probe_irq(stru } cb_writel(socket, CB_SOCKET_MASK, 0); exca_writeb(socket, I365_CSCINT, reg); @@ -17,7 +17,7 @@ mask = probe_irq_mask(val) & 0xffff; -@@ -1018,6 +1021,10 @@ static void yenta_get_socket_capabilitie +@@ -1019,6 +1022,10 @@ static void yenta_get_socket_capabilitie else socket->socket.irq_mask = 0; @@ -28,7 +28,7 @@ dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n", socket->socket.irq_mask, socket->cb_irq); } -@@ -1250,6 +1257,15 @@ static int yenta_probe(struct pci_dev *d +@@ -1251,6 +1258,15 @@ static int yenta_probe(struct pci_dev *d dev_info(&dev->dev, "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); diff --git a/target/linux/generic/backport-4.9/021-bridge-multicast-to-unicast.patch b/target/linux/generic/backport-4.9/021-bridge-multicast-to-unicast.patch index 1886b01cf1c..7c36a767c74 100644 --- a/target/linux/generic/backport-4.9/021-bridge-multicast-to-unicast.patch +++ b/target/linux/generic/backport-4.9/021-bridge-multicast-to-unicast.patch @@ -285,7 +285,7 @@ Signed-off-by: Linus Lüssing if (err) break; } -@@ -1458,7 +1495,8 @@ br_multicast_leave_group(struct net_brid +@@ -1465,7 +1502,8 @@ br_multicast_leave_group(struct net_brid struct net_bridge_port *port, struct br_ip *group, struct bridge_mcast_other_query *other_query, @@ -295,7 +295,7 @@ Signed-off-by: Linus Lüssing { struct net_bridge_mdb_htable *mdb; struct net_bridge_mdb_entry *mp; -@@ -1482,7 +1520,7 @@ br_multicast_leave_group(struct net_brid +@@ -1489,7 +1527,7 @@ br_multicast_leave_group(struct net_brid for (pp = &mp->ports; (p = mlock_dereference(*pp, br)) != NULL; pp = &p->next) { @@ -304,7 +304,7 @@ Signed-off-by: Linus Lüssing continue; rcu_assign_pointer(*pp, p->next); -@@ -1513,7 +1551,7 @@ br_multicast_leave_group(struct net_brid +@@ -1520,7 +1558,7 @@ br_multicast_leave_group(struct net_brid for (p = mlock_dereference(mp->ports, br); p != NULL; p = mlock_dereference(p->next, br)) { @@ -313,7 +313,7 @@ Signed-off-by: Linus Lüssing continue; if (!hlist_unhashed(&p->mglist) && -@@ -1564,7 +1602,8 @@ out: +@@ -1571,7 +1609,8 @@ out: static void br_ip4_multicast_leave_group(struct net_bridge *br, struct net_bridge_port *port, __be32 group, @@ -323,7 +323,7 @@ Signed-off-by: Linus Lüssing { struct br_ip br_group; struct bridge_mcast_own_query *own_query; -@@ -1579,14 +1618,15 @@ static void br_ip4_multicast_leave_group +@@ -1586,14 +1625,15 @@ static void br_ip4_multicast_leave_group br_group.vid = vid; br_multicast_leave_group(br, port, &br_group, &br->ip4_other_query, @@ -341,7 +341,7 @@ Signed-off-by: Linus Lüssing { struct br_ip br_group; struct bridge_mcast_own_query *own_query; -@@ -1601,7 +1641,7 @@ static void br_ip6_multicast_leave_group +@@ -1608,7 +1648,7 @@ static void br_ip6_multicast_leave_group br_group.vid = vid; br_multicast_leave_group(br, port, &br_group, &br->ip6_other_query, @@ -350,7 +350,7 @@ Signed-off-by: Linus Lüssing } #endif -@@ -1644,6 +1684,7 @@ static int br_multicast_ipv4_rcv(struct +@@ -1651,6 +1691,7 @@ static int br_multicast_ipv4_rcv(struct u16 vid) { struct sk_buff *skb_trimmed = NULL; @@ -358,7 +358,7 @@ Signed-off-by: Linus Lüssing struct igmphdr *ih; int err; -@@ -1659,13 +1700,14 @@ static int br_multicast_ipv4_rcv(struct +@@ -1666,13 +1707,14 @@ static int br_multicast_ipv4_rcv(struct } ih = igmp_hdr(skb); @@ -374,7 +374,7 @@ Signed-off-by: Linus Lüssing break; case IGMPV3_HOST_MEMBERSHIP_REPORT: err = br_ip4_multicast_igmp3_report(br, port, skb_trimmed, vid); -@@ -1674,7 +1716,7 @@ static int br_multicast_ipv4_rcv(struct +@@ -1681,7 +1723,7 @@ static int br_multicast_ipv4_rcv(struct err = br_ip4_multicast_query(br, port, skb_trimmed, vid); break; case IGMP_HOST_LEAVE_MESSAGE: @@ -383,7 +383,7 @@ Signed-off-by: Linus Lüssing break; } -@@ -1694,6 +1736,7 @@ static int br_multicast_ipv6_rcv(struct +@@ -1701,6 +1743,7 @@ static int br_multicast_ipv6_rcv(struct u16 vid) { struct sk_buff *skb_trimmed = NULL; @@ -391,7 +391,7 @@ Signed-off-by: Linus Lüssing struct mld_msg *mld; int err; -@@ -1713,8 +1756,10 @@ static int br_multicast_ipv6_rcv(struct +@@ -1720,8 +1763,10 @@ static int br_multicast_ipv6_rcv(struct switch (mld->mld_type) { case ICMPV6_MGM_REPORT: @@ -403,7 +403,7 @@ Signed-off-by: Linus Lüssing break; case ICMPV6_MLD2_REPORT: err = br_ip6_multicast_mld2_report(br, port, skb_trimmed, vid); -@@ -1723,7 +1768,8 @@ static int br_multicast_ipv6_rcv(struct +@@ -1730,7 +1775,8 @@ static int br_multicast_ipv6_rcv(struct err = br_ip6_multicast_query(br, port, skb_trimmed, vid); break; case ICMPV6_MGM_REDUCTION: diff --git a/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch index cfc9abb3b7f..c665900dc4d 100644 --- a/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch +++ b/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c -@@ -2001,13 +2001,13 @@ static struct sk_buff *smsc95xx_tx_fixup +@@ -2004,13 +2004,13 @@ static struct sk_buff *smsc95xx_tx_fixup /* We do not advertise SG, so skbs should be already linearized */ BUG_ON(skb_shinfo(skb)->nr_frags); diff --git a/target/linux/generic/backport-4.9/061-v4.10-0001-mtd-spi-nor-add-Macronix-mx25u25635f-to-list-of-know.patch b/target/linux/generic/backport-4.9/061-v4.10-0001-mtd-spi-nor-add-Macronix-mx25u25635f-to-list-of-know.patch index 54f950036b2..a70d827782f 100644 --- a/target/linux/generic/backport-4.9/061-v4.10-0001-mtd-spi-nor-add-Macronix-mx25u25635f-to-list-of-know.patch +++ b/target/linux/generic/backport-4.9/061-v4.10-0001-mtd-spi-nor-add-Macronix-mx25u25635f-to-list-of-know.patch @@ -12,7 +12,7 @@ Signed-off-by: Cyrille Pitchen --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -872,6 +872,7 @@ static const struct flash_info spi_nor_i +@@ -878,6 +878,7 @@ static const struct flash_info spi_nor_i { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, 0) }, diff --git a/target/linux/generic/backport-4.9/061-v4.10-0002-mtd-spi-nor-fix-spansion-quad-enable.patch b/target/linux/generic/backport-4.9/061-v4.10-0002-mtd-spi-nor-fix-spansion-quad-enable.patch index c5e29c7c1f2..e4563ebeb6d 100644 --- a/target/linux/generic/backport-4.9/061-v4.10-0002-mtd-spi-nor-fix-spansion-quad-enable.patch +++ b/target/linux/generic/backport-4.9/061-v4.10-0002-mtd-spi-nor-fix-spansion-quad-enable.patch @@ -26,7 +26,7 @@ Signed-off-by: Cyrille Pitchen --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1263,6 +1263,13 @@ static int spansion_quad_enable(struct s +@@ -1269,6 +1269,13 @@ static int spansion_quad_enable(struct s return ret; } diff --git a/target/linux/generic/backport-4.9/061-v4.10-0003-mtd-spi-nor-fix-flags-for-s25fl128s.patch b/target/linux/generic/backport-4.9/061-v4.10-0003-mtd-spi-nor-fix-flags-for-s25fl128s.patch index 9c4e10d022f..76c5d2d9712 100644 --- a/target/linux/generic/backport-4.9/061-v4.10-0003-mtd-spi-nor-fix-flags-for-s25fl128s.patch +++ b/target/linux/generic/backport-4.9/061-v4.10-0003-mtd-spi-nor-fix-flags-for-s25fl128s.patch @@ -17,7 +17,7 @@ Signed-off-by: Cyrille Pitchen --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -906,7 +906,7 @@ static const struct flash_info spi_nor_i +@@ -912,7 +912,7 @@ static const struct flash_info spi_nor_i { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) }, { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) }, { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) }, diff --git a/target/linux/generic/backport-4.9/061-v4.10-0004-mtd-spi-nor-add-support-for-s25fl208k.patch b/target/linux/generic/backport-4.9/061-v4.10-0004-mtd-spi-nor-add-support-for-s25fl208k.patch index 955e5bb2d4f..004c1c51519 100644 --- a/target/linux/generic/backport-4.9/061-v4.10-0004-mtd-spi-nor-add-support-for-s25fl208k.patch +++ b/target/linux/generic/backport-4.9/061-v4.10-0004-mtd-spi-nor-add-support-for-s25fl208k.patch @@ -13,7 +13,7 @@ Signed-off-by: Cyrille Pitchen --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -922,6 +922,7 @@ static const struct flash_info spi_nor_i +@@ -928,6 +928,7 @@ static const struct flash_info spi_nor_i { "s25fl132k", INFO(0x014016, 0, 64 * 1024, 64, SECT_4K) }, { "s25fl164k", INFO(0x014017, 0, 64 * 1024, 128, SECT_4K) }, { "s25fl204k", INFO(0x014013, 0, 64 * 1024, 8, SECT_4K | SPI_NOR_DUAL_READ) }, diff --git a/target/linux/generic/backport-4.9/061-v4.10-0006-mtd-spi-nor-Add-support-for-N25Q016A.patch b/target/linux/generic/backport-4.9/061-v4.10-0006-mtd-spi-nor-Add-support-for-N25Q016A.patch index b4e94543e5c..8df61f6ed2c 100644 --- a/target/linux/generic/backport-4.9/061-v4.10-0006-mtd-spi-nor-Add-support-for-N25Q016A.patch +++ b/target/linux/generic/backport-4.9/061-v4.10-0006-mtd-spi-nor-Add-support-for-N25Q016A.patch @@ -19,7 +19,7 @@ Signed-off-by: Cyrille Pitchen --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -879,6 +879,7 @@ static const struct flash_info spi_nor_i +@@ -885,6 +885,7 @@ static const struct flash_info spi_nor_i { "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) }, /* Micron */ diff --git a/target/linux/generic/backport-4.9/062-v4.11-0001-mtd-spi-nor-Add-support-for-S3AN-spi-nor-devices.patch b/target/linux/generic/backport-4.9/062-v4.11-0001-mtd-spi-nor-Add-support-for-S3AN-spi-nor-devices.patch index 87b83cc5dd5..a1749849218 100644 --- a/target/linux/generic/backport-4.9/062-v4.11-0001-mtd-spi-nor-Add-support-for-S3AN-spi-nor-devices.patch +++ b/target/linux/generic/backport-4.9/062-v4.11-0001-mtd-spi-nor-Add-support-for-S3AN-spi-nor-devices.patch @@ -140,7 +140,7 @@ Signed-off-by: Cyrille Pitchen /* NOTE: double check command sets and memory organization when you add * more nor chips. This current list focusses on newer chips, which * have been converging on command sets which including JEDEC ID. -@@ -1014,6 +1073,13 @@ static const struct flash_info spi_nor_i +@@ -1020,6 +1079,13 @@ static const struct flash_info spi_nor_i { "cat25c09", CAT25_INFO( 128, 8, 32, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, { "cat25c17", CAT25_INFO( 256, 8, 32, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, { "cat25128", CAT25_INFO(2048, 8, 64, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, @@ -154,7 +154,7 @@ Signed-off-by: Cyrille Pitchen { }, }; -@@ -1054,7 +1120,12 @@ static int spi_nor_read(struct mtd_info +@@ -1060,7 +1126,12 @@ static int spi_nor_read(struct mtd_info return ret; while (len) { @@ -168,7 +168,7 @@ Signed-off-by: Cyrille Pitchen if (ret == 0) { /* We shouldn't see 0-length reads */ ret = -EIO; -@@ -1175,8 +1246,23 @@ static int spi_nor_write(struct mtd_info +@@ -1181,8 +1252,23 @@ static int spi_nor_write(struct mtd_info for (i = 0; i < len; ) { ssize_t written; @@ -193,7 +193,7 @@ Signed-off-by: Cyrille Pitchen WARN_ONCE(page_offset, "Writing at offset %zu into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.", page_offset); -@@ -1184,8 +1270,11 @@ static int spi_nor_write(struct mtd_info +@@ -1190,8 +1276,11 @@ static int spi_nor_write(struct mtd_info page_remain = min_t(size_t, nor->page_size - page_offset, len - i); @@ -206,7 +206,7 @@ Signed-off-by: Cyrille Pitchen if (ret < 0) goto write_err; written = ret; -@@ -1319,6 +1408,47 @@ static int spi_nor_check(struct spi_nor +@@ -1325,6 +1414,47 @@ static int spi_nor_check(struct spi_nor return 0; } @@ -254,7 +254,7 @@ Signed-off-by: Cyrille Pitchen int spi_nor_scan(struct spi_nor *nor, const char *name, enum read_mode mode) { const struct flash_info *info = NULL; -@@ -1367,6 +1497,14 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1373,6 +1503,14 @@ int spi_nor_scan(struct spi_nor *nor, co mutex_init(&nor->lock); /* @@ -269,7 +269,7 @@ Signed-off-by: Cyrille Pitchen * Atmel, SST, Intel/Numonyx, and others serial NOR tend to power up * with the software protection bits set */ -@@ -1524,6 +1662,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1530,6 +1668,12 @@ int spi_nor_scan(struct spi_nor *nor, co nor->read_dummy = spi_nor_read_dummy_cycles(nor); diff --git a/target/linux/generic/backport-4.9/062-v4.11-0002-mtd-spi-nor-improve-macronix_quad_enable.patch b/target/linux/generic/backport-4.9/062-v4.11-0002-mtd-spi-nor-improve-macronix_quad_enable.patch index bdd5e344d78..ec469d405b9 100644 --- a/target/linux/generic/backport-4.9/062-v4.11-0002-mtd-spi-nor-improve-macronix_quad_enable.patch +++ b/target/linux/generic/backport-4.9/062-v4.11-0002-mtd-spi-nor-improve-macronix_quad_enable.patch @@ -16,7 +16,7 @@ Acked-by: Marek Vasut --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1305,6 +1305,9 @@ static int macronix_quad_enable(struct s +@@ -1311,6 +1311,9 @@ static int macronix_quad_enable(struct s val = read_sr(nor); if (val < 0) return val; diff --git a/target/linux/generic/backport-4.9/062-v4.11-0003-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch b/target/linux/generic/backport-4.9/062-v4.11-0003-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch index 731ef21bb8f..790b557611d 100644 --- a/target/linux/generic/backport-4.9/062-v4.11-0003-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch +++ b/target/linux/generic/backport-4.9/062-v4.11-0003-mtd-spi-nor-remove-WARN_ONCE-message-in-spi_nor_writ.patch @@ -21,7 +21,7 @@ Acked-by: Boris Brezillon --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1263,9 +1263,6 @@ static int spi_nor_write(struct mtd_info +@@ -1269,9 +1269,6 @@ static int spi_nor_write(struct mtd_info page_offset = do_div(aux, nor->page_size); } diff --git a/target/linux/generic/backport-4.9/062-v4.11-0004-mtd-spi-nor-rename-SPINOR_OP_-macros-of-the-4-byte-a.patch b/target/linux/generic/backport-4.9/062-v4.11-0004-mtd-spi-nor-rename-SPINOR_OP_-macros-of-the-4-byte-a.patch index d436789eb00..34562e197c0 100644 --- a/target/linux/generic/backport-4.9/062-v4.11-0004-mtd-spi-nor-rename-SPINOR_OP_-macros-of-the-4-byte-a.patch +++ b/target/linux/generic/backport-4.9/062-v4.11-0004-mtd-spi-nor-rename-SPINOR_OP_-macros-of-the-4-byte-a.patch @@ -95,7 +95,7 @@ Acked-by: Marek Vasut static struct seq_rw_config stfsm_s25fl_write4_configs[] = { --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1632,16 +1632,16 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1638,16 +1638,16 @@ int spi_nor_scan(struct spi_nor *nor, co /* Dedicated 4-byte command set */ switch (nor->flash_read) { case SPI_NOR_QUAD: diff --git a/target/linux/generic/backport-4.9/062-v4.11-0005-mtd-spi-nor-add-a-stateless-method-to-support-memory.patch b/target/linux/generic/backport-4.9/062-v4.11-0005-mtd-spi-nor-add-a-stateless-method-to-support-memory.patch index dc05fe31bb0..1d507c19205 100644 --- a/target/linux/generic/backport-4.9/062-v4.11-0005-mtd-spi-nor-add-a-stateless-method-to-support-memory.patch +++ b/target/linux/generic/backport-4.9/062-v4.11-0005-mtd-spi-nor-add-a-stateless-method-to-support-memory.patch @@ -116,7 +116,7 @@ Acked-by: Marek Vasut /* Enable/disable 4-byte addressing mode. */ static inline int set_4byte(struct spi_nor *nor, const struct flash_info *info, int enable) -@@ -1628,27 +1704,10 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1634,27 +1710,10 @@ int spi_nor_scan(struct spi_nor *nor, co else if (mtd->size > 0x1000000) { /* enable 4-byte addressing if the device exceeds 16MiB */ nor->addr_width = 4; diff --git a/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch b/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch index 339591500f2..d1544b1d360 100644 --- a/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch +++ b/target/linux/generic/backport-4.9/064-v4.12-mtd-spi-nor-enable-stateless-4b-op-codes-for-mx25u25.patch @@ -18,7 +18,7 @@ Signed-off-by: Cyrille Pitchen --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1017,7 +1017,7 @@ static const struct flash_info spi_nor_i +@@ -1023,7 +1023,7 @@ static const struct flash_info spi_nor_i { "mx25l12805d", INFO(0xc22018, 0, 64 * 1024, 256, 0) }, { "mx25l12855e", INFO(0xc22618, 0, 64 * 1024, 256, 0) }, { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, 0) }, diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index dffad0216f2..4e7bc932943 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -1040,7 +1040,7 @@ Signed-off-by: David S. Miller writel(irq->mask, adpt->base + EMAC_INT_MASK); --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c -@@ -7578,7 +7578,7 @@ static int rtl8169_poll(struct napi_stru +@@ -7576,7 +7576,7 @@ static int rtl8169_poll(struct napi_stru } if (work_done < budget) { @@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA); --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -2705,7 +2705,7 @@ static int stmmac_poll(struct napi_struc +@@ -2706,7 +2706,7 @@ static int stmmac_poll(struct napi_struc work_done = stmmac_rx(priv, budget); if (work_done < budget) { diff --git a/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch b/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch index b91bfb7f615..136fdf48d30 100644 --- a/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch +++ b/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller opt->ops.opt_nflen = 8; } -@@ -1187,7 +1187,7 @@ route_lookup: +@@ -1199,7 +1199,7 @@ route_lookup: if (encap_limit >= 0) { init_tel_txopt(&opt, encap_limit); @@ -47,4 +47,4 @@ Signed-off-by: David S. Miller + ipv6_push_frag_opts(skb, &opt.ops, &proto); } - /* Calculate max headroom for all the headers and adjust + skb_push(skb, sizeof(struct ipv6hdr)); diff --git a/target/linux/generic/pending-4.9/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/pending-4.9/465-m25p80-mx-disable-software-protection.patch index 9b90b9bc7e2..27adddeb301 100644 --- a/target/linux/generic/pending-4.9/465-m25p80-mx-disable-software-protection.patch +++ b/target/linux/generic/pending-4.9/465-m25p80-mx-disable-software-protection.patch @@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1595,6 +1595,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1601,6 +1601,7 @@ int spi_nor_scan(struct spi_nor *nor, co if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || JEDEC_MFR(info) == SNOR_MFR_INTEL || diff --git a/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch index e032b08f4d5..e1681d61dd6 100644 --- a/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch +++ b/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch @@ -17,7 +17,7 @@ Signed-off-by: Matthias Schiffer --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1597,6 +1597,7 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1603,6 +1603,7 @@ int spi_nor_scan(struct spi_nor *nor, co JEDEC_MFR(info) == SNOR_MFR_INTEL || JEDEC_MFR(info) == SNOR_MFR_MACRONIX || JEDEC_MFR(info) == SNOR_MFR_SST || @@ -25,7 +25,7 @@ Signed-off-by: Matthias Schiffer info->flags & SPI_NOR_HAS_LOCK) { write_enable(nor); write_sr(nor, 0); -@@ -1615,7 +1616,8 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1621,7 +1622,8 @@ int spi_nor_scan(struct spi_nor *nor, co /* NOR protection support for STmicro/Micron chips and similar */ if (JEDEC_MFR(info) == SNOR_MFR_MICRON || diff --git a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch index e1c1de36029..aaaf7ed793f 100644 --- a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch +++ b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau depends on ARCH_AT91 || (ARM && COMPILE_TEST) --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1642,10 +1642,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1648,10 +1648,12 @@ int spi_nor_scan(struct spi_nor *nor, co #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ diff --git a/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch b/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch index 87f0325fbc0..d54ee4f25ae 100644 --- a/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch +++ b/target/linux/generic/pending-4.9/475-mtd-spi-nor-Add-Winbond-w25q128jv-support.patch @@ -20,7 +20,7 @@ Changes in v2: --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1146,6 +1146,11 @@ static const struct flash_info spi_nor_i +@@ -1152,6 +1152,11 @@ static const struct flash_info spi_nor_i SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, diff --git a/target/linux/generic/pending-4.9/477-mtd-add-spi-nor-add-mx25u3235f.patch b/target/linux/generic/pending-4.9/477-mtd-add-spi-nor-add-mx25u3235f.patch index 9f044027d95..62f6314e93b 100644 --- a/target/linux/generic/pending-4.9/477-mtd-add-spi-nor-add-mx25u3235f.patch +++ b/target/linux/generic/pending-4.9/477-mtd-add-spi-nor-add-mx25u3235f.patch @@ -8,7 +8,7 @@ Signed-off-by: André Valentin --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1014,6 +1014,7 @@ static const struct flash_info spi_nor_i +@@ -1020,6 +1020,7 @@ static const struct flash_info spi_nor_i { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, diff --git a/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch b/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch index 39e78b23431..011f4b44584 100644 --- a/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch +++ b/target/linux/generic/pending-4.9/478-mtd-spi-nor-Add-support-for-XM25QH64A-and-XM25QH128A.patch @@ -17,7 +17,7 @@ Signed-off-by: Hauke Mehrtens --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1171,6 +1171,10 @@ static const struct flash_info spi_nor_i +@@ -1177,6 +1177,10 @@ static const struct flash_info spi_nor_i { "3S400AN", S3AN_INFO(0x1f2400, 256, 264) }, { "3S700AN", S3AN_INFO(0x1f2500, 512, 264) }, { "3S1400AN", S3AN_INFO(0x1f2600, 512, 528) }, diff --git a/target/linux/generic/pending-4.9/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-4.9/530-jffs2_make_lzma_available.patch index 8f68fed50cb..f5cd6005a4c 100644 --- a/target/linux/generic/pending-4.9/530-jffs2_make_lzma_available.patch +++ b/target/linux/generic/pending-4.9/530-jffs2_make_lzma_available.patch @@ -244,7 +244,7 @@ Signed-off-by: Alexandros C. Couloumbis +} --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c -@@ -372,14 +372,41 @@ static int __init init_jffs2_fs(void) +@@ -370,14 +370,41 @@ static int __init init_jffs2_fs(void) BUILD_BUG_ON(sizeof(struct jffs2_raw_inode) != 68); BUILD_BUG_ON(sizeof(struct jffs2_raw_summary) != 32); diff --git a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 4757e81ea11..c8deaba842b 100644 --- a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -153,7 +153,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -2610,6 +2632,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -2613,6 +2635,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -171,7 +171,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -2847,7 +2880,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -2850,7 +2883,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -181,7 +181,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -3219,6 +3253,9 @@ static int rt6_fill_node(struct net *net +@@ -3222,6 +3256,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3495,6 +3532,8 @@ static int ip6_route_dev_notify(struct n +@@ -3490,6 +3527,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3506,6 +3545,7 @@ static int ip6_route_dev_notify(struct n +@@ -3501,6 +3540,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -208,7 +208,7 @@ Signed-off-by: Jonas Gorski in6_dev_put(net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -3721,6 +3761,17 @@ static int __net_init ip6_route_net_init +@@ -3716,6 +3756,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -226,7 +226,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3739,6 +3790,8 @@ out: +@@ -3734,6 +3785,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3756,6 +3809,7 @@ static void __net_exit ip6_route_net_exi +@@ -3751,6 +3804,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3829,6 +3883,9 @@ void __init ip6_route_init_special_entri +@@ -3824,6 +3878,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch index 464e035f5fd..f730e83878e 100644 --- a/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.9/810-pci_disable_common_quirks.patch @@ -49,7 +49,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, * even though no one is handling them (f.e. i915 driver is never loaded). -@@ -3128,6 +3132,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3132,6 +3136,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch index 45f1bfce477..dd5a02c284b 100644 --- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch @@ -714,7 +714,7 @@ Signed-off-by: Yangbo Lu /* Everspin */ { "mr25h256", CAT25_INFO( 32 * 1024, 1, 256, 2, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, -@@ -1014,12 +1028,15 @@ static const struct flash_info spi_nor_i +@@ -1020,12 +1034,15 @@ static const struct flash_info spi_nor_i { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, @@ -731,7 +731,7 @@ Signed-off-by: Yangbo Lu { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, { "mx66l51235l", INFO(0xc2201a, 0, 64 * 1024, 1024, SPI_NOR_QUAD_READ) }, { "mx66l1g55g", INFO(0xc2261b, 0, 64 * 1024, 2048, SPI_NOR_QUAD_READ) }, -@@ -1033,10 +1050,11 @@ static const struct flash_info spi_nor_i +@@ -1039,10 +1056,11 @@ static const struct flash_info spi_nor_i { "n25q128a11", INFO(0x20bb18, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ) }, { "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ) }, { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ) }, @@ -745,7 +745,7 @@ Signed-off-by: Yangbo Lu /* PMC */ { "pm25lv512", INFO(0, 0, 32 * 1024, 2, SECT_4K_PMC) }, -@@ -1054,8 +1072,11 @@ static const struct flash_info spi_nor_i +@@ -1060,8 +1078,11 @@ static const struct flash_info spi_nor_i { "s70fl01gs", INFO(0x010221, 0x4d00, 256 * 1024, 256, 0) }, { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) }, { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) }, @@ -758,7 +758,7 @@ Signed-off-by: Yangbo Lu { "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25sl004a", INFO(0x010212, 0, 64 * 1024, 8, 0) }, { "s25sl008a", INFO(0x010213, 0, 64 * 1024, 16, 0) }, -@@ -1130,6 +1151,9 @@ static const struct flash_info spi_nor_i +@@ -1136,6 +1157,9 @@ static const struct flash_info spi_nor_i { "w25x80", INFO(0xef3014, 0, 64 * 1024, 16, SECT_4K) }, { "w25x16", INFO(0xef3015, 0, 64 * 1024, 32, SECT_4K) }, { "w25x32", INFO(0xef3016, 0, 64 * 1024, 64, SECT_4K) }, @@ -768,7 +768,7 @@ Signed-off-by: Yangbo Lu { "w25q32", INFO(0xef4016, 0, 64 * 1024, 64, SECT_4K) }, { "w25q32dw", INFO(0xef6016, 0, 64 * 1024, 64, -@@ -1201,6 +1225,53 @@ static const struct flash_info *spi_nor_ +@@ -1207,6 +1231,53 @@ static const struct flash_info *spi_nor_ id[0], id[1], id[2]); return ERR_PTR(-ENODEV); } @@ -822,7 +822,7 @@ Signed-off-by: Yangbo Lu static int spi_nor_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf) -@@ -1420,7 +1491,7 @@ static int macronix_quad_enable(struct s +@@ -1426,7 +1497,7 @@ static int macronix_quad_enable(struct s * Write status Register and configuration register with 2 bytes * The first byte will be written to the status register, while the * second byte will be written to the configuration register. @@ -831,7 +831,7 @@ Signed-off-by: Yangbo Lu */ static int write_sr_cr(struct spi_nor *nor, u16 val) { -@@ -1468,6 +1539,24 @@ static int spansion_quad_enable(struct s +@@ -1474,6 +1545,24 @@ static int spansion_quad_enable(struct s return 0; } @@ -856,7 +856,7 @@ Signed-off-by: Yangbo Lu static int set_quad_mode(struct spi_nor *nor, const struct flash_info *info) { int status; -@@ -1614,9 +1703,25 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1620,9 +1709,25 @@ int spi_nor_scan(struct spi_nor *nor, co write_sr(nor, 0); spi_nor_wait_till_ready(nor); } @@ -882,7 +882,7 @@ Signed-off-by: Yangbo Lu mtd->priv = nor; mtd->type = MTD_NORFLASH; mtd->writesize = 1; -@@ -1650,6 +1755,8 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1656,6 +1761,8 @@ int spi_nor_scan(struct spi_nor *nor, co nor->flags |= SNOR_F_USE_FSR; if (info->flags & SPI_NOR_HAS_TB) nor->flags |= SNOR_F_HAS_SR_TB; @@ -891,7 +891,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ -@@ -1689,9 +1796,15 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1695,9 +1802,15 @@ int spi_nor_scan(struct spi_nor *nor, co /* Some devices cannot do fast-read, no matter what DT tells us */ if (info->flags & SPI_NOR_NO_FR) nor->flash_read = SPI_NOR_NORMAL; @@ -910,7 +910,7 @@ Signed-off-by: Yangbo Lu ret = set_quad_mode(nor, info); if (ret) { dev_err(dev, "quad mode not supported\n"); -@@ -1704,6 +1817,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1710,6 +1823,9 @@ int spi_nor_scan(struct spi_nor *nor, co /* Default commands */ switch (nor->flash_read) { diff --git a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch index 7ed375e094e..6e2b7f8f28d 100644 --- a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch @@ -2060,7 +2060,7 @@ Signed-off-by: Yangbo Lu } --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c -@@ -4673,3 +4673,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IN +@@ -4677,3 +4677,11 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2031, quirk_no_aersid); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2032, quirk_no_aersid); DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2033, quirk_no_aersid); diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch index 4327a266486..4124bab4adf 100644 --- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch @@ -1605,17 +1605,6 @@ Signed-off-by: Yangbo Lu +MODULE_DESCRIPTION("Freescale Backplane driver"); +MODULE_AUTHOR("Shaohui Xie "); +MODULE_LICENSE("GPL v2"); ---- a/drivers/net/phy/marvell.c -+++ b/drivers/net/phy/marvell.c -@@ -1610,7 +1610,7 @@ static struct phy_driver marvell_drivers - .flags = PHY_HAS_INTERRUPT, - .probe = marvell_probe, - .config_init = &m88e1145_config_init, -- .config_aneg = &marvell_config_aneg, -+ .config_aneg = &m88e1101_config_aneg, - .read_status = &genphy_read_status, - .ack_interrupt = &marvell_ack_interrupt, - .config_intr = &marvell_config_intr, --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -591,7 +591,7 @@ int phy_mii_ioctl(struct phy_device *phy diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index a143ad566b2..02527134805 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -781,7 +781,7 @@ Signed-off-by: Yangbo Lu }; struct tcrypt_result { -@@ -1333,6 +1333,10 @@ static int do_test(const char *alg, u32 +@@ -1336,6 +1336,10 @@ static int do_test(const char *alg, u32 ret += tcrypt_test("hmac(sha3-512)"); break; @@ -792,7 +792,7 @@ Signed-off-by: Yangbo Lu case 150: ret += tcrypt_test("ansi_cprng"); break; -@@ -1394,6 +1398,9 @@ static int do_test(const char *alg, u32 +@@ -1397,6 +1401,9 @@ static int do_test(const char *alg, u32 case 190: ret += tcrypt_test("authenc(hmac(sha512),cbc(des3_ede))"); break; @@ -802,7 +802,7 @@ Signed-off-by: Yangbo Lu case 200: test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); -@@ -1408,9 +1415,9 @@ static int do_test(const char *alg, u32 +@@ -1411,9 +1418,9 @@ static int do_test(const char *alg, u32 test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, @@ -814,7 +814,7 @@ Signed-off-by: Yangbo Lu test_cipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0, -@@ -1841,9 +1848,9 @@ static int do_test(const char *alg, u32 +@@ -1844,9 +1851,9 @@ static int do_test(const char *alg, u32 test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, @@ -27756,8 +27756,8 @@ Signed-off-by: Yangbo Lu extern bool caam_little_end; +extern bool caam_imx; - #define caam_to_cpu(len) \ - static inline u##len caam##len ## _to_cpu(u##len val) \ + #define caam_to_cpu(len) \ + static inline u##len caam##len ## _to_cpu(u##len val) \ @@ -154,13 +156,10 @@ static inline u64 rd_reg64(void __iomem #else /* CONFIG_64BIT */ static inline void wr_reg64(void __iomem *reg, u64 data) diff --git a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch index 3c278099d3f..a8dcd82f7be 100644 --- a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch @@ -87,7 +87,7 @@ Signed-off-by: Yangbo Lu pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; if (pkt_len < ETH_ZLEN) break; -@@ -4510,6 +4515,7 @@ static struct usb_device_id rtl8152_tabl +@@ -4513,6 +4518,7 @@ static struct usb_device_id rtl8152_tabl {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)}, {REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041)}, {REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff)}, From 4db74fbd6908db88eda4227ed3d18822c80b9ea1 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 14 Nov 2018 12:37:10 +0100 Subject: [PATCH 087/399] kernel: bump 4.14 to 4.14.81 Refreshed all patches. Removed upstreamed patches: - 081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch Altered patches: - 0054-cpufreq-dt-Handle-OPP-voltage-adjust-events Compile-tested on: cns3xxx, imx6, ipq806x, x86_64 Runtime-tested on: cns3xxx, imx6, x86_64 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...tch-back-to-reading-flash-using-smal.patch | 44 ------------------- .../patches-4.14/940-bcm47xx-yenta.patch | 8 ++-- .../661-use_fq_codel_by_default.patch | 2 +- .../530-jffs2_make_lzma_available.patch | 2 +- .../810-pci_disable_common_quirks.patch | 2 +- ...cpufreq-qcom-independent-core-clocks.patch | 4 +- ...-dt-Handle-OPP-voltage-adjust-events.patch | 23 +++++----- ...-dt-Add-L2-frequency-scaling-support.patch | 6 +-- ...056-cpufreq-dt-Add-missing-rcu-locks.patch | 2 +- ...eeprom-ethtool-access-into-netdev-co.patch | 2 +- ...fp-use-netdev-sfp_bus-for-start-stop.patch | 4 +- ...0-add-console-to-pogoplogv3-bootargs.patch | 4 +- 13 files changed, 30 insertions(+), 77 deletions(-) delete mode 100644 target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 09501233ebd..74e52245610 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .137 -LINUX_VERSION-4.14 = .80 +LINUX_VERSION-4.14 = .81 LINUX_KERNEL_HASH-4.9.137 = 6db2512a9094bf4c830124641d1275635600b052962a7db3556da18914ea2589 -LINUX_KERNEL_HASH-4.14.80 = 9ddc7bc11cbea6475ac5abf18e01a143d7d506bece591e0dcb15c9452d3ed7d2 +LINUX_KERNEL_HASH-4.14.81 = 4b36dfd053844ef0617799d432eed67aa4795d3403216d6789288aa7a0e75bde remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch b/target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch deleted file mode 100644 index 91b06b19fea..00000000000 --- a/target/linux/bcm53xx/patches-4.14/081-spi-bcm-qspi-switch-back-to-reading-flash-using-smal.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 940ec770c295682993d1cccce3081fd7c74fece8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Thu, 11 Oct 2018 09:42:17 +0200 -Subject: [PATCH] spi: bcm-qspi: switch back to reading flash using smaller - chunks -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixing/optimizing bcm_qspi_bspi_read() performance introduced two -changes: -1) It added a loop to read all requested data using multiple BSPI ops. -2) It bumped max size of a single BSPI block request from 256 to 512 B. - -The later change resulted in occasional BSPI timeouts causing a -regression. - -For some unknown reason hardware doesn't always handle reads as expected -when using 512 B chunks. In such cases it may happen that BSPI returns -amount of requested bytes without the last 1-3 ones. It provides the -remaining bytes later but doesn't raise an interrupt until another LR -start. - -Switching back to 256 B reads fixes that problem and regression. - -Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance") -Signed-off-by: Rafał Miłecki -Signed-off-by: Mark Brown -Cc: stable@vger.kernel.org ---- - drivers/spi/spi-bcm-qspi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/spi/spi-bcm-qspi.c -+++ b/drivers/spi/spi-bcm-qspi.c -@@ -88,7 +88,7 @@ - #define BSPI_BPP_MODE_SELECT_MASK BIT(8) - #define BSPI_BPP_ADDR_SELECT_MASK BIT(16) - --#define BSPI_READ_LENGTH 512 -+#define BSPI_READ_LENGTH 256 - - /* MSPI register offsets */ - #define MSPI_SPCR0_LSB 0x000 diff --git a/target/linux/brcm47xx/patches-4.14/940-bcm47xx-yenta.patch b/target/linux/brcm47xx/patches-4.14/940-bcm47xx-yenta.patch index 00a44d6317d..bda27d16c4a 100644 --- a/target/linux/brcm47xx/patches-4.14/940-bcm47xx-yenta.patch +++ b/target/linux/brcm47xx/patches-4.14/940-bcm47xx-yenta.patch @@ -1,6 +1,6 @@ --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c -@@ -919,6 +919,8 @@ static unsigned int yenta_probe_irq(stru +@@ -920,6 +920,8 @@ static unsigned int yenta_probe_irq(stru * Probe for usable interrupts using the force * register to generate bogus card status events. */ @@ -9,7 +9,7 @@ cb_writel(socket, CB_SOCKET_EVENT, -1); cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK); reg = exca_readb(socket, I365_CSCINT); -@@ -934,6 +936,7 @@ static unsigned int yenta_probe_irq(stru +@@ -935,6 +937,7 @@ static unsigned int yenta_probe_irq(stru } cb_writel(socket, CB_SOCKET_MASK, 0); exca_writeb(socket, I365_CSCINT, reg); @@ -17,7 +17,7 @@ mask = probe_irq_mask(val) & 0xffff; -@@ -1018,6 +1021,10 @@ static void yenta_get_socket_capabilitie +@@ -1019,6 +1022,10 @@ static void yenta_get_socket_capabilitie else socket->socket.irq_mask = 0; @@ -28,7 +28,7 @@ dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n", socket->socket.irq_mask, socket->cb_irq); } -@@ -1250,6 +1257,15 @@ static int yenta_probe(struct pci_dev *d +@@ -1251,6 +1258,15 @@ static int yenta_probe(struct pci_dev *d dev_info(&dev->dev, "Socket status: %08x\n", cb_readl(socket, CB_SOCKET_STATE)); diff --git a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch index 8007e28301e..d1e92ae40af 100644 --- a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -2029,7 +2029,7 @@ static int __init pktsched_init(void) +@@ -2028,7 +2028,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch index 046e9d54d3e..4e1dfbe7766 100644 --- a/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch +++ b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch @@ -244,7 +244,7 @@ Signed-off-by: Alexandros C. Couloumbis +} --- a/fs/jffs2/super.c +++ b/fs/jffs2/super.c -@@ -372,14 +372,41 @@ static int __init init_jffs2_fs(void) +@@ -370,14 +370,41 @@ static int __init init_jffs2_fs(void) BUILD_BUG_ON(sizeof(struct jffs2_raw_inode) != 68); BUILD_BUG_ON(sizeof(struct jffs2_raw_summary) != 32); diff --git a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch index 2a5bcc8ef12..c80e58105d3 100644 --- a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch +++ b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch @@ -49,7 +49,7 @@ Signed-off-by: Gabor Juhos /* * Some BIOS implementations leave the Intel GPU interrupts enabled, * even though no one is handling them (f.e. i915 driver is never loaded). -@@ -3167,6 +3171,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN +@@ -3171,6 +3175,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); diff --git a/target/linux/ipq806x/patches-4.14/0046-cpufreq-qcom-independent-core-clocks.patch b/target/linux/ipq806x/patches-4.14/0046-cpufreq-qcom-independent-core-clocks.patch index 1d2fbf9db52..b3b3072bcbf 100644 --- a/target/linux/ipq806x/patches-4.14/0046-cpufreq-qcom-independent-core-clocks.patch +++ b/target/linux/ipq806x/patches-4.14/0046-cpufreq-qcom-independent-core-clocks.patch @@ -28,7 +28,7 @@ Signed-off-by: Sricharan R --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c -@@ -220,7 +220,10 @@ static int cpufreq_init(struct cpufreq_p +@@ -231,7 +231,10 @@ static int cpufreq_init(struct cpufreq_p } if (fallback) { @@ -40,7 +40,7 @@ Signed-off-by: Sricharan R /* * OPP tables are initialized only for policy->cpu, do it for -@@ -372,6 +375,8 @@ static int dt_cpufreq_probe(struct platf +@@ -376,6 +379,8 @@ static int dt_cpufreq_probe(struct platf if (data && data->have_governor_per_policy) dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY; diff --git a/target/linux/ipq806x/patches-4.14/0054-cpufreq-dt-Handle-OPP-voltage-adjust-events.patch b/target/linux/ipq806x/patches-4.14/0054-cpufreq-dt-Handle-OPP-voltage-adjust-events.patch index 969adfe4b52..dcf0bcd3f23 100644 --- a/target/linux/ipq806x/patches-4.14/0054-cpufreq-dt-Handle-OPP-voltage-adjust-events.patch +++ b/target/linux/ipq806x/patches-4.14/0054-cpufreq-dt-Handle-OPP-voltage-adjust-events.patch @@ -32,10 +32,10 @@ Signed-off-by: Georgi Djakov + struct notifier_block opp_nb; + struct mutex lock; + unsigned long opp_freq; + bool have_static_opps; }; - static struct freq_attr *cpufreq_dt_attr[] = { -@@ -43,9 +46,16 @@ static struct freq_attr *cpufreq_dt_attr +@@ -44,9 +47,16 @@ static struct freq_attr *cpufreq_dt_attr static int set_target(struct cpufreq_policy *policy, unsigned int index) { struct private_data *priv = policy->driver_data; @@ -54,7 +54,7 @@ Signed-off-by: Georgi Djakov } /* -@@ -86,6 +96,39 @@ node_put: +@@ -87,6 +97,39 @@ node_put: return name; } @@ -94,7 +94,7 @@ Signed-off-by: Georgi Djakov static int resources_available(void) { struct device *cpu_dev; -@@ -152,6 +195,7 @@ static int cpufreq_init(struct cpufreq_p +@@ -153,6 +196,7 @@ static int cpufreq_init(struct cpufreq_p bool fallback = false; const char *name; int ret; @@ -102,30 +102,27 @@ Signed-off-by: Georgi Djakov cpu_dev = get_cpu_device(policy->cpu); if (!cpu_dev) { -@@ -241,13 +285,16 @@ static int cpufreq_init(struct cpufreq_p - goto out_free_opp; +@@ -246,10 +290,13 @@ static int cpufreq_init(struct cpufreq_p + __func__, ret); } + mutex_init(&priv->lock); + dev_pm_opp_register_notifier(cpu_dev, &priv->opp_nb); + - priv->reg_name = name; - priv->opp_table = opp_table; - ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) { dev_err(cpu_dev, "failed to init cpufreq table: %d\n", ret); -- goto out_free_priv; +- goto out_free_opp; + goto out_unregister_nb; } priv->cpu_dev = cpu_dev; -@@ -283,6 +330,8 @@ static int cpufreq_init(struct cpufreq_p +@@ -285,6 +332,8 @@ static int cpufreq_init(struct cpufreq_p out_free_cpufreq_table: dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); +out_unregister_nb: + dev_pm_opp_unregister_notifier(cpu_dev, &priv->opp_nb); - out_free_priv: - kfree(priv); out_free_opp: + if (priv->have_static_opps) + dev_pm_opp_of_cpumask_remove_table(policy->cpus); diff --git a/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch b/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch index 26ea9f3c145..1c26650b785 100644 --- a/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch +++ b/target/linux/ipq806x/patches-4.14/0055-cpufreq-dt-Add-L2-frequency-scaling-support.patch @@ -11,7 +11,7 @@ Signed-off-by: Georgi Djakov --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c -@@ -48,11 +48,41 @@ static int set_target(struct cpufreq_pol +@@ -49,11 +49,41 @@ static int set_target(struct cpufreq_pol struct private_data *priv = policy->driver_data; int ret; unsigned long target_freq = policy->freq_table[index].frequency * 1000; @@ -54,7 +54,7 @@ Signed-off-by: Georgi Djakov mutex_unlock(&priv->lock); return ret; -@@ -196,6 +226,8 @@ static int cpufreq_init(struct cpufreq_p +@@ -197,6 +227,8 @@ static int cpufreq_init(struct cpufreq_p const char *name; int ret; struct srcu_notifier_head *opp_srcu_head; @@ -63,7 +63,7 @@ Signed-off-by: Georgi Djakov cpu_dev = get_cpu_device(policy->cpu); if (!cpu_dev) { -@@ -303,6 +335,13 @@ static int cpufreq_init(struct cpufreq_p +@@ -305,6 +337,13 @@ static int cpufreq_init(struct cpufreq_p policy->suspend_freq = dev_pm_opp_get_suspend_opp_freq(cpu_dev) / 1000; diff --git a/target/linux/ipq806x/patches-4.14/0056-cpufreq-dt-Add-missing-rcu-locks.patch b/target/linux/ipq806x/patches-4.14/0056-cpufreq-dt-Add-missing-rcu-locks.patch index c0eb2eb3cd9..d9d76e409b4 100644 --- a/target/linux/ipq806x/patches-4.14/0056-cpufreq-dt-Add-missing-rcu-locks.patch +++ b/target/linux/ipq806x/patches-4.14/0056-cpufreq-dt-Add-missing-rcu-locks.patch @@ -10,7 +10,7 @@ Signed-off-by: Georgi Djakov --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c -@@ -143,8 +143,10 @@ static int opp_notifier(struct notifier_ +@@ -144,8 +144,10 @@ static int opp_notifier(struct notifier_ ret = PTR_ERR(cpu_reg); goto out; } diff --git a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch index 9b8107cee82..224b9764519 100644 --- a/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch +++ b/target/linux/mvebu/patches-4.14/408-sfp-move-module-eeprom-ethtool-access-into-netdev-co.patch @@ -49,7 +49,7 @@ Signed-off-by: Russell King }; --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -1042,34 +1042,6 @@ int phylink_ethtool_set_pauseparam(struc +@@ -1045,34 +1045,6 @@ int phylink_ethtool_set_pauseparam(struc } EXPORT_SYMBOL_GPL(phylink_ethtool_set_pauseparam); diff --git a/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch b/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch index d0b4480f381..47b71ee4c15 100644 --- a/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch +++ b/target/linux/mvebu/patches-4.14/409-sfp-use-netdev-sfp_bus-for-start-stop.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c -@@ -757,8 +757,8 @@ void phylink_start(struct phylink *pl) +@@ -760,8 +760,8 @@ void phylink_start(struct phylink *pl) clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); phylink_run_resolve(pl); @@ -21,7 +21,7 @@ Signed-off-by: Russell King if (pl->phydev) phy_start(pl->phydev); } -@@ -770,8 +770,8 @@ void phylink_stop(struct phylink *pl) +@@ -773,8 +773,8 @@ void phylink_stop(struct phylink *pl) if (pl->phydev) phy_stop(pl->phydev); diff --git a/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch b/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch index 56e0eaf19cf..4ca42db1e0f 100644 --- a/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch +++ b/target/linux/oxnas/patches-4.14/010-add-console-to-pogoplogv3-bootargs.patch @@ -1,5 +1,5 @@ ---- a/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts 2018-08-14 18:03:56.542679083 +0200 -+++ b/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts 2018-11-04 18:19:35.154886643 +0100 +--- a/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts ++++ b/arch/arm/boot/dts/ox820-cloudengines-pogoplug-series-3.dts @@ -15,7 +15,7 @@ compatible = "cloudengines,pogoplugv3", "oxsemi,ox820"; From dd6d554b2c1e10aa11c5bd8d8d5b0f7f69ad3f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 15 Nov 2018 12:28:50 +0100 Subject: [PATCH 088/399] kernel: fix ubifs loosing O_TMPFILE data after power cut MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There was a bug in ubifs related to the O_TMPFILE. When reapplying changes after power cut data could be lost. This problem was exposed by overlayfs and the upstream commit 3a1e819b4e80 ("ovl: store file handle of lower inode on copy up"). This fixes a regression introduced when switching from 4.9 to 4.14. Signed-off-by: Rafał Miłecki (cherry picked from commit c6a1bcac16f92afa1e41eaceafc85075d97a74cd) --- ...linking-of-inodes-correctly-while-re.patch | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch diff --git a/target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch b/target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch new file mode 100644 index 00000000000..71e036c9208 --- /dev/null +++ b/target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch @@ -0,0 +1,89 @@ +From: Richard Weinberger +Date: Wed, 7 Nov 2018 23:04:43 +0100 +Subject: [PATCH] ubifs: Handle re-linking of inodes correctly while recovery +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +UBIFS's recovery code strictly assumes that a deleted inode will never +come back, therefore it removes all data which belongs to that inode +as soon it faces an inode with link count 0 in the replay list. +Before O_TMPFILE this assumption was perfectly fine. With O_TMPFILE +it can lead to data loss upon a power-cut. + +Consider a journal with entries like: +0: inode X (nlink = 0) /* O_TMPFILE was created */ +1: data for inode X /* Someone writes to the temp file */ +2: inode X (nlink = 0) /* inode was changed, xattr, chmod, … */ +3: inode X (nlink = 1) /* inode was re-linked via linkat() */ + +Upon replay of entry #2 UBIFS will drop all data that belongs to inode X, +this will lead to an empty file after mounting. + +As solution for this problem, scan the replay list for a re-link entry +before dropping data. + +Fixes: 474b93704f32 ("ubifs: Implement O_TMPFILE") +Cc: stable@vger.kernel.org +Cc: Russell Senior +Cc: Rafał Miłecki +Reported-by: Russell Senior +Reported-by: Rafał Miłecki +Signed-off-by: Richard Weinberger +--- + fs/ubifs/replay.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +--- a/fs/ubifs/replay.c ++++ b/fs/ubifs/replay.c +@@ -210,6 +210,38 @@ static int trun_remove_range(struct ubif + } + + /** ++ * inode_still_linked - check whether inode in question will be re-linked. ++ * @c: UBIFS file-system description object ++ * @rino: replay entry to test ++ * ++ * O_TMPFILE files can be re-linked, this means link count goes from 0 to 1. ++ * This case needs special care, otherwise all references to the inode will ++ * be removed upon the first replay entry of an inode with link count 0 ++ * is found. ++ */ ++static bool inode_still_linked(struct ubifs_info *c, struct replay_entry *rino) ++{ ++ struct replay_entry *r; ++ ++ ubifs_assert(rino->deletion); ++ ubifs_assert(key_type(c, &rino->key) == UBIFS_INO_KEY); ++ ++ /* ++ * Find the most recent entry for the inode behind @rino and check ++ * whether it is a deletion. ++ */ ++ list_for_each_entry_reverse(r, &c->replay_list, list) { ++ ubifs_assert(r->sqnum >= rino->sqnum); ++ if (key_inum(c, &r->key) == key_inum(c, &rino->key)) ++ return r->deletion == 0; ++ ++ } ++ ++ ubifs_assert(0); ++ return false; ++} ++ ++/** + * apply_replay_entry - apply a replay entry to the TNC. + * @c: UBIFS file-system description object + * @r: replay entry to apply +@@ -239,6 +271,11 @@ static int apply_replay_entry(struct ubi + { + ino_t inum = key_inum(c, &r->key); + ++ if (inode_still_linked(c, r)) { ++ err = 0; ++ break; ++ } ++ + err = ubifs_tnc_remove_ino(c, inum); + break; + } From 0d549271d397b963be4ca26406688bc5dccaf123 Mon Sep 17 00:00:00 2001 From: Rinki Kumari Date: Thu, 27 Sep 2018 21:40:15 +0530 Subject: [PATCH 089/399] ar71xx: fix TP-Link Archer C7 v5 switch LEDs Signed-off-by: Rinki Kumari --- .../ar71xx/base-files/etc/board.d/01_leds | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 858d6750082..592133ac286 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -142,7 +142,8 @@ archer-c60-v2) ;; esac ;; -archer-c7-v4) +archer-c7-v4|\ +archer-c7-v5) ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt" ucidef_set_led_switch "wan" "WAN" "$board:green:wan" "switch0" "0x02" @@ -150,8 +151,19 @@ archer-c7-v4) ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan3" "switch0" "0x08" ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan2" "switch0" "0x10" ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan1" "switch0" "0x20" - ucidef_set_led_usbdev "usb1" "USB1" "$board:green:usb1" "1-1" - ucidef_set_led_usbdev "usb2" "USB2" "$board:green:usb2" "2-1" + + case "$board" in + archer-c7-v4) + ucidef_set_led_usbdev "usb1" "USB1" "$board:green:usb1" "1-1" + ucidef_set_led_usbdev "usb2" "USB2" "$board:green:usb2" "2-1" + ;; + esac + + case "$board" in + archer-c7-v5) + ucidef_set_led_usbdev "usb" "USB" "$board:green:usb" "1-1" + ;; + esac ;; arduino-yun) ucidef_set_led_wlan "wlan" "WLAN" "arduino:blue:wlan" "phy0tpt" From 07ef8b70b8734c6c8a8e345ec39fe08466785d23 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 21 Nov 2018 10:45:19 +0100 Subject: [PATCH 090/399] kernel: bump 4.9 to 4.9.138 Refreshed all patches. Compile-tested: ar71xx, layerscape Runtime-tested: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...0-MIPS-PCI-add-controllers-before-the-specified-head.patch | 2 +- ...MIPS-kexec-Accept-command-line-parameters-from-users.patch | 2 +- .../lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 74e52245610..22f279ef7b6 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .137 +LINUX_VERSION-4.9 = .138 LINUX_VERSION-4.14 = .81 -LINUX_KERNEL_HASH-4.9.137 = 6db2512a9094bf4c830124641d1275635600b052962a7db3556da18914ea2589 +LINUX_KERNEL_HASH-4.9.138 = 92301242601d50854b173a3fdec318480e24fc86f32102003a9ed7108fab21b7 LINUX_KERNEL_HASH-4.14.81 = 4b36dfd053844ef0617799d432eed67aa4795d3403216d6789288aa7a0e75bde remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/generic/pending-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch b/target/linux/generic/pending-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch index 3eed80e7142..33f28912a23 100644 --- a/target/linux/generic/pending-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch +++ b/target/linux/generic/pending-4.9/170-MIPS-PCI-add-controllers-before-the-specified-head.patch @@ -19,7 +19,7 @@ Signed-off-by: Mathias Kresin --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c -@@ -190,7 +190,7 @@ void register_pci_controller(struct pci_ +@@ -194,7 +194,7 @@ void register_pci_controller(struct pci_ } INIT_LIST_HEAD(&hose->list); diff --git a/target/linux/generic/pending-4.9/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch b/target/linux/generic/pending-4.9/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch index ff85a13fdae..c7abd99b3b1 100644 --- a/target/linux/generic/pending-4.9/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch +++ b/target/linux/generic/pending-4.9/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch @@ -181,7 +181,7 @@ Signed-off-by: Yousong Zhou /* * The generic kexec code builds a page list with physical -@@ -99,15 +214,16 @@ machine_kexec(struct kimage *image) +@@ -102,15 +217,16 @@ machine_kexec(struct kimage *image) /* * we do not want to be bothered. */ diff --git a/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch index f4013f5e215..c78f6c60312 100644 --- a/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-4.9/0001-MIPS-lantiq-add-pcie-driver.patch @@ -4143,7 +4143,7 @@ Signed-off-by: John Crispin + --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c -@@ -300,3 +300,30 @@ char *__init pcibios_setup(char *str) +@@ -304,3 +304,30 @@ char *__init pcibios_setup(char *str) return pcibios_plat_setup(str); return str; } From 216c04ff208f8bc8a268123a325a01c0a5d78004 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 21 Nov 2018 10:48:37 +0100 Subject: [PATCH 091/399] kernel: bump 4.14 to 4.14.82 Refreshed all patches. Compile-tested: cns3xxx, imx6, x86_64 Runtime-tested: cns3xxx, imx6, x86_64 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch | 4 ++-- ...netfilter-nf_flow_table-fix-offloaded-connection-tim.patch | 4 ++-- ...MIPS-kexec-Accept-command-line-parameters-from-users.patch | 2 +- .../patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 22f279ef7b6..fc333b07364 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .138 -LINUX_VERSION-4.14 = .81 +LINUX_VERSION-4.14 = .82 LINUX_KERNEL_HASH-4.9.138 = 92301242601d50854b173a3fdec318480e24fc86f32102003a9ed7108fab21b7 -LINUX_KERNEL_HASH-4.14.81 = 4b36dfd053844ef0617799d432eed67aa4795d3403216d6789288aa7a0e75bde +LINUX_KERNEL_HASH-4.14.82 = a790a2e6f6a76d70decec91d1b7bcfba90f821b076273da070f6e0e1e6391dad remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch b/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch index 5aae823ed7f..7788dd14349 100644 --- a/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch +++ b/target/linux/generic/backport-4.14/320-v4.16-netfilter-nf_conntrack-add-IPS_OFFLOAD-status-bit.patch @@ -57,7 +57,7 @@ Signed-off-by: Pablo Neira Ayuso if (nf_ct_is_expired(tmp)) { nf_ct_gc_expired(tmp); continue; -@@ -975,6 +978,18 @@ static bool gc_worker_can_early_drop(con +@@ -978,6 +981,18 @@ static bool gc_worker_can_early_drop(con return false; } @@ -76,7 +76,7 @@ Signed-off-by: Pablo Neira Ayuso static void gc_worker(struct work_struct *work) { unsigned int min_interval = max(HZ / GC_MAX_BUCKETS_DIV, 1u); -@@ -1011,6 +1026,11 @@ static void gc_worker(struct work_struct +@@ -1014,6 +1029,11 @@ static void gc_worker(struct work_struct tmp = nf_ct_tuplehash_to_ctrack(h); scanned++; diff --git a/target/linux/generic/backport-4.14/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch b/target/linux/generic/backport-4.14/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch index e68395c69e1..e17b4b62049 100644 --- a/target/linux/generic/backport-4.14/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch +++ b/target/linux/generic/backport-4.14/370-netfilter-nf_flow_table-fix-offloaded-connection-tim.patch @@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c -@@ -978,18 +978,6 @@ static bool gc_worker_can_early_drop(con +@@ -981,18 +981,6 @@ static bool gc_worker_can_early_drop(con return false; } @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau static void gc_worker(struct work_struct *work) { unsigned int min_interval = max(HZ / GC_MAX_BUCKETS_DIV, 1u); -@@ -1026,10 +1014,8 @@ static void gc_worker(struct work_struct +@@ -1029,10 +1017,8 @@ static void gc_worker(struct work_struct tmp = nf_ct_tuplehash_to_ctrack(h); scanned++; diff --git a/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch b/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch index 86aed4f0f76..1187543a46f 100644 --- a/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch +++ b/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch @@ -184,7 +184,7 @@ Signed-off-by: Yousong Zhou /* * The generic kexec code builds a page list with physical -@@ -121,15 +235,16 @@ machine_kexec(struct kimage *image) +@@ -124,15 +238,16 @@ machine_kexec(struct kimage *image) /* * we do not want to be bothered. */ diff --git a/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch index f72f39448b0..48dd111cca3 100644 --- a/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch +++ b/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch @@ -4143,7 +4143,7 @@ Signed-off-by: John Crispin + --- a/arch/mips/pci/pci-legacy.c +++ b/arch/mips/pci/pci-legacy.c -@@ -309,3 +309,30 @@ char *__init pcibios_setup(char *str) +@@ -313,3 +313,30 @@ char *__init pcibios_setup(char *str) return pcibios_plat_setup(str); return str; } From 709d080da5c357d7139044b668bacf1d154fc976 Mon Sep 17 00:00:00 2001 From: Linus Kardell Date: Thu, 22 Nov 2018 11:35:08 +0100 Subject: [PATCH 092/399] base-files: fix unkillable processes after restart When restart is run on an init script, the script traps SIGTERM. This is done as a workaround for scripts named the same name as the program they start. In that case, the init script process will have the same name as the program process, and so when the init script runs killall, it will kill itself. So SIGTERM is trapped to make the init script unkillable. However, the trap is retained when the init script runs start, and thus processes started by restart will not respond to SIGTERM, and will thus be unkillable unless you use SIGKILL. This fixes that by removing the trap before running start. Signed-off-by: Linus Kardell (cherry picked from commit 2ac1a57677ce4e21513dca2a8efab1eb6e0a9c58) --- package/base-files/files/etc/rc.common | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 3e237170b4c..d9773a0c5aa 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -23,6 +23,7 @@ reload() { restart() { trap '' TERM stop "$@" + trap - TERM start "$@" } From a02d9a7d9fc8d005b27351509f02d3970e21972e Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 7 Nov 2018 22:31:46 +0100 Subject: [PATCH 093/399] tools: tplink-safeloader: add C7v5 EU SupportList Currently flash from WebIF is broken for Archer C7 v5 EU models as their SupportList entries are missing. The added entries originate from TP-Links latest Archer C7 v5 EU firmware. Signed-off-by: David Bauer (cherry picked from commit 53020ed4b981d8d48394842d0aff1a0d0497cc1c) --- tools/firmware-utils/src/tplink-safeloader.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index b2cc96bc3ce..4b227e1c97b 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -626,7 +626,11 @@ static struct device_info boards[] = { .support_list = "SupportList:\n" "{product_name:Archer C7,product_ver:5.0.0,special_id:00000000}\n" - "{product_name:Archer C7,product_ver:5.0.0,special_id:55530000}\n", + "{product_name:Archer C7,product_ver:5.0.0,special_id:45550000}\n" + "{product_name:Archer C7,product_ver:5.0.0,special_id:55530000}\n" + "{product_name:Archer C7,product_ver:5.0.0,special_id:43410000}\n" + "{product_name:Archer C7,product_ver:5.0.0,special_id:4A500000}\n" + "{product_name:Archer C7,product_ver:5.0.0,special_id:54570000}\n", .support_trail = '\x00', .soft_ver = "soft_ver:1.0.0\n", From 5337319bdfdecf46aa3e56e26fb750fd18d19c5c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 24 Nov 2018 20:10:26 +0100 Subject: [PATCH 094/399] uclient: update to latest Git head 3ba74eb uclient-http: properly handle HTTP redirects via proxy connections Signed-off-by: Jo-Philipp Wich (cherry picked from commit 0bd99db5118665bbe17f84427238c322af3deaae) --- package/libs/uclient/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 888fce3e2aa..256c172f518 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git -PKG_SOURCE_DATE:=2018-08-03 -PKG_SOURCE_VERSION:=ae1c656ff041c6f1ccb37b070fa261e0d71f2b12 -PKG_MIRROR_HASH:=e88c92f880d3c1cf4162f62c4eeb8986baa8d73772e51eed3a60a8346aeb1b7c +PKG_SOURCE_DATE:=2018-11-24 +PKG_SOURCE_VERSION:=3ba74ebc9363993ea2a83fd73b4c1b1a96e73940 +PKG_MIRROR_HASH:=3c456a8ab965ed8db216ac1bfaf2b974e2f689137a7c35d0220e5b7d9c42a994 CMAKE_INSTALL:=1 PKG_BUILD_DEPENDS:=ustream-ssl From 26ebcc88e3de61cbfb7fc2845b617c5b3a73cac8 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 14 Oct 2018 23:53:56 +0200 Subject: [PATCH 095/399] apm821xx: wndr4700: restore sd-card media detection This was not converted to the new, dt-based board name. Fixes: e90dc8d2722 ("apm821xx: convert to device-tree board detection") Signed-off-by: Christian Lamparter --- target/linux/apm821xx/base-files/etc/rc.button/BTN_1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 index c011c857539..5ecf346b532 100755 --- a/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 +++ b/target/linux/apm821xx/base-files/etc/rc.button/BTN_1 @@ -4,7 +4,7 @@ BOARD=$(board_name) -if [ $BOARD == "wndr4700" ]; then +if [ $BOARD == "netgear,wndr4700" ]; then case "$ACTION" in released) rmmod dwc2 From 9671a2d2c8f91db78f0d4e084422743c9f66d38c Mon Sep 17 00:00:00 2001 From: Freddy Leitner Date: Mon, 26 Nov 2018 19:14:19 +0100 Subject: [PATCH 096/399] apm821xx: MBL: load kernel/dtb from SATA 0:1 first This remedies an issue with the MBL Duo if both disks are inserted and contain OpenWrt. kernel and dtb would be loaded from SATA 1:1 while rootfs (/dev/sda2) would be mounted on SATA 0:1. Such a mix&match would obviously only work if both OpenWrt versions/ builds are identical, and especially fail after sysupgrade upgraded the system disk on SATA 0:1. The fallback to SATA 1:1 needs to be kept for MBL Single (only has SATA 1:1) and MBL Duo with one disk inserted on SATA 1:1. To speed up booting in those cases, the unneccesarily doubled "sata init" will only be called once. (In theory it could be omitted completely since the on-flash boot script already initializes SATA to load the on-disk boot script.) Tested on MBL Duo (all possible combination of disks) and MBL Single Signed-off-by: Freddy Leitner Acked-by: Christian Lamparter --- target/linux/apm821xx/image/mbl_boot.scr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/apm821xx/image/mbl_boot.scr b/target/linux/apm821xx/image/mbl_boot.scr index 062dc2725a5..20e48dcef6e 100644 --- a/target/linux/apm821xx/image/mbl_boot.scr +++ b/target/linux/apm821xx/image/mbl_boot.scr @@ -1,6 +1,6 @@ setenv boot_args 'setenv bootargs root=/dev/sda2 rw rootfstype=ext4' -setenv load_part1 'sata init; ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb' -setenv load_part2 'sata init; ext2load sata 0:1 ${kernel_addr_r} /boot/uImage; ext2load sata 0:1 ${fdt_addr_r} /boot/apollo3g.dtb' -setenv load_sata 'if run load_part1; then echo Loaded part 1; elif run load_part2; then echo Loaded part 2; fi' +setenv load_part1 'ext2load sata 0:1 ${kernel_addr_r} /boot/uImage; ext2load sata 0:1 ${fdt_addr_r} /boot/apollo3g.dtb' +setenv load_part2 'ext2load sata 1:1 ${kernel_addr_r} /boot/uImage; ext2load sata 1:1 ${fdt_addr_r} /boot/apollo3g.dtb' +setenv load_sata 'sata init; if run load_part1; then echo Loaded part 1; elif run load_part2; then echo Loaded part 2; fi' setenv boot_sata 'run load_sata; run boot_args addtty; bootm ${kernel_addr_r} - ${fdt_addr_r}' run boot_sata From fede6df09e797e4f5174534dbd0617173099cb6d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 21 Aug 2018 14:48:47 +0200 Subject: [PATCH 097/399] uhttpd: update to latest Git head 952bf9d build: use _DEFAULT_SOURCE 30a18cb uhttpd: recognize PATCH, PUT and DELETE HTTP methods Signed-off-by: Jo-Philipp Wich (cherry picked from commit 22681cdef21be45d4d2c3e21939209ea618b66e4) --- package/network/services/uhttpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 0872b22aa83..9df6050480d 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git -PKG_SOURCE_DATE:=2018-06-26 -PKG_SOURCE_VERSION:=796d42bceed2015bb00309a3bf0f49279b070c19 -PKG_MIRROR_HASH:=b9c79a74a112a5a2551012aa30a072121198f44d308f12948faeb792f0c6410a +PKG_SOURCE_DATE:=2018-08-21 +PKG_SOURCE_VERSION:=952bf9d754d021ee9c08f9add5c9af53aaaf39ae +PKG_MIRROR_HASH:=34cd66b4c8b4a384e31f3821a4536854491ed2cd62f49c7ae0b0cd4381f061dd PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC From 7a8b75375c2442dccc67af51584ca33c94ee0c57 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 23 Aug 2018 09:07:23 +0200 Subject: [PATCH 098/399] uhttpd: support multiple Lua prefixes Update to latest git HEAD in order to support configuring multiple concurrent Lua prefixes in a single uhttpd instance: b741dec lua: support multiple Lua prefixes Additionally rework the init script and update the default configuration example to treat the lua_prefix option as key=value uci list, similar to the interpreter extension mapping. Support for the old "option lua_prefix" plus "option lua_handler" notation is still present. Finally drop the sed postinstall hack in uhttpd-mod-lua to avoid mangling files belonging to other packages. Since Lua prefixes have precedence over CGI prefixes, simply register `/cgi-bin/luci` as Lua handler which will only become active if both luci-base and uhttpd-mod-lua is installed. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 214146c6f298e593695c29b8c04a418dac914040) --- package/network/services/uhttpd/Makefile | 16 +++--------- .../services/uhttpd/files/uhttpd.config | 11 +++++--- .../network/services/uhttpd/files/uhttpd.init | 26 ++++++++++++++++--- 3 files changed, 32 insertions(+), 21 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 9df6050480d..af322b53b6b 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git -PKG_SOURCE_DATE:=2018-08-21 -PKG_SOURCE_VERSION:=952bf9d754d021ee9c08f9add5c9af53aaaf39ae -PKG_MIRROR_HASH:=34cd66b4c8b4a384e31f3821a4536854491ed2cd62f49c7ae0b0cd4381f061dd +PKG_SOURCE_DATE:=2018-08-23 +PKG_SOURCE_VERSION:=b741dec35698a80266fb8206970638e666774a33 +PKG_MIRROR_HASH:=2f7c88ba1b36dd6776a7d954b4c5e96aff288992acf19152a38641c665e261e4 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC @@ -107,16 +107,6 @@ define Package/uhttpd-mod-ubus/install $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus endef -define Package/uhttpd-mod-lua/postinst - $(if $(CONFIG_uhttpd_lua), - #!/bin/sh - if [ -f $${IPKG_INSTROOT}/www/index.html ] - then - sed -e 's:/cgi-bin::g' -i $${IPKG_INSTROOT}/www/index.html - fi - ,) -endef - $(eval $(call BuildPackage,uhttpd)) $(eval $(call BuildPackage,uhttpd-mod-lua)) diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index a7d769e1887..a3deb9cf043 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -49,10 +49,13 @@ config uhttpd main # list interpreter ".php=/usr/bin/php-cgi" # list interpreter ".cgi=/usr/bin/perl" - # Lua url prefix and handler script. - # Lua support is disabled if no prefix given. - option lua_prefix /luci - option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua + # List of prefix->Lua handler mappings. + # Any request to an URL beneath the prefix + # will be dispatched to the associated Lua + # handler script. Lua support is disabled when + # no handler mappings are specified. Lua prefix + # matches have precedence over the CGI prefix. + list lua_prefix "/cgi-bin/luci=/usr/lib/lua/luci/sgi/uhttpd.lua" # Specify the ubus-rpc prefix and socket path. # option ubus_prefix /ubus diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 47270bcc159..dc496b3e282 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -74,6 +74,18 @@ create_httpauth() { haveauth=1 } +append_lua_prefix() { + local v="$1" + local prefix="${v%%=*}" + local handler="${v#*=}" + + if [ "$prefix" != "$handler" ] && [ -n "$prefix" ] && [ -f "$handler" ]; then + procd_append_param command -l "$prefix" -L "$handler" + else + echo "Skipping invalid Lua prefix \"$v\"" >&2 + fi +} + start_instance() { UHTTPD_CERT="" @@ -105,10 +117,16 @@ start_instance() append_arg "$cfg" config "-c" append_arg "$cfg" cgi_prefix "-x" [ -f /usr/lib/uhttpd_lua.so ] && { - config_get handler "$cfg" lua_handler - [ -f "$handler" ] && append_arg "$cfg" lua_prefix "-l" && { - procd_append_param command "-L" "$handler" - } + local len + config_get len "$cfg" lua_prefix_LENGTH + + if [ -n "$len" ]; then + config_list_foreach "$cfg" lua_prefix append_lua_prefix + else + config_get prefix "$cfg" lua_prefix + config_get handler "$cfg" lua_handler + append_lua_prefix "$prefix=$handler" + fi } [ -f /usr/lib/uhttpd_ubus.so ] && { append_arg "$cfg" ubus_prefix "-u" From a8b292afe6d2a9ff2186a98df6d4ab0eb47fcba7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 28 Nov 2018 12:42:24 +0100 Subject: [PATCH 099/399] uhttpd: update to latest Git head cdfc902 cgi: escape url in 403 error output 0bba1ce uhttpd: fix building without TLS and Lua support 2ed3341 help: document -A option fa5fd45 file: fix CPP syntax error 77b774b build: avoid redefining _DEFAULT_SOURCE Signed-off-by: Jo-Philipp Wich (cherry picked from commit 56378bc12da1aa4f9434bd1119ec770096d92cac) --- package/network/services/uhttpd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index af322b53b6b..da426d47002 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git -PKG_SOURCE_DATE:=2018-08-23 -PKG_SOURCE_VERSION:=b741dec35698a80266fb8206970638e666774a33 -PKG_MIRROR_HASH:=2f7c88ba1b36dd6776a7d954b4c5e96aff288992acf19152a38641c665e261e4 +PKG_SOURCE_DATE:=2018-11-28 +PKG_SOURCE_VERSION:=cdfc902a4cb77bc538a729f9e1c8a8578454a0e5 +PKG_MIRROR_HASH:=6b21111547a4453355bd6c941a47f0116a652a77d87c1e05a035168b8ab2aa6f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC From cc8e8750397b721438e312d492433014d46b3a0c Mon Sep 17 00:00:00 2001 From: Karl Vogel Date: Thu, 29 Nov 2018 09:07:21 +0100 Subject: [PATCH 100/399] sdk: find kernel modules when KDIR is a symlink The find statement would not return any results if the KDIR_BASE pointed to a symlink. Ran into this issue due to a custom Kernel/Prepare that was installing a symlink to the kernel directory. The extra slash at the end fixes this scenario and does no harm for targets that have a proper KDIR. Signed-off-by: Karl Vogel (cherry picked from commit ae980458abf8299d614f4b34add32e18d054378d) --- target/sdk/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/sdk/Makefile b/target/sdk/Makefile index a9df8be7d22..95ac3be1975 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -83,7 +83,7 @@ $(BIN_DIR)/$(SDK_NAME).tar.xz: clean mkdir -p $(SDK_BUILD_DIR)/dl $(SDK_BUILD_DIR)/package $(CP) -L $(INCLUDE_DIR) $(SCRIPT_DIR) $(SDK_BUILD_DIR)/ $(TAR) -cf - -C $(TOPDIR) \ - `cd $(TOPDIR); find $(KDIR_BASE) -name \*.ko` \ + `cd $(TOPDIR); find $(KDIR_BASE)/ -name \*.ko` \ `cd $(TOPDIR); find $(KDIR_BASE)/firmware/ -newer $(KDIR_BASE)/firmware/Makefile \ -type f -name '*.bin' -or -name '*.cis' -or -name '*.csp' -or -name '*.dsp' -or -name '*.fw'` \ $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \ From d40de11d1b2efb446139f206840327e4178f2de4 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Fri, 2 Mar 2018 20:04:36 -0800 Subject: [PATCH 101/399] base-files: fix prerm return value, align with postinst code The return value of a package prerm script is discarded and not returned correctly by default_prerm(). This allows other operations like service shutdown to "leak" their return value, prompting workarounds like commit 48cfc826 which do not address the root cause. Preserve a package prerm script return value for use by default_prerm(), sharing the corresponding code from default_postinst() for consistency. Also use consistent code for handling of /etc/init.d/ scripts. Run Tested on: LEDE 17.01.4 running ar71xx. Signed-off-by: Tony Ambardar (cherry picked from commit 8806da86f5da3b1b1e4d24259d168e2219c01a26) --- package/base-files/files/lib/functions.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 318e91856b4..f16ffd17469 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -152,22 +152,27 @@ config_list_foreach() { default_prerm() { local root="${IPKG_INSTROOT}" - local name + local pkgname="$(basename ${1%.*})" + local ret=0 - name=$(basename ${1%.*}) - [ -f "$root/usr/lib/opkg/info/${name}.prerm-pkg" ] && . "$root/usr/lib/opkg/info/${name}.prerm-pkg" + if [ -f "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" ]; then + ( . "$root/usr/lib/opkg/info/${pkgname}.prerm-pkg" ) + ret=$? + fi local shell="$(which bash)" - for i in `cat "$root/usr/lib/opkg/info/${name}.list" | grep "^/etc/init.d/"`; do + for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable else if [ "$PKG_UPGRADE" != "1" ]; then "$i" disable fi - "$i" stop || /bin/true + "$i" stop fi done + + return $ret } add_group_and_user() { From d40e90986c65fb5678d5d1e2563efe4c44472d9f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 29 Nov 2018 11:59:20 +0100 Subject: [PATCH 102/399] rules.mk: add INSTALL_SUID macro This is useful for packages that want to stage SUID executables. Signed-off-by: Jo-Philipp Wich (cherry picked from commit b0261ee5e9bcbc743960727b5aad1829250d1add) --- rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.mk b/rules.mk index a97b2d21556..56ecbf2eb8f 100644 --- a/rules.mk +++ b/rules.mk @@ -276,6 +276,7 @@ PATCH:=patch PYTHON:=python INSTALL_BIN:=install -m0755 +INSTALL_SUID:install -m4755 INSTALL_DIR:=install -d -m0755 INSTALL_DATA:=install -m0644 INSTALL_CONF:=install -m0600 From 06a20afb34994608044e8a6974371111086e31bb Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 29 Nov 2018 12:32:34 +0100 Subject: [PATCH 103/399] rules.mk: fix syntax error Fix broken assignment operator added in a previous commit. Fixes db73ec9f51 ("rules.mk: add INSTALL_SUID macro") Signed-off-by: Jo-Philipp Wich (cherry picked from commit 1416b63dcbadbb5c11c2591b4513f5276b6dc744) --- rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.mk b/rules.mk index 56ecbf2eb8f..38afc7777af 100644 --- a/rules.mk +++ b/rules.mk @@ -276,7 +276,7 @@ PATCH:=patch PYTHON:=python INSTALL_BIN:=install -m0755 -INSTALL_SUID:install -m4755 +INSTALL_SUID:=install -m4755 INSTALL_DIR:=install -d -m0755 INSTALL_DATA:=install -m0644 INSTALL_CONF:=install -m0600 From fbadfecbb5471ce9f8b814f5facdea5d48e246dc Mon Sep 17 00:00:00 2001 From: Marek Lindner Date: Sun, 2 Dec 2018 22:02:04 +0800 Subject: [PATCH 104/399] ipq40xx: fix openmesh sysupgrade with tar content out of order The tar extraction depends on the order in which the files are added to the tar file. Since the order is not guaranteed and depends on the host system, the combined mtd write fails with sysupgrade images built on some systems. Fix by changing to tar file order independent mtd write. Fixes: 86e18f6706e1 ("ipq806x: add support for OpenMesh A42") Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann --- target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh b/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh index f7aed7c9b64..7cc60c00e9c 100644 --- a/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh +++ b/target/linux/ipq40xx/base-files/lib/upgrade/openmesh.sh @@ -76,9 +76,9 @@ platform_do_upgrade_openmesh() { # take care of restoring a saved config [ "$SAVE_CONFIG" -eq 1 ] && restore_backup="${MTD_CONFIG_ARGS} -j ${CONF_TAR}" - # write concatinated kernel + rootfs to flash - tar xf $tar_file ${board_dir}/kernel ${board_dir}/root -O | \ - mtd $restore_backup write - $PART_NAME + mtd -q erase inactive + tar xf $tar_file ${board_dir}/root -O | mtd -n -p $kernel_length $restore_backup write - $PART_NAME + tar xf $tar_file ${board_dir}/kernel -O | mtd -n write - $PART_NAME # prepare new u-boot env if [ "$next_boot_part" = "1" ]; then From 1cd945ea2289f5b6047351da09d8cc2338bb002d Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Fri, 2 Nov 2018 20:52:01 +0100 Subject: [PATCH 105/399] ramips: fix leds on GL.iNet GL-MT300N-V2 The WAN LED now shows the link state. It's color is green, not blue. Signed-off-by: Martin Weinelt (cherry picked from commit 0411813c6f0520dea23a1c4f58f5956c504bf129) --- target/linux/ramips/base-files/etc/board.d/01_leds | 1 + target/linux/ramips/dts/GL-MT300N-V2.dts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 54504c6ee8b..60572759785 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -210,6 +210,7 @@ gl-mt750) ;; gl-mt300n-v2) set_wifi_led "$boardname:red:wlan" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x1" ;; hc5661|\ hc5661a) diff --git a/target/linux/ramips/dts/GL-MT300N-V2.dts b/target/linux/ramips/dts/GL-MT300N-V2.dts index e99d5578f05..98c9a796330 100644 --- a/target/linux/ramips/dts/GL-MT300N-V2.dts +++ b/target/linux/ramips/dts/GL-MT300N-V2.dts @@ -28,7 +28,7 @@ }; wan { - label = "gl-mt300n-v2:blue:wan"; + label = "gl-mt300n-v2:green:wan"; gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; }; From 629073e86d9f43e24819e18c25c9eb63801a65a0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 22 Nov 2018 14:42:14 +0100 Subject: [PATCH 106/399] rpcd: update to latest Git head 3aa81d0 file: access exec timeout via daemon ops structure 7235f34 plugin: store pointer to exec timeout value in the ops structure ccd7c0a treewide: rename exec_timeout to rpc_exec_timeout c79ef22 main: fix logic bug when not specifying a timeout option 2cc4b99 file: use global exec timeout instead of own hardcoded limit ecd1660 exec: increase maximum execution time to 120s Also expose the socket and timeout options in /etc/config/rpcd for easier use. Signed-off-by: Jo-Philipp Wich (cherry picked from commits 41055551151e12abf8efe710efa4dc025a7b7b6a, 952b11766cd83898cf8f9626b75141eac6d4ad1a and e533fb17061027dca2cc60a9555fc2edb9e832eb) --- package/system/rpcd/Makefile | 6 +++--- package/system/rpcd/files/rpcd.config | 3 +++ package/system/rpcd/files/rpcd.init | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index fee2c5b33d3..14cbdaf9c6b 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -12,10 +12,10 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2018-08-16 -PKG_SOURCE_VERSION:=41333abee4c57e3de2bcfa08972954e2af20705a +PKG_SOURCE_DATE:=2018-11-28 +PKG_SOURCE_VERSION:=3aa81d0dfae167eccc26203bd0c96f3e3450f253 PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=a6d3c2228836a738919dfbd57a9e3ae5d427d5f94607b7e78b92b03f09f59731 +PKG_MIRROR_HASH:=1befc5e1793a687e7a37b4f4d611e5f95aef4b79ad4b288c4dcb4c74d212509b PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/system/rpcd/files/rpcd.config b/package/system/rpcd/files/rpcd.config index 499ea276287..faaed7f538d 100644 --- a/package/system/rpcd/files/rpcd.config +++ b/package/system/rpcd/files/rpcd.config @@ -1,3 +1,6 @@ +config rpcd + option socket /var/run/ubus.sock + option timeout 30 config login option username 'root' diff --git a/package/system/rpcd/files/rpcd.init b/package/system/rpcd/files/rpcd.init index 98b633365b8..0a37ee19f92 100755 --- a/package/system/rpcd/files/rpcd.init +++ b/package/system/rpcd/files/rpcd.init @@ -7,8 +7,11 @@ NAME=rpcd PROG=/sbin/rpcd start_service() { + local socket=$(uci -q get rpcd.@rpcd[0].socket) + local timeout=$(uci -q get rpcd.@rpcd[0].timeout) + procd_open_instance - procd_set_param command "$PROG" + procd_set_param command "$PROG" ${socket:+-s "$socket"} ${timeout:+-t "$timeout"} procd_close_instance } From d5afaa41148b363128626135bfb73b156887cddb Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Wed, 12 Dec 2018 13:43:20 +0100 Subject: [PATCH 107/399] openvpn: re-add option comp_lzo This option is deprecated but needs to be kept for backward compatibility. [0] [0] https://community.openvpn.net/openvpn/wiki/DeprecatedOptions#a--comp-lzo Signed-off-by: Martin Schiller Signed-off-by: Hans Dedecker [PKG_RELEASE increase] (cherry picked from commit 3850b41f01925a7eddc24033ed155503c1ad2112) --- package/network/services/openvpn/Makefile | 2 +- package/network/services/openvpn/files/openvpn.options | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index 374e14f7bd6..ae49d4dc687 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn PKG_VERSION:=2.4.5 -PKG_RELEASE:=4 +PKG_RELEASE:=4.1 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ diff --git a/package/network/services/openvpn/files/openvpn.options b/package/network/services/openvpn/files/openvpn.options index 6c084d22dca..c206c458a5c 100644 --- a/package/network/services/openvpn/files/openvpn.options +++ b/package/network/services/openvpn/files/openvpn.options @@ -14,6 +14,7 @@ cipher client_config_dir client_connect client_disconnect +comp_lzo compress connect_freq connect_retry From bcd7644007eba9caa1b0dd535acd6266b04fe8df Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 28 Nov 2018 12:36:15 +0100 Subject: [PATCH 108/399] kernel: bump 4.9 to 4.9.143 Refreshed all patches. Altered patches: - 950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch - 950-0149-Update-vfpmodule.c.patch - 201-extra_optimization.patch New symbol: - CONFIG_HARDEN_BRANCH_PREDICTOR Compile-tested on: ar71xx, ar7, arc770, at91, brcm2708, brcm63xx, ixp4xx, lantiq, layerscape, mpc85xx, orion, rb532, uml Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- target/linux/at91/config-4.9 | 1 + target/linux/brcm2708/bcm2708/config-4.9 | 1 + target/linux/brcm2708/bcm2709/config-4.9 | 1 + ...0001-smsx95xx-fix-crimes-against-truesize.patch | 4 ++-- ...gnore-dtco-targets-when-filtering-symbols.patch | 2 +- .../patches-4.9/950-0031-Add-dwc_otg-driver.patch | 2 +- ...opy_to_user-and-__copy_from_user-performa.patch | 10 +++++++--- .../patches-4.9/950-0149-Update-vfpmodule.c.patch | 10 +++++----- ...Use-skb_cow_head-to-deal-with-cloned-skbs.patch | 2 +- .../generic/hack-4.9/207-disable-modorder.patch | 4 ++-- .../linux/generic/hack-4.9/220-gc_sections.patch | 6 +++--- .../generic/hack-4.9/221-module_exports.patch | 2 +- .../pending-4.9/201-extra_optimization.patch | 8 ++++---- ...jecting-with-source-address-failed-policy.patch | 14 +++++++------- ...80-NET-skip-GRO-for-foreign-MAC-addresses.patch | 8 ++++---- target/linux/layerscape/armv8_32b/config-4.9 | 1 + .../202-core-linux-support-layerscape.patch | 2 +- .../patches-4.9/817-usb-support-layerscape.patch | 6 +++--- 19 files changed, 48 insertions(+), 40 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index fc333b07364..f8c67e44d72 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .138 +LINUX_VERSION-4.9 = .143 LINUX_VERSION-4.14 = .82 -LINUX_KERNEL_HASH-4.9.138 = 92301242601d50854b173a3fdec318480e24fc86f32102003a9ed7108fab21b7 +LINUX_KERNEL_HASH-4.9.143 = 0eb76464a696675fd4f8762e390328a377e973bfa263b00544ca1b5b10ac2cbf LINUX_KERNEL_HASH-4.14.82 = a790a2e6f6a76d70decec91d1b7bcfba90f821b076273da070f6e0e1e6391dad remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/at91/config-4.9 b/target/linux/at91/config-4.9 index 59a092b8569..3a32b0accf3 100644 --- a/target/linux/at91/config-4.9 +++ b/target/linux/at91/config-4.9 @@ -202,6 +202,7 @@ CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_SYSFS=y CONFIG_GRACE_PERIOD=y CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/brcm2708/bcm2708/config-4.9 b/target/linux/brcm2708/bcm2708/config-4.9 index 116dd257dd5..ce01582fec7 100644 --- a/target/linux/brcm2708/bcm2708/config-4.9 +++ b/target/linux/brcm2708/bcm2708/config-4.9 @@ -187,6 +187,7 @@ CONFIG_GPIOLIB=y # CONFIG_GPIO_BCM_VIRT is not set CONFIG_GPIO_SYSFS=y CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/brcm2708/bcm2709/config-4.9 b/target/linux/brcm2708/bcm2709/config-4.9 index 4e505edcedb..0910fa6ea78 100644 --- a/target/linux/brcm2708/bcm2709/config-4.9 +++ b/target/linux/brcm2708/bcm2709/config-4.9 @@ -202,6 +202,7 @@ CONFIG_GPIO_BCM_EXP=y CONFIG_GPIO_BCM_VIRT=y CONFIG_GPIO_SYSFS=y CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch b/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch index 8916e52741d..b0de3f211a0 100644 --- a/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch +++ b/target/linux/brcm2708/patches-4.9/950-0001-smsx95xx-fix-crimes-against-truesize.patch @@ -25,7 +25,7 @@ Signed-off-by: Steve Glendinning static int __must_check __smsc95xx_read_reg(struct usbnet *dev, u32 index, u32 *data, int in_pm) { -@@ -1954,7 +1958,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1961,7 +1965,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(skb); skb_trim(skb, skb->len - 4); /* remove fcs */ @@ -35,7 +35,7 @@ Signed-off-by: Steve Glendinning return 1; } -@@ -1972,7 +1977,8 @@ static int smsc95xx_rx_fixup(struct usbn +@@ -1979,7 +1984,8 @@ static int smsc95xx_rx_fixup(struct usbn if (dev->net->features & NETIF_F_RXCSUM) smsc95xx_rx_csum_offload(ax_skb); skb_trim(ax_skb, ax_skb->len - 4); /* remove fcs */ diff --git a/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch b/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch index 52fe8a22818..28f337b0e3b 100644 --- a/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch +++ b/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch @@ -9,7 +9,7 @@ Subject: [PATCH] kbuild: Ignore dtco targets when filtering symbols --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include -@@ -285,7 +285,7 @@ ksym_dep_filter = +@@ -295,7 +295,7 @@ ksym_dep_filter = $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \ as_*_S|cpp_s_S) \ $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \ diff --git a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch index 12174919bb3..707e1a34a1e 100644 --- a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch @@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5072,7 +5072,7 @@ static void port_event(struct usb_hub *h +@@ -5074,7 +5074,7 @@ static void port_event(struct usb_hub *h if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; diff --git a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch index 016d48dd2c5..c1e5858bce9 100644 --- a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -57,7 +57,7 @@ Signed-off-by: Phil Elwell #define memset(p,v,n) \ --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h -@@ -477,6 +477,9 @@ do { \ +@@ -489,6 +489,9 @@ do { \ extern unsigned long __must_check arm_copy_from_user(void *to, const void __user *from, unsigned long n); @@ -262,17 +262,21 @@ Signed-off-by: Phil Elwell +.endm --- a/arch/arm/lib/copy_from_user.S +++ b/arch/arm/lib/copy_from_user.S -@@ -89,11 +89,13 @@ +@@ -89,7 +89,8 @@ .text -ENTRY(arm_copy_from_user) +ENTRY(__copy_from_user_std) +WEAK(arm_copy_from_user) + #ifdef CONFIG_CPU_SPECTRE + get_thread_info r3 + ldr r3, [r3, #TI_ADDR_LIMIT] +@@ -102,7 +103,7 @@ ENTRY(arm_copy_from_user) #include "copy_template.S" - ENDPROC(arm_copy_from_user) +-ENDPROC(arm_copy_from_user) +ENDPROC(__copy_from_user_std) .pushsection .fixup,"ax" diff --git a/target/linux/brcm2708/patches-4.9/950-0149-Update-vfpmodule.c.patch b/target/linux/brcm2708/patches-4.9/950-0149-Update-vfpmodule.c.patch index 16d740aafb2..78606ed61b1 100644 --- a/target/linux/brcm2708/patches-4.9/950-0149-Update-vfpmodule.c.patch +++ b/target/linux/brcm2708/patches-4.9/950-0149-Update-vfpmodule.c.patch @@ -102,15 +102,15 @@ Signed-off-by: Christopher Alexander Tobias Schulze vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN); fmxr(FPEXC, fpexc); } -@@ -604,6 +611,7 @@ int vfp_restore_user_hwstate(struct user +@@ -602,6 +609,7 @@ int vfp_restore_user_hwstate(struct user + struct thread_info *thread = current_thread_info(); struct vfp_hard_struct *hwstate = &thread->vfpstate.hard; unsigned long fpexc; - int err = 0; + u32 fpsid = fmrx(FPSID); /* Disable VFP to avoid corrupting the new thread state. */ vfp_flush_hwstate(thread); -@@ -627,8 +635,12 @@ int vfp_restore_user_hwstate(struct user +@@ -624,8 +632,12 @@ int vfp_restore_user_hwstate(struct user /* Ensure the VFP is enabled. */ fpexc |= FPEXC_EN; @@ -124,8 +124,8 @@ Signed-off-by: Christopher Alexander Tobias Schulze + hwstate->fpexc = fpexc; - __get_user_error(hwstate->fpinst, &ufp_exc->fpinst, err); -@@ -698,7 +710,8 @@ void kernel_neon_begin(void) + hwstate->fpinst = ufp_exc->fpinst; +@@ -695,7 +707,8 @@ void kernel_neon_begin(void) cpu = get_cpu(); fpexc = fmrx(FPEXC) | FPEXC_EN; diff --git a/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch b/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch index c665900dc4d..9fbdfe4a043 100644 --- a/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch +++ b/target/linux/generic/backport-4.9/023-1-smsc95xx-Use-skb_cow_head-to-deal-with-cloned-skbs.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c -@@ -2004,13 +2004,13 @@ static struct sk_buff *smsc95xx_tx_fixup +@@ -2011,13 +2011,13 @@ static struct sk_buff *smsc95xx_tx_fixup /* We do not advertise SG, so skbs should be already linearized */ BUG_ON(skb_shinfo(skb)->nr_frags); diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 22e863c2866..e92f4fa0bf3 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1213,7 +1213,6 @@ all: modules +@@ -1226,7 +1226,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1243,7 +1242,6 @@ _modinst_: +@@ -1256,7 +1255,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index 31317448992..ea805090357 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -638,11 +643,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -671,11 +676,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) @@ -43,8 +43,8 @@ Signed-off-by: Gabor Juhos -endif - ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE - KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) - else + KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) + KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -81,6 +81,7 @@ config ARM diff --git a/target/linux/generic/hack-4.9/221-module_exports.patch b/target/linux/generic/hack-4.9/221-module_exports.patch index a2027d0d5aa..f357d73d6ab 100644 --- a/target/linux/generic/hack-4.9/221-module_exports.patch +++ b/target/linux/generic/hack-4.9/221-module_exports.patch @@ -90,7 +90,7 @@ Signed-off-by: Felix Fietkau __used \ --- a/scripts/Makefile.build +++ b/scripts/Makefile.build -@@ -401,7 +401,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $( +@@ -409,7 +409,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $( # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- quiet_cmd_cpp_lds_S = LDS $@ diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 8197f7bb9f1..6cc23a261c2 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,12 +14,12 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -644,12 +644,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata - endif +@@ -678,12 +678,12 @@ endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE --KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) -+KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) + KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +-KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) ++KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) else ifdef CONFIG_PROFILE_ALL_BRANCHES -KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) diff --git a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index c8deaba842b..2cebf55a447 100644 --- a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -141,7 +141,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -1967,6 +1984,11 @@ static struct rt6_info *ip6_route_info_c +@@ -1970,6 +1987,11 @@ static struct rt6_info *ip6_route_info_c rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3490,6 +3527,8 @@ static int ip6_route_dev_notify(struct n +@@ -3498,6 +3535,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3501,6 +3540,7 @@ static int ip6_route_dev_notify(struct n +@@ -3509,6 +3548,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put(net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put(net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -208,7 +208,7 @@ Signed-off-by: Jonas Gorski in6_dev_put(net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -3716,6 +3756,17 @@ static int __net_init ip6_route_net_init +@@ -3724,6 +3764,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -226,7 +226,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3734,6 +3785,8 @@ out: +@@ -3742,6 +3793,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3751,6 +3804,7 @@ static void __net_exit ip6_route_net_exi +@@ -3759,6 +3812,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3824,6 +3878,9 @@ void __init ip6_route_init_special_entri +@@ -3832,6 +3886,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 58518f9cfd2..037d2e138db 100644 --- a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5860,6 +5863,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5864,6 +5867,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -5932,6 +5977,7 @@ static int __netdev_upper_dev_link(struc +@@ -5936,6 +5981,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -6058,6 +6104,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6062,6 +6108,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -109,7 +109,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6660,6 +6707,7 @@ int dev_set_mac_address(struct net_devic +@@ -6664,6 +6711,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9 index 44662a23831..fdca7a94a40 100644 --- a/target/linux/layerscape/armv8_32b/config-4.9 +++ b/target/linux/layerscape/armv8_32b/config-4.9 @@ -502,6 +502,7 @@ CONFIG_GPIO_TPS65910=y CONFIG_GPIO_TWL4030=y CONFIG_GPIO_XILINX=y CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDEN_BRANCH_PREDICTOR=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y diff --git a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch index 3229da5321e..517d144f3a3 100644 --- a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch @@ -421,7 +421,7 @@ Signed-off-by: Yangbo Lu * These are the defined Ethernet Protocol ID's. --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6652,9 +6652,18 @@ int dev_set_mtu(struct net_device *dev, +@@ -6656,9 +6656,18 @@ int dev_set_mtu(struct net_device *dev, if (new_mtu == dev->mtu) return 0; diff --git a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch index a8dcd82f7be..af4cd2fe16a 100644 --- a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch @@ -156,7 +156,7 @@ Signed-off-by: Yangbo Lu int ret; --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -4431,6 +4431,14 @@ hub_port_init(struct usb_hub *hub, struc +@@ -4433,6 +4433,14 @@ hub_port_init(struct usb_hub *hub, struc else speed = usb_speed_string(udev->speed); @@ -636,7 +636,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c -@@ -2932,6 +2932,7 @@ static irqreturn_t dwc3_interrupt(int ir +@@ -2927,6 +2927,7 @@ static irqreturn_t dwc3_interrupt(int ir int dwc3_gadget_init(struct dwc3 *dwc) { int ret, irq; @@ -644,7 +644,7 @@ Signed-off-by: Yangbo Lu struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); irq = platform_get_irq_byname(dwc3_pdev, "peripheral"); -@@ -3046,6 +3047,12 @@ int dwc3_gadget_init(struct dwc3 *dwc) +@@ -3041,6 +3042,12 @@ int dwc3_gadget_init(struct dwc3 *dwc) goto err5; } From 2213b20aeed157fd61519da22aa87fffb126743b Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 6 Dec 2018 13:34:21 +0100 Subject: [PATCH 109/399] kernel: bump 4.14 to 4.14.86 Refreshed all patches. Altered patches: - 180-usb-xhci-add-support-for-performing-fake-doorbell.patch Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...mware-loader-for-uPD720201-and-uPD72.patch | 6 +++--- .../802-usb-xhci-force-msi-renesas-xhci.patch | 2 +- ...support-for-performing-fake-doorbell.patch | 12 +++++------ ...-mark-and-erase-all-remaining-blocks.patch | 2 +- .../hack-4.14/207-disable-modorder.patch | 4 ++-- .../generic/hack-4.14/220-gc_sections.patch | 2 +- .../hack-4.14/221-module_exports.patch | 2 +- .../hack-4.14/420-allow-ubi-mlc-support.patch | 2 +- .../generic/hack-4.14/721-phy_packets.patch | 4 ++-- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../pending-4.14/201-extra_optimization.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 ++-- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../pending-4.14/655-increase_skb_pad.patch | 2 +- ...ng-with-source-address-failed-policy.patch | 20 +++++++++---------- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 8 ++++---- ...dd-quirk-to-autoload-ubi-on-rt-ac58u.patch | 2 +- .../0048-net-core-add-RPS-balancer.patch | 2 +- ...low-imod-interval-to-be-configurable.patch | 2 +- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f8c67e44d72..ce92929e9df 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .143 -LINUX_VERSION-4.14 = .82 +LINUX_VERSION-4.14 = .86 LINUX_KERNEL_HASH-4.9.143 = 0eb76464a696675fd4f8762e390328a377e973bfa263b00544ca1b5b10ac2cbf -LINUX_KERNEL_HASH-4.14.82 = a790a2e6f6a76d70decec91d1b7bcfba90f821b076273da070f6e0e1e6391dad +LINUX_KERNEL_HASH-4.14.86 = da9260a9022b917733201b89b5314847cb3332c31e70acb5e9b547956c266e28 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 5d9b1f6061e..a06910b8168 100644 --- a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -257,6 +259,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -262,6 +264,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -292,6 +746,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -297,6 +751,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter driver = (struct hc_driver *)id->driver_data; /* For some HW implementation, a XHCI reset is just not enough... */ -@@ -356,6 +826,16 @@ static void xhci_pci_remove(struct pci_d +@@ -361,6 +831,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index 141b839d680..60e53968047 100644 --- a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -44,7 +44,7 @@ produce a noisy warning. hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1854,6 +1854,7 @@ struct xhci_hcd { +@@ -1857,6 +1857,7 @@ struct xhci_hcd { /* support xHCI 0.96 spec USB2 software LPM */ unsigned sw_lpm_support:1; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 7ab5ffcb148..f7dd241e2f0 100644 --- a/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -127,11 +127,11 @@ it on BCM4708 family. /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1835,6 +1835,7 @@ struct xhci_hcd { - #define XHCI_LIMIT_ENDPOINT_INTERVAL_7 (1 << 26) - #define XHCI_U2_DISABLE_WAKE (1 << 27) - #define XHCI_ASMEDIA_MODIFY_FLOWCONTROL (1 << 28) -+#define XHCI_FAKE_DOORBELL (1 << 29) - #define XHCI_SUSPEND_DELAY (1 << 30) +@@ -1839,6 +1839,7 @@ struct xhci_hcd { + #define XHCI_SUSPEND_DELAY BIT_ULL(30) + #define XHCI_INTEL_USB_ROLE_SW BIT_ULL(31) + #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) ++#define XHCI_FAKE_DOORBELL BIT_ULL(35) unsigned int num_active_eps; + unsigned int limit_active_eps; diff --git a/target/linux/bcm53xx/patches-4.14/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch b/target/linux/bcm53xx/patches-4.14/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch index 271d98cc8c5..a86f4a84061 100644 --- a/target/linux/bcm53xx/patches-4.14/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch +++ b/target/linux/bcm53xx/patches-4.14/500-UBI-Detect-EOF-mark-and-erase-all-remaining-blocks.patch @@ -49,7 +49,7 @@ Signed-off-by: Rafał Miłecki return UBI_IO_BAD_HDR_EBADMSG; --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h -@@ -822,6 +822,7 @@ extern struct mutex ubi_devices_mutex; +@@ -829,6 +829,7 @@ extern struct mutex ubi_devices_mutex; extern struct blocking_notifier_head ubi_notifiers; /* attach.c */ diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch index fcc1580defa..fe6d5212f26 100644 --- a/target/linux/generic/hack-4.14/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1232,7 +1232,6 @@ all: modules +@@ -1234,7 +1234,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1261,7 +1260,6 @@ _modinst_: +@@ -1263,7 +1262,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch index fd53dbd40d6..d2572324039 100644 --- a/target/linux/generic/hack-4.14/220-gc_sections.patch +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -786,11 +791,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH +@@ -788,11 +793,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) endif diff --git a/target/linux/generic/hack-4.14/221-module_exports.patch b/target/linux/generic/hack-4.14/221-module_exports.patch index 2f59d6e93e9..250bf1180f0 100644 --- a/target/linux/generic/hack-4.14/221-module_exports.patch +++ b/target/linux/generic/hack-4.14/221-module_exports.patch @@ -90,7 +90,7 @@ Signed-off-by: Felix Fietkau __used \ --- a/scripts/Makefile.build +++ b/scripts/Makefile.build -@@ -434,7 +434,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $( +@@ -432,7 +432,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $( # Linker scripts preprocessor (.lds.S -> .lds) # --------------------------------------------------------------------------- quiet_cmd_cpp_lds_S = LDS $@ diff --git a/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch b/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch index 595936f1379..51524328459 100644 --- a/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch +++ b/target/linux/generic/hack-4.14/420-allow-ubi-mlc-support.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -851,9 +851,8 @@ int ubi_attach_mtd_dev(struct mtd_info * +@@ -852,9 +852,8 @@ int ubi_attach_mtd_dev(struct mtd_info * * will die soon and you will lose all your data. */ if (mtd->type == MTD_MLCNANDFLASH) { diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index ebe4787b681..d27d94e0469 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2496,6 +2496,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2512,6 +2512,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2626,16 +2630,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2642,16 +2646,6 @@ static inline struct sk_buff *dev_alloc_ } diff --git a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index bbcb7c23fa7..53b1a9a13c4 100644 --- a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6153,7 +6153,7 @@ static void __ref alloc_node_mem_map(str +@@ -6151,7 +6151,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch index 42cd7f15852..c7790657fd6 100644 --- a/target/linux/generic/pending-4.14/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -652,12 +652,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -654,12 +654,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 63afabb1d96..5d8f117dfc8 100644 --- a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1171,6 +1171,49 @@ static struct mtd_info * __init open_mtd +@@ -1172,6 +1172,49 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -58,7 +58,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1254,6 +1297,12 @@ static int __init ubi_init(void) +@@ -1255,6 +1298,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch index c8e25710b27..a3b58dd66f3 100644 --- a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch @@ -50,7 +50,7 @@ Signed-off-by: Gabor Juhos break; --- a/drivers/mtd/ubi/ubi.h +++ b/drivers/mtd/ubi/ubi.h -@@ -778,6 +778,7 @@ struct ubi_attach_info { +@@ -785,6 +785,7 @@ struct ubi_attach_info { int mean_ec; uint64_t ec_sum; int ec_count; diff --git a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch index 71c3fc790b7..adb6b045296 100644 --- a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2460,7 +2460,7 @@ static inline int pskb_network_may_pull( +@@ -2476,7 +2476,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index a5cb9579f77..1397580382d 100644 --- a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -141,7 +141,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__refcnt = ATOMIC_INIT(1), -@@ -2043,6 +2060,11 @@ static struct rt6_info *ip6_route_info_c +@@ -2046,6 +2063,11 @@ static struct rt6_info *ip6_route_info_c rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; @@ -153,7 +153,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: case RTN_UNREACHABLE: default: -@@ -2768,6 +2790,17 @@ static int ip6_pkt_prohibit_out(struct n +@@ -2771,6 +2793,17 @@ static int ip6_pkt_prohibit_out(struct n return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -171,7 +171,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -3004,7 +3037,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -3007,7 +3040,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -181,7 +181,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -3499,6 +3533,9 @@ static int rt6_fill_node(struct net *net +@@ -3502,6 +3536,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3817,6 +3854,8 @@ static int ip6_route_dev_notify(struct n +@@ -3820,6 +3857,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3828,6 +3867,7 @@ static int ip6_route_dev_notify(struct n +@@ -3831,6 +3870,7 @@ static int ip6_route_dev_notify(struct n in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev); #ifdef CONFIG_IPV6_MULTIPLE_TABLES in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev); @@ -208,7 +208,7 @@ Signed-off-by: Jonas Gorski in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev); #endif } -@@ -4044,6 +4084,17 @@ static int __net_init ip6_route_net_init +@@ -4047,6 +4087,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -226,7 +226,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -4062,6 +4113,8 @@ out: +@@ -4065,6 +4116,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -4079,6 +4132,7 @@ static void __net_exit ip6_route_net_exi +@@ -4082,6 +4135,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -4152,6 +4206,9 @@ void __init ip6_route_init_special_entri +@@ -4155,6 +4209,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index feeb7e70f8d..236a7833d2c 100644 --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -6275,6 +6278,48 @@ static void __netdev_adjacent_dev_unlink +@@ -6279,6 +6282,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -6313,6 +6358,7 @@ static int __netdev_upper_dev_link(struc +@@ -6317,6 +6362,7 @@ static int __netdev_upper_dev_link(struc if (ret) return ret; @@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); ret = notifier_to_errno(ret); -@@ -6390,6 +6436,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6394,6 +6440,7 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6962,6 +7009,7 @@ int dev_set_mac_address(struct net_devic +@@ -6966,6 +7013,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch b/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch index 9fa8a91e06f..4ee79515c9a 100644 --- a/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch +++ b/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch @@ -17,7 +17,7 @@ Signed-off-by: Christian Lamparter --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1183,6 +1183,9 @@ static void __init ubi_auto_attach(void) +@@ -1184,6 +1184,9 @@ static void __init ubi_auto_attach(void) mtd = open_mtd_device("ubi"); if (IS_ERR(mtd)) mtd = open_mtd_device("data"); diff --git a/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch b/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch index 01589f224d9..159742c16b2 100644 --- a/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch +++ b/target/linux/mediatek/patches-4.14/0048-net-core-add-RPS-balancer.patch @@ -78,7 +78,7 @@ Signed-off-by: John Crispin if (cpu_online(tcpu)) { cpu = tcpu; goto done; -@@ -8834,6 +8886,9 @@ static int __init net_dev_init(void) +@@ -8838,6 +8890,9 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch index ded3916c5c5..d28993ae38c 100644 --- a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch +++ b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch @@ -86,7 +86,7 @@ Signed-off-by: Greg Kroah-Hartman if (!xhci->shared_hcd) { --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -268,6 +268,9 @@ static int xhci_pci_setup(struct usb_hcd +@@ -273,6 +273,9 @@ static int xhci_pci_setup(struct usb_hcd if (!xhci->sbrn) pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn); From b2f243394e424ac1d4924bc9a399281b9795af16 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 11 Dec 2018 12:24:02 +0100 Subject: [PATCH 110/399] kernel: bump 4.9 to 4.9.144 Refreshed all patches. Compile-tested: ar71xx Runtime-tested: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- target/linux/generic/hack-4.9/207-disable-modorder.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index ce92929e9df..953c513fb86 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .143 +LINUX_VERSION-4.9 = .144 LINUX_VERSION-4.14 = .86 -LINUX_KERNEL_HASH-4.9.143 = 0eb76464a696675fd4f8762e390328a377e973bfa263b00544ca1b5b10ac2cbf +LINUX_KERNEL_HASH-4.9.144 = 05d17f434d22e9fa2f9084cdf6858383564883d23a1d11ce4dae4b217662782b LINUX_KERNEL_HASH-4.14.86 = da9260a9022b917733201b89b5314847cb3332c31e70acb5e9b547956c266e28 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index e92f4fa0bf3..025a18bccdf 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1226,7 +1226,6 @@ all: modules +@@ -1229,7 +1229,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1256,7 +1255,6 @@ _modinst_: +@@ -1259,7 +1258,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi From 6f74e269c86c7aaec44edb5de0e122bebf54c71f Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 11 Dec 2018 13:31:35 +0100 Subject: [PATCH 111/399] kernel: bump 4.14 to 4.14.87 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- target/linux/generic/hack-4.14/207-disable-modorder.patch | 4 ++-- target/linux/generic/hack-4.14/902-debloat_proc.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 953c513fb86..6f93ebf23f3 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .144 -LINUX_VERSION-4.14 = .86 +LINUX_VERSION-4.14 = .87 LINUX_KERNEL_HASH-4.9.144 = 05d17f434d22e9fa2f9084cdf6858383564883d23a1d11ce4dae4b217662782b -LINUX_KERNEL_HASH-4.14.86 = da9260a9022b917733201b89b5314847cb3332c31e70acb5e9b547956c266e28 +LINUX_KERNEL_HASH-4.14.87 = 36744d7d657dab23e455a8096e4ad2dc6a25f25fdce062d8a8bdf4499112e125 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch index fe6d5212f26..0619dcaa7bf 100644 --- a/target/linux/generic/hack-4.14/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1234,7 +1234,6 @@ all: modules +@@ -1237,7 +1237,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1263,7 +1262,6 @@ _modinst_: +@@ -1266,7 +1265,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index 4e700ca0b72..cae6d66e7df 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1951,10 +1951,12 @@ void __init init_mm_internals(void) +@@ -1955,10 +1955,12 @@ void __init init_mm_internals(void) start_shepherd_timer(); #endif #ifdef CONFIG_PROC_FS From 85f42a74d3fb745422b5338aa370ee414a632b32 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 13 Dec 2018 11:43:25 +0100 Subject: [PATCH 112/399] kernel: bump 4.9 to 4.9.145 Refreshed all patches. Fixes CVE: - CVE-2018-14625 Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch | 2 +- ...-add-support-for-releasing-multiple-instances-of-a.patch | 2 +- ...-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch | 4 ++-- ...-rename-__page_frag-functions-to-__page_frag_cache.patch | 6 +++--- .../090-net-generalize-napi_complete_done.patch | 2 +- target/linux/generic/hack-4.9/207-disable-modorder.patch | 4 ++-- target/linux/generic/hack-4.9/220-gc_sections.patch | 2 +- ...-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../linux/generic/pending-4.9/201-extra_optimization.patch | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 6f93ebf23f3..41037f42902 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .144 +LINUX_VERSION-4.9 = .145 LINUX_VERSION-4.14 = .87 -LINUX_KERNEL_HASH-4.9.144 = 05d17f434d22e9fa2f9084cdf6858383564883d23a1d11ce4dae4b217662782b +LINUX_KERNEL_HASH-4.9.145 = 6901ca37e8c305a2f26c598952338b4dc2481ca5a9d0bf71e2b71730a5b5bc5e LINUX_KERNEL_HASH-4.14.87 = 36744d7d657dab23e455a8096e4ad2dc6a25f25fdce062d8a8bdf4499112e125 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch b/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch index 28f337b0e3b..8e7002436be 100644 --- a/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch +++ b/target/linux/brcm2708/patches-4.9/950-0028-kbuild-Ignore-dtco-targets-when-filtering-symbols.patch @@ -9,7 +9,7 @@ Subject: [PATCH] kbuild: Ignore dtco targets when filtering symbols --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include -@@ -295,7 +295,7 @@ ksym_dep_filter = +@@ -296,7 +296,7 @@ ksym_dep_filter = $(CPP) $(call flags_nodeps,c_flags) -D__KSYM_DEPS__ $< ;; \ as_*_S|cpp_s_S) \ $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \ diff --git a/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch b/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch index 7a971169bc9..d4b60d4559b 100644 --- a/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch +++ b/target/linux/generic/backport-4.9/040-mm-add-support-for-releasing-multiple-instances-of-a.patch @@ -52,7 +52,7 @@ Signed-off-by: Linus Torvalds extern void __free_page_frag(void *addr); --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -3945,6 +3945,20 @@ static struct page *__page_frag_refill(s +@@ -3935,6 +3935,20 @@ static struct page *__page_frag_refill(s return page; } diff --git a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch index ddf10eb6dd3..d1da94b4e68 100644 --- a/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch +++ b/target/linux/generic/backport-4.9/041-mm-rename-__alloc_page_frag-to-page_frag_alloc-and-_.patch @@ -63,7 +63,7 @@ Signed-off-by: Linus Torvalds void *napi_alloc_frag(unsigned int fragsz); --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -3959,8 +3959,8 @@ void __page_frag_drain(struct page *page +@@ -3949,8 +3949,8 @@ void __page_frag_drain(struct page *page } EXPORT_SYMBOL(__page_frag_drain); @@ -74,7 +74,7 @@ Signed-off-by: Linus Torvalds { unsigned int size = PAGE_SIZE; struct page *page; -@@ -4011,19 +4011,19 @@ refill: +@@ -4001,19 +4001,19 @@ refill: return nc->va + offset; } diff --git a/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch b/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch index 64fdc7606c2..31b57167b4f 100644 --- a/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch +++ b/target/linux/generic/backport-4.9/042-mm-rename-__page_frag-functions-to-__page_frag_cache.patch @@ -33,7 +33,7 @@ Signed-off-by: Linus Torvalds extern void page_frag_free(void *addr); --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -3924,8 +3924,8 @@ EXPORT_SYMBOL(free_pages); +@@ -3914,8 +3914,8 @@ EXPORT_SYMBOL(free_pages); * drivers to provide a backing region of memory for use as either an * sk_buff->head, or to be used in the "frags" portion of skb_shared_info. */ @@ -44,7 +44,7 @@ Signed-off-by: Linus Torvalds { struct page *page = NULL; gfp_t gfp = gfp_mask; -@@ -3945,19 +3945,20 @@ static struct page *__page_frag_refill(s +@@ -3935,19 +3935,20 @@ static struct page *__page_frag_refill(s return page; } @@ -68,7 +68,7 @@ Signed-off-by: Linus Torvalds void *page_frag_alloc(struct page_frag_cache *nc, unsigned int fragsz, gfp_t gfp_mask) -@@ -3968,7 +3969,7 @@ void *page_frag_alloc(struct page_frag_c +@@ -3958,7 +3959,7 @@ void *page_frag_alloc(struct page_frag_c if (unlikely(!nc->va)) { refill: diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 4e7bc932943..e54545f9d8b 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -192,7 +192,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/can/rcar/rcar_can.c +++ b/drivers/net/can/rcar/rcar_can.c -@@ -695,7 +695,7 @@ static int rcar_can_rx_poll(struct napi_ +@@ -698,7 +698,7 @@ static int rcar_can_rx_poll(struct napi_ } /* All packets processed */ if (num_pkts < quota) { diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 025a18bccdf..5f7eb64bd28 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1229,7 +1229,6 @@ all: modules +@@ -1231,7 +1231,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1259,7 +1258,6 @@ _modinst_: +@@ -1261,7 +1260,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index ea805090357..e326412d0e7 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -671,11 +676,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -673,11 +678,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias) diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 5b886b30fda..d010445bcb8 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5932,7 +5932,7 @@ static void __ref alloc_node_mem_map(str +@@ -5922,7 +5922,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 6cc23a261c2..7a9d1319950 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -678,12 +678,12 @@ endif +@@ -680,12 +680,12 @@ endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) From 40e1450f59199ee3a0b7398cd4c3298d90df6591 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Thu, 13 Dec 2018 11:46:02 +0100 Subject: [PATCH 113/399] kernel: bump 4.14 to 4.14.88 Refreshed all patches. Altered patches: - 180-usb-xhci-add-support-for-performing-fake-doorbell.patch Fixes CVE: - CVE-2018-14625 Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...b-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch | 6 +++--- .../patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch | 4 ++-- ...-usb-xhci-add-support-for-performing-fake-doorbell.patch | 6 +++--- ...-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...91-usb-xhci-allow-imod-interval-to-be-configurable.patch | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 41037f42902..30e1edf75eb 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .145 -LINUX_VERSION-4.14 = .87 +LINUX_VERSION-4.14 = .88 LINUX_KERNEL_HASH-4.9.145 = 6901ca37e8c305a2f26c598952338b4dc2481ca5a9d0bf71e2b71730a5b5bc5e -LINUX_KERNEL_HASH-4.14.87 = 36744d7d657dab23e455a8096e4ad2dc6a25f25fdce062d8a8bdf4499112e125 +LINUX_KERNEL_HASH-4.14.88 = b0f0b8c76708eab6caf3009702e531d40a243b152922ee1f9a441316f226f52d remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index a06910b8168..41f9c8ac7db 100644 --- a/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -262,6 +264,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -266,6 +268,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -297,6 +751,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -301,6 +755,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter driver = (struct hc_driver *)id->driver_data; /* For some HW implementation, a XHCI reset is just not enough... */ -@@ -361,6 +831,16 @@ static void xhci_pci_remove(struct pci_d +@@ -365,6 +835,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index 60e53968047..71b90f2db21 100644 --- a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,7 +13,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -215,7 +215,7 @@ static void xhci_pci_quirks(struct devic +@@ -219,7 +219,7 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_TRUST_TX_LENGTH; if (pdev->vendor == PCI_VENDOR_ID_RENESAS && pdev->device == 0x0015) @@ -44,7 +44,7 @@ produce a noisy warning. hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1857,6 +1857,7 @@ struct xhci_hcd { +@@ -1858,6 +1858,7 @@ struct xhci_hcd { /* support xHCI 0.96 spec USB2 software LPM */ unsigned sw_lpm_support:1; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index f7dd241e2f0..01084274645 100644 --- a/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-4.14/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -127,11 +127,11 @@ it on BCM4708 family. /* --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1839,6 +1839,7 @@ struct xhci_hcd { - #define XHCI_SUSPEND_DELAY BIT_ULL(30) +@@ -1840,6 +1840,7 @@ struct xhci_hcd { #define XHCI_INTEL_USB_ROLE_SW BIT_ULL(31) #define XHCI_RESET_PLL_ON_DISCONNECT BIT_ULL(34) -+#define XHCI_FAKE_DOORBELL BIT_ULL(35) + #define XHCI_SNPS_BROKEN_SUSPEND BIT_ULL(35) ++#define XHCI_FAKE_DOORBELL BIT_ULL(36) unsigned int num_active_eps; unsigned int limit_active_eps; diff --git a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 53b1a9a13c4..88870bc99e8 100644 --- a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6151,7 +6151,7 @@ static void __ref alloc_node_mem_map(str +@@ -6141,7 +6141,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch index d28993ae38c..2a6f5f25d40 100644 --- a/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch +++ b/target/linux/mediatek/patches-4.14/0191-usb-xhci-allow-imod-interval-to-be-configurable.patch @@ -86,7 +86,7 @@ Signed-off-by: Greg Kroah-Hartman if (!xhci->shared_hcd) { --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -273,6 +273,9 @@ static int xhci_pci_setup(struct usb_hcd +@@ -277,6 +277,9 @@ static int xhci_pci_setup(struct usb_hcd if (!xhci->sbrn) pci_read_config_byte(pdev, XHCI_SBRN_OFFSET, &xhci->sbrn); From 50789acf4e75606ffe16f1f6e7e3b7ee2e71185d Mon Sep 17 00:00:00 2001 From: Christoph Krapp Date: Thu, 8 Nov 2018 11:09:02 +0000 Subject: [PATCH 114/399] ar71xx: add support for UniFi-AC-Mesh-Pro This adds the build option for UniFi AC Mesh Pro as well as model detection for it. The device is a hardware clone of the AC Pro. - SoC: QCA9563-AL3A (775Mhz) - RAM: 128MiB - Flash: 16MiB - dual firmware partitions! - LAN: 2x 1000M - POE+ - Wireless: 2.4G: QCA9563 5G: UniFi Chip, QCA988X compatible Signed-off-by: Christoph Krapp (cherry picked from commit 987b961537b7002eda21df97dd8bfebe8882bc6d) --- target/linux/ar71xx/base-files/lib/ar71xx.sh | 17 ++++++++++++----- .../files/arch/mips/ath79/Kconfig.openwrt | 2 +- .../files/arch/mips/ath79/mach-ubnt-unifiac.c | 2 +- .../ar71xx/files/arch/mips/ath79/machtypes.h | 2 +- target/linux/ar71xx/image/generic-ubnt.mk | 6 ++++++ 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 3af2eee2bd5..ccbd4e77c32 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -98,22 +98,28 @@ ubnt_xm_board_detect() { [ -z "$model" ] || AR71XX_MODEL="${model}${magic:3:1}" } -ubnt_ac_lite_get_mtd_part_magic() { +ubnt_unifi_ac_get_mtd_part_magic() { ar71xx_get_mtd_offset_size_format EEPROM 12 2 %02x } -ubnt_ac_lite_board_detect() { +ubnt_unifi_ac_board_detect() { local model local magic - magic="$(ubnt_ac_lite_get_mtd_part_magic)" + magic="$(ubnt_unifi_ac_get_mtd_part_magic)" case ${magic:0:4} in "e517") model="Ubiquiti UniFi-AC-LITE" ;; + "e537") + model="Ubiquiti UniFi-AC-PRO" + ;; "e557") model="Ubiquiti UniFi-AC-MESH" ;; + "e567") + model="Ubiquiti UniFi-AC-MESH-PRO" + ;; esac [ -z "$model" ] || AR71XX_MODEL="${model}" @@ -1369,10 +1375,11 @@ ar71xx_board_detect() { ;; *"UniFi-AC-LITE/MESH") name="unifiac-lite" - ubnt_ac_lite_board_detect + ubnt_unifi_ac_board_detect ;; - *"UniFi-AC-PRO") + *"UniFi-AC-PRO/MESH-PRO") name="unifiac-pro" + ubnt_unifi_ac_board_detect ;; *"UniFiAP Outdoor") name="unifi-outdoor" diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index e7655b3c026..1d0e3d910d4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -2109,7 +2109,7 @@ config ATH79_MACH_UBNT select ATH79_DEV_USB config ATH79_MACH_UBNT_UNIFIAC - bool "Ubiquiti UniFi AC (LITE/LR/MESH/PRO) support" + bool "Ubiquiti UniFi AC (LITE/LR/MESH/PRO/MESH-PRO) support" select SOC_QCA956X select ATH79_DEV_AP9X_PCI if PCI select ATH79_DEV_ETH diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c index 38195a466b8..2f62d32029f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ubnt-unifiac.c @@ -176,4 +176,4 @@ static void __init ubnt_unifiac_pro_setup(void) MIPS_MACHINE(ATH79_MACH_UBNT_UNIFIAC_PRO, "UBNT-UF-AC-PRO", - "Ubiquiti UniFi-AC-PRO", ubnt_unifiac_pro_setup); + "Ubiquiti UniFi-AC-PRO/MESH-PRO", ubnt_unifiac_pro_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 390ec0b2c38..80f6e1d95b7 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -329,7 +329,7 @@ enum ath79_mach_type { ATH79_MACH_UBNT_UAP_PRO, /* Ubiquiti UniFi AP Pro */ ATH79_MACH_UBNT_UNIFI, /* Ubiquiti Unifi */ ATH79_MACH_UBNT_UNIFIAC_LITE, /* Ubiquiti Unifi AC LITE/LR/MESH */ - ATH79_MACH_UBNT_UNIFIAC_PRO, /* Ubiquiti Unifi AC PRO */ + ATH79_MACH_UBNT_UNIFIAC_PRO, /* Ubiquiti Unifi AC PRO/MESH PRO */ ATH79_MACH_UBNT_UNIFI_OUTDOOR, /* Ubiquiti UnifiAP Outdoor */ ATH79_MACH_UBNT_UNIFI_OUTDOOR_PLUS, /* Ubiquiti UnifiAP Outdoor+ */ ATH79_MACH_UBNT_XM, /* Ubiquiti Networks XM board rev 1.0 */ diff --git a/target/linux/ar71xx/image/generic-ubnt.mk b/target/linux/ar71xx/image/generic-ubnt.mk index 07c02955041..77f9d3ad0a8 100644 --- a/target/linux/ar71xx/image/generic-ubnt.mk +++ b/target/linux/ar71xx/image/generic-ubnt.mk @@ -143,6 +143,12 @@ define Device/ubnt-unifiac-pro endef TARGET_DEVICES += ubnt-unifiac-pro +define Device/ubnt-unifiac-mesh-pro + $(Device/ubnt-unifiac-pro) + DEVICE_TITLE := Ubiquiti UniFi AC-Mesh-Pro +endef +TARGET_DEVICES += ubnt-unifiac-mesh-pro + define Device/ubnt-unifi-outdoor $(Device/ubnt-bz) DEVICE_TITLE := Ubiquiti UniFi Outdoor From 2f2055de0edbb566322c7de8bd5e1523e2fecedc Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Tue, 15 May 2018 14:00:37 +0200 Subject: [PATCH 115/399] ebtables: update to latest git 2018-05-15 66a9701 ebtables: Fix build errors and warnings 9fff3d5 include: Fix musl libc compatibility b1cdae8 extensions: Add string filter to ebtables Signed-off-by: Hans Dedecker (backported from ac70ac3532fefa78c944d8a26c8df0ca5d88d04e) (rebased patches) Signed-off-by: Jo-Philipp Wich --- package/network/utils/ebtables/Makefile | 6 +++--- .../network/utils/ebtables/patches/100-musl_fix.patch | 4 ++-- .../ebtables/patches/200-fix-extension-init.patch | 11 +++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index baa8f2efed1..5275c454f64 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ebtables -PKG_SOURCE_DATE:=2018-04-11 +PKG_SOURCE_DATE:=2018-05-15 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=2e783b2277665c467138e7685309622456c41db4 -PKG_MIRROR_HASH:=601a41f579f76c8121bb6076ebcf5eb5efddf634ebb5949ec9e983a17e66e689 +PKG_SOURCE_VERSION:=66a97018a31eed416c6a25d051ea172e4d65be1b +PKG_MIRROR_HASH:=3205285d4e92ab66d75681fd031b6bdc19954198b58dec1d8cbbf64312ebd445 PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/ebtables/patches/100-musl_fix.patch b/package/network/utils/ebtables/patches/100-musl_fix.patch index 3fe5845897c..9528fe4b192 100644 --- a/package/network/utils/ebtables/patches/100-musl_fix.patch +++ b/package/network/utils/ebtables/patches/100-musl_fix.patch @@ -6,5 +6,5 @@ #define EBTABLES_U_H +#define _NETINET_IF_ETHER_H #include - #include - #include + #include + #include diff --git a/package/network/utils/ebtables/patches/200-fix-extension-init.patch b/package/network/utils/ebtables/patches/200-fix-extension-init.patch index 52ab175ec22..4b202ac57ef 100644 --- a/package/network/utils/ebtables/patches/200-fix-extension-init.patch +++ b/package/network/utils/ebtables/patches/200-fix-extension-init.patch @@ -247,3 +247,14 @@ { ebt_register_table(&table); } +--- a/extensions/ebt_string.c ++++ b/extensions/ebt_string.c +@@ -310,7 +310,7 @@ static struct ebt_u_match string_match = + .extra_ops = opts, + }; + +-void _init(void) ++__attribute__((constructor)) static void extension_init(void) + { + ebt_register_match(&string_match); + } From 1e432993c513a613c1823ae7ccd88192df84f07a Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Tue, 15 May 2018 10:41:19 +0800 Subject: [PATCH 116/399] libnftnl: bump to 1.1.0 Signed-off-by: Rosy Song (backported from c7e9d72f056a190fe14b1ebc3f07e726121e2965) --- package/libs/libnftnl/Makefile | 6 +- .../100-src-add-flowtable-support.patch | 1444 ----------------- ...101-expr-add-flow-offload-expression.patch | 259 --- 3 files changed, 3 insertions(+), 1706 deletions(-) delete mode 100644 package/libs/libnftnl/patches/100-src-add-flowtable-support.patch delete mode 100644 package/libs/libnftnl/patches/101-expr-add-flow-offload-expression.patch diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index 149fad90839..b23dd2579f4 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.0.9 -PKG_RELEASE:=2 +PKG_VERSION:=1.1.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=fec1d824aee301e59a11aeaae2a2d429cb99ead81e6bafab791a4dd6569b3635 +PKG_HASH:=ec0eaca11b165110c2b61e6a7b50a7a0a9b17fa04a0c333f795bec2d19f78f6c PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnftnl/patches/100-src-add-flowtable-support.patch b/package/libs/libnftnl/patches/100-src-add-flowtable-support.patch deleted file mode 100644 index 0d15f9235b8..00000000000 --- a/package/libs/libnftnl/patches/100-src-add-flowtable-support.patch +++ /dev/null @@ -1,1444 +0,0 @@ -From: Pablo Neira Ayuso -Date: Wed, 29 Nov 2017 13:07:02 +0100 -Subject: [PATCH] src: add flowtable support - -This patch allows you to add, delete and list flowtable through the -existing netlink interface. - -Signed-off-by: Pablo Neira Ayuso ---- - create mode 100644 examples/nft-flowtable-add.c - create mode 100644 examples/nft-flowtable-del.c - create mode 100644 examples/nft-flowtable-get.c - create mode 100644 include/libnftnl/flowtable.h - create mode 100644 src/flowtable.c - ---- a/examples/Makefile.am -+++ b/examples/Makefile.am -@@ -25,6 +25,9 @@ check_PROGRAMS = nft-table-add \ - nft-obj-add \ - nft-obj-get \ - nft-obj-del \ -+ nft-flowtable-add \ -+ nft-flowtable-del \ -+ nft-flowtable-get \ - nft-ruleset-get \ - nft-ruleset-parse-file \ - nft-compat-get -@@ -104,6 +107,15 @@ nft_obj_del_LDADD = ../src/libnftnl.la $ - nft_obj_get_SOURCES = nft-obj-get.c - nft_obj_get_LDADD = ../src/libnftnl.la ${LIBMNL_LIBS} - -+nft_flowtable_add_SOURCES = nft-flowtable-add.c -+nft_flowtable_add_LDADD = ../src/libnftnl.la ${LIBMNL_LIBS} -+ -+nft_flowtable_del_SOURCES = nft-flowtable-del.c -+nft_flowtable_del_LDADD = ../src/libnftnl.la ${LIBMNL_LIBS} -+ -+nft_flowtable_get_SOURCES = nft-flowtable-get.c -+nft_flowtable_get_LDADD = ../src/libnftnl.la ${LIBMNL_LIBS} -+ - nft_ruleset_get_SOURCES = nft-ruleset-get.c - nft_ruleset_get_LDADD = ../src/libnftnl.la ${LIBMNL_LIBS} - ---- /dev/null -+++ b/examples/nft-flowtable-add.c -@@ -0,0 +1,136 @@ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+ -+static struct nftnl_flowtable *flowtable_add_parse(int argc, char *argv[]) -+{ -+ const char *dev_array[] = { "eth0", "tap0", NULL }; -+ struct nftnl_flowtable *t; -+ int hooknum = 0; -+ -+ if (strcmp(argv[4], "ingress") == 0) -+ hooknum = NF_NETDEV_INGRESS; -+ else { -+ fprintf(stderr, "Unknown hook: %s\n", argv[4]); -+ return NULL; -+ } -+ -+ t = nftnl_flowtable_alloc(); -+ if (t == NULL) { -+ perror("OOM"); -+ return NULL; -+ } -+ nftnl_flowtable_set(t, NFTNL_FLOWTABLE_TABLE, argv[2]); -+ nftnl_flowtable_set(t, NFTNL_FLOWTABLE_NAME, argv[3]); -+ if (argc == 6) { -+ nftnl_flowtable_set_u32(t, NFTNL_FLOWTABLE_HOOKNUM, hooknum); -+ nftnl_flowtable_set_u32(t, NFTNL_FLOWTABLE_PRIO, atoi(argv[5])); -+ } -+ nftnl_flowtable_set_array(t, NFTNL_FLOWTABLE_DEVICES, dev_array); -+ -+ return t; -+} -+ -+int main(int argc, char *argv[]) -+{ -+ struct mnl_socket *nl; -+ char buf[MNL_SOCKET_BUFFER_SIZE]; -+ struct nlmsghdr *nlh; -+ uint32_t portid, seq, flowtable_seq; -+ int ret, family; -+ struct nftnl_flowtable *t; -+ struct mnl_nlmsg_batch *batch; -+ int batching; -+ -+ if (argc != 6) { -+ fprintf(stderr, "Usage: %s \n", -+ argv[0]); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (strcmp(argv[1], "ip") == 0) -+ family = NFPROTO_IPV4; -+ else if (strcmp(argv[1], "ip6") == 0) -+ family = NFPROTO_IPV6; -+ else if (strcmp(argv[1], "bridge") == 0) -+ family = NFPROTO_BRIDGE; -+ else if (strcmp(argv[1], "arp") == 0) -+ family = NFPROTO_ARP; -+ else { -+ fprintf(stderr, "Unknown family: ip, ip6, bridge, arp\n"); -+ exit(EXIT_FAILURE); -+ } -+ -+ t = flowtable_add_parse(argc, argv); -+ if (t == NULL) -+ exit(EXIT_FAILURE); -+ -+ batching = nftnl_batch_is_supported(); -+ if (batching < 0) { -+ perror("cannot talk to nfnetlink"); -+ exit(EXIT_FAILURE); -+ } -+ -+ seq = time(NULL); -+ batch = mnl_nlmsg_batch_start(buf, sizeof(buf)); -+ -+ if (batching) { -+ nftnl_batch_begin(mnl_nlmsg_batch_current(batch), seq++); -+ mnl_nlmsg_batch_next(batch); -+ } -+ -+ flowtable_seq = seq; -+ nlh = nftnl_flowtable_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch), -+ NFT_MSG_NEWFLOWTABLE, family, -+ NLM_F_CREATE|NLM_F_ACK, seq++); -+ nftnl_flowtable_nlmsg_build_payload(nlh, t); -+ nftnl_flowtable_free(t); -+ mnl_nlmsg_batch_next(batch); -+ -+ if (batching) { -+ nftnl_batch_end(mnl_nlmsg_batch_current(batch), seq++); -+ mnl_nlmsg_batch_next(batch); -+ } -+ -+ nl = mnl_socket_open(NETLINK_NETFILTER); -+ if (nl == NULL) { -+ perror("mnl_socket_open"); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { -+ perror("mnl_socket_bind"); -+ exit(EXIT_FAILURE); -+ } -+ portid = mnl_socket_get_portid(nl); -+ -+ if (mnl_socket_sendto(nl, mnl_nlmsg_batch_head(batch), -+ mnl_nlmsg_batch_size(batch)) < 0) { -+ perror("mnl_socket_send"); -+ exit(EXIT_FAILURE); -+ } -+ -+ mnl_nlmsg_batch_stop(batch); -+ -+ ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); -+ while (ret > 0) { -+ ret = mnl_cb_run(buf, ret, flowtable_seq, portid, NULL, NULL); -+ if (ret <= 0) -+ break; -+ ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); -+ } -+ if (ret == -1) { -+ perror("error"); -+ exit(EXIT_FAILURE); -+ } -+ mnl_socket_close(nl); -+ -+ return EXIT_SUCCESS; -+} ---- /dev/null -+++ b/examples/nft-flowtable-del.c -@@ -0,0 +1,122 @@ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+ -+static struct nftnl_flowtable *flowtable_del_parse(int argc, char *argv[]) -+{ -+ struct nftnl_flowtable *t; -+ -+ t = nftnl_flowtable_alloc(); -+ if (t == NULL) { -+ perror("OOM"); -+ return NULL; -+ } -+ -+ nftnl_flowtable_set(t, NFTNL_FLOWTABLE_TABLE, argv[2]); -+ nftnl_flowtable_set(t, NFTNL_FLOWTABLE_NAME, argv[3]); -+ -+ return t; -+} -+ -+int main(int argc, char *argv[]) -+{ -+ struct mnl_socket *nl; -+ struct mnl_nlmsg_batch *batch; -+ char buf[MNL_SOCKET_BUFFER_SIZE]; -+ struct nlmsghdr *nlh; -+ uint32_t portid, seq, flowtable_seq; -+ struct nftnl_flowtable *t; -+ int ret, family, batching; -+ -+ if (argc != 4) { -+ fprintf(stderr, "Usage: %s
\n", -+ argv[0]); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (strcmp(argv[1], "ip") == 0) -+ family = NFPROTO_IPV4; -+ else if (strcmp(argv[1], "ip6") == 0) -+ family = NFPROTO_IPV6; -+ else if (strcmp(argv[1], "bridge") == 0) -+ family = NFPROTO_BRIDGE; -+ else if (strcmp(argv[1], "arp") == 0) -+ family = NFPROTO_ARP; -+ else { -+ fprintf(stderr, "Unknown family: ip, ip6, bridge, arp\n"); -+ exit(EXIT_FAILURE); -+ } -+ -+ t = flowtable_del_parse(argc, argv); -+ if (t == NULL) -+ exit(EXIT_FAILURE); -+ -+ batching = nftnl_batch_is_supported(); -+ if (batching < 0) { -+ perror("cannot talk to nfnetlink"); -+ exit(EXIT_FAILURE); -+ } -+ -+ seq = time(NULL); -+ batch = mnl_nlmsg_batch_start(buf, sizeof(buf)); -+ -+ if (batching) { -+ nftnl_batch_begin(mnl_nlmsg_batch_current(batch), seq++); -+ mnl_nlmsg_batch_next(batch); -+ } -+ -+ flowtable_seq = seq; -+ nlh = nftnl_flowtable_nlmsg_build_hdr(mnl_nlmsg_batch_current(batch), -+ NFT_MSG_DELFLOWTABLE, family, -+ NLM_F_ACK, seq++); -+ nftnl_flowtable_nlmsg_build_payload(nlh, t); -+ nftnl_flowtable_free(t); -+ mnl_nlmsg_batch_next(batch); -+ -+ if (batching) { -+ nftnl_batch_end(mnl_nlmsg_batch_current(batch), seq++); -+ mnl_nlmsg_batch_next(batch); -+ } -+ -+ nl = mnl_socket_open(NETLINK_NETFILTER); -+ if (nl == NULL) { -+ perror("mnl_socket_open"); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { -+ perror("mnl_socket_bind"); -+ exit(EXIT_FAILURE); -+ } -+ portid = mnl_socket_get_portid(nl); -+ -+ if (mnl_socket_sendto(nl, mnl_nlmsg_batch_head(batch), -+ mnl_nlmsg_batch_size(batch)) < 0) { -+ perror("mnl_socket_send"); -+ exit(EXIT_FAILURE); -+ } -+ -+ mnl_nlmsg_batch_stop(batch); -+ -+ ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); -+ while (ret > 0) { -+ ret = mnl_cb_run(buf, ret, flowtable_seq, portid, NULL, NULL); -+ if (ret <= 0) -+ break; -+ ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); -+ } -+ if (ret == -1) { -+ perror("error"); -+ exit(EXIT_FAILURE); -+ } -+ mnl_socket_close(nl); -+ -+ return EXIT_SUCCESS; -+} ---- /dev/null -+++ b/examples/nft-flowtable-get.c -@@ -0,0 +1,121 @@ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+ -+static int table_cb(const struct nlmsghdr *nlh, void *data) -+{ -+ struct nftnl_flowtable *t; -+ char buf[4096]; -+ uint32_t *type = data; -+ -+ t = nftnl_flowtable_alloc(); -+ if (t == NULL) { -+ perror("OOM"); -+ goto err; -+ } -+ -+ if (nftnl_flowtable_nlmsg_parse(nlh, t) < 0) { -+ perror("nftnl_flowtable_nlmsg_parse"); -+ goto err_free; -+ } -+ -+ nftnl_flowtable_snprintf(buf, sizeof(buf), t, *type, 0); -+ printf("%s\n", buf); -+ -+err_free: -+ nftnl_flowtable_free(t); -+err: -+ return MNL_CB_OK; -+} -+ -+int main(int argc, char *argv[]) -+{ -+ struct mnl_socket *nl; -+ char buf[MNL_SOCKET_BUFFER_SIZE]; -+ struct nlmsghdr *nlh; -+ uint32_t portid, seq, type = NFTNL_OUTPUT_DEFAULT; -+ struct nftnl_flowtable *t = NULL; -+ int ret, family; -+ -+ seq = time(NULL); -+ -+ if (argc < 2 || argc > 5) { -+ fprintf(stderr, "Usage: %s [
] [json]\n", -+ argv[0]); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (strcmp(argv[1], "ip") == 0) -+ family = NFPROTO_IPV4; -+ else if (strcmp(argv[1], "ip6") == 0) -+ family = NFPROTO_IPV6; -+ else if (strcmp(argv[1], "bridge") == 0) -+ family = NFPROTO_BRIDGE; -+ else if (strcmp(argv[1], "arp") == 0) -+ family = NFPROTO_ARP; -+ else if (strcmp(argv[1], "unspec") == 0) -+ family = NFPROTO_UNSPEC; -+ else { -+ fprintf(stderr, "Unknown family: ip, ip6, bridge, arp, unspec\n"); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (argc >= 4) { -+ t = nftnl_flowtable_alloc(); -+ if (t == NULL) { -+ perror("OOM"); -+ exit(EXIT_FAILURE); -+ } -+ nlh = nftnl_flowtable_nlmsg_build_hdr(buf, NFT_MSG_GETFLOWTABLE, family, -+ NLM_F_ACK, seq); -+ nftnl_flowtable_set(t, NFTNL_FLOWTABLE_TABLE, argv[2]); -+ nftnl_flowtable_set(t, NFTNL_FLOWTABLE_NAME, argv[3]); -+ nftnl_flowtable_nlmsg_build_payload(nlh, t); -+ nftnl_flowtable_free(t); -+ } else if (argc >= 2) { -+ nlh = nftnl_flowtable_nlmsg_build_hdr(buf, NFT_MSG_GETFLOWTABLE, family, -+ NLM_F_DUMP, seq); -+ } -+ -+ if (strcmp(argv[argc-1], "json") == 0) -+ type = NFTNL_OUTPUT_JSON; -+ -+ nl = mnl_socket_open(NETLINK_NETFILTER); -+ if (nl == NULL) { -+ perror("mnl_socket_open"); -+ exit(EXIT_FAILURE); -+ } -+ -+ if (mnl_socket_bind(nl, 0, MNL_SOCKET_AUTOPID) < 0) { -+ perror("mnl_socket_bind"); -+ exit(EXIT_FAILURE); -+ } -+ portid = mnl_socket_get_portid(nl); -+ -+ if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) { -+ perror("mnl_socket_send"); -+ exit(EXIT_FAILURE); -+ } -+ -+ ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); -+ while (ret > 0) { -+ ret = mnl_cb_run(buf, ret, seq, portid, table_cb, &type); -+ if (ret <= 0) -+ break; -+ ret = mnl_socket_recvfrom(nl, buf, sizeof(buf)); -+ } -+ if (ret == -1) { -+ perror("error"); -+ exit(EXIT_FAILURE); -+ } -+ mnl_socket_close(nl); -+ -+ return EXIT_SUCCESS; -+} ---- a/include/libnftnl/Makefile.am -+++ b/include/libnftnl/Makefile.am -@@ -6,6 +6,7 @@ pkginclude_HEADERS = batch.h \ - rule.h \ - expr.h \ - set.h \ -+ flowtable.h \ - ruleset.h \ - common.h \ - udata.h \ ---- /dev/null -+++ b/include/libnftnl/flowtable.h -@@ -0,0 +1,81 @@ -+#ifndef _LIBNFTNL_FLOWTABLE_H_ -+#define _LIBNFTNL_FLOWTABLE_H_ -+ -+#include -+#include -+#include -+#include -+ -+#include -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+struct nftnl_flowtable; -+ -+struct nftnl_flowtable *nftnl_flowtable_alloc(void); -+void nftnl_flowtable_free(const struct nftnl_flowtable *); -+ -+enum nftnl_flowtable_attr { -+ NFTNL_FLOWTABLE_NAME = 0, -+ NFTNL_FLOWTABLE_FAMILY, -+ NFTNL_FLOWTABLE_TABLE, -+ NFTNL_FLOWTABLE_HOOKNUM, -+ NFTNL_FLOWTABLE_PRIO = 4, -+ NFTNL_FLOWTABLE_USE, -+ NFTNL_FLOWTABLE_DEVICES, -+ __NFTNL_FLOWTABLE_MAX -+}; -+#define NFTNL_FLOWTABLE_MAX (__NFTNL_FLOWTABLE_MAX - 1) -+ -+bool nftnl_flowtable_is_set(const struct nftnl_flowtable *c, uint16_t attr); -+void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr); -+void nftnl_flowtable_set(struct nftnl_flowtable *t, uint16_t attr, const void *data); -+int nftnl_flowtable_set_data(struct nftnl_flowtable *t, uint16_t attr, -+ const void *data, uint32_t data_len); -+void nftnl_flowtable_set_u32(struct nftnl_flowtable *t, uint16_t attr, uint32_t data); -+void nftnl_flowtable_set_s32(struct nftnl_flowtable *t, uint16_t attr, int32_t data); -+int nftnl_flowtable_set_str(struct nftnl_flowtable *t, uint16_t attr, const char *str); -+void nftnl_flowtable_set_array(struct nftnl_flowtable *t, uint16_t attr, const char **data); -+ -+const void *nftnl_flowtable_get(const struct nftnl_flowtable *c, uint16_t attr); -+const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c, uint16_t attr, -+ uint32_t *data_len); -+const char *nftnl_flowtable_get_str(const struct nftnl_flowtable *c, uint16_t attr); -+uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr); -+int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr); -+const char **nftnl_flowtable_get_array(const struct nftnl_flowtable *t, uint16_t attr); -+ -+struct nlmsghdr; -+ -+void nftnl_flowtable_nlmsg_build_payload(struct nlmsghdr *nlh, const struct nftnl_flowtable *t); -+ -+int nftnl_flowtable_parse(struct nftnl_flowtable *c, enum nftnl_parse_type type, -+ const char *data, struct nftnl_parse_err *err); -+int nftnl_flowtable_parse_file(struct nftnl_flowtable *c, enum nftnl_parse_type type, -+ FILE *fp, struct nftnl_parse_err *err); -+int nftnl_flowtable_snprintf(char *buf, size_t size, const struct nftnl_flowtable *t, uint32_t type, uint32_t flags); -+int nftnl_flowtable_fprintf(FILE *fp, const struct nftnl_flowtable *c, uint32_t type, uint32_t flags); -+ -+#define nftnl_flowtable_nlmsg_build_hdr nftnl_nlmsg_build_hdr -+int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtable *t); -+ -+struct nftnl_flowtable_list; -+ -+struct nftnl_flowtable_list *nftnl_flowtable_list_alloc(void); -+void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list); -+int nftnl_flowtable_list_is_empty(const struct nftnl_flowtable_list *list); -+void nftnl_flowtable_list_add(struct nftnl_flowtable *s, -+ struct nftnl_flowtable_list *list); -+void nftnl_flowtable_list_add_tail(struct nftnl_flowtable *s, -+ struct nftnl_flowtable_list *list); -+void nftnl_flowtable_list_del(struct nftnl_flowtable *s); -+int nftnl_flowtable_list_foreach(struct nftnl_flowtable_list *flowtable_list, -+ int (*cb)(struct nftnl_flowtable *t, void *data), void *data); -+ -+#ifdef __cplusplus -+} /* extern "C" */ -+#endif -+ -+#endif /* _LIBNFTNL_FLOWTABLE_H_ */ ---- a/include/linux/netfilter/nf_tables.h -+++ b/include/linux/netfilter/nf_tables.h -@@ -90,6 +90,9 @@ enum nft_verdicts { - * @NFT_MSG_GETOBJ: get a stateful object (enum nft_obj_attributes) - * @NFT_MSG_DELOBJ: delete a stateful object (enum nft_obj_attributes) - * @NFT_MSG_GETOBJ_RESET: get and reset a stateful object (enum nft_obj_attributes) -+ * @NFT_MSG_NEWFLOWTABLE: add new flow table (enum nft_flowtable_attributes) -+ * @NFT_MSG_GETFLOWTABLE: get flow table (enum nft_flowtable_attributes) -+ * @NFT_MSG_DELFLOWTABLE: delete flow table (enum nft_flowtable_attributes) - */ - enum nf_tables_msg_types { - NFT_MSG_NEWTABLE, -@@ -114,6 +117,9 @@ enum nf_tables_msg_types { - NFT_MSG_GETOBJ, - NFT_MSG_DELOBJ, - NFT_MSG_GETOBJ_RESET, -+ NFT_MSG_NEWFLOWTABLE, -+ NFT_MSG_GETFLOWTABLE, -+ NFT_MSG_DELFLOWTABLE, - NFT_MSG_MAX, - }; - -@@ -1303,6 +1309,53 @@ enum nft_object_attributes { - #define NFTA_OBJ_MAX (__NFTA_OBJ_MAX - 1) - - /** -+ * enum nft_flowtable_attributes - nf_tables flow table netlink attributes -+ * -+ * @NFTA_FLOWTABLE_TABLE: name of the table containing the expression (NLA_STRING) -+ * @NFTA_FLOWTABLE_NAME: name of this flow table (NLA_STRING) -+ * @NFTA_FLOWTABLE_HOOK: netfilter hook configuration(NLA_U32) -+ * @NFTA_FLOWTABLE_USE: number of references to this flow table (NLA_U32) -+ */ -+enum nft_flowtable_attributes { -+ NFTA_FLOWTABLE_UNSPEC, -+ NFTA_FLOWTABLE_TABLE, -+ NFTA_FLOWTABLE_NAME, -+ NFTA_FLOWTABLE_HOOK, -+ NFTA_FLOWTABLE_USE, -+ __NFTA_FLOWTABLE_MAX -+}; -+#define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1) -+ -+/** -+ * enum nft_flowtable_hook_attributes - nf_tables flow table hook netlink attributes -+ * -+ * @NFTA_FLOWTABLE_HOOK_NUM: netfilter hook number (NLA_U32) -+ * @NFTA_FLOWTABLE_HOOK_PRIORITY: netfilter hook priority (NLA_U32) -+ * @NFTA_FLOWTABLE_HOOK_DEVS: input devices this flow table is bound to (NLA_NESTED) -+ */ -+enum nft_flowtable_hook_attributes { -+ NFTA_FLOWTABLE_HOOK_UNSPEC, -+ NFTA_FLOWTABLE_HOOK_NUM, -+ NFTA_FLOWTABLE_HOOK_PRIORITY, -+ NFTA_FLOWTABLE_HOOK_DEVS, -+ __NFTA_FLOWTABLE_HOOK_MAX -+}; -+#define NFTA_FLOWTABLE_HOOK_MAX (__NFTA_FLOWTABLE_HOOK_MAX - 1) -+ -+/** -+ * enum nft_device_attributes - nf_tables device netlink attributes -+ * -+ * @NFTA_DEVICE_NAME: name of this device (NLA_STRING) -+ */ -+enum nft_devices_attributes { -+ NFTA_DEVICE_UNSPEC, -+ NFTA_DEVICE_NAME, -+ __NFTA_DEVICE_MAX -+}; -+#define NFTA_DEVICE_MAX (__NFTA_DEVICE_MAX - 1) -+ -+ -+/** - * enum nft_trace_attributes - nf_tables trace netlink attributes - * - * @NFTA_TRACE_TABLE: name of the table (NLA_STRING) ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -8,6 +8,7 @@ libnftnl_la_LDFLAGS = -Wl,--version-scri - libnftnl_la_SOURCES = utils.c \ - batch.c \ - buffer.c \ -+ flowtable.c \ - common.c \ - gen.c \ - table.c \ ---- /dev/null -+++ b/src/flowtable.c -@@ -0,0 +1,793 @@ -+#include "internal.h" -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+struct nftnl_flowtable { -+ struct list_head head; -+ const char *name; -+ const char *table; -+ int family; -+ uint32_t hooknum; -+ int32_t prio; -+ const char **dev_array; -+ uint32_t dev_array_len; -+ uint32_t use; -+ uint32_t flags; -+}; -+ -+struct nftnl_flowtable *nftnl_flowtable_alloc(void) -+{ -+ return calloc(1, sizeof(struct nftnl_flowtable)); -+} -+EXPORT_SYMBOL(nftnl_flowtable_alloc); -+ -+void nftnl_flowtable_free(const struct nftnl_flowtable *c) -+{ -+ int i; -+ -+ if (c->flags & (1 << NFTNL_FLOWTABLE_NAME)) -+ xfree(c->name); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE)) -+ xfree(c->table); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_DEVICES)) { -+ for (i = 0; i < c->dev_array_len; i++) -+ xfree(c->dev_array[i]); -+ -+ xfree(c->dev_array); -+ } -+ xfree(c); -+} -+EXPORT_SYMBOL(nftnl_flowtable_free); -+ -+bool nftnl_flowtable_is_set(const struct nftnl_flowtable *c, uint16_t attr) -+{ -+ return c->flags & (1 << attr); -+} -+EXPORT_SYMBOL(nftnl_flowtable_is_set); -+ -+void nftnl_flowtable_unset(struct nftnl_flowtable *c, uint16_t attr) -+{ -+ int i; -+ -+ if (!(c->flags & (1 << attr))) -+ return; -+ -+ switch (attr) { -+ case NFTNL_FLOWTABLE_NAME: -+ xfree(c->name); -+ break; -+ case NFTNL_FLOWTABLE_TABLE: -+ xfree(c->table); -+ break; -+ case NFTNL_FLOWTABLE_HOOKNUM: -+ case NFTNL_FLOWTABLE_PRIO: -+ case NFTNL_FLOWTABLE_USE: -+ case NFTNL_FLOWTABLE_FAMILY: -+ break; -+ case NFTNL_FLOWTABLE_DEVICES: -+ for (i = 0; i < c->dev_array_len; i++) { -+ xfree(c->dev_array[i]); -+ xfree(c->dev_array); -+ } -+ break; -+ default: -+ return; -+ } -+ -+ c->flags &= ~(1 << attr); -+} -+EXPORT_SYMBOL(nftnl_flowtable_unset); -+ -+static uint32_t nftnl_flowtable_validate[NFTNL_FLOWTABLE_MAX + 1] = { -+ [NFTNL_FLOWTABLE_HOOKNUM] = sizeof(uint32_t), -+ [NFTNL_FLOWTABLE_PRIO] = sizeof(int32_t), -+ [NFTNL_FLOWTABLE_FAMILY] = sizeof(uint32_t), -+}; -+ -+int nftnl_flowtable_set_data(struct nftnl_flowtable *c, uint16_t attr, -+ const void *data, uint32_t data_len) -+{ -+ const char **dev_array; -+ int len = 0, i; -+ -+ nftnl_assert_attr_exists(attr, NFTNL_FLOWTABLE_MAX); -+ nftnl_assert_validate(data, nftnl_flowtable_validate, attr, data_len); -+ -+ switch(attr) { -+ case NFTNL_FLOWTABLE_NAME: -+ if (c->flags & (1 << NFTNL_FLOWTABLE_NAME)) -+ xfree(c->name); -+ -+ c->name = strdup(data); -+ if (!c->name) -+ return -1; -+ break; -+ case NFTNL_FLOWTABLE_TABLE: -+ if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE)) -+ xfree(c->table); -+ -+ c->table = strdup(data); -+ if (!c->table) -+ return -1; -+ break; -+ case NFTNL_FLOWTABLE_HOOKNUM: -+ memcpy(&c->hooknum, data, sizeof(c->hooknum)); -+ break; -+ case NFTNL_FLOWTABLE_PRIO: -+ memcpy(&c->prio, data, sizeof(c->prio)); -+ break; -+ case NFTNL_FLOWTABLE_FAMILY: -+ memcpy(&c->family, data, sizeof(c->family)); -+ break; -+ case NFTNL_FLOWTABLE_DEVICES: -+ dev_array = (const char **)data; -+ while (dev_array[len] != NULL) -+ len++; -+ -+ if (c->flags & (1 << NFTNL_FLOWTABLE_DEVICES)) { -+ for (i = 0; i < c->dev_array_len; i++) { -+ xfree(c->dev_array[i]); -+ xfree(c->dev_array); -+ } -+ } -+ -+ c->dev_array = calloc(len + 1, sizeof(char *)); -+ if (!c->dev_array) -+ return -1; -+ -+ for (i = 0; i < len; i++) -+ c->dev_array[i] = strdup(dev_array[i]); -+ -+ c->dev_array_len = len; -+ break; -+ } -+ c->flags |= (1 << attr); -+ return 0; -+} -+EXPORT_SYMBOL(nftnl_flowtable_set_data); -+ -+void nftnl_flowtable_set(struct nftnl_flowtable *c, uint16_t attr, const void *data) -+{ -+ nftnl_flowtable_set_data(c, attr, data, nftnl_flowtable_validate[attr]); -+} -+EXPORT_SYMBOL(nftnl_flowtable_set); -+ -+void nftnl_flowtable_set_array(struct nftnl_flowtable *c, uint16_t attr, const char **data) -+{ -+ nftnl_flowtable_set_data(c, attr, &data[0], nftnl_flowtable_validate[attr]); -+} -+EXPORT_SYMBOL(nftnl_flowtable_set_array); -+ -+void nftnl_flowtable_set_u32(struct nftnl_flowtable *c, uint16_t attr, uint32_t data) -+{ -+ nftnl_flowtable_set_data(c, attr, &data, sizeof(uint32_t)); -+} -+EXPORT_SYMBOL(nftnl_flowtable_set_u32); -+ -+void nftnl_flowtable_set_s32(struct nftnl_flowtable *c, uint16_t attr, int32_t data) -+{ -+ nftnl_flowtable_set_data(c, attr, &data, sizeof(int32_t)); -+} -+EXPORT_SYMBOL(nftnl_flowtable_set_s32); -+ -+int nftnl_flowtable_set_str(struct nftnl_flowtable *c, uint16_t attr, const char *str) -+{ -+ return nftnl_flowtable_set_data(c, attr, str, strlen(str) + 1); -+} -+EXPORT_SYMBOL(nftnl_flowtable_set_str); -+ -+const void *nftnl_flowtable_get_data(const struct nftnl_flowtable *c, -+ uint16_t attr, uint32_t *data_len) -+{ -+ if (!(c->flags & (1 << attr))) -+ return NULL; -+ -+ switch(attr) { -+ case NFTNL_FLOWTABLE_NAME: -+ *data_len = strlen(c->name) + 1; -+ return c->name; -+ case NFTNL_FLOWTABLE_TABLE: -+ *data_len = strlen(c->table) + 1; -+ return c->table; -+ case NFTNL_FLOWTABLE_HOOKNUM: -+ *data_len = sizeof(uint32_t); -+ return &c->hooknum; -+ case NFTNL_FLOWTABLE_PRIO: -+ *data_len = sizeof(int32_t); -+ return &c->prio; -+ case NFTNL_FLOWTABLE_FAMILY: -+ *data_len = sizeof(int32_t); -+ return &c->family; -+ case NFTNL_FLOWTABLE_DEVICES: -+ return &c->dev_array[0]; -+ } -+ return NULL; -+} -+EXPORT_SYMBOL(nftnl_flowtable_get_data); -+ -+const void *nftnl_flowtable_get(const struct nftnl_flowtable *c, uint16_t attr) -+{ -+ uint32_t data_len; -+ return nftnl_flowtable_get_data(c, attr, &data_len); -+} -+EXPORT_SYMBOL(nftnl_flowtable_get); -+ -+const char *nftnl_flowtable_get_str(const struct nftnl_flowtable *c, uint16_t attr) -+{ -+ return nftnl_flowtable_get(c, attr); -+} -+EXPORT_SYMBOL(nftnl_flowtable_get_str); -+ -+uint32_t nftnl_flowtable_get_u32(const struct nftnl_flowtable *c, uint16_t attr) -+{ -+ uint32_t data_len; -+ const uint32_t *val = nftnl_flowtable_get_data(c, attr, &data_len); -+ -+ nftnl_assert(val, attr, data_len == sizeof(uint32_t)); -+ -+ return val ? *val : 0; -+} -+EXPORT_SYMBOL(nftnl_flowtable_get_u32); -+ -+int32_t nftnl_flowtable_get_s32(const struct nftnl_flowtable *c, uint16_t attr) -+{ -+ uint32_t data_len; -+ const int32_t *val = nftnl_flowtable_get_data(c, attr, &data_len); -+ -+ nftnl_assert(val, attr, data_len == sizeof(int32_t)); -+ -+ return val ? *val : 0; -+} -+EXPORT_SYMBOL(nftnl_flowtable_get_s32); -+ -+const char **nftnl_flowtable_get_array(const struct nftnl_flowtable *c, uint16_t attr) -+{ -+ return (const char **)nftnl_flowtable_get(c, attr); -+} -+EXPORT_SYMBOL(nftnl_flowtable_get_array); -+ -+void nftnl_flowtable_nlmsg_build_payload(struct nlmsghdr *nlh, -+ const struct nftnl_flowtable *c) -+{ -+ int i; -+ -+ if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE)) -+ mnl_attr_put_strz(nlh, NFTA_FLOWTABLE_TABLE, c->table); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_NAME)) -+ mnl_attr_put_strz(nlh, NFTA_FLOWTABLE_NAME, c->name); -+ if ((c->flags & (1 << NFTNL_FLOWTABLE_HOOKNUM)) && -+ (c->flags & (1 << NFTNL_FLOWTABLE_PRIO))) { -+ struct nlattr *nest; -+ -+ nest = mnl_attr_nest_start(nlh, NFTA_FLOWTABLE_HOOK); -+ mnl_attr_put_u32(nlh, NFTA_FLOWTABLE_HOOK_NUM, htonl(c->hooknum)); -+ mnl_attr_put_u32(nlh, NFTA_FLOWTABLE_HOOK_PRIORITY, htonl(c->prio)); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_DEVICES)) { -+ struct nlattr *nest_dev; -+ -+ nest_dev = mnl_attr_nest_start(nlh, -+ NFTA_FLOWTABLE_HOOK_DEVS); -+ for (i = 0; i < c->dev_array_len; i++) -+ mnl_attr_put_strz(nlh, NFTA_DEVICE_NAME, -+ c->dev_array[i]); -+ mnl_attr_nest_end(nlh, nest_dev); -+ } -+ mnl_attr_nest_end(nlh, nest); -+ } -+ if (c->flags & (1 << NFTNL_FLOWTABLE_USE)) -+ mnl_attr_put_u32(nlh, NFTA_FLOWTABLE_USE, htonl(c->use)); -+} -+EXPORT_SYMBOL(nftnl_flowtable_nlmsg_build_payload); -+ -+static int nftnl_flowtable_parse_attr_cb(const struct nlattr *attr, void *data) -+{ -+ const struct nlattr **tb = data; -+ int type = mnl_attr_get_type(attr); -+ -+ if (mnl_attr_type_valid(attr, NFTA_FLOWTABLE_MAX) < 0) -+ return MNL_CB_OK; -+ -+ switch(type) { -+ case NFTA_FLOWTABLE_NAME: -+ case NFTA_FLOWTABLE_TABLE: -+ if (mnl_attr_validate(attr, MNL_TYPE_STRING) < 0) -+ abi_breakage(); -+ break; -+ case NFTA_FLOWTABLE_HOOK: -+ if (mnl_attr_validate(attr, MNL_TYPE_NESTED) < 0) -+ abi_breakage(); -+ break; -+ case NFTA_FLOWTABLE_USE: -+ if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) -+ abi_breakage(); -+ break; -+ } -+ -+ tb[type] = attr; -+ return MNL_CB_OK; -+} -+ -+static int nftnl_flowtable_parse_hook_cb(const struct nlattr *attr, void *data) -+{ -+ const struct nlattr **tb = data; -+ int type = mnl_attr_get_type(attr); -+ -+ if (mnl_attr_type_valid(attr, NFTA_FLOWTABLE_HOOK_MAX) < 0) -+ return MNL_CB_OK; -+ -+ switch(type) { -+ case NFTA_FLOWTABLE_HOOK_NUM: -+ case NFTA_FLOWTABLE_HOOK_PRIORITY: -+ if (mnl_attr_validate(attr, MNL_TYPE_U32) < 0) -+ abi_breakage(); -+ break; -+ case NFTA_FLOWTABLE_HOOK_DEVS: -+ if (mnl_attr_validate(attr, MNL_TYPE_NESTED) < 0) -+ abi_breakage(); -+ break; -+ } -+ -+ tb[type] = attr; -+ return MNL_CB_OK; -+} -+ -+static int nftnl_flowtable_parse_devs(struct nlattr *nest, -+ struct nftnl_flowtable *c) -+{ -+ struct nlattr *attr; -+ char *dev_array[8]; -+ int len = 0, i; -+ -+ mnl_attr_for_each_nested(attr, nest) { -+ if (mnl_attr_get_type(attr) != NFTA_DEVICE_NAME) -+ return -1; -+ dev_array[len++] = strdup(mnl_attr_get_str(attr)); -+ if (len >= 8) -+ break; -+ } -+ -+ if (!len) -+ return -1; -+ -+ c->dev_array = calloc(len + 1, sizeof(char *)); -+ if (!c->dev_array) -+ return -1; -+ -+ c->dev_array_len = len; -+ -+ for (i = 0; i < len; i++) -+ c->dev_array[i] = strdup(dev_array[i]); -+ -+ return 0; -+} -+ -+static int nftnl_flowtable_parse_hook(struct nlattr *attr, struct nftnl_flowtable *c) -+{ -+ struct nlattr *tb[NFTA_FLOWTABLE_HOOK_MAX + 1] = {}; -+ int ret; -+ -+ if (mnl_attr_parse_nested(attr, nftnl_flowtable_parse_hook_cb, tb) < 0) -+ return -1; -+ -+ if (tb[NFTA_FLOWTABLE_HOOK_NUM]) { -+ c->hooknum = ntohl(mnl_attr_get_u32(tb[NFTA_FLOWTABLE_HOOK_NUM])); -+ c->flags |= (1 << NFTNL_FLOWTABLE_HOOKNUM); -+ } -+ if (tb[NFTA_FLOWTABLE_HOOK_PRIORITY]) { -+ c->prio = ntohl(mnl_attr_get_u32(tb[NFTA_FLOWTABLE_HOOK_PRIORITY])); -+ c->flags |= (1 << NFTNL_FLOWTABLE_PRIO); -+ } -+ if (tb[NFTA_FLOWTABLE_HOOK_DEVS]) { -+ ret = nftnl_flowtable_parse_devs(tb[NFTA_FLOWTABLE_HOOK_DEVS], c); -+ if (ret < 0) -+ return -1; -+ c->flags |= (1 << NFTNL_FLOWTABLE_DEVICES); -+ } -+ -+ return 0; -+} -+ -+int nftnl_flowtable_nlmsg_parse(const struct nlmsghdr *nlh, struct nftnl_flowtable *c) -+{ -+ struct nlattr *tb[NFTA_FLOWTABLE_MAX + 1] = {}; -+ struct nfgenmsg *nfg = mnl_nlmsg_get_payload(nlh); -+ int ret = 0; -+ -+ if (mnl_attr_parse(nlh, sizeof(*nfg), nftnl_flowtable_parse_attr_cb, tb) < 0) -+ return -1; -+ -+ if (tb[NFTA_FLOWTABLE_NAME]) { -+ if (c->flags & (1 << NFTNL_FLOWTABLE_NAME)) -+ xfree(c->name); -+ c->name = strdup(mnl_attr_get_str(tb[NFTA_FLOWTABLE_NAME])); -+ if (!c->name) -+ return -1; -+ c->flags |= (1 << NFTNL_FLOWTABLE_NAME); -+ } -+ if (tb[NFTA_FLOWTABLE_TABLE]) { -+ if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE)) -+ xfree(c->table); -+ c->table = strdup(mnl_attr_get_str(tb[NFTA_FLOWTABLE_TABLE])); -+ if (!c->table) -+ return -1; -+ c->flags |= (1 << NFTNL_FLOWTABLE_TABLE); -+ } -+ if (tb[NFTA_FLOWTABLE_HOOK]) { -+ ret = nftnl_flowtable_parse_hook(tb[NFTA_FLOWTABLE_HOOK], c); -+ if (ret < 0) -+ return ret; -+ } -+ if (tb[NFTA_FLOWTABLE_USE]) { -+ c->use = ntohl(mnl_attr_get_u32(tb[NFTA_FLOWTABLE_USE])); -+ c->flags |= (1 << NFTNL_FLOWTABLE_USE); -+ } -+ -+ c->family = nfg->nfgen_family; -+ c->flags |= (1 << NFTNL_FLOWTABLE_FAMILY); -+ -+ return ret; -+} -+EXPORT_SYMBOL(nftnl_flowtable_nlmsg_parse); -+ -+static const char *nftnl_hooknum2str(int family, int hooknum) -+{ -+ switch (family) { -+ case NFPROTO_IPV4: -+ case NFPROTO_IPV6: -+ case NFPROTO_INET: -+ case NFPROTO_BRIDGE: -+ switch (hooknum) { -+ case NF_INET_PRE_ROUTING: -+ return "prerouting"; -+ case NF_INET_LOCAL_IN: -+ return "input"; -+ case NF_INET_FORWARD: -+ return "forward"; -+ case NF_INET_LOCAL_OUT: -+ return "output"; -+ case NF_INET_POST_ROUTING: -+ return "postrouting"; -+ } -+ break; -+ case NFPROTO_ARP: -+ switch (hooknum) { -+ case NF_ARP_IN: -+ return "input"; -+ case NF_ARP_OUT: -+ return "output"; -+ case NF_ARP_FORWARD: -+ return "forward"; -+ } -+ break; -+ case NFPROTO_NETDEV: -+ switch (hooknum) { -+ case NF_NETDEV_INGRESS: -+ return "ingress"; -+ } -+ break; -+ } -+ return "unknown"; -+} -+ -+static inline int nftnl_str2hooknum(int family, const char *hook) -+{ -+ int hooknum; -+ -+ for (hooknum = 0; hooknum < NF_INET_NUMHOOKS; hooknum++) { -+ if (strcmp(hook, nftnl_hooknum2str(family, hooknum)) == 0) -+ return hooknum; -+ } -+ return -1; -+} -+ -+#ifdef JSON_PARSING -+static int nftnl_jansson_parse_flowtable(struct nftnl_flowtable *c, -+ json_t *tree, -+ struct nftnl_parse_err *err) -+{ -+ const char *name, *table, *hooknum_str; -+ int32_t family, prio, hooknum; -+ json_t *root; -+ -+ root = nftnl_jansson_get_node(tree, "flowtable", err); -+ if (root == NULL) -+ return -1; -+ -+ name = nftnl_jansson_parse_str(root, "name", err); -+ if (name != NULL) -+ nftnl_flowtable_set_str(c, NFTNL_FLOWTABLE_NAME, name); -+ -+ if (nftnl_jansson_parse_family(root, &family, err) == 0) -+ nftnl_flowtable_set_u32(c, NFTNL_FLOWTABLE_FAMILY, family); -+ -+ table = nftnl_jansson_parse_str(root, "table", err); -+ -+ if (table != NULL) -+ nftnl_flowtable_set_str(c, NFTNL_FLOWTABLE_TABLE, table); -+ -+ if (nftnl_jansson_node_exist(root, "hooknum")) { -+ if (nftnl_jansson_parse_val(root, "prio", NFTNL_TYPE_S32, -+ &prio, err) == 0) -+ nftnl_flowtable_set_s32(c, NFTNL_FLOWTABLE_PRIO, prio); -+ -+ hooknum_str = nftnl_jansson_parse_str(root, "hooknum", err); -+ if (hooknum_str != NULL) { -+ hooknum = nftnl_str2hooknum(c->family, hooknum_str); -+ if (hooknum == -1) -+ return -1; -+ nftnl_flowtable_set_u32(c, NFTNL_FLOWTABLE_HOOKNUM, -+ hooknum); -+ } -+ } -+ -+ return 0; -+} -+#endif -+ -+static int nftnl_flowtable_json_parse(struct nftnl_flowtable *c, -+ const void *json, -+ struct nftnl_parse_err *err, -+ enum nftnl_parse_input input) -+{ -+#ifdef JSON_PARSING -+ json_t *tree; -+ json_error_t error; -+ int ret; -+ -+ tree = nftnl_jansson_create_root(json, &error, err, input); -+ if (tree == NULL) -+ return -1; -+ -+ ret = nftnl_jansson_parse_flowtable(c, tree, err); -+ -+ nftnl_jansson_free_root(tree); -+ -+ return ret; -+#else -+ errno = EOPNOTSUPP; -+ return -1; -+#endif -+} -+ -+static int nftnl_flowtable_do_parse(struct nftnl_flowtable *c, -+ enum nftnl_parse_type type, -+ const void *data, -+ struct nftnl_parse_err *err, -+ enum nftnl_parse_input input) -+{ -+ int ret; -+ struct nftnl_parse_err perr = {}; -+ -+ switch (type) { -+ case NFTNL_PARSE_JSON: -+ ret = nftnl_flowtable_json_parse(c, data, &perr, input); -+ break; -+ case NFTNL_PARSE_XML: -+ default: -+ ret = -1; -+ errno = EOPNOTSUPP; -+ break; -+ } -+ -+ if (err != NULL) -+ *err = perr; -+ -+ return ret; -+} -+ -+int nftnl_flowtable_parse(struct nftnl_flowtable *c, enum nftnl_parse_type type, -+ const char *data, struct nftnl_parse_err *err) -+{ -+ return nftnl_flowtable_do_parse(c, type, data, err, NFTNL_PARSE_BUFFER); -+} -+EXPORT_SYMBOL(nftnl_flowtable_parse); -+ -+int nftnl_flowtable_parse_file(struct nftnl_flowtable *c, -+ enum nftnl_parse_type type, -+ FILE *fp, struct nftnl_parse_err *err) -+{ -+ return nftnl_flowtable_do_parse(c, type, fp, err, NFTNL_PARSE_FILE); -+} -+EXPORT_SYMBOL(nftnl_flowtable_parse_file); -+ -+static int nftnl_flowtable_export(char *buf, size_t size, -+ const struct nftnl_flowtable *c, int type) -+{ -+ NFTNL_BUF_INIT(b, buf, size); -+ -+ nftnl_buf_open(&b, type, CHAIN); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_NAME)) -+ nftnl_buf_str(&b, type, c->name, NAME); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_TABLE)) -+ nftnl_buf_str(&b, type, c->table, TABLE); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_FAMILY)) -+ nftnl_buf_str(&b, type, nftnl_family2str(c->family), FAMILY); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_USE)) -+ nftnl_buf_u32(&b, type, c->use, USE); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_HOOKNUM)) { -+ if (c->flags & (1 << NFTNL_FLOWTABLE_HOOKNUM)) -+ nftnl_buf_str(&b, type, nftnl_hooknum2str(c->family, -+ c->hooknum), HOOKNUM); -+ if (c->flags & (1 << NFTNL_FLOWTABLE_PRIO)) -+ nftnl_buf_s32(&b, type, c->prio, PRIO); -+ } -+ -+ nftnl_buf_close(&b, type, CHAIN); -+ -+ return nftnl_buf_done(&b); -+} -+ -+static int nftnl_flowtable_snprintf_default(char *buf, size_t size, -+ const struct nftnl_flowtable *c) -+{ -+ int ret, remain = size, offset = 0, i; -+ -+ ret = snprintf(buf, remain, "flow table %s %s use %u", -+ c->table, c->name, c->use); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ if (c->flags & (1 << NFTNL_FLOWTABLE_HOOKNUM)) { -+ ret = snprintf(buf + offset, remain, " hook %s prio %d", -+ nftnl_hooknum2str(c->family, c->hooknum), -+ c->prio); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ if (c->flags & (1 << NFTNL_FLOWTABLE_DEVICES)) { -+ ret = snprintf(buf + offset, remain, " dev { "); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ for (i = 0; i < c->dev_array_len; i++) { -+ ret = snprintf(buf + offset, remain, " %s ", -+ c->dev_array[i]); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ } -+ ret = snprintf(buf + offset, remain, " } "); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ } -+ } -+ -+ return offset; -+} -+ -+static int nftnl_flowtable_cmd_snprintf(char *buf, size_t size, -+ const struct nftnl_flowtable *c, -+ uint32_t cmd, uint32_t type, -+ uint32_t flags) -+{ -+ int ret, remain = size, offset = 0; -+ -+ ret = nftnl_cmd_header_snprintf(buf + offset, remain, cmd, type, flags); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ switch (type) { -+ case NFTNL_OUTPUT_DEFAULT: -+ ret = nftnl_flowtable_snprintf_default(buf + offset, remain, c); -+ break; -+ case NFTNL_OUTPUT_XML: -+ case NFTNL_OUTPUT_JSON: -+ ret = nftnl_flowtable_export(buf + offset, remain, c, type); -+ break; -+ default: -+ return -1; -+ } -+ -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ ret = nftnl_cmd_footer_snprintf(buf + offset, remain, cmd, type, flags); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ return offset; -+} -+ -+int nftnl_flowtable_snprintf(char *buf, size_t size, const struct nftnl_flowtable *c, -+ uint32_t type, uint32_t flags) -+{ -+ if (size) -+ buf[0] = '\0'; -+ -+ return nftnl_flowtable_cmd_snprintf(buf, size, c, nftnl_flag2cmd(flags), -+ type, flags); -+} -+EXPORT_SYMBOL(nftnl_flowtable_snprintf); -+ -+static int nftnl_flowtable_do_snprintf(char *buf, size_t size, const void *c, -+ uint32_t cmd, uint32_t type, uint32_t flags) -+{ -+ return nftnl_flowtable_snprintf(buf, size, c, type, flags); -+} -+ -+int nftnl_flowtable_fprintf(FILE *fp, const struct nftnl_flowtable *c, -+ uint32_t type, uint32_t flags) -+{ -+ return nftnl_fprintf(fp, c, NFTNL_CMD_UNSPEC, type, flags, -+ nftnl_flowtable_do_snprintf); -+} -+EXPORT_SYMBOL(nftnl_flowtable_fprintf); -+ -+struct nftnl_flowtable_list { -+ struct list_head list; -+}; -+ -+struct nftnl_flowtable_list *nftnl_flowtable_list_alloc(void) -+{ -+ struct nftnl_flowtable_list *list; -+ -+ list = calloc(1, sizeof(struct nftnl_flowtable_list)); -+ if (list == NULL) -+ return NULL; -+ -+ INIT_LIST_HEAD(&list->list); -+ -+ return list; -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_alloc); -+ -+void nftnl_flowtable_list_free(struct nftnl_flowtable_list *list) -+{ -+ struct nftnl_flowtable *s, *tmp; -+ -+ list_for_each_entry_safe(s, tmp, &list->list, head) { -+ list_del(&s->head); -+ nftnl_flowtable_free(s); -+ } -+ xfree(list); -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_free); -+ -+int nftnl_flowtable_list_is_empty(const struct nftnl_flowtable_list *list) -+{ -+ return list_empty(&list->list); -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_is_empty); -+ -+void nftnl_flowtable_list_add(struct nftnl_flowtable *s, -+ struct nftnl_flowtable_list *list) -+{ -+ list_add(&s->head, &list->list); -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_add); -+ -+void nftnl_flowtable_list_add_tail(struct nftnl_flowtable *s, -+ struct nftnl_flowtable_list *list) -+{ -+ list_add_tail(&s->head, &list->list); -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_add_tail); -+ -+void nftnl_flowtable_list_del(struct nftnl_flowtable *s) -+{ -+ list_del(&s->head); -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_del); -+ -+int nftnl_flowtable_list_foreach(struct nftnl_flowtable_list *flowtable_list, -+ int (*cb)(struct nftnl_flowtable *t, void *data), void *data) -+{ -+ struct nftnl_flowtable *cur, *tmp; -+ int ret; -+ -+ list_for_each_entry_safe(cur, tmp, &flowtable_list->list, head) { -+ ret = cb(cur, data); -+ if (ret < 0) -+ return ret; -+ } -+ return 0; -+} -+EXPORT_SYMBOL(nftnl_flowtable_list_foreach); ---- a/src/libnftnl.map -+++ b/src/libnftnl.map -@@ -311,3 +311,34 @@ local: *; - LIBNFTNL_6 { - nftnl_expr_fprintf; - } LIBNFTNL_5; -+ -+LIBNFTNL_7 { -+ nftnl_flowtable_alloc; -+ nftnl_flowtable_free; -+ nftnl_flowtable_is_set; -+ nftnl_flowtable_unset; -+ nftnl_flowtable_set; -+ nftnl_flowtable_set_u32; -+ nftnl_flowtable_set_s32; -+ nftnl_flowtable_set_array; -+ nftnl_flowtable_set_str; -+ nftnl_flowtable_get; -+ nftnl_flowtable_get_u32; -+ nftnl_flowtable_get_s32; -+ nftnl_flowtable_get_array; -+ nftnl_flowtable_get_str; -+ nftnl_flowtable_parse; -+ nftnl_flowtable_parse_file; -+ nftnl_flowtable_snprintf; -+ nftnl_flowtable_fprintf; -+ nftnl_flowtable_nlmsg_build_payload; -+ nftnl_flowtable_nlmsg_parse; -+ nftnl_flowtable_list_alloc; -+ nftnl_flowtable_list_free; -+ nftnl_flowtable_list_is_empty; -+ nftnl_flowtable_list_add; -+ nftnl_flowtable_list_add_tail; -+ nftnl_flowtable_list_del; -+ nftnl_flowtable_list_foreach; -+ -+} LIBNFTNL_6; diff --git a/package/libs/libnftnl/patches/101-expr-add-flow-offload-expression.patch b/package/libs/libnftnl/patches/101-expr-add-flow-offload-expression.patch deleted file mode 100644 index c7d3676accb..00000000000 --- a/package/libs/libnftnl/patches/101-expr-add-flow-offload-expression.patch +++ /dev/null @@ -1,259 +0,0 @@ -From: Pablo Neira Ayuso -Date: Sun, 3 Dec 2017 21:05:54 +0100 -Subject: [PATCH] expr: add flow offload expression - -This patch adds the new "flow_offload" expression to select what flows -are offloaded to an existing flowtable. - -Signed-off-by: Pablo Neira Ayuso ---- - create mode 100644 src/expr/flow_offload.c - ---- a/include/libnftnl/expr.h -+++ b/include/libnftnl/expr.h -@@ -221,6 +221,10 @@ enum { - }; - - enum { -+ NFTNL_EXPR_FLOW_TABLE_NAME = NFTNL_EXPR_BASE, -+}; -+ -+enum { - NFTNL_EXPR_FWD_SREG_DEV = NFTNL_EXPR_BASE, - }; - ---- a/include/linux/netfilter/nf_tables.h -+++ b/include/linux/netfilter/nf_tables.h -@@ -952,6 +952,17 @@ enum nft_ct_attributes { - }; - #define NFTA_CT_MAX (__NFTA_CT_MAX - 1) - -+/** -+ * enum nft_flow_attributes - ct offload expression attributes -+ * @NFTA_FLOW_TABLE_NAME: flow table name (NLA_STRING) -+ */ -+enum nft_offload_attributes { -+ NFTA_FLOW_UNSPEC, -+ NFTA_FLOW_TABLE_NAME, -+ __NFTA_FLOW_MAX, -+}; -+#define NFTA_FLOW_MAX (__NFTA_FLOW_MAX - 1) -+ - enum nft_limit_type { - NFT_LIMIT_PKTS, - NFT_LIMIT_PKT_BYTES ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -32,6 +32,7 @@ libnftnl_la_SOURCES = utils.c \ - expr/data_reg.c \ - expr/dup.c \ - expr/exthdr.c \ -+ expr/flow_offload.c \ - expr/fib.c \ - expr/fwd.c \ - expr/limit.c \ ---- /dev/null -+++ b/src/expr/flow_offload.c -@@ -0,0 +1,184 @@ -+#include "internal.h" -+ -+#include -+#include -+#include /* for memcpy */ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+struct nftnl_expr_flow { -+ char *table_name; -+}; -+ -+static int nftnl_expr_flow_set(struct nftnl_expr *e, uint16_t type, -+ const void *data, uint32_t data_len) -+{ -+ struct nftnl_expr_flow *flow = nftnl_expr_data(e); -+ -+ switch (type) { -+ case NFTNL_EXPR_FLOW_TABLE_NAME: -+ flow->table_name = strdup((const char *)data); -+ if (!flow->table_name) -+ return -1; -+ break; -+ default: -+ return -1; -+ } -+ return 0; -+} -+ -+static const void *nftnl_expr_flow_get(const struct nftnl_expr *e, -+ uint16_t type, uint32_t *data_len) -+{ -+ struct nftnl_expr_flow *flow = nftnl_expr_data(e); -+ -+ switch(type) { -+ case NFTNL_EXPR_FLOW_TABLE_NAME: -+ *data_len = strlen(flow->table_name) + 1; -+ return flow->table_name; -+ } -+ return NULL; -+} -+ -+static int nftnl_expr_flow_cb(const struct nlattr *attr, void *data) -+{ -+ const struct nlattr **tb = data; -+ int type = mnl_attr_get_type(attr); -+ -+ if (mnl_attr_type_valid(attr, NFTA_FLOW_MAX) < 0) -+ return MNL_CB_OK; -+ -+ switch(type) { -+ case NFTA_FLOW_TABLE_NAME: -+ if (mnl_attr_validate(attr, MNL_TYPE_STRING) < 0) -+ abi_breakage(); -+ break; -+ } -+ -+ tb[type] = attr; -+ return MNL_CB_OK; -+} -+ -+static void nftnl_expr_flow_build(struct nlmsghdr *nlh, -+ const struct nftnl_expr *e) -+{ -+ struct nftnl_expr_flow *flow = nftnl_expr_data(e); -+ -+ if (e->flags & (1 << NFTNL_EXPR_FLOW_TABLE_NAME)) -+ mnl_attr_put_strz(nlh, NFTA_FLOW_TABLE_NAME, flow->table_name); -+} -+ -+static int nftnl_expr_flow_parse(struct nftnl_expr *e, struct nlattr *attr) -+{ -+ struct nftnl_expr_flow *flow = nftnl_expr_data(e); -+ struct nlattr *tb[NFTA_FLOW_MAX+1] = {}; -+ int ret = 0; -+ -+ if (mnl_attr_parse_nested(attr, nftnl_expr_flow_cb, tb) < 0) -+ return -1; -+ -+ if (tb[NFTA_FLOW_TABLE_NAME]) { -+ flow->table_name = -+ strdup(mnl_attr_get_str(tb[NFTA_FLOW_TABLE_NAME])); -+ if (!flow->table_name) -+ return -1; -+ e->flags |= (1 << NFTNL_EXPR_FLOW_TABLE_NAME); -+ } -+ -+ return ret; -+} -+ -+static int -+nftnl_expr_flow_json_parse(struct nftnl_expr *e, json_t *root, -+ struct nftnl_parse_err *err) -+{ -+#ifdef JSON_PARSING -+ const char *table_name; -+ -+ table_name = nftnl_jansson_parse_str(root, "flowtable", err); -+ if (table_name != NULL) -+ nftnl_expr_set_str(e, NFTNL_EXPR_FLOW_TABLE_NAME, table_name); -+ -+ return 0; -+#else -+ errno = EOPNOTSUPP; -+ return -1; -+#endif -+} -+ -+static int nftnl_expr_flow_export(char *buf, size_t size, -+ const struct nftnl_expr *e, int type) -+{ -+ struct nftnl_expr_flow *l = nftnl_expr_data(e); -+ NFTNL_BUF_INIT(b, buf, size); -+ -+ if (e->flags & (1 << NFTNL_EXPR_FLOW_TABLE_NAME)) -+ nftnl_buf_str(&b, type, l->table_name, SET); -+ -+ return nftnl_buf_done(&b); -+} -+ -+static int nftnl_expr_flow_snprintf_default(char *buf, size_t size, -+ const struct nftnl_expr *e) -+{ -+ int remain = size, offset = 0, ret; -+ struct nftnl_expr_flow *l = nftnl_expr_data(e); -+ -+ ret = snprintf(buf, remain, "flowtable %s ", l->table_name); -+ SNPRINTF_BUFFER_SIZE(ret, remain, offset); -+ -+ return offset; -+} -+ -+static int nftnl_expr_flow_snprintf(char *buf, size_t size, uint32_t type, -+ uint32_t flags, const struct nftnl_expr *e) -+{ -+ switch(type) { -+ case NFTNL_OUTPUT_DEFAULT: -+ return nftnl_expr_flow_snprintf_default(buf, size, e); -+ case NFTNL_OUTPUT_XML: -+ case NFTNL_OUTPUT_JSON: -+ return nftnl_expr_flow_export(buf, size, e, type); -+ default: -+ break; -+ } -+ return -1; -+} -+ -+static void nftnl_expr_flow_free(const struct nftnl_expr *e) -+{ -+ struct nftnl_expr_flow *flow = nftnl_expr_data(e); -+ -+ xfree(flow->table_name); -+} -+ -+static bool nftnl_expr_flow_cmp(const struct nftnl_expr *e1, -+ const struct nftnl_expr *e2) -+{ -+ struct nftnl_expr_flow *l1 = nftnl_expr_data(e1); -+ struct nftnl_expr_flow *l2 = nftnl_expr_data(e2); -+ bool eq = true; -+ -+ if (e1->flags & (1 << NFTNL_EXPR_FLOW_TABLE_NAME)) -+ eq &= !strcmp(l1->table_name, l2->table_name); -+ -+ return eq; -+} -+ -+struct expr_ops expr_ops_flow = { -+ .name = "flow_offload", -+ .alloc_len = sizeof(struct nftnl_expr_flow), -+ .max_attr = NFTA_FLOW_MAX, -+ .free = nftnl_expr_flow_free, -+ .cmp = nftnl_expr_flow_cmp, -+ .set = nftnl_expr_flow_set, -+ .get = nftnl_expr_flow_get, -+ .parse = nftnl_expr_flow_parse, -+ .build = nftnl_expr_flow_build, -+ .snprintf = nftnl_expr_flow_snprintf, -+ .json_parse = nftnl_expr_flow_json_parse, -+}; ---- a/src/expr_ops.c -+++ b/src/expr_ops.c -@@ -33,6 +33,7 @@ extern struct expr_ops expr_ops_target; - extern struct expr_ops expr_ops_dynset; - extern struct expr_ops expr_ops_hash; - extern struct expr_ops expr_ops_fib; -+extern struct expr_ops expr_ops_flow; - - static struct expr_ops expr_ops_notrack = { - .name = "notrack", -@@ -69,6 +70,7 @@ static struct expr_ops *expr_ops[] = { - &expr_ops_hash, - &expr_ops_fib, - &expr_ops_objref, -+ &expr_ops_flow, - NULL, - }; - From 25f58ed81a34a5528e9d51c2fbd34c568919e516 Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Tue, 15 May 2018 11:42:29 +0800 Subject: [PATCH 117/399] nftables: bump to 0.8.5 version Signed-off-by: Rosy Song (backported from 39e87e0ffc4eabf27d25459a369be425e9ef0474) --- package/network/utils/nftables/Makefile | 11 +- .../patches/100-disable-doc-generation.patch | 10 - ...00-src-support-for-flowtable-listing.patch | 515 ------------------ ...01-src-add-support-to-add-flowtables.patch | 515 ------------------ .../patches/202-src-delete-flowtable.patch | 122 ----- .../203-src-flow-offload-support.patch | 191 ------- .../204-tests-shell-add-flowtable-tests.patch | 110 ---- .../205-doc-nft-document-flowtable.patch | 128 ----- 8 files changed, 8 insertions(+), 1594 deletions(-) delete mode 100644 package/network/utils/nftables/patches/100-disable-doc-generation.patch delete mode 100644 package/network/utils/nftables/patches/200-src-support-for-flowtable-listing.patch delete mode 100644 package/network/utils/nftables/patches/201-src-add-support-to-add-flowtables.patch delete mode 100644 package/network/utils/nftables/patches/202-src-delete-flowtable.patch delete mode 100644 package/network/utils/nftables/patches/203-src-flow-offload-support.patch delete mode 100644 package/network/utils/nftables/patches/204-tests-shell-add-flowtable-tests.patch delete mode 100644 package/network/utils/nftables/patches/205-doc-nft-document-flowtable.patch diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 182fcace3b7..c7f8a946be8 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,22 +7,25 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=0.8.2 +PKG_VERSION:=0.8.5 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=675f0aaf88f11e7eacef63dc89cb65d207d9e09c3ea6d518f0ebbb013f0767ec +PKG_HASH:=8e9baf80a1c7f0e19e5b50e469bda4487793d839da45c75e8a20fadcbaeae323 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk DISABLE_NLS:= CONFIGURE_ARGS += \ + --disable-debug \ + --disable-man-doc \ --with-mini-gmp \ --without-cli \ @@ -37,7 +40,9 @@ endef define Package/nftables/install $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_BUILD_DIR)/src/nft $(1)/usr/sbin/ + $(CP) $(PKG_INSTALL_DIR)/usr/sbin/nft $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/ endef $(eval $(call BuildPackage,nftables)) diff --git a/package/network/utils/nftables/patches/100-disable-doc-generation.patch b/package/network/utils/nftables/patches/100-disable-doc-generation.patch deleted file mode 100644 index 2aa4409efb2..00000000000 --- a/package/network/utils/nftables/patches/100-disable-doc-generation.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/Makefile.am -+++ b/Makefile.am -@@ -2,7 +2,6 @@ ACLOCAL_AMFLAGS = -I m4 - - SUBDIRS = src \ - include \ -- doc \ - files - - EXTRA_DIST = tests diff --git a/package/network/utils/nftables/patches/200-src-support-for-flowtable-listing.patch b/package/network/utils/nftables/patches/200-src-support-for-flowtable-listing.patch deleted file mode 100644 index 259513de8ba..00000000000 --- a/package/network/utils/nftables/patches/200-src-support-for-flowtable-listing.patch +++ /dev/null @@ -1,515 +0,0 @@ -From: Pablo Neira Ayuso -Date: Mon, 4 Dec 2017 13:28:25 +0100 -Subject: [PATCH] src: support for flowtable listing - -This patch allows you to dump existing flowtable. - - # nft list ruleset - table ip x { - flowtable x { - hook ingress priority 10 - devices = { eth0, tap0 } - } - } - -You can also list existing flowtables via: - - # nft list flowtables - table ip x { - flowtable x { - hook ingress priority 10 - devices = { eth0, tap0 } - } - } - - You need a Linux kernel >= 4.16-rc to test this new feature. - -Signed-off-by: Pablo Neira Ayuso ---- - ---- a/include/linux/netfilter/nf_tables.h -+++ b/include/linux/netfilter/nf_tables.h -@@ -92,6 +92,9 @@ enum nft_verdicts { - * @NFT_MSG_GETOBJ: get a stateful object (enum nft_obj_attributes) - * @NFT_MSG_DELOBJ: delete a stateful object (enum nft_obj_attributes) - * @NFT_MSG_GETOBJ_RESET: get and reset a stateful object (enum nft_obj_attributes) -+ * @NFT_MSG_NEWFLOWTABLE: add new flow table (enum nft_flowtable_attributes) -+ * @NFT_MSG_GETFLOWTABLE: get flow table (enum nft_flowtable_attributes) -+ * @NFT_MSG_DELFLOWTABLE: delete flow table (enum nft_flowtable_attributes) - */ - enum nf_tables_msg_types { - NFT_MSG_NEWTABLE, -@@ -116,6 +119,9 @@ enum nf_tables_msg_types { - NFT_MSG_GETOBJ, - NFT_MSG_DELOBJ, - NFT_MSG_GETOBJ_RESET, -+ NFT_MSG_NEWFLOWTABLE, -+ NFT_MSG_GETFLOWTABLE, -+ NFT_MSG_DELFLOWTABLE, - NFT_MSG_MAX, - }; - ---- a/include/mnl.h -+++ b/include/mnl.h -@@ -89,6 +89,9 @@ int mnl_nft_obj_batch_add(struct nftnl_o - int mnl_nft_obj_batch_del(struct nftnl_obj *nln, struct nftnl_batch *batch, - unsigned int flags, uint32_t seqnum); - -+struct nftnl_flowtable_list * -+mnl_nft_flowtable_dump(struct netlink_ctx *ctx, int family, const char *table); -+ - struct nftnl_ruleset *mnl_nft_ruleset_dump(struct netlink_ctx *ctx, - uint32_t family); - int mnl_nft_event_listener(struct mnl_socket *nf_sock, unsigned int debug_mask, ---- a/include/netlink.h -+++ b/include/netlink.h -@@ -179,6 +179,10 @@ extern int netlink_add_obj(struct netlin - extern int netlink_delete_obj(struct netlink_ctx *ctx, const struct handle *h, - struct location *loc, uint32_t type); - -+extern int netlink_list_flowtables(struct netlink_ctx *ctx, -+ const struct handle *h, -+ const struct location *loc); -+ - extern void netlink_dump_chain(const struct nftnl_chain *nlc, - struct netlink_ctx *ctx); - extern void netlink_dump_rule(const struct nftnl_rule *nlr, ---- a/include/rule.h -+++ b/include/rule.h -@@ -35,6 +35,7 @@ struct position_spec { - * @chain: chain name (chains and rules only) - * @set: set name (sets only) - * @obj: stateful object name (stateful object only) -+ * @flowtable: flow table name (flow table only) - * @handle: rule handle (rules only) - * @position: rule position (rules only) - * @set_id: set ID (sets only) -@@ -45,6 +46,7 @@ struct handle { - const char *chain; - const char *set; - const char *obj; -+ const char *flowtable; - struct handle_spec handle; - struct position_spec position; - uint32_t set_id; -@@ -98,6 +100,7 @@ enum table_flags { - * @chains: chains contained in the table - * @sets: sets contained in the table - * @objs: stateful objects contained in the table -+ * @flowtables: flow tables contained in the table - * @flags: table flags - * @refcnt: table reference counter - */ -@@ -109,6 +112,7 @@ struct table { - struct list_head chains; - struct list_head sets; - struct list_head objs; -+ struct list_head flowtables; - enum table_flags flags; - unsigned int refcnt; - }; -@@ -315,6 +319,24 @@ void obj_print_plain(const struct obj *o - const char *obj_type_name(uint32_t type); - uint32_t obj_type_to_cmd(uint32_t type); - -+struct flowtable { -+ struct list_head list; -+ struct handle handle; -+ struct location location; -+ unsigned int hooknum; -+ int priority; -+ const char **dev_array; -+ int dev_array_len; -+ unsigned int refcnt; -+}; -+ -+extern struct flowtable *flowtable_alloc(const struct location *loc); -+extern struct flowtable *flowtable_get(struct flowtable *flowtable); -+extern void flowtable_free(struct flowtable *flowtable); -+extern void flowtable_add_hash(struct flowtable *flowtable, struct table *table); -+ -+void flowtable_print(const struct flowtable *n, struct output_ctx *octx); -+ - /** - * enum cmd_ops - command operations - * -@@ -373,6 +395,7 @@ enum cmd_ops { - * @CMD_OBJ_QUOTAS: multiple quotas - * @CMD_OBJ_LIMIT: limit - * @CMD_OBJ_LIMITS: multiple limits -+ * @CMD_OBJ_FLOWTABLES: flow tables - */ - enum cmd_obj { - CMD_OBJ_INVALID, -@@ -399,6 +422,7 @@ enum cmd_obj { - CMD_OBJ_CT_HELPERS, - CMD_OBJ_LIMIT, - CMD_OBJ_LIMITS, -+ CMD_OBJ_FLOWTABLES, - }; - - struct markup { ---- a/src/evaluate.c -+++ b/src/evaluate.c -@@ -3196,6 +3196,7 @@ static int cmd_evaluate_list(struct eval - case CMD_OBJ_CT_HELPERS: - case CMD_OBJ_LIMITS: - case CMD_OBJ_SETS: -+ case CMD_OBJ_FLOWTABLES: - if (cmd->handle.table == NULL) - return 0; - if (table_lookup(&cmd->handle, ctx->cache) == NULL) ---- a/src/mnl.c -+++ b/src/mnl.c -@@ -17,6 +17,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -953,6 +954,63 @@ int mnl_nft_setelem_get(struct netlink_c - return nft_mnl_talk(ctx, nlh, nlh->nlmsg_len, set_elem_cb, nls); - } - -+static int flowtable_cb(const struct nlmsghdr *nlh, void *data) -+{ -+ struct nftnl_flowtable_list *nln_list = data; -+ struct nftnl_flowtable *n; -+ -+ if (check_genid(nlh) < 0) -+ return MNL_CB_ERROR; -+ -+ n = nftnl_flowtable_alloc(); -+ if (n == NULL) -+ memory_allocation_error(); -+ -+ if (nftnl_flowtable_nlmsg_parse(nlh, n) < 0) -+ goto err_free; -+ -+ nftnl_flowtable_list_add_tail(n, nln_list); -+ return MNL_CB_OK; -+ -+err_free: -+ nftnl_flowtable_free(n); -+ return MNL_CB_OK; -+} -+ -+struct nftnl_flowtable_list * -+mnl_nft_flowtable_dump(struct netlink_ctx *ctx, int family, const char *table) -+{ -+ struct nftnl_flowtable_list *nln_list; -+ char buf[MNL_SOCKET_BUFFER_SIZE]; -+ struct nftnl_flowtable *n; -+ struct nlmsghdr *nlh; -+ int ret; -+ -+ n = nftnl_flowtable_alloc(); -+ if (n == NULL) -+ memory_allocation_error(); -+ -+ nlh = nftnl_nlmsg_build_hdr(buf, NFT_MSG_GETFLOWTABLE, family, -+ NLM_F_DUMP | NLM_F_ACK, ctx->seqnum); -+ if (table != NULL) -+ nftnl_flowtable_set_str(n, NFTNL_FLOWTABLE_TABLE, table); -+ nftnl_flowtable_nlmsg_build_payload(nlh, n); -+ nftnl_flowtable_free(n); -+ -+ nln_list = nftnl_flowtable_list_alloc(); -+ if (nln_list == NULL) -+ memory_allocation_error(); -+ -+ ret = nft_mnl_talk(ctx, nlh, nlh->nlmsg_len, flowtable_cb, nln_list); -+ if (ret < 0) -+ goto err; -+ -+ return nln_list; -+err: -+ nftnl_flowtable_list_free(nln_list); -+ return NULL; -+} -+ - /* - * ruleset - */ ---- a/src/netlink.c -+++ b/src/netlink.c -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -1826,6 +1827,70 @@ int netlink_reset_objs(struct netlink_ct - return err; - } - -+static struct flowtable * -+netlink_delinearize_flowtable(struct netlink_ctx *ctx, -+ struct nftnl_flowtable *nlo) -+{ -+ struct flowtable *flowtable; -+ const char **dev_array; -+ int len = 0, i; -+ -+ flowtable = flowtable_alloc(&netlink_location); -+ flowtable->handle.family = -+ nftnl_flowtable_get_u32(nlo, NFTNL_FLOWTABLE_FAMILY); -+ flowtable->handle.table = -+ xstrdup(nftnl_flowtable_get_str(nlo, NFTNL_FLOWTABLE_TABLE)); -+ flowtable->handle.flowtable = -+ xstrdup(nftnl_flowtable_get_str(nlo, NFTNL_FLOWTABLE_NAME)); -+ dev_array = nftnl_flowtable_get_array(nlo, NFTNL_FLOWTABLE_DEVICES); -+ while (dev_array[len] != '\0') -+ len++; -+ -+ flowtable->dev_array = calloc(1, len * sizeof(char *)); -+ for (i = 0; i < len; i++) -+ flowtable->dev_array[i] = xstrdup(dev_array[i]); -+ -+ flowtable->dev_array_len = len; -+ -+ flowtable->priority = -+ nftnl_flowtable_get_u32(nlo, NFTNL_FLOWTABLE_PRIO); -+ flowtable->hooknum = -+ nftnl_flowtable_get_u32(nlo, NFTNL_FLOWTABLE_HOOKNUM); -+ -+ return flowtable; -+} -+ -+static int list_flowtable_cb(struct nftnl_flowtable *nls, void *arg) -+{ -+ struct netlink_ctx *ctx = arg; -+ struct flowtable *flowtable; -+ -+ flowtable = netlink_delinearize_flowtable(ctx, nls); -+ if (flowtable == NULL) -+ return -1; -+ list_add_tail(&flowtable->list, &ctx->list); -+ return 0; -+} -+ -+int netlink_list_flowtables(struct netlink_ctx *ctx, const struct handle *h, -+ const struct location *loc) -+{ -+ struct nftnl_flowtable_list *flowtable_cache; -+ int err; -+ -+ flowtable_cache = mnl_nft_flowtable_dump(ctx, h->family, h->table); -+ if (flowtable_cache == NULL) { -+ if (errno == EINTR) -+ return -1; -+ -+ return 0; -+ } -+ -+ err = nftnl_flowtable_list_foreach(flowtable_cache, list_flowtable_cb, ctx); -+ nftnl_flowtable_list_free(flowtable_cache); -+ return err; -+} -+ - int netlink_batch_send(struct netlink_ctx *ctx, struct list_head *err_list) - { - return mnl_batch_talk(ctx, err_list); ---- a/src/parser_bison.y -+++ b/src/parser_bison.y -@@ -248,6 +248,8 @@ int nft_lex(void *, void *, void *); - %token METER "meter" - %token METERS "meters" - -+%token FLOWTABLES "flowtables" -+ - %token NUM "number" - %token STRING "string" - %token QUOTED_STRING "quoted string" -@@ -1104,6 +1106,10 @@ list_cmd : TABLE table_spec - { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_METER, &$2, &@$, NULL); - } -+ | FLOWTABLES ruleset_spec -+ { -+ $$ = cmd_alloc(CMD_LIST, CMD_OBJ_FLOWTABLES, &$2, &@$, NULL); -+ } - | MAPS ruleset_spec - { - $$ = cmd_alloc(CMD_LIST, CMD_OBJ_MAPS, &$2, &@$, NULL); ---- a/src/rule.c -+++ b/src/rule.c -@@ -95,6 +95,11 @@ static int cache_init_objects(struct net - return -1; - list_splice_tail_init(&ctx->list, &table->chains); - -+ ret = netlink_list_flowtables(ctx, &table->handle, &internal_location); -+ if (ret < 0) -+ return -1; -+ list_splice_tail_init(&ctx->list, &table->flowtables); -+ - if (cmd != CMD_RESET) { - ret = netlink_list_objs(ctx, &table->handle, &internal_location); - if (ret < 0) -@@ -722,6 +727,7 @@ struct table *table_alloc(void) - init_list_head(&table->chains); - init_list_head(&table->sets); - init_list_head(&table->objs); -+ init_list_head(&table->flowtables); - init_list_head(&table->scope.symbols); - table->refcnt = 1; - -@@ -797,6 +803,7 @@ static void table_print_options(const st - - static void table_print(const struct table *table, struct output_ctx *octx) - { -+ struct flowtable *flowtable; - struct chain *chain; - struct obj *obj; - struct set *set; -@@ -818,6 +825,11 @@ static void table_print(const struct tab - set_print(set, octx); - delim = "\n"; - } -+ list_for_each_entry(flowtable, &table->flowtables, list) { -+ nft_print(octx, "%s", delim); -+ flowtable_print(flowtable, octx); -+ delim = "\n"; -+ } - list_for_each_entry(chain, &table->chains, list) { - nft_print(octx, "%s", delim); - chain_print(chain, octx); -@@ -1481,6 +1493,114 @@ static int do_list_obj(struct netlink_ct - return 0; - } - -+struct flowtable *flowtable_alloc(const struct location *loc) -+{ -+ struct flowtable *flowtable; -+ -+ flowtable = xzalloc(sizeof(*flowtable)); -+ if (loc != NULL) -+ flowtable->location = *loc; -+ -+ flowtable->refcnt = 1; -+ return flowtable; -+} -+ -+struct flowtable *flowtable_get(struct flowtable *flowtable) -+{ -+ flowtable->refcnt++; -+ return flowtable; -+} -+ -+void flowtable_free(struct flowtable *flowtable) -+{ -+ if (--flowtable->refcnt > 0) -+ return; -+ handle_free(&flowtable->handle); -+ xfree(flowtable); -+} -+ -+void flowtable_add_hash(struct flowtable *flowtable, struct table *table) -+{ -+ list_add_tail(&flowtable->list, &table->flowtables); -+} -+ -+static void flowtable_print_declaration(const struct flowtable *flowtable, -+ struct print_fmt_options *opts, -+ struct output_ctx *octx) -+{ -+ int i; -+ -+ nft_print(octx, "%sflowtable", opts->tab); -+ -+ if (opts->family != NULL) -+ nft_print(octx, " %s", opts->family); -+ -+ if (opts->table != NULL) -+ nft_print(octx, " %s", opts->table); -+ -+ nft_print(octx, " %s {%s", flowtable->handle.flowtable, opts->nl); -+ -+ nft_print(octx, "%s%shook %s priority %d%s", -+ opts->tab, opts->tab, "ingress", -+ flowtable->priority, opts->stmt_separator); -+ -+ nft_print(octx, "%s%sdevices = { ", opts->tab, opts->tab); -+ for (i = 0; i < flowtable->dev_array_len; i++) { -+ nft_print(octx, "%s", flowtable->dev_array[i]); -+ if (i + 1 != flowtable->dev_array_len) -+ nft_print(octx, ", "); -+ } -+ nft_print(octx, " }%s", opts->stmt_separator); -+} -+ -+static void do_flowtable_print(const struct flowtable *flowtable, -+ struct print_fmt_options *opts, -+ struct output_ctx *octx) -+{ -+ flowtable_print_declaration(flowtable, opts, octx); -+ nft_print(octx, "%s}%s", opts->tab, opts->nl); -+} -+ -+void flowtable_print(const struct flowtable *s, struct output_ctx *octx) -+{ -+ struct print_fmt_options opts = { -+ .tab = "\t", -+ .nl = "\n", -+ .stmt_separator = "\n", -+ }; -+ -+ do_flowtable_print(s, &opts, octx); -+} -+ -+static int do_list_flowtables(struct netlink_ctx *ctx, struct cmd *cmd) -+{ -+ struct print_fmt_options opts = { -+ .tab = "\t", -+ .nl = "\n", -+ .stmt_separator = "\n", -+ }; -+ struct flowtable *flowtable; -+ struct table *table; -+ -+ list_for_each_entry(table, &ctx->cache->list, list) { -+ if (cmd->handle.family != NFPROTO_UNSPEC && -+ cmd->handle.family != table->handle.family) -+ continue; -+ -+ nft_print(ctx->octx, "table %s %s {\n", -+ family2str(table->handle.family), -+ table->handle.table); -+ -+ list_for_each_entry(flowtable, &table->flowtables, list) { -+ flowtable_print_declaration(flowtable, &opts, ctx->octx); -+ nft_print(ctx->octx, "%s}%s", opts.tab, opts.nl); -+ } -+ -+ nft_print(ctx->octx, "}\n"); -+ } -+ return 0; -+} -+ - static int do_list_ruleset(struct netlink_ctx *ctx, struct cmd *cmd) - { - unsigned int family = cmd->handle.family; -@@ -1628,6 +1748,8 @@ static int do_command_list(struct netlin - case CMD_OBJ_LIMIT: - case CMD_OBJ_LIMITS: - return do_list_obj(ctx, cmd, NFT_OBJECT_LIMIT); -+ case CMD_OBJ_FLOWTABLES: -+ return do_list_flowtables(ctx, cmd); - default: - BUG("invalid command object type %u\n", cmd->obj); - } ---- a/src/scanner.l -+++ b/src/scanner.l -@@ -297,6 +297,8 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr - "meter" { return METER; } - "meters" { return METERS; } - -+"flowtables" { return FLOWTABLES; } -+ - "counter" { return COUNTER; } - "name" { return NAME; } - "packets" { return PACKETS; } diff --git a/package/network/utils/nftables/patches/201-src-add-support-to-add-flowtables.patch b/package/network/utils/nftables/patches/201-src-add-support-to-add-flowtables.patch deleted file mode 100644 index 888a767160f..00000000000 --- a/package/network/utils/nftables/patches/201-src-add-support-to-add-flowtables.patch +++ /dev/null @@ -1,515 +0,0 @@ -From: Pablo Neira Ayuso -Date: Thu, 18 Jan 2018 08:43:23 +0100 -Subject: [PATCH] src: add support to add flowtables - -This patch allows you to create flowtable: - - # nft add table x - # nft add flowtable x m { hook ingress priority 10\; devices = { eth0, wlan0 }\; } - -You have to specify hook and priority. So far, only the ingress hook is -supported. The priority represents where this flowtable is placed in the -ingress hook, which is registered to the devices that the user -specifies. - -You can also use the 'create' command instead to bail out in case that -there is an existing flowtable with this name. - -Signed-off-by: Pablo Neira Ayuso ---- - ---- a/include/expression.h -+++ b/include/expression.h -@@ -407,6 +407,8 @@ extern struct expr *prefix_expr_alloc(co - extern struct expr *range_expr_alloc(const struct location *loc, - struct expr *low, struct expr *high); - -+extern struct expr *compound_expr_alloc(const struct location *loc, -+ const struct expr_ops *ops); - extern void compound_expr_add(struct expr *compound, struct expr *expr); - extern void compound_expr_remove(struct expr *compound, struct expr *expr); - extern void list_expr_sort(struct list_head *head); ---- a/include/mnl.h -+++ b/include/mnl.h -@@ -92,6 +92,10 @@ int mnl_nft_obj_batch_del(struct nftnl_o - struct nftnl_flowtable_list * - mnl_nft_flowtable_dump(struct netlink_ctx *ctx, int family, const char *table); - -+int mnl_nft_flowtable_batch_add(struct nftnl_flowtable *flo, -+ struct nftnl_batch *batch, unsigned int flags, -+ uint32_t seqnum); -+ - struct nftnl_ruleset *mnl_nft_ruleset_dump(struct netlink_ctx *ctx, - uint32_t family); - int mnl_nft_event_listener(struct mnl_socket *nf_sock, unsigned int debug_mask, ---- a/include/netlink.h -+++ b/include/netlink.h -@@ -7,6 +7,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -182,6 +183,9 @@ extern int netlink_delete_obj(struct net - extern int netlink_list_flowtables(struct netlink_ctx *ctx, - const struct handle *h, - const struct location *loc); -+extern int netlink_add_flowtable(struct netlink_ctx *ctx, -+ const struct handle *h, struct flowtable *ft, -+ uint32_t flags); - - extern void netlink_dump_chain(const struct nftnl_chain *nlc, - struct netlink_ctx *ctx); ---- a/include/rule.h -+++ b/include/rule.h -@@ -322,10 +322,13 @@ uint32_t obj_type_to_cmd(uint32_t type); - struct flowtable { - struct list_head list; - struct handle handle; -+ struct scope scope; - struct location location; -+ const char * hookstr; - unsigned int hooknum; - int priority; - const char **dev_array; -+ struct expr *dev_expr; - int dev_array_len; - unsigned int refcnt; - }; -@@ -383,6 +386,8 @@ enum cmd_ops { - * @CMD_OBJ_CHAIN: chain - * @CMD_OBJ_CHAINS: multiple chains - * @CMD_OBJ_TABLE: table -+ * @CMD_OBJ_FLOWTABLE: flowtable -+ * @CMD_OBJ_FLOWTABLES: flowtables - * @CMD_OBJ_RULESET: ruleset - * @CMD_OBJ_EXPR: expression - * @CMD_OBJ_MONITOR: monitor -@@ -422,6 +427,7 @@ enum cmd_obj { - CMD_OBJ_CT_HELPERS, - CMD_OBJ_LIMIT, - CMD_OBJ_LIMITS, -+ CMD_OBJ_FLOWTABLE, - CMD_OBJ_FLOWTABLES, - }; - -@@ -481,6 +487,7 @@ struct cmd { - struct rule *rule; - struct chain *chain; - struct table *table; -+ struct flowtable *flowtable; - struct monitor *monitor; - struct markup *markup; - struct obj *object; ---- a/src/evaluate.c -+++ b/src/evaluate.c -@@ -2897,6 +2897,24 @@ static int set_evaluate(struct eval_ctx - return 0; - } - -+static uint32_t str2hooknum(uint32_t family, const char *hook); -+ -+static int flowtable_evaluate(struct eval_ctx *ctx, struct flowtable *ft) -+{ -+ struct table *table; -+ -+ table = table_lookup_global(ctx); -+ if (table == NULL) -+ return cmd_error(ctx, "Could not process rule: Table '%s' does not exist", -+ ctx->cmd->handle.table); -+ -+ ft->hooknum = str2hooknum(NFPROTO_NETDEV, ft->hookstr); -+ if (ft->hooknum == NF_INET_NUMHOOKS) -+ return chain_error(ctx, ft, "invalid hook %s", ft->hookstr); -+ -+ return 0; -+} -+ - static int rule_evaluate(struct eval_ctx *ctx, struct rule *rule) - { - struct stmt *stmt, *tstmt = NULL; -@@ -3069,6 +3087,14 @@ static int cmd_evaluate_add(struct eval_ - return chain_evaluate(ctx, cmd->chain); - case CMD_OBJ_TABLE: - return table_evaluate(ctx, cmd->table); -+ case CMD_OBJ_FLOWTABLE: -+ ret = cache_update(ctx->nf_sock, ctx->cache, cmd->op, -+ ctx->msgs, ctx->debug_mask & NFT_DEBUG_NETLINK, ctx->octx); -+ if (ret < 0) -+ return ret; -+ -+ handle_merge(&cmd->flowtable->handle, &cmd->handle); -+ return flowtable_evaluate(ctx, cmd->flowtable); - case CMD_OBJ_COUNTER: - case CMD_OBJ_QUOTA: - case CMD_OBJ_CT_HELPER: ---- a/src/expression.c -+++ b/src/expression.c -@@ -663,8 +663,8 @@ struct expr *range_expr_alloc(const stru - return expr; - } - --static struct expr *compound_expr_alloc(const struct location *loc, -- const struct expr_ops *ops) -+struct expr *compound_expr_alloc(const struct location *loc, -+ const struct expr_ops *ops) - { - struct expr *expr; - ---- a/src/mnl.c -+++ b/src/mnl.c -@@ -1011,6 +1011,22 @@ err: - return NULL; - } - -+int mnl_nft_flowtable_batch_add(struct nftnl_flowtable *flo, -+ struct nftnl_batch *batch, unsigned int flags, -+ uint32_t seqnum) -+{ -+ struct nlmsghdr *nlh; -+ -+ nlh = nftnl_nlmsg_build_hdr(nftnl_batch_buffer(batch), -+ NFT_MSG_NEWFLOWTABLE, -+ nftnl_flowtable_get_u32(flo, NFTNL_FLOWTABLE_FAMILY), -+ NLM_F_CREATE | flags, seqnum); -+ nftnl_flowtable_nlmsg_build_payload(nlh, flo); -+ mnl_nft_batch_continue(batch); -+ -+ return 0; -+} -+ - /* - * ruleset - */ ---- a/src/netlink.c -+++ b/src/netlink.c -@@ -1773,6 +1773,64 @@ static struct obj *netlink_delinearize_o - return obj; - } - -+static struct nftnl_flowtable *alloc_nftnl_flowtable(const struct handle *h, -+ const struct flowtable *ft) -+{ -+ struct nftnl_flowtable *flo; -+ -+ flo = nftnl_flowtable_alloc(); -+ if (flo == NULL) -+ memory_allocation_error(); -+ -+ nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_FAMILY, h->family); -+ nftnl_flowtable_set_str(flo, NFTNL_FLOWTABLE_TABLE, h->table); -+ if (h->flowtable != NULL) -+ nftnl_flowtable_set_str(flo, NFTNL_FLOWTABLE_NAME, h->flowtable); -+ -+ return flo; -+} -+ -+static void netlink_dump_flowtable(struct nftnl_flowtable *flo, -+ struct netlink_ctx *ctx) -+{ -+ FILE *fp = ctx->octx->output_fp; -+ -+ if (!(ctx->debug_mask & NFT_DEBUG_NETLINK) || !fp) -+ return; -+ -+ nftnl_flowtable_fprintf(fp, flo, 0, 0); -+ fprintf(fp, "\n"); -+} -+ -+int netlink_add_flowtable(struct netlink_ctx *ctx, const struct handle *h, -+ struct flowtable *ft, uint32_t flags) -+{ -+ struct nftnl_flowtable *flo; -+ const char *dev_array[8]; -+ struct expr *expr; -+ int i = 0, err; -+ -+ flo = alloc_nftnl_flowtable(h, ft); -+ nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_HOOKNUM, ft->hooknum); -+ nftnl_flowtable_set_u32(flo, NFTNL_FLOWTABLE_PRIO, ft->priority); -+ -+ list_for_each_entry(expr, &ft->dev_expr->expressions, list) -+ dev_array[i++] = expr->identifier; -+ -+ dev_array[i] = NULL; -+ nftnl_flowtable_set_array(flo, NFTNL_FLOWTABLE_DEVICES, dev_array); -+ -+ netlink_dump_flowtable(flo, ctx); -+ -+ err = mnl_nft_flowtable_batch_add(flo, ctx->batch, flags, ctx->seqnum); -+ if (err < 0) -+ netlink_io_error(ctx, &ft->location, "Could not add flowtable: %s", -+ strerror(errno)); -+ nftnl_flowtable_free(flo); -+ -+ return err; -+} -+ - static int list_obj_cb(struct nftnl_obj *nls, void *arg) - { - struct netlink_ctx *ctx = arg; ---- a/src/parser_bison.y -+++ b/src/parser_bison.y -@@ -145,6 +145,7 @@ int nft_lex(void *, void *, void *); - struct expr *expr; - struct set *set; - struct obj *obj; -+ struct flowtable *flowtable; - struct counter *counter; - struct quota *quota; - struct ct *ct; -@@ -189,6 +190,7 @@ int nft_lex(void *, void *, void *); - - %token HOOK "hook" - %token DEVICE "device" -+%token DEVICES "devices" - %token TABLE "table" - %token TABLES "tables" - %token CHAIN "chain" -@@ -200,6 +202,7 @@ int nft_lex(void *, void *, void *); - %token ELEMENT "element" - %token MAP "map" - %token MAPS "maps" -+%token FLOWTABLE "flowtable" - %token HANDLE "handle" - %token RULESET "ruleset" - %token TRACE "trace" -@@ -500,9 +503,9 @@ int nft_lex(void *, void *, void *); - %type base_cmd add_cmd replace_cmd create_cmd insert_cmd delete_cmd list_cmd reset_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd import_cmd - %destructor { cmd_free($$); } base_cmd add_cmd replace_cmd create_cmd insert_cmd delete_cmd list_cmd reset_cmd flush_cmd rename_cmd export_cmd monitor_cmd describe_cmd import_cmd - --%type table_spec chain_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec --%destructor { handle_free(&$$); } table_spec chain_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec --%type set_spec set_identifier obj_spec obj_identifier -+%type table_spec chain_spec flowtable_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec -+%destructor { handle_free(&$$); } table_spec chain_spec flowtable_spec chain_identifier ruleid_spec handle_spec position_spec rule_position ruleset_spec -+%type set_spec set_identifier flowtable_identifier obj_spec obj_identifier - %destructor { handle_free(&$$); } set_spec set_identifier obj_spec obj_identifier - %type family_spec family_spec_explicit chain_policy prio_spec - -@@ -526,6 +529,9 @@ int nft_lex(void *, void *, void *); - %type map_block_alloc map_block - %destructor { set_free($$); } map_block_alloc - -+%type flowtable_block_alloc flowtable_block -+%destructor { flowtable_free($$); } flowtable_block_alloc -+ - %type obj_block_alloc counter_block quota_block ct_helper_block limit_block - %destructor { obj_free($$); } obj_block_alloc - -@@ -606,8 +612,8 @@ int nft_lex(void *, void *, void *); - %type verdict_map_expr verdict_map_list_expr verdict_map_list_member_expr - %destructor { expr_free($$); } verdict_map_expr verdict_map_list_expr verdict_map_list_member_expr - --%type set_expr set_block_expr set_list_expr set_list_member_expr --%destructor { expr_free($$); } set_expr set_block_expr set_list_expr set_list_member_expr -+%type set_expr set_block_expr set_list_expr set_list_member_expr flowtable_expr flowtable_list_expr flowtable_expr_member -+%destructor { expr_free($$); } set_expr set_block_expr set_list_expr set_list_member_expr flowtable_expr flowtable_list_expr flowtable_expr_member - %type set_elem_expr set_elem_expr_alloc set_lhs_expr set_rhs_expr - %destructor { expr_free($$); } set_elem_expr set_elem_expr_alloc set_lhs_expr set_rhs_expr - %type set_elem_expr_stmt set_elem_expr_stmt_alloc -@@ -872,6 +878,13 @@ add_cmd : TABLE table_spec - { - $$ = cmd_alloc(CMD_ADD, CMD_OBJ_SETELEM, &$2, &@$, $3); - } -+ | FLOWTABLE flowtable_spec flowtable_block_alloc -+ '{' flowtable_block '}' -+ { -+ $5->location = @5; -+ handle_merge(&$3->handle, &$2); -+ $$ = cmd_alloc(CMD_ADD, CMD_OBJ_FLOWTABLE, &$2, &@$, $5); -+ } - | COUNTER obj_spec - { - struct obj *obj; -@@ -947,6 +960,13 @@ create_cmd : TABLE table_spec - { - $$ = cmd_alloc(CMD_CREATE, CMD_OBJ_SETELEM, &$2, &@$, $3); - } -+ | FLOWTABLE flowtable_spec flowtable_block_alloc -+ '{' flowtable_block '}' -+ { -+ $5->location = @5; -+ handle_merge(&$3->handle, &$2); -+ $$ = cmd_alloc(CMD_CREATE, CMD_OBJ_FLOWTABLE, &$2, &@$, $5); -+ } - | COUNTER obj_spec - { - struct obj *obj; -@@ -1317,6 +1337,17 @@ table_block : /* empty */ { $$ = $list, &$1->sets); - $$ = $1; - } -+ -+ | table_block FLOWTABLE flowtable_identifier -+ flowtable_block_alloc '{' flowtable_block '}' -+ stmt_separator -+ { -+ $4->location = @3; -+ handle_merge(&$4->handle, &$3); -+ handle_free(&$3); -+ list_add_tail(&$4->list, &$1->flowtables); -+ $$ = $1; -+ } - | table_block COUNTER obj_identifier - obj_block_alloc '{' counter_block '}' - stmt_separator -@@ -1512,6 +1543,62 @@ set_policy_spec : PERFORMANCE { $$ = NF - | MEMORY { $$ = NFT_SET_POL_MEMORY; } - ; - -+flowtable_block_alloc : /* empty */ -+ { -+ $$ = flowtable_alloc(NULL); -+ } -+ ; -+ -+flowtable_block : /* empty */ { $$ = $-1; } -+ | flowtable_block common_block -+ | flowtable_block stmt_separator -+ | flowtable_block HOOK STRING PRIORITY prio_spec stmt_separator -+ { -+ $$->hookstr = chain_hookname_lookup($3); -+ if ($$->hookstr == NULL) { -+ erec_queue(error(&@3, "unknown chain hook %s", $3), -+ state->msgs); -+ xfree($3); -+ YYERROR; -+ } -+ xfree($3); -+ -+ $$->priority = $5; -+ } -+ | flowtable_block DEVICES '=' flowtable_expr stmt_separator -+ { -+ $$->dev_expr = $4; -+ } -+ ; -+ -+flowtable_expr : '{' flowtable_list_expr '}' -+ { -+ $2->location = @$; -+ $$ = $2; -+ } -+ ; -+ -+flowtable_list_expr : flowtable_expr_member -+ { -+ $$ = compound_expr_alloc(&@$, NULL); -+ compound_expr_add($$, $1); -+ } -+ | flowtable_list_expr COMMA flowtable_expr_member -+ { -+ compound_expr_add($1, $3); -+ $$ = $1; -+ } -+ | flowtable_list_expr COMMA opt_newline -+ ; -+ -+flowtable_expr_member : STRING -+ { -+ $$ = symbol_expr_alloc(&@$, SYMBOL_VALUE, -+ current_scope(state), -+ $1); -+ } -+ ; -+ - data_type_atom_expr : type_identifier - { - const struct datatype *dtype = datatype_lookup_byname($1); -@@ -1720,6 +1807,21 @@ set_identifier : identifier - } - ; - -+ -+flowtable_spec : table_spec identifier -+ { -+ $$ = $1; -+ $$.flowtable = $2; -+ } -+ ; -+ -+flowtable_identifier : identifier -+ { -+ memset(&$$, 0, sizeof($$)); -+ $$.flowtable = $1; -+ } -+ ; -+ - obj_spec : table_spec identifier - { - $$ = $1; ---- a/src/rule.c -+++ b/src/rule.c -@@ -45,6 +45,8 @@ void handle_merge(struct handle *dst, co - dst->chain = xstrdup(src->chain); - if (dst->set == NULL && src->set != NULL) - dst->set = xstrdup(src->set); -+ if (dst->flowtable == NULL && src->flowtable != NULL) -+ dst->flowtable = xstrdup(src->flowtable); - if (dst->obj == NULL && src->obj != NULL) - dst->obj = xstrdup(src->obj); - if (dst->handle.id == 0) -@@ -857,6 +859,7 @@ struct cmd *cmd_alloc(enum cmd_ops op, e - void nft_cmd_expand(struct cmd *cmd) - { - struct list_head new_cmds; -+ struct flowtable *ft; - struct table *table; - struct chain *chain; - struct rule *rule; -@@ -896,6 +899,14 @@ void nft_cmd_expand(struct cmd *cmd) - &set->location, set_get(set)); - list_add_tail(&new->list, &new_cmds); - } -+ list_for_each_entry(ft, &table->flowtables, list) { -+ handle_merge(&ft->handle, &table->handle); -+ memset(&h, 0, sizeof(h)); -+ handle_merge(&h, &ft->handle); -+ new = cmd_alloc(CMD_ADD, CMD_OBJ_FLOWTABLE, &h, -+ &ft->location, flowtable_get(ft)); -+ list_add_tail(&new->list, &new_cmds); -+ } - list_for_each_entry(chain, &table->chains, list) { - list_for_each_entry(rule, &chain->rules, list) { - memset(&h, 0, sizeof(h)); -@@ -982,6 +993,9 @@ void cmd_free(struct cmd *cmd) - case CMD_OBJ_LIMIT: - obj_free(cmd->object); - break; -+ case CMD_OBJ_FLOWTABLE: -+ flowtable_free(cmd->flowtable); -+ break; - default: - BUG("invalid command object type %u\n", cmd->obj); - } -@@ -1071,6 +1085,9 @@ static int do_command_add(struct netlink - case CMD_OBJ_CT_HELPER: - case CMD_OBJ_LIMIT: - return netlink_add_obj(ctx, &cmd->handle, cmd->object, flags); -+ case CMD_OBJ_FLOWTABLE: -+ return netlink_add_flowtable(ctx, &cmd->handle, cmd->flowtable, -+ flags); - default: - BUG("invalid command object type %u\n", cmd->obj); - } ---- a/src/scanner.l -+++ b/src/scanner.l -@@ -238,6 +238,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr - - "hook" { return HOOK; } - "device" { return DEVICE; } -+"devices" { return DEVICES; } - "table" { return TABLE; } - "tables" { return TABLES; } - "chain" { return CHAIN; } -@@ -249,6 +250,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr - "element" { return ELEMENT; } - "map" { return MAP; } - "maps" { return MAPS; } -+"flowtable" { return FLOWTABLE; } - "handle" { return HANDLE; } - "ruleset" { return RULESET; } - "trace" { return TRACE; } diff --git a/package/network/utils/nftables/patches/202-src-delete-flowtable.patch b/package/network/utils/nftables/patches/202-src-delete-flowtable.patch deleted file mode 100644 index 32b7f96bc57..00000000000 --- a/package/network/utils/nftables/patches/202-src-delete-flowtable.patch +++ /dev/null @@ -1,122 +0,0 @@ -From: Pablo Neira Ayuso -Date: Fri, 19 Jan 2018 01:41:38 +0100 -Subject: [PATCH] src: delete flowtable - -This patch allows you to delete an existing flowtable: - - # nft delete flowtable x m - -Signed-off-by: Pablo Neira Ayuso ---- - ---- a/include/mnl.h -+++ b/include/mnl.h -@@ -95,6 +95,9 @@ mnl_nft_flowtable_dump(struct netlink_ct - int mnl_nft_flowtable_batch_add(struct nftnl_flowtable *flo, - struct nftnl_batch *batch, unsigned int flags, - uint32_t seqnum); -+int mnl_nft_flowtable_batch_del(struct nftnl_flowtable *flow, -+ struct nftnl_batch *batch, unsigned int flags, -+ uint32_t seqnum); - - struct nftnl_ruleset *mnl_nft_ruleset_dump(struct netlink_ctx *ctx, - uint32_t family); ---- a/include/netlink.h -+++ b/include/netlink.h -@@ -186,6 +186,9 @@ extern int netlink_list_flowtables(struc - extern int netlink_add_flowtable(struct netlink_ctx *ctx, - const struct handle *h, struct flowtable *ft, - uint32_t flags); -+extern int netlink_delete_flowtable(struct netlink_ctx *ctx, -+ const struct handle *h, -+ struct location *loc); - - extern void netlink_dump_chain(const struct nftnl_chain *nlc, - struct netlink_ctx *ctx); ---- a/src/evaluate.c -+++ b/src/evaluate.c -@@ -3121,6 +3121,7 @@ static int cmd_evaluate_delete(struct ev - case CMD_OBJ_RULE: - case CMD_OBJ_CHAIN: - case CMD_OBJ_TABLE: -+ case CMD_OBJ_FLOWTABLE: - case CMD_OBJ_COUNTER: - case CMD_OBJ_QUOTA: - case CMD_OBJ_CT_HELPER: ---- a/src/mnl.c -+++ b/src/mnl.c -@@ -1027,6 +1027,22 @@ int mnl_nft_flowtable_batch_add(struct n - return 0; - } - -+int mnl_nft_flowtable_batch_del(struct nftnl_flowtable *flo, -+ struct nftnl_batch *batch, unsigned int flags, -+ uint32_t seqnum) -+{ -+ struct nlmsghdr *nlh; -+ -+ nlh = nftnl_nlmsg_build_hdr(nftnl_batch_buffer(batch), -+ NFT_MSG_DELFLOWTABLE, -+ nftnl_flowtable_get_u32(flo, NFTNL_FLOWTABLE_FAMILY), -+ flags, seqnum); -+ nftnl_flowtable_nlmsg_build_payload(nlh, flo); -+ mnl_nft_batch_continue(batch); -+ -+ return 0; -+} -+ - /* - * ruleset - */ ---- a/src/netlink.c -+++ b/src/netlink.c -@@ -1831,6 +1831,24 @@ int netlink_add_flowtable(struct netlink - return err; - } - -+int netlink_delete_flowtable(struct netlink_ctx *ctx, const struct handle *h, -+ struct location *loc) -+{ -+ struct nftnl_flowtable *flo; -+ int err; -+ -+ flo = alloc_nftnl_flowtable(h, NULL); -+ netlink_dump_flowtable(flo, ctx); -+ -+ err = mnl_nft_flowtable_batch_del(flo, ctx->batch, 0, ctx->seqnum); -+ if (err < 0) -+ netlink_io_error(ctx, loc, "Could not delete flowtable: %s", -+ strerror(errno)); -+ nftnl_flowtable_free(flo); -+ -+ return err; -+} -+ - static int list_obj_cb(struct nftnl_obj *nls, void *arg) - { - struct netlink_ctx *ctx = arg; ---- a/src/parser_bison.y -+++ b/src/parser_bison.y -@@ -1024,6 +1024,10 @@ delete_cmd : TABLE table_spec - { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_SETELEM, &$2, &@$, $3); - } -+ | FLOWTABLE flowtable_spec -+ { -+ $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_FLOWTABLE, &$2, &@$, NULL); -+ } - | COUNTER obj_spec - { - $$ = cmd_alloc(CMD_DELETE, CMD_OBJ_COUNTER, &$2, &@$, NULL); ---- a/src/rule.c -+++ b/src/rule.c -@@ -1177,6 +1177,9 @@ static int do_command_delete(struct netl - case CMD_OBJ_LIMIT: - return netlink_delete_obj(ctx, &cmd->handle, &cmd->location, - NFT_OBJECT_LIMIT); -+ case CMD_OBJ_FLOWTABLE: -+ return netlink_delete_flowtable(ctx, &cmd->handle, -+ &cmd->location); - default: - BUG("invalid command object type %u\n", cmd->obj); - } diff --git a/package/network/utils/nftables/patches/203-src-flow-offload-support.patch b/package/network/utils/nftables/patches/203-src-flow-offload-support.patch deleted file mode 100644 index 86dfb1d94aa..00000000000 --- a/package/network/utils/nftables/patches/203-src-flow-offload-support.patch +++ /dev/null @@ -1,191 +0,0 @@ -From: Pablo Neira Ayuso -Date: Sun, 3 Dec 2017 21:27:03 +0100 -Subject: [PATCH] src: flow offload support - -This patch allows us to refer to existing flowtables: - - # nft add rule x x flow offload @m - -Packets matching this rule create an entry in the flow table 'm', hence, -follow up packets that get to the flowtable at ingress bypass the -classic forwarding path. - -Signed-off-by: Pablo Neira Ayuso ---- - ---- a/include/ct.h -+++ b/include/ct.h -@@ -29,6 +29,8 @@ extern struct expr *ct_expr_alloc(const - extern void ct_expr_update_type(struct proto_ctx *ctx, struct expr *expr); - - extern struct stmt *notrack_stmt_alloc(const struct location *loc); -+extern struct stmt *flow_offload_stmt_alloc(const struct location *loc, -+ const char *table_name); - - extern const struct datatype ct_dir_type; - extern const struct datatype ct_state_type; ---- a/include/statement.h -+++ b/include/statement.h -@@ -10,6 +10,12 @@ extern struct stmt *expr_stmt_alloc(cons - extern struct stmt *verdict_stmt_alloc(const struct location *loc, - struct expr *expr); - -+struct flow_stmt { -+ const char *table_name; -+}; -+ -+struct stmt *flow_stmt_alloc(const struct location *loc, const char *name); -+ - struct objref_stmt { - uint32_t type; - struct expr *expr; -@@ -231,6 +237,7 @@ extern struct stmt *xt_stmt_alloc(const - * @STMT_NOTRACK: notrack statement - * @STMT_OBJREF: stateful object reference statement - * @STMT_EXTHDR: extension header statement -+ * @STMT_FLOW_OFFLOAD: flow offload statement - */ - enum stmt_types { - STMT_INVALID, -@@ -256,6 +263,7 @@ enum stmt_types { - STMT_NOTRACK, - STMT_OBJREF, - STMT_EXTHDR, -+ STMT_FLOW_OFFLOAD, - }; - - /** -@@ -316,6 +324,7 @@ struct stmt { - struct fwd_stmt fwd; - struct xt_stmt xt; - struct objref_stmt objref; -+ struct flow_stmt flow; - }; - }; - ---- a/src/ct.c -+++ b/src/ct.c -@@ -456,3 +456,26 @@ struct stmt *notrack_stmt_alloc(const st - { - return stmt_alloc(loc, ¬rack_stmt_ops); - } -+ -+static void flow_offload_stmt_print(const struct stmt *stmt, -+ struct output_ctx *octx) -+{ -+ printf("flow offload @%s", stmt->flow.table_name); -+} -+ -+static const struct stmt_ops flow_offload_stmt_ops = { -+ .type = STMT_FLOW_OFFLOAD, -+ .name = "flow_offload", -+ .print = flow_offload_stmt_print, -+}; -+ -+struct stmt *flow_offload_stmt_alloc(const struct location *loc, -+ const char *table_name) -+{ -+ struct stmt *stmt; -+ -+ stmt = stmt_alloc(loc, &flow_offload_stmt_ops); -+ stmt->flow.table_name = table_name; -+ -+ return stmt; -+} ---- a/src/evaluate.c -+++ b/src/evaluate.c -@@ -2773,6 +2773,7 @@ int stmt_evaluate(struct eval_ctx *ctx, - case STMT_LIMIT: - case STMT_QUOTA: - case STMT_NOTRACK: -+ case STMT_FLOW_OFFLOAD: - return 0; - case STMT_EXPRESSION: - return stmt_evaluate_expr(ctx, stmt); ---- a/src/netlink_delinearize.c -+++ b/src/netlink_delinearize.c -@@ -680,6 +680,16 @@ static void netlink_parse_notrack(struct - ctx->stmt = notrack_stmt_alloc(loc); - } - -+static void netlink_parse_flow_offload(struct netlink_parse_ctx *ctx, -+ const struct location *loc, -+ const struct nftnl_expr *nle) -+{ -+ const char *table_name; -+ -+ table_name = xstrdup(nftnl_expr_get_str(nle, NFTNL_EXPR_FLOW_TABLE_NAME)); -+ ctx->stmt = flow_offload_stmt_alloc(loc, table_name); -+} -+ - static void netlink_parse_ct_stmt(struct netlink_parse_ctx *ctx, - const struct location *loc, - const struct nftnl_expr *nle) -@@ -1255,6 +1265,7 @@ static const struct { - { .name = "hash", .parse = netlink_parse_hash }, - { .name = "fib", .parse = netlink_parse_fib }, - { .name = "tcpopt", .parse = netlink_parse_exthdr }, -+ { .name = "flow_offload", .parse = netlink_parse_flow_offload }, - }; - - static int netlink_parse_expr(const struct nftnl_expr *nle, ---- a/src/netlink_linearize.c -+++ b/src/netlink_linearize.c -@@ -1201,6 +1201,17 @@ static void netlink_gen_notrack_stmt(str - nftnl_rule_add_expr(ctx->nlr, nle); - } - -+static void netlink_gen_flow_offload_stmt(struct netlink_linearize_ctx *ctx, -+ const struct stmt *stmt) -+{ -+ struct nftnl_expr *nle; -+ -+ nle = alloc_nft_expr("flow_offload"); -+ nftnl_expr_set_str(nle, NFTNL_EXPR_FLOW_TABLE_NAME, -+ stmt->flow.table_name); -+ nftnl_rule_add_expr(ctx->nlr, nle); -+} -+ - static void netlink_gen_set_stmt(struct netlink_linearize_ctx *ctx, - const struct stmt *stmt) - { -@@ -1300,6 +1311,8 @@ static void netlink_gen_stmt(struct netl - break; - case STMT_NOTRACK: - return netlink_gen_notrack_stmt(ctx, stmt); -+ case STMT_FLOW_OFFLOAD: -+ return netlink_gen_flow_offload_stmt(ctx, stmt); - case STMT_OBJREF: - return netlink_gen_objref_stmt(ctx, stmt); - default: ---- a/src/parser_bison.y -+++ b/src/parser_bison.y -@@ -248,6 +248,7 @@ int nft_lex(void *, void *, void *); - %token SIZE "size" - - %token FLOW "flow" -+%token OFFLOAD "offload" - %token METER "meter" - %token METERS "meters" - -@@ -3384,6 +3385,10 @@ meta_stmt : META meta_key SET stmt_expr - { - $$ = notrack_stmt_alloc(&@$); - } -+ | FLOW OFFLOAD AT string -+ { -+ $$ = flow_offload_stmt_alloc(&@$, $4); -+ } - ; - - offset_opt : /* empty */ { $$ = 0; } ---- a/src/scanner.l -+++ b/src/scanner.l -@@ -296,6 +296,7 @@ addrstring ({macaddr}|{ip4addr}|{ip6addr - "memory" { return MEMORY; } - - "flow" { return FLOW; } -+"offload" { return OFFLOAD; } - "meter" { return METER; } - "meters" { return METERS; } - diff --git a/package/network/utils/nftables/patches/204-tests-shell-add-flowtable-tests.patch b/package/network/utils/nftables/patches/204-tests-shell-add-flowtable-tests.patch deleted file mode 100644 index e6dbf8fbec7..00000000000 --- a/package/network/utils/nftables/patches/204-tests-shell-add-flowtable-tests.patch +++ /dev/null @@ -1,110 +0,0 @@ -From: Pablo Neira Ayuso -Date: Mon, 22 Jan 2018 19:54:36 +0100 -Subject: [PATCH] tests: shell: add flowtable tests - -Add basic flowtable tests. - -Signed-off-by: Pablo Neira Ayuso ---- - create mode 100755 tests/shell/testcases/flowtable/0001flowtable_0 - create mode 100755 tests/shell/testcases/flowtable/0002create_flowtable_0 - create mode 100755 tests/shell/testcases/flowtable/0003add_after_flush_0 - create mode 100755 tests/shell/testcases/flowtable/0004delete_after_add0 - create mode 100755 tests/shell/testcases/flowtable/0005delete_in_use_1 - ---- a/tests/shell/run-tests.sh -+++ b/tests/shell/run-tests.sh -@@ -68,7 +68,9 @@ kernel_cleanup() { - nft_set_hash nft_set_rbtree nft_set_bitmap \ - nft_chain_nat_ipv4 nft_chain_nat_ipv6 \ - nf_tables_inet nf_tables_bridge nf_tables_arp \ -- nf_tables_ipv4 nf_tables_ipv6 nf_tables -+ nf_tables_ipv4 nf_tables_ipv6 nf_tables \ -+ nf_flow_table nf_flow_table_ipv4 nf_flow_tables_ipv6 \ -+ nf_flow_table_inet nft_flow_offload - } - - find_tests() { ---- /dev/null -+++ b/tests/shell/testcases/flowtable/0001flowtable_0 -@@ -0,0 +1,33 @@ -+#!/bin/bash -+ -+tmpfile=$(mktemp) -+if [ ! -w $tmpfile ] ; then -+ echo "Failed to create tmp file" >&2 -+ exit 0 -+fi -+ -+trap "rm -rf $tmpfile" EXIT # cleanup if aborted -+ -+ -+EXPECTED='table inet t { -+ flowtable f { -+ hook ingress priority 10 -+ devices = { eth0, wlan0 } -+ } -+ -+ chain c { -+ flow offload @f -+ } -+}' -+ -+echo "$EXPECTED" > $tmpfile -+set -e -+$NFT -f $tmpfile -+ -+GET="$($NFT list ruleset)" -+ -+if [ "$EXPECTED" != "$GET" ] ; then -+ DIFF="$(which diff)" -+ [ -x $DIFF ] && $DIFF -u <(echo "$EXPECTED") <(echo "$GET") -+ exit 1 -+fi ---- /dev/null -+++ b/tests/shell/testcases/flowtable/0002create_flowtable_0 -@@ -0,0 +1,12 @@ -+#!/bin/bash -+ -+set -e -+$NFT add table t -+$NFT add flowtable t f { hook ingress priority 10 \; devices = { eth0, wlan0 }\; } -+if $NFT create flowtable t f { hook ingress priority 10 \; devices = { eth0, wlan0 }\; } 2>/dev/null ; then -+ echo "E: flowtable creation not failing on existing set" >&2 -+ exit 1 -+fi -+$NFT add flowtable t f { hook ingress priority 10 \; devices = { eth0, wlan0 }\; } -+ -+exit 0 ---- /dev/null -+++ b/tests/shell/testcases/flowtable/0003add_after_flush_0 -@@ -0,0 +1,8 @@ -+#!/bin/bash -+ -+set -e -+$NFT add table x -+$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} -+$NFT flush ruleset -+$NFT add table x -+$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} ---- /dev/null -+++ b/tests/shell/testcases/flowtable/0004delete_after_add0 -@@ -0,0 +1,6 @@ -+#!/bin/bash -+ -+set -e -+$NFT add table x -+$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} -+$NFT delete flowtable x y ---- /dev/null -+++ b/tests/shell/testcases/flowtable/0005delete_in_use_1 -@@ -0,0 +1,9 @@ -+#!/bin/bash -+ -+set -e -+$NFT add table x -+$NFT add chain x x -+$NFT add flowtable x y { hook ingress priority 0\; devices = { eth0, wlan0 }\;} -+$NFT add rule x x flow offload @y -+$NFT delete flowtable x y -+echo "E: delete flowtable in use" diff --git a/package/network/utils/nftables/patches/205-doc-nft-document-flowtable.patch b/package/network/utils/nftables/patches/205-doc-nft-document-flowtable.patch deleted file mode 100644 index dd6faa57405..00000000000 --- a/package/network/utils/nftables/patches/205-doc-nft-document-flowtable.patch +++ /dev/null @@ -1,128 +0,0 @@ -From: Pablo Neira Ayuso -Date: Tue, 23 Jan 2018 12:58:30 +0100 -Subject: [PATCH] doc: nft: document flowtable - -Document the new flowtable objects available since Linux kernel 4.16-rc. - -Signed-off-by: Pablo Neira Ayuso ---- - ---- a/doc/nft.xml -+++ b/doc/nft.xml -@@ -1166,6 +1166,91 @@ filter input iif $int_ifs accept - - - -+ Flowtables -+ -+ -+ -+ add -+ create -+ -+ flowtable -+ family -+ table -+ flowtable -+ -+ hook hook -+ priority priority ; -+ devices = { device[,...] } ; -+ -+ -+ -+ -+ delete -+ list -+ -+ flowtable -+ family -+ table -+ flowtable -+ -+ -+ -+ -+ Flowtables allow you to accelerate packet forwarding in software. -+ Flowtables entries are represented through a tuple that is composed of the -+ input interface, source and destination address, source and destination -+ port; and layer 3/4 protocols. Each entry also caches the destination -+ interface and the gateway address - to update the destination link-layer -+ address - to forward packets. The ttl and hoplimit fields are also -+ decremented. Hence, flowtables provides an alternative path that allow -+ packets to bypass the classic forwarding path. Flowtables reside in the -+ ingress hook, that is located before the prerouting hook. You can select -+ what flows you want to offload through the flow offload -+ expression from the forward chain. Flowtables are -+ identified by their address family and their name. The address family -+ must be one of -+ -+ -+ ip -+ ip6 -+ inet -+ . -+ -+ The inet address family is a dummy family which is used to create -+ hybrid IPv4/IPv6 tables. -+ -+ When no address family is specified, ip is used by default. -+ -+ -+ -+ -+ -+ -+ -+ Add a new flowtable for the given family with the given name. -+ -+ -+ -+ -+ -+ -+ -+ Delete the specified flowtable. -+ -+ -+ -+ -+ -+ -+ -+ List all flowtables. -+ -+ -+ -+ -+ -+ -+ - Stateful objects - - -@@ -4923,6 +5008,24 @@ add rule nat prerouting tcp dport 22 red - - - -+ -+ -+ Flow offload statement -+ -+ A flow offload statement allows us to select what flows -+ you want to accelerate forwarding through layer 3 network -+ stack bypass. You have to specify the flowtable name where -+ you want to offload this flow. -+ -+ -+ -+ flow offload -+ @flowtable -+ -+ -+ -+ -+ - - Queue statement - From 2e7e60f2d6ebbc54dd2131ff10afdd8f8eab43f5 Mon Sep 17 00:00:00 2001 From: Timo Sigurdsson Date: Thu, 17 May 2018 00:33:56 +0200 Subject: [PATCH 118/399] ath10k-firmware: Update QCA988X firmware to the latest version This patch updates the QCA988X firmware to the latest revision firmware-5.bin_10.2.4-1.0-00037 found in the ath10k-firmware and linux-firmware repositories. Tested on TP-Link Archer C7 v2 (ar71xx). Signed-off-by: Timo Sigurdsson (backported from 349fe46103359682692e6b175d22f8c05ff75f74) --- package/firmware/ath10k-firmware/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index 6b81e1a00bb..cc9ab36f405 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-firmware -PKG_SOURCE_DATE:=2018-04-19 -PKG_SOURCE_VERSION:=71e50312b54cc972657a7b08c470088447cb9676 -PKG_MIRROR_HASH:=726e7bce9917532e3b39ced6a17ca2d4c39fdf4c9bec4a3f8f2ea3e5defa6a54 +PKG_SOURCE_DATE:=2018-05-12 +PKG_SOURCE_VERSION:=952afa4949cb34193040cd4e7441e1aee50ac731 +PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git @@ -433,7 +433,7 @@ define Package/ath10k-firmware-qca988x/install $(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/ $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00033 \ + $(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00037 \ $(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin endef From db4341d907a05912787ff36c4e595e7924ad56bb Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 19 May 2018 15:20:46 +0200 Subject: [PATCH 119/399] ath10k-firmware: Fix mirror hash sum This now matches what was generated locally on my PC and the file on the mirror server. Fixes: 349fe46103359 ("ath10k-firmware: Update QCA988X firmware to the latest version") Signed-off-by: Hauke Mehrtens (backported from 56a03e434386ccd1359d5c995a5a3c0fcc44f6af) --- package/firmware/ath10k-firmware/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index cc9ab36f405..eaee0ebc51f 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-firmware PKG_SOURCE_DATE:=2018-05-12 PKG_SOURCE_VERSION:=952afa4949cb34193040cd4e7441e1aee50ac731 -PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275 +PKG_MIRROR_HASH:=dd300f3f28b8f8c07c93065fd9dc1c9785ebda8f15398b4d2d33f9418adcaf46 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git From 903ef9aaecfb91e91c6ffd6626dcb9660a34bbb4 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Sat, 31 Mar 2018 00:12:03 +0200 Subject: [PATCH 120/399] kernel: merge kmod-fbcon with kmod-fb As of commit in kernel: 6104c37094 fbcon: Make fbcon a built-time depency for fbdev framebuffer console is build in into framebuffer module and there's no standalone fbcon module. Therefore drop the kmod-fbcon and enable console in kmod-fb. The only targets which use these modules are imx6 and geode, both are on kernel 4.14 so no fallback for other kernels is introduced. Being at that this commit also fixes autoload of fbdev for x86. Signed-off-by: Tomasz Maciej Nowak (backported from 9c0ddafd4663948fe5c6f3f4a7a7601fdbb36737) --- package/kernel/linux/modules/video.mk | 50 ++++++++------------------- 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index f76618055f9..3f46860f545 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -56,34 +56,13 @@ $(eval $(call KernelPackage,backlight-pwm)) define KernelPackage/fb SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer support + TITLE:=Framebuffer and framebuffer console support DEPENDS:=@DISPLAY_SUPPORT KCONFIG:= \ CONFIG_FB \ CONFIG_FB_MXS=n \ - CONFIG_FB_SM750=n - FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb.ko - AUTOLOAD:=$(call AutoLoad,06,fb) -endef - -define KernelPackage/fb/description - Kernel support for framebuffers -endef - -define KernelPackage/fb/x86 - FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko - AUTOLOAD+=$(call AutoLoad,06,fbdev fb) -endef - -$(eval $(call KernelPackage,fb)) - - -define KernelPackage/fbcon - SUBMENU:=$(VIDEO_MENU) - TITLE:=Framebuffer Console support - DEPENDS:=+kmod-fb @!LINUX_4_14 - KCONFIG:= \ - CONFIG_FRAMEBUFFER_CONSOLE \ + CONFIG_FB_SM750=n \ + CONFIG_FRAMEBUFFER_CONSOLE=y \ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y \ CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y \ CONFIG_FONTS=y \ @@ -102,23 +81,22 @@ define KernelPackage/fbcon CONFIG_CONSOLE_TRANSLATIONS=y \ CONFIG_VT_CONSOLE=y \ CONFIG_VT_HW_CONSOLE_BINDING=y - FILES:= \ - $(LINUX_DIR)/drivers/video/console/bitblit.ko \ - $(LINUX_DIR)/drivers/video/console/softcursor.ko \ - $(LINUX_DIR)/drivers/video/console/fbcon.ko \ - $(LINUX_DIR)/drivers/video/console/fbcon_rotate.ko \ - $(LINUX_DIR)/drivers/video/console/fbcon_cw.ko \ - $(LINUX_DIR)/drivers/video/console/fbcon_ud.ko \ - $(LINUX_DIR)/drivers/video/console/fbcon_ccw.ko \ + FILES:=$(LINUX_DIR)/drivers/video/fbdev/core/fb.ko \ $(LINUX_DIR)/lib/fonts/font.ko - AUTOLOAD:=$(call AutoLoad,94,font softcursor tileblit fbcon_cw fbcon_ud fbcon_ccw fbcon_rotate bitblit fbcon) + AUTOLOAD:=$(call AutoLoad,06,fb font) endef -define KernelPackage/fbcon/description - Kernel support for framebuffer console +define KernelPackage/fb/description + Kernel support for framebuffers and framebuffer console. endef -$(eval $(call KernelPackage,fbcon)) +define KernelPackage/fb/x86 + FILES+=$(LINUX_DIR)/arch/x86/video/fbdev.ko + AUTOLOAD:=$(call AutoLoad,06,fbdev fb font) +endef + +$(eval $(call KernelPackage,fb)) + define KernelPackage/fb-cfb-fillrect SUBMENU:=$(VIDEO_MENU) From fbd8407248216838c700d615bb084190dedf19e0 Mon Sep 17 00:00:00 2001 From: Rodolfo Giometti Date: Wed, 28 Jun 2017 10:49:01 +0200 Subject: [PATCH 121/399] package sysfsutils: add support for sysfs settings at boot This patch is based on sysfsutils package's behaviour on Debian OS. Signed-off-by: Rodolfo Giometti (backported from 2437e0f67050cad79cc1778b18cefd8d3cd86d07) --- package/libs/sysfsutils/Makefile | 12 ++++++ package/libs/sysfsutils/files/local.conf | 1 + package/libs/sysfsutils/files/sysfs.conf | 22 +++++++++++ package/libs/sysfsutils/files/sysfsutils | 48 ++++++++++++++++++++++++ 4 files changed, 83 insertions(+) create mode 100644 package/libs/sysfsutils/files/local.conf create mode 100644 package/libs/sysfsutils/files/sysfs.conf create mode 100644 package/libs/sysfsutils/files/sysfsutils diff --git a/package/libs/sysfsutils/Makefile b/package/libs/sysfsutils/Makefile index 6265442ea88..60275ec3433 100644 --- a/package/libs/sysfsutils/Makefile +++ b/package/libs/sysfsutils/Makefile @@ -65,9 +65,21 @@ define Package/libsysfs/install endef define Package/sysfsutils/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/sysfsutils $(1)/etc/init.d/ + + $(INSTALL_DATA) ./files/sysfs.conf $(1)/etc/ + $(INSTALL_DIR) $(1)/etc/sysfs.d + $(INSTALL_DATA) ./files/local.conf $(1)/etc/sysfs.d/ + $(INSTALL_DIR) $(1)/usr/bin $(CP) $(PKG_INSTALL_DIR)/usr/bin/systool $(1)/usr/bin/ endef +define Package/sysfsutils/conffiles +/etc/sysfs.conf +/etc/sysfs.d/local.conf +endef + $(eval $(call BuildPackage,libsysfs)) $(eval $(call BuildPackage,sysfsutils)) diff --git a/package/libs/sysfsutils/files/local.conf b/package/libs/sysfsutils/files/local.conf new file mode 100644 index 00000000000..891da73df8d --- /dev/null +++ b/package/libs/sysfsutils/files/local.conf @@ -0,0 +1 @@ +# local sysctl settings can be stored in this directory diff --git a/package/libs/sysfsutils/files/sysfs.conf b/package/libs/sysfsutils/files/sysfs.conf new file mode 100644 index 00000000000..f03246284f6 --- /dev/null +++ b/package/libs/sysfsutils/files/sysfs.conf @@ -0,0 +1,22 @@ +# +# /etc/sysfs.conf - Configuration file for setting sysfs attributes. +# +# The sysfs mount directory is automatically prepended to the attribute paths. +# +# Syntax: +# attribute = value +# mode attribute = 0600 # (any valid argument for chmod) +# owner attribute = root:wheel # (any valid argument for chown) +# +# Examples: +# +# Always use the powersave CPU frequency governor +# devices/system/cpu/cpu0/cpufreq/scaling_governor = powersave +# +# Use userspace CPU frequency governor and set initial speed +# devices/system/cpu/cpu0/cpufreq/scaling_governor = userspace +# devices/system/cpu/cpu0/cpufreq/scaling_setspeed = 600000 +# +# Set permissions of suspend control file +# mode power/state = 0660 +# owner power/state = root:power diff --git a/package/libs/sysfsutils/files/sysfsutils b/package/libs/sysfsutils/files/sysfsutils new file mode 100644 index 00000000000..0305ca82a9d --- /dev/null +++ b/package/libs/sysfsutils/files/sysfsutils @@ -0,0 +1,48 @@ +#!/bin/sh /etc/rc.common +# Copyright (C) 2017 Rodolfo Giometti +# +# Based on Debian's script /etc/init.d/sysfsutils by +# Martin Pitt + +load_conffile() { + FILE="$1" + sed 's/#.*$//; /^[[:space:]]*$/d; + s/^[[:space:]]*\([^=[:space:]]*\)[[:space:]]*\([^=[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1 \2 \3/' \ + $FILE | { + while read f1 f2 f3; do + if [ "$f1" = "mode" -a -n "$f2" -a -n "$f3" ]; then + if [ -f "/sys/$f2" ] || [ -d "/sys/$f2" ]; then + chmod "$f3" "/sys/$f2" + else + echo "unknown attribute $f2" + fi + elif [ "$f1" = "owner" -a -n "$f2" -a -n "$f3" ]; then + if [ -f "/sys/$f2" ]; then + chown "$f3" "/sys/$f2" + else + echo "unknown attribute $f2" + fi + elif [ "$f1" -a -n "$f2" -a -z "$f3" ]; then + if [ -f "/sys/$f1" ]; then + # Some fields need a terminating newline, others + # need the terminating newline to be absent :-( + echo -n "$f2" > "/sys/$f1" 2>/dev/null || + echo "$f2" > "/sys/$f1" + else + echo "unknown attribute $f1" + fi + else + echo "syntax error in $CONFFILE: '$f1' '$f2' '$f3'" + exit 1 + fi + done + } +} + +START=11 +start() { + for file in /etc/sysfs.conf /etc/sysfs.d/*.conf; do + [ -r "$file" ] || continue + load_conffile "$file" + done +} From 49487b0ca48952fa43cfcccd78f8279950fe32ac Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 23 May 2018 23:26:41 +0200 Subject: [PATCH 122/399] wolfssl: update to version 3.14.4 Use download from github archive corresponding to v3.14.4 tag because the project's website apparently only offers 3.14.0-stable release downloads. Signed-off-by: Daniel Golle (backported from 4f67c1522d92bc4512c3ecf58c38ff9886530b48) --- package/libs/wolfssl/Makefile | 9 +- .../wolfssl/patches/001-CVE-2017-13099.patch | 144 ------------------ .../patches/100-disable-hardening-check.patch | 2 +- 3 files changed, 6 insertions(+), 149 deletions(-) delete mode 100644 package/libs/wolfssl/patches/001-CVE-2017-13099.patch diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index d0bd3b5a353..41296dd0f2c 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=3.12.2 -PKG_RELEASE:=2 +PKG_VERSION:=3.14.4 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip -PKG_SOURCE_URL:=https://www.wolfssl.com/ -PKG_HASH:=4993844c4b7919007c4511ec3f987fb06543536c3fc933cb53491bffe9150e49 +# PKG_SOURCE_URL:=https://www.wolfssl.com/ +PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) +PKG_HASH:=1da1b45dec4a455716c8547074ad883c737865225f69443bb173c0dc21683fd1 PKG_FIXUP:=libtool PKG_INSTALL:=1 diff --git a/package/libs/wolfssl/patches/001-CVE-2017-13099.patch b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch deleted file mode 100644 index e7b63cb8d4f..00000000000 --- a/package/libs/wolfssl/patches/001-CVE-2017-13099.patch +++ /dev/null @@ -1,144 +0,0 @@ -From fd455d5a5e9fef24c208e7ac7d3a4bc58834cbf1 Mon Sep 17 00:00:00 2001 -From: David Garske -Date: Tue, 14 Nov 2017 14:05:50 -0800 -Subject: [PATCH] Fix for handling of static RSA PKCS formatting failures so - they are indistinguishable from from correctly formatted RSA blocks (per - RFC5246 section 7.4.7.1). Adjusted the static RSA preMasterSecret RNG - creation for consistency in client case. Removed obsolete - `PMS_VERSION_ERROR`. - ---- - src/internal.c | 70 +++++++++++++++++++++++++++++++++++++++++++++-------- - wolfssl/error-ssl.h | 2 +- - 2 files changed, 61 insertions(+), 11 deletions(-) - ---- a/src/internal.c -+++ b/src/internal.c -@@ -14190,9 +14190,6 @@ const char* wolfSSL_ERR_reason_error_str - case NOT_READY_ERROR : - return "handshake layer not ready yet, complete first"; - -- case PMS_VERSION_ERROR : -- return "premaster secret version mismatch error"; -- - case VERSION_ERROR : - return "record layer version error"; - -@@ -18758,8 +18755,10 @@ int SendClientKeyExchange(WOLFSSL* ssl) - #ifndef NO_RSA - case rsa_kea: - { -+ /* build PreMasterSecret with RNG data */ - ret = wc_RNG_GenerateBlock(ssl->rng, -- ssl->arrays->preMasterSecret, SECRET_LEN); -+ &ssl->arrays->preMasterSecret[VERSION_SZ], -+ SECRET_LEN - VERSION_SZ); - if (ret != 0) { - goto exit_scke; - } -@@ -23545,6 +23544,9 @@ static int DoSessionTicket(WOLFSSL* ssl, - word32 idx; - word32 begin; - word32 sigSz; -+ #ifndef NO_RSA -+ int lastErr; -+ #endif - } DckeArgs; - - static void FreeDckeArgs(WOLFSSL* ssl, void* pArgs) -@@ -23770,6 +23772,14 @@ static int DoSessionTicket(WOLFSSL* ssl, - ERROR_OUT(BUFFER_ERROR, exit_dcke); - } - -+ /* pre-load PreMasterSecret with RNG data */ -+ ret = wc_RNG_GenerateBlock(ssl->rng, -+ &ssl->arrays->preMasterSecret[VERSION_SZ], -+ SECRET_LEN - VERSION_SZ); -+ if (ret != 0) { -+ goto exit_dcke; -+ } -+ - args->output = NULL; - break; - } /* rsa_kea */ -@@ -24234,6 +24244,20 @@ static int DoSessionTicket(WOLFSSL* ssl, - NULL, 0, NULL - #endif - ); -+ -+ /* Errors that can occur here that should be -+ * indistinguishable: -+ * RSA_BUFFER_E, RSA_PAD_E and RSA_PRIVATE_ERROR -+ */ -+ if (ret < 0 && ret != BAD_FUNC_ARG) { -+ #ifdef WOLFSSL_ASYNC_CRYPT -+ if (ret == WC_PENDING_E) -+ goto exit_dcke; -+ #endif -+ /* store error code for handling below */ -+ args->lastErr = ret; -+ ret = 0; -+ } - break; - } /* rsa_kea */ - #endif /* !NO_RSA */ -@@ -24380,16 +24404,42 @@ static int DoSessionTicket(WOLFSSL* ssl, - /* Add the signature length to idx */ - args->idx += args->length; - -- if (args->sigSz == SECRET_LEN && args->output != NULL) { -- XMEMCPY(ssl->arrays->preMasterSecret, args->output, SECRET_LEN); -- if (ssl->arrays->preMasterSecret[0] != ssl->chVersion.major || -- ssl->arrays->preMasterSecret[1] != ssl->chVersion.minor) { -- ERROR_OUT(PMS_VERSION_ERROR, exit_dcke); -+ #ifdef DEBUG_WOLFSSL -+ /* check version (debug warning message only) */ -+ if (args->output != NULL) { -+ if (args->output[0] != ssl->chVersion.major || -+ args->output[1] != ssl->chVersion.minor) { -+ WOLFSSL_MSG("preMasterSecret version mismatch"); - } - } -+ #endif -+ -+ /* RFC5246 7.4.7.1: -+ * Treat incorrectly formatted message blocks and/or -+ * mismatched version numbers in a manner -+ * indistinguishable from correctly formatted RSA blocks -+ */ -+ -+ ret = args->lastErr; -+ args->lastErr = 0; /* reset */ -+ -+ /* build PreMasterSecret */ -+ ssl->arrays->preMasterSecret[0] = ssl->chVersion.major; -+ ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor; -+ if (ret == 0 && args->sigSz == SECRET_LEN && -+ args->output != NULL) { -+ XMEMCPY(&ssl->arrays->preMasterSecret[VERSION_SZ], -+ &args->output[VERSION_SZ], -+ SECRET_LEN - VERSION_SZ); -+ } - else { -- ERROR_OUT(RSA_PRIVATE_ERROR, exit_dcke); -+ /* preMasterSecret has RNG and version set */ -+ /* return proper length and ignore error */ -+ /* error will be caught as decryption error */ -+ args->sigSz = SECRET_LEN; -+ ret = 0; - } -+ - break; - } /* rsa_kea */ - #endif /* !NO_RSA */ ---- a/wolfssl/error-ssl.h -+++ b/wolfssl/error-ssl.h -@@ -57,7 +57,7 @@ enum wolfSSL_ErrorCodes { - DOMAIN_NAME_MISMATCH = -322, /* peer subject name mismatch */ - WANT_READ = -323, /* want read, call again */ - NOT_READY_ERROR = -324, /* handshake layer not ready */ -- PMS_VERSION_ERROR = -325, /* pre m secret version error */ -+ - VERSION_ERROR = -326, /* record layer version error */ - WANT_WRITE = -327, /* want write, call again */ - BUFFER_ERROR = -328, /* malformed buffer input */ diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index 83d51b1d5cb..d913b5fdea2 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -1553,7 +1553,7 @@ extern void uITRON4_free(void *p) ; +@@ -1624,7 +1624,7 @@ extern void uITRON4_free(void *p) ; #endif /* warning for not using harden build options (default with ./configure) */ From 22739871fe514d93bba1a40029b3699ef85fe3b7 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 25 May 2018 20:35:46 +0200 Subject: [PATCH 123/399] wolfssl: add PKG_CONFIG_DEPENDS symbols This change will trigger rebuild on buildbots in case of changed config symbols, like in the case of hostapd selecting some wolfssl symbols lately. Signed-off-by: Daniel Golle (backported from 5857088c5eb3a5a2409e3c57dbfa2487e08bbf4a) --- package/libs/wolfssl/Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 41296dd0f2c..8c0b8617ca7 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=3.14.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip # PKG_SOURCE_URL:=https://www.wolfssl.com/ @@ -23,6 +23,15 @@ PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ PKG_CPE_ID:=cpe:/a:yassl:cyassl +PKG_CONFIG_DEPENDS:=\ + CONFIG_WOLFSSL_HAS_AES_CCM CONFIG_WOLFSSL_HAS_AES_GCM \ + CONFIG_WOLFSSL_HAS_ARC4 CONFIG_WOLFSSL_HAS_CHACHA \ + CONFIG_WOLFSSL_HAS_DES3 CONFIG_WOLFSSL_HAS_DH CONFIG_WOLFSSL_HAS_DTLS \ + CONFIG_WOLFSSL_HAS_ECC CONFIG_WOLFSSL_HAS_ECC25519 \ + CONFIG_WOLFSSL_HAS_OCSP CONFIG_WOLFSSL_HAS_POLY_1305 \ + CONFIG_WOLFSSL_HAS_PSK CONFIG_WOLFSSL_HAS_SESSION_TICKET \ + CONFIG_WOLFSSL_HAS_WPAS + include $(INCLUDE_DIR)/package.mk define Package/libwolfssl From 42121995c7e5275978aa88685e83c691349b7e42 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 31 May 2018 00:34:15 +0200 Subject: [PATCH 124/399] wolfssl: change defaults to cover wpa_supplicant needs Implicetely selecting the required options via Kconfig snippet from hostapd worked fine in local builds when using menuconfig but confused the buildbots which (in phase1) may build wpad-mini and hence already come with CONFIG_WPA_WOLFSSL being defined as unset which then won't trigger changing the defaults of wolfssl. Work around by explicitely reflecting wpa_supplicant's needs in wolfssl's default settings to make buildbots happy. Signed-off-by: Daniel Golle (backported from dad39249fb91d6f320256ac12944863f09bb2dc9) --- package/libs/wolfssl/Config.in | 18 +++++++++--------- package/libs/wolfssl/Makefile | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package/libs/wolfssl/Config.in b/package/libs/wolfssl/Config.in index 9b88914516a..50b0bb9cdf1 100644 --- a/package/libs/wolfssl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -2,11 +2,11 @@ if PACKAGE_libwolfssl config WOLFSSL_HAS_AES_CCM bool "Include AES-CCM support" - default n + default y config WOLFSSL_HAS_AES_GCM bool "Include AES-GCM support" - default n + default y config WOLFSSL_HAS_CHACHA bool "Include ChaCha cipher suite support" @@ -18,23 +18,23 @@ config WOLFSSL_HAS_ECC config WOLFSSL_HAS_DH bool "Include DH (Diffie-Hellman) support" - default n + default y config WOLFSSL_HAS_ARC4 bool "Include ARC4 support" - default n + default y config WOLFSSL_HAS_DES3 bool "Include DES3 (Tripple-DES) support" - default n + default y config WOLFSSL_HAS_PSK bool "Include PKS (Pre Share Key) support" - default n + default y config WOLFSSL_HAS_SESSION_TICKET bool "Include session ticket support" - default n + default y config WOLFSSL_HAS_DTLS bool "Include DTLS support" @@ -42,11 +42,11 @@ config WOLFSSL_HAS_DTLS config WOLFSSL_HAS_OCSP bool "Include OSCP support" - default n + default y config WOLFSSL_HAS_WPAS bool "Include wpa_supplicant support" - default n + default y config WOLFSSL_HAS_ECC25519 bool "Include ECC Curve 22519 support" diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 8c0b8617ca7..e08b6f39294 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl PKG_VERSION:=3.14.4 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip # PKG_SOURCE_URL:=https://www.wolfssl.com/ From 5435e8023e956be4f8a21a8741fbe331db05960a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 24 May 2018 18:51:44 +0200 Subject: [PATCH 125/399] ustream-ssl: fix build against wolfSSL commit 39a6ce205d (ustream-ssl: Enable ECDHE with OpenSSL.) broke build against wolfSSL because wolfSSL doesn't (yet) support SSL_CTX_set_ecdh_auto() of the OpenSSL API. Fix this in ustream-ssl: 189cd38b41 don't use SSL_CTX_set_ecdh_auto with wolfSSL Signed-off-by: Daniel Golle (backported from 4f442f5f383837efcfb345033169178f74f63440) --- package/libs/ustream-ssl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index 055a7c969b6..54b69944fb7 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git -PKG_SOURCE_DATE:=2018-05-22 -PKG_SOURCE_VERSION:=5322f9db23b69fdc2b4760a6cfd67848a11818a4 -PKG_MIRROR_HASH:=c943f6e603b1309b33fd276acddffb33a171b6370455b6c21200897012e42d05 +PKG_SOURCE_DATE:=2018-05-24 +PKG_SOURCE_VERSION:=189cd38b4188bfcb4c8cf67d8ae71741ffc2b906 +PKG_MIRROR_HASH:=114d229828d95229e2b7134f668c0d2c3cee63ffa90e970d4c50a331f505b17d CMAKE_INSTALL:=1 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR) From a35f24309021c1c0e9cbed0faedf58b941cb4bd3 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 28 Apr 2018 21:12:19 +0200 Subject: [PATCH 126/399] hostapd: update to git HEAD of 2018-05-21, allow build against wolfssl Support for building wpa_supplicant/hostapd against wolfssl has been added upstream recently, add build option to allow users using it. Signed-off-by: Daniel Golle (backported from 69f544937f8498e856690f9809a016f0d7f5f68b) (rebased patches) Signed-off-by: Jo-Philipp Wich --- package/network/services/hostapd/Config.in | 19 +- package/network/services/hostapd/Makefile | 43 ++-- .../network/services/hostapd/files/hostapd.sh | 3 +- ...icant-Increase-authentication-timeou.patch | 185 ++++++++++++++++++ ...thenticated-encrypted-EAPOL-Key-data.patch | 7 +- ...icant-Rename-wpas_event_-to-wpas_ap_.patch | 132 +++++++++++++ ...-mesh-factor-out-mesh-join-function.patch} | 24 +-- ...-mesh-factor-out-rsn-initialization.patch} | 48 +++-- ...003-mesh-relocate-RSN-init-function.patch} | 10 +- ...mpletion-callback-to-complete-mesh-.patch} | 14 +- ...untry-setting-to-mesh-configuration.patch} | 11 +- ...nel-driver-DFS-handler-in-userspace.patch} | 10 +- ...nnel-attributes-before-running-Mesh.patch} | 10 +- ...e-type-to-mesh-before-setting-inter.patch} | 8 +- ... 009-mesh-set-mesh-center-frequency.patch} | 8 +- ...mesh-interface-on-dfs-event-handler.patch} | 66 ++++--- ...annels-to-be-selected-if-dfs-is-ena.patch} | 16 +- ...mesh-to-send-channel-switch-request.patch} | 8 +- ...do-not-allow-pri-sec-channel-switch.patch} | 8 +- ...t-allow-scan-result-to-swap-pri-sec.patch} | 8 +- ...h-do-not-use-offchan-mgmt-tx-on-DFS.patch} | 21 +- ...6-mesh-make-forwarding-configurable.patch} | 56 +++--- ...20-mesh-properly-handle-sae_password.patch | 52 ----- ...x-crash-with-CONFIG_TAXONOMY-enabled.patch | 2 +- .../030-rsn_supp-fix-stub-pmksa_cache.patch | 21 -- ...CHANWIDTH_USE_HT-to-max_oper_chwidth.patch | 4 +- ...ent-use-of-VHT20-config-in-mesh-mode.patch | 8 +- ...mesh-fix-parsing-of-max_oper_chwidth.patch | 2 +- .../hostapd/patches/200-multicall.patch | 28 +-- .../services/hostapd/patches/300-noscan.patch | 4 +- .../hostapd/patches/301-mesh-noscan.patch | 10 +- .../patches/310-rescan_immediately.patch | 2 +- .../patches/340-reload_freq_change.patch | 6 +- .../patches/350-nl80211_del_beacon_bss.patch | 6 +- .../patches/360-ctrl_iface_reload.patch | 4 +- .../hostapd/patches/370-ap_sta_support.patch | 12 +- .../patches/380-disable_ctrl_iface_mib.patch | 26 +-- ...dd-new-config-params-to-be-used-with.patch | 6 +- .../patches/463-add-mcast_rate-to-11s.patch | 4 +- .../patches/464-fix-mesh-obss-check.patch | 2 +- .../hostapd/patches/600-ubus_support.patch | 38 ++-- 41 files changed, 627 insertions(+), 325 deletions(-) create mode 100644 package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch create mode 100644 package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch rename package/network/services/hostapd/patches/{0101-mesh-factor-out-mesh-join-function.patch => 001-mesh-factor-out-mesh-join-function.patch} (91%) rename package/network/services/hostapd/patches/{0102-mesh-factor-out-rsn-initialization.patch => 002-mesh-factor-out-rsn-initialization.patch} (69%) rename package/network/services/hostapd/patches/{0103-mesh-relocate-RSN-init-function.patch => 003-mesh-relocate-RSN-init-function.patch} (79%) rename package/network/services/hostapd/patches/{0104-mesh-use-setup-completion-callback-to-complete-mesh-.patch => 004-mesh-use-setup-completion-callback-to-complete-mesh-.patch} (84%) rename package/network/services/hostapd/patches/{0105-mesh-reflect-country-setting-to-mesh-configuration.patch => 005-mesh-reflect-country-setting-to-mesh-configuration.patch} (70%) rename package/network/services/hostapd/patches/{0106-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch => 006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch} (80%) rename package/network/services/hostapd/patches/{0107-mesh-apply-channel-attributes-before-running-Mesh.patch => 007-mesh-apply-channel-attributes-before-running-Mesh.patch} (70%) rename package/network/services/hostapd/patches/{0108-mesh-set-interface-type-to-mesh-before-setting-inter.patch => 008-mesh-set-interface-type-to-mesh-before-setting-inter.patch} (79%) rename package/network/services/hostapd/patches/{0109-mesh-set-mesh-center-frequency.patch => 009-mesh-set-mesh-center-frequency.patch} (69%) rename package/network/services/hostapd/patches/{0110-mesh-consider-mesh-interface-on-dfs-event-handler.patch => 010-mesh-consider-mesh-interface-on-dfs-event-handler.patch} (74%) rename package/network/services/hostapd/patches/{0111-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch => 011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch} (80%) rename package/network/services/hostapd/patches/{0112-mesh-allow-mesh-to-send-channel-switch-request.patch => 012-mesh-allow-mesh-to-send-channel-switch-request.patch} (72%) rename package/network/services/hostapd/patches/{0113-mesh-do-not-allow-pri-sec-channel-switch.patch => 013-mesh-do-not-allow-pri-sec-channel-switch.patch} (75%) rename package/network/services/hostapd/patches/{0114-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch => 014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch} (72%) rename package/network/services/hostapd/patches/{0115-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch => 015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch} (61%) rename package/network/services/hostapd/patches/{021-mesh-make-forwarding-configurable.patch => 016-mesh-make-forwarding-configurable.patch} (83%) delete mode 100644 package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch delete mode 100644 package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index fea5ed3ba38..ba0b2359905 100644 --- a/package/network/services/hostapd/Config.in +++ b/package/network/services/hostapd/Config.in @@ -1,7 +1,7 @@ # wpa_supplicant config config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK bool "Disable timestamp check" - depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mesh || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini || PACAKGE_wpad-mesh + depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mesh || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini || PACKAGE_wpad-mesh default n help This disables the timestamp check for certificates in wpa_supplicant @@ -10,15 +10,30 @@ config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK choice prompt "Choose TLS provider" default WPA_SUPPLICANT_INTERNAL - depends on PACKAGE_wpa-supplicant || PACKAGE_wpad + depends on PACKAGE_wpa-supplicant || PACKAGE_wpad || PACKAGE_wpad-mesh config WPA_SUPPLICANT_INTERNAL bool "internal" + depends on PACKAGE_wpa-supplicant || PACKAGE_wpad config WPA_SUPPLICANT_OPENSSL bool "openssl" select PACKAGE_libopenssl +config WPA_SUPPLICANT_WOLFSSL + bool "wolfssl" + select PACKAGE_libwolfssl + select WOLFSSL_HAS_AES_CCM + select WOLFSSL_HAS_AES_GCM + select WOLFSSL_HAS_ARC4 + select WOLFSSL_HAS_DES3 + select WOLFSSL_HAS_DH + select WOLFSSL_HAS_ECC + select WOLFSSL_HAS_OCSP + select WOLFSSL_HAS_PSK + select WOLFSSL_HAS_SESSION_TICKET + select WOLFSSL_HAS_WPAS + endchoice config WPA_RFKILL_SUPPORT diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index ed9bcfc3d91..933ad9a2319 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=5 +PKG_RELEASE:=1 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-04-09 -PKG_SOURCE_VERSION:=fa617ee6a0b2d39e6372c93ef9437caa3bd9065a -PKG_MIRROR_HASH:=5e6f20153c3405ac905f89fea8a614a57e9ba19583b2de2777179381a74aa7b1 +PKG_SOURCE_DATE:=2018-05-21 +PKG_SOURCE_VERSION:=62566bc23d041e88f8e35933d5fd8c2fd0f7cf2a +PKG_MIRROR_HASH:=f234b24f9471ae9cb34460feec6d6614641691544101535673595272c91448eb PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -47,7 +47,13 @@ ifneq ($(LOCAL_TYPE),hostapd) ifeq ($(LOCAL_VARIANT),full) PKG_CONFIG_DEPENDS += \ CONFIG_WPA_SUPPLICANT_INTERNAL \ - CONFIG_WPA_SUPPLICANT_OPENSSL + CONFIG_WPA_SUPPLICANT_OPENSSL \ + CONFIG_WPA_SUPPLICANT_WOLFSSL + endif + ifeq ($(LOCAL_VARIANT),mesh) + PKG_CONFIG_DEPENDS += \ + CONFIG_WPA_SUPPLICANT_OPENSSL \ + CONFIG_WPA_SUPPLICANT_WOLFSSL endif endif @@ -83,10 +89,23 @@ ifneq ($(LOCAL_TYPE),hostapd) TARGET_LDFLAGS += -lcrypto -lssl endif endif + ifdef CONFIG_WPA_SUPPLICANT_WOLFSSL + ifeq ($(LOCAL_VARIANT),full) + DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 + TARGET_LDFLAGS += -lwolfssl + endif + endif + ifeq ($(LOCAL_VARIANT),mesh) - DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y - TARGET_LDFLAGS += -lcrypto -lssl + ifndef CONFIG_WPA_SUPPLICANT_WOLFSSL + DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y + TARGET_LDFLAGS += -lcrypto -lssl + else + DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y + TARGET_LDFLAGS += -lwolfssl + endif endif + ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK endif @@ -157,7 +176,7 @@ endef define Package/wpad $(call Package/wpad/Default) TITLE+= (full) - DEPENDS+=+WPA_SUPPLICANT_OPENSSL:libopenssl + DEPENDS+=+WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl VARIANT:=wpad-full endef @@ -179,7 +198,7 @@ endef define Package/wpad-mesh $(call Package/wpad/Default) TITLE+= (with 802.11s mesh and SAE support) - DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) + DEPENDS:=$(DRV_DEPENDS) +libubus +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_INTERNAL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) VARIANT:=wpad-mesh endef @@ -192,7 +211,7 @@ define Package/wpa-supplicant CATEGORY:=Network TITLE:=WPA Supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl + DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl CONFLICTS:=wpad wpad-mini wpad-mesh VARIANT:=supplicant-full endef @@ -212,7 +231,7 @@ endef define Package/wpa-supplicant-mesh $(Package/wpa-supplicant) TITLE:=WPA Supplicant (with 802.11s and SAE) - DEPENDS:=$(DRV_DEPENDS) +PACKAGE_wpa-supplicant-mesh:libopenssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) + DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_INTERNAL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) CONFLICTS:=wpad wpad-mesh wpad-mesh VARIANT:=supplicant-mesh endef @@ -243,7 +262,7 @@ define Package/eapol-test SECTION:=net CATEGORY:=Network VARIANT:=supplicant-full - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl + DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl endef diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 4deb0b97aee..7ffff4e7e10 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -688,11 +688,12 @@ wpa_supplicant_add_network() { } [[ "$_w_mode" = "mesh" ]] && { - json_get_vars mesh_id mesh_fwding + json_get_vars mesh_id mesh_fwding mesh_rssi_threshold [ -n "$mesh_id" ] && ssid="${mesh_id}" append network_data "mode=5" "$N$T" [ -n "$mesh_fwding" ] && append network_data "mesh_fwding=${mesh_fwding}" "$N$T" + [ -n "$mesh_rssi_threshold" ] && append network_data "mesh_rssi_threshold=${mesh_rssi_threshold}" "$N$T" [ -n "$freq" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" [ "$noscan" = "1" ] && append network_data "noscan=1" "$N$T" append wpa_key_mgmt "SAE" diff --git a/package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch b/package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch new file mode 100644 index 00000000000..8d9cd456d57 --- /dev/null +++ b/package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch @@ -0,0 +1,185 @@ +From 8a6a7112e5b1391018531f6b6c317f8870e0fcb6 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Thu, 3 May 2018 13:12:28 +0200 +Subject: [PATCH 1/2] Revert "wpa_supplicant: Increase authentication timeout + if CAC is started" + +This reverts commit 37547ad63c9df61ce6899675028594da2527efef. +--- + wpa_supplicant/events.c | 95 ++++--------------------------- + wpa_supplicant/wpa_supplicant.c | 20 ------- + wpa_supplicant/wpa_supplicant_i.h | 3 - + 3 files changed, 10 insertions(+), 108 deletions(-) + +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -3776,81 +3776,6 @@ static void wpa_supplicant_event_port_au + } + + +-static unsigned int wpas_event_cac_ms(const struct wpa_supplicant *wpa_s, +- int freq) +-{ +- size_t i; +- int j; +- +- for (i = 0; i < wpa_s->hw.num_modes; i++) { +- const struct hostapd_hw_modes *mode = &wpa_s->hw.modes[i]; +- +- for (j = 0; j < mode->num_channels; j++) { +- const struct hostapd_channel_data *chan; +- +- chan = &mode->channels[j]; +- if (chan->freq == freq) +- return chan->dfs_cac_ms; +- } +- } +- +- return 0; +-} +- +- +-static void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) +-{ +-#if defined(NEED_AP_MLME) && defined(CONFIG_AP) +- if (wpa_s->ap_iface) { +- wpas_ap_event_dfs_cac_started(wpa_s, radar); +- } else +-#endif /* NEED_AP_MLME && CONFIG_AP */ +- { +- unsigned int cac_time = wpas_event_cac_ms(wpa_s, radar->freq); +- +- cac_time /= 1000; /* convert from ms to sec */ +- if (!cac_time) +- cac_time = 10 * 60; /* max timeout: 10 minutes */ +- +- /* Restart auth timeout: CAC time added to initial timeout */ +- wpas_auth_timeout_restart(wpa_s, cac_time); +- } +-} +- +- +-static void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) +-{ +-#if defined(NEED_AP_MLME) && defined(CONFIG_AP) +- if (wpa_s->ap_iface) { +- wpas_ap_event_dfs_cac_finished(wpa_s, radar); +- } else +-#endif /* NEED_AP_MLME && CONFIG_AP */ +- { +- /* Restart auth timeout with original value after CAC is +- * finished */ +- wpas_auth_timeout_restart(wpa_s, 0); +- } +-} +- +- +-static void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) +-{ +-#if defined(NEED_AP_MLME) && defined(CONFIG_AP) +- if (wpa_s->ap_iface) { +- wpas_ap_event_dfs_cac_aborted(wpa_s, radar); +- } else +-#endif /* NEED_AP_MLME && CONFIG_AP */ +- { +- /* Restart auth timeout with original value after CAC is +- * aborted */ +- wpas_auth_timeout_restart(wpa_s, 0); +- } +-} +- +- + static void wpa_supplicant_event_assoc_auth(struct wpa_supplicant *wpa_s, + union wpa_event_data *data) + { +@@ -4298,25 +4223,25 @@ void wpa_supplicant_event(void *ctx, enu + wpas_ap_event_dfs_radar_detected(wpa_s, + &data->dfs_event); + break; +- case EVENT_DFS_NOP_FINISHED: +- if (data) +- wpas_ap_event_dfs_cac_nop_finished(wpa_s, +- &data->dfs_event); +- break; +-#endif /* NEED_AP_MLME */ +-#endif /* CONFIG_AP */ + case EVENT_DFS_CAC_STARTED: + if (data) +- wpas_event_dfs_cac_started(wpa_s, &data->dfs_event); ++ wpas_ap_event_dfs_cac_started(wpa_s, &data->dfs_event); + break; + case EVENT_DFS_CAC_FINISHED: + if (data) +- wpas_event_dfs_cac_finished(wpa_s, &data->dfs_event); ++ wpas_ap_event_dfs_cac_finished(wpa_s, &data->dfs_event); + break; + case EVENT_DFS_CAC_ABORTED: + if (data) +- wpas_event_dfs_cac_aborted(wpa_s, &data->dfs_event); ++ wpas_ap_event_dfs_cac_aborted(wpa_s, &data->dfs_event); ++ break; ++ case EVENT_DFS_NOP_FINISHED: ++ if (data) ++ wpas_ap_event_dfs_cac_nop_finished(wpa_s, ++ &data->dfs_event); + break; ++#endif /* NEED_AP_MLME */ ++#endif /* CONFIG_AP */ + case EVENT_RX_MGMT: { + u16 fc, stype; + const struct ieee80211_mgmt *mgmt; +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -243,30 +243,10 @@ void wpa_supplicant_req_auth_timeout(str + wpa_dbg(wpa_s, MSG_DEBUG, "Setting authentication timeout: %d sec " + "%d usec", sec, usec); + eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL); +- wpa_s->last_auth_timeout_sec = sec; + eloop_register_timeout(sec, usec, wpa_supplicant_timeout, wpa_s, NULL); + } + + +-/* +- * wpas_auth_timeout_restart - Restart and change timeout for authentication +- * @wpa_s: Pointer to wpa_supplicant data +- * @sec_diff: difference in seconds applied to original timeout value +- */ +-void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff) +-{ +- int new_sec = wpa_s->last_auth_timeout_sec + sec_diff; +- +- if (eloop_is_timeout_registered(wpa_supplicant_timeout, wpa_s, NULL)) { +- wpa_dbg(wpa_s, MSG_DEBUG, +- "Authentication timeout restart: %d sec", new_sec); +- eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL); +- eloop_register_timeout(new_sec, 0, wpa_supplicant_timeout, +- wpa_s, NULL); +- } +-} +- +- + /** + * wpa_supplicant_cancel_auth_timeout - Cancel authentication timeout + * @wpa_s: Pointer to wpa_supplicant data +--- a/wpa_supplicant/wpa_supplicant_i.h ++++ b/wpa_supplicant/wpa_supplicant_i.h +@@ -1182,8 +1182,6 @@ struct wpa_supplicant { + /* RIC elements for FT protocol */ + struct wpabuf *ric_ies; + +- int last_auth_timeout_sec; +- + #ifdef CONFIG_DPP + struct dl_list dpp_bootstrap; /* struct dpp_bootstrap_info */ + struct dl_list dpp_configurator; /* struct dpp_configurator */ +@@ -1258,7 +1256,6 @@ void wpa_supplicant_initiate_eapol(struc + void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr); + void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s, + int sec, int usec); +-void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff); + void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s); + void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, + enum wpa_states state); diff --git a/package/network/services/hostapd/patches/0001-WPA-Ignore-unauthenticated-encrypted-EAPOL-Key-data.patch b/package/network/services/hostapd/patches/0001-WPA-Ignore-unauthenticated-encrypted-EAPOL-Key-data.patch index 1b84f7e86a9..633ab586239 100644 --- a/package/network/services/hostapd/patches/0001-WPA-Ignore-unauthenticated-encrypted-EAPOL-Key-data.patch +++ b/package/network/services/hostapd/patches/0001-WPA-Ignore-unauthenticated-encrypted-EAPOL-Key-data.patch @@ -21,11 +21,9 @@ Signed-off-by: Mathy Vanhoef src/rsn_supp/wpa.c | 11 +++++++++++ 1 file changed, 11 insertions(+) -diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c -index 56f3af7..db94a49 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2215,6 +2215,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr, +@@ -2208,6 +2208,17 @@ int wpa_sm_rx_eapol(struct wpa_sm *sm, c if ((sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) && (key_info & WPA_KEY_INFO_ENCR_KEY_DATA) && mic_len) { @@ -43,6 +41,3 @@ index 56f3af7..db94a49 100644 if (wpa_supplicant_decrypt_key_data(sm, key, mic_len, ver, key_data, &key_data_len)) --- -2.7.4 - diff --git a/package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch b/package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch new file mode 100644 index 00000000000..281bb5bba43 --- /dev/null +++ b/package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch @@ -0,0 +1,132 @@ +From 0d4900ccd1c7ec5c5ffecf5040f9c07a6a32deef Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Thu, 3 May 2018 13:12:35 +0200 +Subject: [PATCH 2/2] Revert "wpa_supplicant: Rename wpas_event_*() to + wpas_ap_event_*()" + +This reverts commit 2dd5fbbff884af488870a37e339b4817c83954de. +--- + wpa_supplicant/ap.c | 20 ++++++++++---------- + wpa_supplicant/ap.h | 18 +++++++++--------- + wpa_supplicant/events.c | 13 ++++++------- + 3 files changed, 25 insertions(+), 26 deletions(-) + +--- a/wpa_supplicant/ap.c ++++ b/wpa_supplicant/ap.c +@@ -1537,8 +1537,8 @@ int wpas_ap_pmksa_cache_add_external(str + + + #ifdef NEED_AP_MLME +-void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) ++void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar) + { + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + return; +@@ -1550,8 +1550,8 @@ void wpas_ap_event_dfs_radar_detected(st + } + + +-void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) ++void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar) + { + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + return; +@@ -1562,8 +1562,8 @@ void wpas_ap_event_dfs_cac_started(struc + } + + +-void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) ++void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar) + { + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + return; +@@ -1574,8 +1574,8 @@ void wpas_ap_event_dfs_cac_finished(stru + } + + +-void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) ++void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar) + { + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + return; +@@ -1586,8 +1586,8 @@ void wpas_ap_event_dfs_cac_aborted(struc + } + + +-void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar) ++void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar) + { + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + return; +--- a/wpa_supplicant/ap.h ++++ b/wpa_supplicant/ap.h +@@ -89,16 +89,16 @@ int wpas_ap_pmksa_cache_list_mesh(struct + char *buf, size_t len); + int wpas_ap_pmksa_cache_add_external(struct wpa_supplicant *wpa_s, char *cmd); + +-void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar); +-void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s, ++void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, + struct dfs_event *radar); +-void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar); +-void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar); +-void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, +- struct dfs_event *radar); ++void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar); ++void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar); ++void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar); ++void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, ++ struct dfs_event *radar); + + void ap_periodic(struct wpa_supplicant *wpa_s); + +--- a/wpa_supplicant/events.c ++++ b/wpa_supplicant/events.c +@@ -4220,25 +4220,24 @@ void wpa_supplicant_event(void *ctx, enu + #ifdef NEED_AP_MLME + case EVENT_DFS_RADAR_DETECTED: + if (data) +- wpas_ap_event_dfs_radar_detected(wpa_s, +- &data->dfs_event); ++ wpas_event_dfs_radar_detected(wpa_s, &data->dfs_event); + break; + case EVENT_DFS_CAC_STARTED: + if (data) +- wpas_ap_event_dfs_cac_started(wpa_s, &data->dfs_event); ++ wpas_event_dfs_cac_started(wpa_s, &data->dfs_event); + break; + case EVENT_DFS_CAC_FINISHED: + if (data) +- wpas_ap_event_dfs_cac_finished(wpa_s, &data->dfs_event); ++ wpas_event_dfs_cac_finished(wpa_s, &data->dfs_event); + break; + case EVENT_DFS_CAC_ABORTED: + if (data) +- wpas_ap_event_dfs_cac_aborted(wpa_s, &data->dfs_event); ++ wpas_event_dfs_cac_aborted(wpa_s, &data->dfs_event); + break; + case EVENT_DFS_NOP_FINISHED: + if (data) +- wpas_ap_event_dfs_cac_nop_finished(wpa_s, +- &data->dfs_event); ++ wpas_event_dfs_cac_nop_finished(wpa_s, ++ &data->dfs_event); + break; + #endif /* NEED_AP_MLME */ + #endif /* CONFIG_AP */ diff --git a/package/network/services/hostapd/patches/0101-mesh-factor-out-mesh-join-function.patch b/package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch similarity index 91% rename from package/network/services/hostapd/patches/0101-mesh-factor-out-mesh-join-function.patch rename to package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch index 7671d1e96c8..72c3c75ae96 100644 --- a/package/network/services/hostapd/patches/0101-mesh-factor-out-mesh-join-function.patch +++ b/package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch @@ -1,7 +1,7 @@ -From 91c0f3f6a9ecae3c9106bef8a8606fab0792dd28 Mon Sep 17 00:00:00 2001 +From 032e70833de4b251fc4a159b2cc4ef28d0f1df0d Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:48:58 -0700 -Subject: [PATCH 01/15] mesh: factor out mesh join function +Date: Tue, 17 Apr 2018 21:54:58 -0700 +Subject: [PATCH 01/16] mesh: factor out mesh join function mesh join function consitss of 2 parts which are preparing configurations and sending join event to driver. @@ -12,22 +12,14 @@ into 2 parts to reduce redundant calls. Signed-off-by: Peter Oh --- - wpa_supplicant/mesh.c | 120 ++++++++++++++++-------------- + wpa_supplicant/mesh.c | 119 ++++++++++++++++-------------- wpa_supplicant/mesh.h | 1 + wpa_supplicant/wpa_supplicant_i.h | 1 + - 3 files changed, 68 insertions(+), 54 deletions(-) + 3 files changed, 67 insertions(+), 54 deletions(-) --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -25,6 +25,7 @@ - #include "mesh_mpm.h" - #include "mesh_rsn.h" - #include "mesh.h" -+#include "drivers/driver_nl80211.h" - - - static void wpa_supplicant_mesh_deinit(struct wpa_supplicant *wpa_s) -@@ -359,13 +360,48 @@ void wpa_supplicant_mesh_add_scan_ie(str +@@ -364,13 +364,48 @@ void wpa_supplicant_mesh_add_scan_ie(str } @@ -78,7 +70,7 @@ Signed-off-by: Peter Oh ret = -ENOENT; goto out; } -@@ -376,22 +412,22 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -381,22 +416,22 @@ int wpa_supplicant_join_mesh(struct wpa_ wpa_s->group_cipher = WPA_CIPHER_NONE; wpa_s->mgmt_group_cipher = 0; @@ -112,7 +104,7 @@ Signed-off-by: Peter Oh } else { ssid->max_oper_chwidth = VHT_CHANWIDTH_80MHZ; } -@@ -405,67 +441,43 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -410,67 +445,43 @@ int wpa_supplicant_join_mesh(struct wpa_ } } if (ssid->beacon_int > 0) diff --git a/package/network/services/hostapd/patches/0102-mesh-factor-out-rsn-initialization.patch b/package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch similarity index 69% rename from package/network/services/hostapd/patches/0102-mesh-factor-out-rsn-initialization.patch rename to package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch index 75717a50e06..ad2ab91fe33 100644 --- a/package/network/services/hostapd/patches/0102-mesh-factor-out-rsn-initialization.patch +++ b/package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch @@ -1,7 +1,7 @@ -From 04ebcadc059a6cfd45cd8ec06e6321b69bdb68b8 Mon Sep 17 00:00:00 2001 +From 6da64b1e056e0b1be18b6ab37c820acb4a0f3cf4 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:48:59 -0700 -Subject: [PATCH 02/15] mesh: factor out rsn initialization +Date: Tue, 17 Apr 2018 21:54:59 -0700 +Subject: [PATCH 02/16] mesh: factor out rsn initialization RSN initialization can be used in different phases if mesh initialization and mesh join don't happen @@ -10,16 +10,16 @@ hence factor it out to help convering the case. Signed-off-by: Peter Oh --- - wpa_supplicant/mesh.c | 73 ++++++++++++++++++++++++++----------------- + wpa_supplicant/mesh.c | 84 +++++++++++++++++++++++++------------------ wpa_supplicant/mesh.h | 1 + - 2 files changed, 45 insertions(+), 29 deletions(-) + 2 files changed, 50 insertions(+), 35 deletions(-) --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -147,6 +147,48 @@ static void wpas_mesh_copy_groups(struct - groups_size); +@@ -147,6 +147,53 @@ static void wpas_mesh_copy_groups(struct } + +int wpas_mesh_init_rsn(struct wpa_supplicant *wpa_s) +{ + struct hostapd_iface *ifmsh = wpa_s->ifmsh; @@ -27,10 +27,14 @@ Signed-off-by: Peter Oh + struct wpa_ssid *ssid = wpa_s->current_ssid; + struct hostapd_data *bss = ifmsh->bss[0]; + static int default_groups[] = { 19, 20, 21, 25, 26, -1 }; ++ const char *password; + size_t len; + + if (mconf->security != MESH_CONF_SEC_NONE) { -+ if (ssid->passphrase == NULL) { ++ password = ssid->sae_password; ++ if (!password) ++ password = ssid->passphrase; ++ if (!password) { + wpa_printf(MSG_ERROR, + "mesh: Passphrase for SAE not configured"); + return -1; @@ -50,9 +54,9 @@ Signed-off-by: Peter Oh + return -1; + } + -+ len = os_strlen(ssid->passphrase); ++ len = os_strlen(password); + bss->conf->ssid.wpa_passphrase = -+ dup_binstr(ssid->passphrase, len); ++ dup_binstr(password, len); + + wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf); + if (!wpa_s->mesh_rsn) @@ -62,15 +66,29 @@ Signed-off-by: Peter Oh + return 0; +} + - ++ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, -@@ -291,35 +333,8 @@ static int wpa_supplicant_mesh_init(stru + struct hostapd_freq_params *freq) +@@ -156,9 +203,6 @@ static int wpa_supplicant_mesh_init(stru + struct hostapd_config *conf; + struct mesh_conf *mconf; + int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 }; +- static int default_groups[] = { 19, 20, 21, 25, 26, -1 }; +- const char *password; +- size_t len; + int rate_len; + int frequency; + +@@ -292,38 +336,8 @@ static int wpa_supplicant_mesh_init(stru return -1; } - if (mconf->security != MESH_CONF_SEC_NONE) { -- if (ssid->passphrase == NULL) { +- password = ssid->sae_password; +- if (!password) +- password = ssid->passphrase; +- if (!password) { - wpa_printf(MSG_ERROR, - "mesh: Passphrase for SAE not configured"); - goto out_free; @@ -90,9 +108,9 @@ Signed-off-by: Peter Oh - goto out_free; - } - -- len = os_strlen(ssid->passphrase); +- len = os_strlen(password); - bss->conf->ssid.wpa_passphrase = -- dup_binstr(ssid->passphrase, len); +- dup_binstr(password, len); - - wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf); - if (!wpa_s->mesh_rsn) diff --git a/package/network/services/hostapd/patches/0103-mesh-relocate-RSN-init-function.patch b/package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch similarity index 79% rename from package/network/services/hostapd/patches/0103-mesh-relocate-RSN-init-function.patch rename to package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch index 153e9b2c675..fa0605cfaf9 100644 --- a/package/network/services/hostapd/patches/0103-mesh-relocate-RSN-init-function.patch +++ b/package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch @@ -1,7 +1,7 @@ -From cbe8b9901f9cc254cbaa1ec1cee1c52af8f828bf Mon Sep 17 00:00:00 2001 +From 95425b5becaeda8a515c942f417696e5df34bbc8 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:00 -0700 -Subject: [PATCH 03/15] mesh: relocate RSN init function +Date: Tue, 17 Apr 2018 21:55:00 -0700 +Subject: [PATCH 03/16] mesh: relocate RSN init function RSN init function should work together with mesh join when it's used. Since mesh join could be called at different stage @@ -16,7 +16,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -333,9 +333,6 @@ static int wpa_supplicant_mesh_init(stru +@@ -336,9 +336,6 @@ static int wpa_supplicant_mesh_init(stru return -1; } @@ -26,7 +26,7 @@ Signed-off-by: Peter Oh wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); return 0; -@@ -381,6 +378,12 @@ void wpas_join_mesh(struct wpa_supplican +@@ -384,6 +381,12 @@ void wpas_join_mesh(struct wpa_supplican struct wpa_ssid *ssid = wpa_s->current_ssid; int ret = 0; diff --git a/package/network/services/hostapd/patches/0104-mesh-use-setup-completion-callback-to-complete-mesh-.patch b/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch similarity index 84% rename from package/network/services/hostapd/patches/0104-mesh-use-setup-completion-callback-to-complete-mesh-.patch rename to package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch index 8927d5ca8b4..73ab99e072c 100644 --- a/package/network/services/hostapd/patches/0104-mesh-use-setup-completion-callback-to-complete-mesh-.patch +++ b/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch @@ -1,7 +1,7 @@ -From 8a4ebbb6bbbc1460c1d584d1a710bf1361797ffd Mon Sep 17 00:00:00 2001 +From 32044a7bb26858bedaf147c77f49f5cef1133de3 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:01 -0700 -Subject: [PATCH 04/15] mesh: use setup completion callback to complete mesh +Date: Tue, 17 Apr 2018 21:55:01 -0700 +Subject: [PATCH 04/16] mesh: use setup completion callback to complete mesh join mesh join function is the last function to be called during @@ -24,7 +24,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -215,6 +215,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -217,6 +217,7 @@ static int wpa_supplicant_mesh_init(stru if (!ifmsh) return -ENOMEM; @@ -32,7 +32,7 @@ Signed-off-by: Peter Oh ifmsh->drv_flags = wpa_s->drv_flags; ifmsh->num_bss = 1; ifmsh->bss = os_calloc(wpa_s->ifmsh->num_bss, -@@ -231,6 +232,8 @@ static int wpa_supplicant_mesh_init(stru +@@ -234,6 +235,8 @@ static int wpa_supplicant_mesh_init(stru bss->drv_priv = wpa_s->drv_priv; bss->iface = ifmsh; bss->mesh_sta_free_cb = mesh_mpm_free_sta; @@ -41,7 +41,7 @@ Signed-off-by: Peter Oh frequency = ssid->frequency; if (frequency != freq->freq && frequency == freq->freq + freq->sec_channel_offset * 20) { -@@ -372,8 +375,9 @@ void wpa_supplicant_mesh_add_scan_ie(str +@@ -375,8 +378,9 @@ void wpa_supplicant_mesh_add_scan_ie(str } @@ -52,7 +52,7 @@ Signed-off-by: Peter Oh struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params; struct wpa_ssid *ssid = wpa_s->current_ssid; int ret = 0; -@@ -495,7 +499,6 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -498,7 +502,6 @@ int wpa_supplicant_join_mesh(struct wpa_ goto out; } diff --git a/package/network/services/hostapd/patches/0105-mesh-reflect-country-setting-to-mesh-configuration.patch b/package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch similarity index 70% rename from package/network/services/hostapd/patches/0105-mesh-reflect-country-setting-to-mesh-configuration.patch rename to package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch index ba69478839c..6f7a968259c 100644 --- a/package/network/services/hostapd/patches/0105-mesh-reflect-country-setting-to-mesh-configuration.patch +++ b/package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch @@ -1,7 +1,7 @@ -From e223e851cbe776029a2768b56e7aa1a9f2873d09 Mon Sep 17 00:00:00 2001 +From e2f13b1fac9799db83a37fc57df9471d9bb5b711 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:02 -0700 -Subject: [PATCH 05/15] mesh: reflect country setting to mesh configuration +Date: Tue, 17 Apr 2018 21:55:02 -0700 +Subject: [PATCH 05/16] mesh: reflect country setting to mesh configuration wpa_supplicant configuration has country parameter that is supposed to be used in AP mode to indicate supporting 802.11h @@ -15,12 +15,13 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -252,6 +252,14 @@ static int wpa_supplicant_mesh_init(stru +@@ -255,6 +255,15 @@ static int wpa_supplicant_mesh_init(stru bss->conf->start_disabled = 1; bss->conf->mesh = MESH_ENABLED; bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; + -+ if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) { ++ if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, ++ wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { + conf->ieee80211h = 1; + conf->ieee80211d = 1; + conf->country[0] = wpa_s->conf->country[0]; diff --git a/package/network/services/hostapd/patches/0106-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch b/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch similarity index 80% rename from package/network/services/hostapd/patches/0106-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch rename to package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch index 66b956fecf1..0d956be2b37 100644 --- a/package/network/services/hostapd/patches/0106-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch +++ b/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch @@ -1,7 +1,7 @@ -From c7f107e52205dd5fdb20f7ae13413b3673b0547e Mon Sep 17 00:00:00 2001 +From 37bf08621eee53f30b464be71876c02e235077ba Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:03 -0700 -Subject: [PATCH 06/15] mesh: inform kernel driver DFS handler in userspace +Date: Tue, 17 Apr 2018 21:55:03 -0700 +Subject: [PATCH 06/16] mesh: inform kernel driver DFS handler in userspace NL80211_ATTR_HANDLE_DFS is required by kerenel space to enable DFS channels that indicates DFS handler @@ -26,7 +26,7 @@ Signed-off-by: Peter Oh /** --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9244,6 +9244,9 @@ static int nl80211_join_mesh(struct i802 +@@ -9270,6 +9270,9 @@ static int nl80211_join_mesh(struct i802 wpa_printf(MSG_DEBUG, " * flags=%08X", params->flags); @@ -38,7 +38,7 @@ Signed-off-by: Peter Oh goto fail; --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -258,6 +258,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -262,6 +262,7 @@ static int wpa_supplicant_mesh_init(stru conf->ieee80211d = 1; conf->country[0] = wpa_s->conf->country[0]; conf->country[1] = wpa_s->conf->country[1]; diff --git a/package/network/services/hostapd/patches/0107-mesh-apply-channel-attributes-before-running-Mesh.patch b/package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch similarity index 70% rename from package/network/services/hostapd/patches/0107-mesh-apply-channel-attributes-before-running-Mesh.patch rename to package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch index 9c8b2b94874..d8722c7cf91 100644 --- a/package/network/services/hostapd/patches/0107-mesh-apply-channel-attributes-before-running-Mesh.patch +++ b/package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch @@ -1,7 +1,7 @@ -From a0c5eea22d5d1181dbe0861b24e4b9bb598f4e50 Mon Sep 17 00:00:00 2001 +From 8190aab3344ae9746c897093f88f3679239d135d Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:04 -0700 -Subject: [PATCH 07/15] mesh: apply channel attributes before running Mesh +Date: Tue, 17 Apr 2018 21:55:04 -0700 +Subject: [PATCH 07/16] mesh: apply channel attributes before running Mesh This helps mesh interface initializes with correct channel parameters. @@ -13,7 +13,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -334,6 +334,8 @@ static int wpa_supplicant_mesh_init(stru +@@ -338,6 +338,8 @@ static int wpa_supplicant_mesh_init(stru conf->basic_rates[rate_len] = -1; } @@ -22,7 +22,7 @@ Signed-off-by: Peter Oh if (hostapd_setup_interface(ifmsh)) { wpa_printf(MSG_ERROR, "Failed to initialize hostapd interface for mesh"); -@@ -345,8 +347,6 @@ static int wpa_supplicant_mesh_init(stru +@@ -349,8 +351,6 @@ static int wpa_supplicant_mesh_init(stru return -1; } diff --git a/package/network/services/hostapd/patches/0108-mesh-set-interface-type-to-mesh-before-setting-inter.patch b/package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch similarity index 79% rename from package/network/services/hostapd/patches/0108-mesh-set-interface-type-to-mesh-before-setting-inter.patch rename to package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch index da47aa8d2c6..ec6cadb223a 100644 --- a/package/network/services/hostapd/patches/0108-mesh-set-interface-type-to-mesh-before-setting-inter.patch +++ b/package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch @@ -1,7 +1,7 @@ -From 143809f1e60f749a5a5c72735ffa8eb99d602cc1 Mon Sep 17 00:00:00 2001 +From e001251cb5708c406d477eca6aa912e5692b17fe Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:05 -0700 -Subject: [PATCH 08/15] mesh: set interface type to mesh before setting +Date: Tue, 17 Apr 2018 21:55:05 -0700 +Subject: [PATCH 08/16] mesh: set interface type to mesh before setting interface Correct interface type is required to start DFS CAC that can be @@ -14,7 +14,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -336,14 +336,14 @@ static int wpa_supplicant_mesh_init(stru +@@ -340,14 +340,14 @@ static int wpa_supplicant_mesh_init(stru wpa_supplicant_conf_ap_ht(wpa_s, ssid, conf); diff --git a/package/network/services/hostapd/patches/0109-mesh-set-mesh-center-frequency.patch b/package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch similarity index 69% rename from package/network/services/hostapd/patches/0109-mesh-set-mesh-center-frequency.patch rename to package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch index ac5e7d38919..2fbbc950ceb 100644 --- a/package/network/services/hostapd/patches/0109-mesh-set-mesh-center-frequency.patch +++ b/package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch @@ -1,7 +1,7 @@ -From 4347c97600f4484be8df804dfb5ed85b867d3c43 Mon Sep 17 00:00:00 2001 +From 3cefd0bf495ad51a860b56281a8cae32bc4bd086 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:06 -0700 -Subject: [PATCH 09/15] mesh: set mesh center frequency +Date: Tue, 17 Apr 2018 21:55:06 -0700 +Subject: [PATCH 09/16] mesh: set mesh center frequency vht center frequency value is required to compose the correct channel info. @@ -12,7 +12,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -453,6 +453,7 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -457,6 +457,7 @@ int wpa_supplicant_join_mesh(struct wpa_ if (wpa_s->mesh_vht_enabled) { ssid->vht = 1; diff --git a/package/network/services/hostapd/patches/0110-mesh-consider-mesh-interface-on-dfs-event-handler.patch b/package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch similarity index 74% rename from package/network/services/hostapd/patches/0110-mesh-consider-mesh-interface-on-dfs-event-handler.patch rename to package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch index 0c78dd43241..e4711a8bdd1 100644 --- a/package/network/services/hostapd/patches/0110-mesh-consider-mesh-interface-on-dfs-event-handler.patch +++ b/package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch @@ -1,32 +1,33 @@ -From d0a0e1030005834b99225feb64ec3794d31beab0 Mon Sep 17 00:00:00 2001 +From 90aa570a894a907d11f85ced43a248198e24acc1 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:07 -0700 -Subject: [PATCH 10/15] mesh: consider mesh interface on dfs event handler +Date: Tue, 17 Apr 2018 21:55:07 -0700 +Subject: [PATCH 10/16] mesh: consider mesh interface on dfs event handler Once mesh starts supporting DFS channels, it has to handle DFS related events from drivers, hence add mesh interface to the check list. Signed-off-by: Peter Oh --- - wpa_supplicant/ap.c | 55 ++++++++++++++++++++++++++++++++--------- + wpa_supplicant/ap.c | 71 ++++++++++++++++++++++++++++++----------- wpa_supplicant/events.c | 1 + - 2 files changed, 44 insertions(+), 12 deletions(-) + 2 files changed, 54 insertions(+), 18 deletions(-) --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1328,13 +1328,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_ +@@ -1337,13 +1337,18 @@ int ap_ctrl_iface_chanswitch(struct wpa_ void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht, int offset, int width, int cf1, int cf2) { -+ struct hostapd_iface *iface = wpa_s->ap_iface; -+ - if (!wpa_s->ap_iface) +- if (!wpa_s->ap_iface) - return; ++ struct hostapd_iface *iface = wpa_s->ap_iface; + ++ if (!wpa_s->ap_iface) { + if (!wpa_s->ifmsh) + return; + else + iface = wpa_s->ifmsh; - ++ } wpa_s->assoc_freq = freq; if (wpa_s->current_ssid) wpa_s->current_ssid->frequency = freq; @@ -35,91 +36,100 @@ Signed-off-by: Peter Oh offset, width, cf1, cf2); } -@@ -1531,10 +1536,15 @@ int wpas_ap_pmksa_cache_add_external(str +@@ -1540,10 +1545,16 @@ int wpas_ap_pmksa_cache_add_external(str void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, struct dfs_event *radar) { +- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) +- return; + struct hostapd_iface *iface = wpa_s->ap_iface; + - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) -- return; ++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) + return; + else + iface = wpa_s->ifmsh; ++ } wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq); - hostapd_dfs_radar_detected(wpa_s->ap_iface, radar->freq, + hostapd_dfs_radar_detected(iface, radar->freq, radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); -@@ -1544,10 +1554,15 @@ void wpas_event_dfs_radar_detected(struc +@@ -1553,10 +1564,16 @@ void wpas_event_dfs_radar_detected(struc void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, struct dfs_event *radar) { +- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) +- return; + struct hostapd_iface *iface = wpa_s->ap_iface; + - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) -- return; ++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) + return; + else + iface = wpa_s->ifmsh; ++ } wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq); - hostapd_dfs_start_cac(wpa_s->ap_iface, radar->freq, + hostapd_dfs_start_cac(iface, radar->freq, radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); } -@@ -1556,10 +1571,16 @@ void wpas_event_dfs_cac_started(struct w +@@ -1565,10 +1582,16 @@ void wpas_event_dfs_cac_started(struct w void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, struct dfs_event *radar) { +- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) +- return; + struct hostapd_iface *iface = wpa_s->ap_iface; + - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) -- return; ++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) + return; + else + iface = wpa_s->ifmsh; -+ ++ } wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq); - hostapd_dfs_complete_cac(wpa_s->ap_iface, 1, radar->freq, + hostapd_dfs_complete_cac(iface, 1, radar->freq, radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); } -@@ -1568,10 +1589,15 @@ void wpas_event_dfs_cac_finished(struct +@@ -1577,10 +1600,16 @@ void wpas_event_dfs_cac_finished(struct void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, struct dfs_event *radar) { +- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) +- return; + struct hostapd_iface *iface = wpa_s->ap_iface; + - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) -- return; ++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) + return; + else + iface = wpa_s->ifmsh; ++ } wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq); - hostapd_dfs_complete_cac(wpa_s->ap_iface, 0, radar->freq, + hostapd_dfs_complete_cac(iface, 0, radar->freq, radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); } -@@ -1580,10 +1606,15 @@ void wpas_event_dfs_cac_aborted(struct w +@@ -1589,10 +1618,16 @@ void wpas_event_dfs_cac_aborted(struct w void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, struct dfs_event *radar) { +- if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) +- return; + struct hostapd_iface *iface = wpa_s->ap_iface; + - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) -- return; ++ if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { + if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) + return; + else + iface = wpa_s->ifmsh; ++ } wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq); - hostapd_dfs_nop_finished(wpa_s->ap_iface, radar->freq, + hostapd_dfs_nop_finished(iface, radar->freq, @@ -128,8 +138,8 @@ Signed-off-by: Peter Oh } --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4168,6 +4168,7 @@ void wpa_supplicant_event(void *ctx, enu - +@@ -4203,6 +4203,7 @@ void wpa_supplicant_event(void *ctx, enu + #ifdef CONFIG_AP if (wpa_s->current_ssid->mode == WPAS_MODE_AP || wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO || + wpa_s->current_ssid->mode == WPAS_MODE_MESH || diff --git a/package/network/services/hostapd/patches/0111-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch similarity index 80% rename from package/network/services/hostapd/patches/0111-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch rename to package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch index 928ba8eb91a..73ae00ce8de 100644 --- a/package/network/services/hostapd/patches/0111-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch +++ b/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch @@ -1,7 +1,7 @@ -From e7fc5d2e6b34102282ff94a6e5255af4b6e9ccb5 Mon Sep 17 00:00:00 2001 +From ce3e491e445ebea9705e76ac7ee3d4841ace1cad Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:08 -0700 -Subject: [PATCH 11/15] mesh: Allow DFS channels to be selected if dfs is +Date: Tue, 17 Apr 2018 21:55:08 -0700 +Subject: [PATCH 11/16] mesh: Allow DFS channels to be selected if dfs is enabled Note: DFS is assumed to be usable if a country code has been set @@ -14,7 +14,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2033,6 +2033,8 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2040,6 +2040,8 @@ void ibss_mesh_setup_freq(struct wpa_sup struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; u32 vht_caps = 0; @@ -23,7 +23,7 @@ Signed-off-by: Peter Oh freq->freq = ssid->frequency; -@@ -2109,8 +2111,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2116,8 +2118,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check primary channel flags */ @@ -36,7 +36,7 @@ Signed-off-by: Peter Oh #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht40) -@@ -2136,8 +2141,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2143,8 +2148,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check secondary channel flags */ @@ -49,7 +49,7 @@ Signed-off-by: Peter Oh freq->channel = pri_chan->chan; -@@ -2227,8 +2235,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2234,8 +2242,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Back to HT configuration if channel not usable */ @@ -62,7 +62,7 @@ Signed-off-by: Peter Oh } chwidth = VHT_CHANWIDTH_80MHZ; -@@ -2248,10 +2259,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2255,10 +2266,11 @@ void ibss_mesh_setup_freq(struct wpa_sup if (!chan) continue; diff --git a/package/network/services/hostapd/patches/0112-mesh-allow-mesh-to-send-channel-switch-request.patch b/package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch similarity index 72% rename from package/network/services/hostapd/patches/0112-mesh-allow-mesh-to-send-channel-switch-request.patch rename to package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch index b011a3c350b..39df49870c5 100644 --- a/package/network/services/hostapd/patches/0112-mesh-allow-mesh-to-send-channel-switch-request.patch +++ b/package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch @@ -1,7 +1,7 @@ -From 851f67301a8b9bc96c3d8cce08e355a64d30350d Mon Sep 17 00:00:00 2001 +From 912b5c89328f1f9585e64fd13460928c71f28352 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:09 -0700 -Subject: [PATCH 12/15] mesh: allow mesh to send channel switch request +Date: Tue, 17 Apr 2018 21:55:09 -0700 +Subject: [PATCH 12/16] mesh: allow mesh to send channel switch request add mesh type to nl80211 channel switch request, so mesh is able to send the request to kernel drivers. @@ -13,7 +13,7 @@ Signed-off-by: Peter Oh --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -8659,7 +8659,8 @@ static int nl80211_switch_channel(void * +@@ -8685,7 +8685,8 @@ static int nl80211_switch_channel(void * } if ((drv->nlmode != NL80211_IFTYPE_AP) && diff --git a/package/network/services/hostapd/patches/0113-mesh-do-not-allow-pri-sec-channel-switch.patch b/package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch similarity index 75% rename from package/network/services/hostapd/patches/0113-mesh-do-not-allow-pri-sec-channel-switch.patch rename to package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch index 988ccdbeb03..8a9818b187d 100644 --- a/package/network/services/hostapd/patches/0113-mesh-do-not-allow-pri-sec-channel-switch.patch +++ b/package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch @@ -1,7 +1,7 @@ -From 5fe4fa1c1f426d81496458d2127bfbd7623fe5d5 Mon Sep 17 00:00:00 2001 +From d7ae7271dce4203bfcd79a230acb24f03f38633d Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:10 -0700 -Subject: [PATCH 13/15] mesh: do not allow pri/sec channel switch +Date: Tue, 17 Apr 2018 21:55:10 -0700 +Subject: [PATCH 13/16] mesh: do not allow pri/sec channel switch We don't want mesh to switch the channel from primary to secondary, since mesh points are not able to join each other in that case. @@ -13,7 +13,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -333,7 +333,10 @@ static int wpa_supplicant_mesh_init(stru +@@ -337,7 +337,10 @@ static int wpa_supplicant_mesh_init(stru rate_len * sizeof(int)); conf->basic_rates[rate_len] = -1; } diff --git a/package/network/services/hostapd/patches/0114-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch b/package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch similarity index 72% rename from package/network/services/hostapd/patches/0114-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch rename to package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch index 2545cb4a1e2..3c692a581f3 100644 --- a/package/network/services/hostapd/patches/0114-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch +++ b/package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch @@ -1,7 +1,7 @@ -From fcc5fe675d1155d65df0471aa06f746c28b66b6c Mon Sep 17 00:00:00 2001 +From cf2ba81fb307f3e87e13896f9dbf93c0c2a9eb92 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:11 -0700 -Subject: [PATCH 14/15] mesh: do not allow scan result to swap pri/sec +Date: Tue, 17 Apr 2018 21:55:11 -0700 +Subject: [PATCH 14/16] mesh: do not allow scan result to swap pri/sec Swapping between primary and secondary channel will break mesh from joining, hence don't allow it. @@ -13,7 +13,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2158,7 +2158,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2165,7 +2165,7 @@ void ibss_mesh_setup_freq(struct wpa_sup } freq->sec_channel_offset = ht40; diff --git a/package/network/services/hostapd/patches/0115-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch b/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch similarity index 61% rename from package/network/services/hostapd/patches/0115-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch rename to package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch index 76b4fe64c9c..9d6ac82bf63 100644 --- a/package/network/services/hostapd/patches/0115-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch +++ b/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch @@ -1,7 +1,7 @@ -From ab2ba9fd9ac73c83dc15a6d76d93df4434d539d6 Mon Sep 17 00:00:00 2001 +From 48f31256ffebfc43d6b14b93597aa2c7e2975dc4 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Thu, 12 Apr 2018 02:49:12 -0700 -Subject: [PATCH 15/15] mesh: do not use offchan mgmt tx on DFS +Date: Tue, 17 Apr 2018 21:55:12 -0700 +Subject: [PATCH 15/16] mesh: do not use offchan mgmt tx on DFS Drivers don't allow mesh to use offchannel on management Tx. @@ -12,24 +12,31 @@ Signed-off-by: Peter Oh --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -7148,6 +7148,7 @@ static int wpa_driver_nl80211_send_actio +@@ -7165,6 +7165,10 @@ static int wpa_driver_nl80211_send_actio struct wpa_driver_nl80211_data *drv = bss->drv; int ret = -1; u8 *buf; + int offchanok = 1; ++ u16 num_modes, flags; ++ struct hostapd_hw_modes *modes; ++ u8 dfs_domain; struct ieee80211_hdr *hdr; wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, " -@@ -7173,6 +7174,8 @@ static int wpa_driver_nl80211_send_actio +@@ -7190,6 +7194,12 @@ static int wpa_driver_nl80211_send_actio os_memset(bss->rand_addr, 0, ETH_ALEN); } -+ if (is_mesh_interface(drv->nlmode) && ieee80211_is_dfs(freq)) ++ if (is_mesh_interface(drv->nlmode) && ++ (modes = nl80211_get_hw_feature_data(bss, &num_modes, &flags, ++ &dfs_domain)) && ++ ieee80211_is_dfs(freq, modes, num_modes)) + offchanok = 0; ++ if (is_ap_interface(drv->nlmode) && (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || (int) freq == bss->freq || drv->device_ap_sme || -@@ -7184,7 +7187,7 @@ static int wpa_driver_nl80211_send_actio +@@ -7201,7 +7211,7 @@ static int wpa_driver_nl80211_send_actio ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf, 24 + data_len, &drv->send_action_cookie, diff --git a/package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/016-mesh-make-forwarding-configurable.patch similarity index 83% rename from package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch rename to package/network/services/hostapd/patches/016-mesh-make-forwarding-configurable.patch index 13f0deaaf06..9f916c5266c 100644 --- a/package/network/services/hostapd/patches/021-mesh-make-forwarding-configurable.patch +++ b/package/network/services/hostapd/patches/016-mesh-make-forwarding-configurable.patch @@ -1,10 +1,7 @@ -From d11881c1ad0d6a102962d1a040a398f597256ae0 Mon Sep 17 00:00:00 2001 +From 9a01d7f21bd33725dc33325a437c3cc4185ee8bd Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Wed, 18 Apr 2018 19:24:31 +0200 -Subject: [PATCH] mesh: make forwarding configurable -To: hostap@lists.infradead.org -Cc: Jouni Malinen , - Johannes Berg +Subject: [PATCH 16/16] mesh: make forwarding configurable Allow mesh_fwding to be specified in a mesh bss config, pass that to the driver (only nl80211 implemented for now) and announce @@ -16,13 +13,13 @@ Signed-off-by: Daniel Golle src/drivers/driver.h | 2 ++ src/drivers/driver_nl80211.c | 3 +++ wpa_supplicant/config.c | 4 ++++ - wpa_supplicant/config.h | 3 +++ + wpa_supplicant/config.h | 9 +++++++++ wpa_supplicant/config_file.c | 4 ++++ wpa_supplicant/config_ssid.h | 5 +++++ wpa_supplicant/mesh.c | 6 ++++++ wpa_supplicant/mesh_mpm.c | 4 ++-- - wpa_supplicant/wpa_supplicant.conf | 6 ++++++ - 10 files changed, 37 insertions(+), 2 deletions(-) + wpa_supplicant/wpa_supplicant.conf | 3 +++ + 10 files changed, 40 insertions(+), 2 deletions(-) --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -34,7 +31,7 @@ Signed-off-by: Daniel Golle }; #define MAX_STA_COUNT 2007 -@@ -612,6 +613,7 @@ struct hostapd_bss_config { +@@ -624,6 +625,7 @@ struct hostapd_bss_config { #define MESH_ENABLED BIT(0) int mesh; @@ -62,7 +59,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9197,6 +9197,9 @@ static int nl80211_put_mesh_config(struc +@@ -9230,6 +9230,9 @@ static int nl80211_put_mesh_config(struc if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) && nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, params->auto_plinks)) || @@ -74,7 +71,7 @@ Signed-off-by: Daniel Golle params->max_peer_links)) || --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2211,6 +2211,7 @@ static const struct parse_data ssid_fiel +@@ -2212,6 +2212,7 @@ static const struct parse_data ssid_fiel #ifdef CONFIG_MESH { INT_RANGE(mode, 0, 5) }, { INT_RANGE(no_auto_peer, 0, 1) }, @@ -82,7 +79,7 @@ Signed-off-by: Daniel Golle { INT_RANGE(mesh_rssi_threshold, -255, 1) }, #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, -@@ -2757,6 +2758,7 @@ void wpa_config_set_network_defaults(str +@@ -2763,6 +2764,7 @@ void wpa_config_set_network_defaults(str ssid->dot11MeshRetryTimeout = DEFAULT_MESH_RETRY_TIMEOUT; ssid->dot11MeshConfirmTimeout = DEFAULT_MESH_CONFIRM_TIMEOUT; ssid->dot11MeshHoldingTimeout = DEFAULT_MESH_HOLDING_TIMEOUT; @@ -90,7 +87,7 @@ Signed-off-by: Daniel Golle ssid->mesh_rssi_threshold = DEFAULT_MESH_RSSI_THRESHOLD; #endif /* CONFIG_MESH */ #ifdef CONFIG_HT_OVERRIDES -@@ -3886,6 +3888,7 @@ struct wpa_config * wpa_config_alloc_emp +@@ -3978,6 +3980,7 @@ struct wpa_config * wpa_config_alloc_emp config->user_mpm = DEFAULT_USER_MPM; config->max_peer_links = DEFAULT_MAX_PEER_LINKS; config->mesh_max_inactivity = DEFAULT_MESH_MAX_INACTIVITY; @@ -98,7 +95,7 @@ Signed-off-by: Daniel Golle config->dot11RSNASAERetransPeriod = DEFAULT_DOT11_RSNA_SAE_RETRANS_PERIOD; config->fast_reauth = DEFAULT_FAST_REAUTH; -@@ -4508,6 +4511,7 @@ static const struct global_parse_data gl +@@ -4600,6 +4603,7 @@ static const struct global_parse_data gl { INT(user_mpm), 0 }, { INT_RANGE(max_peer_links, 0, 255), 0 }, { INT(mesh_max_inactivity), 0 }, @@ -116,18 +113,24 @@ Signed-off-by: Daniel Golle /* * The default dot11RSNASAERetransPeriod is defined as 40 ms in the standard, * but use 1000 ms in practice to avoid issues on low power CPUs. -@@ -1269,6 +1270,8 @@ struct wpa_config { - */ +@@ -1306,6 +1307,14 @@ struct wpa_config { int mesh_max_inactivity; + /** ++ * mesh_fwding - Mesh network layer-2 forwarding ++ * ++ * This controls whether to enable layer-2 forwarding. ++ * By default: 1: enabled ++ */ + int mesh_fwding; + - /** ++ /** * dot11RSNASAERetransPeriod - Timeout to retransmit SAE Auth frame * + * This timeout value is used in mesh STA to retransmit --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL +@@ -818,6 +818,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -135,7 +138,7 @@ Signed-off-by: Daniel Golle INT(frequency); INT(fixed_freq); #ifdef CONFIG_ACS -@@ -1433,6 +1434,9 @@ static void wpa_config_write_global(FILE +@@ -1450,6 +1451,9 @@ static void wpa_config_write_global(FILE fprintf(f, "mesh_max_inactivity=%d\n", config->mesh_max_inactivity); @@ -147,7 +150,7 @@ Signed-off-by: Daniel Golle fprintf(f, "dot11RSNASAERetransPeriod=%d\n", --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -492,6 +492,11 @@ struct wpa_ssid { +@@ -500,6 +500,11 @@ struct wpa_ssid { int dot11MeshConfirmTimeout; /* msec */ int dot11MeshHoldingTimeout; /* msec */ @@ -161,7 +164,7 @@ Signed-off-by: Daniel Golle --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -121,6 +121,7 @@ static struct mesh_conf * mesh_config_cr +@@ -120,6 +120,7 @@ static struct mesh_conf * mesh_config_cr conf->mesh_cc_id = 0; conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET; conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0; @@ -169,14 +172,14 @@ Signed-off-by: Daniel Golle conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries; conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout; conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout; -@@ -256,6 +257,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -255,6 +256,7 @@ static int wpa_supplicant_mesh_init(stru bss->conf->start_disabled = 1; bss->conf->mesh = MESH_ENABLED; bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; + bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding; - if (ieee80211_is_dfs(ssid->frequency) && wpa_s->conf->country[0]) { - conf->ieee80211h = 1; + if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, + wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { @@ -508,6 +510,10 @@ int wpa_supplicant_join_mesh(struct wpa_ } params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity; @@ -204,15 +207,12 @@ Signed-off-by: Daniel Golle wpabuf_put_u8(buf, WLAN_EID_MESH_ID); --- a/wpa_supplicant/wpa_supplicant.conf +++ b/wpa_supplicant/wpa_supplicant.conf -@@ -153,6 +153,12 @@ ap_scan=1 +@@ -153,6 +153,9 @@ ap_scan=1 # This timeout value is used in mesh STA to clean up inactive stations. #mesh_max_inactivity=300 +# Enable 802.11s layer-2 routing and forwarding +#mesh_fwding=1 -+ -+# Accept additional peer links -+#mesh_auto_open_plinks=1 + # cert_in_cb - Whether to include a peer certificate dump in events # This controls whether peer certificates for authentication server and diff --git a/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch b/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch deleted file mode 100644 index 775774bf648..00000000000 --- a/package/network/services/hostapd/patches/020-mesh-properly-handle-sae_password.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 30c1693f42326d4f927e76120492bc9593b8f739 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Fri, 13 Apr 2018 00:42:10 +0200 -Subject: [PATCH] mesh: properly handle sae_password - -The recently introduced sae_password parameter is only handled properly -in wpa_supplicant/sme.c while wpa_supplicant/mesh.c assumed that -ssid->passphrase exclusively holds the secret. -Import the logic from sme.c to mesh.c to allow having only sae_password -set which otherwise throws this error: -AP-ENABLED -mesh: Passphrase for SAE not configured -Init RSN failed. Deinit mesh... -wlan1: interface state ENABLED->DISABLED -AP-DISABLED -Segmentation fault - -Signed-off-by: Daniel Golle ---- - wpa_supplicant/mesh.c | 10 +++++++--- - 1 file changed, 7 insertions(+), 3 deletions(-) - ---- a/wpa_supplicant/mesh.c -+++ b/wpa_supplicant/mesh.c -@@ -154,10 +154,14 @@ int wpas_mesh_init_rsn(struct wpa_suppli - struct wpa_ssid *ssid = wpa_s->current_ssid; - struct hostapd_data *bss = ifmsh->bss[0]; - static int default_groups[] = { 19, 20, 21, 25, 26, -1 }; -+ const char *password; - size_t len; - - if (mconf->security != MESH_CONF_SEC_NONE) { -- if (ssid->passphrase == NULL) { -+ password = ssid->sae_password; -+ if (!password) -+ password = ssid->passphrase; -+ if (!password) { - wpa_printf(MSG_ERROR, - "mesh: Passphrase for SAE not configured"); - return -1; -@@ -177,9 +181,9 @@ int wpas_mesh_init_rsn(struct wpa_suppli - return -1; - } - -- len = os_strlen(ssid->passphrase); -+ len = os_strlen(password); - bss->conf->ssid.wpa_passphrase = -- dup_binstr(ssid->passphrase, len); -+ dup_binstr(password, len); - - wpa_s->mesh_rsn = mesh_rsn_auth_init(wpa_s, mconf); - if (!wpa_s->mesh_rsn) diff --git a/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch b/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch index bbc4672f9ca..af0148bc4e0 100644 --- a/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch +++ b/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -216,7 +216,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -214,7 +214,7 @@ static int wpa_supplicant_mesh_init(stru return 0; } diff --git a/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch b/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch deleted file mode 100644 index db6ec04b35b..00000000000 --- a/package/network/services/hostapd/patches/030-rsn_supp-fix-stub-pmksa_cache.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/src/rsn_supp/pmksa_cache.h -+++ b/src/rsn_supp/pmksa_cache.h -@@ -101,7 +101,7 @@ static inline void pmksa_cache_deinit(st - - static inline struct rsn_pmksa_cache_entry * - pmksa_cache_get(struct rsn_pmksa_cache *pmksa, const u8 *aa, const u8 *pmkid, -- const void *network_ctx) -+ const void *network_ctx, int akmp) - { - return NULL; - } -@@ -148,7 +148,8 @@ static inline int pmksa_cache_set_curren - const u8 *bssid, - void *network_ctx, - int try_opportunistic, -- const u8 *fils_cache_id) -+ const u8 *fils_cache_id, -+ int akmp) - { - return -1; - } diff --git a/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch b/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch index 8ff11f3191d..4b802d2a497 100644 --- a/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch +++ b/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch @@ -17,7 +17,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2796,6 +2796,7 @@ void wpa_config_set_network_defaults(str +@@ -2802,6 +2802,7 @@ void wpa_config_set_network_defaults(str ssid->mka_priority = DEFAULT_PRIO_NOT_KEY_SERVER; #endif /* CONFIG_MACSEC */ ssid->mac_addr = -1; @@ -37,7 +37,7 @@ Signed-off-by: Peter Oh struct dl_list list; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2285,6 +2285,9 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2292,6 +2292,9 @@ void ibss_mesh_setup_freq(struct wpa_sup vht_caps |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; seg0 = 114; } diff --git a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch index bd28fb8de94..f913b1282a1 100644 --- a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch +++ b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch @@ -33,7 +33,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2117,9 +2117,15 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2124,9 +2124,15 @@ void ibss_mesh_setup_freq(struct wpa_sup if (!dfs_enabled) return; @@ -51,7 +51,7 @@ Signed-off-by: Peter Oh #endif /* CONFIG_HT_OVERRIDES */ /* Check/setup HT40+/HT40- */ -@@ -2147,8 +2153,6 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2154,8 +2160,6 @@ void ibss_mesh_setup_freq(struct wpa_sup if (!dfs_enabled) return; @@ -60,7 +60,7 @@ Signed-off-by: Peter Oh if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) return; -@@ -2192,6 +2196,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2199,6 +2203,7 @@ void ibss_mesh_setup_freq(struct wpa_sup wpa_scan_results_free(scan_res); } @@ -68,7 +68,7 @@ Signed-off-by: Peter Oh wpa_printf(MSG_DEBUG, "IBSS/mesh: setup freq channel %d, sec_channel_offset %d", freq->channel, freq->sec_channel_offset); -@@ -2287,7 +2292,10 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2294,7 +2299,10 @@ void ibss_mesh_setup_freq(struct wpa_sup } } else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) { chwidth = VHT_CHANWIDTH_USE_HT; diff --git a/package/network/services/hostapd/patches/033-mesh-fix-parsing-of-max_oper_chwidth.patch b/package/network/services/hostapd/patches/033-mesh-fix-parsing-of-max_oper_chwidth.patch index 6c9f6a72483..cb922ba1e25 100644 --- a/package/network/services/hostapd/patches/033-mesh-fix-parsing-of-max_oper_chwidth.patch +++ b/package/network/services/hostapd/patches/033-mesh-fix-parsing-of-max_oper_chwidth.patch @@ -34,7 +34,7 @@ Forwarded: https://patchwork.ozlabs.org/patch/909751/ --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -503,7 +503,7 @@ struct wpa_ssid { +@@ -511,7 +511,7 @@ struct wpa_ssid { int vht; diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 9f476210f79..5d9a2397de4 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -36,7 +36,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1270,6 +1276,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) +@@ -1274,6 +1280,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) BCHECK=../src/drivers/build.hostapd @@ -49,7 +49,7 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1315,6 +1327,12 @@ ifeq ($(CONFIG_TLS), linux) +@@ -1316,6 +1328,12 @@ ifeq ($(CONFIG_TLS), linux) HOBJS += ../src/crypto/crypto_linux.o endif @@ -128,7 +128,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1887,6 +1904,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1888,6 +1905,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1989,6 +2012,12 @@ endif +@@ -1990,6 +2013,12 @@ endif -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5430,8 +5430,8 @@ union wpa_event_data { +@@ -5449,8 +5449,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5443,7 +5443,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5462,7 +5462,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,8 +178,8 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1473,8 +1473,8 @@ static void hostapd_event_dfs_cac_starte - #endif /* NEED_AP_MLME */ +@@ -1515,8 +1515,8 @@ static void hostapd_event_wds_sta_interf + } -void wpa_supplicant_event(void *ctx, enum wpa_event_type event, @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -1694,7 +1694,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -1742,7 +1742,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -3812,8 +3812,8 @@ static void wpa_supplicant_event_assoc_a +@@ -3901,8 +3901,8 @@ static void wpas_event_assoc_reject(stru } @@ -242,7 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -4632,7 +4632,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -4669,7 +4669,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5736,7 +5736,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -5777,7 +5777,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -5773,6 +5772,11 @@ static int wpa_supplicant_match_existing +@@ -5814,6 +5813,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6029,6 +6033,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -6070,6 +6074,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index d5cf84fb371..4463c75c915 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3131,6 +3131,10 @@ static int hostapd_config_fill(struct ho +@@ -3214,6 +3214,10 @@ static int hostapd_config_fill(struct ho } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -763,6 +763,8 @@ struct hostapd_config { +@@ -775,6 +775,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch index b2c59bc5be7..c72d5e115c2 100644 --- a/package/network/services/hostapd/patches/301-mesh-noscan.patch +++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -2216,6 +2216,7 @@ static const struct parse_data ssid_fiel +@@ -2217,6 +2217,7 @@ static const struct parse_data ssid_fiel #else /* CONFIG_MESH */ { INT_RANGE(mode, 0, 4) }, #endif /* CONFIG_MESH */ @@ -10,7 +10,7 @@ { STR(id_str) }, --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c -@@ -816,6 +816,7 @@ static void wpa_config_write_network(FIL +@@ -818,6 +818,7 @@ static void wpa_config_write_network(FIL #endif /* IEEE8021X_EAPOL */ INT(mode); INT(no_auto_peer); @@ -31,7 +31,7 @@ if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2024,12 +2024,12 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2031,12 +2031,12 @@ void ibss_mesh_setup_freq(struct wpa_sup { enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; @@ -46,7 +46,7 @@ unsigned int j, k; struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; -@@ -2099,7 +2099,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2106,7 +2106,7 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Setup higher BW only for 5 GHz */ @@ -57,7 +57,7 @@ for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h -@@ -835,6 +835,8 @@ struct wpa_ssid { +@@ -856,6 +856,8 @@ struct wpa_ssid { */ int no_auto_peer; diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index f504ba805ff..e72a5c816b3 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4187,7 +4187,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -4228,7 +4228,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch index 87c30976d04..d46f5144d0c 100644 --- a/package/network/services/hostapd/patches/340-reload_freq_change.patch +++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -90,6 +90,25 @@ static void hostapd_reload_bss(struct ho +@@ -93,6 +93,25 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -26,7 +26,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -168,6 +187,7 @@ int hostapd_reload_config(struct hostapd +@@ -171,6 +190,7 @@ int hostapd_reload_config(struct hostapd struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -34,7 +34,7 @@ if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -189,21 +209,20 @@ int hostapd_reload_config(struct hostapd +@@ -192,21 +212,20 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index 2cf92c8a183..10c18674c45 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -27,7 +27,7 @@ } -@@ -7040,8 +7045,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -7057,8 +7062,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); @@ -36,7 +36,7 @@ nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -7415,7 +7418,6 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -7439,7 +7442,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); @@ -44,7 +44,7 @@ /* * If the P2P GO interface was dynamically added, then it is -@@ -7435,7 +7437,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -7459,7 +7461,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch index e7fc814d6a7..07faead2c5a 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -78,7 +78,7 @@ #ifdef CONFIG_IEEE80211W #ifdef NEED_AP_MLME -@@ -3026,6 +3083,8 @@ static int hostapd_ctrl_iface_receive_pr +@@ -3031,6 +3088,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); @@ -89,7 +89,7 @@ #ifdef RADIUS_SERVER --- a/src/ap/ctrl_iface_ap.c +++ b/src/ap/ctrl_iface_ap.c -@@ -857,7 +857,13 @@ int hostapd_parse_csa_settings(const cha +@@ -864,7 +864,13 @@ int hostapd_parse_csa_settings(const cha int hostapd_ctrl_iface_stop_ap(struct hostapd_data *hapd) { diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index 2f0c31848ed..67cfc5a5c8e 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -30,7 +30,7 @@ #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -290,6 +291,10 @@ void calculate_update_time(const struct +@@ -292,6 +293,10 @@ void calculate_update_time(const struct static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { @@ -41,7 +41,7 @@ dst->flags = src->flags; os_memcpy(dst->bssid, src->bssid, ETH_ALEN); dst->freq = src->freq; -@@ -302,6 +307,15 @@ static void wpa_bss_copy_res(struct wpa_ +@@ -304,6 +309,15 @@ static void wpa_bss_copy_res(struct wpa_ dst->est_throughput = src->est_throughput; dst->snr = src->snr; @@ -59,7 +59,7 @@ --- a/wpa_supplicant/bss.h +++ b/wpa_supplicant/bss.h -@@ -80,6 +80,10 @@ struct wpa_bss { +@@ -81,6 +81,10 @@ struct wpa_bss { u8 ssid[SSID_MAX_LEN]; /** Length of SSID */ size_t ssid_len; @@ -183,7 +183,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -1920,6 +1973,8 @@ void wpa_supplicant_associate(struct wpa +@@ -1927,6 +1980,8 @@ void wpa_supplicant_associate(struct wpa wpa_ssid_txt(ssid->ssid, ssid->ssid_len), ssid->id); wpas_notify_mesh_group_started(wpa_s, ssid); @@ -192,7 +192,7 @@ #else /* CONFIG_MESH */ wpa_msg(wpa_s, MSG_ERROR, "mesh mode support not included in the build"); -@@ -5362,6 +5417,16 @@ static int wpa_supplicant_init_iface(str +@@ -5403,6 +5458,16 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -209,7 +209,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -5683,6 +5748,11 @@ static void wpa_supplicant_deinit_iface( +@@ -5724,6 +5789,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index 93ac40e9bd7..cd050fc0c9a 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2852,6 +2852,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2857,6 +2857,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -2893,6 +2894,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2898,6 +2899,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -9809,6 +9809,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9825,6 +9825,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -9816,6 +9817,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9832,6 +9833,7 @@ char * wpa_supplicant_ctrl_iface_process reply + reply_len, reply_size - reply_len); } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -10297,6 +10299,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10313,6 +10315,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -10305,12 +10308,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10321,12 +10324,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -101,7 +101,7 @@ static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen, size_t curr_len, const u8 *mcs_set) -@@ -408,6 +409,7 @@ int hostapd_ctrl_iface_sta_next(struct h +@@ -415,6 +416,7 @@ int hostapd_ctrl_iface_sta_next(struct h return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); } @@ -109,7 +109,7 @@ #ifdef CONFIG_P2P_MANAGER static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, -@@ -746,12 +748,12 @@ int hostapd_ctrl_iface_status(struct hos +@@ -753,12 +755,12 @@ int hostapd_ctrl_iface_status(struct hos return len; len += ret; } @@ -126,7 +126,7 @@ if (os_snprintf_error(buflen - len, ret)) --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2504,6 +2504,7 @@ static const char * bool_txt(Boolean val +@@ -2555,6 +2555,7 @@ static const char * bool_txt(Boolean val return val ? "TRUE" : "FALSE"; } @@ -134,7 +134,7 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2679,6 +2680,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2730,6 +2731,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -163,7 +163,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2295,6 +2295,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2306,6 +2306,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -172,7 +172,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2378,6 +2380,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2389,6 +2391,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -182,7 +182,7 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1170,7 +1170,7 @@ int wpas_ap_wps_nfc_report_handover(stru +@@ -1179,7 +1179,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index a8ae70196dd..d52684e93b3 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2281,6 +2373,8 @@ static const struct parse_data ssid_fiel +@@ -2282,6 +2374,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, @@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -749,6 +751,9 @@ struct wpa_ssid { +@@ -757,6 +759,9 @@ struct wpa_ssid { */ void *parent_cred; @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3000,6 +3000,12 @@ static void wpas_start_assoc_cb(struct w +@@ -3041,6 +3041,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index 6216bf50037..aff00fe556c 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich /** --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9217,6 +9217,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -9250,6 +9250,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -9278,6 +9290,7 @@ static int nl80211_join_mesh(struct i802 +@@ -9311,6 +9323,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch index df056f20746..6fe9d115850 100644 --- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2097,11 +2097,13 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2104,11 +2104,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 91c5c411dcb..022f02d0f1e 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -49,7 +49,7 @@ struct hostapd_iface * hostapd_alloc_iface(void); --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -312,6 +312,7 @@ static void hostapd_free_hapd_data(struc +@@ -315,6 +315,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -57,7 +57,7 @@ iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); -@@ -1189,6 +1190,8 @@ static int hostapd_setup_bss(struct host +@@ -1237,6 +1238,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -66,7 +66,7 @@ return 0; } -@@ -1603,7 +1606,7 @@ static enum nr_chan_width hostapd_get_nr +@@ -1651,7 +1654,7 @@ static enum nr_chan_width hostapd_get_nr #endif /* NEED_AP_MLME */ @@ -75,7 +75,7 @@ { #ifdef NEED_AP_MLME u16 capab = hostapd_own_capab_info(hapd); -@@ -1810,6 +1813,7 @@ static int hostapd_setup_interface_compl +@@ -1872,6 +1875,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -83,7 +83,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME -@@ -1990,6 +1994,7 @@ dfs_offload: +@@ -2052,6 +2056,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -91,7 +91,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2444,6 +2449,7 @@ void hostapd_interface_deinit_free(struc +@@ -2517,6 +2522,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -101,7 +101,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1682,12 +1682,13 @@ ieee802_11_set_radius_info(struct hostap +@@ -1712,12 +1712,13 @@ ieee802_11_set_radius_info(struct hostap static void handle_auth(struct hostapd_data *hapd, @@ -117,7 +117,7 @@ u16 fc; const u8 *challenge = NULL; u32 session_timeout, acct_interim_interval; -@@ -1698,6 +1699,11 @@ static void handle_auth(struct hostapd_d +@@ -1728,6 +1729,11 @@ static void handle_auth(struct hostapd_d char *identity = NULL; char *radius_cui = NULL; u16 seq_ctrl; @@ -129,7 +129,7 @@ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -1858,6 +1864,13 @@ static void handle_auth(struct hostapd_d +@@ -1888,6 +1894,13 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } @@ -143,7 +143,7 @@ if (res == HOSTAPD_ACL_PENDING) return; -@@ -3129,12 +3142,12 @@ void fils_hlp_timeout(void *eloop_ctx, v +@@ -3167,12 +3180,12 @@ void fils_hlp_timeout(void *eloop_ctx, v static void handle_assoc(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -158,7 +158,7 @@ struct sta_info *sta; u8 *tmp = NULL; struct hostapd_sta_wpa_psk_short *psk = NULL; -@@ -3143,6 +3156,11 @@ static void handle_assoc(struct hostapd_ +@@ -3181,6 +3194,11 @@ static void handle_assoc(struct hostapd_ #ifdef CONFIG_FILS int delay_assoc = 0; #endif /* CONFIG_FILS */ @@ -170,7 +170,7 @@ if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : sizeof(mgmt->u.assoc_req))) { -@@ -3314,6 +3332,14 @@ static void handle_assoc(struct hostapd_ +@@ -3352,6 +3370,14 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_MBO */ @@ -185,7 +185,7 @@ /* * sta->capability is used in check_assoc_ies() for RRM enabled * capability element. -@@ -3527,6 +3553,7 @@ static void handle_disassoc(struct hosta +@@ -3565,6 +3591,7 @@ static void handle_disassoc(struct hosta wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code)); @@ -193,7 +193,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { -@@ -3592,6 +3619,8 @@ static void handle_deauth(struct hostapd +@@ -3630,6 +3657,8 @@ static void handle_deauth(struct hostapd " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); @@ -202,7 +202,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " -@@ -3911,7 +3940,7 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3949,7 +3978,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { @@ -211,7 +211,7 @@ return 1; } -@@ -3931,17 +3960,17 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3969,17 +3998,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); @@ -315,7 +315,7 @@ wpabuf_free(sta->p2p_ie); --- a/src/ap/sta_info.c +++ b/src/ap/sta_info.c -@@ -412,6 +412,7 @@ void ap_handle_timer(void *eloop_ctx, vo +@@ -415,6 +415,7 @@ void ap_handle_timer(void *eloop_ctx, vo HOSTAPD_LEVEL_INFO, "deauthenticated due to " "local deauth request"); ap_free_sta(hapd, sta); @@ -323,7 +323,7 @@ return; } -@@ -559,6 +560,7 @@ skip_poll: +@@ -562,6 +563,7 @@ skip_poll: hapd, sta, WLAN_REASON_PREV_AUTH_NOT_VALID); ap_free_sta(hapd, sta); @@ -331,7 +331,7 @@ break; } } -@@ -1220,6 +1222,7 @@ void ap_sta_set_authorized(struct hostap +@@ -1223,6 +1225,7 @@ void ap_sta_set_authorized(struct hostap buf, ip_addr); } else { wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); From 0d08c6705864d0ad430dc3d7049b51bf5a218ba7 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 25 May 2018 15:59:41 +0200 Subject: [PATCH 127/399] hostapd: convert ssl provider build options to variants Instead of selecting the SSL provider at compile time, build package variants for each option so users can select the binary package without having to build it themselves. Most likely not all variants have actually ever been user by anyone. We should reduce the selection to the reasonable and most used combinations at some point in future. For now, build them all. Signed-off-by: Daniel Golle (backported from c8fdd0e9c843dd483f6677dc41f7df17313aa3cd) --- package/network/services/hostapd/Config.in | 82 +++--- package/network/services/hostapd/Makefile | 288 +++++++++++++++++---- 2 files changed, 285 insertions(+), 85 deletions(-) diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index ba0b2359905..3568d9add3c 100644 --- a/package/network/services/hostapd/Config.in +++ b/package/network/services/hostapd/Config.in @@ -1,48 +1,50 @@ # wpa_supplicant config config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK bool "Disable timestamp check" - depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mesh || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini || PACKAGE_wpad-mesh + depends on PACKAGE_wpa-supplicant || \ + PACKAGE_wpa-supplicant-openssl || \ + PACKAGE_wpa-supplicant-wolfssl || \ + PACKAGE_wpa-supplicant-mesh || \ + PACKAGE_wpa-supplicant-mini || \ + PACKAGE_wpad || \ + PACKAGE_wpad-openssl || \ + PACKAGE_wpad-wolfssl || \ + PACKAGE_wpad-mini || \ + PACKAGE_wpad-mesh-openssl || \ + PACKAGE_wpad-mesh-wolfssl default n help This disables the timestamp check for certificates in wpa_supplicant Useful for devices without RTC that cannot reliably get the real date/time -choice - prompt "Choose TLS provider" - default WPA_SUPPLICANT_INTERNAL - depends on PACKAGE_wpa-supplicant || PACKAGE_wpad || PACKAGE_wpad-mesh - -config WPA_SUPPLICANT_INTERNAL - bool "internal" - depends on PACKAGE_wpa-supplicant || PACKAGE_wpad - -config WPA_SUPPLICANT_OPENSSL - bool "openssl" - select PACKAGE_libopenssl - -config WPA_SUPPLICANT_WOLFSSL - bool "wolfssl" - select PACKAGE_libwolfssl - select WOLFSSL_HAS_AES_CCM - select WOLFSSL_HAS_AES_GCM - select WOLFSSL_HAS_ARC4 - select WOLFSSL_HAS_DES3 - select WOLFSSL_HAS_DH - select WOLFSSL_HAS_ECC - select WOLFSSL_HAS_OCSP - select WOLFSSL_HAS_PSK - select WOLFSSL_HAS_SESSION_TICKET - select WOLFSSL_HAS_WPAS - -endchoice - config WPA_RFKILL_SUPPORT bool "Add rfkill support" - depends on PACKAGE_wpa-supplicant || PACKAGE_wpa-supplicant-mesh || PACKAGE_wpa-supplicant-mini || PACKAGE_wpad || PACKAGE_wpad-mini || PACKAGE_wpad-mesh + depends on PACKAGE_wpa-supplicant || \ + PACKAGE_wpa-supplicant-openssl || \ + PACKAGE_wpa-supplicant-wolfssl || \ + PACKAGE_wpa-supplicant-mesh || \ + PACKAGE_wpa-supplicant-mini || \ + PACKAGE_wpad || \ + PACKAGE_wpad-openssl || \ + PACKAGE_wpad-wolfssl || \ + PACKAGE_wpad-mini || \ + PACKAGE_wpad-mesh-openssl || \ + PACKAGE_wpad-mesh-wolfssl default n config WPA_MSG_MIN_PRIORITY int "Minimum debug message priority" + depends on PACKAGE_wpa-supplicant || \ + PACKAGE_wpa-supplicant-openssl || \ + PACKAGE_wpa-supplicant-wolfssl || \ + PACKAGE_wpa-supplicant-mesh || \ + PACKAGE_wpa-supplicant-mini || \ + PACKAGE_wpad || \ + PACKAGE_wpad-openssl || \ + PACKAGE_wpad-wolfssl || \ + PACKAGE_wpad-mini || \ + PACKAGE_wpad-mesh-openssl || \ + PACKAGE_wpad-mesh-wolfssl default 3 help Useful values are: @@ -53,6 +55,24 @@ config WPA_MSG_MIN_PRIORITY 4 = warnings 5 = errors +config WPA_WOLFSSL + bool + default PACKAGE_wpa-supplicant-wolfssl ||\ + PACKAGE_wpad-wolfssl ||\ + PACKAGE_wpad-mesh-wolfssl ||\ + PACKAGE_eapol-test-wolfssl + select PACKAGE_libwolfssl + select WOLFSSL_HAS_AES_CCM + select WOLFSSL_HAS_AES_GCM + select WOLFSSL_HAS_ARC4 + select WOLFSSL_HAS_DES3 + select WOLFSSL_HAS_DH + select WOLFSSL_HAS_ECC + select WOLFSSL_HAS_OCSP + select WOLFSSL_HAS_PSK + select WOLFSSL_HAS_SESSION_TICKET + select WOLFSSL_HAS_WPAS + config DRIVER_WEXT_SUPPORT bool default n diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 933ad9a2319..45d1883e95b 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -30,39 +30,58 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_WPA_RFKILL_SUPPORT \ CONFIG_DRIVER_WEXT_SUPPORT \ CONFIG_DRIVER_11N_SUPPORT \ - CONFIG_DRIVER_11AC_SUPPORT + CONFIG_DRIVER_11AC_SUPPORT \ LOCAL_TYPE=$(strip \ $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \ $(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \ hostapd \ - ))) -LOCAL_VARIANT=$(patsubst wpad-%,%,$(patsubst supplicant-%,%,$(BUILD_VARIANT))) + ))) + +LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\ + $(patsubst wpad-%,%,\ + $(patsubst supplicant-%,%,\ + $(BUILD_VARIANT)\ + ))) + +LOCAL_VARIANT=$(patsubst %-internal,%,\ + $(patsubst %-openssl,%,\ + $(patsubst %-wolfssl,%,\ + $(LOCAL_AND_LIB_VARIANT)\ + ))) + +SSL_VARIANT=$(strip \ + $(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\ + $(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\ + internal\ + ))) + CONFIG_VARIANT:=$(LOCAL_VARIANT) ifeq ($(LOCAL_VARIANT),mesh) CONFIG_VARIANT:=full endif -ifneq ($(LOCAL_TYPE),hostapd) - ifeq ($(LOCAL_VARIANT),full) - PKG_CONFIG_DEPENDS += \ - CONFIG_WPA_SUPPLICANT_INTERNAL \ - CONFIG_WPA_SUPPLICANT_OPENSSL \ - CONFIG_WPA_SUPPLICANT_WOLFSSL - endif - ifeq ($(LOCAL_VARIANT),mesh) - PKG_CONFIG_DEPENDS += \ - CONFIG_WPA_SUPPLICANT_OPENSSL \ - CONFIG_WPA_SUPPLICANT_WOLFSSL - endif -endif - PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY) +WPAD_PROVIDERS:=wpad-mini wpad wpad-openssl wpad-wolfssl \ + wpad-mesh-openssl wpad-mesh-wolfssl + +SUPPLICANT_ONLY_PROVIDERS:=wpa_supplicant-mini wpa_supplicant-p2p \ + wpa_supplicant wpa_supplicant-openssl wpa_supplicant-wolfssl \ + wpa_supplicant-mesh-openssl wpa_supplicant-mesh-wolfssl + +HOSTAPD_ONLY_PROVIDERS:=hostapd-mini hostapd hostapd-openssl hostapd-wolfssl + +EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl + +SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) +HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) +ANY_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) + ifneq ($(CONFIG_DRIVER_11N_SUPPORT),) HOSTAPD_IEEE80211N:=y endif @@ -78,29 +97,31 @@ DRIVER_MAKEOPTS= \ CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \ CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \ +space := +space += + ifeq ($(LOCAL_VARIANT),full) DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT) endif ifneq ($(LOCAL_TYPE),hostapd) - ifdef CONFIG_WPA_SUPPLICANT_OPENSSL - ifeq ($(LOCAL_VARIANT),full) + ifeq ($(LOCAL_VARIANT),full) + ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_TLS=openssl TARGET_LDFLAGS += -lcrypto -lssl endif - endif - ifdef CONFIG_WPA_SUPPLICANT_WOLFSSL - ifeq ($(LOCAL_VARIANT),full) + ifeq ($(SSL_VARIANT),wolfssl) DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 TARGET_LDFLAGS += -lwolfssl endif endif ifeq ($(LOCAL_VARIANT),mesh) - ifndef CONFIG_WPA_SUPPLICANT_WOLFSSL + ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y TARGET_LDFLAGS += -lcrypto -lssl - else + endif + ifeq ($(SSL_VARIANT),wolfssl) DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y TARGET_LDFLAGS += -lwolfssl endif @@ -134,8 +155,25 @@ endef define Package/hostapd $(call Package/hostapd/Default) TITLE+= (full) - VARIANT:=full - CONFLICTS:=wpad wpad-mini wpad-mesh + VARIANT:=full-internal +endef + +define Package/hostapd-openssl +$(call Package/hostapd/Default) + TITLE+= (full) + VARIANT:=full-openssl + DEPENDS+=+libopenssl + CONFLICTS:=$(filter-out hostapd-openssl ,$(HOSTAPD_ONLY_PROVIDERS)) + PROVIDES:=hostapd +endef + +define Package/hostapd-wolfssl +$(call Package/hostapd/Default) + TITLE+= (full) + VARIANT:=full-wolfssl + DEPENDS+=+libwolfssl + CONFLICTS:=$(filter-out hostapd-openssl ,$(filter-out hostapd-wolfssl ,$(HOSTAPD_ONLY_PROVIDERS))) + PROVIDES:=hostapd endef define Package/hostapd/description @@ -143,21 +181,26 @@ define Package/hostapd/description Authenticator. endef +Package/hostapd-openssl/description = $(Package/hostapd/description) +Package/hostapd-wolfssl/description = $(Package/hostapd/description) + define Package/hostapd-mini $(call Package/hostapd/Default) TITLE+= (WPA-PSK only) VARIANT:=mini - CONFLICTS:=wpad wpad-mini wpad-mesh + CONFLICTS:=$(filter-out hostapd-wolfssl ,$(filter-out hostapd-openssl ,$(filter-out hostapd-mini ,$(HOSTAPD_ONLY_PROVIDERS)))) + PROVIDES:=hostapd endef define Package/hostapd-mini/description This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only). endef + define Package/hostapd-utils $(call Package/hostapd/Default) TITLE+= (utils) - DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mesh||PACKAGE_wpad-mini + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) endef define Package/hostapd-utils/description @@ -171,13 +214,36 @@ define Package/wpad/Default TITLE:=IEEE 802.1x Authenticator/Supplicant DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus URL:=http://hostap.epitest.fi/ + PROVIDES:=hostapd wpa-supplicant endef define Package/wpad $(call Package/wpad/Default) TITLE+= (full) - DEPENDS+=+WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl - VARIANT:=wpad-full + VARIANT:=wpad-full-internal +endef + +define Package/wpad-openssl +$(call Package/wpad/Default) + TITLE+= (full) + VARIANT:=wpad-full-openssl + DEPENDS+=+libopenssl + CONFLICTS:=$(filter-out wpad-mesh-wolfssl,\ + $(filter-out wpad-mesh-openssl ,\ + $(filter-out wpad-openssl ,\ + $(ANY_PROVIDERS)))) +endef + +define Package/wpad-wolfssl +$(call Package/wpad/Default) + TITLE+= (full) + VARIANT:=wpad-full-wolfssl + DEPENDS+=+libwolfssl + CONFLICTS:=$(filter-out wpad-mesh-wolfssl ,\ + $(filter-out wpad-mesh-openssl ,\ + $(filter-out wpad-openssl ,\ + $(filter-out wpad-wolfssl ,\ + $(ANY_PROVIDERS))))) endef define Package/wpad/description @@ -185,6 +251,9 @@ define Package/wpad/description Authenticator and Supplicant endef +Package/wpad-openssl/description = $(Package/wpad/description) +Package/wpad-wolfssl/description = $(Package/wpad/description) + define Package/wpad-mini $(call Package/wpad/Default) TITLE+= (WPA-PSK only) @@ -195,25 +264,59 @@ define Package/wpad-mini/description This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only). endef -define Package/wpad-mesh +define Package/wpad-mesh-openssl +$(call Package/wpad/Default) + TITLE+= (with 802.11s mesh and SAE support) + DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) +libopenssl + VARIANT:=wpad-mesh-openssl + CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(ANY_PROVIDERS)) + PROVIDES+=wpa-supplicant-mesh wpad-mesh +endef + +define Package/wpad-mesh-wolfssl $(call Package/wpad/Default) TITLE+= (with 802.11s mesh and SAE support) - DEPENDS:=$(DRV_DEPENDS) +libubus +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_INTERNAL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) - VARIANT:=wpad-mesh + DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) +libwolfssl + VARIANT:=wpad-mesh-wolfssl + CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(filter-out wpad-mesh-wolfssl ,$(ANY_PROVIDERS))) + PROVIDES+=wpa-supplicant-mesh wpad-mesh endef define Package/wpad-mesh/description This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support). endef -define Package/wpa-supplicant +Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description) +Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description) + +define Package/wpa-supplicant/Default SECTION:=net CATEGORY:=Network TITLE:=WPA Supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl - CONFLICTS:=wpad wpad-mini wpad-mesh - VARIANT:=supplicant-full + DEPENDS:=$(DRV_DEPENDS) +endef + +define Package/wpa-supplicant + $(Package/wpa-supplicant/Default) + CONFLICTS:=$(filter-out wpa-supplicant ,$(SUPPLICANT_ONLY_PROVIDERS)) + VARIANT:=supplicant-full-internal +endef + +define Package/wpa-supplicant-openssl + $(Package/wpa-supplicant/Default) + CONFLICTS:=$(filter-out wpa-supplicant-openssl ,$(SUPPLICANT_ONLY_PROVIDERS)) + VARIANT:=supplicant-full-openssl + DEPENDS+=+libopenssl + PROVIDES:=wpa-supplicant +endef + +define Package/wpa-supplicant-wolfssl + $(Package/wpa-supplicant/Default) + CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,$(SUPPLICANT_ONLY_PROVIDERS)) + VARIANT:=supplicant-full-wolfssl + DEPENDS+=+libwolfssl + PROVIDES:=wpa-supplicant endef define Package/wpa-supplicant/config @@ -224,30 +327,45 @@ define Package/wpa-supplicant-p2p $(Package/wpa-supplicant) TITLE:=WPA Supplicant (with Wi-Fi P2P support) DEPENDS:=$(DRV_DEPENDS) @PACKAGE_kmod-cfg80211 - CONFLICTS:=wpad wpad-mini wpad-mesh - VARIANT:=supplicant-p2p + CONFLICTS:=$(filter-out wpa-supplicant-p2p ,$(SUPPLICANT_ONLY_PROVIDERS)) + VARIANT:=supplicant-p2p-internal + PROVIDES:=wpa-supplicant endef -define Package/wpa-supplicant-mesh +define Package/wpa-supplicant-mesh/Default $(Package/wpa-supplicant) TITLE:=WPA Supplicant (with 802.11s and SAE) - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_INTERNAL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) - CONFLICTS:=wpad wpad-mesh wpad-mesh - VARIANT:=supplicant-mesh + DEPENDS:=$(DRV_DEPENDS) @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) + PROVIDES:=wpa-supplicant wpa-supplicant-mesh +endef + +define Package/wpa-supplicant-mesh-openssl + $(Package/wpa-supplicant-mesh/Default) + VARIANT:=supplicant-mesh-openssl + CONFLICTS:=$(filter-out wpa-supplicant-mesh-openssl ,$(SUPPLICANT_ONLY_PROVIDERS)) + DEPENDS+=+libopenssl +endef + +define Package/wpa-supplicant-mesh-wolfssl + $(Package/wpa-supplicant-mesh/Default) + VARIANT:=supplicant-mesh-wolfssl + CONFLICTS:=$(filter-out wpa-supplicant-mesh-openssl ,$(filter-out wpa-supplicant-mesh-wolfssl ,$(SUPPLICANT_ONLY_PROVIDERS))) + DEPENDS+=+libwolfssl endef define Package/wpa-supplicant-mini $(Package/wpa-supplicant) TITLE:=WPA Supplicant (minimal version) DEPENDS:=$(DRV_DEPENDS) - CONFLICTS:=wpad wpad-mini wpad-mesh + CONFLICTS:=$(filter-out wpa-supplicant-mini ,$(SUPPLICANT_ONLY_PROVIDERS)) VARIANT:=supplicant-mini + PROVIDES:=wpa-supplicant endef define Package/wpa-cli SECTION:=net CATEGORY:=Network - DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpa-supplicant-p2p||PACKAGE_wpad-mini||PACKAGE_wpad||PACKAGE_wpad-mesh + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) TITLE:=WPA Supplicant command line control utility endef @@ -261,8 +379,26 @@ define Package/eapol-test TITLE:=802.1x authentication test utility SECTION:=net CATEGORY:=Network - VARIANT:=supplicant-full - DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +WPA_SUPPLICANT_WOLFSSL:libwolfssl + VARIANT:=supplicant-full-internal + DEPENDS:=$(DRV_DEPENDS) +endef + +define Package/eapol-test-openssl + TITLE:=802.1x authentication test utility + SECTION:=net + CATEGORY:=Network + VARIANT:=supplicant-full-openssl + CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS)) + DEPENDS:=$(DRV_DEPENDS) +libopenssl +endef + +define Package/eapol-test-wolfssl + TITLE:=802.1x authentication test utility + SECTION:=net + CATEGORY:=Network + VARIANT:=supplicant-full-wolfssl + CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS))) + DEPENDS:=$(DRV_DEPENDS) +libwolfssl endef @@ -350,7 +486,19 @@ define Build/Compile/supplicant ) endef -define Build/Compile/supplicant-full +define Build/Compile/supplicant-full-internal + +$(call Build/RunMake,wpa_supplicant, \ + eapol_test \ + ) +endef + +define Build/Compile/supplicant-full-openssl + +$(call Build/RunMake,wpa_supplicant, \ + eapol_test \ + ) +endef + +define Build/Compile/supplicant-full-wolfssl +$(call Build/RunMake,wpa_supplicant, \ eapol_test \ ) @@ -379,6 +527,8 @@ define Package/hostapd/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/ endef Package/hostapd-mini/install = $(Package/hostapd/install) +Package/hostapd-openssl/install = $(Package/hostapd/install) +Package/hostapd-wolfssl/install = $(Package/hostapd/install) ifneq ($(LOCAL_TYPE),supplicant) define Package/hostapd-utils/install @@ -396,7 +546,10 @@ define Package/wpad/install $(LN) wpad $(1)/usr/sbin/wpa_supplicant endef Package/wpad-mini/install = $(Package/wpad/install) -Package/wpad-mesh/install = $(Package/wpad/install) +Package/wpad-openssl/install = $(Package/wpad/install) +Package/wpad-wolfssl/install = $(Package/wpad/install) +Package/wpad-mesh-openssl/install = $(Package/wpad/install) +Package/wpad-mesh-wolfssl/install = $(Package/wpad/install) define Package/wpa-supplicant/install $(call Install/supplicant,$(1)) @@ -404,7 +557,10 @@ define Package/wpa-supplicant/install endef Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install) -Package/wpa-supplicant-mesh/install = $(Package/wpa-supplicant/install) +Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install) +Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install) +Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install) +Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install) ifneq ($(LOCAL_TYPE),hostapd) define Package/wpa-cli/install @@ -413,23 +569,47 @@ ifneq ($(LOCAL_TYPE),hostapd) endef endif -ifeq ($(BUILD_VARIANT),supplicant-full) +ifeq ($(BUILD_VARIANT),supplicant-full-internal) define Package/eapol-test/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/ endef endif +ifeq ($(BUILD_VARIANT),supplicant-full-openssl) + define Package/eapol-test-openssl/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/ + endef +endif + +ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl) + define Package/eapol-test-wolfssl/install + $(INSTALL_DIR) $(1)/usr/sbin + $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/ + endef +endif + $(eval $(call BuildPackage,hostapd)) $(eval $(call BuildPackage,hostapd-mini)) +$(eval $(call BuildPackage,hostapd-openssl)) +$(eval $(call BuildPackage,hostapd-wolfssl)) $(eval $(call BuildPackage,wpad)) -$(eval $(call BuildPackage,wpad-mesh)) +$(eval $(call BuildPackage,wpad-mesh-openssl)) +$(eval $(call BuildPackage,wpad-mesh-wolfssl)) $(eval $(call BuildPackage,wpad-mini)) +$(eval $(call BuildPackage,wpad-openssl)) +$(eval $(call BuildPackage,wpad-wolfssl)) $(eval $(call BuildPackage,wpa-supplicant)) -$(eval $(call BuildPackage,wpa-supplicant-mesh)) +$(eval $(call BuildPackage,wpa-supplicant-mesh-openssl)) +$(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl)) $(eval $(call BuildPackage,wpa-supplicant-mini)) $(eval $(call BuildPackage,wpa-supplicant-p2p)) +$(eval $(call BuildPackage,wpa-supplicant-openssl)) +$(eval $(call BuildPackage,wpa-supplicant-wolfssl)) $(eval $(call BuildPackage,wpa-cli)) $(eval $(call BuildPackage,hostapd-utils)) $(eval $(call BuildPackage,hostapd-common)) $(eval $(call BuildPackage,eapol-test)) +$(eval $(call BuildPackage,eapol-test-openssl)) +$(eval $(call BuildPackage,eapol-test-wolfssl)) From 000a3fef0ad9c0f0bcea0a9981c7700d66a97ab8 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 31 May 2018 00:10:49 +0200 Subject: [PATCH 128/399] hostapd: update packaging and patches Clean up conflicts/provides/depends hell and add PROVIDES for eapol-test variants while at it. Update mesh-DFS patchset from Peter Oh to v5 (with local fixes) which allows to drop two revert-patches for upstream commits which previously were necessary to un-break mesh-DFS support. Signed-off-by: Daniel Golle (backported from 78f1974bc565d7544589a49ad8efd92c4ddec5b3) (rebased patches) Signed-off-by: Jo-Philipp Wich --- package/network/services/hostapd/Config.in | 12 +- package/network/services/hostapd/Makefile | 77 +++++--- ...icant-Increase-authentication-timeou.patch | 185 ------------------ ...icant-Rename-wpas_event_-to-wpas_ap_.patch | 132 ------------- ...1-mesh-factor-out-mesh-join-function.patch | 6 +- ...2-mesh-factor-out-rsn-initialization.patch | 6 +- .../003-mesh-relocate-RSN-init-function.patch | 6 +- ...ompletion-callback-to-complete-mesh-.patch | 6 +- ...ountry-setting-to-mesh-configuration.patch | 12 +- ...rnel-driver-DFS-handler-in-userspace.patch | 6 +- ...annel-attributes-before-running-Mesh.patch | 6 +- ...ce-type-to-mesh-before-setting-inter.patch | 6 +- .../009-mesh-set-mesh-center-frequency.patch | 6 +- ...-mesh-interface-on-dfs-event-handler.patch | 68 +++++-- ...hannels-to-be-selected-if-dfs-is-ena.patch | 10 +- ...-mesh-to-send-channel-switch-request.patch | 6 +- ...-do-not-allow-pri-sec-channel-switch.patch | 6 +- ...ot-allow-scan-result-to-swap-pri-sec.patch | 2 +- ...sh-do-not-use-offchan-mgmt-tx-on-DFS.patch | 20 +- ...-fix-channel-switch-error-during-CAC.patch | 64 ++++++ ...nterface-context-to-send-DFS-event-m.patch | 107 ++++++++++ ...8-mesh-make-forwarding-configurable.patch} | 8 +- ...x-crash-with-CONFIG_TAXONOMY-enabled.patch | 2 +- ...CHANWIDTH_USE_HT-to-max_oper_chwidth.patch | 2 +- ...ent-use-of-VHT20-config-in-mesh-mode.patch | 8 +- .../hostapd/patches/110-no_eapol_fix.patch | 2 +- .../hostapd/patches/200-multicall.patch | 10 +- .../hostapd/patches/301-mesh-noscan.patch | 6 +- .../patches/310-rescan_immediately.patch | 2 +- .../patches/350-nl80211_del_beacon_bss.patch | 4 +- .../hostapd/patches/370-ap_sta_support.patch | 8 +- ...dd-new-config-params-to-be-used-with.patch | 2 +- .../patches/463-add-mcast_rate-to-11s.patch | 6 +- .../patches/464-fix-mesh-obss-check.patch | 2 +- 34 files changed, 366 insertions(+), 445 deletions(-) delete mode 100644 package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch delete mode 100644 package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch create mode 100644 package/network/services/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch create mode 100644 package/network/services/hostapd/patches/017-mesh-use-right-interface-context-to-send-DFS-event-m.patch rename package/network/services/hostapd/patches/{016-mesh-make-forwarding-configurable.patch => 018-mesh-make-forwarding-configurable.patch} (96%) diff --git a/package/network/services/hostapd/Config.in b/package/network/services/hostapd/Config.in index 3568d9add3c..222cfb7f131 100644 --- a/package/network/services/hostapd/Config.in +++ b/package/network/services/hostapd/Config.in @@ -4,8 +4,10 @@ config WPA_SUPPLICANT_NO_TIMESTAMP_CHECK depends on PACKAGE_wpa-supplicant || \ PACKAGE_wpa-supplicant-openssl || \ PACKAGE_wpa-supplicant-wolfssl || \ - PACKAGE_wpa-supplicant-mesh || \ + PACKAGE_wpa-supplicant-mesh-openssl || \ + PACKAGE_wpa-supplicant-mesh-wolfssl || \ PACKAGE_wpa-supplicant-mini || \ + PACKAGE_wpa-supplicant-p2p || \ PACKAGE_wpad || \ PACKAGE_wpad-openssl || \ PACKAGE_wpad-wolfssl || \ @@ -22,8 +24,10 @@ config WPA_RFKILL_SUPPORT depends on PACKAGE_wpa-supplicant || \ PACKAGE_wpa-supplicant-openssl || \ PACKAGE_wpa-supplicant-wolfssl || \ - PACKAGE_wpa-supplicant-mesh || \ + PACKAGE_wpa-supplicant-mesh-openssl || \ + PACKAGE_wpa-supplicant-mesh-wolfssl || \ PACKAGE_wpa-supplicant-mini || \ + PACKAGE_wpa-supplicant-p2p || \ PACKAGE_wpad || \ PACKAGE_wpad-openssl || \ PACKAGE_wpad-wolfssl || \ @@ -37,8 +41,10 @@ config WPA_MSG_MIN_PRIORITY depends on PACKAGE_wpa-supplicant || \ PACKAGE_wpa-supplicant-openssl || \ PACKAGE_wpa-supplicant-wolfssl || \ - PACKAGE_wpa-supplicant-mesh || \ + PACKAGE_wpa-supplicant-mesh-openssl || \ + PACKAGE_wpa-supplicant-mesh-wolfssl || \ PACKAGE_wpa-supplicant-mini || \ + PACKAGE_wpa-supplicant-p2p || \ PACKAGE_wpad || \ PACKAGE_wpad-openssl || \ PACKAGE_wpad-wolfssl || \ diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 45d1883e95b..56d064c73b5 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -32,6 +32,23 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_DRIVER_11N_SUPPORT \ CONFIG_DRIVER_11AC_SUPPORT \ +WPAD_PROVIDERS:=wpad-mini wpad wpad-openssl wpad-wolfssl \ + wpad-mesh-openssl wpad-mesh-wolfssl + +SUPPLICANT_ONLY_PROVIDERS:=wpa-supplicant-mini wpa-supplicant-p2p \ + wpa-supplicant wpa-supplicant-openssl wpa-supplicant-wolfssl \ + wpa-supplicant-mesh-openssl wpa-supplicant-mesh-wolfssl + +HOSTAPD_ONLY_PROVIDERS:=hostapd-mini hostapd hostapd-openssl hostapd-wolfssl + +EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl + +SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) +HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) +ANY_SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) +ANY_HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) +ANY_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) + LOCAL_TYPE=$(strip \ $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \ $(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \ @@ -67,20 +84,6 @@ include $(INCLUDE_DIR)/package.mk STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY) -WPAD_PROVIDERS:=wpad-mini wpad wpad-openssl wpad-wolfssl \ - wpad-mesh-openssl wpad-mesh-wolfssl - -SUPPLICANT_ONLY_PROVIDERS:=wpa_supplicant-mini wpa_supplicant-p2p \ - wpa_supplicant wpa_supplicant-openssl wpa_supplicant-wolfssl \ - wpa_supplicant-mesh-openssl wpa_supplicant-mesh-wolfssl - -HOSTAPD_ONLY_PROVIDERS:=hostapd-mini hostapd hostapd-openssl hostapd-wolfssl - -EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl - -SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) -HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) -ANY_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) ifneq ($(CONFIG_DRIVER_11N_SUPPORT),) HOSTAPD_IEEE80211N:=y @@ -200,7 +203,7 @@ endef define Package/hostapd-utils $(call Package/hostapd/Default) TITLE+= (utils) - DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(ANY_HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) endef define Package/hostapd-utils/description @@ -221,6 +224,14 @@ define Package/wpad $(call Package/wpad/Default) TITLE+= (full) VARIANT:=wpad-full-internal + CONFLICTS:=$(filter-out wpad-mesh-wolfssl,\ + $(filter-out wpad-mesh-openssl ,\ + $(filter-out wpad-openssl ,\ + $(filter-out wpad-wolfssl ,\ + $(filter-out wpad-wolfssl ,\ + $(filter-out wpad ,\ + $(ANY_PROVIDERS)\ + )))))) endef define Package/wpad-openssl @@ -258,6 +269,7 @@ define Package/wpad-mini $(call Package/wpad/Default) TITLE+= (WPA-PSK only) VARIANT:=wpad-mini + CONFLICTS:=$(SUPPLICANT_ONLY_PROVIDERS) endef define Package/wpad-mini/description @@ -299,13 +311,18 @@ endef define Package/wpa-supplicant $(Package/wpa-supplicant/Default) - CONFLICTS:=$(filter-out wpa-supplicant ,$(SUPPLICANT_ONLY_PROVIDERS)) VARIANT:=supplicant-full-internal + CONFLICTS:=wpa-supplicant-mini endef define Package/wpa-supplicant-openssl $(Package/wpa-supplicant/Default) - CONFLICTS:=$(filter-out wpa-supplicant-openssl ,$(SUPPLICANT_ONLY_PROVIDERS)) + CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,\ + $(filter-out wpa-supplicant-openssl ,\ + $(filter-out wpa-supplicant-mesh-openssl ,\ + $(filter-out wpa-supplicant-mesh-wolfssl ,\ + $(SUPPLICANT_ONLY_PROVIDERS)\ + )))) VARIANT:=supplicant-full-openssl DEPENDS+=+libopenssl PROVIDES:=wpa-supplicant @@ -313,7 +330,12 @@ endef define Package/wpa-supplicant-wolfssl $(Package/wpa-supplicant/Default) - CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,$(SUPPLICANT_ONLY_PROVIDERS)) + CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,\ + $(filter-out wpa-supplicant-openssl ,\ + $(filter-out wpa-supplicant-mesh-openssl ,\ + $(filter-out wpa-supplicant-mesh-wolfssl ,\ + $(SUPPLICANT_ONLY_PROVIDERS)\ + )))) VARIANT:=supplicant-full-wolfssl DEPENDS+=+libwolfssl PROVIDES:=wpa-supplicant @@ -327,13 +349,19 @@ define Package/wpa-supplicant-p2p $(Package/wpa-supplicant) TITLE:=WPA Supplicant (with Wi-Fi P2P support) DEPENDS:=$(DRV_DEPENDS) @PACKAGE_kmod-cfg80211 - CONFLICTS:=$(filter-out wpa-supplicant-p2p ,$(SUPPLICANT_ONLY_PROVIDERS)) + CONFLICTS:=$(filter-out wpa-supplicant-openssl ,\ + $(filter-out wpa-supplicant-wolfssl ,\ + $(filter-out wpa-supplicant-p2p ,\ + $(filter-out wpa-supplicant-mesh-openssl ,\ + $(filter-out wpa-supplicant-mesh-wolfssl ,\ + $(SUPPLICANT_ONLY_PROVIDERS)\ + ))))) VARIANT:=supplicant-p2p-internal PROVIDES:=wpa-supplicant endef define Package/wpa-supplicant-mesh/Default - $(Package/wpa-supplicant) + $(Package/wpa-supplicant/Default) TITLE:=WPA Supplicant (with 802.11s and SAE) DEPENDS:=$(DRV_DEPENDS) @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) PROVIDES:=wpa-supplicant wpa-supplicant-mesh @@ -354,10 +382,9 @@ define Package/wpa-supplicant-mesh-wolfssl endef define Package/wpa-supplicant-mini - $(Package/wpa-supplicant) + $(Package/wpa-supplicant/Default) TITLE:=WPA Supplicant (minimal version) DEPENDS:=$(DRV_DEPENDS) - CONFLICTS:=$(filter-out wpa-supplicant-mini ,$(SUPPLICANT_ONLY_PROVIDERS)) VARIANT:=supplicant-mini PROVIDES:=wpa-supplicant endef @@ -365,7 +392,7 @@ endef define Package/wpa-cli SECTION:=net CATEGORY:=Network - DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(ANY_SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) TITLE:=WPA Supplicant command line control utility endef @@ -390,6 +417,7 @@ define Package/eapol-test-openssl VARIANT:=supplicant-full-openssl CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS)) DEPENDS:=$(DRV_DEPENDS) +libopenssl + PROVIDES:=eapol-test endef define Package/eapol-test-wolfssl @@ -399,6 +427,7 @@ define Package/eapol-test-wolfssl VARIANT:=supplicant-full-wolfssl CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS))) DEPENDS:=$(DRV_DEPENDS) +libwolfssl + PROVIDES:=eapol-test endef diff --git a/package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch b/package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch deleted file mode 100644 index 8d9cd456d57..00000000000 --- a/package/network/services/hostapd/patches/0001-Revert-wpa_supplicant-Increase-authentication-timeou.patch +++ /dev/null @@ -1,185 +0,0 @@ -From 8a6a7112e5b1391018531f6b6c317f8870e0fcb6 Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Thu, 3 May 2018 13:12:28 +0200 -Subject: [PATCH 1/2] Revert "wpa_supplicant: Increase authentication timeout - if CAC is started" - -This reverts commit 37547ad63c9df61ce6899675028594da2527efef. ---- - wpa_supplicant/events.c | 95 ++++--------------------------- - wpa_supplicant/wpa_supplicant.c | 20 ------- - wpa_supplicant/wpa_supplicant_i.h | 3 - - 3 files changed, 10 insertions(+), 108 deletions(-) - ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -3776,81 +3776,6 @@ static void wpa_supplicant_event_port_au - } - - --static unsigned int wpas_event_cac_ms(const struct wpa_supplicant *wpa_s, -- int freq) --{ -- size_t i; -- int j; -- -- for (i = 0; i < wpa_s->hw.num_modes; i++) { -- const struct hostapd_hw_modes *mode = &wpa_s->hw.modes[i]; -- -- for (j = 0; j < mode->num_channels; j++) { -- const struct hostapd_channel_data *chan; -- -- chan = &mode->channels[j]; -- if (chan->freq == freq) -- return chan->dfs_cac_ms; -- } -- } -- -- return 0; --} -- -- --static void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) --{ --#if defined(NEED_AP_MLME) && defined(CONFIG_AP) -- if (wpa_s->ap_iface) { -- wpas_ap_event_dfs_cac_started(wpa_s, radar); -- } else --#endif /* NEED_AP_MLME && CONFIG_AP */ -- { -- unsigned int cac_time = wpas_event_cac_ms(wpa_s, radar->freq); -- -- cac_time /= 1000; /* convert from ms to sec */ -- if (!cac_time) -- cac_time = 10 * 60; /* max timeout: 10 minutes */ -- -- /* Restart auth timeout: CAC time added to initial timeout */ -- wpas_auth_timeout_restart(wpa_s, cac_time); -- } --} -- -- --static void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) --{ --#if defined(NEED_AP_MLME) && defined(CONFIG_AP) -- if (wpa_s->ap_iface) { -- wpas_ap_event_dfs_cac_finished(wpa_s, radar); -- } else --#endif /* NEED_AP_MLME && CONFIG_AP */ -- { -- /* Restart auth timeout with original value after CAC is -- * finished */ -- wpas_auth_timeout_restart(wpa_s, 0); -- } --} -- -- --static void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) --{ --#if defined(NEED_AP_MLME) && defined(CONFIG_AP) -- if (wpa_s->ap_iface) { -- wpas_ap_event_dfs_cac_aborted(wpa_s, radar); -- } else --#endif /* NEED_AP_MLME && CONFIG_AP */ -- { -- /* Restart auth timeout with original value after CAC is -- * aborted */ -- wpas_auth_timeout_restart(wpa_s, 0); -- } --} -- -- - static void wpa_supplicant_event_assoc_auth(struct wpa_supplicant *wpa_s, - union wpa_event_data *data) - { -@@ -4298,25 +4223,25 @@ void wpa_supplicant_event(void *ctx, enu - wpas_ap_event_dfs_radar_detected(wpa_s, - &data->dfs_event); - break; -- case EVENT_DFS_NOP_FINISHED: -- if (data) -- wpas_ap_event_dfs_cac_nop_finished(wpa_s, -- &data->dfs_event); -- break; --#endif /* NEED_AP_MLME */ --#endif /* CONFIG_AP */ - case EVENT_DFS_CAC_STARTED: - if (data) -- wpas_event_dfs_cac_started(wpa_s, &data->dfs_event); -+ wpas_ap_event_dfs_cac_started(wpa_s, &data->dfs_event); - break; - case EVENT_DFS_CAC_FINISHED: - if (data) -- wpas_event_dfs_cac_finished(wpa_s, &data->dfs_event); -+ wpas_ap_event_dfs_cac_finished(wpa_s, &data->dfs_event); - break; - case EVENT_DFS_CAC_ABORTED: - if (data) -- wpas_event_dfs_cac_aborted(wpa_s, &data->dfs_event); -+ wpas_ap_event_dfs_cac_aborted(wpa_s, &data->dfs_event); -+ break; -+ case EVENT_DFS_NOP_FINISHED: -+ if (data) -+ wpas_ap_event_dfs_cac_nop_finished(wpa_s, -+ &data->dfs_event); - break; -+#endif /* NEED_AP_MLME */ -+#endif /* CONFIG_AP */ - case EVENT_RX_MGMT: { - u16 fc, stype; - const struct ieee80211_mgmt *mgmt; ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -243,30 +243,10 @@ void wpa_supplicant_req_auth_timeout(str - wpa_dbg(wpa_s, MSG_DEBUG, "Setting authentication timeout: %d sec " - "%d usec", sec, usec); - eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL); -- wpa_s->last_auth_timeout_sec = sec; - eloop_register_timeout(sec, usec, wpa_supplicant_timeout, wpa_s, NULL); - } - - --/* -- * wpas_auth_timeout_restart - Restart and change timeout for authentication -- * @wpa_s: Pointer to wpa_supplicant data -- * @sec_diff: difference in seconds applied to original timeout value -- */ --void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff) --{ -- int new_sec = wpa_s->last_auth_timeout_sec + sec_diff; -- -- if (eloop_is_timeout_registered(wpa_supplicant_timeout, wpa_s, NULL)) { -- wpa_dbg(wpa_s, MSG_DEBUG, -- "Authentication timeout restart: %d sec", new_sec); -- eloop_cancel_timeout(wpa_supplicant_timeout, wpa_s, NULL); -- eloop_register_timeout(new_sec, 0, wpa_supplicant_timeout, -- wpa_s, NULL); -- } --} -- -- - /** - * wpa_supplicant_cancel_auth_timeout - Cancel authentication timeout - * @wpa_s: Pointer to wpa_supplicant data ---- a/wpa_supplicant/wpa_supplicant_i.h -+++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -1182,8 +1182,6 @@ struct wpa_supplicant { - /* RIC elements for FT protocol */ - struct wpabuf *ric_ies; - -- int last_auth_timeout_sec; -- - #ifdef CONFIG_DPP - struct dl_list dpp_bootstrap; /* struct dpp_bootstrap_info */ - struct dl_list dpp_configurator; /* struct dpp_configurator */ -@@ -1258,7 +1256,6 @@ void wpa_supplicant_initiate_eapol(struc - void wpa_clear_keys(struct wpa_supplicant *wpa_s, const u8 *addr); - void wpa_supplicant_req_auth_timeout(struct wpa_supplicant *wpa_s, - int sec, int usec); --void wpas_auth_timeout_restart(struct wpa_supplicant *wpa_s, int sec_diff); - void wpa_supplicant_reinit_autoscan(struct wpa_supplicant *wpa_s); - void wpa_supplicant_set_state(struct wpa_supplicant *wpa_s, - enum wpa_states state); diff --git a/package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch b/package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch deleted file mode 100644 index 281bb5bba43..00000000000 --- a/package/network/services/hostapd/patches/0002-Revert-wpa_supplicant-Rename-wpas_event_-to-wpas_ap_.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 0d4900ccd1c7ec5c5ffecf5040f9c07a6a32deef Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Thu, 3 May 2018 13:12:35 +0200 -Subject: [PATCH 2/2] Revert "wpa_supplicant: Rename wpas_event_*() to - wpas_ap_event_*()" - -This reverts commit 2dd5fbbff884af488870a37e339b4817c83954de. ---- - wpa_supplicant/ap.c | 20 ++++++++++---------- - wpa_supplicant/ap.h | 18 +++++++++--------- - wpa_supplicant/events.c | 13 ++++++------- - 3 files changed, 25 insertions(+), 26 deletions(-) - ---- a/wpa_supplicant/ap.c -+++ b/wpa_supplicant/ap.c -@@ -1537,8 +1537,8 @@ int wpas_ap_pmksa_cache_add_external(str - - - #ifdef NEED_AP_MLME --void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) -+void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar) - { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; -@@ -1550,8 +1550,8 @@ void wpas_ap_event_dfs_radar_detected(st - } - - --void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) -+void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar) - { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; -@@ -1562,8 +1562,8 @@ void wpas_ap_event_dfs_cac_started(struc - } - - --void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) -+void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar) - { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; -@@ -1574,8 +1574,8 @@ void wpas_ap_event_dfs_cac_finished(stru - } - - --void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) -+void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar) - { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; -@@ -1586,8 +1586,8 @@ void wpas_ap_event_dfs_cac_aborted(struc - } - - --void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar) -+void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar) - { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; ---- a/wpa_supplicant/ap.h -+++ b/wpa_supplicant/ap.h -@@ -89,16 +89,16 @@ int wpas_ap_pmksa_cache_list_mesh(struct - char *buf, size_t len); - int wpas_ap_pmksa_cache_add_external(struct wpa_supplicant *wpa_s, char *cmd); - --void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar); --void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s, -+void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, - struct dfs_event *radar); --void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar); --void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar); --void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, -- struct dfs_event *radar); -+void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar); -+void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar); -+void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar); -+void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, -+ struct dfs_event *radar); - - void ap_periodic(struct wpa_supplicant *wpa_s); - ---- a/wpa_supplicant/events.c -+++ b/wpa_supplicant/events.c -@@ -4220,25 +4220,24 @@ void wpa_supplicant_event(void *ctx, enu - #ifdef NEED_AP_MLME - case EVENT_DFS_RADAR_DETECTED: - if (data) -- wpas_ap_event_dfs_radar_detected(wpa_s, -- &data->dfs_event); -+ wpas_event_dfs_radar_detected(wpa_s, &data->dfs_event); - break; - case EVENT_DFS_CAC_STARTED: - if (data) -- wpas_ap_event_dfs_cac_started(wpa_s, &data->dfs_event); -+ wpas_event_dfs_cac_started(wpa_s, &data->dfs_event); - break; - case EVENT_DFS_CAC_FINISHED: - if (data) -- wpas_ap_event_dfs_cac_finished(wpa_s, &data->dfs_event); -+ wpas_event_dfs_cac_finished(wpa_s, &data->dfs_event); - break; - case EVENT_DFS_CAC_ABORTED: - if (data) -- wpas_ap_event_dfs_cac_aborted(wpa_s, &data->dfs_event); -+ wpas_event_dfs_cac_aborted(wpa_s, &data->dfs_event); - break; - case EVENT_DFS_NOP_FINISHED: - if (data) -- wpas_ap_event_dfs_cac_nop_finished(wpa_s, -- &data->dfs_event); -+ wpas_event_dfs_cac_nop_finished(wpa_s, -+ &data->dfs_event); - break; - #endif /* NEED_AP_MLME */ - #endif /* CONFIG_AP */ diff --git a/package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch b/package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch index 72c3c75ae96..a1d668b283d 100644 --- a/package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch +++ b/package/network/services/hostapd/patches/001-mesh-factor-out-mesh-join-function.patch @@ -1,7 +1,7 @@ -From 032e70833de4b251fc4a159b2cc4ef28d0f1df0d Mon Sep 17 00:00:00 2001 +From 02ae4382f45f772e3630460459eb4e5af64e71b4 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:54:58 -0700 -Subject: [PATCH 01/16] mesh: factor out mesh join function +Date: Tue, 29 May 2018 14:39:05 -0700 +Subject: [PATCH 01/18] mesh: factor out mesh join function mesh join function consitss of 2 parts which are preparing configurations and sending join event to driver. diff --git a/package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch b/package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch index ad2ab91fe33..26e872d7650 100644 --- a/package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch +++ b/package/network/services/hostapd/patches/002-mesh-factor-out-rsn-initialization.patch @@ -1,7 +1,7 @@ -From 6da64b1e056e0b1be18b6ab37c820acb4a0f3cf4 Mon Sep 17 00:00:00 2001 +From 89db76eeff6502dfa39b011962ec9d560ed4c2ee Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:54:59 -0700 -Subject: [PATCH 02/16] mesh: factor out rsn initialization +Date: Tue, 29 May 2018 14:39:06 -0700 +Subject: [PATCH 02/18] mesh: factor out rsn initialization RSN initialization can be used in different phases if mesh initialization and mesh join don't happen diff --git a/package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch b/package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch index fa0605cfaf9..c96e8107698 100644 --- a/package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch +++ b/package/network/services/hostapd/patches/003-mesh-relocate-RSN-init-function.patch @@ -1,7 +1,7 @@ -From 95425b5becaeda8a515c942f417696e5df34bbc8 Mon Sep 17 00:00:00 2001 +From 07bad5f256cbe8a4b45d32c5b43b870ee815fb42 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:00 -0700 -Subject: [PATCH 03/16] mesh: relocate RSN init function +Date: Tue, 29 May 2018 14:39:07 -0700 +Subject: [PATCH 03/18] mesh: relocate RSN init function RSN init function should work together with mesh join when it's used. Since mesh join could be called at different stage diff --git a/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch b/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch index 73ab99e072c..3ce2848d02c 100644 --- a/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch +++ b/package/network/services/hostapd/patches/004-mesh-use-setup-completion-callback-to-complete-mesh-.patch @@ -1,7 +1,7 @@ -From 32044a7bb26858bedaf147c77f49f5cef1133de3 Mon Sep 17 00:00:00 2001 +From bd05de484bfa61def530d717c7234381f6b33cf7 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:01 -0700 -Subject: [PATCH 04/16] mesh: use setup completion callback to complete mesh +Date: Tue, 29 May 2018 14:39:08 -0700 +Subject: [PATCH 04/18] mesh: use setup completion callback to complete mesh join mesh join function is the last function to be called during diff --git a/package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch b/package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch index 6f7a968259c..a372230d073 100644 --- a/package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch +++ b/package/network/services/hostapd/patches/005-mesh-reflect-country-setting-to-mesh-configuration.patch @@ -1,7 +1,7 @@ -From e2f13b1fac9799db83a37fc57df9471d9bb5b711 Mon Sep 17 00:00:00 2001 +From dbe9afab3b2dceb35d478ac43dfcf8fdc5e23a22 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:02 -0700 -Subject: [PATCH 05/16] mesh: reflect country setting to mesh configuration +Date: Tue, 29 May 2018 14:39:09 -0700 +Subject: [PATCH 05/18] mesh: reflect country setting to mesh configuration wpa_supplicant configuration has country parameter that is supposed to be used in AP mode to indicate supporting 802.11h @@ -9,9 +9,11 @@ and 802.11d. Reflect this configuration to Mesh also since Mesh is required to support 802.11h and 802.11d to use DFS channels. Signed-off-by: Peter Oh +Signed-off-by: Daniel Golle +[daniel@makrotopia.org: adapted to changed ieee80211_is_dfs prototype] --- - wpa_supplicant/mesh.c | 8 ++++++++ - 1 file changed, 8 insertions(+) + wpa_supplicant/mesh.c | 9 +++++++++ + 1 file changed, 9 insertions(+) --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c diff --git a/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch b/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch index 0d956be2b37..fe2353cd815 100644 --- a/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch +++ b/package/network/services/hostapd/patches/006-mesh-inform-kernel-driver-DFS-handler-in-userspace.patch @@ -1,7 +1,7 @@ -From 37bf08621eee53f30b464be71876c02e235077ba Mon Sep 17 00:00:00 2001 +From 51e759da5026b3e64f801135b5d53f2198bbd2f0 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:03 -0700 -Subject: [PATCH 06/16] mesh: inform kernel driver DFS handler in userspace +Date: Tue, 29 May 2018 14:39:10 -0700 +Subject: [PATCH 06/18] mesh: inform kernel driver DFS handler in userspace NL80211_ATTR_HANDLE_DFS is required by kerenel space to enable DFS channels that indicates DFS handler diff --git a/package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch b/package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch index d8722c7cf91..de114953884 100644 --- a/package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch +++ b/package/network/services/hostapd/patches/007-mesh-apply-channel-attributes-before-running-Mesh.patch @@ -1,7 +1,7 @@ -From 8190aab3344ae9746c897093f88f3679239d135d Mon Sep 17 00:00:00 2001 +From bdc77efe681d5b88f3256e2bb6e706d4eaf09518 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:04 -0700 -Subject: [PATCH 07/16] mesh: apply channel attributes before running Mesh +Date: Tue, 29 May 2018 14:39:11 -0700 +Subject: [PATCH 07/18] mesh: apply channel attributes before running Mesh This helps mesh interface initializes with correct channel parameters. diff --git a/package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch b/package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch index ec6cadb223a..5b97691eb97 100644 --- a/package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch +++ b/package/network/services/hostapd/patches/008-mesh-set-interface-type-to-mesh-before-setting-inter.patch @@ -1,7 +1,7 @@ -From e001251cb5708c406d477eca6aa912e5692b17fe Mon Sep 17 00:00:00 2001 +From eb9888ba41faaeb8fd07392ad46808b7d894cc14 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:05 -0700 -Subject: [PATCH 08/16] mesh: set interface type to mesh before setting +Date: Tue, 29 May 2018 14:39:12 -0700 +Subject: [PATCH 08/18] mesh: set interface type to mesh before setting interface Correct interface type is required to start DFS CAC that can be diff --git a/package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch b/package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch index 2fbbc950ceb..1fca7452b0c 100644 --- a/package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch +++ b/package/network/services/hostapd/patches/009-mesh-set-mesh-center-frequency.patch @@ -1,7 +1,7 @@ -From 3cefd0bf495ad51a860b56281a8cae32bc4bd086 Mon Sep 17 00:00:00 2001 +From fa3af966032267e618b19bbf06a536ddb81ddbdf Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:06 -0700 -Subject: [PATCH 09/16] mesh: set mesh center frequency +Date: Tue, 29 May 2018 14:39:13 -0700 +Subject: [PATCH 09/18] mesh: set mesh center frequency vht center frequency value is required to compose the correct channel info. diff --git a/package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch b/package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch index e4711a8bdd1..3f5178a74ba 100644 --- a/package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch +++ b/package/network/services/hostapd/patches/010-mesh-consider-mesh-interface-on-dfs-event-handler.patch @@ -1,16 +1,17 @@ -From 90aa570a894a907d11f85ced43a248198e24acc1 Mon Sep 17 00:00:00 2001 +From 9a8ca54a264a2820af614043e7af853166b320b0 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:07 -0700 -Subject: [PATCH 10/16] mesh: consider mesh interface on dfs event handler +Date: Tue, 29 May 2018 14:39:14 -0700 +Subject: [PATCH 10/18] mesh: consider mesh interface on dfs event handler Once mesh starts supporting DFS channels, it has to handle DFS related events from drivers, hence add mesh interface to the check list. Signed-off-by: Peter Oh +Signed-off-by: Masashi Honma --- wpa_supplicant/ap.c | 71 ++++++++++++++++++++++++++++++----------- - wpa_supplicant/events.c | 1 + - 2 files changed, 54 insertions(+), 18 deletions(-) + wpa_supplicant/events.c | 7 ++-- + 2 files changed, 57 insertions(+), 21 deletions(-) --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -37,8 +38,8 @@ Signed-off-by: Peter Oh } @@ -1540,10 +1545,16 @@ int wpas_ap_pmksa_cache_add_external(str - void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, - struct dfs_event *radar) + void wpas_ap_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, + struct dfs_event *radar) { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; @@ -56,9 +57,9 @@ Signed-off-by: Peter Oh radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); -@@ -1553,10 +1564,16 @@ void wpas_event_dfs_radar_detected(struc - void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, - struct dfs_event *radar) +@@ -1553,10 +1564,16 @@ void wpas_ap_event_dfs_radar_detected(st + void wpas_ap_event_dfs_cac_started(struct wpa_supplicant *wpa_s, + struct dfs_event *radar) { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; @@ -76,9 +77,9 @@ Signed-off-by: Peter Oh radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); } -@@ -1565,10 +1582,16 @@ void wpas_event_dfs_cac_started(struct w - void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, - struct dfs_event *radar) +@@ -1565,10 +1582,16 @@ void wpas_ap_event_dfs_cac_started(struc + void wpas_ap_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, + struct dfs_event *radar) { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; @@ -96,9 +97,9 @@ Signed-off-by: Peter Oh radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); } -@@ -1577,10 +1600,16 @@ void wpas_event_dfs_cac_finished(struct - void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, - struct dfs_event *radar) +@@ -1577,10 +1600,16 @@ void wpas_ap_event_dfs_cac_finished(stru + void wpas_ap_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, + struct dfs_event *radar) { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; @@ -116,9 +117,9 @@ Signed-off-by: Peter Oh radar->ht_enabled, radar->chan_offset, radar->chan_width, radar->cf1, radar->cf2); } -@@ -1589,10 +1618,16 @@ void wpas_event_dfs_cac_aborted(struct w - void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, - struct dfs_event *radar) +@@ -1589,10 +1618,16 @@ void wpas_ap_event_dfs_cac_aborted(struc + void wpas_ap_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, + struct dfs_event *radar) { - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) - return; @@ -138,7 +139,34 @@ Signed-off-by: Peter Oh } --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -4203,6 +4203,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -3802,7 +3802,7 @@ static void wpas_event_dfs_cac_started(s + struct dfs_event *radar) + { + #if defined(NEED_AP_MLME) && defined(CONFIG_AP) +- if (wpa_s->ap_iface) { ++ if (wpa_s->ap_iface || wpa_s->ifmsh) { + wpas_ap_event_dfs_cac_started(wpa_s, radar); + } else + #endif /* NEED_AP_MLME && CONFIG_AP */ +@@ -3823,7 +3823,7 @@ static void wpas_event_dfs_cac_finished( + struct dfs_event *radar) + { + #if defined(NEED_AP_MLME) && defined(CONFIG_AP) +- if (wpa_s->ap_iface) { ++ if (wpa_s->ap_iface || wpa_s->ifmsh) { + wpas_ap_event_dfs_cac_finished(wpa_s, radar); + } else + #endif /* NEED_AP_MLME && CONFIG_AP */ +@@ -3839,7 +3839,7 @@ static void wpas_event_dfs_cac_aborted(s + struct dfs_event *radar) + { + #if defined(NEED_AP_MLME) && defined(CONFIG_AP) +- if (wpa_s->ap_iface) { ++ if (wpa_s->ap_iface || wpa_s->ifmsh) { + wpas_ap_event_dfs_cac_aborted(wpa_s, radar); + } else + #endif /* NEED_AP_MLME && CONFIG_AP */ +@@ -4278,6 +4278,7 @@ void wpa_supplicant_event(void *ctx, enu #ifdef CONFIG_AP if (wpa_s->current_ssid->mode == WPAS_MODE_AP || wpa_s->current_ssid->mode == WPAS_MODE_P2P_GO || diff --git a/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch b/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch index 73ae00ce8de..2022bbbdd20 100644 --- a/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch +++ b/package/network/services/hostapd/patches/011-mesh-Allow-DFS-channels-to-be-selected-if-dfs-is-ena.patch @@ -14,7 +14,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2040,6 +2040,8 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2060,6 +2060,8 @@ void ibss_mesh_setup_freq(struct wpa_sup struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; u32 vht_caps = 0; @@ -23,7 +23,7 @@ Signed-off-by: Peter Oh freq->freq = ssid->frequency; -@@ -2116,8 +2118,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2136,8 +2138,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check primary channel flags */ @@ -36,7 +36,7 @@ Signed-off-by: Peter Oh #ifdef CONFIG_HT_OVERRIDES if (ssid->disable_ht40) -@@ -2143,8 +2148,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2163,8 +2168,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Check secondary channel flags */ @@ -49,7 +49,7 @@ Signed-off-by: Peter Oh freq->channel = pri_chan->chan; -@@ -2234,8 +2242,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2254,8 +2262,11 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Back to HT configuration if channel not usable */ @@ -62,7 +62,7 @@ Signed-off-by: Peter Oh } chwidth = VHT_CHANWIDTH_80MHZ; -@@ -2255,10 +2266,11 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2275,10 +2286,11 @@ void ibss_mesh_setup_freq(struct wpa_sup if (!chan) continue; diff --git a/package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch b/package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch index 39df49870c5..793f4f5db10 100644 --- a/package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch +++ b/package/network/services/hostapd/patches/012-mesh-allow-mesh-to-send-channel-switch-request.patch @@ -1,7 +1,7 @@ -From 912b5c89328f1f9585e64fd13460928c71f28352 Mon Sep 17 00:00:00 2001 +From 4a8245ec2e9d48e464488477a3e7ed234009c216 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:09 -0700 -Subject: [PATCH 12/16] mesh: allow mesh to send channel switch request +Date: Tue, 29 May 2018 14:39:16 -0700 +Subject: [PATCH 12/18] mesh: allow mesh to send channel switch request add mesh type to nl80211 channel switch request, so mesh is able to send the request to kernel drivers. diff --git a/package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch b/package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch index 8a9818b187d..2d818b08357 100644 --- a/package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch +++ b/package/network/services/hostapd/patches/013-mesh-do-not-allow-pri-sec-channel-switch.patch @@ -1,7 +1,7 @@ -From d7ae7271dce4203bfcd79a230acb24f03f38633d Mon Sep 17 00:00:00 2001 +From 267395271c1a36b54ef21070acff2cadce241035 Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:10 -0700 -Subject: [PATCH 13/16] mesh: do not allow pri/sec channel switch +Date: Tue, 29 May 2018 14:39:17 -0700 +Subject: [PATCH 13/18] mesh: do not allow pri/sec channel switch We don't want mesh to switch the channel from primary to secondary, since mesh points are not able to join each other in that case. diff --git a/package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch b/package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch index 3c692a581f3..a6cb1b469c9 100644 --- a/package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch +++ b/package/network/services/hostapd/patches/014-mesh-do-not-allow-scan-result-to-swap-pri-sec.patch @@ -13,7 +13,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2165,7 +2165,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2185,7 +2185,7 @@ void ibss_mesh_setup_freq(struct wpa_sup } freq->sec_channel_offset = ht40; diff --git a/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch b/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch index 9d6ac82bf63..148e90d8592 100644 --- a/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch +++ b/package/network/services/hostapd/patches/015-mesh-do-not-use-offchan-mgmt-tx-on-DFS.patch @@ -1,14 +1,16 @@ -From 48f31256ffebfc43d6b14b93597aa2c7e2975dc4 Mon Sep 17 00:00:00 2001 +From 9423e8be0393e82c8622806a0529e47fd5583c0b Mon Sep 17 00:00:00 2001 From: Peter Oh -Date: Tue, 17 Apr 2018 21:55:12 -0700 -Subject: [PATCH 15/16] mesh: do not use offchan mgmt tx on DFS +Date: Tue, 29 May 2018 14:39:19 -0700 +Subject: [PATCH 15/18] mesh: do not use offchan mgmt tx on DFS Drivers don't allow mesh to use offchannel on management Tx. Signed-off-by: Peter Oh +Signed-off-by: Daniel Golle +[daniel@makrotopia.org: adapted to changed ieee80211_is_dfs prototype] --- - src/drivers/driver_nl80211.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) + src/drivers/driver_nl80211.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -23,20 +25,20 @@ Signed-off-by: Peter Oh struct ieee80211_hdr *hdr; wpa_printf(MSG_DEBUG, "nl80211: Send Action frame (ifindex=%d, " -@@ -7190,6 +7194,12 @@ static int wpa_driver_nl80211_send_actio +@@ -7189,7 +7193,11 @@ static int wpa_driver_nl80211_send_actio + } else { os_memset(bss->rand_addr, 0, ETH_ALEN); } - +- + if (is_mesh_interface(drv->nlmode) && + (modes = nl80211_get_hw_feature_data(bss, &num_modes, &flags, + &dfs_domain)) && + ieee80211_is_dfs(freq, modes, num_modes)) + offchanok = 0; -+ if (is_ap_interface(drv->nlmode) && (!(drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || (int) freq == bss->freq || drv->device_ap_sme || -@@ -7201,7 +7211,7 @@ static int wpa_driver_nl80211_send_actio +@@ -7201,7 +7209,7 @@ static int wpa_driver_nl80211_send_actio ret = nl80211_send_frame_cmd(bss, freq, wait_time, buf, 24 + data_len, &drv->send_action_cookie, diff --git a/package/network/services/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch b/package/network/services/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch new file mode 100644 index 00000000000..5071ae51514 --- /dev/null +++ b/package/network/services/hostapd/patches/016-mesh-fix-channel-switch-error-during-CAC.patch @@ -0,0 +1,64 @@ +From fa9d565fe8841b288f29137c23a7ab2584dd9510 Mon Sep 17 00:00:00 2001 +From: Peter Oh +Date: Tue, 29 May 2018 14:39:20 -0700 +Subject: [PATCH 16/18] mesh: fix channel switch error during CAC + +Mesh interface has used its channel parameters that configured +during its initialization even after channel switched due to +DFS radar detection during CAC which caused channel switch error. +This change fixes the error by updating its channel parameters +when channel's been changed from initial one. + +Signed-off-by: Peter Oh +Signed-off-by: Daniel Golle +[daniel@makrotopia.org: added hw_features_common.h include] +--- + wpa_supplicant/mesh.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -11,6 +11,7 @@ + #include "utils/common.h" + #include "utils/eloop.h" + #include "utils/uuid.h" ++#include "common/hw_features_common.h" + #include "common/ieee802_11_defs.h" + #include "common/wpa_ctrl.h" + #include "ap/sta_info.h" +@@ -394,10 +395,35 @@ void wpa_supplicant_mesh_add_scan_ie(str + void wpas_mesh_complete_cb(void *ctx) + { + struct wpa_supplicant *wpa_s = (struct wpa_supplicant *)ctx; ++ struct hostapd_iface *ifmsh = wpa_s->ifmsh; + struct wpa_driver_mesh_join_params *params = wpa_s->mesh_params; + struct wpa_ssid *ssid = wpa_s->current_ssid; + int ret = 0; + ++ /* ++ * inspect if channel's been changed since initialized. ++ * i.e. DFS radar detection ++ */ ++ if (ifmsh->freq != params->freq.freq) { ++ wpa_s->assoc_freq = ifmsh->freq; ++ ssid->frequency = ifmsh->freq; ++ if (hostapd_set_freq_params(¶ms->freq, ++ ifmsh->conf->hw_mode, ++ ifmsh->freq, ++ ifmsh->conf->channel, ++ ifmsh->conf->ieee80211n, ++ ifmsh->conf->ieee80211ac, ++ ifmsh->conf->secondary_channel, ++ ifmsh->conf->vht_oper_chwidth, ++ ifmsh->conf->vht_oper_centr_freq_seg0_idx, ++ ifmsh->conf->vht_oper_centr_freq_seg1_idx, ++ ifmsh->conf->vht_capab)) { ++ wpa_printf(MSG_ERROR, "Error updating mesh frequency params."); ++ wpa_supplicant_mesh_deinit(wpa_s); ++ return; ++ } ++ } ++ + if (wpas_mesh_init_rsn(wpa_s)) { + wpa_printf(MSG_ERROR, "Init RSN failed. Deinit mesh..."); + wpa_supplicant_mesh_deinit(wpa_s); diff --git a/package/network/services/hostapd/patches/017-mesh-use-right-interface-context-to-send-DFS-event-m.patch b/package/network/services/hostapd/patches/017-mesh-use-right-interface-context-to-send-DFS-event-m.patch new file mode 100644 index 00000000000..a4073bb9fd3 --- /dev/null +++ b/package/network/services/hostapd/patches/017-mesh-use-right-interface-context-to-send-DFS-event-m.patch @@ -0,0 +1,107 @@ +From d3201adfe7d2219217a07ef16ef365ad59c1a89b Mon Sep 17 00:00:00 2001 +From: Peter Oh +Date: Tue, 29 May 2018 14:39:21 -0700 +Subject: [PATCH 17/18] mesh: use right interface context to send DFS event + messages + +use mesh interface context to send DFS event messages when +DFS events are on mesh interface. + +Signed-off-by: Peter Oh +Signed-off-by: Masashi Honma +--- + src/ap/dfs.c | 27 +++++++++++++++++++-------- + 1 file changed, 19 insertions(+), 8 deletions(-) + +--- a/src/ap/dfs.c ++++ b/src/ap/dfs.c +@@ -637,6 +637,17 @@ static unsigned int dfs_get_cac_time(str + } + + ++static void *get_message_ctx(struct hostapd_iface *iface) ++{ ++#ifdef CONFIG_MESH ++ if (iface->mconf) ++ return iface->owner; ++#endif /* CONFIG_MESH */ ++ ++ return iface->bss[0]->msg_ctx; ++} ++ ++ + /* + * Main DFS handler + * 1 - continue channel/ap setup +@@ -719,7 +730,7 @@ int hostapd_handle_dfs(struct hostapd_if + /* Finally start CAC */ + hostapd_set_state(iface, HAPD_IFACE_DFS); + wpa_printf(MSG_DEBUG, "DFS start CAC on %d MHz", iface->freq); +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_START ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_CAC_START + "freq=%d chan=%d sec_chan=%d, width=%d, seg0=%d, seg1=%d, cac_time=%ds", + iface->freq, + iface->conf->channel, iface->conf->secondary_channel, +@@ -768,7 +779,7 @@ int hostapd_dfs_complete_cac(struct host + int ht_enabled, int chan_offset, int chan_width, + int cf1, int cf2) + { +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_COMPLETED ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_CAC_COMPLETED + "success=%d freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", + success, freq, ht_enabled, chan_offset, chan_width, cf1, cf2); + +@@ -810,7 +821,7 @@ int hostapd_dfs_pre_cac_expired(struct h + int ht_enabled, int chan_offset, int chan_width, + int cf1, int cf2) + { +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_PRE_CAC_EXPIRED ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_PRE_CAC_EXPIRED + "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", + freq, ht_enabled, chan_offset, chan_width, cf1, cf2); + +@@ -848,7 +859,7 @@ static int hostapd_dfs_start_channel_swi + + wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d", + channel->chan); +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_NEW_CHANNEL + "freq=%d chan=%d sec_chan=%d", channel->freq, + channel->chan, secondary_channel); + +@@ -935,7 +946,7 @@ static int hostapd_dfs_start_channel_swi + + wpa_printf(MSG_DEBUG, "DFS will switch to a new channel %d", + channel->chan); +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NEW_CHANNEL ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_NEW_CHANNEL + "freq=%d chan=%d sec_chan=%d", channel->freq, + channel->chan, secondary_channel); + +@@ -997,7 +1008,7 @@ int hostapd_dfs_radar_detected(struct ho + { + int res; + +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_RADAR_DETECTED ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_RADAR_DETECTED + "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", + freq, ht_enabled, chan_offset, chan_width, cf1, cf2); + +@@ -1028,7 +1039,7 @@ int hostapd_dfs_nop_finished(struct host + int ht_enabled, int chan_offset, int chan_width, + int cf1, int cf2) + { +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_NOP_FINISHED ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_NOP_FINISHED + "freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", + freq, ht_enabled, chan_offset, chan_width, cf1, cf2); + +@@ -1078,7 +1089,7 @@ int hostapd_dfs_start_cac(struct hostapd + int ht_enabled, int chan_offset, int chan_width, + int cf1, int cf2) + { +- wpa_msg(iface->bss[0]->msg_ctx, MSG_INFO, DFS_EVENT_CAC_START ++ wpa_msg(get_message_ctx(iface), MSG_INFO, DFS_EVENT_CAC_START + "freq=%d chan=%d chan_offset=%d width=%d seg0=%d " + "seg1=%d cac_time=%ds", + freq, (freq - 5000) / 5, chan_offset, chan_width, cf1, cf2, 60); diff --git a/package/network/services/hostapd/patches/016-mesh-make-forwarding-configurable.patch b/package/network/services/hostapd/patches/018-mesh-make-forwarding-configurable.patch similarity index 96% rename from package/network/services/hostapd/patches/016-mesh-make-forwarding-configurable.patch rename to package/network/services/hostapd/patches/018-mesh-make-forwarding-configurable.patch index 9f916c5266c..682eb46503c 100644 --- a/package/network/services/hostapd/patches/016-mesh-make-forwarding-configurable.patch +++ b/package/network/services/hostapd/patches/018-mesh-make-forwarding-configurable.patch @@ -59,7 +59,7 @@ Signed-off-by: Daniel Golle --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9230,6 +9230,9 @@ static int nl80211_put_mesh_config(struc +@@ -9228,6 +9228,9 @@ static int nl80211_put_mesh_config(struc if (((params->flags & WPA_DRIVER_MESH_CONF_FLAG_AUTO_PLINKS) && nla_put_u8(msg, NL80211_MESHCONF_AUTO_OPEN_PLINKS, params->auto_plinks)) || @@ -164,7 +164,7 @@ Signed-off-by: Daniel Golle --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -120,6 +120,7 @@ static struct mesh_conf * mesh_config_cr +@@ -121,6 +121,7 @@ static struct mesh_conf * mesh_config_cr conf->mesh_cc_id = 0; conf->mesh_sp_id = MESH_SYNC_METHOD_NEIGHBOR_OFFSET; conf->mesh_auth_id = (conf->security & MESH_CONF_SEC_AUTH) ? 1 : 0; @@ -172,7 +172,7 @@ Signed-off-by: Daniel Golle conf->dot11MeshMaxRetries = ssid->dot11MeshMaxRetries; conf->dot11MeshRetryTimeout = ssid->dot11MeshRetryTimeout; conf->dot11MeshConfirmTimeout = ssid->dot11MeshConfirmTimeout; -@@ -255,6 +256,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -256,6 +257,7 @@ static int wpa_supplicant_mesh_init(stru bss->conf->start_disabled = 1; bss->conf->mesh = MESH_ENABLED; bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity; @@ -180,7 +180,7 @@ Signed-off-by: Daniel Golle if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes, wpa_s->hw.num_modes) && wpa_s->conf->country[0]) { -@@ -508,6 +510,10 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -534,6 +536,10 @@ int wpa_supplicant_join_mesh(struct wpa_ } params->conf.peer_link_timeout = wpa_s->conf->mesh_max_inactivity; diff --git a/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch b/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch index af0148bc4e0..56554ef02f8 100644 --- a/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch +++ b/package/network/services/hostapd/patches/022-mesh-fix-crash-with-CONFIG_TAXONOMY-enabled.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -214,7 +214,7 @@ static int wpa_supplicant_mesh_init(stru +@@ -215,7 +215,7 @@ static int wpa_supplicant_mesh_init(stru return 0; } diff --git a/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch b/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch index 4b802d2a497..925a53818d2 100644 --- a/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch +++ b/package/network/services/hostapd/patches/031-mesh-add-VHT_CHANWIDTH_USE_HT-to-max_oper_chwidth.patch @@ -37,7 +37,7 @@ Signed-off-by: Peter Oh struct dl_list list; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2292,6 +2292,9 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2312,6 +2312,9 @@ void ibss_mesh_setup_freq(struct wpa_sup vht_caps |= VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; seg0 = 114; } diff --git a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch index f913b1282a1..083bdfe1d18 100644 --- a/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch +++ b/package/network/services/hostapd/patches/032-mesh-implement-use-of-VHT20-config-in-mesh-mode.patch @@ -33,7 +33,7 @@ Signed-off-by: Peter Oh --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2124,9 +2124,15 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2144,9 +2144,15 @@ void ibss_mesh_setup_freq(struct wpa_sup if (!dfs_enabled) return; @@ -51,7 +51,7 @@ Signed-off-by: Peter Oh #endif /* CONFIG_HT_OVERRIDES */ /* Check/setup HT40+/HT40- */ -@@ -2154,8 +2160,6 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2174,8 +2180,6 @@ void ibss_mesh_setup_freq(struct wpa_sup if (!dfs_enabled) return; @@ -60,7 +60,7 @@ Signed-off-by: Peter Oh if (ht40 == -1) { if (!(pri_chan->flag & HOSTAPD_CHAN_HT40MINUS)) return; -@@ -2199,6 +2203,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2219,6 +2223,7 @@ void ibss_mesh_setup_freq(struct wpa_sup wpa_scan_results_free(scan_res); } @@ -68,7 +68,7 @@ Signed-off-by: Peter Oh wpa_printf(MSG_DEBUG, "IBSS/mesh: setup freq channel %d, sec_channel_offset %d", freq->channel, freq->sec_channel_offset); -@@ -2294,7 +2299,10 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2314,7 +2319,10 @@ void ibss_mesh_setup_freq(struct wpa_sup } } else if (ssid->max_oper_chwidth == VHT_CHANWIDTH_USE_HT) { chwidth = VHT_CHANWIDTH_USE_HT; diff --git a/package/network/services/hostapd/patches/110-no_eapol_fix.patch b/package/network/services/hostapd/patches/110-no_eapol_fix.patch index b8e057e2faf..ac53cbc92dc 100644 --- a/package/network/services/hostapd/patches/110-no_eapol_fix.patch +++ b/package/network/services/hostapd/patches/110-no_eapol_fix.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -272,9 +272,10 @@ void wpa_supplicant_cancel_auth_timeout( +@@ -292,9 +292,10 @@ void wpa_supplicant_cancel_auth_timeout( */ void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s) { diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 5d9a2397de4..273af644c61 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -3901,8 +3901,8 @@ static void wpas_event_assoc_reject(stru +@@ -3976,8 +3976,8 @@ static void wpas_event_assoc_reject(stru } @@ -242,7 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -4669,7 +4669,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -4745,7 +4745,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5777,7 +5777,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -5797,7 +5797,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -5814,6 +5813,11 @@ static int wpa_supplicant_match_existing +@@ -5834,6 +5833,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -6070,6 +6074,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -6090,6 +6094,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ diff --git a/package/network/services/hostapd/patches/301-mesh-noscan.patch b/package/network/services/hostapd/patches/301-mesh-noscan.patch index c72d5e115c2..0c42d2b1103 100644 --- a/package/network/services/hostapd/patches/301-mesh-noscan.patch +++ b/package/network/services/hostapd/patches/301-mesh-noscan.patch @@ -20,7 +20,7 @@ INT(fixed_freq); --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -287,6 +287,8 @@ static int wpa_supplicant_mesh_init(stru +@@ -288,6 +288,8 @@ static int wpa_supplicant_mesh_init(stru frequency); goto out_free; } @@ -31,7 +31,7 @@ if (conf->hw_mode == HOSTAPD_MODE_IEEE80211A && ssid->vht) { --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2031,12 +2031,12 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2051,12 +2051,12 @@ void ibss_mesh_setup_freq(struct wpa_sup { enum hostapd_hw_mode hw_mode; struct hostapd_hw_modes *mode = NULL; @@ -46,7 +46,7 @@ unsigned int j, k; struct hostapd_freq_params vht_freq; int chwidth, seg0, seg1; -@@ -2106,7 +2106,7 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2126,7 +2126,7 @@ void ibss_mesh_setup_freq(struct wpa_sup return; /* Setup higher BW only for 5 GHz */ diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index e72a5c816b3..1fb05401f8e 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -4228,7 +4228,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -4248,7 +4248,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index 10c18674c45..9d7a2a4431a 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -36,7 +36,7 @@ nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -7439,7 +7442,6 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -7437,7 +7440,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); @@ -44,7 +44,7 @@ /* * If the P2P GO interface was dynamically added, then it is -@@ -7459,7 +7461,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -7457,7 +7459,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; wpa_driver_nl80211_del_beacon(bss); diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index 67cfc5a5c8e..58a00448495 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -166,7 +166,7 @@ /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { -@@ -893,12 +942,16 @@ void wpa_supplicant_set_state(struct wpa +@@ -913,12 +962,16 @@ void wpa_supplicant_set_state(struct wpa sme_sched_obss_scan(wpa_s, 1); @@ -183,7 +183,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -1927,6 +1980,8 @@ void wpa_supplicant_associate(struct wpa +@@ -1947,6 +2000,8 @@ void wpa_supplicant_associate(struct wpa wpa_ssid_txt(ssid->ssid, ssid->ssid_len), ssid->id); wpas_notify_mesh_group_started(wpa_s, ssid); @@ -192,7 +192,7 @@ #else /* CONFIG_MESH */ wpa_msg(wpa_s, MSG_ERROR, "mesh mode support not included in the build"); -@@ -5403,6 +5458,16 @@ static int wpa_supplicant_init_iface(str +@@ -5423,6 +5478,16 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -209,7 +209,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -5724,6 +5789,11 @@ static void wpa_supplicant_deinit_iface( +@@ -5744,6 +5809,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index d52684e93b3..81ad81c39a6 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3041,6 +3041,12 @@ static void wpas_start_assoc_cb(struct w +@@ -3061,6 +3061,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index aff00fe556c..12cbd993a5d 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich /** --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -9250,6 +9250,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -9248,6 +9248,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -9311,6 +9323,7 @@ static int nl80211_join_mesh(struct i802 +@@ -9309,6 +9321,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || @@ -58,7 +58,7 @@ Tested-by: Simon Wunderlich --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c -@@ -456,6 +456,7 @@ int wpa_supplicant_join_mesh(struct wpa_ +@@ -482,6 +482,7 @@ int wpa_supplicant_join_mesh(struct wpa_ params->meshid = ssid->ssid; params->meshid_len = ssid->ssid_len; diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch index 6fe9d115850..f630894c92b 100644 --- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2104,11 +2104,13 @@ void ibss_mesh_setup_freq(struct wpa_sup +@@ -2124,11 +2124,13 @@ void ibss_mesh_setup_freq(struct wpa_sup for (j = 0; j < wpa_s->last_scan_res_used; j++) { struct wpa_bss *bss = wpa_s->last_scan_res[j]; From 5826efd18ca970462cefa7f82edcd671493d32fb Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 31 May 2018 15:18:12 +0200 Subject: [PATCH 129/399] hostapd: properly build hostapd-only SSL variants Make sure hostapd-openssl is actually build against OpenSSL, same for wolfSSL. Signed-off-by: Daniel Golle (backported from 987900f2de76e6d292e55aa068c39b03f79c8812) --- package/network/services/hostapd/Makefile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 56d064c73b5..5edc513e0e4 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -107,18 +107,18 @@ ifeq ($(LOCAL_VARIANT),full) DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT) endif -ifneq ($(LOCAL_TYPE),hostapd) - ifeq ($(LOCAL_VARIANT),full) - ifeq ($(SSL_VARIANT),openssl) - DRIVER_MAKEOPTS += CONFIG_TLS=openssl - TARGET_LDFLAGS += -lcrypto -lssl - endif - ifeq ($(SSL_VARIANT),wolfssl) - DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 - TARGET_LDFLAGS += -lwolfssl - endif +ifeq ($(LOCAL_VARIANT),full) + ifeq ($(SSL_VARIANT),openssl) + DRIVER_MAKEOPTS += CONFIG_TLS=openssl + TARGET_LDFLAGS += -lcrypto -lssl + endif + ifeq ($(SSL_VARIANT),wolfssl) + DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 + TARGET_LDFLAGS += -lwolfssl endif +endif +ifneq ($(LOCAL_TYPE),hostapd) ifeq ($(LOCAL_VARIANT),mesh) ifeq ($(SSL_VARIANT),openssl) DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y From 31f935edafa4cbd793934e0591cc278e0ed0564a Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 24 May 2018 20:47:46 -0700 Subject: [PATCH 130/399] ath10k-firmware: Fix QCA6174 support Currently when installing the firmware, a bunch of files and directories that the ath10k driver does not look for are created. The package now installs firmware for both hw 2.1 and 3.0 devices. 2.1 is abandonware but may be useful to keep. 3.0 firmware was tested on a Killer 1535 to be relatively stable with 802.11w disabled. 802.11w causes multiple firmware crashes but that's true of other ath10k firmwares as well. Signed-off-by: Rosen Penev (backported and squashed from 27eab4fa578d696ab55b6264a1b35fad6488b664, d0fbe1956b3b9f07b6dcb54a8ed43a4904581e1d, e191c7ee797c8b3458eb9791212a56b16febeeb4) Signed-off-by: Jo-Philipp Wich --- package/firmware/ath10k-firmware/Makefile | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index eaee0ebc51f..c2b40006718 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -438,8 +438,20 @@ define Package/ath10k-firmware-qca988x/install endef define Package/ath10k-firmware-qca6174/install - $(INSTALL_DIR) $(1)/lib/firmware/ath10k - $(CP) $(PKG_BUILD_DIR)/QCA6174 $(1)/lib/firmware/ath10k/ + $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA6174/hw2.1 + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/QCA6174/hw2.1/board-2.bin \ + $(1)/lib/firmware/ath10k/QCA6174/hw2.1/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/QCA6174/hw2.1/firmware-5.bin_SW_RM.1.1.1-00157-QCARMSWPZ-1 \ + $(1)/lib/firmware/ath10k/QCA6174/hw2.1/firmware-5.bin + $(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA6174/hw3.0 + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/QCA6174/hw3.0/board-2.bin \ + $(1)/lib/firmware/ath10k/QCA6174/hw3.0/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/QCA6174/hw3.0/4.4.1.c1/firmware-6.bin_RM.4.4.1.c1-00042-QCARMSWP-1 \ + $(1)/lib/firmware/ath10k/QCA6174/hw3.0/firmware-6.bin endef define Package/ath10k-firmware-qca99x0/install From 0d3bdf7b59404580f21db2fa59769993274d5105 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 May 2018 15:13:47 -0700 Subject: [PATCH 131/399] curl: Use ca-bundle for all TLS libraries. It simplifies the Makefile a bit. In addition, using ca-bundle saves some space as well. It also fixes an issue with at least transmission, which has a dependency on ca-bundle, but currently libcurl with OpenSSL or GnuTLS cause it not to work. This has been tested on mt7621 with OpenSSL and GnuTLS just by running 'curl https://www.google.com' and seeing if there's a verify error. The rest are already using ca-bundle and therefore work fine. Signed-off-by: Rosen Penev Tested-by: Kevin Darbyshire-Bryant (backported from f97946c49680a5fe713d0e2caaf072789f70e68d) --- package/network/utils/curl/Makefile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index db726407b98..522460eff76 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -112,13 +112,15 @@ CONFIGURE_ARGS += \ --without-libmetalink \ --without-librtmp \ --without-libidn \ + --without-ca-path \ + --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt \ \ $(call autoconf_bool,CONFIG_IPV6,ipv6) \ \ - $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ - $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \ - $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \ - $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \ + $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr",--without-cyassl) \ + $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr",--without-gnutls) \ + $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr",--without-ssl) \ + $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr",--without-mbedtls) \ \ $(if $(CONFIG_LIBCURL_LIBIDN2),--with-libidn2="$(STAGING_DIR)/usr",--without-libidn2) \ $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ From 60b29c9c177d7865dd116eeb574fc9c8ab775b77 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 27 May 2018 15:13:48 -0700 Subject: [PATCH 132/399] curl: Add ca-bundle dependency While building, curl complains that the path specified is missing. Also, without ca-bundle, something like 'curl https://www.google.com' does not work due to a certificate verify error. Signed-off-by: Rosen Penev (backported from 7a20c7a05d52f9bb3c82742098457bfbed869a8a) --- package/network/utils/curl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 522460eff76..b4e3fd9d998 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -88,7 +88,7 @@ define Package/libcurl CATEGORY:=Libraries DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN2:libidn2 - DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 + DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 +ca-bundle TITLE:=A client-side URL transfer library MENU:=1 endef From 3e02d196553ca44a17889053f7582a3ac4f2098a Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 5 Jul 2018 18:51:54 +0800 Subject: [PATCH 133/399] ca-certificates: ca-bundle: add symlink for openssl default setting OpenSSL defaults X509_CERT_FILE to /etc/ssl/cert.pem. This change is needed for wget-ssl and possibly others to work seamlessly with fresh ca-bundle installation Fixes openwrt/packages#6152 Signed-off-by: Yousong Zhou (backported from 191078e83d127f5ed9a38366d2edaac49f9333c5) --- package/system/ca-certificates/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/system/ca-certificates/Makefile b/package/system/ca-certificates/Makefile index 5ee7a3528c9..43003cf9255 100644 --- a/package/system/ca-certificates/Makefile +++ b/package/system/ca-certificates/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ca-certificates PKG_VERSION:=20180409 +PKG_RELEASE:=2 PKG_MAINTAINER:= PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.xz @@ -57,6 +58,7 @@ endef define Package/ca-bundle/install $(INSTALL_DIR) $(1)/etc/ssl/certs cat $(PKG_INSTALL_DIR)/usr/share/ca-certificates/*/*.crt >$(1)/etc/ssl/certs/ca-certificates.crt + $(LN) /etc/ssl/certs/ca-certificates.crt $(1)/etc/ssl/cert.pem endef $(eval $(call BuildPackage,ca-certificates)) $(eval $(call BuildPackage,ca-bundle)) From b7beb89b5838079e0985a7a50147424666214cf9 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Wed, 30 May 2018 08:46:34 +0000 Subject: [PATCH 134/399] nettle: bump to 3.4 3.4 is mainly a bug fix/maintenance release. 3KB increase in ipk lib size on mips. Compile tested for: ar71xx, ramips Run tested on: ar71xx Archer C7 v2, ramips mir3g Signed-off-by: Kevin Darbyshire-Bryant (backported from 1ee5051f202f600d854bcf939ba4ee37f057ace2) --- package/libs/nettle/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/nettle/Makefile b/package/libs/nettle/Makefile index 172b5b2563d..67889d079b7 100644 --- a/package/libs/nettle/Makefile +++ b/package/libs/nettle/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nettle -PKG_VERSION:=3.3 +PKG_VERSION:=3.4 PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@GNU/nettle -PKG_HASH:=46942627d5d0ca11720fec18d81fc38f7ef837ea4197c1f630e71ce0d470b11e +PKG_HASH:=ae7a42df026550b85daca8389b6a60ba6313b0567f374392e54918588a411e94 PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING From fc0907bc25991a526ce4da001217d6a64045ffda Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Mon, 14 May 2018 00:05:43 +0300 Subject: [PATCH 135/399] netifd: drop conflicting 'device' interface property Do not set device runtime property on interfaces in the hotplug handler and in fixup_interfaces(). This property conflicts with device option in several proto handlers (mainly QMI and other WWAN/3G protos) and does not seem to be used anywhere. Signed-off-by: Ivan Shapovalov Signed-off-by: Hans Dedecker [PKG_RELEASE increase] (backported from 91b5b2e20d531584918c62a6c6cd046f0580f50a) --- package/network/config/netifd/Makefile | 2 +- .../config/netifd/files/etc/hotplug.d/iface/00-netstate | 1 - package/network/config/netifd/files/lib/network/config.sh | 3 --- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index d77fe9b96e9..f8ad3a8d998 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netifd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git diff --git a/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate b/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate index 023025cd1a0..71ccb01915a 100644 --- a/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate +++ b/package/network/config/netifd/files/etc/hotplug.d/iface/00-netstate @@ -1,7 +1,6 @@ [ ifup = "$ACTION" ] && { uci_toggle_state network "$INTERFACE" up 1 [ -n "$DEVICE" ] && { - uci_toggle_state network "$INTERFACE" device "$(uci -q get network.$INTERFACE.ifname)" uci_toggle_state network "$INTERFACE" ifname "$DEVICE" } } diff --git a/package/network/config/netifd/files/lib/network/config.sh b/package/network/config/netifd/files/lib/network/config.sh index 9128971dab0..0ded45edc4e 100755 --- a/package/network/config/netifd/files/lib/network/config.sh +++ b/package/network/config/netifd/files/lib/network/config.sh @@ -41,15 +41,12 @@ fixup_interface() { config_get type "$config" type config_get ifname "$config" ifname - config_get device "$config" device "$ifname" [ "bridge" = "$type" ] && ifname="br-$config" - config_set "$config" device "$ifname" ubus_call "network.interface.$config" status || return 0 json_get_var l3dev l3_device [ -n "$l3dev" ] && ifname="$l3dev" json_init config_set "$config" ifname "$ifname" - config_set "$config" device "$device" } scan_interfaces() { From 2b51cac21a5a8c0c4f396f5a56c7c29be090f556 Mon Sep 17 00:00:00 2001 From: Ted Hess Date: Tue, 5 Jun 2018 10:05:35 -0400 Subject: [PATCH 136/399] scripts: Replace obsolete POSIX tmpnam in slugimage.pl with File::Temp function Signed-off-by: Ted Hess (backported from 7590c3c58f5e9d580c86da10473d1d29a2f081c9) --- scripts/slugimage.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/slugimage.pl b/scripts/slugimage.pl index deac6ac6dd3..8c0654d4f6f 100755 --- a/scripts/slugimage.pl +++ b/scripts/slugimage.pl @@ -40,7 +40,7 @@ use warnings; use Getopt::Long qw(:config no_ignore_case); -use POSIX qw(tmpnam); +use File::Temp qw(tempfile); my($debug) = 0; my($quiet) = 0; @@ -993,7 +993,7 @@ END # don't touch RedBoot and SysConf anyway. If no Trailer is specified, # put in one. if (not defined $redboot and not -e "RedBoot") { - $redboot = tmpnam(); + $redboot = tempfile(); open TMP, ">$redboot" or die "Cannot open file $redboot: $!"; push @cleanup, $redboot; # The RedBoot partition is 256 * 1024 = 262144; the trailer we add @@ -1006,7 +1006,7 @@ END close TMP; } if (not defined $sysconf and not -e "SysConf") { - $sysconf = tmpnam(); + $sysconf = tempfile(); open TMP, ">$sysconf" or die "Cannot open file $sysconf: $!"; push @cleanup, $sysconf; # The SysConf partition is 128 * 1024 = 131072 @@ -1014,7 +1014,7 @@ END close TMP; } if (not defined $trailer and not -e "Trailer") { - $trailer = tmpnam(); + $trailer = tempfile(); open TMP, ">$trailer" or die "Cannot open file $trailer: $!"; push @cleanup, $trailer; for my $i (@sercomm_flash_trailer) { From a6b561dd01d3f0bd2b207a6ca37e34caa3bf49e5 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 6 Jun 2018 22:30:57 +0200 Subject: [PATCH 137/399] ebtables: update to latest git 2018-06-06 5699354 extensions: fix build failure on fc28 e6359ee build: update ebtables.h from kernel and drop local unused copy Signed-off-by: Hans Dedecker (backported from 1bbe813db0bb8dc65b8ed7740cf7f35a81b8ba0e) --- package/network/utils/ebtables/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index 5275c454f64..9afc542fb2b 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ebtables -PKG_SOURCE_DATE:=2018-05-15 +PKG_SOURCE_DATE:=2018-06-06 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=66a97018a31eed416c6a25d051ea172e4d65be1b -PKG_MIRROR_HASH:=3205285d4e92ab66d75681fd031b6bdc19954198b58dec1d8cbbf64312ebd445 +PKG_SOURCE_VERSION:=56993546c80576986930f9bae7ae4ba744b1e508 +PKG_MIRROR_HASH:=0ec27dc8c6de15f5fed1977ca04db554a47891e12814da3742b351f347a51fc6 PKG_LICENSE:=GPL-2.0 From cc7fa7fcecbdf31828ee0fd3ce23aef144c43c9d Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 7 Jun 2018 01:51:58 +0200 Subject: [PATCH 138/399] ramips: fix reboot with W25Q256 with 4-address-mode enabled Some board vendors actually changed the loader to expect the chip to come up in 4-address-mode and flipped the ADP bit in the flash chip's configuration register which makes it come up in 4-address-mode. Hence it doesn't make sense to avoid switching to 4-address-mode on those boards but the opposite as otherwise reboot hangs eg. on the WrtNode2 boards. Fix this by checking the ADP register and only using SPI_NOR_4B_READ_OP on chips which have ADP==0 (come up in 3-byte mode). See also datasheet section 7.1.11 Power Up Address Mode (ADP) Fixes: 22d982ea0 ("ramips: add support for switching between 3-byte and 4-byte addressing on w25q256 flash") Signed-off-by: Daniel Golle (backported from 8796680277f4b231386fbc6e8a1ccae91d9fcbe8) --- ...spi-nor-w25q256-respect-default-mode.patch | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch diff --git a/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch b/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch new file mode 100644 index 00000000000..568d61db91f --- /dev/null +++ b/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch @@ -0,0 +1,73 @@ +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -142,20 +142,29 @@ static int read_fsr(struct spi_nor *nor) + * location. Return the configuration register value. + * Returns negative if error occurred. + */ +-static int read_cr(struct spi_nor *nor) ++static int _read_cr(struct spi_nor *nor, u8 reg) + { + int ret; + u8 val; + +- ret = nor->read_reg(nor, SPINOR_OP_RDCR, &val, 1); ++ ret = nor->read_reg(nor, reg, &val, 1); + if (ret < 0) { +- dev_err(nor->dev, "error %d reading CR\n", ret); ++ dev_err(nor->dev, "error %d reading %s\n", ret, ++ (reg==SPINOR_OP_RDCR)?"CR":"XCR"); + return ret; + } + + return val; + } + ++static inline int read_cr(struct spi_nor *nor) { ++ return _read_cr(nor, SPINOR_OP_RDCR); ++} ++ ++static inline int read_xcr(struct spi_nor *nor) { ++ return _read_cr(nor, SPINOR_OP_RDXCR); ++} ++ + /* + * Write status register 1 byte + * Returns negative if error occurred. +@@ -2878,9 +2887,16 @@ int spi_nor_scan(struct spi_nor *nor, co + } else if (mtd->size > 0x1000000) { + /* enable 4-byte addressing if the device exceeds 16MiB */ + nor->addr_width = 4; +- if (info->flags & SPI_NOR_4B_READ_OP) +- spi_nor_set_4byte_read(nor, info); +- else if (JEDEC_MFR(info) == SNOR_MFR_SPANSION || ++ if (info->flags & SPI_NOR_4B_READ_OP) { ++ if (JEDEC_MFR(info) == SNOR_MFR_WINBOND) { ++ ret = read_xcr(nor); ++ if (!(ret > 0 && (ret & XCR_DEF_4B_ADDR_MODE))) ++ spi_nor_set_4byte_read(nor, info); ++ else ++ set_4byte(nor, info, 1); ++ } else ++ spi_nor_set_4byte_read(nor, info); ++ } else if (JEDEC_MFR(info) == SNOR_MFR_SPANSION || + info->flags & SPI_NOR_4B_OPCODES) + spi_nor_set_4byte_opcodes(nor, info); + else +--- a/include/linux/mtd/spi-nor.h ++++ b/include/linux/mtd/spi-nor.h +@@ -103,6 +103,7 @@ + #define SPINOR_OP_EN4B 0xb7 /* Enter 4-byte mode */ + #define SPINOR_OP_EX4B 0xe9 /* Exit 4-byte mode */ + #define SPINOR_OP_WREAR 0xc5 /* Write extended address register */ ++#define SPINOR_OP_RDXCR 0x15 /* Read extended configuration register */ + + /* Used for Spansion flashes only. */ + #define SPINOR_OP_BRWR 0x17 /* Bank register write */ +@@ -135,6 +136,7 @@ + + /* Configuration Register bits. */ + #define CR_QUAD_EN_SPAN BIT(1) /* Spansion Quad I/O */ ++#define XCR_DEF_4B_ADDR_MODE BIT(1) /* Winbond 4B mode default */ + + /* Status Register 2 bits. */ + #define SR2_QUAD_EN_BIT7 BIT(7) From 1e0db693dfe6ae5c107713d9135a9a3d8a9b6d10 Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Wed, 30 May 2018 15:05:42 +0000 Subject: [PATCH 139/399] hostapd: make cli treat UNKNOWN COMMAND as failing Avoid infinite loop at 100% CPU when running hostapd_cli if CONFIG_CTRL_IFACE_MIB is not defined. _newselect(4, [3], NULL, NULL, ...) recvfrom(3, "UNKNOWN COMMAND\n", 4095, 0, NULL, NULL) = 16 sendto(3, "STA-NEXT UNKNOWN COMMAND", 24, 0, NULL, 0) = 24 Signed-off-by: Denton Gentry (backported from a84962ea35e4e97f1c4a42f2eac0242cc2cbd879) (rebased patches) Signed-off-by: Jo-Philipp Wich --- .../patches/381-hostapd_cli_UNKNOWN-COMMAND.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch diff --git a/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch b/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch new file mode 100644 index 00000000000..7bac9373730 --- /dev/null +++ b/package/network/services/hostapd/patches/381-hostapd_cli_UNKNOWN-COMMAND.patch @@ -0,0 +1,11 @@ +--- a/hostapd/hostapd_cli.c ++++ b/hostapd/hostapd_cli.c +@@ -743,7 +743,7 @@ static int wpa_ctrl_command_sta(struct w + } + + buf[len] = '\0'; +- if (memcmp(buf, "FAIL", 4) == 0) ++ if (memcmp(buf, "FAIL", 4) == 0 || memcmp(buf, "UNKNOWN COMMAND", 15) == 0) + return -1; + if (print) + printf("%s", buf); From 3a507b2f9b6e544fc5768d501332919d579f2f9e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Apr 2018 19:19:58 +0200 Subject: [PATCH 140/399] kernel: avoid flow offload for connections with xfrm on the dst entry (should fix IPSec) Signed-off-by: Felix Fietkau (backported from b560c1748a4edf0d02046e5a988cc0caf1f4f987) (rebased patches) Signed-off-by: Jo-Philipp Wich --- .../hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch | 5 ++++- .../940-cleanup-offload-hooks-on-netdev-unregister.patch | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch index 84ae4affe3d..308fe0974d2 100644 --- a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch +++ b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch @@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o --- /dev/null +++ b/net/netfilter/xt_FLOWOFFLOAD.c -@@ -0,0 +1,365 @@ +@@ -0,0 +1,368 @@ +/* + * Copyright (C) 2018 Felix Fietkau + * @@ -326,6 +326,9 @@ Signed-off-by: Felix Fietkau + if (!this_dst || !other_dst) + return -ENOENT; + ++ if (dst_xfrm(this_dst) || dst_xfrm(other_dst)) ++ return -EINVAL; ++ + route->tuple[dir].dst = this_dst; + route->tuple[dir].ifindex = xt_in(par)->ifindex; + route->tuple[!dir].dst = other_dst; diff --git a/target/linux/generic/hack-4.14/940-cleanup-offload-hooks-on-netdev-unregister.patch b/target/linux/generic/hack-4.14/940-cleanup-offload-hooks-on-netdev-unregister.patch index 833d9f99168..6638a5e9498 100644 --- a/target/linux/generic/hack-4.14/940-cleanup-offload-hooks-on-netdev-unregister.patch +++ b/target/linux/generic/hack-4.14/940-cleanup-offload-hooks-on-netdev-unregister.patch @@ -39,7 +39,7 @@ Signed-off-by: Chen Minqiang --- a/net/netfilter/xt_FLOWOFFLOAD.c +++ b/net/netfilter/xt_FLOWOFFLOAD.c -@@ -337,10 +337,41 @@ static void xt_flowoffload_table_cleanup +@@ -340,10 +340,41 @@ static void xt_flowoffload_table_cleanup nf_flow_table_free(table); } @@ -81,7 +81,7 @@ Signed-off-by: Chen Minqiang INIT_DELAYED_WORK(&hook_work, xt_flowoffload_hook_work); ret = xt_flowoffload_table_init(&nf_flowtable); -@@ -358,6 +389,7 @@ static void __exit xt_flowoffload_tg_exi +@@ -361,6 +392,7 @@ static void __exit xt_flowoffload_tg_exi { xt_unregister_target(&offload_tg_reg); xt_flowoffload_table_cleanup(&nf_flowtable); From b81774cff80718d20982649c4f21a405fa71a07c Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sun, 18 Feb 2018 22:48:44 +0100 Subject: [PATCH 141/399] ramips: mt7621: fix mtu setting with kernel 4.14 Since kernel 4.10 commit 61e84623ace3 ("net: centralize net_device min/max MTU checking"), the range of mtu is [min_mtu, max_mtu], which is [68, 1500] by default. It's necessary to set a max_mtu if a mtu > 1500 is supported. Signed-off-by: Mathias Kresin (backported from 5da2c68d001ee44b15a58639ed03a0ebb6f68020) --- .../drivers/net/ethernet/mtk/mtk_eth_soc.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c index 6eae661ecf3..74639cbb686 100644 --- a/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c +++ b/target/linux/ramips/files-4.14/drivers/net/ethernet/mtk/mtk_eth_soc.c @@ -1384,20 +1384,12 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu) int frag_size, old_mtu; u32 fwd_cfg; - if (!(priv->flags & FE_FLAG_JUMBO_FRAME)) - return eth_change_mtu(dev, new_mtu); - - if (IS_ENABLED(CONFIG_SOC_MT7621)) - if (new_mtu > 2048) - return -EINVAL; - - frag_size = fe_max_frag_size(new_mtu); - if (new_mtu < 68 || frag_size > PAGE_SIZE) - return -EINVAL; - old_mtu = dev->mtu; dev->mtu = new_mtu; + if (!(priv->flags & FE_FLAG_JUMBO_FRAME)) + return 0; + /* return early if the buffer sizes will not change */ if (old_mtu <= ETH_DATA_LEN && new_mtu <= ETH_DATA_LEN) return 0; @@ -1419,6 +1411,7 @@ static int fe_change_mtu(struct net_device *dev, int new_mtu) if (new_mtu <= ETH_DATA_LEN) { fwd_cfg &= ~FE_GDM1_JMB_EN; } else { + frag_size = fe_max_frag_size(new_mtu); fwd_cfg &= ~(FE_GDM1_JMB_LEN_MASK << FE_GDM1_JMB_LEN_SHIFT); fwd_cfg |= (DIV_ROUND_UP(frag_size, 1024) << FE_GDM1_JMB_LEN_SHIFT) | FE_GDM1_JMB_EN; @@ -1552,6 +1545,9 @@ static int fe_probe(struct platform_device *pdev) netdev->vlan_features = netdev->hw_features & ~NETIF_F_HW_VLAN_CTAG_TX; netdev->features |= netdev->hw_features; + if (IS_ENABLED(CONFIG_SOC_MT7621)) + netdev->max_mtu = 2048; + /* fake rx vlan filter func. to support tx vlan offload func */ if (fe_reg_table[FE_REG_FE_DMA_VID_BASE]) netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; From 21bcc90b1021d6137b89ebd02454c871f34ecd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 11 Jun 2018 12:52:42 +0200 Subject: [PATCH 142/399] base-files: exit if mtd write command fails during sysupgrade MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It avoids confusing situations like: > Could not get image magic > Image check failed. > Upgrade completed > Rebooting system... Signed-off-by: Rafał Miłecki (backported from 5b2e20807d2b38de1cc4185d15bb4320b8bd743a) --- package/base-files/files/lib/upgrade/common.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 38056fd346b..0cbd2ab3a69 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -222,6 +222,7 @@ default_do_upgrade() { else get_image "$1" "$2" | mtd write - "${PART_NAME:-image}" fi + [ $? -ne 0 ] && exit 1 } do_upgrade_stage2() { From cd116c6d5c8e41b40eb456a5bc7f7013e7661124 Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Tue, 12 Jun 2018 15:49:32 +0800 Subject: [PATCH 143/399] libnftnl: bump to version 1.1.1 Signed-off-by: Rosy Song (backported from 9d6a0352e7af9aef95f4d983e39516b76e7fc8ba) --- package/libs/libnftnl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index b23dd2579f4..0fafcb78586 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.1.0 +PKG_VERSION:=1.1.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=ec0eaca11b165110c2b61e6a7b50a7a0a9b17fa04a0c333f795bec2d19f78f6c +PKG_HASH:=5d6a65413f27ec635eedf6aba033f7cf671d462a2afeacc562ba96b19893aff2 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0+ From 6d59535b6ac53cedf499ca0351e5279f183af2e3 Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Tue, 12 Jun 2018 15:49:50 +0800 Subject: [PATCH 144/399] nftables: bump to version 0.9.0 Signed-off-by: Rosy Song (backported from 1ee98fdef3d6d71c1b0b3b120a9e24ac4b93c94f) --- package/network/utils/nftables/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index c7f8a946be8..f3bdc5caeea 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=0.8.5 +PKG_VERSION:=0.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files -PKG_HASH:=8e9baf80a1c7f0e19e5b50e469bda4487793d839da45c75e8a20fadcbaeae323 +PKG_HASH:=ad8181b5fcb9ca572f444bed54018749588522ee97e4c21922648bb78d7e7e91 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 From fe193369872bddad7418c4f1ecc5566373788bff Mon Sep 17 00:00:00 2001 From: Magnus Kroken Date: Sun, 17 Jun 2018 16:16:39 +0200 Subject: [PATCH 145/399] busybox: update to 1.28.4 Signed-off-by: Magnus Kroken (backported from ccc728a0e2a7c9717d3d1bcc59f0462e9dbed01e) --- package/utils/busybox/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 28375b87c05..e73b1d41a85 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox -PKG_VERSION:=1.28.3 -PKG_RELEASE:=4 +PKG_VERSION:=1.28.4 +PKG_RELEASE:=1 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ http://sources.buildroot.net -PKG_HASH:=ad0d22033f23e696f9a71a4c2f9210194dda39b024a79151f4ac278995332a6e +PKG_HASH:=e3c14a3699dc7e82fed397392957afc78e37bdf25398ac38ead6e84621b2ae6a PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 From 32b18f6e211e2699de2b9a8be94f91e0890c562d Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 21 Jun 2018 22:26:18 +0200 Subject: [PATCH 146/399] busybox: udhcpc: replace udhcpc_no_msg_dontroute patch by upstream fix Replace 204-udhcpc_no_msg_dontroute patch by the upstream busybox fix which removes the code which requires the server ID to be on local network Signed-off-by: Hans Dedecker (backported from c6e50075f245b076b57f3f87b5401764a2e11b92) --- package/utils/busybox/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index e73b1d41a85..e8d71670af7 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.28.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 From 9f8f5d4d142ad14d9ed68f79e051d8007fb2ef89 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Mon, 25 Jun 2018 13:16:09 +0800 Subject: [PATCH 147/399] dropbear: let opkg manage symlinks of ssh, scp Signed-off-by: Yousong Zhou (backported from c4aadbdaf69bad3fbb3ef54601a3629ba24a6e9b) --- package/network/services/dropbear/Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index d221fbc7ed3..742e538ff55 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=5.1 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -49,6 +49,10 @@ define Package/dropbear CATEGORY:=Base system TITLE:=Small SSH2 client/server DEPENDS:= +DROPBEAR_ZLIB:zlib + ALTERNATIVES:=\ + 100:/usr/bin/ssh:/usr/sbin/dropbear \ + 100:/usr/bin/scp:/usr/sbin/dropbear \ + endef define Package/dropbear/description @@ -131,8 +135,6 @@ define Package/dropbear/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/dropbearmulti $(1)/usr/sbin/dropbear $(INSTALL_DIR) $(1)/usr/bin - $(LN) ../sbin/dropbear $(1)/usr/bin/scp - $(LN) ../sbin/dropbear $(1)/usr/bin/ssh $(LN) ../sbin/dropbear $(1)/usr/bin/dbclient $(LN) ../sbin/dropbear $(1)/usr/bin/dropbearkey $(INSTALL_DIR) $(1)/etc/config From 7408cdaa310fe75a6da3d4de165d84fcde123c62 Mon Sep 17 00:00:00 2001 From: Alin Nastac Date: Mon, 25 Jun 2018 10:22:21 +0200 Subject: [PATCH 148/399] netfilter: add bpf match support Add xt_bpf modules to {kmod-ipt,iptables-mod}-filter. Match using Linux Socket Filter. Expects a BPF program in decimal format. This is the format generated by the nfbpf_compile utility. Signed-off-by: Alin Nastac (backported from ab07ae2f27dd920cb7ba186d9f7ad2ccb1c980c4) --- include/netfilter.mk | 1 + package/kernel/linux/modules/netfilter.mk | 1 + package/network/utils/iptables/Makefile | 1 + 3 files changed, 3 insertions(+) diff --git a/include/netfilter.mk b/include/netfilter.mk index 5d532cea5b2..510aa183ca1 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -106,6 +106,7 @@ $(eval $(call nf_add,IPT_PHYSDEV,CONFIG_NETFILTER_XT_MATCH_PHYSDEV, $(P_XT)xt_ph # filter $(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_STRING, $(P_XT)xt_string)) +$(eval $(call nf_add,IPT_FILTER,CONFIG_NETFILTER_XT_MATCH_BPF, $(P_XT)xt_bpf)) # ipopt diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 55226bf6295..3d01ccecf85 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -237,6 +237,7 @@ define KernelPackage/ipt-filter/description Netfilter (IPv4) kernel modules for packet content inspection Includes: - string + - bpf endef $(eval $(call KernelPackage,ipt-filter)) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 1d758ed07d7..9c7179c51dc 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -150,6 +150,7 @@ Includes support for: Matches: - string + - bpf endef From ef7a6a4d7260d88c70ee73605daa81e94a3161be Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Thu, 2 Nov 2017 08:21:57 +0100 Subject: [PATCH 149/399] base-files: add menuconfig option for HOME_URL Add a menuconfig option to set the HOME_URL exposed in /usr/lib/os-release independent from the LEDE_DEVICE_MANUFACTURER_URL. Fixes: FS#1123 Signed-off-by: Mathias Kresin (backported from 52a9edb1bfaf51c250a33303beacba95dd1dbc05) --- include/version.mk | 5 +++++ package/base-files/files/usr/lib/os-release | 2 +- package/base-files/image-config.in | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/version.mk b/include/version.mk index 55228307428..164c0579025 100644 --- a/include/version.mk +++ b/include/version.mk @@ -11,6 +11,7 @@ # SOURCE_DATE_EPOCH:=x PKG_CONFIG_DEPENDS += \ + CONFIG_VERSION_HOME_URL \ CONFIG_VERSION_BUG_URL \ CONFIG_VERSION_NUMBER \ CONFIG_VERSION_CODE \ @@ -46,6 +47,9 @@ VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURE VERSION_BUG_URL:=$(call qstrip,$(CONFIG_VERSION_BUG_URL)) VERSION_BUG_URL:=$(if $(VERSION_BUG_URL),$(VERSION_BUG_URL),http://bugs.openwrt.org/) +VERSION_HOME_URL:=$(call qstrip,$(CONFIG_VERSION_HOME_URL)) +VERSION_HOME_URL:=$(if $(VERSION_HOME_URL),$(VERSION_HOME_URL),http://openwrt.org/) + VERSION_SUPPORT_URL:=$(call qstrip,$(CONFIG_VERSION_SUPPORT_URL)) VERSION_SUPPORT_URL:=$(if $(VERSION_SUPPORT_URL),$(VERSION_SUPPORT_URL),http://forum.lede-project.org/) @@ -100,6 +104,7 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \ -e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \ -e 's,%m,$(call sed_escape,$(VERSION_MANUFACTURER_URL)),g' \ -e 's,%b,$(call sed_escape,$(VERSION_BUG_URL)),g' \ + -e 's,%b,$(call sed_escape,$(VERSION_HOME_URL)),g' \ -e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \ -e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \ -e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 82ade594063..121041256a3 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -4,7 +4,7 @@ ID="%d" ID_LIKE="lede openwrt" PRETTY_NAME="%D %V" VERSION_ID="%v" -HOME_URL="%m" +HOME_URL="%u" BUG_URL="%b" SUPPORT_URL="%s" BUILD_ID="%R" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index cee8cd54e12..6c9d631d041 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -202,6 +202,12 @@ if VERSIONOPT %P .. Product name or "Generic" %h .. Hardware revision or "v0" + config VERSION_HOME_URL + string + prompt "Release Homepage" + help + This is the release version homepage + config VERSION_MANUFACTURER string prompt "Manufacturer name" From 3b9bfe8328e071a33b9dad9fd92cd900697456f0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 27 Jun 2018 18:51:25 +0200 Subject: [PATCH 150/399] build: include package directory in sha256sums when running on buildbot In order to be able to better compare files to sync in the future, include all BIN_DIR subdirectories in the checksum calculation. To not break existing applications, restrict the recursive checksumming to CONFIG_BUILDBOT for now. Signed-off-by: Jo-Philipp Wich (backported from 681e825f8fbf59a32c3b09810b2a3fef29880c63) --- Makefile | 2 +- rules.mk | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 0a1f96a973d..e38d44a8104 100644 --- a/Makefile +++ b/Makefile @@ -85,7 +85,7 @@ prereq: $(target/stamp-prereq) tmp/.prereq_packages fi checksum: FORCE - $(call sha256sums,$(BIN_DIR)) + $(call sha256sums,$(BIN_DIR),$(CONFIG_BUILDBOT)) diffconfig: FORCE mkdir -p $(BIN_DIR) diff --git a/rules.mk b/rules.mk index 38afc7777af..6b881a0c619 100644 --- a/rules.mk +++ b/rules.mk @@ -391,8 +391,9 @@ endef # Calculate sha256sum of any plain file within a given directory # $(1) => Input directory +# $(2) => If set, recurse into subdirectories define sha256sums - (cd $(1); find . -maxdepth 1 -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ + (cd $(1); find . $(if $(2),,-maxdepth 1) -type f -not -name 'sha256sums' -printf "%P\n" | sort | \ xargs -r $(STAGING_DIR_HOST)/bin/mkhash -n sha256 | sed -ne 's!^\(.*\) \(.*\)$$!\1 *\2!p' > sha256sums) endef From c388a92d61af07957a79212e6cb274a96a576f0b Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Fri, 29 Jun 2018 05:27:16 +0200 Subject: [PATCH 151/399] swconfig: fix un-initialized return value Fix CID 1330844 Found-by: Coverity Signed-off-by: Alexander Couzens (backported from e37ad4e5ca2e70387656da81704ee4d4589c6d70) --- package/network/config/swconfig/src/swlib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index e6e9aead474..0fb8ebb392c 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -92,7 +92,7 @@ swlib_call(int cmd, int (*call)(struct nl_msg *, void *), struct nl_cb *cb = NULL; int finished; int flags = 0; - int err; + int err = 0; msg = nlmsg_alloc(); if (!msg) { @@ -105,7 +105,8 @@ swlib_call(int cmd, int (*call)(struct nl_msg *, void *), genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, genl_family_get_id(family), 0, flags, cmd, 0); if (data) { - if (data(msg, arg) < 0) + err = data(msg, arg); + if (err < 0) goto nla_put_failure; } From e89126d5d2dc14b41f3029c3d58c51e242273f9c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Fri, 29 Jun 2018 05:36:06 +0200 Subject: [PATCH 152/399] swconfig: swlib_map_settings(): change return type to void The return value of the function isn't used anywhere. Fixes missing return value, CID 1329717. Found-by: Coverity Signed-off-by: Alexander Couzens (backported from b06c447c5f66fd13078327bda3d885d48e2c0e42) --- package/network/config/swconfig/src/uci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/swconfig/src/uci.c b/package/network/config/swconfig/src/uci.c index bf76bd3de1d..f99583b483a 100644 --- a/package/network/config/swconfig/src/uci.c +++ b/package/network/config/swconfig/src/uci.c @@ -59,7 +59,7 @@ static bool swlib_match_name(struct switch_dev *dev, const char *name) strcmp(name, dev->alias) == 0); } -static int +static void swlib_map_settings(struct switch_dev *dev, int type, int port_vlan, struct uci_section *s) { struct swlib_setting *setting; From 66353bdf5a910a21b29842bd23456c83bc3fddd4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 30 Jun 2018 17:02:52 -0700 Subject: [PATCH 153/399] samba36: Disable external libtdb and libtevent This was causing issues recently as samba36 is not API compatible with the libtdb in the packages repo. It shouldn't be using it anyway. Nor tevent. Signed-off-by: Rosen Penev (backported from 1f2612a4ddbb83af0c6daf3719ab74c3b7db6590) --- package/network/services/samba36/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 39bfcc6c4f7..75705d0b372 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=3.6.25 -PKG_RELEASE:=10 +PKG_RELEASE:=11 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ https://download.samba.org/pub/samba/stable @@ -108,6 +108,8 @@ CONFIGURE_ARGS += \ --disable-avahi \ --disable-cups \ --disable-external-libtalloc \ + --disable-external-libtdb \ + --disable-external-libtevent \ --disable-pie \ --disable-relro \ --disable-static \ From 3e3b286fa17aa232f3a89f235d70c8561e155ccd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 30 Jun 2018 12:25:12 -0700 Subject: [PATCH 154/399] usbutils: Switch to Fedora usbutils The Gentoo GitHub mirror went down. One benefit of Fedora's usb.ids file is that it's versioned. Signed-off-by: Rosen Penev (backported from f23271f3b4f54d1e5ddf7b85786f9a30f38409ad) --- package/utils/usbutils/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/utils/usbutils/Makefile b/package/utils/usbutils/Makefile index 7f798954aef..c5f625eb340 100644 --- a/package/utils/usbutils/Makefile +++ b/package/utils/usbutils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usbutils PKG_VERSION:=007 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/usb/usbutils @@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 -PKG_MAINTAINER := Felix Fietkau +PKG_MAINTAINER:=Felix Fietkau include $(INCLUDE_DIR)/package.mk @@ -32,13 +32,13 @@ define Package/usbutils URL:=http://www.linux-usb.org/ endef -USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383 +USB_IDS_REV:=016be785fd4f5f895c6482ec484507d5a08839fa USB_IDS_FILE:=usb.ids.$(USB_IDS_REV) define Download/usb_ids FILE:=$(USB_IDS_FILE) URL_FILE:=usb.ids - URL:=@GITHUB/gentoo/hwids/$(USB_IDS_REV) - HASH:=2d0403ffccc0ff7150e32c0bf8e2878816b76ba08d2c3bb1059f33627a3da30f + URL:=@GITHUB/vcrhonek/hwdata/$(USB_IDS_REV) + HASH:=b1877a9fd30c2f9dedec1657963775e7f261c892eb7d6f4281c453bd73492489 endef $(eval $(call Download,usb_ids)) From b1c42ef11571b7fa179d302fa8fbdb074937c19b Mon Sep 17 00:00:00 2001 From: Lev Date: Wed, 27 Jun 2018 00:50:11 +0200 Subject: [PATCH 155/399] ramips: fix wizfi630a swapped lan/wan port The order of the Ethernet ports were mixed up. This commit fixes the order to be aligned with the physical layout. Signed-off-by: Lev (backported from 3d6f57f3c6dabfe3911ffb1f1a2afbe3ff41c3fd) --- target/linux/ramips/base-files/etc/board.d/02_network | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 0c7e8d79b7a..ebf40ad1fa8 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -373,7 +373,7 @@ ramips_setup_interfaces() ;; wizfi630a) ucidef_add_switch "switch0" \ - "1:lan" "2:lan" "0:wan" "6@eth0" + "0:lan" "1:lan" "2:wan" "6@eth0" ;; wt3020-4M|\ wt3020-8M) From 3341376e0bed6b9928b338c1eec6ac1578727390 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 2 Jul 2018 17:31:03 +0200 Subject: [PATCH 156/399] ebtables: update to latest git 2018-06-27 48cff25 build: drop install -o/-g root 53d7e7a extensions: ebt_string: take action if snprintf discards data Signed-off-by: Hans Dedecker (backported from afac2a2dd67502ef8bd9799f328fa2e3b39292b1) (rebased patches) Signed-off-by: Jo-Philipp Wich --- package/network/utils/ebtables/Makefile | 6 +++--- package/network/utils/ebtables/patches/100-musl_fix.patch | 2 +- .../utils/ebtables/patches/200-fix-extension-init.patch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index 9afc542fb2b..732e9bf2b54 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ebtables -PKG_SOURCE_DATE:=2018-06-06 +PKG_SOURCE_DATE:=2018-06-27 PKG_RELEASE:=1 PKG_SOURCE_URL:=https://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=56993546c80576986930f9bae7ae4ba744b1e508 -PKG_MIRROR_HASH:=0ec27dc8c6de15f5fed1977ca04db554a47891e12814da3742b351f347a51fc6 +PKG_SOURCE_VERSION:=48cff25dfea5b37e16ba5dc6601e98ab140f5f99 +PKG_MIRROR_HASH:=1327cdc3402e5e3056819e4e9b6f9d4a5bfd401f2c4f58447afb2c3c73fc8aac PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/ebtables/patches/100-musl_fix.patch b/package/network/utils/ebtables/patches/100-musl_fix.patch index 9528fe4b192..f393ea7d91d 100644 --- a/package/network/utils/ebtables/patches/100-musl_fix.patch +++ b/package/network/utils/ebtables/patches/100-musl_fix.patch @@ -7,4 +7,4 @@ +#define _NETINET_IF_ETHER_H #include #include - #include + #include diff --git a/package/network/utils/ebtables/patches/200-fix-extension-init.patch b/package/network/utils/ebtables/patches/200-fix-extension-init.patch index 4b202ac57ef..60e2afd331c 100644 --- a/package/network/utils/ebtables/patches/200-fix-extension-init.patch +++ b/package/network/utils/ebtables/patches/200-fix-extension-init.patch @@ -249,7 +249,7 @@ } --- a/extensions/ebt_string.c +++ b/extensions/ebt_string.c -@@ -310,7 +310,7 @@ static struct ebt_u_match string_match = +@@ -312,7 +312,7 @@ static struct ebt_u_match string_match = .extra_ops = opts, }; From f5e33b98394e9293b592d55e7dc29633e7eb20d7 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Mon, 4 Sep 2017 20:20:12 +0100 Subject: [PATCH 157/399] toolchain: gdb: enable TUI The GDB Text User Interface (TUI) is a terminal interface which uses the curses library to show the source file, the assembly output, the program registers and GDB commands in separate text windows. In other words it's a friendlier interface for idiots like me! Signed-off-by: Kevin Darbyshire-Bryant (backported from 900d86766b2a2122ea435d98aa50dc72d5dadf93) --- toolchain/gdb/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 5c80eef9aad..fda34019614 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -41,7 +41,7 @@ HOST_CONFIGURE_ARGS = \ --target=$(REAL_GNU_TARGET_NAME) \ --disable-werror \ --without-uiout \ - --disable-tui --disable-gdbtk --without-x \ + --enable-tui --disable-gdbtk --without-x \ --without-included-gettext \ --enable-threads \ --with-expat \ From becdd2b28e0da5d4cfec6f0d74ce6ac5d04cbb22 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sat, 9 Jun 2018 09:11:24 +0100 Subject: [PATCH 158/399] build: ASLR hardening use $(FPIC) Signed-off-by: Kevin Darbyshire-Bryant (backported from 89b59994eb44b5cd2fac594144c20c63fd05ef25) --- include/hardening.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hardening.mk b/include/hardening.mk index 06a61789ef6..42ce1f56b5a 100644 --- a/include/hardening.mk +++ b/include/hardening.mk @@ -18,7 +18,7 @@ ifdef CONFIG_PKG_CHECK_FORMAT_SECURITY endif ifdef CONFIG_PKG_ASLR_PIE ifeq ($(strip $(PKG_ASLR_PIE)),1) - TARGET_CFLAGS += -fPIC + TARGET_CFLAGS += $(FPIC) TARGET_LDFLAGS += -specs=$(INCLUDE_DIR)/hardened-ld-pie.specs endif endif From 24bf0c63dcde1a387b942e8733cf2371bff6d7dc Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Tue, 3 Jul 2018 15:37:49 +0800 Subject: [PATCH 159/399] fixup-makefile.pl: fixup when PKG_SOURCE is defined elsewhere Signed-off-by: Yousong Zhou (backported from eb6759cc786b9a5fe1425364fc54212a425ff0be) --- scripts/fixup-makefile.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fixup-makefile.pl b/scripts/fixup-makefile.pl index 9026ddcce4d..b6f1c747380 100755 --- a/scripts/fixup-makefile.pl +++ b/scripts/fixup-makefile.pl @@ -26,7 +26,7 @@ ($) $state{related_var} = "URL"; } else { $state{context} = 1; - $state{related_var} = "PKG_SOURCE"; + $state{related_var} = "PKG_SOURCE_URL"; } } From bc6c4fcd2d67935f9eb2ef1e2e8c05078ec9a6d9 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Fri, 6 Jul 2018 16:46:33 +0300 Subject: [PATCH 160/399] tools/cmake: update to 3.11.4 Update cmake and refresh patches. Signed-off-by: Hannu Nyman (backported from 55fa8068c4eb1f6213ca115655067e635da3e637) --- tools/cmake/Makefile | 4 ++-- tools/cmake/patches/130-bootstrap_parallel_make_flag.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index b6d628715cd..3278a481887 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.11.1 +PKG_VERSION:=3.11.4 PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://cmake.org/files/v3.11/ \ https://fossies.org/linux/misc/ -PKG_HASH:=57bebc6ca4d1d42c6385249d148d9216087e0fda57a47dc5c858790a70217d0c +PKG_HASH:=8f864e9f78917de3e1483e256270daabc4a321741592c5b36af028e72bff87f5 HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch index de5137ee387..1fb0ebeaac4 100644 --- a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch +++ b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch @@ -1,6 +1,6 @@ --- a/bootstrap +++ b/bootstrap -@@ -1149,7 +1149,10 @@ int main(){ printf("1%c", (char)0x0a); r +@@ -1151,7 +1151,10 @@ int main(){ printf("1%c", (char)0x0a); r ' > "test.c" cmake_original_make_flags="${cmake_make_flags}" if [ "x${cmake_parallel_make}" != "x" ]; then From 0291b76af96355625c856bf0128e30bba783f139 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Fri, 6 Jul 2018 16:45:06 +0300 Subject: [PATCH 161/399] tools/ccache: update to 3.4.2 update version and refresh patch Signed-off-by: Hannu Nyman (backported from 7ec931b7f01e8e9dc6463069237097950761996a) --- tools/ccache/Makefile | 4 ++-- tools/ccache/patches/100-honour-copts.patch | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 6fc06c10c24..111bd91bb63 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=3.3.6 +PKG_VERSION:=3.4.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://download.samba.org/pub/ccache/ \ https://samba.org/ftp/ccache/ -PKG_HASH:=410a27fdaff64ead6df3fa57fa74bca0eca6b5f6ac77d7288af1256f6b12141d +PKG_HASH:=18a8b14367d63d3d37fb6c33cba60e1b7fcd7a63d608df97c9771ae0d234fee2 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index 7a17fcb75fd..1916d17c60e 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,6 +1,6 @@ ---- a/ccache.c -+++ b/ccache.c -@@ -1803,6 +1803,7 @@ calculate_object_hash(struct args *args, +--- a/src/ccache.c ++++ b/src/ccache.c +@@ -1859,6 +1859,7 @@ calculate_object_hash(struct args *args, "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH", // clang From b06665b2052eac06cb5a2359e1d569cbeca72e91 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 4 Jul 2018 19:49:32 +0200 Subject: [PATCH 162/399] kernel: adjust bridge port isolate patch to match upstream attribute naming Newer kernels have a patch that implements compatible functionality directly. Adjust the attribute of our own patch in preparation for dropping it later Signed-off-by: Felix Fietkau (backported from 41a1c1af4bbf18cb5f3a4dfd1fb988317da9aa2d) --- target/linux/generic/hack-4.14/641-bridge_port_isolate.patch | 4 ++-- target/linux/generic/hack-4.9/641-bridge_port_isolate.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch index 538dbd16b09..43e71ee2ff7 100644 --- a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch +++ b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch @@ -62,7 +62,7 @@ Signed-off-by: Felix Fietkau BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD); -+BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE); ++BRPORT_ATTR_FLAG(isolated, BR_ISOLATE_MODE); #ifdef CONFIG_BRIDGE_IGMP_SNOOPING static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau &brport_attr_proxyarp_wifi, &brport_attr_multicast_flood, &brport_attr_broadcast_flood, -+ &brport_attr_isolate_mode, ++ &brport_attr_isolated, NULL }; diff --git a/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch index 0d0b2c73ffe..c545fa17ef8 100644 --- a/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch +++ b/target/linux/generic/hack-4.9/641-bridge_port_isolate.patch @@ -62,7 +62,7 @@ Signed-off-by: Felix Fietkau BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); -+BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE); ++BRPORT_ATTR_FLAG(isolated, BR_ISOLATE_MODE); #ifdef CONFIG_BRIDGE_IGMP_SNOOPING static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau &brport_attr_proxyarp, &brport_attr_proxyarp_wifi, &brport_attr_multicast_flood, -+ &brport_attr_isolate_mode, ++ &brport_attr_isolated, NULL }; From e68e498ff35412daba861c9d6d8ebad8f22a6465 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 4 Jul 2018 20:14:08 +0200 Subject: [PATCH 163/399] kernel: replace bridge port isolate hack with upstream patch backport on 4.14 Signed-off-by: Felix Fietkau (backported from 21ee8ce9b52f8ae4a6babf4032f71e2d4d56392b) (rebased patches) Signed-off-by: Jo-Philipp Wich --- ...ridge-add-support-for-port-isolation.patch | 145 ++++++++++++++++++ .../640-bridge-only-accept-EAP-locally.patch | 7 +- .../hack-4.14/641-bridge_port_isolate.patch | 76 --------- ...ge_allow_receiption_on_disabled_port.patch | 4 +- 4 files changed, 150 insertions(+), 82 deletions(-) create mode 100644 target/linux/generic/backport-4.14/090-net-bridge-add-support-for-port-isolation.patch delete mode 100644 target/linux/generic/hack-4.14/641-bridge_port_isolate.patch diff --git a/target/linux/generic/backport-4.14/090-net-bridge-add-support-for-port-isolation.patch b/target/linux/generic/backport-4.14/090-net-bridge-add-support-for-port-isolation.patch new file mode 100644 index 00000000000..6237177a45b --- /dev/null +++ b/target/linux/generic/backport-4.14/090-net-bridge-add-support-for-port-isolation.patch @@ -0,0 +1,145 @@ +From: Nikolay Aleksandrov +Date: Thu, 24 May 2018 11:56:48 +0300 +Subject: [PATCH] net: bridge: add support for port isolation + +This patch adds support for a new port flag - BR_ISOLATED. If it is set +then isolated ports cannot communicate between each other, but they can +still communicate with non-isolated ports. The same can be achieved via +ACLs but they can't scale with large number of ports and also the +complexity of the rules grows. This feature can be used to achieve +isolated vlan functionality (similar to pvlan) as well, though currently +it will be port-wide (for all vlans on the port). The new test in +should_deliver uses data that is already cache hot and the new boolean +is used to avoid an additional source port test in should_deliver. + +Signed-off-by: Nikolay Aleksandrov +Reviewed-by: Toshiaki Makita +Signed-off-by: David S. Miller +--- + +--- a/include/uapi/linux/if_link.h ++++ b/include/uapi/linux/if_link.h +@@ -326,6 +326,8 @@ enum { + IFLA_BRPORT_MCAST_TO_UCAST, + IFLA_BRPORT_VLAN_TUNNEL, + IFLA_BRPORT_BCAST_FLOOD, ++ IFLA_BRPORT_NEIGH_SUPPRESS, ++ IFLA_BRPORT_ISOLATED, + __IFLA_BRPORT_MAX + }; + #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) +--- a/net/bridge/br_forward.c ++++ b/net/bridge/br_forward.c +@@ -30,7 +30,8 @@ static inline int should_deliver(const s + vg = nbp_vlan_group_rcu(p); + return ((p->flags & BR_HAIRPIN_MODE) || skb->dev != p->dev) && + br_allowed_egress(vg, skb) && p->state == BR_STATE_FORWARDING && +- nbp_switchdev_allowed_egress(p, skb); ++ nbp_switchdev_allowed_egress(p, skb) && ++ !br_skb_isolated(p, skb); + } + + int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb) +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -170,6 +170,7 @@ int br_handle_frame_finish(struct net *n + goto drop; + + BR_INPUT_SKB_CB(skb)->brdev = br->dev; ++ BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED); + + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) + br_do_proxy_arp(skb, br, vid, p); +--- a/net/bridge/br_netlink.c ++++ b/net/bridge/br_netlink.c +@@ -138,6 +138,7 @@ static inline size_t br_port_info_size(v + + nla_total_size(1) /* IFLA_BRPORT_PROXYARP */ + + nla_total_size(1) /* IFLA_BRPORT_PROXYARP_WIFI */ + + nla_total_size(1) /* IFLA_BRPORT_VLAN_TUNNEL */ ++ + nla_total_size(1) /* IFLA_BRPORT_ISOLATED */ + + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_ROOT_ID */ + + nla_total_size(sizeof(struct ifla_bridge_id)) /* IFLA_BRPORT_BRIDGE_ID */ + + nla_total_size(sizeof(u16)) /* IFLA_BRPORT_DESIGNATED_PORT */ +@@ -208,7 +209,8 @@ static int br_port_fill_attrs(struct sk_ + p->topology_change_ack) || + nla_put_u8(skb, IFLA_BRPORT_CONFIG_PENDING, p->config_pending) || + nla_put_u8(skb, IFLA_BRPORT_VLAN_TUNNEL, !!(p->flags & +- BR_VLAN_TUNNEL))) ++ BR_VLAN_TUNNEL)) || ++ nla_put_u8(skb, IFLA_BRPORT_ISOLATED, !!(p->flags & BR_ISOLATED))) + return -EMSGSIZE; + + timerval = br_timer_value(&p->message_age_timer); +@@ -637,6 +639,7 @@ static const struct nla_policy br_port_p + [IFLA_BRPORT_MCAST_TO_UCAST] = { .type = NLA_U8 }, + [IFLA_BRPORT_MCAST_FLOOD] = { .type = NLA_U8 }, + [IFLA_BRPORT_BCAST_FLOOD] = { .type = NLA_U8 }, ++ [IFLA_BRPORT_ISOLATED] = { .type = NLA_U8 }, + }; + + /* Change the state of the port and notify spanning tree */ +@@ -773,6 +776,11 @@ static int br_setport(struct net_bridge_ + return err; + } + #endif ++ ++ err = br_set_port_flag(p, tb, IFLA_BRPORT_ISOLATED, BR_ISOLATED); ++ if (err) ++ return err; ++ + br_port_flags_change(p, old_flags ^ p->flags); + return 0; + } +--- a/net/bridge/br_private.h ++++ b/net/bridge/br_private.h +@@ -407,6 +407,7 @@ struct br_input_skb_cb { + #endif + + bool proxyarp_replied; ++ bool src_port_isolated; + + #ifdef CONFIG_BRIDGE_VLAN_FILTERING + bool vlan_filtered; +@@ -554,6 +555,14 @@ int br_forward_finish(struct net *net, s + void br_flood(struct net_bridge *br, struct sk_buff *skb, + enum br_pkt_type pkt_type, bool local_rcv, bool local_orig); + ++/* return true if both source port and dest port are isolated */ ++static inline bool br_skb_isolated(const struct net_bridge_port *to, ++ const struct sk_buff *skb) ++{ ++ return BR_INPUT_SKB_CB(skb)->src_port_isolated && ++ (to->flags & BR_ISOLATED); ++} ++ + /* br_if.c */ + void br_port_carrier_check(struct net_bridge_port *p); + int br_add_bridge(struct net *net, const char *name); +--- a/net/bridge/br_sysfs_if.c ++++ b/net/bridge/br_sysfs_if.c +@@ -174,6 +174,7 @@ BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); + BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); + BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); + BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD); ++BRPORT_ATTR_FLAG(isolated, BR_ISOLATED); + + #ifdef CONFIG_BRIDGE_IGMP_SNOOPING + static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) +@@ -223,6 +224,7 @@ static const struct brport_attribute *br + &brport_attr_proxyarp_wifi, + &brport_attr_multicast_flood, + &brport_attr_broadcast_flood, ++ &brport_attr_isolated, + NULL + }; + +--- a/include/linux/if_bridge.h ++++ b/include/linux/if_bridge.h +@@ -49,6 +49,7 @@ struct br_ip_list { + #define BR_MULTICAST_TO_UNICAST BIT(12) + #define BR_VLAN_TUNNEL BIT(13) + #define BR_BCAST_FLOOD BIT(14) ++#define BR_ISOLATED BIT(16) + + #define BR_DEFAULT_AGEING_TIME (300 * HZ) + diff --git a/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch index 83c9cf739fd..0dbb8ee3c0a 100644 --- a/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch +++ b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c -@@ -166,11 +166,14 @@ int br_handle_frame_finish(struct net *n +@@ -166,10 +166,14 @@ int br_handle_frame_finish(struct net *n } } @@ -26,7 +26,6 @@ Signed-off-by: Felix Fietkau goto drop; - BR_INPUT_SKB_CB(skb)->brdev = br->dev; -- - if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) - br_do_proxy_arp(skb, br, vid, p); + BR_INPUT_SKB_CB(skb)->src_port_isolated = !!(p->flags & BR_ISOLATED); + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) diff --git a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch deleted file mode 100644 index 43e71ee2ff7..00000000000 --- a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch +++ /dev/null @@ -1,76 +0,0 @@ -From e988390850731aa1697ed09d47b0932fac1af175 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Fri, 7 Jul 2017 17:20:03 +0200 -Subject: bridge: port isolate - -Isolating individual bridge ports - -Signed-off-by: Felix Fietkau ---- - include/linux/if_bridge.h | 1 + - net/bridge/br_forward.c | 5 +++++ - net/bridge/br_input.c | 3 +++ - net/bridge/br_sysfs_if.c | 2 ++ - 4 files changed, 11 insertions(+) - ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -49,6 +49,7 @@ struct br_ip_list { - #define BR_MULTICAST_TO_UNICAST BIT(12) - #define BR_VLAN_TUNNEL BIT(13) - #define BR_BCAST_FLOOD BIT(14) -+#define BR_ISOLATE_MODE BIT(15) - - #define BR_DEFAULT_AGEING_TIME (300 * HZ) - ---- a/net/bridge/br_forward.c -+++ b/net/bridge/br_forward.c -@@ -141,6 +141,9 @@ static int deliver_clone(const struct ne - void br_forward(const struct net_bridge_port *to, - struct sk_buff *skb, bool local_rcv, bool local_orig) - { -+ if (to->flags & BR_ISOLATE_MODE && !local_orig) -+ to = NULL; -+ - if (to && should_deliver(to, skb)) { - if (local_rcv) - deliver_clone(to, skb, local_orig); -@@ -183,6 +186,8 @@ void br_flood(struct net_bridge *br, str - struct net_bridge_port *p; - - list_for_each_entry_rcu(p, &br->port_list, list) { -+ if (!local_orig && (p->flags & BR_ISOLATE_MODE)) -+ continue; - /* Do not flood unicast traffic to ports that turn it off, nor - * other traffic if flood off, except for traffic we originate - */ ---- a/net/bridge/br_input.c -+++ b/net/bridge/br_input.c -@@ -177,6 +177,9 @@ int br_handle_frame_finish(struct net *n - if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) - br_do_proxy_arp(skb, br, vid, p); - -+ if (p->flags & BR_ISOLATE_MODE) -+ return br_pass_frame_up(skb); -+ - switch (pkt_type) { - case BR_PKT_MULTICAST: - mdst = br_mdb_get(br, skb, vid); ---- a/net/bridge/br_sysfs_if.c -+++ b/net/bridge/br_sysfs_if.c -@@ -174,6 +174,7 @@ BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); - BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); - BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); - BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD); -+BRPORT_ATTR_FLAG(isolated, BR_ISOLATE_MODE); - - #ifdef CONFIG_BRIDGE_IGMP_SNOOPING - static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) -@@ -223,6 +224,7 @@ static const struct brport_attribute *br - &brport_attr_proxyarp_wifi, - &brport_attr_multicast_flood, - &brport_attr_broadcast_flood, -+ &brport_attr_isolated, - NULL - }; - diff --git a/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch b/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch index 03267310a0a..9fcffdee067 100644 --- a/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch +++ b/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/net/bridge/br_input.c +++ b/net/bridge/br_input.c -@@ -238,7 +238,8 @@ static int br_handle_local_finish(struct +@@ -239,7 +239,8 @@ static int br_handle_local_finish(struct { struct net_bridge_port *p = br_port_get_rcu(skb->dev); @@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau BR_INPUT_SKB_CB(skb)->brdev = p->br->dev; br_pass_frame_up(skb); -@@ -326,6 +327,15 @@ rx_handler_result_t br_handle_frame(stru +@@ -327,6 +328,15 @@ rx_handler_result_t br_handle_frame(stru forward: switch (p->state) { From 6d5a6c5c9b0ee51b3cb5bfbecf33981dc97f16da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=9B=BD?= Date: Fri, 6 Jul 2018 18:03:40 +0800 Subject: [PATCH 164/399] verbose.mk: quote SUBMAKE options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit build openwrt on centos 6 I should use devtoolset-3 to get gcc 4.9, but it fail when make menuconfig. so I have to give option HOSTCC='gcc -Wl,--copy-dt-needed-entries' to make. But it passed to sub make to HOSTCC=gcc as micro SUBMAKE expand to HOSTCC=gcc -Wl,--copy-dt-needed-entries. This patch fix this issue. make -C build menuconfig HOSTCC='gcc -Wl,--copy-dt-needed-entries' V='1' make: Entering directory `/work/openwrt/openwrt/build' /opt/rh/devtoolset-3/root/usr/libexec/gcc/x86_64-redhat-linux/4.9.2/ld: lxdialog/checklist.o: undefined reference to symbol 'acs_map' //lib64/libtinfo.so.5: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[1]: *** [mconf] Error 1 make -s -C scripts/config all CC=gcc -Wl,--copy-dt-needed-entries: build failed. Please re-run make with -j1 V=s to see what's going on make: *** [scripts/config/mconf] Error 1 make: Leaving directory `/work/openwrt/openwrt/build' Signed-off-by: 李国 (backported from 671999157d6cd0b629304f86beec7d71fc998b09) --- include/verbose.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/verbose.mk b/include/verbose.mk index b7e43f74300..e02aefe8dda 100644 --- a/include/verbose.mk +++ b/include/verbose.mk @@ -54,7 +54,7 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),) else SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1) export QUIET:=1 - SUBMAKE=cmd() { $(SILENT) $(MAKE) -s $$* < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s to see what's going on"; false; } } 8>&1 9>&2; cmd + SUBMAKE=cmd() { $(SILENT) $(MAKE) -s "$$@" < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s to see what's going on"; false; } } 8>&1 9>&2; cmd endif .SILENT: $(MAKECMDGOALS) From fa112bc46ac71255df0e71a8a468a3cffd63d3e0 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Tue, 3 Jul 2018 08:54:41 +0200 Subject: [PATCH 165/399] librpc: add host build to install h files needed for nfs-kernel-server to get compiled Signed-off-by: Peter Wagner (backported from d8d2133c35c9c9b410e16cdebe878acd0da6382f) --- package/libs/librpc/Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/libs/librpc/Makefile b/package/libs/librpc/Makefile index e8f51a23f1b..d894dd3bdbd 100644 --- a/package/libs/librpc/Makefile +++ b/package/libs/librpc/Makefile @@ -10,6 +10,7 @@ PKG_SOURCE_VERSION:=a921e3ded051746f9f7cd5e5a312fb6771716aac PKG_MIRROR_HASH:=22c8dc55e1c4e8e31635a37708a3ce622a6ca33ebd918a4321b0be6ffce89b21 CMAKE_INSTALL:=1 PKG_USE_MIPS16:=0 +PKG_BUILD_DEPENDS:=librpc/host PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= @@ -17,6 +18,7 @@ PKG_LICENSE_FILES:= PKG_MAINTAINER:=Felix Fietkau include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk define Package/librpc @@ -30,4 +32,11 @@ define Package/librpc/install $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/librpc.so $(1)/lib/ endef +define Host/Install + $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include/rpc + $(INSTALL_DATA) $(HOST_BUILD_DIR)/rpc/types.h $(STAGING_DIR_HOSTPKG)/include/rpc + $(INSTALL_DATA) $(HOST_BUILD_DIR)/rpc/compat.h $(STAGING_DIR_HOSTPKG)/include/rpc +endef + +$(eval $(call HostBuild)) $(eval $(call BuildPackage,librpc)) From 0282d04a85b3c5232742e9084a165d1b5406a0af Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 17 Jul 2018 16:01:46 +0200 Subject: [PATCH 166/399] openvpn: increase procd termination timeout to 15s Increase the termination timeout to 15s to let OpenVPN properly tear down its connections, especially when weak links or complex down scripts are involved. Fixes FS#859. Signed-off-by: Jo-Philipp Wich (backported from 28d3a1b54b6726a0a93477d75d09a25f74ee361f) --- package/network/services/openvpn/Makefile | 2 +- package/network/services/openvpn/files/openvpn.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index ae49d4dc687..360ee56fa71 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn PKG_VERSION:=2.4.5 -PKG_RELEASE:=4.1 +PKG_RELEASE:=4.2 PKG_SOURCE_URL:=\ https://build.openvpn.net/downloads/releases/ \ diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index ab4f7dba0d4..7e6cfd9c351 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -67,6 +67,7 @@ openvpn_add_instance() { --cd "$dir" \ --config "$conf" procd_set_param file "$dir/$conf" + procd_set_param term_timeout 15 procd_set_param respawn procd_append_param respawn 3600 procd_append_param respawn 5 From 775473cf8d47ef6a4ef22349d4a1d67fed542e86 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Tue, 10 Jul 2018 21:17:33 +0200 Subject: [PATCH 167/399] hostapd: cleanup package definition Move common variables and/or values to the package (variant) default. Add additional values in variant packages if necessary. Remove further duplicates by introducing new templates. Remove the ANY_[HOSTAPD|SUPPLICANT_PROVIDERS]_PROVIDERS. The are the same as the variables without the any prefix. No need to maintain both variables. Signed-off-by: Mathias Kresin (backported from 8af8ceb1c8558a6f25c50cb68b87a3a3425f3417) --- package/network/services/hostapd/Makefile | 94 ++++++++++++----------- 1 file changed, 48 insertions(+), 46 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 5edc513e0e4..6bb699d1ff4 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -45,8 +45,6 @@ EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) -ANY_SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) -ANY_HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) ANY_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) LOCAL_TYPE=$(strip \ @@ -147,12 +145,14 @@ endif DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny + define Package/hostapd/Default SECTION:=net CATEGORY:=Network TITLE:=IEEE 802.1x Authenticator URL:=http://hostap.epitest.fi/ DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus + PROVIDES:=hostapd endef define Package/hostapd @@ -161,30 +161,29 @@ $(call Package/hostapd/Default) VARIANT:=full-internal endef +define Package/hostapd/description + This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS + Authenticator. +endef + define Package/hostapd-openssl $(call Package/hostapd/Default) TITLE+= (full) VARIANT:=full-openssl DEPENDS+=+libopenssl CONFLICTS:=$(filter-out hostapd-openssl ,$(HOSTAPD_ONLY_PROVIDERS)) - PROVIDES:=hostapd endef +Package/hostapd-openssl/description = $(Package/hostapd/description) + define Package/hostapd-wolfssl $(call Package/hostapd/Default) TITLE+= (full) VARIANT:=full-wolfssl DEPENDS+=+libwolfssl CONFLICTS:=$(filter-out hostapd-openssl ,$(filter-out hostapd-wolfssl ,$(HOSTAPD_ONLY_PROVIDERS))) - PROVIDES:=hostapd -endef - -define Package/hostapd/description - This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS - Authenticator. endef -Package/hostapd-openssl/description = $(Package/hostapd/description) Package/hostapd-wolfssl/description = $(Package/hostapd/description) define Package/hostapd-mini @@ -192,18 +191,18 @@ $(call Package/hostapd/Default) TITLE+= (WPA-PSK only) VARIANT:=mini CONFLICTS:=$(filter-out hostapd-wolfssl ,$(filter-out hostapd-openssl ,$(filter-out hostapd-mini ,$(HOSTAPD_ONLY_PROVIDERS)))) - PROVIDES:=hostapd endef define Package/hostapd-mini/description This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only). endef - define Package/hostapd-utils - $(call Package/hostapd/Default) - TITLE+= (utils) - DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(ANY_HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) + SECTION:=net + CATEGORY:=Network + TITLE:=IEEE 802.1x Authenticator (utils) + URL:=http://hostap.epitest.fi/ + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) endef define Package/hostapd-utils/description @@ -211,6 +210,7 @@ define Package/hostapd-utils/description IEEE 802.1x/WPA/EAP/RADIUS Authenticator. endef + define Package/wpad/Default SECTION:=net CATEGORY:=Network @@ -234,6 +234,11 @@ $(call Package/wpad/Default) )))))) endef +define Package/wpad/description + This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS + Authenticator and Supplicant +endef + define Package/wpad-openssl $(call Package/wpad/Default) TITLE+= (full) @@ -245,6 +250,8 @@ $(call Package/wpad/Default) $(ANY_PROVIDERS)))) endef +Package/wpad-openssl/description = $(Package/wpad/description) + define Package/wpad-wolfssl $(call Package/wpad/Default) TITLE+= (full) @@ -257,12 +264,6 @@ $(call Package/wpad/Default) $(ANY_PROVIDERS))))) endef -define Package/wpad/description - This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS - Authenticator and Supplicant -endef - -Package/wpad-openssl/description = $(Package/wpad/description) Package/wpad-wolfssl/description = $(Package/wpad/description) define Package/wpad-mini @@ -276,37 +277,43 @@ define Package/wpad-mini/description This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only). endef -define Package/wpad-mesh-openssl +define Package/wpad-mesh $(call Package/wpad/Default) TITLE+= (with 802.11s mesh and SAE support) - DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) +libopenssl + DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) + PROVIDES+=wpa-supplicant-mesh wpad-mesh +endef + +define Package/wpad-mesh/description + This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support). +endef + +define Package/wpad-mesh-openssl +$(call Package/wpad-mesh) + DEPENDS+=+libopenssl VARIANT:=wpad-mesh-openssl CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(ANY_PROVIDERS)) - PROVIDES+=wpa-supplicant-mesh wpad-mesh endef +Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description) + define Package/wpad-mesh-wolfssl -$(call Package/wpad/Default) - TITLE+= (with 802.11s mesh and SAE support) - DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) +libwolfssl +$(call Package/wpad-mesh) + DEPENDS+=+libwolfssl VARIANT:=wpad-mesh-wolfssl CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(filter-out wpad-mesh-wolfssl ,$(ANY_PROVIDERS))) - PROVIDES+=wpa-supplicant-mesh wpad-mesh -endef - -define Package/wpad-mesh/description - This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support). endef -Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description) Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description) + define Package/wpa-supplicant/Default SECTION:=net CATEGORY:=Network TITLE:=WPA Supplicant URL:=http://hostap.epitest.fi/wpa_supplicant/ DEPENDS:=$(DRV_DEPENDS) + PROVIDES:=wpa-supplicant endef define Package/wpa-supplicant @@ -325,7 +332,6 @@ define Package/wpa-supplicant-openssl )))) VARIANT:=supplicant-full-openssl DEPENDS+=+libopenssl - PROVIDES:=wpa-supplicant endef define Package/wpa-supplicant-wolfssl @@ -338,7 +344,6 @@ define Package/wpa-supplicant-wolfssl )))) VARIANT:=supplicant-full-wolfssl DEPENDS+=+libwolfssl - PROVIDES:=wpa-supplicant endef define Package/wpa-supplicant/config @@ -346,9 +351,9 @@ define Package/wpa-supplicant/config endef define Package/wpa-supplicant-p2p - $(Package/wpa-supplicant) - TITLE:=WPA Supplicant (with Wi-Fi P2P support) - DEPENDS:=$(DRV_DEPENDS) @PACKAGE_kmod-cfg80211 + $(Package/wpa-supplicant/Default) + TITLE+= (with Wi-Fi P2P support) + DEPENDS+=@PACKAGE_kmod-cfg80211 CONFLICTS:=$(filter-out wpa-supplicant-openssl ,\ $(filter-out wpa-supplicant-wolfssl ,\ $(filter-out wpa-supplicant-p2p ,\ @@ -357,14 +362,13 @@ define Package/wpa-supplicant-p2p $(SUPPLICANT_ONLY_PROVIDERS)\ ))))) VARIANT:=supplicant-p2p-internal - PROVIDES:=wpa-supplicant endef define Package/wpa-supplicant-mesh/Default $(Package/wpa-supplicant/Default) - TITLE:=WPA Supplicant (with 802.11s and SAE) - DEPENDS:=$(DRV_DEPENDS) @PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) - PROVIDES:=wpa-supplicant wpa-supplicant-mesh + TITLE+= (with 802.11s and SAE) + DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) + PROVIDES+=wpa-supplicant-mesh endef define Package/wpa-supplicant-mesh-openssl @@ -383,16 +387,14 @@ endef define Package/wpa-supplicant-mini $(Package/wpa-supplicant/Default) - TITLE:=WPA Supplicant (minimal version) - DEPENDS:=$(DRV_DEPENDS) + TITLE+= (minimal version) VARIANT:=supplicant-mini - PROVIDES:=wpa-supplicant endef define Package/wpa-cli SECTION:=net CATEGORY:=Network - DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(ANY_SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) TITLE:=WPA Supplicant command line control utility endef From 4e4d124b27a35d97ab164a9eeea559733f14d07a Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Wed, 11 Jul 2018 22:13:36 +0200 Subject: [PATCH 168/399] hostapd: fix conflicts hell Add each variant to the matching PROVIDERS variables after evaluating the respective hostapd*, wpad* and wpa* variant. Each package providing the same feature will automatically conflict with all prior packages providing the same feature. This way we can handle the conflicts automatically without introducing recursive dependencies. Signed-off-by: Mathias Kresin (backported from 3838b16943c6021e3ff06d5733df890408ad7158) --- package/network/services/hostapd/Makefile | 142 +++++++--------------- 1 file changed, 47 insertions(+), 95 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 6bb699d1ff4..5158d8a9f54 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -32,20 +32,10 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_DRIVER_11N_SUPPORT \ CONFIG_DRIVER_11AC_SUPPORT \ -WPAD_PROVIDERS:=wpad-mini wpad wpad-openssl wpad-wolfssl \ - wpad-mesh-openssl wpad-mesh-wolfssl - -SUPPLICANT_ONLY_PROVIDERS:=wpa-supplicant-mini wpa-supplicant-p2p \ - wpa-supplicant wpa-supplicant-openssl wpa-supplicant-wolfssl \ - wpa-supplicant-mesh-openssl wpa-supplicant-mesh-wolfssl - -HOSTAPD_ONLY_PROVIDERS:=hostapd-mini hostapd hostapd-openssl hostapd-wolfssl - EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl -SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) -HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) -ANY_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS) +SUPPLICANT_PROVIDERS:= +HOSTAPD_PROVIDERS:= LOCAL_TYPE=$(strip \ $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \ @@ -153,10 +143,12 @@ define Package/hostapd/Default URL:=http://hostap.epitest.fi/ DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus PROVIDES:=hostapd + CONFLICTS:=$(HOSTAPD_PROVIDERS) + HOSTAPD_PROVIDERS+=$(1) endef define Package/hostapd -$(call Package/hostapd/Default) +$(call Package/hostapd/Default,$(1)) TITLE+= (full) VARIANT:=full-internal endef @@ -167,49 +159,33 @@ define Package/hostapd/description endef define Package/hostapd-openssl -$(call Package/hostapd/Default) +$(call Package/hostapd/Default,$(1)) TITLE+= (full) VARIANT:=full-openssl DEPENDS+=+libopenssl - CONFLICTS:=$(filter-out hostapd-openssl ,$(HOSTAPD_ONLY_PROVIDERS)) endef Package/hostapd-openssl/description = $(Package/hostapd/description) define Package/hostapd-wolfssl -$(call Package/hostapd/Default) +$(call Package/hostapd/Default,$(1)) TITLE+= (full) VARIANT:=full-wolfssl DEPENDS+=+libwolfssl - CONFLICTS:=$(filter-out hostapd-openssl ,$(filter-out hostapd-wolfssl ,$(HOSTAPD_ONLY_PROVIDERS))) endef Package/hostapd-wolfssl/description = $(Package/hostapd/description) define Package/hostapd-mini -$(call Package/hostapd/Default) +$(call Package/hostapd/Default,$(1)) TITLE+= (WPA-PSK only) VARIANT:=mini - CONFLICTS:=$(filter-out hostapd-wolfssl ,$(filter-out hostapd-openssl ,$(filter-out hostapd-mini ,$(HOSTAPD_ONLY_PROVIDERS)))) endef define Package/hostapd-mini/description This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only). endef -define Package/hostapd-utils - SECTION:=net - CATEGORY:=Network - TITLE:=IEEE 802.1x Authenticator (utils) - URL:=http://hostap.epitest.fi/ - DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) -endef - -define Package/hostapd-utils/description - This package contains a command line utility to control the - IEEE 802.1x/WPA/EAP/RADIUS Authenticator. -endef - define Package/wpad/Default SECTION:=net @@ -218,20 +194,15 @@ define Package/wpad/Default DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus URL:=http://hostap.epitest.fi/ PROVIDES:=hostapd wpa-supplicant + CONFLICTS:=$(HOSTAPD_PROVIDERS) $(SUPPLICANT_PROVIDERS) + HOSTAPD_PROVIDERS+=$(1) + SUPPLICANT_PROVIDERS+=$(1) endef define Package/wpad -$(call Package/wpad/Default) +$(call Package/wpad/Default,$(1)) TITLE+= (full) VARIANT:=wpad-full-internal - CONFLICTS:=$(filter-out wpad-mesh-wolfssl,\ - $(filter-out wpad-mesh-openssl ,\ - $(filter-out wpad-openssl ,\ - $(filter-out wpad-wolfssl ,\ - $(filter-out wpad-wolfssl ,\ - $(filter-out wpad ,\ - $(ANY_PROVIDERS)\ - )))))) endef define Package/wpad/description @@ -240,37 +211,27 @@ define Package/wpad/description endef define Package/wpad-openssl -$(call Package/wpad/Default) +$(call Package/wpad/Default,$(1)) TITLE+= (full) VARIANT:=wpad-full-openssl DEPENDS+=+libopenssl - CONFLICTS:=$(filter-out wpad-mesh-wolfssl,\ - $(filter-out wpad-mesh-openssl ,\ - $(filter-out wpad-openssl ,\ - $(ANY_PROVIDERS)))) endef Package/wpad-openssl/description = $(Package/wpad/description) define Package/wpad-wolfssl -$(call Package/wpad/Default) +$(call Package/wpad/Default,$(1)) TITLE+= (full) VARIANT:=wpad-full-wolfssl DEPENDS+=+libwolfssl - CONFLICTS:=$(filter-out wpad-mesh-wolfssl ,\ - $(filter-out wpad-mesh-openssl ,\ - $(filter-out wpad-openssl ,\ - $(filter-out wpad-wolfssl ,\ - $(ANY_PROVIDERS))))) endef Package/wpad-wolfssl/description = $(Package/wpad/description) define Package/wpad-mini -$(call Package/wpad/Default) +$(call Package/wpad/Default,$(1)) TITLE+= (WPA-PSK only) VARIANT:=wpad-mini - CONFLICTS:=$(SUPPLICANT_ONLY_PROVIDERS) endef define Package/wpad-mini/description @@ -278,7 +239,7 @@ define Package/wpad-mini/description endef define Package/wpad-mesh -$(call Package/wpad/Default) +$(call Package/wpad/Default,$(1)) TITLE+= (with 802.11s mesh and SAE support) DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) PROVIDES+=wpa-supplicant-mesh wpad-mesh @@ -289,19 +250,17 @@ define Package/wpad-mesh/description endef define Package/wpad-mesh-openssl -$(call Package/wpad-mesh) +$(call Package/wpad-mesh,$(1)) DEPENDS+=+libopenssl VARIANT:=wpad-mesh-openssl - CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(ANY_PROVIDERS)) endef Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description) define Package/wpad-mesh-wolfssl -$(call Package/wpad-mesh) +$(call Package/wpad-mesh,$(1)) DEPENDS+=+libwolfssl VARIANT:=wpad-mesh-wolfssl - CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(filter-out wpad-mesh-wolfssl ,$(ANY_PROVIDERS))) endef Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description) @@ -314,34 +273,23 @@ define Package/wpa-supplicant/Default URL:=http://hostap.epitest.fi/wpa_supplicant/ DEPENDS:=$(DRV_DEPENDS) PROVIDES:=wpa-supplicant + CONFLICTS:=$(SUPPLICANT_PROVIDERS) + SUPPLICANT_PROVIDERS+=$(1) endef define Package/wpa-supplicant - $(Package/wpa-supplicant/Default) +$(call Package/wpa-supplicant/Default,$(1)) VARIANT:=supplicant-full-internal - CONFLICTS:=wpa-supplicant-mini endef define Package/wpa-supplicant-openssl - $(Package/wpa-supplicant/Default) - CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,\ - $(filter-out wpa-supplicant-openssl ,\ - $(filter-out wpa-supplicant-mesh-openssl ,\ - $(filter-out wpa-supplicant-mesh-wolfssl ,\ - $(SUPPLICANT_ONLY_PROVIDERS)\ - )))) +$(call Package/wpa-supplicant/Default,$(1)) VARIANT:=supplicant-full-openssl DEPENDS+=+libopenssl endef define Package/wpa-supplicant-wolfssl - $(Package/wpa-supplicant/Default) - CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,\ - $(filter-out wpa-supplicant-openssl ,\ - $(filter-out wpa-supplicant-mesh-openssl ,\ - $(filter-out wpa-supplicant-mesh-wolfssl ,\ - $(SUPPLICANT_ONLY_PROVIDERS)\ - )))) +$(call Package/wpa-supplicant/Default,$(1)) VARIANT:=supplicant-full-wolfssl DEPENDS+=+libwolfssl endef @@ -351,57 +299,61 @@ define Package/wpa-supplicant/config endef define Package/wpa-supplicant-p2p - $(Package/wpa-supplicant/Default) +$(call Package/wpa-supplicant/Default,$(1)) TITLE+= (with Wi-Fi P2P support) DEPENDS+=@PACKAGE_kmod-cfg80211 - CONFLICTS:=$(filter-out wpa-supplicant-openssl ,\ - $(filter-out wpa-supplicant-wolfssl ,\ - $(filter-out wpa-supplicant-p2p ,\ - $(filter-out wpa-supplicant-mesh-openssl ,\ - $(filter-out wpa-supplicant-mesh-wolfssl ,\ - $(SUPPLICANT_ONLY_PROVIDERS)\ - ))))) - VARIANT:=supplicant-p2p-internal endef define Package/wpa-supplicant-mesh/Default - $(Package/wpa-supplicant/Default) +$(call Package/wpa-supplicant/Default,$(1)) TITLE+= (with 802.11s and SAE) DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN) PROVIDES+=wpa-supplicant-mesh endef define Package/wpa-supplicant-mesh-openssl - $(Package/wpa-supplicant-mesh/Default) +$(call Package/wpa-supplicant-mesh/Default,$(1)) VARIANT:=supplicant-mesh-openssl - CONFLICTS:=$(filter-out wpa-supplicant-mesh-openssl ,$(SUPPLICANT_ONLY_PROVIDERS)) DEPENDS+=+libopenssl endef define Package/wpa-supplicant-mesh-wolfssl - $(Package/wpa-supplicant-mesh/Default) +$(call Package/wpa-supplicant-mesh/Default,$(1)) VARIANT:=supplicant-mesh-wolfssl - CONFLICTS:=$(filter-out wpa-supplicant-mesh-openssl ,$(filter-out wpa-supplicant-mesh-wolfssl ,$(SUPPLICANT_ONLY_PROVIDERS))) DEPENDS+=+libwolfssl endef define Package/wpa-supplicant-mini - $(Package/wpa-supplicant/Default) +$(call Package/wpa-supplicant/Default,$(1)) TITLE+= (minimal version) VARIANT:=supplicant-mini endef -define Package/wpa-cli + +define Package/hostapd-common + TITLE:=hostapd/wpa_supplicant common support files SECTION:=net CATEGORY:=Network - DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) - TITLE:=WPA Supplicant command line control utility endef -define Package/hostapd-common - TITLE:=hostapd/wpa_supplicant common support files +define Package/hostapd-utils + SECTION:=net + CATEGORY:=Network + TITLE:=IEEE 802.1x Authenticator (utils) + URL:=http://hostap.epitest.fi/ + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg))) +endef + +define Package/hostapd-utils/description + This package contains a command line utility to control the + IEEE 802.1x/WPA/EAP/RADIUS Authenticator. +endef + +define Package/wpa-cli SECTION:=net CATEGORY:=Network + DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg))) + TITLE:=WPA Supplicant command line control utility endef define Package/eapol-test From aa3e4d56c6a569cd230a0463200ca50102f031db Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 17 Jul 2018 19:41:09 -0300 Subject: [PATCH 169/399] base-files: fix wrong sysctl parameter order Restarting service sysctl echos multiple errors like: sysctl: -e: No such file or directory After the first filename, all remaining arguments are treated as files. Signed-off-by: Luiz Angelo Daros de Luca (backported from 4c4288728611d334efb777b74e737e1f98e0dc1b) --- package/base-files/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index ca1cb47a6cc..8775ffbc80e 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=192 +PKG_RELEASE:=193 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ From e5c46a112beda48cbef5c15d3b4dfca47570b84e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 19 Jul 2018 17:13:25 +0200 Subject: [PATCH 170/399] hostapd: remove unused struct hostapd_ubus_iface Signed-off-by: Felix Fietkau (backported from f0ac9afe695ed297caf093f02144b2adf04bca87) --- .../services/hostapd/patches/600-ubus_support.patch | 11 +---------- package/network/services/hostapd/src/src/ap/ubus.h | 6 ------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 022f02d0f1e..a4c4a67fc34 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -30,16 +30,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -392,6 +394,8 @@ struct hostapd_iface { - struct hostapd_config *conf; - char phy[16]; /* Name of the PHY (radio) */ - -+ struct hostapd_ubus_iface ubus; -+ - enum hostapd_iface_state { - HAPD_IFACE_UNINITIALIZED, - HAPD_IFACE_DISABLED, -@@ -544,6 +548,7 @@ hostapd_alloc_bss_data(struct hostapd_if +@@ -544,6 +546,7 @@ hostapd_alloc_bss_data(struct hostapd_if struct hostapd_bss_config *bss); int hostapd_setup_interface(struct hostapd_iface *iface); int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index e3ff981c7dc..ca63b34cb71 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -30,10 +30,6 @@ struct hostapd_data; #include #include -struct hostapd_ubus_iface { - struct ubus_object obj; -}; - struct hostapd_ubus_bss { struct ubus_object obj; struct avl_tree banned; @@ -50,8 +46,6 @@ void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 * #else -struct hostapd_ubus_iface {}; - struct hostapd_ubus_bss {}; static inline void hostapd_ubus_add_iface(struct hostapd_iface *iface) From f8750b1a433fc6f590dc5214a90b6b370f8833da Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 24 Jul 2018 13:36:28 +0200 Subject: [PATCH 171/399] build: prereq-build.mk: fix gcc/g++ SetupHostCommand invocation A missing comma caused the first command option to be considered part of the error message. Signed-off-by: Jo-Philipp Wich (backported from a6f4c7bce8c62d2dded5c8c12f7f118e2a6c9ee5) --- include/prereq-build.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index edd63e9ee68..029249f69cb 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -27,7 +27,7 @@ $(eval $(call TestHostCommand,proper-umask, \ umask | grep -xE 00[012][012])) $(eval $(call SetupHostCommand,gcc, \ - Please install the GNU C Compiler (gcc) 4.8 or later \ + Please install the GNU C Compiler (gcc) 4.8 or later, \ $(CC) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \ gcc -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \ gcc48 --version | grep gcc, \ @@ -46,7 +46,7 @@ $(eval $(call TestHostCommand,working-gcc, \ gcc -x c -o $(TMP_DIR)/a.out -)) $(eval $(call SetupHostCommand,g++, \ - Please install the GNU C++ Compiler (g++) 4.8 or later \ + Please install the GNU C++ Compiler (g++) 4.8 or later, \ $(CXX) -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \ g++ -dumpversion | grep -E '^(4\.[8-9]|[5-9]\.?)', \ g++48 --version | grep g++, \ From c0673db23f1c98ccb9e5f71ec21b94153684fc80 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 24 Jul 2018 15:23:05 +0200 Subject: [PATCH 172/399] build: do not override CCACHE_DIR when ccache is disabled Signed-off-by: Jo-Philipp Wich (backported from 991c7a4f69976f72bcee3f76d6917b224da45ea1) --- include/host-build.mk | 2 +- include/package.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/host-build.mk b/include/host-build.mk index a2a31ae0489..827ea6bbfb1 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -132,7 +132,7 @@ define Host/Exports/Default $(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX) $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig - $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache) $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef diff --git a/include/package.mk b/include/package.mk index 2473eecb922..a03db11119c 100644 --- a/include/package.mk +++ b/include/package.mk @@ -144,7 +144,7 @@ define Build/Exports/Default $(1) : export CONFIG_SITE:=$$(CONFIG_SITE) $(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH) $(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH) - $(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache + $(if $(CONFIG_CCACHE),$(1) : export CCACHE_DIR:=$(STAGING_DIR)/ccache) endef Build/Exports=$(Build/Exports/Default) From edc2af2be931c43a1ee111800737b08bacc60126 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sun, 8 Jul 2018 01:38:08 +0200 Subject: [PATCH 173/399] kernel: improve ubi auto attach code readability Move the put_mtd_device() called on multiple error conditions to a goto label to use it later for more error conditions. The early return on failed open of the mtd device and mismatching mtd type allows to get rid of one level of indentation. By jumping to the cleanup code, a refcount bug is fixed for the wrong flash type condition. While at it, make clear that we only check for the UBI magic if the read from flash was successful. Signed-off-by: Mathias Kresin (backported from fdf6760cda15b2710287c66c9969a3ed527793d8) (rebased patches) Signed-off-by: Jo-Philipp Wich --- ...mtd-device-named-ubi-or-data-on-boot.patch | 57 ++++++++++--------- ...mtd-device-named-ubi-or-data-on-boot.patch | 57 ++++++++++--------- 2 files changed, 62 insertions(+), 52 deletions(-) diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 5d8f117dfc8..89bac648304 100644 --- a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1172,6 +1172,49 @@ static struct mtd_info * __init open_mtd +@@ -1172,6 +1172,54 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -20,45 +20,50 @@ Signed-off-by: Daniel Golle +{ + int err; + struct mtd_info *mtd; ++ size_t len; ++ char magic[4]; + + /* try attaching mtd device named "ubi" or "data" */ + mtd = open_mtd_device("ubi"); + if (IS_ERR(mtd)) + mtd = open_mtd_device("data"); + -+ if (!IS_ERR(mtd)) { -+ size_t len; -+ char magic[4]; ++ if (IS_ERR(mtd)) ++ return; ++ ++ /* check for a valid ubi magic if read from flash was successful */ ++ err = mtd_read(mtd, 0, 4, &len, (void *) magic); ++ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); ++ goto cleanup; ++ } + -+ /* check for a valid ubi magic */ -+ err = mtd_read(mtd, 0, 4, &len, (void *) magic); -+ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); -+ put_mtd_device(mtd); -+ return; -+ } ++ /* don't auto-add media types where UBI doesn't makes sense */ ++ if (mtd->type != MTD_NANDFLASH && ++ mtd->type != MTD_NORFLASH && ++ mtd->type != MTD_DATAFLASH && ++ mtd->type != MTD_MLCNANDFLASH) ++ goto cleanup; + -+ /* auto-add only media types where UBI makes sense */ -+ if (mtd->type == MTD_NANDFLASH || -+ mtd->type == MTD_NORFLASH || -+ mtd->type == MTD_DATAFLASH || -+ mtd->type == MTD_MLCNANDFLASH) { -+ mutex_lock(&ubi_devices_mutex); -+ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); -+ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); -+ mutex_unlock(&ubi_devices_mutex); -+ if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); -+ put_mtd_device(mtd); -+ } -+ } ++ mutex_lock(&ubi_devices_mutex); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); ++ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); ++ mutex_unlock(&ubi_devices_mutex); ++ if (err < 0) { ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); ++ goto cleanup; + } ++ ++ return; ++ ++cleanup: ++ put_mtd_device(mtd); +} + static int __init ubi_init(void) { int err, i, k; -@@ -1255,6 +1298,12 @@ static int __init ubi_init(void) +@@ -1255,6 +1303,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 8b37dba034c..1436e486dde 100644 --- a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1226,6 +1226,49 @@ static struct mtd_info * __init open_mtd +@@ -1226,6 +1226,54 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -20,45 +20,50 @@ Signed-off-by: Daniel Golle +{ + int err; + struct mtd_info *mtd; ++ size_t len; ++ char magic[4]; + + /* try attaching mtd device named "ubi" or "data" */ + mtd = open_mtd_device("ubi"); + if (IS_ERR(mtd)) + mtd = open_mtd_device("data"); + -+ if (!IS_ERR(mtd)) { -+ size_t len; -+ char magic[4]; ++ if (IS_ERR(mtd)) ++ return; ++ ++ /* check for a valid ubi magic if read from flash was successful */ ++ err = mtd_read(mtd, 0, 4, &len, (void *) magic); ++ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); ++ goto cleanup; ++ } + -+ /* check for a valid ubi magic */ -+ err = mtd_read(mtd, 0, 4, &len, (void *) magic); -+ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); -+ put_mtd_device(mtd); -+ return; -+ } ++ /* don't auto-add media types where UBI doesn't makes sense */ ++ if (mtd->type != MTD_NANDFLASH && ++ mtd->type != MTD_NORFLASH && ++ mtd->type != MTD_DATAFLASH && ++ mtd->type != MTD_MLCNANDFLASH) ++ goto cleanup; + -+ /* auto-add only media types where UBI makes sense */ -+ if (mtd->type == MTD_NANDFLASH || -+ mtd->type == MTD_NORFLASH || -+ mtd->type == MTD_DATAFLASH || -+ mtd->type == MTD_MLCNANDFLASH) { -+ mutex_lock(&ubi_devices_mutex); -+ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); -+ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); -+ mutex_unlock(&ubi_devices_mutex); -+ if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); -+ put_mtd_device(mtd); -+ } -+ } ++ mutex_lock(&ubi_devices_mutex); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); ++ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); ++ mutex_unlock(&ubi_devices_mutex); ++ if (err < 0) { ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); ++ goto cleanup; + } ++ ++ return; ++ ++cleanup: ++ put_mtd_device(mtd); +} + static int __init ubi_init(void) { int err, i, k; -@@ -1309,6 +1352,12 @@ static int __init ubi_init(void) +@@ -1309,6 +1357,12 @@ static int __init ubi_init(void) } } From e6945262642a3c83c4f9593286e0c7b794c211f0 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sun, 8 Jul 2018 01:47:28 +0200 Subject: [PATCH 174/399] kernel: handle bad blocks in ubi auto attach code The first block(s) of the ubi mtd device might be bad. We need to take care on our own to skip the bad block(s) and read the next one(s). Don't treat recoverable read errors as fatal and check for the UBI magic if the data of a block could be recovered using ECC or similar. Signed-off-by: Mathias Kresin (backported from 0ac91d82ed4d077150db902eb12d383c2be44fb2) (rebased patches) Signed-off-by: Jo-Philipp Wich --- ...mtd-device-named-ubi-or-data-on-boot.patch | 22 +++++++++++++++---- ...mtd-device-named-ubi-or-data-on-boot.patch | 22 +++++++++++++++---- 2 files changed, 36 insertions(+), 8 deletions(-) diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 89bac648304..ff3490bf9e0 100644 --- a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1172,6 +1172,54 @@ static struct mtd_info * __init open_mtd +@@ -1172,6 +1172,68 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -20,6 +20,7 @@ Signed-off-by: Daniel Golle +{ + int err; + struct mtd_info *mtd; ++ loff_t offset = 0; + size_t len; + char magic[4]; + @@ -31,9 +32,22 @@ Signed-off-by: Daniel Golle + if (IS_ERR(mtd)) + return; + ++ /* get the first not bad block */ ++ if (mtd_can_have_bb(mtd)) ++ while (mtd_block_isbad(mtd, offset)) { ++ offset += mtd->erasesize; ++ ++ if (offset > mtd->size) { ++ pr_err("UBI error: Failed to find a non-bad " ++ "block on mtd%d\n", mtd->index); ++ goto cleanup; ++ } ++ } ++ + /* check for a valid ubi magic if read from flash was successful */ -+ err = mtd_read(mtd, 0, 4, &len, (void *) magic); -+ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { ++ err = mtd_read(mtd, offset, 4, &len, (void *) magic); ++ if ((!err || mtd_is_bitflip(err)) && ++ len == 4 && strncmp(magic, "UBI#", 4)) { + pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + goto cleanup; + } @@ -63,7 +77,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1255,6 +1303,12 @@ static int __init ubi_init(void) +@@ -1255,6 +1317,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 1436e486dde..8b923d17d63 100644 --- a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1226,6 +1226,54 @@ static struct mtd_info * __init open_mtd +@@ -1226,6 +1226,68 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -20,6 +20,7 @@ Signed-off-by: Daniel Golle +{ + int err; + struct mtd_info *mtd; ++ loff_t offset = 0; + size_t len; + char magic[4]; + @@ -31,9 +32,22 @@ Signed-off-by: Daniel Golle + if (IS_ERR(mtd)) + return; + ++ /* get the first not bad block */ ++ if (mtd_can_have_bb(mtd)) ++ while (mtd_block_isbad(mtd, offset)) { ++ offset += mtd->erasesize; ++ ++ if (offset > mtd->size) { ++ pr_err("UBI error: Failed to find a non-bad " ++ "block on mtd%d\n", mtd->index); ++ goto cleanup; ++ } ++ } ++ + /* check for a valid ubi magic if read from flash was successful */ -+ err = mtd_read(mtd, 0, 4, &len, (void *) magic); -+ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { ++ err = mtd_read(mtd, offset, 4, &len, (void *) magic); ++ if ((!err || mtd_is_bitflip(err)) && ++ len == 4 && strncmp(magic, "UBI#", 4)) { + pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + goto cleanup; + } @@ -63,7 +77,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1309,6 +1357,12 @@ static int __init ubi_init(void) +@@ -1309,6 +1371,12 @@ static int __init ubi_init(void) } } From 031d5cf248490b1e5aedac63ac8ac3c49932912f Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sun, 8 Jul 2018 23:18:15 +0200 Subject: [PATCH 175/399] kernel: don't auto attach ubi on read error With a10a204aab26cc ("kernel: make ubi auto-attach check for a tar file magic") the check for the magic was added without considering a failing mtd_read(). If the read fails, no check is done and the mount code is called straight away. Failing with an error message for such cases seems to me the cleaner way, as it would allow to spot hidden/workaround issues. Signed-off-by: Mathias Kresin (backported from 3716b5e4e6374883c80e61021923733b14cdb011) (rebased patches) Signed-off-by: Jo-Philipp Wich --- ...ach-mtd-device-named-ubi-or-data-on-boot.patch | 15 ++++++++++----- ...ach-mtd-device-named-ubi-or-data-on-boot.patch | 15 ++++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index ff3490bf9e0..992aa4662e8 100644 --- a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1172,6 +1172,68 @@ static struct mtd_info * __init open_mtd +@@ -1172,6 +1172,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -44,10 +44,15 @@ Signed-off-by: Daniel Golle + } + } + -+ /* check for a valid ubi magic if read from flash was successful */ ++ /* check if the read from flash was successful */ + err = mtd_read(mtd, offset, 4, &len, (void *) magic); -+ if ((!err || mtd_is_bitflip(err)) && -+ len == 4 && strncmp(magic, "UBI#", 4)) { ++ if ((err && !mtd_is_bitflip(err)) || len != 4) { ++ pr_err("UBI error: unable to read from mtd%d\n", mtd->index); ++ goto cleanup; ++ } ++ ++ /* check for a valid ubi magic */ ++ if (strncmp(magic, "UBI#", 4)) { + pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + goto cleanup; + } @@ -77,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1255,6 +1317,12 @@ static int __init ubi_init(void) +@@ -1255,6 +1322,12 @@ static int __init ubi_init(void) } } diff --git a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 8b923d17d63..168cfe50ee4 100644 --- a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1226,6 +1226,68 @@ static struct mtd_info * __init open_mtd +@@ -1226,6 +1226,73 @@ static struct mtd_info * __init open_mtd return mtd; } @@ -44,10 +44,15 @@ Signed-off-by: Daniel Golle + } + } + -+ /* check for a valid ubi magic if read from flash was successful */ ++ /* check if the read from flash was successful */ + err = mtd_read(mtd, offset, 4, &len, (void *) magic); -+ if ((!err || mtd_is_bitflip(err)) && -+ len == 4 && strncmp(magic, "UBI#", 4)) { ++ if ((err && !mtd_is_bitflip(err)) || len != 4) { ++ pr_err("UBI error: unable to read from mtd%d\n", mtd->index); ++ goto cleanup; ++ } ++ ++ /* check for a valid ubi magic */ ++ if (strncmp(magic, "UBI#", 4)) { + pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + goto cleanup; + } @@ -77,7 +82,7 @@ Signed-off-by: Daniel Golle static int __init ubi_init(void) { int err, i, k; -@@ -1309,6 +1371,12 @@ static int __init ubi_init(void) +@@ -1309,6 +1376,12 @@ static int __init ubi_init(void) } } From 8dd91b56bef0ffb469ae0f156d3dbd2c95afd4e2 Mon Sep 17 00:00:00 2001 From: Christo Nedev Date: Fri, 1 Jun 2018 14:23:21 +0000 Subject: [PATCH 176/399] brcm2708: Update brcm2708-gpu-fw package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem - rapsberry pi 3 b/b+ does not boot with bcm2710 images! How Raspberry Pi boots Actualy? When Raspberry is switched on GPU is activated. 1. GPU execute First stage bootloader from ROM. First stage bootloader mount the FAT boot partition on the SD card and execute second stage bootloader (bootcode.bin). 2. Second stage bootloader (bootcode.bin) activate SDRAM. Load the GPU firmware (start.elf). 3. GPU firmware (start.elf) a) display Rainbow splash. b) read firmware configuration file config.txt and split the RAM using fixup.dat. c) loads a cmdline.txt d) enables the CPU. e) loads the kernel image configurable via config.txt In your target/linux/brcm2708/image/config.txt 493 ## kernel (string) 494 ## Alternative name to use when loading kernel. 495 ## 496 #kernel="" it is not configured! But in your target/linux/brcm2708/image/Makefile 75 KERNEL_IMG := kernel8.img 76 DEVICE_TITLE := Raspberry Pi 3B/3B+ you have kernel8.img GPU Firmware search order by default for a PI 3 is: kernel8.img if found boot in 64 bit mode kernel8-32.img if found boot in 32 bit mode kernel7.img if found boot in 32 bit mode kernel.img if found boot in 32 bit mode But a PI 2 will start the search from kernel7.img and a PI 1 only looks for kernel.img. Оbviously the kernel has been found. But something goes wrong and the device is restarted. In your package/kernel/brcm2708-gpu-fw/Makefile 11 PKG_NAME:=brcm2708-gpu-fw 12 PKG_VERSION:=2017-08-08 13 PKG_RELEASE:=e7ba7ab135f5a68b2c00a919ea9ac8d5528a5d5b boot loader is 10 monts old. In conclusion, the best way to solve the problem is to update the boot loader! Fixup_cd.dat and start_cd.elf files are not necessary. These are used when GPU memory is set to 16 MB, which disables some GPU features. I did not remove them just in case! cheers Signed-off-by: Christo Nedev (backported from c335649629e641209a3539209defffeea090ad8f) --- package/kernel/brcm2708-gpu-fw/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package/kernel/brcm2708-gpu-fw/Makefile b/package/kernel/brcm2708-gpu-fw/Makefile index 9f3d7d3092f..73aebd7b5f2 100644 --- a/package/kernel/brcm2708-gpu-fw/Makefile +++ b/package/kernel/brcm2708-gpu-fw/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=brcm2708-gpu-fw -PKG_VERSION:=2017-08-08 -PKG_RELEASE:=e7ba7ab135f5a68b2c00a919ea9ac8d5528a5d5b +PKG_VERSION:=2018-05-16 +PKG_RELEASE:=0f5f899ccec1c2ef8bba02aa49700b4ec19b4199 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE) @@ -33,7 +33,7 @@ define Download/bootcode_bin FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin URL:=$(RPI_FIRMWARE_URL) URL_FILE:=bootcode.bin - HASH:=b5928ef5253774362014f9e7de856397a932514fe1bc5d7f7817a73c0e10e863 + HASH:=c9eb5258766fabf7127e790b257f106e2717f0ccaaed37544b970b0d113956fc endef $(eval $(call Download,bootcode_bin)) @@ -41,7 +41,7 @@ define Download/fixup_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup.dat - HASH:=d95fcac57de7ab71e863a115fd60444f6099cb2ea100f4a68b2c606f79e775ed + HASH:=8a6311e73d0f349be9b8424db0644fd8f48aaf721f3f2f487488c83d7316cbdf endef $(eval $(call Download,fixup_dat)) @@ -49,7 +49,7 @@ define Download/fixup_cd_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup_cd.dat - HASH:=28f3ec8388df4e0c47489f8370a29ca81dbc536fe7db9978342865b5d093ec36 + HASH:=973b008aae9711d57ddce4f058354fe5a0b4725dd825673f784a2e2754da1f28 endef $(eval $(call Download,fixup_cd_dat)) @@ -57,7 +57,7 @@ define Download/start_elf FILE:=$(RPI_FIRMWARE_FILE)-start.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start.elf - HASH:=8712fb4e241a22f7a33de0f1d420e0fdfff237952aa685c907b91e59c8d487fa + HASH:=8e77c4cce7e44ced609e5046dd55f19cb7656a8ce4694e733b7eb6ecab915fe1 endef $(eval $(call Download,start_elf)) @@ -65,7 +65,7 @@ define Download/start_cd_elf FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start_cd.elf - HASH:=c600ab34bea389da10aac541bf2f9c62e5f774093b7e1f2f72c4637f9cf3a83c + HASH:=25223b479b7aca1d74c6f7a1829aba69fd14906ca5b25ae12571fe71ea2c5a4a endef $(eval $(call Download,start_cd_elf)) From 81541d9159c988c068d7ba42bde75dcde5775312 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Mon, 18 Jun 2018 13:46:04 +0200 Subject: [PATCH 177/399] bcm53xx: exit if writing kernel during sysupgrade fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rafał Miłecki (backported from 93cc44c433fed754bd76f8016a1660a6b932361e) --- target/linux/bcm53xx/base-files/lib/upgrade/platform.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh index 16285aaa089..5a42a36ae4f 100644 --- a/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm53xx/base-files/lib/upgrade/platform.sh @@ -206,7 +206,7 @@ platform_pre_upgrade_trx() { } # Flash - mtd write /tmp/kernel.trx firmware + mtd write /tmp/kernel.trx firmware || exit 1 nand_do_upgrade /tmp/root.ubi } @@ -252,7 +252,7 @@ platform_pre_upgrade_seama() { # Flash local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"\(kernel\|linux\)".*/\1/p' /proc/mtd) - mtd write $dir/kernel.seama firmware + mtd write $dir/kernel.seama firmware || exit 1 mtd ${kernel_size:+-c 0x$kernel_size} fixseama firmware nand_do_upgrade $dir/root.ubi } From de3e415a2e95635d3aa13381a0686e3a66b01a16 Mon Sep 17 00:00:00 2001 From: Dmitry Tunin Date: Sat, 28 Jul 2018 17:06:28 +0300 Subject: [PATCH 178/399] igmpproxy: add a silent logging option [0-3](none, minimal[default], more, maximum) It is not 100% backward compatible, because now 0 disables logging Signed-off-by: Dmitry Tunin (backported from 7a6b2badfa56cfd833d64f113398198f71fd896e) --- package/network/services/igmpproxy/Makefile | 2 +- package/network/services/igmpproxy/files/igmpproxy.config | 2 +- package/network/services/igmpproxy/files/igmpproxy.init | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package/network/services/igmpproxy/Makefile b/package/network/services/igmpproxy/Makefile index 6ac4172c840..d06402a267d 100644 --- a/package/network/services/igmpproxy/Makefile +++ b/package/network/services/igmpproxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=igmpproxy PKG_VERSION:=0.2.1 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/pali/igmpproxy/releases/download/${PKG_VERSION}/ diff --git a/package/network/services/igmpproxy/files/igmpproxy.config b/package/network/services/igmpproxy/files/igmpproxy.config index 6230f8aa1d6..c85ffa3f52e 100644 --- a/package/network/services/igmpproxy/files/igmpproxy.config +++ b/package/network/services/igmpproxy/files/igmpproxy.config @@ -1,6 +1,6 @@ config igmpproxy option quickleave 1 -# option verbose [0-2] +# option verbose [0-3](none, minimal[default], more, maximum) config phyint option network wan diff --git a/package/network/services/igmpproxy/files/igmpproxy.init b/package/network/services/igmpproxy/files/igmpproxy.init index 0c30895ad61..37fe62ad1b0 100644 --- a/package/network/services/igmpproxy/files/igmpproxy.init +++ b/package/network/services/igmpproxy/files/igmpproxy.init @@ -9,10 +9,11 @@ CONFIGFILE=/var/etc/igmpproxy.conf igmp_header() { local quickleave verbose config_get_bool quickleave "$1" quickleave 0 - config_get verbose "$1" verbose 0 + config_get verbose "$1" verbose 1 - [ $verbose = "1" ] && logopts="-v" - [ $verbose = "2" ] && logopts="-v -v" + [ $verbose = "0" ] && logopts="-d" + [ $verbose = "2" ] && logopts="-v" + [ $verbose = "3" ] && logopts="-v -v" mkdir -p /var/etc rm -f /var/etc/igmpproxy.conf From f1b086bf0fe429dad6a97ac08240e83450566720 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Tue, 24 Jul 2018 11:09:17 +0200 Subject: [PATCH 179/399] include/verbose.mk: Add sc to failure message Add sc to build error message Signed-off-by: Daniel Engberg (backported from 0aaa65075508035bdf6c8fc8fa9a79b94dc5eadc) --- include/verbose.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/verbose.mk b/include/verbose.mk index e02aefe8dda..d2600801954 100644 --- a/include/verbose.mk +++ b/include/verbose.mk @@ -54,7 +54,7 @@ ifeq ($(findstring s,$(OPENWRT_VERBOSE)),) else SILENT:=>/dev/null $(if $(findstring w,$(OPENWRT_VERBOSE)),,2>&1) export QUIET:=1 - SUBMAKE=cmd() { $(SILENT) $(MAKE) -s "$$@" < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s to see what's going on"; false; } } 8>&1 9>&2; cmd + SUBMAKE=cmd() { $(SILENT) $(MAKE) -s "$$@" < /dev/null || { echo "make $$*: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on"; false; } } 8>&1 9>&2; cmd endif .SILENT: $(MAKECMDGOALS) From eb7ab27336d86b53b3ddf4515852ac502c4f61eb Mon Sep 17 00:00:00 2001 From: Dmitry Tunin Date: Sat, 28 Jul 2018 17:48:42 +0300 Subject: [PATCH 180/399] igmpproxy: drop SSDP packets It is insecure to let this type of packets inside They can e.g. open ports on some other routers with UPnP, etc Signed-off-by: Dmitry Tunin (backported from c128371124ce4d197a5fbc00e42b58e9d82c571e) --- package/network/services/igmpproxy/Makefile | 2 +- .../network/services/igmpproxy/files/igmpproxy.init | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/package/network/services/igmpproxy/Makefile b/package/network/services/igmpproxy/Makefile index d06402a267d..488de6630d2 100644 --- a/package/network/services/igmpproxy/Makefile +++ b/package/network/services/igmpproxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=igmpproxy PKG_VERSION:=0.2.1 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/pali/igmpproxy/releases/download/${PKG_VERSION}/ diff --git a/package/network/services/igmpproxy/files/igmpproxy.init b/package/network/services/igmpproxy/files/igmpproxy.init index 37fe62ad1b0..c4af4306814 100644 --- a/package/network/services/igmpproxy/files/igmpproxy.init +++ b/package/network/services/igmpproxy/files/igmpproxy.init @@ -68,6 +68,18 @@ igmp_add_firewall_routing() { [[ "$direction" = "downstream" && ! -z "$zone" ]] || return 0 +# First drop SSDP packets then accept all other multicast + + json_add_object "" + json_add_string type rule + json_add_string src "$upstream" + json_add_string dest "$zone" + json_add_string family ipv4 + json_add_string proto udp + json_add_string dest_ip "239.255.255.250" + json_add_string target DROP + json_close_object + json_add_object "" json_add_string type rule json_add_string src "$upstream" From 08e73c9526f934a0015ab882c5412550ae1be180 Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Thu, 26 Jul 2018 10:34:33 +0200 Subject: [PATCH 181/399] ncurses: install lib on host build Signed-off-by: Andy Walsh (backported from 1639ebcb061abb3664e0b80f62f0019e37fda68e) --- package/libs/ncurses/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 95f05fa7115..94c968816fd 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -164,6 +164,8 @@ endef define Host/Install $(INSTALL_BIN) $(HOST_BUILD_DIR)/progs/tic $(STAGING_DIR_HOST)/bin/tic + $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/ + $(INSTALL_DATA) $(HOST_BUILD_DIR)/lib/libncurses.a $(STAGING_DIR_HOSTPKG)/lib/ endef $(eval $(call HostBuild)) From 7939cd49c1497593d7d39c21b6244d3456d7a6a6 Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Wed, 18 Jul 2018 15:42:56 +0800 Subject: [PATCH 182/399] include: add netdev family support for nftables Signed-off-by: Rosy Song (backported from b4d4e4ceb56825033dd4c8e401e9250ae5042a99) --- package/kernel/linux/modules/netfilter.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 3d01ccecf85..3a989104d77 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -1052,3 +1052,23 @@ define KernelPackage/nft-nat6 endef $(eval $(call KernelPackage,nft-nat6)) + +define KernelPackage/nft-netdev + SUBMENU:=$(NF_MENU) + TITLE:=Netfilter nf_tables netdev support + DEPENDS:=+kmod-nft-core + KCONFIG:= \ + CONFIG_NETFILTER_INGRESS=y \ + CONFIG_NF_TABLES_NETDEV \ + CONFIG_NF_DUP_NETDEV \ + CONFIG_NFT_DUP_NETDEV \ + CONFIG_NFT_FWD_NETDEV + FILES:= \ + $(LINUX_DIR)/net/netfilter/nf_tables_netdev.ko \ + $(LINUX_DIR)/net/netfilter/nf_dup_netdev.ko \ + $(LINUX_DIR)/net/netfilter/nft_dup_netdev.ko \ + $(LINUX_DIR)/net/netfilter/nft_fwd_netdev.ko + AUTOLOAD:=$(call AutoProbe,nf_tables_netdev nf_dup_netdev nft_dup_netdev nft_fwd_netdev) +endef + +$(eval $(call KernelPackage,nft-netdev)) From 1c833e7bce269562e1a525ef7cdcecc4842ec1d6 Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Thu, 2 Aug 2018 09:10:15 +0800 Subject: [PATCH 183/399] base-files: fix HOME_URL replace Signed-off-by: Chen Minqiang (backported from 33bce21bb0f3def5a2516384a8ae16f88b9b193e) --- include/version.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/version.mk b/include/version.mk index 164c0579025..1c4b01c7e76 100644 --- a/include/version.mk +++ b/include/version.mk @@ -104,7 +104,7 @@ VERSION_SED_SCRIPT:=$(SED) 's,%U,$(call sed_escape,$(VERSION_REPO)),g' \ -e 's,%M,$(call sed_escape,$(VERSION_MANUFACTURER)),g' \ -e 's,%m,$(call sed_escape,$(VERSION_MANUFACTURER_URL)),g' \ -e 's,%b,$(call sed_escape,$(VERSION_BUG_URL)),g' \ - -e 's,%b,$(call sed_escape,$(VERSION_HOME_URL)),g' \ + -e 's,%u,$(call sed_escape,$(VERSION_HOME_URL)),g' \ -e 's,%s,$(call sed_escape,$(VERSION_SUPPORT_URL)),g' \ -e 's,%P,$(call sed_escape,$(VERSION_PRODUCT)),g' \ -e 's,%h,$(call sed_escape,$(VERSION_HWREV)),g' From c58c31bf99749b644ff1a3851d361417ef204cc5 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Sat, 4 Aug 2018 01:56:39 +0200 Subject: [PATCH 184/399] base-files: sysupgrade: abort if config backup fails Sysupgrade shouldn't proceed, if the backup of the configuration fails because tar (or gzip) exit with a non-zero code. Signed-off-by: Andreas Ziegler (backported from 72489ebeb65fd1e1d77e8d9fbe105827a98dbf03) --- package/base-files/Makefile | 2 +- package/base-files/files/sbin/sysupgrade | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 8775ffbc80e..04a863a8c50 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=193 +PKG_RELEASE:=194 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 2f579fb8743..36379431171 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -166,6 +166,11 @@ do_save_conffiles() { v "Saving config files..." [ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V="" tar c${TAR_V}zf "$conf_tar" -T "$CONFFILES" 2>/dev/null + if [ "$?" -ne 0 ]; then + echo "Failed to create the configuration backup." + rm -f "$conf_tar" + exit 1 + fi rm -f "$CONFFILES" } From 63a87b4c7a537afdc0c8c3507e29f5bf79b0bfd8 Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Sat, 4 Aug 2018 19:01:18 +0800 Subject: [PATCH 185/399] base-files: do not add relevant sections & options except when ipv6 is support in kernel Signed-off-by: Rosy Song (backported from 2b637e5ab8ae24ff4176930f259dce195983d7ea) --- package/base-files/files/bin/config_generate | 42 ++++++++++++-------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index fa148685ccc..c8b253da5bd 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -15,10 +15,14 @@ generate_static_network() { set network.loopback.proto='static' set network.loopback.ipaddr='127.0.0.1' set network.loopback.netmask='255.0.0.0' - delete network.globals - set network.globals='globals' - set network.globals.ula_prefix='auto' EOF + [ -e /proc/sys/net/ipv6 ] && { + uci -q batch <<-EOF + delete network.globals + set network.globals='globals' + set network.globals.ula_prefix='auto' + EOF + } if json_is_a dsl object; then json_select dsl @@ -102,21 +106,23 @@ generate_network() { set network.$1.proto='static' set network.$1.ipaddr='$ipad' set network.$1.netmask='$netm' - set network.$1.ip6assign='60' EOF + [ -e /proc/sys/net/ipv6 ] && uci set network.$1.ip6assign='60' ;; dhcp) # fixup IPv6 slave interface if parent is a bridge [ "$type" = "bridge" ] && ifname="br-$1" - uci -q batch <<-EOF - set network.$1.proto='dhcp' - delete network.${1}6 - set network.${1}6='interface' - set network.${1}6.ifname='$ifname' - set network.${1}6.proto='dhcpv6' - EOF + uci set network.$1.proto='dhcp' + [ -e /proc/sys/net/ipv6 ] && { + uci -q batch <<-EOF + delete network.${1}6 + set network.${1}6='interface' + set network.${1}6.ifname='$ifname' + set network.${1}6.proto='dhcpv6' + EOF + } ;; pppoe) @@ -124,12 +130,16 @@ generate_network() { set network.$1.proto='pppoe' set network.$1.username='username' set network.$1.password='password' - set network.$1.ipv6='1' - delete network.${1}6 - set network.${1}6='interface' - set network.${1}6.ifname='@${1}' - set network.${1}6.proto='dhcpv6' EOF + [ -e /proc/sys/net/ipv6 ] && { + uci -q batch <<-EOF + set network.$1.ipv6='1' + delete network.${1}6 + set network.${1}6='interface' + set network.${1}6.ifname='@${1}' + set network.${1}6.proto='dhcpv6' + EOF + } ;; esac } From 38d4ba4e191738965f133cb6faa423f189ed1b13 Mon Sep 17 00:00:00 2001 From: Daniel Gimpelevich Date: Sun, 21 Jan 2018 13:00:12 -0800 Subject: [PATCH 186/399] kernel: package x86-optimized crypto-misc modules Some of the modules in the crypto-misc package have alternate implementations optimized for different x86 instruction set extensions, but only one of these was built for this package until now: twofish-i586.ko Tested with insmod, on both x86 and x86_64. The modules now have an autoload, which they previous didn't, loading the dependencies in the correct order. Signed-off-by: Daniel Gimpelevich (backported from c762817c9211f439c5da6ea30b6ed828c9861c4f) --- package/kernel/linux/modules/crypto.mk | 52 +++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 2ea2d2c0e75..235e6dadac0 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -441,8 +441,21 @@ $(eval $(call KernelPackage,crypto-michael-mic)) define KernelPackage/crypto-misc TITLE:=Other CryptoAPI modules - DEPENDS:=+kmod-crypto-manager + DEPENDS:=+kmod-crypto-xts KCONFIG:= \ + CONFIG_CRYPTO_CAMELLIA_X86_64 \ + CONFIG_CRYPTO_BLOWFISH_X86_64 \ + CONFIG_CRYPTO_TWOFISH_X86_64 \ + CONFIG_CRYPTO_TWOFISH_X86_64_3WAY \ + CONFIG_CRYPTO_SERPENT_SSE2_X86_64 \ + CONFIG_CRYPTO_CAMELLIA_AESNI_AVX_X86_64 \ + CONFIG_CRYPTO_CAST5_AVX_X86_64 \ + CONFIG_CRYPTO_CAST6_AVX_X86_64 \ + CONFIG_CRYPTO_TWOFISH_AVX_X86_64 \ + CONFIG_CRYPTO_SERPENT_AVX_X86_64 \ + CONFIG_CRYPTO_CAMELLIA_AESNI_AVX2_X86_64 \ + CONFIG_CRYPTO_SERPENT_AVX2_X86_64 \ + CONFIG_CRYPTO_SERPENT_SSE2_586 \ CONFIG_CRYPTO_ANUBIS \ CONFIG_CRYPTO_BLOWFISH \ CONFIG_CRYPTO_CAMELLIA \ @@ -472,15 +485,50 @@ define KernelPackage/crypto-misc $(LINUX_DIR)/crypto/blowfish_common.ko \ $(LINUX_DIR)/crypto/blowfish_generic.ko \ $(LINUX_DIR)/crypto/serpent_generic.ko + AUTOLOAD:=$(call AutoLoad,10,anubis camellia_generic cast_common \ + cast5_generic cast6_generic khazad tea tgr192 twofish_common \ + wp512 blowfish_common serpent_generic) + ifndef CONFIG_TARGET_x86 + AUTOLOAD+= $(call AutoLoad,10,twofish_generic blowfish_generic) + endif $(call AddDepends/crypto) endef ifndef CONFIG_TARGET_x86_64 define KernelPackage/crypto-misc/x86 - FILES+=$(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko + FILES+= \ + $(LINUX_DIR)/arch/x86/crypto/twofish-i586.ko \ + $(LINUX_DIR)/arch/x86/crypto/serpent-sse2-i586.ko \ + $(LINUX_DIR)/arch/x86/crypto/glue_helper.ko \ + $(LINUX_DIR)/crypto/ablk_helper.ko \ + $(LINUX_DIR)/crypto/cryptd.ko \ + $(LINUX_DIR)/crypto/lrw.ko + AUTOLOAD+= $(call AutoLoad,10,lrw cryptd ablk_helper glue_helper \ + serpent-sse2-i586 twofish-i586 blowfish_generic) endef endif +define KernelPackage/crypto-misc/x86/64 + FILES+= \ + $(LINUX_DIR)/arch/x86/crypto/camellia-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/blowfish-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/twofish-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/twofish-x86_64-3way.ko \ + $(LINUX_DIR)/arch/x86/crypto/serpent-sse2-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/camellia-aesni-avx-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/cast5-avx-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/cast6-avx-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/twofish-avx-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/serpent-avx-x86_64.ko \ + $(LINUX_DIR)/arch/x86/crypto/camellia-aesni-avx2.ko \ + $(LINUX_DIR)/arch/x86/crypto/serpent-avx2.ko \ + $(LINUX_DIR)/crypto/ablk_helper.ko + AUTOLOAD+= $(call AutoLoad,10,ablk_helper camellia-x86_64 \ + camellia-aesni-avx-x86_64 camellia-aesni-avx2 cast5-avx-x86_64 \ + cast6-avx-x86_64 twofish-x86_64 twofish-x86_64-3way \ + twofish-avx-x86_64 blowfish-x86_64 serpent-avx-x86_64 serpent-avx2) +endef + $(eval $(call KernelPackage,crypto-misc)) From eb9ac2590343a705bd4399d17196d907d511a0e0 Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Tue, 27 Mar 2018 02:42:06 -0300 Subject: [PATCH 187/399] openvpn-easy-rsa: update to 3.0.4 Upstream renamed openssl-1.0.cnf to openssl-easyrsa.cnf. However, pkg kept using openssl-1.0.cnf. Upstream easyrsa searchs for vars, openssl-*, x509-types in the same directory as easyrsa script. This was patched to revert back to static /etc/easy-rsa/ directory (as does OpenSUSE). EASYRSA_PKI still depends on $PWD. Move easyrsa from /usr/sbin to /usr/bin as root is not needed. Signed-off-by: Luiz Angelo Daros de Luca (backported from f1bef0596fd2a983386c778a94486782bd272e27) (rebased patches) Signed-off-by: Jo-Philipp Wich --- .../services/openvpn-easy-rsa/Makefile | 15 ++++++++------ .../patches/101-static_EASYRSA.patch | 20 +++++++++++++++++++ 2 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch diff --git a/package/network/services/openvpn-easy-rsa/Makefile b/package/network/services/openvpn-easy-rsa/Makefile index f4b479986f8..0cf73950a61 100644 --- a/package/network/services/openvpn-easy-rsa/Makefile +++ b/package/network/services/openvpn-easy-rsa/Makefile @@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn-easy-rsa -PKG_VERSION:=3.0.1 +PKG_VERSION:=3.0.4 PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/$(PKG_VERSION)/ +PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/v$(PKG_VERSION)/ PKG_SOURCE:=EasyRSA-$(PKG_VERSION).tgz -PKG_HASH:=dbdaf5b9444b99e0c5221fd4bcf15384c62380c1b63cea23d42239414d7b2d4e +PKG_HASH:=472167f976c6cb7c860cec6150a5616e163ae20365c81f179811d6ee0779ec5a PKG_LICENSE:=GPL-2.0 PKG_BUILD_DIR:=$(BUILD_DIR)/EasyRSA-$(PKG_VERSION) +PKGARCH:=all include $(INCLUDE_DIR)/package.mk @@ -31,6 +32,7 @@ endef define Package/openvpn-easy-rsa/conffiles /etc/easy-rsa/vars /etc/easy-rsa/openssl-1.0.cnf +/etc/easy-rsa/openssl-easyrsa.cnf endef define Build/Configure @@ -42,11 +44,12 @@ define Build/Compile endef define Package/openvpn-easy-rsa/install - $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc/easy-rsa - $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-easyrsa.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf + $(LN) /etc/easy-rsa/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-easyrsa.cnf $(INSTALL_DATA) $(PKG_BUILD_DIR)/vars.example $(1)/etc/easy-rsa/vars $(INSTALL_DIR) $(1)/etc/easy-rsa/pki diff --git a/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch b/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch new file mode 100644 index 00000000000..9da40178013 --- /dev/null +++ b/package/network/services/openvpn-easy-rsa/patches/101-static_EASYRSA.patch @@ -0,0 +1,20 @@ +--- a/easyrsa ++++ b/easyrsa +@@ -1033,7 +1033,7 @@ vars_setup() { + vars= + + # set up program path +- prog_vars="${0%/*}/vars" ++ prog_vars="/etc/easy-rsa/vars" + # set up PKI path + pki_vars="${EASYRSA_PKI:-$PWD/pki}/vars" + +@@ -1060,7 +1060,7 @@ Note: using Easy-RSA configuration from: + fi + + # Set defaults, preferring existing env-vars if present +- set_var EASYRSA "${0%/*}" ++ set_var EASYRSA "/etc/easy-rsa" + set_var EASYRSA_OPENSSL openssl + set_var EASYRSA_PKI "$PWD/pki" + set_var EASYRSA_DN cn_only From 30d7924c3c62cd9a8dd404996e902101525b7356 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Mon, 30 Jul 2018 17:03:18 +0300 Subject: [PATCH 188/399] wolfssl: remove myself as maintainer I no longer have the time, nor the desire to maintain this package. Remove myself as maintainer. Signed-off-by: Alexandru Ardelean (backported from 20346a63f69bbb919ffdf29bc2e77496d01719e3) --- package/libs/wolfssl/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index e08b6f39294..87ce9328e77 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -40,7 +40,6 @@ define Package/libwolfssl CATEGORY:=Libraries TITLE:=wolfSSL library URL:=http://www.wolfssl.com/ - MAINTAINER:=Alexandru Ardelean MENU:=1 PROVIDES:=libcyassl endef From 34e3a4a034bb5ae6cde7234dabac73a06c1c0386 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 23 Aug 2018 20:03:29 +0200 Subject: [PATCH 189/399] wolfssl: disable broken shipped Job server macro The AX_AM_JOBSERVER macro shipped with m4/ax_am_jobserver.m4 is broken on plain POSIX shells due to the use of `let`. Shells lacking `let` will fail to run the generated m4sh code and end up invoking "make" with "-jyes" as argument, fialing the build. Since there is no reason in the first place for some random package to muck with the make job server settings and since we do not want it to randomly override "-j" either, simply remove references to this defunct macro to let the build succeed on platforms which not happen to use bash as default shell. Signed-off-by: Jo-Philipp Wich (backported from a27de701b0250b06302350d25dc514e1b488dc59) --- .../900-remove-broken-autoconf-macros.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 package/libs/wolfssl/patches/900-remove-broken-autoconf-macros.patch diff --git a/package/libs/wolfssl/patches/900-remove-broken-autoconf-macros.patch b/package/libs/wolfssl/patches/900-remove-broken-autoconf-macros.patch new file mode 100644 index 00000000000..f7756b11c62 --- /dev/null +++ b/package/libs/wolfssl/patches/900-remove-broken-autoconf-macros.patch @@ -0,0 +1,21 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -4140,7 +4140,6 @@ AC_CONFIG_FILES([support/wolfssl.pc]) + AC_CONFIG_FILES([rpm/spec]) + + AX_CREATE_GENERIC_CONFIG +-AX_AM_JOBSERVER([yes]) + + AC_OUTPUT + +--- a/Makefile.am ++++ b/Makefile.am +@@ -20,8 +20,6 @@ dist_noinst_SCRIPTS = + noinst_SCRIPTS = + check_SCRIPTS = + +-#includes additional rules from aminclude.am +-@INC_AMINCLUDE@ + DISTCLEANFILES+= aminclude.am + + CLEANFILES+= cert.der \ From 43c96e8dd87ecc66448305484b824606bef8099b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 31 Jul 2018 20:39:13 +0200 Subject: [PATCH 190/399] iwinfo: update to latest Git HEAD a514139 build: compile with -ffunction-sections, -fdata-sections and LTO 3c30b17 wl: only invoke nvram executable if it exists 65b8333 Revert "build: compile with -ffunction-sections, -fdata-sections and LTO" Signed-off-by: Jo-Philipp Wich (backported from fdd6c556ab42d040efcc92a53149e3f8ec357f69) --- package/network/utils/iwinfo/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 2448f43bd26..287cc0b9714 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2018-07-24 -PKG_SOURCE_VERSION:=94b1366de313c4d1c0c1ea8f0b859bc44d0b231a -PKG_MIRROR_HASH:=6fe4b76b24b9df0ced458d821df1f84818ca1647ae4d3c4439f486b5d35c986e +PKG_SOURCE_DATE:=2018-07-31 +PKG_SOURCE_VERSION:=65b8333f5b66f8812c1ed21a4d5b28a576e6ba63 +PKG_MIRROR_HASH:=78574c9f3da286ce2d896855e67193e88a5829fff8616ab093987ea3761c33c3 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 From b4454ca4fae13f85e06d01df8a2a94ddd78d3368 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 5 Aug 2018 00:06:27 +0200 Subject: [PATCH 191/399] build: remove GNU time dependency Replace the GNU time program invocation with a simple Perl script reporting the timing values. Since we require Perl anyway for the build system, we can as well use that instead of requiring a random GNU utility rarely installed by default. Fixes: ff6e62b288 ("build: log time taken by each packages/steps") Signed-off-by: Jo-Philipp Wich (backported from d3ddf6631e491a831617a5ae8b3d7924e47a275a) --- include/prereq-build.mk | 5 ----- include/subdir.mk | 2 +- scripts/time.pl | 42 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 6 deletions(-) create mode 100755 scripts/time.pl diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 029249f69cb..a416a2d2320 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -138,11 +138,6 @@ $(eval $(call SetupHostCommand,bzip2,Please install 'bzip2', \ $(eval $(call SetupHostCommand,wget,Please install GNU 'wget', \ wget --version | grep GNU)) -$(eval $(call SetupHostCommand,time,Please install GNU 'time' or BusyBox 'time' that supports -f, \ - gtime --version 2>&1 | grep GNU, \ - time --version 2>&1 | grep GNU, \ - busybox time 2>&1 | grep -- '-f FMT')) - $(eval $(call SetupHostCommand,perl,Please install Perl 5.x, \ perl --version | grep "perl.*v5")) diff --git a/include/subdir.mk b/include/subdir.mk index dde3e50b0be..6512e24c2e6 100644 --- a/include/subdir.mk +++ b/include/subdir.mk @@ -43,7 +43,7 @@ log_make = \ $(if $(BUILD_LOG), \ set -o pipefail; \ mkdir -p $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4));) \ - env time -f "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)\#%U\#%S\#%e" -- \ + $(SCRIPT_DIR)/time.pl "time: $(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2)" \ $$(SUBMAKE) $(subdir_make_opts) $(if $(3),$(3)-)$(2) \ $(if $(BUILD_LOG),SILENT= 2>&1 | tee $(BUILD_LOG_DIR)/$(1)$(if $(4),/$(4))/$(if $(3),$(3)-)$(2).txt) diff --git a/scripts/time.pl b/scripts/time.pl new file mode 100755 index 00000000000..cdc5824c83d --- /dev/null +++ b/scripts/time.pl @@ -0,0 +1,42 @@ +#!/usr/bin/env perl + +use strict; +use warnings; +use Time::HiRes qw(gettimeofday); + +if (@ARGV < 2) { + die "Usage: $0 \n"; +} + +my ($prefix, @cmd) = @ARGV; +my ($sec, $msec) = gettimeofday(); +my $pid = fork(); + +if (!defined($pid)) { + die "$0: Failure to fork(): $!\n"; +} +elsif ($pid == 0) { + exec(@cmd); + die "$0: Failure to exec(): $!\n"; +} +else { + $SIG{'INT'} = 'IGNORE'; + $SIG{'QUIT'} = 'IGNORE'; + + if (waitpid($pid, 0) == -1) { + die "$0: Failure to waitpid(): $!\n"; + } + + my $exitcode = $? >> 8; + my ($sec2, $msec2) = gettimeofday(); + my (undef, undef, $cuser, $csystem) = times(); + + printf STDERR "%s#%.2f#%.2f#%.2f\n", + $prefix, $cuser, $csystem, + ($sec2 - $sec) + ($msec2 - $msec) / 1000000; + + $SIG{'INT'} = 'DEFAULT'; + $SIG{'QUIT'} = 'DEFAULT'; + + exit $exitcode; +} From 2890abbcc0329460ebc7384e994272d1ee3b372d Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 5 Aug 2018 12:24:01 +0200 Subject: [PATCH 192/399] scripts: time.pl: avoid hard Time::HiRes dependency Use Time::HiRes when available and fallback to raw syscall interface when not. If that fails too, simply report 0, 0 as real time. Signed-off-by: Jo-Philipp Wich (backported from a692e4e3de60e1a10906511fb8ef2d14937d4a19) --- scripts/time.pl | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/scripts/time.pl b/scripts/time.pl index cdc5824c83d..a23b57c89e3 100755 --- a/scripts/time.pl +++ b/scripts/time.pl @@ -2,14 +2,37 @@ use strict; use warnings; -use Time::HiRes qw(gettimeofday); +use Config; if (@ARGV < 2) { die "Usage: $0 \n"; } +sub gettime { + my ($sec, $usec); + + eval { + require Time::HiRes; + ($sec, $usec) = Time::HiRes::gettimeofday(); + }; + + unless (defined($sec) && defined($usec)) { + my $tv_t = ($Config{'longsize'} == 8) ? 'qq' : 'll'; + my $tv = pack $tv_t, 0, 0; + + eval { + require 'syscall.ph'; + syscall(SYS_gettimeofday(), $tv, 0); + }; + + ($sec, $usec) = unpack $tv_t, $tv; + } + + return ($sec, $usec); +} + my ($prefix, @cmd) = @ARGV; -my ($sec, $msec) = gettimeofday(); +my ($sec, $usec) = gettime(); my $pid = fork(); if (!defined($pid)) { @@ -28,12 +51,12 @@ } my $exitcode = $? >> 8; - my ($sec2, $msec2) = gettimeofday(); + my ($sec2, $usec2) = gettime(); my (undef, undef, $cuser, $csystem) = times(); printf STDERR "%s#%.2f#%.2f#%.2f\n", $prefix, $cuser, $csystem, - ($sec2 - $sec) + ($msec2 - $msec) / 1000000; + ($sec2 - $sec) + ($usec2 - $usec) / 1000000; $SIG{'INT'} = 'DEFAULT'; $SIG{'QUIT'} = 'DEFAULT'; From 4db4444697b8bf1912f2bfb71fa0aced34d0be84 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 5 Aug 2018 12:17:29 +0900 Subject: [PATCH 193/399] imagebuilder: manifest function show stderr This really simplifies debugging, if a package is not found or a feed is not reachable, a proper stderr is printed. Currently it would only say `_call_manifest` failed. Signed-off-by: Paul Spooren (backported from ad5c2897ec054b80549e526ef639dd75548d4747) --- target/imagebuilder/files/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index e0c0132b853..76ea19028ed 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -119,8 +119,8 @@ _call_image: staging_dir/host/.prereq-build _call_manifest: FORCE rm -rf $(TARGET_DIR) mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR) - $(MAKE) package_reload >/dev/null 2>/dev/null - $(MAKE) package_install >/dev/null 2>/dev/null + $(MAKE) package_reload >/dev/null + $(MAKE) package_install >/dev/null $(OPKG) list-installed package_index: FORCE From cc6da6fa1ad6ce55cbab3f9cbb966bd7df83869e Mon Sep 17 00:00:00 2001 From: Eneas U de Queiroz Date: Mon, 6 Aug 2018 18:19:20 +0000 Subject: [PATCH 194/399] ustream-ssl: update to latest git HEAD 23a3f28 openssl, wolfssl: match mbedTLS ciphersuite list 450ada0 ustream-ssl: Revised security on mbedtls 34b0b80 ustream-ssl: add openssl-1.1.0 compatibility Signed-off-by: Eneas U de Queiroz (backported from 33fd1d0d91fe6f0bb639a6fad0f681ba651f8254) --- package/libs/ustream-ssl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index 54b69944fb7..2ea5bf0bd59 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git -PKG_SOURCE_DATE:=2018-05-24 -PKG_SOURCE_VERSION:=189cd38b4188bfcb4c8cf67d8ae71741ffc2b906 -PKG_MIRROR_HASH:=114d229828d95229e2b7134f668c0d2c3cee63ffa90e970d4c50a331f505b17d +PKG_SOURCE_DATE:=2018-07-30 +PKG_SOURCE_VERSION:=23a3f2830341acd1db149175baf7315a33bd0edb +PKG_MIRROR_HASH:=289bef5dac684015b6a40cfd72cf1c8c297bb77cf2efd54e562b628ba3afd83d CMAKE_INSTALL:=1 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_SOURCE_SUBDIR) From 7a52e0a7ab0847002c6f1e6d02083739ef641ab4 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 9 Aug 2018 17:56:19 +0200 Subject: [PATCH 195/399] odhcp6c: apply IPv6/ND configuration earlier Apply IPv6/ND configuration before proto_send_update so that all config info is available when netifd is handling the notify_proto ubus call. In particular this fixes an issue when netifd is updating the downstream IPv6 mtu as netifd was still using the not yet updated upstream IPv6 mtu to set the downstream IPv6 mtu Signed-off-by: Hans Dedecker (backported from 2e02fdb3637c7a0320d230a3232d61e874c1e4d1) --- package/network/ipv6/odhcp6c/Makefile | 2 +- package/network/ipv6/odhcp6c/files/dhcpv6.script | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index c9a893b57bd..451f0962bbb 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=14.1 +PKG_RELEASE:=15 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index dcb7a95d98f..28955a358fc 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -7,6 +7,14 @@ setup_interface () { local device="$1" local prefsig="" local addrsig="" + + # Apply IPv6 / ND configuration + HOPLIMIT=$(cat /proc/sys/net/ipv6/conf/$device/hop_limit) + [ -n "$RA_HOPLIMIT" -a -n "$HOPLIMIT" ] && [ "$RA_HOPLIMIT" -gt "$HOPLIMIT" ] && echo "$RA_HOPLIMIT" > /proc/sys/net/ipv6/conf/$device/hop_limit + [ -n "$RA_MTU" ] && [ "$RA_MTU" -ge 1280 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu 2>/dev/null + [ -n "$RA_REACHABLE" ] && [ "$RA_REACHABLE" -gt 0 ] && echo "$RA_REACHABLE" > /proc/sys/net/ipv6/neigh/$device/base_reachable_time_ms + [ -n "$RA_RETRANSMIT" ] && [ "$RA_RETRANSMIT" -gt 0 ] && echo "$RA_RETRANSMIT" > /proc/sys/net/ipv6/neigh/$device/retrans_time_ms + proto_init_update "*" 1 # Merge RA-DNS @@ -203,13 +211,6 @@ setup_interface () { ubus call network add_dynamic "$(json_dump)" fi - # Apply IPv6 / ND configuration - HOPLIMIT=$(cat /proc/sys/net/ipv6/conf/$device/hop_limit) - [ -n "$RA_HOPLIMIT" -a -n "$HOPLIMIT" ] && [ "$RA_HOPLIMIT" -gt "$HOPLIMIT" ] && echo "$RA_HOPLIMIT" > /proc/sys/net/ipv6/conf/$device/hop_limit - [ -n "$RA_MTU" ] && [ "$RA_MTU" -ge 1280 ] && echo "$RA_MTU" > /proc/sys/net/ipv6/conf/$device/mtu 2>/dev/null - [ -n "$RA_REACHABLE" ] && [ "$RA_REACHABLE" -gt 0 ] && echo "$RA_REACHABLE" > /proc/sys/net/ipv6/neigh/$device/base_reachable_time_ms - [ -n "$RA_RETRANSMIT" ] && [ "$RA_RETRANSMIT" -gt 0 ] && echo "$RA_RETRANSMIT" > /proc/sys/net/ipv6/neigh/$device/retrans_time_ms - # TODO: $SNTP_IP $SIP_IP $SNTP_FQDN $SIP_DOMAIN } From a2b2a9c55fd9a4fa7e211dae35d3951cdcc2bafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20VAR=C3=88NE?= Date: Thu, 9 Aug 2018 20:33:45 +0200 Subject: [PATCH 196/399] base-files: make wifi report unknown command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Avoid having /sbin/wifi silently ignore unknown keywords and execute "up"; instead display the help message and exit with an error. Spell out the "up" keyword (which has users), add it to usage output, and preserve the implicit assumption that runing /sbin/wifi without argument performs "up". Signed-off-by: Thibaut VARÈNE (backported from 78b5764fd8a3c133f0caf170238242b32a97105b) --- package/base-files/files/sbin/wifi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 83befc0d6fb..f7a10de215c 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -6,7 +6,7 @@ usage() { cat < Date: Sat, 11 Aug 2018 10:48:08 +0200 Subject: [PATCH 197/399] base-files: use consistent coding style Add the opening bracket right after the function name, to do it the same way for all functions in this file. Signed-off-by: Dmitry Tunin Signed-off-by: Mathias Kresin (backported from ec28d2797c1bff4a3a97e54fee648cc56185839a) --- package/base-files/files/lib/functions/system.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh index d4402c3a148..e178f26f39a 100644 --- a/package/base-files/files/lib/functions/system.sh +++ b/package/base-files/files/lib/functions/system.sh @@ -20,8 +20,7 @@ find_mtd_chardev() { echo "${INDEX:+$PREFIX$INDEX}" } -mtd_get_mac_ascii() -{ +mtd_get_mac_ascii() { local mtdname="$1" local key="$2" local part @@ -87,22 +86,19 @@ macaddr_add() { echo $oui:$nic } -macaddr_setbit_la() -{ +macaddr_setbit_la() { local mac=$1 printf "%02x:%s" $((0x${mac%%:*} | 0x02)) ${mac#*:} } -macaddr_2bin() -{ +macaddr_2bin() { local mac=$1 echo -ne \\x${mac//:/\\x} } -macaddr_canonicalize() -{ +macaddr_canonicalize() { local mac="$1" local canon="" From d93bd72a9806e771f2d0d0578c610ac8bd4e45a0 Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Sat, 11 Aug 2018 10:10:21 +0200 Subject: [PATCH 198/399] base-files: add function to get mac as text from flash Add a function to get a mac stored as text from flash. The octets of the mac address need to be separated by any separator supported by macaddr_canonicalize(). Signed-off-by: Dmitry Tunin Signed-off-by: Mathias Kresin (backported from dfee452713e6b3c10aafc6174f8087a920b54402) --- .../base-files/files/lib/functions/system.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/package/base-files/files/lib/functions/system.sh b/package/base-files/files/lib/functions/system.sh index e178f26f39a..7ed62804a08 100644 --- a/package/base-files/files/lib/functions/system.sh +++ b/package/base-files/files/lib/functions/system.sh @@ -38,6 +38,29 @@ mtd_get_mac_ascii() { [ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty" } +mtd_get_mac_text() { + local mtdname=$1 + local offset=$2 + local part + local mac_dirty + + part=$(find_mtd_part "$mtdname") + if [ -z "$part" ]; then + echo "mtd_get_mac_text: partition $mtdname not found!" >&2 + return + fi + + if [ -z "$offset" ]; then + echo "mtd_get_mac_text: offset missing!" >&2 + return + fi + + mac_dirty=$(dd if="$part" bs=1 skip="$offset" count=17 2>/dev/null) + + # "canonicalize" mac + [ -n "$mac_dirty" ] && macaddr_canonicalize "$mac_dirty" +} + mtd_get_mac_binary() { local mtdname="$1" local offset="$2" From 1e06b02bf77fb2631e51010d1ae685eb6d75881a Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Mon, 13 Aug 2018 22:05:46 +0300 Subject: [PATCH 199/399] firewall: bump to git HEAD 12a7cf9 Add support for DSCP matches and target 06fa692 defaults: use a generic check_kmod() function 1c4d5bc defaults: fix check_kmod() function Signed-off-by: Stijn Tintel (backported from 03e5dcbf10b1f67a463735efd8db3386f91473fd) --- package/network/config/firewall/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index 010c5aa3427..830a1b268f1 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2018-07-26 -PKG_SOURCE_VERSION:=aa8846bb101054392b81f09bade120c021695892 -PKG_MIRROR_HASH:=cc2ff632744bdefbc64ad11dc18944b44af006c986367a28d6483ade6012effa +PKG_SOURCE_DATE:=2018-08-13 +PKG_SOURCE_VERSION:=1c4d5bcd1137e61e91dca858fe33d76d7a1dc821 +PKG_MIRROR_HASH:=49f939877a734056455556c90b959c407fd2c4988dc5d86f62a8122ebd7b8899 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From a009d4cdf3de5664179470975b8e7ac8dc08ede2 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Fri, 17 Aug 2018 10:00:02 +0200 Subject: [PATCH 200/399] mwlwifi: Update to 10.3.8.0-20180810 Update mwlwifi to 10.3.8.0-20180810 Signed-off-by: Daniel Engberg (backported from e1a1add5178b6a943c6272776ba3af06b3f953a8) --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 9e9824afea7..20451f2862e 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-06-15 -PKG_SOURCE_VERSION:=8683de8e97a31fe01cfd4e63ef6e9867b50aadae -PKG_MIRROR_HASH:=69cd9f7c79564e444edf423133b13dcfbba9f66c051516606049087fa1973a20 +PKG_SOURCE_DATE:=2018-08-10 +PKG_SOURCE_VERSION:=75374802d9ccf431a497bf494ca6a984a7ec2470 +PKG_MIRROR_HASH:=528132e554d99e30e011b7ddbfc615f11319668d6f45b0a4ecae14ae935c3914 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From 57f3a57abde3c7ef2f81f88243982a585365e7ac Mon Sep 17 00:00:00 2001 From: Luiz Angelo Daros de Luca Date: Sat, 18 Aug 2018 22:53:07 -0300 Subject: [PATCH 201/399] base-files: create /etc/ethers by default /etc/ethers is missing on /rom but always created when dnsmasq runs. It is better to have it in place and avoid an extra change in flash after firstboot. It will generate an extra /etc/ethers-opkg when it has changed. Signed-off-by: Luiz Angelo Daros de Luca Signed-off-by: Hans Dedecker (backported from d810d44e5a88e7ed5a72f8cd39fc57639aa6dbd0) --- package/base-files/Makefile | 1 + package/base-files/files/etc/ethers | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 package/base-files/files/etc/ethers diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 04a863a8c50..0fdbc4002e5 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -49,6 +49,7 @@ define Package/base-files/conffiles /etc/config/system /etc/crontabs/ /etc/dropbear/ +/etc/ethers /etc/group /etc/hosts /etc/inittab diff --git a/package/base-files/files/etc/ethers b/package/base-files/files/etc/ethers new file mode 100644 index 00000000000..b92c200a4bb --- /dev/null +++ b/package/base-files/files/etc/ethers @@ -0,0 +1,6 @@ +# +# Lookup man 5 ethers for syntax documentation +# +# Examples : +# 02:00:11:22:33:44 OpenWrt.lan +# 02:00:11:22:33:44 192.168.1.1 From e005beec2d02ae0ab227b6de55d0670106255799 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 16 Aug 2018 19:32:59 -0700 Subject: [PATCH 202/399] samba36: Enable umdnsd support Allows discovery without having to use NetBIOS. Useful for mobile devices. Could eventually throw nbmd away. But that requires Windows 10... Tested on Fedora 28 with avahi-discover. Signed-off-by: Rosen Penev (backported from 499773f8efe3357a2076c75c503ebcb42e41dbe6) --- package/network/services/samba36/Makefile | 2 +- package/network/services/samba36/files/samba.init | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 75705d0b372..b4322f04f4c 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=3.6.25 -PKG_RELEASE:=11 +PKG_RELEASE:=12 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ https://download.samba.org/pub/samba/stable diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init index ae0e0e230df..1c5bb3b3c43 100755 --- a/package/network/services/samba36/files/samba.init +++ b/package/network/services/samba36/files/samba.init @@ -101,6 +101,7 @@ start_service() { init_config procd_open_instance + procd_add_mdns "smb" "tcp" "445" procd_set_param command /usr/sbin/smbd -F procd_set_param respawn procd_set_param file /var/etc/smb.conf From 97fddb2fddbf81535f06f168752c9b7e4abaa87a Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Fri, 24 Aug 2018 15:02:24 +0200 Subject: [PATCH 203/399] dropbear: backport upstream fix for CVE-2018-15599 CVE description : The recv_msg_userauth_request function in svr-auth.c in Dropbear through 2018.76 is prone to a user enumeration vulnerability because username validity affects how fields in SSH_MSG_USERAUTH messages are handled, a similar issue to CVE-2018-15473 in an unrelated codebase. Signed-off-by: Hans Dedecker (backported from 2211ee0037764e1c6b1576fe7a0975722cd4acdc) --- package/network/services/dropbear/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 742e538ff55..182552f6ea4 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ From 7772a5b05be1b4970a0e95d4337a28203d6c2efe Mon Sep 17 00:00:00 2001 From: Thomas Langer Date: Mon, 20 Aug 2018 12:13:29 +0200 Subject: [PATCH 204/399] build: Unset CDPATH to avoid problems In some places the output of commands, which include "cd" are used. In case of CDPATH the new path is printed, which might not be expected. Disable the variable to avoid these problem. When CDPATH was set by the user to some value like "export CDPATH=." the git checkout done by the build system did not work anymore, the git cloning aborted with such an error message for example: .... Packing checkout... tar: /disk/fs1/tmp2/mehrtens/pon-ugw/ugw-haps/openwrt/tmp/dl/ppa-drv-1.0\n@1534240258: Cannot stat: No such file or directory tar: Date sample file not found Try 'tar --help' or 'tar --usage' for more information. ..... To avoid this, this patch makes the build system unset CDPATH inside the build system, so the build system will still work even when the user set this variable in his local environment. Signed-off-by: Thomas Langer Signed-off-by: Hauke Mehrtens Acked-by: Hans Dedecker (backported from 41faf52b0ffe902381e75a35e886f635321347b5) --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index e38d44a8104..53018830615 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,8 @@ ifneq ($(OPENWRT_BUILD),1) export OPENWRT_BUILD GREP_OPTIONS= export GREP_OPTIONS + CDPATH= + export CDPATH include $(TOPDIR)/include/debug.mk include $(TOPDIR)/include/depends.mk include $(TOPDIR)/include/toplevel.mk From 4424fa9ef0bb36b04d8be3e307bf6bb83e64c695 Mon Sep 17 00:00:00 2001 From: Alex Maclean Date: Thu, 23 Aug 2018 14:30:36 +0100 Subject: [PATCH 205/399] x86: add UHCI and XHCI USB host drivers to 4.14 Without UHCI a non-trivial number of machines will have no keyboard without BIOS assistance. Add XHCI as well in case there are chipsets which don't support legacy interfaces, and support PCI OHCI controllers also. Signed-off-by: Alex Maclean (backported from 894a95fa2df9467afe559c899af741a0c9040953) --- target/linux/x86/config-4.14 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 index bde549b1e31..038d874e521 100644 --- a/target/linux/x86/config-4.14 +++ b/target/linux/x86/config-4.14 @@ -438,10 +438,14 @@ CONFIG_USB_EHCI_PCI=y CONFIG_USB_HID=y CONFIG_USB_HIDDEV=y CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PCI=y # CONFIG_USB_OHCI_HCD_PLATFORM is not set CONFIG_USB_PCI=y CONFIG_USB_SUPPORT=y -# CONFIG_USB_UHCI_HCD is not set +CONFIG_USB_UHCI_HCD=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_PCI=y +# CONFIG_USB_XHCI_PLATFORM is not set # CONFIG_USERIO is not set # CONFIG_USER_NS is not set CONFIG_USER_STACKTRACE_SUPPORT=y From ac7b9ca362f0206981c6c1538f859ad50a874315 Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Fri, 24 Aug 2018 11:29:37 +0200 Subject: [PATCH 206/399] x86/geode: enable X86_INTEL_LPSS to select PINCTRL This makes it possible to use the MCP23S08 i/o expander on geode platforms with linux 4.14. Signed-off-by: Martin Schiller (backported from 4eda2fddf2995c8ade2b1e0faddc8ce1f1e0ec5f) --- target/linux/x86/geode/config-default | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default index b564b940eab..15f90faaf00 100644 --- a/target/linux/x86/geode/config-default +++ b/target/linux/x86/geode/config-default @@ -97,6 +97,15 @@ CONFIG_PCI_MMCONFIG=y # CONFIG_PCWATCHDOG is not set CONFIG_PGTABLE_LEVELS=2 # CONFIG_PHYS_ADDR_T_64BIT is not set +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_BAYTRAIL is not set +# CONFIG_PINCTRL_BROXTON is not set +# CONFIG_PINCTRL_CANNONLAKE is not set +# CONFIG_PINCTRL_CHERRYVIEW is not set +# CONFIG_PINCTRL_DENVERTON is not set +# CONFIG_PINCTRL_GEMINILAKE is not set +# CONFIG_PINCTRL_LEWISBURG is not set +# CONFIG_PINCTRL_SUNRISEPOINT is not set # CONFIG_PMIC_OPREGION is not set CONFIG_PNP=y CONFIG_PNPACPI=y @@ -127,7 +136,7 @@ CONFIG_VIA_RHINE_MMIO=y CONFIG_X86_CPUID=y CONFIG_X86_DEBUGCTLMSR=y # CONFIG_X86_E_POWERSAVER is not set -# CONFIG_X86_INTEL_LPSS is not set +CONFIG_X86_INTEL_LPSS=y # CONFIG_X86_LONGHAUL is not set # CONFIG_X86_MCE is not set CONFIG_X86_MINIMUM_CPU_FAMILY=4 From 7d00815ea80a2a2dbe26a0b77f50806f235e9f4f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 26 Aug 2018 12:20:24 +0200 Subject: [PATCH 207/399] x86: geode: Add missing config options This adds a configuration options which is needed now. Without this patch the geode build will fail. Fixes: 4eda2fddf2 ("x86/geode: enable X86_INTEL_LPSS to select PINCTRL") Signed-off-by: Hauke Mehrtens (backported from 0f2787b9ff6976cf4999ed2dbb7debdb53bac2e3) --- target/linux/x86/geode/config-default | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default index 15f90faaf00..abca7ac6b81 100644 --- a/target/linux/x86/geode/config-default +++ b/target/linux/x86/geode/config-default @@ -69,7 +69,8 @@ CONFIG_I2C_BOARDINFO=y # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PMC_IPC is not set -# CONFIG_INTEL_SOC_PMIC_CHTWC is not set +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set CONFIG_ISA=y # CONFIG_ISAPNP is not set CONFIG_ISA_BUS_API=y @@ -124,7 +125,6 @@ CONFIG_SERIAL_8250_PNP=y # CONFIG_SURFACE_PRO3_BUTTON is not set # CONFIG_TOSHIBA_BT_RFKILL is not set # CONFIG_USB_UHCI_HCD is not set -CONFIG_USB_OHCI_HCD_PCI=y CONFIG_VGACON_SOFT_SCROLLBACK=y # CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 From 741f03b8b7c4aa3b83ad2752036fe41edde29266 Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Fri, 24 Aug 2018 11:31:13 +0200 Subject: [PATCH 208/399] x86/64: enable X86_INTEL_LPSS to select PINCTRL This makes it possible to use the MCP23S08 i/o expander on x86_64 platforms with linux 4.14. Signed-off-by: Martin Schiller (backported from 17f30bfcf7329c1770dc996b0d29934942bb2899) --- target/linux/x86/64/config-default | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 12932e4a2ae..ee14a365731 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -276,6 +276,15 @@ CONFIG_PCI_HYPERV=y CONFIG_PCI_XEN=y CONFIG_PGTABLE_LEVELS=4 CONFIG_PHYSICAL_ALIGN=0x1000000 +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_BAYTRAIL is not set +# CONFIG_PINCTRL_BROXTON is not set +# CONFIG_PINCTRL_CANNONLAKE is not set +# CONFIG_PINCTRL_CHERRYVIEW is not set +# CONFIG_PINCTRL_DENVERTON is not set +# CONFIG_PINCTRL_GEMINILAKE is not set +# CONFIG_PINCTRL_LEWISBURG is not set +# CONFIG_PINCTRL_SUNRISEPOINT is not set CONFIG_PM=y # CONFIG_PMIC_OPREGION is not set CONFIG_PM_CLK=y @@ -375,7 +384,7 @@ CONFIG_X86_CPUID=y CONFIG_X86_DEBUGCTLMSR=y CONFIG_X86_DEV_DMA_OPS=y CONFIG_X86_DIRECT_GBPAGES=y -# CONFIG_X86_INTEL_LPSS is not set +CONFIG_X86_INTEL_LPSS=y # CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set # CONFIG_X86_INTEL_MPX is not set CONFIG_X86_INTEL_PSTATE=y From 8ec7ad033efd68b609591cca0584772d95f78d8e Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Fri, 24 Aug 2018 11:35:35 +0200 Subject: [PATCH 209/399] kernel: fix kmod-gpio-mcp23s08 for linux 4.14 Signed-off-by: Martin Schiller (backported from a904003b9b5fe2744ee5d5d8718c54d001f1c93e) --- package/kernel/linux/modules/other.mk | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index eb26a8ba081..9c3d54ebd89 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -228,9 +228,13 @@ define KernelPackage/gpio-mcp23s08 SUBMENU:=$(OTHER_MENU) TITLE:=Microchip MCP23xxx I/O expander DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core - KCONFIG:=CONFIG_GPIO_MCP23S08 - FILES:=$(LINUX_DIR)/drivers/gpio/gpio-mcp23s08.ko - AUTOLOAD:=$(call AutoLoad,40,gpio-mcp23s08) + KCONFIG:= \ + CONFIG_GPIO_MCP23S08 \ + CONFIG_PINCTRL_MCP23S08 + FILES:= \ + $(LINUX_DIR)/drivers/gpio/gpio-mcp23s08.ko@lt4.13 \ + $(LINUX_DIR)/drivers/pinctrl/pinctrl-mcp23s08.ko@ge4.13 + AUTOLOAD:=$(call AutoLoad,40,gpio-mcp23s08@lt4.13 pinctrl-mcp23s08@ge4.13) endef define KernelPackage/gpio-mcp23s08/description From 39420c3eadd826cda9e864fa9f436881ec95f6a8 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Wed, 2 May 2018 10:23:45 +0200 Subject: [PATCH 210/399] libbsd: Update to 0.8.7 Update libbsd to 0.8.7 Remove glibc dependency Clean up InstallDev and install entries Use /usr path for consistency Cherry pick patches from upstream to fix musl compilation Signed-off-by: Daniel Engberg (backported from e341f45913beac28e5574d470ed79e4b6f9ee255) --- package/libs/libbsd/Makefile | 38 ++-- .../libbsd/patches/001-aarch64_support.patch | 19 -- ...1-handle-systems-missing-sys_cdefs.h.patch | 195 ++++++++++++++++++ ...ion_for_glibc_already_providing_them.patch | 65 ++++++ 4 files changed, 272 insertions(+), 45 deletions(-) delete mode 100644 package/libs/libbsd/patches/001-aarch64_support.patch create mode 100644 package/libs/libbsd/patches/001-handle-systems-missing-sys_cdefs.h.patch create mode 100644 package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch diff --git a/package/libs/libbsd/Makefile b/package/libs/libbsd/Makefile index 11232c74154..a425b83398e 100644 --- a/package/libs/libbsd/Makefile +++ b/package/libs/libbsd/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libbsd -PKG_VERSION:=0.3.0 +PKG_VERSION:=0.8.7 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=fbf36ed40443e1d0d795adbae8d461952509e610c3ccf0866ae160b723f7fe38 -PKG_SOURCE_URL:=http://libbsd.freedesktop.org/releases +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_HASH:=f548f10e5af5a08b1e22889ce84315b1ebe41505b015c9596bad03fd13a12b31 +PKG_SOURCE_URL:=https://libbsd.freedesktop.org/releases PKG_LICENSE:=BSD-4-Clause PKG_LICENSE_FILES:=COPYING @@ -18,7 +18,6 @@ PKG_INSTALL:=1 define Package/libbsd SECTION:=libs CATEGORY:=Libraries - DEPENDS:=@USE_GLIBC TITLE:=common BSD library endef @@ -27,30 +26,17 @@ define Package/libbsd/description endef define Build/InstallDev - $(INSTALL_DIR) \ - $(1)/lib \ - $(1)/usr/include - - $(CP) \ - $(PKG_INSTALL_DIR)/lib/libbsd.so* \ - $(1)/lib/ - - $(CP) \ - $(PKG_INSTALL_DIR)/usr/include/* \ - $(1)/usr/include/ - - ( cd $(1)/lib ; $(LN) libbsd.so.$(PKG_VERSION) libbsd.so ) + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbsd.{la,so*} $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libbsd*.pc $(1)/usr/lib/pkgconfig/ + $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/ endef define Package/libbsd/install - $(INSTALL_DIR) \ - $(1)/lib - - $(CP) \ - $(PKG_INSTALL_DIR)/lib/libbsd.so* \ - $(1)/lib/ - - ( cd $(1)/lib ; $(LN) libbsd.so.$(PKG_VERSION) libbsd.so ) + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbsd.so* $(1)/usr/lib/ endef $(eval $(call BuildPackage,libbsd)) diff --git a/package/libs/libbsd/patches/001-aarch64_support.patch b/package/libs/libbsd/patches/001-aarch64_support.patch deleted file mode 100644 index 62291482c70..00000000000 --- a/package/libs/libbsd/patches/001-aarch64_support.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/src/local-elf.h -+++ b/src/local-elf.h -@@ -165,6 +165,16 @@ - #endif - #define ELF_TARG_DATA ELFDATA2MSB - -+#elif defined(__aarch64__) -+ -+#define ELF_TARG_MACH EM_AARCH64 -+#define ELF_TARG_CLASS ELFCLASS64 -+#ifdef __AARCH64EB__ -+#define ELF_TARG_DATA ELFDATA2MSB -+#else -+#define ELF_TARG_DATA ELFDATA2LSB -+#endif -+ - #else - - #error Unknown ELF machine type diff --git a/package/libs/libbsd/patches/001-handle-systems-missing-sys_cdefs.h.patch b/package/libs/libbsd/patches/001-handle-systems-missing-sys_cdefs.h.patch new file mode 100644 index 00000000000..108e967722e --- /dev/null +++ b/package/libs/libbsd/patches/001-handle-systems-missing-sys_cdefs.h.patch @@ -0,0 +1,195 @@ +From 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 6 Mar 2018 01:41:35 +0100 +Subject: Handle systems missing + +This is a non-portable header, and we cannot expect it to be provided by +the system libc (e.g. musl). We just need and rely on declaration that +we have defined ourselves in our own . So we switch to +only ever assume that. + +Fixes: https://bugs.freedesktop.org/105281 +--- + include/bsd/libutil.h | 4 ++++ + include/bsd/md5.h | 4 ++++ + include/bsd/nlist.h | 4 ++++ + include/bsd/readpassphrase.h | 4 ++++ + include/bsd/stdlib.h | 4 ++++ + include/bsd/string.h | 4 ++++ + include/bsd/stringlist.h | 5 +++++ + include/bsd/sys/queue.h | 4 ++++ + include/bsd/sys/tree.h | 4 ++++ + include/bsd/timeconv.h | 4 ++++ + include/bsd/vis.h | 4 ++++ + include/bsd/wchar.h | 4 ++++ + 12 files changed, 49 insertions(+) + +--- a/include/bsd/libutil.h ++++ b/include/bsd/libutil.h +@@ -40,7 +40,11 @@ + #define LIBBSD_LIBUTIL_H + + #include ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + #include + #include +--- a/include/bsd/md5.h ++++ b/include/bsd/md5.h +@@ -27,7 +27,11 @@ typedef struct MD5Context { + uint8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ + } MD5_CTX; + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +--- a/include/bsd/nlist.h ++++ b/include/bsd/nlist.h +@@ -27,7 +27,11 @@ + #ifndef LIBBSD_NLIST_H + #define LIBBSD_NLIST_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + struct nlist { + union { +--- a/include/bsd/readpassphrase.h ++++ b/include/bsd/readpassphrase.h +@@ -31,7 +31,11 @@ + #define RPP_SEVENBIT 0x10 /* Strip the high bit from input. */ + #define RPP_STDIN 0x20 /* Read from stdin, not /dev/tty */ + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +--- a/include/bsd/stdlib.h ++++ b/include/bsd/stdlib.h +@@ -42,7 +42,11 @@ + #ifndef LIBBSD_STDLIB_H + #define LIBBSD_STDLIB_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + #include + +--- a/include/bsd/string.h ++++ b/include/bsd/string.h +@@ -33,7 +33,11 @@ + #ifndef LIBBSD_STRING_H + #define LIBBSD_STRING_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS +--- a/include/bsd/stringlist.h ++++ b/include/bsd/stringlist.h +@@ -31,7 +31,12 @@ + + #ifndef LIBBSD_STRINGLIST_H + #define LIBBSD_STRINGLIST_H ++ ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + /* +--- a/include/bsd/sys/queue.h ++++ b/include/bsd/sys/queue.h +@@ -33,7 +33,11 @@ + #ifndef LIBBSD_SYS_QUEUE_H + #define LIBBSD_SYS_QUEUE_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + /* + * This file defines four types of data structures: singly-linked lists, +--- a/include/bsd/sys/tree.h ++++ b/include/bsd/sys/tree.h +@@ -30,7 +30,11 @@ + #ifndef LIBBSD_SYS_TREE_H + #define LIBBSD_SYS_TREE_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + /* + * This file defines data structures for different types of trees: +--- a/include/bsd/timeconv.h ++++ b/include/bsd/timeconv.h +@@ -41,7 +41,11 @@ + #ifndef LIBBSD_TIMECONV_H + #define LIBBSD_TIMECONV_H + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + #include + +--- a/include/bsd/vis.h ++++ b/include/bsd/vis.h +@@ -72,7 +72,11 @@ + */ + #define UNVIS_END 1 /* no more characters */ + ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + + __BEGIN_DECLS + char *vis(char *, int, int, int); +--- a/include/bsd/wchar.h ++++ b/include/bsd/wchar.h +@@ -40,7 +40,11 @@ + #define LIBBSD_WCHAR_H + + #include ++#ifdef LIBBSD_OVERLAY + #include ++#else ++#include ++#endif + #include + + __BEGIN_DECLS diff --git a/package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch b/package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch new file mode 100644 index 00000000000..3ce1d654c94 --- /dev/null +++ b/package/libs/libbsd/patches/002-fix_function_declaration_protection_for_glibc_already_providing_them.patch @@ -0,0 +1,65 @@ +From 1f8a3f7bccfc84b195218ad0086ebd57049c3490 Mon Sep 17 00:00:00 2001 +From: Guillem Jover +Date: Tue, 6 Mar 2018 01:39:45 +0100 +Subject: Fix function declaration protection for glibc already providing them +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +On non-glibc based systems we cannot unconditionally use the +__GLIBC_PREREQ macro as it gets expanded before evaluation. Instead, +if it is undefined, define it to 0. + +We should also always declare these functions on non-glibc based +systems. And on systems with a new enough glibc, which provides these +functions, we should still provide the declarations if _GNU_SOURCE +is *not* defined. + +Reported-by: Jörg Krause +--- + include/bsd/stdlib.h | 3 ++- + include/bsd/string.h | 3 ++- + include/bsd/sys/cdefs.h | 8 ++++++++ + 3 files changed, 12 insertions(+), 2 deletions(-) + +--- a/include/bsd/stdlib.h ++++ b/include/bsd/stdlib.h +@@ -71,7 +71,8 @@ int sradixsort(const unsigned char **bas + const unsigned char *table, unsigned endbyte); + + void *reallocf(void *ptr, size_t size); +-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26) ++#if !defined(__GLIBC__) || \ ++ (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 26) || !defined(_GNU_SOURCE))) + void *reallocarray(void *ptr, size_t nmemb, size_t size); + #endif + +--- a/include/bsd/string.h ++++ b/include/bsd/string.h +@@ -46,7 +46,8 @@ size_t strlcat(char *dst, const char *sr + char *strnstr(const char *str, const char *find, size_t str_len); + void strmode(mode_t mode, char *str); + +-#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25) ++#if !defined(__GLIBC__) || \ ++ (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE))) + void explicit_bzero(void *buf, size_t len); + #endif + __END_DECLS +--- a/include/bsd/sys/cdefs.h ++++ b/include/bsd/sys/cdefs.h +@@ -59,6 +59,14 @@ + #endif + + /* ++ * On non-glibc based systems, we cannot unconditionally use the ++ * __GLIBC_PREREQ macro as it gets expanded before evaluation. ++ */ ++#ifndef __GLIBC_PREREQ ++#define __GLIBC_PREREQ(maj, min) 0 ++#endif ++ ++/* + * Some kFreeBSD headers expect those macros to be set for sanity checks. + */ + #ifndef _SYS_CDEFS_H_ From 9afbe27bd01fc3b36179120681c1560be3afffdd Mon Sep 17 00:00:00 2001 From: Keith Wong Date: Thu, 12 Apr 2018 11:21:08 +0800 Subject: [PATCH 211/399] kernel: add kmod-tcp-bbr This adds support for BBR (Bottleneck Bandwidth and RTT) TCP congestion control. Applications (e.g. webservers, VPN client/server) which initiate connections from router side can benefit from this. This provide an easier way for users to use BBR by selecting / installing kmod-tcp-bbr instead of altering kernel config and compiling firmware by themselves. Signed-off-by: Keith Wong (backported from 79c233daa4caee1a8af0c7a91e1d4aee96d410e9) --- .../linux/files/sysctl-tcp-bbr-k4_9.conf | 5 +++ .../kernel/linux/files/sysctl-tcp-bbr.conf | 4 +++ package/kernel/linux/modules/netsupport.mk | 31 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 package/kernel/linux/files/sysctl-tcp-bbr-k4_9.conf create mode 100644 package/kernel/linux/files/sysctl-tcp-bbr.conf diff --git a/package/kernel/linux/files/sysctl-tcp-bbr-k4_9.conf b/package/kernel/linux/files/sysctl-tcp-bbr-k4_9.conf new file mode 100644 index 00000000000..2f63b728881 --- /dev/null +++ b/package/kernel/linux/files/sysctl-tcp-bbr-k4_9.conf @@ -0,0 +1,5 @@ +# Do not edit, changes to this file will be lost on upgrades +# /etc/sysctl.conf can be used to customize sysctl settings + +net.ipv4.tcp_congestion_control=bbr +net.core.default_qdisc=fq diff --git a/package/kernel/linux/files/sysctl-tcp-bbr.conf b/package/kernel/linux/files/sysctl-tcp-bbr.conf new file mode 100644 index 00000000000..3a7dba2f0b2 --- /dev/null +++ b/package/kernel/linux/files/sysctl-tcp-bbr.conf @@ -0,0 +1,4 @@ +# Do not edit, changes to this file will be lost on upgrades +# /etc/sysctl.conf can be used to customize sysctl settings + +net.ipv4.tcp_congestion_control=bbr diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index ff767206368..050541488c9 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -777,6 +777,37 @@ endef $(eval $(call KernelPackage,sched)) +define KernelPackage/tcp-bbr + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=BBR TCP congestion control + DEPENDS:=@!LINUX_3_18 @!LINUX_4_1 @!LINUX_4_4 +LINUX_4_9:kmod-sched + KCONFIG:= \ + CONFIG_TCP_CONG_ADVANCED=y \ + CONFIG_TCP_CONG_BBR + FILES:=$(LINUX_DIR)/net/ipv4/tcp_bbr.ko + AUTOLOAD:=$(call AutoLoad,74,tcp_bbr) +endef + +define KernelPackage/tcp-bbr/description + Kernel module for BBR (Bottleneck Bandwidth and RTT) TCP congestion + control. It requires the fq ("Fair Queue") pacing packet scheduler. + For kernel 4.13+, TCP internal pacing is implemented as fallback. +endef + +ifdef CONFIG_LINUX_4_9 + TCP_BBR_SYSCTL_CONF:=sysctl-tcp-bbr-k4_9.conf +else + TCP_BBR_SYSCTL_CONF:=sysctl-tcp-bbr.conf +endif + +define KernelPackage/tcp-bbr/install + $(INSTALL_DIR) $(1)/etc/sysctl.d + $(INSTALL_DATA) ./files/$(TCP_BBR_SYSCTL_CONF) $(1)/etc/sysctl.d/12-tcp-bbr.conf +endef + +$(eval $(call KernelPackage,tcp-bbr)) + + define KernelPackage/ax25 SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=AX25 support From 40ca437c325d6a88ff05033a7817bdfbf962e9a2 Mon Sep 17 00:00:00 2001 From: Tuomas Tynkkynen Date: Sun, 19 Aug 2018 22:11:50 +0300 Subject: [PATCH 212/399] brcm47xx: Enable USB power on WNDR3400v3 WNDR3400v3 needs GPIO 21 pulled high to enable power to USB ports. Add a kernel patch to do that. Signed-off-by: Tuomas Tynkkynen (backported from 5dd745588edea19846b2bc3a2e6938f139374ea9) --- ...able-USB-power-on-Netgear-WNDR3400v3.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 target/linux/brcm47xx/patches-4.14/161-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch diff --git a/target/linux/brcm47xx/patches-4.14/161-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch b/target/linux/brcm47xx/patches-4.14/161-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch new file mode 100644 index 00000000000..4a1a4d532ad --- /dev/null +++ b/target/linux/brcm47xx/patches-4.14/161-MIPS-BCM47XX-Enable-USB-power-on-Netgear-WNDR3400v3.patch @@ -0,0 +1,39 @@ +From 17cb62255ef8f6b6ac270024204a8fa65537b333 Mon Sep 17 00:00:00 2001 +From: Tuomas Tynkkynen +Date: Sun, 19 Aug 2018 21:23:14 +0300 +Subject: [PATCH] MIPS: BCM47XX: Enable USB power on Netgear WNDR3400v3 + +Setting GPIO 21 high seems to be required to enable power to USB ports +on the WNDR3400v3. As there is already similar code for WNR3500L, +make the existing USB power GPIO code generic and use that. + +Signed-off-by: Tuomas Tynkkynen +--- + arch/mips/bcm47xx/workarounds.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/arch/mips/bcm47xx/workarounds.c ++++ b/arch/mips/bcm47xx/workarounds.c +@@ -5,9 +5,8 @@ + #include + #include + +-static void __init bcm47xx_workarounds_netgear_wnr3500l(void) ++static void __init bcm47xx_workarounds_enable_usb_power(int usb_power) + { +- const int usb_power = 12; + int err; + + err = gpio_request_one(usb_power, GPIOF_OUT_INIT_HIGH, "usb_power"); +@@ -23,7 +22,10 @@ void __init bcm47xx_workarounds(void) + + switch (board) { + case BCM47XX_BOARD_NETGEAR_WNR3500L: +- bcm47xx_workarounds_netgear_wnr3500l(); ++ bcm47xx_workarounds_enable_usb_power(12); ++ break; ++ case BCM47XX_BOARD_NETGEAR_WNDR3400_V3: ++ bcm47xx_workarounds_enable_usb_power(21); + break; + default: + /* No workaround(s) needed */ From 87a6aadfd558a8ea4477c85f55e617e5cc7e77ea Mon Sep 17 00:00:00 2001 From: Paul Wassi Date: Thu, 23 Aug 2018 09:24:43 +0200 Subject: [PATCH 213/399] base-files: provide more tolerant xterm detection Set the window title not only in "xterm", but also in e.g. "xterm-256color", "xterm-color", etc. The case statement is taken from Debian / Ubuntu. Signed-off-by: Paul Wassi (backported from 1bd6b91e0f9f53f13b5a9fa2939674012fe7193f) --- package/base-files/files/etc/profile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index e9936fb36a9..9a3ac069a20 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -14,7 +14,11 @@ export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6) export HOME=${HOME:-/root} export PS1='\u@\h:\w\$ ' -[ "$TERM" = "xterm" ] && export PS1='\[\e]0;\u@\h: \w\a\]'$PS1 +case "$TERM" in + xterm*|rxvt*) + export PS1='\[\e]0;\u@\h: \w\a\]'$PS1 + ;; +esac [ -x /bin/more ] || alias more=less [ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi From 62e7ad1d2100f0b2ea8f5ebd1dc50ac7b841967a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 30 Aug 2018 15:08:20 +0200 Subject: [PATCH 214/399] ppp: remove hardcoded lcp-echo-failure, lcp-echo-interval values OpenWrt used to ship hardcoded defaults for lcp-echo-failure and lcp-echo-interval in the non-uci /etc/ppp/options file. These values break uci support for *disabling* LCP echos through the use of "option keepalive 0" as either omitting the keepalive option or setting it to 0 will result in no lcp-echo-* flags getting passed to the pppd cmdline, causing the pppd process to revert to the defaults in /etc/ppp/options. Address this issue by letting the uci "keepalive" option default to the former hardcoded values "5, 1" and by removing the fixed lcp-echo-failure and lcp-echo-interval settings from the /etc/ppp/options files. Ref: https://github.com/openwrt/luci/issues/2112 Ref: https://dev.archive.openwrt.org/ticket/2373.html Ref: https://bugs.openwrt.org/index.php?do=details&task_id=854 Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1259 Signed-off-by: Jo-Philipp Wich (backported from 555c592304023a0d24216a6d8ed9d525602ae218) --- package/network/services/ppp/files/etc/ppp/options | 2 -- package/network/services/ppp/files/ppp.sh | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/ppp/files/etc/ppp/options b/package/network/services/ppp/files/etc/ppp/options index 6b93f7bdb68..dbb2bdb3e25 100644 --- a/package/network/services/ppp/files/etc/ppp/options +++ b/package/network/services/ppp/files/etc/ppp/options @@ -6,5 +6,3 @@ nopcomp nocrtscts lock maxfail 0 -lcp-echo-failure 5 -lcp-echo-interval 1 diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 73bc3161cdc..99d5e4939f0 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -120,6 +120,8 @@ ppp_generic_setup() { } } + [ -n "$keepalive" ] || keepalive="5 1" + local lcp_failure="${keepalive%%[, ]*}" local lcp_interval="${keepalive##*[, ]}" local lcp_adaptive="lcp-echo-adaptive" From 42dafa0ac589370877747c6647f75ea3ab9572b6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 26 Aug 2018 19:36:33 +0200 Subject: [PATCH 215/399] build: add support for enabling the rootfs/boot partition size option via target feature Signed-off-by: Felix Fietkau (backported from 00f030a9c67c551e675364d73234a4cba273b420) --- config/Config-images.in | 4 ++-- scripts/target-metadata.pl | 2 ++ target/Config.in | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 90e873edb8e..afdbdc4079a 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -259,12 +259,12 @@ menu "Target Images" config TARGET_KERNEL_PARTSIZE int "Kernel partition size (in MB)" - depends on GRUB_IMAGES + depends on GRUB_IMAGES || USES_BOOT_PART default 16 config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" - depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml + depends on GRUB_IMAGES || USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml default 256 help Select the root filesystem partition size. diff --git a/scripts/target-metadata.pl b/scripts/target-metadata.pl index cbc3403a057..ef0a34eb4ff 100755 --- a/scripts/target-metadata.pl +++ b/scripts/target-metadata.pl @@ -40,6 +40,8 @@ (@) /^small_flash$/ and $ret .= "\tselect SMALL_FLASH\n"; /^nand$/ and $ret .= "\tselect NAND_SUPPORT\n"; /^virtio$/ and $ret .= "\tselect VIRTIO_SUPPORT\n"; + /^rootfs-part$/ and $ret .= "\tselect USES_ROOTFS_PART\n"; + /^boot-part$/ and $ret .= "\tselect USES_BOOT_PART\n"; } return $ret; } diff --git a/target/Config.in b/target/Config.in index 3aef76890db..3cf4231f2aa 100644 --- a/target/Config.in +++ b/target/Config.in @@ -96,6 +96,12 @@ config ARCH_64BIT config VIRTIO_SUPPORT bool +config USES_ROOTFS_PART + bool + +config USES_BOOT_PART + bool + # Architecture selection config aarch64 From 69f28f3a205d22f44fe79ecb8b30ab1e2f3e60e3 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 3 Sep 2018 21:42:02 +0200 Subject: [PATCH 216/399] hostapd: fix build of wpa-supplicant-p2p VARIANT:= got removed by accident. Fixes: 3838b16943c6 ("hostapd: fix conflicts hell") Signed-off-by: Alexander Couzens (backported from 967d6460c02810c9f4ec6f8c6894057995a03bf9) --- package/network/services/hostapd/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 5158d8a9f54..6700f3589ef 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -302,6 +302,7 @@ define Package/wpa-supplicant-p2p $(call Package/wpa-supplicant/Default,$(1)) TITLE+= (with Wi-Fi P2P support) DEPENDS+=@PACKAGE_kmod-cfg80211 + VARIANT:=supplicant-p2p-internal endef define Package/wpa-supplicant-mesh/Default From 8cac88af4b0f30586cd848a8543e7b1f81902d6b Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 5 Sep 2018 10:59:23 +0200 Subject: [PATCH 217/399] odhcpd: bump to git HEAD (detect broken hostnames) 881f66b odhcpd: detect broken hostnames 3e17fd9 config: fix odhcpd_attrs array size Signed-off-by: Hans Dedecker (backported from ecc3165cbc6e2f51a685962cac6074f63097fa05) --- package/network/services/odhcpd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index fa8731491c6..25a3cf56493 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=1 -PKG_VERSION:=1.10 +PKG_VERSION:=1.11 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2018-07-26 -PKG_SOURCE_VERSION:=44cce3169a961727b1f046b786e7995ffb26a957 -PKG_MIRROR_HASH:=f068ddad6e4c630a5baf7369a6deaebd1ec3f7e5c0aa4826496451da425e40dc +PKG_SOURCE_DATE:=2018-09-05 +PKG_SOURCE_VERSION:=881f66b0c2526bff6a2a51b30d314c512df813b4 +PKG_MIRROR_HASH:=b339004f83974ea6fa7ef04f3a815644f832c2d24d186faddbeb5ea20c908a1e PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 0dbafc3a3a9becad5b50e9c2f8c86cc9eac0bfba Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Thu, 28 Jun 2018 13:00:10 +0300 Subject: [PATCH 218/399] strace: fix build on aarch64 As of version 4.21, strace enforces mpers by default. The current implementation of aarch64 compat in strace assumes it's identical to ARMv7 EABI and therefore tries to enable m32 personality support. As there is no -m32 support on aarch64, this causes the build to fail. Restore previous strace behavior to fix build on aarch64. Signed-off-by: Stijn Tintel Tested-by: Karl Palsson (backported from 067e2f5f1d0102ffb96d3248e42a29e7352cc29c) --- package/devel/strace/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 6209dc5a638..15faa5e4061 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -30,6 +30,10 @@ include $(INCLUDE_DIR)/package.mk HOST_CFLAGS += -I$(LINUX_DIR)/user_headers/include +ifeq ($(ARCH),aarch64) + CONFIGURE_ARGS += --enable-mpers=check +endif + CONFIGURE_VARS+= \ LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \ CPPFLAGS_FOR_BUILD="$(HOST_CPPFLAGS)" \ From f5cf9b265f7825e54286d4dfc994e56ec722c0c5 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Wed, 5 Sep 2018 15:29:25 +0000 Subject: [PATCH 219/399] scripts/metadata.pm: avoid adding dup names in provides list The need arises from building Open vSwitch kernel datapath modules, e.g. - kmod-openvswitch from Linux upstream - kmod-openvswitch-intree from openvswitch source code where both provides virtual package "kmod-openvswitch" for userspace packages to select and depend on Signed-off-by: Yousong Zhou (backported from 204081670b914795a494929777f09807b15f70f4) --- scripts/metadata.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/metadata.pm b/scripts/metadata.pm index e05e4009916..4a5464edc0d 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -250,6 +250,7 @@ sub parse_package_metadata($) { my @vpkg = split /\s+/, $1; @{$pkg->{provides}} = ($pkg->{name}, @vpkg); foreach my $vpkg (@vpkg) { + next if ($vpkg eq $pkg->{name}); $vpackage{$vpkg} or $vpackage{$vpkg} = []; push @{$vpackage{$vpkg}}, $pkg; } From fa3805f2b6d3c03eee94579d29cf2f0bca07ce04 Mon Sep 17 00:00:00 2001 From: Yousong Zhou Date: Thu, 6 Sep 2018 08:00:24 +0000 Subject: [PATCH 220/399] scripts/ipkg-build: quash error messages when conffiles.resolved is empty When Package/xx/conffiles only contains directories that are empty at package time, conffiles.resolved will be missing and the following error messages will appear in the build log. /home/yousong/git-repo/openwrt/openwrt/scripts/ipkg-build -c -o 0 -g 0 /home/yousong/git-repo/openwrt/openwrt/build_dir/target-mips_24kc_musl/linux-malta_be/openvswitch-2.10.0/ipkg-mips_24kc/openvswitch-common /home/yousong/git-repo/openwrt/openwrt/bin/packages/mips_24kc/packages mv: cannot stat 'CONTROL/conffiles.resolved': No such file or directory chmod: cannot access 'CONTROL/conffiles': No such file or directory It will not break the ipkg-build process. The change is merely cosmetic to not cause confusion when reading logs Signed-off-by: Yousong Zhou (backported from 9e58c20ec9d48ee41a4a306b0cd6d3aece285efd) --- scripts/ipkg-build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ipkg-build b/scripts/ipkg-build index d38ba20af30..21127f33910 100755 --- a/scripts/ipkg-build +++ b/scripts/ipkg-build @@ -64,8 +64,10 @@ pkg_appears_sane() { done rm $CONTROL/conffiles - mv $CONTROL/conffiles.resolved $CONTROL/conffiles - chmod 0644 $CONTROL/conffiles + if [ -f $CONTROL/conffiles.resolved ]; then + mv $CONTROL/conffiles.resolved $CONTROL/conffiles + chmod 0644 $CONTROL/conffiles + fi fi cd $owd From 3dbdd404a8729fa7fa324d9f06555f27147af8ad Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 1 Sep 2018 19:06:54 -0700 Subject: [PATCH 221/399] hostapd: Fix compile with OpenSSL 1.1.0 + no deprecated APIs Patch was accepted upsteam: https://w1.fi/cgit/hostap/commit/?id=373c796948599a509bad71695b5b72eef003f661 Signed-off-by: Rosen Penev (backported from f78e07ad2a0926739310f8a6fd74a7b162123c98) (rebased patches) Signed-off-by: Jo-Philipp Wich --- .../hostapd/patches/700-fix-openssl11.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 package/network/services/hostapd/patches/700-fix-openssl11.patch diff --git a/package/network/services/hostapd/patches/700-fix-openssl11.patch b/package/network/services/hostapd/patches/700-fix-openssl11.patch new file mode 100644 index 00000000000..86343c150bb --- /dev/null +++ b/package/network/services/hostapd/patches/700-fix-openssl11.patch @@ -0,0 +1,35 @@ +From 672540d4ddbd24782b5c65b35d636bdfe8a90d0f Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Fri, 15 Jun 2018 18:35:30 -0700 +Subject: [PATCH] Fix compile with OpenSSL 1.1.0 and deprecated APIs + +SSL_session_reused is the same as SSL_cache_hit. The engine load stuff is +now handled by OPENSSL_init. + +Signed-off-by: Rosen Penev +--- + src/crypto/tls_openssl.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/src/crypto/tls_openssl.c ++++ b/src/crypto/tls_openssl.c +@@ -1024,8 +1024,10 @@ void * tls_init(const struct tls_config + + #ifndef OPENSSL_NO_ENGINE + wpa_printf(MSG_DEBUG, "ENGINE: Loading dynamic engine"); ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ERR_load_ENGINE_strings(); + ENGINE_load_dynamic(); ++#endif /* OPENSSL_VERSION_NUMBER */ + + if (conf && + (conf->opensc_engine_path || conf->pkcs11_engine_path || +@@ -3874,7 +3876,7 @@ struct wpabuf * tls_connection_decrypt(v + + int tls_connection_resumed(void *ssl_ctx, struct tls_connection *conn) + { +- return conn ? SSL_cache_hit(conn->ssl) : 0; ++ return conn ? SSL_session_reused(conn->ssl) : 0; + } + + From 376e9294c718c1ba3fcf5eb536f3f0e42369cef3 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 9 Sep 2018 18:55:43 -0700 Subject: [PATCH 222/399] usbutils: Update usb.ids to 0.315 Referencing the version instead of revision should fix uscan. Tested on Turria Omnia. Signed-off-by: Rosen Penev (backported from a9aa25c8b6f2e694d5bc0b14fe84eac6fffeb23a) --- package/utils/usbutils/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/utils/usbutils/Makefile b/package/utils/usbutils/Makefile index c5f625eb340..849ac964369 100644 --- a/package/utils/usbutils/Makefile +++ b/package/utils/usbutils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usbutils PKG_VERSION:=007 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/usb/usbutils @@ -32,13 +32,13 @@ define Package/usbutils URL:=http://www.linux-usb.org/ endef -USB_IDS_REV:=016be785fd4f5f895c6482ec484507d5a08839fa -USB_IDS_FILE:=usb.ids.$(USB_IDS_REV) +USB_IDS_VER:=0.315 +USB_IDS_FILE:=usb.ids.$(USB_IDS_VER) define Download/usb_ids FILE:=$(USB_IDS_FILE) URL_FILE:=usb.ids - URL:=@GITHUB/vcrhonek/hwdata/$(USB_IDS_REV) - HASH:=b1877a9fd30c2f9dedec1657963775e7f261c892eb7d6f4281c453bd73492489 + URL:=@GITHUB/vcrhonek/hwdata/v$(USB_IDS_VER) + HASH:=7454bd75fcfe5559bd1caa1bb132ecffe72a39269a2efaab9472de46be3bcf57 endef $(eval $(call Download,usb_ids)) From 4b5e062bd3b901afe2668f3ff04d08e30df00d22 Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Mon, 27 Aug 2018 14:19:55 +0200 Subject: [PATCH 223/399] base-files: /etc/services: add missing 'rpcbind' alias * add missing 'rpcbind' alias to /etc/services Allows rpcbind to open its 111 port and be reachable via lan, this is the default behaviour. Signed-off-by: Andy Walsh (backported from 4549ab46a85735aa957e05c91dc023228aaa2697) --- package/base-files/files/etc/services | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/etc/services b/package/base-files/files/etc/services index 8ff914ecf25..968f9e78be7 100644 --- a/package/base-files/files/etc/services +++ b/package/base-files/files/etc/services @@ -29,8 +29,8 @@ kerberos 88/tcp kerberos5 krb5 kerberos-sec kerberos 88/udp kerberos5 krb5 kerberos-sec pop3 110/tcp pop3 110/udp -sunrpc 111/tcp -sunrpc 111/udp +sunrpc 111/tcp rpcbind +sunrpc 111/udp rpcbind auth 113/tcp ident sftp 115/tcp nntp 119/tcp From 15a023a458a28a23450c44e0bc6c535bfc15e2a1 Mon Sep 17 00:00:00 2001 From: Marko Ratkaj Date: Mon, 10 Sep 2018 11:04:36 +0200 Subject: [PATCH 224/399] tools/expat: fix docbook2man error on some systems On some systems (Gentoo) configure stage fails because of docbook2man working with SGML rather than with XML. We don't need xmlwf man pages so we disable this. Signed-off-by: Marko Ratkaj (backported from 6e80dd58bb6c8c146ed8fd7ed538e96db4e8cc13) --- tools/expat/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index fab04e011fa..54527a7d0ab 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -19,6 +19,9 @@ HOST_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/host-build.mk +HOST_CONFIGURE_ARGS += \ + --without-docbook + define Host/Install $(MAKE) -C $(HOST_BUILD_DIR) install endef From d9f845f76132772f010bd7541c1780d18c238ebc Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Wed, 12 Sep 2018 09:21:19 +0800 Subject: [PATCH 225/399] odhcpd: enable ipv6 server mode only when it is supported Signed-off-by: Rosy Song (backported from 918ec4d549cc80b590e50003d0c489c27f864749) --- package/network/services/odhcpd/Makefile | 2 +- package/network/services/odhcpd/files/odhcpd.defaults | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 25a3cf56493..03adf004551 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_VERSION:=1.11 PKG_SOURCE_PROTO:=git diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults index cecbdd4a8d7..2d8a6f0b1a4 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -13,7 +13,7 @@ json_select .. case "$protocol" in # only enable server mode on statically addressed lan ports -"static") MODE=server ;; +"static") [ -e /proc/sys/net/ipv6 ] && MODE=server || MODE=disabled ;; *) MODE=disabled ;; esac From f6eab3c3de026799d98391c7f2729b6779c5a9a9 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 17 Sep 2018 11:24:39 +0200 Subject: [PATCH 226/399] ds-lite: drop default encaplimit value Setting encaplimit to a numerical value results into the value being included as tunnel encapsulation limit in the destination option header for tunneled packets. Several users have reported interop issues as not all ISPs support the destination option header containing the tunnel encapsulation limit resulting into broken ds-lite connectivity. Therefore drop the default encaplimit value for ds-lite tunnels so no destination option header is included by default. Signed-off-by: Hans Dedecker (backported from 1241707b4091aa9dd46ad75252689e83f6aac5b2) --- package/network/ipv6/ds-lite/Makefile | 2 +- package/network/ipv6/ds-lite/files/dslite.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/ipv6/ds-lite/Makefile b/package/network/ipv6/ds-lite/Makefile index 4393d35877f..198b6ebcc7c 100644 --- a/package/network/ipv6/ds-lite/Makefile +++ b/package/network/ipv6/ds-lite/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ds-lite PKG_VERSION:=7 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/ds-lite/files/dslite.sh b/package/network/ipv6/ds-lite/files/dslite.sh index 7bd3f2e70d5..017963926db 100644 --- a/package/network/ipv6/ds-lite/files/dslite.sh +++ b/package/network/ipv6/ds-lite/files/dslite.sh @@ -69,7 +69,7 @@ proto_dslite_setup() { json_add_string remote "$peeraddr" [ -n "$tunlink" ] && json_add_string link "$tunlink" json_add_object "data" - json_add_string encaplimit "${encaplimit:-4}" + [ -n "$encaplimit" ] && json_add_string encaplimit "$encaplimit" json_close_object proto_close_tunnel From 6f50d5ccf378d231ca25e06b43cf179d9b07c7cd Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 17 Sep 2018 17:53:34 +0200 Subject: [PATCH 227/399] map: drop default encaplimit value Setting encaplimit to a numerical value results into the value being included as tunnel encapsulation limit in the destination option header for tunneled packets. Several users have reported interop issues as not all ISPs support the destination option header containing the tunnel encapsulation limit resulting into broken map connectivity. Therefore drop the default encaplimit value for map tunnels so no destination option header is included by default. Signed-off-by: Hans Dedecker (backported from d9691b66e2781a43cd4f508605dcfe88c4bbd042) --- package/network/ipv6/map/Makefile | 2 +- package/network/ipv6/map/files/map.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile index cfb7c4ac357..10dbe97b488 100644 --- a/package/network/ipv6/map/Makefile +++ b/package/network/ipv6/map/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=map PKG_VERSION:=4 -PKG_RELEASE:=11 +PKG_RELEASE:=12 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh index 5f4add36eb8..70dc72326c4 100755 --- a/package/network/ipv6/map/files/map.sh +++ b/package/network/ipv6/map/files/map.sh @@ -85,7 +85,7 @@ proto_map_setup() { json_add_string remote $(eval "echo \$RULE_${k}_BR") json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE") json_add_object "data" - json_add_string encaplimit "${encaplimit:-4}" + [ -n "$encaplimit" ] && json_add_string encaplimit "$encaplimit" if [ "$type" = "map-e" ]; then json_add_array "fmrs" for i in $(seq $RULE_COUNT); do From bbc0c4d9cbfe4f93b759bbf4bb845ad4b72588f1 Mon Sep 17 00:00:00 2001 From: Jonathan Lancett Date: Thu, 20 Sep 2018 19:16:01 +0100 Subject: [PATCH 228/399] mwlwifi: driver version to 10.3.8.0-20180920 Signed-off-by: Jonathan Lancett [minor tweak to commit title] Signed-off-by: Kevin Darbyshire-Bryant (backported from 95b3f8ec8d4d27525c8eb016b70290d380c55d0a) --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 20451f2862e..505dcae3463 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-08-10 -PKG_SOURCE_VERSION:=75374802d9ccf431a497bf494ca6a984a7ec2470 -PKG_MIRROR_HASH:=528132e554d99e30e011b7ddbfc615f11319668d6f45b0a4ecae14ae935c3914 +PKG_SOURCE_DATE:=2018-09-20 +PKG_SOURCE_VERSION:=4a98c2bec174982676546e599d6f904b65a7179f +PKG_MIRROR_HASH:=18c524662f8f00b88b4b4483d29461c293c16c1e54b129927e24e2a23598007c PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From 69d6da1de601eb94285752b0bea44ad4f2381dfe Mon Sep 17 00:00:00 2001 From: Brett Mastbergen Date: Wed, 12 Sep 2018 15:04:55 -0400 Subject: [PATCH 229/399] kernel: generic: Fix nftables inet table breakage Commit b7265c59ab7d ("kernel: backport a series of netfilter cleanup patches to 4.14") added patch 302-netfilter-nf_tables_inet-don-t-use- multihook-infrast.patch. That patch switches the netfilter core in the kernel to use the new native NFPROTO_INET support. Unfortunately, the new native NFPROTO_INET support does not exist in 4.14 and was not backported along with this patchset. As such, nftables inet tables never see any traffic. As an example the following nft counter rule should increment for every packet coming into the box, but never will: nft add table inet foo nft add chain inet foo bar { type filter hook input priority 0\; } nft add rule inet foo bar counter This commit pulls in the required backport patches to add the new native NFPROTO_INET support, and thus restore nftables inet table functionality. Tested on Turris Omnia (mvebu) Fixes: b7265c59ab7d ("kernel: backport a series of netfilter cleanup ...") Signed-off-by: Brett Mastbergen (backported from f57806b56e5f6ca7bb9fb66d5b175b5f98ece93c) (rebased patches) Signed-off-by: Jo-Philipp Wich --- ...ake-nf_unregister_net_hooks-simple-w.patch | 91 ++++++++ ...emove-synchronize_net-call-if-nfqueu.patch | 116 ++++++++++ ...filter-core-free-hooks-with-call_rcu.patch | 132 ++++++++++++ ...e-size-of-hook-entry-point-locations.patch | 200 ++++++++++++++++++ ...e-hook-array-sizes-to-what-is-needed.patch | 95 +++++++++ ...allocate-space-for-decnet-hooks-unle.patch | 67 ++++++ ...allocate-space-for-arp-bridge-hooks-.patch | 165 +++++++++++++++ ...ass-hook-number-family-and-device-to.patch | 98 +++++++++ ...etfilter-core-add-nf_remove_net_hook.patch | 44 ++++ ...ass-family-as-parameter-to-nf_remove.patch | 51 +++++ ...upport-for-NFPROTO_INET-hook-registr.patch | 129 +++++++++++ ...nly-allow-one-nat-hook-per-hook-poin.patch | 2 +- ...hecksum-indirection-to-struct-nf_ipv.patch | 4 +- ...hecksum_partial-indirection-to-struc.patch | 4 +- ...-saveroute-indirection-in-struct-nf_.patch | 6 +- ...oute-indirection-to-struct-nf_ipv6_o.patch | 4 +- ...eroute-indirection-to-struct-nf_ipv6.patch | 8 +- ...-route_key_size-field-in-struct-nf_a.patch | 8 +- ...-struct-nf_afinfo-and-its-helper-fun.patch | 4 +- ...dd-generic-flow-table-infrastructure.patch | 2 +- ...etfilter-flow-table-support-for-IPv4.patch | 2 +- ...able-support-for-the-mixed-IPv4-IPv6.patch | 2 +- ...er-nf_tables-flow-offload-expression.patch | 2 +- ...rove-flow-table-Kconfig-dependencies.patch | 6 +- ...tfilter-exit_net-cleanup-check-added.patch | 2 +- ...ble-infrastructure-depends-on-NETFIL.patch | 6 +- ...w_table-relax-mixed-ipv4-ipv6-flowta.patch | 2 +- .../hack-4.14/250-netfilter_depends.patch | 4 +- .../generic/hack-4.14/251-sound_kconfig.patch | 4 +- .../650-netfilter-add-xt_OFFLOAD-target.patch | 10 +- ...w_table-add-hardware-offload-support.patch | 2 +- 31 files changed, 1230 insertions(+), 42 deletions(-) create mode 100644 target/linux/generic/backport-4.14/290-v4.16-netfilter-core-make-nf_unregister_net_hooks-simple-w.patch create mode 100644 target/linux/generic/backport-4.14/291-v4.16-netfilter-core-remove-synchronize_net-call-if-nfqueu.patch create mode 100644 target/linux/generic/backport-4.14/292-v4.16-netfilter-core-free-hooks-with-call_rcu.patch create mode 100644 target/linux/generic/backport-4.14/293-v4.16-netfilter-reduce-size-of-hook-entry-point-locations.patch create mode 100644 target/linux/generic/backport-4.14/294-v4.16-netfilter-reduce-hook-array-sizes-to-what-is-needed.patch create mode 100644 target/linux/generic/backport-4.14/295-v4.16-netfilter-don-t-allocate-space-for-decnet-hooks-unle.patch create mode 100644 target/linux/generic/backport-4.14/296-v4.16-netfilter-don-t-allocate-space-for-arp-bridge-hooks-.patch create mode 100644 target/linux/generic/backport-4.14/297-v4.16-netfilter-core-pass-hook-number-family-and-device-to.patch create mode 100644 target/linux/generic/backport-4.14/298-v4.16-netfilter-core-add-nf_remove_net_hook.patch create mode 100644 target/linux/generic/backport-4.14/298-v4.16-netfilter-core-pass-family-as-parameter-to-nf_remove.patch create mode 100644 target/linux/generic/backport-4.14/299-v4.16-netfilter-core-support-for-NFPROTO_INET-hook-registr.patch diff --git a/target/linux/generic/backport-4.14/290-v4.16-netfilter-core-make-nf_unregister_net_hooks-simple-w.patch b/target/linux/generic/backport-4.14/290-v4.16-netfilter-core-make-nf_unregister_net_hooks-simple-w.patch new file mode 100644 index 00000000000..35800c4acf5 --- /dev/null +++ b/target/linux/generic/backport-4.14/290-v4.16-netfilter-core-make-nf_unregister_net_hooks-simple-w.patch @@ -0,0 +1,91 @@ +From 4e645b47c4f000a503b9c90163ad905786b9bc1d Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Fri, 1 Dec 2017 00:21:02 +0100 +Subject: [PATCH 02/11] netfilter: core: make nf_unregister_net_hooks simple + wrapper again + +This reverts commit d3ad2c17b4047 +("netfilter: core: batch nf_unregister_net_hooks synchronize_net calls"). + +Nothing wrong with it. However, followup patch will delay freeing of hooks +with call_rcu, so all synchronize_net() calls become obsolete and there +is no need anymore for this batching. + +This revert causes a temporary performance degradation when destroying +network namespace, but its resolved with the upcoming call_rcu conversion. + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + net/netfilter/core.c | 59 +++------------------------------------------------- + 1 file changed, 3 insertions(+), 56 deletions(-) + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -395,63 +395,10 @@ EXPORT_SYMBOL(nf_register_net_hooks); + void nf_unregister_net_hooks(struct net *net, const struct nf_hook_ops *reg, + unsigned int hookcount) + { +- struct nf_hook_entries *to_free[16], *p; +- struct nf_hook_entries __rcu **pp; +- unsigned int i, j, n; ++ unsigned int i; + +- mutex_lock(&nf_hook_mutex); +- for (i = 0; i < hookcount; i++) { +- pp = nf_hook_entry_head(net, ®[i]); +- if (!pp) +- continue; +- +- p = nf_entry_dereference(*pp); +- if (WARN_ON_ONCE(!p)) +- continue; +- __nf_unregister_net_hook(p, ®[i]); +- } +- mutex_unlock(&nf_hook_mutex); +- +- do { +- n = min_t(unsigned int, hookcount, ARRAY_SIZE(to_free)); +- +- mutex_lock(&nf_hook_mutex); +- +- for (i = 0, j = 0; i < hookcount && j < n; i++) { +- pp = nf_hook_entry_head(net, ®[i]); +- if (!pp) +- continue; +- +- p = nf_entry_dereference(*pp); +- if (!p) +- continue; +- +- to_free[j] = __nf_hook_entries_try_shrink(pp); +- if (to_free[j]) +- ++j; +- } +- +- mutex_unlock(&nf_hook_mutex); +- +- if (j) { +- unsigned int nfq; +- +- synchronize_net(); +- +- /* need 2nd synchronize_net() if nfqueue is used, skb +- * can get reinjected right before nf_queue_hook_drop() +- */ +- nfq = nf_queue_nf_hook_drop(net); +- if (nfq) +- synchronize_net(); +- +- for (i = 0; i < j; i++) +- kvfree(to_free[i]); +- } +- +- reg += n; +- hookcount -= n; +- } while (hookcount > 0); ++ for (i = 0; i < hookcount; i++) ++ nf_unregister_net_hook(net, ®[i]); + } + EXPORT_SYMBOL(nf_unregister_net_hooks); + diff --git a/target/linux/generic/backport-4.14/291-v4.16-netfilter-core-remove-synchronize_net-call-if-nfqueu.patch b/target/linux/generic/backport-4.14/291-v4.16-netfilter-core-remove-synchronize_net-call-if-nfqueu.patch new file mode 100644 index 00000000000..0ac5783624f --- /dev/null +++ b/target/linux/generic/backport-4.14/291-v4.16-netfilter-core-remove-synchronize_net-call-if-nfqueu.patch @@ -0,0 +1,116 @@ +From 26888dfd7e7454686b8d3ea9ba5045d5f236e4d7 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Fri, 1 Dec 2017 00:21:03 +0100 +Subject: [PATCH 03/11] netfilter: core: remove synchronize_net call if nfqueue + is used + +since commit 960632ece6949b ("netfilter: convert hook list to an array") +nfqueue no longer stores a pointer to the hook that caused the packet +to be queued. Therefore no extra synchronize_net() call is needed after +dropping the packets enqueued by the old rule blob. + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/net/netfilter/nf_queue.h | 2 +- + net/netfilter/core.c | 6 +----- + net/netfilter/nf_internals.h | 2 +- + net/netfilter/nf_queue.c | 7 ++----- + net/netfilter/nfnetlink_queue.c | 9 ++------- + 5 files changed, 7 insertions(+), 19 deletions(-) + +--- a/include/net/netfilter/nf_queue.h ++++ b/include/net/netfilter/nf_queue.h +@@ -25,7 +25,7 @@ struct nf_queue_entry { + struct nf_queue_handler { + int (*outfn)(struct nf_queue_entry *entry, + unsigned int queuenum); +- unsigned int (*nf_hook_drop)(struct net *net); ++ void (*nf_hook_drop)(struct net *net); + }; + + void nf_register_queue_handler(struct net *net, const struct nf_queue_handler *qh); +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -341,7 +341,6 @@ void nf_unregister_net_hook(struct net * + { + struct nf_hook_entries __rcu **pp; + struct nf_hook_entries *p; +- unsigned int nfq; + + pp = nf_hook_entry_head(net, reg); + if (!pp) +@@ -364,10 +363,7 @@ void nf_unregister_net_hook(struct net * + + synchronize_net(); + +- /* other cpu might still process nfqueue verdict that used reg */ +- nfq = nf_queue_nf_hook_drop(net); +- if (nfq) +- synchronize_net(); ++ nf_queue_nf_hook_drop(net); + kvfree(p); + } + EXPORT_SYMBOL(nf_unregister_net_hook); +--- a/net/netfilter/nf_internals.h ++++ b/net/netfilter/nf_internals.h +@@ -10,7 +10,7 @@ + int nf_queue(struct sk_buff *skb, struct nf_hook_state *state, + const struct nf_hook_entries *entries, unsigned int index, + unsigned int verdict); +-unsigned int nf_queue_nf_hook_drop(struct net *net); ++void nf_queue_nf_hook_drop(struct net *net); + + /* nf_log.c */ + int __init netfilter_log_init(void); +--- a/net/netfilter/nf_queue.c ++++ b/net/netfilter/nf_queue.c +@@ -96,18 +96,15 @@ void nf_queue_entry_get_refs(struct nf_q + } + EXPORT_SYMBOL_GPL(nf_queue_entry_get_refs); + +-unsigned int nf_queue_nf_hook_drop(struct net *net) ++void nf_queue_nf_hook_drop(struct net *net) + { + const struct nf_queue_handler *qh; +- unsigned int count = 0; + + rcu_read_lock(); + qh = rcu_dereference(net->nf.queue_handler); + if (qh) +- count = qh->nf_hook_drop(net); ++ qh->nf_hook_drop(net); + rcu_read_unlock(); +- +- return count; + } + EXPORT_SYMBOL_GPL(nf_queue_nf_hook_drop); + +--- a/net/netfilter/nfnetlink_queue.c ++++ b/net/netfilter/nfnetlink_queue.c +@@ -941,23 +941,18 @@ static struct notifier_block nfqnl_dev_n + .notifier_call = nfqnl_rcv_dev_event, + }; + +-static unsigned int nfqnl_nf_hook_drop(struct net *net) ++static void nfqnl_nf_hook_drop(struct net *net) + { + struct nfnl_queue_net *q = nfnl_queue_pernet(net); +- unsigned int instances = 0; + int i; + + for (i = 0; i < INSTANCE_BUCKETS; i++) { + struct nfqnl_instance *inst; + struct hlist_head *head = &q->instance_table[i]; + +- hlist_for_each_entry_rcu(inst, head, hlist) { ++ hlist_for_each_entry_rcu(inst, head, hlist) + nfqnl_flush(inst, NULL, 0); +- instances++; +- } + } +- +- return instances; + } + + static int diff --git a/target/linux/generic/backport-4.14/292-v4.16-netfilter-core-free-hooks-with-call_rcu.patch b/target/linux/generic/backport-4.14/292-v4.16-netfilter-core-free-hooks-with-call_rcu.patch new file mode 100644 index 00000000000..5eca73552b2 --- /dev/null +++ b/target/linux/generic/backport-4.14/292-v4.16-netfilter-core-free-hooks-with-call_rcu.patch @@ -0,0 +1,132 @@ +From 8c873e2199700c2de7dbd5eedb9d90d5f109462b Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Fri, 1 Dec 2017 00:21:04 +0100 +Subject: [PATCH 04/11] netfilter: core: free hooks with call_rcu + +Giuseppe Scrivano says: + "SELinux, if enabled, registers for each new network namespace 6 + netfilter hooks." + +Cost for this is high. With synchronize_net() removed: + "The net benefit on an SMP machine with two cores is that creating a + new network namespace takes -40% of the original time." + +This patch replaces synchronize_net+kvfree with call_rcu(). +We store rcu_head at the tail of a structure that has no fixed layout, +i.e. we cannot use offsetof() to compute the start of the original +allocation. Thus store this information right after the rcu head. + +We could simplify this by just placing the rcu_head at the start +of struct nf_hook_entries. However, this structure is used in +packet processing hotpath, so only place what is needed for that +at the beginning of the struct. + +Reported-by: Giuseppe Scrivano +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/linux/netfilter.h | 19 +++++++++++++++---- + net/netfilter/core.c | 34 ++++++++++++++++++++++++++++------ + 2 files changed, 43 insertions(+), 10 deletions(-) + +--- a/include/linux/netfilter.h ++++ b/include/linux/netfilter.h +@@ -77,17 +77,28 @@ struct nf_hook_entry { + void *priv; + }; + ++struct nf_hook_entries_rcu_head { ++ struct rcu_head head; ++ void *allocation; ++}; ++ + struct nf_hook_entries { + u16 num_hook_entries; + /* padding */ + struct nf_hook_entry hooks[]; + +- /* trailer: pointers to original orig_ops of each hook. +- * +- * This is not part of struct nf_hook_entry since its only +- * needed in slow path (hook register/unregister). ++ /* trailer: pointers to original orig_ops of each hook, ++ * followed by rcu_head and scratch space used for freeing ++ * the structure via call_rcu. + * ++ * This is not part of struct nf_hook_entry since its only ++ * needed in slow path (hook register/unregister): + * const struct nf_hook_ops *orig_ops[] ++ * ++ * For the same reason, we store this at end -- its ++ * only needed when a hook is deleted, not during ++ * packet path processing: ++ * struct nf_hook_entries_rcu_head head + */ + }; + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -74,7 +74,8 @@ static struct nf_hook_entries *allocate_ + struct nf_hook_entries *e; + size_t alloc = sizeof(*e) + + sizeof(struct nf_hook_entry) * num + +- sizeof(struct nf_hook_ops *) * num; ++ sizeof(struct nf_hook_ops *) * num + ++ sizeof(struct nf_hook_entries_rcu_head); + + if (num == 0) + return NULL; +@@ -85,6 +86,30 @@ static struct nf_hook_entries *allocate_ + return e; + } + ++static void __nf_hook_entries_free(struct rcu_head *h) ++{ ++ struct nf_hook_entries_rcu_head *head; ++ ++ head = container_of(h, struct nf_hook_entries_rcu_head, head); ++ kvfree(head->allocation); ++} ++ ++static void nf_hook_entries_free(struct nf_hook_entries *e) ++{ ++ struct nf_hook_entries_rcu_head *head; ++ struct nf_hook_ops **ops; ++ unsigned int num; ++ ++ if (!e) ++ return; ++ ++ num = e->num_hook_entries; ++ ops = nf_hook_entries_get_hook_ops(e); ++ head = (void *)&ops[num]; ++ head->allocation = e; ++ call_rcu(&head->head, __nf_hook_entries_free); ++} ++ + static unsigned int accept_all(void *priv, + struct sk_buff *skb, + const struct nf_hook_state *state) +@@ -291,9 +316,8 @@ int nf_register_net_hook(struct net *net + #ifdef HAVE_JUMP_LABEL + static_key_slow_inc(&nf_hooks_needed[reg->pf][reg->hooknum]); + #endif +- synchronize_net(); + BUG_ON(p == new_hooks); +- kvfree(p); ++ nf_hook_entries_free(p); + return 0; + } + EXPORT_SYMBOL(nf_register_net_hook); +@@ -361,10 +385,8 @@ void nf_unregister_net_hook(struct net * + if (!p) + return; + +- synchronize_net(); +- + nf_queue_nf_hook_drop(net); +- kvfree(p); ++ nf_hook_entries_free(p); + } + EXPORT_SYMBOL(nf_unregister_net_hook); + diff --git a/target/linux/generic/backport-4.14/293-v4.16-netfilter-reduce-size-of-hook-entry-point-locations.patch b/target/linux/generic/backport-4.14/293-v4.16-netfilter-reduce-size-of-hook-entry-point-locations.patch new file mode 100644 index 00000000000..fcf54e9858d --- /dev/null +++ b/target/linux/generic/backport-4.14/293-v4.16-netfilter-reduce-size-of-hook-entry-point-locations.patch @@ -0,0 +1,200 @@ +From b0f38338aef2dae5ade3c16acf713737e3b15a73 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Sun, 3 Dec 2017 00:58:47 +0100 +Subject: [PATCH 05/11] netfilter: reduce size of hook entry point locations + +struct net contains: + +struct nf_hook_entries __rcu *hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; + +which store the hook entry point locations for the various protocol +families and the hooks. + +Using array results in compact c code when doing accesses, i.e. + x = rcu_dereference(net->nf.hooks[pf][hook]); + +but its also wasting a lot of memory, as most families are +not used. + +So split the array into those families that are used, which +are only 5 (instead of 13). In most cases, the 'pf' argument is +constant, i.e. gcc removes switch statement. + +struct net before: + /* size: 5184, cachelines: 81, members: 46 */ +after: + /* size: 4672, cachelines: 73, members: 46 */ + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/linux/netfilter.h | 24 ++++++++++++++++++++++-- + include/net/netns/netfilter.h | 6 +++++- + net/bridge/br_netfilter_hooks.c | 2 +- + net/netfilter/core.c | 38 ++++++++++++++++++++++++++++++-------- + net/netfilter/nf_queue.c | 21 +++++++++++++++++++-- + 5 files changed, 77 insertions(+), 14 deletions(-) + +--- a/include/linux/netfilter.h ++++ b/include/linux/netfilter.h +@@ -195,7 +195,7 @@ static inline int nf_hook(u_int8_t pf, u + struct net_device *indev, struct net_device *outdev, + int (*okfn)(struct net *, struct sock *, struct sk_buff *)) + { +- struct nf_hook_entries *hook_head; ++ struct nf_hook_entries *hook_head = NULL; + int ret = 1; + + #ifdef HAVE_JUMP_LABEL +@@ -206,7 +206,27 @@ static inline int nf_hook(u_int8_t pf, u + #endif + + rcu_read_lock(); +- hook_head = rcu_dereference(net->nf.hooks[pf][hook]); ++ switch (pf) { ++ case NFPROTO_IPV4: ++ hook_head = rcu_dereference(net->nf.hooks_ipv4[hook]); ++ break; ++ case NFPROTO_IPV6: ++ hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]); ++ break; ++ case NFPROTO_ARP: ++ hook_head = rcu_dereference(net->nf.hooks_arp[hook]); ++ break; ++ case NFPROTO_BRIDGE: ++ hook_head = rcu_dereference(net->nf.hooks_bridge[hook]); ++ break; ++ case NFPROTO_DECNET: ++ hook_head = rcu_dereference(net->nf.hooks_decnet[hook]); ++ break; ++ default: ++ WARN_ON_ONCE(1); ++ break; ++ } ++ + if (hook_head) { + struct nf_hook_state state; + +--- a/include/net/netns/netfilter.h ++++ b/include/net/netns/netfilter.h +@@ -17,7 +17,11 @@ struct netns_nf { + #ifdef CONFIG_SYSCTL + struct ctl_table_header *nf_log_dir_header; + #endif +- struct nf_hook_entries __rcu *hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; ++ struct nf_hook_entries __rcu *hooks_ipv4[NF_MAX_HOOKS]; ++ struct nf_hook_entries __rcu *hooks_ipv6[NF_MAX_HOOKS]; ++ struct nf_hook_entries __rcu *hooks_arp[NF_MAX_HOOKS]; ++ struct nf_hook_entries __rcu *hooks_bridge[NF_MAX_HOOKS]; ++ struct nf_hook_entries __rcu *hooks_decnet[NF_MAX_HOOKS]; + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) + bool defrag_ipv4; + #endif +--- a/net/bridge/br_netfilter_hooks.c ++++ b/net/bridge/br_netfilter_hooks.c +@@ -992,7 +992,7 @@ int br_nf_hook_thresh(unsigned int hook, + unsigned int i; + int ret; + +- e = rcu_dereference(net->nf.hooks[NFPROTO_BRIDGE][hook]); ++ e = rcu_dereference(net->nf.hooks_bridge[hook]); + if (!e) + return okfn(net, sk, skb); + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -264,8 +264,23 @@ out_assign: + + static struct nf_hook_entries __rcu **nf_hook_entry_head(struct net *net, const struct nf_hook_ops *reg) + { +- if (reg->pf != NFPROTO_NETDEV) +- return net->nf.hooks[reg->pf]+reg->hooknum; ++ switch (reg->pf) { ++ case NFPROTO_NETDEV: ++ break; ++ case NFPROTO_ARP: ++ return net->nf.hooks_arp + reg->hooknum; ++ case NFPROTO_BRIDGE: ++ return net->nf.hooks_bridge + reg->hooknum; ++ case NFPROTO_IPV4: ++ return net->nf.hooks_ipv4 + reg->hooknum; ++ case NFPROTO_IPV6: ++ return net->nf.hooks_ipv6 + reg->hooknum; ++ case NFPROTO_DECNET: ++ return net->nf.hooks_decnet + reg->hooknum; ++ default: ++ WARN_ON_ONCE(1); ++ return NULL; ++ } + + #ifdef CONFIG_NETFILTER_INGRESS + if (reg->hooknum == NF_NETDEV_INGRESS) { +@@ -534,14 +549,21 @@ void (*nf_nat_decode_session_hook)(struc + EXPORT_SYMBOL(nf_nat_decode_session_hook); + #endif + +-static int __net_init netfilter_net_init(struct net *net) ++static void __net_init __netfilter_net_init(struct nf_hook_entries *e[NF_MAX_HOOKS]) + { +- int i, h; ++ int h; + +- for (i = 0; i < ARRAY_SIZE(net->nf.hooks); i++) { +- for (h = 0; h < NF_MAX_HOOKS; h++) +- RCU_INIT_POINTER(net->nf.hooks[i][h], NULL); +- } ++ for (h = 0; h < NF_MAX_HOOKS; h++) ++ RCU_INIT_POINTER(e[h], NULL); ++} ++ ++static int __net_init netfilter_net_init(struct net *net) ++{ ++ __netfilter_net_init(net->nf.hooks_ipv4); ++ __netfilter_net_init(net->nf.hooks_ipv6); ++ __netfilter_net_init(net->nf.hooks_arp); ++ __netfilter_net_init(net->nf.hooks_bridge); ++ __netfilter_net_init(net->nf.hooks_decnet); + + #ifdef CONFIG_PROC_FS + net->nf.proc_netfilter = proc_net_mkdir(net, "netfilter", +--- a/net/netfilter/nf_queue.c ++++ b/net/netfilter/nf_queue.c +@@ -201,6 +201,23 @@ repeat: + return NF_ACCEPT; + } + ++static struct nf_hook_entries *nf_hook_entries_head(const struct net *net, u8 pf, u8 hooknum) ++{ ++ switch (pf) { ++ case NFPROTO_BRIDGE: ++ return rcu_dereference(net->nf.hooks_bridge[hooknum]); ++ case NFPROTO_IPV4: ++ return rcu_dereference(net->nf.hooks_ipv4[hooknum]); ++ case NFPROTO_IPV6: ++ return rcu_dereference(net->nf.hooks_ipv6[hooknum]); ++ default: ++ WARN_ON_ONCE(1); ++ return NULL; ++ } ++ ++ return NULL; ++} ++ + /* Caller must hold rcu read-side lock */ + void nf_reinject(struct nf_queue_entry *entry, unsigned int verdict) + { +@@ -216,12 +233,12 @@ void nf_reinject(struct nf_queue_entry * + net = entry->state.net; + pf = entry->state.pf; + +- hooks = rcu_dereference(net->nf.hooks[pf][entry->state.hook]); ++ hooks = nf_hook_entries_head(net, pf, entry->state.hook); + + nf_queue_entry_release_refs(entry); + + i = entry->hook_index; +- if (WARN_ON_ONCE(i >= hooks->num_hook_entries)) { ++ if (WARN_ON_ONCE(!hooks || i >= hooks->num_hook_entries)) { + kfree_skb(skb); + kfree(entry); + return; diff --git a/target/linux/generic/backport-4.14/294-v4.16-netfilter-reduce-hook-array-sizes-to-what-is-needed.patch b/target/linux/generic/backport-4.14/294-v4.16-netfilter-reduce-hook-array-sizes-to-what-is-needed.patch new file mode 100644 index 00000000000..d9009b8e1f4 --- /dev/null +++ b/target/linux/generic/backport-4.14/294-v4.16-netfilter-reduce-hook-array-sizes-to-what-is-needed.patch @@ -0,0 +1,95 @@ +From ef57170bbfdd6958281011332b1fd237712f69f0 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Thu, 7 Dec 2017 16:28:24 +0100 +Subject: [PATCH 06/11] netfilter: reduce hook array sizes to what is needed + +Not all families share the same hook count, adjust sizes to what is +needed. + +struct net before: +/* size: 6592, cachelines: 103, members: 46 */ +after: +/* size: 5952, cachelines: 93, members: 46 */ + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/net/netns/netfilter.h | 10 +++++----- + net/netfilter/core.c | 24 +++++++++++++++++------- + 2 files changed, 22 insertions(+), 12 deletions(-) + +--- a/include/net/netns/netfilter.h ++++ b/include/net/netns/netfilter.h +@@ -17,11 +17,11 @@ struct netns_nf { + #ifdef CONFIG_SYSCTL + struct ctl_table_header *nf_log_dir_header; + #endif +- struct nf_hook_entries __rcu *hooks_ipv4[NF_MAX_HOOKS]; +- struct nf_hook_entries __rcu *hooks_ipv6[NF_MAX_HOOKS]; +- struct nf_hook_entries __rcu *hooks_arp[NF_MAX_HOOKS]; +- struct nf_hook_entries __rcu *hooks_bridge[NF_MAX_HOOKS]; +- struct nf_hook_entries __rcu *hooks_decnet[NF_MAX_HOOKS]; ++ struct nf_hook_entries __rcu *hooks_ipv4[NF_INET_NUMHOOKS]; ++ struct nf_hook_entries __rcu *hooks_ipv6[NF_INET_NUMHOOKS]; ++ struct nf_hook_entries __rcu *hooks_arp[NF_ARP_NUMHOOKS]; ++ struct nf_hook_entries __rcu *hooks_bridge[NF_INET_NUMHOOKS]; ++ struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS]; + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) + bool defrag_ipv4; + #endif +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -268,14 +268,24 @@ static struct nf_hook_entries __rcu **nf + case NFPROTO_NETDEV: + break; + case NFPROTO_ARP: ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_arp) <= reg->hooknum)) ++ return NULL; + return net->nf.hooks_arp + reg->hooknum; + case NFPROTO_BRIDGE: ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_bridge) <= reg->hooknum)) ++ return NULL; + return net->nf.hooks_bridge + reg->hooknum; + case NFPROTO_IPV4: ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv4) <= reg->hooknum)) ++ return NULL; + return net->nf.hooks_ipv4 + reg->hooknum; + case NFPROTO_IPV6: ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv6) <= reg->hooknum)) ++ return NULL; + return net->nf.hooks_ipv6 + reg->hooknum; + case NFPROTO_DECNET: ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_decnet) <= reg->hooknum)) ++ return NULL; + return net->nf.hooks_decnet + reg->hooknum; + default: + WARN_ON_ONCE(1); +@@ -549,21 +559,21 @@ void (*nf_nat_decode_session_hook)(struc + EXPORT_SYMBOL(nf_nat_decode_session_hook); + #endif + +-static void __net_init __netfilter_net_init(struct nf_hook_entries *e[NF_MAX_HOOKS]) ++static void __net_init __netfilter_net_init(struct nf_hook_entries **e, int max) + { + int h; + +- for (h = 0; h < NF_MAX_HOOKS; h++) ++ for (h = 0; h < max; h++) + RCU_INIT_POINTER(e[h], NULL); + } + + static int __net_init netfilter_net_init(struct net *net) + { +- __netfilter_net_init(net->nf.hooks_ipv4); +- __netfilter_net_init(net->nf.hooks_ipv6); +- __netfilter_net_init(net->nf.hooks_arp); +- __netfilter_net_init(net->nf.hooks_bridge); +- __netfilter_net_init(net->nf.hooks_decnet); ++ __netfilter_net_init(net->nf.hooks_ipv4, ARRAY_SIZE(net->nf.hooks_ipv4)); ++ __netfilter_net_init(net->nf.hooks_ipv6, ARRAY_SIZE(net->nf.hooks_ipv6)); ++ __netfilter_net_init(net->nf.hooks_arp, ARRAY_SIZE(net->nf.hooks_arp)); ++ __netfilter_net_init(net->nf.hooks_bridge, ARRAY_SIZE(net->nf.hooks_bridge)); ++ __netfilter_net_init(net->nf.hooks_decnet, ARRAY_SIZE(net->nf.hooks_decnet)); + + #ifdef CONFIG_PROC_FS + net->nf.proc_netfilter = proc_net_mkdir(net, "netfilter", diff --git a/target/linux/generic/backport-4.14/295-v4.16-netfilter-don-t-allocate-space-for-decnet-hooks-unle.patch b/target/linux/generic/backport-4.14/295-v4.16-netfilter-don-t-allocate-space-for-decnet-hooks-unle.patch new file mode 100644 index 00000000000..26a93c40ae2 --- /dev/null +++ b/target/linux/generic/backport-4.14/295-v4.16-netfilter-don-t-allocate-space-for-decnet-hooks-unle.patch @@ -0,0 +1,67 @@ +From bb4badf3a3dc81190f7c1c1fa063cdefb18df45f Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Thu, 7 Dec 2017 16:28:25 +0100 +Subject: [PATCH 07/11] netfilter: don't allocate space for decnet hooks unless + needed + +no need to define hook points if the family isn't supported. + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/linux/netfilter.h | 2 ++ + include/net/netns/netfilter.h | 2 ++ + net/netfilter/core.c | 4 ++++ + 3 files changed, 8 insertions(+) + +--- a/include/linux/netfilter.h ++++ b/include/linux/netfilter.h +@@ -219,9 +219,11 @@ static inline int nf_hook(u_int8_t pf, u + case NFPROTO_BRIDGE: + hook_head = rcu_dereference(net->nf.hooks_bridge[hook]); + break; ++#if IS_ENABLED(CONFIG_DECNET) + case NFPROTO_DECNET: + hook_head = rcu_dereference(net->nf.hooks_decnet[hook]); + break; ++#endif + default: + WARN_ON_ONCE(1); + break; +--- a/include/net/netns/netfilter.h ++++ b/include/net/netns/netfilter.h +@@ -21,7 +21,9 @@ struct netns_nf { + struct nf_hook_entries __rcu *hooks_ipv6[NF_INET_NUMHOOKS]; + struct nf_hook_entries __rcu *hooks_arp[NF_ARP_NUMHOOKS]; + struct nf_hook_entries __rcu *hooks_bridge[NF_INET_NUMHOOKS]; ++#if IS_ENABLED(CONFIG_DECNET) + struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS]; ++#endif + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) + bool defrag_ipv4; + #endif +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -283,10 +283,12 @@ static struct nf_hook_entries __rcu **nf + if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv6) <= reg->hooknum)) + return NULL; + return net->nf.hooks_ipv6 + reg->hooknum; ++#if IS_ENABLED(CONFIG_DECNET) + case NFPROTO_DECNET: + if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_decnet) <= reg->hooknum)) + return NULL; + return net->nf.hooks_decnet + reg->hooknum; ++#endif + default: + WARN_ON_ONCE(1); + return NULL; +@@ -573,7 +575,9 @@ static int __net_init netfilter_net_init + __netfilter_net_init(net->nf.hooks_ipv6, ARRAY_SIZE(net->nf.hooks_ipv6)); + __netfilter_net_init(net->nf.hooks_arp, ARRAY_SIZE(net->nf.hooks_arp)); + __netfilter_net_init(net->nf.hooks_bridge, ARRAY_SIZE(net->nf.hooks_bridge)); ++#if IS_ENABLED(CONFIG_DECNET) + __netfilter_net_init(net->nf.hooks_decnet, ARRAY_SIZE(net->nf.hooks_decnet)); ++#endif + + #ifdef CONFIG_PROC_FS + net->nf.proc_netfilter = proc_net_mkdir(net, "netfilter", diff --git a/target/linux/generic/backport-4.14/296-v4.16-netfilter-don-t-allocate-space-for-arp-bridge-hooks-.patch b/target/linux/generic/backport-4.14/296-v4.16-netfilter-don-t-allocate-space-for-arp-bridge-hooks-.patch new file mode 100644 index 00000000000..9444f6bb482 --- /dev/null +++ b/target/linux/generic/backport-4.14/296-v4.16-netfilter-don-t-allocate-space-for-arp-bridge-hooks-.patch @@ -0,0 +1,165 @@ +From 2a95183a5e0375df756efb2ca37602d71e8455f9 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Thu, 7 Dec 2017 16:28:26 +0100 +Subject: [PATCH 08/11] netfilter: don't allocate space for arp/bridge hooks + unless needed + +no need to define hook points if the family isn't supported. +Because we need these hooks for either nftables, arp/ebtables +or the 'call-iptables' hack we have in the bridge layer add two +new dependencies, NETFILTER_FAMILY_{ARP,BRIDGE}, and have the +users select them. + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/linux/netfilter.h | 4 ++++ + include/net/netns/netfilter.h | 4 ++++ + net/Kconfig | 1 + + net/bridge/netfilter/Kconfig | 2 ++ + net/ipv4/netfilter/Kconfig | 2 ++ + net/netfilter/Kconfig | 6 ++++++ + net/netfilter/core.c | 8 ++++++++ + net/netfilter/nf_queue.c | 2 ++ + 8 files changed, 29 insertions(+) + +--- a/include/linux/netfilter.h ++++ b/include/linux/netfilter.h +@@ -214,10 +214,14 @@ static inline int nf_hook(u_int8_t pf, u + hook_head = rcu_dereference(net->nf.hooks_ipv6[hook]); + break; + case NFPROTO_ARP: ++#ifdef CONFIG_NETFILTER_FAMILY_ARP + hook_head = rcu_dereference(net->nf.hooks_arp[hook]); ++#endif + break; + case NFPROTO_BRIDGE: ++#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE + hook_head = rcu_dereference(net->nf.hooks_bridge[hook]); ++#endif + break; + #if IS_ENABLED(CONFIG_DECNET) + case NFPROTO_DECNET: +--- a/include/net/netns/netfilter.h ++++ b/include/net/netns/netfilter.h +@@ -19,8 +19,12 @@ struct netns_nf { + #endif + struct nf_hook_entries __rcu *hooks_ipv4[NF_INET_NUMHOOKS]; + struct nf_hook_entries __rcu *hooks_ipv6[NF_INET_NUMHOOKS]; ++#ifdef CONFIG_NETFILTER_FAMILY_ARP + struct nf_hook_entries __rcu *hooks_arp[NF_ARP_NUMHOOKS]; ++#endif ++#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE + struct nf_hook_entries __rcu *hooks_bridge[NF_INET_NUMHOOKS]; ++#endif + #if IS_ENABLED(CONFIG_DECNET) + struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS]; + #endif +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -182,6 +182,7 @@ config BRIDGE_NETFILTER + depends on BRIDGE + depends on NETFILTER && INET + depends on NETFILTER_ADVANCED ++ select NETFILTER_FAMILY_BRIDGE + default m + ---help--- + Enabling this option will let arptables resp. iptables see bridged +--- a/net/bridge/netfilter/Kconfig ++++ b/net/bridge/netfilter/Kconfig +@@ -4,6 +4,7 @@ + # + menuconfig NF_TABLES_BRIDGE + depends on BRIDGE && NETFILTER && NF_TABLES ++ select NETFILTER_FAMILY_BRIDGE + tristate "Ethernet Bridge nf_tables support" + + if NF_TABLES_BRIDGE +@@ -29,6 +30,7 @@ endif # NF_TABLES_BRIDGE + menuconfig BRIDGE_NF_EBTABLES + tristate "Ethernet Bridge tables (ebtables) support" + depends on BRIDGE && NETFILTER && NETFILTER_XTABLES ++ select NETFILTER_FAMILY_BRIDGE + help + ebtables is a general, extensible frame/packet identification + framework. Say 'Y' or 'M' here if you want to do Ethernet +--- a/net/ipv4/netfilter/Kconfig ++++ b/net/ipv4/netfilter/Kconfig +@@ -72,6 +72,7 @@ endif # NF_TABLES_IPV4 + + config NF_TABLES_ARP + tristate "ARP nf_tables support" ++ select NETFILTER_FAMILY_ARP + help + This option enables the ARP support for nf_tables. + +@@ -392,6 +393,7 @@ endif # IP_NF_IPTABLES + config IP_NF_ARPTABLES + tristate "ARP tables support" + select NETFILTER_XTABLES ++ select NETFILTER_FAMILY_ARP + depends on NETFILTER_ADVANCED + help + arptables is a general, extensible packet identification framework. +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -12,6 +12,12 @@ config NETFILTER_INGRESS + config NETFILTER_NETLINK + tristate + ++config NETFILTER_FAMILY_BRIDGE ++ bool ++ ++config NETFILTER_FAMILY_ARP ++ bool ++ + config NETFILTER_NETLINK_ACCT + tristate "Netfilter NFACCT over NFNETLINK interface" + depends on NETFILTER_ADVANCED +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -267,14 +267,18 @@ static struct nf_hook_entries __rcu **nf + switch (reg->pf) { + case NFPROTO_NETDEV: + break; ++#ifdef CONFIG_NETFILTER_FAMILY_ARP + case NFPROTO_ARP: + if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_arp) <= reg->hooknum)) + return NULL; + return net->nf.hooks_arp + reg->hooknum; ++#endif ++#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE + case NFPROTO_BRIDGE: + if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_bridge) <= reg->hooknum)) + return NULL; + return net->nf.hooks_bridge + reg->hooknum; ++#endif + case NFPROTO_IPV4: + if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv4) <= reg->hooknum)) + return NULL; +@@ -573,8 +577,12 @@ static int __net_init netfilter_net_init + { + __netfilter_net_init(net->nf.hooks_ipv4, ARRAY_SIZE(net->nf.hooks_ipv4)); + __netfilter_net_init(net->nf.hooks_ipv6, ARRAY_SIZE(net->nf.hooks_ipv6)); ++#ifdef CONFIG_NETFILTER_FAMILY_ARP + __netfilter_net_init(net->nf.hooks_arp, ARRAY_SIZE(net->nf.hooks_arp)); ++#endif ++#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE + __netfilter_net_init(net->nf.hooks_bridge, ARRAY_SIZE(net->nf.hooks_bridge)); ++#endif + #if IS_ENABLED(CONFIG_DECNET) + __netfilter_net_init(net->nf.hooks_decnet, ARRAY_SIZE(net->nf.hooks_decnet)); + #endif +--- a/net/netfilter/nf_queue.c ++++ b/net/netfilter/nf_queue.c +@@ -204,8 +204,10 @@ repeat: + static struct nf_hook_entries *nf_hook_entries_head(const struct net *net, u8 pf, u8 hooknum) + { + switch (pf) { ++#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE + case NFPROTO_BRIDGE: + return rcu_dereference(net->nf.hooks_bridge[hooknum]); ++#endif + case NFPROTO_IPV4: + return rcu_dereference(net->nf.hooks_ipv4[hooknum]); + case NFPROTO_IPV6: diff --git a/target/linux/generic/backport-4.14/297-v4.16-netfilter-core-pass-hook-number-family-and-device-to.patch b/target/linux/generic/backport-4.14/297-v4.16-netfilter-core-pass-hook-number-family-and-device-to.patch new file mode 100644 index 00000000000..7d450f95f0c --- /dev/null +++ b/target/linux/generic/backport-4.14/297-v4.16-netfilter-core-pass-hook-number-family-and-device-to.patch @@ -0,0 +1,98 @@ +From 62a0fe46e2aaba1812d3cbcae014a41539f9eb09 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sat, 9 Dec 2017 15:23:51 +0100 +Subject: [PATCH 09/11] netfilter: core: pass hook number, family and device to + nf_find_hook_list() + +Instead of passing struct nf_hook_ops, this is needed by follow up +patches to handle NFPROTO_INET from the core. + +Signed-off-by: Pablo Neira Ayuso +--- + net/netfilter/core.c | 36 +++++++++++++++++++----------------- + 1 file changed, 19 insertions(+), 17 deletions(-) + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -262,36 +262,38 @@ out_assign: + return old; + } + +-static struct nf_hook_entries __rcu **nf_hook_entry_head(struct net *net, const struct nf_hook_ops *reg) ++static struct nf_hook_entries __rcu ** ++nf_hook_entry_head(struct net *net, int pf, unsigned int hooknum, ++ struct net_device *dev) + { +- switch (reg->pf) { ++ switch (pf) { + case NFPROTO_NETDEV: + break; + #ifdef CONFIG_NETFILTER_FAMILY_ARP + case NFPROTO_ARP: +- if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_arp) <= reg->hooknum)) ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_arp) <= hooknum)) + return NULL; +- return net->nf.hooks_arp + reg->hooknum; ++ return net->nf.hooks_arp + hooknum; + #endif + #ifdef CONFIG_NETFILTER_FAMILY_BRIDGE + case NFPROTO_BRIDGE: +- if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_bridge) <= reg->hooknum)) ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_bridge) <= hooknum)) + return NULL; +- return net->nf.hooks_bridge + reg->hooknum; ++ return net->nf.hooks_bridge + hooknum; + #endif + case NFPROTO_IPV4: +- if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv4) <= reg->hooknum)) ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv4) <= hooknum)) + return NULL; +- return net->nf.hooks_ipv4 + reg->hooknum; ++ return net->nf.hooks_ipv4 + hooknum; + case NFPROTO_IPV6: +- if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv6) <= reg->hooknum)) ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_ipv6) <= hooknum)) + return NULL; +- return net->nf.hooks_ipv6 + reg->hooknum; ++ return net->nf.hooks_ipv6 + hooknum; + #if IS_ENABLED(CONFIG_DECNET) + case NFPROTO_DECNET: +- if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_decnet) <= reg->hooknum)) ++ if (WARN_ON_ONCE(ARRAY_SIZE(net->nf.hooks_decnet) <= hooknum)) + return NULL; +- return net->nf.hooks_decnet + reg->hooknum; ++ return net->nf.hooks_decnet + hooknum; + #endif + default: + WARN_ON_ONCE(1); +@@ -299,9 +301,9 @@ static struct nf_hook_entries __rcu **nf + } + + #ifdef CONFIG_NETFILTER_INGRESS +- if (reg->hooknum == NF_NETDEV_INGRESS) { +- if (reg->dev && dev_net(reg->dev) == net) +- return ®->dev->nf_hooks_ingress; ++ if (hooknum == NF_NETDEV_INGRESS) { ++ if (dev && dev_net(dev) == net) ++ return &dev->nf_hooks_ingress; + } + #endif + WARN_ON_ONCE(1); +@@ -323,7 +325,7 @@ int nf_register_net_hook(struct net *net + return -EINVAL; + } + +- pp = nf_hook_entry_head(net, reg); ++ pp = nf_hook_entry_head(net, reg->pf, reg->hooknum, reg->dev); + if (!pp) + return -EINVAL; + +@@ -397,7 +399,7 @@ void nf_unregister_net_hook(struct net * + struct nf_hook_entries __rcu **pp; + struct nf_hook_entries *p; + +- pp = nf_hook_entry_head(net, reg); ++ pp = nf_hook_entry_head(net, reg->pf, reg->hooknum, reg->dev); + if (!pp) + return; + diff --git a/target/linux/generic/backport-4.14/298-v4.16-netfilter-core-add-nf_remove_net_hook.patch b/target/linux/generic/backport-4.14/298-v4.16-netfilter-core-add-nf_remove_net_hook.patch new file mode 100644 index 00000000000..8fea44b3599 --- /dev/null +++ b/target/linux/generic/backport-4.14/298-v4.16-netfilter-core-add-nf_remove_net_hook.patch @@ -0,0 +1,44 @@ +From 3d3cdc38e8c265a9f9d3825e823e772872bca1b8 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sat, 9 Dec 2017 15:19:14 +0100 +Subject: [PATCH 01/11] netfilter: core: add nf_remove_net_hook + +Just a cleanup, __nf_unregister_net_hook() is used by a follow up patch +when handling NFPROTO_INET as a real family from the core. + +Signed-off-by: Pablo Neira Ayuso +--- + net/netfilter/core.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -356,7 +356,7 @@ int nf_register_net_hook(struct net *net + EXPORT_SYMBOL(nf_register_net_hook); + + /* +- * __nf_unregister_net_hook - remove a hook from blob ++ * nf_remove_net_hook - remove a hook from blob + * + * @oldp: current address of hook blob + * @unreg: hook to unregister +@@ -364,8 +364,8 @@ EXPORT_SYMBOL(nf_register_net_hook); + * This cannot fail, hook unregistration must always succeed. + * Therefore replace the to-be-removed hook with a dummy hook. + */ +-static void __nf_unregister_net_hook(struct nf_hook_entries *old, +- const struct nf_hook_ops *unreg) ++static void nf_remove_net_hook(struct nf_hook_entries *old, ++ const struct nf_hook_ops *unreg) + { + struct nf_hook_ops **orig_ops; + bool found = false; +@@ -411,7 +411,7 @@ void nf_unregister_net_hook(struct net * + return; + } + +- __nf_unregister_net_hook(p, reg); ++ nf_remove_net_hook(p, reg); + + p = __nf_hook_entries_try_shrink(pp); + mutex_unlock(&nf_hook_mutex); diff --git a/target/linux/generic/backport-4.14/298-v4.16-netfilter-core-pass-family-as-parameter-to-nf_remove.patch b/target/linux/generic/backport-4.14/298-v4.16-netfilter-core-pass-family-as-parameter-to-nf_remove.patch new file mode 100644 index 00000000000..4c52635c13f --- /dev/null +++ b/target/linux/generic/backport-4.14/298-v4.16-netfilter-core-pass-family-as-parameter-to-nf_remove.patch @@ -0,0 +1,51 @@ +From 30259408118f550f5969fda19c0d67020d21eda8 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sat, 9 Dec 2017 15:26:37 +0100 +Subject: [PATCH 10/11] netfilter: core: pass family as parameter to + nf_remove_net_hook() + +So static_key_slow_dec applies to the family behind NFPROTO_INET. + +Signed-off-by: Pablo Neira Ayuso +--- + net/netfilter/core.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -365,7 +365,7 @@ EXPORT_SYMBOL(nf_register_net_hook); + * Therefore replace the to-be-removed hook with a dummy hook. + */ + static void nf_remove_net_hook(struct nf_hook_entries *old, +- const struct nf_hook_ops *unreg) ++ const struct nf_hook_ops *unreg, int pf) + { + struct nf_hook_ops **orig_ops; + bool found = false; +@@ -383,14 +383,14 @@ static void nf_remove_net_hook(struct nf + + if (found) { + #ifdef CONFIG_NETFILTER_INGRESS +- if (unreg->pf == NFPROTO_NETDEV && unreg->hooknum == NF_NETDEV_INGRESS) ++ if (pf == NFPROTO_NETDEV && unreg->hooknum == NF_NETDEV_INGRESS) + net_dec_ingress_queue(); + #endif + #ifdef HAVE_JUMP_LABEL +- static_key_slow_dec(&nf_hooks_needed[unreg->pf][unreg->hooknum]); ++ static_key_slow_dec(&nf_hooks_needed[pf][unreg->hooknum]); + #endif + } else { +- WARN_ONCE(1, "hook not found, pf %d num %d", unreg->pf, unreg->hooknum); ++ WARN_ONCE(1, "hook not found, pf %d num %d", pf, unreg->hooknum); + } + } + +@@ -411,7 +411,7 @@ void nf_unregister_net_hook(struct net * + return; + } + +- nf_remove_net_hook(p, reg); ++ nf_remove_net_hook(p, reg, reg->pf); + + p = __nf_hook_entries_try_shrink(pp); + mutex_unlock(&nf_hook_mutex); diff --git a/target/linux/generic/backport-4.14/299-v4.16-netfilter-core-support-for-NFPROTO_INET-hook-registr.patch b/target/linux/generic/backport-4.14/299-v4.16-netfilter-core-support-for-NFPROTO_INET-hook-registr.patch new file mode 100644 index 00000000000..b112855132d --- /dev/null +++ b/target/linux/generic/backport-4.14/299-v4.16-netfilter-core-support-for-NFPROTO_INET-hook-registr.patch @@ -0,0 +1,129 @@ +From cb7ccd835ebb333669e400f99c650e4f3abf11c0 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sat, 9 Dec 2017 15:30:26 +0100 +Subject: [PATCH 11/11] netfilter: core: support for NFPROTO_INET hook + registration + +Expand NFPROTO_INET in two hook registrations, one for NFPROTO_IPV4 and +another for NFPROTO_IPV6. Hence, we handle NFPROTO_INET from the core. + +Signed-off-by: Pablo Neira Ayuso +--- + net/netfilter/core.c | 53 +++++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 44 insertions(+), 9 deletions(-) + +--- a/net/netfilter/core.c ++++ b/net/netfilter/core.c +@@ -310,12 +310,13 @@ nf_hook_entry_head(struct net *net, int + return NULL; + } + +-int nf_register_net_hook(struct net *net, const struct nf_hook_ops *reg) ++static int __nf_register_net_hook(struct net *net, int pf, ++ const struct nf_hook_ops *reg) + { + struct nf_hook_entries *p, *new_hooks; + struct nf_hook_entries __rcu **pp; + +- if (reg->pf == NFPROTO_NETDEV) { ++ if (pf == NFPROTO_NETDEV) { + #ifndef CONFIG_NETFILTER_INGRESS + if (reg->hooknum == NF_NETDEV_INGRESS) + return -EOPNOTSUPP; +@@ -325,7 +326,7 @@ int nf_register_net_hook(struct net *net + return -EINVAL; + } + +- pp = nf_hook_entry_head(net, reg->pf, reg->hooknum, reg->dev); ++ pp = nf_hook_entry_head(net, pf, reg->hooknum, reg->dev); + if (!pp) + return -EINVAL; + +@@ -343,17 +344,16 @@ int nf_register_net_hook(struct net *net + + hooks_validate(new_hooks); + #ifdef CONFIG_NETFILTER_INGRESS +- if (reg->pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) ++ if (pf == NFPROTO_NETDEV && reg->hooknum == NF_NETDEV_INGRESS) + net_inc_ingress_queue(); + #endif + #ifdef HAVE_JUMP_LABEL +- static_key_slow_inc(&nf_hooks_needed[reg->pf][reg->hooknum]); ++ static_key_slow_inc(&nf_hooks_needed[pf][reg->hooknum]); + #endif + BUG_ON(p == new_hooks); + nf_hook_entries_free(p); + return 0; + } +-EXPORT_SYMBOL(nf_register_net_hook); + + /* + * nf_remove_net_hook - remove a hook from blob +@@ -394,12 +394,13 @@ static void nf_remove_net_hook(struct nf + } + } + +-void nf_unregister_net_hook(struct net *net, const struct nf_hook_ops *reg) ++void __nf_unregister_net_hook(struct net *net, int pf, ++ const struct nf_hook_ops *reg) + { + struct nf_hook_entries __rcu **pp; + struct nf_hook_entries *p; + +- pp = nf_hook_entry_head(net, reg->pf, reg->hooknum, reg->dev); ++ pp = nf_hook_entry_head(net, pf, reg->hooknum, reg->dev); + if (!pp) + return; + +@@ -411,7 +412,7 @@ void nf_unregister_net_hook(struct net * + return; + } + +- nf_remove_net_hook(p, reg, reg->pf); ++ nf_remove_net_hook(p, reg, pf); + + p = __nf_hook_entries_try_shrink(pp); + mutex_unlock(&nf_hook_mutex); +@@ -421,8 +422,42 @@ void nf_unregister_net_hook(struct net * + nf_queue_nf_hook_drop(net); + nf_hook_entries_free(p); + } ++ ++void nf_unregister_net_hook(struct net *net, const struct nf_hook_ops *reg) ++{ ++ if (reg->pf == NFPROTO_INET) { ++ __nf_unregister_net_hook(net, NFPROTO_IPV4, reg); ++ __nf_unregister_net_hook(net, NFPROTO_IPV6, reg); ++ } else { ++ __nf_unregister_net_hook(net, reg->pf, reg); ++ } ++} + EXPORT_SYMBOL(nf_unregister_net_hook); + ++int nf_register_net_hook(struct net *net, const struct nf_hook_ops *reg) ++{ ++ int err; ++ ++ if (reg->pf == NFPROTO_INET) { ++ err = __nf_register_net_hook(net, NFPROTO_IPV4, reg); ++ if (err < 0) ++ return err; ++ ++ err = __nf_register_net_hook(net, NFPROTO_IPV6, reg); ++ if (err < 0) { ++ __nf_unregister_net_hook(net, NFPROTO_IPV4, reg); ++ return err; ++ } ++ } else { ++ err = __nf_register_net_hook(net, reg->pf, reg); ++ if (err < 0) ++ return err; ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(nf_register_net_hook); ++ + int nf_register_net_hooks(struct net *net, const struct nf_hook_ops *reg, + unsigned int n) + { diff --git a/target/linux/generic/backport-4.14/301-v4.16-netfilter-core-only-allow-one-nat-hook-per-hook-poin.patch b/target/linux/generic/backport-4.14/301-v4.16-netfilter-core-only-allow-one-nat-hook-per-hook-poin.patch index 5ae8f8f1ed6..05888a070ef 100644 --- a/target/linux/generic/backport-4.14/301-v4.16-netfilter-core-only-allow-one-nat-hook-per-hook-poin.patch +++ b/target/linux/generic/backport-4.14/301-v4.16-netfilter-core-only-allow-one-nat-hook-per-hook-poin.patch @@ -120,7 +120,7 @@ Signed-off-by: Pablo Neira Ayuso .priority = NF_IP6_PRI_NAT_SRC, --- a/net/netfilter/core.c +++ b/net/netfilter/core.c -@@ -135,6 +135,12 @@ nf_hook_entries_grow(const struct nf_hoo +@@ -160,6 +160,12 @@ nf_hook_entries_grow(const struct nf_hoo ++i; continue; } diff --git a/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch b/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch index b122dd55d0f..458ddd41723 100644 --- a/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch +++ b/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch @@ -18,7 +18,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -274,8 +274,6 @@ struct nf_queue_entry; +@@ -311,8 +311,6 @@ struct nf_queue_entry; struct nf_afinfo { unsigned short family; @@ -27,7 +27,7 @@ Signed-off-by: Pablo Neira Ayuso __sum16 (*checksum_partial)(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, -@@ -296,20 +294,9 @@ static inline const struct nf_afinfo *nf +@@ -333,20 +331,9 @@ static inline const struct nf_afinfo *nf return rcu_dereference(nf_afinfo[family]); } diff --git a/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch b/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch index 7c22312c67e..19a0aacb45b 100644 --- a/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch +++ b/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch @@ -18,7 +18,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -274,11 +274,6 @@ struct nf_queue_entry; +@@ -311,11 +311,6 @@ struct nf_queue_entry; struct nf_afinfo { unsigned short family; @@ -30,7 +30,7 @@ Signed-off-by: Pablo Neira Ayuso int (*route)(struct net *net, struct dst_entry **dst, struct flowi *fl, bool strict); void (*saveroute)(const struct sk_buff *skb, -@@ -298,22 +293,9 @@ __sum16 nf_checksum(struct sk_buff *skb, +@@ -335,22 +330,9 @@ __sum16 nf_checksum(struct sk_buff *skb, unsigned int dataoff, u_int8_t protocol, unsigned short family); diff --git a/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch b/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch index e52f81164e0..75de3c84fef 100644 --- a/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch +++ b/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch @@ -11,7 +11,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -276,8 +276,6 @@ struct nf_afinfo { +@@ -313,8 +313,6 @@ struct nf_afinfo { unsigned short family; int (*route)(struct net *net, struct dst_entry **dst, struct flowi *fl, bool strict); @@ -176,7 +176,7 @@ Signed-off-by: Pablo Neira Ayuso #include #include #include -@@ -111,6 +113,35 @@ unsigned int nf_queue_nf_hook_drop(struc +@@ -108,6 +110,35 @@ void nf_queue_nf_hook_drop(struct net *n } EXPORT_SYMBOL_GPL(nf_queue_nf_hook_drop); @@ -212,7 +212,7 @@ Signed-off-by: Pablo Neira Ayuso static int __nf_queue(struct sk_buff *skb, const struct nf_hook_state *state, const struct nf_hook_entries *entries, unsigned int index, unsigned int queuenum) -@@ -147,7 +178,16 @@ static int __nf_queue(struct sk_buff *sk +@@ -144,7 +175,16 @@ static int __nf_queue(struct sk_buff *sk nf_queue_entry_get_refs(entry); skb_dst_force(skb); diff --git a/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch b/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch index fe60a790366..b98aac0fff6 100644 --- a/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch +++ b/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch @@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -274,8 +274,6 @@ struct nf_queue_entry; +@@ -311,8 +311,6 @@ struct nf_queue_entry; struct nf_afinfo { unsigned short family; @@ -26,7 +26,7 @@ Signed-off-by: Pablo Neira Ayuso int (*reroute)(struct net *net, struct sk_buff *skb, const struct nf_queue_entry *entry); int route_key_size; -@@ -294,6 +292,8 @@ __sum16 nf_checksum(struct sk_buff *skb, +@@ -331,6 +329,8 @@ __sum16 nf_checksum(struct sk_buff *skb, __sum16 nf_checksum_partial(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, unsigned int len, u_int8_t protocol, unsigned short family); diff --git a/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch b/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch index 2ffb39d9aff..5dbd1a4cea5 100644 --- a/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch +++ b/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch @@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -274,8 +274,6 @@ struct nf_queue_entry; +@@ -311,8 +311,6 @@ struct nf_queue_entry; struct nf_afinfo { unsigned short family; @@ -26,7 +26,7 @@ Signed-off-by: Pablo Neira Ayuso int route_key_size; }; -@@ -294,6 +292,7 @@ __sum16 nf_checksum_partial(struct sk_bu +@@ -331,6 +329,7 @@ __sum16 nf_checksum_partial(struct sk_bu u_int8_t protocol, unsigned short family); int nf_route(struct net *net, struct dst_entry **dst, struct flowi *fl, bool strict, unsigned short family); @@ -171,7 +171,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_queue.c +++ b/net/netfilter/nf_queue.c -@@ -250,7 +250,6 @@ void nf_reinject(struct nf_queue_entry * +@@ -266,7 +266,6 @@ void nf_reinject(struct nf_queue_entry * const struct nf_hook_entry *hook_entry; const struct nf_hook_entries *hooks; struct sk_buff *skb = entry->skb; @@ -179,7 +179,7 @@ Signed-off-by: Pablo Neira Ayuso const struct net *net; unsigned int i; int err; -@@ -277,8 +276,7 @@ void nf_reinject(struct nf_queue_entry * +@@ -293,8 +292,7 @@ void nf_reinject(struct nf_queue_entry * verdict = nf_hook_entry_hookfn(hook_entry, skb, &entry->state); if (verdict == NF_ACCEPT) { diff --git a/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch b/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch index 1b571252b5e..21381b7e6b5 100644 --- a/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch +++ b/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch @@ -9,7 +9,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -274,7 +274,6 @@ struct nf_queue_entry; +@@ -311,7 +311,6 @@ struct nf_queue_entry; struct nf_afinfo { unsigned short family; @@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso #include #include #include -@@ -148,9 +150,9 @@ static int __nf_queue(struct sk_buff *sk +@@ -145,9 +147,9 @@ static int __nf_queue(struct sk_buff *sk { int status = -ENOENT; struct nf_queue_entry *entry = NULL; @@ -59,7 +59,7 @@ Signed-off-by: Pablo Neira Ayuso /* QUEUE == DROP if no one is waiting, to be safe. */ qh = rcu_dereference(net->nf.queue_handler); -@@ -159,11 +161,19 @@ static int __nf_queue(struct sk_buff *sk +@@ -156,11 +158,19 @@ static int __nf_queue(struct sk_buff *sk goto err; } @@ -83,7 +83,7 @@ Signed-off-by: Pablo Neira Ayuso if (!entry) { status = -ENOMEM; goto err; -@@ -173,7 +183,7 @@ static int __nf_queue(struct sk_buff *sk +@@ -170,7 +180,7 @@ static int __nf_queue(struct sk_buff *sk .skb = skb, .state = *state, .hook_index = index, diff --git a/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch b/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch index 6d19743dfe6..0ca58f99885 100644 --- a/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch +++ b/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch @@ -12,7 +12,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h -@@ -272,16 +272,6 @@ int skb_make_writable(struct sk_buff *sk +@@ -309,16 +309,6 @@ int skb_make_writable(struct sk_buff *sk struct flowi; struct nf_queue_entry; @@ -29,7 +29,7 @@ Signed-off-by: Pablo Neira Ayuso __sum16 nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, u_int8_t protocol, unsigned short family); -@@ -293,9 +283,6 @@ int nf_route(struct net *net, struct dst +@@ -330,9 +320,6 @@ int nf_route(struct net *net, struct dst bool strict, unsigned short family); int nf_reroute(struct sk_buff *skb, struct nf_queue_entry *entry); diff --git a/target/linux/generic/backport-4.14/322-v4.16-netfilter-add-generic-flow-table-infrastructure.patch b/target/linux/generic/backport-4.14/322-v4.16-netfilter-add-generic-flow-table-infrastructure.patch index d811ef006c4..16de9571a86 100644 --- a/target/linux/generic/backport-4.14/322-v4.16-netfilter-add-generic-flow-table-infrastructure.patch +++ b/target/linux/generic/backport-4.14/322-v4.16-netfilter-add-generic-flow-table-infrastructure.patch @@ -126,7 +126,7 @@ Signed-off-by: Pablo Neira Ayuso #endif /* _FLOW_OFFLOAD_H */ --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -661,6 +661,13 @@ endif # NF_TABLES_NETDEV +@@ -667,6 +667,13 @@ endif # NF_TABLES_NETDEV endif # NF_TABLES diff --git a/target/linux/generic/backport-4.14/323-v4.16-netfilter-flow-table-support-for-IPv4.patch b/target/linux/generic/backport-4.14/323-v4.16-netfilter-flow-table-support-for-IPv4.patch index 6f36171605b..50d9039c123 100644 --- a/target/linux/generic/backport-4.14/323-v4.16-netfilter-flow-table-support-for-IPv4.patch +++ b/target/linux/generic/backport-4.14/323-v4.16-netfilter-flow-table-support-for-IPv4.patch @@ -19,7 +19,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig -@@ -77,6 +77,14 @@ config NF_TABLES_ARP +@@ -78,6 +78,14 @@ config NF_TABLES_ARP endif # NF_TABLES diff --git a/target/linux/generic/backport-4.14/325-v4.16-netfilter-flow-table-support-for-the-mixed-IPv4-IPv6.patch b/target/linux/generic/backport-4.14/325-v4.16-netfilter-flow-table-support-for-the-mixed-IPv4-IPv6.patch index 9fcb1be982c..04948d88ab1 100644 --- a/target/linux/generic/backport-4.14/325-v4.16-netfilter-flow-table-support-for-the-mixed-IPv4-IPv6.patch +++ b/target/linux/generic/backport-4.14/325-v4.16-netfilter-flow-table-support-for-the-mixed-IPv4-IPv6.patch @@ -63,7 +63,7 @@ Signed-off-by: Pablo Neira Ayuso .family = NFPROTO_IPV6, --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -661,6 +661,14 @@ endif # NF_TABLES_NETDEV +@@ -667,6 +667,14 @@ endif # NF_TABLES_NETDEV endif # NF_TABLES diff --git a/target/linux/generic/backport-4.14/326-v4.16-netfilter-nf_tables-flow-offload-expression.patch b/target/linux/generic/backport-4.14/326-v4.16-netfilter-nf_tables-flow-offload-expression.patch index 86f1f8a098c..0decc341057 100644 --- a/target/linux/generic/backport-4.14/326-v4.16-netfilter-nf_tables-flow-offload-expression.patch +++ b/target/linux/generic/backport-4.14/326-v4.16-netfilter-nf_tables-flow-offload-expression.patch @@ -39,7 +39,7 @@ Signed-off-by: Pablo Neira Ayuso NFT_LIMIT_PKT_BYTES --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -509,6 +509,13 @@ config NFT_CT +@@ -515,6 +515,13 @@ config NFT_CT This option adds the "ct" expression that you can use to match connection tracking information such as the flow state. diff --git a/target/linux/generic/backport-4.14/329-v4.16-netfilter-improve-flow-table-Kconfig-dependencies.patch b/target/linux/generic/backport-4.14/329-v4.16-netfilter-improve-flow-table-Kconfig-dependencies.patch index 7174723fc97..0d5cd3bb4fd 100644 --- a/target/linux/generic/backport-4.14/329-v4.16-netfilter-improve-flow-table-Kconfig-dependencies.patch +++ b/target/linux/generic/backport-4.14/329-v4.16-netfilter-improve-flow-table-Kconfig-dependencies.patch @@ -59,7 +59,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig -@@ -78,8 +78,9 @@ config NF_TABLES_ARP +@@ -79,8 +79,9 @@ config NF_TABLES_ARP endif # NF_TABLES config NF_FLOW_TABLE_IPV4 @@ -85,7 +85,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -669,8 +669,9 @@ endif # NF_TABLES_NETDEV +@@ -675,8 +675,9 @@ endif # NF_TABLES_NETDEV endif # NF_TABLES config NF_FLOW_TABLE_INET @@ -96,7 +96,7 @@ Signed-off-by: Pablo Neira Ayuso help This option adds the flow table mixed IPv4/IPv6 support. -@@ -678,6 +679,7 @@ config NF_FLOW_TABLE_INET +@@ -684,6 +685,7 @@ config NF_FLOW_TABLE_INET config NF_FLOW_TABLE tristate "Netfilter flow table module" diff --git a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch index b1b876cf1d6..5938a9ba5a8 100644 --- a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch +++ b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch @@ -62,7 +62,7 @@ Signed-off-by: Pablo Neira Ayuso static struct pernet_operations nfnl_log_net_ops = { --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c -@@ -1515,10 +1515,15 @@ static int __net_init nfnl_queue_net_ini +@@ -1510,10 +1510,15 @@ static int __net_init nfnl_queue_net_ini static void __net_exit nfnl_queue_net_exit(struct net *net) { diff --git a/target/linux/generic/backport-4.14/346-v4.16-netfilter-flowtable-infrastructure-depends-on-NETFIL.patch b/target/linux/generic/backport-4.14/346-v4.16-netfilter-flowtable-infrastructure-depends-on-NETFIL.patch index 162086e340d..bb8c2d3e5a9 100644 --- a/target/linux/generic/backport-4.14/346-v4.16-netfilter-flowtable-infrastructure-depends-on-NETFIL.patch +++ b/target/linux/generic/backport-4.14/346-v4.16-netfilter-flowtable-infrastructure-depends-on-NETFIL.patch @@ -25,7 +25,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig -@@ -79,8 +79,7 @@ endif # NF_TABLES +@@ -80,8 +80,7 @@ endif # NF_TABLES config NF_FLOW_TABLE_IPV4 tristate "Netfilter flow table IPv4 module" @@ -49,7 +49,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -670,8 +670,8 @@ endif # NF_TABLES +@@ -676,8 +676,8 @@ endif # NF_TABLES config NF_FLOW_TABLE_INET tristate "Netfilter flow table mixed IPv4/IPv6 module" @@ -60,7 +60,7 @@ Signed-off-by: Pablo Neira Ayuso help This option adds the flow table mixed IPv4/IPv6 support. -@@ -679,7 +679,9 @@ config NF_FLOW_TABLE_INET +@@ -685,7 +685,9 @@ config NF_FLOW_TABLE_INET config NF_FLOW_TABLE tristate "Netfilter flow table module" diff --git a/target/linux/generic/backport-4.14/356-v4.18-netfilter-nf_flow_table-relax-mixed-ipv4-ipv6-flowta.patch b/target/linux/generic/backport-4.14/356-v4.18-netfilter-nf_flow_table-relax-mixed-ipv4-ipv6-flowta.patch index 7d4bdc6d8dc..b5fe25a1d64 100644 --- a/target/linux/generic/backport-4.14/356-v4.18-netfilter-nf_flow_table-relax-mixed-ipv4-ipv6-flowta.patch +++ b/target/linux/generic/backport-4.14/356-v4.18-netfilter-nf_flow_table-relax-mixed-ipv4-ipv6-flowta.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -670,8 +670,7 @@ endif # NF_TABLES +@@ -676,8 +676,7 @@ endif # NF_TABLES config NF_FLOW_TABLE_INET tristate "Netfilter flow table mixed IPv4/IPv6 module" diff --git a/target/linux/generic/hack-4.14/250-netfilter_depends.patch b/target/linux/generic/hack-4.14/250-netfilter_depends.patch index 264d7661cf6..a8fe5d41758 100644 --- a/target/linux/generic/hack-4.14/250-netfilter_depends.patch +++ b/target/linux/generic/hack-4.14/250-netfilter_depends.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -223,7 +223,6 @@ config NF_CONNTRACK_FTP +@@ -229,7 +229,6 @@ config NF_CONNTRACK_FTP config NF_CONNTRACK_H323 tristate "H.323 protocol support" @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau depends on NETFILTER_ADVANCED help H.323 is a VoIP signalling protocol from ITU-T. As one of the most -@@ -1046,7 +1045,6 @@ config NETFILTER_XT_TARGET_SECMARK +@@ -1052,7 +1051,6 @@ config NETFILTER_XT_TARGET_SECMARK config NETFILTER_XT_TARGET_TCPMSS tristate '"TCPMSS" target support' diff --git a/target/linux/generic/hack-4.14/251-sound_kconfig.patch b/target/linux/generic/hack-4.14/251-sound_kconfig.patch index e1e48ce5f34..5bf5c01ad3a 100644 --- a/target/linux/generic/hack-4.14/251-sound_kconfig.patch +++ b/target/linux/generic/hack-4.14/251-sound_kconfig.patch @@ -122,8 +122,8 @@ Signed-off-by: John Crispin - tristate + tristate "Netfilter NFNETLINK interface" - config NETFILTER_NETLINK_ACCT - tristate "Netfilter NFACCT over NFNETLINK interface" + config NETFILTER_FAMILY_BRIDGE + bool --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig @@ -1,5 +1,5 @@ diff --git a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch index 308fe0974d2..2044bfaeb8a 100644 --- a/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch +++ b/target/linux/generic/hack-4.14/650-netfilter-add-xt_OFFLOAD-target.patch @@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig -@@ -75,8 +75,6 @@ config NF_TABLES_ARP +@@ -76,8 +76,6 @@ config NF_TABLES_ARP help This option enables the ARP support for nf_tables. @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau config NF_FLOW_TABLE_IPV4 tristate "Netfilter flow table IPv4 module" depends on NF_FLOW_TABLE -@@ -85,6 +83,8 @@ config NF_FLOW_TABLE_IPV4 +@@ -86,6 +84,8 @@ config NF_FLOW_TABLE_IPV4 To compile it as a module, choose M here. @@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau depends on !NF_CONNTRACK || NF_CONNTRACK --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -665,8 +665,6 @@ config NFT_FIB_NETDEV +@@ -671,8 +671,6 @@ config NFT_FIB_NETDEV endif # NF_TABLES_NETDEV @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau config NF_FLOW_TABLE_INET tristate "Netfilter flow table mixed IPv4/IPv6 module" depends on NF_FLOW_TABLE -@@ -675,11 +673,12 @@ config NF_FLOW_TABLE_INET +@@ -681,11 +679,12 @@ config NF_FLOW_TABLE_INET To compile it as a module, choose M here. @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau help This option adds the flow table core infrastructure. -@@ -968,6 +967,15 @@ config NETFILTER_XT_TARGET_NOTRACK +@@ -974,6 +973,15 @@ config NETFILTER_XT_TARGET_NOTRACK depends on NETFILTER_ADVANCED select NETFILTER_XT_TARGET_CT diff --git a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index e4a9ba7d961..ad78b684a0c 100644 --- a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -128,7 +128,7 @@ Signed-off-by: Pablo Neira Ayuso #define NFTA_FLOWTABLE_MAX (__NFTA_FLOWTABLE_MAX - 1) --- a/net/netfilter/Kconfig +++ b/net/netfilter/Kconfig -@@ -686,6 +686,15 @@ config NF_FLOW_TABLE +@@ -692,6 +692,15 @@ config NF_FLOW_TABLE To compile it as a module, choose M here. From 63b867adedf4863ea0354f49a47f6b33d0f6c720 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 22 Sep 2018 23:59:10 +0200 Subject: [PATCH 230/399] kernel: fix build of nftables Backport an additional patch from 4.16 for nftables. This fixes a build problem recently introduced. Fixes: f57806b56e5 ("kernel: generic: Fix nftables inet table breakage") Signed-off-by: Hauke Mehrtens (backported from efffba34097ff75d12365fb863621d893f974623) --- ...add-defines-for-arp-decnet-max-hooks.patch | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 target/linux/generic/backport-4.14/289-v4.16-netfilter-add-defines-for-arp-decnet-max-hooks.patch diff --git a/target/linux/generic/backport-4.14/289-v4.16-netfilter-add-defines-for-arp-decnet-max-hooks.patch b/target/linux/generic/backport-4.14/289-v4.16-netfilter-add-defines-for-arp-decnet-max-hooks.patch new file mode 100644 index 00000000000..f7898d4f301 --- /dev/null +++ b/target/linux/generic/backport-4.14/289-v4.16-netfilter-add-defines-for-arp-decnet-max-hooks.patch @@ -0,0 +1,67 @@ +From e58f33cc84bc089c430ac955f3cad6380ae98591 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Thu, 7 Dec 2017 16:28:23 +0100 +Subject: [PATCH] netfilter: add defines for arp/decnet max hooks + +The kernel already has defines for this, but they are in uapi exposed +headers. + +Including these from netns.h causes build errors and also adds unneeded +dependencies on heads that we don't need. + +So move these defines to netfilter_defs.h and place the uapi ones +in ifndef __KERNEL__ to keep them for userspace. + +Signed-off-by: Florian Westphal +Signed-off-by: Pablo Neira Ayuso +--- + include/linux/netfilter_defs.h | 6 ++++++ + include/uapi/linux/netfilter_arp.h | 3 +++ + include/uapi/linux/netfilter_decnet.h | 4 +++- + 3 files changed, 12 insertions(+), 1 deletion(-) + +--- a/include/linux/netfilter_defs.h ++++ b/include/linux/netfilter_defs.h +@@ -7,4 +7,10 @@ + /* Largest hook number + 1, see uapi/linux/netfilter_decnet.h */ + #define NF_MAX_HOOKS 8 + ++/* in/out/forward only */ ++#define NF_ARP_NUMHOOKS 3 ++ ++/* max hook is NF_DN_ROUTE (6), also see uapi/linux/netfilter_decnet.h */ ++#define NF_DN_NUMHOOKS 7 ++ + #endif +--- a/include/uapi/linux/netfilter_arp.h ++++ b/include/uapi/linux/netfilter_arp.h +@@ -15,6 +15,9 @@ + #define NF_ARP_IN 0 + #define NF_ARP_OUT 1 + #define NF_ARP_FORWARD 2 ++ ++#ifndef __KERNEL__ + #define NF_ARP_NUMHOOKS 3 ++#endif + + #endif /* __LINUX_ARP_NETFILTER_H */ +--- a/include/uapi/linux/netfilter_decnet.h ++++ b/include/uapi/linux/netfilter_decnet.h +@@ -24,6 +24,9 @@ + #define NFC_DN_IF_IN 0x0004 + /* Output device. */ + #define NFC_DN_IF_OUT 0x0008 ++ ++/* kernel define is in netfilter_defs.h */ ++#define NF_DN_NUMHOOKS 7 + #endif /* ! __KERNEL__ */ + + /* DECnet Hooks */ +@@ -41,7 +44,6 @@ + #define NF_DN_HELLO 5 + /* Input Routing Packets */ + #define NF_DN_ROUTE 6 +-#define NF_DN_NUMHOOKS 7 + + enum nf_dn_hook_priorities { + NF_DN_PRI_FIRST = INT_MIN, From a3446cb0d227a842bf748b8ca04bb4631bf1ea27 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 24 Sep 2018 08:36:10 +0200 Subject: [PATCH 231/399] lldpd: inhibit linking of libbsd on !GLIBC Signed-off-by: Jo-Philipp Wich (backported from 4f277eb6402684ca79c9834e8eb30c0e93368e8b) --- package/network/services/lldpd/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index 22b55c6df13..78dc54be932 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -87,6 +87,10 @@ define Package/lldpd/conffiles /etc/config/lldpd endef +CONFIGURE_VARS += \ + $(if $(CONFIG_USE_GLIBC),,libbsd_CFLAGS=-ldo-not-link-bsd) \ + $(if $(CONFIG_USE_GLIBC),,libbsd_LDFLAGS=-ldo-not-link-bsd) + CONFIGURE_ARGS += \ $(if $(CONFIG_LLDPD_WITH_PRIVSEP), \ --with-privsep-user=lldp \ From 6bcafab581cd60196e94b2b0edebc236888f7f4d Mon Sep 17 00:00:00 2001 From: Konstantin Demin Date: Mon, 5 Mar 2018 12:46:44 +0300 Subject: [PATCH 232/399] rules.mk: add ESED command ESED is SED with extended regular expressions turned on. Command line and usage are the same as for SED. Signed-off-by: Konstantin Demin (backported from d3b43f49acb38cbe364da8735c9617427edd3d81) --- rules.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/rules.mk b/rules.mk index 6b881a0c619..15b330c7926 100644 --- a/rules.mk +++ b/rules.mk @@ -265,6 +265,7 @@ TARGET_CC:=$(TARGET_CROSS)gcc TARGET_CXX:=$(TARGET_CROSS)g++ KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh SED:=$(STAGING_DIR_HOST)/bin/sed -i -e +ESED:=$(STAGING_DIR_HOST)/bin/sed -E -i -e CP:=cp -fpR LN:=ln -sf XARGS:=xargs -r From 85c77301d4ad126cf93695422fdaa9a50ca957e6 Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Fri, 2 Mar 2018 19:32:24 -0800 Subject: [PATCH 233/399] base-files: fix postinstall uci-defaults removal Commit 7f694582 introduced a bug where default_postinst() often fails to remove a uci-defaults script after application, leaving it to run again after a reboot. (Note: commit 7f694582 also introduced FS#1021, now fixed by 73c745f6) The subtle problem arises from the shell logical chain: [ -f "$i" ] && . "$i" && rm -f "$i" Most uci-defaults scripts contain a terminal 'exit 0' statement which, when sourced, results in the logic chain exiting before executing 'rm -f'. This was observed while testing upgrades of 'luci-app-sqm'. The solution is to wrap the shell sourcing in a subshell relative to the command 'rm -f': ( [ -f "$i" ] && . "$i" ) && rm -f "$i" Revert to using 'grep' to prefilter the list of entries from the control file, which yields the full path of uci-defaults scripts. This allows keeping the existence check, directory change and script sourcing inside the subshell, with the script removal correctly outside. This approach avoids adding a second subshell only around the "." (source) command. The change also preserves the fix FS#1021, since the full path is used to source the script, which is POSIX-portable irrespective of PATH variable or reference to the CWD. Run Tested on: LEDE 17.01.4 running ar71xx, while tracing installation of package luci-app-sqm with its associated /etc/uci-defaults/luci-sqm file. Signed-off-by: Tony Ambardar (backported from 4097ab6a975902b170dd7f7ac6c8025e5f32ef8d) --- package/base-files/files/lib/functions.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index f16ffd17469..50a7b408698 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -234,10 +234,9 @@ default_postinst() { if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then . /lib/functions/system.sh [ -d /tmp/.uci ] || mkdir -p /tmp/.uci - for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do ( - cd /etc/uci-defaults - [ -f "$i" ] && . ./"$i" && rm -f "$i" - ) done + for i in $(grep -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"); do + ( [ -f "$i" ] && cd "$(dirname $i)" && . "$i" ) && rm -f "$i" + done uci commit fi From 991e43c894d0e6e74a1010ff4f327e25ca69fd9a Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Fri, 21 Sep 2018 19:41:27 +0100 Subject: [PATCH 234/399] kernel: re-enable MIPS VDSO kernel upstream commit 9efcaa7c4afba5628f2650a76f69c798f47eeb18 to 4.14 itself a backport of 0f02cfbc3d9e413d450d8d0fd660077c23f67eff has resolved the cache line issues that led to us disabling VDSO by default on MIPS. Remove our force disable patch: pending-4.14/206-mips-disable-vdso.patch Signed-off-by: Kevin Darbyshire-Bryant Acked-by: Hauke Mehrtens (backported from 8ee7a80d190b291e828cace3cac8c485f3b8667d) --- .../pending-4.14/206-mips-disable-vdso.patch | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 target/linux/generic/pending-4.14/206-mips-disable-vdso.patch diff --git a/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch b/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch deleted file mode 100644 index f3c58dcd3ad..00000000000 --- a/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Felix Fietkau -Subject: kernel: disable MIPS VDSO by default until the cache issues have been resolved - -lede-commit: 1185e645a773c86aa88cf04d0e2911dc62eb43f5 -Signed-off-by: Felix Fietkau ---- - arch/mips/vdso/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/mips/vdso/Makefile -+++ b/arch/mips/vdso/Makefile -@@ -30,9 +30,9 @@ aflags-vdso := $(ccflags-vdso) \ - ifndef CONFIG_CPU_MIPSR6 - ifeq ($(call ld-ifversion, -lt, 225000000, y),y) - $(warning MIPS VDSO requires binutils >= 2.25) -- obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) -- ccflags-vdso += -DDISABLE_MIPS_VDSO - endif -+ obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) -+ ccflags-vdso += -DDISABLE_MIPS_VDSO - endif - - # VDSO linker flags. From 9a01ff5c0349c01d2182d9b4f15fe7ba8b156329 Mon Sep 17 00:00:00 2001 From: David Yang Date: Sat, 11 Aug 2018 15:51:02 +0800 Subject: [PATCH 235/399] dante: disable sched_getscheduler() - not implemented in musl musl doesn't come with an valid implementation of `sched_getscheduler()`; it simply returns -ENOSYS for it. Without this option (and compile dante with `sched_getscheduler()` enabled), you will get error: serverinit(): sched_getscheduler(2): failed to retrieve current cpuscheduling policy: Function not implemented and dante won't start at all. Ref: http://lists.alpinelinux.org/alpine-devel/3932.html Ref: http://lists.alpinelinux.org/alpine-devel/3936.html Signed-off-by: David Yang [slightly reword commit message] Signed-off-by: Jo-Philipp Wich (backported from aaf46a8fe23eca959164c1681ab3a37c6e746b05) --- package/network/utils/dante/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/network/utils/dante/Makefile b/package/network/utils/dante/Makefile index 6f821122b29..1c57b120f8b 100644 --- a/package/network/utils/dante/Makefile +++ b/package/network/utils/dante/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dante PKG_VERSION:=1.4.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://www.inet.no/dante/files/ @@ -29,7 +29,8 @@ CONFIGURE_ARGS += \ --disable-libwrap CONFIGURE_VARS += \ - ac_cv_search_pam_start="" + ac_cv_search_pam_start="" \ + ac_cv_func_sched_setscheduler=no define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include @@ -49,7 +50,7 @@ Dante is a circuit-level firewall/proxy that can be used to provide convenient and secure network connectivity, requiring only that the server Dante runs on has external network connectivity. Dante is used daily by Fortune 100 companies and large international organizations, either as a standard SOCKS server or as -a "reverse proxy". +a "reverse proxy". endef define Package/libsocks From 38e99cb37942716c3ae2d4d4e083fc38469dfcf5 Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Tue, 7 Aug 2018 17:46:42 +0200 Subject: [PATCH 236/399] gettext-full: host compile with -fpic Signed-off-by: Andy Walsh (backported from 2bbc9376c6c081a8db491f047e32091da6ba0016) --- package/libs/gettext-full/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index db6aee75083..4cb8d8d6180 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -77,6 +77,8 @@ HOST_CONFIGURE_VARS += \ am_cv_func_iconv=no \ ac_cv_header_iconv_h=no \ +HOST_CFLAGS += $(HOST_FPIC) + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/lib/libintl-full/include $(CP) $(PKG_INSTALL_DIR)/usr/include/libintl.h $(1)/usr/lib/libintl-full/include/ From d5b045b52b8c13680e8d38f203ff67e4f37cd619 Mon Sep 17 00:00:00 2001 From: Andy Walsh Date: Wed, 1 Aug 2018 12:48:08 +0200 Subject: [PATCH 237/399] ncurses: use default host install * just use default host/install, so libs/headers get properly generated/installed Signed-off-by: Andy Walsh (backported from e0196152ebe7b6d11b740a81d0c3bced5b1902c1) --- package/libs/ncurses/Makefile | 6 ------ 1 file changed, 6 deletions(-) diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 94c968816fd..904d3c1551f 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -162,12 +162,6 @@ define Host/Compile $(MAKE) -C $(HOST_BUILD_DIR)/progs tic endef -define Host/Install - $(INSTALL_BIN) $(HOST_BUILD_DIR)/progs/tic $(STAGING_DIR_HOST)/bin/tic - $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib/ - $(INSTALL_DATA) $(HOST_BUILD_DIR)/lib/libncurses.a $(STAGING_DIR_HOSTPKG)/lib/ -endef - $(eval $(call HostBuild)) $(eval $(call BuildPackage,terminfo)) $(eval $(call BuildPackage,libncurses)) From 0ccf009b623a149a06e678c53bd7e5c04941cb60 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Mon, 24 Sep 2018 14:20:29 +0200 Subject: [PATCH 238/399] base-files: add network_get_metric() to /lib/functions/network.sh Signed-off-by: Florian Eckert Signed-off-by: Hans Dedecker [PKG_RELEASE increase] (backported from 61a59949009993a6b1d634ecbce765b37c4c2560) --- package/base-files/Makefile | 2 +- package/base-files/files/lib/functions/network.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 0fdbc4002e5..9134f118e0d 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=194 +PKG_RELEASE:=194.1 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh index d7fd2dea573..4fdcb66302a 100644 --- a/package/base-files/files/lib/functions/network.sh +++ b/package/base-files/files/lib/functions/network.sh @@ -271,6 +271,11 @@ network_is_up() # 2: interface network_get_protocol() { __network_ifstatus "$1" "$2" ".proto"; } +# determine the metric of the given logical interface +# 1: destination variable +# 2: interface +network_get_metric() { __network_ifstatus "$1" "$2" ".metric"; } + # determine the layer 3 linux network device of the given logical interface # 1: destination variable # 2: interface From 468a4b5b6279423d96e537330dde1ff76d2198ed Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Sun, 23 Sep 2018 10:05:04 +0800 Subject: [PATCH 239/399] netifd: do not validate relevant section when ipv6 is not supported Signed-off-by: Rosy Song (backported from a6add47869972139cef9106aecfddbac0b3f64f4) --- package/network/config/netifd/files/etc/init.d/network | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/netifd/files/etc/init.d/network b/package/network/config/netifd/files/etc/init.d/network index 6cd167d19d2..99d9f6582fb 100755 --- a/package/network/config/netifd/files/etc/init.d/network +++ b/package/network/config/netifd/files/etc/init.d/network @@ -133,9 +133,9 @@ service_triggers() procd_open_validate validate_atm_bridge_section validate_route_section - validate_route6_section + [ -e /proc/sys/net/ipv6 ] && validate_route6_section validate_rule_section - validate_rule6_section + [ -e /proc/sys/net/ipv6 ] && validate_rule6_section validate_switch_section validate_switch_vlan procd_close_validate From b3cc304e4552aa29721941406a885cd8e8987a5b Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Thu, 9 Aug 2018 14:47:31 +0800 Subject: [PATCH 240/399] iptables: fix dependency for libip6tc on IPV6 Signed-off-by: Rosy Song (backported from 2dc1f54b1205094e7c6036cae6275d2c326bad3e) --- package/network/utils/iptables/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 9c7179c51dc..c1e4790d11a 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -462,7 +462,7 @@ define Package/libiptc $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libip4tc +libip6tc +libxtables + DEPENDS:=+libip4tc +IPV6:libip6tc +libxtables ABI_VERSION:=$(PKG_VERSION) TITLE:=IPv4/IPv6 firewall - shared libiptc library (compatibility stub) endef @@ -482,7 +482,7 @@ $(call Package/iptables/Default) CATEGORY:=Libraries TITLE:=IPv6 firewall - shared libiptc library ABI_VERSION:=$(PKG_VERSION) - DEPENDS:=+libxtables + DEPENDS:=@IPV6 +libxtables endef define Package/libxtables From 4e165fbc29cb855373b0d3fc3290a51bf9065c92 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 3 Aug 2018 22:13:13 +0200 Subject: [PATCH 241/399] wireguard: bump to 0.0.20180802 Changelog taken from the version announcement > == Changes == > > * chacha20poly1305: selftest: split up test vector constants > > The test vectors are encoded as long strings -- really long strings -- and > apparently RFC821 doesn't like lines longer than 998. > https://cr.yp.to/smtp/message.html > > * queueing: keep reference to peer after setting atomic state bit > > This fixes a regression introduced when preparing the LKML submission. > > * allowedips: prevent double read in kref > * allowedips: avoid window of disappeared peer > * hashtables: document immediate zeroing semantics > * peer: ensure resources are freed when creation fails > * queueing: document double-adding and reference conditions > * queueing: ensure strictly ordered loads and stores > * cookie: returned keypair might disappear if rcu lock not held > * noise: free peer references on failure > * peer: ensure destruction doesn't race > > Various fixes, as well as lots of code comment documentation, for a > small variety of the less obvious aspects of object lifecycles, > focused on correctness. > > * allowedips: free root inside of RCU callback > * allowedips: use different macro names so as to avoid confusion > > These incorporate two suggestions from LKML. > > This snapshot contains commits from: Jason A. Donenfeld and Jann Horn. Signed-off-by: Jason A. Donenfeld Signed-off-by: Yousong Zhou (backported from 68e2ebe64a0f27eb25c0e56ef1125ce1318e2279) --- package/network/services/wireguard/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index a88dca1e7f5..9f90115f816 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180718 -PKG_RELEASE:=2 +PKG_VERSION:=0.0.20180802 +PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=083c093a6948c8d38f92e7ea5533f9ff926019f24dc2612ea974851ed3e24705 +PKG_HASH:=cd1da34b377d58df760aadf69ced045081517570586fc2d4eed7f09f5d5a47c6 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From b920285883c72ce388bc57f9b1fdcc78b18d99bd Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 12 Aug 2018 01:29:52 -0700 Subject: [PATCH 242/399] wireguard: bump to 0.0.20180809 * send: switch handshake stamp to an atomic Rather than abusing the handshake lock, we're much better off just using a boring atomic64 for this. It's simpler and performs better. Also, while we're at it, we set the handshake stamp both before and after the calculations, in case the calculations block for a really long time waiting for the RNG to initialize. * compat: better atomic acquire/release backport This should fix compilation and correctness on several platforms. * crypto: move simd context to specific type This was a suggestion from Andy Lutomirski on LKML. * chacha20poly1305: selftest: use arrays for test vectors We no longer have lines so long that they're rejected by SMTP servers. * qemu: add easy git harness This makes it a bit easier to use our qemu harness for testing our mainline integration tree. * curve25519-x86_64: avoid use of r12 This causes problems with RAP and KERNEXEC for PaX, as r12 is a reserved register. * chacha20: use memmove in case buffers overlap A small correctness fix that we never actually hit in WireGuard but is important especially for moving this into a general purpose library. * curve25519-hacl64: simplify u64_eq_mask * curve25519-hacl64: correct u64_gte_mask Two bitmath fixes from Samuel, which come complete with a z3 script proving their correctness. * timers: include header in right file This fixes compilation in some environments. * netlink: don't start over iteration on multipart non-first allowedips Matt Layher found a bug where a netlink dump of peers would never terminate in some circumstances, causing wg(8) to keep trying forever. We now have a fix as well as a unit test to mitigate this, and we'll be looking to create a fuzzer out of Matt's nice library. Signed-off-by: Jason A. Donenfeld (backported from 42dc0e25947a77b02ea18fa0e5fa04382250d5db) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 9f90115f816..0f6fa1adcb7 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180802 +PKG_VERSION:=0.0.20180809 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=cd1da34b377d58df760aadf69ced045081517570586fc2d4eed7f09f5d5a47c6 +PKG_HASH:=3e351c42d22de427713f1da06d21189c5896a694a66cf19233a7c33295676f19 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 686f70729321e8c8a9497d7c17a4f52565455d8f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 4 Sep 2018 12:33:46 -0600 Subject: [PATCH 243/399] wireguard: bump to 0.0.20180904 * Kconfig: use new-style help marker * global: run through clang-format * uapi: reformat * global: satisfy check_patch.pl errors * global: prefer sizeof(*pointer) when possible * global: always find OOM unlikely Tons of style cleanups. * crypto: use unaligned helpers We now avoid unaligned accesses for generic users of the crypto API. * crypto: import zinc More style cleanups and a rearrangement of the crypto routines to fit how this is going to work upstream. This required some fairly big changes to our build system, so there may be some build errors we'll have to address in subsequent snapshots. * compat: rng_is_initialized made it into 4.19 We therefore don't need it in the compat layer anymore. * curve25519-hacl64: use formally verified C for comparisons The previous code had been proved in Z3, but this new code from upstream KreMLin is directly generated from the F*, which is preferable. The assembly generated is identical. * curve25519-x86_64: let the compiler decide when/how to load constants Small performance boost. * curve25519-arm: reformat * curve25519-arm: cleanups from lkml * curve25519-arm: add spaces after commas * curve25519-arm: use ordinary prolog and epilogue * curve25519-arm: do not waste 32 bytes of stack * curve25519-arm: prefix immediates with # This incorporates ASM nits from upstream review. Signed-off-by: Jason A. Donenfeld (backported from 4ccbe7de6cb20766fd309bc3824c7591e33b0b96) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 0f6fa1adcb7..c9608ec61c7 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180809 +PKG_VERSION:=0.0.20180904 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=3e351c42d22de427713f1da06d21189c5896a694a66cf19233a7c33295676f19 +PKG_HASH:=a38ead72994a7db7cda2d0085f410df1111b4728db050a519883eda8f3fe38f1 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 9f9f8db13865975cbc69a501e3b2fbcac05631e5 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 10 Sep 2018 18:59:16 -0600 Subject: [PATCH 244/399] wireguard: bump to 0.0.20180910 * curve25519: arm: do not modify sp directly * compat: support neon.h on old kernels * compat: arch-namespace certain includes * compat: move simd.h from crypto to compat since it's going upstream This fixes a decent amount of compat breakage and thumb2-mode breakage introduced by our move to Zinc. * crypto: use CRYPTOGAMS license Rather than using code from OpenSSL, use code directly from AndyP. * poly1305: rewrite self tests from scratch * poly1305: switch to donna This makes our C Poly1305 implementation a bit more intensely tested and also faster, especially on 64-bit systems. It also sets the stage for moving to a HACL* implementation when that's ready. Signed-off-by: Jason A. Donenfeld (backported from a54f492d0cf1f9bff1dd449961441e789c724995) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index c9608ec61c7..ef00f8067e7 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180904 +PKG_VERSION:=0.0.20180910 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=a38ead72994a7db7cda2d0085f410df1111b4728db050a519883eda8f3fe38f1 +PKG_HASH:=43481ac82d4889491e1ae761d4ef10688410975cc861db5d2ac1845ac62eae39 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 113dadc6dde5d571abfe228a8d1fef4b21dbf624 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 18 Sep 2018 16:57:05 +0200 Subject: [PATCH 245/399] wireguard: bump to 0.0.20180918 * blake2s-x86_64: fix whitespace errors * crypto: do not use compound literals in selftests * crypto: make sure UML is properly disabled * kconfig: make NEON depend on CPU_V7 * poly1305: rename finish to final * chacha20: add constant for words in block * curve25519-x86_64: remove useless define * poly1305: precompute 5*r in init instead of blocks * chacha20-arm: swap scalar and neon functions * simd: add __must_check annotation * poly1305: do not require simd context for arch * chacha20-x86_64: cascade down implementations * crypto: pass simd by reference * chacha20-x86_64: don't activate simd for small blocks * poly1305-x86_64: don't activate simd for small blocks * crypto: do not use -include trick * crypto: turn Zinc into individual modules * chacha20poly1305: relax simd between sg chunks * chacha20-x86_64: more limited cascade * crypto: allow for disabling simd in zinc modules * poly1305-x86_64: show full struct for state * chacha20-x86_64: use correct cut off for avx512-vl * curve25519-arm: only compile if symbols will be used * chacha20poly1305: add __init to selftest helper functions * chacha20: add independent self test Tons of improvements all around the board to our cryptography library, including some performance boosts with how we handle SIMD for small packets. * send/receive: reduce number of sg entries This quells a powerpc stack usage warning. * global: remove non-essential inline annotations We now allow the compiler to determine whether or not to inline certain functions, while still manually choosing so for a few performance-critical sections. Signed-off-by: Jason A. Donenfeld (backported from f07a94da50b8a31928cb34c19695747e0df74beb) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index ef00f8067e7..a04004ba46b 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180910 +PKG_VERSION:=0.0.20180918 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=43481ac82d4889491e1ae761d4ef10688410975cc861db5d2ac1845ac62eae39 +PKG_HASH:=c0d931bdfce139a3678592ada463042c24f12dd01ba75badd3eeb0aee2211302 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From fbce30208801b5d04235de7648eccda2cf3c9816 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Thu, 27 Sep 2018 21:14:10 +0100 Subject: [PATCH 246/399] wireguard: bump to 0.0.20180925 33523a5 version: bump snapshot 0759480 curve25519-hacl64: reduce stack usage under KASAN b9ab0fc chacha20: add bounds checking to selftests 2e99d19 chacha20-mips32r2: reduce stack and branches in loop, refactor jumptable handling d6ac367 qemu: bump musl 28d8b7e crypto: make constant naming scheme consistent 56c4ea9 hchacha20: keep in native endian in words 0c3c0bc chacha20-arm: remove unused preambles 3dcd246 chacha20-arm: updated scalar code from Andy 6b9d5ca poly1305-mips64: remove useless preprocessor error 3ff3990 crypto-arm: rework KERNEL_MODE_NEON handling again dd2f91e crypto: flatten out makefile 67a3cfb curve25519-fiat32: work around m68k compiler stack frame bug 9aa2943 allowedips: work around kasan stack frame bug in selftest 317b318 chacha20-arm: use new scalar implementation b715e3b crypto-arm: rework KERNEL_MODE_NEON handling 77b07d9 global: reduce stack frame size ddc2bd6 chacha20: add chunked selftest and test sliding alignments and hchacha20 2eead02 chacha20-mips32r2: reduce jumptable entry size and stack usage a0ac620 chacha20-mips32r2: use simpler calling convention 09247c0 chacha20-arm: go with Ard's version to optimize for Cortex-A7 a329e0a chacha20-mips32r2: remove reorder directives 3b22533 chacha20-mips32r2: fix typo to allow reorder again d4ac6bb poly1305-mips32r2: remove all reorder directives 197a30c global: put SPDX identifier on its own line 305806d ratelimiter: disable selftest with KASAN 4e06236 crypto: do not waste space on selftest items 5e0fd08 netlink: reverse my christmas trees a61ea8b crypto: explicitly dual license b161aff poly1305: account for simd being toggled off midway 470a0c5 allowedips: change from BUG_ON to WARN_ON aa9e090 chacha20: prefer crypto_xor_cpy to avoid memmove 1b0adf5 poly1305: no need to trick gcc 8.1 a849803 blake2s: simplify final function 073f3d1 poly1305: better module description Signed-off-by: Kevin Darbyshire-Bryant (backported from 37961f12baa756caf5d735fdafff46205d21a93d) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index a04004ba46b..29c7447476c 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180918 +PKG_VERSION:=0.0.20180925 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=c0d931bdfce139a3678592ada463042c24f12dd01ba75badd3eeb0aee2211302 +PKG_HASH:=4a0488a07e40ec17e798f3e40a85cedf55f0560b1c3a8fd95806c7d4266cb0e8 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 217219ee1dd4faf5f3ce32cfb9385b770466e323 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 29 Sep 2018 15:56:20 +0200 Subject: [PATCH 247/399] kernel: Activate VDSO on MIPS again The cache coloring problem on MIPS CPUs was fixed with kernel 4.9.129 of the kernel 4.9 branch. Activate VDSO support for MIPS again. Signed-off-by: Hauke Mehrtens (backported from 91a71804f89a238082904ae027fffb52114e3499) --- .../pending-4.9/206-mips-disable-vdso.patch | 23 ------------------- 1 file changed, 23 deletions(-) delete mode 100644 target/linux/generic/pending-4.9/206-mips-disable-vdso.patch diff --git a/target/linux/generic/pending-4.9/206-mips-disable-vdso.patch b/target/linux/generic/pending-4.9/206-mips-disable-vdso.patch deleted file mode 100644 index 807d5790447..00000000000 --- a/target/linux/generic/pending-4.9/206-mips-disable-vdso.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Felix Fietkau -Subject: kernel: disable MIPS VDSO by default until the cache issues have been resolved - -lede-commit: 1185e645a773c86aa88cf04d0e2911dc62eb43f5 -Signed-off-by: Felix Fietkau ---- - arch/mips/vdso/Makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/mips/vdso/Makefile -+++ b/arch/mips/vdso/Makefile -@@ -28,9 +28,9 @@ aflags-vdso := $(ccflags-vdso) \ - ifndef CONFIG_CPU_MIPSR6 - ifeq ($(call ld-ifversion, -lt, 225000000, y),y) - $(warning MIPS VDSO requires binutils >= 2.25) -- obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) -- ccflags-vdso += -DDISABLE_MIPS_VDSO - endif -+ obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) -+ ccflags-vdso += -DDISABLE_MIPS_VDSO - endif - - # VDSO linker flags. From 386a57dc596c95919024e0726582a996d801d9fb Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 18 Dec 2018 14:12:21 +0100 Subject: [PATCH 248/399] kernel: bump 4.9 to 4.9.146 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- .../024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch | 2 +- .../layerscape/patches-4.9/703-phy-support-layerscape.patch | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 30e1edf75eb..414a5bcee8b 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .145 LINUX_VERSION-4.14 = .88 +LINUX_VERSION-4.9 = .146 -LINUX_KERNEL_HASH-4.9.145 = 6901ca37e8c305a2f26c598952338b4dc2481ca5a9d0bf71e2b71730a5b5bc5e LINUX_KERNEL_HASH-4.14.88 = b0f0b8c76708eab6caf3009702e531d40a243b152922ee1f9a441316f226f52d +LINUX_KERNEL_HASH-4.9.146 = 58195a8be3085d117c83a2ed1caa3b46ea7c1614c75f951b9f13f7adb03f8e59 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch index 4a3f355b4d8..0a5b9ead9dc 100644 --- a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch +++ b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch @@ -134,7 +134,7 @@ Signed-off-by: David S. Miller if (tcp_small_queue_check(sk, skb, 0)) break; -@@ -3542,8 +3542,6 @@ void __tcp_send_ack(struct sock *sk, u32 +@@ -3546,8 +3546,6 @@ void __tcp_send_ack(struct sock *sk, u32 /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784 diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch index 4124bab4adf..9c232791882 100644 --- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch @@ -1713,7 +1713,7 @@ Signed-off-by: Yangbo Lu ret = phydrv->resume(phydev); if (ret) -@@ -1723,7 +1723,7 @@ static int phy_remove(struct device *dev +@@ -1720,7 +1720,7 @@ static int phy_remove(struct device *dev phydev->state = PHY_DOWN; mutex_unlock(&phydev->lock); From 7b0e1d28e89e8932aa228ff2f37c274745eaa5e8 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 18 Dec 2018 14:12:50 +0100 Subject: [PATCH 249/399] kernel: bump 4.14 to 4.14.89 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 2 +- ...les-remove-multihook-chains-and-fami.patch | 12 +-- ...hecksum-indirection-to-struct-nf_ipv.patch | 2 +- ...hecksum_partial-indirection-to-struc.patch | 2 +- ...-saveroute-indirection-in-struct-nf_.patch | 4 +- ...oute-indirection-to-struct-nf_ipv6_o.patch | 2 +- ...eroute-indirection-to-struct-nf_ipv6.patch | 6 +- ...-route_key_size-field-in-struct-nf_a.patch | 2 +- ...-struct-nf_afinfo-and-its-helper-fun.patch | 4 +- ...bles-add-flow-table-netlink-frontend.patch | 24 +++--- ...les-remove-nhooks-field-from-struct-.patch | 2 +- ...les-fix-a-typo-in-nf_tables_getflowt.patch | 2 +- ...les-no-need-for-struct-nft_af_info-t.patch | 4 +- ...les-fix-potential-NULL-ptr-deref-in-.patch | 2 +- ...les-add-single-table-list-for-all-fa.patch | 74 +++++++++---------- ...tfilter-exit_net-cleanup-check-added.patch | 4 +- ...nf_tables-get-rid-of-pernet-families.patch | 10 +-- ...les-get-rid-of-struct-nft_af_info-ab.patch | 74 +++++++++---------- ...ow_offload-wait-for-garbage-collecto.patch | 2 +- ...tfilter-nf_tables-fix-flowtable-free.patch | 2 +- ...les-allocate-handle-and-delete-objec.patch | 32 ++++---- ...w_table-move-init-code-to-nf_flow_ta.patch | 4 +- ...w_table-fix-priv-pointer-for-netdev-.patch | 2 +- ...w_table-track-flow-tables-in-nf_flow.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...w_table-add-hardware-offload-support.patch | 6 +- ...dd-quirk-to-autoload-ubi-on-rt-ac58u.patch | 6 +- .../patches-4.14/0052-net-phy-add-FC.patch | 2 +- ...spi-nor-w25q256-respect-default-mode.patch | 2 +- .../302-spi-nor-add-gd25q512.patch | 2 +- ...or-enable-4B-opcodes-for-mx66l51235l.patch | 2 +- 32 files changed, 151 insertions(+), 151 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 414a5bcee8b..826e27c3fd0 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,11 +2,11 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.14 = .88 LINUX_VERSION-4.9 = .146 +LINUX_VERSION-4.14 = .89 -LINUX_KERNEL_HASH-4.14.88 = b0f0b8c76708eab6caf3009702e531d40a243b152922ee1f9a441316f226f52d LINUX_KERNEL_HASH-4.9.146 = 58195a8be3085d117c83a2ed1caa3b46ea7c1614c75f951b9f13f7adb03f8e59 +LINUX_KERNEL_HASH-4.14.89 = ce6e16ac44dddd0d6a232bf2ce03e8bf8beca19f9b84503684466d140a1a0b25 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch index d9215505ee1..067481ba943 100644 --- a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -74,7 +74,7 @@ Cc: Kir Kolyshkin sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); /* Goal is to send at least one packet per ms, -@@ -2184,7 +2184,7 @@ static bool tcp_small_queue_check(struct +@@ -2200,7 +2200,7 @@ static bool tcp_small_queue_check(struct { unsigned int limit; diff --git a/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch b/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch index 0db6262fd93..4c00ea8456c 100644 --- a/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch +++ b/target/linux/generic/backport-4.14/303-v4.16-netfilter-nf_tables-remove-multihook-chains-and-fami.patch @@ -264,7 +264,7 @@ Signed-off-by: Pablo Neira Ayuso } nft_chain_release_hook(&hook); } -@@ -5135,10 +5123,9 @@ static int nf_tables_commit(struct net * +@@ -5129,10 +5117,9 @@ static int nf_tables_commit(struct net * case NFT_MSG_DELCHAIN: list_del_rcu(&trans->ctx.chain->list); nf_tables_chain_notify(&trans->ctx, NFT_MSG_DELCHAIN); @@ -278,7 +278,7 @@ Signed-off-by: Pablo Neira Ayuso break; case NFT_MSG_NEWRULE: nft_clear(trans->ctx.net, nft_trans_rule(trans)); -@@ -5275,10 +5262,9 @@ static int nf_tables_abort(struct net *n +@@ -5269,10 +5256,9 @@ static int nf_tables_abort(struct net *n } else { trans->ctx.table->use--; list_del_rcu(&trans->ctx.chain->list); @@ -292,7 +292,7 @@ Signed-off-by: Pablo Neira Ayuso } break; case NFT_MSG_DELCHAIN: -@@ -5381,7 +5367,7 @@ int nft_chain_validate_hooks(const struc +@@ -5375,7 +5361,7 @@ int nft_chain_validate_hooks(const struc if (nft_is_base_chain(chain)) { basechain = nft_base_chain(chain); @@ -301,7 +301,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; return -EOPNOTSUPP; -@@ -5863,8 +5849,7 @@ int __nft_release_basechain(struct nft_c +@@ -5857,8 +5843,7 @@ int __nft_release_basechain(struct nft_c BUG_ON(!nft_is_base_chain(ctx->chain)); @@ -311,7 +311,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { list_del(&rule->list); ctx->chain->use--; -@@ -5893,8 +5878,7 @@ static void __nft_release_afinfo(struct +@@ -5887,8 +5872,7 @@ static void __nft_release_afinfo(struct list_for_each_entry_safe(table, nt, &afi->tables, list) { list_for_each_entry(chain, &table->chains, list) @@ -379,7 +379,7 @@ Signed-off-by: Pablo Neira Ayuso par->hook_mask = 1 << ops->hooknum; } else { -@@ -564,7 +564,7 @@ static int nft_match_validate(const stru +@@ -565,7 +565,7 @@ static int nft_match_validate(const stru if (nft_is_base_chain(ctx->chain)) { const struct nft_base_chain *basechain = nft_base_chain(ctx->chain); diff --git a/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch b/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch index 458ddd41723..a73256a2c92 100644 --- a/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch +++ b/target/linux/generic/backport-4.14/304-v4.16-netfilter-move-checksum-indirection-to-struct-nf_ipv.patch @@ -116,7 +116,7 @@ Signed-off-by: Pablo Neira Ayuso .saveroute = nf_ip_saveroute, --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -193,12 +193,12 @@ static __sum16 nf_ip6_checksum_partial(s +@@ -194,12 +194,12 @@ static __sum16 nf_ip6_checksum_partial(s static const struct nf_ipv6_ops ipv6ops = { .chk_addr = ipv6_chk_addr, .route_input = ip6_route_input, diff --git a/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch b/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch index 19a0aacb45b..6ef0928257b 100644 --- a/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch +++ b/target/linux/generic/backport-4.14/305-v4.16-netfilter-move-checksum_partial-indirection-to-struc.patch @@ -151,7 +151,7 @@ Signed-off-by: Pablo Neira Ayuso .reroute = nf_ip_reroute, --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -191,15 +191,15 @@ static __sum16 nf_ip6_checksum_partial(s +@@ -192,15 +192,15 @@ static __sum16 nf_ip6_checksum_partial(s }; static const struct nf_ipv6_ops ipv6ops = { diff --git a/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch b/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch index 75de3c84fef..2b44066f1aa 100644 --- a/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch +++ b/target/linux/generic/backport-4.14/306-v4.16-netfilter-remove-saveroute-indirection-in-struct-nf_.patch @@ -125,7 +125,7 @@ Signed-off-by: Pablo Neira Ayuso }; --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -69,31 +69,6 @@ int ip6_route_me_harder(struct net *net, +@@ -70,31 +70,6 @@ int ip6_route_me_harder(struct net *net, } EXPORT_SYMBOL(ip6_route_me_harder); @@ -157,7 +157,7 @@ Signed-off-by: Pablo Neira Ayuso static int nf_ip6_reroute(struct net *net, struct sk_buff *skb, const struct nf_queue_entry *entry) { -@@ -201,7 +176,6 @@ static const struct nf_ipv6_ops ipv6ops +@@ -202,7 +177,6 @@ static const struct nf_ipv6_ops ipv6ops static const struct nf_afinfo nf_ip6_afinfo = { .family = AF_INET6, .route = nf_ip6_route, diff --git a/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch b/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch index b98aac0fff6..eb3e29349a3 100644 --- a/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch +++ b/target/linux/generic/backport-4.14/307-v4.16-netfilter-move-route-indirection-to-struct-nf_ipv6_o.patch @@ -114,7 +114,7 @@ Signed-off-by: Pablo Neira Ayuso }; --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -171,11 +171,11 @@ static const struct nf_ipv6_ops ipv6ops +@@ -172,11 +172,11 @@ static const struct nf_ipv6_ops ipv6ops .fragment = ip6_fragment, .checksum = nf_ip6_checksum, .checksum_partial = nf_ip6_checksum_partial, diff --git a/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch b/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch index 5dbd1a4cea5..d45c4ef85b6 100644 --- a/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch +++ b/target/linux/generic/backport-4.14/308-v4.16-netfilter-move-reroute-indirection-to-struct-nf_ipv6.patch @@ -138,7 +138,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -69,7 +69,7 @@ int ip6_route_me_harder(struct net *net, +@@ -70,7 +70,7 @@ int ip6_route_me_harder(struct net *net, } EXPORT_SYMBOL(ip6_route_me_harder); @@ -147,7 +147,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nf_queue_entry *entry) { struct ip6_rt_info *rt_info = nf_queue_entry_reroute(entry); -@@ -79,7 +79,7 @@ static int nf_ip6_reroute(struct net *ne +@@ -80,7 +80,7 @@ static int nf_ip6_reroute(struct net *ne if (!ipv6_addr_equal(&iph->daddr, &rt_info->daddr) || !ipv6_addr_equal(&iph->saddr, &rt_info->saddr) || skb->mark != rt_info->mark) @@ -156,7 +156,7 @@ Signed-off-by: Pablo Neira Ayuso } return 0; } -@@ -172,11 +172,11 @@ static const struct nf_ipv6_ops ipv6ops +@@ -173,11 +173,11 @@ static const struct nf_ipv6_ops ipv6ops .checksum = nf_ip6_checksum, .checksum_partial = nf_ip6_checksum_partial, .route = nf_ip6_route, diff --git a/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch b/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch index 21381b7e6b5..270379346a4 100644 --- a/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch +++ b/target/linux/generic/backport-4.14/309-v4.16-netfilter-remove-route_key_size-field-in-struct-nf_a.patch @@ -29,7 +29,7 @@ Signed-off-by: Pablo Neira Ayuso static int __init ipv4_netfilter_init(void) --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -177,7 +177,6 @@ static const struct nf_ipv6_ops ipv6ops +@@ -178,7 +178,6 @@ static const struct nf_ipv6_ops ipv6ops static const struct nf_afinfo nf_ip6_afinfo = { .family = AF_INET6, diff --git a/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch b/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch index 0ca58f99885..381b99721a4 100644 --- a/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch +++ b/target/linux/generic/backport-4.14/310-v4.16-netfilter-remove-struct-nf_afinfo-and-its-helper-fun.patch @@ -102,7 +102,7 @@ Signed-off-by: Pablo Neira Ayuso -subsys_initcall(ipv4_netfilter_init); --- a/net/ipv6/netfilter.c +++ b/net/ipv6/netfilter.c -@@ -175,14 +175,10 @@ static const struct nf_ipv6_ops ipv6ops +@@ -176,14 +176,10 @@ static const struct nf_ipv6_ops ipv6ops .reroute = nf_ip6_reroute, }; @@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso } /* This can be called from inet6_init() on errors, so it cannot -@@ -191,5 +187,4 @@ int __init ipv6_netfilter_init(void) +@@ -192,5 +188,4 @@ int __init ipv6_netfilter_init(void) void ipv6_netfilter_fini(void) { RCU_INIT_POINTER(nf_ipv6_ops, NULL); diff --git a/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch b/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch index 1c16bbae4e0..f573d53b265 100644 --- a/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch +++ b/target/linux/generic/backport-4.14/321-v4.16-netfilter-nf_tables-add-flow-table-netlink-frontend.patch @@ -292,7 +292,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) { err = nft_delobj(ctx, obj); if (err < 0) -@@ -4835,6 +4879,605 @@ static void nf_tables_obj_notify(const s +@@ -4829,6 +4873,605 @@ static void nf_tables_obj_notify(const s ctx->afi->family, ctx->report, GFP_KERNEL); } @@ -898,7 +898,7 @@ Signed-off-by: Pablo Neira Ayuso static int nf_tables_fill_gen_info(struct sk_buff *skb, struct net *net, u32 portid, u32 seq) { -@@ -4865,6 +5508,49 @@ nla_put_failure: +@@ -4859,6 +5502,49 @@ nla_put_failure: return -EMSGSIZE; } @@ -948,7 +948,7 @@ Signed-off-by: Pablo Neira Ayuso static void nf_tables_gen_notify(struct net *net, struct sk_buff *skb, int event) { -@@ -5017,6 +5703,21 @@ static const struct nfnl_callback nf_tab +@@ -5011,6 +5697,21 @@ static const struct nfnl_callback nf_tab .attr_count = NFTA_OBJ_MAX, .policy = nft_obj_policy, }, @@ -970,7 +970,7 @@ Signed-off-by: Pablo Neira Ayuso }; static void nft_chain_commit_update(struct nft_trans *trans) -@@ -5065,6 +5766,9 @@ static void nf_tables_commit_release(str +@@ -5059,6 +5760,9 @@ static void nf_tables_commit_release(str case NFT_MSG_DELOBJ: nft_obj_destroy(nft_trans_obj(trans)); break; @@ -980,7 +980,7 @@ Signed-off-by: Pablo Neira Ayuso } kfree(trans); } -@@ -5184,6 +5888,21 @@ static int nf_tables_commit(struct net * +@@ -5178,6 +5882,21 @@ static int nf_tables_commit(struct net * nf_tables_obj_notify(&trans->ctx, nft_trans_obj(trans), NFT_MSG_DELOBJ); break; @@ -1002,7 +1002,7 @@ Signed-off-by: Pablo Neira Ayuso } } -@@ -5221,6 +5940,9 @@ static void nf_tables_abort_release(stru +@@ -5215,6 +5934,9 @@ static void nf_tables_abort_release(stru case NFT_MSG_NEWOBJ: nft_obj_destroy(nft_trans_obj(trans)); break; @@ -1012,7 +1012,7 @@ Signed-off-by: Pablo Neira Ayuso } kfree(trans); } -@@ -5312,6 +6034,17 @@ static int nf_tables_abort(struct net *n +@@ -5306,6 +6028,17 @@ static int nf_tables_abort(struct net *n nft_clear(trans->ctx.net, nft_trans_obj(trans)); nft_trans_destroy(trans); break; @@ -1030,7 +1030,7 @@ Signed-off-by: Pablo Neira Ayuso } } -@@ -5862,6 +6595,7 @@ EXPORT_SYMBOL_GPL(__nft_release_basechai +@@ -5856,6 +6589,7 @@ EXPORT_SYMBOL_GPL(__nft_release_basechai /* Called by nft_unregister_afinfo() from __net_exit path, nfnl_lock is held. */ static void __nft_release_afinfo(struct net *net, struct nft_af_info *afi) { @@ -1038,7 +1038,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table, *nt; struct nft_chain *chain, *nc; struct nft_object *obj, *ne; -@@ -5875,6 +6609,9 @@ static void __nft_release_afinfo(struct +@@ -5869,6 +6603,9 @@ static void __nft_release_afinfo(struct list_for_each_entry_safe(table, nt, &afi->tables, list) { list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); @@ -1048,7 +1048,7 @@ Signed-off-by: Pablo Neira Ayuso /* No packets are walking on these chains anymore. */ ctx.table = table; list_for_each_entry(chain, &table->chains, list) { -@@ -5885,6 +6622,11 @@ static void __nft_release_afinfo(struct +@@ -5879,6 +6616,11 @@ static void __nft_release_afinfo(struct nf_tables_rule_release(&ctx, rule); } } @@ -1060,7 +1060,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_safe(set, ns, &table->sets, list) { list_del(&set->list); table->use--; -@@ -5928,6 +6670,8 @@ static int __init nf_tables_module_init( +@@ -5922,6 +6664,8 @@ static int __init nf_tables_module_init( if (err < 0) goto err3; @@ -1069,7 +1069,7 @@ Signed-off-by: Pablo Neira Ayuso pr_info("nf_tables: (c) 2007-2009 Patrick McHardy \n"); return register_pernet_subsys(&nf_tables_net_ops); err3: -@@ -5942,6 +6686,7 @@ static void __exit nf_tables_module_exit +@@ -5936,6 +6680,7 @@ static void __exit nf_tables_module_exit { unregister_pernet_subsys(&nf_tables_net_ops); nfnetlink_subsys_unregister(&nf_tables_subsys); diff --git a/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch b/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch index 7d13a594242..af812248838 100644 --- a/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch +++ b/target/linux/generic/backport-4.14/327-v4.16-netfilter-nf_tables-remove-nhooks-field-from-struct-.patch @@ -82,7 +82,7 @@ Signed-off-by: Pablo Neira Ayuso hook->priority = ntohl(nla_get_be32(ha[NFTA_HOOK_PRIORITY])); type = chain_type[afi->family][NFT_CHAIN_T_DEFAULT]; -@@ -4987,7 +4984,7 @@ static int nf_tables_flowtable_parse_hoo +@@ -4981,7 +4978,7 @@ static int nf_tables_flowtable_parse_hoo return -EINVAL; hooknum = ntohl(nla_get_be32(tb[NFTA_FLOWTABLE_HOOK_NUM])); diff --git a/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch b/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch index 62bca051104..4ea9cf6c89b 100644 --- a/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch +++ b/target/linux/generic/backport-4.14/328-v4.16-netfilter-nf_tables-fix-a-typo-in-nf_tables_getflowt.patch @@ -11,7 +11,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5411,7 +5411,7 @@ static int nf_tables_getflowtable(struct +@@ -5405,7 +5405,7 @@ static int nf_tables_getflowtable(struct flowtable = nf_tables_flowtable_lookup(table, nla[NFTA_FLOWTABLE_NAME], genmask); diff --git a/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch b/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch index 35c75a201ee..29404cff63d 100644 --- a/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch +++ b/target/linux/generic/backport-4.14/331-v4.16-netfilter-nf_tables-no-need-for-struct-nft_af_info-t.patch @@ -62,7 +62,7 @@ Signed-off-by: Pablo Neira Ayuso if (ret >= 0) { ctx->table->flags &= ~NFT_TABLE_F_DORMANT; nft_trans_table_enable(trans) = true; -@@ -5792,7 +5785,6 @@ static int nf_tables_commit(struct net * +@@ -5786,7 +5779,6 @@ static int nf_tables_commit(struct net * if (nft_trans_table_update(trans)) { if (!nft_trans_table_enable(trans)) { nf_tables_table_disable(net, @@ -70,7 +70,7 @@ Signed-off-by: Pablo Neira Ayuso trans->ctx.table); trans->ctx.table->flags |= NFT_TABLE_F_DORMANT; } -@@ -5956,7 +5948,6 @@ static int nf_tables_abort(struct net *n +@@ -5950,7 +5942,6 @@ static int nf_tables_abort(struct net *n if (nft_trans_table_update(trans)) { if (nft_trans_table_enable(trans)) { nf_tables_table_disable(net, diff --git a/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch b/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch index d140a335186..bc6810bdd2c 100644 --- a/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch +++ b/target/linux/generic/backport-4.14/334-v4.15-netfilter-nf_tables-fix-potential-NULL-ptr-deref-in-.patch @@ -15,7 +15,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5330,8 +5330,10 @@ static int nf_tables_dump_flowtable_done +@@ -5324,8 +5324,10 @@ static int nf_tables_dump_flowtable_done if (!filter) return 0; diff --git a/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch b/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch index 59ec44a4823..e08b9b26d5b 100644 --- a/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch +++ b/target/linux/generic/backport-4.14/335-v4.16-netfilter-nf_tables-add-single-table-list-for-all-fa.patch @@ -615,7 +615,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -2322,7 +2317,8 @@ static int nf_tables_newrule(struct net +@@ -2323,7 +2318,8 @@ static int nf_tables_newrule(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -625,7 +625,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -2361,7 +2357,7 @@ static int nf_tables_newrule(struct net +@@ -2362,7 +2358,7 @@ static int nf_tables_newrule(struct net return PTR_ERR(old_rule); } @@ -634,7 +634,7 @@ Signed-off-by: Pablo Neira Ayuso n = 0; size = 0; -@@ -2501,7 +2497,8 @@ static int nf_tables_delrule(struct net +@@ -2495,7 +2491,8 @@ static int nf_tables_delrule(struct net if (IS_ERR(afi)) return PTR_ERR(afi); @@ -644,7 +644,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -2512,7 +2509,7 @@ static int nf_tables_delrule(struct net +@@ -2506,7 +2503,7 @@ static int nf_tables_delrule(struct net return PTR_ERR(chain); } @@ -653,7 +653,7 @@ Signed-off-by: Pablo Neira Ayuso if (chain) { if (nla[NFTA_RULE_HANDLE]) { -@@ -2710,13 +2707,13 @@ static int nft_ctx_init_from_setattr(str +@@ -2704,13 +2701,13 @@ static int nft_ctx_init_from_setattr(str if (afi == NULL) return -EAFNOSUPPORT; @@ -670,7 +670,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -2844,7 +2841,7 @@ static int nf_tables_fill_set(struct sk_ +@@ -2838,7 +2835,7 @@ static int nf_tables_fill_set(struct sk_ goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -679,7 +679,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(ctx->net->nft.base_seq & 0xffff); -@@ -2936,10 +2933,8 @@ static int nf_tables_dump_sets(struct sk +@@ -2930,10 +2927,8 @@ static int nf_tables_dump_sets(struct sk { const struct nft_set *set; unsigned int idx, s_idx = cb->args[0]; @@ -690,7 +690,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_ctx *ctx = cb->data, ctx_set; if (cb->args[1]) -@@ -2948,51 +2943,44 @@ static int nf_tables_dump_sets(struct sk +@@ -2942,51 +2937,44 @@ static int nf_tables_dump_sets(struct sk rcu_read_lock(); cb->seq = net->nft.base_seq; @@ -771,7 +771,7 @@ Signed-off-by: Pablo Neira Ayuso } cb->args[1] = 1; done: -@@ -3202,11 +3190,12 @@ static int nf_tables_newset(struct net * +@@ -3196,11 +3184,12 @@ static int nf_tables_newset(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -786,7 +786,7 @@ Signed-off-by: Pablo Neira Ayuso set = nf_tables_set_lookup(table, nla[NFTA_SET_NAME], genmask); if (IS_ERR(set)) { -@@ -3475,12 +3464,12 @@ static int nft_ctx_init_from_elemattr(st +@@ -3469,12 +3458,12 @@ static int nft_ctx_init_from_elemattr(st if (IS_ERR(afi)) return PTR_ERR(afi); @@ -802,7 +802,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -3585,7 +3574,6 @@ static int nf_tables_dump_set(struct sk_ +@@ -3579,7 +3568,6 @@ static int nf_tables_dump_set(struct sk_ { struct nft_set_dump_ctx *dump_ctx = cb->data; struct net *net = sock_net(skb->sk); @@ -810,7 +810,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_set *set; struct nft_set_dump_args args; -@@ -3597,21 +3585,19 @@ static int nf_tables_dump_set(struct sk_ +@@ -3591,21 +3579,19 @@ static int nf_tables_dump_set(struct sk_ int event; rcu_read_lock(); @@ -841,7 +841,7 @@ Signed-off-by: Pablo Neira Ayuso } break; } -@@ -3631,7 +3617,7 @@ static int nf_tables_dump_set(struct sk_ +@@ -3625,7 +3611,7 @@ static int nf_tables_dump_set(struct sk_ goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -850,7 +850,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(net->nft.base_seq & 0xffff); -@@ -3733,7 +3719,7 @@ static int nf_tables_fill_setelem_info(s +@@ -3727,7 +3713,7 @@ static int nf_tables_fill_setelem_info(s goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -859,7 +859,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(ctx->net->nft.base_seq & 0xffff); -@@ -3977,7 +3963,7 @@ static int nft_add_set_elem(struct nft_c +@@ -3971,7 +3957,7 @@ static int nft_add_set_elem(struct nft_c list_for_each_entry(binding, &set->bindings, list) { struct nft_ctx bind_ctx = { .net = ctx->net, @@ -868,7 +868,7 @@ Signed-off-by: Pablo Neira Ayuso .table = ctx->table, .chain = (struct nft_chain *)binding->chain, }; -@@ -4527,7 +4513,8 @@ static int nf_tables_newobj(struct net * +@@ -4521,7 +4507,8 @@ static int nf_tables_newobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -878,7 +878,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4545,7 +4532,7 @@ static int nf_tables_newobj(struct net * +@@ -4539,7 +4526,7 @@ static int nf_tables_newobj(struct net * return 0; } @@ -887,7 +887,7 @@ Signed-off-by: Pablo Neira Ayuso type = nft_obj_type_get(objtype); if (IS_ERR(type)) -@@ -4622,7 +4609,6 @@ struct nft_obj_filter { +@@ -4616,7 +4603,6 @@ struct nft_obj_filter { static int nf_tables_dump_obj(struct sk_buff *skb, struct netlink_callback *cb) { const struct nfgenmsg *nfmsg = nlmsg_data(cb->nlh); @@ -895,7 +895,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; unsigned int idx = 0, s_idx = cb->args[0]; struct nft_obj_filter *filter = cb->data; -@@ -4637,38 +4623,37 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4631,38 +4617,37 @@ static int nf_tables_dump_obj(struct sk_ rcu_read_lock(); cb->seq = net->nft.base_seq; @@ -960,7 +960,7 @@ Signed-off-by: Pablo Neira Ayuso } } done: -@@ -4755,7 +4740,8 @@ static int nf_tables_getobj(struct net * +@@ -4749,7 +4734,8 @@ static int nf_tables_getobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -970,7 +970,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4815,7 +4801,8 @@ static int nf_tables_delobj(struct net * +@@ -4809,7 +4795,8 @@ static int nf_tables_delobj(struct net * if (IS_ERR(afi)) return PTR_ERR(afi); @@ -980,7 +980,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -4826,7 +4813,7 @@ static int nf_tables_delobj(struct net * +@@ -4820,7 +4807,7 @@ static int nf_tables_delobj(struct net * if (obj->use > 0) return -EBUSY; @@ -989,7 +989,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delobj(&ctx, obj); } -@@ -4864,7 +4851,7 @@ static void nf_tables_obj_notify(const s +@@ -4858,7 +4845,7 @@ static void nf_tables_obj_notify(const s struct nft_object *obj, int event) { nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event, @@ -998,7 +998,7 @@ Signed-off-by: Pablo Neira Ayuso } /* -@@ -5054,7 +5041,7 @@ void nft_flow_table_iterate(struct net * +@@ -5048,7 +5035,7 @@ void nft_flow_table_iterate(struct net * rcu_read_lock(); list_for_each_entry_rcu(afi, &net->nft.af_info, list) { @@ -1007,7 +1007,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry_rcu(flowtable, &table->flowtables, list) { iter(&flowtable->data, data); } -@@ -5102,7 +5089,8 @@ static int nf_tables_newflowtable(struct +@@ -5096,7 +5083,8 @@ static int nf_tables_newflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1017,7 +1017,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5119,7 +5107,7 @@ static int nf_tables_newflowtable(struct +@@ -5113,7 +5101,7 @@ static int nf_tables_newflowtable(struct return 0; } @@ -1026,7 +1026,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL); if (!flowtable) -@@ -5200,7 +5188,8 @@ static int nf_tables_delflowtable(struct +@@ -5194,7 +5182,8 @@ static int nf_tables_delflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1036,7 +1036,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5211,7 +5200,7 @@ static int nf_tables_delflowtable(struct +@@ -5205,7 +5194,7 @@ static int nf_tables_delflowtable(struct if (flowtable->use > 0) return -EBUSY; @@ -1045,7 +1045,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delflowtable(&ctx, flowtable); } -@@ -5280,40 +5269,37 @@ static int nf_tables_dump_flowtable(stru +@@ -5274,40 +5263,37 @@ static int nf_tables_dump_flowtable(stru struct net *net = sock_net(skb->sk); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1107,7 +1107,7 @@ Signed-off-by: Pablo Neira Ayuso } } done: -@@ -5398,7 +5384,8 @@ static int nf_tables_getflowtable(struct +@@ -5392,7 +5378,8 @@ static int nf_tables_getflowtable(struct if (IS_ERR(afi)) return PTR_ERR(afi); @@ -1117,7 +1117,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5441,7 +5428,7 @@ static void nf_tables_flowtable_notify(s +@@ -5435,7 +5422,7 @@ static void nf_tables_flowtable_notify(s err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid, ctx->seq, event, 0, @@ -1126,7 +1126,7 @@ Signed-off-by: Pablo Neira Ayuso if (err < 0) { kfree_skb(skb); goto err; -@@ -5519,17 +5506,14 @@ static int nf_tables_flowtable_event(str +@@ -5513,17 +5500,14 @@ static int nf_tables_flowtable_event(str struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct nft_flowtable *flowtable; struct nft_table *table; @@ -1147,7 +1147,7 @@ Signed-off-by: Pablo Neira Ayuso } } nfnl_unlock(NFNL_SUBSYS_NFTABLES); -@@ -6555,6 +6539,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump); +@@ -6549,6 +6533,7 @@ EXPORT_SYMBOL_GPL(nft_data_dump); static int __net_init nf_tables_init_net(struct net *net) { INIT_LIST_HEAD(&net->nft.af_info); @@ -1155,7 +1155,7 @@ Signed-off-by: Pablo Neira Ayuso INIT_LIST_HEAD(&net->nft.commit_list); net->nft.base_seq = 1; return 0; -@@ -6591,10 +6576,10 @@ static void __nft_release_afinfo(struct +@@ -6585,10 +6570,10 @@ static void __nft_release_afinfo(struct struct nft_set *set, *ns; struct nft_ctx ctx = { .net = net, @@ -1255,7 +1255,7 @@ Signed-off-by: Pablo Neira Ayuso par->nft_compat = true; } -@@ -502,7 +502,7 @@ __nft_match_destroy(const struct nft_ctx +@@ -503,7 +503,7 @@ __nft_match_destroy(const struct nft_ctx par.net = ctx->net; par.match = match; par.matchinfo = info; @@ -1264,7 +1264,7 @@ Signed-off-by: Pablo Neira Ayuso if (par.match->destroy != NULL) par.match->destroy(&par); -@@ -732,7 +732,7 @@ nft_match_select_ops(const struct nft_ct +@@ -733,7 +733,7 @@ nft_match_select_ops(const struct nft_ct mt_name = nla_data(tb[NFTA_MATCH_NAME]); rev = ntohl(nla_get_be32(tb[NFTA_MATCH_REV])); @@ -1273,7 +1273,7 @@ Signed-off-by: Pablo Neira Ayuso /* Re-use the existing match if it's already loaded. */ list_for_each_entry(nft_match, &nft_match_list, head) { -@@ -823,7 +823,7 @@ nft_target_select_ops(const struct nft_c +@@ -824,7 +824,7 @@ nft_target_select_ops(const struct nft_c tg_name = nla_data(tb[NFTA_TARGET_NAME]); rev = ntohl(nla_get_be32(tb[NFTA_TARGET_REV])); diff --git a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch index 5938a9ba5a8..e20ddc2917a 100644 --- a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch +++ b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch @@ -21,7 +21,7 @@ Signed-off-by: Pablo Neira Ayuso static struct pernet_operations clusterip_net_ops = { --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -6545,6 +6545,12 @@ static int __net_init nf_tables_init_net +@@ -6539,6 +6539,12 @@ static int __net_init nf_tables_init_net return 0; } @@ -34,7 +34,7 @@ Signed-off-by: Pablo Neira Ayuso int __nft_release_basechain(struct nft_ctx *ctx) { struct nft_rule *rule, *nr; -@@ -6622,6 +6628,7 @@ static void __nft_release_afinfo(struct +@@ -6616,6 +6622,7 @@ static void __nft_release_afinfo(struct static struct pernet_operations nf_tables_net_ops = { .init = nf_tables_init_net, diff --git a/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch b/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch index de5c2409b3c..2274c1327d9 100644 --- a/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch +++ b/target/linux/generic/backport-4.14/337-v4.16-netfilter-nf_tables-get-rid-of-pernet-families.patch @@ -364,7 +364,7 @@ Signed-off-by: Pablo Neira Ayuso if (afi->family == family) return afi; } -@@ -5036,15 +5034,12 @@ void nft_flow_table_iterate(struct net * +@@ -5030,15 +5028,12 @@ void nft_flow_table_iterate(struct net * void *data) { struct nft_flowtable *flowtable; @@ -383,7 +383,7 @@ Signed-off-by: Pablo Neira Ayuso } } rcu_read_unlock(); -@@ -6536,21 +6531,6 @@ int nft_data_dump(struct sk_buff *skb, i +@@ -6530,21 +6525,6 @@ int nft_data_dump(struct sk_buff *skb, i } EXPORT_SYMBOL_GPL(nft_data_dump); @@ -405,7 +405,7 @@ Signed-off-by: Pablo Neira Ayuso int __nft_release_basechain(struct nft_ctx *ctx) { struct nft_rule *rule, *nr; -@@ -6571,8 +6551,7 @@ int __nft_release_basechain(struct nft_c +@@ -6565,8 +6545,7 @@ int __nft_release_basechain(struct nft_c } EXPORT_SYMBOL_GPL(__nft_release_basechain); @@ -415,7 +415,7 @@ Signed-off-by: Pablo Neira Ayuso { struct nft_flowtable *flowtable, *nf; struct nft_table *table, *nt; -@@ -6582,10 +6561,11 @@ static void __nft_release_afinfo(struct +@@ -6576,10 +6555,11 @@ static void __nft_release_afinfo(struct struct nft_set *set, *ns; struct nft_ctx ctx = { .net = net, @@ -428,7 +428,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); list_for_each_entry(flowtable, &table->flowtables, list) -@@ -6626,6 +6606,21 @@ static void __nft_release_afinfo(struct +@@ -6620,6 +6600,21 @@ static void __nft_release_afinfo(struct } } diff --git a/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch b/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch index e5ed45c1c6b..fd19ffad5a5 100644 --- a/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch +++ b/target/linux/generic/backport-4.14/338-v4.16-netfilter-nf_tables-get-rid-of-struct-nft_af_info-ab.patch @@ -639,7 +639,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -2295,7 +2188,7 @@ static int nf_tables_newrule(struct net +@@ -2296,7 +2189,7 @@ static int nf_tables_newrule(struct net { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -648,7 +648,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_chain *chain; struct nft_rule *rule, *old_rule = NULL; -@@ -2311,11 +2204,7 @@ static int nf_tables_newrule(struct net +@@ -2312,11 +2205,7 @@ static int nf_tables_newrule(struct net create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false; @@ -661,7 +661,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -2355,7 +2244,7 @@ static int nf_tables_newrule(struct net +@@ -2356,7 +2245,7 @@ static int nf_tables_newrule(struct net return PTR_ERR(old_rule); } @@ -670,7 +670,7 @@ Signed-off-by: Pablo Neira Ayuso n = 0; size = 0; -@@ -2484,18 +2373,13 @@ static int nf_tables_delrule(struct net +@@ -2478,18 +2367,13 @@ static int nf_tables_delrule(struct net { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -690,7 +690,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -2507,7 +2391,7 @@ static int nf_tables_delrule(struct net +@@ -2501,7 +2385,7 @@ static int nf_tables_delrule(struct net return PTR_ERR(chain); } @@ -699,7 +699,7 @@ Signed-off-by: Pablo Neira Ayuso if (chain) { if (nla[NFTA_RULE_HANDLE]) { -@@ -2692,26 +2576,17 @@ static int nft_ctx_init_from_setattr(str +@@ -2686,26 +2570,17 @@ static int nft_ctx_init_from_setattr(str u8 genmask) { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); @@ -729,7 +729,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -2943,7 +2818,7 @@ static int nf_tables_dump_sets(struct sk +@@ -2937,7 +2812,7 @@ static int nf_tables_dump_sets(struct sk list_for_each_entry_rcu(table, &net->nft.tables, list) { if (ctx->family != NFPROTO_UNSPEC && @@ -738,7 +738,7 @@ Signed-off-by: Pablo Neira Ayuso continue; if (ctx->table && ctx->table != table) -@@ -2964,7 +2839,7 @@ static int nf_tables_dump_sets(struct sk +@@ -2958,7 +2833,7 @@ static int nf_tables_dump_sets(struct sk ctx_set = *ctx; ctx_set.table = table; @@ -747,7 +747,7 @@ Signed-off-by: Pablo Neira Ayuso if (nf_tables_fill_set(skb, &ctx_set, set, NFT_MSG_NEWSET, -@@ -3076,8 +2951,8 @@ static int nf_tables_newset(struct net * +@@ -3070,8 +2945,8 @@ static int nf_tables_newset(struct net * { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); @@ -757,7 +757,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_set *set; struct nft_ctx ctx; -@@ -3184,16 +3059,12 @@ static int nf_tables_newset(struct net * +@@ -3178,16 +3053,12 @@ static int nf_tables_newset(struct net * create = nlh->nlmsg_flags & NLM_F_CREATE ? true : false; @@ -776,7 +776,7 @@ Signed-off-by: Pablo Neira Ayuso set = nf_tables_set_lookup(table, nla[NFTA_SET_NAME], genmask); if (IS_ERR(set)) { -@@ -3455,19 +3326,15 @@ static int nft_ctx_init_from_elemattr(st +@@ -3449,19 +3320,15 @@ static int nft_ctx_init_from_elemattr(st u8 genmask) { const struct nfgenmsg *nfmsg = nlmsg_data(nlh); @@ -799,7 +799,7 @@ Signed-off-by: Pablo Neira Ayuso return 0; } -@@ -3585,7 +3452,7 @@ static int nf_tables_dump_set(struct sk_ +@@ -3579,7 +3446,7 @@ static int nf_tables_dump_set(struct sk_ rcu_read_lock(); list_for_each_entry_rcu(table, &net->nft.tables, list) { if (dump_ctx->ctx.family != NFPROTO_UNSPEC && @@ -808,7 +808,7 @@ Signed-off-by: Pablo Neira Ayuso continue; if (table != dump_ctx->ctx.table) -@@ -3615,7 +3482,7 @@ static int nf_tables_dump_set(struct sk_ +@@ -3609,7 +3476,7 @@ static int nf_tables_dump_set(struct sk_ goto nla_put_failure; nfmsg = nlmsg_data(nlh); @@ -817,7 +817,7 @@ Signed-off-by: Pablo Neira Ayuso nfmsg->version = NFNETLINK_V0; nfmsg->res_id = htons(net->nft.base_seq & 0xffff); -@@ -4495,7 +4362,6 @@ static int nf_tables_newobj(struct net * +@@ -4489,7 +4356,6 @@ static int nf_tables_newobj(struct net * const struct nft_object_type *type; u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -825,7 +825,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_object *obj; struct nft_ctx ctx; -@@ -4507,11 +4373,7 @@ static int nf_tables_newobj(struct net * +@@ -4501,11 +4367,7 @@ static int nf_tables_newobj(struct net * !nla[NFTA_OBJ_DATA]) return -EINVAL; @@ -838,7 +838,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4530,7 +4392,7 @@ static int nf_tables_newobj(struct net * +@@ -4524,7 +4386,7 @@ static int nf_tables_newobj(struct net * return 0; } @@ -847,7 +847,7 @@ Signed-off-by: Pablo Neira Ayuso type = nft_obj_type_get(objtype); if (IS_ERR(type)) -@@ -4622,7 +4484,7 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4616,7 +4478,7 @@ static int nf_tables_dump_obj(struct sk_ cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -856,7 +856,7 @@ Signed-off-by: Pablo Neira Ayuso continue; list_for_each_entry_rcu(obj, &table->objects, list) { -@@ -4645,7 +4507,7 @@ static int nf_tables_dump_obj(struct sk_ +@@ -4639,7 +4501,7 @@ static int nf_tables_dump_obj(struct sk_ cb->nlh->nlmsg_seq, NFT_MSG_NEWOBJ, NLM_F_MULTI | NLM_F_APPEND, @@ -865,7 +865,7 @@ Signed-off-by: Pablo Neira Ayuso obj, reset) < 0) goto done; -@@ -4703,7 +4565,6 @@ static int nf_tables_getobj(struct net * +@@ -4697,7 +4559,6 @@ static int nf_tables_getobj(struct net * const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_cur(net); int family = nfmsg->nfgen_family; @@ -873,7 +873,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; struct nft_object *obj; struct sk_buff *skb2; -@@ -4734,11 +4595,7 @@ static int nf_tables_getobj(struct net * +@@ -4728,11 +4589,7 @@ static int nf_tables_getobj(struct net * !nla[NFTA_OBJ_TYPE]) return -EINVAL; @@ -886,7 +886,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4785,7 +4642,6 @@ static int nf_tables_delobj(struct net * +@@ -4779,7 +4636,6 @@ static int nf_tables_delobj(struct net * const struct nfgenmsg *nfmsg = nlmsg_data(nlh); u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; @@ -894,7 +894,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_object *obj; struct nft_ctx ctx; -@@ -4795,11 +4651,7 @@ static int nf_tables_delobj(struct net * +@@ -4789,11 +4645,7 @@ static int nf_tables_delobj(struct net * !nla[NFTA_OBJ_NAME]) return -EINVAL; @@ -907,7 +907,7 @@ Signed-off-by: Pablo Neira Ayuso genmask); if (IS_ERR(table)) return PTR_ERR(table); -@@ -4811,7 +4663,7 @@ static int nf_tables_delobj(struct net * +@@ -4805,7 +4657,7 @@ static int nf_tables_delobj(struct net * if (obj->use > 0) return -EBUSY; @@ -916,7 +916,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delobj(&ctx, obj); } -@@ -4996,33 +4848,31 @@ err1: +@@ -4990,33 +4842,31 @@ err1: return err; } @@ -956,7 +956,7 @@ Signed-off-by: Pablo Neira Ayuso return ERR_PTR(-EAGAIN); } #endif -@@ -5070,7 +4920,6 @@ static int nf_tables_newflowtable(struct +@@ -5064,7 +4914,6 @@ static int nf_tables_newflowtable(struct u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -964,7 +964,7 @@ Signed-off-by: Pablo Neira Ayuso struct nft_table *table; struct nft_ctx ctx; int err, i, k; -@@ -5080,12 +4929,8 @@ static int nf_tables_newflowtable(struct +@@ -5074,12 +4923,8 @@ static int nf_tables_newflowtable(struct !nla[NFTA_FLOWTABLE_HOOK]) return -EINVAL; @@ -978,7 +978,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5102,7 +4947,7 @@ static int nf_tables_newflowtable(struct +@@ -5096,7 +4941,7 @@ static int nf_tables_newflowtable(struct return 0; } @@ -987,7 +987,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable = kzalloc(sizeof(*flowtable), GFP_KERNEL); if (!flowtable) -@@ -5115,7 +4960,7 @@ static int nf_tables_newflowtable(struct +@@ -5109,7 +4954,7 @@ static int nf_tables_newflowtable(struct goto err1; } @@ -996,7 +996,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(type)) { err = PTR_ERR(type); goto err2; -@@ -5175,16 +5020,11 @@ static int nf_tables_delflowtable(struct +@@ -5169,16 +5014,11 @@ static int nf_tables_delflowtable(struct u8 genmask = nft_genmask_next(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1014,7 +1014,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -5195,7 +5035,7 @@ static int nf_tables_delflowtable(struct +@@ -5189,7 +5029,7 @@ static int nf_tables_delflowtable(struct if (flowtable->use > 0) return -EBUSY; @@ -1023,7 +1023,7 @@ Signed-off-by: Pablo Neira Ayuso return nft_delflowtable(&ctx, flowtable); } -@@ -5270,7 +5110,7 @@ static int nf_tables_dump_flowtable(stru +@@ -5264,7 +5104,7 @@ static int nf_tables_dump_flowtable(stru cb->seq = net->nft.base_seq; list_for_each_entry_rcu(table, &net->nft.tables, list) { @@ -1032,7 +1032,7 @@ Signed-off-by: Pablo Neira Ayuso continue; list_for_each_entry_rcu(flowtable, &table->flowtables, list) { -@@ -5289,7 +5129,7 @@ static int nf_tables_dump_flowtable(stru +@@ -5283,7 +5123,7 @@ static int nf_tables_dump_flowtable(stru cb->nlh->nlmsg_seq, NFT_MSG_NEWFLOWTABLE, NLM_F_MULTI | NLM_F_APPEND, @@ -1041,7 +1041,7 @@ Signed-off-by: Pablo Neira Ayuso goto done; nl_dump_check_consistent(cb, nlmsg_hdr(skb)); -@@ -5349,7 +5189,6 @@ static int nf_tables_getflowtable(struct +@@ -5343,7 +5183,6 @@ static int nf_tables_getflowtable(struct u8 genmask = nft_genmask_cur(net); int family = nfmsg->nfgen_family; struct nft_flowtable *flowtable; @@ -1049,7 +1049,7 @@ Signed-off-by: Pablo Neira Ayuso const struct nft_table *table; struct sk_buff *skb2; int err; -@@ -5375,12 +5214,8 @@ static int nf_tables_getflowtable(struct +@@ -5369,12 +5208,8 @@ static int nf_tables_getflowtable(struct if (!nla[NFTA_FLOWTABLE_NAME]) return -EINVAL; @@ -1063,7 +1063,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(table)) return PTR_ERR(table); -@@ -6551,7 +6386,7 @@ int __nft_release_basechain(struct nft_c +@@ -6545,7 +6380,7 @@ int __nft_release_basechain(struct nft_c } EXPORT_SYMBOL_GPL(__nft_release_basechain); @@ -1072,7 +1072,7 @@ Signed-off-by: Pablo Neira Ayuso { struct nft_flowtable *flowtable, *nf; struct nft_table *table, *nt; -@@ -6564,7 +6399,7 @@ static void __nft_release_afinfo(struct +@@ -6558,7 +6393,7 @@ static void __nft_release_afinfo(struct }; list_for_each_entry_safe(table, nt, &net->nft.tables, list) { @@ -1081,7 +1081,7 @@ Signed-off-by: Pablo Neira Ayuso list_for_each_entry(chain, &table->chains, list) nf_tables_unregister_hook(net, table, chain); -@@ -6616,7 +6451,7 @@ static int __net_init nf_tables_init_net +@@ -6610,7 +6445,7 @@ static int __net_init nf_tables_init_net static void __net_exit nf_tables_exit_net(struct net *net) { diff --git a/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch b/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch index 4b4206502c5..663f088d656 100644 --- a/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch +++ b/target/linux/generic/backport-4.14/339-v4.16-netfilter-nft_flow_offload-wait-for-garbage-collecto.patch @@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4886,13 +4886,13 @@ void nft_flow_table_iterate(struct net * +@@ -4880,13 +4880,13 @@ void nft_flow_table_iterate(struct net * struct nft_flowtable *flowtable; const struct nft_table *table; diff --git a/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch b/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch index 670d2ca6d4c..3aed3f9ff1f 100644 --- a/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch +++ b/target/linux/generic/backport-4.14/342-v4.16-netfilter-nf_tables-fix-flowtable-free.patch @@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso }; --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5271,17 +5271,12 @@ err: +@@ -5265,17 +5265,12 @@ err: nfnetlink_set_err(ctx->net, ctx->portid, NFNLGRP_NFTABLES, -ENOBUFS); } diff --git a/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch b/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch index 98ec5d1b7ce..84729ad1f57 100644 --- a/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch +++ b/target/linux/generic/backport-4.14/344-v4.16-netfilter-nf_tables-allocate-handle-and-delete-objec.patch @@ -266,7 +266,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(chain)) return PTR_ERR(chain); -@@ -2563,6 +2611,7 @@ static const struct nla_policy nft_set_p +@@ -2557,6 +2605,7 @@ static const struct nla_policy nft_set_p [NFTA_SET_USERDATA] = { .type = NLA_BINARY, .len = NFT_USERDATA_MAXLEN }, [NFTA_SET_OBJ_TYPE] = { .type = NLA_U32 }, @@ -274,7 +274,7 @@ Signed-off-by: Pablo Neira Ayuso }; static const struct nla_policy nft_set_desc_policy[NFTA_SET_DESC_MAX + 1] = { -@@ -2606,6 +2655,22 @@ static struct nft_set *nf_tables_set_loo +@@ -2600,6 +2649,22 @@ static struct nft_set *nf_tables_set_loo return ERR_PTR(-ENOENT); } @@ -297,7 +297,7 @@ Signed-off-by: Pablo Neira Ayuso static struct nft_set *nf_tables_set_lookup_byid(const struct net *net, const struct nlattr *nla, u8 genmask) -@@ -2722,6 +2787,9 @@ static int nf_tables_fill_set(struct sk_ +@@ -2716,6 +2781,9 @@ static int nf_tables_fill_set(struct sk_ goto nla_put_failure; if (nla_put_string(skb, NFTA_SET_NAME, set->name)) goto nla_put_failure; @@ -307,7 +307,7 @@ Signed-off-by: Pablo Neira Ayuso if (set->flags != 0) if (nla_put_be32(skb, NFTA_SET_FLAGS, htonl(set->flags))) goto nla_put_failure; -@@ -3130,6 +3198,7 @@ static int nf_tables_newset(struct net * +@@ -3124,6 +3192,7 @@ static int nf_tables_newset(struct net * set->udata = udata; set->timeout = timeout; set->gc_int = gc_int; @@ -315,7 +315,7 @@ Signed-off-by: Pablo Neira Ayuso err = ops->init(set, &desc, nla); if (err < 0) -@@ -3189,7 +3258,10 @@ static int nf_tables_delset(struct net * +@@ -3183,7 +3252,10 @@ static int nf_tables_delset(struct net * if (err < 0) return err; @@ -327,7 +327,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(set)) return PTR_ERR(set); -@@ -4250,6 +4322,21 @@ struct nft_object *nf_tables_obj_lookup( +@@ -4244,6 +4316,21 @@ struct nft_object *nf_tables_obj_lookup( } EXPORT_SYMBOL_GPL(nf_tables_obj_lookup); @@ -349,7 +349,7 @@ Signed-off-by: Pablo Neira Ayuso static const struct nla_policy nft_obj_policy[NFTA_OBJ_MAX + 1] = { [NFTA_OBJ_TABLE] = { .type = NLA_STRING, .len = NFT_TABLE_MAXNAMELEN - 1 }, -@@ -4257,6 +4344,7 @@ static const struct nla_policy nft_obj_p +@@ -4251,6 +4338,7 @@ static const struct nla_policy nft_obj_p .len = NFT_OBJ_MAXNAMELEN - 1 }, [NFTA_OBJ_TYPE] = { .type = NLA_U32 }, [NFTA_OBJ_DATA] = { .type = NLA_NESTED }, @@ -357,7 +357,7 @@ Signed-off-by: Pablo Neira Ayuso }; static struct nft_object *nft_obj_init(const struct nft_ctx *ctx, -@@ -4404,6 +4492,8 @@ static int nf_tables_newobj(struct net * +@@ -4398,6 +4486,8 @@ static int nf_tables_newobj(struct net * goto err1; } obj->table = table; @@ -366,7 +366,7 @@ Signed-off-by: Pablo Neira Ayuso obj->name = nla_strdup(nla[NFTA_OBJ_NAME], GFP_KERNEL); if (!obj->name) { err = -ENOMEM; -@@ -4450,7 +4540,9 @@ static int nf_tables_fill_obj_info(struc +@@ -4444,7 +4534,9 @@ static int nf_tables_fill_obj_info(struc nla_put_string(skb, NFTA_OBJ_NAME, obj->name) || nla_put_be32(skb, NFTA_OBJ_TYPE, htonl(obj->ops->type->type)) || nla_put_be32(skb, NFTA_OBJ_USE, htonl(obj->use)) || @@ -377,7 +377,7 @@ Signed-off-by: Pablo Neira Ayuso goto nla_put_failure; nlmsg_end(skb, nlh); -@@ -4648,7 +4740,7 @@ static int nf_tables_delobj(struct net * +@@ -4642,7 +4734,7 @@ static int nf_tables_delobj(struct net * u32 objtype; if (!nla[NFTA_OBJ_TYPE] || @@ -386,7 +386,7 @@ Signed-off-by: Pablo Neira Ayuso return -EINVAL; table = nf_tables_table_lookup(net, nla[NFTA_OBJ_TABLE], family, -@@ -4657,7 +4749,12 @@ static int nf_tables_delobj(struct net * +@@ -4651,7 +4743,12 @@ static int nf_tables_delobj(struct net * return PTR_ERR(table); objtype = ntohl(nla_get_be32(nla[NFTA_OBJ_TYPE])); @@ -400,7 +400,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(obj)) return PTR_ERR(obj); if (obj->use > 0) -@@ -4729,6 +4826,7 @@ static const struct nla_policy nft_flowt +@@ -4723,6 +4820,7 @@ static const struct nla_policy nft_flowt [NFTA_FLOWTABLE_NAME] = { .type = NLA_STRING, .len = NFT_NAME_MAXLEN - 1 }, [NFTA_FLOWTABLE_HOOK] = { .type = NLA_NESTED }, @@ -408,7 +408,7 @@ Signed-off-by: Pablo Neira Ayuso }; struct nft_flowtable *nf_tables_flowtable_lookup(const struct nft_table *table, -@@ -4746,6 +4844,20 @@ struct nft_flowtable *nf_tables_flowtabl +@@ -4740,6 +4838,20 @@ struct nft_flowtable *nf_tables_flowtabl } EXPORT_SYMBOL_GPL(nf_tables_flowtable_lookup); @@ -429,7 +429,7 @@ Signed-off-by: Pablo Neira Ayuso #define NFT_FLOWTABLE_DEVICE_MAX 8 static int nf_tables_parse_devices(const struct nft_ctx *ctx, -@@ -4954,6 +5066,8 @@ static int nf_tables_newflowtable(struct +@@ -4948,6 +5060,8 @@ static int nf_tables_newflowtable(struct return -ENOMEM; flowtable->table = table; @@ -438,7 +438,7 @@ Signed-off-by: Pablo Neira Ayuso flowtable->name = nla_strdup(nla[NFTA_FLOWTABLE_NAME], GFP_KERNEL); if (!flowtable->name) { err = -ENOMEM; -@@ -5028,8 +5142,14 @@ static int nf_tables_delflowtable(struct +@@ -5022,8 +5136,14 @@ static int nf_tables_delflowtable(struct if (IS_ERR(table)) return PTR_ERR(table); @@ -455,7 +455,7 @@ Signed-off-by: Pablo Neira Ayuso if (IS_ERR(flowtable)) return PTR_ERR(flowtable); if (flowtable->use > 0) -@@ -5062,7 +5182,9 @@ static int nf_tables_fill_flowtable_info +@@ -5056,7 +5176,9 @@ static int nf_tables_fill_flowtable_info if (nla_put_string(skb, NFTA_FLOWTABLE_TABLE, flowtable->table->name) || nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || diff --git a/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch b/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch index 2cf8cea23c7..3cc644a5300 100644 --- a/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch +++ b/target/linux/generic/backport-4.14/357-v4.18-netfilter-nf_flow_table-move-init-code-to-nf_flow_ta.patch @@ -236,7 +236,7 @@ Signed-off-by: Felix Fietkau .owner = THIS_MODULE, --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -5081,40 +5081,38 @@ static int nf_tables_newflowtable(struct +@@ -5075,40 +5075,38 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -285,7 +285,7 @@ Signed-off-by: Felix Fietkau err3: module_put(type->owner); err2: -@@ -5395,10 +5393,8 @@ err: +@@ -5389,10 +5387,8 @@ err: static void nf_tables_flowtable_destroy(struct nft_flowtable *flowtable) { diff --git a/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch b/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch index d978a076fd3..d78f8003aa1 100644 --- a/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch +++ b/target/linux/generic/backport-4.14/358-v4.18-netfilter-nf_flow_table-fix-priv-pointer-for-netdev-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4947,7 +4947,7 @@ static int nf_tables_flowtable_parse_hoo +@@ -4941,7 +4941,7 @@ static int nf_tables_flowtable_parse_hoo flowtable->ops[i].pf = NFPROTO_NETDEV; flowtable->ops[i].hooknum = hooknum; flowtable->ops[i].priority = priority; diff --git a/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch b/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch index 84048a0be81..8268041c21b 100644 --- a/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch +++ b/target/linux/generic/backport-4.14/359-v4.18-netfilter-nf_flow_table-track-flow-tables-in-nf_flow.patch @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau WARN_ON(!nf_flow_offload_gc_step(flow_table)); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4991,23 +4991,6 @@ static const struct nf_flowtable_type *n +@@ -4985,23 +4985,6 @@ static const struct nf_flowtable_type *n return ERR_PTR(-ENOENT); } diff --git a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 88870bc99e8..61ececbc896 100644 --- a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -6141,7 +6141,7 @@ static void __ref alloc_node_mem_map(str +@@ -6143,7 +6143,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch index ad78b684a0c..8d13eeff875 100644 --- a/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch +++ b/target/linux/generic/pending-4.14/640-netfilter-nf_flow_table-add-hardware-offload-support.patch @@ -506,7 +506,7 @@ Signed-off-by: Pablo Neira Ayuso +MODULE_ALIAS("nf-flow-table-hw"); --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c -@@ -4934,6 +4934,14 @@ static int nf_tables_flowtable_parse_hoo +@@ -4928,6 +4928,14 @@ static int nf_tables_flowtable_parse_hoo if (err < 0) goto err1; @@ -521,7 +521,7 @@ Signed-off-by: Pablo Neira Ayuso ops = kzalloc(sizeof(struct nf_hook_ops) * n, GFP_KERNEL); if (!ops) { err = -ENOMEM; -@@ -5064,10 +5072,19 @@ static int nf_tables_newflowtable(struct +@@ -5058,10 +5066,19 @@ static int nf_tables_newflowtable(struct } flowtable->data.type = type; @@ -541,7 +541,7 @@ Signed-off-by: Pablo Neira Ayuso err = nf_tables_flowtable_parse_hook(&ctx, nla[NFTA_FLOWTABLE_HOOK], flowtable); if (err < 0) -@@ -5165,7 +5182,8 @@ static int nf_tables_fill_flowtable_info +@@ -5159,7 +5176,8 @@ static int nf_tables_fill_flowtable_info nla_put_string(skb, NFTA_FLOWTABLE_NAME, flowtable->name) || nla_put_be32(skb, NFTA_FLOWTABLE_USE, htonl(flowtable->use)) || nla_put_be64(skb, NFTA_FLOWTABLE_HANDLE, cpu_to_be64(flowtable->handle), diff --git a/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch b/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch index 4ee79515c9a..6a83d79d8c3 100644 --- a/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch +++ b/target/linux/ipq40xx/patches-4.14/400-mtd-ubi-add-quirk-to-autoload-ubi-on-rt-ac58u.patch @@ -17,7 +17,7 @@ Signed-off-by: Christian Lamparter --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c -@@ -1184,6 +1184,9 @@ static void __init ubi_auto_attach(void) +@@ -1187,6 +1187,9 @@ static void __init ubi_auto_attach(void) mtd = open_mtd_device("ubi"); if (IS_ERR(mtd)) mtd = open_mtd_device("data"); @@ -25,5 +25,5 @@ Signed-off-by: Christian Lamparter + if (IS_ERR(mtd)) + mtd = open_mtd_device("UBI_DEV"); - if (!IS_ERR(mtd)) { - size_t len; + if (IS_ERR(mtd)) + return; diff --git a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch index c396e314a9f..9d9391d6cda 100644 --- a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch +++ b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1943,7 +1943,7 @@ static struct phy_driver genphy_driver = +@@ -1940,7 +1940,7 @@ static struct phy_driver genphy_driver = .config_init = genphy_config_init, .features = PHY_GBIT_FEATURES | SUPPORTED_MII | SUPPORTED_AUI | SUPPORTED_FIBRE | diff --git a/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch b/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch index 568d61db91f..6bce3194f29 100644 --- a/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch +++ b/target/linux/ramips/patches-4.14/0054-mtd-spi-nor-w25q256-respect-default-mode.patch @@ -33,7 +33,7 @@ /* * Write status register 1 byte * Returns negative if error occurred. -@@ -2878,9 +2887,16 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -2888,9 +2897,16 @@ int spi_nor_scan(struct spi_nor *nor, co } else if (mtd->size > 0x1000000) { /* enable 4-byte addressing if the device exceeds 16MiB */ nor->addr_width = 4; diff --git a/target/linux/ramips/patches-4.14/302-spi-nor-add-gd25q512.patch b/target/linux/ramips/patches-4.14/302-spi-nor-add-gd25q512.patch index 408fc13e7ac..e5c39db68f4 100644 --- a/target/linux/ramips/patches-4.14/302-spi-nor-add-gd25q512.patch +++ b/target/linux/ramips/patches-4.14/302-spi-nor-add-gd25q512.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1050,6 +1050,11 @@ static const struct flash_info spi_nor_i +@@ -1059,6 +1059,11 @@ static const struct flash_info spi_nor_i SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, diff --git a/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch b/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch index d959ddb097f..95993fe74c9 100644 --- a/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch +++ b/target/linux/ramips/patches-4.14/303-spi-nor-enable-4B-opcodes-for-mx66l51235l.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1089,7 +1089,7 @@ static const struct flash_info spi_nor_i +@@ -1098,7 +1098,7 @@ static const struct flash_info spi_nor_i { "mx25l25635e", INFO(0xc22019, 0, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "mx25u25635f", INFO(0xc22539, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_OPCODES) }, { "mx25l25655e", INFO(0xc22619, 0, 64 * 1024, 512, 0) }, From 2f11a9ed68f5f7fc9323d2bf9c496fbc2bf76b76 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 18 Dec 2018 12:40:30 +0100 Subject: [PATCH 250/399] cns3xxx: fix writing to wrong PCI registers Originally, cns3xxx used it's own functions for mapping, reading and writing registers. Upstream commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") removed the internal PCI config write function in favor of the generic one: cns3xxx_pci_write_config() --> pci_generic_config_write() cns3xxx_pci_write_config() expected aligned addresses, being produced by cns3xxx_pci_map_bus() while the generic one pci_generic_config_write() actually expects the real address as both the function and hardware are capable of byte-aligned writes. This currently leads to pci_generic_config_write() writing to the wrong registers on some ocasions. First issue seen due to this: - driver ath9k gets loaded - The driver wants to write value 0xA8 to register PCI_LATENCY_TIMER, located at 0x0D - cns3xxx_pci_map_bus() aligns the address to 0x0C - pci_generic_config_write() effectively writes 0xA8 into register 0x0C (CACHE_LINE_SIZE) This seems to cause some slight instability when certain PCI devices are used. Another issue example caused by this this is the PCI bus numbering, where the primary bus is higher than the secondary, which is impossible. Before: 00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode]) Flags: bus master, fast devsel, latency 0, IRQ 255 Bus: primary=02, secondary=01, subordinate=ff, sec-latency=0 After fix: 00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode]) Flags: bus master, fast devsel, latency 0, IRQ 255 Bus: primary=00, secondary=01, subordinate=02, sec-latency=0 And very likely some more .. Fix all by omitting the alignment being done in the mapping function. Signed-off-by: Koen Vandeputte --- ...writing-to-wrong-PCI-registers-after.patch | 79 +++++++++++++++++++ ...writing-to-wrong-PCI-registers-after.patch | 79 +++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch create mode 100644 target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch diff --git a/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch b/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch new file mode 100644 index 00000000000..458515a0b59 --- /dev/null +++ b/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch @@ -0,0 +1,79 @@ +From 03556dab1cb02d85b50d7be3ee3a3bac001f5991 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Tue, 18 Dec 2018 12:14:06 +0100 +Subject: [PATCH] arm: cns3xxx: fix writing to wrong PCI registers after + alignment + +Originally, cns3xxx used it's own functions for mapping, reading and writing registers. + +Commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +removed the internal PCI config write function in favor of the generic one: + +cns3xxx_pci_write_config() --> pci_generic_config_write() + +cns3xxx_pci_write_config() expected aligned addresses, being produced by cns3xxx_pci_map_bus() +while the generic one pci_generic_config_write() actually expects the real address +as both the function and hardware are capable of byte-aligned writes. + +This currently leads to pci_generic_config_write() writing +to the wrong registers on some ocasions. + +First issue seen due to this: + +- driver ath9k gets loaded +- The driver wants to write value 0xA8 to register PCI_LATENCY_TIMER, located at 0x0D +- cns3xxx_pci_map_bus() aligns the address to 0x0C +- pci_generic_config_write() effectively writes 0xA8 into register 0x0C (CACHE_LINE_SIZE) + +This seems to cause some slight instability when certain PCI devices are used. + +Another issue example caused by this this is the PCI bus numbering, +where the primary bus is higher than the secondary, which is impossible. + +Before: + +00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode]) + Flags: bus master, fast devsel, latency 0, IRQ 255 + Bus: primary=02, secondary=01, subordinate=ff, sec-latency=0 + +After fix: + +00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode]) + Flags: bus master, fast devsel, latency 0, IRQ 255 + Bus: primary=00, secondary=01, subordinate=02, sec-latency=0 + +And very likely some more .. + +Fix all by omitting the alignment being done in the mapping function. + +Fixes: 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +Signed-off-by: Koen Vandeputte +CC: Arnd Bergmann +CC: Bjorn Helgaas +CC: Krzysztof Halasa +CC: Olof Johansson +CC: Robin Leblon +CC: Rob Herring +CC: Russell King +CC: Tim Harvey +CC: stable@vger.kernel.org # v4.0+ +--- + arch/arm/mach-cns3xxx/pcie.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c +index 318394ed5c7a..5e11ad3164e0 100644 +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, + } else /* remote PCI bus */ + base = cnspci->cfg1_regs + ((busno & 0xf) << 20); + +- return base + (where & 0xffc) + (devfn << 12); ++ return base + where + (devfn << 12); + } + + static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, +-- +2.17.1 + diff --git a/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch b/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch new file mode 100644 index 00000000000..458515a0b59 --- /dev/null +++ b/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch @@ -0,0 +1,79 @@ +From 03556dab1cb02d85b50d7be3ee3a3bac001f5991 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Tue, 18 Dec 2018 12:14:06 +0100 +Subject: [PATCH] arm: cns3xxx: fix writing to wrong PCI registers after + alignment + +Originally, cns3xxx used it's own functions for mapping, reading and writing registers. + +Commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +removed the internal PCI config write function in favor of the generic one: + +cns3xxx_pci_write_config() --> pci_generic_config_write() + +cns3xxx_pci_write_config() expected aligned addresses, being produced by cns3xxx_pci_map_bus() +while the generic one pci_generic_config_write() actually expects the real address +as both the function and hardware are capable of byte-aligned writes. + +This currently leads to pci_generic_config_write() writing +to the wrong registers on some ocasions. + +First issue seen due to this: + +- driver ath9k gets loaded +- The driver wants to write value 0xA8 to register PCI_LATENCY_TIMER, located at 0x0D +- cns3xxx_pci_map_bus() aligns the address to 0x0C +- pci_generic_config_write() effectively writes 0xA8 into register 0x0C (CACHE_LINE_SIZE) + +This seems to cause some slight instability when certain PCI devices are used. + +Another issue example caused by this this is the PCI bus numbering, +where the primary bus is higher than the secondary, which is impossible. + +Before: + +00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode]) + Flags: bus master, fast devsel, latency 0, IRQ 255 + Bus: primary=02, secondary=01, subordinate=ff, sec-latency=0 + +After fix: + +00:00.0 PCI bridge: Cavium, Inc. Device 3400 (rev 01) (prog-if 00 [Normal decode]) + Flags: bus master, fast devsel, latency 0, IRQ 255 + Bus: primary=00, secondary=01, subordinate=02, sec-latency=0 + +And very likely some more .. + +Fix all by omitting the alignment being done in the mapping function. + +Fixes: 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +Signed-off-by: Koen Vandeputte +CC: Arnd Bergmann +CC: Bjorn Helgaas +CC: Krzysztof Halasa +CC: Olof Johansson +CC: Robin Leblon +CC: Rob Herring +CC: Russell King +CC: Tim Harvey +CC: stable@vger.kernel.org # v4.0+ +--- + arch/arm/mach-cns3xxx/pcie.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c +index 318394ed5c7a..5e11ad3164e0 100644 +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, + } else /* remote PCI bus */ + base = cnspci->cfg1_regs + ((busno & 0xf) << 20); + +- return base + (where & 0xffc) + (devfn << 12); ++ return base + where + (devfn << 12); + } + + static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, +-- +2.17.1 + From ca05fd5ebf20244d6ace73ebcd976414e7fcb0c4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 29 Sep 2018 17:45:54 +0200 Subject: [PATCH 251/399] build: fix kernel headers install for uml The kernel headers makefile needs to override LINUX_KARCH Signed-off-by: Felix Fietkau (backported from c3a0102195a2902f1964b667fb86031308c78f9d) --- include/kernel.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/kernel.mk b/include/kernel.mk index c169550f488..97bcfe3f0b7 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -97,7 +97,7 @@ endif KERNEL_MAKE = $(MAKE) $(KERNEL_MAKEOPTS) -KERNEL_MAKE_FLAGS := \ +KERNEL_MAKE_FLAGS = \ HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ CROSS_COMPILE="$(KERNEL_CROSS)" \ ARCH="$(LINUX_KARCH)" \ From 868a4cf69f93e4425411801f986e1073b5b24b29 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 1 Oct 2018 12:44:50 +0200 Subject: [PATCH 252/399] build: insert blank line after KernelPackage template to allow chaining calls to it Signed-off-by: Felix Fietkau (backported from b7855230a348fa711de70665c861f63c631c98e9) --- include/kernel.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/kernel.mk b/include/kernel.mk index 97bcfe3f0b7..77c5ecf6006 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -254,6 +254,7 @@ $(call KernelPackage/$(1)/config) $$(eval $$(call BuildPackage,kmod-$(1))) $$(IPKG_kmod-$(1)): $$(wildcard $$(FILES)) + endef version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1)) From 8b07cd6000ddf7c8827114e44e574b094ef16ce4 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Mon, 15 Oct 2018 20:00:05 +0200 Subject: [PATCH 253/399] build: remove obsolete -rc kernel testing rewrites The -rcX "testing" kernels are no longer hosted on cdn.kernel.org file servers directly in a "testing" directory. Therefore the logic that tested for "-rc" can be removed. Signed-off-by: Christian Lamparter (backported from 92bcd08989dede0f60589023e2aea4a864de76c6) --- include/kernel.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/kernel.mk b/include/kernel.mk index 77c5ecf6006..62a8e99e2d2 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -60,9 +60,8 @@ else LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz - TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,) ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) - LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING) + LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x else LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null)) endif From 16f4057188b7fd4bc8126600d053a1822231cc36 Mon Sep 17 00:00:00 2001 From: Thorsten Glaser Date: Mon, 22 Oct 2018 21:00:57 +0200 Subject: [PATCH 254/399] build: fix libressl build on x32 (amd64ilp32) host disable use of assembly code since x32 gets misdetected as amd64 Signed-off-by: Thorsten Glaser (backported from a395563f68fde6f52dbf10913f59f13b8c804cd5) --- tools/libressl/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index 4c7e8a7b6ec..bb8113a4ada 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -24,4 +24,8 @@ include $(INCLUDE_DIR)/host-build.mk HOST_CONFIGURE_ARGS += --disable-shared HOST_CFLAGS += $(FPIC) +ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32) +HOST_CONFIGURE_ARGS += --disable-asm +endif + $(eval $(call HostBuild)) From 9885d3aec1db0830a1df98da9793d9506b0cbc58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 23 Nov 2018 10:53:37 +0100 Subject: [PATCH 255/399] build: Introduce building of artifacts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently could (ab)use IMAGES for this task, but the downside is, that the filenames has filesystem tied to the filename, which might be confusing as the artifact itself don't has to be used with that specific filesystem. Another downside is, that the artifacts built with IMAGES target are build for every FILESYSTEMS filesystem. Consider following use case: define Device/apalis ... FILESYSTEMS := ext4 squashfs IMAGES := spl-uboot.bin recovery.scr IMAGE/spl-uboot.bin := append-uboot-spl | pad-to 68k | append-uboot IMAGE/recovery.scr := recovery-scr endef Where we would get target binaries with following filenames: openwrt-imx6-apalis-squashfs.recovery.scr openwrt-imx6-apalis-squashfs.spl-uboot.bin openwrt-imx6-apalis-ext4.recovery.scr openwrt-imx6-apalis-ext4.spl-uboot.bin With proposed patch, we could now just do: define Device/apalis ... ARTIFACTS := spl-uboot.bin recovery.scr ARTIFACT/spl-uboot.bin := append-uboot-spl | pad-to 68k | append-uboot ARTIFACT/recovery.scr := recovery-scr endef Which would produce target binaries with following filenames: openwrt-imx6-apalis-recovery.scr openwrt-imx6-apalis-spl-uboot.bin Signed-off-by: Petr Štetiar Acked-by: Hauke Mehrtens (backported from 493c9a35516c27a8ec412d97e63c8cf6f41a57ea) --- include/image.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/image.mk b/include/image.mk index f2a85f6feb9..a2b106d9098 100644 --- a/include/image.mk +++ b/include/image.mk @@ -321,6 +321,7 @@ define Device/Init CMDLINE:= IMAGES := + ARTIFACTS := IMAGE_PREFIX := $(IMG_PREFIX)-$(1) IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1)-$$(2) KERNEL_PREFIX = $$(IMAGE_PREFIX) @@ -498,6 +499,19 @@ define Device/Build/image endef +define Device/Build/artifact + $$(_TARGET): $(BIN_DIR)/$(IMAGE_PREFIX)-$(1) + $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1): $$(KDIR_KERNEL_IMAGE) + @rm -f $$@ + $$(call concat_cmd,$(ARTIFACT/$(1))) + + .IGNORE: $(BIN_DIR)/$(IMAGE_PREFIX)-$(1) + + $(BIN_DIR)/$(IMAGE_PREFIX)-$(1): $(KDIR)/tmp/$(IMAGE_PREFIX)-$(1) + cp $$^ $$@ + +endef + define Device/Build $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1))) $(call Device/Build/kernel,$(1)) @@ -508,6 +522,10 @@ define Device/Build $$(eval $$(foreach image,$$(IMAGES), \ $$(foreach fs,$$(filter $(TARGET_FILESYSTEMS),$$(FILESYSTEMS)), \ $$(call Device/Build/image,$$(fs),$$(image),$(1))))) + + $$(eval $$(foreach artifact,$$(ARTIFACTS), \ + $$(call Device/Build/artifact,$$(artifact)))) + endef define Device/DumpInfo From 1a3c129967e02671b94905f243b3c0b09fab86aa Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 25 Aug 2018 18:11:03 +0200 Subject: [PATCH 256/399] kernel: add missing dependency to regmap to kmod-gpio-mcp23s08 This fixes a build problem recently introduced. Fixes: a904003b9b5f ("kernel: fix kmod-gpio-mcp23s08 for linux 4.14") Signed-off-by: Hauke Mehrtens (backported from e882e63f1e1169030389b304489ab8a7d785df33) --- package/kernel/linux/modules/other.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 9c3d54ebd89..ecf222ac138 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -227,7 +227,7 @@ $(eval $(call KernelPackage,gpio-dev)) define KernelPackage/gpio-mcp23s08 SUBMENU:=$(OTHER_MENU) TITLE:=Microchip MCP23xxx I/O expander - DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core + DEPENDS:=@GPIO_SUPPORT +kmod-i2c-core +LINUX_4_14:kmod-regmap KCONFIG:= \ CONFIG_GPIO_MCP23S08 \ CONFIG_PINCTRL_MCP23S08 From c1e53d2c82c4945d3e5bfac6d8fcb6b7e058d48c Mon Sep 17 00:00:00 2001 From: "W. Michael Petullo" Date: Sun, 26 Aug 2018 02:31:31 -0400 Subject: [PATCH 257/399] kernel: build support for NFSv4 in nfsd Signed-off-by: W. Michael Petullo (backported from 92aa21497b22bcf03862cf9da8e89ef007affebd) --- package/kernel/linux/modules/fs.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 19524df7341..4114659f315 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -439,9 +439,13 @@ $(eval $(call KernelPackage,fs-nfs-v4)) define KernelPackage/fs-nfsd SUBMENU:=$(FS_MENU) TITLE:=NFS kernel server support - DEPENDS:=+kmod-fs-nfs-common +kmod-fs-exportfs + DEPENDS:=+kmod-fs-nfs-common +kmod-fs-exportfs +kmod-fs-nfs-common-rpcsec KCONFIG:= \ CONFIG_NFSD \ + CONFIG_NFSD_V4=y \ + CONFIG_NFSD_BLOCKLAYOUT=n \ + CONFIG_NFSD_SCSILAYOUT=n \ + CONFIG_NFSD_FLEXFILELAYOUT=n \ CONFIG_NFSD_FAULT_INJECTION=n FILES:=$(LINUX_DIR)/fs/nfsd/nfsd.ko AUTOLOAD:=$(call AutoLoad,40,nfsd) From a29fe94e8cefc37071d81d58ee8970a3f6ccacdc Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sat, 29 Sep 2018 23:18:33 +0200 Subject: [PATCH 258/399] kernel: Add missing config option for NFSDv4 This configuration option is not set when building the layerscape/armv8_64b target. Fixes: 92aa21497b2 ("kernel: build support for NFSv4 in nfsd") Signed-off-by: Hauke Mehrtens (backported from 99e1a12fd0448bc045da7f3776e804df187ee7a2) --- package/kernel/linux/modules/fs.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 4114659f315..ebf8677d93f 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -443,6 +443,7 @@ define KernelPackage/fs-nfsd KCONFIG:= \ CONFIG_NFSD \ CONFIG_NFSD_V4=y \ + CONFIG_NFSD_V4_SECURITY_LABEL=n \ CONFIG_NFSD_BLOCKLAYOUT=n \ CONFIG_NFSD_SCSILAYOUT=n \ CONFIG_NFSD_FLEXFILELAYOUT=n \ From 0439280c2fcf859de935e4cd62c64fe907a6bb3e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 25 Jan 2018 14:01:34 +0100 Subject: [PATCH 259/399] kernel: support gcc-optimized inlining on all architectures Optimized inlining was disabled by default when gcc 4 was still relatively new. By now, all gcc versions handle this well and there seems to be no real reason to keep it x86-only. Signed-off-by: Felix Fietkau (backported from 1e8882585c6f4a5e7f5e2b4f18cd550aafa6f81d) (rebased patches) Signed-off-by: Jo-Philipp Wich --- target/linux/generic/config-4.14 | 1 + target/linux/generic/config-4.9 | 1 + .../pending-4.14/220-optimize_inlining.patch | 70 +++++++++++++++++++ .../pending-4.9/220-optimize_inlining.patch | 70 +++++++++++++++++++ .../pending-4.9/890-uart_optional_sysrq.patch | 2 +- target/linux/x86/config-4.14 | 1 - 6 files changed, 143 insertions(+), 2 deletions(-) create mode 100644 target/linux/generic/pending-4.14/220-optimize_inlining.patch create mode 100644 target/linux/generic/pending-4.9/220-optimize_inlining.patch diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 96916c0e43e..34773958f5e 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -3312,6 +3312,7 @@ CONFIG_NMI_LOG_BUF_SHIFT=13 # CONFIG_OPROFILE is not set # CONFIG_OPROFILE_EVENT_MULTIPLEX is not set # CONFIG_OPT3001 is not set +# CONFIG_OPTIMIZE_INLINING is not set # CONFIG_ORANGEFS_FS is not set # CONFIG_ORION_WATCHDOG is not set # CONFIG_OSF_PARTITION is not set diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 53955d9ae7f..5e2b25f31e3 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -3117,6 +3117,7 @@ CONFIG_NMI_LOG_BUF_SHIFT=13 # CONFIG_OPROFILE is not set # CONFIG_OPROFILE_EVENT_MULTIPLEX is not set # CONFIG_OPT3001 is not set +# CONFIG_OPTIMIZE_INLINING is not set # CONFIG_ORANGEFS_FS is not set # CONFIG_ORION_WATCHDOG is not set # CONFIG_OSF_PARTITION is not set diff --git a/target/linux/generic/pending-4.14/220-optimize_inlining.patch b/target/linux/generic/pending-4.14/220-optimize_inlining.patch new file mode 100644 index 00000000000..dca1dcb2041 --- /dev/null +++ b/target/linux/generic/pending-4.14/220-optimize_inlining.patch @@ -0,0 +1,70 @@ +--- a/arch/x86/Kconfig.debug ++++ b/arch/x86/Kconfig.debug +@@ -284,20 +284,6 @@ config CPA_DEBUG + ---help--- + Do change_page_attr() self-tests every 30 seconds. + +-config OPTIMIZE_INLINING +- bool "Allow gcc to uninline functions marked 'inline'" +- ---help--- +- This option determines if the kernel forces gcc to inline the functions +- developers have marked 'inline'. Doing so takes away freedom from gcc to +- do what it thinks is best, which is desirable for the gcc 3.x series of +- compilers. The gcc 4.x series have a rewritten inlining algorithm and +- enabling this option will generate a smaller kernel there. Hopefully +- this algorithm is so good that allowing gcc 4.x and above to make the +- decision will become the default in the future. Until then this option +- is there to test gcc for this. +- +- If unsure, say N. +- + config DEBUG_ENTRY + bool "Debug low-level entry code" + depends on DEBUG_KERNEL +--- a/lib/Kconfig.debug ++++ b/lib/Kconfig.debug +@@ -137,6 +137,20 @@ endmenu # "printk and dmesg options" + + menu "Compile-time checks and compiler options" + ++config OPTIMIZE_INLINING ++ bool "Allow gcc to uninline functions marked 'inline'" ++ ---help--- ++ This option determines if the kernel forces gcc to inline the functions ++ developers have marked 'inline'. Doing so takes away freedom from gcc to ++ do what it thinks is best, which is desirable for the gcc 3.x series of ++ compilers. The gcc 4.x series have a rewritten inlining algorithm and ++ enabling this option will generate a smaller kernel there. Hopefully ++ this algorithm is so good that allowing gcc 4.x and above to make the ++ decision will become the default in the future. Until then this option ++ is there to test gcc for this. ++ ++ If unsure, say N. ++ + config DEBUG_INFO + bool "Compile the kernel with debug info" + depends on DEBUG_KERNEL && !COMPILE_TEST +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -296,9 +296,6 @@ config ZONE_DMA32 + config AUDIT_ARCH + def_bool y if X86_64 + +-config ARCH_SUPPORTS_OPTIMIZED_INLINING +- def_bool y +- + config ARCH_SUPPORTS_DEBUG_PAGEALLOC + def_bool y + +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -90,8 +90,7 @@ + * of extern inline functions at link time. + * A lot of inline functions can cause havoc with function tracing. + */ +-#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ +- !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) ++#if !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) + #define inline \ + inline __attribute__((always_inline, unused)) notrace __gnu_inline + #else diff --git a/target/linux/generic/pending-4.9/220-optimize_inlining.patch b/target/linux/generic/pending-4.9/220-optimize_inlining.patch new file mode 100644 index 00000000000..75c04ea15ca --- /dev/null +++ b/target/linux/generic/pending-4.9/220-optimize_inlining.patch @@ -0,0 +1,70 @@ +--- a/arch/x86/Kconfig.debug ++++ b/arch/x86/Kconfig.debug +@@ -287,20 +287,6 @@ config CPA_DEBUG + ---help--- + Do change_page_attr() self-tests every 30 seconds. + +-config OPTIMIZE_INLINING +- bool "Allow gcc to uninline functions marked 'inline'" +- ---help--- +- This option determines if the kernel forces gcc to inline the functions +- developers have marked 'inline'. Doing so takes away freedom from gcc to +- do what it thinks is best, which is desirable for the gcc 3.x series of +- compilers. The gcc 4.x series have a rewritten inlining algorithm and +- enabling this option will generate a smaller kernel there. Hopefully +- this algorithm is so good that allowing gcc 4.x and above to make the +- decision will become the default in the future. Until then this option +- is there to test gcc for this. +- +- If unsure, say N. +- + config DEBUG_ENTRY + bool "Debug low-level entry code" + depends on DEBUG_KERNEL +--- a/lib/Kconfig.debug ++++ b/lib/Kconfig.debug +@@ -117,6 +117,20 @@ endmenu # "printk and dmesg options" + + menu "Compile-time checks and compiler options" + ++config OPTIMIZE_INLINING ++ bool "Allow gcc to uninline functions marked 'inline'" ++ ---help--- ++ This option determines if the kernel forces gcc to inline the functions ++ developers have marked 'inline'. Doing so takes away freedom from gcc to ++ do what it thinks is best, which is desirable for the gcc 3.x series of ++ compilers. The gcc 4.x series have a rewritten inlining algorithm and ++ enabling this option will generate a smaller kernel there. Hopefully ++ this algorithm is so good that allowing gcc 4.x and above to make the ++ decision will become the default in the future. Until then this option ++ is there to test gcc for this. ++ ++ If unsure, say N. ++ + config DEBUG_INFO + bool "Compile the kernel with debug info" + depends on DEBUG_KERNEL && !COMPILE_TEST +--- a/arch/x86/Kconfig ++++ b/arch/x86/Kconfig +@@ -273,9 +273,6 @@ config ZONE_DMA32 + config AUDIT_ARCH + def_bool y if X86_64 + +-config ARCH_SUPPORTS_OPTIMIZED_INLINING +- def_bool y +- + config ARCH_SUPPORTS_DEBUG_PAGEALLOC + def_bool y + +--- a/include/linux/compiler-gcc.h ++++ b/include/linux/compiler-gcc.h +@@ -89,8 +89,7 @@ + * of extern inline functions at link time. + * A lot of inline functions can cause havoc with function tracing. + */ +-#if !defined(CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING) || \ +- !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) ++#if !defined(CONFIG_OPTIMIZE_INLINING) || (__GNUC__ < 4) + #define inline \ + inline __attribute__((always_inline, unused)) notrace __gnu_inline + #else diff --git a/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch b/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch index ff0824d343d..d80246db99f 100644 --- a/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch +++ b/target/linux/generic/pending-4.9/890-uart_optional_sysrq.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau { --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug -@@ -396,6 +396,11 @@ config MAGIC_SYSRQ_DEFAULT_ENABLE +@@ -410,6 +410,11 @@ config MAGIC_SYSRQ_DEFAULT_ENABLE This may be set to 1 or 0 to enable or disable them all, or to a bitmask as described in Documentation/sysrq.txt. diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 index 038d874e521..4a81cbc6b86 100644 --- a/target/linux/x86/config-4.14 +++ b/target/linux/x86/config-4.14 @@ -350,7 +350,6 @@ CONFIG_NVRAM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_OPROFILE_NMI_TIMER=y -# CONFIG_OPTIMIZE_INLINING is not set CONFIG_OUTPUT_FORMAT="elf32-i386" CONFIG_PAGE_OFFSET=0xC0000000 CONFIG_PC104=y From 8bf1a35eda4fc0ae5d40dbd35905e300127ccced Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 16 Oct 2018 12:11:20 +0200 Subject: [PATCH 260/399] hostapd: fix MAC filter related log spam Backport two upstream fixes to address overly verbose logging of MAC ACL rejection messages. Fixes: FS#1468 Signed-off-by: Jo-Philipp Wich (backported from 3e633bb3709611d79965fab667e3239fd3bde151) --- package/network/services/hostapd/Makefile | 2 +- ...e-undesired-logging-of-ACL-rejection.patch | 39 +++++++++++++++++++ ...-logging-priority-for-handle_auth_cb.patch | 28 +++++++++++++ .../hostapd/patches/600-ubus_support.patch | 20 +++++----- 4 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 package/network/services/hostapd/patches/000-0001-Reduce-undesired-logging-of-ACL-rejection.patch create mode 100644 package/network/services/hostapd/patches/000-0002-Drop-logging-priority-for-handle_auth_cb.patch diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 6700f3589ef..dacdf701b96 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/patches/000-0001-Reduce-undesired-logging-of-ACL-rejection.patch b/package/network/services/hostapd/patches/000-0001-Reduce-undesired-logging-of-ACL-rejection.patch new file mode 100644 index 00000000000..3fc80a01d7b --- /dev/null +++ b/package/network/services/hostapd/patches/000-0001-Reduce-undesired-logging-of-ACL-rejection.patch @@ -0,0 +1,39 @@ +From 6588f712220797c69dbd019daa19b82a50d92782 Mon Sep 17 00:00:00 2001 +From: Jouni Malinen +Date: Sun, 14 Oct 2018 19:57:22 +0300 +Subject: Reduce undesired logging of ACL rejection events from AP mode + +When Probe Request frame handling was extended to use MAC ACL through +ieee802_11_allowed_address(), the MSG_INFO level log print ("Station + not allowed to authenticate") from that function ended up getting +printed even for Probe Request frames. That was not by design and it can +result in excessive logging and MSG_INFO level if MAC ACL is used. + +Fix this by printing this log entry only for authentication and +association frames. In addition, drop the priority of that log entry to +MSG_DEBUG since this is not really an unexpected behavior in most MAC +ACL use cases. + +Fixes: 92eb00aec2a0 ("Extend ACL check for Probe Request frames") +Signed-off-by: Jouni Malinen +--- + src/ap/ieee802_11.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -1636,9 +1636,11 @@ ieee802_11_allowed_address(struct hostap + is_probe_req); + + if (res == HOSTAPD_ACL_REJECT) { +- wpa_printf(MSG_INFO, +- "Station " MACSTR " not allowed to authenticate", +- MAC2STR(addr)); ++ if (!is_probe_req) ++ wpa_printf(MSG_DEBUG, ++ "Station " MACSTR ++ " not allowed to authenticate", ++ MAC2STR(addr)); + return HOSTAPD_ACL_REJECT; + } + diff --git a/package/network/services/hostapd/patches/000-0002-Drop-logging-priority-for-handle_auth_cb.patch b/package/network/services/hostapd/patches/000-0002-Drop-logging-priority-for-handle_auth_cb.patch new file mode 100644 index 00000000000..82165a94f97 --- /dev/null +++ b/package/network/services/hostapd/patches/000-0002-Drop-logging-priority-for-handle_auth_cb.patch @@ -0,0 +1,28 @@ +From dc1b1c8db7905639be6f4de8173e2d97bf6df90d Mon Sep 17 00:00:00 2001 +From: Jouni Malinen +Date: Sun, 14 Oct 2018 20:03:55 +0300 +Subject: Drop logging priority for handle_auth_cb no-STA-match messages + +This message was printed and MSG_INFO level which would be more +reasonable for error cases where hostapd has accepted authentication. +However, this is not really an error case for the cases where +authentication was rejected (e.g., due to MAC ACL). Drop this to use +MSG_DEBUG level. + +Signed-off-by: Jouni Malinen +--- + src/ap/ieee802_11.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -4018,7 +4018,8 @@ static void handle_auth_cb(struct hostap + + sta = ap_get_sta(hapd, mgmt->da); + if (!sta) { +- wpa_printf(MSG_INFO, "handle_auth_cb: STA " MACSTR " not found", ++ wpa_printf(MSG_DEBUG, "handle_auth_cb: STA " MACSTR ++ " not found", + MAC2STR(mgmt->da)); + return; + } diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index a4c4a67fc34..7ac16e62b3f 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -92,7 +92,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1712,12 +1712,13 @@ ieee802_11_set_radius_info(struct hostap +@@ -1714,12 +1714,13 @@ ieee802_11_set_radius_info(struct hostap static void handle_auth(struct hostapd_data *hapd, @@ -108,7 +108,7 @@ u16 fc; const u8 *challenge = NULL; u32 session_timeout, acct_interim_interval; -@@ -1728,6 +1729,11 @@ static void handle_auth(struct hostapd_d +@@ -1730,6 +1731,11 @@ static void handle_auth(struct hostapd_d char *identity = NULL; char *radius_cui = NULL; u16 seq_ctrl; @@ -120,7 +120,7 @@ if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -1888,6 +1894,13 @@ static void handle_auth(struct hostapd_d +@@ -1890,6 +1896,13 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } @@ -134,7 +134,7 @@ if (res == HOSTAPD_ACL_PENDING) return; -@@ -3167,12 +3180,12 @@ void fils_hlp_timeout(void *eloop_ctx, v +@@ -3169,12 +3182,12 @@ void fils_hlp_timeout(void *eloop_ctx, v static void handle_assoc(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -149,7 +149,7 @@ struct sta_info *sta; u8 *tmp = NULL; struct hostapd_sta_wpa_psk_short *psk = NULL; -@@ -3181,6 +3194,11 @@ static void handle_assoc(struct hostapd_ +@@ -3183,6 +3196,11 @@ static void handle_assoc(struct hostapd_ #ifdef CONFIG_FILS int delay_assoc = 0; #endif /* CONFIG_FILS */ @@ -161,7 +161,7 @@ if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : sizeof(mgmt->u.assoc_req))) { -@@ -3352,6 +3370,14 @@ static void handle_assoc(struct hostapd_ +@@ -3354,6 +3372,14 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_MBO */ @@ -176,7 +176,7 @@ /* * sta->capability is used in check_assoc_ies() for RRM enabled * capability element. -@@ -3565,6 +3591,7 @@ static void handle_disassoc(struct hosta +@@ -3567,6 +3593,7 @@ static void handle_disassoc(struct hosta wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.disassoc.reason_code)); @@ -184,7 +184,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { -@@ -3630,6 +3657,8 @@ static void handle_deauth(struct hostapd +@@ -3632,6 +3659,8 @@ static void handle_deauth(struct hostapd " reason_code=%d", MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); @@ -193,7 +193,7 @@ sta = ap_get_sta(hapd, mgmt->sa); if (sta == NULL) { wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " -@@ -3949,7 +3978,7 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3951,7 +3980,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { @@ -202,7 +202,7 @@ return 1; } -@@ -3969,17 +3998,17 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3971,17 +4000,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); From c1a856b18ba84f9ed1e40c77b398919752c3b8d0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 30 Apr 2018 13:40:42 +0200 Subject: [PATCH 261/399] hostapd: add support for client taxonomy in the full config This can be used to fingerprint clients to try to identify the exact model Signed-off-by: Felix Fietkau (backported from 23c1827e341fce302ba2841ecabeeb3f95e21d68) --- .../hostapd/files/hostapd-full.config | 2 +- .../patches/430-hostapd_cli_ifdef.patch | 32 ++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 786afad2bcc..355a70b9e18 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -357,7 +357,7 @@ CONFIG_INTERNAL_LIBTOMMATH=y # Has the AP retain the Probe Request and (Re)Association Request frames from # a client, from which a signature can be produced which can identify the model # of client device like "Nexus 6P" or "iPhone 5s". -#CONFIG_TAXONOMY=y +CONFIG_TAXONOMY=y # Fast Initial Link Setup (FILS) (IEEE 802.11ai) # Note: This is an experimental and not yet complete implementation. This diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch index c1882d84a50..29dc0832eea 100644 --- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -1,6 +1,22 @@ --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -417,7 +417,6 @@ static int hostapd_cli_cmd_sa_query(stru +@@ -385,7 +385,6 @@ static int hostapd_cli_cmd_disassociate( + } + + +-#ifdef CONFIG_TAXONOMY + static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc, + char *argv[]) + { +@@ -398,7 +397,6 @@ static int hostapd_cli_cmd_signature(str + os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]); + return wpa_ctrl_command(ctrl, buf); + } +-#endif /* CONFIG_TAXONOMY */ + + + #ifdef CONFIG_IEEE80211W +@@ -417,7 +415,6 @@ static int hostapd_cli_cmd_sa_query(stru #endif /* CONFIG_IEEE80211W */ @@ -8,7 +24,7 @@ static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) { -@@ -643,7 +642,6 @@ static int hostapd_cli_cmd_wps_config(st +@@ -643,7 +640,6 @@ static int hostapd_cli_cmd_wps_config(st ssid_hex, argv[1]); return wpa_ctrl_command(ctrl, buf); } @@ -16,7 +32,15 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1518,7 +1516,6 @@ static const struct hostapd_cli_cmd host +@@ -1510,15 +1506,12 @@ static const struct hostapd_cli_cmd host + { "disassociate", hostapd_cli_cmd_disassociate, + hostapd_complete_stations, + " = disassociate a station" }, +-#ifdef CONFIG_TAXONOMY + { "signature", hostapd_cli_cmd_signature, hostapd_complete_stations, + " = get taxonomy signature for a station" }, +-#endif /* CONFIG_TAXONOMY */ + #ifdef CONFIG_IEEE80211W { "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations, " = send SA Query to a station" }, #endif /* CONFIG_IEEE80211W */ @@ -24,7 +48,7 @@ { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1543,7 +1540,6 @@ static const struct hostapd_cli_cmd host +@@ -1543,7 +1536,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, From 46fa2453fdbd530b6df251401f1d07a8a91b8c81 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 30 Apr 2018 13:48:54 +0200 Subject: [PATCH 262/399] hostapd: expose device taxonomy signature via ubus Signed-off-by: Felix Fietkau (backported from 7d8681ccb99730ca0b35a5c341b468a86cadbf35) --- package/network/services/hostapd/src/src/ap/ubus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 2c310adae26..37a20ed774e 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -20,6 +20,7 @@ #include "beacon.h" #include "rrm.h" #include "wnm_ap.h" +#include "taxonomy.h" static struct ubus_context *ctx; static struct blob_buf b; @@ -184,6 +185,11 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, blobmsg_add_u32(&b, "", sta->rrm_enabled_capa[i]); blobmsg_close_array(&b, r); blobmsg_add_u32(&b, "aid", sta->aid); +#ifdef CONFIG_TAXONOMY + r = blobmsg_alloc_string_buffer(&b, "signature", 1024); + if (retrieve_sta_taxonomy(hapd, sta, r, 1024) > 0) + blobmsg_add_string_buffer(&b); +#endif blobmsg_close_table(&b, c); } blobmsg_close_array(&b, list); From 0ca423d59509623711e1e5ad6695f142a6431d87 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 17 Oct 2018 11:14:15 +0200 Subject: [PATCH 263/399] netifd: update to latest git HEAD 841b5d1 system-linux: enable by default ignore encaplimit for grev6 tunnels 125cbee system-linux: fix a typo in gre tunnel data parsing logic Signed-off-by: Hans Dedecker (backported from db6f9d5598a353c94578bd76dbef92dd78f3ae63) --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index f8ad3a8d998..f02ca244b1e 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2018-10-07 -PKG_SOURCE_VERSION:=d0fa124eac8bb0e35680d80ea719eada873267be -PKG_MIRROR_HASH:=eac9deaa3b422172751f7311d31b45bcebc329058e05c79d2ffa902258d4163c +PKG_SOURCE_DATE:=2018-10-17 +PKG_SOURCE_VERSION:=841b5d158708ee89d9fa870c40404469cb8e871e +PKG_MIRROR_HASH:=57710dee4c03c40bb7d8683d034f636210fae0cd0f3c0fbdebb191bd6e511888 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From b1cc8c8ef2465b2637d64ba6cae9e3a9c05fd2f1 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Mon, 19 Nov 2018 10:12:28 +0100 Subject: [PATCH 264/399] netifd: update to latest git HEAD 4b83102 treewide: switch to C-code style comments 70506bf treewide: make some functions static d9872db interface: fix removal of dynamic interfaces 2f7ef7d interface: rework code to get rid of interface_set_dynamic Signed-off-by: Hans Dedecker (backported from 8e409f476b358111113353c3d3adfcff113674b8) --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index f02ca244b1e..1cae3ea15e7 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2018-10-17 -PKG_SOURCE_VERSION:=841b5d158708ee89d9fa870c40404469cb8e871e -PKG_MIRROR_HASH:=57710dee4c03c40bb7d8683d034f636210fae0cd0f3c0fbdebb191bd6e511888 +PKG_SOURCE_DATE:=2018-11-19 +PKG_SOURCE_VERSION:=4b83102da60bf26b455ac8425a1f5e338ea01f8a +PKG_MIRROR_HASH:=74189ed52039f9d688090cba595ae722174987cd4b804d984e18bdc7ae3773f8 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From d275b30414dc71c5cd633d7e4a8cf882fc5e49d5 Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Wed, 26 Sep 2018 19:44:25 +0800 Subject: [PATCH 265/399] odhcpd-ipv6only: fix dependency for IPV6 Signed-off-by: Rosy Song (backported from 456df06071f54d3c799725227d1ac77afbe61891) --- package/network/services/odhcpd/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 03adf004551..8c9a3d72d0e 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_VERSION:=1.11 PKG_SOURCE_PROTO:=git @@ -72,6 +72,7 @@ endef define Package/odhcpd-ipv6only $(call Package/odhcpd/default) VARIANT:=ipv6only + DEPENDS+= @IPV6 endef Package/odhcpd-ipv6only/config=$(call Package/odhcpd/default/config,odhcpd-ipv6only,ipv6only) From ac7c30708f8be29016bae7490d32405713083fd5 Mon Sep 17 00:00:00 2001 From: Samuel Casa Date: Tue, 7 Aug 2018 10:49:22 +0200 Subject: [PATCH 266/399] zram-swap: remove trailing whitespaces in init script Signed-off-by: Samuel Casa [slightly reword subject] Signed-off-by: Jo-Philipp Wich (backported from b291517fdf5a698726fe94010055ec90d85f365a) --- package/system/zram-swap/files/zram.init | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 431e47c8f94..17483c8fbcf 100644 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -75,13 +75,13 @@ list_cpu_idx() if [ "$(mount | grep /dev/zram0)" ]; then local line i=1 # Hot-add new ZRAM device (if necessary) - if [ ! -b /dev/zram1 ]; then + if [ ! -b /dev/zram1 ]; then cat /sys/class/zram-control/hot_add fi else local line i=0 fi - + while read line; do { case "$line" in [Pp]rocessor*) From afd6460418dfbe9ed370a4f9ce4a8fb202f4eb7d Mon Sep 17 00:00:00 2001 From: Samuel Casa Date: Tue, 7 Aug 2018 11:16:34 +0200 Subject: [PATCH 267/399] zram-swap: Shell cosmetic Signed-off-by: Samuel Casa (backported from 65e9561b3d0546bfe6bad1840d81c0aa07b0c68d) --- package/system/zram-swap/files/zram.init | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 17483c8fbcf..63a20479d10 100644 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -16,7 +16,7 @@ zram_size() # in megabytes if [ -z "$zram_size" ]; then # e.g. 6mb for 16mb-routers or 61mb for 128mb-routers - echo $(( $ram_size / 2048 )) + echo $(( ram_size / 2048 )) else echo "$zram_size" fi @@ -72,7 +72,7 @@ zram_reset() list_cpu_idx() { # Offset by 1 if /dev/zram0 is in use by /tmp - if [ "$(mount | grep /dev/zram0)" ]; then + if mount | grep -q /dev/zram0; then local line i=1 # Hot-add new ZRAM device (if necessary) if [ ! -b /dev/zram1 ]; then @@ -86,7 +86,7 @@ list_cpu_idx() case "$line" in [Pp]rocessor*) echo $i - i=$(( $i + 1 )) + i=$(( i + 1 )) ;; esac } done <"/proc/cpuinfo" @@ -107,7 +107,7 @@ start() logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MegaBytes)" zram_reset "$zram_dev" "enforcing defaults" - echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename $zram_dev )/disksize" + echo $(( zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" swapon "$zram_dev" } done From 5ff4ea6bc4d2bff3407e5ec509ff779ccf66782c Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Thu, 2 Aug 2018 00:15:44 +0300 Subject: [PATCH 268/399] zram-swap: compression algorithm configuration option Compression algorithms for zram are provided by kernel crypto API, could be any of [lzo|zl4|deflate|] depending on kernel modules. Compress algo for zram-swap could be defined via 'zram_comp_algo' option in 'system' section of '/etc/config/system' file, or via cli (for e.x. with 'uci set system.@System[0].zram_comp_algo=lz4 && uci commit system'). check available algo's via 'cat /sys/block/zram0 /comp_algorithm' Signed-off-by: Emil Muratov (backported from b9e89adfb7881806d01e3bd259852e352f3b3ce8) --- package/system/zram-swap/files/zram.init | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 63a20479d10..419221b1a3a 100644 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -69,6 +69,23 @@ zram_reset() echo "1" >"$proc_entry" } +zram_comp_algo() +{ + local dev="$1" + local zram_comp_algo="$( uci -q get system.@system[0].zram_comp_algo )" + + if [ -z "$zram_comp_algo" ] || [ ! -e /sys/block/$( basename $dev )/comp_algorithm ]; then + return 0 + fi + + if [ `grep -c "$zram_comp_algo" /sys/block/$( basename $dev )/comp_algorithm` -ne 0 ]; then + logger -s -t zram_comp_algo -p daemon.debug "Set compression algorithm '$zram_comp_algo' for zram '$dev'" + echo $zram_comp_algo > "/sys/block/$( basename $dev )/comp_algorithm" + else + logger -s -t zram_comp_algo -p daemon.debug "Compression algorithm '$zram_comp_algo' is not supported for '$dev'" + fi +} + list_cpu_idx() { # Offset by 1 if /dev/zram0 is in use by /tmp @@ -108,6 +125,7 @@ start() zram_reset "$zram_dev" "enforcing defaults" echo $(( zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" + zram_comp_algo "$zram_dev" mkswap "$zram_dev" swapon "$zram_dev" } done From 9a5509736a8e58d294f0d977a619cd8940845453 Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Thu, 2 Aug 2018 00:18:45 +0300 Subject: [PATCH 269/399] zram-swap: fix zram dev reset for multicore cpu devices * "zram stop" could reset up to $(num_of_cores) zram devices even if some of those were not mounted as swap dev's. This fix tries to enumerate mounted swap zram dev's before making a reset * remove hot-added zram devs on stop (except zram0) Signed-off-by: Emil Muratov (backported from 9edc1fe8abac6638cd05640279bc741a23b8d260) --- package/system/zram-swap/files/zram.init | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 419221b1a3a..1eba3f4d98b 100644 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -133,18 +133,16 @@ start() stop() { - local zram_dev proc_entry - - for core in $( list_cpu_idx ); do { - zram_dev="$( zram_dev "$core" )" - proc_entry="/sys/block/$( basename "$zram_dev" )/reset" - - grep -sq ^"$zram_dev " /proc/swaps && { - logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev" - swapoff "$zram_dev" - } - - zram_reset "$zram_dev" "claiming memory back" + local zram_dev + + for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do { + logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev" + swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back" + local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )" + if [ $dev_index -ne 0 ]; then + logger -s -t zram_stop -p daemon.debug "removing zram $zram_dev" + echo $dev_index > /sys/class/zram-control/hot_remove + fi } done } From 2d4b52707dd6892a1d42a3aced04ebec76cf9b52 Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Thu, 2 Aug 2018 00:50:00 +0300 Subject: [PATCH 270/399] zram-swap: fix number of created zram devices for multicore CPU's Use only one zram swap device of the specified $size instead of [N x $size] devices for multicore CPUs Now zram module uses multiple compression streams for each dev by default, so we do not need to create several zram devs to utilize multicore CPUs. Signed-off-by: Emil Muratov (backported from 814cae7362c3bd57e8fd9305d5d0b48ff219d4d0) --- package/system/zram-swap/files/zram.init | 74 ++++++++++-------------- 1 file changed, 29 insertions(+), 45 deletions(-) mode change 100644 => 100755 package/system/zram-swap/files/zram.init diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init old mode 100644 new mode 100755 index 1eba3f4d98b..2db986f9a8b --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -26,11 +26,6 @@ zram_applicable() { local zram_dev="$1" - grep -sq ^"$zram_dev " /proc/swaps && { - logger -s -t zram_applicable -p daemon.notice "[OK] '$zram_dev' already active" - return 1 - } - [ -e "$zram_dev" ] || { logger -s -t zram_applicable -p daemon.crit "[ERROR] device '$zram_dev' not found" return 1 @@ -54,9 +49,8 @@ zram_applicable() zram_dev() { - local core="$1" - - echo "/dev/zram${core:-0}" + local idx="$1" + echo "/dev/zram${idx:-0}" } zram_reset() @@ -69,6 +63,19 @@ zram_reset() echo "1" >"$proc_entry" } +zram_getdev() +{ + #get unallocated zram dev + local zdev=$( zram_dev ) + + if [ "$(mount | grep $zdev)" ]; then + local idx=`cat /sys/class/zram-control/hot_add` + zdev="$( zram_dev $idx )" + fi + + echo $zdev +} + zram_comp_algo() { local dev="$1" @@ -86,49 +93,26 @@ zram_comp_algo() fi } -list_cpu_idx() -{ - # Offset by 1 if /dev/zram0 is in use by /tmp - if mount | grep -q /dev/zram0; then - local line i=1 - # Hot-add new ZRAM device (if necessary) - if [ ! -b /dev/zram1 ]; then - cat /sys/class/zram-control/hot_add - fi - else - local line i=0 - fi - - while read line; do { - case "$line" in - [Pp]rocessor*) - echo $i - i=$(( i + 1 )) - ;; - esac - } done <"/proc/cpuinfo" -} - start() { - # http://shmilyxbq-compcache.googlecode.com/hg/README - # if >1 cpu_core, reinit kmodule with e.g. num_devices=4 - local zram_size="$( zram_size )" - local zram_dev core + local zram_dev - for core in $( list_cpu_idx ); do { - zram_dev="$( zram_dev "$core" )" - zram_applicable "$zram_dev" || return 1 + if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then + logger -s -t zram_start -p daemon.notice "[OK] zram swap is already mounted" + return 1 + fi - logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MegaBytes)" + zram_dev="$( zram_getdev )" + zram_applicable "$zram_dev" || return 1 - zram_reset "$zram_dev" "enforcing defaults" - echo $(( zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" - zram_comp_algo "$zram_dev" - mkswap "$zram_dev" - swapon "$zram_dev" - } done + logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MegaBytes)" + + zram_reset "$zram_dev" "enforcing defaults" + zram_comp_algo "$zram_dev" + echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" + mkswap "$zram_dev" + swapon "$zram_dev" } stop() From 24326581281361f0d66f8bd40ac4c598d16fbc4b Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Thu, 2 Aug 2018 01:05:14 +0300 Subject: [PATCH 271/399] zram-swap: Add "max compression streams" configuration option Config option to limit maximum compression streams per zram dev for multicore CPU's. This could be defined via 'zram_comp_streams' option in the 'system' section of '/etc/config/system' file or via cli (for e.x. with 'uci set system.@System[0].zram_comp_streams=2 && uci commit system'). Default is number of logical CPU cores. Signed-off-by: Emil Muratov (backported from 70d3ffb47fcef901e4d86da4c9077ba8b8e2ba10) --- package/system/zram-swap/files/zram.init | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index 2db986f9a8b..9fd4089c6bc 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -93,6 +93,19 @@ zram_comp_algo() fi } +zram_comp_streams() +{ + local dev="$1" + local logical_cpus=$( grep -ci "^processor" /proc/cpuinfo ) + [ $logical_cpus -gt 1 ] || return 1 + local zram_comp_streams="$( uci -q get system.@system[0].zram_comp_streams )" + [ -n "$zram_comp_streams" ] && [ "$zram_comp_streams" -le "$logical_cpus" ] || zram_comp_streams=$logical_cpus + if [ -e /sys/block/$( basename $dev )/max_comp_streams ]; then + logger -s -t zram_comp_streams -p daemon.debug "Set max compression streams to '$zram_comp_streams' for zram '$dev'" + echo $zram_comp_streams > /sys/block/$( basename $dev )/max_comp_streams + fi +} + start() { local zram_size="$( zram_size )" @@ -110,6 +123,7 @@ start() zram_reset "$zram_dev" "enforcing defaults" zram_comp_algo "$zram_dev" + zram_comp_streams "$zram_dev" echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize" mkswap "$zram_dev" swapon "$zram_dev" From 52e9f03b49f06fcf2757999a6b570d920627fdb0 Mon Sep 17 00:00:00 2001 From: Emil Muratov Date: Tue, 25 Sep 2018 12:24:28 +0300 Subject: [PATCH 272/399] zram-swap: bump pkg version Signed-off-by: Emil Muratov (backported from bbf46c9f8feea755ceb8e33ccf91733c1c2b2a34) --- package/system/zram-swap/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile index bd84d79b012..99dd9a675f2 100644 --- a/package/system/zram-swap/Makefile +++ b/package/system/zram-swap/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zram-swap -PKG_VERSION:=1 +PKG_VERSION:=1.1 PKG_RELEASE:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) From ea08a29d2a1c53a60fca8a8fdf241a7099bc9846 Mon Sep 17 00:00:00 2001 From: Syrone Wong Date: Mon, 1 Oct 2018 10:56:04 +0800 Subject: [PATCH 273/399] ipset: update to 6.38 dropped already upstream patch Signed-off-by: Syrone Wong (backported from 68f109609b613b38bb3b2e6e82a9c04ae8bd011f) --- package/network/utils/ipset/Makefile | 4 +-- ...t-reference-to-u_int8_t-with-uint8_t.patch | 25 ------------------- 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 55b7c493de2..6dad4cb6f5f 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ipset -PKG_VERSION:=6.34 +PKG_VERSION:=6.38 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ipset.netfilter.org -PKG_HASH:=d70e831b670b7aa25dde81fd994d3a7ce0c0e801559a557105576df66cd8d680 +PKG_HASH:=ceef625ba31fe0aaa422926c7231a819de0b07644c02c17ebdd3022a29e3e244 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch deleted file mode 100644 index 745e9fa3b36..00000000000 --- a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a4212bf911026740afc7fce98d9100e2ef5dcea0 Mon Sep 17 00:00:00 2001 -From: Jozsef Kadlecsik -Date: Tue, 26 Sep 2017 07:00:13 +0200 -Subject: [PATCH] Replace the last reference to u_int8_t with uint8_t. - ---- - src/ipset.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ipset.c b/src/ipset.c -index 79f56b8..df0778a 100644 ---- a/src/ipset.c -+++ b/src/ipset.c -@@ -282,7 +282,7 @@ call_parser(int *argc, char *argv[], const struct ipset_type *type, - const struct ipset_arg *arg; - const char *optstr; - const struct ipset_type *t = type; -- u_int8_t revision = type->revision; -+ uint8_t revision = type->revision; - int ret = 0, i = 1; - - /* Currently CREATE and ADT may have got additional arguments */ --- -2.13.5 - From 0d8ef978744e8e37ad67e8bda8298520dd3aa271 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 6 Oct 2018 21:23:53 +0200 Subject: [PATCH 274/399] ubus: update to latest git HEAD 221ce7e ubusd_acl: event send access list support da503db ubusd_acl: event listen access list support c035bab ubusd_acl: rework wildcard support 73bd847 ubusd_event: move strmatch_len to ubus_common.h 0327a91 ubus/lua: add support for BLOBMSG_TYPE_DOUBLE Signed-off-by: Hans Dedecker (backported from f771a1b96277e3553b46746decdf24fbf00a8997) --- package/system/ubus/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 09ddd8de924..ef492d2c65c 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2018-07-26 -PKG_SOURCE_VERSION:=40e0931e70bfe198690a7dac43b32fad06f46ef9 -PKG_MIRROR_HASH:=ddf8a42ff9a88a81b87058887d79a4eea6f2d606a29f168422d41112702793e5 +PKG_SOURCE_DATE:=2018-10-06 +PKG_SOURCE_VERSION:=221ce7e7ff1bd1a0c9995fa9d32f58e865f7207f +PKG_MIRROR_HASH:=e6ab3f009688740eb6d7a1857df59a6ba10ae8ae0fac78ae0fd6672f71c02dce CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 From 0609ea0bf0de21a2a3f1d9c423c60c717b496954 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 3 Oct 2018 08:57:00 +0200 Subject: [PATCH 275/399] iw: add iw-full package without size reduction hacks Signed-off-by: Felix Fietkau (backported from 8c647e873f9adf4527e61684458075f8d2b61a97) --- package/network/utils/iw/Makefile | 17 +++++++ .../utils/iw/patches/200-reduce_size.patch | 46 +++++++++++-------- 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index 912fc3e28d2..a11768268c4 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -15,6 +15,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/iw PKG_HASH:=f01671c0074bfdec082a884057edba1b9efd35c89eda554638496f03b769ad89 +PKG_BUILD_DIR:=$(BUILD_DIR)/iw-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 @@ -26,6 +27,14 @@ define Package/iw TITLE:=cfg80211 interface configuration utility URL:=http://wireless.kernel.org/en/users/Documentation/iw DEPENDS:= +libnl-tiny + VARIANT:=tiny +endef + +define Package/iw-full + $(Package/iw) + TITLE += (full version) + VARIANT:=full + PROVIDES:=iw endef define Build/Configure @@ -40,6 +49,11 @@ TARGET_CPPFLAGS:= \ -DCONFIG_LIBNL20 \ -D_GNU_SOURCE +ifeq ($(BUILD_VARIANT),full) + TARGET_CPPFLAGS += -DIW_FULL + MAKE_FLAGS += IW_FULL=1 +endif + MAKE_FLAGS += \ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -ffunction-sections -fdata-sections" \ LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ @@ -53,4 +67,7 @@ define Package/iw/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/iw $(1)/usr/sbin/ endef +Package/iw-full/install=$(Package/iw/install) + $(eval $(call BuildPackage,iw)) +$(eval $(call BuildPackage,iw-full)) diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch index 36fe0ff7461..3663c1e0a57 100644 --- a/package/network/utils/iw/patches/200-reduce_size.patch +++ b/package/network/utils/iw/patches/200-reduce_size.patch @@ -4,7 +4,7 @@ } switch (gnlh->cmd) { -+#if 0 ++#ifdef IW_FULL case NL80211_CMD_NEW_WIPHY: printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME])); break; @@ -20,7 +20,7 @@ mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); printf("del station %s\n", macbuf); break; -+#if 0 ++#ifdef IW_FULL case NL80211_CMD_JOIN_IBSS: mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC])); printf("IBSS %s joined\n", macbuf); @@ -42,7 +42,7 @@ } } -+#if 0 ++#ifdef IW_FULL if (tb_band[NL80211_BAND_ATTR_RATES]) { printf("\t\tBitrates (non-HT):\n"); nla_for_each_nested(nl_rate, tb_band[NL80211_BAND_ATTR_RATES], rem_rate) { @@ -58,7 +58,7 @@ printf("\tCoverage class: %d (up to %dm)\n", coverage, 450 * coverage); } -+#if 0 ++#ifdef IW_FULL if (tb_msg[NL80211_ATTR_CIPHER_SUITES]) { int num = nla_len(tb_msg[NL80211_ATTR_CIPHER_SUITES]) / sizeof(__u32); int i; @@ -74,7 +74,7 @@ printf("\t\t * %s\n", iftype_name(nla_type(nl_mode))); } -+#if 0 ++#ifdef IW_FULL if (tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES]) { printf("\tsoftware interface modes (can always be added):\n"); nla_for_each_nested(nl_mode, tb_msg[NL80211_ATTR_SOFTWARE_IFTYPES], rem_mode) @@ -88,7 +88,7 @@ printf("\tinterface combinations are not supported\n"); } -+#if 0 ++#ifdef IW_FULL if (tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS]) { printf("\tSupported commands:\n"); nla_for_each_nested(nl_cmd, tb_msg[NL80211_ATTR_SUPPORTED_COMMANDS], rem_cmd) @@ -104,7 +104,7 @@ } } -+#if 0 ++#ifdef IW_FULL if (tb_msg[NL80211_ATTR_FEATURE_FLAGS]) { unsigned int features = nla_get_u32(tb_msg[NL80211_ATTR_FEATURE_FLAGS]); @@ -120,7 +120,7 @@ "List all wireless devices and their capabilities."); TOPLEVEL(phy, NULL, NL80211_CMD_GET_WIPHY, NLM_F_DUMP, CIB_NONE, handle_info, NULL); -+#if 0 ++#ifdef IW_FULL static int handle_commands(struct nl80211_state *state, struct nl_msg *msg, int argc, char **argv, enum id_input id) { @@ -153,7 +153,7 @@ + [114] = { "MESH ID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), }, + [191] = { "VHT capabilities", print_vht_capa, 12, 255, BIT(PRINT_SCAN), }, + [192] = { "VHT operation", print_vht_oper, 5, 255, BIT(PRINT_SCAN), }, -+#if 0 ++#ifdef IW_FULL [1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), }, [3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), }, [5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), }, @@ -184,7 +184,7 @@ ieprinters[ie[0]].flags & BIT(ptype)) { print_ie(&ieprinters[ie[0]], ie[0], ie[1], ie + 2, &ie_buffer); -+#if 0 ++#ifdef IW_FULL } else if (ie[0] == 221 /* vendor */) { print_vendor(ie[1], ie + 2, unknown, ptype); } else if (unknown) { @@ -200,7 +200,7 @@ printf(" ESS"); if (capa & WLAN_CAPABILITY_IBSS) printf(" IBSS"); -+#if 0 ++#ifdef IW_FULL if (capa & WLAN_CAPABILITY_CF_POLLABLE) printf(" CfPollable"); if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST) @@ -216,7 +216,7 @@ if (bss[NL80211_BSS_FREQUENCY]) { int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]); printf("\tfreq: %d\n", freq); -+#if 0 ++#ifdef IW_FULL if (freq > 45000) is_dmg = true; +#endif @@ -227,7 +227,7 @@ return 0; } -+#if 0 ++#ifdef IW_FULL COMMAND(scan, sched_start, SCHED_SCAN_OPTIONS, NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan, @@ -242,7 +242,7 @@ static char cmdbuf[100]; -+#if 0 ++#ifdef IW_FULL const char *command_name(enum nl80211_commands cmd) { if (cmd <= NL80211_CMD_MAX && commands[cmd]) @@ -254,22 +254,28 @@ int ieee80211_channel_to_frequency(int chan, enum nl80211_band band) { -@@ -426,6 +428,7 @@ int parse_keys(struct nl_msg *msg, char +@@ -426,6 +428,9 @@ int parse_keys(struct nl_msg *msg, char char keybuf[13]; int pos = 0; ++#ifndef IW_FULL + return 1; ++#endif if (!argc) return 1; --- a/Makefile +++ b/Makefile -@@ -25,6 +25,8 @@ OBJS-$(HWSIM) += hwsim.o +@@ -25,6 +25,12 @@ OBJS-$(HWSIM) += hwsim.o OBJS += $(OBJS-y) $(OBJS-Y) -+OBJS_DISABLED = ocb offch cqm wowlan coalesce roc p2p ap -+OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_DISABLED)),$(OBJS)) ++OBJS_FULL = ocb offch cqm wowlan coalesce roc p2p ap ++ifdef IW_FULL ++ CFLAGS += -DIW_FULL ++else ++ OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_DISABLED)),$(OBJS)) ++endif ALL = iw ifeq ($(NO_PKG_CONFIG),) @@ -279,7 +285,7 @@ nla_put_failure: return -ENOBUFS; } -+#if 0 ++#ifdef IW_FULL COMMAND_ALIAS(station, set, " plink_action ", NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_plink, "Set mesh peer link action for this station (peer).", @@ -292,7 +298,7 @@ nla_put_failure: return -ENOBUFS; } -+#if 0 ++#ifdef IW_FULL COMMAND_ALIAS(station, set, " mesh_power_mode " "", NL80211_CMD_SET_STATION, 0, CIB_NETDEV, handle_station_set_mesh_power_mode, From ab1b46870153e7cdf8acab189d6d04d97a056a6c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 7 Oct 2018 10:35:08 +0200 Subject: [PATCH 276/399] iw: fix filtering linked object files for iw-tiny It was broken by the recent commit that added iw-full Signed-off-by: Felix Fietkau (backported from 7999282f7f1a1ab8a965f4b5efe31a4209bac0a6) --- package/network/utils/iw/patches/200-reduce_size.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch index 3663c1e0a57..bf5d038609c 100644 --- a/package/network/utils/iw/patches/200-reduce_size.patch +++ b/package/network/utils/iw/patches/200-reduce_size.patch @@ -274,7 +274,7 @@ +ifdef IW_FULL + CFLAGS += -DIW_FULL +else -+ OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_DISABLED)),$(OBJS)) ++ OBJS:=$(filter-out $(patsubst %,%.o,$(OBJS_FULL)),$(OBJS)) +endif ALL = iw From dc78c70d5c0749c983239895ec75bdd2b8328aa1 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 7 Oct 2018 10:48:31 +0200 Subject: [PATCH 277/399] iw: strip a few more non-essential features from iw-tiny Signed-off-by: Felix Fietkau (backported from 518fb345e110f7028912211ebf75af92c7c10809) --- .../utils/iw/patches/200-reduce_size.patch | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch index bf5d038609c..5f4bce6a8bc 100644 --- a/package/network/utils/iw/patches/200-reduce_size.patch +++ b/package/network/utils/iw/patches/200-reduce_size.patch @@ -270,7 +270,7 @@ OBJS += $(OBJS-y) $(OBJS-Y) -+OBJS_FULL = ocb offch cqm wowlan coalesce roc p2p ap ++OBJS_FULL = ocb offch cqm wowlan coalesce roc p2p ap mgmt vendor +ifdef IW_FULL + CFLAGS += -DIW_FULL +else @@ -308,3 +308,48 @@ static int handle_station_dump(struct nl80211_state *state, struct nl_msg *msg, +--- a/interface.c ++++ b/interface.c +@@ -615,9 +615,11 @@ static int handle_interface_wds_peer(str + nla_put_failure: + return -ENOBUFS; + } ++#ifdef IW_FULL + COMMAND(set, peer, "", + NL80211_CMD_SET_WDS_PEER, 0, CIB_NETDEV, handle_interface_wds_peer, + "Set interface WDS peer."); ++#endif + + static int set_mcast_rate(struct nl80211_state *state, + struct nl_msg *msg, +@@ -707,6 +709,7 @@ static int handle_chan(struct nl80211_st + return handle_chanfreq(state, msg, true, argc, argv, id); + } + ++#ifdef IW_FULL + SECTION(switch); + COMMAND(switch, freq, + " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]\n" +@@ -715,3 +718,4 @@ COMMAND(switch, freq, + "Switch the operating channel by sending a channel switch announcement (CSA)."); + COMMAND(switch, channel, " [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz] [beacons ] [block-tx]", + NL80211_CMD_CHANNEL_SWITCH, 0, CIB_NETDEV, handle_chan, NULL); ++#endif +--- a/phy.c ++++ b/phy.c +@@ -359,6 +359,7 @@ static int handle_cac(struct nl80211_sta + + return 0; + } ++#ifdef IW_FULL + TOPLEVEL(cac, "channel [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [NOHT|HT20|HT40+|HT40-|5MHz|10MHz|80MHz]\n" + "freq [5|10|20|40|80|80+80|160] [ []]", +@@ -370,6 +371,7 @@ COMMAND(cac, trigger, + NL80211_CMD_RADAR_DETECT, 0, CIB_NETDEV, handle_cac_trigger, + "Start or trigger a channel availability check (CAC) looking to look for\n" + "radars on the given channel."); ++#endif + + static int handle_fragmentation(struct nl80211_state *state, + struct nl_msg *msg, From d5dd3b113465de1ba1156a0c34284bb33f7f0460 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sun, 7 Oct 2018 15:04:49 +0200 Subject: [PATCH 278/399] odhcpd: update to latest git HEAD (FS#1853) 57f639e (HEAD -> master, origin/master, origin/HEAD) odhcpd: make DHCPv6/RA/NDP support optional 402c274 dhcpv6: check return code of dhcpv6_ia_init() ee7472a router: don't leak RA message in relay mode (FS#1853) Signed-off-by: Hans Dedecker (backported from af78e90d4cdb3c944d9c4f3d4d4648dd67886c4d) --- package/network/services/odhcpd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 8c9a3d72d0e..e3a4214bf93 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=3 -PKG_VERSION:=1.11 +PKG_VERSION:=1.12 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2018-09-05 -PKG_SOURCE_VERSION:=881f66b0c2526bff6a2a51b30d314c512df813b4 -PKG_MIRROR_HASH:=b339004f83974ea6fa7ef04f3a815644f832c2d24d186faddbeb5ea20c908a1e +PKG_SOURCE_DATE:=2018-10-07 +PKG_SOURCE_VERSION:=57f639e3b0288c2ec12cdfb8598a182293746a0a +PKG_MIRROR_HASH:=2cf81f6044ac3a325481c3f0a754773c74fca6fb5cf3a44d4105e43df47cdbf8 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 1c56c3d2530c6bbf7630dacb0506310ceefdc83a Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 17 Oct 2018 11:02:05 +0200 Subject: [PATCH 279/399] gre: make encaplimit support configurable Make inclusion of the destination option header containing the tunnel encapsulation limit configurable for IPv6 GRE packets. Setting the uci parameter encaplimit to ignore; allows to disable the insertion of the destination option header in the IPv6 GRE packets. Otherwise the tunnel encapsulation limit value can be set to a value from 0 till 255 by setting the encaplimit uci parameter accordingly. Signed-off-by: Hans Dedecker (backported from 3d015e971f5e3f0df8e8ab149fda1270c5c72507) --- package/network/config/gre/Makefile | 2 +- package/network/config/gre/files/gre.sh | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index 73319e80cff..a7e8612c6ca 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre PKG_VERSION:=1 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/files/gre.sh b/package/network/config/gre/files/gre.sh index e604bfb259a..ca11e87cfd4 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -39,6 +39,7 @@ gre_generic_setup() { [ -n "$ocsum" ] && json_add_boolean ocsum "$ocsum" [ -n "$iseqno" ] && json_add_boolean iseqno "$iseqno" [ -n "$oseqno" ] && json_add_boolean oseqno "$oseqno" + [ -n "$encaplimit" ] && json_add_string encaplimit "$encaplimit" json_close_object proto_close_tunnel @@ -133,7 +134,7 @@ grev6_setup() { local remoteip6 local ip6addr peer6addr weakif - json_get_vars ip6addr peer6addr tunlink weakif + json_get_vars ip6addr peer6addr tunlink weakif encaplimit [ -z "$peer6addr" ] && { proto_notify_error "$cfg" "MISSING_PEER_ADDRESS" @@ -274,6 +275,7 @@ proto_grev6_init_config() { proto_config_add_string "ip6addr" proto_config_add_string "peer6addr" proto_config_add_string "weakif" + proto_config_add_string "encaplimit" } proto_grev6tap_init_config() { From 5d8040455e42fae401cd8f1d7d87874e71e10ffe Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 10 Apr 2018 16:29:05 +0200 Subject: [PATCH 280/399] uqmi: fix indenting fix indenting Signed-off-by: Florian Eckert (backported from 692c6d9a5dbb955d00516b465271fd8a053af206) --- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index c60cae653a4..5b34185f320 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -158,7 +158,7 @@ proto_qmi_setup() { ${password:+--password $password} \ ${autoconnect:+--autoconnect}) - # pdh_4 is a numeric value on success + # pdh_4 is a numeric value on success if ! [ "$pdh_4" -eq "$pdh_4" ] 2> /dev/null; then echo "Unable to connect IPv4" uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds @@ -166,14 +166,14 @@ proto_qmi_setup() { return 1 fi - # Check data connection state + # Check data connection state connstat=$(uqmi -s -d "$device" --get-data-status) - [ "$connstat" == '"connected"' ] || { - echo "No data link!" - uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds - proto_notify_error "$interface" CALL_FAILED - return 1 - } + [ "$connstat" == '"connected"' ] || { + echo "No data link!" + uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds + proto_notify_error "$interface" CALL_FAILED + return 1 + } } [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { @@ -195,7 +195,7 @@ proto_qmi_setup() { ${password:+--password $password} \ ${autoconnect:+--autoconnect}) - # pdh_6 is a numeric value on success + # pdh_6 is a numeric value on success if ! [ "$pdh_6" -eq "$pdh_6" ] 2> /dev/null; then echo "Unable to connect IPv6" uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds @@ -203,14 +203,14 @@ proto_qmi_setup() { return 1 fi - # Check data connection state + # Check data connection state connstat=$(uqmi -s -d "$device" --get-data-status) - [ "$connstat" == '"connected"' ] || { - echo "No data link!" - uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds - proto_notify_error "$interface" CALL_FAILED - return 1 - } + [ "$connstat" == '"connected"' ] || { + echo "No data link!" + uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds + proto_notify_error "$interface" CALL_FAILED + return 1 + } } echo "Setting up $ifname" From 860e2dac40db3d14c241302ead9702b0753e7f8a Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 12 Apr 2018 13:10:33 +0200 Subject: [PATCH 281/399] uqmi: redirect uqmi commands output to /dev/null Move uqmi std and error output on commands without using them to /dev/null. This will remove useless outputs in the syslog. Signed-off-by: Florian Eckert (backported from 2d57aa9c4c852e847e66a3bb5c775910d0cb8d77) --- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 5b34185f320..b2d73452117 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -90,7 +90,7 @@ proto_qmi_setup() { mnc=${plmn:3} echo "Setting PLMN to $plmn" fi - uqmi -s -d "$device" --set-plmn --mcc "$mcc" --mnc "$mnc" || { + uqmi -s -d "$device" --set-plmn --mcc "$mcc" --mnc "$mnc" > /dev/null 2>&1 || { echo "Unable to set PLMN" proto_notify_error "$interface" PLMN_FAILED proto_block_restart "$interface" @@ -99,11 +99,11 @@ proto_qmi_setup() { } # Cleanup current state if any - uqmi -s -d "$device" --stop-network 0xffffffff --autoconnect + uqmi -s -d "$device" --stop-network 0xffffffff --autoconnect > /dev/null 2>&1 # Set IP format - uqmi -s -d "$device" --set-data-format 802.3 - uqmi -s -d "$device" --wda-set-data-format 802.3 + uqmi -s -d "$device" --set-data-format 802.3 > /dev/null 2>&1 + uqmi -s -d "$device" --wda-set-data-format 802.3 > /dev/null 2>&1 dataformat="$(uqmi -s -d "$device" --wda-get-data-format)" if [ "$dataformat" = '"raw-ip"' ]; then @@ -117,7 +117,7 @@ proto_qmi_setup() { echo "Y" > /sys/class/net/$ifname/qmi/raw_ip fi - uqmi -s -d "$device" --sync + uqmi -s -d "$device" --sync > /dev/null 2>&1 echo "Waiting for network registration" while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do @@ -125,7 +125,7 @@ proto_qmi_setup() { sleep 5; done - [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" + [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1 echo "Starting network $interface" @@ -147,7 +147,7 @@ proto_qmi_setup() { return 1 fi - uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4 > /dev/null + uqmi -s -d "$device" --set-client-id wds,"$cid_4" --set-ip-family ipv4 > /dev/null 2>&1 pdh_4=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ --start-network \ @@ -161,7 +161,7 @@ proto_qmi_setup() { # pdh_4 is a numeric value on success if ! [ "$pdh_4" -eq "$pdh_4" ] 2> /dev/null; then echo "Unable to connect IPv4" - uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds + uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds > /dev/null 2>&1 proto_notify_error "$interface" CALL_FAILED return 1 fi @@ -170,7 +170,7 @@ proto_qmi_setup() { connstat=$(uqmi -s -d "$device" --get-data-status) [ "$connstat" == '"connected"' ] || { echo "No data link!" - uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds + uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds > /dev/null 2>&1 proto_notify_error "$interface" CALL_FAILED return 1 } @@ -184,7 +184,7 @@ proto_qmi_setup() { return 1 fi - uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6 > /dev/null + uqmi -s -d "$device" --set-client-id wds,"$cid_6" --set-ip-family ipv6 > /dev/null 2>&1 pdh_6=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ --start-network \ @@ -198,7 +198,7 @@ proto_qmi_setup() { # pdh_6 is a numeric value on success if ! [ "$pdh_6" -eq "$pdh_6" ] 2> /dev/null; then echo "Unable to connect IPv6" - uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds + uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds > /dev/null 2>&1 proto_notify_error "$interface" CALL_FAILED return 1 fi @@ -207,7 +207,7 @@ proto_qmi_setup() { connstat=$(uqmi -s -d "$device" --get-data-status) [ "$connstat" == '"connected"' ] || { echo "No data link!" - uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds + uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds > /dev/null 2>&1 proto_notify_error "$interface" CALL_FAILED return 1 } From 251f4fd20e7c70565b9753743bd27bf96000061e Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 12 Apr 2018 13:29:34 +0200 Subject: [PATCH 282/399] uqmi: add timeout option value This value will be used for now during following situations: * Ask the sim with the uqmi --get-pin-status command. * Wait for network registration with the uqmi --get-serving-system command. This two commands wait forever in a while loop. Add a timeout to stop waiting and so inform netifd. Signed-off-by: Florian Eckert (backported from dee93def394c9bf10d2cc3eb64d9e190ca461a67) --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index b2d73452117..a0dcb17cde0 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -22,17 +22,20 @@ proto_qmi_init_config() { proto_config_add_boolean dhcpv6 proto_config_add_boolean autoconnect proto_config_add_int plmn + proto_config_add_int timeout proto_config_add_defaults } proto_qmi_setup() { local interface="$1" local dataformat connstat - local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn $PROTO_DEFAULT_OPTIONS + local device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn timeout $PROTO_DEFAULT_OPTIONS local ip4table ip6table local cid_4 pdh_4 cid_6 pdh_6 local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 - json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn ip4table ip6table $PROTO_DEFAULT_OPTIONS + json_get_vars device apn auth username password pincode delay modes pdptype profile dhcpv6 autoconnect plmn ip4table ip6table timeout $PROTO_DEFAULT_OPTIONS + + [ "$timeout" = "" ] && timeout="10" [ "$metric" = "" ] && metric="0" From 5c10aaa65b1cb054d584b5abad73582975864e19 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 11 Oct 2018 16:30:55 +0200 Subject: [PATCH 283/399] uqmi: fix variable initilization for timeout handling Also add logging output for SIM initilization. Signed-off-by: Florian Eckert (backported from 71865200c95d5ccebe01980c88ee44a15888bcaf) --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index a0dcb17cde0..560c0b9459e 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -68,6 +68,8 @@ proto_qmi_setup() { return 1 } + echo "Waiting for SIM initialization" + local uninitialized_timeout=0 while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do [ -e "$device" ] || return 1 sleep 1; From 1e012fd697d87a2ace9e0c2e046a206b377dc18c Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 12 Apr 2018 13:20:49 +0200 Subject: [PATCH 284/399] uqmi: do not block proto handler if modem is unable to registrate QMI proto setup-handler will wait forever if it is unable to registrate to the mobile network. To fix this stop polling network registration status and notify netifd. Netifd will generate then a "ifup-failed" ACTION. Signed-off-by: Florian Eckert (backported from dec1bfa0f48d43174921d1a1357a4842f9ba0cf6) --- .../network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 560c0b9459e..f1a939763a1 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -125,9 +125,18 @@ proto_qmi_setup() { uqmi -s -d "$device" --sync > /dev/null 2>&1 echo "Waiting for network registration" + local registration_timeout=0 while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do [ -e "$device" ] || return 1 - sleep 5; + if [ "$registration_timeout" -lt "$timeout" ]; then + let registration_timeout++ + sleep 1; + else + echo "Network registration failed" + proto_notify_error "$interface" NETWORK_REGISTRATION_FAILED + proto_block_restart "$interface" + return 1 + fi done [ -n "$modes" ] && uqmi -s -d "$device" --set-network-modes "$modes" > /dev/null 2>&1 From 5a3810b386040a6424ba2f16c7805eb492002fb8 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 10 Apr 2018 15:56:24 +0200 Subject: [PATCH 285/399] uqmi: do not block proto handler if SIM is uninitialized QMI proto setup-handler will wait forever if SIM does not get initialized. To fix this stop polling pin status and notify netifd. Netifd will generate then a "ifup-failed" ACTION. Signed-off-by: Florian Eckert (backported from f171a86d064ac3fcfff05d286becae87c2e26b5f) --- .../network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index f1a939763a1..759be62a425 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -72,7 +72,15 @@ proto_qmi_setup() { local uninitialized_timeout=0 while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do [ -e "$device" ] || return 1 - sleep 1; + if [ "$uninitialized_timeout" -lt "$timeout" ]; then + let uninitialized_timeout++ + sleep 1; + else + echo "SIM not initialized" + proto_notify_error "$interface" SIM_NOT_INITIALIZED + proto_block_restart "$interface" + return 1 + fi done [ -n "$pincode" ] && { From 4f02bee9bbc77f65920f0a96afe429dc2e973b1d Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 10 Apr 2018 12:55:11 +0200 Subject: [PATCH 286/399] uqmi: evaluate pin-status output in qmi_setup function Load the json output from uqmi --get-pin-status command and evaluate the "pin1_status" value. The following uqmi "pin1_status" values are evaluated: - disabled Do not verify PIN because SIM verification is disabled on this SIM - blocked Stop qmi_setup because SIM is locked and a PUK is required - not_verified SIM is not yet verified. Do a uqmi --verify-pin1 command if a SIM is specified - verified: Do not verify the PIN because this was already done before Signed-off-by: Florian Eckert (backported from 4b80bd878d0fcb520f4811097900ebb5478a74fd) --- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 759be62a425..422d00525ef 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -83,14 +83,56 @@ proto_qmi_setup() { fi done - [ -n "$pincode" ] && { - uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || { - echo "Unable to verify PIN" - proto_notify_error "$interface" PIN_FAILED - proto_block_restart "$interface" - return 1 + if uqmi -s -d "$device" --get-pin-status | grep '"Not supported"' > /dev/null; then + [ -n "$pincode" ] && { + uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null || { + echo "Unable to verify PIN" + proto_notify_error "$interface" PIN_FAILED + proto_block_restart "$interface" + return 1 + } } - } + else + . /usr/share/libubox/jshn.sh + json_load "$(uqmi -s -d "$device" --get-pin-status)" + json_get_var pin1_status pin1_status + + case "$pin1_status" in + disabled) + echo "PIN verification is disabled" + ;; + blocked) + echo "SIM locked PUK required" + proto_notify_error "$interface" PUK_NEEDED + proto_block_restart "$interface" + return 1 + ;; + not_verified) + if [ -n "$pincode" ]; then + uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null 2>&1 || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null 2>&1 || { + echo "Unable to verify PIN" + proto_notify_error "$interface" PIN_FAILED + proto_block_restart "$interface" + return 1 + } + else + echo "PIN not specified but required" + proto_notify_error "$interface" PIN_NOT_SPECIFIED + proto_block_restart "$interface" + return 1 + fi + ;; + verified) + echo "PIN already verified" + ;; + *) + echo "PIN status failed ($pin1_status)" + proto_notify_error "$interface" PIN_STATUS_FAILED + proto_block_restart "$interface" + return 1 + ;; + esac + fi [ -n "$plmn" ] && { local mcc mnc From bcf824a4794f12e71d1215e39950c5eab89be084 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 12 Apr 2018 10:31:29 +0200 Subject: [PATCH 287/399] uqmi: stop proto handler if verify pin count is not 3 Check pin count value from pin status and stop verification the pin if the value is less then 3. This should prevent the proto-handler to lock the SIM. If SIM is locked then the PUK is needed. Signed-off-by: Florian Eckert (backported from 0c9d06b5b243334123eafaf2e26a15ec2757767e) --- package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 422d00525ef..9b2f69f009f 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -96,6 +96,7 @@ proto_qmi_setup() { . /usr/share/libubox/jshn.sh json_load "$(uqmi -s -d "$device" --get-pin-status)" json_get_var pin1_status pin1_status + json_get_var pin1_verify_tries pin1_verify_tries case "$pin1_status" in disabled) @@ -108,6 +109,12 @@ proto_qmi_setup() { return 1 ;; not_verified) + [ "$pin1_verify_tries" -lt "3" ] && { + echo "PIN verify count value is $pin1_verify_tries this is below the limit of 3" + proto_notify_error "$interface" PIN_TRIES_BELOW_LIMIT + proto_block_restart "$interface" + return 1 + } if [ -n "$pincode" ]; then uqmi -s -d "$device" --verify-pin1 "$pincode" > /dev/null 2>&1 || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" > /dev/null 2>&1 || { echo "Unable to verify PIN" From b64622b0c8deeba53dd9f43e3160b681e61a3cf3 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Tue, 9 Oct 2018 11:32:36 +0200 Subject: [PATCH 288/399] uqmi: update PKG_RELEASE version update PKG_RELEASE Signed-off-by: Florian Eckert (backported from 4cabda8b7ddb0efea23e2aa044ea8bf18e03d199) --- package/network/utils/uqmi/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 640cbe4e1bb..b2f34744003 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uqmi -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git From ab64f9da81c72cad4ca88c0af1e3a7ba0fa7685c Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Sun, 11 Nov 2018 02:31:41 +0100 Subject: [PATCH 289/399] ugps: update to latest git HEAD 07528d43f9bc nmea.c: set _BSD_SOURCE to have timegm() & stime() on musl b88037b6bf6a check timegm return code ccabdf6c235f nmea.c: Add null byte to nmea fields cdc1478a8133 remove deprication warning Signed-off-by: Alexander Couzens (backported from 81d7f82441f0754d398309a722323d792a24d76a) --- package/utils/ugps/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 937789fd833..3ce5ace51a9 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=3 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-02-12 -PKG_SOURCE_VERSION:=928cb537aa6a1951ff503b4d13f3c78cead7b581 -PKG_MIRROR_HASH:=21f2c9a1656b2115d2d26ef714390422b885d88ecd21eb9d16d6548444654deb +PKG_SOURCE_DATE:=2018-11-11 +PKG_SOURCE_VERSION:=07528d43f9bccf22dfb16ee03083bb46dd53dfcf +PKG_MIRROR_HASH:=0811925082e0ec503aae1f65797241e78886930b061931db066b44c2b0e4bc23 PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ From ed32045bcc645e15b5e9f44061efa218024d5137 Mon Sep 17 00:00:00 2001 From: Russell Senior Date: Sun, 14 Oct 2018 02:34:32 -0700 Subject: [PATCH 290/399] patch: apply upstream cve fixes Apply two upstream patches to address two CVEs: * CVE-2018-1000156 * CVE-2018-6952 Add PKG_CPE_ID to Makefile. Build tested on apm821xx and ar71xx. Signed-off-by: Russell Senior (backported from 4797dddfde6a8ffdbdcb4e5b5e137b0a00313f62) (rebased patches) Signed-off-by: Jo-Philipp Wich --- tools/patch/Makefile | 2 + .../patch/patches/010-CVE-2018-1000156.patch | 199 ++++++++++++++++++ tools/patch/patches/020-CVE-2018-6952.patch | 25 +++ 3 files changed, 226 insertions(+) create mode 100644 tools/patch/patches/010-CVE-2018-1000156.patch create mode 100644 tools/patch/patches/020-CVE-2018-6952.patch diff --git a/tools/patch/Makefile b/tools/patch/Makefile index 4c4c09bc088..0f4d7f0326c 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -8,6 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=patch PKG_VERSION:=2.7.6 +PKG_RELEASE:=2 +PKG_CPE_ID:=cpe:/a:gnu:patch PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/patch diff --git a/tools/patch/patches/010-CVE-2018-1000156.patch b/tools/patch/patches/010-CVE-2018-1000156.patch new file mode 100644 index 00000000000..306ba793fcb --- /dev/null +++ b/tools/patch/patches/010-CVE-2018-1000156.patch @@ -0,0 +1,199 @@ +From ee2904728eb4364a36d62d66f723d0b68749e5df Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Fri, 6 Apr 2018 12:14:49 +0200 +Subject: [PATCH] Fix arbitrary command execution in ed-style patches + (CVE-2018-1000156) + +* src/pch.c (do_ed_script): Write ed script to a temporary file instead +of piping it to ed: this will cause ed to abort on invalid commands +instead of rejecting them and carrying on. +* tests/ed-style: New test case. +* tests/Makefile.am (TESTS): Add test case. +--- + src/pch.c | 89 +++++++++++++++++++++++++++++++++++------------ + tests/Makefile.am | 1 + + tests/ed-style | 41 ++++++++++++++++++++++ + 3 files changed, 108 insertions(+), 23 deletions(-) + create mode 100644 tests/ed-style + +--- a/src/pch.c ++++ b/src/pch.c +@@ -33,6 +33,7 @@ + # include + #endif + #include ++#include + + #define INITHUNKMAX 125 /* initial dynamic allocation size */ + +@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char c + static char const editor_program[] = EDITOR_PROGRAM; + + file_offset beginning_of_this_line; +- FILE *pipefp = 0; + size_t chars_read; ++ FILE *tmpfp = 0; ++ char const *tmpname; ++ int tmpfd; ++ pid_t pid; ++ ++ if (! dry_run && ! skip_rest_of_patch) ++ { ++ /* Write ed script to a temporary file. This causes ed to abort on ++ invalid commands such as when line numbers or ranges exceed the ++ number of available lines. When ed reads from a pipe, it rejects ++ invalid commands and treats the next line as a new command, which ++ can lead to arbitrary command execution. */ ++ ++ tmpfd = make_tempfile (&tmpname, 'e', NULL, O_RDWR | O_BINARY, 0); ++ if (tmpfd == -1) ++ pfatal ("Can't create temporary file %s", quotearg (tmpname)); ++ tmpfp = fdopen (tmpfd, "w+b"); ++ if (! tmpfp) ++ pfatal ("Can't open stream for file %s", quotearg (tmpname)); ++ } + +- if (! dry_run && ! skip_rest_of_patch) { +- int exclusive = *outname_needs_removal ? 0 : O_EXCL; +- assert (! inerrno); +- *outname_needs_removal = true; +- copy_file (inname, outname, 0, exclusive, instat.st_mode, true); +- sprintf (buf, "%s %s%s", editor_program, +- verbosity == VERBOSE ? "" : "- ", +- outname); +- fflush (stdout); +- pipefp = popen(buf, binary_transput ? "wb" : "w"); +- if (!pipefp) +- pfatal ("Can't open pipe to %s", quotearg (buf)); +- } + for (;;) { + char ed_command_letter; + beginning_of_this_line = file_tell (pfp); +@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char c + } + ed_command_letter = get_ed_command_letter (buf); + if (ed_command_letter) { +- if (pipefp) +- if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) ++ if (tmpfp) ++ if (! fwrite (buf, sizeof *buf, chars_read, tmpfp)) + write_fatal (); + if (ed_command_letter != 'd' && ed_command_letter != 's') { + p_pass_comments_through = true; + while ((chars_read = get_line ()) != 0) { +- if (pipefp) +- if (! fwrite (buf, sizeof *buf, chars_read, pipefp)) ++ if (tmpfp) ++ if (! fwrite (buf, sizeof *buf, chars_read, tmpfp)) + write_fatal (); + if (chars_read == 2 && strEQ (buf, ".\n")) + break; +@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char c + break; + } + } +- if (!pipefp) ++ if (!tmpfp) + return; +- if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, pipefp) == 0 +- || fflush (pipefp) != 0) ++ if (fwrite ("w\nq\n", sizeof (char), (size_t) 4, tmpfp) == 0 ++ || fflush (tmpfp) != 0) + write_fatal (); +- if (pclose (pipefp) != 0) +- fatal ("%s FAILED", editor_program); ++ ++ if (lseek (tmpfd, 0, SEEK_SET) == -1) ++ pfatal ("Can't rewind to the beginning of file %s", quotearg (tmpname)); ++ ++ if (! dry_run && ! skip_rest_of_patch) { ++ int exclusive = *outname_needs_removal ? 0 : O_EXCL; ++ *outname_needs_removal = true; ++ if (inerrno != ENOENT) ++ { ++ *outname_needs_removal = true; ++ copy_file (inname, outname, 0, exclusive, instat.st_mode, true); ++ } ++ sprintf (buf, "%s %s%s", editor_program, ++ verbosity == VERBOSE ? "" : "- ", ++ outname); ++ fflush (stdout); ++ ++ pid = fork(); ++ if (pid == -1) ++ pfatal ("Can't fork"); ++ else if (pid == 0) ++ { ++ dup2 (tmpfd, 0); ++ execl ("/bin/sh", "sh", "-c", buf, (char *) 0); ++ _exit (2); ++ } ++ else ++ { ++ int wstatus; ++ if (waitpid (pid, &wstatus, 0) == -1 ++ || ! WIFEXITED (wstatus) ++ || WEXITSTATUS (wstatus) != 0) ++ fatal ("%s FAILED", editor_program); ++ } ++ } ++ ++ fclose (tmpfp); ++ safe_unlink (tmpname); + + if (ofp) + { +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -32,6 +32,7 @@ TESTS = \ + crlf-handling \ + dash-o-append \ + deep-directories \ ++ ed-style \ + empty-files \ + false-match \ + fifo \ +--- /dev/null ++++ b/tests/ed-style +@@ -0,0 +1,41 @@ ++# Copyright (C) 2018 Free Software Foundation, Inc. ++# ++# Copying and distribution of this file, with or without modification, ++# in any medium, are permitted without royalty provided the copyright ++# notice and this notice are preserved. ++ ++. $srcdir/test-lib.sh ++ ++require cat ++use_local_patch ++use_tmpdir ++ ++# ============================================================== ++ ++cat > ed1.diff < ed2.diff < /dev/null || echo "Status: $?"' < +Date: Fri, 17 Aug 2018 13:35:40 +0200 +Subject: [PATCH] Fix swapping fake lines in pch_swap + +* src/pch.c (pch_swap): Fix swapping p_bfake and p_efake when there is a +blank line in the middle of a context-diff hunk: that empty line stays +in the middle of the hunk and isn't swapped. + +Fixes: https://savannah.gnu.org/bugs/index.php?53133 +--- + src/pch.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/src/pch.c ++++ b/src/pch.c +@@ -2114,7 +2114,7 @@ pch_swap (void) + } + if (p_efake >= 0) { /* fix non-freeable ptr range */ + if (p_efake <= i) +- n = p_end - i + 1; ++ n = p_end - p_ptrn_lines; + else + n = -i; + p_efake += n; From 1adb3b28a9c1b3a8302a467eaa4cb07a4c5becd4 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 14 Oct 2018 15:25:37 +0200 Subject: [PATCH 291/399] tools: patch: make patch build depend on automake The Makefile.am changed and now patch wants to use automake to regenerate the Makefile.in. Make sure automake was build before we build patch. This fixes build problem seen by the build bots. Fixes: 4797dddfde6 ("patch: apply upstream cve fixes") Signed-off-by: Hauke Mehrtens (backported from 07e8c217cb79a19c59fcb34ea6de39aa91a625b6) --- tools/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/Makefile b/tools/Makefile index d2b5daf18c2..6766d7df6e5 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -66,6 +66,7 @@ $(curdir)/bc/compile := $(curdir)/bison/compile $(curdir)/findutils/compile := $(curdir)/bison/compile $(curdir)/gengetopt/compile := $(curdir)/libtool/compile $(curdir)/patchelf/compile := $(curdir)/libtool/compile +$(curdir)/patch/compile := $(curdir)/automake/compile $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/libressl/compile := $(curdir)/pkg-config/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile From a10c67b05727ec8b773771f60127cac39ffa90f8 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 14 Oct 2018 16:42:45 +0200 Subject: [PATCH 292/399] tools: patch: Fix build by not modifing Makefile.am A new test case was adding in one of the patches fixing a problem, this also included a change in the test/Makefile.am to add this test case. The build system detected a change in the Makefile.am and wants to regenerate the Makefile.in, but this fails because automake-1.15 is not installed yet. As automake depends on patch being build first, make sure we do not modify the Makefile.am. This fixes build problem seen by the build bots. Fixes: 4797dddfde6 ("patch: apply upstream cve fixes") Signed-off-by: Hauke Mehrtens (backported from 759f111f8d7f2d9f5f12713fc6f48ce6422997ec) --- tools/Makefile | 1 - .../patch/patches/010-CVE-2018-1000156.patch | 54 ------------------- 2 files changed, 55 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 6766d7df6e5..d2b5daf18c2 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -66,7 +66,6 @@ $(curdir)/bc/compile := $(curdir)/bison/compile $(curdir)/findutils/compile := $(curdir)/bison/compile $(curdir)/gengetopt/compile := $(curdir)/libtool/compile $(curdir)/patchelf/compile := $(curdir)/libtool/compile -$(curdir)/patch/compile := $(curdir)/automake/compile $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/libressl/compile := $(curdir)/pkg-config/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile diff --git a/tools/patch/patches/010-CVE-2018-1000156.patch b/tools/patch/patches/010-CVE-2018-1000156.patch index 306ba793fcb..7114f82e8fa 100644 --- a/tools/patch/patches/010-CVE-2018-1000156.patch +++ b/tools/patch/patches/010-CVE-2018-1000156.patch @@ -143,57 +143,3 @@ instead of rejecting them and carrying on. if (ofp) { ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -32,6 +32,7 @@ TESTS = \ - crlf-handling \ - dash-o-append \ - deep-directories \ -+ ed-style \ - empty-files \ - false-match \ - fifo \ ---- /dev/null -+++ b/tests/ed-style -@@ -0,0 +1,41 @@ -+# Copyright (C) 2018 Free Software Foundation, Inc. -+# -+# Copying and distribution of this file, with or without modification, -+# in any medium, are permitted without royalty provided the copyright -+# notice and this notice are preserved. -+ -+. $srcdir/test-lib.sh -+ -+require cat -+use_local_patch -+use_tmpdir -+ -+# ============================================================== -+ -+cat > ed1.diff < ed2.diff < /dev/null || echo "Status: $?"' < Date: Mon, 15 Oct 2018 10:17:29 -0700 Subject: [PATCH 293/399] tools: patch: Add missing CVE-2018-6951 fix uscan reports a new CVE now that PKG_CPE_ID was added. Reordered patches by date. Signed-off-by: Rosen Penev [re-title commit & refresh patches] Signed-off-by: Kevin Darbyshire-Bryant (backported from a6bd9d0cb652686453604b762e80a35d023908c4) --- tools/patch/Makefile | 2 +- tools/patch/patches/010-CVE-2018-6951.patch | 24 +++++++++++++++++++ ...00156.patch => 020-CVE-2018-1000156.patch} | 15 +++++------- ...018-6952.patch => 030-CVE-2018-6952.patch} | 4 ++-- 4 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 tools/patch/patches/010-CVE-2018-6951.patch rename tools/patch/patches/{010-CVE-2018-1000156.patch => 020-CVE-2018-1000156.patch} (89%) rename tools/patch/patches/{020-CVE-2018-6952.patch => 030-CVE-2018-6952.patch} (86%) diff --git a/tools/patch/Makefile b/tools/patch/Makefile index 0f4d7f0326c..7323b5b2ab7 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=patch PKG_VERSION:=2.7.6 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_CPE_ID:=cpe:/a:gnu:patch PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/patch/patches/010-CVE-2018-6951.patch b/tools/patch/patches/010-CVE-2018-6951.patch new file mode 100644 index 00000000000..10dc5680993 --- /dev/null +++ b/tools/patch/patches/010-CVE-2018-6951.patch @@ -0,0 +1,24 @@ +From 1f7853c05f9949d81da9be7a02b90cc64284d1f8 Mon Sep 17 00:00:00 2001 +From: Andreas Gruenbacher +Date: Mon, 12 Feb 2018 16:48:24 +0100 +Subject: [PATCH] Fix segfault with mangled rename patch + +http://savannah.gnu.org/bugs/?53132 +* src/pch.c (intuit_diff_type): Ensure that two filenames are specified +for renames and copies (fix the existing check). +--- + src/pch.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/src/pch.c ++++ b/src/pch.c +@@ -974,7 +974,8 @@ intuit_diff_type (bool need_header, mode + if ((pch_rename () || pch_copy ()) + && ! inname + && ! ((i == OLD || i == NEW) && +- p_name[! reverse] && ++ p_name[reverse] && p_name[! reverse] && ++ name_is_valid (p_name[reverse]) && + name_is_valid (p_name[! reverse]))) + { + say ("Cannot %s file without two valid file names\n", pch_rename () ? "rename" : "copy"); diff --git a/tools/patch/patches/010-CVE-2018-1000156.patch b/tools/patch/patches/020-CVE-2018-1000156.patch similarity index 89% rename from tools/patch/patches/010-CVE-2018-1000156.patch rename to tools/patch/patches/020-CVE-2018-1000156.patch index 7114f82e8fa..99dfe540753 100644 --- a/tools/patch/patches/010-CVE-2018-1000156.patch +++ b/tools/patch/patches/020-CVE-2018-1000156.patch @@ -1,4 +1,4 @@ -From ee2904728eb4364a36d62d66f723d0b68749e5df Mon Sep 17 00:00:00 2001 +From b3a0ca3deed00334f9feece43f76776b6a168e47 Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Fri, 6 Apr 2018 12:14:49 +0200 Subject: [PATCH] Fix arbitrary command execution in ed-style patches @@ -10,11 +10,8 @@ instead of rejecting them and carrying on. * tests/ed-style: New test case. * tests/Makefile.am (TESTS): Add test case. --- - src/pch.c | 89 +++++++++++++++++++++++++++++++++++------------ - tests/Makefile.am | 1 + - tests/ed-style | 41 ++++++++++++++++++++++ - 3 files changed, 108 insertions(+), 23 deletions(-) - create mode 100644 tests/ed-style + src/pch.c | 89 +++++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 66 insertions(+), 23 deletions(-) --- a/src/pch.c +++ b/src/pch.c @@ -26,7 +23,7 @@ instead of rejecting them and carrying on. #define INITHUNKMAX 125 /* initial dynamic allocation size */ -@@ -2388,22 +2389,28 @@ do_ed_script (char const *inname, char c +@@ -2389,22 +2390,28 @@ do_ed_script (char const *inname, char c static char const editor_program[] = EDITOR_PROGRAM; file_offset beginning_of_this_line; @@ -69,7 +66,7 @@ instead of rejecting them and carrying on. for (;;) { char ed_command_letter; beginning_of_this_line = file_tell (pfp); -@@ -2414,14 +2421,14 @@ do_ed_script (char const *inname, char c +@@ -2415,14 +2422,14 @@ do_ed_script (char const *inname, char c } ed_command_letter = get_ed_command_letter (buf); if (ed_command_letter) { @@ -88,7 +85,7 @@ instead of rejecting them and carrying on. write_fatal (); if (chars_read == 2 && strEQ (buf, ".\n")) break; -@@ -2434,13 +2441,49 @@ do_ed_script (char const *inname, char c +@@ -2435,13 +2442,49 @@ do_ed_script (char const *inname, char c break; } } diff --git a/tools/patch/patches/020-CVE-2018-6952.patch b/tools/patch/patches/030-CVE-2018-6952.patch similarity index 86% rename from tools/patch/patches/020-CVE-2018-6952.patch rename to tools/patch/patches/030-CVE-2018-6952.patch index e72a8cbc27c..36b58c79ddb 100644 --- a/tools/patch/patches/020-CVE-2018-6952.patch +++ b/tools/patch/patches/030-CVE-2018-6952.patch @@ -1,4 +1,4 @@ -From daa51e492049d9fe3ac049165ec19641bf19cd7f Mon Sep 17 00:00:00 2001 +From df40f2ea17254de269a3624319a12a93a4e395ff Mon Sep 17 00:00:00 2001 From: Andreas Gruenbacher Date: Fri, 17 Aug 2018 13:35:40 +0200 Subject: [PATCH] Fix swapping fake lines in pch_swap @@ -14,7 +14,7 @@ Fixes: https://savannah.gnu.org/bugs/index.php?53133 --- a/src/pch.c +++ b/src/pch.c -@@ -2114,7 +2114,7 @@ pch_swap (void) +@@ -2115,7 +2115,7 @@ pch_swap (void) } if (p_efake >= 0) { /* fix non-freeable ptr range */ if (p_efake <= i) From b2df8076bd697c89309fc6392683b5bb53a96edb Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 31 Oct 2018 16:55:14 -0700 Subject: [PATCH 294/399] tools/patch: Add fedora patch for crashing git style patches https://lists.gnu.org/archive/html/bug-patch/2018-10/msg00000.html I assume a CVE number will be assigned soon. Signed-off-by: Rosen Penev (backported from 32fc41baabc9e83a045a7a805b0d91a030cfbd3c) --- tools/patch/Makefile | 2 +- ...rror-handling-with-git-style-patches.patch | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tools/patch/patches/040-Fix-error-handling-with-git-style-patches.patch diff --git a/tools/patch/Makefile b/tools/patch/Makefile index 7323b5b2ab7..cab9fee9f62 100644 --- a/tools/patch/Makefile +++ b/tools/patch/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=patch PKG_VERSION:=2.7.6 -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_CPE_ID:=cpe:/a:gnu:patch PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/patch/patches/040-Fix-error-handling-with-git-style-patches.patch b/tools/patch/patches/040-Fix-error-handling-with-git-style-patches.patch new file mode 100644 index 00000000000..5cc958e7464 --- /dev/null +++ b/tools/patch/patches/040-Fix-error-handling-with-git-style-patches.patch @@ -0,0 +1,53 @@ +From 424da221cec76ea200cff1fa9b08a6f3d94c28a7 Mon Sep 17 00:00:00 2001 +From: Lubomir Rintel +Date: Wed, 31 Oct 2018 16:39:13 -0700 +Subject: [PATCH] Fix error handling with git-style patches + +When an error is encountered in output_files(), the subsequent call to +cleanup() calls back into output_files() resulting in an infinte recursion. +This is trivially reproduced with a git-style patch (which utilizes +output_file_later()) that tries to patch a nonexistent or unreadable +file (see attached test case). + +* src/patch.c: (output_files) clear the files_to_output list before +iterating it, so that recursive calls won't iterate the same files. +--- + src/patch.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +--- a/src/patch.c ++++ b/src/patch.c +@@ -1938,8 +1938,12 @@ output_files (struct stat const *st) + { + gl_list_iterator_t iter; + const void *elt; ++ gl_list_t files; + +- iter = gl_list_iterator (files_to_output); ++ files = files_to_output; ++ init_files_to_output (); ++ ++ iter = gl_list_iterator (files); + while (gl_list_iterator_next (&iter, &elt, NULL)) + { + const struct file_to_output *file_to_output = elt; +@@ -1957,8 +1961,8 @@ output_files (struct stat const *st) + /* Free the list up to here. */ + for (;;) + { +- const void *elt2 = gl_list_get_at (files_to_output, 0); +- gl_list_remove_at (files_to_output, 0); ++ const void *elt2 = gl_list_get_at (files, 0); ++ gl_list_remove_at (files, 0); + if (elt == elt2) + break; + } +@@ -1967,7 +1971,7 @@ output_files (struct stat const *st) + } + } + gl_list_iterator_free (&iter); +- gl_list_clear (files_to_output); ++ gl_list_clear (files); + } + + /* Fatal exit with cleanup. */ From ae16d0fb39d6703ed1476c5759586fd24e06f5bd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 15 Oct 2018 10:47:09 -0700 Subject: [PATCH 295/399] tools/libressl: Add PKG_CPE_ID for proper CVE tracking Signed-off-by: Rosen Penev (backported from 74a5c619dc4322314e6db63f2ab113e61958665e) --- tools/libressl/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile index bb8113a4ada..9cfe343c5d4 100644 --- a/tools/libressl/Makefile +++ b/tools/libressl/Makefile @@ -12,6 +12,8 @@ PKG_VERSION:=2.7.2 PKG_HASH:=917a8779c342177ff3751a2bf955d0262d1d8916a4b408930c45cef326700995 PKG_RELEASE:=1 +PKG_CPE_ID:=cpe:/a:openbsd:libressl + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://mirror.ox.ac.uk/pub/OpenBSD/LibreSSL \ http://ftp.jaist.ac.jp/pub/OpenBSD/LibreSSL \ From 1249e6d498e64170a6ed282d8c6d738f800471e2 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 15 Oct 2018 13:58:30 -0700 Subject: [PATCH 296/399] tools/xz: Add PKG_CPE_ID for proper CVE tracking Signed-off-by: Rosen Penev (backported from 622176262d4b8093eda1704e052ae97d74c85c7f) --- tools/xz/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/xz/Makefile b/tools/xz/Makefile index d6b619db41f..5d574892bb0 100644 --- a/tools/xz/Makefile +++ b/tools/xz/Makefile @@ -13,6 +13,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/lzmautils \ http://tukaani.org/xz PKG_HASH:=3313fd2a95f43d88e44264e6b015e7d03053e681860b0d5d3f9baca79c57b7bf +PKG_CPE_ID:=cpe:/a:tukaani:xz HOST_BUILD_PARALLEL:=1 From 53249917825acfcd5ef10d279c38be9c6740a10c Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 28 Oct 2018 16:49:28 +0200 Subject: [PATCH 297/399] tools/ccache: update to 3.5 Update ccache to 3.5 Signed-off-by: Hannu Nyman (backported from b0a2e60793f194a7a33e93a12f9ca5f2ae410529) --- tools/ccache/Makefile | 4 ++-- tools/ccache/patches/100-honour-copts.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 111bd91bb63..175cb11bdf3 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=3.4.2 +PKG_VERSION:=3.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://download.samba.org/pub/ccache/ \ https://samba.org/ftp/ccache/ -PKG_HASH:=18a8b14367d63d3d37fb6c33cba60e1b7fcd7a63d608df97c9771ae0d234fee2 +PKG_HASH:=bdd44b72ae4506a2e2deef9fefb15c606a474bbca7658cd2be26105155eec012 include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/ccache/patches/100-honour-copts.patch b/tools/ccache/patches/100-honour-copts.patch index 1916d17c60e..60bb5e0c123 100644 --- a/tools/ccache/patches/100-honour-copts.patch +++ b/tools/ccache/patches/100-honour-copts.patch @@ -1,6 +1,6 @@ --- a/src/ccache.c +++ b/src/ccache.c -@@ -1859,6 +1859,7 @@ calculate_object_hash(struct args *args, +@@ -1940,6 +1940,7 @@ calculate_object_hash(struct args *args, "CPLUS_INCLUDE_PATH", "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH", // clang From 3d4eb5607817da3d916455c080ca7d50fddd43a6 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 1 Oct 2018 05:07:46 +0200 Subject: [PATCH 298/399] wolfssl: update to version 3.15.3-stable Signed-off-by: Daniel Golle (backported from ed0d5a1e609e0b39eff9f06e3522396581d0b06e) --- package/libs/wolfssl/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 87ce9328e77..a01a8949aa5 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=3.14.4 -PKG_RELEASE:=3 +PKG_VERSION:=3.15.3-stable +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip # PKG_SOURCE_URL:=https://www.wolfssl.com/ PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) -PKG_HASH:=1da1b45dec4a455716c8547074ad883c737865225f69443bb173c0dc21683fd1 +PKG_HASH:=dc97c07a7667b39a890e14f4b4a209f51524a4cabee7adb6c80822ee78c1f62a PKG_FIXUP:=libtool PKG_INSTALL:=1 From 2046cd25903570948e0a6c9705782f040f7e664c Mon Sep 17 00:00:00 2001 From: Yufei Miao Date: Wed, 10 Oct 2018 23:23:44 +0800 Subject: [PATCH 299/399] mwlwifi: driver version to 10.3.8.0-20181008 Signed-off-by: Yufei Miao (backported from 260be8a5790416a8e8e42eb59d5b24a656e4bedb) --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 505dcae3463..7525fe63708 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-09-20 -PKG_SOURCE_VERSION:=4a98c2bec174982676546e599d6f904b65a7179f -PKG_MIRROR_HASH:=18c524662f8f00b88b4b4483d29461c293c16c1e54b129927e24e2a23598007c +PKG_SOURCE_DATE:=2018-10-08 +PKG_SOURCE_VERSION:=3520811c99737659de5b65f1e57612a4ae5ad6e6 +PKG_MIRROR_HASH:=8dd116ee939cd5607a6ecae5f8830d159bb96d4600bc3d5a3b14adc35112256f PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From ebe02f7a354f5fac315447228c000ea926fe4feb Mon Sep 17 00:00:00 2001 From: Jonathan Lancett Date: Mon, 22 Oct 2018 14:36:23 +0000 Subject: [PATCH 300/399] mwlwifi: driver version to 10.3.8.0-20181022 Upgrade 88W8997 firmware to 8.4.0.52. Removed unnecessary firmware settings. Added vendor events. Fixed crash problem when module is removed. Modified the code to protect tx queues. Signed-off-by: Jonathan Lancett [tidy commit message] Signed-off-by: Kevin Darbyshire-Bryant (backported from 9ac73502405b4d4f110e4901df7d05b7f7bcd781) --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 7525fe63708..6cea33d9ccf 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-08 -PKG_SOURCE_VERSION:=3520811c99737659de5b65f1e57612a4ae5ad6e6 -PKG_MIRROR_HASH:=8dd116ee939cd5607a6ecae5f8830d159bb96d4600bc3d5a3b14adc35112256f +PKG_SOURCE_DATE:=2018-10-22 +PKG_SOURCE_VERSION:=fac1da8da63197e0e491eebebe17b37ce1da271f +PKG_MIRROR_HASH:=95a6a818c1da0839eec789b7f7f6f8b5adf9ed2fc4e7006866c7fb7edde3c76f PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From 66ff4e478a1b296b6630c53d13662579743683c5 Mon Sep 17 00:00:00 2001 From: Kabuli Chana Date: Mon, 29 Oct 2018 10:58:07 -0600 Subject: [PATCH 301/399] mwlwifi: update to version 10.3.8.0-20181029 compile / test target mvebu / mamba Signed-off-by: Kabuli Chana (backported from 390158bd2b0bab61e3c454a006fa68a4ad98dfdc) --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 6cea33d9ccf..54089238d5f 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-22 -PKG_SOURCE_VERSION:=fac1da8da63197e0e491eebebe17b37ce1da271f -PKG_MIRROR_HASH:=95a6a818c1da0839eec789b7f7f6f8b5adf9ed2fc4e7006866c7fb7edde3c76f +PKG_SOURCE_DATE:=2018-10-29 +PKG_SOURCE_VERSION:=382700ce5744fe80271c57a89c6589e767d91620 +PKG_MIRROR_HASH:=7378b7d391aeec7a86b6548723911d21bc780ea84ceea858e910cc65a1d925c6 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From c756d666dc044ca89e2da08ed569b61a69dd7cf4 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 1 Nov 2018 14:05:59 +0100 Subject: [PATCH 302/399] scripts: update config.guess and config.sub This updates these two files to commit 2fa97a8a0ed3 ("config.guess (amd64:CYGWIN*:*:*, x86_64:CYGWIN*:*:*): Set master") which is the current master of https://git.savannah.gnu.org/gitweb/?p=config.git;a=summary This contains updates for multiple architectures and will unbreak the build on the x32 ABI. Signed-off-by: Hauke Mehrtens (backported from 3361a8817e9a6c4ab73d72bd98a3d652b756c12e) --- scripts/config.guess | 756 +++++++------ scripts/config.sub | 2517 +++++++++++++++++++++--------------------- 2 files changed, 1649 insertions(+), 1624 deletions(-) diff --git a/scripts/config.guess b/scripts/config.guess index fddac4281a6..18f8edc0ff5 100755 --- a/scripts/config.guess +++ b/scripts/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2015-07-03' +timestamp='2018-08-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2015-07-03' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2015-07-03' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,8 +84,6 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,34 +94,39 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15 +trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0 + +set_cc_for_build() { + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi @@ -132,14 +135,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +152,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,27 +179,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -205,10 +218,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -216,39 +229,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) + echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -265,63 +294,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -333,7 +353,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -360,38 +380,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + UNAME_REL="`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + case `isainfo -b` in + 32) + echo i386-pc-solaris2"$UNAME_REL" + ;; + 64) + echo x86_64-pc-solaris2"$UNAME_REL" + ;; + esac exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -400,25 +415,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -429,44 +444,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -475,23 +490,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -517,17 +532,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -544,7 +559,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -556,14 +571,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -574,7 +589,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -588,7 +603,7 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -597,18 +612,18 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -623,28 +638,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -677,13 +692,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -694,23 +709,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -735,11 +750,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -748,7 +763,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -756,9 +771,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -783,127 +798,120 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -916,61 +924,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -984,64 +995,70 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1055,34 +1072,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1092,12 +1109,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1107,9 +1124,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1117,7 +1134,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1129,9 +1146,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1151,9 +1168,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1162,28 +1179,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1194,7 +1211,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1214,23 +1231,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1249,46 +1266,56 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1299,27 +1326,33 @@ EOF # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1328,18 +1361,19 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + # shellcheck disable=SC2154 + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1360,14 +1394,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1376,34 +1410,48 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; esac +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1422,16 +1470,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/scripts/config.sub b/scripts/config.sub index f018151c64b..f208558ec21 100755 --- a/scripts/config.sub +++ b/scripts/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2015-07-28' +timestamp='2018-08-29' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2015-07-28' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2015-07-28' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,12 +53,11 @@ timestamp='2015-07-28' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -90,12 +89,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,1234 +110,1159 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +IFS="-" read -r field1 field2 field3 field4 <&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + alliant) + basic_machine=fx80-alliant + os= + ;; + altos | altos3068) + basic_machine=m68k-altos + os= + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amiga) + basic_machine=m68k-unknown + os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + os= + ;; + da30) + basic_machine=m68k-da30 + os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + os= + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sequent) + basic_machine=i386-sequent + os= + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + os= + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + os= + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + os= + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + os= + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + os= + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos + cpu=m68k + vendor=motorola ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + os=${os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=solaris2 ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + os=${os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi + cpu=mips + vendor=sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs + cpu=m68000 + vendor=convergent ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv + cpu=mips + vendor=sony + os=newsos ;; - next | m*-next ) - basic_machine=m68k-next + next | m*-next) + cpu=m68k + vendor=next case $os in - -nextstep* ) + nextstep* ) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 + cpu=m68k + vendor=tti ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm[46]00) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi + sde) + cpu=mipsisa32 + vendor=sde + os=${os:-elf} ;; - sb1) - basic_machine=mipsisa64sb1-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + os=vxworks ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sei) - basic_machine=mips-sei - os=-seiux + w65) + cpu=w65 + vendor=wdc ;; - sequent) - basic_machine=i386-sequent + w89k-*) + cpu=hppa1.1 + vendor=winbond + os=proelf ;; - sh) - basic_machine=sh-hitachi - os=-hms + none) + cpu=none + vendor=none ;; - sh5el) - basic_machine=sh5le-unknown + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - sh64) - basic_machine=sh64-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + + *-*) + IFS="-" read -r cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arceb \ + | arm | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | romp | rs6000 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | wasm32 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1346,197 +1270,246 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if [ x$os != x ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + bluegene*) + os=cnk ;; - -solaris) - os=-solaris2 + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -svr4*) - os=-sysv4 + solaris) + os=solaris2 ;; - -unixware*) - os=-sysv4.2uw + unixware*) + os=sysv4.2uw ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) + qnx*) + case $cpu in + x86 | i*86) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + nto-qnx*) ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -linux-dietlibc) - os=-linux-dietlibc + linux-dietlibc) + os=linux-dietlibc ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 + ;; + lynx*) + os=lynxos ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -opened*) - os=-openedition + opened*) + os=openedition ;; - -os400*) - os=-os400 + os400*) + os=os400 ;; - -wince*) - os=-wince + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -osfrose*) - os=-osfrose + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -osf*) - os=-osf + wince*) + os=wince ;; - -utek*) - os=-bsd + utek*) + os=bsd ;; - -dynix*) - os=-bsd + dynix*) + os=bsd ;; - -acis*) - os=-aos + acis*) + os=aos ;; - -atheos*) - os=-atheos + atheos*) + os=atheos ;; - -syllable*) - os=-syllable + syllable*) + os=syllable ;; - -386bsd) - os=-bsd + 386bsd) + os=bsd ;; - -ctix* | -uts*) - os=-sysv + ctix* | uts*) + os=sysv ;; - -nova*) - os=-rtmk-nova + nova*) + os=rtmk-nova ;; - -ns2 ) - os=-nextstep2 + ns2) + os=nextstep2 ;; - -nsk*) - os=-nsk + nsk*) + os=nsk ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 + sinix*) + os=sysv4 ;; - -tpf*) - os=-tpf + tpf*) + os=tpf ;; - -triton*) - os=-sysv3 + triton*) + os=sysv3 ;; - -oss*) - os=-sysv3 + oss*) + os=sysv3 ;; - -svr4) - os=-sysv4 + svr4*) + os=sysv4 ;; - -svr3) - os=-sysv3 + svr3) + os=sysv3 ;; - -sysvr4) - os=-sysv4 + sysvr4) + os=sysv4 ;; - # This must come after -sysvr4. - -sysv*) + # This must come after sysvr4. + sysv*) ;; - -ose*) - os=-ose + ose*) + os=ose ;; - -es1800*) - os=-ose + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -xenix) - os=-xenix + zvmoe) + os=zvmoe ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + dicos*) + os=dicos ;; - -aros*) - os=-aros + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -zvmoe) - os=-zvmoe + nacl*) ;; - -dicos*) - os=-dicos + ios) ;; - -nacl*) + none) ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1552,261 +1525,265 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; - *-be) - os=-beos + pru-*) + os=elf ;; - *-haiku) - os=-haiku + *-be) + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) +case $vendor in + unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" From e2637a471a647a99ce419177a2bd20dd7507ca80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 9 Nov 2018 12:09:29 +0100 Subject: [PATCH 303/399] Revert "iptables: fix dependency for libip6tc on IPV6" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch reverts commit 2dc1f54b1205094e7c6036cae6275d2c326bad3e as it breaks the build for me on x86-64 if I've IPV6 support disabled. Same config builds fine on `openwrt-18.06` branch at 55d078b2. $ grep IPV6 .config # CONFIG_KERNEL_IPV6 is not set # CONFIG_IPV6 is not set Build errors out on: Package libiptc is missing dependencies for the following libraries: libip6tc.so.0 Looking at iptables-1.6.2/libiptc/Makefile.am: libiptc_la_LIBADD = libip4tc.la libip6tc.la and to iptables-1.6.2/libiptc/libiptc.pc.in: Requires: libip4tc libip6tc It seems that libiptc needs v4/v6 libs, so v6 isn't optional. Cc: Rosy Song Signed-off-by: Petr Štetiar (backported from 1b4b942bcef8638a040788ab9ae94c66e38fd960) --- package/network/utils/iptables/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index c1e4790d11a..9c7179c51dc 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -462,7 +462,7 @@ define Package/libiptc $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libip4tc +IPV6:libip6tc +libxtables + DEPENDS:=+libip4tc +libip6tc +libxtables ABI_VERSION:=$(PKG_VERSION) TITLE:=IPv4/IPv6 firewall - shared libiptc library (compatibility stub) endef @@ -482,7 +482,7 @@ $(call Package/iptables/Default) CATEGORY:=Libraries TITLE:=IPv6 firewall - shared libiptc library ABI_VERSION:=$(PKG_VERSION) - DEPENDS:=@IPV6 +libxtables + DEPENDS:=+libxtables endef define Package/libxtables From 0340d3ad2d1b6bdc9c58e242d987dd92a98d0db1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Nov 2018 12:59:47 -0800 Subject: [PATCH 304/399] flex: Add a lex symlink Some packages like libpfring assume the presense of lex, which on some other systems is a symlink to flex but not all. Symlink flex to fix compilation. Arch Linux and Fedora do this as far as I know. Signed-off-by: Rosen Penev (backported from 7ef38e42c8440a29d1dc721a9e6184b2e369bc2f) --- tools/flex/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/flex/Makefile b/tools/flex/Makefile index 1eff81f3451..bb5aecbdfea 100644 --- a/tools/flex/Makefile +++ b/tools/flex/Makefile @@ -21,6 +21,11 @@ include $(INCLUDE_DIR)/host-build.mk HOST_CONFIGURE_ARGS += --disable-shared +define Host/Install + $(call Host/Install/Default) + $(LN) flex $(STAGING_DIR_HOST)/bin/lex +endef + define Host/Clean -$(MAKE) -C $(HOST_BUILD_DIR) uninstall $(call Host/Clean/Default) From f7a97a21f77bcc339c5b5d75d426c428324be6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 9 Nov 2018 08:25:41 +0100 Subject: [PATCH 305/399] base-files: sysupgrade: Allow downloading of firmware images using HTTPS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently it's only possible to download images over HTTP. Signed-off-by: Petr Štetiar (backported from 7c104a83589c3e3fbfdfda2ef68b8695f57dde75) --- package/base-files/files/sbin/sysupgrade | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 36379431171..b75bd097f3b 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -204,7 +204,8 @@ type platform_check_image >/dev/null 2>/dev/null || { } case "$IMAGE" in - http://*) + http://*|\ + https://*) wget -O/tmp/sysupgrade.img "$IMAGE" IMAGE=/tmp/sysupgrade.img ;; From 575621e3556100ba7129f648fd7cba4e67855ce8 Mon Sep 17 00:00:00 2001 From: Martin Schiller Date: Mon, 19 Nov 2018 06:50:28 +0100 Subject: [PATCH 306/399] lantiq/basefiles: use shutdown instead of stop when the system goes down I can't see any reason why we shouldn't use shutdown for lantiq as well. Signed-off-by: Martin Schiller (backported from 18398abe1eb5de50b3d8affd51e003bf7555d91a) --- target/linux/lantiq/base-files/etc/inittab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/lantiq/base-files/etc/inittab b/target/linux/lantiq/base-files/etc/inittab index 21fa8d58ef6..37d52c588c6 100644 --- a/target/linux/lantiq/base-files/etc/inittab +++ b/target/linux/lantiq/base-files/etc/inittab @@ -1,3 +1,3 @@ ::sysinit:/etc/init.d/rcS S boot -::shutdown:/etc/init.d/rcS K stop +::shutdown:/etc/init.d/rcS K shutdown ttyLTQ0::askfirst:/usr/libexec/login.sh From 0f5b8a92b42d2c0c8e3dc025ef3be7ee2163f3c4 Mon Sep 17 00:00:00 2001 From: Kabuli Chana Date: Wed, 14 Nov 2018 15:27:10 -0700 Subject: [PATCH 307/399] mwlwifi: update to version 10.3.8.0-20181114 compile / test target mvebu / mamba Signed-off-by: Kabuli Chana (backported from 392eea392cdae42d4e388e9f1a89bb6fb4e849b6) --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 54089238d5f..06468a7e6db 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -15,9 +15,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-10-29 -PKG_SOURCE_VERSION:=382700ce5744fe80271c57a89c6589e767d91620 -PKG_MIRROR_HASH:=7378b7d391aeec7a86b6548723911d21bc780ea84ceea858e910cc65a1d925c6 +PKG_SOURCE_DATE:=2018-11-14 +PKG_SOURCE_VERSION:=81413aa9855825541a0034b3ff497c2b7d59be5b +PKG_MIRROR_HASH:=94a1571eed4841d2b965156ac8daed221b6e398a3cfe66b93eca1a6cee9cecd4 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From 75d4465464e615d97ed07dac503d39c904770542 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 20 Nov 2018 17:20:39 +0100 Subject: [PATCH 308/399] include/rootfs.mk: remove boot directory Currently every file in boot directory is copied over target /boot on root file system and is usually inaccessible because appropriate boot file system is mounted on top of it. Therefore remove /boot, which in result will also save space on target root file system. Signed-off-by: Tomasz Maciej Nowak (backported from 31075313bf69fff3803b7c1da1e0ed7e5773d999) --- include/rootfs.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/rootfs.mk b/include/rootfs.mk index 76425c017a8..dc8621dbae4 100644 --- a/include/rootfs.mk +++ b/include/rootfs.mk @@ -90,6 +90,7 @@ define prepare_rootfs rm -f $(1)/usr/lib/opkg/lists/* rm -f $(1)/usr/lib/opkg/info/*.postinst* rm -f $(1)/var/lock/*.lock + rm -rf $(1)/boot $(call clean_ipkg,$(1)) $(call mklibs,$(1)) endef From dab5305e316622a1799edd21a145647d98403132 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 20 Nov 2018 17:20:40 +0100 Subject: [PATCH 309/399] x86: mount writable bootfs Mount boot file system with rw option to allow installation of packages which install files to /boot directory. Signed-off-by: Tomasz Maciej Nowak (backported from f78b26163790fdf2b53464ab808af10f72e31c3e) --- .../linux/x86/base-files/lib/preinit/79_move_config | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/target/linux/x86/base-files/lib/preinit/79_move_config b/target/linux/x86/base-files/lib/preinit/79_move_config index 7b34d9e5dac..debce435578 100644 --- a/target/linux/x86/base-files/lib/preinit/79_move_config +++ b/target/linux/x86/base-files/lib/preinit/79_move_config @@ -8,16 +8,12 @@ move_config() { if export_bootdevice && export_partdevice partdev 1; then mkdir -p /boot - if mount -t ext4 -o ro,noatime "/dev/$partdev" /boot; then - if [ -f /boot/sysupgrade.tgz ]; then - mount /boot -o remount,rw,noatime - mv -f /boot/sysupgrade.tgz / - mount /boot -o remount,ro,noatime - fi - mount --bind /boot/boot /boot + mount -t ext4 -o rw,noatime "/dev/$partdev" /boot + mount --bind /boot/boot /boot + if [ -f /boot/sysupgrade.tgz ]; then + mv -f /boot/sysupgrade.tgz / fi fi } boot_hook_add preinit_mount_root move_config - From 6b0bafb16b77a5a8e49cbcf0f482bbfcea028cae Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Tue, 20 Nov 2018 17:20:41 +0100 Subject: [PATCH 310/399] x86: add packages files to image bootfs Add files to bootfs image from selected as built-in packages, which want to install files to targets boot file system. Signed-off-by: Tomasz Maciej Nowak (backported from 51e199fbe80acb6e95dff942280b0396e094032b) --- target/linux/x86/image/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 8a3cb327e3c..fcdfcb8afb9 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -83,6 +83,7 @@ ifneq ($(CONFIG_GRUB_IMAGES),) -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \ -e 's#@ROOT@#$(GRUB_ROOT)#g' \ ./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg + -$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/ PADDING="$(CONFIG_TARGET_IMAGES_PAD)" SIGNATURE="$(SIGNATURE)" PATH="$(TARGET_PATH)" $(SCRIPT_DIR)/gen_image_generic.sh \ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \ $(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/root.grub \ @@ -120,6 +121,7 @@ define Image/Build/iso -e 's#@CMDLINE@#root=/dev/sr0 rootfstype=iso9660 rootwait $(strip $(call Image/cmdline/$(1)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \ -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \ ./grub-iso.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg + -$(CP) $(STAGING_DIR_ROOT)/boot/. $(KDIR)/root.grub/boot/ mkisofs -R -b boot/grub/eltorito.img -no-emul-boot -boot-info-table \ -o $(KDIR)/root.iso $(KDIR)/root.grub $(TARGET_DIR) endef From fc38aad1949150d13baf0ad7a261beee0768dc60 Mon Sep 17 00:00:00 2001 From: Tomasz Maciej Nowak Date: Wed, 28 Nov 2018 20:44:21 +0100 Subject: [PATCH 311/399] x86: make sysupgrade.tgz reachable again Moving binding mount before check for saved sysupgrade configuration made it unreachable. Fix it by moving binding mount after the check. Fixes: f78b2616 (x86: mount writable bootfs) Reported-by: Lucian Cristian Signed-off-by: Tomasz Maciej Nowak (backported from c288ad9c2b2a4ab62e4c887f13f220870911cc28) --- target/linux/x86/base-files/lib/preinit/79_move_config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/x86/base-files/lib/preinit/79_move_config b/target/linux/x86/base-files/lib/preinit/79_move_config index debce435578..aff720a52c5 100644 --- a/target/linux/x86/base-files/lib/preinit/79_move_config +++ b/target/linux/x86/base-files/lib/preinit/79_move_config @@ -9,10 +9,10 @@ move_config() { if export_bootdevice && export_partdevice partdev 1; then mkdir -p /boot mount -t ext4 -o rw,noatime "/dev/$partdev" /boot - mount --bind /boot/boot /boot if [ -f /boot/sysupgrade.tgz ]; then mv -f /boot/sysupgrade.tgz / fi + mount --bind /boot/boot /boot fi } From dfa9d4a70ec887e6f663f71e6a8861d83556435b Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Fri, 25 May 2018 09:45:04 +0200 Subject: [PATCH 312/399] fstools: update to latest git HEAD dd02dad fstools: allow the mounting with full access time accounting 242248c fstools: allow to compress the filesystem Signed-off-by: Hans Dedecker (backported from 5df2597c59879029059d09c426dbf10e06c80306) --- package/system/fstools/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 494f90d2e68..1c71f4b2a8c 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2018-04-16 -PKG_SOURCE_VERSION:=e24368361db166cf369a19cea773bd54f9d854b1 -PKG_MIRROR_HASH:=8b483e752578683224245a6d77b3d7172b7cf7a8c3b959e21c47ff18aefc2464 +PKG_SOURCE_DATE:=2018-05-23 +PKG_SOURCE_VERSION:=dd02dad332958575cc52e60c78ef10ef2b5aaced +PKG_MIRROR_HASH:=31051da29a0fff0b60ab3fc7fe27be281ed298346ff0ac65e3a2976671d2deed CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 3af64ddbff9f81fbfba68e2b357473db2fe65ac1 Mon Sep 17 00:00:00 2001 From: Pierre Lebleu Date: Thu, 24 May 2018 14:20:33 +0200 Subject: [PATCH 313/399] fstools: Add the new options available in the menuconfig Mounting using the zlib compression and mounting with full access accounting are now available in the menuconfig. Signed-off-by: Pierre Lebleu (backported from e6b8ce4c081b0bdfbbd20477ecef18b285481b07) --- package/system/fstools/Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 1c71f4b2a8c..440f1873947 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -33,6 +33,8 @@ include $(INCLUDE_DIR)/cmake.mk TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt) CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_UBIFS_EXTROOT),-DCMAKE_UBIFS_EXTROOT=y) +CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME),-DCMAKE_OVL_MOUNT_FULL_ACCESS_TIME=y) +CMAKE_OPTIONS += $(if $(CONFIG_FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB),-DCMAKE_OVL_MOUNT_COMPRESS_ZLIB=y) define Package/fstools SECTION:=base @@ -50,6 +52,20 @@ define Package/fstools/config default y help This option makes it possible to use extroot functionality if the root filesystem resides on an UBIFS partition + + config FSTOOLS_OVL_MOUNT_FULL_ACCESS_TIME + depends on PACKAGE_fstools + bool "Full access time accounting" + default n + help + This option enables the full access time accounting (warning: it will increase the flash writes). + + config FSTOOLS_OVL_MOUNT_COMPRESS_ZLIB + depends on PACKAGE_fstools + bool "Compress using zlib" + default n + help + This option enables the compression using zlib on the storage device. endef define Package/snapshot-tool From e78aa6f77b73409c1aa3f3722a50614607f977ae Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 6 Jun 2018 18:22:25 -0700 Subject: [PATCH 314/399] strace: Update to 4.22 SourceForge is deprecated according to upstream, so switch to main site for downloads. Tested on Turris Omnia (mvebu). Signed-off-by: Rosen Penev (backported from d12d81f8d41d8169c1299375ff15c232231d972c) --- package/devel/strace/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 15faa5e4061..f41e7584249 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=4.20 +PKG_VERSION:=4.22 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@SF/$(PKG_NAME) -PKG_HASH:=5bf3148dd17306a42566f7da17368fdd781afa147db05ea63a4ca2b50f58c523 +PKG_SOURCE_URL:=https://strace.io/files/$(PKG_VERSION) +PKG_HASH:=068cd09264c95e4d591bbcd3ea08f99a693ed8663cd5169b0fdad72eb5bdb39d PKG_LICENSE:=BSD-3c PKG_LICENSE_FILES:=COPYRIGHT From 492174198f612df46c58b2dcd636cad163a13ca8 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Sat, 9 Jun 2018 22:23:51 +0200 Subject: [PATCH 315/399] tools/e2fsprogs: Update to 1.44.2 Update e2fsprogs to 1.44.2 Signed-off-by: Daniel Engberg (backported from 651a62353b02a61f685e34ad6eaea8e61394a741) --- tools/e2fsprogs/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index f809df424a3..783b3150818 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs -PKG_VERSION:=1.44.1 -PKG_HASH:=0ca164c1c87724df904c918b2d7051ef989b51de725db66c67514dbe6dd2b9ef +PKG_VERSION:=1.44.2 +PKG_HASH:=8324cf0b6e81805a741d94087b00e99f7e16144f1ee5a413709a1fa6948b126c PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz From ec9e3e6a9e3e909139bef974f4310c4debe6a4c6 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Mon, 11 Jun 2018 00:22:36 +0200 Subject: [PATCH 316/399] mbedtls: Cosmetic cleanups This is more of a cosmetic change and a reminder that the CMake script hardcodes -O2. Source: https://github.com/ARMmbed/mbedtls/blob/mbedtls-2.7/CMakeLists.txt#L73 https://github.com/ARMmbed/mbedtls/blob/master/CMakeLists.txt#L97 Remove the release type option as it's already provided by the toolchain. Source: https://github.com/openwrt/openwrt/blob/master/include/cmake.mk#L50 Signed-off-by: Daniel Engberg (backported from 5297a759aee34952299d1d42f677f31781026c67) --- package/libs/mbedtls/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 4556ad80b46..659bf59d889 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -64,9 +64,9 @@ endef PKG_INSTALL:=1 TARGET_CFLAGS += -ffunction-sections -fdata-sections +TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) CMAKE_OPTIONS += \ - -DCMAKE_BUILD_TYPE:String="Release" \ -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \ -DENABLE_TESTING:Bool=OFF \ -DENABLE_PROGRAMS:Bool=ON From 2f97b405fed4805ed8faf411b7643ce24f26a2c5 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 6 Jun 2018 18:22:28 -0700 Subject: [PATCH 317/399] ethtool: Update to 4.16 Tested on Turris Omnia (mvebu). Signed-off-by: Rosen Penev (backported from 2737cea0bb117013875ee33916bb4b9deae9ea47) --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index b378ce2af93..0d85380ae44 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=4.15 +PKG_VERSION:=4.16 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=71f7fd32483ffdc7c6c4d882e230714eb101df0a46cbe396dbeb8ac78f1ef91a +PKG_HASH:=fe967a6722db2099fa63d847b6628e3e31cf9f53571a37503347dcc3e4015a03 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 44979a31e13b0e0ff1480f24ea0faaa0a807fd76 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Mon, 18 Jun 2018 17:50:47 +0200 Subject: [PATCH 318/399] ethtool: Update to 4.17 Tested on 8devices Jalapeno(ipq40xx) Introduces following changes * Fix: In ethtool.8, remove superfluous and incorrect \ * Fix: fix uninitialized return value * Fix: fix RING_VF assignment * Fix: remove unused global variable * Fix: several fixes in do_gregs() * Fix: correctly free hkey when get_stringset() fails * Fix: remove unreachable code * Fix: fix stack clash in do_get_phy_tunable and do_set_phy_tunable * Feature: Add register dump support for MICROCHIP LAN78xx Signed-off-by: Robert Marko (backported from 4bb2532ec1d4f30ad44037331130daffa687eb3d) --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index 0d85380ae44..565acd41d9a 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=4.16 +PKG_VERSION:=4.17 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=fe967a6722db2099fa63d847b6628e3e31cf9f53571a37503347dcc3e4015a03 +PKG_HASH:=c46b1eb417c78793dddb3247b89eb8f50f6e398e12ee4670b092b3570728c585 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 83cbf4c0bacdfbdc6d3ccf1a45533aefec3879b2 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 25 Aug 2018 23:26:24 +0200 Subject: [PATCH 319/399] ethtool: Update to 4.18 Tested on 8devices Jalapeno(ipq40xx) Introduces following changes: Feature: Add support for WAKE_FILTER (WoL using filters) Feature: Add support for action value -2 (wake-up filter) Fix: document WoL filters option also in help message Feature: ixgbe dump strings for security registers Signed-off-by: Robert Marko (backported from a9d73531921ef4755e2cbd6e9e7e36c59b00655c) --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index 565acd41d9a..fc83c23f4b5 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=4.17 +PKG_VERSION:=4.18 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=c46b1eb417c78793dddb3247b89eb8f50f6e398e12ee4670b092b3570728c585 +PKG_HASH:=90948555d4c017561d0d8795f2dc61893a4932c0f3b85e6d422afd7031b7c110 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 1f7504b8843d03850637c24118366201e2b2df51 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 10 Nov 2018 13:40:45 +0100 Subject: [PATCH 320/399] ethtool: update to 4.19 8a1ad80 Release version 4.19. ecdf295 ethtool: Fix uninitialized variable use at qsfp dump 98c148e ethtool: better syntax for combinations of FEC modes d4b9f3f ethtool: support combinations of FEC modes Signed-off-by: Hans Dedecker (backported from 5617e138bdaff94587d700def3d74e81c5b2db19) --- package/network/utils/ethtool/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile index fc83c23f4b5..c328c6b0b89 100644 --- a/package/network/utils/ethtool/Makefile +++ b/package/network/utils/ethtool/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ethtool -PKG_VERSION:=4.18 +PKG_VERSION:=4.19 PKG_RELEASE:=1 PKG_MAINTAINER:=Felix Fietkau PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/network/ethtool -PKG_HASH:=90948555d4c017561d0d8795f2dc61893a4932c0f3b85e6d422afd7031b7c110 +PKG_HASH:=b18a6c364e42c29cdac057cf183c9674163db96b30848adfa8c2a90450f6d0c8 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From a74369a64d0a58e61b3695ba67633440089e262d Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 6 Oct 2018 05:09:00 +0200 Subject: [PATCH 321/399] wireguard: bump to 0.0.20181006 * Account for big-endian 2^26 conversion in Poly1305. * Account for big-endian NEON in Curve25519. * Fix macros in big-endian AArch64 code so that this will actually run there at all. * Prefer if (IS_ENABLED(...)) over ifdef mazes when possible. * Call simd_relax() within any preempt-disabling glue code every once in a while so as not to increase latency if folks pass in super long buffers. * Prefer compiler-defined architecture macros in assembly code, which puts us in closer alignment with upstream CRYPTOGAMS code, and is cleaner. * Non-static symbols are prefixed with wg_ to avoid polluting the global namespace. * Return a bool from simd_relax() indicating whether or not we were rescheduled. * Reflect the proper simd conditions on arm. * Do not reorder lines in Kbuild files for the simd asm-generic addition, since we don't want to cause merge conflicts. * WARN() if the selftests fail in Zinc, since if this is an initcall, it won't block module loading, so we want to be loud. * Document some interdependencies beside include statements. * Add missing static statement to fpu init functions. * Use union in chacha to access state words as a flat matrix, instead of casting a struct to a u8 and hoping all goes well. Then, by passing around that array as a struct for as long as possible, we can update counter[0] instead of state[12] in the generic blocks, which makes it clearer what's happening. * Remove __aligned(32) for chacha20_ctx since we no longer use vmovdqa on x86, and the other implementations do not require that kind of alignment either. * Submit patch to ARM tree for adjusting RiscPC's cflags to be -march=armv3 so that we can build code that uses umull. * Allow CONFIG_ARM[64] to imply [!]CONFIG_64BIT, and use zinc arch config variables consistently throughout. * Document rationale for the 2^26->2^64/32 conversion in code comments. * Convert all of remaining BUG_ON to WARN_ON. * Replace `bxeq lr` with `reteq lr` in ARM assembler to be compatible with old ISAs via the macro in . * Do not allow WireGuard to be a built-in if IPv6 is a module. * Writeback the base register and reorder multiplications in the NEON x25519 implementation. * Try all combinations of different implementations in selftests, so that potential bugs are more immediately unearthed. * Self tests and SIMD glue code work with #include, which lets the compiler optimize these. Previously these files were .h, because they were included, but a simple grep of the kernel tree shows 259 other files that carry out this same pattern. Only they prefer to instead name the files with a .c instead of a .h, so we now follow the convention. * Support many more platforms in QEMU, especially big endian ones. * Kernels < 3.17 don't have read_cpuid_part, so fix building there. Signed-off-by: Jason A. Donenfeld (backported from b6658564505e1f9a582ac63bd06cdf4b423818be) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 29c7447476c..3544e341eeb 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20180925 +PKG_VERSION:=0.0.20181006 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=4a0488a07e40ec17e798f3e40a85cedf55f0560b1c3a8fd95806c7d4266cb0e8 +PKG_HASH:=9fe7cd5767eda65647463ec29ed707f917f4a77babaaf247adc4be7acaab4665 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From a6a3abeb96f589fad72a003435a5cbd2dfc36106 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Tue, 9 Oct 2018 09:03:59 +0100 Subject: [PATCH 322/399] wireguard: bump to 0.0.20181007 64750c1 version: bump snapshot f11a2b8 global: style nits 4b34b6a crypto: clean up remaining .h->.c 06d9fc8 allowedips: document additional nobs c32b5f9 makefile: do more generic wildcard so as to avoid rename issues 20f48d8 crypto: use BIT(i) & bitmap instead of (bitmap >> i) & 1 b6e09f6 crypto: disable broken implementations in selftests fd50f77 compat: clang cannot handle __builtin_constant_p bddaca7 compat: make asm/simd.h conditional on its existence b4ba33e compat: account for ancient ARM assembler Signed-off-by: Kevin Darbyshire-Bryant (backported from 3925298f3ca9bcd854571367d98bb6ca07f4e66e) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 3544e341eeb..dad430b5c6a 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20181006 +PKG_VERSION:=0.0.20181007 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=9fe7cd5767eda65647463ec29ed707f917f4a77babaaf247adc4be7acaab4665 +PKG_HASH:=d26e0d1216594871b5947e76d64c2fa50e9b34b68cdcfa3fdad588cbb314af89 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 6319242a2a377e939a401d497d9a7dfbdf83406a Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 18 Oct 2018 03:48:34 +0200 Subject: [PATCH 323/399] wireguard: bump to 0.0.20181018 ba2ab5d version: bump snapshot 5f59c76 tools: wg-quick: wait for interface to disappear on freebsd ac7e7a3 tools: don't fail if a netlink interface dump is inconsistent 8432585 main: get rid of unloaded debug message 139e57c tools: compile on gnu99 d65817c tools: use libc's endianness macro if no compiler macro f985de2 global: give if statements brackets and other cleanups b3a5d8a main: change module description 296d505 device: use textual error labels always 8bde328 allowedips: swap endianness early on a650d49 timers: avoid using control statements in macro db4dd93 allowedips: remove control statement from macro by rewriting 780a597 global: more nits 06b1236 global: rename struct wireguard_ to struct wg_ 205dd46 netlink: do not stuff index into nla type 2c6b57b qemu: kill after 20 minutes 6f2953d compat: look in Kbuild and Makefile since they differ based on arch a93d7e4 create-patch: blacklist instead of whitelist 8d53657 global: prefix functions used in callbacks with wg_ 123f85c compat: don't output for grep errors Signed-off-by: Jason A. Donenfeld (backported from 4653818dabe6d2f6e99b483ec256e4374dbb2c77) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index dad430b5c6a..8a71ce27d78 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20181007 +PKG_VERSION:=0.0.20181018 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=d26e0d1216594871b5947e76d64c2fa50e9b34b68cdcfa3fdad588cbb314af89 +PKG_HASH:=af05824211b27cbeeea2b8d6b76be29552c0d80bfe716471215e4e43d259e327 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 6de949113210b6ec62fa03e775ed5a301cdcb43e Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 15 Nov 2018 12:14:49 -0800 Subject: [PATCH 324/399] wireguard: bump to 0.0.20181115 * Zinc no longer ships generated assembly code. Rather, we now bundle in the original perlasm generator for it. The primary purpose of this snapshot is to get testing of this. * Clarify the peer removal logic and make lifetimes more precise. * Use READ_ONCE for is_valid and is_dead. * No need to use atomic when the recounter is mutex protected. * Fix up macros and annotations in allowedips. * Increment drop counter when staged packets are dropped. * Use static constants instead of enums for 64-bit values in selftest. * Mark large constants as ULL in poly1305-donna64. * Fix sparse warnings in allowedips debugging code. * Do not use wg_peer_get_maybe_zero in timer callbacks, since we now can carefully control the lifetime of these functions and ensure they never execute after dropping the last reference. * Cleanup hashing in ratelimiter. * Do not guard timer removals, since del_timer is always okay. * We now check for PM_AUTOSLEEP, which makes the clear*on-suspend decision a bit more general. * Set csum_level to ~0, since the poly1305 authenticator certainly means that no data was modified in transit. * Use CHECKSUM_PARTIAL check for skb_checksum_help instead of skb_checksum_setup check. * wg.8: specify that wg(8) shows runtime info too * wg.8: AllowedIPs isn't actually required * keygen-html: add missing glue macro * wg-quick: android: do not choke on empty allowed-ips Signed-off-by: Jason A. Donenfeld (backported from bf52c968e863768494e79731550c62610dd3cf78) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 8a71ce27d78..442938c241b 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20181018 +PKG_VERSION:=0.0.20181115 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=af05824211b27cbeeea2b8d6b76be29552c0d80bfe716471215e4e43d259e327 +PKG_HASH:=11292c7e86fce6fb0d9fd170389d2afc609bda963a7faf1fd713e11c2af53085 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 753531da249f4960b1088513665982322a2b6a97 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 19 Nov 2018 18:30:17 +0100 Subject: [PATCH 325/399] wireguard: bump to 0.0.20181119 * chacha20,poly1305: fix up for win64 * poly1305: only export neon symbols when in use * poly1305: cleanup leftover debugging changes * crypto: resolve target prefix on buggy kernels * chacha20,poly1305: don't do compiler testing in generator and remove xor helper * crypto: better path resolution and more specific generated .S * poly1305: make frame pointers for auxiliary calls * chacha20,poly1305: do not use xlate This should fix up the various build errors, warnings, and insertion errors introduced by the previous snapshot, where we added some significant refactoring. In short, we're trying to port to using Andy Polyakov's original perlasm files, and this means quite a lot of work to re-do that had stableized in our old .S. Signed-off-by: Jason A. Donenfeld (backported from 48d8d46d331cd866ad5717cc5b090223a1856a4a) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index 442938c241b..a1930740183 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20181115 +PKG_VERSION:=0.0.20181119 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=11292c7e86fce6fb0d9fd170389d2afc609bda963a7faf1fd713e11c2af53085 +PKG_HASH:=7d47f7996dd291069de4efb3097c42f769f60dc3ac6f850a4d5705f321e4406b PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 61323d22c07358f086acee41ed68f8e6d9cd0651 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Tue, 18 Dec 2018 19:40:31 +0100 Subject: [PATCH 326/399] dropbear: fix dropbear startup issue Interface triggers are installed by the dropbear init script in case an interface is configured for a given dropbear uci section. As dropbear is started after network the interface trigger event can be missed during a small window; this is especially the case if lan is specified as interface. Fix this by starting dropbear before network so no interface trigger is missed. As dropbear is started earlier than netifd add a boot function to avoid the usage of network.sh functions as call to such functions will fail at boottime. Signed-off-by: Hans Dedecker Acked-by: Jo-Philipp Wich --- package/network/services/dropbear/Makefile | 2 +- package/network/services/dropbear/files/dropbear.init | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 182552f6ea4..9127651ef99 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=7 +PKG_RELEASE:=7.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init index b86e52d8bc2..eef2643c14a 100755 --- a/package/network/services/dropbear/files/dropbear.init +++ b/package/network/services/dropbear/files/dropbear.init @@ -2,7 +2,7 @@ # Copyright (C) 2006-2010 OpenWrt.org # Copyright (C) 2006 Carlos Sobrinho -START=50 +START=19 STOP=50 USE_PROCD=1 @@ -59,6 +59,8 @@ dropbear_instance() } [ -n "${Interface}" ] && { + [ -n "${BOOT}" ] && return 0 + network_get_ipaddrs_all ipaddrs "${Interface}" || { echo "interface ${Interface} has no physdev or physdev has no suitable ip" return 1 @@ -119,6 +121,12 @@ load_interfaces() [ "${enable}" = "1" ] && interfaces=" ${interface} ${interfaces}" } +boot() +{ + BOOT=1 + start "$@" +} + start_service() { [ -s /etc/dropbear/dropbear_rsa_host_key ] || keygen From eef6bd3393f406f73187a670fa34d5e6a228f9e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 25 Dec 2018 15:51:33 +0100 Subject: [PATCH 327/399] bcm53xx: update pinctrl driver & use its new DT binding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Driver has been updated upstream to support more precise DT binding and avoid mapping conflicts between pinctrl and USB 2.0 PHY. Signed-off-by: Rafał Miłecki (cherry picked from commit a28f6ab27f9ae1a08c6945013cdb796b12ce150d) --- ...upport-updated-DT-binding-as-syscon-.patch | 99 +++++++++++++++++++ ...01X-Update-Northstar-pinctrl-binding.patch | 31 ++++++ 2 files changed, 130 insertions(+) create mode 100644 target/linux/bcm53xx/patches-4.14/084-v4.21-pinctrl-bcm-ns-support-updated-DT-binding-as-syscon-.patch create mode 100644 target/linux/bcm53xx/patches-4.14/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch diff --git a/target/linux/bcm53xx/patches-4.14/084-v4.21-pinctrl-bcm-ns-support-updated-DT-binding-as-syscon-.patch b/target/linux/bcm53xx/patches-4.14/084-v4.21-pinctrl-bcm-ns-support-updated-DT-binding-as-syscon-.patch new file mode 100644 index 00000000000..45595bddc92 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/084-v4.21-pinctrl-bcm-ns-support-updated-DT-binding-as-syscon-.patch @@ -0,0 +1,99 @@ +From a49d784d5a8272d0f63c448fe8dc69e589db006e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Tue, 18 Dec 2018 16:58:08 +0100 +Subject: [PATCH] pinctrl: bcm: ns: support updated DT binding as syscon + subnode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Documentation has been recently updated specifying that pinctrl should +be subnode of the CRU "syscon". Support that by using parent node for +regmap and reading "offset" property from the DT. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Linus Walleij +--- + drivers/pinctrl/bcm/pinctrl-ns.c | 29 +++++++++++++++++++---------- + 1 file changed, 19 insertions(+), 10 deletions(-) + +--- a/drivers/pinctrl/bcm/pinctrl-ns.c ++++ b/drivers/pinctrl/bcm/pinctrl-ns.c +@@ -5,6 +5,7 @@ + + #include + #include ++#include + #include + #include + #include +@@ -12,6 +13,7 @@ + #include + #include + #include ++#include + #include + + #define FLAG_BCM4708 BIT(1) +@@ -22,7 +24,8 @@ struct ns_pinctrl { + struct device *dev; + unsigned int chipset_flag; + struct pinctrl_dev *pctldev; +- void __iomem *base; ++ struct regmap *regmap; ++ u32 offset; + + struct pinctrl_desc pctldesc; + struct ns_pinctrl_group *groups; +@@ -229,9 +232,9 @@ static int ns_pinctrl_set_mux(struct pin + unset |= BIT(pin_number); + } + +- tmp = readl(ns_pinctrl->base); ++ regmap_read(ns_pinctrl->regmap, ns_pinctrl->offset, &tmp); + tmp &= ~unset; +- writel(tmp, ns_pinctrl->base); ++ regmap_write(ns_pinctrl->regmap, ns_pinctrl->offset, tmp); + + return 0; + } +@@ -263,13 +266,13 @@ static const struct of_device_id ns_pinc + static int ns_pinctrl_probe(struct platform_device *pdev) + { + struct device *dev = &pdev->dev; ++ struct device_node *np = dev->of_node; + const struct of_device_id *of_id; + struct ns_pinctrl *ns_pinctrl; + struct pinctrl_desc *pctldesc; + struct pinctrl_pin_desc *pin; + struct ns_pinctrl_group *group; + struct ns_pinctrl_function *function; +- struct resource *res; + int i; + + ns_pinctrl = devm_kzalloc(dev, sizeof(*ns_pinctrl), GFP_KERNEL); +@@ -287,12 +290,18 @@ static int ns_pinctrl_probe(struct platf + return -EINVAL; + ns_pinctrl->chipset_flag = (uintptr_t)of_id->data; + +- res = platform_get_resource_byname(pdev, IORESOURCE_MEM, +- "cru_gpio_control"); +- ns_pinctrl->base = devm_ioremap_resource(dev, res); +- if (IS_ERR(ns_pinctrl->base)) { +- dev_err(dev, "Failed to map pinctrl regs\n"); +- return PTR_ERR(ns_pinctrl->base); ++ ns_pinctrl->regmap = syscon_node_to_regmap(of_get_parent(np)); ++ if (IS_ERR(ns_pinctrl->regmap)) { ++ int err = PTR_ERR(ns_pinctrl->regmap); ++ ++ dev_err(dev, "Failed to map pinctrl regs: %d\n", err); ++ ++ return err; ++ } ++ ++ if (of_property_read_u32(np, "offset", &ns_pinctrl->offset)) { ++ dev_err(dev, "Failed to get register offset\n"); ++ return -ENOENT; + } + + memcpy(pctldesc, &ns_pinctrl_desc, sizeof(*pctldesc)); diff --git a/target/linux/bcm53xx/patches-4.14/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch b/target/linux/bcm53xx/patches-4.14/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch new file mode 100644 index 00000000000..d1d287588c0 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/302-ARM-dts-BCM5301X-Update-Northstar-pinctrl-binding.patch @@ -0,0 +1,31 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] ARM: dts: BCM5301X: Update Northstar pinctrl binding +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki +--- + +--- a/arch/arm/boot/dts/bcm5301x.dtsi ++++ b/arch/arm/boot/dts/bcm5301x.dtsi +@@ -400,16 +400,12 @@ + #size-cells = <1>; + + cru@100 { +- compatible = "simple-bus"; ++ compatible = "syscon", "simple-mfd"; + reg = <0x100 0x1a4>; +- ranges; +- #address-cells = <1>; +- #size-cells = <1>; + +- pin-controller@1c0 { ++ pinctrl { + compatible = "brcm,bcm4708-pinmux"; +- reg = <0x1c0 0x24>; +- reg-names = "cru_gpio_control"; ++ offset = <0xc0>; + + spi-pins { + groups = "spi_grp"; From dbbba84ed4f85924e49da220727adf2abaeb3c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 27 Dec 2018 07:01:38 +0100 Subject: [PATCH 328/399] bcm53xx: rename dts backport patches changing their prefixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Start 03x with 030 instead of 035. It's a trivial change that adds more place for further backports in the 03x space. Signed-off-by: Rafał Miłecki (cherry picked from commit a5d6f2eb76a549af9e5e186042ab6bf2371be725) --- ...01-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch} | 0 ...0-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch} | 0 ...0-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch} | 0 ...30-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch} | 0 ...0-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch} | 0 ...01-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch} | 0 ...01-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch} | 0 ...02-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch} | 0 ...03-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch} | 0 ...4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch} | 0 ...2-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch} | 0 ...06-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch} | 0 ...07-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch} | 0 ...01-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch} | 0 ...> 033-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch} | 0 ...19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch} | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename target/linux/bcm53xx/patches-4.14/{035-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch => 030-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{035-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch => 030-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{035-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch => 030-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{035-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch => 030-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{035-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch => 030-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{036-v4.17-0001-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch => 031-v4.17-0001-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0001-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch => 032-v4.18-0001-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0002-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch => 032-v4.18-0002-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0003-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch => 032-v4.18-0003-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch => 032-v4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch => 032-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0006-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch => 032-v4.18-0006-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{037-v4.18-0007-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch => 032-v4.18-0007-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{038-v4.19-0001-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch => 033-v4.19-0001-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{038-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch => 033-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch} (100%) rename target/linux/bcm53xx/patches-4.14/{038-v4.19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch => 033-v4.19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch} (100%) diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch b/target/linux/bcm53xx/patches-4.14/030-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/035-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch rename to target/linux/bcm53xx/patches-4.14/030-v4.15-0001-ARM-dts-BCM5301X-Specify-USB-ports-for-USB-LED-of-Lu.patch diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch b/target/linux/bcm53xx/patches-4.14/030-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/035-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch rename to target/linux/bcm53xx/patches-4.14/030-v4.15-0002-ARM-dts-BCM5301X-Add-DT-for-Luxul-XBR-4500.patch diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch b/target/linux/bcm53xx/patches-4.14/030-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/035-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch rename to target/linux/bcm53xx/patches-4.14/030-v4.15-0003-ARM-dts-BCM5301X-Add-DT-for-Luxul-ABR-4500.patch diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch b/target/linux/bcm53xx/patches-4.14/030-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/035-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch rename to target/linux/bcm53xx/patches-4.14/030-v4.15-0004-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-810.patch diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch b/target/linux/bcm53xx/patches-4.14/030-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/035-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch rename to target/linux/bcm53xx/patches-4.14/030-v4.15-0005-ARM-dts-BCM53573-Add-DT-for-Luxul-XAP-1440.patch diff --git a/target/linux/bcm53xx/patches-4.14/036-v4.17-0001-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch b/target/linux/bcm53xx/patches-4.14/031-v4.17-0001-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/036-v4.17-0001-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch rename to target/linux/bcm53xx/patches-4.14/031-v4.17-0001-ARM-dts-BCM5301X-add-missing-LEDs-for-Buffalo-WZR-90.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0001-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0001-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0001-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0001-ARM-dts-BCM5301X-Switch-Luxul-XWC-1000-to-the-new-fi.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0002-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0002-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0002-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0002-ARM-dts-BCM5301X-Relicense-most-DTS-files-to-the-GPL.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0003-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0003-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0003-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0003-ARM-dts-BCM5301X-Relicense-Buffalo-files-to-the-GPL-.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0004-ARM-dts-BCM5301X-Add-DT-for-Luxul-XWR-3150-V1.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0005-ARM-dts-BCM5301X-Add-DT-for-Luxul-XAP-1610.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0006-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0006-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0006-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0006-ARM-dts-BCM5301X-Relicense-Asus-RT-AC87U-file-to-the.patch diff --git a/target/linux/bcm53xx/patches-4.14/037-v4.18-0007-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch b/target/linux/bcm53xx/patches-4.14/032-v4.18-0007-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/037-v4.18-0007-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch rename to target/linux/bcm53xx/patches-4.14/032-v4.18-0007-ARM-dts-BCM5301X-Switch-D-Link-DIR-885L-to-the-new-p.patch diff --git a/target/linux/bcm53xx/patches-4.14/038-v4.19-0001-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch b/target/linux/bcm53xx/patches-4.14/033-v4.19-0001-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/038-v4.19-0001-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch rename to target/linux/bcm53xx/patches-4.14/033-v4.19-0001-ARM-dts-BCM5301X-Make-USB-3.0-PHY-use-MDIO-PHY-drive.patch diff --git a/target/linux/bcm53xx/patches-4.14/038-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch b/target/linux/bcm53xx/patches-4.14/033-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/038-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch rename to target/linux/bcm53xx/patches-4.14/033-v4.19-0002-ARM-dts-BCM53573-Add-architected-timer.patch diff --git a/target/linux/bcm53xx/patches-4.14/038-v4.19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch b/target/linux/bcm53xx/patches-4.14/033-v4.19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch similarity index 100% rename from target/linux/bcm53xx/patches-4.14/038-v4.19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch rename to target/linux/bcm53xx/patches-4.14/033-v4.19-0003-ARM-dts-BCM5301X-Add-support-for-Linksys-EA9500.patch From 5af6b7976ff7ec382a7a8592d7f8f7dbfb54cc26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Thu, 27 Dec 2018 07:25:40 +0100 Subject: [PATCH 329/399] bcm53xx: backport DTS changes queued for the 4.21 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It just replaces some downstream patches & adds relicensing work. Signed-off-by: Rafał Miłecki (cherry picked from commit 7a7d19abcfc56c5073931e81f481e2e1fdf774c2) --- ...s-BCM5301X-Specify-flash-partitions.patch} | 5 +- ...-Relicense-BCM47081-BCM4709-files-to.patch | 58 ++++++++++++++ ...-Relicense-BCM47094-file-to-the-GPL-.patch | 33 ++++++++ ...-Relicense-Tenda-AC9-file-to-the-GPL.patch | 32 ++++++++ ...-Relicense-SoC-file-to-the-GPL-2.0-M.patch | 33 ++++++++ ...X-Add-basic-DT-for-Linksys-EA6500-V2.patch | 75 +++++++++++++++++++ ...Describe-Northstar-pins-mux-control.patch} | 6 +- ...RM-BCM5301X-Add-DT-for-Netgear-R7900.patch | 2 +- .../905-BCM53573-minor-hacks.patch | 2 +- 9 files changed, 241 insertions(+), 5 deletions(-) rename target/linux/bcm53xx/patches-4.14/{130-ARM-dts-BCM5301X-Specify-flash-partitions.patch => 034-v4.20-0001-ARM-dts-BCM5301X-Specify-flash-partitions.patch} (95%) create mode 100644 target/linux/bcm53xx/patches-4.14/035-v4.21-0001-ARM-dts-BCM5301X-Relicense-BCM47081-BCM4709-files-to.patch create mode 100644 target/linux/bcm53xx/patches-4.14/035-v4.21-0002-ARM-dts-BCM5301X-Relicense-BCM47094-file-to-the-GPL-.patch create mode 100644 target/linux/bcm53xx/patches-4.14/035-v4.21-0003-ARM-dts-BCM53573-Relicense-Tenda-AC9-file-to-the-GPL.patch create mode 100644 target/linux/bcm53xx/patches-4.14/035-v4.21-0004-ARM-dts-BCM53573-Relicense-SoC-file-to-the-GPL-2.0-M.patch create mode 100644 target/linux/bcm53xx/patches-4.14/035-v4.21-0005-ARM-dts-BCM5301X-Add-basic-DT-for-Linksys-EA6500-V2.patch rename target/linux/bcm53xx/patches-4.14/{131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch => 035-v4.21-0006-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch} (85%) diff --git a/target/linux/bcm53xx/patches-4.14/130-ARM-dts-BCM5301X-Specify-flash-partitions.patch b/target/linux/bcm53xx/patches-4.14/034-v4.20-0001-ARM-dts-BCM5301X-Specify-flash-partitions.patch similarity index 95% rename from target/linux/bcm53xx/patches-4.14/130-ARM-dts-BCM5301X-Specify-flash-partitions.patch rename to target/linux/bcm53xx/patches-4.14/034-v4.20-0001-ARM-dts-BCM5301X-Specify-flash-partitions.patch index 5f343eb7725..e6e2522f089 100644 --- a/target/linux/bcm53xx/patches-4.14/130-ARM-dts-BCM5301X-Specify-flash-partitions.patch +++ b/target/linux/bcm53xx/patches-4.14/034-v4.20-0001-ARM-dts-BCM5301X-Specify-flash-partitions.patch @@ -1,6 +1,6 @@ -From ed4728d9fa0b19687caa964cf5c2082b80208167 Mon Sep 17 00:00:00 2001 +From b0465fdfdd7e7c1afe2fae1cb36b94e1ce89732e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Sat, 28 Jul 2018 13:25:48 +0200 +Date: Sat, 28 Jul 2018 14:13:57 +0200 Subject: [PATCH] ARM: dts: BCM5301X: Specify flash partitions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -17,6 +17,7 @@ binding which got accidentally upstreamed while describing SPI controller. Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli --- arch/arm/boot/dts/bcm47081-tplink-archer-c5-v2.dts | 28 +++++++++++++++++++ arch/arm/boot/dts/bcm4709-asus-rt-ac87u.dts | 31 ++++++++++++++++++++++ diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.21-0001-ARM-dts-BCM5301X-Relicense-BCM47081-BCM4709-files-to.patch b/target/linux/bcm53xx/patches-4.14/035-v4.21-0001-ARM-dts-BCM5301X-Relicense-BCM47081-BCM4709-files-to.patch new file mode 100644 index 00000000000..2dc6b2c23c7 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/035-v4.21-0001-ARM-dts-BCM5301X-Relicense-BCM47081-BCM4709-files-to.patch @@ -0,0 +1,58 @@ +From 26ff86f7794b9466481ccf29ac79925d327f106d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 20 Sep 2018 13:18:47 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense BCM47081/BCM4709 files to the + GPL 2.0+ / MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This matches licensing used by other BCM5301X files and is preferred as: +1) GPL 2.0+ makes it clearly compatible with Linux kernel +2) MIT is also permissive but preferred over ISC + +Both files were fully developed by me. Commits touching them were signed +by Florian and Hauke due to submitting process only. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47081.dtsi | 13 +------------ + arch/arm/boot/dts/bcm4709.dtsi | 3 +-- + 2 files changed, 2 insertions(+), 14 deletions(-) + +--- a/arch/arm/boot/dts/bcm47081.dtsi ++++ b/arch/arm/boot/dts/bcm47081.dtsi +@@ -1,20 +1,9 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Broadcom BCM470X / BCM5301X ARM platform code. + * DTS for BCM47081 SoC. + * + * Copyright © 2014 Rafał Miłecki +- * +- * 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 "bcm5301x.dtsi" +--- a/arch/arm/boot/dts/bcm4709.dtsi ++++ b/arch/arm/boot/dts/bcm4709.dtsi +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright (C) 2016 Rafał Miłecki +- * +- * Licensed under the ISC license. + */ + + #include "bcm4708.dtsi" diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.21-0002-ARM-dts-BCM5301X-Relicense-BCM47094-file-to-the-GPL-.patch b/target/linux/bcm53xx/patches-4.14/035-v4.21-0002-ARM-dts-BCM5301X-Relicense-BCM47094-file-to-the-GPL-.patch new file mode 100644 index 00000000000..86c6b0ae41e --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/035-v4.21-0002-ARM-dts-BCM5301X-Relicense-BCM47094-file-to-the-GPL-.patch @@ -0,0 +1,33 @@ +From d10967344375026ca8762b6080dec2585d895906 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 20 Sep 2018 13:20:19 +0200 +Subject: [PATCH] ARM: dts: BCM5301X: Relicense BCM47094 file to the GPL 2.0+ / + MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This matches licensing used by other BCM5301X files and is preferred as: +1) GPL 2.0+ makes it clearly compatible with Linux kernel +2) MIT is also permissive but preferred over ISC + +This file has been developed by me & once modified by Vivek. + +Signed-off-by: Rafał Miłecki +Acked-by: Vivek Unune +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47094.dtsi | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm47094.dtsi ++++ b/arch/arm/boot/dts/bcm47094.dtsi +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright (C) 2016 Rafał Miłecki +- * +- * Licensed under the ISC license. + */ + + #include "bcm4708.dtsi" diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.21-0003-ARM-dts-BCM53573-Relicense-Tenda-AC9-file-to-the-GPL.patch b/target/linux/bcm53xx/patches-4.14/035-v4.21-0003-ARM-dts-BCM53573-Relicense-Tenda-AC9-file-to-the-GPL.patch new file mode 100644 index 00000000000..a5358b70c33 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/035-v4.21-0003-ARM-dts-BCM53573-Relicense-Tenda-AC9-file-to-the-GPL.patch @@ -0,0 +1,32 @@ +From 1c9001b4f69a37820862286b3bbcdde152a52dcf Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 20 Sep 2018 13:37:47 +0200 +Subject: [PATCH] ARM: dts: BCM53573: Relicense Tenda AC9 file to the GPL 2.0+ + / MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This matches licensing used by most of BCM5301X files and is preferred as: +1) GPL 2.0+ makes it clearly compatible with Linux kernel +2) MIT is also permissive but preferred over ISC + +This file was fully developed by me. + +Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm47189-tenda-ac9.dts | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm47189-tenda-ac9.dts ++++ b/arch/arm/boot/dts/bcm47189-tenda-ac9.dts +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright (C) 2016 Rafał Miłecki +- * +- * Licensed under the ISC license. + */ + + /dts-v1/; diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.21-0004-ARM-dts-BCM53573-Relicense-SoC-file-to-the-GPL-2.0-M.patch b/target/linux/bcm53xx/patches-4.14/035-v4.21-0004-ARM-dts-BCM53573-Relicense-SoC-file-to-the-GPL-2.0-M.patch new file mode 100644 index 00000000000..56cd6376aa7 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/035-v4.21-0004-ARM-dts-BCM53573-Relicense-SoC-file-to-the-GPL-2.0-M.patch @@ -0,0 +1,33 @@ +From ca3a6e705cad10662827093d5426abe078861793 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 20 Sep 2018 13:39:28 +0200 +Subject: [PATCH] ARM: dts: BCM53573: Relicense SoC file to the GPL 2.0+ / MIT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This matches licensing used by most of BCM5301X files and is preferred as: +1) GPL 2.0+ makes it clearly compatible with Linux kernel +2) MIT is also permissive but preferred over ISC + +This file has been developed by me & once modified by Rob dropping a +single leading zero in an UART address. + +Signed-off-by: Rafał Miłecki +Acked-by: Rob Herring +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/bcm53573.dtsi | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/bcm53573.dtsi ++++ b/arch/arm/boot/dts/bcm53573.dtsi +@@ -1,7 +1,6 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + /* + * Copyright (C) 2016 Rafał Miłecki +- * +- * Licensed under the ISC license. + */ + + #include diff --git a/target/linux/bcm53xx/patches-4.14/035-v4.21-0005-ARM-dts-BCM5301X-Add-basic-DT-for-Linksys-EA6500-V2.patch b/target/linux/bcm53xx/patches-4.14/035-v4.21-0005-ARM-dts-BCM5301X-Add-basic-DT-for-Linksys-EA6500-V2.patch new file mode 100644 index 00000000000..d657d7ab1c9 --- /dev/null +++ b/target/linux/bcm53xx/patches-4.14/035-v4.21-0005-ARM-dts-BCM5301X-Add-basic-DT-for-Linksys-EA6500-V2.patch @@ -0,0 +1,75 @@ +From 03e96644d7a810916fc4997d572577e876908b18 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ren=C3=A9=20Kjellerup?= +Date: Mon, 1 Oct 2018 15:07:16 -0700 +Subject: [PATCH] ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2 + +It is wireless home router based on BCM4708A0 with BCM4360 + BCM4331 +wireless chipsets. The BCM4331 5GHz chip currently isn't supported only +due to missing compatible firmware. + +Signed-off-by: Rene Kjellerup +Signed-off-by: Florian Fainelli +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts | 45 +++++++++++++++++++++++++ + 2 files changed, 46 insertions(+) + create mode 100644 arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -82,6 +82,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ + bcm4708-asus-rt-ac68u.dtb \ + bcm4708-buffalo-wzr-1750dhp.dtb \ + bcm4708-linksys-ea6300-v1.dtb \ ++ bcm4708-linksys-ea6500-v2.dtb \ + bcm4708-luxul-xap-1510.dtb \ + bcm4708-luxul-xwc-1000.dtb \ + bcm4708-netgear-r6250.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts +@@ -0,0 +1,45 @@ ++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT ++/* ++ * Copyright (C) 2017 Rafał Miłecki ++ * Copyright (C) 2018 Rene Kjellerup ++ */ ++ ++/dts-v1/; ++ ++#include "bcm4708.dtsi" ++#include "bcm5301x-nand-cs0-bch8.dtsi" ++ ++/ { ++ compatible = "linksys,ea6500-v2", "brcm,bcm4708"; ++ model = "Linksys EA6500 V2"; ++ ++ chosen { ++ bootargs = "console=ttyS0,115200"; ++ }; ++ ++ memory { ++ reg = <0x00000000 0x08000000>; ++ }; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ wps { ++ label = "WPS"; ++ linux,code = ; ++ gpios = <&chipcommon 7 GPIO_ACTIVE_LOW>; ++ }; ++ ++ restart { ++ label = "Reset"; ++ linux,code = ; ++ gpios = <&chipcommon 11 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&usb3_phy { ++ status = "okay"; ++}; diff --git a/target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch b/target/linux/bcm53xx/patches-4.14/035-v4.21-0006-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch similarity index 85% rename from target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch rename to target/linux/bcm53xx/patches-4.14/035-v4.21-0006-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch index 7b2904acbcc..5f6dd17dc7c 100644 --- a/target/linux/bcm53xx/patches-4.14/131-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch +++ b/target/linux/bcm53xx/patches-4.14/035-v4.21-0006-ARM-dts-BCM5301X-Describe-Northstar-pins-mux-control.patch @@ -1,5 +1,6 @@ +From 9994241ac97cb84d1df98fdc172d3cc6b04b11bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Fri, 9 Nov 2018 09:53:56 +0100 +Date: Fri, 9 Nov 2018 09:56:49 +0100 Subject: [PATCH] ARM: dts: BCM5301X: Describe Northstar pins mux controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 @@ -9,7 +10,10 @@ This describes hardware & will allow referencing pin functions. The first usage is UART1 which allows supporting devices using it. Signed-off-by: Rafał Miłecki +Signed-off-by: Florian Fainelli --- + arch/arm/boot/dts/bcm5301x.dtsi | 44 +++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) --- a/arch/arm/boot/dts/bcm5301x.dtsi +++ b/arch/arm/boot/dts/bcm5301x.dtsi diff --git a/target/linux/bcm53xx/patches-4.14/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch b/target/linux/bcm53xx/patches-4.14/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch index 5092817f076..c546ba9f62e 100644 --- a/target/linux/bcm53xx/patches-4.14/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch +++ b/target/linux/bcm53xx/patches-4.14/310-ARM-BCM5301X-Add-DT-for-Netgear-R7900.patch @@ -9,7 +9,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -97,6 +97,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ +@@ -98,6 +98,7 @@ dtb-$(CONFIG_ARCH_BCM_5301X) += \ bcm4709-buffalo-wxr-1900dhp.dtb \ bcm4709-linksys-ea9200.dtb \ bcm4709-netgear-r7000.dtb \ diff --git a/target/linux/bcm53xx/patches-4.14/905-BCM53573-minor-hacks.patch b/target/linux/bcm53xx/patches-4.14/905-BCM53573-minor-hacks.patch index e3ee0f73569..0813b6a817a 100644 --- a/target/linux/bcm53xx/patches-4.14/905-BCM53573-minor-hacks.patch +++ b/target/linux/bcm53xx/patches-4.14/905-BCM53573-minor-hacks.patch @@ -11,7 +11,7 @@ Signed-off-by: Rafał Miłecki --- a/arch/arm/boot/dts/bcm53573.dtsi +++ b/arch/arm/boot/dts/bcm53573.dtsi -@@ -54,6 +54,7 @@ +@@ -53,6 +53,7 @@ , , ; From baa00b21820a931c44ecd7cfdfc4e2b4dc19ce16 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Tue, 4 Dec 2018 21:06:20 +0200 Subject: [PATCH 330/399] brcm2708-gpu-fw: update to git HEAD Signed-off-by: Stijn Tintel (cherry picked from commit 42ca32ad2ffc2fcd22878173eba011962d369c50) --- package/kernel/brcm2708-gpu-fw/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package/kernel/brcm2708-gpu-fw/Makefile b/package/kernel/brcm2708-gpu-fw/Makefile index 73aebd7b5f2..e98add03bd0 100644 --- a/package/kernel/brcm2708-gpu-fw/Makefile +++ b/package/kernel/brcm2708-gpu-fw/Makefile @@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=brcm2708-gpu-fw -PKG_VERSION:=2018-05-16 -PKG_RELEASE:=0f5f899ccec1c2ef8bba02aa49700b4ec19b4199 +PKG_VERSION:=2018-11-29 +PKG_RELEASE:=b428bdd819df8d0ad3009b64492a4b3d1f9453e4 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)/rpi-firmware-$(PKG_RELEASE) @@ -33,7 +33,7 @@ define Download/bootcode_bin FILE:=$(RPI_FIRMWARE_FILE)-bootcode.bin URL:=$(RPI_FIRMWARE_URL) URL_FILE:=bootcode.bin - HASH:=c9eb5258766fabf7127e790b257f106e2717f0ccaaed37544b970b0d113956fc + HASH:=7b24659eb049333eec69f59cf0c5aa0d49eab5ed67726af3c6f0c9bcf1e3f9e3 endef $(eval $(call Download,bootcode_bin)) @@ -41,7 +41,7 @@ define Download/fixup_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup.dat - HASH:=8a6311e73d0f349be9b8424db0644fd8f48aaf721f3f2f487488c83d7316cbdf + HASH:=5e5946fe7c0b1f5e270f43a17aef5f6da5758d5e544ed37137628c972c9b8061 endef $(eval $(call Download,fixup_dat)) @@ -49,7 +49,7 @@ define Download/fixup_cd_dat FILE:=$(RPI_FIRMWARE_FILE)-fixup_cd.dat URL:=$(RPI_FIRMWARE_URL) URL_FILE:=fixup_cd.dat - HASH:=973b008aae9711d57ddce4f058354fe5a0b4725dd825673f784a2e2754da1f28 + HASH:=d7ed04063af818695f6d2f6ffdde8304c19385051c9cee7f8d6d5b20851e4e55 endef $(eval $(call Download,fixup_cd_dat)) @@ -57,7 +57,7 @@ define Download/start_elf FILE:=$(RPI_FIRMWARE_FILE)-start.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start.elf - HASH:=8e77c4cce7e44ced609e5046dd55f19cb7656a8ce4694e733b7eb6ecab915fe1 + HASH:=7e69d068c249cd859f5c44a8cf80a5e96a3f3fbeeeb0260de7373130a1d9b0fe endef $(eval $(call Download,start_elf)) @@ -65,7 +65,7 @@ define Download/start_cd_elf FILE:=$(RPI_FIRMWARE_FILE)-start_cd.elf URL:=$(RPI_FIRMWARE_URL) URL_FILE:=start_cd.elf - HASH:=25223b479b7aca1d74c6f7a1829aba69fd14906ca5b25ae12571fe71ea2c5a4a + HASH:=08aee2119a19c3556099ff875181d8e5440ebd1cecf1a5936b9340fe41da4428 endef $(eval $(call Download,start_cd_elf)) From 806b570a35362e29f1c615db7bbb9cdf2deda20e Mon Sep 17 00:00:00 2001 From: Massimo Tum Date: Tue, 2 Oct 2018 16:19:24 +0200 Subject: [PATCH 331/399] ath10k: update QCA4019 firmware Update firmware for QCA4019 also for 18.06 branch. https://github.com/openwrt/openwrt/pull/1138 Signed-off-by: Massimo Tum --- package/firmware/ath10k-firmware/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index c2b40006718..6e6670b87f6 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -403,7 +403,7 @@ define Package/ath10k-firmware-qca4019/install $(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/ $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.4/firmware-5.bin_10.4-3.4-00104 \ + $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.5.3/firmware-5.bin_10.4-3.5.3-00057 \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin endef From 016a71a18a238842e36d6742af7fb852fe5742dc Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Thu, 29 Nov 2018 21:44:16 +0100 Subject: [PATCH 332/399] odhcpd: backport prefix filter/NETEV_ADDR6LIST_CHANGE event fixes d404c7e netlink: fix triggering of NETEV_ADDR6LIST_CHANGE event ae6cf80 config: correctly break string for prefix filter Signed-off-by: Hans Dedecker (cherry picked from commit 493c1d17663dbfdaf23304994e71280400493fc2) --- package/network/services/odhcpd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index e3a4214bf93..3a1998bf23c 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=3 -PKG_VERSION:=1.12 +PKG_VERSION:=1.13 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2018-10-07 -PKG_SOURCE_VERSION:=57f639e3b0288c2ec12cdfb8598a182293746a0a -PKG_MIRROR_HASH:=2cf81f6044ac3a325481c3f0a754773c74fca6fb5cf3a44d4105e43df47cdbf8 +PKG_SOURCE_DATE:=2018-11-29 +PKG_SOURCE_VERSION:=d404c7e50bd487f9d8d3b13e5ff1c7fa878c7973 +PKG_MIRROR_HASH:=59cf3dfc3d30ac99fc5b914caae4eddc71567ca4a8709a2f464e562fc124ef0f PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From afcdf099b7cc505acf9497a3dbccf4e6bdc29c27 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 29 Dec 2018 13:41:35 +0100 Subject: [PATCH 333/399] kernel: fix f2fs on big endian machines The WD MyBook Live SquashFS images didn't work anymore due to a upstream regression in f2fs commit: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows") that got backported to 4.14.86 and 4.9.144. by Martin Blumenstingl: |Treat "block_count" from struct f2fs_super_block as 64-bit little endian |value in sanity_check_raw_super() because struct f2fs_super_block |declares "block_count" as "__le64". | |This fixes a bug where the superblock validation fails on big endian |devices with the following error: | F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) | F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock | F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) | F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock |As result of this the partition cannot be mounted. | |With this patch applied the superblock validation works fine and the |partition can be mounted again: | F2FS-fs (sda1): Mounted with checkpoint version = 7c84 | |My little endian x86-64 hardware was able to mount the partition without |this fix. |To confirm that mounting f2fs filesystems works on big endian machines |again I tested this on a 32-bit MIPS big endian (lantiq) device. Hopefully, this will do until Martin's patch moved through upstream to -stable. Signed-off-by: Christian Lamparter --- ...eck_raw_super-on-big-endian-machines.patch | 51 +++++++++++++++++++ ...eck_raw_super-on-big-endian-machines.patch | 51 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch create mode 100644 target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch diff --git a/target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch b/target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch new file mode 100644 index 00000000000..6cbaf28e81f --- /dev/null +++ b/target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch @@ -0,0 +1,51 @@ +From: Martin Blumenstingl +To: linux-f2fs-devel@lists.sourceforge.net, yuchao0@huawei.com, + jaegeuk@kernel.org +Subject: [PATCH v2 1/1] f2fs: fix validation of the block count in + sanity_check_raw_super +Date: Sat, 22 Dec 2018 11:22:26 +0100 +Message-Id: <20181222102226.10050-2-martin.blumenstingl@googlemail.com> + +Treat "block_count" from struct f2fs_super_block as 64-bit little endian +value in sanity_check_raw_super() because struct f2fs_super_block +declares "block_count" as "__le64". + +This fixes a bug where the superblock validation fails on big endian +devices with the following error: + F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) + F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock + F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) + F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock +As result of this the partition cannot be mounted. + +With this patch applied the superblock validation works fine and the +partition can be mounted again: + F2FS-fs (sda1): Mounted with checkpoint version = 7c84 + +My little endian x86-64 hardware was able to mount the partition without +this fix. +To confirm that mounting f2fs filesystems works on big endian machines +again I tested this on a 32-bit MIPS big endian (lantiq) device. + +Fixes: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows") +Cc: stable@vger.kernel.org +Signed-off-by: Martin Blumenstingl +Reviewed-by: Chao Yu +--- + +--- a/fs/f2fs/super.c ++++ b/fs/f2fs/super.c +@@ -1897,10 +1897,10 @@ static int sanity_check_raw_super(struct + return 1; + } + +- if (segment_count > (le32_to_cpu(raw_super->block_count) >> 9)) { ++ if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) { + f2fs_msg(sb, KERN_INFO, +- "Wrong segment_count / block_count (%u > %u)", +- segment_count, le32_to_cpu(raw_super->block_count)); ++ "Wrong segment_count / block_count (%u > %llu)", ++ segment_count, le64_to_cpu(raw_super->block_count)); + return 1; + } + diff --git a/target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch b/target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch new file mode 100644 index 00000000000..5844af52332 --- /dev/null +++ b/target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch @@ -0,0 +1,51 @@ +From: Martin Blumenstingl +To: linux-f2fs-devel@lists.sourceforge.net, yuchao0@huawei.com, + jaegeuk@kernel.org +Subject: [PATCH v2 1/1] f2fs: fix validation of the block count in + sanity_check_raw_super +Date: Sat, 22 Dec 2018 11:22:26 +0100 +Message-Id: <20181222102226.10050-2-martin.blumenstingl@googlemail.com> + +Treat "block_count" from struct f2fs_super_block as 64-bit little endian +value in sanity_check_raw_super() because struct f2fs_super_block +declares "block_count" as "__le64". + +This fixes a bug where the superblock validation fails on big endian +devices with the following error: + F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) + F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock + F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) + F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock +As result of this the partition cannot be mounted. + +With this patch applied the superblock validation works fine and the +partition can be mounted again: + F2FS-fs (sda1): Mounted with checkpoint version = 7c84 + +My little endian x86-64 hardware was able to mount the partition without +this fix. +To confirm that mounting f2fs filesystems works on big endian machines +again I tested this on a 32-bit MIPS big endian (lantiq) device. + +Fixes: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows") +Cc: stable@vger.kernel.org +Signed-off-by: Martin Blumenstingl +Reviewed-by: Chao Yu +--- + +--- a/fs/f2fs/super.c ++++ b/fs/f2fs/super.c +@@ -1427,10 +1427,10 @@ static int sanity_check_raw_super(struct + return 1; + } + +- if (segment_count > (le32_to_cpu(raw_super->block_count) >> 9)) { ++ if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) { + f2fs_msg(sb, KERN_INFO, +- "Wrong segment_count / block_count (%u > %u)", +- segment_count, le32_to_cpu(raw_super->block_count)); ++ "Wrong segment_count / block_count (%u > %llu)", ++ segment_count, le64_to_cpu(raw_super->block_count)); + return 1; + } + From 8a9b0b95df7d96bc51d6e4731264add11f72925d Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sun, 30 Dec 2018 20:46:06 +0100 Subject: [PATCH 334/399] apm821xx: switch MX60(W)'s recovery images to multi-image method In the past, the MX60(W)'s recovery images always had problems with the size restriction and never really worked without manual intervention. This patch reworks the initramfs, which allows the device to ease up on the impossible tight kernel size requirements for the initramfs image. This new initramfs can be loaded through the MX60(W) U-boot in the following way: => setenv bootargs console=ttyS0,$baudrate => tftpboot $meraki_loadaddr meraki_mx60-initramfs-kernel.bin [...] Load address: 0x800000 Loading: ################################################ [...] done [...] => bootm $fileaddr \## Booting kernel from Legacy Image at 00800000 ... ... For more information and the latest flashing guide: please visit the OpenWrt Wiki Page for the MX60(W): Signed-off-by: Chris Blake Signed-off-by: Christian Lamparter (cherry picked from commit 36c19c9f0be23ad327085aa762e95de638e19b4a) --- target/linux/apm821xx/image/Makefile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 1e94a409185..7f33c660e63 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -102,13 +102,10 @@ define Device/meraki_mx60 # otherwise the final image will fail to boot. This is set within the # MX60 kernel header definition which is found at # ./tools/firmware-utils/src/mkmerakifw.c, line 103~ - KERNEL_SIZE := 2984k + KERNEL_SIZE := 4031k IMAGE_SIZE := 1021m KERNEL := kernel-bin | gzip | uImage gzip | MerakiAdd-dtb | MerakiNAND - KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux | gzip | uImage gzip | \ - check-size $$(KERNEL_SIZE) | \ - MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \ - MerakiNAND + KERNEL_INITRAMFS := kernel-bin | gzip | dtb | MuImage-initramfs gzip IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 SUPPORTED_DEVICES += mx60 From 62ddfaff32a3a819fac4d8cdfdad012a6707e537 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Fri, 4 Jan 2019 18:59:14 +0100 Subject: [PATCH 335/399] odhcpd: filter routes based on prefix_filter 96694ab router: filter route information option Signed-off-by: Hans Dedecker --- package/network/services/odhcpd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 3a1998bf23c..2f5b4a5d2f1 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=3 -PKG_VERSION:=1.13 +PKG_VERSION:=1.14 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2018-11-29 -PKG_SOURCE_VERSION:=d404c7e50bd487f9d8d3b13e5ff1c7fa878c7973 -PKG_MIRROR_HASH:=59cf3dfc3d30ac99fc5b914caae4eddc71567ca4a8709a2f464e562fc124ef0f +PKG_SOURCE_DATE:=2018-01-04 +PKG_SOURCE_VERSION:=96694abe8093b06daf5d503d19e7cdcd62de03a5 +PKG_MIRROR_HASH:=f1407019f9d2e9459159837f4ad1b55fc18a41297ee525135fa1a072742c86af PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From c5c20f510a19f0eb5500fefde1f366f48c168e85 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 5 Jan 2019 11:24:27 +0100 Subject: [PATCH 336/399] odhcpd: noop to fix PKG_SOURCE_DATE Signed-off-by: Hans Dedecker --- package/network/services/odhcpd/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 2f5b4a5d2f1..f5be5ff4c88 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -13,7 +13,7 @@ PKG_VERSION:=1.14 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2018-01-04 +PKG_SOURCE_DATE:=2019-01-04 PKG_SOURCE_VERSION:=96694abe8093b06daf5d503d19e7cdcd62de03a5 PKG_MIRROR_HASH:=f1407019f9d2e9459159837f4ad1b55fc18a41297ee525135fa1a072742c86af From a8cc06c5371eca2ae8ab4511c7136d0ebd9ee3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Tue, 8 Jan 2019 10:01:08 +0100 Subject: [PATCH 337/399] mac80211: brcmfmac: backport firmware loading changes & fix memory bugs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This pick most of brcmfmac changes backported into the master in commits 5932eb690f24 ("mac80211: brcmfmac: backport firmware loading cleanup") 3eab6b8275b2 ("mac80211: brcmfmac: backport NVRAM loading improvements") 529c95cc15dc ("mac80211: brcmfmac: fix use-after-free & possible NULL pointer dereference") It's more than would be normally backported into a stable branch but it seems required. Firmware loading cleanups are needed to allow fix memory bugs in a reliable way. Memory fixes are really important to avoid corrupting memory and risking a NULL pointer dereference. Hopefully this stuff has received enough testing in the master. Signed-off-by: Rafał Miłecki --- ...ve-firmware-loading-code-duplication.patch | 102 ++++++++++ ...recursion-from-firmware-load-error-h.patch | 127 +++++++++++++ ...port-for-first-trying-to-get-a-board.patch | 77 ++++++++ ...rd_type-used-for-nvram-file-selectio.patch | 77 ++++++++ ...rd_type-from-DMI-on-x86-based-machin.patch | 179 ++++++++++++++++++ ...cmfmac-Cleanup-brcmf_fw_request_done.patch | 41 ++++ ...-register-wiphy-s-during-module_init.patch | 26 +-- ...-in-driver-tables-with-country-codes.patch | 6 +- 8 files changed, 620 insertions(+), 15 deletions(-) create mode 100644 package/kernel/mac80211/patches/355-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch create mode 100644 package/kernel/mac80211/patches/355-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch create mode 100644 package/kernel/mac80211/patches/355-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch create mode 100644 package/kernel/mac80211/patches/355-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch create mode 100644 package/kernel/mac80211/patches/355-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch create mode 100644 package/kernel/mac80211/patches/355-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch diff --git a/package/kernel/mac80211/patches/355-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch b/package/kernel/mac80211/patches/355-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch new file mode 100644 index 00000000000..eca15a516e5 --- /dev/null +++ b/package/kernel/mac80211/patches/355-v5.0-0001-brcmfmac-Remove-firmware-loading-code-duplication.patch @@ -0,0 +1,102 @@ +From a1a3b762163868ad07a4499a73df324f40d5ab0b Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 10 Oct 2018 13:00:58 +0200 +Subject: [PATCH] brcmfmac: Remove firmware-loading code duplication + +brcmf_fw_request_next_item and brcmf_fw_request_done both have identical +code to complete the fw-request depending on the item-type. + +This commit adds a new brcmf_fw_complete_request helper removing this code +duplication. + +Signed-off-by: Hans de Goede +Signed-off-by: Kalle Valo +--- + .../broadcom/brcm80211/brcmfmac/firmware.c | 62 +++++++++++----------- + 1 file changed, 31 insertions(+), 31 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +@@ -504,6 +504,34 @@ fail: + return -ENOENT; + } + ++static int brcmf_fw_complete_request(const struct firmware *fw, ++ struct brcmf_fw *fwctx) ++{ ++ struct brcmf_fw_item *cur = &fwctx->req->items[fwctx->curpos]; ++ int ret = 0; ++ ++ brcmf_dbg(TRACE, "firmware %s %sfound\n", cur->path, fw ? "" : "not "); ++ ++ switch (cur->type) { ++ case BRCMF_FW_TYPE_NVRAM: ++ ret = brcmf_fw_request_nvram_done(fw, fwctx); ++ break; ++ case BRCMF_FW_TYPE_BINARY: ++ if (fw) ++ cur->binary = fw; ++ else ++ ret = -ENOENT; ++ break; ++ default: ++ /* something fishy here so bail out early */ ++ brcmf_err("unknown fw type: %d\n", cur->type); ++ release_firmware(fw); ++ ret = -EINVAL; ++ } ++ ++ return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret; ++} ++ + static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async) + { + struct brcmf_fw_item *cur; +@@ -525,15 +553,7 @@ static int brcmf_fw_request_next_item(st + if (ret < 0) { + brcmf_fw_request_done(NULL, fwctx); + } else if (!async && fw) { +- brcmf_dbg(TRACE, "firmware %s %sfound\n", cur->path, +- fw ? "" : "not "); +- if (cur->type == BRCMF_FW_TYPE_BINARY) +- cur->binary = fw; +- else if (cur->type == BRCMF_FW_TYPE_NVRAM) +- brcmf_fw_request_nvram_done(fw, fwctx); +- else +- release_firmware(fw); +- ++ brcmf_fw_complete_request(fw, fwctx); + return -EAGAIN; + } + return 0; +@@ -547,28 +567,8 @@ static void brcmf_fw_request_done(const + + cur = &fwctx->req->items[fwctx->curpos]; + +- brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path, +- fw ? "" : "not "); +- +- if (!fw) +- ret = -ENOENT; +- +- switch (cur->type) { +- case BRCMF_FW_TYPE_NVRAM: +- ret = brcmf_fw_request_nvram_done(fw, fwctx); +- break; +- case BRCMF_FW_TYPE_BINARY: +- cur->binary = fw; +- break; +- default: +- /* something fishy here so bail out early */ +- brcmf_err("unknown fw type: %d\n", cur->type); +- release_firmware(fw); +- ret = -EINVAL; +- goto fail; +- } +- +- if (ret < 0 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL)) ++ ret = brcmf_fw_complete_request(fw, fwctx); ++ if (ret < 0) + goto fail; + + do { diff --git a/package/kernel/mac80211/patches/355-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch b/package/kernel/mac80211/patches/355-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch new file mode 100644 index 00000000000..1a4a1ec348a --- /dev/null +++ b/package/kernel/mac80211/patches/355-v5.0-0002-brcmfmac-Remove-recursion-from-firmware-load-error-h.patch @@ -0,0 +1,127 @@ +From 5b587496dc63595b71265d986ce69728c2724370 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 10 Oct 2018 13:00:59 +0200 +Subject: [PATCH] brcmfmac: Remove recursion from firmware load error handling + +Before this commit brcmf_fw_request_done would call +brcmf_fw_request_next_item to load the next item, which on an error would +call brcmf_fw_request_done, which if the error is recoverable (*) will +then continue calling brcmf_fw_request_next_item for the next item again +which on an error will call brcmf_fw_request_done again... + +This does not blow up because we only have a limited number of items so +we never recurse too deep. But the recursion is still quite ugly and +frankly is giving me a headache, so lets fix this. + +This commit fixes this by removing brcmf_fw_request_next_item and by +making brcmf_fw_get_firmwares and brcmf_fw_request_done directly call +firmware_request_nowait resp. firmware_request themselves. + +*) brcmf_fw_request_nvram_done fallback path succeeds or + BRCMF_FW_REQF_OPTIONAL is set + +Signed-off-by: Hans de Goede +Signed-off-by: Kalle Valo +--- + .../broadcom/brcm80211/brcmfmac/firmware.c | 65 +++++++--------------- + 1 file changed, 19 insertions(+), 46 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +@@ -532,33 +532,6 @@ static int brcmf_fw_complete_request(con + return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret; + } + +-static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async) +-{ +- struct brcmf_fw_item *cur; +- const struct firmware *fw = NULL; +- int ret; +- +- cur = &fwctx->req->items[fwctx->curpos]; +- +- brcmf_dbg(TRACE, "%srequest for %s\n", async ? "async " : "", +- cur->path); +- +- if (async) +- ret = request_firmware_nowait(THIS_MODULE, true, cur->path, +- fwctx->dev, GFP_KERNEL, fwctx, +- brcmf_fw_request_done); +- else +- ret = request_firmware(&fw, cur->path, fwctx->dev); +- +- if (ret < 0) { +- brcmf_fw_request_done(NULL, fwctx); +- } else if (!async && fw) { +- brcmf_fw_complete_request(fw, fwctx); +- return -EAGAIN; +- } +- return 0; +-} +- + static void brcmf_fw_request_done(const struct firmware *fw, void *ctx) + { + struct brcmf_fw *fwctx = ctx; +@@ -568,26 +541,19 @@ static void brcmf_fw_request_done(const + cur = &fwctx->req->items[fwctx->curpos]; + + ret = brcmf_fw_complete_request(fw, fwctx); +- if (ret < 0) +- goto fail; + +- do { +- if (++fwctx->curpos == fwctx->req->n_items) { +- ret = 0; +- goto done; +- } +- +- ret = brcmf_fw_request_next_item(fwctx, false); +- } while (ret == -EAGAIN); +- +- return; +- +-fail: +- brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret, +- dev_name(fwctx->dev), cur->path); +- brcmf_fw_free_request(fwctx->req); +- fwctx->req = NULL; +-done: ++ while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) { ++ cur = &fwctx->req->items[fwctx->curpos]; ++ request_firmware(&fw, cur->path, fwctx->dev); ++ ret = brcmf_fw_complete_request(fw, ctx); ++ } ++ ++ if (ret) { ++ brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret, ++ dev_name(fwctx->dev), cur->path); ++ brcmf_fw_free_request(fwctx->req); ++ fwctx->req = NULL; ++ } + fwctx->done(fwctx->dev, ret, fwctx->req); + kfree(fwctx); + } +@@ -611,7 +577,9 @@ int brcmf_fw_get_firmwares(struct device + void (*fw_cb)(struct device *dev, int err, + struct brcmf_fw_request *req)) + { ++ struct brcmf_fw_item *first = &req->items[0]; + struct brcmf_fw *fwctx; ++ int ret; + + brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev)); + if (!fw_cb) +@@ -628,7 +596,12 @@ int brcmf_fw_get_firmwares(struct device + fwctx->req = req; + fwctx->done = fw_cb; + +- brcmf_fw_request_next_item(fwctx, true); ++ ret = request_firmware_nowait(THIS_MODULE, true, first->path, ++ fwctx->dev, GFP_KERNEL, fwctx, ++ brcmf_fw_request_done); ++ if (ret < 0) ++ brcmf_fw_request_done(NULL, fwctx); ++ + return 0; + } + diff --git a/package/kernel/mac80211/patches/355-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch b/package/kernel/mac80211/patches/355-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch new file mode 100644 index 00000000000..727dcbe85a8 --- /dev/null +++ b/package/kernel/mac80211/patches/355-v5.0-0003-brcmfmac-Add-support-for-first-trying-to-get-a-board.patch @@ -0,0 +1,77 @@ +From eae8e50669e15002b195177212a6e25afbe7cf4d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 10 Oct 2018 13:01:00 +0200 +Subject: [PATCH] brcmfmac: Add support for first trying to get a board + specific nvram file + +The nvram files which some brcmfmac chips need are board-specific. To be +able to distribute these as part of linux-firmware, so that devices with +such a wifi chip will work OOTB, multiple (one per board) versions must +co-exist under /lib/firmware. + +This commit adds support for callers of the brcmfmac/firmware.c code to +pass in a board_type parameter through the request structure. + +If that parameter is set then the code will first try to load +chipmodel.board_type.txt before falling back to the old chipmodel.txt name. + +Signed-off-by: Hans de Goede +Signed-off-by: Kalle Valo +--- + .../broadcom/brcm80211/brcmfmac/firmware.c | 27 +++++++++++++++++++++- + .../broadcom/brcm80211/brcmfmac/firmware.h | 1 + + 2 files changed, 27 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +@@ -532,6 +532,31 @@ static int brcmf_fw_complete_request(con + return (cur->flags & BRCMF_FW_REQF_OPTIONAL) ? 0 : ret; + } + ++static int brcmf_fw_request_firmware(const struct firmware **fw, ++ struct brcmf_fw *fwctx) ++{ ++ struct brcmf_fw_item *cur = &fwctx->req->items[fwctx->curpos]; ++ int ret; ++ ++ /* nvram files are board-specific, first try a board-specific path */ ++ if (cur->type == BRCMF_FW_TYPE_NVRAM && fwctx->req->board_type) { ++ char alt_path[BRCMF_FW_NAME_LEN]; ++ ++ strlcpy(alt_path, cur->path, BRCMF_FW_NAME_LEN); ++ /* strip .txt at the end */ ++ alt_path[strlen(alt_path) - 4] = 0; ++ strlcat(alt_path, ".", BRCMF_FW_NAME_LEN); ++ strlcat(alt_path, fwctx->req->board_type, BRCMF_FW_NAME_LEN); ++ strlcat(alt_path, ".txt", BRCMF_FW_NAME_LEN); ++ ++ ret = request_firmware(fw, alt_path, fwctx->dev); ++ if (ret == 0) ++ return ret; ++ } ++ ++ return request_firmware(fw, cur->path, fwctx->dev); ++} ++ + static void brcmf_fw_request_done(const struct firmware *fw, void *ctx) + { + struct brcmf_fw *fwctx = ctx; +@@ -544,7 +569,7 @@ static void brcmf_fw_request_done(const + + while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) { + cur = &fwctx->req->items[fwctx->curpos]; +- request_firmware(&fw, cur->path, fwctx->dev); ++ brcmf_fw_request_firmware(&fw, fwctx); + ret = brcmf_fw_complete_request(fw, ctx); + } + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.h +@@ -70,6 +70,7 @@ struct brcmf_fw_request { + u16 domain_nr; + u16 bus_nr; + u32 n_items; ++ const char *board_type; + struct brcmf_fw_item items[0]; + }; + diff --git a/package/kernel/mac80211/patches/355-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch b/package/kernel/mac80211/patches/355-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch new file mode 100644 index 00000000000..a33ceaa21ed --- /dev/null +++ b/package/kernel/mac80211/patches/355-v5.0-0004-brcmfmac-Set-board_type-used-for-nvram-file-selectio.patch @@ -0,0 +1,77 @@ +From 0ad4b55b2f29784f93875e6231bf57cd233624a2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 10 Oct 2018 13:01:01 +0200 +Subject: [PATCH] brcmfmac: Set board_type used for nvram file selection to + machine-compatible + +For of/devicetree using machines, set the board_type used for nvram file +selection to the first string listed in the top-level's node compatible +string, aka the machine-compatible as used by of_machine_is_compatible(). + +The board_type setting is used to load the board-specific nvram file with +a board-specific name so that we can ship files for each supported board +in linux-firmware. + +Signed-off-by: Hans de Goede +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h | 1 + + drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 11 ++++++++++- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c | 1 + + drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 1 + + 4 files changed, 13 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +@@ -59,6 +59,7 @@ struct brcmf_mp_device { + bool iapp; + bool ignore_probe_fail; + struct brcmfmac_pd_cc *country_codes; ++ const char *board_type; + union { + struct brcmfmac_sdio_pd sdio; + } bus; +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +@@ -27,11 +27,20 @@ void brcmf_of_probe(struct device *dev, + struct brcmf_mp_device *settings) + { + struct brcmfmac_sdio_pd *sdio = &settings->bus.sdio; +- struct device_node *np = dev->of_node; ++ struct device_node *root, *np = dev->of_node; ++ struct property *prop; + int irq; + u32 irqf; + u32 val; + ++ /* Set board-type to the first string of the machine compatible prop */ ++ root = of_find_node_by_path("/"); ++ if (root) { ++ prop = of_find_property(root, "compatible", NULL); ++ settings->board_type = of_prop_next_string(prop, NULL); ++ of_node_put(root); ++ } ++ + if (!np || bus_type != BRCMF_BUSTYPE_SDIO || + !of_device_is_compatible(np, "brcm,bcm4329-fmac")) + return; +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +@@ -1785,6 +1785,7 @@ brcmf_pcie_prepare_fw_request(struct brc + fwreq->items[BRCMF_PCIE_FW_CODE].type = BRCMF_FW_TYPE_BINARY; + fwreq->items[BRCMF_PCIE_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM; + fwreq->items[BRCMF_PCIE_FW_NVRAM].flags = BRCMF_FW_REQF_OPTIONAL; ++ fwreq->board_type = devinfo->settings->board_type; + /* NVRAM reserves PCI domain 0 for Broadcom's SDK faked bus */ + fwreq->domain_nr = pci_domain_nr(devinfo->pdev->bus) + 1; + fwreq->bus_nr = devinfo->pdev->bus->number; +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +@@ -4174,6 +4174,7 @@ brcmf_sdio_prepare_fw_request(struct brc + + fwreq->items[BRCMF_SDIO_FW_CODE].type = BRCMF_FW_TYPE_BINARY; + fwreq->items[BRCMF_SDIO_FW_NVRAM].type = BRCMF_FW_TYPE_NVRAM; ++ fwreq->board_type = bus->sdiodev->settings->board_type; + + return fwreq; + } diff --git a/package/kernel/mac80211/patches/355-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch b/package/kernel/mac80211/patches/355-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch new file mode 100644 index 00000000000..25426e3f109 --- /dev/null +++ b/package/kernel/mac80211/patches/355-v5.0-0005-brcmfmac-Set-board_type-from-DMI-on-x86-based-machin.patch @@ -0,0 +1,179 @@ +From bd1e82bb420adf4ad7cd468d8a482cde622dd69d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 10 Oct 2018 13:01:02 +0200 +Subject: [PATCH] brcmfmac: Set board_type from DMI on x86 based machines + +For x86 based machines, set the board_type used for nvram file selection +based on the DMI sys-vendor and product-name strings. + +Since on some models these strings are too generic, this commit also adds +a quirk table overriding the strings for models listed in that table. + +The board_type setting is used to load the board-specific nvram file with +a board-specific name so that we can ship files for each supported board +in linux-firmware. + +Signed-off-by: Hans de Goede +Signed-off-by: Kalle Valo +--- + .../wireless/broadcom/brcm80211/brcmfmac/Makefile | 2 + + .../wireless/broadcom/brcm80211/brcmfmac/common.c | 3 +- + .../wireless/broadcom/brcm80211/brcmfmac/common.h | 7 ++ + .../net/wireless/broadcom/brcm80211/brcmfmac/dmi.c | 116 +++++++++++++++++++++ + 4 files changed, 127 insertions(+), 1 deletion(-) + create mode 100644 drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile +@@ -54,3 +54,5 @@ brcmfmac-$(CPTCFG_BRCM_TRACING) += \ + tracepoint.o + brcmfmac-$(CONFIG_OF) += \ + of.o ++brcmfmac-$(CONFIG_DMI) += \ ++ dmi.o +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +@@ -448,8 +448,9 @@ struct brcmf_mp_device *brcmf_get_module + } + } + if (!found) { +- /* No platform data for this device, try OF (Open Firwmare) */ ++ /* No platform data for this device, try OF and DMI data */ + brcmf_of_probe(dev, bus_type, settings); ++ brcmf_dmi_probe(settings, chip, chiprev); + } + return settings; + } +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.h +@@ -75,4 +75,11 @@ void brcmf_release_module_param(struct b + /* Sets dongle media info (drv_version, mac address). */ + int brcmf_c_preinit_dcmds(struct brcmf_if *ifp); + ++#ifdef CONFIG_DMI ++void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev); ++#else ++static inline void ++brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) {} ++#endif ++ + #endif /* BRCMFMAC_COMMON_H */ +--- /dev/null ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/dmi.c +@@ -0,0 +1,116 @@ ++/* ++ * Copyright 2018 Hans de Goede ++ * ++ * 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 "core.h" ++#include "common.h" ++#include "brcm_hw_ids.h" ++ ++/* The DMI data never changes so we can use a static buf for this */ ++static char dmi_board_type[128]; ++ ++struct brcmf_dmi_data { ++ u32 chip; ++ u32 chiprev; ++ const char *board_type; ++}; ++ ++/* NOTE: Please keep all entries sorted alphabetically */ ++ ++static const struct brcmf_dmi_data gpd_win_pocket_data = { ++ BRCM_CC_4356_CHIP_ID, 2, "gpd-win-pocket" ++}; ++ ++static const struct brcmf_dmi_data jumper_ezpad_mini3_data = { ++ BRCM_CC_43430_CHIP_ID, 0, "jumper-ezpad-mini3" ++}; ++ ++static const struct brcmf_dmi_data meegopad_t08_data = { ++ BRCM_CC_43340_CHIP_ID, 2, "meegopad-t08" ++}; ++ ++static const struct dmi_system_id dmi_platform_data[] = { ++ { ++ /* Match for the GPDwin which unfortunately uses somewhat ++ * generic dmi strings, which is why we test for 4 strings. ++ * Comparing against 23 other byt/cht boards, board_vendor ++ * and board_name are unique to the GPDwin, where as only one ++ * other board has the same board_serial and 3 others have ++ * the same default product_name. Also the GPDwin is the ++ * only device to have both board_ and product_name not set. ++ */ ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"), ++ DMI_MATCH(DMI_BOARD_NAME, "Default string"), ++ DMI_MATCH(DMI_BOARD_SERIAL, "Default string"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ }, ++ .driver_data = (void *)&gpd_win_pocket_data, ++ }, ++ { ++ /* Jumper EZpad mini3 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Insyde"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "CherryTrail"), ++ /* jumperx.T87.KFBNEEA02 with the version-nr dropped */ ++ DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"), ++ }, ++ .driver_data = (void *)&jumper_ezpad_mini3_data, ++ }, ++ { ++ /* Meegopad T08 */ ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Default string"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "Default string"), ++ DMI_MATCH(DMI_BOARD_NAME, "T3 MRD"), ++ DMI_MATCH(DMI_BOARD_VERSION, "V1.1"), ++ }, ++ .driver_data = (void *)&meegopad_t08_data, ++ }, ++ {} ++}; ++ ++void brcmf_dmi_probe(struct brcmf_mp_device *settings, u32 chip, u32 chiprev) ++{ ++ const struct dmi_system_id *match; ++ const struct brcmf_dmi_data *data; ++ const char *sys_vendor; ++ const char *product_name; ++ ++ /* Some models have DMI strings which are too generic, e.g. ++ * "Default string", we use a quirk table for these. ++ */ ++ for (match = dmi_first_match(dmi_platform_data); ++ match; ++ match = dmi_first_match(match + 1)) { ++ data = match->driver_data; ++ ++ if (data->chip == chip && data->chiprev == chiprev) { ++ settings->board_type = data->board_type; ++ return; ++ } ++ } ++ ++ /* Not found in the quirk-table, use sys_vendor-product_name */ ++ sys_vendor = dmi_get_system_info(DMI_SYS_VENDOR); ++ product_name = dmi_get_system_info(DMI_PRODUCT_NAME); ++ if (sys_vendor && product_name) { ++ snprintf(dmi_board_type, sizeof(dmi_board_type), "%s-%s", ++ sys_vendor, product_name); ++ settings->board_type = dmi_board_type; ++ } ++} diff --git a/package/kernel/mac80211/patches/355-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch b/package/kernel/mac80211/patches/355-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch new file mode 100644 index 00000000000..211e9e4a9fc --- /dev/null +++ b/package/kernel/mac80211/patches/355-v5.0-0006-brcmfmac-Cleanup-brcmf_fw_request_done.patch @@ -0,0 +1,41 @@ +From 55e491edbf14b2da5419c2a319ea3b1d6368d9a2 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 10 Oct 2018 13:01:03 +0200 +Subject: [PATCH] brcmfmac: Cleanup brcmf_fw_request_done() + +The "cur" variable is now only used for a debug print and we already +print the same info from brcmf_fw_complete_request(), so the debug print +does not provide any extra info and we can remove it. + +Signed-off-by: Hans de Goede +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 8 +------- + 1 file changed, 1 insertion(+), 7 deletions(-) + +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +@@ -560,22 +560,16 @@ static int brcmf_fw_request_firmware(con + static void brcmf_fw_request_done(const struct firmware *fw, void *ctx) + { + struct brcmf_fw *fwctx = ctx; +- struct brcmf_fw_item *cur; +- int ret = 0; +- +- cur = &fwctx->req->items[fwctx->curpos]; ++ int ret; + + ret = brcmf_fw_complete_request(fw, fwctx); + + while (ret == 0 && ++fwctx->curpos < fwctx->req->n_items) { +- cur = &fwctx->req->items[fwctx->curpos]; + brcmf_fw_request_firmware(&fw, fwctx); + ret = brcmf_fw_complete_request(fw, ctx); + } + + if (ret) { +- brcmf_dbg(TRACE, "failed err=%d: dev=%s, fw=%s\n", ret, +- dev_name(fwctx->dev), cur->path); + brcmf_fw_free_request(fwctx->req); + fwctx->req = NULL; + } 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 index e70738322d2..2e710d3d62a 100644 --- 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 @@ -31,35 +31,37 @@ Signed-off-by: Rafał Miłecki }; static void brcmf_fw_request_done(const struct firmware *fw, void *ctx); -@@ -589,6 +590,8 @@ fail: - fwctx->req = NULL; - done: +@@ -574,6 +575,8 @@ static void brcmf_fw_request_done(const + fwctx->req = NULL; + } fwctx->done(fwctx->dev, ret, fwctx->req); + if (fwctx->completion) + complete(fwctx->completion); kfree(fwctx); } -@@ -612,6 +615,8 @@ int brcmf_fw_get_firmwares(struct device - struct brcmf_fw_request *req)) +@@ -598,6 +601,7 @@ int brcmf_fw_get_firmwares(struct device { + struct brcmf_fw_item *first = &req->items[0]; struct brcmf_fw *fwctx; + struct completion completion; -+ int err; + int ret; brcmf_dbg(TRACE, "enter: dev=%s\n", dev_name(dev)); - if (!fw_cb) -@@ -628,7 +633,14 @@ int brcmf_fw_get_firmwares(struct device +@@ -615,12 +619,17 @@ int brcmf_fw_get_firmwares(struct device fwctx->req = req; fwctx->done = fw_cb; + init_completion(&completion); + fwctx->completion = &completion; + - brcmf_fw_request_next_item(fwctx, true); -+ -+ wait_for_completion_timeout(fwctx->completion, msecs_to_jiffies(5000)); -+ fwctx->completion = NULL; + ret = request_firmware_nowait(THIS_MODULE, true, first->path, + fwctx->dev, GFP_KERNEL, fwctx, + brcmf_fw_request_done); + if (ret < 0) + brcmf_fw_request_done(NULL, fwctx); + ++ wait_for_completion_timeout(&completion, msecs_to_jiffies(5000)); + return 0; } diff --git a/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch index e7551c3a703..5bb70158108 100644 --- a/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch +++ b/package/kernel/mac80211/patches/863-brcmfmac-add-in-driver-tables-with-country-codes.patch @@ -49,9 +49,9 @@ Signed-off-by: Rafał Miłecki void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct brcmf_mp_device *settings) { -@@ -32,6 +62,8 @@ void brcmf_of_probe(struct device *dev, - u32 irqf; - u32 val; +@@ -41,6 +71,8 @@ void brcmf_of_probe(struct device *dev, + of_node_put(root); + } + brcmf_of_probe_cc(dev, settings); + From b9dcf2de5f3d42c4b5b1cbaf607e0265a518dc63 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 7 Jan 2019 11:09:26 +0100 Subject: [PATCH 338/399] kernel: bump 4.9 to 4.9.148 Refreshed all patches. Altered patches: - 902-debloat_proc.patch Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- ...cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch | 7 +------ target/linux/generic/hack-4.9/902-debloat_proc.patch | 5 +++-- target/linux/generic/pending-4.9/834-ledtrig-libata.patch | 8 ++++---- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 826e27c3fd0..af36f408e35 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .146 +LINUX_VERSION-4.9 = .148 LINUX_VERSION-4.14 = .89 -LINUX_KERNEL_HASH-4.9.146 = 58195a8be3085d117c83a2ed1caa3b46ea7c1614c75f951b9f13f7adb03f8e59 +LINUX_KERNEL_HASH-4.9.148 = 6067151b0225a8de1ab79abc9be7bae237eaca0cd838eb26684169560d88a994 LINUX_KERNEL_HASH-4.14.89 = ce6e16ac44dddd0d6a232bf2ce03e8bf8beca19f9b84503684466d140a1a0b25 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch b/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch index 458515a0b59..faeb3e41700 100644 --- a/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch +++ b/target/linux/generic/backport-4.9/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch @@ -61,11 +61,9 @@ CC: stable@vger.kernel.org # v4.0+ arch/arm/mach-cns3xxx/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c -index 318394ed5c7a..5e11ad3164e0 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c -@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, +@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus } else /* remote PCI bus */ base = cnspci->cfg1_regs + ((busno & 0xf) << 20); @@ -74,6 +72,3 @@ index 318394ed5c7a..5e11ad3164e0 100644 } static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, --- -2.17.1 - diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index 3095f832a27..f9a1e320986 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -221,13 +221,14 @@ Signed-off-by: Felix Fietkau if (!root_irq_dir) --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c -@@ -399,6 +399,8 @@ static int __init init_timer_list_procfs +@@ -399,6 +399,9 @@ static int __init init_timer_list_procfs { struct proc_dir_entry *pe; + if (IS_ENABLED(CONFIG_PROC_STRIPPED)) + return 0; - pe = proc_create("timer_list", 0444, NULL, &timer_list_fops); ++ + pe = proc_create("timer_list", 0400, NULL, &timer_list_fops); if (!pe) return -ENOMEM; --- a/mm/vmalloc.c diff --git a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch index b2c0b489807..4715182c6b3 100644 --- a/target/linux/generic/pending-4.9/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.9/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -4994,6 +5007,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -4995,6 +5008,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; -@@ -5895,6 +5911,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -5896,6 +5912,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -5916,6 +5935,12 @@ static void ata_host_release(struct devi +@@ -5917,6 +5936,12 @@ static void ata_host_release(struct devi kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6362,7 +6387,23 @@ int ata_host_register(struct ata_host *h +@@ -6363,7 +6388,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } From 367ccf7a2d4ff7bec492fd7802b00ac38cbcd707 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 7 Jan 2019 11:12:09 +0100 Subject: [PATCH 339/399] kernel: bump 4.14 to 4.14.91 Refreshed all patches. Altered patches: - 902-debloat_proc.patch Removed upstreamed: - 500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 4 +- .../cns3xxx/patches-4.14/060-pcie_abort.patch | 2 +- ...ption-fix-dwm-158-3g-modem-interface.patch | 2 +- ...writing-to-wrong-PCI-registers-after.patch | 7 +- ...linking-of-inodes-correctly-while-re.patch | 89 ------------------- .../generic/hack-4.14/902-debloat_proc.patch | 5 +- .../pending-4.14/834-ledtrig-libata.patch | 8 +- .../oxnas/patches-4.14/999-libata-hacks.patch | 4 +- 9 files changed, 16 insertions(+), 109 deletions(-) delete mode 100644 target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index af36f408e35..66d11fc0c5c 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .148 -LINUX_VERSION-4.14 = .89 +LINUX_VERSION-4.14 = .91 LINUX_KERNEL_HASH-4.9.148 = 6067151b0225a8de1ab79abc9be7bae237eaca0cd838eb26684169560d88a994 -LINUX_KERNEL_HASH-4.14.89 = ce6e16ac44dddd0d6a232bf2ce03e8bf8beca19f9b84503684466d140a1a0b25 +LINUX_KERNEL_HASH-4.14.91 = 6a587c8b4160918efa082b0c2eda8c2db0f50d8814ad1d1ac94be1edf66ca6a9 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index 71b90f2db21..ed14505e183 100644 --- a/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -50,5 +50,5 @@ produce a noisy warning. /* support xHCI 1.0 spec USB2 hardware LPM */ +#define XHCI_FORCE_MSI (1 << 24) unsigned hw_lpm_support:1; - /* cached usb2 extened protocol capabilites */ - u32 *ext_caps; + /* Broken Suspend flag for SNPS Suspend resume issue */ + unsigned broken_suspend:1; diff --git a/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch b/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch index 7a3a8e4c250..b5f0350571c 100644 --- a/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch +++ b/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch @@ -1,7 +1,7 @@ --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c @@ -86,6 +86,79 @@ static void __iomem *cns3xxx_pci_map_bus - return base + (where & 0xffc) + (devfn << 12); + return base + where + (devfn << 12); } +static inline int check_master_abort(struct pci_bus *bus, unsigned int devfn, int where) diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch index 4201ab17442..93ca8331e3b 100644 --- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch +++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch @@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c -@@ -1927,7 +1927,8 @@ static const struct usb_device_id option +@@ -1934,7 +1934,8 @@ static const struct usb_device_id option { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) }, /* D-Link DWM-156 (variant) */ { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) }, { USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) }, diff --git a/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch b/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch index 458515a0b59..faeb3e41700 100644 --- a/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch +++ b/target/linux/generic/backport-4.14/100-arm-cns3xxx-fix-writing-to-wrong-PCI-registers-after.patch @@ -61,11 +61,9 @@ CC: stable@vger.kernel.org # v4.0+ arch/arm/mach-cns3xxx/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c -index 318394ed5c7a..5e11ad3164e0 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c -@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, +@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus } else /* remote PCI bus */ base = cnspci->cfg1_regs + ((busno & 0xf) << 20); @@ -74,6 +72,3 @@ index 318394ed5c7a..5e11ad3164e0 100644 } static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, --- -2.17.1 - diff --git a/target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch b/target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch deleted file mode 100644 index 71e036c9208..00000000000 --- a/target/linux/generic/backport-4.14/500-ubifs-Handle-re-linking-of-inodes-correctly-while-re.patch +++ /dev/null @@ -1,89 +0,0 @@ -From: Richard Weinberger -Date: Wed, 7 Nov 2018 23:04:43 +0100 -Subject: [PATCH] ubifs: Handle re-linking of inodes correctly while recovery -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -UBIFS's recovery code strictly assumes that a deleted inode will never -come back, therefore it removes all data which belongs to that inode -as soon it faces an inode with link count 0 in the replay list. -Before O_TMPFILE this assumption was perfectly fine. With O_TMPFILE -it can lead to data loss upon a power-cut. - -Consider a journal with entries like: -0: inode X (nlink = 0) /* O_TMPFILE was created */ -1: data for inode X /* Someone writes to the temp file */ -2: inode X (nlink = 0) /* inode was changed, xattr, chmod, … */ -3: inode X (nlink = 1) /* inode was re-linked via linkat() */ - -Upon replay of entry #2 UBIFS will drop all data that belongs to inode X, -this will lead to an empty file after mounting. - -As solution for this problem, scan the replay list for a re-link entry -before dropping data. - -Fixes: 474b93704f32 ("ubifs: Implement O_TMPFILE") -Cc: stable@vger.kernel.org -Cc: Russell Senior -Cc: Rafał Miłecki -Reported-by: Russell Senior -Reported-by: Rafał Miłecki -Signed-off-by: Richard Weinberger ---- - fs/ubifs/replay.c | 37 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 37 insertions(+) - ---- a/fs/ubifs/replay.c -+++ b/fs/ubifs/replay.c -@@ -210,6 +210,38 @@ static int trun_remove_range(struct ubif - } - - /** -+ * inode_still_linked - check whether inode in question will be re-linked. -+ * @c: UBIFS file-system description object -+ * @rino: replay entry to test -+ * -+ * O_TMPFILE files can be re-linked, this means link count goes from 0 to 1. -+ * This case needs special care, otherwise all references to the inode will -+ * be removed upon the first replay entry of an inode with link count 0 -+ * is found. -+ */ -+static bool inode_still_linked(struct ubifs_info *c, struct replay_entry *rino) -+{ -+ struct replay_entry *r; -+ -+ ubifs_assert(rino->deletion); -+ ubifs_assert(key_type(c, &rino->key) == UBIFS_INO_KEY); -+ -+ /* -+ * Find the most recent entry for the inode behind @rino and check -+ * whether it is a deletion. -+ */ -+ list_for_each_entry_reverse(r, &c->replay_list, list) { -+ ubifs_assert(r->sqnum >= rino->sqnum); -+ if (key_inum(c, &r->key) == key_inum(c, &rino->key)) -+ return r->deletion == 0; -+ -+ } -+ -+ ubifs_assert(0); -+ return false; -+} -+ -+/** - * apply_replay_entry - apply a replay entry to the TNC. - * @c: UBIFS file-system description object - * @r: replay entry to apply -@@ -239,6 +271,11 @@ static int apply_replay_entry(struct ubi - { - ino_t inum = key_inum(c, &r->key); - -+ if (inode_still_linked(c, r)) { -+ err = 0; -+ break; -+ } -+ - err = ubifs_tnc_remove_ino(c, inum); - break; - } diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index cae6d66e7df..d9963361868 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -221,13 +221,14 @@ Signed-off-by: Felix Fietkau if (!root_irq_dir) --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c -@@ -389,6 +389,8 @@ static int __init init_timer_list_procfs +@@ -389,6 +389,9 @@ static int __init init_timer_list_procfs { struct proc_dir_entry *pe; + if (IS_ENABLED(CONFIG_PROC_STRIPPED)) + return 0; - pe = proc_create("timer_list", 0444, NULL, &timer_list_fops); ++ + pe = proc_create("timer_list", 0400, NULL, &timer_list_fops); if (!pe) return -ENOMEM; --- a/mm/vmalloc.c diff --git a/target/linux/generic/pending-4.14/834-ledtrig-libata.patch b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch index 2eec024b725..392d41c94f2 100644 --- a/target/linux/generic/pending-4.14/834-ledtrig-libata.patch +++ b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch @@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle /** * ata_build_rw_tf - Build ATA taskfile for given read/write request * @tf: Target ATA taskfile -@@ -5120,6 +5133,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5121,6 +5134,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (tag < 0) return NULL; } @@ -75,7 +75,7 @@ Signed-off-by: Daniel Golle qc = __ata_qc_from_tag(ap, tag); qc->tag = tag; -@@ -6021,6 +6037,9 @@ struct ata_port *ata_port_alloc(struct a +@@ -6022,6 +6038,9 @@ struct ata_port *ata_port_alloc(struct a ap->stats.unhandled_irq = 1; ap->stats.idle_irq = 1; #endif @@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle ata_sff_port_init(ap); return ap; -@@ -6042,6 +6061,12 @@ static void ata_host_release(struct devi +@@ -6043,6 +6062,12 @@ static void ata_host_release(struct devi kfree(ap->pmp_link); kfree(ap->slave_link); @@ -98,7 +98,7 @@ Signed-off-by: Daniel Golle kfree(ap); host->ports[i] = NULL; } -@@ -6488,7 +6513,23 @@ int ata_host_register(struct ata_host *h +@@ -6489,7 +6514,23 @@ int ata_host_register(struct ata_host *h host->ports[i]->print_id = atomic_inc_return(&ata_print_id); host->ports[i]->local_port_no = i + 1; } diff --git a/target/linux/oxnas/patches-4.14/999-libata-hacks.patch b/target/linux/oxnas/patches-4.14/999-libata-hacks.patch index e490dbf7c17..382a16329aa 100644 --- a/target/linux/oxnas/patches-4.14/999-libata-hacks.patch +++ b/target/linux/oxnas/patches-4.14/999-libata-hacks.patch @@ -15,7 +15,7 @@ /* initialize internal qc */ /* XXX: Tag 0 is used for drivers with legacy EH as some -@@ -5127,6 +5135,9 @@ struct ata_queued_cmd *ata_qc_new_init(s +@@ -5128,6 +5136,9 @@ struct ata_queued_cmd *ata_qc_new_init(s if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) return NULL; @@ -25,7 +25,7 @@ /* libsas case */ if (ap->flags & ATA_FLAG_SAS_HOST) { tag = ata_sas_allocate_tag(ap); -@@ -5172,6 +5183,8 @@ void ata_qc_free(struct ata_queued_cmd * +@@ -5173,6 +5184,8 @@ void ata_qc_free(struct ata_queued_cmd * qc->tag = ATA_TAG_POISON; if (ap->flags & ATA_FLAG_SAS_HOST) ata_sas_free_tag(tag, ap); From c3fef269d61fd9fc860dcfd812984276790fd712 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 7 Jan 2019 11:59:49 +0100 Subject: [PATCH 340/399] cns3xxx: use actual size reads for PCIe upstream commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") reimplemented cns3xxx_pci_read_config() using pci_generic_config_read32(), which preserved the property of only doing 32-bit reads. It also replaced cns3xxx_pci_write_config() with pci_generic_config_write(), so it changed writes from always being 32 bits to being the actual size, which works just fine. Due to: - The documentation does not mention that only 32 bit access is allowed. - Writes are already executed using the actual size - Extensive testing shows that 8b, 16b and 32b reads work as intended It makes perfectly sense to also swap 32 bit reading in favor of actual size. Signed-off-by: Koen Vandeputte --- ...s3xxx-use-actual-size-reads-for-PCIe.patch | 51 +++++++++++++++++++ ...s3xxx-use-actual-size-reads-for-PCIe.patch | 51 +++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch create mode 100644 target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch diff --git a/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch b/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch new file mode 100644 index 00000000000..44ca8337057 --- /dev/null +++ b/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch @@ -0,0 +1,51 @@ +From 4cc30de79d293f1e8c5f50ae3a9c005def9564a0 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Mon, 7 Jan 2019 14:14:27 +0100 +Subject: [PATCH 2/2] arm: cns3xxx: use actual size reads for PCIe + +commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +reimplemented cns3xxx_pci_read_config() using pci_generic_config_read32(), +which preserved the property of only doing 32-bit reads. + +It also replaced cns3xxx_pci_write_config() with pci_generic_config_write(), +so it changed writes from always being 32 bits to being the actual size, +which works just fine. + +Due to: +- The documentation does not mention that only 32 bit access is allowed. +- Writes are already executed using the actual size +- Extensive testing shows that 8b, 16b and 32b reads work as intended + +It makes perfectly sense to also swap 32 bit reading in favor of actual size. + +Fixes: 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +Suggested-by: Bjorn Helgaas +Signed-off-by: Koen Vandeputte +CC: Arnd Bergmann +CC: Krzysztof Halasa +CC: Olof Johansson +CC: Robin Leblon +CC: Rob Herring +CC: Russell King +CC: Tim Harvey +CC: stable@vger.kernel.org # v4.0+ +--- + arch/arm/mach-cns3xxx/pcie.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c +index 5e11ad3164e0..95a11d5b3587 100644 +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, + u32 mask = (0x1ull << (size * 8)) - 1; + int shift = (where % 4) * 8; + +- ret = pci_generic_config_read32(bus, devfn, where, size, val); ++ ret = pci_generic_config_read(bus, devfn, where, size, val); + + if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && + (where & 0xffc) == PCI_CLASS_REVISION) +-- +2.17.1 + diff --git a/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch b/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch new file mode 100644 index 00000000000..44ca8337057 --- /dev/null +++ b/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch @@ -0,0 +1,51 @@ +From 4cc30de79d293f1e8c5f50ae3a9c005def9564a0 Mon Sep 17 00:00:00 2001 +From: Koen Vandeputte +Date: Mon, 7 Jan 2019 14:14:27 +0100 +Subject: [PATCH 2/2] arm: cns3xxx: use actual size reads for PCIe + +commit 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +reimplemented cns3xxx_pci_read_config() using pci_generic_config_read32(), +which preserved the property of only doing 32-bit reads. + +It also replaced cns3xxx_pci_write_config() with pci_generic_config_write(), +so it changed writes from always being 32 bits to being the actual size, +which works just fine. + +Due to: +- The documentation does not mention that only 32 bit access is allowed. +- Writes are already executed using the actual size +- Extensive testing shows that 8b, 16b and 32b reads work as intended + +It makes perfectly sense to also swap 32 bit reading in favor of actual size. + +Fixes: 802b7c06adc7 ("ARM: cns3xxx: Convert PCI to use generic config accessors") +Suggested-by: Bjorn Helgaas +Signed-off-by: Koen Vandeputte +CC: Arnd Bergmann +CC: Krzysztof Halasa +CC: Olof Johansson +CC: Robin Leblon +CC: Rob Herring +CC: Russell King +CC: Tim Harvey +CC: stable@vger.kernel.org # v4.0+ +--- + arch/arm/mach-cns3xxx/pcie.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c +index 5e11ad3164e0..95a11d5b3587 100644 +--- a/arch/arm/mach-cns3xxx/pcie.c ++++ b/arch/arm/mach-cns3xxx/pcie.c +@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, + u32 mask = (0x1ull << (size * 8)) - 1; + int shift = (where % 4) * 8; + +- ret = pci_generic_config_read32(bus, devfn, where, size, val); ++ ret = pci_generic_config_read(bus, devfn, where, size, val); + + if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && + (where & 0xffc) == PCI_CLASS_REVISION) +-- +2.17.1 + From 4c0e15fc16a9eaf57abeb8f65c30b63eab340f5c Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Wed, 21 Nov 2018 05:03:12 -0800 Subject: [PATCH 341/399] base-files: install missing /etc/iproute2/ematch_map This file is needed to properly use the tc ematch modules present in kmod-sched-core and kmod-sched. It is a read-only index file of ematch methods used only by tc. Signed-off-by: Tony Ambardar [cherry picked from commit 10a2ccb7fceef3a6dea4ece14e6141a807292d5f] --- package/base-files/files/etc/iproute2/ematch_map | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 package/base-files/files/etc/iproute2/ematch_map diff --git a/package/base-files/files/etc/iproute2/ematch_map b/package/base-files/files/etc/iproute2/ematch_map new file mode 100644 index 00000000000..4d6bb2f0397 --- /dev/null +++ b/package/base-files/files/etc/iproute2/ematch_map @@ -0,0 +1,8 @@ +# lookup table for ematch kinds +1 cmp +2 nbyte +3 u32 +4 meta +7 canid +8 ipset +9 ipt From e0daa62af69eb3eba9750eccec8d790388878ba8 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 18 Sep 2018 18:32:20 -0700 Subject: [PATCH 342/399] fstools: Install mount.hotplug and 10-fstab.defaults as 600 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both of these are used by programs that run as root and nothing else. Signed-off-by: Rosen Penev [rmilecki: dropped PKG_SOURCE_URL regression from the original patch] Signed-off-by: Rafał Miłecki (cherry picked from commit 4ad87744fa83e2f75fd4f6e9a46f106aaf7ee2dc) --- package/system/fstools/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 440f1873947..1b5bea47f06 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fstools -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git @@ -108,8 +108,8 @@ define Package/block-mount/install $(INSTALL_DIR) $(1)/sbin $(1)/lib $(1)/usr/sbin $(1)/etc/hotplug.d/block $(1)/etc/init.d/ $(1)/etc/uci-defaults/ $(INSTALL_BIN) ./files/fstab.init $(1)/etc/init.d/fstab - $(INSTALL_DATA) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab - $(INSTALL_DATA) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount + $(INSTALL_CONF) ./files/fstab.default $(1)/etc/uci-defaults/10-fstab + $(INSTALL_CONF) ./files/mount.hotplug $(1)/etc/hotplug.d/block/10-mount $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/block $(1)/sbin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libblkid-tiny.so $(1)/lib/ From d7275c03123fbbc318f47c37b08ad7433c639ebf Mon Sep 17 00:00:00 2001 From: Rosy Song Date: Sun, 23 Sep 2018 09:57:29 +0800 Subject: [PATCH 343/399] fstools: filter unknown action in mount.hotplug script Signed-off-by: Rosy Song (cherry picked from commit 0fa1dd71ccf5456e1a55dd492e9a42d9b71185ba) --- package/system/fstools/Makefile | 2 +- package/system/fstools/files/mount.hotplug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 1b5bea47f06..cc02033706b 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fstools -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git diff --git a/package/system/fstools/files/mount.hotplug b/package/system/fstools/files/mount.hotplug index 946924e351c..550e57c7139 100644 --- a/package/system/fstools/files/mount.hotplug +++ b/package/system/fstools/files/mount.hotplug @@ -1 +1 @@ -/sbin/block hotplug +[ "$ACTION" = "add" -o "$ACTION" = "remove" ] && /sbin/block hotplug From 3b4e779e93dea90f910e7974769c5208e4c0a0ad Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sun, 21 Oct 2018 20:43:46 +0200 Subject: [PATCH 344/399] fstools: update to git HEAD 29e53af fstools: add ntfs support Signed-off-by: Hans Dedecker (cherry picked from commit 59db98d0f216b2de1472bcde0d87ae871625052c) --- package/system/fstools/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index cc02033706b..3f8fbd99f4b 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2018-05-23 -PKG_SOURCE_VERSION:=dd02dad332958575cc52e60c78ef10ef2b5aaced -PKG_MIRROR_HASH:=31051da29a0fff0b60ab3fc7fe27be281ed298346ff0ac65e3a2976671d2deed +PKG_SOURCE_DATE:=2018-09-29 +PKG_SOURCE_VERSION:=29e53af0b91954ca6a13bdd1f0e67c939ccb8e6d +PKG_MIRROR_HASH:=e90c60362dc3f304c9748b57a3e602f37fd758bf8134fbc3fbbda4300d4f46c7 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 069fda746e3c407a2f61ee9368f264700bea20cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Date: Wed, 2 Jan 2019 07:13:19 +0100 Subject: [PATCH 345/399] fstools: update to the latest master branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a big block(d) cleanup with new feature of generating "mount" hotplug.d events. It's an important update for those who were using mountd in the pre-18.06 releases. Due to the mountd being replaced with blockd a support for "mountd" hotplug.d events has been lost. It broke all kind of shell scripts that were e.g. managing services depending on an external USB drive availability. This basically (re-)adds support for calling /etc/hotplug.d/mount/ scripts with ACTION ("add" or "remove") and DEVICE set. af93f4b block(d): improve hotplug.d "mount" events for the autofs 3bb3352 blockd: unmount device explicitly when it disappears 28753b3 block: remove target directory after unmounting c8c7ca5 block: cleanup handling "start" action of the "autofs" command f1bb762 block: make blockd_notify() return an int instead of void 71c2bde block: generate hotplug.d mount events 30f5096 block: validate amount of arguments for the "autofs" command dc6a462 blockd: don't reparse blob msg in the vlist callbacks f6a9686 blockd: don't unmount device when removing it from the list 1913fea block: don't duplicate unmounting code in the mount_action() 6b445fa block: make umount_device() function more generic a778468 block: don't duplicate mounting code in the mount_device() 5dc631d block: simplify code picking mount target directory 2971779 block: move blockd_notify() call out of the conditional blocks b86bd6e block: fix formatting & indent in the mount_device() e12c0d6 fstools: use EXIT_FAILURE when indicating error on exit 091aa3d fstools: guard usage of WEXITSTATUS Signed-off-by: Rafał Miłecki (cherry picked from commit 5c4277ec376541b10f1acbea734aa29900eb5722) --- package/system/fstools/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 3f8fbd99f4b..58be215f8f8 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2018-09-29 -PKG_SOURCE_VERSION:=29e53af0b91954ca6a13bdd1f0e67c939ccb8e6d -PKG_MIRROR_HASH:=e90c60362dc3f304c9748b57a3e602f37fd758bf8134fbc3fbbda4300d4f46c7 +PKG_SOURCE_DATE:=2018-12-28 +PKG_SOURCE_VERSION:=af93f4b8dc32cf1320dfe8f4b93bb3a12606fc33 +PKG_MIRROR_HASH:=a2d8c2500fe75014ef16c039d8cdb276c1d5c066f8bce6550a3ecf46a9a411a9 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 0d6eaa0ba53d77ecbcd08c4c838377c260c6cd87 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 12 Jan 2019 19:39:01 +0100 Subject: [PATCH 346/399] octeon: fix typo in platform.sh Fix upgrade typo Signed-off-by: Hans Dedecker --- target/linux/octeon/base-files/lib/upgrade/platform.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/octeon/base-files/lib/upgrade/platform.sh b/target/linux/octeon/base-files/lib/upgrade/platform.sh index cd49c0da36e..fdfd6759bc3 100755 --- a/target/linux/octeon/base-files/lib/upgrade/platform.sh +++ b/target/linux/octeon/base-files/lib/upgrade/platform.sh @@ -88,7 +88,7 @@ platform_check_image() { local kernel_length=`(tar xf $tar_file sysupgrade-$board/kernel -O | wc -c) 2> /dev/null` local rootfs_length=`(tar xf $tar_file sysupgrade-$board/root -O | wc -c) 2> /dev/null` [ "$kernel_length" = 0 -o "$rootfs_length" = 0 ] && { - echo "The upgarde image is corrupt." + echo "The upgrade image is corrupt." return 1 } return 0 From 0cef35f09645387b4b7980124e21c6e6672f85a7 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 12 Jan 2019 19:42:56 +0100 Subject: [PATCH 347/399] tools/firmware-utils: fix sysupgrade typo in mkdapimg Signed-off-by: Hans Dedecker --- tools/firmware-utils/src/mkdapimg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/firmware-utils/src/mkdapimg.c b/tools/firmware-utils/src/mkdapimg.c index ed662d8ecc0..640f42d7c6c 100644 --- a/tools/firmware-utils/src/mkdapimg.c +++ b/tools/firmware-utils/src/mkdapimg.c @@ -12,7 +12,7 @@ // Usage: mkdapimg [-p] [-m ] -s -i -o // -// e.g.: mkdapimg -s RT3052-AP-DAP1350-3 -i sysupgarde.bin -o factory.bin +// e.g.: mkdapimg -s RT3052-AP-DAP1350-3 -i sysupgrade.bin -o factory.bin // // If the model string is not given, we will assume that // the leading characters upto the first "-" is the model. From d58c6aedb6c8e53c0c9d29f646462787f3c6d584 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Sat, 12 Jan 2019 19:47:02 +0100 Subject: [PATCH 348/399] tools/firmware-utils: fix sysupgrade typo in mkdapimg2 Signed-off-by: Hans Dedecker --- tools/firmware-utils/src/mkdapimg2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/firmware-utils/src/mkdapimg2.c b/tools/firmware-utils/src/mkdapimg2.c index aef003c280c..6b53c959b6b 100644 --- a/tools/firmware-utils/src/mkdapimg2.c +++ b/tools/firmware-utils/src/mkdapimg2.c @@ -48,7 +48,7 @@ // 0x000000120000-0x000000040000 = 0xE0000 -> 917504 // // e.g.: mkdapimg2 -s HONEYBEE-FIRMWARE-DAP-1330 -v 1.00.21 -r Default -// -k 917504 -i sysupgarde.bin -o factory.bin +// -k 917504 -i sysupgrade.bin -o factory.bin // // // The img_hdr_struct was taken from the D-Link SDK: From f34ad1a8f0d1ee4a3e4b966d58c8f3b8a523a417 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 14 Jan 2019 15:16:04 +0100 Subject: [PATCH 349/399] mt76: update to the latest version 6745830 mt76: fix race condition in station removal 7e5c819 mt76: add mt76_sta_remove helper 75aa36e mt7603: use wcid/wcid_mask from struct mt76_dev fd85ff9 mt7603: use mt76_sta_remove helper 0848d2d mt7603: simplify mt7603_mcu_msg_send, remove skb_ret handling 83a80ca mt76: request tx status for powersave released EOSP packet df5c797 mt76: fix uninitialized mutex access setting rts threshold 0bfa98e mt76: introduce mt76x02_config_mac_addr_list routine 4248446 mt76x0: pci: enable VHT rates in IBSS mode f75efd8 mt76x2u: phy: add TX_SHAPING calibration c1d67b4 mt76x2u: phy: run phy_channel_calibrate after channel switch 9fe0fe8 mt76x2u: main: use mt76x02_bss_info_changed utility routine 3fc95d7 mt76x2u: init: remove mt76x2u_init_beacon_offsets routine 88f6883 mt76: remove wait argument from mt76x02_mcu_calibrate 009ab91 mt76: clean up more unused EXPORT_SYMBOLs 963768d mt76x02: fix regression in tx station race condition fix d7788cc mt76: mt76x02: make group_wcid the first member in struct mt76x02_vif e65ad4c mt7603: make group_wcid the first member in struct mt7603_vif 7b1373e mt76: mt76x02: remove mt76x02_txq_init a97127b mt76: replace sta_add/remove ops with common sta_state function 13f1e82 mt7603: clear wtbl entry for removed stations 90e2c1b mt7603: add mt7603_wtbl_set_skip_tx, change mt7603_wtbl_set_ps users 41931e4 mt7603: toggle skip_tx on station add/remove d0fdf01 mt7603: avoid unnecessary wtbl writes for ps-filter 96b3b3d mt76x2u: main: fix typo setting sta_state mac80211 callback 471d397 mt7603: fix priority for buffered multicast packets 3873e82 mt7603: fix MT_BMAP_0/MT_GROUP_THD_0 register initializion for mt7628 749d5c3 mt7603: fix reserved page handling for mt7628 d22799b mt7603: reduce reserved pages for beacons 42c5281 mt7603: fix maximum frame size in scheduler init fa7335b mt76: fix potential NULL pointer dereference in mt76_stop_tx_queues 84aa12a mt76: fix potential null pointer deref in mt76_sta_add 7c4c33c mt7603: skip efuse tx power data for mt7628 ca2c875 mt7603: add support for accessing remapped registers via ops b44d793 mt7603: clear PSE redirections before MCU init 82363ab mt7603: move tx status to rx queue 0 c09e8a4 mt7603: fix buffering of tx packets for powersave clients 4734108 mt7603: use mt7603_wtbl_clear on station removal 9428e34 mt7603: fix watchdog reset sequence b3f82a3 mt7603: report PSE reset failures via debugfs a301dec mt7603: add back PSE client reset code 94cebfc mt7603: fix handling lost interrupt events during watchdog reset b38fe7d mt7603: only issue PSE reset on PSE stuck da666a7 mt7603: issue PSE reset if firmware debug register indicates stuck queues 5fb60a7 mt7603: fix aggregation size handling 31cd20e mt7603: issue PSE reset on stuck beacon 4063ae1 mt7603: check for PSE hang / stuck beacon first 00e03b9 mt7603: fix MT_WF_PHY_CR_RXTD_BASE definition c3efb5d mt7603: add support for detecting MT7688 and single stream devices 2a136cb mt7603: fix TKIP key setup cd456ca mt7603: disable broken support for WEP hardware encryption 3ecb7f8 mt7603: fix hardware queue assignment 6ac9653 mt7603: fix CAB queue limits d22feb0 mt7603: move cab queue enabling to pre-tbtt tasklet 44bb372 mt7603: fix CAB queue flush mask 5a5b396 mt76: throttle transmission of buffered multicast packets 8084323 mt7603: implement code for adjusting energy detect CCA thresholds 8929a6e mt7603: increase MCU timeout f2ba65f mt7603: update firmware to 20161027164355 0ad998b mt7603: increase aggregation limits (based on vendor driver changes) da00af0 mt7603: clear bit 18 in MT_SEC_SCR to fix ICV error 417ab77 mt7603: improve recovery from PSE reset failure fea7ad8 mt76: move mt76x02_phy_get_min_avg_rssi to mt76 core 9d009be mt7603: add dynamic sensitivity tuning based on false CCA events 2c8e9ac mt7603: initialize channel maximum power from eeprom data b2cc29b mt76: move mt76x02_get_txpower to mt76 core 6203d46 mt7603: add support for setting transmit power 294e095 mt7603: reset DMA scheduler on MT7628 8178f0d mt7603: apply efuse data only when it exists e67e551 mt76: dma: remove napi from mt76_dma_rx_fill signature 0490bd2 mt76: usb: do not build the skb if reported len does not fit in buf_size eb076ae mt76: Add missing include of linux/module.h 1d2819e mt76: fix typo in mt76x02_check_mac_err routine 9c9fae3 mt76: mac: run mt76x02_mac_work routine atomically 6be90b6 mt76: usb: avoid queue/status spinlocks while passing tx status to mac80211 40dad32 mt76x0: pci: fix ACS support d94e9c4 mt76x02: do not set protection on set_rts_threshold callback 0d83d73 mt76x02: fixup MT_PROT_RATE_* defines 628f8d7 mt76x02: set protection according to ht operation element f7d8c17 mt76x0: configure MT_VHT_HT_FBK_CFG1 10f57cf mt76x2: add static qualifier to mt76x2_init_hardware 37b2ad3 mt76: dfs: run mt76x02_dfs_set_domain atomically 51b6daf mt76x2: init: set default value for MT_TX_LINK_CFG 9661da4 mt76: add energy detect CCA support to mt76x{0,2}e drivers 876d0e9 mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val c78e317 mt76: dma: do not build skb if reported len does not fit in buf_size 3598046 mt76: mmio: introduce mt76x02_check_tx_hang watchdog 58988a3 mt76: fix signedness of rx status signal field bce700d mt7603: fix signal strength reporting on single-stream devices 148219d mt7603: fix checkpatch issues 2a092e2 mt7603: fix per-rate retry accounting 962152b mt7603: fix WMM TXOP limit configuration 24ec040 mt7603: fix BSSID configuration in AP mode 48fb011 mt7603: fix CF-End transmit rate when 11b stations are connected 9daa5ff mt76: make const array 'data' static, shrinks object size 7d4a95c mt76: dma: avoid indirect call in mt76_dma_tx_queue_skb f84b008 mt76: fix tx status reporting for non-probing frames 8167074 Revert "mt7603: update firmware to 20161027164355" 2ad54b2 mt76: move wcid rssi ewma init to mt76 core d77c861 mt76: fix rssi ewma tracking eca96cd mt76: use proper name for __MT76x02_H macro d1bc504 mt76: fix building without CONFIG_LEDS_CLASS a946b78 mt76: add led support to mt76x0e driver Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 47134599726..4399c53cf26 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -1,16 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mt76 -PKG_RELEASE=2 +PKG_RELEASE=1 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-11-09 -PKG_SOURCE_VERSION:=ffccb48c5082b2c6f43a0235b77b62ca388810f0 -PKG_MIRROR_HASH:=bff0063db1a1b1353f59aad16abad4dd93ceeb4c672811ad864cebe0e39c7d8d +PKG_SOURCE_DATE:=2019-01-10 +PKG_SOURCE_VERSION:=a946b78acfda091cd6730a54fa9dfc87f125b17d +PKG_MIRROR_HASH:=a077d6160459b9251ce2362c2c429a3958b591f9e25d3a980bb0c78f77e04db0 PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 @@ -80,7 +80,7 @@ endef define KernelPackage/mt76x0-common $(KernelPackage/mt76-default) TITLE:=MediaTek MT76x0 wireless driver common code - DEPENDS+=+kmod-mt76x02-common +kmod-mt76x02-usb + DEPENDS+=+kmod-mt76x02-common HIDDEN:=1 FILES:=$(PKG_BUILD_DIR)/mt76x0/mt76x0-common.ko endef From cae263227ffdec1bd0d005b7752f25b6ebc6f8fa Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 15 Jan 2019 11:57:34 +0100 Subject: [PATCH 350/399] kernel: bump 4.9 to 4.9.150 Refreshed all patches. Remove upstreamed: - 510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch Altered patches: - 024-7-net-reorganize-struct-sock-for-better-data-locality.patch Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...5-Support-pin-groups-other-than-7-11.patch | 4 +- ...i-bcm2835-Disable-forced-software-CS.patch | 4 +- ...-0017-spi-bcm2835-Remove-unused-code.patch | 4 +- ...struct-sock-for-better-data-locality.patch | 13 ++--- ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 4 +- ...90-net-generalize-napi_complete_done.patch | 4 +- ...issing-tunnel-encapsulation-limit-op.patch | 4 +- ...s3xxx-use-actual-size-reads-for-PCIe.patch | 7 +-- .../702-phy_add_aneg_done_function.patch | 2 +- .../generic/hack-4.9/902-debloat_proc.patch | 2 +- ...ort-limiting-4K-sectors-support-base.patch | 2 +- ...eck_raw_super-on-big-endian-machines.patch | 51 ------------------- .../pending-4.9/630-packet_socket_type.patch | 6 +-- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 24 ++++----- ...ng-with-source-address-failed-policy.patch | 4 +- ...detach-callback-to-struct-phy_driver.patch | 2 +- .../703-phy-support-layerscape.patch | 6 +-- 18 files changed, 46 insertions(+), 101 deletions(-) delete mode 100644 target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 66d11fc0c5c..c8f05dbdba4 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .148 +LINUX_VERSION-4.9 = .150 LINUX_VERSION-4.14 = .91 -LINUX_KERNEL_HASH-4.9.148 = 6067151b0225a8de1ab79abc9be7bae237eaca0cd838eb26684169560d88a994 +LINUX_KERNEL_HASH-4.9.150 = 94cc177ba2b433e4e30fefef38de33248ba1e2499ebda905096a8822097117e4 LINUX_KERNEL_HASH-4.14.91 = 6a587c8b4160918efa082b0c2eda8c2db0f50d8814ad1d1ac94be1edf66ca6a9 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/brcm2708/patches-4.9/950-0015-spi-bcm2835-Support-pin-groups-other-than-7-11.patch b/target/linux/brcm2708/patches-4.9/950-0015-spi-bcm2835-Support-pin-groups-other-than-7-11.patch index 62145a2f07d..c4cda8090ac 100644 --- a/target/linux/brcm2708/patches-4.9/950-0015-spi-bcm2835-Support-pin-groups-other-than-7-11.patch +++ b/target/linux/brcm2708/patches-4.9/950-0015-spi-bcm2835-Support-pin-groups-other-than-7-11.patch @@ -19,7 +19,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c -@@ -688,6 +688,8 @@ static int bcm2835_spi_setup(struct spi_ +@@ -686,6 +686,8 @@ static int bcm2835_spi_setup(struct spi_ { int err; struct gpio_chip *chip; @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell /* * sanity checking the native-chipselects */ -@@ -704,15 +706,42 @@ static int bcm2835_spi_setup(struct spi_ +@@ -702,15 +704,42 @@ static int bcm2835_spi_setup(struct spi_ "setup: only two native chip-selects are supported\n"); return -EINVAL; } diff --git a/target/linux/brcm2708/patches-4.9/950-0016-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/brcm2708/patches-4.9/950-0016-spi-bcm2835-Disable-forced-software-CS.patch index 5d4062c4e49..2abef97adbb 100644 --- a/target/linux/brcm2708/patches-4.9/950-0016-spi-bcm2835-Disable-forced-software-CS.patch +++ b/target/linux/brcm2708/patches-4.9/950-0016-spi-bcm2835-Disable-forced-software-CS.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c -@@ -707,6 +707,7 @@ static int bcm2835_spi_setup(struct spi_ +@@ -705,6 +705,7 @@ static int bcm2835_spi_setup(struct spi_ return -EINVAL; } @@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell /* now translate native cs to GPIO */ /* first look for chip select pins in the devices pin groups */ for (pingroup_index = 0; -@@ -756,6 +757,7 @@ static int bcm2835_spi_setup(struct spi_ +@@ -754,6 +755,7 @@ static int bcm2835_spi_setup(struct spi_ spi->chip_select, spi->cs_gpio, err); return err; } diff --git a/target/linux/brcm2708/patches-4.9/950-0017-spi-bcm2835-Remove-unused-code.patch b/target/linux/brcm2708/patches-4.9/950-0017-spi-bcm2835-Remove-unused-code.patch index 08577fce2af..ef6bb529940 100644 --- a/target/linux/brcm2708/patches-4.9/950-0017-spi-bcm2835-Remove-unused-code.patch +++ b/target/linux/brcm2708/patches-4.9/950-0017-spi-bcm2835-Remove-unused-code.patch @@ -9,7 +9,7 @@ Subject: [PATCH] spi-bcm2835: Remove unused code --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c -@@ -679,17 +679,8 @@ static void bcm2835_spi_set_cs(struct sp +@@ -677,17 +677,8 @@ static void bcm2835_spi_set_cs(struct sp bcm2835_wr(bs, BCM2835_SPI_CS, cs); } @@ -27,7 +27,7 @@ Subject: [PATCH] spi-bcm2835: Remove unused code /* * sanity checking the native-chipselects */ -@@ -707,58 +698,6 @@ static int bcm2835_spi_setup(struct spi_ +@@ -705,58 +696,6 @@ static int bcm2835_spi_setup(struct spi_ return -EINVAL; } diff --git a/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch b/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch index e8c1915e188..a43b4037fea 100644 --- a/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch +++ b/target/linux/generic/backport-4.9/024-7-net-reorganize-struct-sock-for-better-data-locality.patch @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller --- a/include/net/sock.h +++ b/include/net/sock.h -@@ -343,6 +343,9 @@ struct sock { +@@ -344,6 +344,9 @@ struct sock { #define sk_rxhash __sk_common.skc_rxhash socket_lock_t sk_lock; @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller struct sk_buff_head sk_receive_queue; /* * The backlog queue is special, it is always used with -@@ -359,14 +362,13 @@ struct sock { +@@ -360,14 +363,13 @@ struct sock { struct sk_buff *tail; } sk_backlog; #define sk_rmem_alloc sk_backlog.rmem_alloc @@ -80,7 +80,7 @@ Signed-off-by: David S. Miller int sk_rcvbuf; struct sk_filter __rcu *sk_filter; -@@ -379,11 +381,30 @@ struct sock { +@@ -380,11 +382,30 @@ struct sock { #endif struct dst_entry *sk_rx_dst; struct dst_entry __rcu *sk_dst_cache; @@ -113,7 +113,7 @@ Signed-off-by: David S. Miller /* * Because of non atomicity rules, all -@@ -399,41 +420,23 @@ struct sock { +@@ -400,31 +421,17 @@ struct sock { #define SK_PROTOCOL_MAX U8_MAX kmemcheck_bitfield_end(flags); @@ -143,8 +143,9 @@ Signed-off-by: David S. Miller - long sk_sndtimeo; - struct timer_list sk_timer; ktime_t sk_stamp; - u16 sk_tsflags; - u8 sk_shutdown; + #if BITS_PER_LONG==32 + seqlock_t sk_stamp_seq; +@@ -434,10 +441,6 @@ struct sock { u32 sk_tskey; struct socket *sk_socket; void *sk_user_data; diff --git a/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch index be3140bb9cc..bedb4b37299 100644 --- a/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch +++ b/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -44,7 +44,7 @@ Cc: Kir Kolyshkin * @sk_lingertime: %SO_LINGER l_linger setting * @sk_backlog: always used with the per-socket spinlock held * @sk_callback_lock: used with the callbacks in the end of this struct -@@ -421,6 +422,8 @@ struct sock { +@@ -422,6 +423,8 @@ struct sock { kmemcheck_bitfield_end(flags); u16 sk_gso_max_segs; @@ -55,7 +55,7 @@ Cc: Kir Kolyshkin rwlock_t sk_callback_lock; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2475,6 +2475,7 @@ void sock_init_data(struct socket *sock, +@@ -2478,6 +2478,7 @@ void sock_init_data(struct socket *sock, sk->sk_max_pacing_rate = ~0U; sk->sk_pacing_rate = ~0U; diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index e54545f9d8b..c05ba5d1586 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -269,7 +269,7 @@ Signed-off-by: David S. Miller "NAPI Complete, did %d packets with budget %d\n", --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -@@ -658,7 +658,7 @@ static int xgene_enet_napi(struct napi_s +@@ -655,7 +655,7 @@ static int xgene_enet_napi(struct napi_s processed = xgene_enet_process_ring(ring, budget); if (processed != budget) { @@ -701,7 +701,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c -@@ -1320,7 +1320,7 @@ restart_poll: +@@ -1324,7 +1324,7 @@ restart_poll: ibmveth_replenish_task(adapter); if (frames_processed < budget) { diff --git a/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch b/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch index 136fdf48d30..7c3c5608c53 100644 --- a/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch +++ b/target/linux/generic/backport-4.9/094-v4.12-0001-ip6_tunnel-Fix-missing-tunnel-encapsulation-limit-op.patch @@ -30,7 +30,7 @@ Signed-off-by: David S. Miller --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c -@@ -957,7 +957,7 @@ static void init_tel_txopt(struct ipv6_t +@@ -958,7 +958,7 @@ static void init_tel_txopt(struct ipv6_t opt->dst_opt[5] = IPV6_TLV_PADN; opt->dst_opt[6] = 1; @@ -39,7 +39,7 @@ Signed-off-by: David S. Miller opt->ops.opt_nflen = 8; } -@@ -1199,7 +1199,7 @@ route_lookup: +@@ -1200,7 +1200,7 @@ route_lookup: if (encap_limit >= 0) { init_tel_txopt(&opt, encap_limit); diff --git a/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch b/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch index 44ca8337057..2b3384391a7 100644 --- a/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch +++ b/target/linux/generic/backport-4.9/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch @@ -33,11 +33,9 @@ CC: stable@vger.kernel.org # v4.0+ arch/arm/mach-cns3xxx/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c -index 5e11ad3164e0..95a11d5b3587 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c -@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, +@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struc u32 mask = (0x1ull << (size * 8)) - 1; int shift = (where % 4) * 8; @@ -46,6 +44,3 @@ index 5e11ad3164e0..95a11d5b3587 100644 if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && (where & 0xffc) == PCI_CLASS_REVISION) --- -2.17.1 - diff --git a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch index 8a2b51a4f7a..1862375be2f 100644 --- a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1312,6 +1312,9 @@ int genphy_update_link(struct phy_device +@@ -1309,6 +1309,9 @@ int genphy_update_link(struct phy_device { int status; diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index f9a1e320986..9cdb3fb95e0 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -328,7 +328,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3084,6 +3084,8 @@ static __net_initdata struct pernet_oper +@@ -3087,6 +3087,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch index aaaf7ed793f..f4ccc5fc443 100644 --- a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch +++ b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau + config SPI_ATMEL_QUADSPI tristate "Atmel Quad SPI Controller" - depends on ARCH_AT91 || (ARM && COMPILE_TEST) + depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110) --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1648,10 +1648,12 @@ int spi_nor_scan(struct spi_nor *nor, co diff --git a/target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch b/target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch deleted file mode 100644 index 5844af52332..00000000000 --- a/target/linux/generic/pending-4.9/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Martin Blumenstingl -To: linux-f2fs-devel@lists.sourceforge.net, yuchao0@huawei.com, - jaegeuk@kernel.org -Subject: [PATCH v2 1/1] f2fs: fix validation of the block count in - sanity_check_raw_super -Date: Sat, 22 Dec 2018 11:22:26 +0100 -Message-Id: <20181222102226.10050-2-martin.blumenstingl@googlemail.com> - -Treat "block_count" from struct f2fs_super_block as 64-bit little endian -value in sanity_check_raw_super() because struct f2fs_super_block -declares "block_count" as "__le64". - -This fixes a bug where the superblock validation fails on big endian -devices with the following error: - F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) - F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock - F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) - F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock -As result of this the partition cannot be mounted. - -With this patch applied the superblock validation works fine and the -partition can be mounted again: - F2FS-fs (sda1): Mounted with checkpoint version = 7c84 - -My little endian x86-64 hardware was able to mount the partition without -this fix. -To confirm that mounting f2fs filesystems works on big endian machines -again I tested this on a 32-bit MIPS big endian (lantiq) device. - -Fixes: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows") -Cc: stable@vger.kernel.org -Signed-off-by: Martin Blumenstingl -Reviewed-by: Chao Yu ---- - ---- a/fs/f2fs/super.c -+++ b/fs/f2fs/super.c -@@ -1427,10 +1427,10 @@ static int sanity_check_raw_super(struct - return 1; - } - -- if (segment_count > (le32_to_cpu(raw_super->block_count) >> 9)) { -+ if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) { - f2fs_msg(sb, KERN_INFO, -- "Wrong segment_count / block_count (%u > %u)", -- segment_count, le32_to_cpu(raw_super->block_count)); -+ "Wrong segment_count / block_count (%u > %llu)", -+ segment_count, le64_to_cpu(raw_super->block_count)); - return 1; - } - diff --git a/target/linux/generic/pending-4.9/630-packet_socket_type.patch b/target/linux/generic/pending-4.9/630-packet_socket_type.patch index 0bf9339d112..13a544736d1 100644 --- a/target/linux/generic/pending-4.9/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.9/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3262,6 +3264,7 @@ static int packet_create(struct net *net +@@ -3266,6 +3268,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3875,6 +3878,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3879,6 +3882,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3927,6 +3940,13 @@ static int packet_getsockopt(struct sock +@@ -3931,6 +3944,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 35ffce38ed3..af9a5b19149 100644 --- a/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.9/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -292,7 +292,7 @@ Signed-off-by: Steven Barth __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); -@@ -961,6 +1100,7 @@ static void init_tel_txopt(struct ipv6_t +@@ -962,6 +1101,7 @@ static void init_tel_txopt(struct ipv6_t opt->ops.opt_nflen = 8; } @@ -300,7 +300,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own * @t: the outgoing tunnel device -@@ -1299,6 +1439,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1300,6 +1440,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str { struct ip6_tnl *t = netdev_priv(dev); struct ipv6hdr *ipv6h; @@ -308,7 +308,7 @@ Signed-off-by: Steven Barth int encap_limit = -1; __u16 offset; struct flowi6 fl6; -@@ -1361,6 +1502,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1362,6 +1503,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str fl6.flowi6_mark = skb->mark; } @@ -327,7 +327,7 @@ Signed-off-by: Steven Barth if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; -@@ -1488,6 +1641,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1489,6 +1642,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.flowinfo = p->flowinfo; t->parms.link = p->link; t->parms.proto = p->proto; @@ -342,7 +342,7 @@ Signed-off-by: Steven Barth dst_cache_reset(&t->dst_cache); ip6_tnl_link_config(t); return 0; -@@ -1526,6 +1687,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1527,6 +1688,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1903,6 +2065,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1937,6 +2108,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1938,6 +2109,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_COLLECT_METADATA]) parms->collect_md = true; @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2050,6 +2261,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2051,6 +2262,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2077,6 +2294,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2078,6 +2295,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(2) + /* IFLA_IPTUN_COLLECT_METADATA */ nla_total_size(0) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2084,6 +2319,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2085,6 +2320,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2092,9 +2330,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2093,9 +2331,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2132,6 +2388,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2133,6 +2389,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_SPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, diff --git a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 2cebf55a447..fa8c3b75ded 100644 --- a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -76,7 +76,7 @@ Signed-off-by: Jonas Gorski static inline const char *rtn_type(char *buf, size_t len, unsigned int t) --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c -@@ -157,6 +157,7 @@ static int ipmr_rule_action(struct fib_r +@@ -159,6 +159,7 @@ static int ipmr_rule_action(struct fib_r case FR_ACT_UNREACHABLE: return -ENETUNREACH; case FR_ACT_PROHIBIT: @@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski tb_id = fib_rule_get_table(rule, arg); --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c -@@ -167,6 +167,8 @@ static int ip6mr_rule_action(struct fib_ +@@ -169,6 +169,8 @@ static int ip6mr_rule_action(struct fib_ return -ENETUNREACH; case FR_ACT_PROHIBIT: return -EACCES; diff --git a/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch index 7cc39dcb8aa..5c7ae72bcb2 100644 --- a/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1001,6 +1001,9 @@ void phy_detach(struct phy_device *phyde +@@ -998,6 +998,9 @@ void phy_detach(struct phy_device *phyde struct mii_bus *bus; int i; diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch index 9c232791882..a94b7ea7d44 100644 --- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch @@ -1695,7 +1695,7 @@ Signed-off-by: Yangbo Lu EXPORT_SYMBOL(phy_ethtool_get_wol); --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1046,7 +1046,7 @@ int phy_suspend(struct phy_device *phyde +@@ -1043,7 +1043,7 @@ int phy_suspend(struct phy_device *phyde if (wol.wolopts) return -EBUSY; @@ -1704,7 +1704,7 @@ Signed-off-by: Yangbo Lu ret = phydrv->suspend(phydev); if (ret) -@@ -1063,7 +1063,7 @@ int phy_resume(struct phy_device *phydev +@@ -1060,7 +1060,7 @@ int phy_resume(struct phy_device *phydev struct phy_driver *phydrv = to_phy_driver(phydev->mdio.dev.driver); int ret = 0; @@ -1713,7 +1713,7 @@ Signed-off-by: Yangbo Lu ret = phydrv->resume(phydev); if (ret) -@@ -1720,7 +1720,7 @@ static int phy_remove(struct device *dev +@@ -1717,7 +1717,7 @@ static int phy_remove(struct device *dev phydev->state = PHY_DOWN; mutex_unlock(&phydev->lock); From 939fa07b041fef58196fba8dd4b5184adb7b4d3f Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 15 Jan 2019 12:41:26 +0100 Subject: [PATCH 351/399] kernel: bump 4.14 to 4.14.93 Refreshed all patches. Remove upstreamed: - 510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- .../brcm47xx/patches-4.14/159-cpu_fixes.patch | 39 +++++++------- .../patches-4.14/160-kmap_coherent.patch | 4 +- .../cns3xxx/patches-4.14/060-pcie_abort.patch | 2 +- ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 4 +- ...s3xxx-use-actual-size-reads-for-PCIe.patch | 7 +-- .../hack-4.14/207-disable-modorder.patch | 4 +- ...cache-use-more-efficient-cache-blast.patch | 2 +- .../702-phy_add_aneg_done_function.patch | 2 +- .../generic/hack-4.14/902-debloat_proc.patch | 2 +- .../203-kallsyms_uncompressed.patch | 8 +-- ...ort-limiting-4K-sectors-support-base.patch | 2 +- ...eck_raw_super-on-big-endian-machines.patch | 51 ------------------- .../pending-4.14/630-packet_socket_type.patch | 6 +-- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 24 ++++----- ...ng-with-source-address-failed-policy.patch | 4 +- ...detach-callback-to-struct-phy_driver.patch | 2 +- .../patches-4.14/0052-net-phy-add-FC.patch | 2 +- 18 files changed, 57 insertions(+), 112 deletions(-) delete mode 100644 target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index c8f05dbdba4..85c67f185e2 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .150 -LINUX_VERSION-4.14 = .91 +LINUX_VERSION-4.14 = .93 LINUX_KERNEL_HASH-4.9.150 = 94cc177ba2b433e4e30fefef38de33248ba1e2499ebda905096a8822097117e4 -LINUX_KERNEL_HASH-4.14.91 = 6a587c8b4160918efa082b0c2eda8c2db0f50d8814ad1d1ac94be1edf66ca6a9 +LINUX_KERNEL_HASH-4.14.93 = bb125fb204f7089782e179126121dd0f0aad9f02b7517ce3744982254c221bad remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch index 96917f82a63..3de77b1afd8 100644 --- a/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch +++ b/target/linux/brcm47xx/patches-4.14/159-cpu_fixes.patch @@ -1,6 +1,6 @@ --- a/arch/mips/include/asm/r4kcache.h +++ b/arch/mips/include/asm/r4kcache.h -@@ -25,6 +25,38 @@ +@@ -26,6 +26,38 @@ extern void (*r4k_blast_dcache)(void); extern void (*r4k_blast_icache)(void); @@ -39,7 +39,7 @@ /* * This macro return a properly sign-extended address suitable as base address * for indexed cache operations. Two issues here: -@@ -98,6 +130,7 @@ static inline void flush_icache_line_ind +@@ -99,6 +131,7 @@ static inline void flush_icache_line_ind static inline void flush_dcache_line_indexed(unsigned long addr) { __dflush_prologue @@ -47,7 +47,7 @@ cache_op(Index_Writeback_Inv_D, addr); __dflush_epilogue } -@@ -125,6 +158,7 @@ static inline void flush_icache_line(uns +@@ -126,6 +159,7 @@ static inline void flush_icache_line(uns static inline void flush_dcache_line(unsigned long addr) { __dflush_prologue @@ -55,7 +55,7 @@ cache_op(Hit_Writeback_Inv_D, addr); __dflush_epilogue } -@@ -132,6 +166,7 @@ static inline void flush_dcache_line(uns +@@ -133,6 +167,7 @@ static inline void flush_dcache_line(uns static inline void invalidate_dcache_line(unsigned long addr) { __dflush_prologue @@ -63,7 +63,7 @@ cache_op(Hit_Invalidate_D, addr); __dflush_epilogue } -@@ -205,6 +240,7 @@ static inline int protected_flush_icache +@@ -206,6 +241,7 @@ static inline int protected_flush_icache #ifdef CONFIG_EVA return protected_cachee_op(Hit_Invalidate_I, addr); #else @@ -71,7 +71,7 @@ return protected_cache_op(Hit_Invalidate_I, addr); #endif } -@@ -218,6 +254,7 @@ static inline int protected_flush_icache +@@ -219,6 +255,7 @@ static inline int protected_flush_icache */ static inline int protected_writeback_dcache_line(unsigned long addr) { @@ -79,7 +79,7 @@ #ifdef CONFIG_EVA return protected_cachee_op(Hit_Writeback_Inv_D, addr); #else -@@ -575,8 +612,51 @@ static inline void invalidate_tcache_pag +@@ -576,8 +613,51 @@ static inline void invalidate_tcache_pag : "r" (base), \ "i" (op)); @@ -132,7 +132,7 @@ static inline void extra##blast_##pfx##cache##lsize(void) \ { \ unsigned long start = INDEX_BASE; \ -@@ -588,6 +668,7 @@ static inline void extra##blast_##pfx##c +@@ -589,6 +669,7 @@ static inline void extra##blast_##pfx##c \ __##pfx##flush_prologue \ \ @@ -140,7 +140,7 @@ for (ws = 0; ws < ws_end; ws += ws_inc) \ for (addr = start; addr < end; addr += lsize * 32) \ cache##lsize##_unroll32(addr|ws, indexop); \ -@@ -602,6 +683,7 @@ static inline void extra##blast_##pfx##c +@@ -603,6 +684,7 @@ static inline void extra##blast_##pfx##c \ __##pfx##flush_prologue \ \ @@ -148,7 +148,7 @@ do { \ cache##lsize##_unroll32(start, hitop); \ start += lsize * 32; \ -@@ -620,6 +702,8 @@ static inline void extra##blast_##pfx##c +@@ -621,6 +703,8 @@ static inline void extra##blast_##pfx##c current_cpu_data.desc.waybit; \ unsigned long ws, addr; \ \ @@ -157,7 +157,7 @@ __##pfx##flush_prologue \ \ for (ws = 0; ws < ws_end; ws += ws_inc) \ -@@ -629,26 +713,26 @@ static inline void extra##blast_##pfx##c +@@ -630,26 +714,26 @@ static inline void extra##blast_##pfx##c __##pfx##flush_epilogue \ } @@ -204,7 +204,7 @@ #define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \ static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \ -@@ -677,53 +761,23 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde +@@ -678,53 +762,23 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde __BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) /* build blast_xxx_range, protected_blast_xxx_range */ @@ -266,7 +266,7 @@ } \ \ __##pfx##flush_epilogue \ -@@ -731,8 +785,8 @@ static inline void prot##extra##blast_## +@@ -732,8 +786,8 @@ static inline void prot##extra##blast_## #ifndef CONFIG_EVA @@ -277,7 +277,7 @@ #else -@@ -769,14 +823,14 @@ __BUILD_PROT_BLAST_CACHE_RANGE(d, dcache +@@ -770,15 +824,15 @@ __BUILD_PROT_BLAST_CACHE_RANGE(d, dcache __BUILD_PROT_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I) #endif @@ -298,7 +298,8 @@ +__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();) +__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , ) - #endif /* _ASM_R4KCACHE_H */ + /* Currently, this is very specific to Loongson-3 */ + #define __BUILD_BLAST_CACHE_NODE(pfx, desc, indexop, hitop, lsize) \ --- a/arch/mips/include/asm/stackframe.h +++ b/arch/mips/include/asm/stackframe.h @@ -428,6 +428,10 @@ @@ -396,7 +397,7 @@ if (dc_lsize == 0) r4k_blast_dcache = (void *)cache_noop; else if (dc_lsize == 16) -@@ -957,6 +969,8 @@ static void local_r4k_flush_cache_sigtra +@@ -986,6 +998,8 @@ static void local_r4k_flush_cache_sigtra } R4600_HIT_CACHEOP_WAR_IMPL; @@ -405,7 +406,7 @@ if (!cpu_has_ic_fills_f_dc) { if (dc_lsize) vaddr ? flush_dcache_line(addr & ~(dc_lsize - 1)) -@@ -1851,6 +1865,17 @@ static void coherency_setup(void) +@@ -1880,6 +1894,17 @@ static void coherency_setup(void) * silly idea of putting something else there ... */ switch (current_cpu_type()) { @@ -423,7 +424,7 @@ case CPU_R4000PC: case CPU_R4000SC: case CPU_R4000MC: -@@ -1897,6 +1922,15 @@ void r4k_cache_init(void) +@@ -1926,6 +1951,15 @@ void r4k_cache_init(void) extern void build_copy_page(void); struct cpuinfo_mips *c = ¤t_cpu_data; @@ -439,7 +440,7 @@ probe_pcache(); probe_vcache(); setup_scache(); -@@ -1974,7 +2008,15 @@ void r4k_cache_init(void) +@@ -2004,7 +2038,15 @@ void r4k_cache_init(void) */ local_r4k___flush_cache_all(NULL); diff --git a/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch b/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch index 60484ddcb9e..5cdb545e553 100644 --- a/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch +++ b/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch @@ -29,7 +29,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 #endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */ --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c -@@ -672,7 +672,7 @@ static inline void local_r4k_flush_cache +@@ -694,7 +694,7 @@ static inline void local_r4k_flush_cache map_coherent = (cpu_has_dc_aliases && page_mapcount(page) && !Page_dcache_dirty(page)); @@ -38,7 +38,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485 vaddr = kmap_coherent(page, addr); else vaddr = kmap_atomic(page); -@@ -697,7 +697,7 @@ static inline void local_r4k_flush_cache +@@ -719,7 +719,7 @@ static inline void local_r4k_flush_cache } if (vaddr) { diff --git a/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch b/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch index b5f0350571c..87b1526c3a3 100644 --- a/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch +++ b/target/linux/cns3xxx/patches-4.14/060-pcie_abort.patch @@ -82,7 +82,7 @@ { @@ -95,6 +168,11 @@ static int cns3xxx_pci_read_config(struc - ret = pci_generic_config_read32(bus, devfn, where, size, val); + ret = pci_generic_config_read(bus, devfn, where, size, val); + if (check_master_abort(bus, devfn, where)) { + printk(KERN_ERR "pci error: %04d:%02x:%02x.%02x %02x(%d)= master_abort on read\n", pci_domain_nr(bus), bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn), where, size); diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch index 067481ba943..5639497926c 100644 --- a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -44,7 +44,7 @@ Cc: Kir Kolyshkin * @sk_lingertime: %SO_LINGER l_linger setting * @sk_backlog: always used with the per-socket spinlock held * @sk_callback_lock: used with the callbacks in the end of this struct -@@ -445,6 +446,8 @@ struct sock { +@@ -446,6 +447,8 @@ struct sock { sk_type : 16; #define SK_PROTOCOL_MAX U8_MAX u16 sk_gso_max_segs; @@ -55,7 +55,7 @@ Cc: Kir Kolyshkin rwlock_t sk_callback_lock; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2739,6 +2739,7 @@ void sock_init_data(struct socket *sock, +@@ -2742,6 +2742,7 @@ void sock_init_data(struct socket *sock, sk->sk_max_pacing_rate = ~0U; sk->sk_pacing_rate = ~0U; diff --git a/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch b/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch index 44ca8337057..2b3384391a7 100644 --- a/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch +++ b/target/linux/generic/backport-4.14/101-arm-cns3xxx-use-actual-size-reads-for-PCIe.patch @@ -33,11 +33,9 @@ CC: stable@vger.kernel.org # v4.0+ arch/arm/mach-cns3xxx/pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c -index 5e11ad3164e0..95a11d5b3587 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c -@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, +@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struc u32 mask = (0x1ull << (size * 8)) - 1; int shift = (where % 4) * 8; @@ -46,6 +44,3 @@ index 5e11ad3164e0..95a11d5b3587 100644 if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn && (where & 0xffc) == PCI_CLASS_REVISION) --- -2.17.1 - diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch index 0619dcaa7bf..b45a8e3bc2c 100644 --- a/target/linux/generic/hack-4.14/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1237,7 +1237,6 @@ all: modules +@@ -1240,7 +1240,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1266,7 +1265,6 @@ _modinst_: +@@ -1269,7 +1268,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.14/300-MIPS-r4k_cache-use-more-efficient-cache-blast.patch b/target/linux/generic/hack-4.14/300-MIPS-r4k_cache-use-more-efficient-cache-blast.patch index 860a7e03c56..c07ccf9474e 100644 --- a/target/linux/generic/hack-4.14/300-MIPS-r4k_cache-use-more-efficient-cache-blast.patch +++ b/target/linux/generic/hack-4.14/300-MIPS-r4k_cache-use-more-efficient-cache-blast.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- --- a/arch/mips/include/asm/r4kcache.h +++ b/arch/mips/include/asm/r4kcache.h -@@ -682,16 +682,48 @@ static inline void prot##extra##blast_## +@@ -683,16 +683,48 @@ static inline void prot##extra##blast_## unsigned long end) \ { \ unsigned long lsize = cpu_##desc##_line_size(); \ diff --git a/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch index 0453112a1fd..24d3cdffa33 100644 --- a/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch @@ -15,7 +15,7 @@ --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1458,6 +1458,9 @@ int genphy_update_link(struct phy_device +@@ -1455,6 +1455,9 @@ int genphy_update_link(struct phy_device { int status; diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index d9963361868..1121ac11816 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -328,7 +328,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3378,6 +3378,8 @@ static __net_initdata struct pernet_oper +@@ -3381,6 +3381,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch index fa68f307d4e..5f66c3d5012 100644 --- a/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch @@ -65,7 +65,7 @@ Signed-off-by: Felix Fietkau static int absolute_percpu = 0; static char symbol_prefix_char = '\0'; static int base_relative = 0; -@@ -457,6 +458,9 @@ static void write_src(void) +@@ -458,6 +459,9 @@ static void write_src(void) free(markers); @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau output_label("kallsyms_token_table"); off = 0; for (i = 0; i < 256; i++) { -@@ -515,6 +519,9 @@ static void *find_token(unsigned char *s +@@ -516,6 +520,9 @@ static void *find_token(unsigned char *s { int i; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau for (i = 0; i < len - 1; i++) { if (str[i] == token[0] && str[i+1] == token[1]) return &str[i]; -@@ -587,6 +594,9 @@ static void optimize_result(void) +@@ -588,6 +595,9 @@ static void optimize_result(void) { int i, best; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau /* using the '\0' symbol last allows compress_symbols to use standard * fast string functions */ for (i = 255; i >= 0; i--) { -@@ -775,6 +785,8 @@ int main(int argc, char **argv) +@@ -776,6 +786,8 @@ int main(int argc, char **argv) symbol_prefix_char = *p; } else if (strcmp(argv[i], "--base-relative") == 0) base_relative = 1; diff --git a/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch index 231f9c21a4e..0f4ea32688b 100644 --- a/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch +++ b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau + config SPI_ATMEL_QUADSPI tristate "Atmel Quad SPI Controller" - depends on ARCH_AT91 || (ARM && COMPILE_TEST) + depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110) --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -2561,10 +2561,12 @@ static int spi_nor_select_erase(struct s diff --git a/target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch b/target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch deleted file mode 100644 index 6cbaf28e81f..00000000000 --- a/target/linux/generic/pending-4.14/510-f2fs-fix-sanity_check_raw_super-on-big-endian-machines.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Martin Blumenstingl -To: linux-f2fs-devel@lists.sourceforge.net, yuchao0@huawei.com, - jaegeuk@kernel.org -Subject: [PATCH v2 1/1] f2fs: fix validation of the block count in - sanity_check_raw_super -Date: Sat, 22 Dec 2018 11:22:26 +0100 -Message-Id: <20181222102226.10050-2-martin.blumenstingl@googlemail.com> - -Treat "block_count" from struct f2fs_super_block as 64-bit little endian -value in sanity_check_raw_super() because struct f2fs_super_block -declares "block_count" as "__le64". - -This fixes a bug where the superblock validation fails on big endian -devices with the following error: - F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) - F2FS-fs (sda1): Can't find valid F2FS filesystem in 1th superblock - F2FS-fs (sda1): Wrong segment_count / block_count (61439 > 0) - F2FS-fs (sda1): Can't find valid F2FS filesystem in 2th superblock -As result of this the partition cannot be mounted. - -With this patch applied the superblock validation works fine and the -partition can be mounted again: - F2FS-fs (sda1): Mounted with checkpoint version = 7c84 - -My little endian x86-64 hardware was able to mount the partition without -this fix. -To confirm that mounting f2fs filesystems works on big endian machines -again I tested this on a 32-bit MIPS big endian (lantiq) device. - -Fixes: 0cfe75c5b01199 ("f2fs: enhance sanity_check_raw_super() to avoid potential overflows") -Cc: stable@vger.kernel.org -Signed-off-by: Martin Blumenstingl -Reviewed-by: Chao Yu ---- - ---- a/fs/f2fs/super.c -+++ b/fs/f2fs/super.c -@@ -1897,10 +1897,10 @@ static int sanity_check_raw_super(struct - return 1; - } - -- if (segment_count > (le32_to_cpu(raw_super->block_count) >> 9)) { -+ if (segment_count > (le64_to_cpu(raw_super->block_count) >> 9)) { - f2fs_msg(sb, KERN_INFO, -- "Wrong segment_count / block_count (%u > %u)", -- segment_count, le32_to_cpu(raw_super->block_count)); -+ "Wrong segment_count / block_count (%u > %llu)", -+ segment_count, le64_to_cpu(raw_super->block_count)); - return 1; - } - diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch index d55d678549f..e8eae3b7ff8 100644 --- a/target/linux/generic/pending-4.14/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3265,6 +3267,7 @@ static int packet_create(struct net *net +@@ -3269,6 +3271,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3878,6 +3881,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3882,6 +3885,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3930,6 +3943,13 @@ static int packet_getsockopt(struct sock +@@ -3934,6 +3947,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 7c60d7e7999..89e6646c572 100644 --- a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -292,7 +292,7 @@ Signed-off-by: Steven Barth __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); -@@ -962,6 +1101,7 @@ static void init_tel_txopt(struct ipv6_t +@@ -963,6 +1102,7 @@ static void init_tel_txopt(struct ipv6_t opt->ops.opt_nflen = 8; } @@ -300,7 +300,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own * @t: the outgoing tunnel device -@@ -1305,6 +1445,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1306,6 +1446,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str { struct ip6_tnl *t = netdev_priv(dev); struct ipv6hdr *ipv6h; @@ -308,7 +308,7 @@ Signed-off-by: Steven Barth int encap_limit = -1; __u16 offset; struct flowi6 fl6; -@@ -1371,6 +1512,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1372,6 +1513,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); @@ -327,7 +327,7 @@ Signed-off-by: Steven Barth if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; -@@ -1499,6 +1652,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1500,6 +1653,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.link = p->link; t->parms.proto = p->proto; t->parms.fwmark = p->fwmark; @@ -342,7 +342,7 @@ Signed-off-by: Steven Barth dst_cache_reset(&t->dst_cache); ip6_tnl_link_config(t); return 0; -@@ -1537,6 +1698,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1538,6 +1699,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -350,7 +350,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1923,6 +2085,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1924,6 +2086,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -366,7 +366,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1960,6 +2131,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1961,6 +2132,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_FWMARK]) parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); @@ -413,7 +413,7 @@ Signed-off-by: Steven Barth } static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], -@@ -2075,6 +2286,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -2076,6 +2287,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -426,7 +426,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -2104,6 +2321,24 @@ static size_t ip6_tnl_get_size(const str +@@ -2105,6 +2322,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(0) + /* IFLA_IPTUN_FWMARK */ nla_total_size(4) + @@ -451,7 +451,7 @@ Signed-off-by: Steven Barth 0; } -@@ -2111,6 +2346,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2112,6 +2347,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -461,7 +461,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || -@@ -2120,9 +2358,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -2121,9 +2359,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || @@ -490,7 +490,7 @@ Signed-off-by: Steven Barth if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || -@@ -2162,6 +2418,7 @@ static const struct nla_policy ip6_tnl_p +@@ -2163,6 +2419,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, diff --git a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 1397580382d..36aaccbdb3e 100644 --- a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -76,7 +76,7 @@ Signed-off-by: Jonas Gorski static inline const char *rtn_type(char *buf, size_t len, unsigned int t) --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c -@@ -161,6 +161,7 @@ static int ipmr_rule_action(struct fib_r +@@ -163,6 +163,7 @@ static int ipmr_rule_action(struct fib_r case FR_ACT_UNREACHABLE: return -ENETUNREACH; case FR_ACT_PROHIBIT: @@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski tb_id = fib_rule_get_table(rule, arg); --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c -@@ -168,6 +168,8 @@ static int ip6mr_rule_action(struct fib_ +@@ -170,6 +170,8 @@ static int ip6mr_rule_action(struct fib_ return -ENETUNREACH; case FR_ACT_PROHIBIT: return -EACCES; diff --git a/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch index 11436a21667..119b53c6d71 100644 --- a/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1102,6 +1102,9 @@ void phy_detach(struct phy_device *phyde +@@ -1099,6 +1099,9 @@ void phy_detach(struct phy_device *phyde struct module *ndev_owner = dev->dev.parent->driver->owner; struct mii_bus *bus; diff --git a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch index 9d9391d6cda..1e0f9a9b2a9 100644 --- a/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch +++ b/target/linux/mediatek/patches-4.14/0052-net-phy-add-FC.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c -@@ -1940,7 +1940,7 @@ static struct phy_driver genphy_driver = +@@ -1937,7 +1937,7 @@ static struct phy_driver genphy_driver = .config_init = genphy_config_init, .features = PHY_GBIT_FEATURES | SUPPORTED_MII | SUPPORTED_AUI | SUPPORTED_FIBRE | From abd0f7995e5ebde37ed97fb2f1bdc75119ec58c7 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Thu, 29 Nov 2018 16:19:22 +0000 Subject: [PATCH 352/399] kmod-sched-cake: bump to latest cake 331ac70 Correctly update parent qlen when splitting GSO packets 581967c Makefile: Hook into Kbuild/Kconfig infrastructure The parent qlen change is potentially relevant for us, the makefile is a no-op. Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 55e0a7131a4b6e98d7cd623727f8ac5c4702b60d) --- package/kernel/kmod-sched-cake/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index c771081d782..ed1243f6523 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2018-10-02 -PKG_SOURCE_VERSION:=ddf4c95145f2fbcca16f19e01f3195d213ca760b -PKG_MIRROR_HASH:=c5fd914fa1129e1cbe46e3dff30077b3265446538831e3a668229c22c4cf497a +PKG_SOURCE_DATE:=2019-01-08 +PKG_SOURCE_VERSION:=331ac70c8580544cd08a556579dc8807d9941d2e +PKG_MIRROR_HASH:=e2174531a92d1e9c48bcb74757399255aa205cb64f9863f307e357c5e23c3449 PKG_MAINTAINER:=Kevin Darbyshire-Bryant include $(INCLUDE_DIR)/package.mk From 7f98cd8d503e33ad43d6273d417474086bcb446d Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Wed, 16 Jan 2019 22:29:33 +0100 Subject: [PATCH 353/399] odhcpd: fix onlink IA check (FS#2060) ae16950 dhcpv6-ia: fix compiler warning c70d5cf dhcpv6-ia: fix onlink IA check (FS#2060) Signed-off-by: Hans Dedecker --- package/network/services/odhcpd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index f5be5ff4c88..34734c6e42e 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,13 +9,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=3 -PKG_VERSION:=1.14 +PKG_VERSION:=1.15 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2019-01-04 -PKG_SOURCE_VERSION:=96694abe8093b06daf5d503d19e7cdcd62de03a5 -PKG_MIRROR_HASH:=f1407019f9d2e9459159837f4ad1b55fc18a41297ee525135fa1a072742c86af +PKG_SOURCE_DATE:=2019-01-16 +PKG_SOURCE_VERSION:=ae16950ce18b037a91b706edcee92ce173cf74b0 +PKG_MIRROR_HASH:=ba6e1d7c5e3c26ca4e5c1d09077845033395656690be3faec21ed77c9bfca895 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 3603c2321d675b7086d9413a68bcfdf1da3cccb5 Mon Sep 17 00:00:00 2001 From: Andreas Ziegler Date: Thu, 27 Dec 2018 15:34:18 +0100 Subject: [PATCH 354/399] ramips: mt7621: fix 5GHz WiFi LED on ZBT WG3526 This fixes the 5GHz WiFi LED which was previously not working. Signed-off-by: Andreas Ziegler (cherry picked from commit d492da702a2118b34ced9772586c5a6de68e70fd) --- target/linux/ramips/dts/ZBT-WG3526.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi index 104a51f8de7..8f755e34802 100644 --- a/target/linux/ramips/dts/ZBT-WG3526.dtsi +++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi @@ -100,6 +100,10 @@ reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x8000>; ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + }; }; }; }; From e789bd2243d029ffd8b2f85c0eac9e65f5716909 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 10 Sep 2018 11:42:53 +0200 Subject: [PATCH 355/399] opkg: drop argument from check_signature in opkg.conf check_signature is a bool option and doesn't take any arguments. The presence of the 1 falsely suggests setting it to 0 disables the check, while the option actually needs to be removed or commented out to be disabled. So remove the argument to make it more clear. Fixes: beca028bd6bb ("build: add integration for managing opkg package feed keys") Signed-off-by: Jonas Gorski (cherry picked from commit d3bf5ff9bc7b55b2a3dab93853b33a0cd2c4ca47) --- package/system/opkg/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index f00e574de08..67105675e8d 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=opkg -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git @@ -89,7 +89,7 @@ define Package/opkg/install $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg ifneq ($(CONFIG_SIGNED_PACKAGES),) - echo "option check_signature 1" >> $(1)/etc/opkg.conf + echo "option check_signature" >> $(1)/etc/opkg.conf endif $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) ./files/opkg-key $(1)/usr/sbin/ From fafd7691e6bfe645e86168e5cfa98e1de863d2c5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 18 Jan 2019 18:43:18 +0100 Subject: [PATCH 356/399] opkg: update to latest Git head This update fixes some cosmetical issues and a number of segmentation faults when parsing lists having Conflicts or Replaces tags. d217daf libopkg: fix replacelist parsing and writing 9dd9a07 libopkg: fix segmentation fault when traversing conflicts 34571ba libopkg: consider provided packages in pkg_vec_mark_if_matches() 18740e6 opkg_download: print error when fork() fails e3d7330 libopkg: don't print unresolved dependencies twice Signed-off-by: Jo-Philipp Wich (cherry picked from commit 1bd18f2b5cbf1c9c384e9725eff7804decf88c90) --- package/system/opkg/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 67105675e8d..865644ac6e6 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -9,14 +9,14 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=opkg -PKG_RELEASE:=3 +PKG_RELEASE:=1 PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2017-12-07 -PKG_SOURCE_VERSION:=3b417b9f41b4ceb5912d82f867dd5534e5675b5c -PKG_MIRROR_HASH:=1c9c21e56186345d0034d15051c1d9c5ebb5aa6658d6ae8886d8403207a914a3 +PKG_SOURCE_DATE:=2019-01-18 +PKG_SOURCE_VERSION:=7708a01a084872bbe4c46f36d2da021fdeb10862 +PKG_MIRROR_HASH:=117148ece22e64654264afd869606ef5507edd3dc965ffe000c6b1b1074b3f4a PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING From 455bfd10659d6ed68426a7002fe6f9fffab7171b Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 18 Jan 2019 11:23:17 +0100 Subject: [PATCH 357/399] kernel: bump 4.9 to 4.9.151 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 85c67f185e2..6c2f02a2bbb 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .150 +LINUX_VERSION-4.9 = .151 LINUX_VERSION-4.14 = .93 -LINUX_KERNEL_HASH-4.9.150 = 94cc177ba2b433e4e30fefef38de33248ba1e2499ebda905096a8822097117e4 +LINUX_KERNEL_HASH-4.9.151 = 15965595807e4dce34da951a806af9928b60c19d3f40773de43f606f14ed425c LINUX_KERNEL_HASH-4.14.93 = bb125fb204f7089782e179126121dd0f0aad9f02b7517ce3744982254c221bad remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) From 76037756d0c97eb2cbb9f227b3d3b11705b5abe0 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 18 Jan 2019 11:26:17 +0100 Subject: [PATCH 358/399] kernel: bump 4.14 to 4.14.94 Refreshed all patches. Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 6c2f02a2bbb..4552d4c90fa 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .151 -LINUX_VERSION-4.14 = .93 +LINUX_VERSION-4.14 = .94 LINUX_KERNEL_HASH-4.9.151 = 15965595807e4dce34da951a806af9928b60c19d3f40773de43f606f14ed425c -LINUX_KERNEL_HASH-4.14.93 = bb125fb204f7089782e179126121dd0f0aad9f02b7517ce3744982254c221bad +LINUX_KERNEL_HASH-4.14.94 = e728518bb024209acc222e803cdc00d0ea2b1f4ebf28a8ed17a639171a1c23f1 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) From 6e16dd1234ea4814af2b46a22b4aea111baef3ab Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 20 Jan 2019 18:01:57 +0100 Subject: [PATCH 359/399] mt76: update to the latest version d273ddd mt7603: fix number of frames limit in .release_buffered_frames 63bf183 mt76: add channel switch announcement support e45db12 mt7603: fix tx status info 9d11596 mt7603: discard bogus tx status data 4bcb2f9 mt7603: fix txd q_idx field value 4206db7 mt76: set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR flag c4e4982 mt7603: set IEEE80211_HW_TX_STATUS_NO_AMPDU_LEN 702f557 mt7603: use maximum tx count for buffered multicast packets 158529d mt7603: fix PSE reset retry sequence fc31457 mt7603: implement support for SMPS 3e9a7d5 Revert "mt7603: fix txd q_idx field value" 815fd03 mt7603: fix CCA timing values b35cc8e mt7603: set timing on channel change before starting MAC 79b337c mt7603: move CF-End rate update to mt7603_mac_set_timing 3df341d mt7603: avoid redundant MAC timing updates 1c751f3 mt76: avoid scheduling tx queues for powersave stations 2efa389 mt7603: limit station power save queue length to 64 63a79ff mt76: do not report out-of-range rx nss fe30bd3 mt7603: issue PSE reset on tx hang ce8cc5d mt7603: issue PSE client reset on init e342cc5 mt7603: fix buffered multicast count register aa470d8 mt7603: fix buffered multicast queue flush b4ee01f mt76: fix tx status timeout processing 7d00d58 mt76x02: fix per-chain signal strength reporting 64abb35 mt76: fix corrupted software generated tx CCMP PN 0b939dc mt76: fix resetting software IV flag on key delete Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 4399c53cf26..a8306bd6106 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2019-01-10 -PKG_SOURCE_VERSION:=a946b78acfda091cd6730a54fa9dfc87f125b17d -PKG_MIRROR_HASH:=a077d6160459b9251ce2362c2c429a3958b591f9e25d3a980bb0c78f77e04db0 +PKG_SOURCE_DATE:=2019-01-25 +PKG_SOURCE_VERSION:=0b939dc7edf0629ee2d1475b6dd6b9a4a1f9384d +PKG_MIRROR_HASH:=64279b0186a6dabd8916085e6bb272b11a1a8c3f2ad4e41c9fb1cefef71d71ba PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 From 91d3b873530a9c6e27356ee99357bffdd6f042eb Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 25 Jan 2019 18:41:21 +0100 Subject: [PATCH 360/399] uboot-fritz4040: fix crash caused by interaction with gcc 7.1+ David Bauer reported a u-boot crash (data abort) at a odd place (byteswap) when he ran ping/tftp on his 7530. |(FRITZ7530) # ping 192.168.1.70 |eth0 PHY0 up Speed :1000 Full duplex |eth0 PHY1 Down Speed :10 Half duplex |eth0 PHY2 Down Speed :10 Half duplex |eth0 PHY3 Down Speed :10 Half duplex |eth0 PHY4 Down Speed :10 Half duplex |Using eth0 device |data abort |pc : [<84234774>] lr : [<842351a4>] |sp : 8412fdb0 ip : 0000009b fp : 00000000 |r10: 00000000 r9 : 00000001 r8 : 8412ff68 |r7 : 00000000 r6 : 0000002a r5 : 84244e90 r4 : 8425e28e |r3 : 84244e90 r2 : 14000045 r1 : 8412fdb0 r0 : 8425e28e |Flags: nZCv IRQs off FIQs off Mode SVC_32 |Resetting CPU ... | |resetting ... This issue is caused by switch from gcc 5.5 to 7.1+ as explained in the upstream patch: |From a768e513b07b5999a8e7d7740ac8d9da04ee7e51 Mon Sep 17 00:00:00 2001 |From: Denis Pynkin |Date: Fri, 21 Jul 2017 19:28:42 +0300 |Subject: [PATCH] net: Use packed structures for networking | |PXE boot is broken with GCC 7.1 due option '-fstore-merging' enabled |by default for '-O2': | |BOOTP broadcast 1 |data abort |pc : [<8ff8bb30>] lr : [<00004f1f>] |reloc pc : [<17832b30>] lr : [<878abf1f>] |sp : 8f558bc0 ip : 00000000 fp : 8ffef5a4 |r10: 8ffed248 r9 : 8f558ee0 r8 : 8ffef594 |r7 : 0000000e r6 : 8ffed700 r5 : 00000000 r4 : 8ffed74e |r3 : 00060101 r2 : 8ffed230 r1 : 8ffed706 r0 : 00000ddd |Flags: nzcv IRQs off FIQs off Mode S | |Core reason is usage of structures for network headers without packed |attribute. This patch just backports the upstream change to the uboot-fritz4040 package. Reported-by: David Bauer Signed-off-by: Christian Lamparter --- ...Use-packed-structures-for-networking.patch | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 package/boot/uboot-fritz4040/patches/120-net-Use-packed-structures-for-networking.patch diff --git a/package/boot/uboot-fritz4040/patches/120-net-Use-packed-structures-for-networking.patch b/package/boot/uboot-fritz4040/patches/120-net-Use-packed-structures-for-networking.patch new file mode 100644 index 00000000000..8a7b0bb04f8 --- /dev/null +++ b/package/boot/uboot-fritz4040/patches/120-net-Use-packed-structures-for-networking.patch @@ -0,0 +1,137 @@ +From: Denis Pynkin +Date: Fri, 21 Jul 2017 19:28:42 +0300 +Subject: [PATCH] net: Use packed structures for networking + +PXE boot is broken with GCC 7.1 due option '-fstore-merging' enabled +by default for '-O2': + +BOOTP broadcast 1 +data abort +pc : [<8ff8bb30>] lr : [<00004f1f>] +reloc pc : [<17832b30>] lr : [<878abf1f>] +sp : 8f558bc0 ip : 00000000 fp : 8ffef5a4 +r10: 8ffed248 r9 : 8f558ee0 r8 : 8ffef594 +r7 : 0000000e r6 : 8ffed700 r5 : 00000000 r4 : 8ffed74e +r3 : 00060101 r2 : 8ffed230 r1 : 8ffed706 r0 : 00000ddd +Flags: nzcv IRQs off FIQs off Mode SVC_32 +Resetting CPU ... + +Core reason is usage of structures for network headers without packed +attribute. + +Reviewed-by: Yauheni Kaliuta +Signed-off-by: Denis Pynkin +Acked-by: Joe Hershberger +Signed-off-by: Christian Lamparter +[backported from u-boot main] +--- + +--- a/include/net.h ++++ b/include/net.h +@@ -182,7 +182,7 @@ struct ethernet_hdr { + uchar et_dest[6]; /* Destination node */ + uchar et_src[6]; /* Source node */ + ushort et_protlen; /* Protocol or length */ +-}; ++} __attribute__((packed)); + + /* Ethernet header size */ + #define ETHER_HDR_SIZE (sizeof(struct ethernet_hdr)) +@@ -198,7 +198,7 @@ struct e802_hdr { + uchar et_snap2; + uchar et_snap3; + ushort et_prot; /* 802 protocol */ +-}; ++} __attribute__((packed)); + + /* 802 + SNAP + ethernet header size */ + #define E802_HDR_SIZE (sizeof(struct e802_hdr)) +@@ -212,7 +212,7 @@ struct vlan_ethernet_hdr { + ushort vet_vlan_type; /* PROT_VLAN */ + ushort vet_tag; /* TAG of VLAN */ + ushort vet_type; /* protocol type */ +-}; ++} __attribute__((packed)); + + /* VLAN Ethernet header size */ + #define VLAN_ETHER_HDR_SIZE (sizeof(struct vlan_ethernet_hdr)) +@@ -239,7 +239,7 @@ struct ip_hdr { + ushort ip_sum; /* checksum */ + IPaddr_t ip_src; /* Source IP address */ + IPaddr_t ip_dst; /* Destination IP address */ +-}; ++} __attribute__((packed)); + + #define IP_OFFS 0x1fff /* ip offset *= 8 */ + #define IP_FLAGS 0xe000 /* first 3 bits */ +@@ -267,7 +267,7 @@ struct ip_udp_hdr { + ushort udp_dst; /* UDP destination port */ + ushort udp_len; /* Length of UDP packet */ + ushort udp_xsum; /* Checksum */ +-}; ++} __attribute__((packed)); + + #define IP_UDP_HDR_SIZE (sizeof(struct ip_udp_hdr)) + #define UDP_HDR_SIZE (IP_UDP_HDR_SIZE - IP_HDR_SIZE) +@@ -306,7 +306,7 @@ struct arp_hdr { + uchar ar_tha[]; /* Target hardware address */ + uchar ar_tpa[]; /* Target protocol address */ + #endif /* 0 */ +-}; ++} __attribute__((packed)); + + #define ARP_HDR_SIZE (8+20) /* Size assuming ethernet */ + +@@ -341,7 +341,7 @@ struct icmp_hdr { + } frag; + uchar data[0]; + } un; +-}; ++} __attribute__((packed)); + + #define ICMP_HDR_SIZE (sizeof(struct icmp_hdr)) + #define IP_ICMP_HDR_SIZE (IP_HDR_SIZE + ICMP_HDR_SIZE) +--- a/net/bootp.h ++++ b/net/bootp.h +@@ -49,7 +49,7 @@ struct Bootp_t { + char bp_sname[64]; /* Server host name */ + char bp_file[128]; /* Boot file name */ + char bp_vend[OPT_FIELD_SIZE]; /* Vendor information */ +-}; ++} __attribute__((packed)); + + #define BOOTP_HDR_SIZE sizeof(struct Bootp_t) + +--- a/net/dns.h ++++ b/net/dns.h +@@ -32,7 +32,7 @@ struct header { + uint16_t nauth; /* Authority PRs */ + uint16_t nother; /* Other PRs */ + unsigned char data[1]; /* Data, variable length */ +-}; ++} __attribute__((packed)); + + extern void DnsStart(void); /* Begin DNS */ + +--- a/net/nfs.h ++++ b/net/nfs.h +@@ -71,7 +71,7 @@ struct rpc_t { + uint32_t data[19]; + } reply; + } u; +-}; ++} __attribute__((packed)); + extern void NfsStart(void); /* Begin NFS */ + + +--- a/net/sntp.h ++++ b/net/sntp.h +@@ -54,7 +54,7 @@ struct sntp_pkt_t { + unsigned long long originate_timestamp; + unsigned long long receive_timestamp; + unsigned long long transmit_timestamp; +-}; ++} __attribute__((packed)); + + extern void SntpStart(void); /* Begin SNTP */ + From dd5fa217dce336d5c258c462adf1aa3055f65903 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 23 Jan 2019 14:08:31 +0100 Subject: [PATCH 361/399] kernel: bump 4.9 to 4.9.152 Refreshed all patches. Compile-tested on: ar71xx Runtime-tested on: ar71xx Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- .../910-unaligned_access_hacks.patch | 4 +- .../804-crypto-support-layerscape.patch | 63 ++++++++++--------- 3 files changed, 37 insertions(+), 34 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 4552d4c90fa..6f9cb9c4803 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -2,10 +2,10 @@ LINUX_RELEASE?=1 -LINUX_VERSION-4.9 = .151 +LINUX_VERSION-4.9 = .152 LINUX_VERSION-4.14 = .94 -LINUX_KERNEL_HASH-4.9.151 = 15965595807e4dce34da951a806af9928b60c19d3f40773de43f606f14ed425c +LINUX_KERNEL_HASH-4.9.152 = 90e47b85c09af47eefafe851685ee731538f640b0650a6a9cfa0234436708e39 LINUX_KERNEL_HASH-4.14.94 = e728518bb024209acc222e803cdc00d0ea2b1f4ebf28a8ed17a639171a1c23f1 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 7fb38784f78..2a30108ee84 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -241,7 +241,7 @@ */ --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c -@@ -471,7 +471,7 @@ int ipv6_recv_error(struct sock *sk, str +@@ -472,7 +472,7 @@ int ipv6_recv_error(struct sock *sk, str ipv6_iface_scope_id(&sin->sin6_addr, IP6CB(skb)->iif); } else { @@ -250,7 +250,7 @@ &sin->sin6_addr); sin->sin6_scope_id = 0; } -@@ -817,12 +817,12 @@ int ip6_datagram_send_ctl(struct net *ne +@@ -816,12 +816,12 @@ int ip6_datagram_send_ctl(struct net *ne } if (fl6->flowlabel&IPV6_FLOWINFO_MASK) { diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index 02527134805..6c91543e6fb 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -21630,21 +21630,18 @@ Signed-off-by: Yangbo Lu -static inline dma_addr_t buf_map_to_sec4_sg(struct device *jrdev, - struct sec4_sg_entry *sec4_sg, - u8 *buf, int buflen) +-{ +- dma_addr_t buf_dma; +/* Map current buffer in state (if length > 0) and put it in link table */ +static inline int buf_map_to_sec4_sg(struct device *jrdev, + struct sec4_sg_entry *sec4_sg, + struct caam_hash_state *state) - { -- dma_addr_t buf_dma; ++{ + int buflen = *current_buflen(state); - -- buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE); -- dma_to_sec4_sg_one(sec4_sg, buf_dma, buflen, 0); ++ + if (!buflen) + return 0; - -- return buf_dma; --} ++ + state->buf_dma = dma_map_single(jrdev, current_buf(state), buflen, + DMA_TO_DEVICE); + if (dma_mapping_error(jrdev, state->buf_dma)) { @@ -21653,6 +21650,13 @@ Signed-off-by: Yangbo Lu + return -ENOMEM; + } +- buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE); +- dma_to_sec4_sg_one(sec4_sg, buf_dma, buflen, 0); ++ dma_to_sec4_sg_one(sec4_sg, state->buf_dma, buflen, 0); + +- return buf_dma; +-} +- -/* - * Only put buffer in link table if it contains data, which is possible, - * since a buffer has previously been used, and needs to be unmapped, @@ -21668,8 +21672,7 @@ Signed-off-by: Yangbo Lu - buf_dma = buf_map_to_sec4_sg(jrdev, sec4_sg, buf, buflen); - else - buf_dma = 0; -+ dma_to_sec4_sg_one(sec4_sg, state->buf_dma, buflen, 0); - +- - return buf_dma; + return 0; } @@ -22259,7 +22262,7 @@ Signed-off-by: Yangbo Lu u32 *desc; int digestsize = crypto_ahash_digestsize(ahash); struct ahash_edesc *edesc; -@@ -1246,7 +1083,6 @@ static int ahash_final_no_ctx(struct aha +@@ -1249,7 +1086,6 @@ static int ahash_final_no_ctx(struct aha dev_err(jrdev, "unable to map dst\n"); goto unmap; } @@ -22267,7 +22270,7 @@ Signed-off-by: Yangbo Lu #ifdef DEBUG print_hex_dump(KERN_ERR, "jobdesc@"__stringify(__LINE__)": ", -@@ -1276,13 +1112,12 @@ static int ahash_update_no_ctx(struct ah +@@ -1279,13 +1115,12 @@ static int ahash_update_no_ctx(struct ah struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); struct caam_hash_state *state = ahash_request_ctx(req); struct device *jrdev = ctx->jrdev; @@ -22287,7 +22290,7 @@ Signed-off-by: Yangbo Lu int in_len = *buflen + req->nbytes, to_hash; int sec4_sg_bytes, src_nents, mapped_nents; struct ahash_edesc *edesc; -@@ -1329,10 +1164,11 @@ static int ahash_update_no_ctx(struct ah +@@ -1332,10 +1167,11 @@ static int ahash_update_no_ctx(struct ah edesc->src_nents = src_nents; edesc->sec4_sg_bytes = sec4_sg_bytes; @@ -22302,7 +22305,7 @@ Signed-off-by: Yangbo Lu sg_to_sec4_sg_last(req->src, mapped_nents, edesc->sec4_sg + 1, 0); -@@ -1342,8 +1178,6 @@ static int ahash_update_no_ctx(struct ah +@@ -1345,8 +1181,6 @@ static int ahash_update_no_ctx(struct ah *next_buflen, 0); } @@ -22311,7 +22314,7 @@ Signed-off-by: Yangbo Lu desc = edesc->hw_desc; edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, -@@ -1403,12 +1237,9 @@ static int ahash_finup_no_ctx(struct aha +@@ -1406,12 +1240,9 @@ static int ahash_finup_no_ctx(struct aha struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); struct caam_hash_state *state = ahash_request_ctx(req); struct device *jrdev = ctx->jrdev; @@ -22327,7 +22330,7 @@ Signed-off-by: Yangbo Lu u32 *desc; int sec4_sg_bytes, sec4_sg_src_index, src_nents, mapped_nents; int digestsize = crypto_ahash_digestsize(ahash); -@@ -1450,9 +1281,9 @@ static int ahash_finup_no_ctx(struct aha +@@ -1453,9 +1284,9 @@ static int ahash_finup_no_ctx(struct aha edesc->src_nents = src_nents; edesc->sec4_sg_bytes = sec4_sg_bytes; @@ -22340,7 +22343,7 @@ Signed-off-by: Yangbo Lu ret = ahash_edesc_add_src(ctx, edesc, req, mapped_nents, 1, buflen, req->nbytes); -@@ -1496,11 +1327,10 @@ static int ahash_update_first(struct aha +@@ -1499,11 +1330,10 @@ static int ahash_update_first(struct aha struct caam_hash_ctx *ctx = crypto_ahash_ctx(ahash); struct caam_hash_state *state = ahash_request_ctx(req); struct device *jrdev = ctx->jrdev; @@ -22356,7 +22359,7 @@ Signed-off-by: Yangbo Lu int to_hash; u32 *desc; int src_nents, mapped_nents; -@@ -1545,7 +1375,6 @@ static int ahash_update_first(struct aha +@@ -1548,7 +1378,6 @@ static int ahash_update_first(struct aha } edesc->src_nents = src_nents; @@ -22364,7 +22367,7 @@ Signed-off-by: Yangbo Lu ret = ahash_edesc_add_src(ctx, edesc, req, mapped_nents, 0, 0, to_hash); -@@ -1582,6 +1411,7 @@ static int ahash_update_first(struct aha +@@ -1585,6 +1414,7 @@ static int ahash_update_first(struct aha state->final = ahash_final_no_ctx; scatterwalk_map_and_copy(next_buf, req->src, 0, req->nbytes, 0); @@ -22372,7 +22375,7 @@ Signed-off-by: Yangbo Lu } #ifdef DEBUG print_hex_dump(KERN_ERR, "next buf@"__stringify(__LINE__)": ", -@@ -1688,7 +1518,6 @@ struct caam_hash_template { +@@ -1691,7 +1521,6 @@ struct caam_hash_template { unsigned int blocksize; struct ahash_alg template_ahash; u32 alg_type; @@ -22380,7 +22383,7 @@ Signed-off-by: Yangbo Lu }; /* ahash descriptors */ -@@ -1714,7 +1543,6 @@ static struct caam_hash_template driver_ +@@ -1717,7 +1546,6 @@ static struct caam_hash_template driver_ }, }, .alg_type = OP_ALG_ALGSEL_SHA1, @@ -22388,7 +22391,7 @@ Signed-off-by: Yangbo Lu }, { .name = "sha224", .driver_name = "sha224-caam", -@@ -1736,7 +1564,6 @@ static struct caam_hash_template driver_ +@@ -1739,7 +1567,6 @@ static struct caam_hash_template driver_ }, }, .alg_type = OP_ALG_ALGSEL_SHA224, @@ -22396,7 +22399,7 @@ Signed-off-by: Yangbo Lu }, { .name = "sha256", .driver_name = "sha256-caam", -@@ -1758,7 +1585,6 @@ static struct caam_hash_template driver_ +@@ -1761,7 +1588,6 @@ static struct caam_hash_template driver_ }, }, .alg_type = OP_ALG_ALGSEL_SHA256, @@ -22404,7 +22407,7 @@ Signed-off-by: Yangbo Lu }, { .name = "sha384", .driver_name = "sha384-caam", -@@ -1780,7 +1606,6 @@ static struct caam_hash_template driver_ +@@ -1783,7 +1609,6 @@ static struct caam_hash_template driver_ }, }, .alg_type = OP_ALG_ALGSEL_SHA384, @@ -22412,7 +22415,7 @@ Signed-off-by: Yangbo Lu }, { .name = "sha512", .driver_name = "sha512-caam", -@@ -1802,7 +1627,6 @@ static struct caam_hash_template driver_ +@@ -1805,7 +1630,6 @@ static struct caam_hash_template driver_ }, }, .alg_type = OP_ALG_ALGSEL_SHA512, @@ -22420,7 +22423,7 @@ Signed-off-by: Yangbo Lu }, { .name = "md5", .driver_name = "md5-caam", -@@ -1824,14 +1648,12 @@ static struct caam_hash_template driver_ +@@ -1827,14 +1651,12 @@ static struct caam_hash_template driver_ }, }, .alg_type = OP_ALG_ALGSEL_MD5, @@ -22435,7 +22438,7 @@ Signed-off-by: Yangbo Lu struct ahash_alg ahash_alg; }; -@@ -1853,6 +1675,7 @@ static int caam_hash_cra_init(struct cry +@@ -1856,6 +1678,7 @@ static int caam_hash_cra_init(struct cry HASH_MSG_LEN + SHA256_DIGEST_SIZE, HASH_MSG_LEN + 64, HASH_MSG_LEN + SHA512_DIGEST_SIZE }; @@ -22443,7 +22446,7 @@ Signed-off-by: Yangbo Lu /* * Get a Job ring from Job Ring driver to ensure in-order -@@ -1863,11 +1686,31 @@ static int caam_hash_cra_init(struct cry +@@ -1866,11 +1689,31 @@ static int caam_hash_cra_init(struct cry pr_err("Job Ring Device allocation for transform failed\n"); return PTR_ERR(ctx->jrdev); } @@ -22478,7 +22481,7 @@ Signed-off-by: Yangbo Lu OP_ALG_ALGSEL_SHIFT]; crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), -@@ -1879,30 +1722,10 @@ static void caam_hash_cra_exit(struct cr +@@ -1882,30 +1725,10 @@ static void caam_hash_cra_exit(struct cr { struct caam_hash_ctx *ctx = crypto_tfm_ctx(tfm); @@ -22513,7 +22516,7 @@ Signed-off-by: Yangbo Lu caam_jr_free(ctx->jrdev); } -@@ -1961,7 +1784,6 @@ caam_hash_alloc(struct caam_hash_templat +@@ -1964,7 +1787,6 @@ caam_hash_alloc(struct caam_hash_templat alg->cra_type = &crypto_ahash_type; t_alg->alg_type = template->alg_type; From 11bfb39e394b80dce5de28d16083ac0f59f4002d Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Wed, 23 Jan 2019 14:10:59 +0100 Subject: [PATCH 362/399] kernel: bump 4.14 to 4.14.95 Refreshed all patches. Removed superseded patches: - 0400-Revert-MIPS-smp-mt-Use-CPU-interrupt-controller-IPI-.patch Add upstream patch to fix build error on ipq806x - 420-enable-CONFIG_MMC_SDHCI_IO_ACCESSORS.patch Compile-tested on: cns3xxx, imx6, ipq806x Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte --- include/kernel-version.mk | 4 +- ...enable-CONFIG_MMC_SDHCI_IO_ACCESSORS.patch | 23 ++ ...mt-Use-CPU-interrupt-controller-IPI-.patch | 271 ------------------ 3 files changed, 25 insertions(+), 273 deletions(-) create mode 100644 target/linux/generic/backport-4.14/420-enable-CONFIG_MMC_SDHCI_IO_ACCESSORS.patch delete mode 100644 target/linux/lantiq/patches-4.14/0400-Revert-MIPS-smp-mt-Use-CPU-interrupt-controller-IPI-.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 6f9cb9c4803..0dd68aa4048 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,10 +3,10 @@ LINUX_RELEASE?=1 LINUX_VERSION-4.9 = .152 -LINUX_VERSION-4.14 = .94 +LINUX_VERSION-4.14 = .95 LINUX_KERNEL_HASH-4.9.152 = 90e47b85c09af47eefafe851685ee731538f640b0650a6a9cfa0234436708e39 -LINUX_KERNEL_HASH-4.14.94 = e728518bb024209acc222e803cdc00d0ea2b1f4ebf28a8ed17a639171a1c23f1 +LINUX_KERNEL_HASH-4.14.95 = ce6729e3fca312520e3cb4f27993852dbb019d94c59c0b35cedab571f9cb58e4 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1))))))) diff --git a/target/linux/generic/backport-4.14/420-enable-CONFIG_MMC_SDHCI_IO_ACCESSORS.patch b/target/linux/generic/backport-4.14/420-enable-CONFIG_MMC_SDHCI_IO_ACCESSORS.patch new file mode 100644 index 00000000000..994ecd7ed41 --- /dev/null +++ b/target/linux/generic/backport-4.14/420-enable-CONFIG_MMC_SDHCI_IO_ACCESSORS.patch @@ -0,0 +1,23 @@ +From: Vijay Viswanath +Date: Wed, 27 Sep 2017 11:04:42 +0530 +Subject: [PATCH v2 3/4] mmc: Kconfig: Enable CONFIG_MMC_SDHCI_IO_ACCESSORS + +Enable CONFIG_MMC_SDHCI_IO_ACCESSORS so that SDHC controller specific +register read and write APIs, if registered, can be used. + +Signed-off-by: Vijay Viswanath +Acked-by: Adrian Hunter +--- + drivers/mmc/host/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mmc/host/Kconfig ++++ b/drivers/mmc/host/Kconfig +@@ -420,6 +420,7 @@ config MMC_SDHCI_MSM + tristate "Qualcomm SDHCI Controller Support" + depends on ARCH_QCOM || (ARM && COMPILE_TEST) + depends on MMC_SDHCI_PLTFM ++ select MMC_SDHCI_IO_ACCESSORS + help + This selects the Secure Digital Host Controller Interface (SDHCI) + support present in Qualcomm SOCs. The controller supports diff --git a/target/linux/lantiq/patches-4.14/0400-Revert-MIPS-smp-mt-Use-CPU-interrupt-controller-IPI-.patch b/target/linux/lantiq/patches-4.14/0400-Revert-MIPS-smp-mt-Use-CPU-interrupt-controller-IPI-.patch deleted file mode 100644 index 7c2deb190e1..00000000000 --- a/target/linux/lantiq/patches-4.14/0400-Revert-MIPS-smp-mt-Use-CPU-interrupt-controller-IPI-.patch +++ /dev/null @@ -1,271 +0,0 @@ -From 8fe9821b478e5c61fef4786b7ec96b6766af196d Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Mon, 8 Jan 2018 23:04:57 +0100 -Subject: [PATCH] Revert "MIPS: smp-mt: Use CPU interrupt controller IPI IRQ - domain support" - -The problem is that the Lantiq IRQ controller gets registered first and -it directly handles the MIPS native SW1/2 and HW0 - HW5 IRQs. It looks -like this controller already registers IRQ 0 - 7 and the generic driver -only gets the following IRQs starting later. - -The upstream discussion can be found at https://www.linux-mips.org/archives/linux-mips/2017-05/msg00059.html - -This reverts kernel commit 1eed40043579 ("MIPS: smp-mt: Use CPU interrupt -controller IPI IRQ domain support"). - -Signed-off-by: Mathias Kresin - ---- - arch/mips/kernel/smp-mt.c | 49 ++++++++++++++++++++++-- - arch/mips/lantiq/irq.c | 52 ++++++++++++++++++++++++++ - arch/mips/mti-malta/malta-int.c | 83 +++++++++++++++++++++++++++++++++++++++-- - 3 files changed, 176 insertions(+), 8 deletions(-) - ---- a/arch/mips/kernel/smp-mt.c -+++ b/arch/mips/kernel/smp-mt.c -@@ -83,8 +83,6 @@ static unsigned int __init smvp_vpe_init - if (tc != 0) - smvp_copy_vpe_config(); - -- cpu_set_vpe_id(&cpu_data[ncpu], tc); -- - return ncpu; - } - -@@ -116,6 +114,49 @@ static void __init smvp_tc_init(unsigned - write_tc_c0_tchalt(TCHALT_H); - } - -+static void vsmp_send_ipi_single(int cpu, unsigned int action) -+{ -+ int i; -+ unsigned long flags; -+ int vpflags; -+ -+#ifdef CONFIG_MIPS_GIC -+ if (gic_present) { -+ mips_smp_send_ipi_single(cpu, action); -+ return; -+ } -+#endif -+ local_irq_save(flags); -+ -+ vpflags = dvpe(); /* can't access the other CPU's registers whilst MVPE enabled */ -+ -+ switch (action) { -+ case SMP_CALL_FUNCTION: -+ i = C_SW1; -+ break; -+ -+ case SMP_RESCHEDULE_YOURSELF: -+ default: -+ i = C_SW0; -+ break; -+ } -+ -+ /* 1:1 mapping of vpe and tc... */ -+ settc(cpu); -+ write_vpe_c0_cause(read_vpe_c0_cause() | i); -+ evpe(vpflags); -+ -+ local_irq_restore(flags); -+} -+ -+static void vsmp_send_ipi_mask(const struct cpumask *mask, unsigned int action) -+{ -+ unsigned int i; -+ -+ for_each_cpu(i, mask) -+ vsmp_send_ipi_single(i, action); -+} -+ - static void vsmp_init_secondary(void) - { - /* This is Malta specific: IPI,performance and timer interrupts */ -@@ -240,8 +281,8 @@ static void __init vsmp_prepare_cpus(uns - } - - const struct plat_smp_ops vsmp_smp_ops = { -- .send_ipi_single = mips_smp_send_ipi_single, -- .send_ipi_mask = mips_smp_send_ipi_mask, -+ .send_ipi_single = vsmp_send_ipi_single, -+ .send_ipi_mask = vsmp_send_ipi_mask, - .init_secondary = vsmp_init_secondary, - .smp_finish = vsmp_smp_finish, - .boot_secondary = vsmp_boot_secondary, ---- a/arch/mips/lantiq/irq.c -+++ b/arch/mips/lantiq/irq.c -@@ -272,6 +272,47 @@ static void ltq_hw_irq_handler(struct ir - ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2); - } - -+#ifdef CONFIG_MIPS_MT_SMP -+void __init arch_init_ipiirq(int irq, struct irqaction *action) -+{ -+ setup_irq(irq, action); -+ irq_set_handler(irq, handle_percpu_irq); -+} -+ -+static void ltq_sw0_irqdispatch(void) -+{ -+ do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ); -+} -+ -+static void ltq_sw1_irqdispatch(void) -+{ -+ do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ); -+} -+static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) -+{ -+ scheduler_ipi(); -+ return IRQ_HANDLED; -+} -+ -+static irqreturn_t ipi_call_interrupt(int irq, void *dev_id) -+{ -+ generic_smp_call_function_interrupt(); -+ return IRQ_HANDLED; -+} -+ -+static struct irqaction irq_resched = { -+ .handler = ipi_resched_interrupt, -+ .flags = IRQF_PERCPU, -+ .name = "IPI_resched" -+}; -+ -+static struct irqaction irq_call = { -+ .handler = ipi_call_interrupt, -+ .flags = IRQF_PERCPU, -+ .name = "IPI_call" -+}; -+#endif -+ - asmlinkage void plat_irq_dispatch(void) - { - unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; -@@ -359,6 +400,17 @@ int __init icu_of_init(struct device_nod - (MAX_IM * INT_NUM_IM_OFFSET) + MIPS_CPU_IRQ_CASCADE, - &irq_domain_ops, 0); - -+#if defined(CONFIG_MIPS_MT_SMP) -+ if (cpu_has_vint) { -+ pr_info("Setting up IPI vectored interrupts\n"); -+ set_vi_handler(MIPS_CPU_IPI_RESCHED_IRQ, ltq_sw0_irqdispatch); -+ set_vi_handler(MIPS_CPU_IPI_CALL_IRQ, ltq_sw1_irqdispatch); -+ } -+ arch_init_ipiirq(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ, -+ &irq_resched); -+ arch_init_ipiirq(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ, &irq_call); -+#endif -+ - #ifndef CONFIG_MIPS_MT_SMP - set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 | - IE_IRQ3 | IE_IRQ4 | IE_IRQ5); ---- a/arch/mips/mti-malta/malta-int.c -+++ b/arch/mips/mti-malta/malta-int.c -@@ -144,6 +144,56 @@ static irqreturn_t corehi_handler(int ir - return IRQ_HANDLED; - } - -+#ifdef CONFIG_MIPS_MT_SMP -+ -+#define MIPS_CPU_IPI_RESCHED_IRQ 0 /* SW int 0 for resched */ -+#define C_RESCHED C_SW0 -+#define MIPS_CPU_IPI_CALL_IRQ 1 /* SW int 1 for resched */ -+#define C_CALL C_SW1 -+static int cpu_ipi_resched_irq, cpu_ipi_call_irq; -+ -+static void ipi_resched_dispatch(void) -+{ -+ do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_RESCHED_IRQ); -+} -+ -+static void ipi_call_dispatch(void) -+{ -+ do_IRQ(MIPS_CPU_IRQ_BASE + MIPS_CPU_IPI_CALL_IRQ); -+} -+ -+static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id) -+{ -+#ifdef CONFIG_MIPS_VPE_APSP_API_CMP -+ if (aprp_hook) -+ aprp_hook(); -+#endif -+ -+ scheduler_ipi(); -+ -+ return IRQ_HANDLED; -+} -+ -+static irqreturn_t ipi_call_interrupt(int irq, void *dev_id) -+{ -+ generic_smp_call_function_interrupt(); -+ -+ return IRQ_HANDLED; -+} -+ -+static struct irqaction irq_resched = { -+ .handler = ipi_resched_interrupt, -+ .flags = IRQF_PERCPU, -+ .name = "IPI_resched" -+}; -+ -+static struct irqaction irq_call = { -+ .handler = ipi_call_interrupt, -+ .flags = IRQF_PERCPU, -+ .name = "IPI_call" -+}; -+#endif /* CONFIG_MIPS_MT_SMP */ -+ - static struct irqaction corehi_irqaction = { - .handler = corehi_handler, - .name = "CoreHi", -@@ -171,6 +221,12 @@ static msc_irqmap_t msc_eicirqmap[] __in - - static int msc_nr_eicirqs __initdata = ARRAY_SIZE(msc_eicirqmap); - -+void __init arch_init_ipiirq(int irq, struct irqaction *action) -+{ -+ setup_irq(irq, action); -+ irq_set_handler(irq, handle_percpu_irq); -+} -+ - void __init arch_init_irq(void) - { - int corehi_irq; -@@ -216,11 +272,30 @@ void __init arch_init_irq(void) - - if (mips_gic_present()) { - corehi_irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_COREHI; -- } else if (cpu_has_veic) { -- set_vi_handler(MSC01E_INT_COREHI, corehi_irqdispatch); -- corehi_irq = MSC01E_INT_BASE + MSC01E_INT_COREHI; - } else { -- corehi_irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_COREHI; -+#if defined(CONFIG_MIPS_MT_SMP) -+ /* set up ipi interrupts */ -+ if (cpu_has_veic) { -+ set_vi_handler (MSC01E_INT_SW0, ipi_resched_dispatch); -+ set_vi_handler (MSC01E_INT_SW1, ipi_call_dispatch); -+ cpu_ipi_resched_irq = MSC01E_INT_SW0; -+ cpu_ipi_call_irq = MSC01E_INT_SW1; -+ } else { -+ cpu_ipi_resched_irq = MIPS_CPU_IRQ_BASE + -+ MIPS_CPU_IPI_RESCHED_IRQ; -+ cpu_ipi_call_irq = MIPS_CPU_IRQ_BASE + -+ MIPS_CPU_IPI_CALL_IRQ; -+ } -+ arch_init_ipiirq(cpu_ipi_resched_irq, &irq_resched); -+ arch_init_ipiirq(cpu_ipi_call_irq, &irq_call); -+#endif -+ if (cpu_has_veic) { -+ set_vi_handler(MSC01E_INT_COREHI, -+ corehi_irqdispatch); -+ corehi_irq = MSC01E_INT_BASE + MSC01E_INT_COREHI; -+ } else { -+ corehi_irq = MIPS_CPU_IRQ_BASE + MIPSCPU_INT_COREHI; -+ } - } - - setup_irq(corehi_irq, &corehi_irqaction); From e5a0b6cde051bd24280e9c3a360e65617bce2416 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 30 Jan 2019 10:12:00 +0100 Subject: [PATCH 363/399] uhttpd: disable concurrent requests by default In order to avoid straining CPU and memory resources on lower end devices, avoid running multiple CGI requests in parallel. Ref: https://forum.openwrt.org/t/high-load-fix-on-openwrt-luci/29006 Signed-off-by: Jo-Philipp Wich (cherry picked from commit c6aa9ff38870a30dbe6da17e4edad6039fe10ddf) --- package/network/services/uhttpd/Makefile | 2 +- package/network/services/uhttpd/files/uhttpd.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index da426d47002..29f1c89f127 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index a3deb9cf043..8b7d84c2066 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -24,7 +24,7 @@ config uhttpd main # If this number is exceeded, further requests are # queued until the number of running requests drops # below the limit again. - option max_requests 3 + option max_requests 1 # Maximum number of concurrent connections. # If this number is exceeded, further TCP connection From 1447924c9581e11c296b1ca8798e1253ee22d2fd Mon Sep 17 00:00:00 2001 From: Stijn Segers Date: Sat, 22 Dec 2018 11:16:17 +0100 Subject: [PATCH 364/399] mbedtls: update to 2.14.1 for 18.06 Updates mbedtls to 2.14.1. This builds on the previous master commit 7849f74117ce83e4cfcd1448a22cc05dbf9b3486. Fixes in 2.13.0: * Fixed a security issue in the X.509 module which could lead to a buffer overread during certificate extensions parsing. * Several bugfixes. * Improvements for better support for DTLS on low-bandwidth, high latency networks with high packet loss. Fixes in 2.14.1: * CVE-2018-19608: Local timing attack on RSA decryption Includes master commit 9e7c4702a1f4e49113d10bc736f50e8a06bdb8ba 'mbedtls: fix compilation on ARM < 6'. Signed-off-by: Daniel Engberg [Update to 2.14.1] Signed-off-by: Hauke Mehrtens [Adapted and squashed for 18.06.1+] Signed-off-by: Stijn Segers Acked-by: Hauke Mehrtens --- package/libs/mbedtls/Makefile | 4 +- package/libs/mbedtls/patches/200-config.patch | 48 +++++++++---------- ...optimized-MULADDC-code-only-on-ARM-6.patch | 27 +++++++++++ .../patches/300-soversion-compatibility.patch | 6 +-- 4 files changed, 56 insertions(+), 29 deletions(-) create mode 100644 package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 659bf59d889..e265cac575a 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mbedtls -PKG_VERSION:=2.12.0 +PKG_VERSION:=2.14.1 PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-gpl.tgz PKG_SOURCE_URL:=https://tls.mbed.org/download/ -PKG_HASH:=8661d19a896a5a7a232ed01ac7f05cf0ec3514798f18076c2c9ef965fbeb5a28 +PKG_HASH:=baa1121952786f5b2c66c52226a8ca0e05126de920d1756266551df677915b7e PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index ab16d4726c8..a9cd62fc399 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -1,6 +1,6 @@ --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h -@@ -548,14 +548,14 @@ +@@ -557,14 +557,14 @@ * * Enable Output Feedback mode (OFB) for symmetric ciphers. */ @@ -17,7 +17,7 @@ /** * \def MBEDTLS_CIPHER_NULL_CIPHER -@@ -645,19 +645,19 @@ +@@ -654,19 +654,19 @@ * * Comment macros to disable the curve and functions for it */ @@ -55,7 +55,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED -@@ -735,7 +735,7 @@ +@@ -768,7 +768,7 @@ * See dhm.h for more details. * */ @@ -64,7 +64,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED -@@ -755,7 +755,7 @@ +@@ -788,7 +788,7 @@ * MBEDTLS_TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_ECDHE_PSK_WITH_RC4_128_SHA */ @@ -73,7 +73,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED -@@ -780,7 +780,7 @@ +@@ -813,7 +813,7 @@ * MBEDTLS_TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA * MBEDTLS_TLS_RSA_PSK_WITH_RC4_128_SHA */ @@ -82,7 +82,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_RSA_ENABLED -@@ -914,7 +914,7 @@ +@@ -947,7 +947,7 @@ * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -91,7 +91,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED -@@ -938,7 +938,7 @@ +@@ -971,7 +971,7 @@ * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 */ @@ -100,7 +100,7 @@ /** * \def MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED -@@ -1042,7 +1042,7 @@ +@@ -1075,7 +1075,7 @@ * This option is only useful if both MBEDTLS_SHA256_C and * MBEDTLS_SHA512_C are defined. Otherwise the available hash module is used. */ @@ -109,7 +109,7 @@ /** * \def MBEDTLS_ENTROPY_NV_SEED -@@ -1137,14 +1137,14 @@ +@@ -1170,14 +1170,14 @@ * Uncomment this macro to disable the use of CRT in RSA. * */ @@ -135,7 +135,7 @@ /** * \def MBEDTLS_SSL_ALL_ALERT_MESSAGES -@@ -1298,7 +1298,7 @@ +@@ -1331,7 +1331,7 @@ * configuration of this extension). * */ @@ -144,7 +144,7 @@ /** * \def MBEDTLS_SSL_SRV_SUPPORT_SSLV2_CLIENT_HELLO -@@ -1473,7 +1473,7 @@ +@@ -1506,7 +1506,7 @@ * * Comment this macro to disable support for SSL session tickets */ @@ -153,7 +153,7 @@ /** * \def MBEDTLS_SSL_EXPORT_KEYS -@@ -1503,7 +1503,7 @@ +@@ -1536,7 +1536,7 @@ * * Comment this macro to disable support for truncated HMAC in SSL */ @@ -162,7 +162,7 @@ /** * \def MBEDTLS_SSL_TRUNCATED_HMAC_COMPAT -@@ -1562,7 +1562,7 @@ +@@ -1595,7 +1595,7 @@ * * Comment this to disable run-time checking and save ROM space */ @@ -171,7 +171,7 @@ /** * \def MBEDTLS_X509_ALLOW_EXTENSIONS_NON_V3 -@@ -1892,7 +1892,7 @@ +@@ -1925,7 +1925,7 @@ * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 * MBEDTLS_TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 */ @@ -180,7 +180,7 @@ /** * \def MBEDTLS_ARIA_C -@@ -1958,7 +1958,7 @@ +@@ -1991,7 +1991,7 @@ * This module enables the AES-CCM ciphersuites, if other requisites are * enabled as well. */ @@ -189,7 +189,7 @@ /** * \def MBEDTLS_CERTS_C -@@ -1970,7 +1970,7 @@ +@@ -2003,7 +2003,7 @@ * * This module is used for testing (ssl_client/server). */ @@ -216,7 +216,7 @@ /** * \def MBEDTLS_CIPHER_C -@@ -2043,7 +2043,7 @@ +@@ -2078,7 +2078,7 @@ * * This module provides debugging functions. */ @@ -225,7 +225,7 @@ /** * \def MBEDTLS_DES_C -@@ -2072,7 +2072,7 @@ +@@ -2107,7 +2107,7 @@ * \warning DES is considered a weak cipher and its use constitutes a * security risk. We recommend considering stronger ciphers instead. */ @@ -234,7 +234,7 @@ /** * \def MBEDTLS_DHM_C -@@ -2235,7 +2235,7 @@ +@@ -2270,7 +2270,7 @@ * This module adds support for the Hashed Message Authentication Code * (HMAC)-based key derivation function (HKDF). */ @@ -252,7 +252,7 @@ /** * \def MBEDTLS_NIST_KW_C -@@ -2545,7 +2545,7 @@ +@@ -2580,7 +2580,7 @@ * * This module enables abstraction of common (libc) functions. */ @@ -270,7 +270,7 @@ /** * \def MBEDTLS_RIPEMD160_C -@@ -2566,7 +2566,7 @@ +@@ -2601,7 +2601,7 @@ * Caller: library/md.c * */ @@ -279,7 +279,7 @@ /** * \def MBEDTLS_RSA_C -@@ -2673,7 +2673,7 @@ +@@ -2708,7 +2708,7 @@ * * Requires: MBEDTLS_CIPHER_C */ @@ -288,7 +288,7 @@ /** * \def MBEDTLS_SSL_CLI_C -@@ -2773,7 +2773,7 @@ +@@ -2808,7 +2808,7 @@ * * This module provides run-time version information. */ @@ -297,7 +297,7 @@ /** * \def MBEDTLS_X509_USE_C -@@ -2883,7 +2883,7 @@ +@@ -2918,7 +2918,7 @@ * Module: library/xtea.c * Caller: */ diff --git a/package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch b/package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch new file mode 100644 index 00000000000..b6c60f0019d --- /dev/null +++ b/package/libs/mbedtls/patches/300-bn_mul.h-Use-optimized-MULADDC-code-only-on-ARM-6.patch @@ -0,0 +1,27 @@ +From 7aff5a70f3580426865b6c86437a3e47546d13f7 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 16 Dec 2018 13:02:49 +0100 +Subject: [PATCH] bn_mul.h: Use optimized MULADDC code only on ARM >= 6 + +The optimized code uses umaal which was only introduced with ARMv6 and +is not available on older versions. +This broke compilation with arm926ej-s CPU for me. + +Fixes: 16b1bd89326 ("bn_mul.h: add ARM DSP optimized MULADDC code") +Signed-off-by: Hauke Mehrtens +--- + include/mbedtls/bn_mul.h | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/include/mbedtls/bn_mul.h ++++ b/include/mbedtls/bn_mul.h +@@ -638,7 +638,8 @@ + "r6", "r7", "r8", "r9", "cc" \ + ); + +-#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) ++#elif defined (__ARM_FEATURE_DSP) && (__ARM_FEATURE_DSP == 1) && \ ++ __TARGET_ARCH_ARM >= 6 + + #define MULADDC_INIT \ + asm( diff --git a/package/libs/mbedtls/patches/300-soversion-compatibility.patch b/package/libs/mbedtls/patches/300-soversion-compatibility.patch index a352b449f1e..6445f5e5e03 100644 --- a/package/libs/mbedtls/patches/300-soversion-compatibility.patch +++ b/package/libs/mbedtls/patches/300-soversion-compatibility.patch @@ -4,7 +4,7 @@ if(USE_SHARED_MBEDTLS_LIBRARY) add_library(mbedcrypto SHARED ${src_crypto}) -- set_target_properties(mbedcrypto PROPERTIES VERSION 2.12.0 SOVERSION 3) +- set_target_properties(mbedcrypto PROPERTIES VERSION 2.14.1 SOVERSION 3) + set_target_properties(mbedcrypto PROPERTIES VERSION 2.12.0 SOVERSION 1) target_link_libraries(mbedcrypto ${libs}) @@ -13,7 +13,7 @@ target_link_libraries(mbedx509 ${libs} mbedcrypto) add_library(mbedtls SHARED ${src_tls}) -- set_target_properties(mbedtls PROPERTIES VERSION 2.12.0 SOVERSION 11) +- set_target_properties(mbedtls PROPERTIES VERSION 2.14.1 SOVERSION 12) + set_target_properties(mbedtls PROPERTIES VERSION 2.12.0 SOVERSION 10) target_link_libraries(mbedtls ${libs} mbedx509) @@ -24,7 +24,7 @@ endif endif --SOEXT_TLS=so.11 +-SOEXT_TLS=so.12 +SOEXT_TLS=so.10 SOEXT_X509=so.0 -SOEXT_CRYPTO=so.3 From 8c105c62e47160fbf81906cf19a2f6927c74fd27 Mon Sep 17 00:00:00 2001 From: Daniel Engberg Date: Mon, 24 Dec 2018 10:35:44 +0100 Subject: [PATCH 365/399] wireguard: Update to snapshot 0.0.20181218 Update WireGuard to 0.0.20181218 Signed-off-by: Daniel Engberg (cherry picked from commit 9a37c95431b5401c309b7731920daa964842bdee) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index a1930740183..f752d3b83aa 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20181119 +PKG_VERSION:=0.0.20181218 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=7d47f7996dd291069de4efb3097c42f769f60dc3ac6f850a4d5705f321e4406b +PKG_HASH:=2e9f86acefa49dbfb7fa6f5e10d543f1885a2d5460cd5e102696901107675735 PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 4f2199f5285c9bd60f83f653cf580a140b50ba4b Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 23 Jan 2019 14:49:44 +0100 Subject: [PATCH 366/399] wireguard: bump to 0.0.20190123 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * tools: curve25519: handle unaligned loads/stores safely This should fix sporadic crashes with `wg pubkey` on certain architectures. * netlink: auth socket changes against namespace of socket In WireGuard, the underlying UDP socket lives in the namespace where the interface was created and doesn't move if the interface is moved. This allows one to create the interface in some privileged place that has Internet access, and then move it into a container namespace that only has the WireGuard interface for egress. Consider the following situation: 1. Interface created in namespace A. Socket therefore lives in namespace A. 2. Interface moved to namespace B. Socket remains in namespace A. 3. Namespace B now has access to the interface and changes the listen port and/or fwmark of socket. Change is reflected in namespace A. This behavior is arguably _fine_ and perhaps even expected or acceptable. But there's also an argument to be made that B should have A's cred to do so. So, this patch adds a simple ns_capable check. * ratelimiter: build tests with !IPV6 Should reenable building in debug mode for systems without IPv6. * noise: replace getnstimeofday64 with ktime_get_real_ts64 * ratelimiter: totalram_pages is now a function * qemu: enable FP on MIPS Linux 5.0 support. * keygen-html: bring back pure javascript implementation Benoît Viguier has proofs that values will stay well within 2^53. We also have an improved carry function that's much simpler. Probably more constant time than emscripten's 64-bit integers. * contrib: introduce simple highlighter library This is the highlighter library being used in: - https://twitter.com/EdgeSecurity/status/1085294681003454465 - https://twitter.com/EdgeSecurity/status/1081953278248796165 It's included here as a contrib example, so that others can paste it into their own GUI clients for having the same strictly validating highlighting. * netlink: use __kernel_timespec for handshake time This readies us for Y2038. See https://lwn.net/Articles/776435/ for more info. Signed-off-by: Jason A. Donenfeld (cherry picked from commit bbcd0634f8c9769a336386f8df471231d24a27cc) --- package/network/services/wireguard/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile index f752d3b83aa..2e9f17e0e66 100644 --- a/package/network/services/wireguard/Makefile +++ b/package/network/services/wireguard/Makefile @@ -11,12 +11,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=wireguard -PKG_VERSION:=0.0.20181218 +PKG_VERSION:=0.0.20190123 PKG_RELEASE:=1 PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ -PKG_HASH:=2e9f86acefa49dbfb7fa6f5e10d543f1885a2d5460cd5e102696901107675735 +PKG_HASH:=edd13c7631af169e3838621b1a1bff3ef73cf7bc778eec2bd55f7c1089ffdf9b PKG_LICENSE:=GPL-2.0 Apache-2.0 PKG_LICENSE_FILES:=COPYING From 80ed6ebc56b4e982451dae7d40f14943a2f28a9c Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 30 Jan 2019 11:42:27 +0100 Subject: [PATCH 367/399] dnsmasq: backport upstream static lease fix Backport and rebase upstream fix 18eac67 ("Fix entries in /etc/hosts disabling static leases.") Signed-off-by: Jo-Philipp Wich --- package/network/services/dnsmasq/Makefile | 2 +- ...in-etc-hosts-disabling-static-leases.patch | 54 +++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 5e76579e4b0..f48847b9a30 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.80 -PKG_RELEASE:=1 +PKG_RELEASE:=1.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch b/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch new file mode 100644 index 00000000000..d641e4fbf11 --- /dev/null +++ b/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch @@ -0,0 +1,54 @@ +From 18eac67c0a15b673c8d27002c248651b308093e4 Mon Sep 17 00:00:00 2001 +From: Steven Siloti +Date: Sun, 13 Jan 2019 22:56:36 +0000 +Subject: [PATCH 30/30] Fix entries in /etc/hosts disabling static leases. + +It is possible for a config entry to have one address family specified by a +dhcp-host directive and the other added from /etc/hosts. This is especially +common on OpenWrt because it uses odhcpd for DHCPv6 and IPv6 leases are +imported into dnsmasq via a hosts file. + +To handle this case there need to be separate *_HOSTS flags for IPv4 and IPv6. +Otherwise when the hosts file is reloaded it will clear the CONFIG_ADDR(6) flag +which was set by the dhcp-host directive. + +Signed-off-by: Kevin Darbyshire-Bryant +--- + src/dhcp-common.c | 8 ++++++-- + src/dnsmasq.h | 1 + + 2 files changed, 7 insertions(+), 2 deletions(-) + +--- a/src/dhcp-common.c ++++ b/src/dhcp-common.c +@@ -372,7 +372,11 @@ void dhcp_update_configs(struct dhcp_con + + for (config = configs; config; config = config->next) + if (config->flags & CONFIG_ADDR_HOSTS) +- config->flags &= ~(CONFIG_ADDR | CONFIG_ADDR6 | CONFIG_ADDR_HOSTS); ++ config->flags &= ~(CONFIG_ADDR | CONFIG_ADDR_HOSTS); ++#ifdef HAVE_DHCP6 ++ if (config->flags & CONFIG_ADDR6_HOSTS) ++ config->flags &= ~(CONFIG_ADDR6 | CONFIG_ADDR6_HOSTS); ++#endif + + #ifdef HAVE_DHCP6 + again: +@@ -421,7 +425,7 @@ void dhcp_update_configs(struct dhcp_con + (!(conf_tmp = config_find_by_address6(configs, &crec->addr.addr.addr.addr6, 128, 0)) || conf_tmp == config)) + { + memcpy(&config->addr6, &crec->addr.addr.addr.addr6, IN6ADDRSZ); +- config->flags |= CONFIG_ADDR6 | CONFIG_ADDR_HOSTS; ++ config->flags |= CONFIG_ADDR6 | CONFIG_ADDR6_HOSTS; + continue; + } + #endif +--- a/src/dnsmasq.h ++++ b/src/dnsmasq.h +@@ -796,6 +796,7 @@ struct dhcp_config { + #define CONFIG_BANK 2048 /* from dhcp hosts file */ + #define CONFIG_ADDR6 4096 + #define CONFIG_WILDCARD 8192 ++#define CONFIG_ADDR6_HOSTS 16384 /* address added by from /etc/hosts */ + + struct dhcp_opt { + int opt, len, flags; From 39c3b5139ffe752abdbc0495739a19cccac088d7 Mon Sep 17 00:00:00 2001 From: Sven Roederer Date: Mon, 28 Jan 2019 20:11:50 +0100 Subject: [PATCH 368/399] openssl: bump to 1.0.2q This fixes the following security problems: * CVE-2018-5407: Microarchitecture timing vulnerability in ECC scalar multiplication * CVE-2018-0734: Timing vulnerability in DSA signature generation * Resolve a compatibility issue in EC_GROUP handling with the FIPS Object Module Signed-off-by: Sven Roederer (cherry picked from commit 989060478ae270885727d91c25b9b52b0f33743c) --- package/libs/openssl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index b64a51d6d31..a4781e9eeea 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.0.2 -PKG_BUGFIX:=p +PKG_BUGFIX:=q PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) PKG_RELEASE:=1 PKG_USE_MIPS16:=0 @@ -24,7 +24,7 @@ PKG_SOURCE_URL:= \ http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ -PKG_HASH:=50a98e07b1a89eb8f6a99477f262df71c6fa7bef77df4dc83025a2845c827d00 +PKG_HASH:=5744cfcbcec2b1b48629f7354203bc1e5e9b5466998bbccc5b5fcde3b18eb684 PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE From 2c7a1ccaeac6bb4a197e12257f166022d6757fb3 Mon Sep 17 00:00:00 2001 From: Daniel Halmschlager Date: Tue, 4 Dec 2018 20:40:10 +0100 Subject: [PATCH 369/399] ar71xx: Add usb drivers in Archer C7 v4/v5 images This commit adds the default usb packages - kmod-usb-core - kmod-usb2 - kmod-usb-ledtrig-usbport for Archer C7 v4 and v5. (The C7 v5 configuration is based on the v4, therefore the change for v4 also applies for v5.) Signed-off-by: Daniel Halmschlager (backported from commit 99e212171abf44d6e0f7e7ba50a229ad7b3f3a34) --- target/linux/ar71xx/image/generic-tp-link.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ar71xx/image/generic-tp-link.mk b/target/linux/ar71xx/image/generic-tp-link.mk index 502c88b1bae..338b2db2d65 100644 --- a/target/linux/ar71xx/image/generic-tp-link.mk +++ b/target/linux/ar71xx/image/generic-tp-link.mk @@ -131,7 +131,7 @@ TARGET_DEVICES += tl-wdr7500-v3 define Device/archer-c7-v4 $(Device/archer-cxx) DEVICE_TITLE := TP-LINK Archer C7 v4 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x BOARDNAME := ARCHER-C7-V4 TPLINK_BOARD_ID := ARCHER-C7-V4 IMAGE_SIZE := 15104k From e6c2f3feb1e5bf30f25b333f91ec2be6f5b7102d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Santamar=C3=ADa=20Rogado?= Date: Fri, 18 Jan 2019 22:28:41 +0100 Subject: [PATCH 370/399] ar71xx: use correct wan mac address for the TP-Link Archer C7 v4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The correct MAC address for this device is lan_mac +1, there is no need to set lan_mac so use base_mac variable instead lan_mac. Based on this PR for ath79: https://github.com/openwrt/openwrt/pull/1726 Signed-off-by: David Santamaría Rogado [fix alphabetical ordering, reword subject] Signed-off-by: Jo-Philipp Wich (cherry picked from commit 4bcf58135210736f2a1603609d2a76b3e188e2ad) --- .../ar71xx/base-files/etc/board.d/02_network | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index b0076366bc5..6f5f07e1c5d 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -576,6 +576,10 @@ ar71xx_setup_macs() local wan_mac="" case $board in + archer-c7-v4) + base_mac=$(mtd_get_mac_binary config 8) + wan_mac=$(macaddr_add "$base_mac" 1) + ;; dgl-5500-a1|\ dir-825-c1) wan_mac=$(mtd_get_mac_ascii nvram "wan_mac") @@ -587,6 +591,13 @@ ar71xx_setup_macs() lan_mac=$(mtd_get_mac_binary caldata 0) wan_mac=$(mtd_get_mac_binary caldata 6) ;; + dir-869-a1|\ + mynet-n750) + wan_mac=$(mtd_get_mac_ascii devdata "wanmac") + ;; + esr900) + wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr") + ;; fritz300e) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) ;; @@ -595,13 +606,6 @@ ar71xx_setup_macs() lan_mac=$(mtd_get_mac_binary product-info 8) wan_mac=$(macaddr_add "$lan_mac" 1) ;; - esr900) - wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr") - ;; - dir-869-a1|\ - mynet-n750) - wan_mac=$(mtd_get_mac_ascii devdata "wanmac") - ;; wlr8100) lan_mac=$(mtd_get_mac_ascii u-boot-env "ethaddr") wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr") From b98b55a64fb633d7901f9db5529e52e3175300e9 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 13 Dec 2018 01:33:36 +0800 Subject: [PATCH 371/399] build: fix STAGING_DIR cleaning for packages This fixes two issues with cleaning package files from STAGING_DIR: * CleanStaging currently can only remove files and not directories. This changes CleanStaging to use clean-package.sh, which does remove directories. * Because of the way directories are ordered in the staging files list, clean-package.sh currently tries (and fails) to remove parent directories before removing subdirectories. This changes clean-package.sh to process the staging files list in reverse, so that subdirectories are removed first. Signed-off-by: Jeffery To (cherry picked from commit a1170936798e519776de605d6986ccb72f04cb06) --- include/package.mk | 7 ++++--- scripts/clean-package.sh | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/package.mk b/include/package.mk index a03db11119c..569ad647d6d 100644 --- a/include/package.mk +++ b/include/package.mk @@ -81,9 +81,10 @@ STAGING_FILES_LIST:=$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),).lis define CleanStaging rm -f $(STAMP_INSTALLED) @-(\ - cd "$(STAGING_DIR)"; \ - if [ -f packages/$(STAGING_FILES_LIST) ]; then \ - cat packages/$(STAGING_FILES_LIST) | xargs -r rm -f 2>/dev/null; \ + if [ -f $(STAGING_DIR)/packages/$(STAGING_FILES_LIST) ]; then \ + $(SCRIPT_DIR)/clean-package.sh \ + "$(STAGING_DIR)/packages/$(STAGING_FILES_LIST)" \ + "$(STAGING_DIR)"; \ fi; \ ) endef diff --git a/scripts/clean-package.sh b/scripts/clean-package.sh index d1a257889d9..e580566a528 100755 --- a/scripts/clean-package.sh +++ b/scripts/clean-package.sh @@ -14,7 +14,7 @@ cat "$1" | ( [ -f "$entry" ] && rm -f $entry done ) -cat "$1" | ( +sort -r "$1" | ( cd "$2" while read entry; do [ -n "$entry" ] || break From d4178c8f478c0e96ff22197b5174869721def831 Mon Sep 17 00:00:00 2001 From: Thorsten Glaser Date: Mon, 22 Oct 2018 19:28:50 +0200 Subject: [PATCH 372/399] build: fix umask detection bashism the leading 0 is optional and not emitted by some shells Signed-off-by: Thorsten Glaser (cherry picked from commit da5bee5345ce8f66eb36b8993b87b684e5cce614) --- include/prereq-build.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index a416a2d2320..f7da916f648 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -24,7 +24,7 @@ $(eval $(call TestHostCommand,case-sensitive-fs, \ $(eval $(call TestHostCommand,proper-umask, \ Please build with umask 022 - other values produce broken packages, \ - umask | grep -xE 00[012][012])) + umask | grep -xE 0?0[012][012])) $(eval $(call SetupHostCommand,gcc, \ Please install the GNU C Compiler (gcc) 4.8 or later, \ From e6162b212796838660719be072378818997bb9f3 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 30 Jan 2019 13:01:24 +0100 Subject: [PATCH 373/399] dnsmasq: backport missing braces fix Fold upstream fix d2d4990 ("Fix missing braces in 8eac67c0a15b673c8d27002c248651b308093e4") into the already existing static lease fix patch. Signed-off-by: Jo-Philipp Wich --- package/network/services/dnsmasq/Makefile | 2 +- ...-Fix-entries-in-etc-hosts-disabling-static-leases.patch | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index f48847b9a30..e89ad19f5c5 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.80 -PKG_RELEASE:=1.1 +PKG_RELEASE:=1.2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq diff --git a/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch b/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch index d641e4fbf11..d74227fe7ca 100644 --- a/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch +++ b/package/network/services/dnsmasq/patches/001-Fix-entries-in-etc-hosts-disabling-static-leases.patch @@ -20,9 +20,11 @@ Signed-off-by: Kevin Darbyshire-Bryant --- a/src/dhcp-common.c +++ b/src/dhcp-common.c -@@ -372,7 +372,11 @@ void dhcp_update_configs(struct dhcp_con +@@ -371,8 +371,14 @@ void dhcp_update_configs(struct dhcp_con + int prot = AF_INET; for (config = configs; config; config = config->next) ++ { if (config->flags & CONFIG_ADDR_HOSTS) - config->flags &= ~(CONFIG_ADDR | CONFIG_ADDR6 | CONFIG_ADDR_HOSTS); + config->flags &= ~(CONFIG_ADDR | CONFIG_ADDR_HOSTS); @@ -30,10 +32,11 @@ Signed-off-by: Kevin Darbyshire-Bryant + if (config->flags & CONFIG_ADDR6_HOSTS) + config->flags &= ~(CONFIG_ADDR6 | CONFIG_ADDR6_HOSTS); +#endif ++ } #ifdef HAVE_DHCP6 again: -@@ -421,7 +425,7 @@ void dhcp_update_configs(struct dhcp_con +@@ -421,7 +427,7 @@ void dhcp_update_configs(struct dhcp_con (!(conf_tmp = config_find_by_address6(configs, &crec->addr.addr.addr.addr6, 128, 0)) || conf_tmp == config)) { memcpy(&config->addr6, &crec->addr.addr.addr.addr6, IN6ADDRSZ); From cddd7b4c778a68194319630274b1849e8f788a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Kelleter?= Date: Mon, 8 Oct 2018 15:30:00 +0200 Subject: [PATCH 374/399] base-files: config_get: prevent filename globbing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When config_get is called as "config_get section option" the option is unexpectedly globbed by the shell which differs from the way options are read to a variable with "config_get variable section option". Add another layer of double quotes to fix it. Signed-off-by: Günther Kelleter (backported from commit c3389ab135400fba0cb710d9c6c63df2f563d9d9) --- package/base-files/Makefile | 2 +- package/base-files/files/lib/functions.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 9134f118e0d..904f4af073b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=194.1 +PKG_RELEASE:=194.2 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 50a7b408698..edce75e8ff8 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -92,7 +92,7 @@ config_unset() { # config_get