HEX
Server: LiteSpeed
System: Linux atali.colombiahosting.com.co 5.14.0-570.12.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 13 06:11:55 EDT 2025 x86_64
User: coopserp (1713)
PHP: 8.2.29
Disabled: dl,exec,passthru,proc_open,proc_close,shell_exec,memory_limit,system,popen,curl_multi_exec,show_source,symlink,link,leak,listen,diskfreespace,tmpfile,ignore_user_abord,highlight_file,source,show_source,fpaththru,virtual,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,posix_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setid,posix_times,posix_ttyname,posix_uname,proc_get_status,proc_nice,proc_terminate
Upload Files
File: //usr/lib/python3.9/site-packages/tuned/plugins/__pycache__/plugin_usb.cpython-39.opt-1.pyc
a

,�g��@sXddlmZddlTddlZddlmZddlZddlZej	�
�ZGdd�dej�Z
dS)�)�base)�*�N)�commandsc@sjeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
eddd�dd��Ze
d�ddd��ZdS)�	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
	----
	====
	cCsJd|_t�|_t�|_|j�d��dd�D]}|j�|j�q*t	�|_
dS)NT�usbZDEVTYPEZ
usb_device)Z_devices_supported�setZ
_free_devicesZ_assigned_devices�_hardware_inventoryZget_devicesZmatch_property�addZsys_namer�_cmd��self�device�r�</usr/lib/python3.9/site-packages/tuned/plugins/plugin_usb.py�
_init_devicesszUSBPlugin._init_devicescs�fdd�|D�S)Ncsg|]}�j�d|��qS)r)r	Z
get_device)�.0�x�r
rr�
<listcomp>(�z1USBPlugin._get_device_objects.<locals>.<listcomp>r)r
Zdevicesrrr�_get_device_objects'szUSBPlugin._get_device_objectscCsddiS)N�autosuspendrrrrr�_get_config_options*s�zUSBPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning�r
�instancerrr�_instance_init0szUSBPlugin._instance_initcCsdS)Nrrrrr�_instance_cleanup4szUSBPlugin._instance_cleanupcCsd|S)Nz)/sys/bus/usb/devices/%s/power/autosuspendrrrrr�_autosuspend_sysfile7szUSBPlugin._autosuspend_sysfilerT)Z
per_devicec	CsR|�|�}|durdS|rdnd}|sN|�|�}|jj|||rFtjgndd�|S)N�1�0F�Zno_error)Z_option_boolrrZ
write_to_file�errno�ENOENT)	r
�valuerrZsim�remove�enable�val�sys_filerrr�_set_autosuspend:s


�zUSBPlugin._set_autosuspendFcCs|�|�}|jj||d���S)Nr!)rrZ	read_file�strip)r
rrZignore_missingr(rrr�_get_autosuspendGs
zUSBPlugin._get_autosuspendN)F)�__name__�
__module__�__qualname__�__doc__rr�classmethodrrrrZcommand_setr)Zcommand_getr+rrrrr
s



r)�rZ
decoratorsZ
tuned.logsZtunedZtuned.utils.commandsr�globr"Zlogs�get�logZPluginrrrrr�<module>s