fidl_fuchsia_wlan_softmac__common/
fidl_fuchsia_wlan_softmac__common.rs

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