--- zzzz-none-000/linux-4.19.183/drivers/usb/storage/scsiglue.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/usb/storage/scsiglue.c 2023-06-28 08:54:20.000000000 +0000 @@ -573,8 +573,38 @@ } static DEVICE_ATTR_RW(max_sectors); +#if defined(CONFIG_AVM_USB_SUSPEND) +/* Output routine for the sysfs max_spinup_ms file */ +static ssize_t +max_spinup_ms_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct us_data *us = host_to_us(dev_to_shost(dev)); + + return sprintf(buf, "%u\n", us->max_spinup_ms); +} + +/* Input routine for the sysfs max_sectors file */ +static ssize_t +max_spinup_ms_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) +{ + struct us_data *us = host_to_us(dev_to_shost(dev)); + unsigned int ms; + + if (sscanf(buf, "%u", &ms) > 0) { + us->max_spinup_ms = ms; + return count; + } + return -EINVAL; +} + +static DEVICE_ATTR_RW(max_spinup_ms); +#endif + static struct device_attribute *sysfs_device_attr_list[] = { &dev_attr_max_sectors, +#if defined(CONFIG_AVM_USB_SUSPEND) + &dev_attr_max_spinup_ms, +#endif NULL, }; @@ -612,6 +642,10 @@ .sg_tablesize = SG_MAX_SEGMENTS, +#if defined(CONFIG_AVM_KERNEL) + /* limit the total size of a transfer to 1024 KB */ + .max_sectors = 2048, +#else /* * Limit the total size of a transfer to 120 KB. * @@ -630,6 +664,7 @@ * and 2048 for USB3 devices. */ .max_sectors = 240, +#endif /* * merge commands... this seems to help performance, but