29
29
*/
30
30
31
31
#define DRIVER_NAME "Generic HID driver"
32
- #define DRIVER_VERSION "0.59 "
32
+ #define DRIVER_VERSION "0.60 "
33
33
34
34
#define HU_VAR_WAITBEFORERECONNECT "waitbeforereconnect"
35
35
@@ -1399,6 +1399,27 @@ void upsdrv_initups(void)
1399
1399
subdriver_matcher -> next = regex_matcher ;
1400
1400
#endif /* SHUT_MODE / USB */
1401
1401
1402
+ /* First activate the few tweaks which can impact device detection */
1403
+
1404
+ /* Activate Powercom tweaks */
1405
+ if (testvar ("interruptonly" )) {
1406
+ interrupt_only = 1 ;
1407
+ }
1408
+
1409
+ val = getval ("interruptsize" );
1410
+ if (val ) {
1411
+ int ipv = atoi (val );
1412
+ if (ipv > 0 ) {
1413
+ interrupt_size = (unsigned int )ipv ;
1414
+ } else {
1415
+ fatalx (EXIT_FAILURE , "Error: invalid interruptsize: %d" , ipv );
1416
+ }
1417
+ }
1418
+
1419
+ if (testvar ("disable_fix_report_desc" )) {
1420
+ disable_fix_report_desc = 1 ;
1421
+ }
1422
+
1402
1423
/* Search for the first supported UPS matching the
1403
1424
regular expression (USB) or device_path (SHUT) */
1404
1425
ret = comm_driver -> open_dev (& udev , & curDevice , subdriver_matcher , & callback );
@@ -1411,10 +1432,7 @@ void upsdrv_initups(void)
1411
1432
hd -> Vendor ? hd -> Vendor : "unknown" ,
1412
1433
hd -> Product ? hd -> Product : "unknown" );
1413
1434
1414
- /* Activate Powercom tweaks */
1415
- if (testvar ("interruptonly" )) {
1416
- interrupt_only = 1 ;
1417
- }
1435
+ /* Later activate the relatively cosmetic tweaks */
1418
1436
1419
1437
/* Activate Cyberpower/APC tweaks */
1420
1438
if (testvar ("onlinedischarge" ) || testvar ("onlinedischarge_onbattery" )) {
@@ -1544,20 +1562,6 @@ void upsdrv_initups(void)
1544
1562
lbrb_log_delay_without_calibrating = 1 ;
1545
1563
}
1546
1564
1547
- if (testvar ("disable_fix_report_desc" )) {
1548
- disable_fix_report_desc = 1 ;
1549
- }
1550
-
1551
- val = getval ("interruptsize" );
1552
- if (val ) {
1553
- int ipv = atoi (val );
1554
- if (ipv > 0 ) {
1555
- interrupt_size = (unsigned int )ipv ;
1556
- } else {
1557
- fatalx (EXIT_FAILURE , "Error: invalid interruptsize: %d" , ipv );
1558
- }
1559
- }
1560
-
1561
1565
if (hid_ups_walk (HU_WALKMODE_INIT ) == FALSE) {
1562
1566
fatalx (EXIT_FAILURE , "Can't initialize data from HID UPS" );
1563
1567
}
0 commit comments