mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
kernel: bump 5.15 to 5.15.144 (#11728)
Signed-off-by: Beginner-Go <70857188+Beginner-Go@users.noreply.github.com>
This commit is contained in:
parent
d0f140b6c3
commit
60707924cc
@ -1,2 +1,2 @@
|
|||||||
LINUX_VERSION-5.15 = .143
|
LINUX_VERSION-5.15 = .144
|
||||||
LINUX_KERNEL_HASH-5.15.143 = 096bb16ec07232f27f6a07998c41b655883a8d0a6bb613d39bf524a9ffd99e02
|
LINUX_KERNEL_HASH-5.15.144 = f053afafafce771acbf478afdd16e9aa85b0a0e328205c4f53276062300a5b3b
|
||||||
|
@ -589,15 +589,15 @@ SVN-Revision: 35130
|
|||||||
* XXX skbs on the gro_list have all been parsed and pulled
|
* XXX skbs on the gro_list have all been parsed and pulled
|
||||||
--- a/include/net/addrconf.h
|
--- a/include/net/addrconf.h
|
||||||
+++ b/include/net/addrconf.h
|
+++ b/include/net/addrconf.h
|
||||||
@@ -47,7 +47,7 @@ struct prefix_info {
|
@@ -52,7 +52,7 @@ struct prefix_info {
|
||||||
__be32 reserved2;
|
__be32 reserved2;
|
||||||
|
|
||||||
struct in6_addr prefix;
|
struct in6_addr prefix;
|
||||||
-};
|
-};
|
||||||
+} __attribute__((packed, aligned(2)));
|
+} __attribute__((packed, aligned(2)));
|
||||||
|
|
||||||
#include <linux/ipv6.h>
|
/* rfc4861 4.6.2: IPv6 PIO is 32 bytes in size */
|
||||||
#include <linux/netdevice.h>
|
static_assert(sizeof(struct prefix_info) == 32);
|
||||||
--- a/include/net/inet_ecn.h
|
--- a/include/net/inet_ecn.h
|
||||||
+++ b/include/net/inet_ecn.h
|
+++ b/include/net/inet_ecn.h
|
||||||
@@ -138,9 +138,9 @@ static inline int IP6_ECN_set_ce(struct
|
@@ -138,9 +138,9 @@ static inline int IP6_ECN_set_ce(struct
|
||||||
|
@ -1,899 +0,0 @@
|
|||||||
From: Felix Fietkau <nbd@openwrt.org>
|
|
||||||
Subject: [PATCH] ar71xx: fix unaligned access in a few more places
|
|
||||||
|
|
||||||
SVN-Revision: 35130
|
|
||||||
---
|
|
||||||
arch/mips/include/asm/checksum.h | 83 +++---------------
|
|
||||||
include/uapi/linux/ip.h | 2 +-
|
|
||||||
include/uapi/linux/ipv6.h | 2 +-
|
|
||||||
include/uapi/linux/tcp.h | 4 ++--
|
|
||||||
include/uapi/linux/udp.h | 2 +-
|
|
||||||
net/netfilter/nf_conntrack_core.c | 4 ++--
|
|
||||||
include/uapi/linux/icmp.h | 2 +-
|
|
||||||
include/uapi/linux/in6.h | 2 +-
|
|
||||||
net/ipv6/tcp_ipv6.c | 9 +++--
|
|
||||||
net/ipv6/datagram.c | 6 ++--
|
|
||||||
net/ipv6/exthdrs.c | 2 +-
|
|
||||||
include/linux/types.h | 5 +++
|
|
||||||
net/ipv4/af_inet.c | 4 ++--
|
|
||||||
net/ipv4/tcp_output.c | 69 +++++++++--------
|
|
||||||
include/uapi/linux/igmp.h | 8 +++---
|
|
||||||
net/core/flow_dissector.c | 2 +-
|
|
||||||
include/uapi/linux/icmpv6.h | 2 +-
|
|
||||||
include/net/ndisc.h | 10 ++++----
|
|
||||||
net/sched/cls_u32.c | 6 +++---
|
|
||||||
net/ipv6/ip6_offload.c | 2 +-
|
|
||||||
include/net/addrconf.h | 2 +-
|
|
||||||
include/net/inet_ecn.h | 4 ++--
|
|
||||||
include/net/ipv6.h | 23 +++++----
|
|
||||||
include/net/secure_seq.h | 1 +
|
|
||||||
include/uapi/linux/in.h | 2 +-
|
|
||||||
net/ipv6/ip6_fib.h | 2 +-
|
|
||||||
net/netfilter/nf_conntrack_proto_tcp.c | 2 +-
|
|
||||||
net/xfrm/xfrm_input.c | 4 ++--
|
|
||||||
net/ipv4/tcp_input.c | 12 ++++---
|
|
||||||
include/uapi/linux/if_pppox.h | 1 +
|
|
||||||
net/ipv6/netfilter/nf_log_ipv6.c | 4 ++--
|
|
||||||
include/net/neighbour.h | 6 +++--
|
|
||||||
include/uapi/linux/netfilter_arp/arp_tables.h | 2 +-
|
|
||||||
net/core/utils.c | 10 +++++--
|
|
||||||
include/linux/etherdevice.h | 11 ++++---
|
|
||||||
net/ipv4/tcp_offload.c | 6 +++---
|
|
||||||
net/ipv6/netfilter/ip6table_mangle.c | 4 ++--
|
|
||||||
37 file changed, 171 insertions(+), 141 deletions(-)
|
|
||||||
|
|
||||||
--- a/arch/mips/include/asm/checksum.h
|
|
||||||
+++ b/arch/mips/include/asm/checksum.h
|
|
||||||
@@ -100,26 +100,30 @@ static inline __sum16 ip_fast_csum(const
|
|
||||||
const unsigned int *stop = word + ihl;
|
|
||||||
unsigned int csum;
|
|
||||||
int carry;
|
|
||||||
+ unsigned int w;
|
|
||||||
|
|
||||||
- csum = word[0];
|
|
||||||
- csum += word[1];
|
|
||||||
- carry = (csum < word[1]);
|
|
||||||
+ csum = net_hdr_word(word++);
|
|
||||||
+
|
|
||||||
+ w = net_hdr_word(word++);
|
|
||||||
+ csum += w;
|
|
||||||
+ carry = (csum < w);
|
|
||||||
csum += carry;
|
|
||||||
|
|
||||||
- csum += word[2];
|
|
||||||
- carry = (csum < word[2]);
|
|
||||||
+ w = net_hdr_word(word++);
|
|
||||||
+ csum += w;
|
|
||||||
+ carry = (csum < w);
|
|
||||||
csum += carry;
|
|
||||||
|
|
||||||
- csum += word[3];
|
|
||||||
- carry = (csum < word[3]);
|
|
||||||
+ w = net_hdr_word(word++);
|
|
||||||
+ csum += w;
|
|
||||||
+ carry = (csum < w);
|
|
||||||
csum += carry;
|
|
||||||
|
|
||||||
- word += 4;
|
|
||||||
do {
|
|
||||||
- csum += *word;
|
|
||||||
- carry = (csum < *word);
|
|
||||||
+ w = net_hdr_word(word++);
|
|
||||||
+ csum += w;
|
|
||||||
+ carry = (csum < w);
|
|
||||||
csum += carry;
|
|
||||||
- word++;
|
|
||||||
} while (word != stop);
|
|
||||||
|
|
||||||
return csum_fold(csum);
|
|
||||||
@@ -182,73 +186,6 @@ static inline __sum16 ip_compute_csum(co
|
|
||||||
return csum_fold(csum_partial(buff, len, 0));
|
|
||||||
}
|
|
||||||
|
|
||||||
-#define _HAVE_ARCH_IPV6_CSUM
|
|
||||||
-static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr,
|
|
||||||
- const struct in6_addr *daddr,
|
|
||||||
- __u32 len, __u8 proto,
|
|
||||||
- __wsum sum)
|
|
||||||
-{
|
|
||||||
- __wsum tmp;
|
|
||||||
-
|
|
||||||
- __asm__(
|
|
||||||
- " .set push # csum_ipv6_magic\n"
|
|
||||||
- " .set noreorder \n"
|
|
||||||
- " .set noat \n"
|
|
||||||
- " addu %0, %5 # proto (long in network byte order)\n"
|
|
||||||
- " sltu $1, %0, %5 \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
-
|
|
||||||
- " addu %0, %6 # csum\n"
|
|
||||||
- " sltu $1, %0, %6 \n"
|
|
||||||
- " lw %1, 0(%2) # four words source address\n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 4(%2) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 8(%2) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 12(%2) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 0(%3) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 4(%3) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 8(%3) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " lw %1, 12(%3) \n"
|
|
||||||
- " addu %0, $1 \n"
|
|
||||||
- " addu %0, %1 \n"
|
|
||||||
- " sltu $1, %0, %1 \n"
|
|
||||||
-
|
|
||||||
- " addu %0, $1 # Add final carry\n"
|
|
||||||
- " .set pop"
|
|
||||||
- : "=&r" (sum), "=&r" (tmp)
|
|
||||||
- : "r" (saddr), "r" (daddr),
|
|
||||||
- "0" (htonl(len)), "r" (htonl(proto)), "r" (sum));
|
|
||||||
-
|
|
||||||
- return csum_fold(sum);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
#include <asm-generic/checksum.h>
|
|
||||||
#endif /* CONFIG_GENERIC_CSUM */
|
|
||||||
|
|
||||||
--- a/include/uapi/linux/ip.h
|
|
||||||
+++ b/include/uapi/linux/ip.h
|
|
||||||
@@ -106,7 +106,7 @@ struct iphdr {
|
|
||||||
__be32 daddr;
|
|
||||||
);
|
|
||||||
/*The options start here. */
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
|
|
||||||
struct ip_auth_hdr {
|
|
||||||
--- a/include/uapi/linux/ipv6.h
|
|
||||||
+++ b/include/uapi/linux/ipv6.h
|
|
||||||
@@ -135,7 +135,7 @@ struct ipv6hdr {
|
|
||||||
struct in6_addr saddr;
|
|
||||||
struct in6_addr daddr;
|
|
||||||
);
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
|
|
||||||
/* index values for the variables in ipv6_devconf */
|
|
||||||
--- a/include/uapi/linux/tcp.h
|
|
||||||
+++ b/include/uapi/linux/tcp.h
|
|
||||||
@@ -55,7 +55,7 @@ struct tcphdr {
|
|
||||||
__be16 window;
|
|
||||||
__sum16 check;
|
|
||||||
__be16 urg_ptr;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The union cast uses a gcc extension to avoid aliasing problems
|
|
||||||
@@ -65,7 +65,7 @@ struct tcphdr {
|
|
||||||
union tcp_word_hdr {
|
|
||||||
struct tcphdr hdr;
|
|
||||||
__be32 words[5];
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
#define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3])
|
|
||||||
|
|
||||||
--- a/include/uapi/linux/udp.h
|
|
||||||
+++ b/include/uapi/linux/udp.h
|
|
||||||
@@ -25,7 +25,7 @@ struct udphdr {
|
|
||||||
__be16 dest;
|
|
||||||
__be16 len;
|
|
||||||
__sum16 check;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
/* UDP socket options */
|
|
||||||
#define UDP_CORK 1 /* Never send partially complete segments */
|
|
||||||
--- a/net/netfilter/nf_conntrack_core.c
|
|
||||||
+++ b/net/netfilter/nf_conntrack_core.c
|
|
||||||
@@ -308,8 +308,8 @@ nf_ct_get_tuple(const struct sk_buff *sk
|
|
||||||
|
|
||||||
switch (l3num) {
|
|
||||||
case NFPROTO_IPV4:
|
|
||||||
- tuple->src.u3.ip = ap[0];
|
|
||||||
- tuple->dst.u3.ip = ap[1];
|
|
||||||
+ tuple->src.u3.ip = net_hdr_word(ap++);
|
|
||||||
+ tuple->dst.u3.ip = net_hdr_word(ap);
|
|
||||||
break;
|
|
||||||
case NFPROTO_IPV6:
|
|
||||||
memcpy(tuple->src.u3.ip6, ap, sizeof(tuple->src.u3.ip6));
|
|
||||||
--- a/include/uapi/linux/icmp.h
|
|
||||||
+++ b/include/uapi/linux/icmp.h
|
|
||||||
@@ -102,7 +102,7 @@ struct icmphdr {
|
|
||||||
} frag;
|
|
||||||
__u8 reserved[4];
|
|
||||||
} un;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
--- a/include/uapi/linux/in6.h
|
|
||||||
+++ b/include/uapi/linux/in6.h
|
|
||||||
@@ -43,7 +43,7 @@ struct in6_addr {
|
|
||||||
#define s6_addr16 in6_u.u6_addr16
|
|
||||||
#define s6_addr32 in6_u.u6_addr32
|
|
||||||
#endif
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
#endif /* __UAPI_DEF_IN6_ADDR */
|
|
||||||
|
|
||||||
#if __UAPI_DEF_SOCKADDR_IN6
|
|
||||||
--- a/net/ipv6/tcp_ipv6.c
|
|
||||||
+++ b/net/ipv6/tcp_ipv6.c
|
|
||||||
@@ -35,6 +35,7 @@
|
|
||||||
#include <linux/ipsec.h>
|
|
||||||
#include <linux/times.h>
|
|
||||||
#include <linux/slab.h>
|
|
||||||
+#include <asm/unaligned.h>
|
|
||||||
#include <linux/uaccess.h>
|
|
||||||
#include <linux/ipv6.h>
|
|
||||||
#include <linux/icmpv6.h>
|
|
||||||
@@ -944,10 +945,10 @@ static void tcp_v6_send_response(const s
|
|
||||||
topt = (__be32 *)(t1 + 1);
|
|
||||||
|
|
||||||
if (tsecr) {
|
|
||||||
- *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
|
||||||
- (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP);
|
|
||||||
- *topt++ = htonl(tsval);
|
|
||||||
- *topt++ = htonl(tsecr);
|
|
||||||
+ put_unaligned_be32((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
|
||||||
+ (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP, topt++);
|
|
||||||
+ put_unaligned_be32(tsval, topt++);
|
|
||||||
+ put_unaligned_be32(tsecr, topt++);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mrst)
|
|
||||||
--- a/include/linux/ipv6.h
|
|
||||||
+++ b/include/linux/ipv6.h
|
|
||||||
@@ -6,6 +6,7 @@
|
|
||||||
|
|
||||||
#define ipv6_optlen(p) (((p)->hdrlen+1) << 3)
|
|
||||||
#define ipv6_authlen(p) (((p)->hdrlen+2) << 2)
|
|
||||||
+
|
|
||||||
/*
|
|
||||||
* This structure contains configuration options per IPv6 link.
|
|
||||||
*/
|
|
||||||
--- a/net/ipv6/datagram.c
|
|
||||||
+++ b/net/ipv6/datagram.c
|
|
||||||
@@ -492,7 +492,7 @@ int ipv6_recv_error(struct sock *sk, str
|
|
||||||
ipv6_iface_scope_id(&sin->sin6_addr,
|
|
||||||
IP6CB(skb)->iif);
|
|
||||||
} else {
|
|
||||||
- ipv6_addr_set_v4mapped(*(__be32 *)(nh + serr->addr_offset),
|
|
||||||
+ ipv6_addr_set_v4mapped(net_hdr_word(nh + serr->addr_offset),
|
|
||||||
&sin->sin6_addr);
|
|
||||||
sin->sin6_scope_id = 0;
|
|
||||||
}
|
|
||||||
@@ -846,12 +846,12 @@ int ip6_datagram_send_ctl(struct net *ne
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fl6->flowlabel&IPV6_FLOWINFO_MASK) {
|
|
||||||
- if ((fl6->flowlabel^*(__be32 *)CMSG_DATA(cmsg))&~IPV6_FLOWINFO_MASK) {
|
|
||||||
+ if ((fl6->flowlabel^net_hdr_word(CMSG_DATA(cmsg)))&~IPV6_FLOWINFO_MASK) {
|
|
||||||
err = -EINVAL;
|
|
||||||
goto exit_f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- fl6->flowlabel = IPV6_FLOWINFO_MASK & *(__be32 *)CMSG_DATA(cmsg);
|
|
||||||
+ fl6->flowlabel = IPV6_FLOWINFO_MASK & net_hdr_word(CMSG_DATA(cmsg));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IPV6_2292HOPOPTS:
|
|
||||||
--- a/net/ipv6/exthdrs.c
|
|
||||||
+++ b/net/ipv6/exthdrs.c
|
|
||||||
@@ -1002,7 +1002,7 @@ static bool ipv6_hop_jumbo(struct sk_buf
|
|
||||||
goto drop;
|
|
||||||
}
|
|
||||||
|
|
||||||
- pkt_len = ntohl(*(__be32 *)(nh + optoff + 2));
|
|
||||||
+ pkt_len = ntohl(net_hdr_word(nh + optoff + 2));
|
|
||||||
if (pkt_len <= IPV6_MAXPLEN) {
|
|
||||||
__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
|
|
||||||
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
|
|
||||||
--- a/include/linux/types.h
|
|
||||||
+++ b/include/linux/types.h
|
|
||||||
@@ -231,5 +231,11 @@ typedef void (*swap_func_t)(void *a, voi
|
|
||||||
typedef int (*cmp_r_func_t)(const void *a, const void *b, const void *priv);
|
|
||||||
typedef int (*cmp_func_t)(const void *a, const void *b);
|
|
||||||
|
|
||||||
+struct net_hdr_word {
|
|
||||||
+ u32 words[1];
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
+
|
|
||||||
+#define net_hdr_word(_p) (((struct net_hdr_word *) (_p))->words[0])
|
|
||||||
+
|
|
||||||
#endif /* __ASSEMBLY__ */
|
|
||||||
#endif /* _LINUX_TYPES_H */
|
|
||||||
--- a/net/ipv4/af_inet.c
|
|
||||||
+++ b/net/ipv4/af_inet.c
|
|
||||||
@@ -1477,8 +1477,8 @@ struct sk_buff *inet_gro_receive(struct
|
|
||||||
if (unlikely(ip_fast_csum((u8 *)iph, 5)))
|
|
||||||
goto out_unlock;
|
|
||||||
|
|
||||||
- id = ntohl(*(__be32 *)&iph->id);
|
|
||||||
- flush = (u16)((ntohl(*(__be32 *)iph) ^ skb_gro_len(skb)) | (id & ~IP_DF));
|
|
||||||
+ id = ntohl(net_hdr_word(&iph->id));
|
|
||||||
+ flush = (u16)((ntohl(net_hdr_word(iph)) ^ skb_gro_len(skb)) | (id & ~IP_DF));
|
|
||||||
id >>= 16;
|
|
||||||
|
|
||||||
list_for_each_entry(p, head, list) {
|
|
||||||
--- a/net/ipv4/tcp_output.c
|
|
||||||
+++ b/net/ipv4/tcp_output.c
|
|
||||||
@@ -609,48 +609,53 @@ static void tcp_options_write(__be32 *pt
|
|
||||||
u16 options = opts->options; /* mungable copy */
|
|
||||||
|
|
||||||
if (unlikely(OPTION_MD5 & options)) {
|
|
||||||
- *ptr++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
|
||||||
- (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG);
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
|
||||||
+ (TCPOPT_MD5SIG << 8) | TCPOLEN_MD5SIG);
|
|
||||||
/* overload cookie hash location */
|
|
||||||
opts->hash_location = (__u8 *)ptr;
|
|
||||||
ptr += 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unlikely(opts->mss)) {
|
|
||||||
- *ptr++ = htonl((TCPOPT_MSS << 24) |
|
|
||||||
- (TCPOLEN_MSS << 16) |
|
|
||||||
- opts->mss);
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_MSS << 24) | (TCPOLEN_MSS << 16) |
|
|
||||||
+ opts->mss);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (likely(OPTION_TS & options)) {
|
|
||||||
if (unlikely(OPTION_SACK_ADVERTISE & options)) {
|
|
||||||
- *ptr++ = htonl((TCPOPT_SACK_PERM << 24) |
|
|
||||||
- (TCPOLEN_SACK_PERM << 16) |
|
|
||||||
- (TCPOPT_TIMESTAMP << 8) |
|
|
||||||
- TCPOLEN_TIMESTAMP);
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_SACK_PERM << 24) |
|
|
||||||
+ (TCPOLEN_SACK_PERM << 16) |
|
|
||||||
+ (TCPOPT_TIMESTAMP << 8) |
|
|
||||||
+ TCPOLEN_TIMESTAMP);
|
|
||||||
options &= ~OPTION_SACK_ADVERTISE;
|
|
||||||
} else {
|
|
||||||
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
|
||||||
- (TCPOPT_NOP << 16) |
|
|
||||||
- (TCPOPT_TIMESTAMP << 8) |
|
|
||||||
- TCPOLEN_TIMESTAMP);
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_NOP << 24) |
|
|
||||||
+ (TCPOPT_NOP << 16) |
|
|
||||||
+ (TCPOPT_TIMESTAMP << 8) |
|
|
||||||
+ TCPOLEN_TIMESTAMP);
|
|
||||||
}
|
|
||||||
- *ptr++ = htonl(opts->tsval);
|
|
||||||
- *ptr++ = htonl(opts->tsecr);
|
|
||||||
+ net_hdr_word(ptr++) = htonl(opts->tsval);
|
|
||||||
+ net_hdr_word(ptr++) = htonl(opts->tsecr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unlikely(OPTION_SACK_ADVERTISE & options)) {
|
|
||||||
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
|
||||||
- (TCPOPT_NOP << 16) |
|
|
||||||
- (TCPOPT_SACK_PERM << 8) |
|
|
||||||
- TCPOLEN_SACK_PERM);
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_NOP << 24) |
|
|
||||||
+ (TCPOPT_NOP << 16) |
|
|
||||||
+ (TCPOPT_SACK_PERM << 8) |
|
|
||||||
+ TCPOLEN_SACK_PERM);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unlikely(OPTION_WSCALE & options)) {
|
|
||||||
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
|
||||||
- (TCPOPT_WINDOW << 16) |
|
|
||||||
- (TCPOLEN_WINDOW << 8) |
|
|
||||||
- opts->ws);
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_NOP << 24) |
|
|
||||||
+ (TCPOPT_WINDOW << 16) |
|
|
||||||
+ (TCPOLEN_WINDOW << 8) |
|
|
||||||
+ opts->ws);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (unlikely(opts->num_sack_blocks)) {
|
|
||||||
@@ -658,16 +663,17 @@ static void tcp_options_write(__be32 *pt
|
|
||||||
tp->duplicate_sack : tp->selective_acks;
|
|
||||||
int this_sack;
|
|
||||||
|
|
||||||
- *ptr++ = htonl((TCPOPT_NOP << 24) |
|
|
||||||
- (TCPOPT_NOP << 16) |
|
|
||||||
- (TCPOPT_SACK << 8) |
|
|
||||||
- (TCPOLEN_SACK_BASE + (opts->num_sack_blocks *
|
|
||||||
+ net_hdr_word(ptr++) =
|
|
||||||
+ htonl((TCPOPT_NOP << 24) |
|
|
||||||
+ (TCPOPT_NOP << 16) |
|
|
||||||
+ (TCPOPT_SACK << 8) |
|
|
||||||
+ (TCPOLEN_SACK_BASE + (opts->num_sack_blocks *
|
|
||||||
TCPOLEN_SACK_PERBLOCK)));
|
|
||||||
|
|
||||||
for (this_sack = 0; this_sack < opts->num_sack_blocks;
|
|
||||||
++this_sack) {
|
|
||||||
- *ptr++ = htonl(sp[this_sack].start_seq);
|
|
||||||
- *ptr++ = htonl(sp[this_sack].end_seq);
|
|
||||||
+ net_hdr_word(ptr++) = htonl(sp[this_sack].start_seq);
|
|
||||||
+ net_hdr_word(ptr++) = htonl(sp[this_sack].end_seq);
|
|
||||||
}
|
|
||||||
|
|
||||||
tp->rx_opt.dsack = 0;
|
|
||||||
@@ -680,13 +686,14 @@ static void tcp_options_write(__be32 *pt
|
|
||||||
|
|
||||||
if (foc->exp) {
|
|
||||||
len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len;
|
|
||||||
- *ptr = htonl((TCPOPT_EXP << 24) | (len << 16) |
|
|
||||||
+ net_hdr_word(ptr) =
|
|
||||||
+ htonl((TCPOPT_EXP << 24) | (len << 16) |
|
|
||||||
TCPOPT_FASTOPEN_MAGIC);
|
|
||||||
p += TCPOLEN_EXP_FASTOPEN_BASE;
|
|
||||||
} else {
|
|
||||||
len = TCPOLEN_FASTOPEN_BASE + foc->len;
|
|
||||||
- *p++ = TCPOPT_FASTOPEN;
|
|
||||||
- *p++ = len;
|
|
||||||
+ net_hdr_word(p++) = TCPOPT_FASTOPEN;
|
|
||||||
+ net_hdr_word(p++) = len;
|
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(p, foc->val, foc->len);
|
|
||||||
--- a/include/uapi/linux/igmp.h
|
|
||||||
+++ b/include/uapi/linux/igmp.h
|
|
||||||
@@ -33,7 +33,7 @@ struct igmphdr {
|
|
||||||
__u8 code; /* For newer IGMP */
|
|
||||||
__sum16 csum;
|
|
||||||
__be32 group;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
/* V3 group record types [grec_type] */
|
|
||||||
#define IGMPV3_MODE_IS_INCLUDE 1
|
|
||||||
@@ -49,7 +49,7 @@ struct igmpv3_grec {
|
|
||||||
__be16 grec_nsrcs;
|
|
||||||
__be32 grec_mca;
|
|
||||||
__be32 grec_src[0];
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
struct igmpv3_report {
|
|
||||||
__u8 type;
|
|
||||||
@@ -58,7 +58,7 @@ struct igmpv3_report {
|
|
||||||
__be16 resv2;
|
|
||||||
__be16 ngrec;
|
|
||||||
struct igmpv3_grec grec[0];
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
struct igmpv3_query {
|
|
||||||
__u8 type;
|
|
||||||
@@ -79,7 +79,7 @@ struct igmpv3_query {
|
|
||||||
__u8 qqic;
|
|
||||||
__be16 nsrcs;
|
|
||||||
__be32 srcs[0];
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
#define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */
|
|
||||||
#define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */
|
|
||||||
--- a/net/core/flow_dissector.c
|
|
||||||
+++ b/net/core/flow_dissector.c
|
|
||||||
@@ -129,7 +129,7 @@ __be32 __skb_flow_get_ports(const struct
|
|
||||||
ports = __skb_header_pointer(skb, thoff + poff,
|
|
||||||
sizeof(_ports), data, hlen, &_ports);
|
|
||||||
if (ports)
|
|
||||||
- return *ports;
|
|
||||||
+ return (__be32)net_hdr_word(ports);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
--- a/include/uapi/linux/icmpv6.h
|
|
||||||
+++ b/include/uapi/linux/icmpv6.h
|
|
||||||
@@ -78,7 +78,7 @@ struct icmp6hdr {
|
|
||||||
#define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other
|
|
||||||
#define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime
|
|
||||||
#define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
|
|
||||||
#define ICMPV6_ROUTER_PREF_LOW 0x3
|
|
||||||
--- a/include/net/ndisc.h
|
|
||||||
+++ b/include/net/ndisc.h
|
|
||||||
@@ -93,7 +93,7 @@ struct ra_msg {
|
|
||||||
struct icmp6hdr icmph;
|
|
||||||
__be32 reachable_time;
|
|
||||||
__be32 retrans_timer;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
struct rd_msg {
|
|
||||||
struct icmp6hdr icmph;
|
|
||||||
@@ -372,10 +372,10 @@ static inline u32 ndisc_hashfn(const voi
|
|
||||||
{
|
|
||||||
const u32 *p32 = pkey;
|
|
||||||
|
|
||||||
- return (((p32[0] ^ hash32_ptr(dev)) * hash_rnd[0]) +
|
|
||||||
- (p32[1] * hash_rnd[1]) +
|
|
||||||
- (p32[2] * hash_rnd[2]) +
|
|
||||||
- (p32[3] * hash_rnd[3]));
|
|
||||||
+ return (((net_hdr_word(&p32[0]) ^ hash32_ptr(dev)) * hash_rnd[0]) +
|
|
||||||
+ (net_hdr_word(&p32[1]) * hash_rnd[1]) +
|
|
||||||
+ (net_hdr_word(&p32[2]) * hash_rnd[2]) +
|
|
||||||
+ (net_hdr_word(&p32[3]) * hash_rnd[3]));
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct neighbour *__ipv6_neigh_lookup_noref(struct net_device *dev, const void *pkey)
|
|
||||||
--- a/net/sched/cls_u32.c
|
|
||||||
+++ b/net/sched/cls_u32.c
|
|
||||||
@@ -155,7 +155,7 @@ next_knode:
|
|
||||||
data = skb_header_pointer(skb, toff, 4, &hdata);
|
|
||||||
if (!data)
|
|
||||||
goto out;
|
|
||||||
- if ((*data ^ key->val) & key->mask) {
|
|
||||||
+ if ((net_hdr_word(data) ^ key->val) & key->mask) {
|
|
||||||
n = rcu_dereference_bh(n->next);
|
|
||||||
goto next_knode;
|
|
||||||
}
|
|
||||||
@@ -206,8 +206,8 @@ check_terminal:
|
|
||||||
&hdata);
|
|
||||||
if (!data)
|
|
||||||
goto out;
|
|
||||||
- sel = ht->divisor & u32_hash_fold(*data, &n->sel,
|
|
||||||
- n->fshift);
|
|
||||||
+ sel = ht->divisor & u32_hash_fold(net_hdr_word(data),
|
|
||||||
+ &n->sel, n->fshift);
|
|
||||||
}
|
|
||||||
if (!(n->sel.flags & (TC_U32_VAROFFSET | TC_U32_OFFSET | TC_U32_EAT)))
|
|
||||||
goto next_ht;
|
|
||||||
--- a/net/ipv6/ip6_offload.c
|
|
||||||
+++ b/net/ipv6/ip6_offload.c
|
|
||||||
@@ -241,7 +241,7 @@ INDIRECT_CALLABLE_SCOPE struct sk_buff *
|
|
||||||
continue;
|
|
||||||
|
|
||||||
iph2 = (struct ipv6hdr *)(p->data + off);
|
|
||||||
- first_word = *(__be32 *)iph ^ *(__be32 *)iph2;
|
|
||||||
+ first_word = net_hdr_word(iph) ^ net_hdr_word(iph2);
|
|
||||||
|
|
||||||
/* All fields must match except length and Traffic Class.
|
|
||||||
* XXX skbs on the gro_list have all been parsed and pulled
|
|
||||||
--- a/include/net/addrconf.h
|
|
||||||
+++ b/include/net/addrconf.h
|
|
||||||
@@ -47,7 +47,7 @@ struct prefix_info {
|
|
||||||
__be32 reserved2;
|
|
||||||
|
|
||||||
struct in6_addr prefix;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
#include <linux/ipv6.h>
|
|
||||||
#include <linux/netdevice.h>
|
|
||||||
--- a/include/net/inet_ecn.h
|
|
||||||
+++ b/include/net/inet_ecn.h
|
|
||||||
@@ -138,9 +138,9 @@ static inline int IP6_ECN_set_ce(struct
|
|
||||||
if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph)))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
- from = *(__be32 *)iph;
|
|
||||||
+ from = net_hdr_word(iph);
|
|
||||||
to = from | htonl(INET_ECN_CE << 20);
|
|
||||||
- *(__be32 *)iph = to;
|
|
||||||
+ net_hdr_word(iph) = to;
|
|
||||||
if (skb->ip_summed == CHECKSUM_COMPLETE)
|
|
||||||
skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from),
|
|
||||||
(__force __wsum)to);
|
|
||||||
--- a/include/net/ipv6.h
|
|
||||||
+++ b/include/net/ipv6.h
|
|
||||||
@@ -147,7 +147,7 @@ struct frag_hdr {
|
|
||||||
__u8 reserved;
|
|
||||||
__be16 frag_off;
|
|
||||||
__be32 identification;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
|
|
||||||
#define IP6_MF 0x0001
|
|
||||||
#define IP6_OFFSET 0xFFF8
|
|
||||||
@@ -561,8 +561,8 @@ static inline void __ipv6_addr_set_half(
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
- addr[0] = wh;
|
|
||||||
- addr[1] = wl;
|
|
||||||
+ net_hdr_word(&addr[0]) = wh;
|
|
||||||
+ net_hdr_word(&addr[1]) = wl;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void ipv6_addr_set(struct in6_addr *addr,
|
|
||||||
@@ -621,6 +621,8 @@ static inline bool ipv6_prefix_equal(con
|
|
||||||
const __be32 *a1 = addr1->s6_addr32;
|
|
||||||
const __be32 *a2 = addr2->s6_addr32;
|
|
||||||
unsigned int pdw, pbi;
|
|
||||||
+ /* Used for last <32-bit fraction of prefix */
|
|
||||||
+ u32 pbia1, pbia2;
|
|
||||||
|
|
||||||
/* check complete u32 in prefix */
|
|
||||||
pdw = prefixlen >> 5;
|
|
||||||
@@ -629,7 +631,9 @@ static inline bool ipv6_prefix_equal(con
|
|
||||||
|
|
||||||
/* check incomplete u32 in prefix */
|
|
||||||
pbi = prefixlen & 0x1f;
|
|
||||||
- if (pbi && ((a1[pdw] ^ a2[pdw]) & htonl((0xffffffff) << (32 - pbi))))
|
|
||||||
+ pbia1 = net_hdr_word(&a1[pdw]);
|
|
||||||
+ pbia2 = net_hdr_word(&a2[pdw]);
|
|
||||||
+ if (pbi && ((pbia1 ^ pbia2) & htonl((0xffffffff) << (32 - pbi))))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
@@ -746,13 +750,13 @@ static inline void ipv6_addr_set_v4mappe
|
|
||||||
*/
|
|
||||||
static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
|
|
||||||
{
|
|
||||||
- const __be32 *a1 = token1, *a2 = token2;
|
|
||||||
+ const struct in6_addr *a1 = token1, *a2 = token2;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
addrlen >>= 2;
|
|
||||||
|
|
||||||
for (i = 0; i < addrlen; i++) {
|
|
||||||
- __be32 xb = a1[i] ^ a2[i];
|
|
||||||
+ __be32 xb = a1->s6_addr32[i] ^ a2->s6_addr32[i];
|
|
||||||
if (xb)
|
|
||||||
return i * 32 + 31 - __fls(ntohl(xb));
|
|
||||||
}
|
|
||||||
@@ -946,17 +950,18 @@ static inline u32 ip6_multipath_hash_fie
|
|
||||||
static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
|
|
||||||
__be32 flowlabel)
|
|
||||||
{
|
|
||||||
- *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | flowlabel;
|
|
||||||
+ net_hdr_word((__be32 *)hdr) =
|
|
||||||
+ htonl(0x60000000 | (tclass << 20)) | flowlabel;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline __be32 ip6_flowinfo(const struct ipv6hdr *hdr)
|
|
||||||
{
|
|
||||||
- return *(__be32 *)hdr & IPV6_FLOWINFO_MASK;
|
|
||||||
+ return net_hdr_word((__be32 *)hdr) & IPV6_FLOWINFO_MASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline __be32 ip6_flowlabel(const struct ipv6hdr *hdr)
|
|
||||||
{
|
|
||||||
- return *(__be32 *)hdr & IPV6_FLOWLABEL_MASK;
|
|
||||||
+ return net_hdr_word((__be32 *)hdr) & IPV6_FLOWLABEL_MASK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline u8 ip6_tclass(__be32 flowinfo)
|
|
||||||
--- a/include/net/secure_seq.h
|
|
||||||
+++ b/include/net/secure_seq.h
|
|
||||||
@@ -3,6 +3,7 @@
|
|
||||||
#define _NET_SECURE_SEQ
|
|
||||||
|
|
||||||
#include <linux/types.h>
|
|
||||||
+#include <linux/in6.h>
|
|
||||||
|
|
||||||
u64 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
|
|
||||||
u64 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
|
|
||||||
--- a/include/uapi/linux/in.h
|
|
||||||
+++ b/include/uapi/linux/in.h
|
|
||||||
@@ -88,7 +88,7 @@ enum {
|
|
||||||
/* Internet address. */
|
|
||||||
struct in_addr {
|
|
||||||
__be32 s_addr;
|
|
||||||
-};
|
|
||||||
+} __attribute__((packed, aligned(2)));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define IP_TOS 1
|
|
||||||
--- a/net/ipv6/ip6_fib.c
|
|
||||||
+++ b/net/ipv6/ip6_fib.c
|
|
||||||
@@ -141,7 +141,7 @@ static __be32 addr_bit_set(const void *t
|
|
||||||
* See include/asm-generic/bitops/le.h.
|
|
||||||
*/
|
|
||||||
return (__force __be32)(1 << ((~fn_bit ^ BITOP_BE32_SWIZZLE) & 0x1f)) &
|
|
||||||
- addr[fn_bit >> 5];
|
|
||||||
+ net_hdr_word(&addr[fn_bit >> 5]);
|
|
||||||
}
|
|
||||||
|
|
||||||
struct fib6_info *fib6_info_alloc(gfp_t gfp_flags, bool with_fib6_nh)
|
|
||||||
--- a/net/netfilter/nf_conntrack_proto_tcp.c
|
|
||||||
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
|
|
||||||
@@ -400,7 +400,7 @@ static void tcp_sack(const struct sk_buf
|
|
||||||
|
|
||||||
/* Fast path for timestamp-only option */
|
|
||||||
if (length == TCPOLEN_TSTAMP_ALIGNED
|
|
||||||
- && *(__be32 *)ptr == htonl((TCPOPT_NOP << 24)
|
|
||||||
+ && net_hdr_word(ptr) == htonl((TCPOPT_NOP << 24)
|
|
||||||
| (TCPOPT_NOP << 16)
|
|
||||||
| (TCPOPT_TIMESTAMP << 8)
|
|
||||||
| TCPOLEN_TIMESTAMP))
|
|
||||||
--- a/net/xfrm/xfrm_input.c
|
|
||||||
+++ b/net/xfrm/xfrm_input.c
|
|
||||||
@@ -167,8 +167,8 @@ int xfrm_parse_spi(struct sk_buff *skb,
|
|
||||||
if (!pskb_may_pull(skb, hlen))
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
- *spi = *(__be32 *)(skb_transport_header(skb) + offset);
|
|
||||||
- *seq = *(__be32 *)(skb_transport_header(skb) + offset_seq);
|
|
||||||
+ *spi = net_hdr_word(skb_transport_header(skb) + offset);
|
|
||||||
+ *seq = net_hdr_word(skb_transport_header(skb) + offset_seq);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(xfrm_parse_spi);
|
|
||||||
--- a/net/ipv4/tcp_input.c
|
|
||||||
+++ b/net/ipv4/tcp_input.c
|
|
||||||
@@ -4171,14 +4171,16 @@ static bool tcp_parse_aligned_timestamp(
|
|
||||||
{
|
|
||||||
const __be32 *ptr = (const __be32 *)(th + 1);
|
|
||||||
|
|
||||||
- if (*ptr == htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16)
|
|
||||||
- | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) {
|
|
||||||
+ if (net_hdr_word(ptr) ==
|
|
||||||
+ htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) |
|
|
||||||
+ (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP)) {
|
|
||||||
tp->rx_opt.saw_tstamp = 1;
|
|
||||||
++ptr;
|
|
||||||
- tp->rx_opt.rcv_tsval = ntohl(*ptr);
|
|
||||||
+ tp->rx_opt.rcv_tsval = get_unaligned_be32(ptr);
|
|
||||||
++ptr;
|
|
||||||
- if (*ptr)
|
|
||||||
- tp->rx_opt.rcv_tsecr = ntohl(*ptr) - tp->tsoffset;
|
|
||||||
+ if (net_hdr_word(ptr))
|
|
||||||
+ tp->rx_opt.rcv_tsecr = get_unaligned_be32(ptr) -
|
|
||||||
+ tp->tsoffset;
|
|
||||||
else
|
|
||||||
tp->rx_opt.rcv_tsecr = 0;
|
|
||||||
return true;
|
|
||||||
--- a/include/uapi/linux/if_pppox.h
|
|
||||||
+++ b/include/uapi/linux/if_pppox.h
|
|
||||||
@@ -51,6 +51,7 @@ struct pppoe_addr {
|
|
||||||
*/
|
|
||||||
struct pptp_addr {
|
|
||||||
__u16 call_id;
|
|
||||||
+ __u16 pad;
|
|
||||||
struct in_addr sin_addr;
|
|
||||||
};
|
|
||||||
|
|
||||||
--- a/include/net/neighbour.h
|
|
||||||
+++ b/include/net/neighbour.h
|
|
||||||
@@ -270,8 +270,10 @@ static inline bool neigh_key_eq128(const
|
|
||||||
const u32 *n32 = (const u32 *)n->primary_key;
|
|
||||||
const u32 *p32 = pkey;
|
|
||||||
|
|
||||||
- return ((n32[0] ^ p32[0]) | (n32[1] ^ p32[1]) |
|
|
||||||
- (n32[2] ^ p32[2]) | (n32[3] ^ p32[3])) == 0;
|
|
||||||
+ return ((n32[0] ^ net_hdr_word(&p32[0])) |
|
|
||||||
+ (n32[1] ^ net_hdr_word(&p32[1])) |
|
|
||||||
+ (n32[2] ^ net_hdr_word(&p32[2])) |
|
|
||||||
+ (n32[3] ^ net_hdr_word(&p32[3]))) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline struct neighbour *___neigh_lookup_noref(
|
|
||||||
--- a/include/uapi/linux/netfilter_arp/arp_tables.h
|
|
||||||
+++ b/include/uapi/linux/netfilter_arp/arp_tables.h
|
|
||||||
@@ -70,7 +70,7 @@ struct arpt_arp {
|
|
||||||
__u8 flags;
|
|
||||||
/* Inverse flags */
|
|
||||||
__u16 invflags;
|
|
||||||
-};
|
|
||||||
+} __attribute__((aligned(4)));
|
|
||||||
|
|
||||||
/* Values for "flag" field in struct arpt_ip (general arp structure).
|
|
||||||
* No flags defined yet.
|
|
||||||
--- a/net/core/utils.c
|
|
||||||
+++ b/net/core/utils.c
|
|
||||||
@@ -460,8 +460,14 @@ void inet_proto_csum_replace16(__sum16 *
|
|
||||||
bool pseudohdr)
|
|
||||||
{
|
|
||||||
__be32 diff[] = {
|
|
||||||
- ~from[0], ~from[1], ~from[2], ~from[3],
|
|
||||||
- to[0], to[1], to[2], to[3],
|
|
||||||
+ ~net_hdr_word(&from[0]),
|
|
||||||
+ ~net_hdr_word(&from[1]),
|
|
||||||
+ ~net_hdr_word(&from[2]),
|
|
||||||
+ ~net_hdr_word(&from[3]),
|
|
||||||
+ net_hdr_word(&to[0]),
|
|
||||||
+ net_hdr_word(&to[1]),
|
|
||||||
+ net_hdr_word(&to[2]),
|
|
||||||
+ net_hdr_word(&to[3]),
|
|
||||||
};
|
|
||||||
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
|
||||||
*sum = csum_fold(csum_partial(diff, sizeof(diff),
|
|
||||||
--- a/include/linux/etherdevice.h
|
|
||||||
+++ b/include/linux/etherdevice.h
|
|
||||||
@@ -525,7 +525,7 @@ static inline bool is_etherdev_addr(cons
|
|
||||||
* @b: Pointer to Ethernet header
|
|
||||||
*
|
|
||||||
* Compare two Ethernet headers, returns 0 if equal.
|
|
||||||
- * This assumes that the network header (i.e., IP header) is 4-byte
|
|
||||||
+ * This assumes that the network header (i.e., IP header) is 2-byte
|
|
||||||
* aligned OR the platform can handle unaligned access. This is the
|
|
||||||
* case for all packets coming into netif_receive_skb or similar
|
|
||||||
* entry points.
|
|
||||||
@@ -548,11 +548,12 @@ static inline unsigned long compare_ethe
|
|
||||||
fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
|
|
||||||
return fold;
|
|
||||||
#else
|
|
||||||
- u32 *a32 = (u32 *)((u8 *)a + 2);
|
|
||||||
- u32 *b32 = (u32 *)((u8 *)b + 2);
|
|
||||||
+ const u16 *a16 = a;
|
|
||||||
+ const u16 *b16 = b;
|
|
||||||
|
|
||||||
- return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
|
|
||||||
- (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
|
|
||||||
+ return (a16[0] ^ b16[0]) | (a16[1] ^ b16[1]) | (a16[2] ^ b16[2]) |
|
|
||||||
+ (a16[3] ^ b16[3]) | (a16[4] ^ b16[4]) | (a16[5] ^ b16[5]) |
|
|
||||||
+ (a16[6] ^ b16[6]);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
--- a/net/ipv4/tcp_offload.c
|
|
||||||
+++ b/net/ipv4/tcp_offload.c
|
|
||||||
@@ -223,7 +223,7 @@ struct sk_buff *tcp_gro_receive(struct l
|
|
||||||
|
|
||||||
th2 = tcp_hdr(p);
|
|
||||||
|
|
||||||
- if (*(u32 *)&th->source ^ *(u32 *)&th2->source) {
|
|
||||||
+ if (net_hdr_word(&th->source) ^ net_hdr_word(&th2->source)) {
|
|
||||||
NAPI_GRO_CB(p)->same_flow = 0;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
@@ -241,8 +241,8 @@ found:
|
|
||||||
~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH));
|
|
||||||
flush |= (__force int)(th->ack_seq ^ th2->ack_seq);
|
|
||||||
for (i = sizeof(*th); i < thlen; i += 4)
|
|
||||||
- flush |= *(u32 *)((u8 *)th + i) ^
|
|
||||||
- *(u32 *)((u8 *)th2 + i);
|
|
||||||
+ flush |= net_hdr_word((u8 *)th + i) ^
|
|
||||||
+ net_hdr_word((u8 *)th2 + i);
|
|
||||||
|
|
||||||
/* When we receive our second frame we can made a decision on if we
|
|
||||||
* continue this flow as an atomic flow with a fixed ID or if we use
|
|
||||||
--- a/net/ipv6/netfilter/ip6table_mangle.c
|
|
||||||
+++ b/net/ipv6/netfilter/ip6table_mangle.c
|
|
||||||
@@ -44,7 +44,7 @@ ip6t_mangle_out(struct sk_buff *skb, con
|
|
||||||
hop_limit = ipv6_hdr(skb)->hop_limit;
|
|
||||||
|
|
||||||
/* flowlabel and prio (includes version, which shouldn't change either */
|
|
||||||
- flowlabel = *((u_int32_t *)ipv6_hdr(skb));
|
|
||||||
+ flowlabel = net_hdr_word(ipv6_hdr(skb));
|
|
||||||
|
|
||||||
ret = ip6t_do_table(skb, state, priv);
|
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ ip6t_mangle_out(struct sk_buff *skb, con
|
|
||||||
!ipv6_addr_equal(&ipv6_hdr(skb)->daddr, &daddr) ||
|
|
||||||
skb->mark != mark ||
|
|
||||||
ipv6_hdr(skb)->hop_limit != hop_limit ||
|
|
||||||
- flowlabel != *((u_int32_t *)ipv6_hdr(skb)))) {
|
|
||||||
+ flowlabel != net_hdr_word(ipv6_hdr(skb)))) {
|
|
||||||
err = ip6_route_me_harder(state->net, state->sk, skb);
|
|
||||||
if (err < 0)
|
|
||||||
ret = NF_DROP_ERR(err);
|
|
@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
|||||||
#define USB_VENDOR_ID_BELKIN 0x050d
|
#define USB_VENDOR_ID_BELKIN 0x050d
|
||||||
#define USB_DEVICE_ID_FLIP_KVM 0x3201
|
#define USB_DEVICE_ID_FLIP_KVM 0x3201
|
||||||
|
|
||||||
@@ -1319,6 +1322,9 @@
|
@@ -1322,6 +1325,9 @@
|
||||||
#define USB_VENDOR_ID_XAT 0x2505
|
#define USB_VENDOR_ID_XAT 0x2505
|
||||||
#define USB_DEVICE_ID_XAT_CSR 0x0220
|
#define USB_DEVICE_ID_XAT_CSR 0x0220
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
|||||||
#define USB_DEVICE_ID_THT_2P_ARCADE 0x75e1
|
#define USB_DEVICE_ID_THT_2P_ARCADE 0x75e1
|
||||||
--- a/drivers/hid/hid-quirks.c
|
--- a/drivers/hid/hid-quirks.c
|
||||||
+++ b/drivers/hid/hid-quirks.c
|
+++ b/drivers/hid/hid-quirks.c
|
||||||
@@ -41,6 +41,7 @@ static const struct hid_device_id hid_qu
|
@@ -42,6 +42,7 @@ static const struct hid_device_id hid_qu
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS682), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS682), HID_QUIRK_NOGET },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS692), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS692), HID_QUIRK_NOGET },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_UC100KM), HID_QUIRK_NOGET },
|
||||||
@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
|
|||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
|
||||||
@@ -199,6 +200,7 @@ static const struct hid_device_id hid_qu
|
@@ -200,6 +201,7 @@ static const struct hid_device_id hid_qu
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
|
||||||
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
|
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
|
||||||
|
@ -329,7 +329,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
|||||||
|
|
||||||
--- a/arch/arm64/include/asm/pgtable.h
|
--- a/arch/arm64/include/asm/pgtable.h
|
||||||
+++ b/arch/arm64/include/asm/pgtable.h
|
+++ b/arch/arm64/include/asm/pgtable.h
|
||||||
@@ -999,23 +999,13 @@ static inline void update_mmu_cache(stru
|
@@ -1005,23 +1005,13 @@ static inline void update_mmu_cache(stru
|
||||||
* page after fork() + CoW for pfn mappings. We don't always have a
|
* page after fork() + CoW for pfn mappings. We don't always have a
|
||||||
* hardware-managed access flag on arm64.
|
* hardware-managed access flag on arm64.
|
||||||
*/
|
*/
|
||||||
|
@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
ret = stmmac_hw_setup(dev, true);
|
ret = stmmac_hw_setup(dev, true);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
|
||||||
@@ -6432,6 +6425,7 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6429,6 +6422,7 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_clear_rx_descriptors(priv, queue);
|
stmmac_clear_rx_descriptors(priv, queue);
|
||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
@@ -6493,6 +6487,7 @@ void stmmac_enable_tx_queue(struct stmma
|
@@ -6490,6 +6484,7 @@ void stmmac_enable_tx_queue(struct stmma
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
stmmac_clear_tx_descriptors(priv, queue);
|
stmmac_clear_tx_descriptors(priv, queue);
|
||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
@@ -7417,6 +7412,25 @@ int stmmac_suspend(struct device *dev)
|
@@ -7414,6 +7409,25 @@ int stmmac_suspend(struct device *dev)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
EXPORT_SYMBOL_GPL(stmmac_suspend);
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
/**
|
/**
|
||||||
* stmmac_reset_queues_param - reset queue parameters
|
* stmmac_reset_queues_param - reset queue parameters
|
||||||
* @priv: device pointer
|
* @priv: device pointer
|
||||||
@@ -7427,22 +7441,11 @@ static void stmmac_reset_queues_param(st
|
@@ -7424,22 +7438,11 @@ static void stmmac_reset_queues_param(st
|
||||||
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
u32 tx_cnt = priv->plat->tx_queues_to_use;
|
||||||
u32 queue;
|
u32 queue;
|
||||||
|
|
||||||
|
@ -874,7 +874,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
tx_q->cur_tx = entry;
|
tx_q->cur_tx = entry;
|
||||||
|
|
||||||
if (netif_msg_pktdata(priv)) {
|
if (netif_msg_pktdata(priv)) {
|
||||||
@@ -4515,7 +4515,7 @@ static void stmmac_rx_vlan(struct net_de
|
@@ -4512,7 +4512,7 @@ static void stmmac_rx_vlan(struct net_de
|
||||||
*/
|
*/
|
||||||
static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
|
static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -883,7 +883,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
int dirty = stmmac_rx_dirty(priv, queue);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int entry = rx_q->dirty_rx;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
|
|
||||||
@@ -4565,7 +4565,7 @@ static inline void stmmac_rx_refill(stru
|
@@ -4562,7 +4562,7 @@ static inline void stmmac_rx_refill(stru
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
stmmac_set_rx_owner(priv, p, use_rx_wd);
|
stmmac_set_rx_owner(priv, p, use_rx_wd);
|
||||||
|
|
||||||
@ -892,7 +892,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
rx_q->dirty_rx = entry;
|
rx_q->dirty_rx = entry;
|
||||||
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
|
rx_q->rx_tail_addr = rx_q->dma_rx_phy +
|
||||||
@@ -4593,12 +4593,12 @@ static unsigned int stmmac_rx_buf1_len(s
|
@@ -4590,12 +4590,12 @@ static unsigned int stmmac_rx_buf1_len(s
|
||||||
|
|
||||||
/* First descriptor, not last descriptor and not split header */
|
/* First descriptor, not last descriptor and not split header */
|
||||||
if (status & rx_not_ls)
|
if (status & rx_not_ls)
|
||||||
@ -907,7 +907,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
|
static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
|
||||||
@@ -4614,7 +4614,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
@@ -4611,7 +4611,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
||||||
|
|
||||||
/* Not last descriptor */
|
/* Not last descriptor */
|
||||||
if (status & rx_not_ls)
|
if (status & rx_not_ls)
|
||||||
@ -916,7 +916,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
plen = stmmac_get_rx_frame_len(priv, p, coe);
|
||||||
|
|
||||||
@@ -4625,7 +4625,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
@@ -4622,7 +4622,7 @@ static unsigned int stmmac_rx_buf2_len(s
|
||||||
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
|
static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
|
||||||
struct xdp_frame *xdpf, bool dma_map)
|
struct xdp_frame *xdpf, bool dma_map)
|
||||||
{
|
{
|
||||||
@ -925,7 +925,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int entry = tx_q->cur_tx;
|
unsigned int entry = tx_q->cur_tx;
|
||||||
struct dma_desc *tx_desc;
|
struct dma_desc *tx_desc;
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
@@ -4688,7 +4688,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
|
@@ -4685,7 +4685,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
|
||||||
|
|
||||||
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
stmmac_enable_dma_transmission(priv, priv->ioaddr);
|
||||||
|
|
||||||
@ -934,7 +934,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
tx_q->cur_tx = entry;
|
tx_q->cur_tx = entry;
|
||||||
|
|
||||||
return STMMAC_XDP_TX;
|
return STMMAC_XDP_TX;
|
||||||
@@ -4862,7 +4862,7 @@ static void stmmac_dispatch_skb_zc(struc
|
@@ -4859,7 +4859,7 @@ static void stmmac_dispatch_skb_zc(struc
|
||||||
|
|
||||||
static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
|
||||||
{
|
{
|
||||||
@ -943,7 +943,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int entry = rx_q->dirty_rx;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
struct dma_desc *rx_desc = NULL;
|
struct dma_desc *rx_desc = NULL;
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
@@ -4905,7 +4905,7 @@ static bool stmmac_rx_refill_zc(struct s
|
@@ -4902,7 +4902,7 @@ static bool stmmac_rx_refill_zc(struct s
|
||||||
dma_wmb();
|
dma_wmb();
|
||||||
stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
|
stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
|
||||||
|
|
||||||
@ -952,7 +952,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rx_desc) {
|
if (rx_desc) {
|
||||||
@@ -4920,7 +4920,7 @@ static bool stmmac_rx_refill_zc(struct s
|
@@ -4917,7 +4917,7 @@ static bool stmmac_rx_refill_zc(struct s
|
||||||
|
|
||||||
static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
|
static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
|
||||||
{
|
{
|
||||||
@ -961,7 +961,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
unsigned int count = 0, error = 0, len = 0;
|
unsigned int count = 0, error = 0, len = 0;
|
||||||
int dirty = stmmac_rx_dirty(priv, queue);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int next_entry = rx_q->cur_rx;
|
unsigned int next_entry = rx_q->cur_rx;
|
||||||
@@ -4942,7 +4942,7 @@ static int stmmac_rx_zc(struct stmmac_pr
|
@@ -4939,7 +4939,7 @@ static int stmmac_rx_zc(struct stmmac_pr
|
||||||
desc_size = sizeof(struct dma_desc);
|
desc_size = sizeof(struct dma_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -970,7 +970,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->dma_rx_phy, desc_size);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
@@ -4989,7 +4989,7 @@ read_again:
|
@@ -4986,7 +4986,7 @@ read_again:
|
||||||
|
|
||||||
/* Prefetch the next RX descriptor */
|
/* Prefetch the next RX descriptor */
|
||||||
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
||||||
@ -979,7 +979,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
next_entry = rx_q->cur_rx;
|
next_entry = rx_q->cur_rx;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -5110,7 +5110,7 @@ read_again:
|
@@ -5107,7 +5107,7 @@ read_again:
|
||||||
*/
|
*/
|
||||||
static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
|
||||||
{
|
{
|
||||||
@ -988,7 +988,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned int count = 0, error = 0, len = 0;
|
unsigned int count = 0, error = 0, len = 0;
|
||||||
int status = 0, coe = priv->hw->rx_csum;
|
int status = 0, coe = priv->hw->rx_csum;
|
||||||
@@ -5123,7 +5123,7 @@ static int stmmac_rx(struct stmmac_priv
|
@@ -5120,7 +5120,7 @@ static int stmmac_rx(struct stmmac_priv
|
||||||
int buf_sz;
|
int buf_sz;
|
||||||
|
|
||||||
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
|
dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
|
||||||
@ -997,7 +997,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (netif_msg_rx_status(priv)) {
|
if (netif_msg_rx_status(priv)) {
|
||||||
void *rx_head;
|
void *rx_head;
|
||||||
@@ -5137,7 +5137,7 @@ static int stmmac_rx(struct stmmac_priv
|
@@ -5134,7 +5134,7 @@ static int stmmac_rx(struct stmmac_priv
|
||||||
desc_size = sizeof(struct dma_desc);
|
desc_size = sizeof(struct dma_desc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1006,7 +1006,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->dma_rx_phy, desc_size);
|
rx_q->dma_rx_phy, desc_size);
|
||||||
}
|
}
|
||||||
while (count < limit) {
|
while (count < limit) {
|
||||||
@@ -5181,7 +5181,7 @@ read_again:
|
@@ -5178,7 +5178,7 @@ read_again:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
|
||||||
@ -1015,7 +1015,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
next_entry = rx_q->cur_rx;
|
next_entry = rx_q->cur_rx;
|
||||||
|
|
||||||
if (priv->extend_desc)
|
if (priv->extend_desc)
|
||||||
@@ -5315,7 +5315,7 @@ read_again:
|
@@ -5312,7 +5312,7 @@ read_again:
|
||||||
buf1_len, dma_dir);
|
buf1_len, dma_dir);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->page, buf->page_offset, buf1_len,
|
buf->page, buf->page_offset, buf1_len,
|
||||||
@ -1024,7 +1024,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->page);
|
page_pool_release_page(rx_q->page_pool, buf->page);
|
||||||
@@ -5327,7 +5327,7 @@ read_again:
|
@@ -5324,7 +5324,7 @@ read_again:
|
||||||
buf2_len, dma_dir);
|
buf2_len, dma_dir);
|
||||||
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
|
||||||
buf->sec_page, 0, buf2_len,
|
buf->sec_page, 0, buf2_len,
|
||||||
@ -1033,7 +1033,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Data payload appended into SKB */
|
/* Data payload appended into SKB */
|
||||||
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
page_pool_release_page(rx_q->page_pool, buf->sec_page);
|
||||||
@@ -5770,11 +5770,13 @@ static irqreturn_t stmmac_safety_interru
|
@@ -5767,11 +5767,13 @@ static irqreturn_t stmmac_safety_interru
|
||||||
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
|
static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
|
struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
|
||||||
@ -1048,7 +1048,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (unlikely(!data)) {
|
if (unlikely(!data)) {
|
||||||
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
||||||
@@ -5814,10 +5816,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
|
@@ -5811,10 +5813,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
|
||||||
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
|
static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
|
||||||
{
|
{
|
||||||
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
|
struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
|
||||||
@ -1062,7 +1062,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (unlikely(!data)) {
|
if (unlikely(!data)) {
|
||||||
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
|
||||||
@@ -5848,10 +5852,10 @@ static void stmmac_poll_controller(struc
|
@@ -5845,10 +5849,10 @@ static void stmmac_poll_controller(struc
|
||||||
|
|
||||||
if (priv->plat->multi_msi_en) {
|
if (priv->plat->multi_msi_en) {
|
||||||
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
|
for (i = 0; i < priv->plat->rx_queues_to_use; i++)
|
||||||
@ -1075,7 +1075,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
} else {
|
} else {
|
||||||
disable_irq(dev->irq);
|
disable_irq(dev->irq);
|
||||||
stmmac_interrupt(dev->irq, dev);
|
stmmac_interrupt(dev->irq, dev);
|
||||||
@@ -6032,34 +6036,34 @@ static int stmmac_rings_status_show(stru
|
@@ -6029,34 +6033,34 @@ static int stmmac_rings_status_show(stru
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
for (queue = 0; queue < rx_count; queue++) {
|
for (queue = 0; queue < rx_count; queue++) {
|
||||||
@ -1116,7 +1116,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6406,7 +6410,7 @@ void stmmac_disable_rx_queue(struct stmm
|
@@ -6403,7 +6407,7 @@ void stmmac_disable_rx_queue(struct stmm
|
||||||
|
|
||||||
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1125,7 +1125,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
@@ -6443,7 +6447,7 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6440,7 +6444,7 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
@ -1134,7 +1134,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6469,7 +6473,7 @@ void stmmac_disable_tx_queue(struct stmm
|
@@ -6466,7 +6470,7 @@ void stmmac_disable_tx_queue(struct stmm
|
||||||
|
|
||||||
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1143,7 +1143,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
struct stmmac_channel *ch = &priv->channel[queue];
|
struct stmmac_channel *ch = &priv->channel[queue];
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -6519,7 +6523,7 @@ void stmmac_xdp_release(struct net_devic
|
@@ -6516,7 +6520,7 @@ void stmmac_xdp_release(struct net_devic
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -1152,7 +1152,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Free the IRQ lines */
|
/* Free the IRQ lines */
|
||||||
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
|
stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
|
||||||
@@ -6578,7 +6582,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6575,7 +6579,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
/* DMA RX Channel Configuration */
|
/* DMA RX Channel Configuration */
|
||||||
for (chan = 0; chan < rx_cnt; chan++) {
|
for (chan = 0; chan < rx_cnt; chan++) {
|
||||||
@ -1161,7 +1161,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, chan);
|
rx_q->dma_rx_phy, chan);
|
||||||
@@ -6596,7 +6600,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6593,7 +6597,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
} else {
|
} else {
|
||||||
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
stmmac_set_dma_bfsize(priv, priv->ioaddr,
|
||||||
@ -1170,7 +1170,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
rx_q->queue_index);
|
rx_q->queue_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6605,7 +6609,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6602,7 +6606,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
/* DMA TX Channel Configuration */
|
/* DMA TX Channel Configuration */
|
||||||
for (chan = 0; chan < tx_cnt; chan++) {
|
for (chan = 0; chan < tx_cnt; chan++) {
|
||||||
@ -1179,7 +1179,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, chan);
|
tx_q->dma_tx_phy, chan);
|
||||||
@@ -6638,7 +6642,7 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6635,7 +6639,7 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
|
|
||||||
irq_error:
|
irq_error:
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -1188,7 +1188,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@@ -6665,8 +6669,8 @@ int stmmac_xsk_wakeup(struct net_device
|
@@ -6662,8 +6666,8 @@ int stmmac_xsk_wakeup(struct net_device
|
||||||
queue >= priv->plat->tx_queues_to_use)
|
queue >= priv->plat->tx_queues_to_use)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@ -1199,7 +1199,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
ch = &priv->channel[queue];
|
ch = &priv->channel[queue];
|
||||||
|
|
||||||
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
|
if (!rx_q->xsk_pool && !tx_q->xsk_pool)
|
||||||
@@ -6926,8 +6930,8 @@ int stmmac_reinit_ringparam(struct net_d
|
@@ -6923,8 +6927,8 @@ int stmmac_reinit_ringparam(struct net_d
|
||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
stmmac_release(dev);
|
stmmac_release(dev);
|
||||||
|
|
||||||
@ -1210,7 +1210,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
ret = stmmac_open(dev);
|
ret = stmmac_open(dev);
|
||||||
@@ -7362,7 +7366,7 @@ int stmmac_suspend(struct device *dev)
|
@@ -7359,7 +7363,7 @@ int stmmac_suspend(struct device *dev)
|
||||||
stmmac_disable_all_queues(priv);
|
stmmac_disable_all_queues(priv);
|
||||||
|
|
||||||
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
|
||||||
@ -1219,7 +1219,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
if (priv->eee_enabled) {
|
if (priv->eee_enabled) {
|
||||||
priv->tx_path_in_lpi_mode = false;
|
priv->tx_path_in_lpi_mode = false;
|
||||||
@@ -7414,7 +7418,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
|
@@ -7411,7 +7415,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
|
||||||
|
|
||||||
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
@ -1228,7 +1228,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
rx_q->cur_rx = 0;
|
rx_q->cur_rx = 0;
|
||||||
rx_q->dirty_rx = 0;
|
rx_q->dirty_rx = 0;
|
||||||
@@ -7422,7 +7426,7 @@ static void stmmac_reset_rx_queue(struct
|
@@ -7419,7 +7423,7 @@ static void stmmac_reset_rx_queue(struct
|
||||||
|
|
||||||
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
{
|
{
|
||||||
|
@ -1045,7 +1045,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Disable the MAC Rx/Tx */
|
/* Disable the MAC Rx/Tx */
|
||||||
stmmac_mac_set(priv, priv->ioaddr, false);
|
stmmac_mac_set(priv, priv->ioaddr, false);
|
||||||
@@ -6405,7 +6521,7 @@ void stmmac_disable_rx_queue(struct stmm
|
@@ -6402,7 +6518,7 @@ void stmmac_disable_rx_queue(struct stmm
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
|
|
||||||
stmmac_stop_rx_dma(priv, queue);
|
stmmac_stop_rx_dma(priv, queue);
|
||||||
@ -1054,7 +1054,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
@@ -6416,21 +6532,21 @@ void stmmac_enable_rx_queue(struct stmma
|
@@ -6413,21 +6529,21 @@ void stmmac_enable_rx_queue(struct stmma
|
||||||
u32 buf_size;
|
u32 buf_size;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1080,7 +1080,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
rx_q->dma_rx_phy, rx_q->queue_index);
|
rx_q->dma_rx_phy, rx_q->queue_index);
|
||||||
@@ -6468,7 +6584,7 @@ void stmmac_disable_tx_queue(struct stmm
|
@@ -6465,7 +6581,7 @@ void stmmac_disable_tx_queue(struct stmm
|
||||||
spin_unlock_irqrestore(&ch->lock, flags);
|
spin_unlock_irqrestore(&ch->lock, flags);
|
||||||
|
|
||||||
stmmac_stop_tx_dma(priv, queue);
|
stmmac_stop_tx_dma(priv, queue);
|
||||||
@ -1089,7 +1089,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
|
||||||
@@ -6478,21 +6594,21 @@ void stmmac_enable_tx_queue(struct stmma
|
@@ -6475,21 +6591,21 @@ void stmmac_enable_tx_queue(struct stmma
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1115,7 +1115,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
|
||||||
tx_q->dma_tx_phy, tx_q->queue_index);
|
tx_q->dma_tx_phy, tx_q->queue_index);
|
||||||
@@ -6532,7 +6648,7 @@ void stmmac_xdp_release(struct net_devic
|
@@ -6529,7 +6645,7 @@ void stmmac_xdp_release(struct net_devic
|
||||||
stmmac_stop_all_dma(priv);
|
stmmac_stop_all_dma(priv);
|
||||||
|
|
||||||
/* Release and free the Rx/Tx resources */
|
/* Release and free the Rx/Tx resources */
|
||||||
@ -1124,7 +1124,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
/* Disable the MAC Rx/Tx */
|
/* Disable the MAC Rx/Tx */
|
||||||
stmmac_mac_set(priv, priv->ioaddr, false);
|
stmmac_mac_set(priv, priv->ioaddr, false);
|
||||||
@@ -6557,14 +6673,14 @@ int stmmac_xdp_open(struct net_device *d
|
@@ -6554,14 +6670,14 @@ int stmmac_xdp_open(struct net_device *d
|
||||||
u32 chan;
|
u32 chan;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@ -1141,7 +1141,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
|
netdev_err(dev, "%s: DMA descriptors initialization failed\n",
|
||||||
__func__);
|
__func__);
|
||||||
@@ -6646,7 +6762,7 @@ irq_error:
|
@@ -6643,7 +6759,7 @@ irq_error:
|
||||||
|
|
||||||
stmmac_hw_teardown(dev);
|
stmmac_hw_teardown(dev);
|
||||||
init_error:
|
init_error:
|
||||||
@ -1150,7 +1150,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
dma_desc_error:
|
dma_desc_error:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -7509,7 +7625,7 @@ int stmmac_resume(struct device *dev)
|
@@ -7506,7 +7622,7 @@ int stmmac_resume(struct device *dev)
|
||||||
stmmac_reset_queues_param(priv);
|
stmmac_reset_queues_param(priv);
|
||||||
|
|
||||||
stmmac_free_tx_skbufs(priv);
|
stmmac_free_tx_skbufs(priv);
|
||||||
|
@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
|
||||||
@@ -5627,18 +5627,15 @@ static int stmmac_change_mtu(struct net_
|
@@ -5624,18 +5624,15 @@ static int stmmac_change_mtu(struct net_
|
||||||
{
|
{
|
||||||
struct stmmac_priv *priv = netdev_priv(dev);
|
struct stmmac_priv *priv = netdev_priv(dev);
|
||||||
int txfifosz = priv->plat->tx_fifo_size;
|
int txfifosz = priv->plat->tx_fifo_size;
|
||||||
@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
|
||||||
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -5650,8 +5647,29 @@ static int stmmac_change_mtu(struct net_
|
@@ -5647,8 +5644,29 @@ static int stmmac_change_mtu(struct net_
|
||||||
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2926,26 +2926,56 @@ static const struct regmap_bus mt7531_re
|
@@ -2951,26 +2951,56 @@ static const struct regmap_bus mt7531_re
|
||||||
.reg_update_bits = mt7530_regmap_update_bits,
|
.reg_update_bits = mt7530_regmap_update_bits,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
/* Initialise the PCS devices */
|
/* Initialise the PCS devices */
|
||||||
@@ -2967,15 +2997,11 @@ mt753x_setup(struct dsa_switch *ds)
|
@@ -2992,15 +3022,11 @@ mt753x_setup(struct dsa_switch *ds)
|
||||||
if (ret && priv->irq)
|
if (ret && priv->irq)
|
||||||
mt7530_free_irq_common(priv);
|
mt7530_free_irq_common(priv);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2899,7 +2899,7 @@ static int mt7530_regmap_read(void *cont
|
@@ -2924,7 +2924,7 @@ static int mt7530_regmap_read(void *cont
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = context;
|
struct mt7530_priv *priv = context;
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
return 0;
|
return 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -2907,23 +2907,25 @@ static int mt7530_regmap_write(void *con
|
@@ -2932,23 +2932,25 @@ static int mt7530_regmap_write(void *con
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = context;
|
struct mt7530_priv *priv = context;
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -2949,6 +2951,9 @@ mt7531_create_sgmii(struct mt7530_priv *
|
@@ -2974,6 +2976,9 @@ mt7531_create_sgmii(struct mt7530_priv *
|
||||||
mt7531_pcs_config[i]->reg_stride = 4;
|
mt7531_pcs_config[i]->reg_stride = 4;
|
||||||
mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i);
|
mt7531_pcs_config[i]->reg_base = MT7531_SGMII_REG_BASE(5 + i);
|
||||||
mt7531_pcs_config[i]->max_register = 0x17c;
|
mt7531_pcs_config[i]->max_register = 0x17c;
|
||||||
|
@ -133,7 +133,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -2895,22 +2916,6 @@ static const struct phylink_pcs_ops mt75
|
@@ -2920,22 +2941,6 @@ static const struct phylink_pcs_ops mt75
|
||||||
.pcs_an_restart = mt7530_pcs_an_restart,
|
.pcs_an_restart = mt7530_pcs_an_restart,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
static void
|
static void
|
||||||
mt7530_mdio_regmap_lock(void *mdio_lock)
|
mt7530_mdio_regmap_lock(void *mdio_lock)
|
||||||
{
|
{
|
||||||
@@ -2923,7 +2928,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
|
@@ -2948,7 +2953,7 @@ mt7530_mdio_regmap_unlock(void *mdio_loc
|
||||||
mutex_unlock(mdio_lock);
|
mutex_unlock(mdio_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
.reg_write = mt7530_regmap_write,
|
.reg_write = mt7530_regmap_write,
|
||||||
.reg_read = mt7530_regmap_read,
|
.reg_read = mt7530_regmap_read,
|
||||||
};
|
};
|
||||||
@@ -2956,7 +2961,7 @@ mt7531_create_sgmii(struct mt7530_priv *
|
@@ -2981,7 +2986,7 @@ mt7531_create_sgmii(struct mt7530_priv *
|
||||||
mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
|
mt7531_pcs_config[i]->lock_arg = &priv->bus->mdio_lock;
|
||||||
|
|
||||||
regmap = devm_regmap_init(priv->dev,
|
regmap = devm_regmap_init(priv->dev,
|
||||||
@ -174,7 +174,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mt7531_pcs_config[i]);
|
mt7531_pcs_config[i]);
|
||||||
if (IS_ERR(regmap)) {
|
if (IS_ERR(regmap)) {
|
||||||
ret = PTR_ERR(regmap);
|
ret = PTR_ERR(regmap);
|
||||||
@@ -3121,6 +3126,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
|
@@ -3146,6 +3151,7 @@ MODULE_DEVICE_TABLE(of, mt7530_of_match)
|
||||||
static int
|
static int
|
||||||
mt7530_probe(struct mdio_device *mdiodev)
|
mt7530_probe(struct mdio_device *mdiodev)
|
||||||
{
|
{
|
||||||
@ -182,7 +182,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
struct mt7530_priv *priv;
|
struct mt7530_priv *priv;
|
||||||
struct device_node *dn;
|
struct device_node *dn;
|
||||||
|
|
||||||
@@ -3200,6 +3206,21 @@ mt7530_probe(struct mdio_device *mdiodev
|
@@ -3225,6 +3231,21 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||||
mutex_init(&priv->reg_mutex);
|
mutex_init(&priv->reg_mutex);
|
||||||
dev_set_drvdata(&mdiodev->dev, priv);
|
dev_set_drvdata(&mdiodev->dev, priv);
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -3007,12 +3007,6 @@ mt753x_setup(struct dsa_switch *ds)
|
@@ -3032,12 +3032,6 @@ mt753x_setup(struct dsa_switch *ds)
|
||||||
if (ret && priv->irq)
|
if (ret && priv->irq)
|
||||||
mt7530_free_irq_common(priv);
|
mt7530_free_irq_common(priv);
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3129,6 +3123,7 @@ mt7530_probe(struct mdio_device *mdiodev
|
@@ -3154,6 +3148,7 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||||
static struct regmap_config *regmap_config;
|
static struct regmap_config *regmap_config;
|
||||||
struct mt7530_priv *priv;
|
struct mt7530_priv *priv;
|
||||||
struct device_node *dn;
|
struct device_node *dn;
|
||||||
@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
dn = mdiodev->dev.of_node;
|
dn = mdiodev->dev.of_node;
|
||||||
|
|
||||||
@@ -3221,6 +3216,12 @@ mt7530_probe(struct mdio_device *mdiodev
|
@@ -3246,6 +3241,12 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||||
if (IS_ERR(priv->regmap))
|
if (IS_ERR(priv->regmap))
|
||||||
return PTR_ERR(priv->regmap);
|
return PTR_ERR(priv->regmap);
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1109,7 +1109,6 @@ static int
|
@@ -1117,7 +1117,6 @@ static int
|
||||||
mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
|
mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
@ -222,7 +222,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
int length;
|
int length;
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
@@ -1120,7 +1119,7 @@ mt7530_port_change_mtu(struct dsa_switch
|
@@ -1128,7 +1127,7 @@ mt7530_port_change_mtu(struct dsa_switch
|
||||||
if (!dsa_is_cpu_port(ds, port))
|
if (!dsa_is_cpu_port(ds, port))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
val = mt7530_mii_read(priv, MT7530_GMACCR);
|
val = mt7530_mii_read(priv, MT7530_GMACCR);
|
||||||
val &= ~MAX_RX_PKT_LEN_MASK;
|
val &= ~MAX_RX_PKT_LEN_MASK;
|
||||||
@@ -1141,7 +1140,7 @@ mt7530_port_change_mtu(struct dsa_switch
|
@@ -1149,7 +1148,7 @@ mt7530_port_change_mtu(struct dsa_switch
|
||||||
|
|
||||||
mt7530_mii_write(priv, MT7530_GMACCR, val);
|
mt7530_mii_write(priv, MT7530_GMACCR, val);
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1937,10 +1936,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
|
@@ -1945,10 +1944,10 @@ mt7530_irq_thread_fn(int irq, void *dev_
|
||||||
u32 val;
|
u32 val;
|
||||||
int p;
|
int p;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
for (p = 0; p < MT7530_NUM_PHYS; p++) {
|
for (p = 0; p < MT7530_NUM_PHYS; p++) {
|
||||||
if (BIT(p) & val) {
|
if (BIT(p) & val) {
|
||||||
@@ -1976,7 +1975,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
|
@@ -1984,7 +1983,7 @@ mt7530_irq_bus_lock(struct irq_data *d)
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
|
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1985,7 +1984,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da
|
@@ -1993,7 +1992,7 @@ mt7530_irq_bus_sync_unlock(struct irq_da
|
||||||
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
|
struct mt7530_priv *priv = irq_data_get_irq_chip_data(d);
|
||||||
|
|
||||||
mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable);
|
mt7530_mii_write(priv, MT7530_SYS_INT_EN, priv->irq_enable);
|
||||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -3135,44 +3135,21 @@ static const struct of_device_id mt7530_
|
@@ -3160,44 +3160,21 @@ static const struct of_device_id mt7530_
|
||||||
MODULE_DEVICE_TABLE(of, mt7530_of_match);
|
MODULE_DEVICE_TABLE(of, mt7530_of_match);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -67,7 +67,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
if (!priv->info)
|
if (!priv->info)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -3186,23 +3163,53 @@ mt7530_probe(struct mdio_device *mdiodev
|
@@ -3211,23 +3188,53 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
priv->id = priv->info->id;
|
priv->id = priv->info->id;
|
||||||
@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
|
priv->reset = devm_gpiod_get_optional(&mdiodev->dev, "reset",
|
||||||
GPIOD_OUT_LOW);
|
GPIOD_OUT_LOW);
|
||||||
if (IS_ERR(priv->reset)) {
|
if (IS_ERR(priv->reset)) {
|
||||||
@@ -3211,12 +3218,15 @@ mt7530_probe(struct mdio_device *mdiodev
|
@@ -3236,12 +3243,15 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -3253,6 +3253,17 @@ mt7530_probe(struct mdio_device *mdiodev
|
@@ -3278,6 +3278,17 @@ mt7530_probe(struct mdio_device *mdiodev
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mt7530_remove(struct mdio_device *mdiodev)
|
mt7530_remove(struct mdio_device *mdiodev)
|
||||||
{
|
{
|
||||||
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
struct mt7530_priv *priv = dev_get_drvdata(&mdiodev->dev);
|
||||||
@@ -3271,16 +3282,11 @@ mt7530_remove(struct mdio_device *mdiode
|
@@ -3296,16 +3307,11 @@ mt7530_remove(struct mdio_device *mdiode
|
||||||
dev_err(priv->dev, "Failed to disable io pwr: %d\n",
|
dev_err(priv->dev, "Failed to disable io pwr: %d\n",
|
||||||
ret);
|
ret);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/MAINTAINERS
|
--- a/MAINTAINERS
|
||||||
+++ b/MAINTAINERS
|
+++ b/MAINTAINERS
|
||||||
@@ -11901,6 +11901,7 @@ M: Landen Chao <Landen.Chao@mediatek.com
|
@@ -11895,6 +11895,7 @@ M: Landen Chao <Landen.Chao@mediatek.com
|
||||||
M: DENG Qingfang <dqfext@gmail.com>
|
M: DENG Qingfang <dqfext@gmail.com>
|
||||||
L: netdev@vger.kernel.org
|
L: netdev@vger.kernel.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
@ -68,8 +68,8 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
obj-$(CONFIG_NET_DSA_MT7530) += mt7530.o
|
obj-$(CONFIG_NET_DSA_MT7530) += mt7530.o
|
||||||
+obj-$(CONFIG_NET_DSA_MT7530_MDIO) += mt7530-mdio.o
|
+obj-$(CONFIG_NET_DSA_MT7530_MDIO) += mt7530-mdio.o
|
||||||
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
|
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
|
||||||
|
obj-$(CONFIG_NET_DSA_QCA8K) += qca8k.o
|
||||||
obj-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o
|
obj-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o
|
||||||
realtek-smi-objs := realtek-smi-core.o rtl8366.o rtl8366rb.o
|
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/net/dsa/mt7530-mdio.c
|
+++ b/drivers/net/dsa/mt7530-mdio.c
|
||||||
@@ -0,0 +1,271 @@
|
@@ -0,0 +1,271 @@
|
||||||
@ -416,7 +416,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
static u32
|
static u32
|
||||||
mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
|
mt7530_mii_read(struct mt7530_priv *priv, u32 reg)
|
||||||
{
|
{
|
||||||
@@ -2944,72 +2895,6 @@ static const struct phylink_pcs_ops mt75
|
@@ -2958,72 +2909,6 @@ static const struct phylink_pcs_ops mt75
|
||||||
.pcs_an_restart = mt7530_pcs_an_restart,
|
.pcs_an_restart = mt7530_pcs_an_restart,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -489,7 +489,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
static int
|
static int
|
||||||
mt753x_setup(struct dsa_switch *ds)
|
mt753x_setup(struct dsa_switch *ds)
|
||||||
{
|
{
|
||||||
@@ -3068,7 +2953,7 @@ static int mt753x_set_mac_eee(struct dsa
|
@@ -3082,7 +2967,7 @@ static int mt753x_set_mac_eee(struct dsa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,7 +498,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
.get_tag_protocol = mtk_get_tag_protocol,
|
.get_tag_protocol = mtk_get_tag_protocol,
|
||||||
.setup = mt753x_setup,
|
.setup = mt753x_setup,
|
||||||
.get_strings = mt7530_get_strings,
|
.get_strings = mt7530_get_strings,
|
||||||
@@ -3102,8 +2987,9 @@ static const struct dsa_switch_ops mt753
|
@@ -3116,8 +3001,9 @@ static const struct dsa_switch_ops mt753
|
||||||
.get_mac_eee = mt753x_get_mac_eee,
|
.get_mac_eee = mt753x_get_mac_eee,
|
||||||
.set_mac_eee = mt753x_set_mac_eee,
|
.set_mac_eee = mt753x_set_mac_eee,
|
||||||
};
|
};
|
||||||
@ -509,7 +509,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
[ID_MT7621] = {
|
[ID_MT7621] = {
|
||||||
.id = ID_MT7621,
|
.id = ID_MT7621,
|
||||||
.pcs_ops = &mt7530_pcs_ops,
|
.pcs_ops = &mt7530_pcs_ops,
|
||||||
@@ -3136,16 +3022,9 @@ static const struct mt753x_info mt753x_t
|
@@ -3150,16 +3036,9 @@ static const struct mt753x_info mt753x_t
|
||||||
.mac_port_config = mt7531_mac_config,
|
.mac_port_config = mt7531_mac_config,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@ -528,7 +528,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mt7530_probe_common(struct mt7530_priv *priv)
|
mt7530_probe_common(struct mt7530_priv *priv)
|
||||||
{
|
{
|
||||||
struct device *dev = priv->dev;
|
struct device *dev = priv->dev;
|
||||||
@@ -3182,88 +3061,9 @@ mt7530_probe_common(struct mt7530_priv *
|
@@ -3196,88 +3075,9 @@ mt7530_probe_common(struct mt7530_priv *
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -619,7 +619,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mt7530_remove_common(struct mt7530_priv *priv)
|
mt7530_remove_common(struct mt7530_priv *priv)
|
||||||
{
|
{
|
||||||
if (priv->irq)
|
if (priv->irq)
|
||||||
@@ -3274,57 +3074,6 @@ mt7530_remove_common(struct mt7530_priv
|
@@ -3288,57 +3088,6 @@ mt7530_remove_common(struct mt7530_priv
|
||||||
mutex_destroy(&priv->reg_mutex);
|
mutex_destroy(&priv->reg_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/MAINTAINERS
|
--- a/MAINTAINERS
|
||||||
+++ b/MAINTAINERS
|
+++ b/MAINTAINERS
|
||||||
@@ -11899,9 +11899,11 @@ MEDIATEK SWITCH DRIVER
|
@@ -11893,9 +11893,11 @@ MEDIATEK SWITCH DRIVER
|
||||||
M: Sean Wang <sean.wang@mediatek.com>
|
M: Sean Wang <sean.wang@mediatek.com>
|
||||||
M: Landen Chao <Landen.Chao@mediatek.com>
|
M: Landen Chao <Landen.Chao@mediatek.com>
|
||||||
M: DENG Qingfang <dqfext@gmail.com>
|
M: DENG Qingfang <dqfext@gmail.com>
|
||||||
@ -76,8 +76,8 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
obj-$(CONFIG_NET_DSA_MT7530_MDIO) += mt7530-mdio.o
|
obj-$(CONFIG_NET_DSA_MT7530_MDIO) += mt7530-mdio.o
|
||||||
+obj-$(CONFIG_NET_DSA_MT7530_MMIO) += mt7530-mmio.o
|
+obj-$(CONFIG_NET_DSA_MT7530_MMIO) += mt7530-mmio.o
|
||||||
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
|
obj-$(CONFIG_NET_DSA_MV88E6060) += mv88e6060.o
|
||||||
|
obj-$(CONFIG_NET_DSA_QCA8K) += qca8k.o
|
||||||
obj-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o
|
obj-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o
|
||||||
realtek-smi-objs := realtek-smi-core.o rtl8366.o rtl8366rb.o
|
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/net/dsa/mt7530-mmio.c
|
+++ b/drivers/net/dsa/mt7530-mmio.c
|
||||||
@@ -0,0 +1,101 @@
|
@@ -0,0 +1,101 @@
|
||||||
@ -184,7 +184,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
+MODULE_LICENSE("GPL");
|
+MODULE_LICENSE("GPL");
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -1984,6 +1984,47 @@ static const struct irq_domain_ops mt753
|
@@ -1992,6 +1992,47 @@ static const struct irq_domain_ops mt753
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -232,7 +232,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mt7530_setup_mdio_irq(struct mt7530_priv *priv)
|
mt7530_setup_mdio_irq(struct mt7530_priv *priv)
|
||||||
{
|
{
|
||||||
struct dsa_switch *ds = priv->ds;
|
struct dsa_switch *ds = priv->ds;
|
||||||
@@ -2017,8 +2058,15 @@ mt7530_setup_irq(struct mt7530_priv *pri
|
@@ -2025,8 +2066,15 @@ mt7530_setup_irq(struct mt7530_priv *pri
|
||||||
return priv->irq ? : -EINVAL;
|
return priv->irq ? : -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
if (!priv->irq_domain) {
|
if (!priv->irq_domain) {
|
||||||
dev_err(dev, "failed to create IRQ domain\n");
|
dev_err(dev, "failed to create IRQ domain\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -2507,6 +2555,25 @@ static void mt7531_mac_port_get_caps(str
|
@@ -2521,6 +2569,25 @@ static void mt7531_mac_port_get_caps(str
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,7 +276,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
static int
|
static int
|
||||||
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
|
mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
|
||||||
{
|
{
|
||||||
@@ -2583,6 +2650,17 @@ static bool mt753x_is_mac_port(u32 port)
|
@@ -2597,6 +2664,17 @@ static bool mt753x_is_mac_port(u32 port)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -294,7 +294,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
mt7531_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
|
||||||
phy_interface_t interface)
|
phy_interface_t interface)
|
||||||
{
|
{
|
||||||
@@ -2652,7 +2730,8 @@ mt753x_phylink_mac_config(struct dsa_swi
|
@@ -2666,7 +2744,8 @@ mt753x_phylink_mac_config(struct dsa_swi
|
||||||
|
|
||||||
switch (port) {
|
switch (port) {
|
||||||
case 0 ... 4: /* Internal phy */
|
case 0 ... 4: /* Internal phy */
|
||||||
@ -304,7 +304,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
goto unsupported;
|
goto unsupported;
|
||||||
break;
|
break;
|
||||||
case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */
|
case 5: /* 2nd cpu port with phy of port 0 or 4 / external phy */
|
||||||
@@ -2730,7 +2809,8 @@ static void mt753x_phylink_mac_link_up(s
|
@@ -2744,7 +2823,8 @@ static void mt753x_phylink_mac_link_up(s
|
||||||
/* MT753x MAC works in 1G full duplex mode for all up-clocked
|
/* MT753x MAC works in 1G full duplex mode for all up-clocked
|
||||||
* variants.
|
* variants.
|
||||||
*/
|
*/
|
||||||
@ -314,7 +314,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
(phy_interface_mode_is_8023z(interface))) {
|
(phy_interface_mode_is_8023z(interface))) {
|
||||||
speed = SPEED_1000;
|
speed = SPEED_1000;
|
||||||
duplex = DUPLEX_FULL;
|
duplex = DUPLEX_FULL;
|
||||||
@@ -2810,6 +2890,21 @@ mt7531_cpu_port_config(struct dsa_switch
|
@@ -2824,6 +2904,21 @@ mt7531_cpu_port_config(struct dsa_switch
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
|
static void mt753x_phylink_get_caps(struct dsa_switch *ds, int port,
|
||||||
struct phylink_config *config)
|
struct phylink_config *config)
|
||||||
{
|
{
|
||||||
@@ -2955,6 +3050,27 @@ static int mt753x_set_mac_eee(struct dsa
|
@@ -2969,6 +3064,27 @@ static int mt753x_set_mac_eee(struct dsa
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
const struct dsa_switch_ops mt7530_switch_ops = {
|
const struct dsa_switch_ops mt7530_switch_ops = {
|
||||||
.get_tag_protocol = mtk_get_tag_protocol,
|
.get_tag_protocol = mtk_get_tag_protocol,
|
||||||
.setup = mt753x_setup,
|
.setup = mt753x_setup,
|
||||||
@@ -3023,6 +3139,17 @@ const struct mt753x_info mt753x_table[]
|
@@ -3037,6 +3153,17 @@ const struct mt753x_info mt753x_table[]
|
||||||
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
.mac_port_get_caps = mt7531_mac_port_get_caps,
|
||||||
.mac_port_config = mt7531_mac_config,
|
.mac_port_config = mt7531_mac_config,
|
||||||
},
|
},
|
||||||
|
@ -73,7 +73,7 @@ Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|||||||
}
|
}
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -3017,6 +3017,12 @@ mt753x_setup(struct dsa_switch *ds)
|
@@ -3031,6 +3031,12 @@ mt753x_setup(struct dsa_switch *ds)
|
||||||
if (ret && priv->irq)
|
if (ret && priv->irq)
|
||||||
mt7530_free_irq_common(priv);
|
mt7530_free_irq_common(priv);
|
||||||
|
|
||||||
|
@ -1,229 +0,0 @@
|
|||||||
From ec51fbd1b8a2bca2948dede99c14ec63dc57ff6b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Bjørn Mork <bjorn@mork.no>
|
|
||||||
Date: Fri, 6 Jan 2023 17:07:38 +0100
|
|
||||||
Subject: [PATCH] r8152: add USB device driver for config selection
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Subclassing the generic USB device driver to override the
|
|
||||||
default configuration selection regardless of matching interface
|
|
||||||
drivers.
|
|
||||||
|
|
||||||
The r815x family devices expose a vendor specific function which
|
|
||||||
the r8152 interface driver wants to handle. This is the preferred
|
|
||||||
device mode. Additionally one or more USB class functions are
|
|
||||||
usually supported for hosts lacking a vendor specific driver. The
|
|
||||||
choice is USB configuration based, with one alternate function per
|
|
||||||
configuration.
|
|
||||||
|
|
||||||
Example device with both NCM and ECM alternate cfgs:
|
|
||||||
|
|
||||||
T: Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 4 Spd=5000 MxCh= 0
|
|
||||||
D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 3
|
|
||||||
P: Vendor=0bda ProdID=8156 Rev=31.00
|
|
||||||
S: Manufacturer=Realtek
|
|
||||||
S: Product=USB 10/100/1G/2.5G LAN
|
|
||||||
S: SerialNumber=001000001
|
|
||||||
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=256mA
|
|
||||||
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=r8152
|
|
||||||
E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
|
|
||||||
E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
|
|
||||||
E: Ad=83(I) Atr=03(Int.) MxPS= 2 Ivl=128ms
|
|
||||||
C: #Ifs= 2 Cfg#= 2 Atr=a0 MxPwr=256mA
|
|
||||||
I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=0d Prot=00 Driver=
|
|
||||||
E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
|
|
||||||
I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=01 Driver=
|
|
||||||
I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=01 Driver=
|
|
||||||
E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
|
|
||||||
E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
|
|
||||||
C: #Ifs= 2 Cfg#= 3 Atr=a0 MxPwr=256mA
|
|
||||||
I: If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=
|
|
||||||
E: Ad=83(I) Atr=03(Int.) MxPS= 16 Ivl=128ms
|
|
||||||
I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=
|
|
||||||
I: If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=
|
|
||||||
E: Ad=81(I) Atr=02(Bulk) MxPS=1024 Ivl=0ms
|
|
||||||
E: Ad=02(O) Atr=02(Bulk) MxPS=1024 Ivl=0ms
|
|
||||||
|
|
||||||
A problem with this is that Linux will prefer class functions over
|
|
||||||
vendor specific functions. Using the above example, Linux defaults
|
|
||||||
to cfg #2, running the device in a sub-optimal NCM mode.
|
|
||||||
|
|
||||||
Previously we've attempted to work around the problem by
|
|
||||||
blacklisting the devices in the ECM class driver "cdc_ether", and
|
|
||||||
matching on the ECM class function in the vendor specific interface
|
|
||||||
driver. The latter has been used to switch back to the vendor
|
|
||||||
specific configuration when the driver is probed for a class
|
|
||||||
function.
|
|
||||||
|
|
||||||
This workaround has several issues;
|
|
||||||
- class driver blacklists is additional maintanence cruft in an
|
|
||||||
unrelated driver
|
|
||||||
- class driver blacklists prevents users from optionally running
|
|
||||||
the devices in class mode
|
|
||||||
- each device needs double match entries in the vendor driver
|
|
||||||
- the initial probing as a class function slows down device
|
|
||||||
discovery
|
|
||||||
|
|
||||||
Now these issues have become even worse with the introduction of
|
|
||||||
firmware supporting both NCM and ECM, where NCM ends up as the
|
|
||||||
default mode in Linux. To use the same workaround, we now have
|
|
||||||
to blacklist the devices in to two different class drivers and
|
|
||||||
add yet another match entry to the vendor specific driver.
|
|
||||||
|
|
||||||
This patch implements an alternative workaround strategy -
|
|
||||||
independent of the interface drivers. It avoids adding a
|
|
||||||
blacklist to the cdc_ncm driver and will let us remove the
|
|
||||||
existing blacklist from the cdc_ether driver.
|
|
||||||
|
|
||||||
As an additional bonus, removing the blacklists allow users to
|
|
||||||
select one of the other device modes if wanted.
|
|
||||||
|
|
||||||
Signed-off-by: Bjørn Mork <bjorn@mork.no>
|
|
||||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
---
|
|
||||||
drivers/net/usb/r8152.c | 113 ++++++++++++++++++++++++++++------------
|
|
||||||
1 file changed, 81 insertions(+), 32 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
|
||||||
+++ b/drivers/net/usb/r8152.c
|
|
||||||
@@ -9639,6 +9639,9 @@ static int rtl8152_probe(struct usb_inte
|
|
||||||
if (version == RTL_VER_UNKNOWN)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
+ if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
|
|
||||||
+ return -ENODEV;
|
|
||||||
+
|
|
||||||
if (!rtl_vendor_mode(intf))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
@@ -9848,43 +9851,35 @@ static void rtl8152_disconnect(struct us
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-#define REALTEK_USB_DEVICE(vend, prod) { \
|
|
||||||
- USB_DEVICE_INTERFACE_CLASS(vend, prod, USB_CLASS_VENDOR_SPEC), \
|
|
||||||
-}, \
|
|
||||||
-{ \
|
|
||||||
- USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_COMM, \
|
|
||||||
- USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), \
|
|
||||||
-}
|
|
||||||
|
|
||||||
/* table of devices that work with this driver */
|
|
||||||
static const struct usb_device_id rtl8152_table[] = {
|
|
||||||
/* Realtek */
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8050),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8053),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8152),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8155),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8156),
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8050) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8053) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8152) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8153) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8155) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_REALTEK, 0x8156) },
|
|
||||||
|
|
||||||
/* Microsoft */
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0c5e),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3054),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3069),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7205),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x720c),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x7214),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x721e),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0xa387),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff),
|
|
||||||
- REALTEK_USB_DEVICE(VENDOR_ID_TPLINK, 0x0601),
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x304f) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3054) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3062) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3069) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x3082) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7205) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x720c) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x7214) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0x721e) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LENOVO, 0xa387) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) },
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -9904,7 +9899,61 @@ static struct usb_driver rtl8152_driver
|
|
||||||
.disable_hub_initiated_lpm = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
-module_usb_driver(rtl8152_driver);
|
|
||||||
+static int rtl8152_cfgselector_probe(struct usb_device *udev)
|
|
||||||
+{
|
|
||||||
+ struct usb_host_config *c;
|
|
||||||
+ int i, num_configs;
|
|
||||||
+
|
|
||||||
+ /* The vendor mode is not always config #1, so to find it out. */
|
|
||||||
+ c = udev->config;
|
|
||||||
+ num_configs = udev->descriptor.bNumConfigurations;
|
|
||||||
+ for (i = 0; i < num_configs; (i++, c++)) {
|
|
||||||
+ struct usb_interface_descriptor *desc = NULL;
|
|
||||||
+
|
|
||||||
+ if (!c->desc.bNumInterfaces)
|
|
||||||
+ continue;
|
|
||||||
+ desc = &c->intf_cache[0]->altsetting->desc;
|
|
||||||
+ if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC)
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (i == num_configs)
|
|
||||||
+ return -ENODEV;
|
|
||||||
+
|
|
||||||
+ if (usb_set_configuration(udev, c->desc.bConfigurationValue)) {
|
|
||||||
+ dev_err(&udev->dev, "Failed to set configuration %d\n",
|
|
||||||
+ c->desc.bConfigurationValue);
|
|
||||||
+ return -ENODEV;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static struct usb_device_driver rtl8152_cfgselector_driver = {
|
|
||||||
+ .name = MODULENAME "-cfgselector",
|
|
||||||
+ .probe = rtl8152_cfgselector_probe,
|
|
||||||
+ .id_table = rtl8152_table,
|
|
||||||
+ .generic_subclass = 1,
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+static int __init rtl8152_driver_init(void)
|
|
||||||
+{
|
|
||||||
+ int ret;
|
|
||||||
+
|
|
||||||
+ ret = usb_register_device_driver(&rtl8152_cfgselector_driver, THIS_MODULE);
|
|
||||||
+ if (ret)
|
|
||||||
+ return ret;
|
|
||||||
+ return usb_register(&rtl8152_driver);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void __exit rtl8152_driver_exit(void)
|
|
||||||
+{
|
|
||||||
+ usb_deregister(&rtl8152_driver);
|
|
||||||
+ usb_deregister_device_driver(&rtl8152_cfgselector_driver);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+module_init(rtl8152_driver_init);
|
|
||||||
+module_exit(rtl8152_driver_exit);
|
|
||||||
|
|
||||||
MODULE_AUTHOR(DRIVER_AUTHOR);
|
|
||||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
|
@ -1,64 +0,0 @@
|
|||||||
From 0d4cda805a183bbe523f2407edb5c14ade50b841 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hayes Wang <hayeswang@realtek.com>
|
|
||||||
Date: Tue, 17 Jan 2023 11:03:44 +0800
|
|
||||||
Subject: [PATCH] r8152: avoid to change cfg for all devices
|
|
||||||
|
|
||||||
The rtl8152_cfgselector_probe() should set the USB configuration to the
|
|
||||||
vendor mode only for the devices which the driver (r8152) supports.
|
|
||||||
Otherwise, no driver would be used for such devices.
|
|
||||||
|
|
||||||
Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection")
|
|
||||||
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
|
|
||||||
Reviewed-by: Simon Horman <simon.horman@corigine.com>
|
|
||||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
---
|
|
||||||
drivers/net/usb/r8152.c | 20 +++++++++++++++++---
|
|
||||||
1 file changed, 17 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
|
||||||
+++ b/drivers/net/usb/r8152.c
|
|
||||||
@@ -9545,9 +9545,8 @@ static int rtl_fw_init(struct r8152 *tp)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-u8 rtl8152_get_version(struct usb_interface *intf)
|
|
||||||
+static u8 __rtl_get_hw_ver(struct usb_device *udev)
|
|
||||||
{
|
|
||||||
- struct usb_device *udev = interface_to_usbdev(intf);
|
|
||||||
u32 ocp_data = 0;
|
|
||||||
__le32 *tmp;
|
|
||||||
u8 version;
|
|
||||||
@@ -9617,10 +9616,19 @@ u8 rtl8152_get_version(struct usb_interf
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
version = RTL_VER_UNKNOWN;
|
|
||||||
- dev_info(&intf->dev, "Unknown version 0x%04x\n", ocp_data);
|
|
||||||
+ dev_info(&udev->dev, "Unknown version 0x%04x\n", ocp_data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ return version;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+u8 rtl8152_get_version(struct usb_interface *intf)
|
|
||||||
+{
|
|
||||||
+ u8 version;
|
|
||||||
+
|
|
||||||
+ version = __rtl_get_hw_ver(interface_to_usbdev(intf));
|
|
||||||
+
|
|
||||||
dev_dbg(&intf->dev, "Detected version 0x%04x\n", version);
|
|
||||||
|
|
||||||
return version;
|
|
||||||
@@ -9904,6 +9912,12 @@ static int rtl8152_cfgselector_probe(str
|
|
||||||
struct usb_host_config *c;
|
|
||||||
int i, num_configs;
|
|
||||||
|
|
||||||
+ /* Switch the device to vendor mode, if and only if the vendor mode
|
|
||||||
+ * driver supports it.
|
|
||||||
+ */
|
|
||||||
+ if (__rtl_get_hw_ver(udev) == RTL_VER_UNKNOWN)
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
/* The vendor mode is not always config #1, so to find it out. */
|
|
||||||
c = udev->config;
|
|
||||||
num_configs = udev->descriptor.bNumConfigurations;
|
|
@ -1,71 +0,0 @@
|
|||||||
From 95a4c1d617b92cdc4522297741b56e8f6cd01a1e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hayes Wang <hayeswang@realtek.com>
|
|
||||||
Date: Thu, 19 Jan 2023 15:40:42 +0800
|
|
||||||
Subject: [PATCH] r8152: remove rtl_vendor_mode function
|
|
||||||
|
|
||||||
After commit ec51fbd1b8a2 ("r8152: add USB device driver for
|
|
||||||
config selection"), the code about changing USB configuration
|
|
||||||
in rtl_vendor_mode() wouldn't be run anymore. Therefore, the
|
|
||||||
function could be removed.
|
|
||||||
|
|
||||||
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
|
|
||||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/net/usb/r8152.c | 39 +--------------------------------------
|
|
||||||
1 file changed, 1 insertion(+), 38 deletions(-)
|
|
||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
|
||||||
+++ b/drivers/net/usb/r8152.c
|
|
||||||
@@ -8281,43 +8281,6 @@ static bool rtl_check_vendor_ok(struct u
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
-static bool rtl_vendor_mode(struct usb_interface *intf)
|
|
||||||
-{
|
|
||||||
- struct usb_host_interface *alt = intf->cur_altsetting;
|
|
||||||
- struct usb_device *udev;
|
|
||||||
- struct usb_host_config *c;
|
|
||||||
- int i, num_configs;
|
|
||||||
-
|
|
||||||
- if (alt->desc.bInterfaceClass == USB_CLASS_VENDOR_SPEC)
|
|
||||||
- return rtl_check_vendor_ok(intf);
|
|
||||||
-
|
|
||||||
- /* The vendor mode is not always config #1, so to find it out. */
|
|
||||||
- udev = interface_to_usbdev(intf);
|
|
||||||
- c = udev->config;
|
|
||||||
- num_configs = udev->descriptor.bNumConfigurations;
|
|
||||||
- if (num_configs < 2)
|
|
||||||
- return false;
|
|
||||||
-
|
|
||||||
- for (i = 0; i < num_configs; (i++, c++)) {
|
|
||||||
- struct usb_interface_descriptor *desc = NULL;
|
|
||||||
-
|
|
||||||
- if (c->desc.bNumInterfaces > 0)
|
|
||||||
- desc = &c->intf_cache[0]->altsetting->desc;
|
|
||||||
- else
|
|
||||||
- continue;
|
|
||||||
-
|
|
||||||
- if (desc->bInterfaceClass == USB_CLASS_VENDOR_SPEC) {
|
|
||||||
- usb_driver_set_configuration(udev, c->desc.bConfigurationValue);
|
|
||||||
- break;
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (i == num_configs)
|
|
||||||
- dev_err(&intf->dev, "Unexpected Device\n");
|
|
||||||
-
|
|
||||||
- return false;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
static int rtl8152_pre_reset(struct usb_interface *intf)
|
|
||||||
{
|
|
||||||
struct r8152 *tp = usb_get_intfdata(intf);
|
|
||||||
@@ -9650,7 +9613,7 @@ static int rtl8152_probe(struct usb_inte
|
|
||||||
if (intf->cur_altsetting->desc.bInterfaceClass != USB_CLASS_VENDOR_SPEC)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
- if (!rtl_vendor_mode(intf))
|
|
||||||
+ if (!rtl_check_vendor_ok(intf))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
usb_reset_device(udev);
|
|
@ -1,24 +0,0 @@
|
|||||||
From 0fbd79c01a9a657348f7032df70c57a406468c86 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Hayes Wang <hayeswang@realtek.com>
|
|
||||||
Date: Tue, 2 May 2023 11:36:27 +0800
|
|
||||||
Subject: [PATCH] r8152: fix the autosuspend doesn't work
|
|
||||||
|
|
||||||
Set supports_autosuspend = 1 for the rtl8152_cfgselector_driver.
|
|
||||||
|
|
||||||
Fixes: ec51fbd1b8a2 ("r8152: add USB device driver for config selection")
|
|
||||||
Signed-off-by: Hayes Wang <hayeswang@realtek.com>
|
|
||||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
||||||
---
|
|
||||||
drivers/net/usb/r8152.c | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
|
||||||
+++ b/drivers/net/usb/r8152.c
|
|
||||||
@@ -9912,6 +9912,7 @@ static struct usb_device_driver rtl8152_
|
|
||||||
.probe = rtl8152_cfgselector_probe,
|
|
||||||
.id_table = rtl8152_table,
|
|
||||||
.generic_subclass = 1,
|
|
||||||
+ .supports_autosuspend = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
static int __init rtl8152_driver_init(void)
|
|
@ -1,39 +0,0 @@
|
|||||||
From 72f93a3136ee18fd59fa6579f84c07e93424681e Mon Sep 17 00:00:00 2001
|
|
||||||
From: Antonio Napolitano <anton@polit.no>
|
|
||||||
Date: Sat, 26 Aug 2023 01:05:50 +0200
|
|
||||||
Subject: [PATCH] r8152: add vendor/device ID pair for D-Link DUB-E250
|
|
||||||
|
|
||||||
The D-Link DUB-E250 is an RTL8156 based 2.5G Ethernet controller.
|
|
||||||
|
|
||||||
Add the vendor and product ID values to the driver. This makes Ethernet
|
|
||||||
work with the adapter.
|
|
||||||
|
|
||||||
Signed-off-by: Antonio Napolitano <anton@polit.no>
|
|
||||||
Link: https://lore.kernel.org/r/CV200KJEEUPC.WPKAHXCQJ05I@mercurius
|
|
||||||
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
|
|
||||||
---
|
|
||||||
drivers/net/usb/r8152.c | 1 +
|
|
||||||
include/linux/usb/r8152.h | 1 +
|
|
||||||
2 files changed, 2 insertions(+)
|
|
||||||
|
|
||||||
|
|
||||||
--- a/include/linux/usb/r8152.h
|
|
||||||
+++ b/include/linux/usb/r8152.h
|
|
||||||
@@ -29,6 +29,7 @@
|
|
||||||
#define VENDOR_ID_LINKSYS 0x13b1
|
|
||||||
#define VENDOR_ID_NVIDIA 0x0955
|
|
||||||
#define VENDOR_ID_TPLINK 0x2357
|
|
||||||
+#define VENDOR_ID_DLINK 0x2001
|
|
||||||
|
|
||||||
#if IS_REACHABLE(CONFIG_USB_RTL8152)
|
|
||||||
extern u8 rtl8152_get_version(struct usb_interface *intf);
|
|
||||||
--- a/drivers/net/usb/r8152.c
|
|
||||||
+++ b/drivers/net/usb/r8152.c
|
|
||||||
@@ -9834,6 +9834,7 @@ static const struct usb_device_id rtl815
|
|
||||||
{ USB_DEVICE(VENDOR_ID_LINKSYS, 0x0041) },
|
|
||||||
{ USB_DEVICE(VENDOR_ID_NVIDIA, 0x09ff) },
|
|
||||||
{ USB_DEVICE(VENDOR_ID_TPLINK, 0x0601) },
|
|
||||||
+ { USB_DEVICE(VENDOR_ID_DLINK, 0xb301) },
|
|
||||||
{}
|
|
||||||
};
|
|
||||||
|
|
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
--- a/drivers/net/usb/qmi_wwan.c
|
--- a/drivers/net/usb/qmi_wwan.c
|
||||||
+++ b/drivers/net/usb/qmi_wwan.c
|
+++ b/drivers/net/usb/qmi_wwan.c
|
||||||
@@ -1316,6 +1316,7 @@ static const struct usb_device_id produc
|
@@ -1317,6 +1317,7 @@ static const struct usb_device_id produc
|
||||||
{QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
|
{QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
|
||||||
{QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */
|
{QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */
|
||||||
{QMI_FIXED_INTF(0x19d2, 0x1432, 3)}, /* ZTE ME3620 */
|
{QMI_FIXED_INTF(0x19d2, 0x1432, 3)}, /* ZTE ME3620 */
|
||||||
|
@ -15,7 +15,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2382,7 +2382,7 @@ mt7531_setup(struct dsa_switch *ds)
|
@@ -2422,7 +2422,7 @@ mt7531_setup(struct dsa_switch *ds)
|
||||||
struct mt7530_priv *priv = ds->priv;
|
struct mt7530_priv *priv = ds->priv;
|
||||||
struct mt7530_dummy_poll p;
|
struct mt7530_dummy_poll p;
|
||||||
u32 val, id;
|
u32 val, id;
|
||||||
@ -24,7 +24,7 @@ Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
|
|||||||
|
|
||||||
/* Reset whole chip through gpio pin or memory-mapped registers for
|
/* Reset whole chip through gpio pin or memory-mapped registers for
|
||||||
* different type of hardware
|
* different type of hardware
|
||||||
@@ -2414,6 +2414,10 @@ mt7531_setup(struct dsa_switch *ds)
|
@@ -2454,6 +2454,10 @@ mt7531_setup(struct dsa_switch *ds)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
rxd->rxd5 = 0;
|
rxd->rxd5 = 0;
|
||||||
rxd->rxd6 = 0;
|
rxd->rxd6 = 0;
|
||||||
rxd->rxd7 = 0;
|
rxd->rxd7 = 0;
|
||||||
@@ -3063,7 +3063,7 @@ static int mtk_start_dma(struct mtk_eth
|
@@ -3066,7 +3066,7 @@ static int mtk_start_dma(struct mtk_eth
|
||||||
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
|
MTK_TX_BT_32DWORDS | MTK_NDP_CO_PRO |
|
||||||
MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE;
|
MTK_RX_2B_OFFSET | MTK_TX_WB_DDONE;
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
|
val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
|
||||||
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
|
MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
|
||||||
MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN;
|
MTK_CHK_DDONE_EN | MTK_LEAKY_BUCKET_EN;
|
||||||
@@ -3475,7 +3475,7 @@ static void mtk_hw_reset(struct mtk_eth
|
@@ -3478,7 +3478,7 @@ static void mtk_hw_reset(struct mtk_eth
|
||||||
{
|
{
|
||||||
u32 val;
|
u32 val;
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
|
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
|
||||||
val = RSTCTRL_PPE0_V2;
|
val = RSTCTRL_PPE0_V2;
|
||||||
} else {
|
} else {
|
||||||
@@ -3487,7 +3487,7 @@ static void mtk_hw_reset(struct mtk_eth
|
@@ -3490,7 +3490,7 @@ static void mtk_hw_reset(struct mtk_eth
|
||||||
|
|
||||||
ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
|
ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
|
regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
|
||||||
0x3ffffff);
|
0x3ffffff);
|
||||||
}
|
}
|
||||||
@@ -3683,7 +3683,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3686,7 +3686,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
else
|
else
|
||||||
mtk_hw_reset(eth);
|
mtk_hw_reset(eth);
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
/* Set FE to PDMAv2 if necessary */
|
/* Set FE to PDMAv2 if necessary */
|
||||||
val = mtk_r32(eth, MTK_FE_GLO_MISC);
|
val = mtk_r32(eth, MTK_FE_GLO_MISC);
|
||||||
mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC);
|
mtk_w32(eth, val | BIT(4), MTK_FE_GLO_MISC);
|
||||||
@@ -3720,7 +3720,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3723,7 +3723,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
*/
|
*/
|
||||||
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
|
||||||
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
|
||||||
|
@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
|
|
||||||
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
|
||||||
@@ -3989,7 +3989,10 @@ static void mtk_sgmii_destroy(struct mtk
|
@@ -3975,7 +3975,10 @@ static void mtk_sgmii_destroy(struct mtk
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
mtk_pcs_lynxi_destroy(eth->sgmii_pcs[i]);
|
mtk_pcs_lynxi_destroy(eth->sgmii_pcs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4432,7 +4435,12 @@ static int mtk_sgmii_init(struct mtk_eth
|
@@ -4428,7 +4431,12 @@ static int mtk_sgmii_init(struct mtk_eth
|
||||||
u32 flags;
|
u32 flags;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
np = of_parse_phandle(eth->dev->of_node, "mediatek,sgmiisys", i);
|
np = of_parse_phandle(eth->dev->of_node, "mediatek,sgmiisys", i);
|
||||||
if (!np)
|
if (!np)
|
||||||
break;
|
break;
|
||||||
@@ -4477,6 +4485,18 @@ static int mtk_probe(struct platform_dev
|
@@ -4473,6 +4481,18 @@ static int mtk_probe(struct platform_dev
|
||||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
||||||
eth->ip_align = NET_IP_ALIGN;
|
eth->ip_align = NET_IP_ALIGN;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
spin_lock_init(ð->page_lock);
|
spin_lock_init(ð->page_lock);
|
||||||
spin_lock_init(ð->tx_irq_lock);
|
spin_lock_init(ð->tx_irq_lock);
|
||||||
spin_lock_init(ð->rx_irq_lock);
|
spin_lock_init(ð->rx_irq_lock);
|
||||||
@@ -4662,7 +4682,7 @@ static int mtk_probe(struct platform_dev
|
@@ -4658,7 +4678,7 @@ static int mtk_probe(struct platform_dev
|
||||||
goto err_free_dev;
|
goto err_free_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
if (!eth->netdev[i])
|
if (!eth->netdev[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -4739,6 +4759,7 @@ static const struct mtk_soc_data mt2701_
|
@@ -4735,6 +4755,7 @@ static const struct mtk_soc_data mt2701_
|
||||||
.hw_features = MTK_HW_FEATURES,
|
.hw_features = MTK_HW_FEATURES,
|
||||||
.required_clks = MT7623_CLKS_BITMAP,
|
.required_clks = MT7623_CLKS_BITMAP,
|
||||||
.required_pctl = true,
|
.required_pctl = true,
|
||||||
@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||||
@@ -4757,6 +4778,7 @@ static const struct mtk_soc_data mt7621_
|
@@ -4753,6 +4774,7 @@ static const struct mtk_soc_data mt7621_
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
.offload_version = 1,
|
.offload_version = 1,
|
||||||
.hash_offset = 2,
|
.hash_offset = 2,
|
||||||
@ -85,7 +85,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
@@ -4778,6 +4800,7 @@ static const struct mtk_soc_data mt7622_
|
@@ -4774,6 +4796,7 @@ static const struct mtk_soc_data mt7622_
|
||||||
.offload_version = 2,
|
.offload_version = 2,
|
||||||
.hash_offset = 2,
|
.hash_offset = 2,
|
||||||
.has_accounting = true,
|
.has_accounting = true,
|
||||||
@ -93,7 +93,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
@@ -4797,6 +4820,7 @@ static const struct mtk_soc_data mt7623_
|
@@ -4793,6 +4816,7 @@ static const struct mtk_soc_data mt7623_
|
||||||
.required_pctl = true,
|
.required_pctl = true,
|
||||||
.offload_version = 1,
|
.offload_version = 1,
|
||||||
.hash_offset = 2,
|
.hash_offset = 2,
|
||||||
@ -101,7 +101,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
@@ -4816,6 +4840,7 @@ static const struct mtk_soc_data mt7629_
|
@@ -4812,6 +4836,7 @@ static const struct mtk_soc_data mt7629_
|
||||||
.required_clks = MT7629_CLKS_BITMAP,
|
.required_clks = MT7629_CLKS_BITMAP,
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
.has_accounting = true,
|
.has_accounting = true,
|
||||||
@ -109,7 +109,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma),
|
.txd_size = sizeof(struct mtk_tx_dma),
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma),
|
.rxd_size = sizeof(struct mtk_rx_dma),
|
||||||
@@ -4837,6 +4862,7 @@ static const struct mtk_soc_data mt7981_
|
@@ -4833,6 +4858,7 @@ static const struct mtk_soc_data mt7981_
|
||||||
.hash_offset = 4,
|
.hash_offset = 4,
|
||||||
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
||||||
.has_accounting = true,
|
.has_accounting = true,
|
||||||
@ -117,7 +117,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.txrx = {
|
.txrx = {
|
||||||
.txd_size = sizeof(struct mtk_tx_dma_v2),
|
.txd_size = sizeof(struct mtk_tx_dma_v2),
|
||||||
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
.rxd_size = sizeof(struct mtk_rx_dma_v2),
|
||||||
@@ -4856,6 +4882,7 @@ static const struct mtk_soc_data mt7986_
|
@@ -4852,6 +4878,7 @@ static const struct mtk_soc_data mt7986_
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
.offload_version = 2,
|
.offload_version = 2,
|
||||||
.hash_offset = 4,
|
.hash_offset = 4,
|
||||||
@ -125,7 +125,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
.foe_entry_size = sizeof(struct mtk_foe_entry),
|
||||||
.has_accounting = true,
|
.has_accounting = true,
|
||||||
.txrx = {
|
.txrx = {
|
||||||
@@ -4874,6 +4901,7 @@ static const struct mtk_soc_data rt5350_
|
@@ -4870,6 +4897,7 @@ static const struct mtk_soc_data rt5350_
|
||||||
.hw_features = MTK_HW_FEATURES_MT7628,
|
.hw_features = MTK_HW_FEATURES_MT7628,
|
||||||
.required_clks = MT7628_CLKS_BITMAP,
|
.required_clks = MT7628_CLKS_BITMAP,
|
||||||
.required_pctl = false,
|
.required_pctl = false,
|
||||||
|
@ -51,7 +51,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
!eth->netdev[mac]))
|
!eth->netdev[mac]))
|
||||||
goto release_desc;
|
goto release_desc;
|
||||||
|
|
||||||
@@ -2937,7 +2937,7 @@ static void mtk_dma_free(struct mtk_eth
|
@@ -2940,7 +2940,7 @@ static void mtk_dma_free(struct mtk_eth
|
||||||
const struct mtk_soc_data *soc = eth->soc;
|
const struct mtk_soc_data *soc = eth->soc;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
if (eth->netdev[i])
|
if (eth->netdev[i])
|
||||||
netdev_reset_queue(eth->netdev[i]);
|
netdev_reset_queue(eth->netdev[i]);
|
||||||
if (eth->scratch_ring) {
|
if (eth->scratch_ring) {
|
||||||
@@ -3091,7 +3091,7 @@ static void mtk_gdm_config(struct mtk_et
|
@@ -3094,7 +3094,7 @@ static void mtk_gdm_config(struct mtk_et
|
||||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
|
u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
|
||||||
|
|
||||||
/* default setup the forward port to send frame to PDMA */
|
/* default setup the forward port to send frame to PDMA */
|
||||||
@@ -3704,7 +3704,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3707,7 +3707,7 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
* up with the more appropriate value when mtk_mac_config call is being
|
* up with the more appropriate value when mtk_mac_config call is being
|
||||||
* invoked.
|
* invoked.
|
||||||
*/
|
*/
|
||||||
@ -78,7 +78,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
struct net_device *dev = eth->netdev[i];
|
struct net_device *dev = eth->netdev[i];
|
||||||
|
|
||||||
mtk_w32(eth, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(i));
|
mtk_w32(eth, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(i));
|
||||||
@@ -3909,7 +3909,7 @@ static void mtk_pending_work(struct work
|
@@ -3895,7 +3895,7 @@ static void mtk_pending_work(struct work
|
||||||
mtk_prepare_for_reset(eth);
|
mtk_prepare_for_reset(eth);
|
||||||
|
|
||||||
/* stop all devices to make sure that dma is properly shut down */
|
/* stop all devices to make sure that dma is properly shut down */
|
||||||
@ -87,7 +87,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
if (!eth->netdev[i] || !netif_running(eth->netdev[i]))
|
if (!eth->netdev[i] || !netif_running(eth->netdev[i]))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -3925,7 +3925,7 @@ static void mtk_pending_work(struct work
|
@@ -3911,7 +3911,7 @@ static void mtk_pending_work(struct work
|
||||||
mtk_hw_init(eth, true);
|
mtk_hw_init(eth, true);
|
||||||
|
|
||||||
/* restart DMA and enable IRQs */
|
/* restart DMA and enable IRQs */
|
||||||
@ -96,7 +96,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
if (!test_bit(i, &restart))
|
if (!test_bit(i, &restart))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -3953,7 +3953,7 @@ static int mtk_free_dev(struct mtk_eth *
|
@@ -3939,7 +3939,7 @@ static int mtk_free_dev(struct mtk_eth *
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -105,7 +105,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
if (!eth->netdev[i])
|
if (!eth->netdev[i])
|
||||||
continue;
|
continue;
|
||||||
free_netdev(eth->netdev[i]);
|
free_netdev(eth->netdev[i]);
|
||||||
@@ -3972,7 +3972,7 @@ static int mtk_unreg_dev(struct mtk_eth
|
@@ -3958,7 +3958,7 @@ static int mtk_unreg_dev(struct mtk_eth
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
struct mtk_mac *mac;
|
struct mtk_mac *mac;
|
||||||
if (!eth->netdev[i])
|
if (!eth->netdev[i])
|
||||||
continue;
|
continue;
|
||||||
@@ -4277,7 +4277,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -4262,7 +4262,7 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
}
|
}
|
||||||
|
|
||||||
id = be32_to_cpup(_id);
|
id = be32_to_cpup(_id);
|
||||||
@ -123,7 +123,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
dev_err(eth->dev, "%d is not a valid mac id\n", id);
|
dev_err(eth->dev, "%d is not a valid mac id\n", id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -4407,7 +4407,7 @@ void mtk_eth_set_dma_device(struct mtk_e
|
@@ -4403,7 +4403,7 @@ void mtk_eth_set_dma_device(struct mtk_e
|
||||||
|
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
dev = eth->netdev[i];
|
dev = eth->netdev[i];
|
||||||
|
|
||||||
if (!dev || !(dev->flags & IFF_UP))
|
if (!dev || !(dev->flags & IFF_UP))
|
||||||
@@ -4734,7 +4734,7 @@ static int mtk_remove(struct platform_de
|
@@ -4730,7 +4730,7 @@ static int mtk_remove(struct platform_de
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* stop all devices to make sure that dma is properly shut down */
|
/* stop all devices to make sure that dma is properly shut down */
|
||||||
|
@ -154,7 +154,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
|
|
||||||
if (!tx_buf->data)
|
if (!tx_buf->data)
|
||||||
break;
|
break;
|
||||||
@@ -3742,7 +3788,26 @@ static int mtk_hw_init(struct mtk_eth *e
|
@@ -3745,7 +3791,26 @@ static int mtk_hw_init(struct mtk_eth *e
|
||||||
mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4);
|
mtk_w32(eth, eth->soc->txrx.rx_irq_done_mask, reg_map->qdma.int_grp + 4);
|
||||||
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
|
||||||
|
|
||||||
@ -182,7 +182,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
/* PSE should not drop port8 and port9 packets from WDMA Tx */
|
/* PSE should not drop port8 and port9 packets from WDMA Tx */
|
||||||
mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
|
mtk_w32(eth, 0x00000300, PSE_DROP_CFG);
|
||||||
|
|
||||||
@@ -4314,7 +4379,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -4310,7 +4375,11 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
}
|
}
|
||||||
spin_lock_init(&mac->hw_stats->stats_lock);
|
spin_lock_init(&mac->hw_stats->stats_lock);
|
||||||
u64_stats_init(&mac->hw_stats->syncp);
|
u64_stats_init(&mac->hw_stats->syncp);
|
||||||
|
@ -150,7 +150,7 @@ mtk_eth_soc driver.
|
|||||||
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
|
||||||
WRITE_ONCE(desc->txd4, data);
|
WRITE_ONCE(desc->txd4, data);
|
||||||
|
|
||||||
@@ -4964,6 +5065,25 @@ static const struct mtk_soc_data mt7986_
|
@@ -4960,6 +5061,25 @@ static const struct mtk_soc_data mt7986_
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ mtk_eth_soc driver.
|
|||||||
static const struct mtk_soc_data rt5350_data = {
|
static const struct mtk_soc_data rt5350_data = {
|
||||||
.reg_map = &mt7628_reg_map,
|
.reg_map = &mt7628_reg_map,
|
||||||
.caps = MT7628_CAPS,
|
.caps = MT7628_CAPS,
|
||||||
@@ -4982,14 +5102,15 @@ static const struct mtk_soc_data rt5350_
|
@@ -4978,14 +5098,15 @@ static const struct mtk_soc_data rt5350_
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct of_device_id of_mtk_match[] = {
|
const struct of_device_id of_mtk_match[] = {
|
||||||
|
@ -607,7 +607,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
mtk_w32(eth, val, MTK_PPSC);
|
mtk_w32(eth, val, MTK_PPSC);
|
||||||
|
|
||||||
dev_dbg(eth->dev, "MDC is running on %d Hz\n", MDC_MAX_FREQ / divider);
|
dev_dbg(eth->dev, "MDC is running on %d Hz\n", MDC_MAX_FREQ / divider);
|
||||||
@@ -4433,8 +4636,8 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -4418,8 +4621,8 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
const __be32 *_id = of_get_property(np, "reg", NULL);
|
const __be32 *_id = of_get_property(np, "reg", NULL);
|
||||||
phy_interface_t phy_mode;
|
phy_interface_t phy_mode;
|
||||||
struct phylink *phylink;
|
struct phylink *phylink;
|
||||||
@ -617,7 +617,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
int txqs = 1;
|
int txqs = 1;
|
||||||
|
|
||||||
if (!_id) {
|
if (!_id) {
|
||||||
@@ -4525,6 +4728,32 @@ static int mtk_add_mac(struct mtk_eth *e
|
@@ -4521,6 +4724,32 @@ static int mtk_add_mac(struct mtk_eth *e
|
||||||
mac->phylink_config.supported_interfaces);
|
mac->phylink_config.supported_interfaces);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -650,7 +650,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
|||||||
phylink = phylink_create(&mac->phylink_config,
|
phylink = phylink_create(&mac->phylink_config,
|
||||||
of_fwnode_handle(mac->of_node),
|
of_fwnode_handle(mac->of_node),
|
||||||
phy_mode, &mtk_phylink_ops);
|
phy_mode, &mtk_phylink_ops);
|
||||||
@@ -4712,6 +4941,13 @@ static int mtk_probe(struct platform_dev
|
@@ -4708,6 +4937,13 @@ static int mtk_probe(struct platform_dev
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
@ -16,7 +16,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
|||||||
|
|
||||||
--- a/drivers/net/dsa/mt7530.c
|
--- a/drivers/net/dsa/mt7530.c
|
||||||
+++ b/drivers/net/dsa/mt7530.c
|
+++ b/drivers/net/dsa/mt7530.c
|
||||||
@@ -2121,10 +2121,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr
|
@@ -2129,10 +2129,13 @@ mt7530_setup_mdio(struct mt7530_priv *pr
|
||||||
{
|
{
|
||||||
struct dsa_switch *ds = priv->ds;
|
struct dsa_switch *ds = priv->ds;
|
||||||
struct device *dev = priv->dev;
|
struct device *dev = priv->dev;
|
||||||
@ -30,7 +30,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
|||||||
bus = devm_mdiobus_alloc(dev);
|
bus = devm_mdiobus_alloc(dev);
|
||||||
if (!bus)
|
if (!bus)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@@ -2141,7 +2144,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr
|
@@ -2149,7 +2152,9 @@ mt7530_setup_mdio(struct mt7530_priv *pr
|
||||||
if (priv->irq)
|
if (priv->irq)
|
||||||
mt7530_setup_mdio_irq(priv);
|
mt7530_setup_mdio_irq(priv);
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
--- a/drivers/net/usb/qmi_wwan.c
|
--- a/drivers/net/usb/qmi_wwan.c
|
||||||
+++ b/drivers/net/usb/qmi_wwan.c
|
+++ b/drivers/net/usb/qmi_wwan.c
|
||||||
@@ -1419,6 +1419,9 @@ static const struct usb_device_id produc
|
@@ -1420,6 +1420,9 @@ static const struct usb_device_id produc
|
||||||
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
|
{QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
|
||||||
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
|
{QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
|
||||||
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
|
{QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
#endif
|
#endif
|
||||||
--- a/include/linux/if_vlan.h
|
--- a/include/linux/if_vlan.h
|
||||||
+++ b/include/linux/if_vlan.h
|
+++ b/include/linux/if_vlan.h
|
||||||
@@ -222,7 +222,28 @@ extern void vlan_vids_del_by_dev(struct
|
@@ -230,7 +230,28 @@ extern void vlan_vids_del_by_dev(struct
|
||||||
|
|
||||||
extern bool vlan_uses_dev(const struct net_device *dev);
|
extern bool vlan_uses_dev(const struct net_device *dev);
|
||||||
|
|
||||||
@ -549,7 +549,7 @@
|
|||||||
struct fib_table *tb;
|
struct fib_table *tb;
|
||||||
--- a/include/net/addrconf.h
|
--- a/include/net/addrconf.h
|
||||||
+++ b/include/net/addrconf.h
|
+++ b/include/net/addrconf.h
|
||||||
@@ -504,4 +504,9 @@ int if6_proc_init(void);
|
@@ -512,4 +512,9 @@ int if6_proc_init(void);
|
||||||
void if6_proc_exit(void);
|
void if6_proc_exit(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
#endif
|
#endif
|
||||||
--- a/include/linux/if_vlan.h
|
--- a/include/linux/if_vlan.h
|
||||||
+++ b/include/linux/if_vlan.h
|
+++ b/include/linux/if_vlan.h
|
||||||
@@ -222,7 +222,28 @@ extern void vlan_vids_del_by_dev(struct
|
@@ -230,7 +230,28 @@ extern void vlan_vids_del_by_dev(struct
|
||||||
|
|
||||||
extern bool vlan_uses_dev(const struct net_device *dev);
|
extern bool vlan_uses_dev(const struct net_device *dev);
|
||||||
|
|
||||||
@ -549,7 +549,7 @@
|
|||||||
struct fib_table *tb;
|
struct fib_table *tb;
|
||||||
--- a/include/net/addrconf.h
|
--- a/include/net/addrconf.h
|
||||||
+++ b/include/net/addrconf.h
|
+++ b/include/net/addrconf.h
|
||||||
@@ -504,4 +504,9 @@ int if6_proc_init(void);
|
@@ -512,4 +512,9 @@ int if6_proc_init(void);
|
||||||
void if6_proc_exit(void);
|
void if6_proc_exit(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
if (!buf->sec_page)
|
if (!buf->sec_page)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
@@ -4634,6 +4638,10 @@ static inline void stmmac_rx_refill(stru
|
@@ -4631,6 +4635,10 @@ static inline void stmmac_rx_refill(stru
|
||||||
struct stmmac_rx_queue *rx_q = &priv->dma_conf.rx_queue[queue];
|
struct stmmac_rx_queue *rx_q = &priv->dma_conf.rx_queue[queue];
|
||||||
int dirty = stmmac_rx_dirty(priv, queue);
|
int dirty = stmmac_rx_dirty(priv, queue);
|
||||||
unsigned int entry = rx_q->dirty_rx;
|
unsigned int entry = rx_q->dirty_rx;
|
||||||
@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
|
|||||||
|
|
||||||
while (dirty-- > 0) {
|
while (dirty-- > 0) {
|
||||||
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry];
|
struct stmmac_rx_buffer *buf = &rx_q->buf_pool[entry];
|
||||||
@@ -4646,13 +4654,13 @@ static inline void stmmac_rx_refill(stru
|
@@ -4643,13 +4651,13 @@ static inline void stmmac_rx_refill(stru
|
||||||
p = rx_q->dma_rx + entry;
|
p = rx_q->dma_rx + entry;
|
||||||
|
|
||||||
if (!buf->page) {
|
if (!buf->page) {
|
||||||
|
Loading…
Reference in New Issue
Block a user