nl-linux 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,233 @@
1
+ # SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
2
+ #
3
+ # Copyright (c) 2025 Valve Corporation.
4
+ #
5
+ #--
6
+ # frozen_string_literal: true
7
+ # rbs_inline: enabled
8
+ # This code is generated by Ynl::Generator. DO NOT EDIT.
9
+ require 'nl'
10
+ # Energy model netlink interface to notify its changes.
11
+ class Nl::Linux::DevEnergymodel < ::Nl::Family
12
+ NAME = "dev-energymodel"
13
+ PROTOCOL = Ractor.make_shareable(::Nl::Protocols::Genl.new("dev-energymodel"))
14
+ module Structs
15
+ end
16
+ module AttributeSets
17
+ # Information on a single performance domains.
18
+ class PerfDomain < ::Nl::Protocols::Genl::AttributeSet
19
+ # Abstract class
20
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
21
+ end
22
+ class Pad < Attribute
23
+ TYPE = 1
24
+ NAME = :"pad"
25
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Pad.new()
26
+ end
27
+ class PerfDomainId < Attribute
28
+ TYPE = 2
29
+ NAME = :"perf_domain_id"
30
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
31
+ end
32
+ class Flags < Attribute
33
+ TYPE = 3
34
+ NAME = :"flags"
35
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
36
+ end
37
+ class Cpus < Attribute
38
+ TYPE = 4
39
+ NAME = :"cpus"
40
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
41
+ end
42
+ # :nodoc:
43
+ BY_NAME = Ractor.make_shareable({:"pad" => Pad, :"perf_domain_id" => PerfDomainId, :"flags" => Flags, :"cpus" => Cpus}) #: Hash[::Symbol, Attribute]
44
+ # :nodoc:
45
+ BY_TYPE = Ractor.make_shareable({1 => Pad, 2 => PerfDomainId, 3 => Flags, 4 => Cpus}) #: Hash[::Integer, Attribute]
46
+ class << self
47
+ # Looks up Attribute class by name.
48
+ #--
49
+ # @rbs name: Symbol
50
+ # @rbs return: Attribute
51
+ def by_name(name); BY_NAME.fetch(name); end
52
+ # Looks up Attribute class by type value.
53
+ #--
54
+ # @rbs type: Integer
55
+ # @rbs return: Attribute
56
+ def by_type(type); BY_TYPE.fetch(type); end
57
+ end
58
+ end
59
+ # Performance states table.
60
+ class PerfTable < ::Nl::Protocols::Genl::AttributeSet
61
+ # Abstract class
62
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
63
+ end
64
+ class PerfDomainId < Attribute
65
+ TYPE = 1
66
+ NAME = :"perf_domain_id"
67
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U32, check: nil)
68
+ end
69
+ class PerfState < Attribute
70
+ TYPE = 2
71
+ NAME = :"perf_state"
72
+ end
73
+ # :nodoc:
74
+ BY_NAME = Ractor.make_shareable({:"perf_domain_id" => PerfDomainId, :"perf_state" => PerfState}) #: Hash[::Symbol, Attribute]
75
+ # :nodoc:
76
+ BY_TYPE = Ractor.make_shareable({1 => PerfDomainId, 2 => PerfState}) #: Hash[::Integer, Attribute]
77
+ class << self
78
+ # Looks up Attribute class by name.
79
+ #--
80
+ # @rbs name: Symbol
81
+ # @rbs return: Attribute
82
+ def by_name(name); BY_NAME.fetch(name); end
83
+ # Looks up Attribute class by type value.
84
+ #--
85
+ # @rbs type: Integer
86
+ # @rbs return: Attribute
87
+ def by_type(type); BY_TYPE.fetch(type); end
88
+ end
89
+ end
90
+ # Performance state of a performance domain.
91
+ class PerfState < ::Nl::Protocols::Genl::AttributeSet
92
+ # Abstract class
93
+ class Attribute < ::Nl::Protocols::Genl::AttributeSet::Attribute
94
+ end
95
+ class Pad < Attribute
96
+ TYPE = 1
97
+ NAME = :"pad"
98
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Pad.new()
99
+ end
100
+ class Performance < Attribute
101
+ TYPE = 2
102
+ NAME = :"performance"
103
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
104
+ end
105
+ class Frequency < Attribute
106
+ TYPE = 3
107
+ NAME = :"frequency"
108
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
109
+ end
110
+ class Power < Attribute
111
+ TYPE = 4
112
+ NAME = :"power"
113
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
114
+ end
115
+ class Cost < Attribute
116
+ TYPE = 5
117
+ NAME = :"cost"
118
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
119
+ end
120
+ class Flags < Attribute
121
+ TYPE = 6
122
+ NAME = :"flags"
123
+ DATATYPE = ::Nl::Protocols::Genl::DataTypes::Scalar.new(::Nl::Endian::Host::U64, check: nil)
124
+ end
125
+ # :nodoc:
126
+ BY_NAME = Ractor.make_shareable({:"pad" => Pad, :"performance" => Performance, :"frequency" => Frequency, :"power" => Power, :"cost" => Cost, :"flags" => Flags}) #: Hash[::Symbol, Attribute]
127
+ # :nodoc:
128
+ BY_TYPE = Ractor.make_shareable({1 => Pad, 2 => Performance, 3 => Frequency, 4 => Power, 5 => Cost, 6 => Flags}) #: Hash[::Integer, Attribute]
129
+ class << self
130
+ # Looks up Attribute class by name.
131
+ #--
132
+ # @rbs name: Symbol
133
+ # @rbs return: Attribute
134
+ def by_name(name); BY_NAME.fetch(name); end
135
+ # Looks up Attribute class by type value.
136
+ #--
137
+ # @rbs type: Integer
138
+ # @rbs return: Attribute
139
+ def by_type(type); BY_TYPE.fetch(type); end
140
+ end
141
+ end
142
+ PerfTable::PerfState::DATATYPE = ::Nl::Protocols::Genl::DataTypes::NestedAttributes.new(PerfState)
143
+ end
144
+ module Messages
145
+ # Get the list of information for all performance domains.
146
+ class DoGetPerfDomainsRequest < ::Nl::Protocols::Genl::Message
147
+ TYPE = 1
148
+ FIXED_HEADER = nil
149
+ ATTRIBUTE_SET = AttributeSets::PerfDomain
150
+ ATTRIBUTES = Ractor.make_shareable(%i[perf_domain_id])
151
+ # Gets the value of `perf-domain-id` attribute in the message.
152
+ #--
153
+ # @rbs return: ::Integer
154
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
155
+ end
156
+ # Get the list of information for all performance domains.
157
+ class DoGetPerfDomainsReply < ::Nl::Protocols::Genl::Message
158
+ TYPE = 1
159
+ FIXED_HEADER = nil
160
+ ATTRIBUTE_SET = AttributeSets::PerfDomain
161
+ ATTRIBUTES = Ractor.make_shareable(%i[pad perf_domain_id flags cpus])
162
+ # Gets the value of `perf-domain-id` attribute in the message.
163
+ #--
164
+ # @rbs return: ::Integer
165
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
166
+ # Gets the value of `flags` attribute in the message.
167
+ #--
168
+ # @rbs return: ::Integer
169
+ def flags; attributes[:"flags"]&.value; end
170
+ # Gets the value of `cpus` attribute in the message.
171
+ #--
172
+ # @rbs return: ::Integer
173
+ def cpus; attributes[:"cpus"]&.value; end
174
+ end
175
+ # Get the list of information for all performance domains.
176
+ class DumpGetPerfDomainsReply < ::Nl::Protocols::Genl::Message
177
+ TYPE = 1
178
+ FIXED_HEADER = nil
179
+ ATTRIBUTE_SET = AttributeSets::PerfDomain
180
+ ATTRIBUTES = Ractor.make_shareable(%i[pad perf_domain_id flags cpus])
181
+ # Gets the value of `perf-domain-id` attribute in the message.
182
+ #--
183
+ # @rbs return: ::Integer
184
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
185
+ # Gets the value of `flags` attribute in the message.
186
+ #--
187
+ # @rbs return: ::Integer
188
+ def flags; attributes[:"flags"]&.value; end
189
+ # Gets the value of `cpus` attribute in the message.
190
+ #--
191
+ # @rbs return: ::Integer
192
+ def cpus; attributes[:"cpus"]&.value; end
193
+ end
194
+ # Get the energy model table of a performance domain.
195
+ class DoGetPerfTableRequest < ::Nl::Protocols::Genl::Message
196
+ TYPE = 2
197
+ FIXED_HEADER = nil
198
+ ATTRIBUTE_SET = AttributeSets::PerfTable
199
+ ATTRIBUTES = Ractor.make_shareable(%i[perf_domain_id])
200
+ # Gets the value of `perf-domain-id` attribute in the message.
201
+ #--
202
+ # @rbs return: ::Integer
203
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
204
+ end
205
+ # Get the energy model table of a performance domain.
206
+ class DoGetPerfTableReply < ::Nl::Protocols::Genl::Message
207
+ TYPE = 2
208
+ FIXED_HEADER = nil
209
+ ATTRIBUTE_SET = AttributeSets::PerfTable
210
+ ATTRIBUTES = Ractor.make_shareable(%i[perf_domain_id perf_state])
211
+ # Gets the value of `perf-domain-id` attribute in the message.
212
+ #--
213
+ # @rbs return: ::Integer
214
+ def perf_domain_id; attributes[:"perf_domain_id"]&.value; end
215
+ # Gets the value of `perf-state` attribute in the message.
216
+ #--
217
+ # @rbs return: AttributeSets::PerfState
218
+ def perf_state; attributes[:"perf_state"]&.value; end
219
+ end
220
+ end
221
+ # Get the list of information for all performance domains.
222
+ #--
223
+ # @rbs (?perf_domain_id: ::Integer) -> Messages::DoGetPerfDomainsReply
224
+ def do_get_perf_domains(**args)
225
+ exchange_message(:"do", Messages::DoGetPerfDomainsRequest, Messages::DoGetPerfDomainsReply, args)
226
+ end
227
+ # Get the energy model table of a performance domain.
228
+ #--
229
+ # @rbs (?perf_domain_id: ::Integer) -> Messages::DoGetPerfTableReply
230
+ def do_get_perf_table(**args)
231
+ exchange_message(:"do", Messages::DoGetPerfTableRequest, Messages::DoGetPerfTableReply, args)
232
+ end
233
+ end