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