diff --git a/repos/dde_linux/patches/usb_net_smsc95xx.patch b/repos/dde_linux/patches/usb_net_smsc95xx.patch new file mode 100644 index 0000000000..9a08c9220c --- /dev/null +++ b/repos/dde_linux/patches/usb_net_smsc95xx.patch @@ -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[] = { diff --git a/repos/dde_linux/ports/linux.hash b/repos/dde_linux/ports/linux.hash index 4998beb6b7..88d078cdd9 100644 --- a/repos/dde_linux/ports/linux.hash +++ b/repos/dde_linux/ports/linux.hash @@ -1 +1 @@ -5593e6833c49b2b82314c2ad2d040ff91df63d16 +b590eada42a940c88de535ea0f5c10e1bd0e709b diff --git a/repos/dde_linux/ports/linux.port b/repos/dde_linux/ports/linux.port index aad2600b18..07280e8213 100644 --- a/repos/dde_linux/ports/linux.port +++ b/repos/dde_linux/ports/linux.port @@ -15,10 +15,12 @@ PATCH_FILES := i915_irq.patch \ usb_host_devio_sg.patch \ usb_net_pinephone.patch \ usb_net_cdc_ncm.patch \ + usb_net_smsc95xx.patch \ workqueue_deadlock.patch PATCHES += $(addprefix patches/,$(PATCH_FILES)) 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_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)} diff --git a/repos/dde_linux/src/drivers/usb_net/dummies.c b/repos/dde_linux/src/drivers/usb_net/dummies.c index 951a2f2399..cb672070a9 100644 --- a/repos/dde_linux/src/drivers/usb_net/dummies.c +++ b/repos/dde_linux/src/drivers/usb_net/dummies.c @@ -335,6 +335,81 @@ int of_get_mac_address(struct device_node * np,u8 * addr) #endif +#include + +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 + +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 + +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); void software_node_notify(struct device * dev) { diff --git a/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/generated_dummies.c b/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/generated_dummies.c index cfbdef4114..b6d944ce97 100644 --- a/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/generated_dummies.c +++ b/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/generated_dummies.c @@ -1,7 +1,7 @@ /* * \brief Dummy definitions of Linux Kernel functions * \author Automatically generated file - do no edit - * \date 2024-01-16 + * \date 2024-01-18 */ #include @@ -52,14 +52,6 @@ int __ipv6_addr_type(const struct in6_addr * addr) } -#include - -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 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 - -int __mdiobus_register(struct mii_bus * bus,struct module * owner) -{ - lx_emul_trace_and_stop(__func__); -} - - #include unsigned long __per_cpu_offset[NR_CPUS] = {}; @@ -259,6 +243,11 @@ void dst_release(struct dst_entry * dst) } +#include + +struct irq_chip dummy_irq_chip; + + #include asmlinkage __visible void dump_stack(void) @@ -315,6 +304,22 @@ void finish_rcuwait(struct rcuwait * w) } +#include + +int generic_handle_domain_irq(struct irq_domain * domain,unsigned int hwirq) +{ + lx_emul_trace_and_stop(__func__); +} + + +#include + +int genphy_read_status(struct phy_device * phydev) +{ + lx_emul_trace_and_stop(__func__); +} + + #include int genphy_resume(struct phy_device * phydev) @@ -360,6 +365,14 @@ void handle_fasteoi_irq(struct irq_desc * desc) } +#include + +void handle_simple_irq(struct irq_desc * desc) +{ + lx_emul_trace_and_stop(__func__); +} + + #include void in6_dev_finish_destroy(struct inet6_dev * idev) @@ -418,6 +431,22 @@ int irq_can_set_affinity(unsigned int irq) } +#include + +void irq_dispose_mapping(unsigned int virq) +{ + lx_emul_trace_and_stop(__func__); +} + + +#include + +void irq_domain_free_fwnode(struct fwnode_handle * fwnode) +{ + lx_emul_trace_and_stop(__func__); +} + + #include 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 + +void irq_domain_remove(struct irq_domain * domain) +{ + lx_emul_trace_and_stop(__func__); +} + + #include 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 + +const struct irq_domain_ops irq_domain_simple_ops; + + #include 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; -#include - -struct mii_bus * mdiobus_alloc_size(size_t size) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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 - -void phy_attached_info(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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 -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__); } @@ -736,7 +762,23 @@ void phy_print_status(struct phy_device * phydev) #include -void phy_start(struct phy_device * phydev) +int phy_init_hw(struct phy_device * phydev) +{ + lx_emul_trace_and_stop(__func__); +} + + +#include + +int phy_mii_ioctl(struct phy_device * phydev,struct ifreq * ifr,int cmd) +{ + lx_emul_trace_and_stop(__func__); +} + + +#include + +void phy_print_status(struct phy_device * phydev) { lx_emul_trace_and_stop(__func__); } diff --git a/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/source.list b/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/source.list index df67fc4941..fe09ea89de 100644 --- a/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/source.list +++ b/repos/dde_linux/src/drivers/usb_net/spec/arm_v6/source.list @@ -21,6 +21,7 @@ drivers/net/usb/ax88179_178a.c drivers/net/usb/cdc_ether.c drivers/net/usb/cdc_mbim.c drivers/net/usb/cdc_ncm.c +drivers/net/usb/smsc95xx.c drivers/net/usb/usbnet.c drivers/usb/class/cdc-wdm.c drivers/usb/core/config.c diff --git a/repos/dde_linux/src/drivers/usb_net/spec/arm_v7/generated_dummies.c b/repos/dde_linux/src/drivers/usb_net/spec/arm_v7/generated_dummies.c index 24a8161654..827d950139 100644 --- a/repos/dde_linux/src/drivers/usb_net/spec/arm_v7/generated_dummies.c +++ b/repos/dde_linux/src/drivers/usb_net/spec/arm_v7/generated_dummies.c @@ -1,7 +1,7 @@ /* * \brief Dummy definitions of Linux Kernel functions * \author Automatically generated file - do no edit - * \date 2023-08-18 + * \date 2024-01-18 */ #include @@ -52,14 +52,6 @@ int __ipv6_addr_type(const struct in6_addr * addr) } -#include - -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 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 - -int __mdiobus_register(struct mii_bus * bus,struct module * owner) -{ - lx_emul_trace_and_stop(__func__); -} - - #include unsigned long __per_cpu_offset[NR_CPUS] = {}; @@ -519,14 +503,6 @@ struct pernet_operations __net_initdata loopback_net_ops; unsigned long lpj_fine; -#include - -struct mii_bus * mdiobus_alloc_size(size_t size) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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 - -void phy_attached_info(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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 - -void phy_start(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include void phy_stop(struct phy_device * phydev) diff --git a/repos/dde_linux/src/drivers/usb_net/spec/x86_32/generated_dummies.c b/repos/dde_linux/src/drivers/usb_net/spec/x86_32/generated_dummies.c index 7d0e64d4e4..d9924d3096 100644 --- a/repos/dde_linux/src/drivers/usb_net/spec/x86_32/generated_dummies.c +++ b/repos/dde_linux/src/drivers/usb_net/spec/x86_32/generated_dummies.c @@ -44,14 +44,6 @@ int __ipv6_addr_type(const struct in6_addr * addr) } -#include - -int __mdiobus_register(struct mii_bus * bus,struct module * owner) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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; -#include - -struct mii_bus * mdiobus_alloc_size(size_t size) -{ - lx_emul_trace_and_stop(__func__); -} - - #include void mdiobus_free(struct mii_bus * bus) @@ -563,14 +547,6 @@ int param_set_copystring(const char * val,const struct kernel_param * kp) } -#include - -void phy_attached_info(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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 - -void phy_start(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include void phy_stop(struct phy_device * phydev) diff --git a/repos/dde_linux/src/drivers/usb_net/spec/x86_64/generated_dummies.c b/repos/dde_linux/src/drivers/usb_net/spec/x86_64/generated_dummies.c index 43068a489d..2755d1b6ad 100644 --- a/repos/dde_linux/src/drivers/usb_net/spec/x86_64/generated_dummies.c +++ b/repos/dde_linux/src/drivers/usb_net/spec/x86_64/generated_dummies.c @@ -44,14 +44,6 @@ int __ipv6_addr_type(const struct in6_addr * addr) } -#include - -int __mdiobus_register(struct mii_bus * bus,struct module * owner) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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; -#include - -struct mii_bus * mdiobus_alloc_size(size_t size) -{ - lx_emul_trace_and_stop(__func__); -} - - #include void mdiobus_free(struct mii_bus * bus) @@ -534,14 +518,6 @@ int param_set_copystring(const char * val,const struct kernel_param * kp) } -#include - -void phy_attached_info(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include 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 - -void phy_start(struct phy_device * phydev) -{ - lx_emul_trace_and_stop(__func__); -} - - #include void phy_stop(struct phy_device * phydev) @@ -800,8 +768,6 @@ int usb_clear_halt(struct usb_device * dev,int pipe) } -#include - extern void usb_devio_cleanup(void); void usb_devio_cleanup(void) { diff --git a/repos/dde_linux/src/virt_linux/target.inc b/repos/dde_linux/src/virt_linux/target.inc index 36eb5a0b21..dc8ef4f64d 100644 --- a/repos/dde_linux/src/virt_linux/target.inc +++ b/repos/dde_linux/src/virt_linux/target.inc @@ -1,13 +1,10 @@ # -# Linux kernel configuration +# Linux generic kernel configuration # # kernel fundamentals 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 LX_ENABLE += NO_HZ_IDLE @@ -50,6 +47,7 @@ LX_ENABLE += HID_APPLE HID_CHERRY HID_HOLTEK HID_MICROSOFT # USB NET LX_ENABLE += USB_NET_DRIVERS USB_USBNET LX_ENABLE += USB_NET_AX8817X USB_NET_AX88179_178A USB_NET_CDCETHER +LX_ENABLE += USB_NET_SMSC95XX # USB MBIM MODEM 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 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_NET_RNDIS_HOST USB_NET_SMSC95XX +LX_DISABLE += USB_NET_RNDIS_HOST # disable cpu frequency scaling LX_DISABLE += SCHED_MC CPU_FREQ