fidl_fuchsia_wlan_softmac__common/
fidl_fuchsia_wlan_softmac__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11pub const WLAN_MAC_MAX_RATES: u32 = 263;
12
13bitflags! {
14    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
15    pub struct WlanRxInfoFlags: u32 {
16        /// The FCS for the received frame was invalid.
17        const FCS_INVALID = 1;
18        /// Padding was added after the MAC header to align the frame body to 4 bytes.
19        const FRAME_BODY_PADDING_4 = 2;
20    }
21}
22
23impl WlanRxInfoFlags {
24    #[inline(always)]
25    pub fn from_bits_allow_unknown(bits: u32) -> Self {
26        Self::from_bits_retain(bits)
27    }
28
29    #[inline(always)]
30    pub fn has_unknown_bits(&self) -> bool {
31        self.get_unknown_bits() != 0
32    }
33
34    #[inline(always)]
35    pub fn get_unknown_bits(&self) -> u32 {
36        self.bits() & !Self::all().bits()
37    }
38}
39
40bitflags! {
41    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
42    pub struct WlanRxInfoValid: u32 {
43        const PHY = 1;
44        const DATA_RATE = 2;
45        const CHAN_WIDTH = 4;
46        const MCS = 8;
47        const RSSI = 16;
48        const SNR = 32;
49    }
50}
51
52impl WlanRxInfoValid {
53    #[inline(always)]
54    pub fn from_bits_allow_unknown(bits: u32) -> Self {
55        Self::from_bits_retain(bits)
56    }
57
58    #[inline(always)]
59    pub fn has_unknown_bits(&self) -> bool {
60        self.get_unknown_bits() != 0
61    }
62
63    #[inline(always)]
64    pub fn get_unknown_bits(&self) -> u32 {
65        self.bits() & !Self::all().bits()
66    }
67}
68
69bitflags! {
70    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
71    pub struct WlanTxInfoFlags: u32 {
72        /// Indicate this packet should be protected.
73        const PROTECTED = 1;
74        /// For rate control: indicate an important data frame, such as EAPOL, which should be sent
75        /// _reliably_ rather than fast, and is exempt from rate probing
76        const FAVOR_RELIABILITY = 2;
77        /// Indicate that this packet should be sent out with QoS header when possible (11n+).
78        const QOS = 4;
79    }
80}
81
82impl WlanTxInfoFlags {
83    #[inline(always)]
84    pub fn from_bits_allow_unknown(bits: u32) -> Self {
85        Self::from_bits_retain(bits)
86    }
87
88    #[inline(always)]
89    pub fn has_unknown_bits(&self) -> bool {
90        self.get_unknown_bits() != 0
91    }
92
93    #[inline(always)]
94    pub fn get_unknown_bits(&self) -> u32 {
95        self.bits() & !Self::all().bits()
96    }
97}
98
99bitflags! {
100    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
101    pub struct WlanTxInfoValid: u32 {
102        const DATA_RATE = 1;
103        const TX_VECTOR_IDX = 2;
104        const PHY = 4;
105        const CHANNEL_BANDWIDTH = 8;
106        const MCS = 16;
107    }
108}
109
110impl WlanTxInfoValid {
111    #[inline(always)]
112    pub fn from_bits_allow_unknown(bits: u32) -> Self {
113        Self::from_bits_retain(bits)
114    }
115
116    #[inline(always)]
117    pub fn has_unknown_bits(&self) -> bool {
118        self.get_unknown_bits() != 0
119    }
120
121    #[inline(always)]
122    pub fn get_unknown_bits(&self) -> u32 {
123        self.bits() & !Self::all().bits()
124    }
125}
126
127#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
128#[repr(u8)]
129pub enum WlanProtection {
130    None = 0,
131    Rx = 1,
132    Tx = 2,
133    RxTx = 3,
134}
135
136impl WlanProtection {
137    #[inline]
138    pub fn from_primitive(prim: u8) -> Option<Self> {
139        match prim {
140            0 => Some(Self::None),
141            1 => Some(Self::Rx),
142            2 => Some(Self::Tx),
143            3 => Some(Self::RxTx),
144            _ => None,
145        }
146    }
147
148    #[inline]
149    pub const fn into_primitive(self) -> u8 {
150        self as u8
151    }
152}
153
154#[derive(Clone, Debug, PartialEq)]
155pub struct WlanRxInfo {
156    /// Receive flags. These represent boolean flags as opposed to enums or value-based info which
157    /// are represented below. Values should be taken from the WLAN_RX_INFO_FLAGS_* enum.
158    pub rx_flags: WlanRxInfoFlags,
159    /// Bitmask indicating which of the following fields are valid in this struct. Reserved flags
160    /// must be zero.
161    pub valid_fields: WlanRxInfoValid,
162    /// The PHY format of the device at the time of the operation.
163    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
164    /// The data rate of the device, measured in units of 0.5 Mb/s.
165    pub data_rate: u32,
166    pub channel: fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
167    /// The modulation and coding scheme index of the device at the time of the operation. Depends
168    /// on the PHY format and channel width.
169    pub mcs: u8,
170    /// Received Signal Strength Indicator.
171    pub rssi_dbm: i8,
172    /// Signal-to-Noise Ratio, in 0.5 dB.
173    pub snr_dbh: i16,
174}
175
176impl fidl::Persistable for WlanRxInfo {}
177
178#[derive(Clone, Debug, PartialEq)]
179pub struct WlanRxPacket {
180    pub mac_frame: Vec<u8>,
181    pub info: WlanRxInfo,
182}
183
184impl fidl::Persistable for WlanRxPacket {}
185
186#[derive(Clone, Debug, PartialEq)]
187pub struct WlanSoftmacBaseJoinBssRequest {
188    pub join_request: fidl_fuchsia_wlan_common__common::JoinBssRequest,
189}
190
191impl fidl::Persistable for WlanSoftmacBaseJoinBssRequest {}
192
193#[derive(Clone, Debug, PartialEq)]
194pub struct WlanSoftmacBaseNotifyAssociationCompleteRequest {
195    pub assoc_cfg: WlanAssociationConfig,
196}
197
198impl fidl::Persistable for WlanSoftmacBaseNotifyAssociationCompleteRequest {}
199
200#[derive(Clone, Debug, PartialEq)]
201pub struct WlanSoftmacBaseQueryDiscoverySupportResponse {
202    pub resp: DiscoverySupport,
203}
204
205impl fidl::Persistable for WlanSoftmacBaseQueryDiscoverySupportResponse {}
206
207#[derive(Clone, Debug, PartialEq)]
208pub struct WlanSoftmacBaseQueryMacSublayerSupportResponse {
209    pub resp: fidl_fuchsia_wlan_common__common::MacSublayerSupport,
210}
211
212impl fidl::Persistable for WlanSoftmacBaseQueryMacSublayerSupportResponse {}
213
214#[derive(Clone, Debug, PartialEq)]
215pub struct WlanSoftmacBaseQuerySecuritySupportResponse {
216    pub resp: fidl_fuchsia_wlan_common__common::SecuritySupport,
217}
218
219impl fidl::Persistable for WlanSoftmacBaseQuerySecuritySupportResponse {}
220
221#[derive(Clone, Debug, PartialEq)]
222pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
223    pub resp: fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
224}
225
226impl fidl::Persistable for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {}
227
228#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
229#[repr(C)]
230pub struct WlanSoftmacBridgeSetEthernetStatusRequest {
231    pub status: u32,
232}
233
234impl fidl::Persistable for WlanSoftmacBridgeSetEthernetStatusRequest {}
235
236#[derive(Clone, Debug, PartialEq)]
237pub struct WlanSoftmacIfcBaseReportTxResultRequest {
238    pub tx_result: fidl_fuchsia_wlan_common__common::WlanTxResult,
239}
240
241impl fidl::Persistable for WlanSoftmacIfcBaseReportTxResultRequest {}
242
243#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
244pub struct WlanTxInfo {
245    /// Transmit flags. These represent boolean options as opposed to enums or other value-based
246    /// info which are represented below. Values should be taken from the WLAN_TX_INFO_FLAGS_* enum.
247    pub tx_flags: u32,
248    /// Bitmask indicating which of the following fields are valid in this struct. Reserved flags
249    /// must be zero. Values for fields not indicated by a flag may be chosen at the discretion of
250    /// the softmac driver.
251    pub valid_fields: u32,
252    pub tx_vector_idx: u16,
253    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
254    pub channel_bandwidth: fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
255    /// The modulation and coding scheme index for this packet. Depends on the PHY format and
256    /// channel width.
257    pub mcs: u8,
258}
259
260impl fidl::Persistable for WlanTxInfo {}
261
262#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
263pub struct WlanTxPacket {
264    pub mac_frame: Vec<u8>,
265    /// Additional data needed to transmit the packet.
266    /// TODO(https://fxbug.dev/42056823): This field is ignored by iwlwifi.
267    pub info: WlanTxInfo,
268}
269
270impl fidl::Persistable for WlanTxPacket {}
271
272/// Features related to discovery of potential BSSs.
273/// See IEEE 802.11-2016 11.1.4.2 and 11.1.4.3.
274#[derive(Clone, Debug, Default, PartialEq)]
275pub struct DiscoverySupport {
276    pub scan_offload: Option<ScanOffloadExtension>,
277    pub probe_response_offload: Option<ProbeResponseOffloadExtension>,
278    #[doc(hidden)]
279    pub __source_breaking: fidl::marker::SourceBreaking,
280}
281
282impl fidl::Persistable for DiscoverySupport {}
283
284#[derive(Clone, Debug, Default, PartialEq)]
285pub struct EthernetRxTransferRequest {
286    pub packet_address: Option<u64>,
287    pub packet_size: Option<u64>,
288    #[doc(hidden)]
289    pub __source_breaking: fidl::marker::SourceBreaking,
290}
291
292impl fidl::Persistable for EthernetRxTransferRequest {}
293
294#[derive(Clone, Debug, Default, PartialEq)]
295pub struct EthernetTxTransferRequest {
296    pub packet_address: Option<u64>,
297    pub packet_size: Option<u64>,
298    pub async_id: Option<u64>,
299    pub borrowed_operation: Option<u64>,
300    pub complete_borrowed_operation: Option<u64>,
301    #[doc(hidden)]
302    pub __source_breaking: fidl::marker::SourceBreaking,
303}
304
305impl fidl::Persistable for EthernetTxTransferRequest {}
306
307/// Indicates where and how probe responses are to be handled.
308/// See IEEE 802.11-2016 11.1.4.3.
309/// This is a discovery extension, expected to be used for softmac only.
310#[derive(Clone, Debug, Default, PartialEq)]
311pub struct ProbeResponseOffloadExtension {
312    /// If true, driver responds to probe requests; otherwise MLME must respond.
313    pub supported: Option<bool>,
314    #[doc(hidden)]
315    pub __source_breaking: fidl::marker::SourceBreaking,
316}
317
318impl fidl::Persistable for ProbeResponseOffloadExtension {}
319
320/// Indicates where and how scan logic is orchestrated.
321/// See IEEE 802.11-2016 11.1.4.2 and 11.1.4.3.
322/// This is a discovery extension, expected to be used for softmac only.
323#[derive(Clone, Debug, Default, PartialEq)]
324pub struct ScanOffloadExtension {
325    /// If true, driver orchestrates scans; otherwise MLME must do so.
326    pub supported: Option<bool>,
327    pub scan_cancel_supported: Option<bool>,
328    #[doc(hidden)]
329    pub __source_breaking: fidl::marker::SourceBreaking,
330}
331
332impl fidl::Persistable for ScanOffloadExtension {}
333
334/// Argument table to be passed as the single argument to
335/// WlanSoftmac.NotifyAssociationComplete.
336/// All information here is relevant only in the context of the association with
337/// the given peer_addr.
338/// All fields in this table are required unless stated otherwise.
339#[derive(Clone, Debug, Default, PartialEq)]
340pub struct WlanAssociationConfig {
341    /// The MAC address of the peer with which we are now associated.
342    pub bssid: Option<[u8; 6]>,
343    /// A unique identifier for this specific association. This is unique among
344    /// active associations, not necessarily historical ones.
345    pub aid: Option<u16>,
346    pub listen_interval: Option<u16>,
347    pub channel: Option<fidl_fuchsia_wlan_ieee80211__common::WlanChannel>,
348    /// QoS capable and parameters
349    pub qos: Option<bool>,
350    /// WFA WMM v1.2, 2.2.2
351    pub wmm_params: Option<fidl_fuchsia_wlan_common__common::WlanWmmParameters>,
352    /// Concatenation of SupportedRates and ExtendedSupportedRates
353    /// IEEE Std 802.11-2016, 9.4.2.3 & 9.4.2.13
354    pub rates: Option<Vec<u8>>,
355    /// IEEE Std 802.11-2016, 9.4.1.4
356    pub capability_info: Option<u16>,
357    /// IEEE Std 802.11-2016, 9.4.2.56, 57
358    /// Rx MCS Bitmask in Supported MCS Set field represents the set of MCS
359    /// the peer can receive at from this device, considering this device's Tx capability.
360    pub ht_cap: Option<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
361    pub ht_op: Option<fidl_fuchsia_wlan_ieee80211__common::HtOperation>,
362    /// IEEE Std 802.11-2016, 9.4.2.158, 159
363    pub vht_cap: Option<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
364    pub vht_op: Option<fidl_fuchsia_wlan_ieee80211__common::VhtOperation>,
365    #[doc(hidden)]
366    pub __source_breaking: fidl::marker::SourceBreaking,
367}
368
369impl fidl::Persistable for WlanAssociationConfig {}
370
371#[derive(Clone, Debug, Default, PartialEq)]
372pub struct WlanKeyConfiguration {
373    /// Which path to protect: None, TX, RX, or TX and RX.
374    pub protection: Option<WlanProtection>,
375    /// IEEE Cipher suite selector.
376    /// See IEEE Std 802.11-2016, 9.4.2.25.2, Table 9-131
377    pub cipher_oui: Option<[u8; 3]>,
378    pub cipher_type: Option<u8>,
379    pub key_type: Option<fidl_fuchsia_wlan_ieee80211__common::KeyType>,
380    /// The peer MAC address for pairwise and peer keys.
381    /// For group keys this value is always the broadcast address.
382    pub peer_addr: Option<[u8; 6]>,
383    /// Index for rotating keys, e.g. group keys.
384    /// This value is always 0 for key types which aren't rotating, e.g. pairwise keys.
385    pub key_idx: Option<u8>,
386    pub key: Option<Vec<u8>>,
387    /// Receive Sequence Counter for group keys only.
388    /// In all other cases the RSC will be 0.
389    pub rsc: Option<u64>,
390    #[doc(hidden)]
391    pub __source_breaking: fidl::marker::SourceBreaking,
392}
393
394impl fidl::Persistable for WlanKeyConfiguration {}
395
396#[derive(Clone, Debug, Default, PartialEq)]
397pub struct WlanRxTransferRequest {
398    pub packet_address: Option<u64>,
399    pub packet_size: Option<u64>,
400    pub packet_info: Option<WlanRxInfo>,
401    pub async_id: Option<u64>,
402    pub arena: Option<u64>,
403    #[doc(hidden)]
404    pub __source_breaking: fidl::marker::SourceBreaking,
405}
406
407impl fidl::Persistable for WlanRxTransferRequest {}
408
409/// Describes the capabilities of a SoftMAC on a particular band.
410#[derive(Clone, Debug, Default, PartialEq)]
411pub struct WlanSoftmacBandCapability {
412    pub band: Option<fidl_fuchsia_wlan_ieee80211__common::WlanBand>,
413    /// Count of supported basic rates. If the `basic_rate_list` field is
414    /// present, then this field **must** also be present and **must** be
415    /// consistent with the `basic_rate_list` field.
416    ///
417    /// # Deprecation
418    ///
419    /// This field has been replaced by `basic_rates`. Servers (i.e., drivers)
420    /// that target platform versions wherein `basic_rate_count` is deprecated
421    /// should omit it and write basic rates to the `basic_rates` field instead.
422    /// Clients attempt to read `basic_rates` before `basic_rate_count`.
423    pub basic_rate_count: Option<u8>,
424    /// Set of supported basic rates in units of 500 Kbit/s (as defined in IEEE
425    /// Std 802.11-2016, 9.4.2.3), e.g., 0x02 represents 1 Mbps. This set
426    /// represents all of the non-HT rates that the device supports for both
427    /// transmitting and receiving.
428    ///
429    /// The count of rates present in this field **must** be consistent with the
430    /// `basic_rate_count` field when present.
431    ///
432    /// # Deprecation
433    ///
434    /// This field has been replaced by `basic_rates`. Servers (i.e., drivers)
435    /// that target platform versions wherein `basic_rate_list` is deprecated
436    /// should omit it and write basic rates to the `basic_rates` field instead.
437    /// Clients attempt to read `basic_rates` before `basic_rate_list`.
438    pub basic_rate_list: Option<[u8; 12]>,
439    /// Determines if the `ht_caps` fields should be read by clients. If the
440    /// device supports HT PHY mode, then `ht_supported` **must** be true and
441    /// the `ht_caps` field **must** be set and provide data that describes HT
442    /// capabilities. Any other configuration of these fields means that the
443    /// device does **not** support HT PHY mode. See `HtCapabilities`.
444    ///
445    /// # Deprecation
446    ///
447    /// This field determines whether or not the `ht_caps` field is read by
448    /// clients, but is not strictly necessary as table fields like `ht_caps`
449    /// may be set or unset. Servers (i.e., drivers) that target platform
450    /// versions wherein `ht_supported` is deprecated should always set the
451    /// field to true and set `ht_caps` if the device supports HT PHY mode or
452    /// unset `ht_caps` if the device does not.
453    pub ht_supported: Option<bool>,
454    pub ht_caps: Option<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities>,
455    /// Determines if the `vht_caps` fields should be read by clients. If the
456    /// device supports VHT PHY mode, then `vht_supported` **must** be true and
457    /// the `vht_caps` field **must** be set and provide data that describes VHT
458    /// capabilities. Any other configuration of these fields means that the
459    /// device does **not** support VHT PHY mode. See `VhtCapabilities`.
460    ///
461    /// # Deprecation
462    ///
463    /// This field determines whether or not the `vht_caps` field is read by
464    /// clients, but is not strictly necessary as table fields like `vht_caps`
465    /// may be set or unset. Servers (i.e., drivers) that target platform
466    /// versions wherein `vht_supported` is deprecated should always set the
467    /// field to true and set `vht_caps` if the device supports VHT PHY mode or
468    /// unset `vht_caps` if the device does not.
469    pub vht_supported: Option<bool>,
470    pub vht_caps: Option<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities>,
471    /// Count of operating channels. If the `operating_channel_list` field is
472    /// present, then this field **must** also be present and **must** be
473    /// consistent with the `operating_channel_list` field.
474    ///
475    /// # Deprecation
476    ///
477    /// This field has been replaced by `operating_channels`. Servers (i.e.,
478    /// drivers) that target platform versions wherein `operating_channel_count`
479    /// is deprecated should omit it and write operating channels to the
480    /// `operating_channels` field instead. Clients attempt to read
481    /// `operating_channels` before `operating_channel_count`.
482    pub operating_channel_count: Option<u16>,
483    /// Set of valid operating channels per regulatory information as determined
484    /// by the device driver during iface creation. An operating channel refers
485    /// to a channel on which APs may transmit beacon frames.
486    ///
487    /// The count of channels present in this field **must** be consistent with
488    /// the `operating_channel_count` field when present.
489    ///
490    /// # Deprecation
491    ///
492    /// This field has been replaced by `operating_channels`. Servers (i.e.,
493    /// drivers) that target platform versions wherein `operating_channel_list`
494    /// is deprecated should omit it and write operating channels to the
495    /// `operating_channels` field instead. Clients attempt to read
496    /// `operating_channels` before `operating_channel_list`.
497    pub operating_channel_list: Option<[u8; 256]>,
498    /// Set of supported basic rates in units of 500 Kbit/s (as defined in IEEE
499    /// Std 802.11-2016, 9.4.2.3), e.g., 0x02 represents 1 Mbps. This set
500    /// represents all of the non-HT rates that the device supports for both
501    /// transmitting and receiving.
502    pub basic_rates: Option<Vec<u8>>,
503    /// Set of valid operating channels per regulatory information as determined
504    /// by the device driver during iface creation. An operating channel refers
505    /// to a channel on which APs may transmit beacon frames.
506    ///
507    /// The client must use this set to determine the efficacy of subsequent
508    /// requests to scan a subset of channels using the iface or to determine
509    /// which operating channel to use when starting an AP.
510    pub operating_channels: Option<Vec<u8>>,
511    #[doc(hidden)]
512    pub __source_breaking: fidl::marker::SourceBreaking,
513}
514
515impl fidl::Persistable for WlanSoftmacBandCapability {}
516
517#[derive(Clone, Debug, Default, PartialEq)]
518pub struct WlanSoftmacBaseCancelScanRequest {
519    pub scan_id: Option<u64>,
520    #[doc(hidden)]
521    pub __source_breaking: fidl::marker::SourceBreaking,
522}
523
524impl fidl::Persistable for WlanSoftmacBaseCancelScanRequest {}
525
526#[derive(Clone, Debug, Default, PartialEq)]
527pub struct WlanSoftmacBaseClearAssociationRequest {
528    pub peer_addr: Option<[u8; 6]>,
529    #[doc(hidden)]
530    pub __source_breaking: fidl::marker::SourceBreaking,
531}
532
533impl fidl::Persistable for WlanSoftmacBaseClearAssociationRequest {}
534
535#[derive(Clone, Debug, Default, PartialEq)]
536pub struct WlanSoftmacBaseEnableBeaconingRequest {
537    /// Beacon template. Since this is a template, some packet content can
538    /// only contain minimal valid information, because the content is later
539    /// modified by hardware, firmware, or software.
540    pub packet_template: Option<WlanTxPacket>,
541    /// TIM offset to the start of the `packet_template` field in bytes.
542    /// This must index the first byte of the TIM IE, which is the tag ID.
543    pub tim_ele_offset: Option<u64>,
544    /// Beacon interval period in TU.
545    pub beacon_interval: Option<u16>,
546    #[doc(hidden)]
547    pub __source_breaking: fidl::marker::SourceBreaking,
548}
549
550impl fidl::Persistable for WlanSoftmacBaseEnableBeaconingRequest {}
551
552#[derive(Clone, Debug, Default, PartialEq)]
553pub struct WlanSoftmacBaseSetChannelRequest {
554    pub channel: Option<fidl_fuchsia_wlan_ieee80211__common::WlanChannel>,
555    #[doc(hidden)]
556    pub __source_breaking: fidl::marker::SourceBreaking,
557}
558
559impl fidl::Persistable for WlanSoftmacBaseSetChannelRequest {}
560
561#[derive(Clone, Debug, Default, PartialEq)]
562pub struct WlanSoftmacBaseStartPassiveScanRequest {
563    /// List of channels to scan on. An empty list of channels will cause a
564    /// scan request to immediately return ZX_ERR_INVALID_ARGS.
565    ///
566    /// Invalid channel numbers will be silently ignored. The validity of a channel
567    /// number depends on the current regulatory region, and a SoftMAC driver cannot
568    /// always determine the region setting. This is especially the case when
569    /// firmware changes the region setting dynamically.
570    ///
571    /// This is a required parameter.
572    pub channels: Option<Vec<u8>>,
573    /// Minimum duration to spend on each channel during the scan.
574    pub min_channel_time: Option<i64>,
575    /// Maximum duration to spend on each channel during the scan.
576    pub max_channel_time: Option<i64>,
577    /// Minimum duration to spend on the home channel(s) between the dwell time on
578    /// each channel where a home channel corresponds to channels the device should
579    /// otherwise be present on while not scanning.
580    pub min_home_time: Option<i64>,
581    #[doc(hidden)]
582    pub __source_breaking: fidl::marker::SourceBreaking,
583}
584
585impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanRequest {}
586
587#[derive(Clone, Debug, Default, PartialEq)]
588pub struct WlanSoftmacBaseUpdateWmmParametersRequest {
589    pub ac: Option<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory>,
590    pub params: Option<fidl_fuchsia_wlan_common__common::WlanWmmParameters>,
591    #[doc(hidden)]
592    pub __source_breaking: fidl::marker::SourceBreaking,
593}
594
595impl fidl::Persistable for WlanSoftmacBaseUpdateWmmParametersRequest {}
596
597#[derive(Clone, Debug, Default, PartialEq)]
598pub struct WlanSoftmacBaseStartActiveScanResponse {
599    pub scan_id: Option<u64>,
600    #[doc(hidden)]
601    pub __source_breaking: fidl::marker::SourceBreaking,
602}
603
604impl fidl::Persistable for WlanSoftmacBaseStartActiveScanResponse {}
605
606#[derive(Clone, Debug, Default, PartialEq)]
607pub struct WlanSoftmacBaseStartPassiveScanResponse {
608    pub scan_id: Option<u64>,
609    #[doc(hidden)]
610    pub __source_breaking: fidl::marker::SourceBreaking,
611}
612
613impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanResponse {}
614
615#[derive(Clone, Debug, Default, PartialEq)]
616pub struct WlanSoftmacIfcBaseNotifyScanCompleteRequest {
617    pub status: Option<i32>,
618    pub scan_id: Option<u64>,
619    #[doc(hidden)]
620    pub __source_breaking: fidl::marker::SourceBreaking,
621}
622
623impl fidl::Persistable for WlanSoftmacIfcBaseNotifyScanCompleteRequest {}
624
625/// High-level information describing the state of a running softmac.
626/// All fields in this response are required.
627#[derive(Clone, Debug, Default, PartialEq)]
628pub struct WlanSoftmacQueryResponse {
629    /// Station address.
630    pub sta_addr: Option<[u8; 6]>,
631    /// MAC role
632    pub mac_role: Option<fidl_fuchsia_wlan_common__common::WlanMacRole>,
633    /// Bitmask indicating WlanInfoPhyType values supported by the hardware.
634    pub supported_phys: Option<Vec<fidl_fuchsia_wlan_common__common::WlanPhyType>>,
635    /// Bitmask indicating enabled WlanInfoHardwareCapability values. Values defined as fuchsia.wlan.common.WlanSoftmacHardwareCapability
636    pub hardware_capability: Option<u32>,
637    /// Supported bands.
638    pub band_caps: Option<Vec<WlanSoftmacBandCapability>>,
639    /// The MAC address of the device as assigned in the factory.
640    pub factory_addr: Option<[u8; 6]>,
641    #[doc(hidden)]
642    pub __source_breaking: fidl::marker::SourceBreaking,
643}
644
645impl fidl::Persistable for WlanSoftmacQueryResponse {}
646
647/// Argument struct to be passed as the single argument to WlanSoftmac.StartActiveScan
648#[derive(Clone, Debug, Default, PartialEq)]
649pub struct WlanSoftmacStartActiveScanRequest {
650    /// List of channels to scan on. An empty list of channels will cause a
651    /// scan request to immediately return ZX_ERR_INVALID_ARGS.
652    ///
653    /// Invalid channel numbers will be silently ignored. The validity of a channel
654    /// number depends on the current regulatory region, and a SoftMAC driver cannot
655    /// always determine the region setting. This is especially the case when
656    /// firmware changes the region setting dynamically.
657    pub channels: Option<Vec<u8>>,
658    /// List of SSIDs to scan for. For a list with a single SSID, the SSID will be placed in
659    /// the SSID element in the Probe Request frame. For a list with more than one SSID,
660    /// all SSIDs will be placed in an SSID List element in the Probe Request frame with the
661    /// first SSID in the list in the required SSID element. An empty list is the same as
662    /// specifying a list containing only the wildcard SSID.
663    pub ssids: Option<Vec<fidl_fuchsia_wlan_ieee80211__common::CSsid>>,
664    /// Buffer containing a MAC header (as defined in IEEE Std 802.11-2016, 9.3.3.2) to
665    /// include in each Probe Request frame.
666    pub mac_header: Option<Vec<u8>>,
667    /// Buffer containing IE bytes to include in each Probe Request frame.
668    ///
669    /// The IEs specified must not result in a Probe Request MMPDU that exceed the
670    /// limits defined by IEEE Std 802.11-2016, 9.2.4.7. MMPDU limit constants can
671    /// be found in fuchsia.wlan.ieee80211. These limits are very large and will
672    /// likely not be exceeded by specifying the most common IEs found in
673    /// Probe Request frames.
674    pub ies: Option<Vec<u8>>,
675    /// Minimum duration to spend on each channel during the scan.
676    pub min_channel_time: Option<i64>,
677    /// Maximum duration to spend on each channel during the scan.
678    pub max_channel_time: Option<i64>,
679    /// Minimum duration to spend on the home channel(s) between the dwell time on each channel
680    /// where a home channel corresponds to channels the device should otherwise be present
681    /// on while not scanning.
682    pub min_home_time: Option<i64>,
683    /// Minimum number of Probe Request frames to transmit per channel visit during a scan.
684    /// The definition of a channel visit may differ between device drivers, but it is roughly
685    /// the interval of time spent on a specific channel during a scan.
686    ///
687    /// Sending more than one Probe Request frame on a channel may increase the probability that
688    /// it is received in a noisy environment.
689    pub min_probes_per_channel: Option<u8>,
690    /// Maximum number of Probe Request frames to transmit per channel visit during a scan.
691    /// The definition of a channel visit may differ between device drivers, but it is roughly
692    /// the interval of time spent on a specific channel during a scan. Specifying 0 is invalid
693    /// since at least one Probe Request frame must be transmitted for an active scan.
694    ///
695    /// Limiting the number of Probe Request frames sent on a channel reduces the time spent
696    /// transmitting frames, and thus increase the time spent receiving frames, while scanning.
697    pub max_probes_per_channel: Option<u8>,
698    #[doc(hidden)]
699    pub __source_breaking: fidl::marker::SourceBreaking,
700}
701
702impl fidl::Persistable for WlanSoftmacStartActiveScanRequest {}
703
704#[derive(Clone, Debug, Default, PartialEq)]
705pub struct WlanTxTransferRequest {
706    pub packet_address: Option<u64>,
707    pub packet_size: Option<u64>,
708    pub packet_info: Option<WlanTxInfo>,
709    pub async_id: Option<u64>,
710    pub arena: Option<u64>,
711    #[doc(hidden)]
712    pub __source_breaking: fidl::marker::SourceBreaking,
713}
714
715impl fidl::Persistable for WlanTxTransferRequest {}
716
717pub mod ethernet_rx_ordinals {
718    pub const TRANSFER: u64 = 0x199ff3498ef8a22a;
719}
720
721pub mod ethernet_tx_ordinals {
722    pub const TRANSFER: u64 = 0x616dafedf07d00e7;
723}
724
725pub mod wlan_rx_ordinals {
726    pub const TRANSFER: u64 = 0x2c73b18cbfca6055;
727}
728
729pub mod wlan_softmac_base_ordinals {
730    pub const QUERY: u64 = 0x18231a638e508f9d;
731    pub const QUERY_DISCOVERY_SUPPORT: u64 = 0x16797affc0cb58ae;
732    pub const QUERY_MAC_SUBLAYER_SUPPORT: u64 = 0x7302c3f8c131f075;
733    pub const QUERY_SECURITY_SUPPORT: u64 = 0x3691bb75abf6354;
734    pub const QUERY_SPECTRUM_MANAGEMENT_SUPPORT: u64 = 0x347d78dc1d4d27bf;
735    pub const SET_CHANNEL: u64 = 0x12836b533cd63ece;
736    pub const JOIN_BSS: u64 = 0x1336fb5455b77a6e;
737    pub const ENABLE_BEACONING: u64 = 0x6c35807632c64576;
738    pub const DISABLE_BEACONING: u64 = 0x3303b30f99dbb406;
739    pub const INSTALL_KEY: u64 = 0x7decf9b4200b9131;
740    pub const NOTIFY_ASSOCIATION_COMPLETE: u64 = 0x436ffe3ba461d6cd;
741    pub const CLEAR_ASSOCIATION: u64 = 0x581d76c39190a7dd;
742    pub const START_PASSIVE_SCAN: u64 = 0x5662f989cb4083bb;
743    pub const START_ACTIVE_SCAN: u64 = 0x4896eafa9937751e;
744    pub const CANCEL_SCAN: u64 = 0xf7d859369764556;
745    pub const UPDATE_WMM_PARAMETERS: u64 = 0x68522c7122d5f78c;
746}
747
748pub mod wlan_softmac_bridge_ordinals {
749    pub const QUERY: u64 = 0x18231a638e508f9d;
750    pub const QUERY_DISCOVERY_SUPPORT: u64 = 0x16797affc0cb58ae;
751    pub const QUERY_MAC_SUBLAYER_SUPPORT: u64 = 0x7302c3f8c131f075;
752    pub const QUERY_SECURITY_SUPPORT: u64 = 0x3691bb75abf6354;
753    pub const QUERY_SPECTRUM_MANAGEMENT_SUPPORT: u64 = 0x347d78dc1d4d27bf;
754    pub const SET_CHANNEL: u64 = 0x12836b533cd63ece;
755    pub const JOIN_BSS: u64 = 0x1336fb5455b77a6e;
756    pub const ENABLE_BEACONING: u64 = 0x6c35807632c64576;
757    pub const DISABLE_BEACONING: u64 = 0x3303b30f99dbb406;
758    pub const INSTALL_KEY: u64 = 0x7decf9b4200b9131;
759    pub const NOTIFY_ASSOCIATION_COMPLETE: u64 = 0x436ffe3ba461d6cd;
760    pub const CLEAR_ASSOCIATION: u64 = 0x581d76c39190a7dd;
761    pub const START_PASSIVE_SCAN: u64 = 0x5662f989cb4083bb;
762    pub const START_ACTIVE_SCAN: u64 = 0x4896eafa9937751e;
763    pub const CANCEL_SCAN: u64 = 0xf7d859369764556;
764    pub const UPDATE_WMM_PARAMETERS: u64 = 0x68522c7122d5f78c;
765    pub const START: u64 = 0x7b2c15a507020d4d;
766    pub const SET_ETHERNET_STATUS: u64 = 0x412503cb3aaa350b;
767}
768
769pub mod wlan_softmac_ifc_base_ordinals {
770    pub const REPORT_TX_RESULT: u64 = 0x5835c2f13d94e09a;
771    pub const NOTIFY_SCAN_COMPLETE: u64 = 0x7045e3cd460dc42c;
772}
773
774pub mod wlan_softmac_ifc_bridge_ordinals {
775    pub const REPORT_TX_RESULT: u64 = 0x5835c2f13d94e09a;
776    pub const NOTIFY_SCAN_COMPLETE: u64 = 0x7045e3cd460dc42c;
777    pub const STOP_BRIDGED_DRIVER: u64 = 0x112dbd0cc2251151;
778}
779
780pub mod wlan_tx_ordinals {
781    pub const TRANSFER: u64 = 0x19f8ff7a8b910ab3;
782}
783
784mod internal {
785    use super::*;
786    unsafe impl fidl::encoding::TypeMarker for WlanRxInfoFlags {
787        type Owned = Self;
788
789        #[inline(always)]
790        fn inline_align(_context: fidl::encoding::Context) -> usize {
791            4
792        }
793
794        #[inline(always)]
795        fn inline_size(_context: fidl::encoding::Context) -> usize {
796            4
797        }
798    }
799
800    impl fidl::encoding::ValueTypeMarker for WlanRxInfoFlags {
801        type Borrowed<'a> = Self;
802        #[inline(always)]
803        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
804            *value
805        }
806    }
807
808    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
809        for WlanRxInfoFlags
810    {
811        #[inline]
812        unsafe fn encode(
813            self,
814            encoder: &mut fidl::encoding::Encoder<'_, D>,
815            offset: usize,
816            _depth: fidl::encoding::Depth,
817        ) -> fidl::Result<()> {
818            encoder.debug_check_bounds::<Self>(offset);
819            encoder.write_num(self.bits(), offset);
820            Ok(())
821        }
822    }
823
824    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoFlags {
825        #[inline(always)]
826        fn new_empty() -> Self {
827            Self::empty()
828        }
829
830        #[inline]
831        unsafe fn decode(
832            &mut self,
833            decoder: &mut fidl::encoding::Decoder<'_, D>,
834            offset: usize,
835            _depth: fidl::encoding::Depth,
836        ) -> fidl::Result<()> {
837            decoder.debug_check_bounds::<Self>(offset);
838            let prim = decoder.read_num::<u32>(offset);
839            *self = Self::from_bits_allow_unknown(prim);
840            Ok(())
841        }
842    }
843    unsafe impl fidl::encoding::TypeMarker for WlanRxInfoValid {
844        type Owned = Self;
845
846        #[inline(always)]
847        fn inline_align(_context: fidl::encoding::Context) -> usize {
848            4
849        }
850
851        #[inline(always)]
852        fn inline_size(_context: fidl::encoding::Context) -> usize {
853            4
854        }
855    }
856
857    impl fidl::encoding::ValueTypeMarker for WlanRxInfoValid {
858        type Borrowed<'a> = Self;
859        #[inline(always)]
860        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
861            *value
862        }
863    }
864
865    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
866        for WlanRxInfoValid
867    {
868        #[inline]
869        unsafe fn encode(
870            self,
871            encoder: &mut fidl::encoding::Encoder<'_, D>,
872            offset: usize,
873            _depth: fidl::encoding::Depth,
874        ) -> fidl::Result<()> {
875            encoder.debug_check_bounds::<Self>(offset);
876            encoder.write_num(self.bits(), offset);
877            Ok(())
878        }
879    }
880
881    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoValid {
882        #[inline(always)]
883        fn new_empty() -> Self {
884            Self::empty()
885        }
886
887        #[inline]
888        unsafe fn decode(
889            &mut self,
890            decoder: &mut fidl::encoding::Decoder<'_, D>,
891            offset: usize,
892            _depth: fidl::encoding::Depth,
893        ) -> fidl::Result<()> {
894            decoder.debug_check_bounds::<Self>(offset);
895            let prim = decoder.read_num::<u32>(offset);
896            *self = Self::from_bits_allow_unknown(prim);
897            Ok(())
898        }
899    }
900    unsafe impl fidl::encoding::TypeMarker for WlanTxInfoFlags {
901        type Owned = Self;
902
903        #[inline(always)]
904        fn inline_align(_context: fidl::encoding::Context) -> usize {
905            4
906        }
907
908        #[inline(always)]
909        fn inline_size(_context: fidl::encoding::Context) -> usize {
910            4
911        }
912    }
913
914    impl fidl::encoding::ValueTypeMarker for WlanTxInfoFlags {
915        type Borrowed<'a> = Self;
916        #[inline(always)]
917        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
918            *value
919        }
920    }
921
922    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
923        for WlanTxInfoFlags
924    {
925        #[inline]
926        unsafe fn encode(
927            self,
928            encoder: &mut fidl::encoding::Encoder<'_, D>,
929            offset: usize,
930            _depth: fidl::encoding::Depth,
931        ) -> fidl::Result<()> {
932            encoder.debug_check_bounds::<Self>(offset);
933            encoder.write_num(self.bits(), offset);
934            Ok(())
935        }
936    }
937
938    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoFlags {
939        #[inline(always)]
940        fn new_empty() -> Self {
941            Self::empty()
942        }
943
944        #[inline]
945        unsafe fn decode(
946            &mut self,
947            decoder: &mut fidl::encoding::Decoder<'_, D>,
948            offset: usize,
949            _depth: fidl::encoding::Depth,
950        ) -> fidl::Result<()> {
951            decoder.debug_check_bounds::<Self>(offset);
952            let prim = decoder.read_num::<u32>(offset);
953            *self = Self::from_bits_allow_unknown(prim);
954            Ok(())
955        }
956    }
957    unsafe impl fidl::encoding::TypeMarker for WlanTxInfoValid {
958        type Owned = Self;
959
960        #[inline(always)]
961        fn inline_align(_context: fidl::encoding::Context) -> usize {
962            4
963        }
964
965        #[inline(always)]
966        fn inline_size(_context: fidl::encoding::Context) -> usize {
967            4
968        }
969    }
970
971    impl fidl::encoding::ValueTypeMarker for WlanTxInfoValid {
972        type Borrowed<'a> = Self;
973        #[inline(always)]
974        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
975            *value
976        }
977    }
978
979    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
980        for WlanTxInfoValid
981    {
982        #[inline]
983        unsafe fn encode(
984            self,
985            encoder: &mut fidl::encoding::Encoder<'_, D>,
986            offset: usize,
987            _depth: fidl::encoding::Depth,
988        ) -> fidl::Result<()> {
989            encoder.debug_check_bounds::<Self>(offset);
990            encoder.write_num(self.bits(), offset);
991            Ok(())
992        }
993    }
994
995    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoValid {
996        #[inline(always)]
997        fn new_empty() -> Self {
998            Self::empty()
999        }
1000
1001        #[inline]
1002        unsafe fn decode(
1003            &mut self,
1004            decoder: &mut fidl::encoding::Decoder<'_, D>,
1005            offset: usize,
1006            _depth: fidl::encoding::Depth,
1007        ) -> fidl::Result<()> {
1008            decoder.debug_check_bounds::<Self>(offset);
1009            let prim = decoder.read_num::<u32>(offset);
1010            *self = Self::from_bits_allow_unknown(prim);
1011            Ok(())
1012        }
1013    }
1014    unsafe impl fidl::encoding::TypeMarker for WlanProtection {
1015        type Owned = Self;
1016
1017        #[inline(always)]
1018        fn inline_align(_context: fidl::encoding::Context) -> usize {
1019            std::mem::align_of::<u8>()
1020        }
1021
1022        #[inline(always)]
1023        fn inline_size(_context: fidl::encoding::Context) -> usize {
1024            std::mem::size_of::<u8>()
1025        }
1026
1027        #[inline(always)]
1028        fn encode_is_copy() -> bool {
1029            true
1030        }
1031
1032        #[inline(always)]
1033        fn decode_is_copy() -> bool {
1034            false
1035        }
1036    }
1037
1038    impl fidl::encoding::ValueTypeMarker for WlanProtection {
1039        type Borrowed<'a> = Self;
1040        #[inline(always)]
1041        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1042            *value
1043        }
1044    }
1045
1046    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
1047        #[inline]
1048        unsafe fn encode(
1049            self,
1050            encoder: &mut fidl::encoding::Encoder<'_, D>,
1051            offset: usize,
1052            _depth: fidl::encoding::Depth,
1053        ) -> fidl::Result<()> {
1054            encoder.debug_check_bounds::<Self>(offset);
1055            encoder.write_num(self.into_primitive(), offset);
1056            Ok(())
1057        }
1058    }
1059
1060    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
1061        #[inline(always)]
1062        fn new_empty() -> Self {
1063            Self::None
1064        }
1065
1066        #[inline]
1067        unsafe fn decode(
1068            &mut self,
1069            decoder: &mut fidl::encoding::Decoder<'_, D>,
1070            offset: usize,
1071            _depth: fidl::encoding::Depth,
1072        ) -> fidl::Result<()> {
1073            decoder.debug_check_bounds::<Self>(offset);
1074            let prim = decoder.read_num::<u8>(offset);
1075
1076            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1077            Ok(())
1078        }
1079    }
1080
1081    impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
1082        type Borrowed<'a> = &'a Self;
1083        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1084            value
1085        }
1086    }
1087
1088    unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
1089        type Owned = Self;
1090
1091        #[inline(always)]
1092        fn inline_align(_context: fidl::encoding::Context) -> usize {
1093            4
1094        }
1095
1096        #[inline(always)]
1097        fn inline_size(_context: fidl::encoding::Context) -> usize {
1098            32
1099        }
1100    }
1101
1102    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
1103        for &WlanRxInfo
1104    {
1105        #[inline]
1106        unsafe fn encode(
1107            self,
1108            encoder: &mut fidl::encoding::Encoder<'_, D>,
1109            offset: usize,
1110            _depth: fidl::encoding::Depth,
1111        ) -> fidl::Result<()> {
1112            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1113            // Delegate to tuple encoding.
1114            fidl::encoding::Encode::<WlanRxInfo, D>::encode(
1115                (
1116                    <WlanRxInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
1117                    <WlanRxInfoValid as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1118                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1119                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
1120                    <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
1121                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1122                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
1123                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
1124                ),
1125                encoder, offset, _depth
1126            )
1127        }
1128    }
1129    unsafe impl<
1130        D: fidl::encoding::ResourceDialect,
1131        T0: fidl::encoding::Encode<WlanRxInfoFlags, D>,
1132        T1: fidl::encoding::Encode<WlanRxInfoValid, D>,
1133        T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1134        T3: fidl::encoding::Encode<u32, D>,
1135        T4: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>,
1136        T5: fidl::encoding::Encode<u8, D>,
1137        T6: fidl::encoding::Encode<i8, D>,
1138        T7: fidl::encoding::Encode<i16, D>,
1139    > fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
1140    {
1141        #[inline]
1142        unsafe fn encode(
1143            self,
1144            encoder: &mut fidl::encoding::Encoder<'_, D>,
1145            offset: usize,
1146            depth: fidl::encoding::Depth,
1147        ) -> fidl::Result<()> {
1148            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1149            // Zero out padding regions. There's no need to apply masks
1150            // because the unmasked parts will be overwritten by fields.
1151            // Write the fields.
1152            self.0.encode(encoder, offset + 0, depth)?;
1153            self.1.encode(encoder, offset + 4, depth)?;
1154            self.2.encode(encoder, offset + 8, depth)?;
1155            self.3.encode(encoder, offset + 12, depth)?;
1156            self.4.encode(encoder, offset + 16, depth)?;
1157            self.5.encode(encoder, offset + 28, depth)?;
1158            self.6.encode(encoder, offset + 29, depth)?;
1159            self.7.encode(encoder, offset + 30, depth)?;
1160            Ok(())
1161        }
1162    }
1163
1164    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
1165        #[inline(always)]
1166        fn new_empty() -> Self {
1167            Self {
1168                rx_flags: fidl::new_empty!(WlanRxInfoFlags, D),
1169                valid_fields: fidl::new_empty!(WlanRxInfoValid, D),
1170                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1171                data_rate: fidl::new_empty!(u32, D),
1172                channel: fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D),
1173                mcs: fidl::new_empty!(u8, D),
1174                rssi_dbm: fidl::new_empty!(i8, D),
1175                snr_dbh: fidl::new_empty!(i16, D),
1176            }
1177        }
1178
1179        #[inline]
1180        unsafe fn decode(
1181            &mut self,
1182            decoder: &mut fidl::encoding::Decoder<'_, D>,
1183            offset: usize,
1184            _depth: fidl::encoding::Depth,
1185        ) -> fidl::Result<()> {
1186            decoder.debug_check_bounds::<Self>(offset);
1187            // Verify that padding bytes are zero.
1188            fidl::decode!(WlanRxInfoFlags, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
1189            fidl::decode!(WlanRxInfoValid, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1190            fidl::decode!(
1191                fidl_fuchsia_wlan_common__common::WlanPhyType,
1192                D,
1193                &mut self.phy,
1194                decoder,
1195                offset + 8,
1196                _depth
1197            )?;
1198            fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
1199            fidl::decode!(
1200                fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
1201                D,
1202                &mut self.channel,
1203                decoder,
1204                offset + 16,
1205                _depth
1206            )?;
1207            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
1208            fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
1209            fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
1210            Ok(())
1211        }
1212    }
1213
1214    impl fidl::encoding::ValueTypeMarker for WlanRxPacket {
1215        type Borrowed<'a> = &'a Self;
1216        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1217            value
1218        }
1219    }
1220
1221    unsafe impl fidl::encoding::TypeMarker for WlanRxPacket {
1222        type Owned = Self;
1223
1224        #[inline(always)]
1225        fn inline_align(_context: fidl::encoding::Context) -> usize {
1226            8
1227        }
1228
1229        #[inline(always)]
1230        fn inline_size(_context: fidl::encoding::Context) -> usize {
1231            48
1232        }
1233    }
1234
1235    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxPacket, D>
1236        for &WlanRxPacket
1237    {
1238        #[inline]
1239        unsafe fn encode(
1240            self,
1241            encoder: &mut fidl::encoding::Encoder<'_, D>,
1242            offset: usize,
1243            _depth: fidl::encoding::Depth,
1244        ) -> fidl::Result<()> {
1245            encoder.debug_check_bounds::<WlanRxPacket>(offset);
1246            // Delegate to tuple encoding.
1247            fidl::encoding::Encode::<WlanRxPacket, D>::encode(
1248                (
1249                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
1250                    <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1251                ),
1252                encoder, offset, _depth
1253            )
1254        }
1255    }
1256    unsafe impl<
1257        D: fidl::encoding::ResourceDialect,
1258        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1259        T1: fidl::encoding::Encode<WlanRxInfo, D>,
1260    > fidl::encoding::Encode<WlanRxPacket, D> for (T0, T1)
1261    {
1262        #[inline]
1263        unsafe fn encode(
1264            self,
1265            encoder: &mut fidl::encoding::Encoder<'_, D>,
1266            offset: usize,
1267            depth: fidl::encoding::Depth,
1268        ) -> fidl::Result<()> {
1269            encoder.debug_check_bounds::<WlanRxPacket>(offset);
1270            // Zero out padding regions. There's no need to apply masks
1271            // because the unmasked parts will be overwritten by fields.
1272            // Write the fields.
1273            self.0.encode(encoder, offset + 0, depth)?;
1274            self.1.encode(encoder, offset + 16, depth)?;
1275            Ok(())
1276        }
1277    }
1278
1279    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxPacket {
1280        #[inline(always)]
1281        fn new_empty() -> Self {
1282            Self {
1283                mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1284                info: fidl::new_empty!(WlanRxInfo, D),
1285            }
1286        }
1287
1288        #[inline]
1289        unsafe fn decode(
1290            &mut self,
1291            decoder: &mut fidl::encoding::Decoder<'_, D>,
1292            offset: usize,
1293            _depth: fidl::encoding::Depth,
1294        ) -> fidl::Result<()> {
1295            decoder.debug_check_bounds::<Self>(offset);
1296            // Verify that padding bytes are zero.
1297            fidl::decode!(
1298                fidl::encoding::UnboundedVector<u8>,
1299                D,
1300                &mut self.mac_frame,
1301                decoder,
1302                offset + 0,
1303                _depth
1304            )?;
1305            fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1306            Ok(())
1307        }
1308    }
1309
1310    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseJoinBssRequest {
1311        type Borrowed<'a> = &'a Self;
1312        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1313            value
1314        }
1315    }
1316
1317    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseJoinBssRequest {
1318        type Owned = Self;
1319
1320        #[inline(always)]
1321        fn inline_align(_context: fidl::encoding::Context) -> usize {
1322            8
1323        }
1324
1325        #[inline(always)]
1326        fn inline_size(_context: fidl::encoding::Context) -> usize {
1327            16
1328        }
1329    }
1330
1331    unsafe impl<D: fidl::encoding::ResourceDialect>
1332        fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D>
1333        for &WlanSoftmacBaseJoinBssRequest
1334    {
1335        #[inline]
1336        unsafe fn encode(
1337            self,
1338            encoder: &mut fidl::encoding::Encoder<'_, D>,
1339            offset: usize,
1340            _depth: fidl::encoding::Depth,
1341        ) -> fidl::Result<()> {
1342            encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
1343            // Delegate to tuple encoding.
1344            fidl::encoding::Encode::<WlanSoftmacBaseJoinBssRequest, D>::encode(
1345                (
1346                    <fidl_fuchsia_wlan_common__common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.join_request),
1347                ),
1348                encoder, offset, _depth
1349            )
1350        }
1351    }
1352    unsafe impl<
1353        D: fidl::encoding::ResourceDialect,
1354        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::JoinBssRequest, D>,
1355    > fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D> for (T0,)
1356    {
1357        #[inline]
1358        unsafe fn encode(
1359            self,
1360            encoder: &mut fidl::encoding::Encoder<'_, D>,
1361            offset: usize,
1362            depth: fidl::encoding::Depth,
1363        ) -> fidl::Result<()> {
1364            encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
1365            // Zero out padding regions. There's no need to apply masks
1366            // because the unmasked parts will be overwritten by fields.
1367            // Write the fields.
1368            self.0.encode(encoder, offset + 0, depth)?;
1369            Ok(())
1370        }
1371    }
1372
1373    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1374        for WlanSoftmacBaseJoinBssRequest
1375    {
1376        #[inline(always)]
1377        fn new_empty() -> Self {
1378            Self {
1379                join_request: fidl::new_empty!(fidl_fuchsia_wlan_common__common::JoinBssRequest, D),
1380            }
1381        }
1382
1383        #[inline]
1384        unsafe fn decode(
1385            &mut self,
1386            decoder: &mut fidl::encoding::Decoder<'_, D>,
1387            offset: usize,
1388            _depth: fidl::encoding::Depth,
1389        ) -> fidl::Result<()> {
1390            decoder.debug_check_bounds::<Self>(offset);
1391            // Verify that padding bytes are zero.
1392            fidl::decode!(
1393                fidl_fuchsia_wlan_common__common::JoinBssRequest,
1394                D,
1395                &mut self.join_request,
1396                decoder,
1397                offset + 0,
1398                _depth
1399            )?;
1400            Ok(())
1401        }
1402    }
1403
1404    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
1405        type Borrowed<'a> = &'a Self;
1406        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1407            value
1408        }
1409    }
1410
1411    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
1412        type Owned = Self;
1413
1414        #[inline(always)]
1415        fn inline_align(_context: fidl::encoding::Context) -> usize {
1416            8
1417        }
1418
1419        #[inline(always)]
1420        fn inline_size(_context: fidl::encoding::Context) -> usize {
1421            16
1422        }
1423    }
1424
1425    unsafe impl<D: fidl::encoding::ResourceDialect>
1426        fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>
1427        for &WlanSoftmacBaseNotifyAssociationCompleteRequest
1428    {
1429        #[inline]
1430        unsafe fn encode(
1431            self,
1432            encoder: &mut fidl::encoding::Encoder<'_, D>,
1433            offset: usize,
1434            _depth: fidl::encoding::Depth,
1435        ) -> fidl::Result<()> {
1436            encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
1437            // Delegate to tuple encoding.
1438            fidl::encoding::Encode::<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>::encode(
1439                (<WlanAssociationConfig as fidl::encoding::ValueTypeMarker>::borrow(
1440                    &self.assoc_cfg,
1441                ),),
1442                encoder,
1443                offset,
1444                _depth,
1445            )
1446        }
1447    }
1448    unsafe impl<
1449        D: fidl::encoding::ResourceDialect,
1450        T0: fidl::encoding::Encode<WlanAssociationConfig, D>,
1451    > fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D> for (T0,)
1452    {
1453        #[inline]
1454        unsafe fn encode(
1455            self,
1456            encoder: &mut fidl::encoding::Encoder<'_, D>,
1457            offset: usize,
1458            depth: fidl::encoding::Depth,
1459        ) -> fidl::Result<()> {
1460            encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
1461            // Zero out padding regions. There's no need to apply masks
1462            // because the unmasked parts will be overwritten by fields.
1463            // Write the fields.
1464            self.0.encode(encoder, offset + 0, depth)?;
1465            Ok(())
1466        }
1467    }
1468
1469    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1470        for WlanSoftmacBaseNotifyAssociationCompleteRequest
1471    {
1472        #[inline(always)]
1473        fn new_empty() -> Self {
1474            Self { assoc_cfg: fidl::new_empty!(WlanAssociationConfig, D) }
1475        }
1476
1477        #[inline]
1478        unsafe fn decode(
1479            &mut self,
1480            decoder: &mut fidl::encoding::Decoder<'_, D>,
1481            offset: usize,
1482            _depth: fidl::encoding::Depth,
1483        ) -> fidl::Result<()> {
1484            decoder.debug_check_bounds::<Self>(offset);
1485            // Verify that padding bytes are zero.
1486            fidl::decode!(
1487                WlanAssociationConfig,
1488                D,
1489                &mut self.assoc_cfg,
1490                decoder,
1491                offset + 0,
1492                _depth
1493            )?;
1494            Ok(())
1495        }
1496    }
1497
1498    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
1499        type Borrowed<'a> = &'a Self;
1500        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1501            value
1502        }
1503    }
1504
1505    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
1506        type Owned = Self;
1507
1508        #[inline(always)]
1509        fn inline_align(_context: fidl::encoding::Context) -> usize {
1510            8
1511        }
1512
1513        #[inline(always)]
1514        fn inline_size(_context: fidl::encoding::Context) -> usize {
1515            16
1516        }
1517    }
1518
1519    unsafe impl<D: fidl::encoding::ResourceDialect>
1520        fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D>
1521        for &WlanSoftmacBaseQueryDiscoverySupportResponse
1522    {
1523        #[inline]
1524        unsafe fn encode(
1525            self,
1526            encoder: &mut fidl::encoding::Encoder<'_, D>,
1527            offset: usize,
1528            _depth: fidl::encoding::Depth,
1529        ) -> fidl::Result<()> {
1530            encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
1531            // Delegate to tuple encoding.
1532            fidl::encoding::Encode::<WlanSoftmacBaseQueryDiscoverySupportResponse, D>::encode(
1533                (<DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),),
1534                encoder,
1535                offset,
1536                _depth,
1537            )
1538        }
1539    }
1540    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DiscoverySupport, D>>
1541        fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D> for (T0,)
1542    {
1543        #[inline]
1544        unsafe fn encode(
1545            self,
1546            encoder: &mut fidl::encoding::Encoder<'_, D>,
1547            offset: usize,
1548            depth: fidl::encoding::Depth,
1549        ) -> fidl::Result<()> {
1550            encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
1551            // Zero out padding regions. There's no need to apply masks
1552            // because the unmasked parts will be overwritten by fields.
1553            // Write the fields.
1554            self.0.encode(encoder, offset + 0, depth)?;
1555            Ok(())
1556        }
1557    }
1558
1559    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1560        for WlanSoftmacBaseQueryDiscoverySupportResponse
1561    {
1562        #[inline(always)]
1563        fn new_empty() -> Self {
1564            Self { resp: fidl::new_empty!(DiscoverySupport, D) }
1565        }
1566
1567        #[inline]
1568        unsafe fn decode(
1569            &mut self,
1570            decoder: &mut fidl::encoding::Decoder<'_, D>,
1571            offset: usize,
1572            _depth: fidl::encoding::Depth,
1573        ) -> fidl::Result<()> {
1574            decoder.debug_check_bounds::<Self>(offset);
1575            // Verify that padding bytes are zero.
1576            fidl::decode!(DiscoverySupport, D, &mut self.resp, decoder, offset + 0, _depth)?;
1577            Ok(())
1578        }
1579    }
1580
1581    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
1582        type Borrowed<'a> = &'a Self;
1583        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1584            value
1585        }
1586    }
1587
1588    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
1589        type Owned = Self;
1590
1591        #[inline(always)]
1592        fn inline_align(_context: fidl::encoding::Context) -> usize {
1593            8
1594        }
1595
1596        #[inline(always)]
1597        fn inline_size(_context: fidl::encoding::Context) -> usize {
1598            16
1599        }
1600    }
1601
1602    unsafe impl<D: fidl::encoding::ResourceDialect>
1603        fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>
1604        for &WlanSoftmacBaseQueryMacSublayerSupportResponse
1605    {
1606        #[inline]
1607        unsafe fn encode(
1608            self,
1609            encoder: &mut fidl::encoding::Encoder<'_, D>,
1610            offset: usize,
1611            _depth: fidl::encoding::Depth,
1612        ) -> fidl::Result<()> {
1613            encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
1614            // Delegate to tuple encoding.
1615            fidl::encoding::Encode::<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>::encode(
1616                (
1617                    <fidl_fuchsia_wlan_common__common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1618                ),
1619                encoder, offset, _depth
1620            )
1621        }
1622    }
1623    unsafe impl<
1624        D: fidl::encoding::ResourceDialect,
1625        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::MacSublayerSupport, D>,
1626    > fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D> for (T0,)
1627    {
1628        #[inline]
1629        unsafe fn encode(
1630            self,
1631            encoder: &mut fidl::encoding::Encoder<'_, D>,
1632            offset: usize,
1633            depth: fidl::encoding::Depth,
1634        ) -> fidl::Result<()> {
1635            encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
1636            // Zero out padding regions. There's no need to apply masks
1637            // because the unmasked parts will be overwritten by fields.
1638            // Write the fields.
1639            self.0.encode(encoder, offset + 0, depth)?;
1640            Ok(())
1641        }
1642    }
1643
1644    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1645        for WlanSoftmacBaseQueryMacSublayerSupportResponse
1646    {
1647        #[inline(always)]
1648        fn new_empty() -> Self {
1649            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::MacSublayerSupport, D) }
1650        }
1651
1652        #[inline]
1653        unsafe fn decode(
1654            &mut self,
1655            decoder: &mut fidl::encoding::Decoder<'_, D>,
1656            offset: usize,
1657            _depth: fidl::encoding::Depth,
1658        ) -> fidl::Result<()> {
1659            decoder.debug_check_bounds::<Self>(offset);
1660            // Verify that padding bytes are zero.
1661            fidl::decode!(
1662                fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1663                D,
1664                &mut self.resp,
1665                decoder,
1666                offset + 0,
1667                _depth
1668            )?;
1669            Ok(())
1670        }
1671    }
1672
1673    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
1674        type Borrowed<'a> = &'a Self;
1675        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1676            value
1677        }
1678    }
1679
1680    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
1681        type Owned = Self;
1682
1683        #[inline(always)]
1684        fn inline_align(_context: fidl::encoding::Context) -> usize {
1685            8
1686        }
1687
1688        #[inline(always)]
1689        fn inline_size(_context: fidl::encoding::Context) -> usize {
1690            16
1691        }
1692    }
1693
1694    unsafe impl<D: fidl::encoding::ResourceDialect>
1695        fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D>
1696        for &WlanSoftmacBaseQuerySecuritySupportResponse
1697    {
1698        #[inline]
1699        unsafe fn encode(
1700            self,
1701            encoder: &mut fidl::encoding::Encoder<'_, D>,
1702            offset: usize,
1703            _depth: fidl::encoding::Depth,
1704        ) -> fidl::Result<()> {
1705            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
1706            // Delegate to tuple encoding.
1707            fidl::encoding::Encode::<WlanSoftmacBaseQuerySecuritySupportResponse, D>::encode(
1708                (
1709                    <fidl_fuchsia_wlan_common__common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1710                ),
1711                encoder, offset, _depth
1712            )
1713        }
1714    }
1715    unsafe impl<
1716        D: fidl::encoding::ResourceDialect,
1717        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SecuritySupport, D>,
1718    > fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D> for (T0,)
1719    {
1720        #[inline]
1721        unsafe fn encode(
1722            self,
1723            encoder: &mut fidl::encoding::Encoder<'_, D>,
1724            offset: usize,
1725            depth: fidl::encoding::Depth,
1726        ) -> fidl::Result<()> {
1727            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
1728            // Zero out padding regions. There's no need to apply masks
1729            // because the unmasked parts will be overwritten by fields.
1730            // Write the fields.
1731            self.0.encode(encoder, offset + 0, depth)?;
1732            Ok(())
1733        }
1734    }
1735
1736    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1737        for WlanSoftmacBaseQuerySecuritySupportResponse
1738    {
1739        #[inline(always)]
1740        fn new_empty() -> Self {
1741            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common__common::SecuritySupport, D) }
1742        }
1743
1744        #[inline]
1745        unsafe fn decode(
1746            &mut self,
1747            decoder: &mut fidl::encoding::Decoder<'_, D>,
1748            offset: usize,
1749            _depth: fidl::encoding::Depth,
1750        ) -> fidl::Result<()> {
1751            decoder.debug_check_bounds::<Self>(offset);
1752            // Verify that padding bytes are zero.
1753            fidl::decode!(
1754                fidl_fuchsia_wlan_common__common::SecuritySupport,
1755                D,
1756                &mut self.resp,
1757                decoder,
1758                offset + 0,
1759                _depth
1760            )?;
1761            Ok(())
1762        }
1763    }
1764
1765    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
1766        type Borrowed<'a> = &'a Self;
1767        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1768            value
1769        }
1770    }
1771
1772    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
1773        type Owned = Self;
1774
1775        #[inline(always)]
1776        fn inline_align(_context: fidl::encoding::Context) -> usize {
1777            8
1778        }
1779
1780        #[inline(always)]
1781        fn inline_size(_context: fidl::encoding::Context) -> usize {
1782            16
1783        }
1784    }
1785
1786    unsafe impl<D: fidl::encoding::ResourceDialect>
1787        fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
1788        for &WlanSoftmacBaseQuerySpectrumManagementSupportResponse
1789    {
1790        #[inline]
1791        unsafe fn encode(
1792            self,
1793            encoder: &mut fidl::encoding::Encoder<'_, D>,
1794            offset: usize,
1795            _depth: fidl::encoding::Depth,
1796        ) -> fidl::Result<()> {
1797            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
1798                offset,
1799            );
1800            // Delegate to tuple encoding.
1801            fidl::encoding::Encode::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>::encode(
1802                (
1803                    <fidl_fuchsia_wlan_common__common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
1804                ),
1805                encoder, offset, _depth
1806            )
1807        }
1808    }
1809    unsafe impl<
1810        D: fidl::encoding::ResourceDialect,
1811        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SpectrumManagementSupport, D>,
1812    > fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D> for (T0,)
1813    {
1814        #[inline]
1815        unsafe fn encode(
1816            self,
1817            encoder: &mut fidl::encoding::Encoder<'_, D>,
1818            offset: usize,
1819            depth: fidl::encoding::Depth,
1820        ) -> fidl::Result<()> {
1821            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
1822                offset,
1823            );
1824            // Zero out padding regions. There's no need to apply masks
1825            // because the unmasked parts will be overwritten by fields.
1826            // Write the fields.
1827            self.0.encode(encoder, offset + 0, depth)?;
1828            Ok(())
1829        }
1830    }
1831
1832    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1833        for WlanSoftmacBaseQuerySpectrumManagementSupportResponse
1834    {
1835        #[inline(always)]
1836        fn new_empty() -> Self {
1837            Self {
1838                resp: fidl::new_empty!(
1839                    fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
1840                    D
1841                ),
1842            }
1843        }
1844
1845        #[inline]
1846        unsafe fn decode(
1847            &mut self,
1848            decoder: &mut fidl::encoding::Decoder<'_, D>,
1849            offset: usize,
1850            _depth: fidl::encoding::Depth,
1851        ) -> fidl::Result<()> {
1852            decoder.debug_check_bounds::<Self>(offset);
1853            // Verify that padding bytes are zero.
1854            fidl::decode!(
1855                fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
1856                D,
1857                &mut self.resp,
1858                decoder,
1859                offset + 0,
1860                _depth
1861            )?;
1862            Ok(())
1863        }
1864    }
1865
1866    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
1867        type Borrowed<'a> = &'a Self;
1868        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1869            value
1870        }
1871    }
1872
1873    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
1874        type Owned = Self;
1875
1876        #[inline(always)]
1877        fn inline_align(_context: fidl::encoding::Context) -> usize {
1878            4
1879        }
1880
1881        #[inline(always)]
1882        fn inline_size(_context: fidl::encoding::Context) -> usize {
1883            4
1884        }
1885        #[inline(always)]
1886        fn encode_is_copy() -> bool {
1887            true
1888        }
1889
1890        #[inline(always)]
1891        fn decode_is_copy() -> bool {
1892            true
1893        }
1894    }
1895
1896    unsafe impl<D: fidl::encoding::ResourceDialect>
1897        fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D>
1898        for &WlanSoftmacBridgeSetEthernetStatusRequest
1899    {
1900        #[inline]
1901        unsafe fn encode(
1902            self,
1903            encoder: &mut fidl::encoding::Encoder<'_, D>,
1904            offset: usize,
1905            _depth: fidl::encoding::Depth,
1906        ) -> fidl::Result<()> {
1907            encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
1908            unsafe {
1909                // Copy the object into the buffer.
1910                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1911                (buf_ptr as *mut WlanSoftmacBridgeSetEthernetStatusRequest).write_unaligned(
1912                    (self as *const WlanSoftmacBridgeSetEthernetStatusRequest).read(),
1913                );
1914                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1915                // done second because the memcpy will write garbage to these bytes.
1916            }
1917            Ok(())
1918        }
1919    }
1920    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
1921        fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D> for (T0,)
1922    {
1923        #[inline]
1924        unsafe fn encode(
1925            self,
1926            encoder: &mut fidl::encoding::Encoder<'_, D>,
1927            offset: usize,
1928            depth: fidl::encoding::Depth,
1929        ) -> fidl::Result<()> {
1930            encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
1931            // Zero out padding regions. There's no need to apply masks
1932            // because the unmasked parts will be overwritten by fields.
1933            // Write the fields.
1934            self.0.encode(encoder, offset + 0, depth)?;
1935            Ok(())
1936        }
1937    }
1938
1939    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1940        for WlanSoftmacBridgeSetEthernetStatusRequest
1941    {
1942        #[inline(always)]
1943        fn new_empty() -> Self {
1944            Self { status: fidl::new_empty!(u32, D) }
1945        }
1946
1947        #[inline]
1948        unsafe fn decode(
1949            &mut self,
1950            decoder: &mut fidl::encoding::Decoder<'_, D>,
1951            offset: usize,
1952            _depth: fidl::encoding::Depth,
1953        ) -> fidl::Result<()> {
1954            decoder.debug_check_bounds::<Self>(offset);
1955            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1956            // Verify that padding bytes are zero.
1957            // Copy from the buffer into the object.
1958            unsafe {
1959                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1960            }
1961            Ok(())
1962        }
1963    }
1964
1965    impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
1966        type Borrowed<'a> = &'a Self;
1967        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1968            value
1969        }
1970    }
1971
1972    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
1973        type Owned = Self;
1974
1975        #[inline(always)]
1976        fn inline_align(_context: fidl::encoding::Context) -> usize {
1977            2
1978        }
1979
1980        #[inline(always)]
1981        fn inline_size(_context: fidl::encoding::Context) -> usize {
1982            40
1983        }
1984    }
1985
1986    unsafe impl<D: fidl::encoding::ResourceDialect>
1987        fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D>
1988        for &WlanSoftmacIfcBaseReportTxResultRequest
1989    {
1990        #[inline]
1991        unsafe fn encode(
1992            self,
1993            encoder: &mut fidl::encoding::Encoder<'_, D>,
1994            offset: usize,
1995            _depth: fidl::encoding::Depth,
1996        ) -> fidl::Result<()> {
1997            encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
1998            // Delegate to tuple encoding.
1999            fidl::encoding::Encode::<WlanSoftmacIfcBaseReportTxResultRequest, D>::encode(
2000                (
2001                    <fidl_fuchsia_wlan_common__common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result),
2002                ),
2003                encoder, offset, _depth
2004            )
2005        }
2006    }
2007    unsafe impl<
2008        D: fidl::encoding::ResourceDialect,
2009        T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanTxResult, D>,
2010    > fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D> for (T0,)
2011    {
2012        #[inline]
2013        unsafe fn encode(
2014            self,
2015            encoder: &mut fidl::encoding::Encoder<'_, D>,
2016            offset: usize,
2017            depth: fidl::encoding::Depth,
2018        ) -> fidl::Result<()> {
2019            encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
2020            // Zero out padding regions. There's no need to apply masks
2021            // because the unmasked parts will be overwritten by fields.
2022            // Write the fields.
2023            self.0.encode(encoder, offset + 0, depth)?;
2024            Ok(())
2025        }
2026    }
2027
2028    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2029        for WlanSoftmacIfcBaseReportTxResultRequest
2030    {
2031        #[inline(always)]
2032        fn new_empty() -> Self {
2033            Self { tx_result: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanTxResult, D) }
2034        }
2035
2036        #[inline]
2037        unsafe fn decode(
2038            &mut self,
2039            decoder: &mut fidl::encoding::Decoder<'_, D>,
2040            offset: usize,
2041            _depth: fidl::encoding::Depth,
2042        ) -> fidl::Result<()> {
2043            decoder.debug_check_bounds::<Self>(offset);
2044            // Verify that padding bytes are zero.
2045            fidl::decode!(
2046                fidl_fuchsia_wlan_common__common::WlanTxResult,
2047                D,
2048                &mut self.tx_result,
2049                decoder,
2050                offset + 0,
2051                _depth
2052            )?;
2053            Ok(())
2054        }
2055    }
2056
2057    impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
2058        type Borrowed<'a> = &'a Self;
2059        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2060            value
2061        }
2062    }
2063
2064    unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
2065        type Owned = Self;
2066
2067        #[inline(always)]
2068        fn inline_align(_context: fidl::encoding::Context) -> usize {
2069            4
2070        }
2071
2072        #[inline(always)]
2073        fn inline_size(_context: fidl::encoding::Context) -> usize {
2074            24
2075        }
2076    }
2077
2078    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
2079        for &WlanTxInfo
2080    {
2081        #[inline]
2082        unsafe fn encode(
2083            self,
2084            encoder: &mut fidl::encoding::Encoder<'_, D>,
2085            offset: usize,
2086            _depth: fidl::encoding::Depth,
2087        ) -> fidl::Result<()> {
2088            encoder.debug_check_bounds::<WlanTxInfo>(offset);
2089            // Delegate to tuple encoding.
2090            fidl::encoding::Encode::<WlanTxInfo, D>::encode(
2091                (
2092                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
2093                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
2094                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
2095                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
2096                    <fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_bandwidth),
2097                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
2098                ),
2099                encoder, offset, _depth
2100            )
2101        }
2102    }
2103    unsafe impl<
2104        D: fidl::encoding::ResourceDialect,
2105        T0: fidl::encoding::Encode<u32, D>,
2106        T1: fidl::encoding::Encode<u32, D>,
2107        T2: fidl::encoding::Encode<u16, D>,
2108        T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
2109        T4: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth, D>,
2110        T5: fidl::encoding::Encode<u8, D>,
2111    > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
2112    {
2113        #[inline]
2114        unsafe fn encode(
2115            self,
2116            encoder: &mut fidl::encoding::Encoder<'_, D>,
2117            offset: usize,
2118            depth: fidl::encoding::Depth,
2119        ) -> fidl::Result<()> {
2120            encoder.debug_check_bounds::<WlanTxInfo>(offset);
2121            // Zero out padding regions. There's no need to apply masks
2122            // because the unmasked parts will be overwritten by fields.
2123            unsafe {
2124                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2125                (ptr as *mut u32).write_unaligned(0);
2126            }
2127            unsafe {
2128                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(20);
2129                (ptr as *mut u32).write_unaligned(0);
2130            }
2131            // Write the fields.
2132            self.0.encode(encoder, offset + 0, depth)?;
2133            self.1.encode(encoder, offset + 4, depth)?;
2134            self.2.encode(encoder, offset + 8, depth)?;
2135            self.3.encode(encoder, offset + 12, depth)?;
2136            self.4.encode(encoder, offset + 16, depth)?;
2137            self.5.encode(encoder, offset + 20, depth)?;
2138            Ok(())
2139        }
2140    }
2141
2142    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
2143        #[inline(always)]
2144        fn new_empty() -> Self {
2145            Self {
2146                tx_flags: fidl::new_empty!(u32, D),
2147                valid_fields: fidl::new_empty!(u32, D),
2148                tx_vector_idx: fidl::new_empty!(u16, D),
2149                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
2150                channel_bandwidth: fidl::new_empty!(
2151                    fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
2152                    D
2153                ),
2154                mcs: fidl::new_empty!(u8, D),
2155            }
2156        }
2157
2158        #[inline]
2159        unsafe fn decode(
2160            &mut self,
2161            decoder: &mut fidl::encoding::Decoder<'_, D>,
2162            offset: usize,
2163            _depth: fidl::encoding::Depth,
2164        ) -> fidl::Result<()> {
2165            decoder.debug_check_bounds::<Self>(offset);
2166            // Verify that padding bytes are zero.
2167            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
2168            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2169            let mask = 0xffff0000u32;
2170            let maskedval = padval & mask;
2171            if maskedval != 0 {
2172                return Err(fidl::Error::NonZeroPadding {
2173                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2174                });
2175            }
2176            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(20) };
2177            let padval = unsafe { (ptr as *const u32).read_unaligned() };
2178            let mask = 0xffffff00u32;
2179            let maskedval = padval & mask;
2180            if maskedval != 0 {
2181                return Err(fidl::Error::NonZeroPadding {
2182                    padding_start: offset + 20 + ((mask as u64).trailing_zeros() / 8) as usize,
2183                });
2184            }
2185            fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
2186            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
2187            fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
2188            fidl::decode!(
2189                fidl_fuchsia_wlan_common__common::WlanPhyType,
2190                D,
2191                &mut self.phy,
2192                decoder,
2193                offset + 12,
2194                _depth
2195            )?;
2196            fidl::decode!(
2197                fidl_fuchsia_wlan_ieee80211__common::ChannelBandwidth,
2198                D,
2199                &mut self.channel_bandwidth,
2200                decoder,
2201                offset + 16,
2202                _depth
2203            )?;
2204            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 20, _depth)?;
2205            Ok(())
2206        }
2207    }
2208
2209    impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
2210        type Borrowed<'a> = &'a Self;
2211        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2212            value
2213        }
2214    }
2215
2216    unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
2217        type Owned = Self;
2218
2219        #[inline(always)]
2220        fn inline_align(_context: fidl::encoding::Context) -> usize {
2221            8
2222        }
2223
2224        #[inline(always)]
2225        fn inline_size(_context: fidl::encoding::Context) -> usize {
2226            40
2227        }
2228    }
2229
2230    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
2231        for &WlanTxPacket
2232    {
2233        #[inline]
2234        unsafe fn encode(
2235            self,
2236            encoder: &mut fidl::encoding::Encoder<'_, D>,
2237            offset: usize,
2238            _depth: fidl::encoding::Depth,
2239        ) -> fidl::Result<()> {
2240            encoder.debug_check_bounds::<WlanTxPacket>(offset);
2241            // Delegate to tuple encoding.
2242            fidl::encoding::Encode::<WlanTxPacket, D>::encode(
2243                (
2244                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
2245                    <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
2246                ),
2247                encoder, offset, _depth
2248            )
2249        }
2250    }
2251    unsafe impl<
2252        D: fidl::encoding::ResourceDialect,
2253        T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
2254        T1: fidl::encoding::Encode<WlanTxInfo, D>,
2255    > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
2256    {
2257        #[inline]
2258        unsafe fn encode(
2259            self,
2260            encoder: &mut fidl::encoding::Encoder<'_, D>,
2261            offset: usize,
2262            depth: fidl::encoding::Depth,
2263        ) -> fidl::Result<()> {
2264            encoder.debug_check_bounds::<WlanTxPacket>(offset);
2265            // Zero out padding regions. There's no need to apply masks
2266            // because the unmasked parts will be overwritten by fields.
2267            // Write the fields.
2268            self.0.encode(encoder, offset + 0, depth)?;
2269            self.1.encode(encoder, offset + 16, depth)?;
2270            Ok(())
2271        }
2272    }
2273
2274    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
2275        #[inline(always)]
2276        fn new_empty() -> Self {
2277            Self {
2278                mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
2279                info: fidl::new_empty!(WlanTxInfo, D),
2280            }
2281        }
2282
2283        #[inline]
2284        unsafe fn decode(
2285            &mut self,
2286            decoder: &mut fidl::encoding::Decoder<'_, D>,
2287            offset: usize,
2288            _depth: fidl::encoding::Depth,
2289        ) -> fidl::Result<()> {
2290            decoder.debug_check_bounds::<Self>(offset);
2291            // Verify that padding bytes are zero.
2292            fidl::decode!(
2293                fidl::encoding::UnboundedVector<u8>,
2294                D,
2295                &mut self.mac_frame,
2296                decoder,
2297                offset + 0,
2298                _depth
2299            )?;
2300            fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
2301            Ok(())
2302        }
2303    }
2304
2305    impl DiscoverySupport {
2306        #[inline(always)]
2307        fn max_ordinal_present(&self) -> u64 {
2308            if let Some(_) = self.probe_response_offload {
2309                return 2;
2310            }
2311            if let Some(_) = self.scan_offload {
2312                return 1;
2313            }
2314            0
2315        }
2316    }
2317
2318    impl fidl::encoding::ValueTypeMarker for DiscoverySupport {
2319        type Borrowed<'a> = &'a Self;
2320        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2321            value
2322        }
2323    }
2324
2325    unsafe impl fidl::encoding::TypeMarker for DiscoverySupport {
2326        type Owned = Self;
2327
2328        #[inline(always)]
2329        fn inline_align(_context: fidl::encoding::Context) -> usize {
2330            8
2331        }
2332
2333        #[inline(always)]
2334        fn inline_size(_context: fidl::encoding::Context) -> usize {
2335            16
2336        }
2337    }
2338
2339    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoverySupport, D>
2340        for &DiscoverySupport
2341    {
2342        unsafe fn encode(
2343            self,
2344            encoder: &mut fidl::encoding::Encoder<'_, D>,
2345            offset: usize,
2346            mut depth: fidl::encoding::Depth,
2347        ) -> fidl::Result<()> {
2348            encoder.debug_check_bounds::<DiscoverySupport>(offset);
2349            // Vector header
2350            let max_ordinal: u64 = self.max_ordinal_present();
2351            encoder.write_num(max_ordinal, offset);
2352            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2353            // Calling encoder.out_of_line_offset(0) is not allowed.
2354            if max_ordinal == 0 {
2355                return Ok(());
2356            }
2357            depth.increment()?;
2358            let envelope_size = 8;
2359            let bytes_len = max_ordinal as usize * envelope_size;
2360            #[allow(unused_variables)]
2361            let offset = encoder.out_of_line_offset(bytes_len);
2362            let mut _prev_end_offset: usize = 0;
2363            if 1 > max_ordinal {
2364                return Ok(());
2365            }
2366
2367            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2368            // are envelope_size bytes.
2369            let cur_offset: usize = (1 - 1) * envelope_size;
2370
2371            // Zero reserved fields.
2372            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2373
2374            // Safety:
2375            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2376            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2377            //   envelope_size bytes, there is always sufficient room.
2378            fidl::encoding::encode_in_envelope_optional::<ScanOffloadExtension, D>(
2379                self.scan_offload
2380                    .as_ref()
2381                    .map(<ScanOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow),
2382                encoder,
2383                offset + cur_offset,
2384                depth,
2385            )?;
2386
2387            _prev_end_offset = cur_offset + envelope_size;
2388            if 2 > max_ordinal {
2389                return Ok(());
2390            }
2391
2392            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2393            // are envelope_size bytes.
2394            let cur_offset: usize = (2 - 1) * envelope_size;
2395
2396            // Zero reserved fields.
2397            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2398
2399            // Safety:
2400            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2401            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2402            //   envelope_size bytes, there is always sufficient room.
2403            fidl::encoding::encode_in_envelope_optional::<ProbeResponseOffloadExtension, D>(
2404                self.probe_response_offload.as_ref().map(
2405                    <ProbeResponseOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow,
2406                ),
2407                encoder,
2408                offset + cur_offset,
2409                depth,
2410            )?;
2411
2412            _prev_end_offset = cur_offset + envelope_size;
2413
2414            Ok(())
2415        }
2416    }
2417
2418    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoverySupport {
2419        #[inline(always)]
2420        fn new_empty() -> Self {
2421            Self::default()
2422        }
2423
2424        unsafe fn decode(
2425            &mut self,
2426            decoder: &mut fidl::encoding::Decoder<'_, D>,
2427            offset: usize,
2428            mut depth: fidl::encoding::Depth,
2429        ) -> fidl::Result<()> {
2430            decoder.debug_check_bounds::<Self>(offset);
2431            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2432                None => return Err(fidl::Error::NotNullable),
2433                Some(len) => len,
2434            };
2435            // Calling decoder.out_of_line_offset(0) is not allowed.
2436            if len == 0 {
2437                return Ok(());
2438            };
2439            depth.increment()?;
2440            let envelope_size = 8;
2441            let bytes_len = len * envelope_size;
2442            let offset = decoder.out_of_line_offset(bytes_len)?;
2443            // Decode the envelope for each type.
2444            let mut _next_ordinal_to_read = 0;
2445            let mut next_offset = offset;
2446            let end_offset = offset + bytes_len;
2447            _next_ordinal_to_read += 1;
2448            if next_offset >= end_offset {
2449                return Ok(());
2450            }
2451
2452            // Decode unknown envelopes for gaps in ordinals.
2453            while _next_ordinal_to_read < 1 {
2454                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2455                _next_ordinal_to_read += 1;
2456                next_offset += envelope_size;
2457            }
2458
2459            let next_out_of_line = decoder.next_out_of_line();
2460            let handles_before = decoder.remaining_handles();
2461            if let Some((inlined, num_bytes, num_handles)) =
2462                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2463            {
2464                let member_inline_size =
2465                    <ScanOffloadExtension as fidl::encoding::TypeMarker>::inline_size(
2466                        decoder.context,
2467                    );
2468                if inlined != (member_inline_size <= 4) {
2469                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2470                }
2471                let inner_offset;
2472                let mut inner_depth = depth.clone();
2473                if inlined {
2474                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2475                    inner_offset = next_offset;
2476                } else {
2477                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2478                    inner_depth.increment()?;
2479                }
2480                let val_ref = self
2481                    .scan_offload
2482                    .get_or_insert_with(|| fidl::new_empty!(ScanOffloadExtension, D));
2483                fidl::decode!(
2484                    ScanOffloadExtension,
2485                    D,
2486                    val_ref,
2487                    decoder,
2488                    inner_offset,
2489                    inner_depth
2490                )?;
2491                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2492                {
2493                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2494                }
2495                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2496                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2497                }
2498            }
2499
2500            next_offset += envelope_size;
2501            _next_ordinal_to_read += 1;
2502            if next_offset >= end_offset {
2503                return Ok(());
2504            }
2505
2506            // Decode unknown envelopes for gaps in ordinals.
2507            while _next_ordinal_to_read < 2 {
2508                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2509                _next_ordinal_to_read += 1;
2510                next_offset += envelope_size;
2511            }
2512
2513            let next_out_of_line = decoder.next_out_of_line();
2514            let handles_before = decoder.remaining_handles();
2515            if let Some((inlined, num_bytes, num_handles)) =
2516                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2517            {
2518                let member_inline_size =
2519                    <ProbeResponseOffloadExtension as fidl::encoding::TypeMarker>::inline_size(
2520                        decoder.context,
2521                    );
2522                if inlined != (member_inline_size <= 4) {
2523                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2524                }
2525                let inner_offset;
2526                let mut inner_depth = depth.clone();
2527                if inlined {
2528                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2529                    inner_offset = next_offset;
2530                } else {
2531                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2532                    inner_depth.increment()?;
2533                }
2534                let val_ref = self
2535                    .probe_response_offload
2536                    .get_or_insert_with(|| fidl::new_empty!(ProbeResponseOffloadExtension, D));
2537                fidl::decode!(
2538                    ProbeResponseOffloadExtension,
2539                    D,
2540                    val_ref,
2541                    decoder,
2542                    inner_offset,
2543                    inner_depth
2544                )?;
2545                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2546                {
2547                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2548                }
2549                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2550                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2551                }
2552            }
2553
2554            next_offset += envelope_size;
2555
2556            // Decode the remaining unknown envelopes.
2557            while next_offset < end_offset {
2558                _next_ordinal_to_read += 1;
2559                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2560                next_offset += envelope_size;
2561            }
2562
2563            Ok(())
2564        }
2565    }
2566
2567    impl EthernetRxTransferRequest {
2568        #[inline(always)]
2569        fn max_ordinal_present(&self) -> u64 {
2570            if let Some(_) = self.packet_size {
2571                return 2;
2572            }
2573            if let Some(_) = self.packet_address {
2574                return 1;
2575            }
2576            0
2577        }
2578    }
2579
2580    impl fidl::encoding::ValueTypeMarker for EthernetRxTransferRequest {
2581        type Borrowed<'a> = &'a Self;
2582        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2583            value
2584        }
2585    }
2586
2587    unsafe impl fidl::encoding::TypeMarker for EthernetRxTransferRequest {
2588        type Owned = Self;
2589
2590        #[inline(always)]
2591        fn inline_align(_context: fidl::encoding::Context) -> usize {
2592            8
2593        }
2594
2595        #[inline(always)]
2596        fn inline_size(_context: fidl::encoding::Context) -> usize {
2597            16
2598        }
2599    }
2600
2601    unsafe impl<D: fidl::encoding::ResourceDialect>
2602        fidl::encoding::Encode<EthernetRxTransferRequest, D> for &EthernetRxTransferRequest
2603    {
2604        unsafe fn encode(
2605            self,
2606            encoder: &mut fidl::encoding::Encoder<'_, D>,
2607            offset: usize,
2608            mut depth: fidl::encoding::Depth,
2609        ) -> fidl::Result<()> {
2610            encoder.debug_check_bounds::<EthernetRxTransferRequest>(offset);
2611            // Vector header
2612            let max_ordinal: u64 = self.max_ordinal_present();
2613            encoder.write_num(max_ordinal, offset);
2614            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2615            // Calling encoder.out_of_line_offset(0) is not allowed.
2616            if max_ordinal == 0 {
2617                return Ok(());
2618            }
2619            depth.increment()?;
2620            let envelope_size = 8;
2621            let bytes_len = max_ordinal as usize * envelope_size;
2622            #[allow(unused_variables)]
2623            let offset = encoder.out_of_line_offset(bytes_len);
2624            let mut _prev_end_offset: usize = 0;
2625            if 1 > max_ordinal {
2626                return Ok(());
2627            }
2628
2629            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2630            // are envelope_size bytes.
2631            let cur_offset: usize = (1 - 1) * envelope_size;
2632
2633            // Zero reserved fields.
2634            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2635
2636            // Safety:
2637            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2638            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2639            //   envelope_size bytes, there is always sufficient room.
2640            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2641                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2642                encoder,
2643                offset + cur_offset,
2644                depth,
2645            )?;
2646
2647            _prev_end_offset = cur_offset + envelope_size;
2648            if 2 > max_ordinal {
2649                return Ok(());
2650            }
2651
2652            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2653            // are envelope_size bytes.
2654            let cur_offset: usize = (2 - 1) * envelope_size;
2655
2656            // Zero reserved fields.
2657            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2658
2659            // Safety:
2660            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2661            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2662            //   envelope_size bytes, there is always sufficient room.
2663            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2664                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2665                encoder,
2666                offset + cur_offset,
2667                depth,
2668            )?;
2669
2670            _prev_end_offset = cur_offset + envelope_size;
2671
2672            Ok(())
2673        }
2674    }
2675
2676    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2677        for EthernetRxTransferRequest
2678    {
2679        #[inline(always)]
2680        fn new_empty() -> Self {
2681            Self::default()
2682        }
2683
2684        unsafe fn decode(
2685            &mut self,
2686            decoder: &mut fidl::encoding::Decoder<'_, D>,
2687            offset: usize,
2688            mut depth: fidl::encoding::Depth,
2689        ) -> fidl::Result<()> {
2690            decoder.debug_check_bounds::<Self>(offset);
2691            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
2692                None => return Err(fidl::Error::NotNullable),
2693                Some(len) => len,
2694            };
2695            // Calling decoder.out_of_line_offset(0) is not allowed.
2696            if len == 0 {
2697                return Ok(());
2698            };
2699            depth.increment()?;
2700            let envelope_size = 8;
2701            let bytes_len = len * envelope_size;
2702            let offset = decoder.out_of_line_offset(bytes_len)?;
2703            // Decode the envelope for each type.
2704            let mut _next_ordinal_to_read = 0;
2705            let mut next_offset = offset;
2706            let end_offset = offset + bytes_len;
2707            _next_ordinal_to_read += 1;
2708            if next_offset >= end_offset {
2709                return Ok(());
2710            }
2711
2712            // Decode unknown envelopes for gaps in ordinals.
2713            while _next_ordinal_to_read < 1 {
2714                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2715                _next_ordinal_to_read += 1;
2716                next_offset += envelope_size;
2717            }
2718
2719            let next_out_of_line = decoder.next_out_of_line();
2720            let handles_before = decoder.remaining_handles();
2721            if let Some((inlined, num_bytes, num_handles)) =
2722                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2723            {
2724                let member_inline_size =
2725                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2726                if inlined != (member_inline_size <= 4) {
2727                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2728                }
2729                let inner_offset;
2730                let mut inner_depth = depth.clone();
2731                if inlined {
2732                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2733                    inner_offset = next_offset;
2734                } else {
2735                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2736                    inner_depth.increment()?;
2737                }
2738                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
2739                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2740                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2741                {
2742                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2743                }
2744                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2745                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2746                }
2747            }
2748
2749            next_offset += envelope_size;
2750            _next_ordinal_to_read += 1;
2751            if next_offset >= end_offset {
2752                return Ok(());
2753            }
2754
2755            // Decode unknown envelopes for gaps in ordinals.
2756            while _next_ordinal_to_read < 2 {
2757                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2758                _next_ordinal_to_read += 1;
2759                next_offset += envelope_size;
2760            }
2761
2762            let next_out_of_line = decoder.next_out_of_line();
2763            let handles_before = decoder.remaining_handles();
2764            if let Some((inlined, num_bytes, num_handles)) =
2765                fidl::encoding::decode_envelope_header(decoder, next_offset)?
2766            {
2767                let member_inline_size =
2768                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
2769                if inlined != (member_inline_size <= 4) {
2770                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
2771                }
2772                let inner_offset;
2773                let mut inner_depth = depth.clone();
2774                if inlined {
2775                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
2776                    inner_offset = next_offset;
2777                } else {
2778                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
2779                    inner_depth.increment()?;
2780                }
2781                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
2782                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
2783                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
2784                {
2785                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
2786                }
2787                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
2788                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
2789                }
2790            }
2791
2792            next_offset += envelope_size;
2793
2794            // Decode the remaining unknown envelopes.
2795            while next_offset < end_offset {
2796                _next_ordinal_to_read += 1;
2797                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
2798                next_offset += envelope_size;
2799            }
2800
2801            Ok(())
2802        }
2803    }
2804
2805    impl EthernetTxTransferRequest {
2806        #[inline(always)]
2807        fn max_ordinal_present(&self) -> u64 {
2808            if let Some(_) = self.complete_borrowed_operation {
2809                return 5;
2810            }
2811            if let Some(_) = self.borrowed_operation {
2812                return 4;
2813            }
2814            if let Some(_) = self.async_id {
2815                return 3;
2816            }
2817            if let Some(_) = self.packet_size {
2818                return 2;
2819            }
2820            if let Some(_) = self.packet_address {
2821                return 1;
2822            }
2823            0
2824        }
2825    }
2826
2827    impl fidl::encoding::ValueTypeMarker for EthernetTxTransferRequest {
2828        type Borrowed<'a> = &'a Self;
2829        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2830            value
2831        }
2832    }
2833
2834    unsafe impl fidl::encoding::TypeMarker for EthernetTxTransferRequest {
2835        type Owned = Self;
2836
2837        #[inline(always)]
2838        fn inline_align(_context: fidl::encoding::Context) -> usize {
2839            8
2840        }
2841
2842        #[inline(always)]
2843        fn inline_size(_context: fidl::encoding::Context) -> usize {
2844            16
2845        }
2846    }
2847
2848    unsafe impl<D: fidl::encoding::ResourceDialect>
2849        fidl::encoding::Encode<EthernetTxTransferRequest, D> for &EthernetTxTransferRequest
2850    {
2851        unsafe fn encode(
2852            self,
2853            encoder: &mut fidl::encoding::Encoder<'_, D>,
2854            offset: usize,
2855            mut depth: fidl::encoding::Depth,
2856        ) -> fidl::Result<()> {
2857            encoder.debug_check_bounds::<EthernetTxTransferRequest>(offset);
2858            // Vector header
2859            let max_ordinal: u64 = self.max_ordinal_present();
2860            encoder.write_num(max_ordinal, offset);
2861            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
2862            // Calling encoder.out_of_line_offset(0) is not allowed.
2863            if max_ordinal == 0 {
2864                return Ok(());
2865            }
2866            depth.increment()?;
2867            let envelope_size = 8;
2868            let bytes_len = max_ordinal as usize * envelope_size;
2869            #[allow(unused_variables)]
2870            let offset = encoder.out_of_line_offset(bytes_len);
2871            let mut _prev_end_offset: usize = 0;
2872            if 1 > max_ordinal {
2873                return Ok(());
2874            }
2875
2876            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2877            // are envelope_size bytes.
2878            let cur_offset: usize = (1 - 1) * envelope_size;
2879
2880            // Zero reserved fields.
2881            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2882
2883            // Safety:
2884            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2885            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2886            //   envelope_size bytes, there is always sufficient room.
2887            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2888                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2889                encoder,
2890                offset + cur_offset,
2891                depth,
2892            )?;
2893
2894            _prev_end_offset = cur_offset + envelope_size;
2895            if 2 > max_ordinal {
2896                return Ok(());
2897            }
2898
2899            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2900            // are envelope_size bytes.
2901            let cur_offset: usize = (2 - 1) * envelope_size;
2902
2903            // Zero reserved fields.
2904            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2905
2906            // Safety:
2907            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2908            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2909            //   envelope_size bytes, there is always sufficient room.
2910            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2911                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2912                encoder,
2913                offset + cur_offset,
2914                depth,
2915            )?;
2916
2917            _prev_end_offset = cur_offset + envelope_size;
2918            if 3 > max_ordinal {
2919                return Ok(());
2920            }
2921
2922            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2923            // are envelope_size bytes.
2924            let cur_offset: usize = (3 - 1) * envelope_size;
2925
2926            // Zero reserved fields.
2927            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2928
2929            // Safety:
2930            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2931            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2932            //   envelope_size bytes, there is always sufficient room.
2933            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2934                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2935                encoder,
2936                offset + cur_offset,
2937                depth,
2938            )?;
2939
2940            _prev_end_offset = cur_offset + envelope_size;
2941            if 4 > max_ordinal {
2942                return Ok(());
2943            }
2944
2945            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2946            // are envelope_size bytes.
2947            let cur_offset: usize = (4 - 1) * envelope_size;
2948
2949            // Zero reserved fields.
2950            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2951
2952            // Safety:
2953            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2954            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2955            //   envelope_size bytes, there is always sufficient room.
2956            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2957                self.borrowed_operation
2958                    .as_ref()
2959                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2960                encoder,
2961                offset + cur_offset,
2962                depth,
2963            )?;
2964
2965            _prev_end_offset = cur_offset + envelope_size;
2966            if 5 > max_ordinal {
2967                return Ok(());
2968            }
2969
2970            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
2971            // are envelope_size bytes.
2972            let cur_offset: usize = (5 - 1) * envelope_size;
2973
2974            // Zero reserved fields.
2975            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
2976
2977            // Safety:
2978            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
2979            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
2980            //   envelope_size bytes, there is always sufficient room.
2981            fidl::encoding::encode_in_envelope_optional::<u64, D>(
2982                self.complete_borrowed_operation
2983                    .as_ref()
2984                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
2985                encoder,
2986                offset + cur_offset,
2987                depth,
2988            )?;
2989
2990            _prev_end_offset = cur_offset + envelope_size;
2991
2992            Ok(())
2993        }
2994    }
2995
2996    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2997        for EthernetTxTransferRequest
2998    {
2999        #[inline(always)]
3000        fn new_empty() -> Self {
3001            Self::default()
3002        }
3003
3004        unsafe fn decode(
3005            &mut self,
3006            decoder: &mut fidl::encoding::Decoder<'_, D>,
3007            offset: usize,
3008            mut depth: fidl::encoding::Depth,
3009        ) -> fidl::Result<()> {
3010            decoder.debug_check_bounds::<Self>(offset);
3011            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3012                None => return Err(fidl::Error::NotNullable),
3013                Some(len) => len,
3014            };
3015            // Calling decoder.out_of_line_offset(0) is not allowed.
3016            if len == 0 {
3017                return Ok(());
3018            };
3019            depth.increment()?;
3020            let envelope_size = 8;
3021            let bytes_len = len * envelope_size;
3022            let offset = decoder.out_of_line_offset(bytes_len)?;
3023            // Decode the envelope for each type.
3024            let mut _next_ordinal_to_read = 0;
3025            let mut next_offset = offset;
3026            let end_offset = offset + bytes_len;
3027            _next_ordinal_to_read += 1;
3028            if next_offset >= end_offset {
3029                return Ok(());
3030            }
3031
3032            // Decode unknown envelopes for gaps in ordinals.
3033            while _next_ordinal_to_read < 1 {
3034                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3035                _next_ordinal_to_read += 1;
3036                next_offset += envelope_size;
3037            }
3038
3039            let next_out_of_line = decoder.next_out_of_line();
3040            let handles_before = decoder.remaining_handles();
3041            if let Some((inlined, num_bytes, num_handles)) =
3042                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3043            {
3044                let member_inline_size =
3045                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3046                if inlined != (member_inline_size <= 4) {
3047                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3048                }
3049                let inner_offset;
3050                let mut inner_depth = depth.clone();
3051                if inlined {
3052                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3053                    inner_offset = next_offset;
3054                } else {
3055                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3056                    inner_depth.increment()?;
3057                }
3058                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
3059                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3060                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3061                {
3062                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3063                }
3064                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3065                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3066                }
3067            }
3068
3069            next_offset += envelope_size;
3070            _next_ordinal_to_read += 1;
3071            if next_offset >= end_offset {
3072                return Ok(());
3073            }
3074
3075            // Decode unknown envelopes for gaps in ordinals.
3076            while _next_ordinal_to_read < 2 {
3077                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3078                _next_ordinal_to_read += 1;
3079                next_offset += envelope_size;
3080            }
3081
3082            let next_out_of_line = decoder.next_out_of_line();
3083            let handles_before = decoder.remaining_handles();
3084            if let Some((inlined, num_bytes, num_handles)) =
3085                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3086            {
3087                let member_inline_size =
3088                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3089                if inlined != (member_inline_size <= 4) {
3090                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3091                }
3092                let inner_offset;
3093                let mut inner_depth = depth.clone();
3094                if inlined {
3095                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3096                    inner_offset = next_offset;
3097                } else {
3098                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3099                    inner_depth.increment()?;
3100                }
3101                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
3102                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3103                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3104                {
3105                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3106                }
3107                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3108                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3109                }
3110            }
3111
3112            next_offset += envelope_size;
3113            _next_ordinal_to_read += 1;
3114            if next_offset >= end_offset {
3115                return Ok(());
3116            }
3117
3118            // Decode unknown envelopes for gaps in ordinals.
3119            while _next_ordinal_to_read < 3 {
3120                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3121                _next_ordinal_to_read += 1;
3122                next_offset += envelope_size;
3123            }
3124
3125            let next_out_of_line = decoder.next_out_of_line();
3126            let handles_before = decoder.remaining_handles();
3127            if let Some((inlined, num_bytes, num_handles)) =
3128                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3129            {
3130                let member_inline_size =
3131                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3132                if inlined != (member_inline_size <= 4) {
3133                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3134                }
3135                let inner_offset;
3136                let mut inner_depth = depth.clone();
3137                if inlined {
3138                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3139                    inner_offset = next_offset;
3140                } else {
3141                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3142                    inner_depth.increment()?;
3143                }
3144                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
3145                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3146                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3147                {
3148                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3149                }
3150                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3151                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3152                }
3153            }
3154
3155            next_offset += envelope_size;
3156            _next_ordinal_to_read += 1;
3157            if next_offset >= end_offset {
3158                return Ok(());
3159            }
3160
3161            // Decode unknown envelopes for gaps in ordinals.
3162            while _next_ordinal_to_read < 4 {
3163                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3164                _next_ordinal_to_read += 1;
3165                next_offset += envelope_size;
3166            }
3167
3168            let next_out_of_line = decoder.next_out_of_line();
3169            let handles_before = decoder.remaining_handles();
3170            if let Some((inlined, num_bytes, num_handles)) =
3171                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3172            {
3173                let member_inline_size =
3174                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3175                if inlined != (member_inline_size <= 4) {
3176                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3177                }
3178                let inner_offset;
3179                let mut inner_depth = depth.clone();
3180                if inlined {
3181                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3182                    inner_offset = next_offset;
3183                } else {
3184                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3185                    inner_depth.increment()?;
3186                }
3187                let val_ref =
3188                    self.borrowed_operation.get_or_insert_with(|| fidl::new_empty!(u64, D));
3189                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3190                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3191                {
3192                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3193                }
3194                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3195                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3196                }
3197            }
3198
3199            next_offset += envelope_size;
3200            _next_ordinal_to_read += 1;
3201            if next_offset >= end_offset {
3202                return Ok(());
3203            }
3204
3205            // Decode unknown envelopes for gaps in ordinals.
3206            while _next_ordinal_to_read < 5 {
3207                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3208                _next_ordinal_to_read += 1;
3209                next_offset += envelope_size;
3210            }
3211
3212            let next_out_of_line = decoder.next_out_of_line();
3213            let handles_before = decoder.remaining_handles();
3214            if let Some((inlined, num_bytes, num_handles)) =
3215                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3216            {
3217                let member_inline_size =
3218                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3219                if inlined != (member_inline_size <= 4) {
3220                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3221                }
3222                let inner_offset;
3223                let mut inner_depth = depth.clone();
3224                if inlined {
3225                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3226                    inner_offset = next_offset;
3227                } else {
3228                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3229                    inner_depth.increment()?;
3230                }
3231                let val_ref = self
3232                    .complete_borrowed_operation
3233                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
3234                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
3235                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3236                {
3237                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3238                }
3239                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3240                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3241                }
3242            }
3243
3244            next_offset += envelope_size;
3245
3246            // Decode the remaining unknown envelopes.
3247            while next_offset < end_offset {
3248                _next_ordinal_to_read += 1;
3249                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3250                next_offset += envelope_size;
3251            }
3252
3253            Ok(())
3254        }
3255    }
3256
3257    impl ProbeResponseOffloadExtension {
3258        #[inline(always)]
3259        fn max_ordinal_present(&self) -> u64 {
3260            if let Some(_) = self.supported {
3261                return 1;
3262            }
3263            0
3264        }
3265    }
3266
3267    impl fidl::encoding::ValueTypeMarker for ProbeResponseOffloadExtension {
3268        type Borrowed<'a> = &'a Self;
3269        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3270            value
3271        }
3272    }
3273
3274    unsafe impl fidl::encoding::TypeMarker for ProbeResponseOffloadExtension {
3275        type Owned = Self;
3276
3277        #[inline(always)]
3278        fn inline_align(_context: fidl::encoding::Context) -> usize {
3279            8
3280        }
3281
3282        #[inline(always)]
3283        fn inline_size(_context: fidl::encoding::Context) -> usize {
3284            16
3285        }
3286    }
3287
3288    unsafe impl<D: fidl::encoding::ResourceDialect>
3289        fidl::encoding::Encode<ProbeResponseOffloadExtension, D>
3290        for &ProbeResponseOffloadExtension
3291    {
3292        unsafe fn encode(
3293            self,
3294            encoder: &mut fidl::encoding::Encoder<'_, D>,
3295            offset: usize,
3296            mut depth: fidl::encoding::Depth,
3297        ) -> fidl::Result<()> {
3298            encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
3299            // Vector header
3300            let max_ordinal: u64 = self.max_ordinal_present();
3301            encoder.write_num(max_ordinal, offset);
3302            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3303            // Calling encoder.out_of_line_offset(0) is not allowed.
3304            if max_ordinal == 0 {
3305                return Ok(());
3306            }
3307            depth.increment()?;
3308            let envelope_size = 8;
3309            let bytes_len = max_ordinal as usize * envelope_size;
3310            #[allow(unused_variables)]
3311            let offset = encoder.out_of_line_offset(bytes_len);
3312            let mut _prev_end_offset: usize = 0;
3313            if 1 > max_ordinal {
3314                return Ok(());
3315            }
3316
3317            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3318            // are envelope_size bytes.
3319            let cur_offset: usize = (1 - 1) * envelope_size;
3320
3321            // Zero reserved fields.
3322            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3323
3324            // Safety:
3325            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3326            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3327            //   envelope_size bytes, there is always sufficient room.
3328            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3329                self.supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3330                encoder,
3331                offset + cur_offset,
3332                depth,
3333            )?;
3334
3335            _prev_end_offset = cur_offset + envelope_size;
3336
3337            Ok(())
3338        }
3339    }
3340
3341    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3342        for ProbeResponseOffloadExtension
3343    {
3344        #[inline(always)]
3345        fn new_empty() -> Self {
3346            Self::default()
3347        }
3348
3349        unsafe fn decode(
3350            &mut self,
3351            decoder: &mut fidl::encoding::Decoder<'_, D>,
3352            offset: usize,
3353            mut depth: fidl::encoding::Depth,
3354        ) -> fidl::Result<()> {
3355            decoder.debug_check_bounds::<Self>(offset);
3356            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3357                None => return Err(fidl::Error::NotNullable),
3358                Some(len) => len,
3359            };
3360            // Calling decoder.out_of_line_offset(0) is not allowed.
3361            if len == 0 {
3362                return Ok(());
3363            };
3364            depth.increment()?;
3365            let envelope_size = 8;
3366            let bytes_len = len * envelope_size;
3367            let offset = decoder.out_of_line_offset(bytes_len)?;
3368            // Decode the envelope for each type.
3369            let mut _next_ordinal_to_read = 0;
3370            let mut next_offset = offset;
3371            let end_offset = offset + bytes_len;
3372            _next_ordinal_to_read += 1;
3373            if next_offset >= end_offset {
3374                return Ok(());
3375            }
3376
3377            // Decode unknown envelopes for gaps in ordinals.
3378            while _next_ordinal_to_read < 1 {
3379                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3380                _next_ordinal_to_read += 1;
3381                next_offset += envelope_size;
3382            }
3383
3384            let next_out_of_line = decoder.next_out_of_line();
3385            let handles_before = decoder.remaining_handles();
3386            if let Some((inlined, num_bytes, num_handles)) =
3387                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3388            {
3389                let member_inline_size =
3390                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3391                if inlined != (member_inline_size <= 4) {
3392                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3393                }
3394                let inner_offset;
3395                let mut inner_depth = depth.clone();
3396                if inlined {
3397                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3398                    inner_offset = next_offset;
3399                } else {
3400                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3401                    inner_depth.increment()?;
3402                }
3403                let val_ref = self.supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
3404                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3405                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3406                {
3407                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3408                }
3409                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3410                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3411                }
3412            }
3413
3414            next_offset += envelope_size;
3415
3416            // Decode the remaining unknown envelopes.
3417            while next_offset < end_offset {
3418                _next_ordinal_to_read += 1;
3419                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3420                next_offset += envelope_size;
3421            }
3422
3423            Ok(())
3424        }
3425    }
3426
3427    impl ScanOffloadExtension {
3428        #[inline(always)]
3429        fn max_ordinal_present(&self) -> u64 {
3430            if let Some(_) = self.scan_cancel_supported {
3431                return 2;
3432            }
3433            if let Some(_) = self.supported {
3434                return 1;
3435            }
3436            0
3437        }
3438    }
3439
3440    impl fidl::encoding::ValueTypeMarker for ScanOffloadExtension {
3441        type Borrowed<'a> = &'a Self;
3442        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3443            value
3444        }
3445    }
3446
3447    unsafe impl fidl::encoding::TypeMarker for ScanOffloadExtension {
3448        type Owned = Self;
3449
3450        #[inline(always)]
3451        fn inline_align(_context: fidl::encoding::Context) -> usize {
3452            8
3453        }
3454
3455        #[inline(always)]
3456        fn inline_size(_context: fidl::encoding::Context) -> usize {
3457            16
3458        }
3459    }
3460
3461    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanOffloadExtension, D>
3462        for &ScanOffloadExtension
3463    {
3464        unsafe fn encode(
3465            self,
3466            encoder: &mut fidl::encoding::Encoder<'_, D>,
3467            offset: usize,
3468            mut depth: fidl::encoding::Depth,
3469        ) -> fidl::Result<()> {
3470            encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
3471            // Vector header
3472            let max_ordinal: u64 = self.max_ordinal_present();
3473            encoder.write_num(max_ordinal, offset);
3474            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3475            // Calling encoder.out_of_line_offset(0) is not allowed.
3476            if max_ordinal == 0 {
3477                return Ok(());
3478            }
3479            depth.increment()?;
3480            let envelope_size = 8;
3481            let bytes_len = max_ordinal as usize * envelope_size;
3482            #[allow(unused_variables)]
3483            let offset = encoder.out_of_line_offset(bytes_len);
3484            let mut _prev_end_offset: usize = 0;
3485            if 1 > max_ordinal {
3486                return Ok(());
3487            }
3488
3489            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3490            // are envelope_size bytes.
3491            let cur_offset: usize = (1 - 1) * envelope_size;
3492
3493            // Zero reserved fields.
3494            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3495
3496            // Safety:
3497            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3498            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3499            //   envelope_size bytes, there is always sufficient room.
3500            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3501                self.supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3502                encoder,
3503                offset + cur_offset,
3504                depth,
3505            )?;
3506
3507            _prev_end_offset = cur_offset + envelope_size;
3508            if 2 > max_ordinal {
3509                return Ok(());
3510            }
3511
3512            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3513            // are envelope_size bytes.
3514            let cur_offset: usize = (2 - 1) * envelope_size;
3515
3516            // Zero reserved fields.
3517            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3518
3519            // Safety:
3520            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3521            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3522            //   envelope_size bytes, there is always sufficient room.
3523            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3524                self.scan_cancel_supported
3525                    .as_ref()
3526                    .map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3527                encoder,
3528                offset + cur_offset,
3529                depth,
3530            )?;
3531
3532            _prev_end_offset = cur_offset + envelope_size;
3533
3534            Ok(())
3535        }
3536    }
3537
3538    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanOffloadExtension {
3539        #[inline(always)]
3540        fn new_empty() -> Self {
3541            Self::default()
3542        }
3543
3544        unsafe fn decode(
3545            &mut self,
3546            decoder: &mut fidl::encoding::Decoder<'_, D>,
3547            offset: usize,
3548            mut depth: fidl::encoding::Depth,
3549        ) -> fidl::Result<()> {
3550            decoder.debug_check_bounds::<Self>(offset);
3551            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3552                None => return Err(fidl::Error::NotNullable),
3553                Some(len) => len,
3554            };
3555            // Calling decoder.out_of_line_offset(0) is not allowed.
3556            if len == 0 {
3557                return Ok(());
3558            };
3559            depth.increment()?;
3560            let envelope_size = 8;
3561            let bytes_len = len * envelope_size;
3562            let offset = decoder.out_of_line_offset(bytes_len)?;
3563            // Decode the envelope for each type.
3564            let mut _next_ordinal_to_read = 0;
3565            let mut next_offset = offset;
3566            let end_offset = offset + bytes_len;
3567            _next_ordinal_to_read += 1;
3568            if next_offset >= end_offset {
3569                return Ok(());
3570            }
3571
3572            // Decode unknown envelopes for gaps in ordinals.
3573            while _next_ordinal_to_read < 1 {
3574                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3575                _next_ordinal_to_read += 1;
3576                next_offset += envelope_size;
3577            }
3578
3579            let next_out_of_line = decoder.next_out_of_line();
3580            let handles_before = decoder.remaining_handles();
3581            if let Some((inlined, num_bytes, num_handles)) =
3582                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3583            {
3584                let member_inline_size =
3585                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3586                if inlined != (member_inline_size <= 4) {
3587                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3588                }
3589                let inner_offset;
3590                let mut inner_depth = depth.clone();
3591                if inlined {
3592                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3593                    inner_offset = next_offset;
3594                } else {
3595                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3596                    inner_depth.increment()?;
3597                }
3598                let val_ref = self.supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
3599                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3600                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3601                {
3602                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3603                }
3604                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3605                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3606                }
3607            }
3608
3609            next_offset += envelope_size;
3610            _next_ordinal_to_read += 1;
3611            if next_offset >= end_offset {
3612                return Ok(());
3613            }
3614
3615            // Decode unknown envelopes for gaps in ordinals.
3616            while _next_ordinal_to_read < 2 {
3617                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3618                _next_ordinal_to_read += 1;
3619                next_offset += envelope_size;
3620            }
3621
3622            let next_out_of_line = decoder.next_out_of_line();
3623            let handles_before = decoder.remaining_handles();
3624            if let Some((inlined, num_bytes, num_handles)) =
3625                fidl::encoding::decode_envelope_header(decoder, next_offset)?
3626            {
3627                let member_inline_size =
3628                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
3629                if inlined != (member_inline_size <= 4) {
3630                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
3631                }
3632                let inner_offset;
3633                let mut inner_depth = depth.clone();
3634                if inlined {
3635                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3636                    inner_offset = next_offset;
3637                } else {
3638                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3639                    inner_depth.increment()?;
3640                }
3641                let val_ref =
3642                    self.scan_cancel_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
3643                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
3644                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3645                {
3646                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
3647                }
3648                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3649                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3650                }
3651            }
3652
3653            next_offset += envelope_size;
3654
3655            // Decode the remaining unknown envelopes.
3656            while next_offset < end_offset {
3657                _next_ordinal_to_read += 1;
3658                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3659                next_offset += envelope_size;
3660            }
3661
3662            Ok(())
3663        }
3664    }
3665
3666    impl WlanAssociationConfig {
3667        #[inline(always)]
3668        fn max_ordinal_present(&self) -> u64 {
3669            if let Some(_) = self.vht_op {
3670                return 12;
3671            }
3672            if let Some(_) = self.vht_cap {
3673                return 11;
3674            }
3675            if let Some(_) = self.ht_op {
3676                return 10;
3677            }
3678            if let Some(_) = self.ht_cap {
3679                return 9;
3680            }
3681            if let Some(_) = self.capability_info {
3682                return 8;
3683            }
3684            if let Some(_) = self.rates {
3685                return 7;
3686            }
3687            if let Some(_) = self.wmm_params {
3688                return 6;
3689            }
3690            if let Some(_) = self.qos {
3691                return 5;
3692            }
3693            if let Some(_) = self.channel {
3694                return 4;
3695            }
3696            if let Some(_) = self.listen_interval {
3697                return 3;
3698            }
3699            if let Some(_) = self.aid {
3700                return 2;
3701            }
3702            if let Some(_) = self.bssid {
3703                return 1;
3704            }
3705            0
3706        }
3707    }
3708
3709    impl fidl::encoding::ValueTypeMarker for WlanAssociationConfig {
3710        type Borrowed<'a> = &'a Self;
3711        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3712            value
3713        }
3714    }
3715
3716    unsafe impl fidl::encoding::TypeMarker for WlanAssociationConfig {
3717        type Owned = Self;
3718
3719        #[inline(always)]
3720        fn inline_align(_context: fidl::encoding::Context) -> usize {
3721            8
3722        }
3723
3724        #[inline(always)]
3725        fn inline_size(_context: fidl::encoding::Context) -> usize {
3726            16
3727        }
3728    }
3729
3730    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanAssociationConfig, D>
3731        for &WlanAssociationConfig
3732    {
3733        unsafe fn encode(
3734            self,
3735            encoder: &mut fidl::encoding::Encoder<'_, D>,
3736            offset: usize,
3737            mut depth: fidl::encoding::Depth,
3738        ) -> fidl::Result<()> {
3739            encoder.debug_check_bounds::<WlanAssociationConfig>(offset);
3740            // Vector header
3741            let max_ordinal: u64 = self.max_ordinal_present();
3742            encoder.write_num(max_ordinal, offset);
3743            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3744            // Calling encoder.out_of_line_offset(0) is not allowed.
3745            if max_ordinal == 0 {
3746                return Ok(());
3747            }
3748            depth.increment()?;
3749            let envelope_size = 8;
3750            let bytes_len = max_ordinal as usize * envelope_size;
3751            #[allow(unused_variables)]
3752            let offset = encoder.out_of_line_offset(bytes_len);
3753            let mut _prev_end_offset: usize = 0;
3754            if 1 > max_ordinal {
3755                return Ok(());
3756            }
3757
3758            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3759            // are envelope_size bytes.
3760            let cur_offset: usize = (1 - 1) * envelope_size;
3761
3762            // Zero reserved fields.
3763            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3764
3765            // Safety:
3766            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3767            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3768            //   envelope_size bytes, there is always sufficient room.
3769            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3770                self.bssid
3771                    .as_ref()
3772                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3773                encoder,
3774                offset + cur_offset,
3775                depth,
3776            )?;
3777
3778            _prev_end_offset = cur_offset + envelope_size;
3779            if 2 > max_ordinal {
3780                return Ok(());
3781            }
3782
3783            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3784            // are envelope_size bytes.
3785            let cur_offset: usize = (2 - 1) * envelope_size;
3786
3787            // Zero reserved fields.
3788            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3789
3790            // Safety:
3791            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3792            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3793            //   envelope_size bytes, there is always sufficient room.
3794            fidl::encoding::encode_in_envelope_optional::<u16, D>(
3795                self.aid.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3796                encoder,
3797                offset + cur_offset,
3798                depth,
3799            )?;
3800
3801            _prev_end_offset = cur_offset + envelope_size;
3802            if 3 > max_ordinal {
3803                return Ok(());
3804            }
3805
3806            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3807            // are envelope_size bytes.
3808            let cur_offset: usize = (3 - 1) * envelope_size;
3809
3810            // Zero reserved fields.
3811            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3812
3813            // Safety:
3814            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3815            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3816            //   envelope_size bytes, there is always sufficient room.
3817            fidl::encoding::encode_in_envelope_optional::<u16, D>(
3818                self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3819                encoder,
3820                offset + cur_offset,
3821                depth,
3822            )?;
3823
3824            _prev_end_offset = cur_offset + envelope_size;
3825            if 4 > max_ordinal {
3826                return Ok(());
3827            }
3828
3829            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3830            // are envelope_size bytes.
3831            let cur_offset: usize = (4 - 1) * envelope_size;
3832
3833            // Zero reserved fields.
3834            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3835
3836            // Safety:
3837            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3838            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3839            //   envelope_size bytes, there is always sufficient room.
3840            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>(
3841            self.channel.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
3842            encoder, offset + cur_offset, depth
3843        )?;
3844
3845            _prev_end_offset = cur_offset + envelope_size;
3846            if 5 > max_ordinal {
3847                return Ok(());
3848            }
3849
3850            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3851            // are envelope_size bytes.
3852            let cur_offset: usize = (5 - 1) * envelope_size;
3853
3854            // Zero reserved fields.
3855            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3856
3857            // Safety:
3858            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3859            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3860            //   envelope_size bytes, there is always sufficient room.
3861            fidl::encoding::encode_in_envelope_optional::<bool, D>(
3862                self.qos.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3863                encoder,
3864                offset + cur_offset,
3865                depth,
3866            )?;
3867
3868            _prev_end_offset = cur_offset + envelope_size;
3869            if 6 > max_ordinal {
3870                return Ok(());
3871            }
3872
3873            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3874            // are envelope_size bytes.
3875            let cur_offset: usize = (6 - 1) * envelope_size;
3876
3877            // Zero reserved fields.
3878            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3879
3880            // Safety:
3881            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3882            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3883            //   envelope_size bytes, there is always sufficient room.
3884            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
3885            self.wmm_params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
3886            encoder, offset + cur_offset, depth
3887        )?;
3888
3889            _prev_end_offset = cur_offset + envelope_size;
3890            if 7 > max_ordinal {
3891                return Ok(());
3892            }
3893
3894            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3895            // are envelope_size bytes.
3896            let cur_offset: usize = (7 - 1) * envelope_size;
3897
3898            // Zero reserved fields.
3899            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3900
3901            // Safety:
3902            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3903            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3904            //   envelope_size bytes, there is always sufficient room.
3905            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 263>, D>(
3906                self.rates.as_ref().map(
3907                    <fidl::encoding::Vector<u8, 263> as fidl::encoding::ValueTypeMarker>::borrow,
3908                ),
3909                encoder,
3910                offset + cur_offset,
3911                depth,
3912            )?;
3913
3914            _prev_end_offset = cur_offset + envelope_size;
3915            if 8 > max_ordinal {
3916                return Ok(());
3917            }
3918
3919            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3920            // are envelope_size bytes.
3921            let cur_offset: usize = (8 - 1) * envelope_size;
3922
3923            // Zero reserved fields.
3924            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3925
3926            // Safety:
3927            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3928            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3929            //   envelope_size bytes, there is always sufficient room.
3930            fidl::encoding::encode_in_envelope_optional::<u16, D>(
3931                self.capability_info.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3932                encoder,
3933                offset + cur_offset,
3934                depth,
3935            )?;
3936
3937            _prev_end_offset = cur_offset + envelope_size;
3938            if 9 > max_ordinal {
3939                return Ok(());
3940            }
3941
3942            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3943            // are envelope_size bytes.
3944            let cur_offset: usize = (9 - 1) * envelope_size;
3945
3946            // Zero reserved fields.
3947            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3948
3949            // Safety:
3950            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3951            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3952            //   envelope_size bytes, there is always sufficient room.
3953            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
3954            self.ht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3955            encoder, offset + cur_offset, depth
3956        )?;
3957
3958            _prev_end_offset = cur_offset + envelope_size;
3959            if 10 > max_ordinal {
3960                return Ok(());
3961            }
3962
3963            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3964            // are envelope_size bytes.
3965            let cur_offset: usize = (10 - 1) * envelope_size;
3966
3967            // Zero reserved fields.
3968            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3969
3970            // Safety:
3971            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3972            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3973            //   envelope_size bytes, there is always sufficient room.
3974            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtOperation, D>(
3975            self.ht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::ValueTypeMarker>::borrow),
3976            encoder, offset + cur_offset, depth
3977        )?;
3978
3979            _prev_end_offset = cur_offset + envelope_size;
3980            if 11 > max_ordinal {
3981                return Ok(());
3982            }
3983
3984            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
3985            // are envelope_size bytes.
3986            let cur_offset: usize = (11 - 1) * envelope_size;
3987
3988            // Zero reserved fields.
3989            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3990
3991            // Safety:
3992            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
3993            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
3994            //   envelope_size bytes, there is always sufficient room.
3995            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
3996            self.vht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
3997            encoder, offset + cur_offset, depth
3998        )?;
3999
4000            _prev_end_offset = cur_offset + envelope_size;
4001            if 12 > max_ordinal {
4002                return Ok(());
4003            }
4004
4005            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4006            // are envelope_size bytes.
4007            let cur_offset: usize = (12 - 1) * envelope_size;
4008
4009            // Zero reserved fields.
4010            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4011
4012            // Safety:
4013            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4014            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4015            //   envelope_size bytes, there is always sufficient room.
4016            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D>(
4017            self.vht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::ValueTypeMarker>::borrow),
4018            encoder, offset + cur_offset, depth
4019        )?;
4020
4021            _prev_end_offset = cur_offset + envelope_size;
4022
4023            Ok(())
4024        }
4025    }
4026
4027    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssociationConfig {
4028        #[inline(always)]
4029        fn new_empty() -> Self {
4030            Self::default()
4031        }
4032
4033        unsafe fn decode(
4034            &mut self,
4035            decoder: &mut fidl::encoding::Decoder<'_, D>,
4036            offset: usize,
4037            mut depth: fidl::encoding::Depth,
4038        ) -> fidl::Result<()> {
4039            decoder.debug_check_bounds::<Self>(offset);
4040            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4041                None => return Err(fidl::Error::NotNullable),
4042                Some(len) => len,
4043            };
4044            // Calling decoder.out_of_line_offset(0) is not allowed.
4045            if len == 0 {
4046                return Ok(());
4047            };
4048            depth.increment()?;
4049            let envelope_size = 8;
4050            let bytes_len = len * envelope_size;
4051            let offset = decoder.out_of_line_offset(bytes_len)?;
4052            // Decode the envelope for each type.
4053            let mut _next_ordinal_to_read = 0;
4054            let mut next_offset = offset;
4055            let end_offset = offset + bytes_len;
4056            _next_ordinal_to_read += 1;
4057            if next_offset >= end_offset {
4058                return Ok(());
4059            }
4060
4061            // Decode unknown envelopes for gaps in ordinals.
4062            while _next_ordinal_to_read < 1 {
4063                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4064                _next_ordinal_to_read += 1;
4065                next_offset += envelope_size;
4066            }
4067
4068            let next_out_of_line = decoder.next_out_of_line();
4069            let handles_before = decoder.remaining_handles();
4070            if let Some((inlined, num_bytes, num_handles)) =
4071                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4072            {
4073                let member_inline_size =
4074                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4075                        decoder.context,
4076                    );
4077                if inlined != (member_inline_size <= 4) {
4078                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4079                }
4080                let inner_offset;
4081                let mut inner_depth = depth.clone();
4082                if inlined {
4083                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4084                    inner_offset = next_offset;
4085                } else {
4086                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4087                    inner_depth.increment()?;
4088                }
4089                let val_ref = self
4090                    .bssid
4091                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4092                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4093                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4094                {
4095                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4096                }
4097                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4098                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4099                }
4100            }
4101
4102            next_offset += envelope_size;
4103            _next_ordinal_to_read += 1;
4104            if next_offset >= end_offset {
4105                return Ok(());
4106            }
4107
4108            // Decode unknown envelopes for gaps in ordinals.
4109            while _next_ordinal_to_read < 2 {
4110                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4111                _next_ordinal_to_read += 1;
4112                next_offset += envelope_size;
4113            }
4114
4115            let next_out_of_line = decoder.next_out_of_line();
4116            let handles_before = decoder.remaining_handles();
4117            if let Some((inlined, num_bytes, num_handles)) =
4118                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4119            {
4120                let member_inline_size =
4121                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4122                if inlined != (member_inline_size <= 4) {
4123                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4124                }
4125                let inner_offset;
4126                let mut inner_depth = depth.clone();
4127                if inlined {
4128                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4129                    inner_offset = next_offset;
4130                } else {
4131                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4132                    inner_depth.increment()?;
4133                }
4134                let val_ref = self.aid.get_or_insert_with(|| fidl::new_empty!(u16, D));
4135                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4136                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4137                {
4138                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4139                }
4140                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4141                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4142                }
4143            }
4144
4145            next_offset += envelope_size;
4146            _next_ordinal_to_read += 1;
4147            if next_offset >= end_offset {
4148                return Ok(());
4149            }
4150
4151            // Decode unknown envelopes for gaps in ordinals.
4152            while _next_ordinal_to_read < 3 {
4153                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4154                _next_ordinal_to_read += 1;
4155                next_offset += envelope_size;
4156            }
4157
4158            let next_out_of_line = decoder.next_out_of_line();
4159            let handles_before = decoder.remaining_handles();
4160            if let Some((inlined, num_bytes, num_handles)) =
4161                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4162            {
4163                let member_inline_size =
4164                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4165                if inlined != (member_inline_size <= 4) {
4166                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4167                }
4168                let inner_offset;
4169                let mut inner_depth = depth.clone();
4170                if inlined {
4171                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4172                    inner_offset = next_offset;
4173                } else {
4174                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4175                    inner_depth.increment()?;
4176                }
4177                let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
4178                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4179                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4180                {
4181                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4182                }
4183                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4184                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4185                }
4186            }
4187
4188            next_offset += envelope_size;
4189            _next_ordinal_to_read += 1;
4190            if next_offset >= end_offset {
4191                return Ok(());
4192            }
4193
4194            // Decode unknown envelopes for gaps in ordinals.
4195            while _next_ordinal_to_read < 4 {
4196                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4197                _next_ordinal_to_read += 1;
4198                next_offset += envelope_size;
4199            }
4200
4201            let next_out_of_line = decoder.next_out_of_line();
4202            let handles_before = decoder.remaining_handles();
4203            if let Some((inlined, num_bytes, num_handles)) =
4204                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4205            {
4206                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4207                if inlined != (member_inline_size <= 4) {
4208                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4209                }
4210                let inner_offset;
4211                let mut inner_depth = depth.clone();
4212                if inlined {
4213                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4214                    inner_offset = next_offset;
4215                } else {
4216                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4217                    inner_depth.increment()?;
4218                }
4219                let val_ref = self.channel.get_or_insert_with(|| {
4220                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D)
4221                });
4222                fidl::decode!(
4223                    fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
4224                    D,
4225                    val_ref,
4226                    decoder,
4227                    inner_offset,
4228                    inner_depth
4229                )?;
4230                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4231                {
4232                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4233                }
4234                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4235                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4236                }
4237            }
4238
4239            next_offset += envelope_size;
4240            _next_ordinal_to_read += 1;
4241            if next_offset >= end_offset {
4242                return Ok(());
4243            }
4244
4245            // Decode unknown envelopes for gaps in ordinals.
4246            while _next_ordinal_to_read < 5 {
4247                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4248                _next_ordinal_to_read += 1;
4249                next_offset += envelope_size;
4250            }
4251
4252            let next_out_of_line = decoder.next_out_of_line();
4253            let handles_before = decoder.remaining_handles();
4254            if let Some((inlined, num_bytes, num_handles)) =
4255                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4256            {
4257                let member_inline_size =
4258                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4259                if inlined != (member_inline_size <= 4) {
4260                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4261                }
4262                let inner_offset;
4263                let mut inner_depth = depth.clone();
4264                if inlined {
4265                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4266                    inner_offset = next_offset;
4267                } else {
4268                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4269                    inner_depth.increment()?;
4270                }
4271                let val_ref = self.qos.get_or_insert_with(|| fidl::new_empty!(bool, D));
4272                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4273                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4274                {
4275                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4276                }
4277                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4278                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4279                }
4280            }
4281
4282            next_offset += envelope_size;
4283            _next_ordinal_to_read += 1;
4284            if next_offset >= end_offset {
4285                return Ok(());
4286            }
4287
4288            // Decode unknown envelopes for gaps in ordinals.
4289            while _next_ordinal_to_read < 6 {
4290                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4291                _next_ordinal_to_read += 1;
4292                next_offset += envelope_size;
4293            }
4294
4295            let next_out_of_line = decoder.next_out_of_line();
4296            let handles_before = decoder.remaining_handles();
4297            if let Some((inlined, num_bytes, num_handles)) =
4298                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4299            {
4300                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4301                if inlined != (member_inline_size <= 4) {
4302                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4303                }
4304                let inner_offset;
4305                let mut inner_depth = depth.clone();
4306                if inlined {
4307                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4308                    inner_offset = next_offset;
4309                } else {
4310                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4311                    inner_depth.increment()?;
4312                }
4313                let val_ref = self.wmm_params.get_or_insert_with(|| {
4314                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
4315                });
4316                fidl::decode!(
4317                    fidl_fuchsia_wlan_common__common::WlanWmmParameters,
4318                    D,
4319                    val_ref,
4320                    decoder,
4321                    inner_offset,
4322                    inner_depth
4323                )?;
4324                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4325                {
4326                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4327                }
4328                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4329                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4330                }
4331            }
4332
4333            next_offset += envelope_size;
4334            _next_ordinal_to_read += 1;
4335            if next_offset >= end_offset {
4336                return Ok(());
4337            }
4338
4339            // Decode unknown envelopes for gaps in ordinals.
4340            while _next_ordinal_to_read < 7 {
4341                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4342                _next_ordinal_to_read += 1;
4343                next_offset += envelope_size;
4344            }
4345
4346            let next_out_of_line = decoder.next_out_of_line();
4347            let handles_before = decoder.remaining_handles();
4348            if let Some((inlined, num_bytes, num_handles)) =
4349                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4350            {
4351                let member_inline_size =
4352                    <fidl::encoding::Vector<u8, 263> as fidl::encoding::TypeMarker>::inline_size(
4353                        decoder.context,
4354                    );
4355                if inlined != (member_inline_size <= 4) {
4356                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4357                }
4358                let inner_offset;
4359                let mut inner_depth = depth.clone();
4360                if inlined {
4361                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4362                    inner_offset = next_offset;
4363                } else {
4364                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4365                    inner_depth.increment()?;
4366                }
4367                let val_ref = self
4368                    .rates
4369                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 263>, D));
4370                fidl::decode!(fidl::encoding::Vector<u8, 263>, D, val_ref, decoder, inner_offset, inner_depth)?;
4371                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4372                {
4373                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4374                }
4375                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4376                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4377                }
4378            }
4379
4380            next_offset += envelope_size;
4381            _next_ordinal_to_read += 1;
4382            if next_offset >= end_offset {
4383                return Ok(());
4384            }
4385
4386            // Decode unknown envelopes for gaps in ordinals.
4387            while _next_ordinal_to_read < 8 {
4388                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4389                _next_ordinal_to_read += 1;
4390                next_offset += envelope_size;
4391            }
4392
4393            let next_out_of_line = decoder.next_out_of_line();
4394            let handles_before = decoder.remaining_handles();
4395            if let Some((inlined, num_bytes, num_handles)) =
4396                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4397            {
4398                let member_inline_size =
4399                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4400                if inlined != (member_inline_size <= 4) {
4401                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4402                }
4403                let inner_offset;
4404                let mut inner_depth = depth.clone();
4405                if inlined {
4406                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4407                    inner_offset = next_offset;
4408                } else {
4409                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4410                    inner_depth.increment()?;
4411                }
4412                let val_ref = self.capability_info.get_or_insert_with(|| fidl::new_empty!(u16, D));
4413                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4414                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4415                {
4416                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4417                }
4418                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4419                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4420                }
4421            }
4422
4423            next_offset += envelope_size;
4424            _next_ordinal_to_read += 1;
4425            if next_offset >= end_offset {
4426                return Ok(());
4427            }
4428
4429            // Decode unknown envelopes for gaps in ordinals.
4430            while _next_ordinal_to_read < 9 {
4431                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4432                _next_ordinal_to_read += 1;
4433                next_offset += envelope_size;
4434            }
4435
4436            let next_out_of_line = decoder.next_out_of_line();
4437            let handles_before = decoder.remaining_handles();
4438            if let Some((inlined, num_bytes, num_handles)) =
4439                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4440            {
4441                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4442                if inlined != (member_inline_size <= 4) {
4443                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4444                }
4445                let inner_offset;
4446                let mut inner_depth = depth.clone();
4447                if inlined {
4448                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4449                    inner_offset = next_offset;
4450                } else {
4451                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4452                    inner_depth.increment()?;
4453                }
4454                let val_ref = self.ht_cap.get_or_insert_with(|| {
4455                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
4456                });
4457                fidl::decode!(
4458                    fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
4459                    D,
4460                    val_ref,
4461                    decoder,
4462                    inner_offset,
4463                    inner_depth
4464                )?;
4465                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4466                {
4467                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4468                }
4469                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4470                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4471                }
4472            }
4473
4474            next_offset += envelope_size;
4475            _next_ordinal_to_read += 1;
4476            if next_offset >= end_offset {
4477                return Ok(());
4478            }
4479
4480            // Decode unknown envelopes for gaps in ordinals.
4481            while _next_ordinal_to_read < 10 {
4482                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4483                _next_ordinal_to_read += 1;
4484                next_offset += envelope_size;
4485            }
4486
4487            let next_out_of_line = decoder.next_out_of_line();
4488            let handles_before = decoder.remaining_handles();
4489            if let Some((inlined, num_bytes, num_handles)) =
4490                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4491            {
4492                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4493                if inlined != (member_inline_size <= 4) {
4494                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4495                }
4496                let inner_offset;
4497                let mut inner_depth = depth.clone();
4498                if inlined {
4499                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4500                    inner_offset = next_offset;
4501                } else {
4502                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4503                    inner_depth.increment()?;
4504                }
4505                let val_ref = self.ht_op.get_or_insert_with(|| {
4506                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtOperation, D)
4507                });
4508                fidl::decode!(
4509                    fidl_fuchsia_wlan_ieee80211__common::HtOperation,
4510                    D,
4511                    val_ref,
4512                    decoder,
4513                    inner_offset,
4514                    inner_depth
4515                )?;
4516                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4517                {
4518                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4519                }
4520                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4521                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4522                }
4523            }
4524
4525            next_offset += envelope_size;
4526            _next_ordinal_to_read += 1;
4527            if next_offset >= end_offset {
4528                return Ok(());
4529            }
4530
4531            // Decode unknown envelopes for gaps in ordinals.
4532            while _next_ordinal_to_read < 11 {
4533                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4534                _next_ordinal_to_read += 1;
4535                next_offset += envelope_size;
4536            }
4537
4538            let next_out_of_line = decoder.next_out_of_line();
4539            let handles_before = decoder.remaining_handles();
4540            if let Some((inlined, num_bytes, num_handles)) =
4541                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4542            {
4543                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4544                if inlined != (member_inline_size <= 4) {
4545                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4546                }
4547                let inner_offset;
4548                let mut inner_depth = depth.clone();
4549                if inlined {
4550                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4551                    inner_offset = next_offset;
4552                } else {
4553                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4554                    inner_depth.increment()?;
4555                }
4556                let val_ref = self.vht_cap.get_or_insert_with(|| {
4557                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
4558                });
4559                fidl::decode!(
4560                    fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
4561                    D,
4562                    val_ref,
4563                    decoder,
4564                    inner_offset,
4565                    inner_depth
4566                )?;
4567                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4568                {
4569                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4570                }
4571                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4572                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4573                }
4574            }
4575
4576            next_offset += envelope_size;
4577            _next_ordinal_to_read += 1;
4578            if next_offset >= end_offset {
4579                return Ok(());
4580            }
4581
4582            // Decode unknown envelopes for gaps in ordinals.
4583            while _next_ordinal_to_read < 12 {
4584                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4585                _next_ordinal_to_read += 1;
4586                next_offset += envelope_size;
4587            }
4588
4589            let next_out_of_line = decoder.next_out_of_line();
4590            let handles_before = decoder.remaining_handles();
4591            if let Some((inlined, num_bytes, num_handles)) =
4592                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4593            {
4594                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4595                if inlined != (member_inline_size <= 4) {
4596                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4597                }
4598                let inner_offset;
4599                let mut inner_depth = depth.clone();
4600                if inlined {
4601                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4602                    inner_offset = next_offset;
4603                } else {
4604                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4605                    inner_depth.increment()?;
4606                }
4607                let val_ref = self.vht_op.get_or_insert_with(|| {
4608                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtOperation, D)
4609                });
4610                fidl::decode!(
4611                    fidl_fuchsia_wlan_ieee80211__common::VhtOperation,
4612                    D,
4613                    val_ref,
4614                    decoder,
4615                    inner_offset,
4616                    inner_depth
4617                )?;
4618                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4619                {
4620                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4621                }
4622                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4623                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4624                }
4625            }
4626
4627            next_offset += envelope_size;
4628
4629            // Decode the remaining unknown envelopes.
4630            while next_offset < end_offset {
4631                _next_ordinal_to_read += 1;
4632                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4633                next_offset += envelope_size;
4634            }
4635
4636            Ok(())
4637        }
4638    }
4639
4640    impl WlanKeyConfiguration {
4641        #[inline(always)]
4642        fn max_ordinal_present(&self) -> u64 {
4643            if let Some(_) = self.rsc {
4644                return 8;
4645            }
4646            if let Some(_) = self.key {
4647                return 7;
4648            }
4649            if let Some(_) = self.key_idx {
4650                return 6;
4651            }
4652            if let Some(_) = self.peer_addr {
4653                return 5;
4654            }
4655            if let Some(_) = self.key_type {
4656                return 4;
4657            }
4658            if let Some(_) = self.cipher_type {
4659                return 3;
4660            }
4661            if let Some(_) = self.cipher_oui {
4662                return 2;
4663            }
4664            if let Some(_) = self.protection {
4665                return 1;
4666            }
4667            0
4668        }
4669    }
4670
4671    impl fidl::encoding::ValueTypeMarker for WlanKeyConfiguration {
4672        type Borrowed<'a> = &'a Self;
4673        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4674            value
4675        }
4676    }
4677
4678    unsafe impl fidl::encoding::TypeMarker for WlanKeyConfiguration {
4679        type Owned = Self;
4680
4681        #[inline(always)]
4682        fn inline_align(_context: fidl::encoding::Context) -> usize {
4683            8
4684        }
4685
4686        #[inline(always)]
4687        fn inline_size(_context: fidl::encoding::Context) -> usize {
4688            16
4689        }
4690    }
4691
4692    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfiguration, D>
4693        for &WlanKeyConfiguration
4694    {
4695        unsafe fn encode(
4696            self,
4697            encoder: &mut fidl::encoding::Encoder<'_, D>,
4698            offset: usize,
4699            mut depth: fidl::encoding::Depth,
4700        ) -> fidl::Result<()> {
4701            encoder.debug_check_bounds::<WlanKeyConfiguration>(offset);
4702            // Vector header
4703            let max_ordinal: u64 = self.max_ordinal_present();
4704            encoder.write_num(max_ordinal, offset);
4705            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4706            // Calling encoder.out_of_line_offset(0) is not allowed.
4707            if max_ordinal == 0 {
4708                return Ok(());
4709            }
4710            depth.increment()?;
4711            let envelope_size = 8;
4712            let bytes_len = max_ordinal as usize * envelope_size;
4713            #[allow(unused_variables)]
4714            let offset = encoder.out_of_line_offset(bytes_len);
4715            let mut _prev_end_offset: usize = 0;
4716            if 1 > max_ordinal {
4717                return Ok(());
4718            }
4719
4720            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4721            // are envelope_size bytes.
4722            let cur_offset: usize = (1 - 1) * envelope_size;
4723
4724            // Zero reserved fields.
4725            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4726
4727            // Safety:
4728            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4729            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4730            //   envelope_size bytes, there is always sufficient room.
4731            fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4732                self.protection
4733                    .as_ref()
4734                    .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4735                encoder,
4736                offset + cur_offset,
4737                depth,
4738            )?;
4739
4740            _prev_end_offset = cur_offset + envelope_size;
4741            if 2 > max_ordinal {
4742                return Ok(());
4743            }
4744
4745            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4746            // are envelope_size bytes.
4747            let cur_offset: usize = (2 - 1) * envelope_size;
4748
4749            // Zero reserved fields.
4750            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4751
4752            // Safety:
4753            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4754            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4755            //   envelope_size bytes, there is always sufficient room.
4756            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4757                self.cipher_oui
4758                    .as_ref()
4759                    .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4760                encoder,
4761                offset + cur_offset,
4762                depth,
4763            )?;
4764
4765            _prev_end_offset = cur_offset + envelope_size;
4766            if 3 > max_ordinal {
4767                return Ok(());
4768            }
4769
4770            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4771            // are envelope_size bytes.
4772            let cur_offset: usize = (3 - 1) * envelope_size;
4773
4774            // Zero reserved fields.
4775            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4776
4777            // Safety:
4778            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4779            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4780            //   envelope_size bytes, there is always sufficient room.
4781            fidl::encoding::encode_in_envelope_optional::<u8, D>(
4782                self.cipher_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4783                encoder,
4784                offset + cur_offset,
4785                depth,
4786            )?;
4787
4788            _prev_end_offset = cur_offset + envelope_size;
4789            if 4 > max_ordinal {
4790                return Ok(());
4791            }
4792
4793            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4794            // are envelope_size bytes.
4795            let cur_offset: usize = (4 - 1) * envelope_size;
4796
4797            // Zero reserved fields.
4798            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4799
4800            // Safety:
4801            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4802            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4803            //   envelope_size bytes, there is always sufficient room.
4804            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::KeyType, D>(
4805            self.key_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::ValueTypeMarker>::borrow),
4806            encoder, offset + cur_offset, depth
4807        )?;
4808
4809            _prev_end_offset = cur_offset + envelope_size;
4810            if 5 > max_ordinal {
4811                return Ok(());
4812            }
4813
4814            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4815            // are envelope_size bytes.
4816            let cur_offset: usize = (5 - 1) * envelope_size;
4817
4818            // Zero reserved fields.
4819            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4820
4821            // Safety:
4822            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4823            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4824            //   envelope_size bytes, there is always sufficient room.
4825            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4826                self.peer_addr
4827                    .as_ref()
4828                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4829                encoder,
4830                offset + cur_offset,
4831                depth,
4832            )?;
4833
4834            _prev_end_offset = cur_offset + envelope_size;
4835            if 6 > max_ordinal {
4836                return Ok(());
4837            }
4838
4839            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4840            // are envelope_size bytes.
4841            let cur_offset: usize = (6 - 1) * envelope_size;
4842
4843            // Zero reserved fields.
4844            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4845
4846            // Safety:
4847            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4848            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4849            //   envelope_size bytes, there is always sufficient room.
4850            fidl::encoding::encode_in_envelope_optional::<u8, D>(
4851                self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4852                encoder,
4853                offset + cur_offset,
4854                depth,
4855            )?;
4856
4857            _prev_end_offset = cur_offset + envelope_size;
4858            if 7 > max_ordinal {
4859                return Ok(());
4860            }
4861
4862            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4863            // are envelope_size bytes.
4864            let cur_offset: usize = (7 - 1) * envelope_size;
4865
4866            // Zero reserved fields.
4867            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4868
4869            // Safety:
4870            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4871            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4872            //   envelope_size bytes, there is always sufficient room.
4873            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4874                self.key.as_ref().map(
4875                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4876                ),
4877                encoder,
4878                offset + cur_offset,
4879                depth,
4880            )?;
4881
4882            _prev_end_offset = cur_offset + envelope_size;
4883            if 8 > max_ordinal {
4884                return Ok(());
4885            }
4886
4887            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
4888            // are envelope_size bytes.
4889            let cur_offset: usize = (8 - 1) * envelope_size;
4890
4891            // Zero reserved fields.
4892            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4893
4894            // Safety:
4895            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
4896            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
4897            //   envelope_size bytes, there is always sufficient room.
4898            fidl::encoding::encode_in_envelope_optional::<u64, D>(
4899                self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4900                encoder,
4901                offset + cur_offset,
4902                depth,
4903            )?;
4904
4905            _prev_end_offset = cur_offset + envelope_size;
4906
4907            Ok(())
4908        }
4909    }
4910
4911    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfiguration {
4912        #[inline(always)]
4913        fn new_empty() -> Self {
4914            Self::default()
4915        }
4916
4917        unsafe fn decode(
4918            &mut self,
4919            decoder: &mut fidl::encoding::Decoder<'_, D>,
4920            offset: usize,
4921            mut depth: fidl::encoding::Depth,
4922        ) -> fidl::Result<()> {
4923            decoder.debug_check_bounds::<Self>(offset);
4924            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4925                None => return Err(fidl::Error::NotNullable),
4926                Some(len) => len,
4927            };
4928            // Calling decoder.out_of_line_offset(0) is not allowed.
4929            if len == 0 {
4930                return Ok(());
4931            };
4932            depth.increment()?;
4933            let envelope_size = 8;
4934            let bytes_len = len * envelope_size;
4935            let offset = decoder.out_of_line_offset(bytes_len)?;
4936            // Decode the envelope for each type.
4937            let mut _next_ordinal_to_read = 0;
4938            let mut next_offset = offset;
4939            let end_offset = offset + bytes_len;
4940            _next_ordinal_to_read += 1;
4941            if next_offset >= end_offset {
4942                return Ok(());
4943            }
4944
4945            // Decode unknown envelopes for gaps in ordinals.
4946            while _next_ordinal_to_read < 1 {
4947                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4948                _next_ordinal_to_read += 1;
4949                next_offset += envelope_size;
4950            }
4951
4952            let next_out_of_line = decoder.next_out_of_line();
4953            let handles_before = decoder.remaining_handles();
4954            if let Some((inlined, num_bytes, num_handles)) =
4955                fidl::encoding::decode_envelope_header(decoder, next_offset)?
4956            {
4957                let member_inline_size =
4958                    <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4959                if inlined != (member_inline_size <= 4) {
4960                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
4961                }
4962                let inner_offset;
4963                let mut inner_depth = depth.clone();
4964                if inlined {
4965                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4966                    inner_offset = next_offset;
4967                } else {
4968                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4969                    inner_depth.increment()?;
4970                }
4971                let val_ref =
4972                    self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4973                fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4974                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4975                {
4976                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
4977                }
4978                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4979                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4980                }
4981            }
4982
4983            next_offset += envelope_size;
4984            _next_ordinal_to_read += 1;
4985            if next_offset >= end_offset {
4986                return Ok(());
4987            }
4988
4989            // Decode unknown envelopes for gaps in ordinals.
4990            while _next_ordinal_to_read < 2 {
4991                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4992                _next_ordinal_to_read += 1;
4993                next_offset += envelope_size;
4994            }
4995
4996            let next_out_of_line = decoder.next_out_of_line();
4997            let handles_before = decoder.remaining_handles();
4998            if let Some((inlined, num_bytes, num_handles)) =
4999                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5000            {
5001                let member_inline_size =
5002                    <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
5003                        decoder.context,
5004                    );
5005                if inlined != (member_inline_size <= 4) {
5006                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5007                }
5008                let inner_offset;
5009                let mut inner_depth = depth.clone();
5010                if inlined {
5011                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5012                    inner_offset = next_offset;
5013                } else {
5014                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5015                    inner_depth.increment()?;
5016                }
5017                let val_ref = self
5018                    .cipher_oui
5019                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
5020                fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
5021                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5022                {
5023                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5024                }
5025                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5026                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5027                }
5028            }
5029
5030            next_offset += envelope_size;
5031            _next_ordinal_to_read += 1;
5032            if next_offset >= end_offset {
5033                return Ok(());
5034            }
5035
5036            // Decode unknown envelopes for gaps in ordinals.
5037            while _next_ordinal_to_read < 3 {
5038                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5039                _next_ordinal_to_read += 1;
5040                next_offset += envelope_size;
5041            }
5042
5043            let next_out_of_line = decoder.next_out_of_line();
5044            let handles_before = decoder.remaining_handles();
5045            if let Some((inlined, num_bytes, num_handles)) =
5046                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5047            {
5048                let member_inline_size =
5049                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5050                if inlined != (member_inline_size <= 4) {
5051                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5052                }
5053                let inner_offset;
5054                let mut inner_depth = depth.clone();
5055                if inlined {
5056                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5057                    inner_offset = next_offset;
5058                } else {
5059                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5060                    inner_depth.increment()?;
5061                }
5062                let val_ref = self.cipher_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
5063                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
5064                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5065                {
5066                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5067                }
5068                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5069                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5070                }
5071            }
5072
5073            next_offset += envelope_size;
5074            _next_ordinal_to_read += 1;
5075            if next_offset >= end_offset {
5076                return Ok(());
5077            }
5078
5079            // Decode unknown envelopes for gaps in ordinals.
5080            while _next_ordinal_to_read < 4 {
5081                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5082                _next_ordinal_to_read += 1;
5083                next_offset += envelope_size;
5084            }
5085
5086            let next_out_of_line = decoder.next_out_of_line();
5087            let handles_before = decoder.remaining_handles();
5088            if let Some((inlined, num_bytes, num_handles)) =
5089                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5090            {
5091                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::KeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5092                if inlined != (member_inline_size <= 4) {
5093                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5094                }
5095                let inner_offset;
5096                let mut inner_depth = depth.clone();
5097                if inlined {
5098                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5099                    inner_offset = next_offset;
5100                } else {
5101                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5102                    inner_depth.increment()?;
5103                }
5104                let val_ref = self.key_type.get_or_insert_with(|| {
5105                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::KeyType, D)
5106                });
5107                fidl::decode!(
5108                    fidl_fuchsia_wlan_ieee80211__common::KeyType,
5109                    D,
5110                    val_ref,
5111                    decoder,
5112                    inner_offset,
5113                    inner_depth
5114                )?;
5115                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5116                {
5117                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5118                }
5119                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5120                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5121                }
5122            }
5123
5124            next_offset += envelope_size;
5125            _next_ordinal_to_read += 1;
5126            if next_offset >= end_offset {
5127                return Ok(());
5128            }
5129
5130            // Decode unknown envelopes for gaps in ordinals.
5131            while _next_ordinal_to_read < 5 {
5132                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5133                _next_ordinal_to_read += 1;
5134                next_offset += envelope_size;
5135            }
5136
5137            let next_out_of_line = decoder.next_out_of_line();
5138            let handles_before = decoder.remaining_handles();
5139            if let Some((inlined, num_bytes, num_handles)) =
5140                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5141            {
5142                let member_inline_size =
5143                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
5144                        decoder.context,
5145                    );
5146                if inlined != (member_inline_size <= 4) {
5147                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5148                }
5149                let inner_offset;
5150                let mut inner_depth = depth.clone();
5151                if inlined {
5152                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5153                    inner_offset = next_offset;
5154                } else {
5155                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5156                    inner_depth.increment()?;
5157                }
5158                let val_ref = self
5159                    .peer_addr
5160                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
5161                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
5162                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5163                {
5164                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5165                }
5166                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5167                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5168                }
5169            }
5170
5171            next_offset += envelope_size;
5172            _next_ordinal_to_read += 1;
5173            if next_offset >= end_offset {
5174                return Ok(());
5175            }
5176
5177            // Decode unknown envelopes for gaps in ordinals.
5178            while _next_ordinal_to_read < 6 {
5179                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5180                _next_ordinal_to_read += 1;
5181                next_offset += envelope_size;
5182            }
5183
5184            let next_out_of_line = decoder.next_out_of_line();
5185            let handles_before = decoder.remaining_handles();
5186            if let Some((inlined, num_bytes, num_handles)) =
5187                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5188            {
5189                let member_inline_size =
5190                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5191                if inlined != (member_inline_size <= 4) {
5192                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5193                }
5194                let inner_offset;
5195                let mut inner_depth = depth.clone();
5196                if inlined {
5197                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5198                    inner_offset = next_offset;
5199                } else {
5200                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5201                    inner_depth.increment()?;
5202                }
5203                let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
5204                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
5205                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5206                {
5207                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5208                }
5209                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5210                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5211                }
5212            }
5213
5214            next_offset += envelope_size;
5215            _next_ordinal_to_read += 1;
5216            if next_offset >= end_offset {
5217                return Ok(());
5218            }
5219
5220            // Decode unknown envelopes for gaps in ordinals.
5221            while _next_ordinal_to_read < 7 {
5222                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5223                _next_ordinal_to_read += 1;
5224                next_offset += envelope_size;
5225            }
5226
5227            let next_out_of_line = decoder.next_out_of_line();
5228            let handles_before = decoder.remaining_handles();
5229            if let Some((inlined, num_bytes, num_handles)) =
5230                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5231            {
5232                let member_inline_size =
5233                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
5234                        decoder.context,
5235                    );
5236                if inlined != (member_inline_size <= 4) {
5237                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5238                }
5239                let inner_offset;
5240                let mut inner_depth = depth.clone();
5241                if inlined {
5242                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5243                    inner_offset = next_offset;
5244                } else {
5245                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5246                    inner_depth.increment()?;
5247                }
5248                let val_ref = self
5249                    .key
5250                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
5251                fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
5252                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5253                {
5254                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5255                }
5256                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5257                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5258                }
5259            }
5260
5261            next_offset += envelope_size;
5262            _next_ordinal_to_read += 1;
5263            if next_offset >= end_offset {
5264                return Ok(());
5265            }
5266
5267            // Decode unknown envelopes for gaps in ordinals.
5268            while _next_ordinal_to_read < 8 {
5269                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5270                _next_ordinal_to_read += 1;
5271                next_offset += envelope_size;
5272            }
5273
5274            let next_out_of_line = decoder.next_out_of_line();
5275            let handles_before = decoder.remaining_handles();
5276            if let Some((inlined, num_bytes, num_handles)) =
5277                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5278            {
5279                let member_inline_size =
5280                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5281                if inlined != (member_inline_size <= 4) {
5282                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5283                }
5284                let inner_offset;
5285                let mut inner_depth = depth.clone();
5286                if inlined {
5287                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5288                    inner_offset = next_offset;
5289                } else {
5290                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5291                    inner_depth.increment()?;
5292                }
5293                let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
5294                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5295                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5296                {
5297                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5298                }
5299                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5300                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5301                }
5302            }
5303
5304            next_offset += envelope_size;
5305
5306            // Decode the remaining unknown envelopes.
5307            while next_offset < end_offset {
5308                _next_ordinal_to_read += 1;
5309                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5310                next_offset += envelope_size;
5311            }
5312
5313            Ok(())
5314        }
5315    }
5316
5317    impl WlanRxTransferRequest {
5318        #[inline(always)]
5319        fn max_ordinal_present(&self) -> u64 {
5320            if let Some(_) = self.arena {
5321                return 5;
5322            }
5323            if let Some(_) = self.async_id {
5324                return 4;
5325            }
5326            if let Some(_) = self.packet_info {
5327                return 3;
5328            }
5329            if let Some(_) = self.packet_size {
5330                return 2;
5331            }
5332            if let Some(_) = self.packet_address {
5333                return 1;
5334            }
5335            0
5336        }
5337    }
5338
5339    impl fidl::encoding::ValueTypeMarker for WlanRxTransferRequest {
5340        type Borrowed<'a> = &'a Self;
5341        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5342            value
5343        }
5344    }
5345
5346    unsafe impl fidl::encoding::TypeMarker for WlanRxTransferRequest {
5347        type Owned = Self;
5348
5349        #[inline(always)]
5350        fn inline_align(_context: fidl::encoding::Context) -> usize {
5351            8
5352        }
5353
5354        #[inline(always)]
5355        fn inline_size(_context: fidl::encoding::Context) -> usize {
5356            16
5357        }
5358    }
5359
5360    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxTransferRequest, D>
5361        for &WlanRxTransferRequest
5362    {
5363        unsafe fn encode(
5364            self,
5365            encoder: &mut fidl::encoding::Encoder<'_, D>,
5366            offset: usize,
5367            mut depth: fidl::encoding::Depth,
5368        ) -> fidl::Result<()> {
5369            encoder.debug_check_bounds::<WlanRxTransferRequest>(offset);
5370            // Vector header
5371            let max_ordinal: u64 = self.max_ordinal_present();
5372            encoder.write_num(max_ordinal, offset);
5373            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5374            // Calling encoder.out_of_line_offset(0) is not allowed.
5375            if max_ordinal == 0 {
5376                return Ok(());
5377            }
5378            depth.increment()?;
5379            let envelope_size = 8;
5380            let bytes_len = max_ordinal as usize * envelope_size;
5381            #[allow(unused_variables)]
5382            let offset = encoder.out_of_line_offset(bytes_len);
5383            let mut _prev_end_offset: usize = 0;
5384            if 1 > max_ordinal {
5385                return Ok(());
5386            }
5387
5388            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5389            // are envelope_size bytes.
5390            let cur_offset: usize = (1 - 1) * envelope_size;
5391
5392            // Zero reserved fields.
5393            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5394
5395            // Safety:
5396            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5397            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5398            //   envelope_size bytes, there is always sufficient room.
5399            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5400                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5401                encoder,
5402                offset + cur_offset,
5403                depth,
5404            )?;
5405
5406            _prev_end_offset = cur_offset + envelope_size;
5407            if 2 > max_ordinal {
5408                return Ok(());
5409            }
5410
5411            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5412            // are envelope_size bytes.
5413            let cur_offset: usize = (2 - 1) * envelope_size;
5414
5415            // Zero reserved fields.
5416            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5417
5418            // Safety:
5419            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5420            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5421            //   envelope_size bytes, there is always sufficient room.
5422            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5423                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5424                encoder,
5425                offset + cur_offset,
5426                depth,
5427            )?;
5428
5429            _prev_end_offset = cur_offset + envelope_size;
5430            if 3 > max_ordinal {
5431                return Ok(());
5432            }
5433
5434            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5435            // are envelope_size bytes.
5436            let cur_offset: usize = (3 - 1) * envelope_size;
5437
5438            // Zero reserved fields.
5439            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5440
5441            // Safety:
5442            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5443            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5444            //   envelope_size bytes, there is always sufficient room.
5445            fidl::encoding::encode_in_envelope_optional::<WlanRxInfo, D>(
5446                self.packet_info
5447                    .as_ref()
5448                    .map(<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow),
5449                encoder,
5450                offset + cur_offset,
5451                depth,
5452            )?;
5453
5454            _prev_end_offset = cur_offset + envelope_size;
5455            if 4 > max_ordinal {
5456                return Ok(());
5457            }
5458
5459            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5460            // are envelope_size bytes.
5461            let cur_offset: usize = (4 - 1) * envelope_size;
5462
5463            // Zero reserved fields.
5464            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5465
5466            // Safety:
5467            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5468            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5469            //   envelope_size bytes, there is always sufficient room.
5470            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5471                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5472                encoder,
5473                offset + cur_offset,
5474                depth,
5475            )?;
5476
5477            _prev_end_offset = cur_offset + envelope_size;
5478            if 5 > max_ordinal {
5479                return Ok(());
5480            }
5481
5482            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5483            // are envelope_size bytes.
5484            let cur_offset: usize = (5 - 1) * envelope_size;
5485
5486            // Zero reserved fields.
5487            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5488
5489            // Safety:
5490            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5491            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5492            //   envelope_size bytes, there is always sufficient room.
5493            fidl::encoding::encode_in_envelope_optional::<u64, D>(
5494                self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
5495                encoder,
5496                offset + cur_offset,
5497                depth,
5498            )?;
5499
5500            _prev_end_offset = cur_offset + envelope_size;
5501
5502            Ok(())
5503        }
5504    }
5505
5506    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxTransferRequest {
5507        #[inline(always)]
5508        fn new_empty() -> Self {
5509            Self::default()
5510        }
5511
5512        unsafe fn decode(
5513            &mut self,
5514            decoder: &mut fidl::encoding::Decoder<'_, D>,
5515            offset: usize,
5516            mut depth: fidl::encoding::Depth,
5517        ) -> fidl::Result<()> {
5518            decoder.debug_check_bounds::<Self>(offset);
5519            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
5520                None => return Err(fidl::Error::NotNullable),
5521                Some(len) => len,
5522            };
5523            // Calling decoder.out_of_line_offset(0) is not allowed.
5524            if len == 0 {
5525                return Ok(());
5526            };
5527            depth.increment()?;
5528            let envelope_size = 8;
5529            let bytes_len = len * envelope_size;
5530            let offset = decoder.out_of_line_offset(bytes_len)?;
5531            // Decode the envelope for each type.
5532            let mut _next_ordinal_to_read = 0;
5533            let mut next_offset = offset;
5534            let end_offset = offset + bytes_len;
5535            _next_ordinal_to_read += 1;
5536            if next_offset >= end_offset {
5537                return Ok(());
5538            }
5539
5540            // Decode unknown envelopes for gaps in ordinals.
5541            while _next_ordinal_to_read < 1 {
5542                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5543                _next_ordinal_to_read += 1;
5544                next_offset += envelope_size;
5545            }
5546
5547            let next_out_of_line = decoder.next_out_of_line();
5548            let handles_before = decoder.remaining_handles();
5549            if let Some((inlined, num_bytes, num_handles)) =
5550                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5551            {
5552                let member_inline_size =
5553                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5554                if inlined != (member_inline_size <= 4) {
5555                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5556                }
5557                let inner_offset;
5558                let mut inner_depth = depth.clone();
5559                if inlined {
5560                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5561                    inner_offset = next_offset;
5562                } else {
5563                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5564                    inner_depth.increment()?;
5565                }
5566                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
5567                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5568                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5569                {
5570                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5571                }
5572                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5573                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5574                }
5575            }
5576
5577            next_offset += envelope_size;
5578            _next_ordinal_to_read += 1;
5579            if next_offset >= end_offset {
5580                return Ok(());
5581            }
5582
5583            // Decode unknown envelopes for gaps in ordinals.
5584            while _next_ordinal_to_read < 2 {
5585                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5586                _next_ordinal_to_read += 1;
5587                next_offset += envelope_size;
5588            }
5589
5590            let next_out_of_line = decoder.next_out_of_line();
5591            let handles_before = decoder.remaining_handles();
5592            if let Some((inlined, num_bytes, num_handles)) =
5593                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5594            {
5595                let member_inline_size =
5596                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5597                if inlined != (member_inline_size <= 4) {
5598                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5599                }
5600                let inner_offset;
5601                let mut inner_depth = depth.clone();
5602                if inlined {
5603                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5604                    inner_offset = next_offset;
5605                } else {
5606                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5607                    inner_depth.increment()?;
5608                }
5609                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
5610                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5611                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5612                {
5613                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5614                }
5615                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5616                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5617                }
5618            }
5619
5620            next_offset += envelope_size;
5621            _next_ordinal_to_read += 1;
5622            if next_offset >= end_offset {
5623                return Ok(());
5624            }
5625
5626            // Decode unknown envelopes for gaps in ordinals.
5627            while _next_ordinal_to_read < 3 {
5628                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5629                _next_ordinal_to_read += 1;
5630                next_offset += envelope_size;
5631            }
5632
5633            let next_out_of_line = decoder.next_out_of_line();
5634            let handles_before = decoder.remaining_handles();
5635            if let Some((inlined, num_bytes, num_handles)) =
5636                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5637            {
5638                let member_inline_size =
5639                    <WlanRxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5640                if inlined != (member_inline_size <= 4) {
5641                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5642                }
5643                let inner_offset;
5644                let mut inner_depth = depth.clone();
5645                if inlined {
5646                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5647                    inner_offset = next_offset;
5648                } else {
5649                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5650                    inner_depth.increment()?;
5651                }
5652                let val_ref =
5653                    self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanRxInfo, D));
5654                fidl::decode!(WlanRxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
5655                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5656                {
5657                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5658                }
5659                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5660                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5661                }
5662            }
5663
5664            next_offset += envelope_size;
5665            _next_ordinal_to_read += 1;
5666            if next_offset >= end_offset {
5667                return Ok(());
5668            }
5669
5670            // Decode unknown envelopes for gaps in ordinals.
5671            while _next_ordinal_to_read < 4 {
5672                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5673                _next_ordinal_to_read += 1;
5674                next_offset += envelope_size;
5675            }
5676
5677            let next_out_of_line = decoder.next_out_of_line();
5678            let handles_before = decoder.remaining_handles();
5679            if let Some((inlined, num_bytes, num_handles)) =
5680                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5681            {
5682                let member_inline_size =
5683                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5684                if inlined != (member_inline_size <= 4) {
5685                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5686                }
5687                let inner_offset;
5688                let mut inner_depth = depth.clone();
5689                if inlined {
5690                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5691                    inner_offset = next_offset;
5692                } else {
5693                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5694                    inner_depth.increment()?;
5695                }
5696                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
5697                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5698                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5699                {
5700                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5701                }
5702                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5703                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5704                }
5705            }
5706
5707            next_offset += envelope_size;
5708            _next_ordinal_to_read += 1;
5709            if next_offset >= end_offset {
5710                return Ok(());
5711            }
5712
5713            // Decode unknown envelopes for gaps in ordinals.
5714            while _next_ordinal_to_read < 5 {
5715                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5716                _next_ordinal_to_read += 1;
5717                next_offset += envelope_size;
5718            }
5719
5720            let next_out_of_line = decoder.next_out_of_line();
5721            let handles_before = decoder.remaining_handles();
5722            if let Some((inlined, num_bytes, num_handles)) =
5723                fidl::encoding::decode_envelope_header(decoder, next_offset)?
5724            {
5725                let member_inline_size =
5726                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
5727                if inlined != (member_inline_size <= 4) {
5728                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
5729                }
5730                let inner_offset;
5731                let mut inner_depth = depth.clone();
5732                if inlined {
5733                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
5734                    inner_offset = next_offset;
5735                } else {
5736                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
5737                    inner_depth.increment()?;
5738                }
5739                let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
5740                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
5741                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
5742                {
5743                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
5744                }
5745                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
5746                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
5747                }
5748            }
5749
5750            next_offset += envelope_size;
5751
5752            // Decode the remaining unknown envelopes.
5753            while next_offset < end_offset {
5754                _next_ordinal_to_read += 1;
5755                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
5756                next_offset += envelope_size;
5757            }
5758
5759            Ok(())
5760        }
5761    }
5762
5763    impl WlanSoftmacBandCapability {
5764        #[inline(always)]
5765        fn max_ordinal_present(&self) -> u64 {
5766            if let Some(_) = self.operating_channels {
5767                return 11;
5768            }
5769            if let Some(_) = self.basic_rates {
5770                return 10;
5771            }
5772            if let Some(_) = self.operating_channel_list {
5773                return 9;
5774            }
5775            if let Some(_) = self.operating_channel_count {
5776                return 8;
5777            }
5778            if let Some(_) = self.vht_caps {
5779                return 7;
5780            }
5781            if let Some(_) = self.vht_supported {
5782                return 6;
5783            }
5784            if let Some(_) = self.ht_caps {
5785                return 5;
5786            }
5787            if let Some(_) = self.ht_supported {
5788                return 4;
5789            }
5790            if let Some(_) = self.basic_rate_list {
5791                return 3;
5792            }
5793            if let Some(_) = self.basic_rate_count {
5794                return 2;
5795            }
5796            if let Some(_) = self.band {
5797                return 1;
5798            }
5799            0
5800        }
5801    }
5802
5803    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBandCapability {
5804        type Borrowed<'a> = &'a Self;
5805        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
5806            value
5807        }
5808    }
5809
5810    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBandCapability {
5811        type Owned = Self;
5812
5813        #[inline(always)]
5814        fn inline_align(_context: fidl::encoding::Context) -> usize {
5815            8
5816        }
5817
5818        #[inline(always)]
5819        fn inline_size(_context: fidl::encoding::Context) -> usize {
5820            16
5821        }
5822    }
5823
5824    unsafe impl<D: fidl::encoding::ResourceDialect>
5825        fidl::encoding::Encode<WlanSoftmacBandCapability, D> for &WlanSoftmacBandCapability
5826    {
5827        unsafe fn encode(
5828            self,
5829            encoder: &mut fidl::encoding::Encoder<'_, D>,
5830            offset: usize,
5831            mut depth: fidl::encoding::Depth,
5832        ) -> fidl::Result<()> {
5833            encoder.debug_check_bounds::<WlanSoftmacBandCapability>(offset);
5834            // Vector header
5835            let max_ordinal: u64 = self.max_ordinal_present();
5836            encoder.write_num(max_ordinal, offset);
5837            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
5838            // Calling encoder.out_of_line_offset(0) is not allowed.
5839            if max_ordinal == 0 {
5840                return Ok(());
5841            }
5842            depth.increment()?;
5843            let envelope_size = 8;
5844            let bytes_len = max_ordinal as usize * envelope_size;
5845            #[allow(unused_variables)]
5846            let offset = encoder.out_of_line_offset(bytes_len);
5847            let mut _prev_end_offset: usize = 0;
5848            if 1 > max_ordinal {
5849                return Ok(());
5850            }
5851
5852            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5853            // are envelope_size bytes.
5854            let cur_offset: usize = (1 - 1) * envelope_size;
5855
5856            // Zero reserved fields.
5857            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5858
5859            // Safety:
5860            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5861            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5862            //   envelope_size bytes, there is always sufficient room.
5863            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanBand, D>(
5864            self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
5865            encoder, offset + cur_offset, depth
5866        )?;
5867
5868            _prev_end_offset = cur_offset + envelope_size;
5869            if 2 > max_ordinal {
5870                return Ok(());
5871            }
5872
5873            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5874            // are envelope_size bytes.
5875            let cur_offset: usize = (2 - 1) * envelope_size;
5876
5877            // Zero reserved fields.
5878            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5879
5880            // Safety:
5881            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5882            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5883            //   envelope_size bytes, there is always sufficient room.
5884            fidl::encoding::encode_in_envelope_optional::<u8, D>(
5885                self.basic_rate_count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
5886                encoder,
5887                offset + cur_offset,
5888                depth,
5889            )?;
5890
5891            _prev_end_offset = cur_offset + envelope_size;
5892            if 3 > max_ordinal {
5893                return Ok(());
5894            }
5895
5896            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5897            // are envelope_size bytes.
5898            let cur_offset: usize = (3 - 1) * envelope_size;
5899
5900            // Zero reserved fields.
5901            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5902
5903            // Safety:
5904            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5905            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5906            //   envelope_size bytes, there is always sufficient room.
5907            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 12>, D>(
5908                self.basic_rate_list.as_ref().map(
5909                    <fidl::encoding::Array<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
5910                ),
5911                encoder,
5912                offset + cur_offset,
5913                depth,
5914            )?;
5915
5916            _prev_end_offset = cur_offset + envelope_size;
5917            if 4 > max_ordinal {
5918                return Ok(());
5919            }
5920
5921            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5922            // are envelope_size bytes.
5923            let cur_offset: usize = (4 - 1) * envelope_size;
5924
5925            // Zero reserved fields.
5926            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5927
5928            // Safety:
5929            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5930            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5931            //   envelope_size bytes, there is always sufficient room.
5932            fidl::encoding::encode_in_envelope_optional::<bool, D>(
5933                self.ht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5934                encoder,
5935                offset + cur_offset,
5936                depth,
5937            )?;
5938
5939            _prev_end_offset = cur_offset + envelope_size;
5940            if 5 > max_ordinal {
5941                return Ok(());
5942            }
5943
5944            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5945            // are envelope_size bytes.
5946            let cur_offset: usize = (5 - 1) * envelope_size;
5947
5948            // Zero reserved fields.
5949            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5950
5951            // Safety:
5952            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5953            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5954            //   envelope_size bytes, there is always sufficient room.
5955            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D>(
5956            self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
5957            encoder, offset + cur_offset, depth
5958        )?;
5959
5960            _prev_end_offset = cur_offset + envelope_size;
5961            if 6 > max_ordinal {
5962                return Ok(());
5963            }
5964
5965            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5966            // are envelope_size bytes.
5967            let cur_offset: usize = (6 - 1) * envelope_size;
5968
5969            // Zero reserved fields.
5970            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5971
5972            // Safety:
5973            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5974            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5975            //   envelope_size bytes, there is always sufficient room.
5976            fidl::encoding::encode_in_envelope_optional::<bool, D>(
5977                self.vht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
5978                encoder,
5979                offset + cur_offset,
5980                depth,
5981            )?;
5982
5983            _prev_end_offset = cur_offset + envelope_size;
5984            if 7 > max_ordinal {
5985                return Ok(());
5986            }
5987
5988            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
5989            // are envelope_size bytes.
5990            let cur_offset: usize = (7 - 1) * envelope_size;
5991
5992            // Zero reserved fields.
5993            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
5994
5995            // Safety:
5996            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
5997            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
5998            //   envelope_size bytes, there is always sufficient room.
5999            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D>(
6000            self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
6001            encoder, offset + cur_offset, depth
6002        )?;
6003
6004            _prev_end_offset = cur_offset + envelope_size;
6005            if 8 > max_ordinal {
6006                return Ok(());
6007            }
6008
6009            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6010            // are envelope_size bytes.
6011            let cur_offset: usize = (8 - 1) * envelope_size;
6012
6013            // Zero reserved fields.
6014            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6015
6016            // Safety:
6017            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6018            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6019            //   envelope_size bytes, there is always sufficient room.
6020            fidl::encoding::encode_in_envelope_optional::<u16, D>(
6021                self.operating_channel_count
6022                    .as_ref()
6023                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
6024                encoder,
6025                offset + cur_offset,
6026                depth,
6027            )?;
6028
6029            _prev_end_offset = cur_offset + envelope_size;
6030            if 9 > max_ordinal {
6031                return Ok(());
6032            }
6033
6034            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6035            // are envelope_size bytes.
6036            let cur_offset: usize = (9 - 1) * envelope_size;
6037
6038            // Zero reserved fields.
6039            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6040
6041            // Safety:
6042            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6043            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6044            //   envelope_size bytes, there is always sufficient room.
6045            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 256>, D>(
6046                self.operating_channel_list.as_ref().map(
6047                    <fidl::encoding::Array<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
6048                ),
6049                encoder,
6050                offset + cur_offset,
6051                depth,
6052            )?;
6053
6054            _prev_end_offset = cur_offset + envelope_size;
6055            if 10 > max_ordinal {
6056                return Ok(());
6057            }
6058
6059            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6060            // are envelope_size bytes.
6061            let cur_offset: usize = (10 - 1) * envelope_size;
6062
6063            // Zero reserved fields.
6064            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6065
6066            // Safety:
6067            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6068            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6069            //   envelope_size bytes, there is always sufficient room.
6070            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
6071                self.basic_rates.as_ref().map(
6072                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
6073                ),
6074                encoder,
6075                offset + cur_offset,
6076                depth,
6077            )?;
6078
6079            _prev_end_offset = cur_offset + envelope_size;
6080            if 11 > max_ordinal {
6081                return Ok(());
6082            }
6083
6084            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6085            // are envelope_size bytes.
6086            let cur_offset: usize = (11 - 1) * envelope_size;
6087
6088            // Zero reserved fields.
6089            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6090
6091            // Safety:
6092            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6093            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6094            //   envelope_size bytes, there is always sufficient room.
6095            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
6096                self.operating_channels.as_ref().map(
6097                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
6098                ),
6099                encoder,
6100                offset + cur_offset,
6101                depth,
6102            )?;
6103
6104            _prev_end_offset = cur_offset + envelope_size;
6105
6106            Ok(())
6107        }
6108    }
6109
6110    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6111        for WlanSoftmacBandCapability
6112    {
6113        #[inline(always)]
6114        fn new_empty() -> Self {
6115            Self::default()
6116        }
6117
6118        unsafe fn decode(
6119            &mut self,
6120            decoder: &mut fidl::encoding::Decoder<'_, D>,
6121            offset: usize,
6122            mut depth: fidl::encoding::Depth,
6123        ) -> fidl::Result<()> {
6124            decoder.debug_check_bounds::<Self>(offset);
6125            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6126                None => return Err(fidl::Error::NotNullable),
6127                Some(len) => len,
6128            };
6129            // Calling decoder.out_of_line_offset(0) is not allowed.
6130            if len == 0 {
6131                return Ok(());
6132            };
6133            depth.increment()?;
6134            let envelope_size = 8;
6135            let bytes_len = len * envelope_size;
6136            let offset = decoder.out_of_line_offset(bytes_len)?;
6137            // Decode the envelope for each type.
6138            let mut _next_ordinal_to_read = 0;
6139            let mut next_offset = offset;
6140            let end_offset = offset + bytes_len;
6141            _next_ordinal_to_read += 1;
6142            if next_offset >= end_offset {
6143                return Ok(());
6144            }
6145
6146            // Decode unknown envelopes for gaps in ordinals.
6147            while _next_ordinal_to_read < 1 {
6148                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6149                _next_ordinal_to_read += 1;
6150                next_offset += envelope_size;
6151            }
6152
6153            let next_out_of_line = decoder.next_out_of_line();
6154            let handles_before = decoder.remaining_handles();
6155            if let Some((inlined, num_bytes, num_handles)) =
6156                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6157            {
6158                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6159                if inlined != (member_inline_size <= 4) {
6160                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6161                }
6162                let inner_offset;
6163                let mut inner_depth = depth.clone();
6164                if inlined {
6165                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6166                    inner_offset = next_offset;
6167                } else {
6168                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6169                    inner_depth.increment()?;
6170                }
6171                let val_ref = self.band.get_or_insert_with(|| {
6172                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanBand, D)
6173                });
6174                fidl::decode!(
6175                    fidl_fuchsia_wlan_ieee80211__common::WlanBand,
6176                    D,
6177                    val_ref,
6178                    decoder,
6179                    inner_offset,
6180                    inner_depth
6181                )?;
6182                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6183                {
6184                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6185                }
6186                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6187                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6188                }
6189            }
6190
6191            next_offset += envelope_size;
6192            _next_ordinal_to_read += 1;
6193            if next_offset >= end_offset {
6194                return Ok(());
6195            }
6196
6197            // Decode unknown envelopes for gaps in ordinals.
6198            while _next_ordinal_to_read < 2 {
6199                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6200                _next_ordinal_to_read += 1;
6201                next_offset += envelope_size;
6202            }
6203
6204            let next_out_of_line = decoder.next_out_of_line();
6205            let handles_before = decoder.remaining_handles();
6206            if let Some((inlined, num_bytes, num_handles)) =
6207                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6208            {
6209                let member_inline_size =
6210                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6211                if inlined != (member_inline_size <= 4) {
6212                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6213                }
6214                let inner_offset;
6215                let mut inner_depth = depth.clone();
6216                if inlined {
6217                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6218                    inner_offset = next_offset;
6219                } else {
6220                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6221                    inner_depth.increment()?;
6222                }
6223                let val_ref = self.basic_rate_count.get_or_insert_with(|| fidl::new_empty!(u8, D));
6224                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
6225                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6226                {
6227                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6228                }
6229                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6230                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6231                }
6232            }
6233
6234            next_offset += envelope_size;
6235            _next_ordinal_to_read += 1;
6236            if next_offset >= end_offset {
6237                return Ok(());
6238            }
6239
6240            // Decode unknown envelopes for gaps in ordinals.
6241            while _next_ordinal_to_read < 3 {
6242                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6243                _next_ordinal_to_read += 1;
6244                next_offset += envelope_size;
6245            }
6246
6247            let next_out_of_line = decoder.next_out_of_line();
6248            let handles_before = decoder.remaining_handles();
6249            if let Some((inlined, num_bytes, num_handles)) =
6250                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6251            {
6252                let member_inline_size =
6253                    <fidl::encoding::Array<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
6254                        decoder.context,
6255                    );
6256                if inlined != (member_inline_size <= 4) {
6257                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6258                }
6259                let inner_offset;
6260                let mut inner_depth = depth.clone();
6261                if inlined {
6262                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6263                    inner_offset = next_offset;
6264                } else {
6265                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6266                    inner_depth.increment()?;
6267                }
6268                let val_ref = self
6269                    .basic_rate_list
6270                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 12>, D));
6271                fidl::decode!(fidl::encoding::Array<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
6272                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6273                {
6274                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6275                }
6276                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6277                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6278                }
6279            }
6280
6281            next_offset += envelope_size;
6282            _next_ordinal_to_read += 1;
6283            if next_offset >= end_offset {
6284                return Ok(());
6285            }
6286
6287            // Decode unknown envelopes for gaps in ordinals.
6288            while _next_ordinal_to_read < 4 {
6289                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6290                _next_ordinal_to_read += 1;
6291                next_offset += envelope_size;
6292            }
6293
6294            let next_out_of_line = decoder.next_out_of_line();
6295            let handles_before = decoder.remaining_handles();
6296            if let Some((inlined, num_bytes, num_handles)) =
6297                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6298            {
6299                let member_inline_size =
6300                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6301                if inlined != (member_inline_size <= 4) {
6302                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6303                }
6304                let inner_offset;
6305                let mut inner_depth = depth.clone();
6306                if inlined {
6307                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6308                    inner_offset = next_offset;
6309                } else {
6310                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6311                    inner_depth.increment()?;
6312                }
6313                let val_ref = self.ht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
6314                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6315                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6316                {
6317                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6318                }
6319                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6320                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6321                }
6322            }
6323
6324            next_offset += envelope_size;
6325            _next_ordinal_to_read += 1;
6326            if next_offset >= end_offset {
6327                return Ok(());
6328            }
6329
6330            // Decode unknown envelopes for gaps in ordinals.
6331            while _next_ordinal_to_read < 5 {
6332                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6333                _next_ordinal_to_read += 1;
6334                next_offset += envelope_size;
6335            }
6336
6337            let next_out_of_line = decoder.next_out_of_line();
6338            let handles_before = decoder.remaining_handles();
6339            if let Some((inlined, num_bytes, num_handles)) =
6340                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6341            {
6342                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6343                if inlined != (member_inline_size <= 4) {
6344                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6345                }
6346                let inner_offset;
6347                let mut inner_depth = depth.clone();
6348                if inlined {
6349                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6350                    inner_offset = next_offset;
6351                } else {
6352                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6353                    inner_depth.increment()?;
6354                }
6355                let val_ref = self.ht_caps.get_or_insert_with(|| {
6356                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::HtCapabilities, D)
6357                });
6358                fidl::decode!(
6359                    fidl_fuchsia_wlan_ieee80211__common::HtCapabilities,
6360                    D,
6361                    val_ref,
6362                    decoder,
6363                    inner_offset,
6364                    inner_depth
6365                )?;
6366                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6367                {
6368                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6369                }
6370                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6371                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6372                }
6373            }
6374
6375            next_offset += envelope_size;
6376            _next_ordinal_to_read += 1;
6377            if next_offset >= end_offset {
6378                return Ok(());
6379            }
6380
6381            // Decode unknown envelopes for gaps in ordinals.
6382            while _next_ordinal_to_read < 6 {
6383                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6384                _next_ordinal_to_read += 1;
6385                next_offset += envelope_size;
6386            }
6387
6388            let next_out_of_line = decoder.next_out_of_line();
6389            let handles_before = decoder.remaining_handles();
6390            if let Some((inlined, num_bytes, num_handles)) =
6391                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6392            {
6393                let member_inline_size =
6394                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6395                if inlined != (member_inline_size <= 4) {
6396                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6397                }
6398                let inner_offset;
6399                let mut inner_depth = depth.clone();
6400                if inlined {
6401                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6402                    inner_offset = next_offset;
6403                } else {
6404                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6405                    inner_depth.increment()?;
6406                }
6407                let val_ref = self.vht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
6408                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
6409                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6410                {
6411                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6412                }
6413                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6414                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6415                }
6416            }
6417
6418            next_offset += envelope_size;
6419            _next_ordinal_to_read += 1;
6420            if next_offset >= end_offset {
6421                return Ok(());
6422            }
6423
6424            // Decode unknown envelopes for gaps in ordinals.
6425            while _next_ordinal_to_read < 7 {
6426                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6427                _next_ordinal_to_read += 1;
6428                next_offset += envelope_size;
6429            }
6430
6431            let next_out_of_line = decoder.next_out_of_line();
6432            let handles_before = decoder.remaining_handles();
6433            if let Some((inlined, num_bytes, num_handles)) =
6434                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6435            {
6436                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6437                if inlined != (member_inline_size <= 4) {
6438                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6439                }
6440                let inner_offset;
6441                let mut inner_depth = depth.clone();
6442                if inlined {
6443                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6444                    inner_offset = next_offset;
6445                } else {
6446                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6447                    inner_depth.increment()?;
6448                }
6449                let val_ref = self.vht_caps.get_or_insert_with(|| {
6450                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities, D)
6451                });
6452                fidl::decode!(
6453                    fidl_fuchsia_wlan_ieee80211__common::VhtCapabilities,
6454                    D,
6455                    val_ref,
6456                    decoder,
6457                    inner_offset,
6458                    inner_depth
6459                )?;
6460                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6461                {
6462                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6463                }
6464                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6465                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6466                }
6467            }
6468
6469            next_offset += envelope_size;
6470            _next_ordinal_to_read += 1;
6471            if next_offset >= end_offset {
6472                return Ok(());
6473            }
6474
6475            // Decode unknown envelopes for gaps in ordinals.
6476            while _next_ordinal_to_read < 8 {
6477                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6478                _next_ordinal_to_read += 1;
6479                next_offset += envelope_size;
6480            }
6481
6482            let next_out_of_line = decoder.next_out_of_line();
6483            let handles_before = decoder.remaining_handles();
6484            if let Some((inlined, num_bytes, num_handles)) =
6485                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6486            {
6487                let member_inline_size =
6488                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6489                if inlined != (member_inline_size <= 4) {
6490                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6491                }
6492                let inner_offset;
6493                let mut inner_depth = depth.clone();
6494                if inlined {
6495                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6496                    inner_offset = next_offset;
6497                } else {
6498                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6499                    inner_depth.increment()?;
6500                }
6501                let val_ref =
6502                    self.operating_channel_count.get_or_insert_with(|| fidl::new_empty!(u16, D));
6503                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
6504                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6505                {
6506                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6507                }
6508                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6509                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6510                }
6511            }
6512
6513            next_offset += envelope_size;
6514            _next_ordinal_to_read += 1;
6515            if next_offset >= end_offset {
6516                return Ok(());
6517            }
6518
6519            // Decode unknown envelopes for gaps in ordinals.
6520            while _next_ordinal_to_read < 9 {
6521                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6522                _next_ordinal_to_read += 1;
6523                next_offset += envelope_size;
6524            }
6525
6526            let next_out_of_line = decoder.next_out_of_line();
6527            let handles_before = decoder.remaining_handles();
6528            if let Some((inlined, num_bytes, num_handles)) =
6529                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6530            {
6531                let member_inline_size =
6532                    <fidl::encoding::Array<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6533                        decoder.context,
6534                    );
6535                if inlined != (member_inline_size <= 4) {
6536                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6537                }
6538                let inner_offset;
6539                let mut inner_depth = depth.clone();
6540                if inlined {
6541                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6542                    inner_offset = next_offset;
6543                } else {
6544                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6545                    inner_depth.increment()?;
6546                }
6547                let val_ref = self
6548                    .operating_channel_list
6549                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 256>, D));
6550                fidl::decode!(fidl::encoding::Array<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6551                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6552                {
6553                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6554                }
6555                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6556                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6557                }
6558            }
6559
6560            next_offset += envelope_size;
6561            _next_ordinal_to_read += 1;
6562            if next_offset >= end_offset {
6563                return Ok(());
6564            }
6565
6566            // Decode unknown envelopes for gaps in ordinals.
6567            while _next_ordinal_to_read < 10 {
6568                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6569                _next_ordinal_to_read += 1;
6570                next_offset += envelope_size;
6571            }
6572
6573            let next_out_of_line = decoder.next_out_of_line();
6574            let handles_before = decoder.remaining_handles();
6575            if let Some((inlined, num_bytes, num_handles)) =
6576                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6577            {
6578                let member_inline_size =
6579                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
6580                        decoder.context,
6581                    );
6582                if inlined != (member_inline_size <= 4) {
6583                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6584                }
6585                let inner_offset;
6586                let mut inner_depth = depth.clone();
6587                if inlined {
6588                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6589                    inner_offset = next_offset;
6590                } else {
6591                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6592                    inner_depth.increment()?;
6593                }
6594                let val_ref = self
6595                    .basic_rates
6596                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
6597                fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
6598                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6599                {
6600                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6601                }
6602                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6603                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6604                }
6605            }
6606
6607            next_offset += envelope_size;
6608            _next_ordinal_to_read += 1;
6609            if next_offset >= end_offset {
6610                return Ok(());
6611            }
6612
6613            // Decode unknown envelopes for gaps in ordinals.
6614            while _next_ordinal_to_read < 11 {
6615                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6616                _next_ordinal_to_read += 1;
6617                next_offset += envelope_size;
6618            }
6619
6620            let next_out_of_line = decoder.next_out_of_line();
6621            let handles_before = decoder.remaining_handles();
6622            if let Some((inlined, num_bytes, num_handles)) =
6623                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6624            {
6625                let member_inline_size =
6626                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
6627                        decoder.context,
6628                    );
6629                if inlined != (member_inline_size <= 4) {
6630                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6631                }
6632                let inner_offset;
6633                let mut inner_depth = depth.clone();
6634                if inlined {
6635                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6636                    inner_offset = next_offset;
6637                } else {
6638                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6639                    inner_depth.increment()?;
6640                }
6641                let val_ref = self
6642                    .operating_channels
6643                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
6644                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
6645                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6646                {
6647                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6648                }
6649                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6650                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6651                }
6652            }
6653
6654            next_offset += envelope_size;
6655
6656            // Decode the remaining unknown envelopes.
6657            while next_offset < end_offset {
6658                _next_ordinal_to_read += 1;
6659                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6660                next_offset += envelope_size;
6661            }
6662
6663            Ok(())
6664        }
6665    }
6666
6667    impl WlanSoftmacBaseCancelScanRequest {
6668        #[inline(always)]
6669        fn max_ordinal_present(&self) -> u64 {
6670            if let Some(_) = self.scan_id {
6671                return 1;
6672            }
6673            0
6674        }
6675    }
6676
6677    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseCancelScanRequest {
6678        type Borrowed<'a> = &'a Self;
6679        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6680            value
6681        }
6682    }
6683
6684    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseCancelScanRequest {
6685        type Owned = Self;
6686
6687        #[inline(always)]
6688        fn inline_align(_context: fidl::encoding::Context) -> usize {
6689            8
6690        }
6691
6692        #[inline(always)]
6693        fn inline_size(_context: fidl::encoding::Context) -> usize {
6694            16
6695        }
6696    }
6697
6698    unsafe impl<D: fidl::encoding::ResourceDialect>
6699        fidl::encoding::Encode<WlanSoftmacBaseCancelScanRequest, D>
6700        for &WlanSoftmacBaseCancelScanRequest
6701    {
6702        unsafe fn encode(
6703            self,
6704            encoder: &mut fidl::encoding::Encoder<'_, D>,
6705            offset: usize,
6706            mut depth: fidl::encoding::Depth,
6707        ) -> fidl::Result<()> {
6708            encoder.debug_check_bounds::<WlanSoftmacBaseCancelScanRequest>(offset);
6709            // Vector header
6710            let max_ordinal: u64 = self.max_ordinal_present();
6711            encoder.write_num(max_ordinal, offset);
6712            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6713            // Calling encoder.out_of_line_offset(0) is not allowed.
6714            if max_ordinal == 0 {
6715                return Ok(());
6716            }
6717            depth.increment()?;
6718            let envelope_size = 8;
6719            let bytes_len = max_ordinal as usize * envelope_size;
6720            #[allow(unused_variables)]
6721            let offset = encoder.out_of_line_offset(bytes_len);
6722            let mut _prev_end_offset: usize = 0;
6723            if 1 > max_ordinal {
6724                return Ok(());
6725            }
6726
6727            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6728            // are envelope_size bytes.
6729            let cur_offset: usize = (1 - 1) * envelope_size;
6730
6731            // Zero reserved fields.
6732            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6733
6734            // Safety:
6735            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6736            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6737            //   envelope_size bytes, there is always sufficient room.
6738            fidl::encoding::encode_in_envelope_optional::<u64, D>(
6739                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
6740                encoder,
6741                offset + cur_offset,
6742                depth,
6743            )?;
6744
6745            _prev_end_offset = cur_offset + envelope_size;
6746
6747            Ok(())
6748        }
6749    }
6750
6751    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6752        for WlanSoftmacBaseCancelScanRequest
6753    {
6754        #[inline(always)]
6755        fn new_empty() -> Self {
6756            Self::default()
6757        }
6758
6759        unsafe fn decode(
6760            &mut self,
6761            decoder: &mut fidl::encoding::Decoder<'_, D>,
6762            offset: usize,
6763            mut depth: fidl::encoding::Depth,
6764        ) -> fidl::Result<()> {
6765            decoder.debug_check_bounds::<Self>(offset);
6766            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6767                None => return Err(fidl::Error::NotNullable),
6768                Some(len) => len,
6769            };
6770            // Calling decoder.out_of_line_offset(0) is not allowed.
6771            if len == 0 {
6772                return Ok(());
6773            };
6774            depth.increment()?;
6775            let envelope_size = 8;
6776            let bytes_len = len * envelope_size;
6777            let offset = decoder.out_of_line_offset(bytes_len)?;
6778            // Decode the envelope for each type.
6779            let mut _next_ordinal_to_read = 0;
6780            let mut next_offset = offset;
6781            let end_offset = offset + bytes_len;
6782            _next_ordinal_to_read += 1;
6783            if next_offset >= end_offset {
6784                return Ok(());
6785            }
6786
6787            // Decode unknown envelopes for gaps in ordinals.
6788            while _next_ordinal_to_read < 1 {
6789                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6790                _next_ordinal_to_read += 1;
6791                next_offset += envelope_size;
6792            }
6793
6794            let next_out_of_line = decoder.next_out_of_line();
6795            let handles_before = decoder.remaining_handles();
6796            if let Some((inlined, num_bytes, num_handles)) =
6797                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6798            {
6799                let member_inline_size =
6800                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
6801                if inlined != (member_inline_size <= 4) {
6802                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6803                }
6804                let inner_offset;
6805                let mut inner_depth = depth.clone();
6806                if inlined {
6807                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6808                    inner_offset = next_offset;
6809                } else {
6810                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6811                    inner_depth.increment()?;
6812                }
6813                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
6814                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
6815                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6816                {
6817                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6818                }
6819                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6820                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6821                }
6822            }
6823
6824            next_offset += envelope_size;
6825
6826            // Decode the remaining unknown envelopes.
6827            while next_offset < end_offset {
6828                _next_ordinal_to_read += 1;
6829                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6830                next_offset += envelope_size;
6831            }
6832
6833            Ok(())
6834        }
6835    }
6836
6837    impl WlanSoftmacBaseClearAssociationRequest {
6838        #[inline(always)]
6839        fn max_ordinal_present(&self) -> u64 {
6840            if let Some(_) = self.peer_addr {
6841                return 1;
6842            }
6843            0
6844        }
6845    }
6846
6847    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseClearAssociationRequest {
6848        type Borrowed<'a> = &'a Self;
6849        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
6850            value
6851        }
6852    }
6853
6854    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseClearAssociationRequest {
6855        type Owned = Self;
6856
6857        #[inline(always)]
6858        fn inline_align(_context: fidl::encoding::Context) -> usize {
6859            8
6860        }
6861
6862        #[inline(always)]
6863        fn inline_size(_context: fidl::encoding::Context) -> usize {
6864            16
6865        }
6866    }
6867
6868    unsafe impl<D: fidl::encoding::ResourceDialect>
6869        fidl::encoding::Encode<WlanSoftmacBaseClearAssociationRequest, D>
6870        for &WlanSoftmacBaseClearAssociationRequest
6871    {
6872        unsafe fn encode(
6873            self,
6874            encoder: &mut fidl::encoding::Encoder<'_, D>,
6875            offset: usize,
6876            mut depth: fidl::encoding::Depth,
6877        ) -> fidl::Result<()> {
6878            encoder.debug_check_bounds::<WlanSoftmacBaseClearAssociationRequest>(offset);
6879            // Vector header
6880            let max_ordinal: u64 = self.max_ordinal_present();
6881            encoder.write_num(max_ordinal, offset);
6882            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
6883            // Calling encoder.out_of_line_offset(0) is not allowed.
6884            if max_ordinal == 0 {
6885                return Ok(());
6886            }
6887            depth.increment()?;
6888            let envelope_size = 8;
6889            let bytes_len = max_ordinal as usize * envelope_size;
6890            #[allow(unused_variables)]
6891            let offset = encoder.out_of_line_offset(bytes_len);
6892            let mut _prev_end_offset: usize = 0;
6893            if 1 > max_ordinal {
6894                return Ok(());
6895            }
6896
6897            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
6898            // are envelope_size bytes.
6899            let cur_offset: usize = (1 - 1) * envelope_size;
6900
6901            // Zero reserved fields.
6902            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
6903
6904            // Safety:
6905            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
6906            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
6907            //   envelope_size bytes, there is always sufficient room.
6908            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
6909                self.peer_addr
6910                    .as_ref()
6911                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
6912                encoder,
6913                offset + cur_offset,
6914                depth,
6915            )?;
6916
6917            _prev_end_offset = cur_offset + envelope_size;
6918
6919            Ok(())
6920        }
6921    }
6922
6923    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
6924        for WlanSoftmacBaseClearAssociationRequest
6925    {
6926        #[inline(always)]
6927        fn new_empty() -> Self {
6928            Self::default()
6929        }
6930
6931        unsafe fn decode(
6932            &mut self,
6933            decoder: &mut fidl::encoding::Decoder<'_, D>,
6934            offset: usize,
6935            mut depth: fidl::encoding::Depth,
6936        ) -> fidl::Result<()> {
6937            decoder.debug_check_bounds::<Self>(offset);
6938            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
6939                None => return Err(fidl::Error::NotNullable),
6940                Some(len) => len,
6941            };
6942            // Calling decoder.out_of_line_offset(0) is not allowed.
6943            if len == 0 {
6944                return Ok(());
6945            };
6946            depth.increment()?;
6947            let envelope_size = 8;
6948            let bytes_len = len * envelope_size;
6949            let offset = decoder.out_of_line_offset(bytes_len)?;
6950            // Decode the envelope for each type.
6951            let mut _next_ordinal_to_read = 0;
6952            let mut next_offset = offset;
6953            let end_offset = offset + bytes_len;
6954            _next_ordinal_to_read += 1;
6955            if next_offset >= end_offset {
6956                return Ok(());
6957            }
6958
6959            // Decode unknown envelopes for gaps in ordinals.
6960            while _next_ordinal_to_read < 1 {
6961                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
6962                _next_ordinal_to_read += 1;
6963                next_offset += envelope_size;
6964            }
6965
6966            let next_out_of_line = decoder.next_out_of_line();
6967            let handles_before = decoder.remaining_handles();
6968            if let Some((inlined, num_bytes, num_handles)) =
6969                fidl::encoding::decode_envelope_header(decoder, next_offset)?
6970            {
6971                let member_inline_size =
6972                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
6973                        decoder.context,
6974                    );
6975                if inlined != (member_inline_size <= 4) {
6976                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
6977                }
6978                let inner_offset;
6979                let mut inner_depth = depth.clone();
6980                if inlined {
6981                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
6982                    inner_offset = next_offset;
6983                } else {
6984                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
6985                    inner_depth.increment()?;
6986                }
6987                let val_ref = self
6988                    .peer_addr
6989                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
6990                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
6991                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
6992                {
6993                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
6994                }
6995                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
6996                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
6997                }
6998            }
6999
7000            next_offset += envelope_size;
7001
7002            // Decode the remaining unknown envelopes.
7003            while next_offset < end_offset {
7004                _next_ordinal_to_read += 1;
7005                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7006                next_offset += envelope_size;
7007            }
7008
7009            Ok(())
7010        }
7011    }
7012
7013    impl WlanSoftmacBaseEnableBeaconingRequest {
7014        #[inline(always)]
7015        fn max_ordinal_present(&self) -> u64 {
7016            if let Some(_) = self.beacon_interval {
7017                return 3;
7018            }
7019            if let Some(_) = self.tim_ele_offset {
7020                return 2;
7021            }
7022            if let Some(_) = self.packet_template {
7023                return 1;
7024            }
7025            0
7026        }
7027    }
7028
7029    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
7030        type Borrowed<'a> = &'a Self;
7031        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7032            value
7033        }
7034    }
7035
7036    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
7037        type Owned = Self;
7038
7039        #[inline(always)]
7040        fn inline_align(_context: fidl::encoding::Context) -> usize {
7041            8
7042        }
7043
7044        #[inline(always)]
7045        fn inline_size(_context: fidl::encoding::Context) -> usize {
7046            16
7047        }
7048    }
7049
7050    unsafe impl<D: fidl::encoding::ResourceDialect>
7051        fidl::encoding::Encode<WlanSoftmacBaseEnableBeaconingRequest, D>
7052        for &WlanSoftmacBaseEnableBeaconingRequest
7053    {
7054        unsafe fn encode(
7055            self,
7056            encoder: &mut fidl::encoding::Encoder<'_, D>,
7057            offset: usize,
7058            mut depth: fidl::encoding::Depth,
7059        ) -> fidl::Result<()> {
7060            encoder.debug_check_bounds::<WlanSoftmacBaseEnableBeaconingRequest>(offset);
7061            // Vector header
7062            let max_ordinal: u64 = self.max_ordinal_present();
7063            encoder.write_num(max_ordinal, offset);
7064            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7065            // Calling encoder.out_of_line_offset(0) is not allowed.
7066            if max_ordinal == 0 {
7067                return Ok(());
7068            }
7069            depth.increment()?;
7070            let envelope_size = 8;
7071            let bytes_len = max_ordinal as usize * envelope_size;
7072            #[allow(unused_variables)]
7073            let offset = encoder.out_of_line_offset(bytes_len);
7074            let mut _prev_end_offset: usize = 0;
7075            if 1 > max_ordinal {
7076                return Ok(());
7077            }
7078
7079            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7080            // are envelope_size bytes.
7081            let cur_offset: usize = (1 - 1) * envelope_size;
7082
7083            // Zero reserved fields.
7084            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7085
7086            // Safety:
7087            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7088            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7089            //   envelope_size bytes, there is always sufficient room.
7090            fidl::encoding::encode_in_envelope_optional::<WlanTxPacket, D>(
7091                self.packet_template
7092                    .as_ref()
7093                    .map(<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow),
7094                encoder,
7095                offset + cur_offset,
7096                depth,
7097            )?;
7098
7099            _prev_end_offset = cur_offset + envelope_size;
7100            if 2 > max_ordinal {
7101                return Ok(());
7102            }
7103
7104            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7105            // are envelope_size bytes.
7106            let cur_offset: usize = (2 - 1) * envelope_size;
7107
7108            // Zero reserved fields.
7109            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7110
7111            // Safety:
7112            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7113            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7114            //   envelope_size bytes, there is always sufficient room.
7115            fidl::encoding::encode_in_envelope_optional::<u64, D>(
7116                self.tim_ele_offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
7117                encoder,
7118                offset + cur_offset,
7119                depth,
7120            )?;
7121
7122            _prev_end_offset = cur_offset + envelope_size;
7123            if 3 > max_ordinal {
7124                return Ok(());
7125            }
7126
7127            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7128            // are envelope_size bytes.
7129            let cur_offset: usize = (3 - 1) * envelope_size;
7130
7131            // Zero reserved fields.
7132            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7133
7134            // Safety:
7135            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7136            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7137            //   envelope_size bytes, there is always sufficient room.
7138            fidl::encoding::encode_in_envelope_optional::<u16, D>(
7139                self.beacon_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
7140                encoder,
7141                offset + cur_offset,
7142                depth,
7143            )?;
7144
7145            _prev_end_offset = cur_offset + envelope_size;
7146
7147            Ok(())
7148        }
7149    }
7150
7151    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7152        for WlanSoftmacBaseEnableBeaconingRequest
7153    {
7154        #[inline(always)]
7155        fn new_empty() -> Self {
7156            Self::default()
7157        }
7158
7159        unsafe fn decode(
7160            &mut self,
7161            decoder: &mut fidl::encoding::Decoder<'_, D>,
7162            offset: usize,
7163            mut depth: fidl::encoding::Depth,
7164        ) -> fidl::Result<()> {
7165            decoder.debug_check_bounds::<Self>(offset);
7166            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7167                None => return Err(fidl::Error::NotNullable),
7168                Some(len) => len,
7169            };
7170            // Calling decoder.out_of_line_offset(0) is not allowed.
7171            if len == 0 {
7172                return Ok(());
7173            };
7174            depth.increment()?;
7175            let envelope_size = 8;
7176            let bytes_len = len * envelope_size;
7177            let offset = decoder.out_of_line_offset(bytes_len)?;
7178            // Decode the envelope for each type.
7179            let mut _next_ordinal_to_read = 0;
7180            let mut next_offset = offset;
7181            let end_offset = offset + bytes_len;
7182            _next_ordinal_to_read += 1;
7183            if next_offset >= end_offset {
7184                return Ok(());
7185            }
7186
7187            // Decode unknown envelopes for gaps in ordinals.
7188            while _next_ordinal_to_read < 1 {
7189                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7190                _next_ordinal_to_read += 1;
7191                next_offset += envelope_size;
7192            }
7193
7194            let next_out_of_line = decoder.next_out_of_line();
7195            let handles_before = decoder.remaining_handles();
7196            if let Some((inlined, num_bytes, num_handles)) =
7197                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7198            {
7199                let member_inline_size =
7200                    <WlanTxPacket as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7201                if inlined != (member_inline_size <= 4) {
7202                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7203                }
7204                let inner_offset;
7205                let mut inner_depth = depth.clone();
7206                if inlined {
7207                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7208                    inner_offset = next_offset;
7209                } else {
7210                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7211                    inner_depth.increment()?;
7212                }
7213                let val_ref =
7214                    self.packet_template.get_or_insert_with(|| fidl::new_empty!(WlanTxPacket, D));
7215                fidl::decode!(WlanTxPacket, D, val_ref, decoder, inner_offset, inner_depth)?;
7216                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7217                {
7218                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7219                }
7220                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7221                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7222                }
7223            }
7224
7225            next_offset += envelope_size;
7226            _next_ordinal_to_read += 1;
7227            if next_offset >= end_offset {
7228                return Ok(());
7229            }
7230
7231            // Decode unknown envelopes for gaps in ordinals.
7232            while _next_ordinal_to_read < 2 {
7233                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7234                _next_ordinal_to_read += 1;
7235                next_offset += envelope_size;
7236            }
7237
7238            let next_out_of_line = decoder.next_out_of_line();
7239            let handles_before = decoder.remaining_handles();
7240            if let Some((inlined, num_bytes, num_handles)) =
7241                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7242            {
7243                let member_inline_size =
7244                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7245                if inlined != (member_inline_size <= 4) {
7246                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7247                }
7248                let inner_offset;
7249                let mut inner_depth = depth.clone();
7250                if inlined {
7251                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7252                    inner_offset = next_offset;
7253                } else {
7254                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7255                    inner_depth.increment()?;
7256                }
7257                let val_ref = self.tim_ele_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
7258                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
7259                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7260                {
7261                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7262                }
7263                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7264                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7265                }
7266            }
7267
7268            next_offset += envelope_size;
7269            _next_ordinal_to_read += 1;
7270            if next_offset >= end_offset {
7271                return Ok(());
7272            }
7273
7274            // Decode unknown envelopes for gaps in ordinals.
7275            while _next_ordinal_to_read < 3 {
7276                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7277                _next_ordinal_to_read += 1;
7278                next_offset += envelope_size;
7279            }
7280
7281            let next_out_of_line = decoder.next_out_of_line();
7282            let handles_before = decoder.remaining_handles();
7283            if let Some((inlined, num_bytes, num_handles)) =
7284                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7285            {
7286                let member_inline_size =
7287                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7288                if inlined != (member_inline_size <= 4) {
7289                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7290                }
7291                let inner_offset;
7292                let mut inner_depth = depth.clone();
7293                if inlined {
7294                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7295                    inner_offset = next_offset;
7296                } else {
7297                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7298                    inner_depth.increment()?;
7299                }
7300                let val_ref = self.beacon_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
7301                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
7302                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7303                {
7304                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7305                }
7306                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7307                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7308                }
7309            }
7310
7311            next_offset += envelope_size;
7312
7313            // Decode the remaining unknown envelopes.
7314            while next_offset < end_offset {
7315                _next_ordinal_to_read += 1;
7316                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7317                next_offset += envelope_size;
7318            }
7319
7320            Ok(())
7321        }
7322    }
7323
7324    impl WlanSoftmacBaseSetChannelRequest {
7325        #[inline(always)]
7326        fn max_ordinal_present(&self) -> u64 {
7327            if let Some(_) = self.channel {
7328                return 1;
7329            }
7330            0
7331        }
7332    }
7333
7334    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseSetChannelRequest {
7335        type Borrowed<'a> = &'a Self;
7336        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7337            value
7338        }
7339    }
7340
7341    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseSetChannelRequest {
7342        type Owned = Self;
7343
7344        #[inline(always)]
7345        fn inline_align(_context: fidl::encoding::Context) -> usize {
7346            8
7347        }
7348
7349        #[inline(always)]
7350        fn inline_size(_context: fidl::encoding::Context) -> usize {
7351            16
7352        }
7353    }
7354
7355    unsafe impl<D: fidl::encoding::ResourceDialect>
7356        fidl::encoding::Encode<WlanSoftmacBaseSetChannelRequest, D>
7357        for &WlanSoftmacBaseSetChannelRequest
7358    {
7359        unsafe fn encode(
7360            self,
7361            encoder: &mut fidl::encoding::Encoder<'_, D>,
7362            offset: usize,
7363            mut depth: fidl::encoding::Depth,
7364        ) -> fidl::Result<()> {
7365            encoder.debug_check_bounds::<WlanSoftmacBaseSetChannelRequest>(offset);
7366            // Vector header
7367            let max_ordinal: u64 = self.max_ordinal_present();
7368            encoder.write_num(max_ordinal, offset);
7369            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7370            // Calling encoder.out_of_line_offset(0) is not allowed.
7371            if max_ordinal == 0 {
7372                return Ok(());
7373            }
7374            depth.increment()?;
7375            let envelope_size = 8;
7376            let bytes_len = max_ordinal as usize * envelope_size;
7377            #[allow(unused_variables)]
7378            let offset = encoder.out_of_line_offset(bytes_len);
7379            let mut _prev_end_offset: usize = 0;
7380            if 1 > max_ordinal {
7381                return Ok(());
7382            }
7383
7384            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7385            // are envelope_size bytes.
7386            let cur_offset: usize = (1 - 1) * envelope_size;
7387
7388            // Zero reserved fields.
7389            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7390
7391            // Safety:
7392            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7393            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7394            //   envelope_size bytes, there is always sufficient room.
7395            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>(
7396            self.channel.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
7397            encoder, offset + cur_offset, depth
7398        )?;
7399
7400            _prev_end_offset = cur_offset + envelope_size;
7401
7402            Ok(())
7403        }
7404    }
7405
7406    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7407        for WlanSoftmacBaseSetChannelRequest
7408    {
7409        #[inline(always)]
7410        fn new_empty() -> Self {
7411            Self::default()
7412        }
7413
7414        unsafe fn decode(
7415            &mut self,
7416            decoder: &mut fidl::encoding::Decoder<'_, D>,
7417            offset: usize,
7418            mut depth: fidl::encoding::Depth,
7419        ) -> fidl::Result<()> {
7420            decoder.debug_check_bounds::<Self>(offset);
7421            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7422                None => return Err(fidl::Error::NotNullable),
7423                Some(len) => len,
7424            };
7425            // Calling decoder.out_of_line_offset(0) is not allowed.
7426            if len == 0 {
7427                return Ok(());
7428            };
7429            depth.increment()?;
7430            let envelope_size = 8;
7431            let bytes_len = len * envelope_size;
7432            let offset = decoder.out_of_line_offset(bytes_len)?;
7433            // Decode the envelope for each type.
7434            let mut _next_ordinal_to_read = 0;
7435            let mut next_offset = offset;
7436            let end_offset = offset + bytes_len;
7437            _next_ordinal_to_read += 1;
7438            if next_offset >= end_offset {
7439                return Ok(());
7440            }
7441
7442            // Decode unknown envelopes for gaps in ordinals.
7443            while _next_ordinal_to_read < 1 {
7444                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7445                _next_ordinal_to_read += 1;
7446                next_offset += envelope_size;
7447            }
7448
7449            let next_out_of_line = decoder.next_out_of_line();
7450            let handles_before = decoder.remaining_handles();
7451            if let Some((inlined, num_bytes, num_handles)) =
7452                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7453            {
7454                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7455                if inlined != (member_inline_size <= 4) {
7456                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7457                }
7458                let inner_offset;
7459                let mut inner_depth = depth.clone();
7460                if inlined {
7461                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7462                    inner_offset = next_offset;
7463                } else {
7464                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7465                    inner_depth.increment()?;
7466                }
7467                let val_ref = self.channel.get_or_insert_with(|| {
7468                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D)
7469                });
7470                fidl::decode!(
7471                    fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
7472                    D,
7473                    val_ref,
7474                    decoder,
7475                    inner_offset,
7476                    inner_depth
7477                )?;
7478                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7479                {
7480                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7481                }
7482                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7483                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7484                }
7485            }
7486
7487            next_offset += envelope_size;
7488
7489            // Decode the remaining unknown envelopes.
7490            while next_offset < end_offset {
7491                _next_ordinal_to_read += 1;
7492                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7493                next_offset += envelope_size;
7494            }
7495
7496            Ok(())
7497        }
7498    }
7499
7500    impl WlanSoftmacBaseStartPassiveScanRequest {
7501        #[inline(always)]
7502        fn max_ordinal_present(&self) -> u64 {
7503            if let Some(_) = self.min_home_time {
7504                return 4;
7505            }
7506            if let Some(_) = self.max_channel_time {
7507                return 3;
7508            }
7509            if let Some(_) = self.min_channel_time {
7510                return 2;
7511            }
7512            if let Some(_) = self.channels {
7513                return 1;
7514            }
7515            0
7516        }
7517    }
7518
7519    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7520        type Borrowed<'a> = &'a Self;
7521        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7522            value
7523        }
7524    }
7525
7526    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
7527        type Owned = Self;
7528
7529        #[inline(always)]
7530        fn inline_align(_context: fidl::encoding::Context) -> usize {
7531            8
7532        }
7533
7534        #[inline(always)]
7535        fn inline_size(_context: fidl::encoding::Context) -> usize {
7536            16
7537        }
7538    }
7539
7540    unsafe impl<D: fidl::encoding::ResourceDialect>
7541        fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanRequest, D>
7542        for &WlanSoftmacBaseStartPassiveScanRequest
7543    {
7544        unsafe fn encode(
7545            self,
7546            encoder: &mut fidl::encoding::Encoder<'_, D>,
7547            offset: usize,
7548            mut depth: fidl::encoding::Depth,
7549        ) -> fidl::Result<()> {
7550            encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanRequest>(offset);
7551            // Vector header
7552            let max_ordinal: u64 = self.max_ordinal_present();
7553            encoder.write_num(max_ordinal, offset);
7554            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7555            // Calling encoder.out_of_line_offset(0) is not allowed.
7556            if max_ordinal == 0 {
7557                return Ok(());
7558            }
7559            depth.increment()?;
7560            let envelope_size = 8;
7561            let bytes_len = max_ordinal as usize * envelope_size;
7562            #[allow(unused_variables)]
7563            let offset = encoder.out_of_line_offset(bytes_len);
7564            let mut _prev_end_offset: usize = 0;
7565            if 1 > max_ordinal {
7566                return Ok(());
7567            }
7568
7569            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7570            // are envelope_size bytes.
7571            let cur_offset: usize = (1 - 1) * envelope_size;
7572
7573            // Zero reserved fields.
7574            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7575
7576            // Safety:
7577            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7578            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7579            //   envelope_size bytes, there is always sufficient room.
7580            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
7581                self.channels.as_ref().map(
7582                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
7583                ),
7584                encoder,
7585                offset + cur_offset,
7586                depth,
7587            )?;
7588
7589            _prev_end_offset = cur_offset + envelope_size;
7590            if 2 > max_ordinal {
7591                return Ok(());
7592            }
7593
7594            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7595            // are envelope_size bytes.
7596            let cur_offset: usize = (2 - 1) * envelope_size;
7597
7598            // Zero reserved fields.
7599            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7600
7601            // Safety:
7602            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7603            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7604            //   envelope_size bytes, there is always sufficient room.
7605            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7606                self.min_channel_time
7607                    .as_ref()
7608                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7609                encoder,
7610                offset + cur_offset,
7611                depth,
7612            )?;
7613
7614            _prev_end_offset = cur_offset + envelope_size;
7615            if 3 > max_ordinal {
7616                return Ok(());
7617            }
7618
7619            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7620            // are envelope_size bytes.
7621            let cur_offset: usize = (3 - 1) * envelope_size;
7622
7623            // Zero reserved fields.
7624            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7625
7626            // Safety:
7627            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7628            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7629            //   envelope_size bytes, there is always sufficient room.
7630            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7631                self.max_channel_time
7632                    .as_ref()
7633                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7634                encoder,
7635                offset + cur_offset,
7636                depth,
7637            )?;
7638
7639            _prev_end_offset = cur_offset + envelope_size;
7640            if 4 > max_ordinal {
7641                return Ok(());
7642            }
7643
7644            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7645            // are envelope_size bytes.
7646            let cur_offset: usize = (4 - 1) * envelope_size;
7647
7648            // Zero reserved fields.
7649            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7650
7651            // Safety:
7652            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7653            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7654            //   envelope_size bytes, there is always sufficient room.
7655            fidl::encoding::encode_in_envelope_optional::<i64, D>(
7656                self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
7657                encoder,
7658                offset + cur_offset,
7659                depth,
7660            )?;
7661
7662            _prev_end_offset = cur_offset + envelope_size;
7663
7664            Ok(())
7665        }
7666    }
7667
7668    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7669        for WlanSoftmacBaseStartPassiveScanRequest
7670    {
7671        #[inline(always)]
7672        fn new_empty() -> Self {
7673            Self::default()
7674        }
7675
7676        unsafe fn decode(
7677            &mut self,
7678            decoder: &mut fidl::encoding::Decoder<'_, D>,
7679            offset: usize,
7680            mut depth: fidl::encoding::Depth,
7681        ) -> fidl::Result<()> {
7682            decoder.debug_check_bounds::<Self>(offset);
7683            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
7684                None => return Err(fidl::Error::NotNullable),
7685                Some(len) => len,
7686            };
7687            // Calling decoder.out_of_line_offset(0) is not allowed.
7688            if len == 0 {
7689                return Ok(());
7690            };
7691            depth.increment()?;
7692            let envelope_size = 8;
7693            let bytes_len = len * envelope_size;
7694            let offset = decoder.out_of_line_offset(bytes_len)?;
7695            // Decode the envelope for each type.
7696            let mut _next_ordinal_to_read = 0;
7697            let mut next_offset = offset;
7698            let end_offset = offset + bytes_len;
7699            _next_ordinal_to_read += 1;
7700            if next_offset >= end_offset {
7701                return Ok(());
7702            }
7703
7704            // Decode unknown envelopes for gaps in ordinals.
7705            while _next_ordinal_to_read < 1 {
7706                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7707                _next_ordinal_to_read += 1;
7708                next_offset += envelope_size;
7709            }
7710
7711            let next_out_of_line = decoder.next_out_of_line();
7712            let handles_before = decoder.remaining_handles();
7713            if let Some((inlined, num_bytes, num_handles)) =
7714                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7715            {
7716                let member_inline_size =
7717                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
7718                        decoder.context,
7719                    );
7720                if inlined != (member_inline_size <= 4) {
7721                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7722                }
7723                let inner_offset;
7724                let mut inner_depth = depth.clone();
7725                if inlined {
7726                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7727                    inner_offset = next_offset;
7728                } else {
7729                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7730                    inner_depth.increment()?;
7731                }
7732                let val_ref = self
7733                    .channels
7734                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
7735                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
7736                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7737                {
7738                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7739                }
7740                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7741                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7742                }
7743            }
7744
7745            next_offset += envelope_size;
7746            _next_ordinal_to_read += 1;
7747            if next_offset >= end_offset {
7748                return Ok(());
7749            }
7750
7751            // Decode unknown envelopes for gaps in ordinals.
7752            while _next_ordinal_to_read < 2 {
7753                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7754                _next_ordinal_to_read += 1;
7755                next_offset += envelope_size;
7756            }
7757
7758            let next_out_of_line = decoder.next_out_of_line();
7759            let handles_before = decoder.remaining_handles();
7760            if let Some((inlined, num_bytes, num_handles)) =
7761                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7762            {
7763                let member_inline_size =
7764                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7765                if inlined != (member_inline_size <= 4) {
7766                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7767                }
7768                let inner_offset;
7769                let mut inner_depth = depth.clone();
7770                if inlined {
7771                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7772                    inner_offset = next_offset;
7773                } else {
7774                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7775                    inner_depth.increment()?;
7776                }
7777                let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7778                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7779                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7780                {
7781                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7782                }
7783                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7784                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7785                }
7786            }
7787
7788            next_offset += envelope_size;
7789            _next_ordinal_to_read += 1;
7790            if next_offset >= end_offset {
7791                return Ok(());
7792            }
7793
7794            // Decode unknown envelopes for gaps in ordinals.
7795            while _next_ordinal_to_read < 3 {
7796                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7797                _next_ordinal_to_read += 1;
7798                next_offset += envelope_size;
7799            }
7800
7801            let next_out_of_line = decoder.next_out_of_line();
7802            let handles_before = decoder.remaining_handles();
7803            if let Some((inlined, num_bytes, num_handles)) =
7804                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7805            {
7806                let member_inline_size =
7807                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7808                if inlined != (member_inline_size <= 4) {
7809                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7810                }
7811                let inner_offset;
7812                let mut inner_depth = depth.clone();
7813                if inlined {
7814                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7815                    inner_offset = next_offset;
7816                } else {
7817                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7818                    inner_depth.increment()?;
7819                }
7820                let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7821                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7822                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7823                {
7824                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7825                }
7826                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7827                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7828                }
7829            }
7830
7831            next_offset += envelope_size;
7832            _next_ordinal_to_read += 1;
7833            if next_offset >= end_offset {
7834                return Ok(());
7835            }
7836
7837            // Decode unknown envelopes for gaps in ordinals.
7838            while _next_ordinal_to_read < 4 {
7839                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7840                _next_ordinal_to_read += 1;
7841                next_offset += envelope_size;
7842            }
7843
7844            let next_out_of_line = decoder.next_out_of_line();
7845            let handles_before = decoder.remaining_handles();
7846            if let Some((inlined, num_bytes, num_handles)) =
7847                fidl::encoding::decode_envelope_header(decoder, next_offset)?
7848            {
7849                let member_inline_size =
7850                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
7851                if inlined != (member_inline_size <= 4) {
7852                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
7853                }
7854                let inner_offset;
7855                let mut inner_depth = depth.clone();
7856                if inlined {
7857                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
7858                    inner_offset = next_offset;
7859                } else {
7860                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
7861                    inner_depth.increment()?;
7862                }
7863                let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
7864                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
7865                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
7866                {
7867                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
7868                }
7869                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
7870                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
7871                }
7872            }
7873
7874            next_offset += envelope_size;
7875
7876            // Decode the remaining unknown envelopes.
7877            while next_offset < end_offset {
7878                _next_ordinal_to_read += 1;
7879                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
7880                next_offset += envelope_size;
7881            }
7882
7883            Ok(())
7884        }
7885    }
7886
7887    impl WlanSoftmacBaseUpdateWmmParametersRequest {
7888        #[inline(always)]
7889        fn max_ordinal_present(&self) -> u64 {
7890            if let Some(_) = self.params {
7891                return 2;
7892            }
7893            if let Some(_) = self.ac {
7894                return 1;
7895            }
7896            0
7897        }
7898    }
7899
7900    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7901        type Borrowed<'a> = &'a Self;
7902        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
7903            value
7904        }
7905    }
7906
7907    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
7908        type Owned = Self;
7909
7910        #[inline(always)]
7911        fn inline_align(_context: fidl::encoding::Context) -> usize {
7912            8
7913        }
7914
7915        #[inline(always)]
7916        fn inline_size(_context: fidl::encoding::Context) -> usize {
7917            16
7918        }
7919    }
7920
7921    unsafe impl<D: fidl::encoding::ResourceDialect>
7922        fidl::encoding::Encode<WlanSoftmacBaseUpdateWmmParametersRequest, D>
7923        for &WlanSoftmacBaseUpdateWmmParametersRequest
7924    {
7925        unsafe fn encode(
7926            self,
7927            encoder: &mut fidl::encoding::Encoder<'_, D>,
7928            offset: usize,
7929            mut depth: fidl::encoding::Depth,
7930        ) -> fidl::Result<()> {
7931            encoder.debug_check_bounds::<WlanSoftmacBaseUpdateWmmParametersRequest>(offset);
7932            // Vector header
7933            let max_ordinal: u64 = self.max_ordinal_present();
7934            encoder.write_num(max_ordinal, offset);
7935            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
7936            // Calling encoder.out_of_line_offset(0) is not allowed.
7937            if max_ordinal == 0 {
7938                return Ok(());
7939            }
7940            depth.increment()?;
7941            let envelope_size = 8;
7942            let bytes_len = max_ordinal as usize * envelope_size;
7943            #[allow(unused_variables)]
7944            let offset = encoder.out_of_line_offset(bytes_len);
7945            let mut _prev_end_offset: usize = 0;
7946            if 1 > max_ordinal {
7947                return Ok(());
7948            }
7949
7950            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7951            // are envelope_size bytes.
7952            let cur_offset: usize = (1 - 1) * envelope_size;
7953
7954            // Zero reserved fields.
7955            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7956
7957            // Safety:
7958            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7959            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7960            //   envelope_size bytes, there is always sufficient room.
7961            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D>(
7962            self.ac.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::ValueTypeMarker>::borrow),
7963            encoder, offset + cur_offset, depth
7964        )?;
7965
7966            _prev_end_offset = cur_offset + envelope_size;
7967            if 2 > max_ordinal {
7968                return Ok(());
7969            }
7970
7971            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
7972            // are envelope_size bytes.
7973            let cur_offset: usize = (2 - 1) * envelope_size;
7974
7975            // Zero reserved fields.
7976            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
7977
7978            // Safety:
7979            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
7980            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
7981            //   envelope_size bytes, there is always sufficient room.
7982            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanWmmParameters, D>(
7983            self.params.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
7984            encoder, offset + cur_offset, depth
7985        )?;
7986
7987            _prev_end_offset = cur_offset + envelope_size;
7988
7989            Ok(())
7990        }
7991    }
7992
7993    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
7994        for WlanSoftmacBaseUpdateWmmParametersRequest
7995    {
7996        #[inline(always)]
7997        fn new_empty() -> Self {
7998            Self::default()
7999        }
8000
8001        unsafe fn decode(
8002            &mut self,
8003            decoder: &mut fidl::encoding::Decoder<'_, D>,
8004            offset: usize,
8005            mut depth: fidl::encoding::Depth,
8006        ) -> fidl::Result<()> {
8007            decoder.debug_check_bounds::<Self>(offset);
8008            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8009                None => return Err(fidl::Error::NotNullable),
8010                Some(len) => len,
8011            };
8012            // Calling decoder.out_of_line_offset(0) is not allowed.
8013            if len == 0 {
8014                return Ok(());
8015            };
8016            depth.increment()?;
8017            let envelope_size = 8;
8018            let bytes_len = len * envelope_size;
8019            let offset = decoder.out_of_line_offset(bytes_len)?;
8020            // Decode the envelope for each type.
8021            let mut _next_ordinal_to_read = 0;
8022            let mut next_offset = offset;
8023            let end_offset = offset + bytes_len;
8024            _next_ordinal_to_read += 1;
8025            if next_offset >= end_offset {
8026                return Ok(());
8027            }
8028
8029            // Decode unknown envelopes for gaps in ordinals.
8030            while _next_ordinal_to_read < 1 {
8031                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8032                _next_ordinal_to_read += 1;
8033                next_offset += envelope_size;
8034            }
8035
8036            let next_out_of_line = decoder.next_out_of_line();
8037            let handles_before = decoder.remaining_handles();
8038            if let Some((inlined, num_bytes, num_handles)) =
8039                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8040            {
8041                let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8042                if inlined != (member_inline_size <= 4) {
8043                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8044                }
8045                let inner_offset;
8046                let mut inner_depth = depth.clone();
8047                if inlined {
8048                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8049                    inner_offset = next_offset;
8050                } else {
8051                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8052                    inner_depth.increment()?;
8053                }
8054                let val_ref = self.ac.get_or_insert_with(|| {
8055                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory, D)
8056                });
8057                fidl::decode!(
8058                    fidl_fuchsia_wlan_ieee80211__common::WlanAccessCategory,
8059                    D,
8060                    val_ref,
8061                    decoder,
8062                    inner_offset,
8063                    inner_depth
8064                )?;
8065                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8066                {
8067                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8068                }
8069                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8070                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8071                }
8072            }
8073
8074            next_offset += envelope_size;
8075            _next_ordinal_to_read += 1;
8076            if next_offset >= end_offset {
8077                return Ok(());
8078            }
8079
8080            // Decode unknown envelopes for gaps in ordinals.
8081            while _next_ordinal_to_read < 2 {
8082                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8083                _next_ordinal_to_read += 1;
8084                next_offset += envelope_size;
8085            }
8086
8087            let next_out_of_line = decoder.next_out_of_line();
8088            let handles_before = decoder.remaining_handles();
8089            if let Some((inlined, num_bytes, num_handles)) =
8090                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8091            {
8092                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8093                if inlined != (member_inline_size <= 4) {
8094                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8095                }
8096                let inner_offset;
8097                let mut inner_depth = depth.clone();
8098                if inlined {
8099                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8100                    inner_offset = next_offset;
8101                } else {
8102                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8103                    inner_depth.increment()?;
8104                }
8105                let val_ref = self.params.get_or_insert_with(|| {
8106                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanWmmParameters, D)
8107                });
8108                fidl::decode!(
8109                    fidl_fuchsia_wlan_common__common::WlanWmmParameters,
8110                    D,
8111                    val_ref,
8112                    decoder,
8113                    inner_offset,
8114                    inner_depth
8115                )?;
8116                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8117                {
8118                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8119                }
8120                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8121                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8122                }
8123            }
8124
8125            next_offset += envelope_size;
8126
8127            // Decode the remaining unknown envelopes.
8128            while next_offset < end_offset {
8129                _next_ordinal_to_read += 1;
8130                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8131                next_offset += envelope_size;
8132            }
8133
8134            Ok(())
8135        }
8136    }
8137
8138    impl WlanSoftmacBaseStartActiveScanResponse {
8139        #[inline(always)]
8140        fn max_ordinal_present(&self) -> u64 {
8141            if let Some(_) = self.scan_id {
8142                return 1;
8143            }
8144            0
8145        }
8146    }
8147
8148    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartActiveScanResponse {
8149        type Borrowed<'a> = &'a Self;
8150        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8151            value
8152        }
8153    }
8154
8155    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartActiveScanResponse {
8156        type Owned = Self;
8157
8158        #[inline(always)]
8159        fn inline_align(_context: fidl::encoding::Context) -> usize {
8160            8
8161        }
8162
8163        #[inline(always)]
8164        fn inline_size(_context: fidl::encoding::Context) -> usize {
8165            16
8166        }
8167    }
8168
8169    unsafe impl<D: fidl::encoding::ResourceDialect>
8170        fidl::encoding::Encode<WlanSoftmacBaseStartActiveScanResponse, D>
8171        for &WlanSoftmacBaseStartActiveScanResponse
8172    {
8173        unsafe fn encode(
8174            self,
8175            encoder: &mut fidl::encoding::Encoder<'_, D>,
8176            offset: usize,
8177            mut depth: fidl::encoding::Depth,
8178        ) -> fidl::Result<()> {
8179            encoder.debug_check_bounds::<WlanSoftmacBaseStartActiveScanResponse>(offset);
8180            // Vector header
8181            let max_ordinal: u64 = self.max_ordinal_present();
8182            encoder.write_num(max_ordinal, offset);
8183            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8184            // Calling encoder.out_of_line_offset(0) is not allowed.
8185            if max_ordinal == 0 {
8186                return Ok(());
8187            }
8188            depth.increment()?;
8189            let envelope_size = 8;
8190            let bytes_len = max_ordinal as usize * envelope_size;
8191            #[allow(unused_variables)]
8192            let offset = encoder.out_of_line_offset(bytes_len);
8193            let mut _prev_end_offset: usize = 0;
8194            if 1 > max_ordinal {
8195                return Ok(());
8196            }
8197
8198            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8199            // are envelope_size bytes.
8200            let cur_offset: usize = (1 - 1) * envelope_size;
8201
8202            // Zero reserved fields.
8203            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8204
8205            // Safety:
8206            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8207            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8208            //   envelope_size bytes, there is always sufficient room.
8209            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8210                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8211                encoder,
8212                offset + cur_offset,
8213                depth,
8214            )?;
8215
8216            _prev_end_offset = cur_offset + envelope_size;
8217
8218            Ok(())
8219        }
8220    }
8221
8222    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8223        for WlanSoftmacBaseStartActiveScanResponse
8224    {
8225        #[inline(always)]
8226        fn new_empty() -> Self {
8227            Self::default()
8228        }
8229
8230        unsafe fn decode(
8231            &mut self,
8232            decoder: &mut fidl::encoding::Decoder<'_, D>,
8233            offset: usize,
8234            mut depth: fidl::encoding::Depth,
8235        ) -> fidl::Result<()> {
8236            decoder.debug_check_bounds::<Self>(offset);
8237            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8238                None => return Err(fidl::Error::NotNullable),
8239                Some(len) => len,
8240            };
8241            // Calling decoder.out_of_line_offset(0) is not allowed.
8242            if len == 0 {
8243                return Ok(());
8244            };
8245            depth.increment()?;
8246            let envelope_size = 8;
8247            let bytes_len = len * envelope_size;
8248            let offset = decoder.out_of_line_offset(bytes_len)?;
8249            // Decode the envelope for each type.
8250            let mut _next_ordinal_to_read = 0;
8251            let mut next_offset = offset;
8252            let end_offset = offset + bytes_len;
8253            _next_ordinal_to_read += 1;
8254            if next_offset >= end_offset {
8255                return Ok(());
8256            }
8257
8258            // Decode unknown envelopes for gaps in ordinals.
8259            while _next_ordinal_to_read < 1 {
8260                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8261                _next_ordinal_to_read += 1;
8262                next_offset += envelope_size;
8263            }
8264
8265            let next_out_of_line = decoder.next_out_of_line();
8266            let handles_before = decoder.remaining_handles();
8267            if let Some((inlined, num_bytes, num_handles)) =
8268                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8269            {
8270                let member_inline_size =
8271                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8272                if inlined != (member_inline_size <= 4) {
8273                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8274                }
8275                let inner_offset;
8276                let mut inner_depth = depth.clone();
8277                if inlined {
8278                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8279                    inner_offset = next_offset;
8280                } else {
8281                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8282                    inner_depth.increment()?;
8283                }
8284                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8285                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8286                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8287                {
8288                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8289                }
8290                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8291                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8292                }
8293            }
8294
8295            next_offset += envelope_size;
8296
8297            // Decode the remaining unknown envelopes.
8298            while next_offset < end_offset {
8299                _next_ordinal_to_read += 1;
8300                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8301                next_offset += envelope_size;
8302            }
8303
8304            Ok(())
8305        }
8306    }
8307
8308    impl WlanSoftmacBaseStartPassiveScanResponse {
8309        #[inline(always)]
8310        fn max_ordinal_present(&self) -> u64 {
8311            if let Some(_) = self.scan_id {
8312                return 1;
8313            }
8314            0
8315        }
8316    }
8317
8318    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
8319        type Borrowed<'a> = &'a Self;
8320        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8321            value
8322        }
8323    }
8324
8325    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
8326        type Owned = Self;
8327
8328        #[inline(always)]
8329        fn inline_align(_context: fidl::encoding::Context) -> usize {
8330            8
8331        }
8332
8333        #[inline(always)]
8334        fn inline_size(_context: fidl::encoding::Context) -> usize {
8335            16
8336        }
8337    }
8338
8339    unsafe impl<D: fidl::encoding::ResourceDialect>
8340        fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanResponse, D>
8341        for &WlanSoftmacBaseStartPassiveScanResponse
8342    {
8343        unsafe fn encode(
8344            self,
8345            encoder: &mut fidl::encoding::Encoder<'_, D>,
8346            offset: usize,
8347            mut depth: fidl::encoding::Depth,
8348        ) -> fidl::Result<()> {
8349            encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanResponse>(offset);
8350            // Vector header
8351            let max_ordinal: u64 = self.max_ordinal_present();
8352            encoder.write_num(max_ordinal, offset);
8353            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8354            // Calling encoder.out_of_line_offset(0) is not allowed.
8355            if max_ordinal == 0 {
8356                return Ok(());
8357            }
8358            depth.increment()?;
8359            let envelope_size = 8;
8360            let bytes_len = max_ordinal as usize * envelope_size;
8361            #[allow(unused_variables)]
8362            let offset = encoder.out_of_line_offset(bytes_len);
8363            let mut _prev_end_offset: usize = 0;
8364            if 1 > max_ordinal {
8365                return Ok(());
8366            }
8367
8368            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8369            // are envelope_size bytes.
8370            let cur_offset: usize = (1 - 1) * envelope_size;
8371
8372            // Zero reserved fields.
8373            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8374
8375            // Safety:
8376            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8377            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8378            //   envelope_size bytes, there is always sufficient room.
8379            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8380                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8381                encoder,
8382                offset + cur_offset,
8383                depth,
8384            )?;
8385
8386            _prev_end_offset = cur_offset + envelope_size;
8387
8388            Ok(())
8389        }
8390    }
8391
8392    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8393        for WlanSoftmacBaseStartPassiveScanResponse
8394    {
8395        #[inline(always)]
8396        fn new_empty() -> Self {
8397            Self::default()
8398        }
8399
8400        unsafe fn decode(
8401            &mut self,
8402            decoder: &mut fidl::encoding::Decoder<'_, D>,
8403            offset: usize,
8404            mut depth: fidl::encoding::Depth,
8405        ) -> fidl::Result<()> {
8406            decoder.debug_check_bounds::<Self>(offset);
8407            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8408                None => return Err(fidl::Error::NotNullable),
8409                Some(len) => len,
8410            };
8411            // Calling decoder.out_of_line_offset(0) is not allowed.
8412            if len == 0 {
8413                return Ok(());
8414            };
8415            depth.increment()?;
8416            let envelope_size = 8;
8417            let bytes_len = len * envelope_size;
8418            let offset = decoder.out_of_line_offset(bytes_len)?;
8419            // Decode the envelope for each type.
8420            let mut _next_ordinal_to_read = 0;
8421            let mut next_offset = offset;
8422            let end_offset = offset + bytes_len;
8423            _next_ordinal_to_read += 1;
8424            if next_offset >= end_offset {
8425                return Ok(());
8426            }
8427
8428            // Decode unknown envelopes for gaps in ordinals.
8429            while _next_ordinal_to_read < 1 {
8430                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8431                _next_ordinal_to_read += 1;
8432                next_offset += envelope_size;
8433            }
8434
8435            let next_out_of_line = decoder.next_out_of_line();
8436            let handles_before = decoder.remaining_handles();
8437            if let Some((inlined, num_bytes, num_handles)) =
8438                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8439            {
8440                let member_inline_size =
8441                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8442                if inlined != (member_inline_size <= 4) {
8443                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8444                }
8445                let inner_offset;
8446                let mut inner_depth = depth.clone();
8447                if inlined {
8448                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8449                    inner_offset = next_offset;
8450                } else {
8451                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8452                    inner_depth.increment()?;
8453                }
8454                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8455                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8456                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8457                {
8458                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8459                }
8460                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8461                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8462                }
8463            }
8464
8465            next_offset += envelope_size;
8466
8467            // Decode the remaining unknown envelopes.
8468            while next_offset < end_offset {
8469                _next_ordinal_to_read += 1;
8470                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8471                next_offset += envelope_size;
8472            }
8473
8474            Ok(())
8475        }
8476    }
8477
8478    impl WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8479        #[inline(always)]
8480        fn max_ordinal_present(&self) -> u64 {
8481            if let Some(_) = self.scan_id {
8482                return 2;
8483            }
8484            if let Some(_) = self.status {
8485                return 1;
8486            }
8487            0
8488        }
8489    }
8490
8491    impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8492        type Borrowed<'a> = &'a Self;
8493        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8494            value
8495        }
8496    }
8497
8498    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
8499        type Owned = Self;
8500
8501        #[inline(always)]
8502        fn inline_align(_context: fidl::encoding::Context) -> usize {
8503            8
8504        }
8505
8506        #[inline(always)]
8507        fn inline_size(_context: fidl::encoding::Context) -> usize {
8508            16
8509        }
8510    }
8511
8512    unsafe impl<D: fidl::encoding::ResourceDialect>
8513        fidl::encoding::Encode<WlanSoftmacIfcBaseNotifyScanCompleteRequest, D>
8514        for &WlanSoftmacIfcBaseNotifyScanCompleteRequest
8515    {
8516        unsafe fn encode(
8517            self,
8518            encoder: &mut fidl::encoding::Encoder<'_, D>,
8519            offset: usize,
8520            mut depth: fidl::encoding::Depth,
8521        ) -> fidl::Result<()> {
8522            encoder.debug_check_bounds::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(offset);
8523            // Vector header
8524            let max_ordinal: u64 = self.max_ordinal_present();
8525            encoder.write_num(max_ordinal, offset);
8526            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8527            // Calling encoder.out_of_line_offset(0) is not allowed.
8528            if max_ordinal == 0 {
8529                return Ok(());
8530            }
8531            depth.increment()?;
8532            let envelope_size = 8;
8533            let bytes_len = max_ordinal as usize * envelope_size;
8534            #[allow(unused_variables)]
8535            let offset = encoder.out_of_line_offset(bytes_len);
8536            let mut _prev_end_offset: usize = 0;
8537            if 1 > max_ordinal {
8538                return Ok(());
8539            }
8540
8541            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8542            // are envelope_size bytes.
8543            let cur_offset: usize = (1 - 1) * envelope_size;
8544
8545            // Zero reserved fields.
8546            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8547
8548            // Safety:
8549            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8550            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8551            //   envelope_size bytes, there is always sufficient room.
8552            fidl::encoding::encode_in_envelope_optional::<i32, D>(
8553                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
8554                encoder,
8555                offset + cur_offset,
8556                depth,
8557            )?;
8558
8559            _prev_end_offset = cur_offset + envelope_size;
8560            if 2 > max_ordinal {
8561                return Ok(());
8562            }
8563
8564            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8565            // are envelope_size bytes.
8566            let cur_offset: usize = (2 - 1) * envelope_size;
8567
8568            // Zero reserved fields.
8569            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8570
8571            // Safety:
8572            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8573            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8574            //   envelope_size bytes, there is always sufficient room.
8575            fidl::encoding::encode_in_envelope_optional::<u64, D>(
8576                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
8577                encoder,
8578                offset + cur_offset,
8579                depth,
8580            )?;
8581
8582            _prev_end_offset = cur_offset + envelope_size;
8583
8584            Ok(())
8585        }
8586    }
8587
8588    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8589        for WlanSoftmacIfcBaseNotifyScanCompleteRequest
8590    {
8591        #[inline(always)]
8592        fn new_empty() -> Self {
8593            Self::default()
8594        }
8595
8596        unsafe fn decode(
8597            &mut self,
8598            decoder: &mut fidl::encoding::Decoder<'_, D>,
8599            offset: usize,
8600            mut depth: fidl::encoding::Depth,
8601        ) -> fidl::Result<()> {
8602            decoder.debug_check_bounds::<Self>(offset);
8603            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8604                None => return Err(fidl::Error::NotNullable),
8605                Some(len) => len,
8606            };
8607            // Calling decoder.out_of_line_offset(0) is not allowed.
8608            if len == 0 {
8609                return Ok(());
8610            };
8611            depth.increment()?;
8612            let envelope_size = 8;
8613            let bytes_len = len * envelope_size;
8614            let offset = decoder.out_of_line_offset(bytes_len)?;
8615            // Decode the envelope for each type.
8616            let mut _next_ordinal_to_read = 0;
8617            let mut next_offset = offset;
8618            let end_offset = offset + bytes_len;
8619            _next_ordinal_to_read += 1;
8620            if next_offset >= end_offset {
8621                return Ok(());
8622            }
8623
8624            // Decode unknown envelopes for gaps in ordinals.
8625            while _next_ordinal_to_read < 1 {
8626                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8627                _next_ordinal_to_read += 1;
8628                next_offset += envelope_size;
8629            }
8630
8631            let next_out_of_line = decoder.next_out_of_line();
8632            let handles_before = decoder.remaining_handles();
8633            if let Some((inlined, num_bytes, num_handles)) =
8634                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8635            {
8636                let member_inline_size =
8637                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8638                if inlined != (member_inline_size <= 4) {
8639                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8640                }
8641                let inner_offset;
8642                let mut inner_depth = depth.clone();
8643                if inlined {
8644                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8645                    inner_offset = next_offset;
8646                } else {
8647                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8648                    inner_depth.increment()?;
8649                }
8650                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
8651                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
8652                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8653                {
8654                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8655                }
8656                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8657                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8658                }
8659            }
8660
8661            next_offset += envelope_size;
8662            _next_ordinal_to_read += 1;
8663            if next_offset >= end_offset {
8664                return Ok(());
8665            }
8666
8667            // Decode unknown envelopes for gaps in ordinals.
8668            while _next_ordinal_to_read < 2 {
8669                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8670                _next_ordinal_to_read += 1;
8671                next_offset += envelope_size;
8672            }
8673
8674            let next_out_of_line = decoder.next_out_of_line();
8675            let handles_before = decoder.remaining_handles();
8676            if let Some((inlined, num_bytes, num_handles)) =
8677                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8678            {
8679                let member_inline_size =
8680                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
8681                if inlined != (member_inline_size <= 4) {
8682                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8683                }
8684                let inner_offset;
8685                let mut inner_depth = depth.clone();
8686                if inlined {
8687                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8688                    inner_offset = next_offset;
8689                } else {
8690                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8691                    inner_depth.increment()?;
8692                }
8693                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
8694                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
8695                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8696                {
8697                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
8698                }
8699                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
8700                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
8701                }
8702            }
8703
8704            next_offset += envelope_size;
8705
8706            // Decode the remaining unknown envelopes.
8707            while next_offset < end_offset {
8708                _next_ordinal_to_read += 1;
8709                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8710                next_offset += envelope_size;
8711            }
8712
8713            Ok(())
8714        }
8715    }
8716
8717    impl WlanSoftmacQueryResponse {
8718        #[inline(always)]
8719        fn max_ordinal_present(&self) -> u64 {
8720            if let Some(_) = self.factory_addr {
8721                return 6;
8722            }
8723            if let Some(_) = self.band_caps {
8724                return 5;
8725            }
8726            if let Some(_) = self.hardware_capability {
8727                return 4;
8728            }
8729            if let Some(_) = self.supported_phys {
8730                return 3;
8731            }
8732            if let Some(_) = self.mac_role {
8733                return 2;
8734            }
8735            if let Some(_) = self.sta_addr {
8736                return 1;
8737            }
8738            0
8739        }
8740    }
8741
8742    impl fidl::encoding::ValueTypeMarker for WlanSoftmacQueryResponse {
8743        type Borrowed<'a> = &'a Self;
8744        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
8745            value
8746        }
8747    }
8748
8749    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacQueryResponse {
8750        type Owned = Self;
8751
8752        #[inline(always)]
8753        fn inline_align(_context: fidl::encoding::Context) -> usize {
8754            8
8755        }
8756
8757        #[inline(always)]
8758        fn inline_size(_context: fidl::encoding::Context) -> usize {
8759            16
8760        }
8761    }
8762
8763    unsafe impl<D: fidl::encoding::ResourceDialect>
8764        fidl::encoding::Encode<WlanSoftmacQueryResponse, D> for &WlanSoftmacQueryResponse
8765    {
8766        unsafe fn encode(
8767            self,
8768            encoder: &mut fidl::encoding::Encoder<'_, D>,
8769            offset: usize,
8770            mut depth: fidl::encoding::Depth,
8771        ) -> fidl::Result<()> {
8772            encoder.debug_check_bounds::<WlanSoftmacQueryResponse>(offset);
8773            // Vector header
8774            let max_ordinal: u64 = self.max_ordinal_present();
8775            encoder.write_num(max_ordinal, offset);
8776            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
8777            // Calling encoder.out_of_line_offset(0) is not allowed.
8778            if max_ordinal == 0 {
8779                return Ok(());
8780            }
8781            depth.increment()?;
8782            let envelope_size = 8;
8783            let bytes_len = max_ordinal as usize * envelope_size;
8784            #[allow(unused_variables)]
8785            let offset = encoder.out_of_line_offset(bytes_len);
8786            let mut _prev_end_offset: usize = 0;
8787            if 1 > max_ordinal {
8788                return Ok(());
8789            }
8790
8791            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8792            // are envelope_size bytes.
8793            let cur_offset: usize = (1 - 1) * envelope_size;
8794
8795            // Zero reserved fields.
8796            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8797
8798            // Safety:
8799            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8800            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8801            //   envelope_size bytes, there is always sufficient room.
8802            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8803                self.sta_addr
8804                    .as_ref()
8805                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8806                encoder,
8807                offset + cur_offset,
8808                depth,
8809            )?;
8810
8811            _prev_end_offset = cur_offset + envelope_size;
8812            if 2 > max_ordinal {
8813                return Ok(());
8814            }
8815
8816            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8817            // are envelope_size bytes.
8818            let cur_offset: usize = (2 - 1) * envelope_size;
8819
8820            // Zero reserved fields.
8821            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8822
8823            // Safety:
8824            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8825            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8826            //   envelope_size bytes, there is always sufficient room.
8827            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common__common::WlanMacRole, D>(
8828            self.mac_role.as_ref().map(<fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
8829            encoder, offset + cur_offset, depth
8830        )?;
8831
8832            _prev_end_offset = cur_offset + envelope_size;
8833            if 3 > max_ordinal {
8834                return Ok(());
8835            }
8836
8837            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8838            // are envelope_size bytes.
8839            let cur_offset: usize = (3 - 1) * envelope_size;
8840
8841            // Zero reserved fields.
8842            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8843
8844            // Safety:
8845            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8846            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8847            //   envelope_size bytes, there is always sufficient room.
8848            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D>(
8849            self.supported_phys.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow),
8850            encoder, offset + cur_offset, depth
8851        )?;
8852
8853            _prev_end_offset = cur_offset + envelope_size;
8854            if 4 > max_ordinal {
8855                return Ok(());
8856            }
8857
8858            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8859            // are envelope_size bytes.
8860            let cur_offset: usize = (4 - 1) * envelope_size;
8861
8862            // Zero reserved fields.
8863            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8864
8865            // Safety:
8866            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8867            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8868            //   envelope_size bytes, there is always sufficient room.
8869            fidl::encoding::encode_in_envelope_optional::<u32, D>(
8870                self.hardware_capability
8871                    .as_ref()
8872                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
8873                encoder,
8874                offset + cur_offset,
8875                depth,
8876            )?;
8877
8878            _prev_end_offset = cur_offset + envelope_size;
8879            if 5 > max_ordinal {
8880                return Ok(());
8881            }
8882
8883            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8884            // are envelope_size bytes.
8885            let cur_offset: usize = (5 - 1) * envelope_size;
8886
8887            // Zero reserved fields.
8888            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8889
8890            // Safety:
8891            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8892            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8893            //   envelope_size bytes, there is always sufficient room.
8894            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D>(
8895            self.band_caps.as_ref().map(<fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
8896            encoder, offset + cur_offset, depth
8897        )?;
8898
8899            _prev_end_offset = cur_offset + envelope_size;
8900            if 6 > max_ordinal {
8901                return Ok(());
8902            }
8903
8904            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
8905            // are envelope_size bytes.
8906            let cur_offset: usize = (6 - 1) * envelope_size;
8907
8908            // Zero reserved fields.
8909            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
8910
8911            // Safety:
8912            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
8913            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
8914            //   envelope_size bytes, there is always sufficient room.
8915            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
8916                self.factory_addr
8917                    .as_ref()
8918                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
8919                encoder,
8920                offset + cur_offset,
8921                depth,
8922            )?;
8923
8924            _prev_end_offset = cur_offset + envelope_size;
8925
8926            Ok(())
8927        }
8928    }
8929
8930    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
8931        for WlanSoftmacQueryResponse
8932    {
8933        #[inline(always)]
8934        fn new_empty() -> Self {
8935            Self::default()
8936        }
8937
8938        unsafe fn decode(
8939            &mut self,
8940            decoder: &mut fidl::encoding::Decoder<'_, D>,
8941            offset: usize,
8942            mut depth: fidl::encoding::Depth,
8943        ) -> fidl::Result<()> {
8944            decoder.debug_check_bounds::<Self>(offset);
8945            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
8946                None => return Err(fidl::Error::NotNullable),
8947                Some(len) => len,
8948            };
8949            // Calling decoder.out_of_line_offset(0) is not allowed.
8950            if len == 0 {
8951                return Ok(());
8952            };
8953            depth.increment()?;
8954            let envelope_size = 8;
8955            let bytes_len = len * envelope_size;
8956            let offset = decoder.out_of_line_offset(bytes_len)?;
8957            // Decode the envelope for each type.
8958            let mut _next_ordinal_to_read = 0;
8959            let mut next_offset = offset;
8960            let end_offset = offset + bytes_len;
8961            _next_ordinal_to_read += 1;
8962            if next_offset >= end_offset {
8963                return Ok(());
8964            }
8965
8966            // Decode unknown envelopes for gaps in ordinals.
8967            while _next_ordinal_to_read < 1 {
8968                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
8969                _next_ordinal_to_read += 1;
8970                next_offset += envelope_size;
8971            }
8972
8973            let next_out_of_line = decoder.next_out_of_line();
8974            let handles_before = decoder.remaining_handles();
8975            if let Some((inlined, num_bytes, num_handles)) =
8976                fidl::encoding::decode_envelope_header(decoder, next_offset)?
8977            {
8978                let member_inline_size =
8979                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
8980                        decoder.context,
8981                    );
8982                if inlined != (member_inline_size <= 4) {
8983                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
8984                }
8985                let inner_offset;
8986                let mut inner_depth = depth.clone();
8987                if inlined {
8988                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
8989                    inner_offset = next_offset;
8990                } else {
8991                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
8992                    inner_depth.increment()?;
8993                }
8994                let val_ref = self
8995                    .sta_addr
8996                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
8997                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
8998                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
8999                {
9000                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9001                }
9002                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9003                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9004                }
9005            }
9006
9007            next_offset += envelope_size;
9008            _next_ordinal_to_read += 1;
9009            if next_offset >= end_offset {
9010                return Ok(());
9011            }
9012
9013            // Decode unknown envelopes for gaps in ordinals.
9014            while _next_ordinal_to_read < 2 {
9015                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9016                _next_ordinal_to_read += 1;
9017                next_offset += envelope_size;
9018            }
9019
9020            let next_out_of_line = decoder.next_out_of_line();
9021            let handles_before = decoder.remaining_handles();
9022            if let Some((inlined, num_bytes, num_handles)) =
9023                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9024            {
9025                let member_inline_size = <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9026                if inlined != (member_inline_size <= 4) {
9027                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9028                }
9029                let inner_offset;
9030                let mut inner_depth = depth.clone();
9031                if inlined {
9032                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9033                    inner_offset = next_offset;
9034                } else {
9035                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9036                    inner_depth.increment()?;
9037                }
9038                let val_ref = self.mac_role.get_or_insert_with(|| {
9039                    fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D)
9040                });
9041                fidl::decode!(
9042                    fidl_fuchsia_wlan_common__common::WlanMacRole,
9043                    D,
9044                    val_ref,
9045                    decoder,
9046                    inner_offset,
9047                    inner_depth
9048                )?;
9049                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9050                {
9051                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9052                }
9053                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9054                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9055                }
9056            }
9057
9058            next_offset += envelope_size;
9059            _next_ordinal_to_read += 1;
9060            if next_offset >= end_offset {
9061                return Ok(());
9062            }
9063
9064            // Decode unknown envelopes for gaps in ordinals.
9065            while _next_ordinal_to_read < 3 {
9066                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9067                _next_ordinal_to_read += 1;
9068                next_offset += envelope_size;
9069            }
9070
9071            let next_out_of_line = decoder.next_out_of_line();
9072            let handles_before = decoder.remaining_handles();
9073            if let Some((inlined, num_bytes, num_handles)) =
9074                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9075            {
9076                let member_inline_size = <fidl::encoding::Vector<
9077                    fidl_fuchsia_wlan_common__common::WlanPhyType,
9078                    64,
9079                > as fidl::encoding::TypeMarker>::inline_size(
9080                    decoder.context
9081                );
9082                if inlined != (member_inline_size <= 4) {
9083                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9084                }
9085                let inner_offset;
9086                let mut inner_depth = depth.clone();
9087                if inlined {
9088                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9089                    inner_offset = next_offset;
9090                } else {
9091                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9092                    inner_depth.increment()?;
9093                }
9094                let val_ref =
9095                self.supported_phys.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D));
9096                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
9097                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9098                {
9099                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9100                }
9101                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9102                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9103                }
9104            }
9105
9106            next_offset += envelope_size;
9107            _next_ordinal_to_read += 1;
9108            if next_offset >= end_offset {
9109                return Ok(());
9110            }
9111
9112            // Decode unknown envelopes for gaps in ordinals.
9113            while _next_ordinal_to_read < 4 {
9114                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9115                _next_ordinal_to_read += 1;
9116                next_offset += envelope_size;
9117            }
9118
9119            let next_out_of_line = decoder.next_out_of_line();
9120            let handles_before = decoder.remaining_handles();
9121            if let Some((inlined, num_bytes, num_handles)) =
9122                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9123            {
9124                let member_inline_size =
9125                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9126                if inlined != (member_inline_size <= 4) {
9127                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9128                }
9129                let inner_offset;
9130                let mut inner_depth = depth.clone();
9131                if inlined {
9132                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9133                    inner_offset = next_offset;
9134                } else {
9135                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9136                    inner_depth.increment()?;
9137                }
9138                let val_ref =
9139                    self.hardware_capability.get_or_insert_with(|| fidl::new_empty!(u32, D));
9140                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
9141                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9142                {
9143                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9144                }
9145                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9146                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9147                }
9148            }
9149
9150            next_offset += envelope_size;
9151            _next_ordinal_to_read += 1;
9152            if next_offset >= end_offset {
9153                return Ok(());
9154            }
9155
9156            // Decode unknown envelopes for gaps in ordinals.
9157            while _next_ordinal_to_read < 5 {
9158                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9159                _next_ordinal_to_read += 1;
9160                next_offset += envelope_size;
9161            }
9162
9163            let next_out_of_line = decoder.next_out_of_line();
9164            let handles_before = decoder.remaining_handles();
9165            if let Some((inlined, num_bytes, num_handles)) =
9166                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9167            {
9168                let member_inline_size = <fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9169                if inlined != (member_inline_size <= 4) {
9170                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9171                }
9172                let inner_offset;
9173                let mut inner_depth = depth.clone();
9174                if inlined {
9175                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9176                    inner_offset = next_offset;
9177                } else {
9178                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9179                    inner_depth.increment()?;
9180                }
9181                let val_ref = self.band_caps.get_or_insert_with(
9182                    || fidl::new_empty!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D),
9183                );
9184                fidl::decode!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
9185                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9186                {
9187                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9188                }
9189                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9190                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9191                }
9192            }
9193
9194            next_offset += envelope_size;
9195            _next_ordinal_to_read += 1;
9196            if next_offset >= end_offset {
9197                return Ok(());
9198            }
9199
9200            // Decode unknown envelopes for gaps in ordinals.
9201            while _next_ordinal_to_read < 6 {
9202                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9203                _next_ordinal_to_read += 1;
9204                next_offset += envelope_size;
9205            }
9206
9207            let next_out_of_line = decoder.next_out_of_line();
9208            let handles_before = decoder.remaining_handles();
9209            if let Some((inlined, num_bytes, num_handles)) =
9210                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9211            {
9212                let member_inline_size =
9213                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
9214                        decoder.context,
9215                    );
9216                if inlined != (member_inline_size <= 4) {
9217                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9218                }
9219                let inner_offset;
9220                let mut inner_depth = depth.clone();
9221                if inlined {
9222                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9223                    inner_offset = next_offset;
9224                } else {
9225                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9226                    inner_depth.increment()?;
9227                }
9228                let val_ref = self
9229                    .factory_addr
9230                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
9231                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
9232                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9233                {
9234                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9235                }
9236                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9237                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9238                }
9239            }
9240
9241            next_offset += envelope_size;
9242
9243            // Decode the remaining unknown envelopes.
9244            while next_offset < end_offset {
9245                _next_ordinal_to_read += 1;
9246                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9247                next_offset += envelope_size;
9248            }
9249
9250            Ok(())
9251        }
9252    }
9253
9254    impl WlanSoftmacStartActiveScanRequest {
9255        #[inline(always)]
9256        fn max_ordinal_present(&self) -> u64 {
9257            if let Some(_) = self.max_probes_per_channel {
9258                return 9;
9259            }
9260            if let Some(_) = self.min_probes_per_channel {
9261                return 8;
9262            }
9263            if let Some(_) = self.min_home_time {
9264                return 7;
9265            }
9266            if let Some(_) = self.max_channel_time {
9267                return 6;
9268            }
9269            if let Some(_) = self.min_channel_time {
9270                return 5;
9271            }
9272            if let Some(_) = self.ies {
9273                return 4;
9274            }
9275            if let Some(_) = self.mac_header {
9276                return 3;
9277            }
9278            if let Some(_) = self.ssids {
9279                return 2;
9280            }
9281            if let Some(_) = self.channels {
9282                return 1;
9283            }
9284            0
9285        }
9286    }
9287
9288    impl fidl::encoding::ValueTypeMarker for WlanSoftmacStartActiveScanRequest {
9289        type Borrowed<'a> = &'a Self;
9290        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
9291            value
9292        }
9293    }
9294
9295    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacStartActiveScanRequest {
9296        type Owned = Self;
9297
9298        #[inline(always)]
9299        fn inline_align(_context: fidl::encoding::Context) -> usize {
9300            8
9301        }
9302
9303        #[inline(always)]
9304        fn inline_size(_context: fidl::encoding::Context) -> usize {
9305            16
9306        }
9307    }
9308
9309    unsafe impl<D: fidl::encoding::ResourceDialect>
9310        fidl::encoding::Encode<WlanSoftmacStartActiveScanRequest, D>
9311        for &WlanSoftmacStartActiveScanRequest
9312    {
9313        unsafe fn encode(
9314            self,
9315            encoder: &mut fidl::encoding::Encoder<'_, D>,
9316            offset: usize,
9317            mut depth: fidl::encoding::Depth,
9318        ) -> fidl::Result<()> {
9319            encoder.debug_check_bounds::<WlanSoftmacStartActiveScanRequest>(offset);
9320            // Vector header
9321            let max_ordinal: u64 = self.max_ordinal_present();
9322            encoder.write_num(max_ordinal, offset);
9323            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
9324            // Calling encoder.out_of_line_offset(0) is not allowed.
9325            if max_ordinal == 0 {
9326                return Ok(());
9327            }
9328            depth.increment()?;
9329            let envelope_size = 8;
9330            let bytes_len = max_ordinal as usize * envelope_size;
9331            #[allow(unused_variables)]
9332            let offset = encoder.out_of_line_offset(bytes_len);
9333            let mut _prev_end_offset: usize = 0;
9334            if 1 > max_ordinal {
9335                return Ok(());
9336            }
9337
9338            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9339            // are envelope_size bytes.
9340            let cur_offset: usize = (1 - 1) * envelope_size;
9341
9342            // Zero reserved fields.
9343            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9344
9345            // Safety:
9346            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9347            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9348            //   envelope_size bytes, there is always sufficient room.
9349            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
9350                self.channels.as_ref().map(
9351                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
9352                ),
9353                encoder,
9354                offset + cur_offset,
9355                depth,
9356            )?;
9357
9358            _prev_end_offset = cur_offset + envelope_size;
9359            if 2 > max_ordinal {
9360                return Ok(());
9361            }
9362
9363            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9364            // are envelope_size bytes.
9365            let cur_offset: usize = (2 - 1) * envelope_size;
9366
9367            // Zero reserved fields.
9368            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9369
9370            // Safety:
9371            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9372            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9373            //   envelope_size bytes, there is always sufficient room.
9374            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D>(
9375            self.ssids.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84> as fidl::encoding::ValueTypeMarker>::borrow),
9376            encoder, offset + cur_offset, depth
9377        )?;
9378
9379            _prev_end_offset = cur_offset + envelope_size;
9380            if 3 > max_ordinal {
9381                return Ok(());
9382            }
9383
9384            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9385            // are envelope_size bytes.
9386            let cur_offset: usize = (3 - 1) * envelope_size;
9387
9388            // Zero reserved fields.
9389            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9390
9391            // Safety:
9392            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9393            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9394            //   envelope_size bytes, there is always sufficient room.
9395            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 28>, D>(
9396                self.mac_header.as_ref().map(
9397                    <fidl::encoding::Vector<u8, 28> as fidl::encoding::ValueTypeMarker>::borrow,
9398                ),
9399                encoder,
9400                offset + cur_offset,
9401                depth,
9402            )?;
9403
9404            _prev_end_offset = cur_offset + envelope_size;
9405            if 4 > max_ordinal {
9406                return Ok(());
9407            }
9408
9409            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9410            // are envelope_size bytes.
9411            let cur_offset: usize = (4 - 1) * envelope_size;
9412
9413            // Zero reserved fields.
9414            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9415
9416            // Safety:
9417            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9418            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9419            //   envelope_size bytes, there is always sufficient room.
9420            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 11454>, D>(
9421                self.ies.as_ref().map(
9422                    <fidl::encoding::Vector<u8, 11454> as fidl::encoding::ValueTypeMarker>::borrow,
9423                ),
9424                encoder,
9425                offset + cur_offset,
9426                depth,
9427            )?;
9428
9429            _prev_end_offset = cur_offset + envelope_size;
9430            if 5 > max_ordinal {
9431                return Ok(());
9432            }
9433
9434            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9435            // are envelope_size bytes.
9436            let cur_offset: usize = (5 - 1) * envelope_size;
9437
9438            // Zero reserved fields.
9439            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9440
9441            // Safety:
9442            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9443            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9444            //   envelope_size bytes, there is always sufficient room.
9445            fidl::encoding::encode_in_envelope_optional::<i64, D>(
9446                self.min_channel_time
9447                    .as_ref()
9448                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9449                encoder,
9450                offset + cur_offset,
9451                depth,
9452            )?;
9453
9454            _prev_end_offset = cur_offset + envelope_size;
9455            if 6 > max_ordinal {
9456                return Ok(());
9457            }
9458
9459            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9460            // are envelope_size bytes.
9461            let cur_offset: usize = (6 - 1) * envelope_size;
9462
9463            // Zero reserved fields.
9464            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9465
9466            // Safety:
9467            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9468            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9469            //   envelope_size bytes, there is always sufficient room.
9470            fidl::encoding::encode_in_envelope_optional::<i64, D>(
9471                self.max_channel_time
9472                    .as_ref()
9473                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9474                encoder,
9475                offset + cur_offset,
9476                depth,
9477            )?;
9478
9479            _prev_end_offset = cur_offset + envelope_size;
9480            if 7 > max_ordinal {
9481                return Ok(());
9482            }
9483
9484            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9485            // are envelope_size bytes.
9486            let cur_offset: usize = (7 - 1) * envelope_size;
9487
9488            // Zero reserved fields.
9489            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9490
9491            // Safety:
9492            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9493            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9494            //   envelope_size bytes, there is always sufficient room.
9495            fidl::encoding::encode_in_envelope_optional::<i64, D>(
9496                self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
9497                encoder,
9498                offset + cur_offset,
9499                depth,
9500            )?;
9501
9502            _prev_end_offset = cur_offset + envelope_size;
9503            if 8 > max_ordinal {
9504                return Ok(());
9505            }
9506
9507            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9508            // are envelope_size bytes.
9509            let cur_offset: usize = (8 - 1) * envelope_size;
9510
9511            // Zero reserved fields.
9512            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9513
9514            // Safety:
9515            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9516            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9517            //   envelope_size bytes, there is always sufficient room.
9518            fidl::encoding::encode_in_envelope_optional::<u8, D>(
9519                self.min_probes_per_channel
9520                    .as_ref()
9521                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9522                encoder,
9523                offset + cur_offset,
9524                depth,
9525            )?;
9526
9527            _prev_end_offset = cur_offset + envelope_size;
9528            if 9 > max_ordinal {
9529                return Ok(());
9530            }
9531
9532            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
9533            // are envelope_size bytes.
9534            let cur_offset: usize = (9 - 1) * envelope_size;
9535
9536            // Zero reserved fields.
9537            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
9538
9539            // Safety:
9540            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
9541            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
9542            //   envelope_size bytes, there is always sufficient room.
9543            fidl::encoding::encode_in_envelope_optional::<u8, D>(
9544                self.max_probes_per_channel
9545                    .as_ref()
9546                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
9547                encoder,
9548                offset + cur_offset,
9549                depth,
9550            )?;
9551
9552            _prev_end_offset = cur_offset + envelope_size;
9553
9554            Ok(())
9555        }
9556    }
9557
9558    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
9559        for WlanSoftmacStartActiveScanRequest
9560    {
9561        #[inline(always)]
9562        fn new_empty() -> Self {
9563            Self::default()
9564        }
9565
9566        unsafe fn decode(
9567            &mut self,
9568            decoder: &mut fidl::encoding::Decoder<'_, D>,
9569            offset: usize,
9570            mut depth: fidl::encoding::Depth,
9571        ) -> fidl::Result<()> {
9572            decoder.debug_check_bounds::<Self>(offset);
9573            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
9574                None => return Err(fidl::Error::NotNullable),
9575                Some(len) => len,
9576            };
9577            // Calling decoder.out_of_line_offset(0) is not allowed.
9578            if len == 0 {
9579                return Ok(());
9580            };
9581            depth.increment()?;
9582            let envelope_size = 8;
9583            let bytes_len = len * envelope_size;
9584            let offset = decoder.out_of_line_offset(bytes_len)?;
9585            // Decode the envelope for each type.
9586            let mut _next_ordinal_to_read = 0;
9587            let mut next_offset = offset;
9588            let end_offset = offset + bytes_len;
9589            _next_ordinal_to_read += 1;
9590            if next_offset >= end_offset {
9591                return Ok(());
9592            }
9593
9594            // Decode unknown envelopes for gaps in ordinals.
9595            while _next_ordinal_to_read < 1 {
9596                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9597                _next_ordinal_to_read += 1;
9598                next_offset += envelope_size;
9599            }
9600
9601            let next_out_of_line = decoder.next_out_of_line();
9602            let handles_before = decoder.remaining_handles();
9603            if let Some((inlined, num_bytes, num_handles)) =
9604                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9605            {
9606                let member_inline_size =
9607                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
9608                        decoder.context,
9609                    );
9610                if inlined != (member_inline_size <= 4) {
9611                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9612                }
9613                let inner_offset;
9614                let mut inner_depth = depth.clone();
9615                if inlined {
9616                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9617                    inner_offset = next_offset;
9618                } else {
9619                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9620                    inner_depth.increment()?;
9621                }
9622                let val_ref = self
9623                    .channels
9624                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
9625                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
9626                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9627                {
9628                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9629                }
9630                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9631                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9632                }
9633            }
9634
9635            next_offset += envelope_size;
9636            _next_ordinal_to_read += 1;
9637            if next_offset >= end_offset {
9638                return Ok(());
9639            }
9640
9641            // Decode unknown envelopes for gaps in ordinals.
9642            while _next_ordinal_to_read < 2 {
9643                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9644                _next_ordinal_to_read += 1;
9645                next_offset += envelope_size;
9646            }
9647
9648            let next_out_of_line = decoder.next_out_of_line();
9649            let handles_before = decoder.remaining_handles();
9650            if let Some((inlined, num_bytes, num_handles)) =
9651                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9652            {
9653                let member_inline_size = <fidl::encoding::Vector<
9654                    fidl_fuchsia_wlan_ieee80211__common::CSsid,
9655                    84,
9656                > as fidl::encoding::TypeMarker>::inline_size(
9657                    decoder.context
9658                );
9659                if inlined != (member_inline_size <= 4) {
9660                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9661                }
9662                let inner_offset;
9663                let mut inner_depth = depth.clone();
9664                if inlined {
9665                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9666                    inner_offset = next_offset;
9667                } else {
9668                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9669                    inner_depth.increment()?;
9670                }
9671                let val_ref =
9672                self.ssids.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D));
9673                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211__common::CSsid, 84>, D, val_ref, decoder, inner_offset, inner_depth)?;
9674                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9675                {
9676                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9677                }
9678                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9679                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9680                }
9681            }
9682
9683            next_offset += envelope_size;
9684            _next_ordinal_to_read += 1;
9685            if next_offset >= end_offset {
9686                return Ok(());
9687            }
9688
9689            // Decode unknown envelopes for gaps in ordinals.
9690            while _next_ordinal_to_read < 3 {
9691                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9692                _next_ordinal_to_read += 1;
9693                next_offset += envelope_size;
9694            }
9695
9696            let next_out_of_line = decoder.next_out_of_line();
9697            let handles_before = decoder.remaining_handles();
9698            if let Some((inlined, num_bytes, num_handles)) =
9699                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9700            {
9701                let member_inline_size =
9702                    <fidl::encoding::Vector<u8, 28> as fidl::encoding::TypeMarker>::inline_size(
9703                        decoder.context,
9704                    );
9705                if inlined != (member_inline_size <= 4) {
9706                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9707                }
9708                let inner_offset;
9709                let mut inner_depth = depth.clone();
9710                if inlined {
9711                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9712                    inner_offset = next_offset;
9713                } else {
9714                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9715                    inner_depth.increment()?;
9716                }
9717                let val_ref = self
9718                    .mac_header
9719                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 28>, D));
9720                fidl::decode!(fidl::encoding::Vector<u8, 28>, D, val_ref, decoder, inner_offset, inner_depth)?;
9721                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9722                {
9723                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9724                }
9725                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9726                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9727                }
9728            }
9729
9730            next_offset += envelope_size;
9731            _next_ordinal_to_read += 1;
9732            if next_offset >= end_offset {
9733                return Ok(());
9734            }
9735
9736            // Decode unknown envelopes for gaps in ordinals.
9737            while _next_ordinal_to_read < 4 {
9738                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9739                _next_ordinal_to_read += 1;
9740                next_offset += envelope_size;
9741            }
9742
9743            let next_out_of_line = decoder.next_out_of_line();
9744            let handles_before = decoder.remaining_handles();
9745            if let Some((inlined, num_bytes, num_handles)) =
9746                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9747            {
9748                let member_inline_size =
9749                    <fidl::encoding::Vector<u8, 11454> as fidl::encoding::TypeMarker>::inline_size(
9750                        decoder.context,
9751                    );
9752                if inlined != (member_inline_size <= 4) {
9753                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9754                }
9755                let inner_offset;
9756                let mut inner_depth = depth.clone();
9757                if inlined {
9758                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9759                    inner_offset = next_offset;
9760                } else {
9761                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9762                    inner_depth.increment()?;
9763                }
9764                let val_ref = self
9765                    .ies
9766                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 11454>, D));
9767                fidl::decode!(fidl::encoding::Vector<u8, 11454>, D, val_ref, decoder, inner_offset, inner_depth)?;
9768                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9769                {
9770                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9771                }
9772                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9773                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9774                }
9775            }
9776
9777            next_offset += envelope_size;
9778            _next_ordinal_to_read += 1;
9779            if next_offset >= end_offset {
9780                return Ok(());
9781            }
9782
9783            // Decode unknown envelopes for gaps in ordinals.
9784            while _next_ordinal_to_read < 5 {
9785                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9786                _next_ordinal_to_read += 1;
9787                next_offset += envelope_size;
9788            }
9789
9790            let next_out_of_line = decoder.next_out_of_line();
9791            let handles_before = decoder.remaining_handles();
9792            if let Some((inlined, num_bytes, num_handles)) =
9793                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9794            {
9795                let member_inline_size =
9796                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9797                if inlined != (member_inline_size <= 4) {
9798                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9799                }
9800                let inner_offset;
9801                let mut inner_depth = depth.clone();
9802                if inlined {
9803                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9804                    inner_offset = next_offset;
9805                } else {
9806                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9807                    inner_depth.increment()?;
9808                }
9809                let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9810                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9811                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9812                {
9813                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9814                }
9815                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9816                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9817                }
9818            }
9819
9820            next_offset += envelope_size;
9821            _next_ordinal_to_read += 1;
9822            if next_offset >= end_offset {
9823                return Ok(());
9824            }
9825
9826            // Decode unknown envelopes for gaps in ordinals.
9827            while _next_ordinal_to_read < 6 {
9828                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9829                _next_ordinal_to_read += 1;
9830                next_offset += envelope_size;
9831            }
9832
9833            let next_out_of_line = decoder.next_out_of_line();
9834            let handles_before = decoder.remaining_handles();
9835            if let Some((inlined, num_bytes, num_handles)) =
9836                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9837            {
9838                let member_inline_size =
9839                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9840                if inlined != (member_inline_size <= 4) {
9841                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9842                }
9843                let inner_offset;
9844                let mut inner_depth = depth.clone();
9845                if inlined {
9846                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9847                    inner_offset = next_offset;
9848                } else {
9849                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9850                    inner_depth.increment()?;
9851                }
9852                let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9853                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9854                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9855                {
9856                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9857                }
9858                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9859                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9860                }
9861            }
9862
9863            next_offset += envelope_size;
9864            _next_ordinal_to_read += 1;
9865            if next_offset >= end_offset {
9866                return Ok(());
9867            }
9868
9869            // Decode unknown envelopes for gaps in ordinals.
9870            while _next_ordinal_to_read < 7 {
9871                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9872                _next_ordinal_to_read += 1;
9873                next_offset += envelope_size;
9874            }
9875
9876            let next_out_of_line = decoder.next_out_of_line();
9877            let handles_before = decoder.remaining_handles();
9878            if let Some((inlined, num_bytes, num_handles)) =
9879                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9880            {
9881                let member_inline_size =
9882                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9883                if inlined != (member_inline_size <= 4) {
9884                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9885                }
9886                let inner_offset;
9887                let mut inner_depth = depth.clone();
9888                if inlined {
9889                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9890                    inner_offset = next_offset;
9891                } else {
9892                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9893                    inner_depth.increment()?;
9894                }
9895                let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
9896                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
9897                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9898                {
9899                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9900                }
9901                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9902                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9903                }
9904            }
9905
9906            next_offset += envelope_size;
9907            _next_ordinal_to_read += 1;
9908            if next_offset >= end_offset {
9909                return Ok(());
9910            }
9911
9912            // Decode unknown envelopes for gaps in ordinals.
9913            while _next_ordinal_to_read < 8 {
9914                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9915                _next_ordinal_to_read += 1;
9916                next_offset += envelope_size;
9917            }
9918
9919            let next_out_of_line = decoder.next_out_of_line();
9920            let handles_before = decoder.remaining_handles();
9921            if let Some((inlined, num_bytes, num_handles)) =
9922                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9923            {
9924                let member_inline_size =
9925                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9926                if inlined != (member_inline_size <= 4) {
9927                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9928                }
9929                let inner_offset;
9930                let mut inner_depth = depth.clone();
9931                if inlined {
9932                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9933                    inner_offset = next_offset;
9934                } else {
9935                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9936                    inner_depth.increment()?;
9937                }
9938                let val_ref =
9939                    self.min_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9940                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9941                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9942                {
9943                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9944                }
9945                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9946                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9947                }
9948            }
9949
9950            next_offset += envelope_size;
9951            _next_ordinal_to_read += 1;
9952            if next_offset >= end_offset {
9953                return Ok(());
9954            }
9955
9956            // Decode unknown envelopes for gaps in ordinals.
9957            while _next_ordinal_to_read < 9 {
9958                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
9959                _next_ordinal_to_read += 1;
9960                next_offset += envelope_size;
9961            }
9962
9963            let next_out_of_line = decoder.next_out_of_line();
9964            let handles_before = decoder.remaining_handles();
9965            if let Some((inlined, num_bytes, num_handles)) =
9966                fidl::encoding::decode_envelope_header(decoder, next_offset)?
9967            {
9968                let member_inline_size =
9969                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
9970                if inlined != (member_inline_size <= 4) {
9971                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
9972                }
9973                let inner_offset;
9974                let mut inner_depth = depth.clone();
9975                if inlined {
9976                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
9977                    inner_offset = next_offset;
9978                } else {
9979                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
9980                    inner_depth.increment()?;
9981                }
9982                let val_ref =
9983                    self.max_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
9984                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
9985                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
9986                {
9987                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
9988                }
9989                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
9990                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
9991                }
9992            }
9993
9994            next_offset += envelope_size;
9995
9996            // Decode the remaining unknown envelopes.
9997            while next_offset < end_offset {
9998                _next_ordinal_to_read += 1;
9999                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10000                next_offset += envelope_size;
10001            }
10002
10003            Ok(())
10004        }
10005    }
10006
10007    impl WlanTxTransferRequest {
10008        #[inline(always)]
10009        fn max_ordinal_present(&self) -> u64 {
10010            if let Some(_) = self.arena {
10011                return 5;
10012            }
10013            if let Some(_) = self.async_id {
10014                return 4;
10015            }
10016            if let Some(_) = self.packet_info {
10017                return 3;
10018            }
10019            if let Some(_) = self.packet_size {
10020                return 2;
10021            }
10022            if let Some(_) = self.packet_address {
10023                return 1;
10024            }
10025            0
10026        }
10027    }
10028
10029    impl fidl::encoding::ValueTypeMarker for WlanTxTransferRequest {
10030        type Borrowed<'a> = &'a Self;
10031        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10032            value
10033        }
10034    }
10035
10036    unsafe impl fidl::encoding::TypeMarker for WlanTxTransferRequest {
10037        type Owned = Self;
10038
10039        #[inline(always)]
10040        fn inline_align(_context: fidl::encoding::Context) -> usize {
10041            8
10042        }
10043
10044        #[inline(always)]
10045        fn inline_size(_context: fidl::encoding::Context) -> usize {
10046            16
10047        }
10048    }
10049
10050    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxTransferRequest, D>
10051        for &WlanTxTransferRequest
10052    {
10053        unsafe fn encode(
10054            self,
10055            encoder: &mut fidl::encoding::Encoder<'_, D>,
10056            offset: usize,
10057            mut depth: fidl::encoding::Depth,
10058        ) -> fidl::Result<()> {
10059            encoder.debug_check_bounds::<WlanTxTransferRequest>(offset);
10060            // Vector header
10061            let max_ordinal: u64 = self.max_ordinal_present();
10062            encoder.write_num(max_ordinal, offset);
10063            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
10064            // Calling encoder.out_of_line_offset(0) is not allowed.
10065            if max_ordinal == 0 {
10066                return Ok(());
10067            }
10068            depth.increment()?;
10069            let envelope_size = 8;
10070            let bytes_len = max_ordinal as usize * envelope_size;
10071            #[allow(unused_variables)]
10072            let offset = encoder.out_of_line_offset(bytes_len);
10073            let mut _prev_end_offset: usize = 0;
10074            if 1 > max_ordinal {
10075                return Ok(());
10076            }
10077
10078            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10079            // are envelope_size bytes.
10080            let cur_offset: usize = (1 - 1) * envelope_size;
10081
10082            // Zero reserved fields.
10083            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10084
10085            // Safety:
10086            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10087            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10088            //   envelope_size bytes, there is always sufficient room.
10089            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10090                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10091                encoder,
10092                offset + cur_offset,
10093                depth,
10094            )?;
10095
10096            _prev_end_offset = cur_offset + envelope_size;
10097            if 2 > max_ordinal {
10098                return Ok(());
10099            }
10100
10101            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10102            // are envelope_size bytes.
10103            let cur_offset: usize = (2 - 1) * envelope_size;
10104
10105            // Zero reserved fields.
10106            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10107
10108            // Safety:
10109            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10110            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10111            //   envelope_size bytes, there is always sufficient room.
10112            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10113                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10114                encoder,
10115                offset + cur_offset,
10116                depth,
10117            )?;
10118
10119            _prev_end_offset = cur_offset + envelope_size;
10120            if 3 > max_ordinal {
10121                return Ok(());
10122            }
10123
10124            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10125            // are envelope_size bytes.
10126            let cur_offset: usize = (3 - 1) * envelope_size;
10127
10128            // Zero reserved fields.
10129            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10130
10131            // Safety:
10132            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10133            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10134            //   envelope_size bytes, there is always sufficient room.
10135            fidl::encoding::encode_in_envelope_optional::<WlanTxInfo, D>(
10136                self.packet_info
10137                    .as_ref()
10138                    .map(<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow),
10139                encoder,
10140                offset + cur_offset,
10141                depth,
10142            )?;
10143
10144            _prev_end_offset = cur_offset + envelope_size;
10145            if 4 > max_ordinal {
10146                return Ok(());
10147            }
10148
10149            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10150            // are envelope_size bytes.
10151            let cur_offset: usize = (4 - 1) * envelope_size;
10152
10153            // Zero reserved fields.
10154            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10155
10156            // Safety:
10157            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10158            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10159            //   envelope_size bytes, there is always sufficient room.
10160            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10161                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10162                encoder,
10163                offset + cur_offset,
10164                depth,
10165            )?;
10166
10167            _prev_end_offset = cur_offset + envelope_size;
10168            if 5 > max_ordinal {
10169                return Ok(());
10170            }
10171
10172            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
10173            // are envelope_size bytes.
10174            let cur_offset: usize = (5 - 1) * envelope_size;
10175
10176            // Zero reserved fields.
10177            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
10178
10179            // Safety:
10180            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
10181            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
10182            //   envelope_size bytes, there is always sufficient room.
10183            fidl::encoding::encode_in_envelope_optional::<u64, D>(
10184                self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
10185                encoder,
10186                offset + cur_offset,
10187                depth,
10188            )?;
10189
10190            _prev_end_offset = cur_offset + envelope_size;
10191
10192            Ok(())
10193        }
10194    }
10195
10196    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxTransferRequest {
10197        #[inline(always)]
10198        fn new_empty() -> Self {
10199            Self::default()
10200        }
10201
10202        unsafe fn decode(
10203            &mut self,
10204            decoder: &mut fidl::encoding::Decoder<'_, D>,
10205            offset: usize,
10206            mut depth: fidl::encoding::Depth,
10207        ) -> fidl::Result<()> {
10208            decoder.debug_check_bounds::<Self>(offset);
10209            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
10210                None => return Err(fidl::Error::NotNullable),
10211                Some(len) => len,
10212            };
10213            // Calling decoder.out_of_line_offset(0) is not allowed.
10214            if len == 0 {
10215                return Ok(());
10216            };
10217            depth.increment()?;
10218            let envelope_size = 8;
10219            let bytes_len = len * envelope_size;
10220            let offset = decoder.out_of_line_offset(bytes_len)?;
10221            // Decode the envelope for each type.
10222            let mut _next_ordinal_to_read = 0;
10223            let mut next_offset = offset;
10224            let end_offset = offset + bytes_len;
10225            _next_ordinal_to_read += 1;
10226            if next_offset >= end_offset {
10227                return Ok(());
10228            }
10229
10230            // Decode unknown envelopes for gaps in ordinals.
10231            while _next_ordinal_to_read < 1 {
10232                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10233                _next_ordinal_to_read += 1;
10234                next_offset += envelope_size;
10235            }
10236
10237            let next_out_of_line = decoder.next_out_of_line();
10238            let handles_before = decoder.remaining_handles();
10239            if let Some((inlined, num_bytes, num_handles)) =
10240                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10241            {
10242                let member_inline_size =
10243                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10244                if inlined != (member_inline_size <= 4) {
10245                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10246                }
10247                let inner_offset;
10248                let mut inner_depth = depth.clone();
10249                if inlined {
10250                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10251                    inner_offset = next_offset;
10252                } else {
10253                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10254                    inner_depth.increment()?;
10255                }
10256                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
10257                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10258                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10259                {
10260                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10261                }
10262                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10263                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10264                }
10265            }
10266
10267            next_offset += envelope_size;
10268            _next_ordinal_to_read += 1;
10269            if next_offset >= end_offset {
10270                return Ok(());
10271            }
10272
10273            // Decode unknown envelopes for gaps in ordinals.
10274            while _next_ordinal_to_read < 2 {
10275                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10276                _next_ordinal_to_read += 1;
10277                next_offset += envelope_size;
10278            }
10279
10280            let next_out_of_line = decoder.next_out_of_line();
10281            let handles_before = decoder.remaining_handles();
10282            if let Some((inlined, num_bytes, num_handles)) =
10283                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10284            {
10285                let member_inline_size =
10286                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10287                if inlined != (member_inline_size <= 4) {
10288                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10289                }
10290                let inner_offset;
10291                let mut inner_depth = depth.clone();
10292                if inlined {
10293                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10294                    inner_offset = next_offset;
10295                } else {
10296                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10297                    inner_depth.increment()?;
10298                }
10299                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
10300                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10301                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10302                {
10303                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10304                }
10305                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10306                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10307                }
10308            }
10309
10310            next_offset += envelope_size;
10311            _next_ordinal_to_read += 1;
10312            if next_offset >= end_offset {
10313                return Ok(());
10314            }
10315
10316            // Decode unknown envelopes for gaps in ordinals.
10317            while _next_ordinal_to_read < 3 {
10318                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10319                _next_ordinal_to_read += 1;
10320                next_offset += envelope_size;
10321            }
10322
10323            let next_out_of_line = decoder.next_out_of_line();
10324            let handles_before = decoder.remaining_handles();
10325            if let Some((inlined, num_bytes, num_handles)) =
10326                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10327            {
10328                let member_inline_size =
10329                    <WlanTxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10330                if inlined != (member_inline_size <= 4) {
10331                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10332                }
10333                let inner_offset;
10334                let mut inner_depth = depth.clone();
10335                if inlined {
10336                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10337                    inner_offset = next_offset;
10338                } else {
10339                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10340                    inner_depth.increment()?;
10341                }
10342                let val_ref =
10343                    self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanTxInfo, D));
10344                fidl::decode!(WlanTxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
10345                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10346                {
10347                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10348                }
10349                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10350                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10351                }
10352            }
10353
10354            next_offset += envelope_size;
10355            _next_ordinal_to_read += 1;
10356            if next_offset >= end_offset {
10357                return Ok(());
10358            }
10359
10360            // Decode unknown envelopes for gaps in ordinals.
10361            while _next_ordinal_to_read < 4 {
10362                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10363                _next_ordinal_to_read += 1;
10364                next_offset += envelope_size;
10365            }
10366
10367            let next_out_of_line = decoder.next_out_of_line();
10368            let handles_before = decoder.remaining_handles();
10369            if let Some((inlined, num_bytes, num_handles)) =
10370                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10371            {
10372                let member_inline_size =
10373                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10374                if inlined != (member_inline_size <= 4) {
10375                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10376                }
10377                let inner_offset;
10378                let mut inner_depth = depth.clone();
10379                if inlined {
10380                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10381                    inner_offset = next_offset;
10382                } else {
10383                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10384                    inner_depth.increment()?;
10385                }
10386                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
10387                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10388                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10389                {
10390                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10391                }
10392                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10393                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10394                }
10395            }
10396
10397            next_offset += envelope_size;
10398            _next_ordinal_to_read += 1;
10399            if next_offset >= end_offset {
10400                return Ok(());
10401            }
10402
10403            // Decode unknown envelopes for gaps in ordinals.
10404            while _next_ordinal_to_read < 5 {
10405                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10406                _next_ordinal_to_read += 1;
10407                next_offset += envelope_size;
10408            }
10409
10410            let next_out_of_line = decoder.next_out_of_line();
10411            let handles_before = decoder.remaining_handles();
10412            if let Some((inlined, num_bytes, num_handles)) =
10413                fidl::encoding::decode_envelope_header(decoder, next_offset)?
10414            {
10415                let member_inline_size =
10416                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
10417                if inlined != (member_inline_size <= 4) {
10418                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
10419                }
10420                let inner_offset;
10421                let mut inner_depth = depth.clone();
10422                if inlined {
10423                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
10424                    inner_offset = next_offset;
10425                } else {
10426                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
10427                    inner_depth.increment()?;
10428                }
10429                let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
10430                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
10431                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
10432                {
10433                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
10434                }
10435                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
10436                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
10437                }
10438            }
10439
10440            next_offset += envelope_size;
10441
10442            // Decode the remaining unknown envelopes.
10443            while next_offset < end_offset {
10444                _next_ordinal_to_read += 1;
10445                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
10446                next_offset += envelope_size;
10447            }
10448
10449            Ok(())
10450        }
10451    }
10452}