--- zzzz-none-000/linux-2.6.28.10/drivers/usb/storage/transport.c 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/drivers/usb/storage/transport.c 2016-07-28 13:47:37.000000000 +0000 @@ -60,6 +60,26 @@ #include #include "../../scsi/sd.h" +/* 20160728 AVM/VGJ USB KPI */ +#if defined (CONFIG_AVM_ENHANCED) + +#define BYTES_PER_GB (1024*1024*1024) + +int reset_count = 0; +module_param(reset_count, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(reset_count, "Count of resets"); + +int gb_transferred = 0; +module_param(gb_transferred, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(gb_transferred, "Count of gigabytes transferred"); + +int bytes_transferred = 0; +module_param(bytes_transferred, int, S_IRUGO | S_IWUSR); +MODULE_PARM_DESC(bytes_transferred, "Count of bytes transferred since last GB"); + +#endif + + /*********************************************************************** * Data transfer routines @@ -771,7 +791,14 @@ usb_stor_report_device_reset(us); scsi_unlock(us_to_host(us)); us->transport_reset(us); + } else { +/* 20160715 AVM/VGJ Increment reset counter */ +#if defined (CONFIG_AVM_ENHANCED) + printk(KERN_ERR "USB Storage device reset\n"); + reset_count++; +#endif } + clear_bit(US_FLIDX_RESETTING, &us->dflags); last_sector_hacks(us, srb); } @@ -1143,7 +1170,15 @@ sizeof(usb_stor_sense_invalidCDB)); return USB_STOR_TRANSPORT_NO_SENSE; } - + +/* 20160728 AVM/VGJ Increment bytes transferred counter */ +#if defined (CONFIG_AVM_ENHANCED) + bytes_transferred += transfer_length; + if(bytes_transferred > BYTES_PER_GB) { + gb_transferred++; + bytes_transferred -= BYTES_PER_GB; + } +#endif /* command good -- note that data could be short */ return USB_STOR_TRANSPORT_GOOD;