Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-02-26 10:23:58 +08:00
commit f5af73bcef
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
48 changed files with 571 additions and 748 deletions

View File

@ -90,6 +90,13 @@ network_get_prefix6() {
__network_ifstatus "$1" "$2" "['ipv6-prefix'][0]['address','mask']" "/"
}
# determine first IPv6 prefix assignment of given logical interface
# 1: destination variable
# 2: interface
network_get_prefix_assignment6() {
__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][0]['address','mask']" "/"
}
# determine all IPv4 addresses of given logical interface
# 1: destination variable
# 2: interface
@ -187,6 +194,13 @@ network_get_prefixes6() {
__network_ifstatus "$1" "$2" "['ipv6-prefix'][*]['address','mask']" "/ "
}
# determine all IPv6 prefix assignments of given logical interface
# 1: destination variable
# 2: interface
network_get_prefix_assignments6() {
__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][*]['address','mask']" "/ "
}
# determine IPv4 gateway of given logical interface
# 1: destination variable
# 2: interface

View File

@ -6,12 +6,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=libcap
PKG_VERSION:=2.66
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=2.67
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
PKG_HASH:=15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2
PKG_HASH:=ce9b22fdc271beb6dae7543da5f74cf24cb82e6848cfd088a5a069dec5ea5198
PKG_MAINTAINER:=Paul Wassi <p.wassi@gmx.at>
PKG_LICENSE:=GPL-2.0-only

View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=ncurses
PKG_CPE_ID:=cpe:/a:gnu:ncurses
PKG_VERSION:=6.4
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
@ -123,6 +123,7 @@ ifneq ($(HOST_OS),FreeBSD)
)
for file in \
a/ansi \
a/alacritty \
d/dumb \
l/linux \
r/rxvt \

View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ustream-ssl
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
PKG_SOURCE_DATE:=2022-12-08
PKG_SOURCE_VERSION:=9217ab46536353c7c792951b57163063f5ec7a3b
PKG_MIRROR_HASH:=cd4dc6a6c18290348b1f8b1c01df3320e4954dc46d714c797bef066f7a91248d
PKG_SOURCE_DATE:=2023-02-25
PKG_SOURCE_VERSION:=498f6e268d4d2b0ad33b430f4ba1abe397d31496
PKG_MIRROR_HASH:=a201d065dd613e30886c9f13a0851cec79538192cfe591b6f8ecd88724d55fb1
CMAKE_INSTALL:=1
PKG_LICENSE:=ISC

View File

@ -1,13 +1,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=netifd
PKG_RELEASE:=2
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
PKG_SOURCE_DATE:=2022-12-30
PKG_SOURCE_VERSION:=81c1fbcba2f27f687c2a471f341502d47679f401
PKG_MIRROR_HASH:=41d19f2804759aa42708942e27116bec78b169abee639d97c2ec7f0f62fa7739
PKG_SOURCE_DATE:=2023-02-25
PKG_SOURCE_VERSION:=463a1207f0766417866e2c28316e58a96f84370b
PKG_MIRROR_HASH:=1d407847282637f6e069b482368f2f8fc0126e66f3b37e4258e1fc1d19dd1ce5
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_UPSTREAM_VERSION:=2.88
PKG_UPSTREAM_VERSION:=2.89
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
PKG_RELEASE:=$(AUTORELEASE)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
PKG_HASH:=23544deda10340c053bea6f15a93fed6ea7f5aaa85316bfc671ffa6d22fbc1b3
PKG_HASH:=02bd230346cf0b9d5909f5e151df168b2707103785eb616b56685855adebb609
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View File

@ -26,7 +26,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1247,7 +1247,7 @@ extern struct daemon {
@@ -1248,7 +1248,7 @@ extern struct daemon {
int inotifyfd;
#endif
#if defined(HAVE_LINUX_NETWORK)
@ -35,7 +35,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
#elif defined(HAVE_BSD_NETWORK)
int dhcp_raw_fd, dhcp_icmp_fd, routefd;
#endif
@@ -1452,9 +1452,6 @@ int read_write(int fd, unsigned char *pa
@@ -1453,9 +1453,6 @@ int read_write(int fd, unsigned char *pa
void close_fds(long max_fd, int spare1, int spare2, int spare3);
int wildcard_match(const char* wildcard, const char* match);
int wildcard_matchn(const char* wildcard, const char* match, int num);

View File

@ -1,6 +1,6 @@
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1630,14 +1630,26 @@ void emit_dbus_signal(int action, struct
@@ -1631,14 +1631,26 @@ void emit_dbus_signal(int action, struct
/* ubus.c */
#ifdef HAVE_UBUS

View File

@ -1,7 +1,7 @@
--- a/src/dnsmasq.h
+++ b/src/dnsmasq.h
@@ -1141,7 +1141,7 @@ extern struct daemon {
int max_logs; /* queue limit */
@@ -1156,7 +1156,7 @@ extern struct daemon {
int randport_limit; /* Maximum number of source ports for query. */
int cachesize, ftabsize;
int port, query_port, min_port, max_port;
- unsigned long local_ttl, neg_ttl, max_ttl, min_cache_ttl, max_cache_ttl, auth_ttl, dhcp_ttl, use_dhcp_ttl;
@ -19,7 +19,7 @@
#define LOPT_MAXTTL 297
#define LOPT_NO_REBIND 298
#define LOPT_LOC_REBND 299
@@ -302,6 +303,7 @@ static const struct myoption opts[] =
@@ -308,6 +309,7 @@ static const struct myoption opts[] =
{ "dhcp-name-match", 1, 0, LOPT_NAME_MATCH },
{ "dhcp-broadcast", 2, 0, LOPT_BROADCAST },
{ "neg-ttl", 1, 0, LOPT_NEGTTL },
@ -27,7 +27,7 @@
{ "max-ttl", 1, 0, LOPT_MAXTTL },
{ "min-cache-ttl", 1, 0, LOPT_MINCTTL },
{ "max-cache-ttl", 1, 0, LOPT_MAXCTTL },
@@ -440,6 +442,7 @@ static struct {
@@ -452,6 +454,7 @@ static struct {
{ 't', ARG_ONE, "<host_name>", gettext_noop("Specify default target in an MX record."), NULL },
{ 'T', ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for replies from /etc/hosts."), NULL },
{ LOPT_NEGTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for negative caching."), NULL },
@ -35,7 +35,7 @@
{ LOPT_MAXTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live in seconds for maximum TTL to send to clients."), NULL },
{ LOPT_MAXCTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live ceiling for cache."), NULL },
{ LOPT_MINCTTL, ARG_ONE, "<integer>", gettext_noop("Specify time-to-live floor for cache."), NULL },
@@ -3182,6 +3185,7 @@ static int one_opt(int option, char *arg
@@ -3404,6 +3407,7 @@ static int one_opt(int option, char *arg
case 'T': /* --local-ttl */
case LOPT_NEGTTL: /* --neg-ttl */
@ -43,7 +43,7 @@
case LOPT_MAXTTL: /* --max-ttl */
case LOPT_MINCTTL: /* --min-cache-ttl */
case LOPT_MAXCTTL: /* --max-cache-ttl */
@@ -3193,6 +3197,8 @@ static int one_opt(int option, char *arg
@@ -3415,6 +3419,8 @@ static int one_opt(int option, char *arg
ret_err(gen_err);
else if (option == LOPT_NEGTTL)
daemon->neg_ttl = (unsigned long)ttl;
@ -54,15 +54,15 @@
else if (option == LOPT_MINCTTL)
--- a/src/rfc1035.c
+++ b/src/rfc1035.c
@@ -681,6 +681,7 @@ int extract_addresses(struct dns_header
@@ -683,6 +683,7 @@ int extract_addresses(struct dns_header
for (j = 0; j < ntohs(header->ancount); j++)
{
int secflag = 0;
+ unsigned long mttl = 0;
if (!(res = extract_name(header, qlen, &p1, name, 0, 10)))
return 0; /* bad packet */
return 2; /* bad packet */
@@ -689,6 +690,14 @@ int extract_addresses(struct dns_header
@@ -691,6 +692,14 @@ int extract_addresses(struct dns_header
GETLONG(attl, p1);
if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign)
@ -77,15 +77,15 @@
{
(p1) -= 4;
PUTLONG(daemon->max_ttl, p1);
@@ -796,6 +805,7 @@ int extract_addresses(struct dns_header
@@ -798,6 +807,7 @@ int extract_addresses(struct dns_header
for (j = 0; j < ntohs(header->ancount); j++)
{
int secflag = 0;
+ unsigned long mttl = 0;
if (!(res = extract_name(header, qlen, &p1, name, 0, 10)))
return 0; /* bad packet */
@@ -804,6 +814,14 @@ int extract_addresses(struct dns_header
return 2; /* bad packet */
@@ -806,6 +816,14 @@ int extract_addresses(struct dns_header
GETSHORT(aqclass, p1);
GETLONG(attl, p1);
if ((daemon->max_ttl != 0) && (attl > daemon->max_ttl) && !is_sign)

View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ethtool
PKG_VERSION:=6.1
PKG_VERSION:=6.2
PKG_RELEASE:=1
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
PKG_HASH:=c41fc881ffa5a40432d2dd829eb44c64a49dee482e716baacf9262c64daa8f90
PKG_HASH:=86df0114064d4d73f6bf72bf03e85c33964a519ee0c1d1ba65005ad2d0e570e1
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

View File

@ -1,465 +0,0 @@
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool v2 1/3] uapi: Bring in if.h
Date: Sat, 14 Jan 2023 08:34:09 -0800
Bring in if.h from commit eec517cdb481 ("net: Add IF_OPER_TESTING") as
well as uapi/linux/hdlc/ioctl.h. Ensure that we define all of the
necessary guards to provide updated definitions of ifmap, ifreq and
IFNAMSIZ. This resolves build issues with kernel headers < 4.11 which
lacked 2618be7dccf8739b89e1906b64bd8d551af351e6 ("uapi: fix linux/if.h
userspace compilation errors").
Fixes: 1fa60003a8b8 ("misc: header includes cleanup")
Reported-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
Makefile.am | 6 +-
internal.h | 7 +-
uapi/linux/hdlc/ioctl.h | 94 +++++++++++++
uapi/linux/if.h | 296 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 397 insertions(+), 6 deletions(-)
create mode 100644 uapi/linux/hdlc/ioctl.h
create mode 100644 uapi/linux/if.h
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,8 @@ EXTRA_DIST = LICENSE ethtool.8 ethtool.s
sbin_PROGRAMS = ethtool
ethtool_SOURCES = ethtool.c uapi/linux/ethtool.h internal.h \
- uapi/linux/net_tstamp.h rxclass.c common.c common.h \
+ uapi/linux/net_tstamp.h uapi/linux/if.h uapi/linux/hdlc/ioctl.h \
+ rxclass.c common.c common.h \
json_writer.c json_writer.h json_print.c json_print.h \
list.h
if ETHTOOL_ENABLE_PRETTY_DUMP
@@ -43,7 +44,8 @@ ethtool_SOURCES += \
netlink/desc-rtnl.c netlink/cable_test.c netlink/tunnels.c \
uapi/linux/ethtool_netlink.h \
uapi/linux/netlink.h uapi/linux/genetlink.h \
- uapi/linux/rtnetlink.h uapi/linux/if_link.h
+ uapi/linux/rtnetlink.h uapi/linux/if_link.h \
+ uapi/linux/if.h uapi/linux/hdlc/ioctl.h
AM_CPPFLAGS += @MNL_CFLAGS@
LDADD += @MNL_LIBS@
endif
--- a/internal.h
+++ b/internal.h
@@ -21,6 +21,9 @@
#include <unistd.h>
#include <endian.h>
#include <sys/ioctl.h>
+#define __UAPI_DEF_IF_IFNAMSIZ 1
+#define __UAPI_DEF_IF_IFMAP 1
+#define __UAPI_DEF_IF_IFREQ 1
#include <linux/if.h>
#include "json_writer.h"
@@ -52,10 +55,6 @@ typedef int32_t s32;
#define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
#endif
-#ifndef ALTIFNAMSIZ
-#define ALTIFNAMSIZ 128
-#endif
-
#include <linux/ethtool.h>
#include <linux/net_tstamp.h>
--- /dev/null
+++ b/uapi/linux/hdlc/ioctl.h
@@ -0,0 +1,94 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef __HDLC_IOCTL_H__
+#define __HDLC_IOCTL_H__
+
+
+#define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */
+
+#define CLOCK_DEFAULT 0 /* Default setting */
+#define CLOCK_EXT 1 /* External TX and RX clock - DTE */
+#define CLOCK_INT 2 /* Internal TX and RX clock - DCE */
+#define CLOCK_TXINT 3 /* Internal TX and external RX clock */
+#define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */
+
+
+#define ENCODING_DEFAULT 0 /* Default setting */
+#define ENCODING_NRZ 1
+#define ENCODING_NRZI 2
+#define ENCODING_FM_MARK 3
+#define ENCODING_FM_SPACE 4
+#define ENCODING_MANCHESTER 5
+
+
+#define PARITY_DEFAULT 0 /* Default setting */
+#define PARITY_NONE 1 /* No parity */
+#define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */
+#define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */
+#define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */
+#define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */
+#define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */
+#define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */
+
+#define LMI_DEFAULT 0 /* Default setting */
+#define LMI_NONE 1 /* No LMI, all PVCs are static */
+#define LMI_ANSI 2 /* ANSI Annex D */
+#define LMI_CCITT 3 /* ITU-T Annex A */
+#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
+
+#ifndef __ASSEMBLY__
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+} sync_serial_settings; /* V.35, V.24, X.21 */
+
+typedef struct {
+ unsigned int clock_rate; /* bits per second */
+ unsigned int clock_type; /* internal, external, TX-internal etc. */
+ unsigned short loopback;
+ unsigned int slot_map;
+} te1_settings; /* T1, E1 */
+
+typedef struct {
+ unsigned short encoding;
+ unsigned short parity;
+} raw_hdlc_proto;
+
+typedef struct {
+ unsigned int t391;
+ unsigned int t392;
+ unsigned int n391;
+ unsigned int n392;
+ unsigned int n393;
+ unsigned short lmi;
+ unsigned short dce; /* 1 for DCE (network side) operation */
+} fr_proto;
+
+typedef struct {
+ unsigned int dlci;
+} fr_proto_pvc; /* for creating/deleting FR PVCs */
+
+typedef struct {
+ unsigned int dlci;
+ char master[IFNAMSIZ]; /* Name of master FRAD device */
+}fr_proto_pvc_info; /* for returning PVC information only */
+
+typedef struct {
+ unsigned int interval;
+ unsigned int timeout;
+} cisco_proto;
+
+typedef struct {
+ unsigned short dce; /* 1 for DCE (network side) operation */
+ unsigned int modulo; /* modulo (8 = basic / 128 = extended) */
+ unsigned int window; /* frame window size */
+ unsigned int t1; /* timeout t1 */
+ unsigned int t2; /* timeout t2 */
+ unsigned int n2; /* frame retry counter */
+} x25_hdlc_proto;
+
+/* PPP doesn't need any info now - supply length = 0 to ioctl */
+
+#endif /* __ASSEMBLY__ */
+#endif /* __HDLC_IOCTL_H__ */
--- /dev/null
+++ b/uapi/linux/if.h
@@ -0,0 +1,296 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/*
+ * INET An implementation of the TCP/IP protocol suite for the LINUX
+ * operating system. INET is implemented using the BSD Socket
+ * interface as the means of communication with the user level.
+ *
+ * Global definitions for the INET interface module.
+ *
+ * Version: @(#)if.h 1.0.2 04/18/93
+ *
+ * Authors: Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
+ * Ross Biro
+ * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
+ *
+ * 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.
+ */
+#ifndef _LINUX_IF_H
+#define _LINUX_IF_H
+
+#include <linux/libc-compat.h> /* for compatibility with glibc */
+#include <linux/types.h> /* for "__kernel_caddr_t" et al */
+#include <linux/socket.h> /* for "struct sockaddr" et al */
+ /* for "__user" et al */
+
+#include <sys/socket.h> /* for struct sockaddr. */
+
+#if __UAPI_DEF_IF_IFNAMSIZ
+#define IFNAMSIZ 16
+#endif /* __UAPI_DEF_IF_IFNAMSIZ */
+#define IFALIASZ 256
+#define ALTIFNAMSIZ 128
+#include <linux/hdlc/ioctl.h>
+
+/* For glibc compatibility. An empty enum does not compile. */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \
+ __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
+/**
+ * enum net_device_flags - &struct net_device flags
+ *
+ * These are the &struct net_device flags, they can be set by drivers, the
+ * kernel and some can be triggered by userspace. Userspace can query and
+ * set these flags using userspace utilities but there is also a sysfs
+ * entry available for all dev flags which can be queried and set. These flags
+ * are shared for all types of net_devices. The sysfs entries are available
+ * via /sys/class/net/<dev>/flags. Flags which can be toggled through sysfs
+ * are annotated below, note that only a few flags can be toggled and some
+ * other flags are always preserved from the original net_device flags
+ * even if you try to set them via sysfs. Flags which are always preserved
+ * are kept under the flag grouping @IFF_VOLATILE. Flags which are __volatile__
+ * are annotated below as such.
+ *
+ * You should have a pretty good reason to be extending these flags.
+ *
+ * @IFF_UP: interface is up. Can be toggled through sysfs.
+ * @IFF_BROADCAST: broadcast address valid. Volatile.
+ * @IFF_DEBUG: turn on debugging. Can be toggled through sysfs.
+ * @IFF_LOOPBACK: is a loopback net. Volatile.
+ * @IFF_POINTOPOINT: interface is has p-p link. Volatile.
+ * @IFF_NOTRAILERS: avoid use of trailers. Can be toggled through sysfs.
+ * Volatile.
+ * @IFF_RUNNING: interface RFC2863 OPER_UP. Volatile.
+ * @IFF_NOARP: no ARP protocol. Can be toggled through sysfs. Volatile.
+ * @IFF_PROMISC: receive all packets. Can be toggled through sysfs.
+ * @IFF_ALLMULTI: receive all multicast packets. Can be toggled through
+ * sysfs.
+ * @IFF_MASTER: master of a load balancer. Volatile.
+ * @IFF_SLAVE: slave of a load balancer. Volatile.
+ * @IFF_MULTICAST: Supports multicast. Can be toggled through sysfs.
+ * @IFF_PORTSEL: can set media type. Can be toggled through sysfs.
+ * @IFF_AUTOMEDIA: auto media select active. Can be toggled through sysfs.
+ * @IFF_DYNAMIC: dialup device with changing addresses. Can be toggled
+ * through sysfs.
+ * @IFF_LOWER_UP: driver signals L1 up. Volatile.
+ * @IFF_DORMANT: driver signals dormant. Volatile.
+ * @IFF_ECHO: echo sent packets. Volatile.
+ */
+enum net_device_flags {
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
+ IFF_UP = 1<<0, /* sysfs */
+ IFF_BROADCAST = 1<<1, /* __volatile__ */
+ IFF_DEBUG = 1<<2, /* sysfs */
+ IFF_LOOPBACK = 1<<3, /* __volatile__ */
+ IFF_POINTOPOINT = 1<<4, /* __volatile__ */
+ IFF_NOTRAILERS = 1<<5, /* sysfs */
+ IFF_RUNNING = 1<<6, /* __volatile__ */
+ IFF_NOARP = 1<<7, /* sysfs */
+ IFF_PROMISC = 1<<8, /* sysfs */
+ IFF_ALLMULTI = 1<<9, /* sysfs */
+ IFF_MASTER = 1<<10, /* __volatile__ */
+ IFF_SLAVE = 1<<11, /* __volatile__ */
+ IFF_MULTICAST = 1<<12, /* sysfs */
+ IFF_PORTSEL = 1<<13, /* sysfs */
+ IFF_AUTOMEDIA = 1<<14, /* sysfs */
+ IFF_DYNAMIC = 1<<15, /* sysfs */
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+ IFF_LOWER_UP = 1<<16, /* __volatile__ */
+ IFF_DORMANT = 1<<17, /* __volatile__ */
+ IFF_ECHO = 1<<18, /* __volatile__ */
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
+};
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
+#define IFF_UP IFF_UP
+#define IFF_BROADCAST IFF_BROADCAST
+#define IFF_DEBUG IFF_DEBUG
+#define IFF_LOOPBACK IFF_LOOPBACK
+#define IFF_POINTOPOINT IFF_POINTOPOINT
+#define IFF_NOTRAILERS IFF_NOTRAILERS
+#define IFF_RUNNING IFF_RUNNING
+#define IFF_NOARP IFF_NOARP
+#define IFF_PROMISC IFF_PROMISC
+#define IFF_ALLMULTI IFF_ALLMULTI
+#define IFF_MASTER IFF_MASTER
+#define IFF_SLAVE IFF_SLAVE
+#define IFF_MULTICAST IFF_MULTICAST
+#define IFF_PORTSEL IFF_PORTSEL
+#define IFF_AUTOMEDIA IFF_AUTOMEDIA
+#define IFF_DYNAMIC IFF_DYNAMIC
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
+
+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
+#define IFF_LOWER_UP IFF_LOWER_UP
+#define IFF_DORMANT IFF_DORMANT
+#define IFF_ECHO IFF_ECHO
+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
+
+#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
+ IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
+
+#define IF_GET_IFACE 0x0001 /* for querying only */
+#define IF_GET_PROTO 0x0002
+
+/* For definitions see hdlc.h */
+#define IF_IFACE_V35 0x1000 /* V.35 serial interface */
+#define IF_IFACE_V24 0x1001 /* V.24 serial interface */
+#define IF_IFACE_X21 0x1002 /* X.21 serial interface */
+#define IF_IFACE_T1 0x1003 /* T1 telco serial interface */
+#define IF_IFACE_E1 0x1004 /* E1 telco serial interface */
+#define IF_IFACE_SYNC_SERIAL 0x1005 /* can't be set by software */
+#define IF_IFACE_X21D 0x1006 /* X.21 Dual Clocking (FarSite) */
+
+/* For definitions see hdlc.h */
+#define IF_PROTO_HDLC 0x2000 /* raw HDLC protocol */
+#define IF_PROTO_PPP 0x2001 /* PPP protocol */
+#define IF_PROTO_CISCO 0x2002 /* Cisco HDLC protocol */
+#define IF_PROTO_FR 0x2003 /* Frame Relay protocol */
+#define IF_PROTO_FR_ADD_PVC 0x2004 /* Create FR PVC */
+#define IF_PROTO_FR_DEL_PVC 0x2005 /* Delete FR PVC */
+#define IF_PROTO_X25 0x2006 /* X.25 */
+#define IF_PROTO_HDLC_ETH 0x2007 /* raw HDLC, Ethernet emulation */
+#define IF_PROTO_FR_ADD_ETH_PVC 0x2008 /* Create FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_DEL_ETH_PVC 0x2009 /* Delete FR Ethernet-bridged PVC */
+#define IF_PROTO_FR_PVC 0x200A /* for reading PVC status */
+#define IF_PROTO_FR_ETH_PVC 0x200B
+#define IF_PROTO_RAW 0x200C /* RAW Socket */
+
+/* RFC 2863 operational status */
+enum {
+ IF_OPER_UNKNOWN,
+ IF_OPER_NOTPRESENT,
+ IF_OPER_DOWN,
+ IF_OPER_LOWERLAYERDOWN,
+ IF_OPER_TESTING,
+ IF_OPER_DORMANT,
+ IF_OPER_UP,
+};
+
+/* link modes */
+enum {
+ IF_LINK_MODE_DEFAULT,
+ IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */
+ IF_LINK_MODE_TESTING, /* limit upward transition to testing */
+};
+
+/*
+ * Device mapping structure. I'd just gone off and designed a
+ * beautiful scheme using only loadable modules with arguments
+ * for driver options and along come the PCMCIA people 8)
+ *
+ * Ah well. The get() side of this is good for WDSETUP, and it'll
+ * be handy for debugging things. The set side is fine for now and
+ * being very small might be worth keeping for clean configuration.
+ */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_IFMAP
+struct ifmap {
+ unsigned long mem_start;
+ unsigned long mem_end;
+ unsigned short base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+};
+#endif /* __UAPI_DEF_IF_IFMAP */
+
+struct if_settings {
+ unsigned int type; /* Type of physical device or protocol */
+ unsigned int size; /* Size of the data allocated by the caller */
+ union {
+ /* {atm/eth/dsl}_settings anyone ? */
+ raw_hdlc_proto *raw_hdlc;
+ cisco_proto *cisco;
+ fr_proto *fr;
+ fr_proto_pvc *fr_pvc;
+ fr_proto_pvc_info *fr_pvc_info;
+ x25_hdlc_proto *x25;
+
+ /* interface settings */
+ sync_serial_settings *sync;
+ te1_settings *te1;
+ } ifs_ifsu;
+};
+
+/*
+ * Interface request structure used for socket
+ * ioctl's. All interface ioctl's must have parameter
+ * definitions which begin with ifr_name. The
+ * remainder may be interface specific.
+ */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_IFREQ
+struct ifreq {
+#define IFHWADDRLEN 6
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ char ifru_newname[IFNAMSIZ];
+ void * ifru_data;
+ struct if_settings ifru_settings;
+ } ifr_ifru;
+};
+#endif /* __UAPI_DEF_IF_IFREQ */
+
+#define ifr_name ifr_ifrn.ifrn_name /* interface name */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+#define ifr_flags ifr_ifru.ifru_flags /* flags */
+#define ifr_metric ifr_ifru.ifru_ivalue /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+#define ifr_map ifr_ifru.ifru_map /* device map */
+#define ifr_slave ifr_ifru.ifru_slave /* slave device */
+#define ifr_data ifr_ifru.ifru_data /* for use by interface */
+#define ifr_ifindex ifr_ifru.ifru_ivalue /* interface index */
+#define ifr_bandwidth ifr_ifru.ifru_ivalue /* link bandwidth */
+#define ifr_qlen ifr_ifru.ifru_ivalue /* Queue length */
+#define ifr_newname ifr_ifru.ifru_newname /* New name */
+#define ifr_settings ifr_ifru.ifru_settings /* Device/proto settings*/
+
+/*
+ * Structure used in SIOCGIFCONF request.
+ * Used to retrieve interface configuration
+ * for machine (useful for programs which
+ * must know all networks accessible).
+ */
+
+/* for compatibility with glibc net/if.h */
+#if __UAPI_DEF_IF_IFCONF
+struct ifconf {
+ int ifc_len; /* size of buffer */
+ union {
+ char *ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+};
+#endif /* __UAPI_DEF_IF_IFCONF */
+
+#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
+#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
+
+#endif /* _LINUX_IF_H */

View File

@ -1,25 +0,0 @@
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool v2 2/3] netlink: Fix maybe uninitialized 'meters' variable
Date: Sat, 14 Jan 2023 08:34:10 -0800
GCC12 warns that 'meters' may be uninitialized, initialize it
accordingly.
Fixes: 9561db9b76f4 ("Add cable test TDR support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
netlink/parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/netlink/parser.c
+++ b/netlink/parser.c
@@ -237,7 +237,7 @@ int nl_parse_direct_m2cm(struct nl_conte
struct nl_msg_buff *msgbuff, void *dest)
{
const char *arg = *nlctx->argp;
- float meters;
+ float meters = 0.0;
uint32_t cm;
int ret;

View File

@ -1,63 +0,0 @@
From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Subject: [PATCH ethtool v2 3/3] marvell.c: Fix build with musl-libc
Date: Sat, 14 Jan 2023 08:34:11 -0800
After commit 1fa60003a8b8 ("misc: header includes cleanup") we stopped
including net/if.h which resolved the proper defines to pull in
sys/types.h and provide a definition for u_int32_t. With musl-libc we
would need to define _GNU_SOURCE to ensure that sys/types.h does provide a
definition for u_int32_t.
Rather, just replace u_uint{16,32}_t with the more standard
uint{16,32}_t types from stdint.h
Fixes: 1fa60003a8b8 ("misc: header includes cleanup")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
marvell.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
--- a/marvell.c
+++ b/marvell.c
@@ -31,23 +31,23 @@ static void dump_timer(const char *name,
static void dump_queue(const char *name, const void *a, int rx)
{
struct desc {
- u_int32_t ctl;
- u_int32_t next;
- u_int32_t data_lo;
- u_int32_t data_hi;
- u_int32_t status;
- u_int32_t timestamp;
- u_int16_t csum2;
- u_int16_t csum1;
- u_int16_t csum2_start;
- u_int16_t csum1_start;
- u_int32_t addr_lo;
- u_int32_t addr_hi;
- u_int32_t count_lo;
- u_int32_t count_hi;
- u_int32_t byte_count;
- u_int32_t csr;
- u_int32_t flag;
+ uint32_t ctl;
+ uint32_t next;
+ uint32_t data_lo;
+ uint32_t data_hi;
+ uint32_t status;
+ uint32_t timestamp;
+ uint16_t csum2;
+ uint16_t csum1;
+ uint16_t csum2_start;
+ uint16_t csum1_start;
+ uint32_t addr_lo;
+ uint32_t addr_hi;
+ uint32_t count_lo;
+ uint32_t count_hi;
+ uint32_t byte_count;
+ uint32_t csr;
+ uint32_t flag;
};
const struct desc *d = a;

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=iproute2
PKG_VERSION:=6.1.0
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=6.2.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
PKG_HASH:=5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab
PKG_HASH:=4d72730200ec5b2aabaa1a2f20553c6748292f065d9a154c7d5e22559df9fd62
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=iptables
PKG_LICENSE:=GPL-2.0

View File

@ -1,6 +1,6 @@
--- a/netem/maketable.c
+++ b/netem/maketable.c
@@ -10,7 +10,9 @@
@@ -11,7 +11,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
@ -12,7 +12,7 @@
#include <sys/stat.h>
--- a/netem/normal.c
+++ b/netem/normal.c
@@ -8,8 +8,12 @@
@@ -9,8 +9,12 @@
#include <string.h>
#include <limits.h>
@ -27,7 +27,7 @@
#define TABLEFACTOR NETEM_DIST_SCALE
--- a/netem/pareto.c
+++ b/netem/pareto.c
@@ -7,8 +7,12 @@
@@ -8,8 +8,12 @@
#include <math.h>
#include <limits.h>
@ -42,7 +42,7 @@
#define TABLESIZE 16384
--- a/netem/paretonormal.c
+++ b/netem/paretonormal.c
@@ -14,10 +14,13 @@
@@ -15,10 +15,13 @@
#include <string.h>
#include <math.h>
#include <limits.h>

View File

@ -1,6 +1,6 @@
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -128,6 +128,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
@@ -127,6 +127,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
ifneq ($(IPT_LIB_DIR),)
CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
endif

View File

@ -1,6 +1,6 @@
--- a/tc/q_fifo.c
+++ b/tc/q_fifo.c
@@ -95,5 +95,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
@@ -90,5 +90,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
struct qdisc_util pfifo_fast_qdisc_util = {
.id = "pfifo_fast",

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -412,7 +412,7 @@ check_tirpc()
@@ -411,7 +411,7 @@ check_tirpc()
check_mnl()
{

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -267,7 +267,7 @@ EOF
@@ -266,7 +266,7 @@ EOF
check_elf()
{

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -470,7 +470,7 @@ EOF
@@ -469,7 +469,7 @@ EOF
check_cap()
{

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -399,7 +399,7 @@ check_selinux()
@@ -398,7 +398,7 @@ check_selinux()
check_tirpc()
{

View File

@ -25,7 +25,7 @@
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -65,11 +65,17 @@ static void usage(void)
@@ -61,11 +61,17 @@ static void usage(void)
fprintf(stderr,
"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
" ip [ -force ] -batch filename\n"
@ -43,7 +43,7 @@
" OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
" -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
" -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
@@ -92,37 +98,49 @@ static const struct cmd {
@@ -88,37 +94,49 @@ static const struct cmd {
int (*func)(int argc, char **argv);
} cmds[] = {
{ "address", do_ipaddr },

View File

@ -1,6 +1,6 @@
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -114,7 +114,7 @@ LDLIBS += -L. -lm
@@ -113,7 +113,7 @@ LDLIBS += -L. -lm
ifeq ($(SHARED_LIBS),y)
LDLIBS += -ldl
@ -9,7 +9,7 @@
endif
TCLIB := tc_core.o
@@ -144,7 +144,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
@@ -143,7 +143,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
all: tc $(TCSO)
tc: $(TCOBJ) $(LIBNETLINK) libtc.a
@ -18,7 +18,7 @@
libtc.a: $(TCLIB)
$(QUIET_AR)$(AR) rcs $@ $^
@@ -166,6 +166,7 @@ install: all
@@ -165,6 +165,7 @@ install: all
clean:
rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.tab.h; \
rm -f emp_ematch.tab.*
@ -26,7 +26,7 @@
q_atm.so: q_atm.c
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
@@ -205,4 +206,16 @@ static-syms.h: $(wildcard *.c)
@@ -204,4 +205,16 @@ static-syms.h: $(wildcard *.c)
sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
done > $@

View File

@ -11,7 +11,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
--- a/ip/rtm_map.c
+++ b/ip/rtm_map.c
@@ -54,6 +54,8 @@ char *rtnl_rtntype_n2a(int id, char *buf
@@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf
return "nat";
case RTN_XRESOLVE:
return "xresolve";
@ -20,7 +20,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
default:
snprintf(buf, len, "%d", id);
return buf;
@@ -89,6 +91,8 @@ int rtnl_rtntype_a2n(int *id, char *arg)
@@ -84,6 +86,8 @@ int rtnl_rtntype_a2n(int *id, char *arg)
res = RTN_UNICAST;
else if (strcmp(arg, "throw") == 0)
res = RTN_THROW;

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -291,7 +291,7 @@ int main(int argc, char **argv) {
@@ -290,7 +290,7 @@ int main(int argc, char **argv) {
}
EOF
@ -9,7 +9,7 @@
local ret=$?
rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
@@ -309,7 +309,7 @@ int main(int argc, char **argv) {
@@ -308,7 +308,7 @@ int main(int argc, char **argv) {
}
EOF

View File

@ -11,7 +11,7 @@
--- a/tc/Makefile
+++ b/tc/Makefile
@@ -141,7 +141,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
@@ -140,7 +140,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic $< -o $@

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -456,14 +456,8 @@ EOF
@@ -455,14 +455,8 @@ EOF
if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
echo "no"
else

View File

@ -1,6 +1,6 @@
--- a/configure
+++ b/configure
@@ -386,7 +386,7 @@ check_libbpf()
@@ -385,7 +385,7 @@ check_libbpf()
check_selinux()
# SELinux is a compile time option in the ss utility
{

View File

@ -1,43 +0,0 @@
From 3a3a2f6be704c970938eb8dac4eb0118f1c2fb06 Mon Sep 17 00:00:00 2001
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Wed, 21 Dec 2022 23:26:28 +0100
Subject: [PATCH iproute2 v2] configure: Remove include <sys/stat.h>
The check_name_to_handle_at() function in the configure script is
including sys/stat.h. This include fails with glibc 2.36 like this:
````
In file included from /linux-5.15.84/include/uapi/linux/stat.h:5,
from /toolchain-x86_64_gcc-12.2.0_glibc/include/bits/statx.h:31,
from /toolchain-x86_64_gcc-12.2.0_glibc/include/sys/stat.h:465,
from config.YExfMc/name_to_handle_at_test.c:3:
/linux-5.15.84/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" [-Wcpp]
10 | #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders"
| ^~~~~~~
In file included from /linux-5.15.84/include/uapi/linux/posix_types.h:5,
from /linux-5.15.84/include/uapi/linux/types.h:14:
/linux-5.15.84/include/uapi/linux/stddef.h:5:10: fatal error: linux/compiler_types.h: No such file or directory
5 | #include <linux/compiler_types.h>
| ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
````
Just removing the include works, the manpage of name_to_handle_at() says
only fcntl.h is needed.
Fixes: c5b72cc56bf8 ("lib/fs: fix issue when {name,open}_to_handle_at() is not implemented")
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
configure | 1 -
1 file changed, 1 deletion(-)
--- a/configure
+++ b/configure
@@ -215,7 +215,6 @@ check_name_to_handle_at()
cat >$TMPDIR/name_to_handle_at_test.c <<EOF
#define _GNU_SOURCE
#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char **argv)
{

View File

@ -0,0 +1,29 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9563_glinet_gl-x1200.dtsi"
/ {
compatible = "glinet,gl-x1200-nor-nand", "qca,qca9563";
model = "GL.iNet GL-X1200 (NOR/NAND)";
};
&nor_partitions {
partition@60000 {
label = "kernel";
reg = <0x060000 0x400000>;
/*
* U-Boot bootcmd is "bootm 0x9f060000".
* So this might be possible to resize in the future.
*/
};
partition@460000 {
label = "nor_reserved";
reg = <0x460000 0xba0000>;
};
};
&nand_ubi {
label = "ubi";
};

View File

@ -0,0 +1,16 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca9563_glinet_gl-x1200.dtsi"
/ {
compatible = "glinet,gl-x1200-nor", "qca,qca9563";
model = "GL.iNet GL-X1200 (NOR)";
};
&nor_partitions {
partition@60000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x060000 0xfa0000>;
};
};

View File

@ -0,0 +1,209 @@
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
#include "qca956x.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
aliases {
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
label-mac-device = &eth0;
};
keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&jtag_disable_pins>;
reset {
label = "reset";
linux,code = <KEY_RESTART>;
gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
};
};
leds {
compatible = "gpio-leds";
led_system: system {
label = "red:system";
gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
default-state = "keep";
};
wlan2g {
label = "green:wlan2g";
gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
linux,default-trigger = "phy1tpt";
};
wlan5g {
label = "green:wlan5g";
gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "phy0tpt";
};
};
gpio-export {
compatible = "gpio-export";
gpio_modem1_power {
gpio-export,name = "gl-x1200:4g1:power";
gpio-export,output = <0>;
gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
};
gpio_modem2_power {
gpio-export,name = "gl-x1200:4g2:power";
gpio-export,output = <0>;
gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
};
};
};
&spi {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <25000000>;
nor_partitions: partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x000000 0x040000>;
read-only;
};
partition@40000 {
label = "u-boot-env";
reg = <0x040000 0x010000>;
};
partition@50000 {
label = "art";
reg = <0x050000 0x010000>;
read-only;
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
calibration_ath9k: calibration@1000 {
reg = <0x1000 0x440>;
};
calibration_ath10k: calibration@5000 {
reg = <0x5000 0x2f20>;
};
macaddr_art_0: macaddr@0 {
reg = <0x0 0x6>;
};
macaddr_art_1002: macaddr@1002 {
reg = <0x1002 0x6>;
};
macaddr_art_5006: macaddr@5006 {
reg = <0x5006 0x6>;
};
};
/* Firmware / Kernel flash type specific */
};
};
flash@1 {
compatible = "spi-nand";
reg = <1>;
spi-max-frequency = <25000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
nand_ubi: partition@0 {
label = "nand_ubi";
reg = <0x000000 0x8000000>;
};
};
};
};
&eth0 {
status = "okay";
phy-handle = <&phy0>;
nvmem-cells = <&macaddr_art_0>;
nvmem-cell-names = "mac-address";
};
&gpio {
usb_vbus {
gpio-hog;
gpios = <7 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "usb-vbus";
};
};
&mdio0 {
status = "okay";
phy0: ethernet-phy@0 {
reg = <0>;
phy-mode = "sgmii";
qca,ar8327-initvals = <
0x04 0x00080080 /* PORT0 PAD MODE CTRL */
0x7c 0x0000007e /* PORT0_STATUS */
>;
};
};
&pcie {
status = "okay";
wifi@0,0 {
compatible = "qcom,ath10k";
reg = <0 0 0 0 0>;
nvmem-cells = <&macaddr_art_5006>, <&calibration_ath10k>;
nvmem-cell-names = "mac-address", "pre-calibration";
};
};
&usb0 {
status = "okay";
};
&usb1 {
status = "okay";
};
&usb_phy0 {
status = "okay";
};
&usb_phy1 {
status = "okay";
};
&wmac {
status = "okay";
nvmem-cells = <&macaddr_art_1002>, <&calibration_ath9k>;
nvmem-cell-names = "mac-address", "calibration";
};

View File

@ -212,6 +212,35 @@ define Device/glinet_gl-xe300
endef
TARGET_DEVICES += glinet_gl-xe300
define Device/glinet_gl-x1200-common
SOC := qca9563
DEVICE_VENDOR := GL.iNet
DEVICE_MODEL := GL-X1200
DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct-htt kmod-usb2 \
kmod-usb-storage block-mount kmod-usb-net-qmi-wwan uqmi
IMAGE_SIZE := 16000k
endef
define Device/glinet_gl-x1200-nor-nand
$(Device/glinet_gl-x1200-common)
DEVICE_VARIANT := NOR/NAND
KERNEL_SIZE := 4096k
IMAGE_SIZE := 131072k
PAGESIZE := 2048
VID_HDR_OFFSET := 2048
BLOCKSIZE := 128k
IMAGES += factory.img
IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
endef
TARGET_DEVICES += glinet_gl-x1200-nor-nand
define Device/glinet_gl-x1200-nor
$(Device/glinet_gl-x1200-common)
DEVICE_VARIANT := NOR
endef
TARGET_DEVICES += glinet_gl-x1200-nor
define Device/linksys_ea4500-v3
SOC := qca9558
DEVICE_VENDOR := Linksys

View File

@ -30,6 +30,11 @@ ath79_setup_interfaces()
ucidef_add_switch "switch0" \
"0@eth0" "4:lan"
;;
glinet,gl-x1200-nor|\
glinet,gl-x1200-nor-nand)
ucidef_add_switch "switch0" \
"0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
;;
linksys,ea4500-v3)
ucidef_add_switch "switch0" \
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0"
@ -88,6 +93,11 @@ ath79_setup_macs()
wan_mac=$(mtd_get_mac_binary art 0x0)
label_mac=$wan_mac
;;
glinet,gl-x1200-nor|\
glinet,gl-x1200-nor-nand)
wan_mac=$(mtd_get_mac_binary art 0x0)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
netgear,wndr3700-v4|\
netgear,wndr4300|\
netgear,wndr4300sw|\

View File

@ -19,7 +19,9 @@ platform_do_upgrade() {
glinet_nand_nor_do_upgrade "$1"
;;
glinet,gl-ar750s-nor|\
glinet,gl-ar750s-nor-nand)
glinet,gl-ar750s-nor-nand|\
glinet,gl-x1200-nor|\
glinet,gl-x1200-nor-nand)
nand_nor_do_upgrade "$1"
;;
*)

View File

@ -10,8 +10,7 @@ BOARDNAME:=Broadcom BCM47xx/53xx (MIPS)
FEATURES:=squashfs usb
SUBTARGETS:=generic mips74k legacy
KERNEL_PATCHVER:=5.10
KERNEL_TESTING_PATCHVER:=5.15
KERNEL_PATCHVER:=5.15
define Target/Description
Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.

View File

@ -18,8 +18,8 @@
#
TEXT_START := 0x80001000
BZ_TEXT_START := 0x80700000
BZ_STACK_START := 0x80800000
BZ_TEXT_START := 0x80d00000
BZ_STACK_START := 0x80e00000
OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S

View File

@ -100,6 +100,16 @@
status = "okay";
};
};
regulator-usb-vbus {
compatible = "regulator-fixed";
regulator-name = "USB_VBUS";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
regulator-always-on;
regulator-boot-on;
gpio = <&tlmm 68 GPIO_ACTIVE_LOW>;
};
};
@ -268,7 +278,7 @@
pins = "gpio55", "gpio56", "gpio57",
"gpio60", "gpio62", "gpio63",
"gpio64", "gpio65", "gpio66",
"gpio67", "gpio68", "gpio69";
"gpio67", "gpio69";
function = "qpic";
bias-pull-down;
};

View File

@ -6,6 +6,7 @@
*/
#include "cn9130.dtsi"
#include "puzzle-thermal.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
@ -109,26 +110,18 @@
chassis_fan_group0: fan-group@0 {
#cooling-cells = <2>;
reg = <0x00>;
cooling-levels = <64 102 170 230 250>;
cooling-levels = <80 102 170 230 255>;
};
};
};
};
&ap_thermal_cpu1 {
trips {
cpu_active: cpu-active {
temperature = <44000>;
hysteresis = <2000>;
type = "active";
};
};
cooling-maps {
fan-map {
trip = <&cpu_active>;
cooling-device = <&chassis_fan_group0 64 THERMAL_NO_LIMIT>;
};
};
&ap_thermal_ic {
PUZZLE_FAN_THERMAL(ic, &chassis_fan_group0);
};
&cp0_thermal_ic {
PUZZLE_FAN_THERMAL(cp0, &chassis_fan_group0);
};
/* on-board eMMC - U9 */
@ -396,6 +389,10 @@
};
};
&cp1_thermal_ic {
PUZZLE_FAN_THERMAL(cp1, &chassis_fan_group0);
};
&cp1_usb3_1 {
status = "okay";
phys = <&cp1_comphy3 1>;

View File

@ -6,6 +6,7 @@
*/
#include "cn9130.dtsi"
#include "puzzle-thermal.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
@ -154,28 +155,21 @@
chassis_fan_group0: fan-group@0 {
#cooling-cells = <2>;
reg = <0x00>;
cooling-levels = <64 102 170 230 250>;
cooling-levels = <80 102 170 230 255>;
};
};
};
};
&ap_thermal_cpu1 {
trips {
cpu_active: cpu-active {
temperature = <44000>;
hysteresis = <2000>;
type = "active";
};
};
cooling-maps {
fan-map {
trip = <&cpu_active>;
cooling-device = <&chassis_fan_group0 64 THERMAL_NO_LIMIT>;
};
};
&ap_thermal_ic {
PUZZLE_FAN_THERMAL(ic, &chassis_fan_group0);
};
&cp0_thermal_ic {
PUZZLE_FAN_THERMAL(cp0, &chassis_fan_group0);
};
/* on-board eMMC - U9 */
&ap_sdhci0 {
pinctrl-names = "default";
@ -447,6 +441,10 @@
};
};
&cp1_thermal_ic {
PUZZLE_FAN_THERMAL(cp1, &chassis_fan_group0);
};
/*
* Instantiate the second connected CP115
*/
@ -562,3 +560,7 @@
};
};
};
&cp2_thermal_ic {
PUZZLE_FAN_THERMAL(cp2, &chassis_fan_group0);
};

View File

@ -0,0 +1,41 @@
#define PUZZLE_FAN_THERMAL(_cname, _fan) \
trips { \
_cname##_active_high: cpu-active-high { \
temperature = <80000>; \
hysteresis = <2000>; \
type = "active"; \
}; \
_cname##_active_med: cpu-active-med { \
temperature = <72000>; \
hysteresis = <2000>; \
type = "active"; \
}; \
_cname##_active_low: cpu-active-low { \
temperature = <65000>; \
hysteresis = <2000>; \
type = "active"; \
}; \
_cname##_active_idle: cpu-active-idle { \
temperature = <60000>; \
hysteresis = <2000>; \
type = "active"; \
}; \
}; \
cooling-maps { \
cpu-active-high { \
trip = <&_cname##_active_high>; \
cooling-device = <_fan 3 THERMAL_NO_LIMIT>; \
}; \
cpu-active-med { \
trip = <&_cname##_active_med>; \
cooling-device = <_fan 2 THERMAL_NO_LIMIT>; \
}; \
cpu-active-low { \
trip = <&_cname##_active_low>; \
cooling-device = <_fan 1 THERMAL_NO_LIMIT>; \
}; \
cpu-active-idle { \
trip = <&_cname##_active_idle>; \
cooling-device = <_fan 0 THERMAL_NO_LIMIT>; \
}; \
}

View File

@ -53,7 +53,7 @@ Cc: Robert Marko <robert.marko@sartura.hr>
obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
--- /dev/null
+++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c
@@ -0,0 +1,413 @@
@@ -0,0 +1,445 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* IEI WT61P803 PUZZLE MCU HWMON Driver
+ *
@ -84,13 +84,17 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ * @name: Thermal cooling device name
+ * @pwm_channel: Controlled PWM channel (0 or 1)
+ * @cooling_levels: Thermal cooling device cooling levels (DT)
+ * @cur_level: Current cooling level
+ * @num_levels: Number of cooling levels
+ */
+struct iei_wt61p803_puzzle_thermal_cooling_device {
+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon;
+ struct thermal_cooling_device *tcdev;
+ char name[THERMAL_NAME_LENGTH];
+ int pwm_channel;
+ u8 *cooling_levels;
+ u32 *cooling_levels;
+ int cur_level;
+ u8 num_levels;
+};
+
+/**
@ -326,8 +330,12 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+static int iei_wt61p803_puzzle_get_max_state(struct thermal_cooling_device *tcdev,
+ unsigned long *state)
+{
+ *state = IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL;
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
+
+ if (!cdev)
+ return -EINVAL;
+
+ *state = cdev->num_levels - 1;
+ return 0;
+}
+
@ -335,14 +343,14 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ unsigned long *state)
+{
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
+ long value;
+ int ret;
+
+ ret = iei_wt61p803_puzzle_read_pwm_channel(mcu_hwmon, cdev->pwm_channel, &value);
+ if (ret)
+ return ret;
+ *state = value;
+ if (!cdev)
+ return -EINVAL;
+
+ if (cdev->cur_level < 0)
+ return -EAGAIN;
+
+ *state = cdev->cur_level;
+ return 0;
+}
+
@ -350,9 +358,21 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ unsigned long state)
+{
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
+ u8 pwm_level;
+
+ return iei_wt61p803_puzzle_write_pwm_channel(mcu_hwmon, cdev->pwm_channel, state);
+ if (!cdev)
+ return -EINVAL;
+
+ if (state >= cdev->num_levels)
+ return -EINVAL;
+
+ if (state == cdev->cur_level)
+ return 0;
+
+ cdev->cur_level = state;
+ pwm_level = cdev->cooling_levels[state];
+
+ return iei_wt61p803_puzzle_write_pwm_channel(cdev->mcu_hwmon, cdev->pwm_channel, pwm_level);
+}
+
+static const struct thermal_cooling_device_ops iei_wt61p803_puzzle_cooling_ops = {
@ -369,7 +389,7 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev;
+ u32 pwm_channel;
+ u8 num_levels;
+ int ret;
+ int i, ret;
+
+ ret = fwnode_property_read_u32(child, "reg", &pwm_channel);
+ if (ret)
@ -377,7 +397,7 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+
+ mcu_hwmon->thermal_cooling_dev_present[pwm_channel] = true;
+
+ num_levels = fwnode_property_count_u8(child, "cooling-levels");
+ num_levels = fwnode_property_count_u32(child, "cooling-levels");
+ if (!num_levels)
+ return -EINVAL;
+
@ -385,28 +405,40 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ if (!cdev)
+ return -ENOMEM;
+
+ cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u8), GFP_KERNEL);
+ cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u32), GFP_KERNEL);
+ if (!cdev->cooling_levels)
+ return -ENOMEM;
+
+ ret = fwnode_property_read_u8_array(child, "cooling-levels",
+ cdev->cooling_levels,
+ num_levels);
+ ret = fwnode_property_read_u32_array(child, "cooling-levels",
+ cdev->cooling_levels,
+ num_levels);
+ if (ret) {
+ dev_err(dev, "Couldn't read property 'cooling-levels'\n");
+ return ret;
+ }
+
+ snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
+ cdev->tcdev = devm_thermal_of_cooling_device_register(dev, NULL, cdev->name, cdev,
+ &iei_wt61p803_puzzle_cooling_ops);
+ if (IS_ERR(cdev->tcdev))
+ return PTR_ERR(cdev->tcdev);
+ for (i = 0; i < num_levels; i++) {
+ if (cdev->cooling_levels[i] >
+ IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL) {
+ dev_err(dev, "iei_wt61p803_fan state[%d]:%d > %d\n", i,
+ cdev->cooling_levels[i],
+ IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL);
+ return -EINVAL;
+ }
+ }
+
+ cdev->mcu_hwmon = mcu_hwmon;
+ cdev->pwm_channel = pwm_channel;
+ cdev->num_levels = num_levels;
+ cdev->cur_level = -1;
+ mcu_hwmon->cdev[pwm_channel] = cdev;
+
+ snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
+ cdev->tcdev = devm_thermal_of_cooling_device_register(dev, to_of_node(child), cdev->name,
+ cdev, &iei_wt61p803_puzzle_cooling_ops);
+ if (IS_ERR(cdev->tcdev))
+ return PTR_ERR(cdev->tcdev);
+
+ return 0;
+}
+

View File

@ -53,7 +53,7 @@ Cc: Robert Marko <robert.marko@sartura.hr>
obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
--- /dev/null
+++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c
@@ -0,0 +1,413 @@
@@ -0,0 +1,445 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* IEI WT61P803 PUZZLE MCU HWMON Driver
+ *
@ -84,13 +84,17 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ * @name: Thermal cooling device name
+ * @pwm_channel: Controlled PWM channel (0 or 1)
+ * @cooling_levels: Thermal cooling device cooling levels (DT)
+ * @cur_level: Current cooling level
+ * @num_levels: Number of cooling levels
+ */
+struct iei_wt61p803_puzzle_thermal_cooling_device {
+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon;
+ struct thermal_cooling_device *tcdev;
+ char name[THERMAL_NAME_LENGTH];
+ int pwm_channel;
+ u8 *cooling_levels;
+ u32 *cooling_levels;
+ int cur_level;
+ u8 num_levels;
+};
+
+/**
@ -326,8 +330,12 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+static int iei_wt61p803_puzzle_get_max_state(struct thermal_cooling_device *tcdev,
+ unsigned long *state)
+{
+ *state = IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL;
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
+
+ if (!cdev)
+ return -EINVAL;
+
+ *state = cdev->num_levels - 1;
+ return 0;
+}
+
@ -335,14 +343,14 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ unsigned long *state)
+{
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
+ long value;
+ int ret;
+
+ ret = iei_wt61p803_puzzle_read_pwm_channel(mcu_hwmon, cdev->pwm_channel, &value);
+ if (ret)
+ return ret;
+ *state = value;
+ if (!cdev)
+ return -EINVAL;
+
+ if (cdev->cur_level < 0)
+ return -EAGAIN;
+
+ *state = cdev->cur_level;
+ return 0;
+}
+
@ -350,9 +358,21 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ unsigned long state)
+{
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
+ struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
+ u8 pwm_level;
+
+ return iei_wt61p803_puzzle_write_pwm_channel(mcu_hwmon, cdev->pwm_channel, state);
+ if (!cdev)
+ return -EINVAL;
+
+ if (state >= cdev->num_levels)
+ return -EINVAL;
+
+ if (state == cdev->cur_level)
+ return 0;
+
+ cdev->cur_level = state;
+ pwm_level = cdev->cooling_levels[state];
+
+ return iei_wt61p803_puzzle_write_pwm_channel(cdev->mcu_hwmon, cdev->pwm_channel, pwm_level);
+}
+
+static const struct thermal_cooling_device_ops iei_wt61p803_puzzle_cooling_ops = {
@ -369,7 +389,7 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ struct iei_wt61p803_puzzle_thermal_cooling_device *cdev;
+ u32 pwm_channel;
+ u8 num_levels;
+ int ret;
+ int i, ret;
+
+ ret = fwnode_property_read_u32(child, "reg", &pwm_channel);
+ if (ret)
@ -377,7 +397,7 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+
+ mcu_hwmon->thermal_cooling_dev_present[pwm_channel] = true;
+
+ num_levels = fwnode_property_count_u8(child, "cooling-levels");
+ num_levels = fwnode_property_count_u32(child, "cooling-levels");
+ if (!num_levels)
+ return -EINVAL;
+
@ -385,28 +405,40 @@ Cc: Robert Marko <robert.marko@sartura.hr>
+ if (!cdev)
+ return -ENOMEM;
+
+ cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u8), GFP_KERNEL);
+ cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u32), GFP_KERNEL);
+ if (!cdev->cooling_levels)
+ return -ENOMEM;
+
+ ret = fwnode_property_read_u8_array(child, "cooling-levels",
+ cdev->cooling_levels,
+ num_levels);
+ ret = fwnode_property_read_u32_array(child, "cooling-levels",
+ cdev->cooling_levels,
+ num_levels);
+ if (ret) {
+ dev_err(dev, "Couldn't read property 'cooling-levels'\n");
+ return ret;
+ }
+
+ snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
+ cdev->tcdev = devm_thermal_of_cooling_device_register(dev, NULL, cdev->name, cdev,
+ &iei_wt61p803_puzzle_cooling_ops);
+ if (IS_ERR(cdev->tcdev))
+ return PTR_ERR(cdev->tcdev);
+ for (i = 0; i < num_levels; i++) {
+ if (cdev->cooling_levels[i] >
+ IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL) {
+ dev_err(dev, "iei_wt61p803_fan state[%d]:%d > %d\n", i,
+ cdev->cooling_levels[i],
+ IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL);
+ return -EINVAL;
+ }
+ }
+
+ cdev->mcu_hwmon = mcu_hwmon;
+ cdev->pwm_channel = pwm_channel;
+ cdev->num_levels = num_levels;
+ cdev->cur_level = -1;
+ mcu_hwmon->cdev[pwm_channel] = cdev;
+
+ snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
+ cdev->tcdev = devm_thermal_of_cooling_device_register(dev, to_of_node(child), cdev->name,
+ cdev, &iei_wt61p803_puzzle_cooling_ops);
+ if (IS_ERR(cdev->tcdev))
+ return PTR_ERR(cdev->tcdev);
+
+ return 0;
+}
+

View File

@ -96,7 +96,7 @@
};
};
&pcie1 {
&pcie2 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0 0 0 0 0>;

View File

@ -122,7 +122,7 @@
};
};
&pcie1 {
&pcie2 {
wifi@0,0 {
compatible = "mediatek,mt76";
reg = <0x0 0 0 0 0>;

View File

@ -51,7 +51,7 @@ define Device/friendlyarm_nanopi-r5c
SOC := rk3568
UBOOT_DEVICE_NAME := nanopi-r5c-rk3568
IMAGE/sysupgrade.img.gz := boot-common | boot-script | pine64-img | gzip | append-metadata
DEVICE_PACKAGES := kmod-r8125 kmod-rtw88 wpad-basic-openssl
DEVICE_PACKAGES := kmod-r8125 kmod-rtw88 rtl8822ce-firmware wpad-basic-openssl
endef
TARGET_DEVICES += friendlyarm_nanopi-r5c

View File

@ -21,8 +21,6 @@
# build & install the final libc
# 7) toolchain/gcc/final/compile
# build & install the final gcc
# 8) toolchain/libc/utils/compile
# build & install libc utilities
#
# For musl, steps 2 and 4 are skipped, and step 3 is done after 5
@ -34,8 +32,8 @@ $(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN)
# builddir dependencies
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
ifdef CONFIG_USE_MUSL
$(curdir)/gcc/initial/compile:=$(curdir)/binutils/compile
$(curdir)/kernel-headers/compile:=$(curdir)/gcc/initial/compile
$(curdir)/$(LIBC)/compile:=$(curdir)/kernel-headers/compile
else
$(curdir)/builddirs += $(LIBC)/headers gcc/minimal
$(curdir)/gcc/minimal/compile:=$(curdir)/binutils/compile
@ -44,10 +42,8 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/headers/compile
endif
$(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile $(curdir)/kernel-headers/compile
$(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile
$(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile $(curdir)/kernel-headers/compile
$(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile
endif
ifndef DUMP_TARGET_DB
@ -85,12 +81,12 @@ $(curdir)/ := .config prereq
$(curdir)//compile = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk $(tools/stamp-compile)
ifndef DUMP_TARGET_DB
$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
$(TOOLCHAIN_DIR)/stamp/.gcc_final_installed:
endif
$(curdir)/install: $(curdir)/compile
$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR)))
$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc_final_installed,,$(TOOLCHAIN_DIR)))
$(eval $(call stampfile,$(curdir),toolchain,check,$(TMP_DIR)/.build))
$(eval $(call subdir,$(curdir)))

View File

@ -15,7 +15,7 @@ PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
PKG_SOURCE_DATE:=2022-03-17
PKG_SOURCE_VERSION:=afdd63fc386919b4aa40d573b0a6069414d14317
PKG_MIRROR_HASH:=caedb66cf6dcbdcee0d1525923e203d003ef15f34a13a328686794666f16171f
PKG_MIRROR_HASH:=59c294e00ddfc1f4bda658c7567584ce35fdd479c413ebdb1376981b27737be1
include $(INCLUDE_DIR)/host-build.mk