File tree 1 file changed +16
-4
lines changed
1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -1955,11 +1955,23 @@ static bool_t hid_ups_walk(walkmode_t mode)
1955
1955
1956
1956
case HU_WALKMODE_FULL_UPDATE :
1957
1957
/* These don't need polling after initinfo() */
1958
- if (item -> hidflags & (HU_FLAG_ABSENT | HU_TYPE_CMD | HU_FLAG_STATIC ))
1958
+ if (item -> hidflags & (HU_FLAG_ABSENT | HU_TYPE_CMD ))
1959
1959
continue ;
1960
1960
1961
- /* These need to be polled after user changes (setvar / instcmd) */
1962
- if ( (item -> hidflags & HU_FLAG_SEMI_STATIC ) && (data_has_changed == FALSE) )
1961
+ /* These don't need polling after initinfo() normally
1962
+ * However in "pollonly" mode we use these to detect "Data stale"
1963
+ * condition (e.g. cable disconnected) by failing the reads:
1964
+ */
1965
+ if ((item -> hidflags & HU_FLAG_STATIC ) && use_interrupt_pipe )
1966
+ continue ;
1967
+
1968
+ /* These need to be polled after user changes (setvar / instcmd)
1969
+ * or to detect "Data stale" in "pollonly" mode
1970
+ */
1971
+ if ( (item -> hidflags & HU_FLAG_SEMI_STATIC )
1972
+ && (data_has_changed == FALSE)
1973
+ && use_interrupt_pipe
1974
+ )
1963
1975
continue ;
1964
1976
1965
1977
break ;
@@ -2074,7 +2086,7 @@ static bool_t hid_ups_walk(walkmode_t mode)
2074
2086
if (ups_infoval_set (item , value ) != 1 )
2075
2087
continue ;
2076
2088
2077
- if (mode == HU_WALKMODE_INIT ) {
2089
+ if (mode == HU_WALKMODE_INIT || (! use_interrupt_pipe ) ) {
2078
2090
info_lkp_t * info_lkp ;
2079
2091
2080
2092
dstate_setflags (item -> info_type , item -> info_flags );
You can’t perform that action at this time.
0 commit comments