VULN_CHECK_I913V6 GiddlmZddlddlZddlmZddlZddlZejjZ GddejZ y))base)*N)commandsc|eZdZdZdZdZedZdZdZ dZ e dd d Z e ddd Zy ) USBPlugina Sets autosuspend timeout of USB devices to the value specified by the [option]`autosuspend` option in seconds. If the [option]`devices` option is specified, the [option]`autosuspend` option applies to only the USB devices specified, otherwise it applies to all USB devices. The value `0` means that autosuspend is disabled. .Turn off USB autosuspend for USB devices `1-1` and `1-2` ==== ---- [usb] devices=1-1,1-2 autosuspend=0 ---- ==== cd|_t|_t|_|jj dj ddD]'}|jj|j)t|_ y)NTusbDEVTYPE usb_device) _devices_supportedset _free_devices_assigned_devices_hardware_inventory get_devicesmatch_propertyaddsys_namer_cmdselfdevices =/usr/lib/python3.12/site-packages/tuned/plugins/plugin_usb.py _init_deviceszUSBPlugin._init_devicessk $u$5$((44U;JJ9Vbcf&//*dj$)c`|Dcgc]}|jjd| c}Scc}w)Nr )r get_device)rdevicesxs r_get_device_objectszUSBPlugin._get_device_objects's-AH IA$ " " - -eQ 7 II Is#+c ddiS)N autosuspend)rs r_get_config_optionszUSBPlugin._get_config_options*s4 rc d|_d|_y)NTF)_has_static_tuning_has_dynamic_tuningrinstances r_instance_initzUSBPlugin._instance_init0s $(!&(rcy)Nr$r)s r_instance_cleanupzUSBPlugin._instance_cleanup4src d|zS)Nz)/sys/bus/usb/devices/%s/power/autosuspendr$rs r_autosuspend_sysfilezUSBPlugin._autosuspend_sysfile7s 4v ==rr#T) per_devicec|j|}|y|rdnd}|sB|j|}|jj|||rtj gnd|S)N10Fno_error) _option_boolr/r write_to_fileerrnoENOENT) rvaluerr*simremoveenablevalsys_files r_set_autosuspendzUSBPlugin._set_autosuspend:sc   U #& ^ 3# ''/8998S!' ~U4 *rcz|j|}|jj||jS)Nr4)r/r read_filestrip)rrr*ignore_missingr?s r_get_autosuspendzUSBPlugin._get_autosuspendGs5  & &v .(   X  ? E E GGrN)F)__name__ __module__ __qualname____doc__rr! classmethodr%r+r-r/ command_setr@ command_getrEr$rrrr sk$J '>m-  .  mHHrr)r decorators tuned.logstunedtuned.utils.commandsrglobr8logsgetlogPluginrr$rrrWs;)  jjnn@H @Hr