Import version 2.18.1
This commit is contained in:
@@ -9,7 +9,7 @@ ENV{REALTEK_MODE1}="1"
|
||||
ENV{REALTEK_MODE2}="3"
|
||||
|
||||
# Realtek
|
||||
ATTR{idVendor}=="0bda", ATTR{idProduct}=="815[2,3,5,6]", ATTR{bConfigurationValue}!="$env{REALTEK_MODE1}", ATTR{bConfigurationValue}="$env{REALTEK_MODE1}"
|
||||
ATTR{idVendor}=="0bda", ATTR{idProduct}=="815[2,3,5,6,7]", ATTR{bConfigurationValue}!="$env{REALTEK_MODE1}", ATTR{bConfigurationValue}="$env{REALTEK_MODE1}"
|
||||
ATTR{idVendor}=="0bda", ATTR{idProduct}=="8053", ATTR{bcdDevice}=="e???", ATTR{bConfigurationValue}!="$env{REALTEK_MODE2}", ATTR{bConfigurationValue}="$env{REALTEK_MODE2}"
|
||||
|
||||
# Samsung
|
||||
|
||||
@@ -8,9 +8,17 @@ ifneq ($(KERNELRELEASE),)
|
||||
obj-m := r8152.o
|
||||
# EXTRA_CFLAGS += -DRTL8152_S5_WOL
|
||||
# EXTRA_CFLAGS += -DRTL8152_DEBUG
|
||||
|
||||
ifneq (,$(filter OFF off, $(CONFIG_CTAP_SHORT)))
|
||||
EXTRA_CFLAGS += -DCONFIG_CTAP_SHORT_OFF
|
||||
endif
|
||||
|
||||
ifeq (TRUE, $(shell test $(VERSION) -lt 5 && echo "TRUE" || \
|
||||
test $(VERSION) -eq 5 && test $(PATCHLEVEL) -lt 12 && echo "TRUE"))
|
||||
EXTRA_CFLAGS += -DLINUX_VERSION_MAJOR=$(VERSION)
|
||||
EXTRA_CFLAGS += -DLINUX_VERSION_PATCHLEVEL=$(PATCHLEVEL)
|
||||
EXTRA_CFLAGS += -DLINUX_VERSION_SUBLEVEL=$(SUBLEVEL)
|
||||
endif
|
||||
else
|
||||
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
|
||||
PWD :=$(shell pwd)
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
2.5G for kernel v4.10 and later
|
||||
# ethtool -s eth0 autoneg on advertise 0x80000000002f
|
||||
|
||||
5G for kernel v4.10 and later (Couldn't be supported before kernel v4.10)
|
||||
# ethtool -s eth0 autoneg on advertise 0x180000000002f
|
||||
|
||||
# ethtool -s eth0 autoneg on advertise 0x002f (1G)
|
||||
# ethtool -s eth0 autoneg on advertise 0x000f (100M full)
|
||||
# ethtool -s eth0 autoneg on advertise 0x0003 (10M full)
|
||||
|
||||
+36
-17
@@ -25,6 +25,8 @@
|
||||
#define TSO_LEGACY_MAX_SIZE 65536
|
||||
#define netif_napi_add_weight netif_napi_add
|
||||
#define netif_set_tso_max_size netif_set_gso_max_size
|
||||
#define netif_set_tso_max_segs netif_set_gso_max_segs
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0)
|
||||
#define PHY_MAC_INTERRUPT PHY_IGNORE_INTERRUPT
|
||||
@@ -57,15 +59,19 @@
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
|
||||
#define MDIO_EEE_2_5GT 0x0001 /* 2.5GT EEE cap */
|
||||
#define MDIO_EEE_2_5GT 0x0001 /* 2.5GT EEE cap */
|
||||
#define MDIO_EEE_5GT 0x0002 /* 5GT EEE cap */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,2,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,1,0)
|
||||
#define MDIO_AN_10GBT_CTRL_ADV2_5G 0x0080 /* Advertise 2.5GBASE-T */
|
||||
#define MDIO_AN_10GBT_STAT_LP2_5G 0x0020 /* LP is 2.5GBT capable */
|
||||
#define MDIO_AN_10GBT_CTRL_ADV2_5G 0x0080 /* Advertise 2.5GBASE-T */
|
||||
#define MDIO_AN_10GBT_CTRL_ADV5G 0x0100 /* Advertise 5GBASE-T */
|
||||
#define MDIO_AN_10GBT_STAT_LP2_5G 0x0020 /* LP is 2.5GBT capable */
|
||||
#define MDIO_AN_10GBT_STAT_LP5G 0x0040 /* LP is 5GBT capable */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,20,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
|
||||
#define SPEED_2500 2500
|
||||
#define SPEED_5000 5000
|
||||
#define SPEED_25000 25000
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
|
||||
#ifndef ETHTOOL_LINK_MODE_2500baseT_Full_BIT
|
||||
@@ -349,7 +355,7 @@
|
||||
static inline void netif_napi_del(struct napi_struct *napi)
|
||||
{
|
||||
#ifdef CONFIG_NETPOLL
|
||||
list_del(&napi->dev_list);
|
||||
list_del(&napi->dev_list);
|
||||
#endif
|
||||
}
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) */
|
||||
@@ -465,21 +471,21 @@
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) */
|
||||
static inline __be16 vlan_get_protocol(const struct sk_buff *skb)
|
||||
{
|
||||
__be16 protocol = 0;
|
||||
__be16 protocol = 0;
|
||||
|
||||
if (vlan_tx_tag_present(skb) ||
|
||||
skb->protocol != cpu_to_be16(ETH_P_8021Q))
|
||||
protocol = skb->protocol;
|
||||
else {
|
||||
__be16 proto, *protop;
|
||||
protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr,
|
||||
h_vlan_encapsulated_proto),
|
||||
sizeof(proto), &proto);
|
||||
if (likely(protop))
|
||||
protocol = *protop;
|
||||
}
|
||||
if (vlan_tx_tag_present(skb) ||
|
||||
skb->protocol != cpu_to_be16(ETH_P_8021Q))
|
||||
protocol = skb->protocol;
|
||||
else {
|
||||
__be16 proto, *protop;
|
||||
protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr,
|
||||
h_vlan_encapsulated_proto),
|
||||
sizeof(proto), &proto);
|
||||
if (likely(protop))
|
||||
protocol = *protop;
|
||||
}
|
||||
|
||||
return protocol;
|
||||
return protocol;
|
||||
}
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38) */
|
||||
@@ -612,11 +618,24 @@
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,8,0) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,9,0) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,12,0) */
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188) || LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251) || LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0)
|
||||
#if LINUX_VERSION_MAJOR != 4 || LINUX_VERSION_PATCHLEVEL != 19 || LINUX_VERSION_SUBLEVEL < 291
|
||||
static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr)
|
||||
{
|
||||
memcpy(dev->dev_addr, addr, 6);
|
||||
}
|
||||
#endif /* LINUX_VERSION_MAJOR != 4 || LINUX_VERSION_PATCHLEVEL != 19 || LINUX_VERSION_SUBLEVEL < 291 */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,4,251) || LINUX_VERSION_CODE >= KERNEL_VERSION(5,5,0) */
|
||||
#endif /*LINUX_VERSION_CODE < KERNEL_VERSION(5,10,188) || LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0) */
|
||||
static inline void netif_set_gso_max_segs(struct net_device *dev,
|
||||
unsigned int segs)
|
||||
{
|
||||
/* dev->gso_max_segs is read locklessly from sk_setup_caps() */
|
||||
WRITE_ONCE(dev->gso_max_segs, segs);
|
||||
}
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0) */
|
||||
#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(5,19,0) */
|
||||
|
||||
#ifndef FALSE
|
||||
|
||||
Reference in New Issue
Block a user