usb_net: add SMSC95xx driver for arm_v6

issue #5095
This commit is contained in:
Sebastian Sumpf 2024-01-19 12:52:58 +01:00 committed by Christian Helmuth
parent b73765cf9b
commit 8851b64825
10 changed files with 179 additions and 148 deletions

View File

@ -0,0 +1,19 @@
Remove FLAG_LINK_INTR because otherwiese usbnet.c will set the curruent link
state to down during initialization. Currently we do not support link-state
changes for SMSC95XX because the driver uses mdio/phy/irqchip infrastructure
that is hard to enable. Therefore, the driver must be started with NIC whose
link is up.
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 32d2c60..bd7f0be 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -2002,7 +2002,7 @@ static const struct driver_info smsc95xx_info = {
.tx_fixup = smsc95xx_tx_fixup,
.status = smsc95xx_status,
.manage_power = smsc95xx_manage_power,
- .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
+ .flags = FLAG_ETHER | FLAG_SEND_ZLP,
};
static const struct usb_device_id products[] = {

View File

@ -1 +1 @@
5593e6833c49b2b82314c2ad2d040ff91df63d16 b590eada42a940c88de535ea0f5c10e1bd0e709b

View File

@ -15,10 +15,12 @@ PATCH_FILES := i915_irq.patch \
usb_host_devio_sg.patch \ usb_host_devio_sg.patch \
usb_net_pinephone.patch \ usb_net_pinephone.patch \
usb_net_cdc_ncm.patch \ usb_net_cdc_ncm.patch \
usb_net_smsc95xx.patch \
workqueue_deadlock.patch workqueue_deadlock.patch
PATCHES += $(addprefix patches/,$(PATCH_FILES)) PATCHES += $(addprefix patches/,$(PATCH_FILES))
PATCH_OPT(patches/i915_irq.patch) := -p1 -d${DIR(linux)} PATCH_OPT(patches/i915_irq.patch) := -p1 -d${DIR(linux)}
PATCH_OPT(patches/usb_net_pinephone.patch) := -p1 -d${DIR(linux)} PATCH_OPT(patches/usb_net_pinephone.patch) := -p1 -d${DIR(linux)}
PATCH_OPT(patches/usb_net_cdc_ncm.patch) := -p1 -d${DIR(linux)} PATCH_OPT(patches/usb_net_cdc_ncm.patch) := -p1 -d${DIR(linux)}
PATCH_OPT(patches/usb_net_smsc95xx.patch) := -p1 -d${DIR(linux)}
PATCH_OPT(patches/workqueue_deadlock.patch) := -p1 -d${DIR(linux)} PATCH_OPT(patches/workqueue_deadlock.patch) := -p1 -d${DIR(linux)}

View File

@ -335,6 +335,81 @@ int of_get_mac_address(struct device_node * np,u8 * addr)
#endif #endif
#include <linux/irqdomain.h>
struct fwnode_handle * __irq_domain_alloc_fwnode(unsigned int type,int id,const char * name,phys_addr_t * pa)
{
lx_emul_trace(__func__);
return (struct fwnode_handle *)0x1;
}
struct irq_domain * __irq_domain_add(struct fwnode_handle * fwnode,unsigned int size,irq_hw_number_t hwirq_max,int direct_max,const struct irq_domain_ops * ops,void * host_data)
{
lx_emul_trace(__func__);
return (struct irq_domain *)0x1;
}
unsigned int irq_create_mapping_affinity(struct irq_domain * domain,irq_hw_number_t hwirq,const struct irq_affinity_desc * affinity)
{
lx_emul_trace(__func__);
return 1;
}
#include <linux/irq.h>
void irq_set_chip_and_handler_name(unsigned int irq,const struct irq_chip * chip,irq_flow_handler_t handle,const char * name)
{
lx_emul_trace(__func__);
}
#include <linux/phy.h>
struct mii_bus * mdiobus_alloc_size(size_t size)
{
static struct mii_bus _m;
lx_emul_trace(__func__);
return &_m;
}
int __mdiobus_register(struct mii_bus * bus,struct module * owner)
{
lx_emul_trace(__func__);
return 0;
}
struct phy_device * phy_find_first(struct mii_bus * bus)
{
static struct phy_device _p;
lx_emul_trace(__func__);
return &_p;
}
int phy_connect_direct(struct net_device * dev,struct phy_device * phydev,void (* handler)(struct net_device *),phy_interface_t interface)
{
lx_emul_trace(__func__);
return 0;
}
void phy_attached_info(struct phy_device * phydev)
{
lx_emul_trace(__func__);
}
void phy_start(struct phy_device * phydev)
{
lx_emul_trace(__func__);
}
extern void software_node_notify(struct device * dev); extern void software_node_notify(struct device * dev);
void software_node_notify(struct device * dev) void software_node_notify(struct device * dev)
{ {

View File

@ -1,7 +1,7 @@
/* /*
* \brief Dummy definitions of Linux Kernel functions * \brief Dummy definitions of Linux Kernel functions
* \author Automatically generated file - do no edit * \author Automatically generated file - do no edit
* \date 2024-01-16 * \date 2024-01-18
*/ */
#include <lx_emul.h> #include <lx_emul.h>
@ -52,14 +52,6 @@ int __ipv6_addr_type(const struct in6_addr * addr)
} }
#include <linux/irqdomain.h>
struct irq_domain * __irq_domain_add(struct fwnode_handle * fwnode,unsigned int size,irq_hw_number_t hwirq_max,int direct_max,const struct irq_domain_ops * ops,void * host_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number_t hwirq,unsigned int * irq) struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number_t hwirq,unsigned int * irq)
@ -68,14 +60,6 @@ struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number
} }
#include <linux/phy.h>
int __mdiobus_register(struct mii_bus * bus,struct module * owner)
{
lx_emul_trace_and_stop(__func__);
}
#include <asm-generic/percpu.h> #include <asm-generic/percpu.h>
unsigned long __per_cpu_offset[NR_CPUS] = {}; unsigned long __per_cpu_offset[NR_CPUS] = {};
@ -259,6 +243,11 @@ void dst_release(struct dst_entry * dst)
} }
#include <linux/irq.h>
struct irq_chip dummy_irq_chip;
#include <linux/printk.h> #include <linux/printk.h>
asmlinkage __visible void dump_stack(void) asmlinkage __visible void dump_stack(void)
@ -315,6 +304,22 @@ void finish_rcuwait(struct rcuwait * w)
} }
#include <linux/irqdesc.h>
int generic_handle_domain_irq(struct irq_domain * domain,unsigned int hwirq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h>
int genphy_read_status(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
int genphy_resume(struct phy_device * phydev) int genphy_resume(struct phy_device * phydev)
@ -360,6 +365,14 @@ void handle_fasteoi_irq(struct irq_desc * desc)
} }
#include <linux/irq.h>
void handle_simple_irq(struct irq_desc * desc)
{
lx_emul_trace_and_stop(__func__);
}
#include <net/addrconf.h> #include <net/addrconf.h>
void in6_dev_finish_destroy(struct inet6_dev * idev) void in6_dev_finish_destroy(struct inet6_dev * idev)
@ -418,6 +431,22 @@ int irq_can_set_affinity(unsigned int irq)
} }
#include <linux/irqdomain.h>
void irq_dispose_mapping(unsigned int virq)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h>
void irq_domain_free_fwnode(struct fwnode_handle * fwnode)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
void irq_domain_free_irqs_common(struct irq_domain * domain,unsigned int virq,unsigned int nr_irqs) void irq_domain_free_irqs_common(struct irq_domain * domain,unsigned int virq,unsigned int nr_irqs)
@ -426,6 +455,14 @@ void irq_domain_free_irqs_common(struct irq_domain * domain,unsigned int virq,un
} }
#include <linux/irqdomain.h>
void irq_domain_remove(struct irq_domain * domain)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
void irq_domain_set_info(struct irq_domain * domain,unsigned int virq,irq_hw_number_t hwirq,const struct irq_chip * chip,void * chip_data,irq_flow_handler_t handler,void * handler_data,const char * handler_name) void irq_domain_set_info(struct irq_domain * domain,unsigned int virq,irq_hw_number_t hwirq,const struct irq_chip * chip,void * chip_data,irq_flow_handler_t handler,void * handler_data,const char * handler_name)
@ -434,6 +471,11 @@ void irq_domain_set_info(struct irq_domain * domain,unsigned int virq,irq_hw_num
} }
#include <linux/irqdomain.h>
const struct irq_domain_ops irq_domain_simple_ops;
#include <linux/irq.h> #include <linux/irq.h>
void irq_modify_status(unsigned int irq,unsigned long clr,unsigned long set) void irq_modify_status(unsigned int irq,unsigned long clr,unsigned long set)
@ -524,14 +566,6 @@ struct pernet_operations __net_initdata loopback_net_ops;
unsigned long lpj_fine; unsigned long lpj_fine;
#include <linux/phy.h>
struct mii_bus * mdiobus_alloc_size(size_t size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void mdiobus_free(struct mii_bus * bus) void mdiobus_free(struct mii_bus * bus)
@ -670,14 +704,6 @@ int of_property_read_string(const struct device_node * np,const char * propname,
} }
#include <linux/phy.h>
void phy_attached_info(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface) struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface)
@ -728,7 +754,7 @@ int phy_ethtool_set_link_ksettings(struct net_device * ndev,const struct ethtool
#include <linux/phy.h> #include <linux/phy.h>
void phy_print_status(struct phy_device * phydev) void phy_get_pause(struct phy_device * phydev,bool * tx_pause,bool * rx_pause)
{ {
lx_emul_trace_and_stop(__func__); lx_emul_trace_and_stop(__func__);
} }
@ -736,7 +762,23 @@ void phy_print_status(struct phy_device * phydev)
#include <linux/phy.h> #include <linux/phy.h>
void phy_start(struct phy_device * phydev) int phy_init_hw(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h>
int phy_mii_ioctl(struct phy_device * phydev,struct ifreq * ifr,int cmd)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h>
void phy_print_status(struct phy_device * phydev)
{ {
lx_emul_trace_and_stop(__func__); lx_emul_trace_and_stop(__func__);
} }

View File

@ -21,6 +21,7 @@ drivers/net/usb/ax88179_178a.c
drivers/net/usb/cdc_ether.c drivers/net/usb/cdc_ether.c
drivers/net/usb/cdc_mbim.c drivers/net/usb/cdc_mbim.c
drivers/net/usb/cdc_ncm.c drivers/net/usb/cdc_ncm.c
drivers/net/usb/smsc95xx.c
drivers/net/usb/usbnet.c drivers/net/usb/usbnet.c
drivers/usb/class/cdc-wdm.c drivers/usb/class/cdc-wdm.c
drivers/usb/core/config.c drivers/usb/core/config.c

View File

@ -1,7 +1,7 @@
/* /*
* \brief Dummy definitions of Linux Kernel functions * \brief Dummy definitions of Linux Kernel functions
* \author Automatically generated file - do no edit * \author Automatically generated file - do no edit
* \date 2023-08-18 * \date 2024-01-18
*/ */
#include <lx_emul.h> #include <lx_emul.h>
@ -52,14 +52,6 @@ int __ipv6_addr_type(const struct in6_addr * addr)
} }
#include <linux/irqdomain.h>
struct irq_domain * __irq_domain_add(struct fwnode_handle * fwnode,unsigned int size,irq_hw_number_t hwirq_max,int direct_max,const struct irq_domain_ops * ops,void * host_data)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/irqdomain.h> #include <linux/irqdomain.h>
struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number_t hwirq,unsigned int * irq) struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number_t hwirq,unsigned int * irq)
@ -68,14 +60,6 @@ struct irq_desc * __irq_resolve_mapping(struct irq_domain * domain,irq_hw_number
} }
#include <linux/phy.h>
int __mdiobus_register(struct mii_bus * bus,struct module * owner)
{
lx_emul_trace_and_stop(__func__);
}
#include <asm-generic/percpu.h> #include <asm-generic/percpu.h>
unsigned long __per_cpu_offset[NR_CPUS] = {}; unsigned long __per_cpu_offset[NR_CPUS] = {};
@ -519,14 +503,6 @@ struct pernet_operations __net_initdata loopback_net_ops;
unsigned long lpj_fine; unsigned long lpj_fine;
#include <linux/phy.h>
struct mii_bus * mdiobus_alloc_size(size_t size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void mdiobus_free(struct mii_bus * bus) void mdiobus_free(struct mii_bus * bus)
@ -665,14 +641,6 @@ int of_property_read_string(const struct device_node * np,const char * propname,
} }
#include <linux/phy.h>
void phy_attached_info(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface) struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface)
@ -729,14 +697,6 @@ void phy_print_status(struct phy_device * phydev)
} }
#include <linux/phy.h>
void phy_start(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void phy_stop(struct phy_device * phydev) void phy_stop(struct phy_device * phydev)

View File

@ -44,14 +44,6 @@ int __ipv6_addr_type(const struct in6_addr * addr)
} }
#include <linux/phy.h>
int __mdiobus_register(struct mii_bus * bus,struct module * owner)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h> #include <linux/printk.h>
int __printk_ratelimit(const char * func) int __printk_ratelimit(const char * func)
@ -446,14 +438,6 @@ int kobject_uevent_env(struct kobject * kobj,enum kobject_action action,char * e
struct pernet_operations __net_initdata loopback_net_ops; struct pernet_operations __net_initdata loopback_net_ops;
#include <linux/phy.h>
struct mii_bus * mdiobus_alloc_size(size_t size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void mdiobus_free(struct mii_bus * bus) void mdiobus_free(struct mii_bus * bus)
@ -563,14 +547,6 @@ int param_set_copystring(const char * val,const struct kernel_param * kp)
} }
#include <linux/phy.h>
void phy_attached_info(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface) struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface)
@ -627,14 +603,6 @@ void phy_print_status(struct phy_device * phydev)
} }
#include <linux/phy.h>
void phy_start(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void phy_stop(struct phy_device * phydev) void phy_stop(struct phy_device * phydev)

View File

@ -44,14 +44,6 @@ int __ipv6_addr_type(const struct in6_addr * addr)
} }
#include <linux/phy.h>
int __mdiobus_register(struct mii_bus * bus,struct module * owner)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/printk.h> #include <linux/printk.h>
int __printk_ratelimit(const char * func) int __printk_ratelimit(const char * func)
@ -417,14 +409,6 @@ int kobject_uevent_env(struct kobject * kobj,enum kobject_action action,char * e
struct pernet_operations __net_initdata loopback_net_ops; struct pernet_operations __net_initdata loopback_net_ops;
#include <linux/phy.h>
struct mii_bus * mdiobus_alloc_size(size_t size)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void mdiobus_free(struct mii_bus * bus) void mdiobus_free(struct mii_bus * bus)
@ -534,14 +518,6 @@ int param_set_copystring(const char * val,const struct kernel_param * kp)
} }
#include <linux/phy.h>
void phy_attached_info(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface) struct phy_device * phy_connect(struct net_device * dev,const char * bus_id,void (* handler)(struct net_device *),phy_interface_t interface)
@ -598,14 +574,6 @@ void phy_print_status(struct phy_device * phydev)
} }
#include <linux/phy.h>
void phy_start(struct phy_device * phydev)
{
lx_emul_trace_and_stop(__func__);
}
#include <linux/phy.h> #include <linux/phy.h>
void phy_stop(struct phy_device * phydev) void phy_stop(struct phy_device * phydev)
@ -800,8 +768,6 @@ int usb_clear_halt(struct usb_device * dev,int pipe)
} }
#include <linux/usb.h>
extern void usb_devio_cleanup(void); extern void usb_devio_cleanup(void);
void usb_devio_cleanup(void) void usb_devio_cleanup(void)
{ {

View File

@ -1,13 +1,10 @@
# #
# Linux kernel configuration # Linux generic kernel configuration
# #
# kernel fundamentals # kernel fundamentals
LX_ENABLE += TTY MMU SERIAL_EARLYCON SERIAL_OF_PLATFORM PRINTK HAS_IOMEM SMP LX_ENABLE += TTY MMU SERIAL_EARLYCON SERIAL_OF_PLATFORM PRINTK HAS_IOMEM SMP
# do not generate thumb instructions on ARMv7 platforms
LX_DISABLE += THUMB2_KERNEL ARM_VIRT_EXT DEBUG_PREEMPT
# support disabling ticking during idle # support disabling ticking during idle
LX_ENABLE += NO_HZ_IDLE LX_ENABLE += NO_HZ_IDLE
@ -50,6 +47,7 @@ LX_ENABLE += HID_APPLE HID_CHERRY HID_HOLTEK HID_MICROSOFT
# USB NET # USB NET
LX_ENABLE += USB_NET_DRIVERS USB_USBNET LX_ENABLE += USB_NET_DRIVERS USB_USBNET
LX_ENABLE += USB_NET_AX8817X USB_NET_AX88179_178A USB_NET_CDCETHER LX_ENABLE += USB_NET_AX8817X USB_NET_AX88179_178A USB_NET_CDCETHER
LX_ENABLE += USB_NET_SMSC95XX
# USB MBIM MODEM # USB MBIM MODEM
LX_ENABLE += USB_NET_CDC_NCM USB_NET_CDC_MBIM USB_WDM LX_ENABLE += USB_NET_CDC_NCM USB_NET_CDC_MBIM USB_WDM
@ -57,7 +55,7 @@ LX_ENABLE += USB_NET_CDC_NCM USB_NET_CDC_MBIM USB_WDM
# disable unwanted # disable unwanted
LX_DISABLE += USB_NET_NET1080 USB_NET_CDC_SUBSET_ENABLE USB_BELKIN LX_DISABLE += USB_NET_NET1080 USB_NET_CDC_SUBSET_ENABLE USB_BELKIN
LX_DISABLE += USB_ARMLINUX USB_NET_ZAURUS USB_NET_CDC_SUBSET LX_DISABLE += USB_ARMLINUX USB_NET_ZAURUS USB_NET_CDC_SUBSET
LX_DISABLE += USB_NET_RNDIS_HOST USB_NET_SMSC95XX LX_DISABLE += USB_NET_RNDIS_HOST
# disable cpu frequency scaling # disable cpu frequency scaling
LX_DISABLE += SCHED_MC CPU_FREQ LX_DISABLE += SCHED_MC CPU_FREQ