fidl_fuchsia_wlan_softmac/
fidl_fuchsia_wlan_softmac.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::client::QueryResponseFut;
8use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
9use fidl::endpoints::{ControlHandle as _, Responder as _};
10use futures::future::{self, MaybeDone, TryFutureExt};
11use zx_status;
12
13pub const WLAN_MAC_MAX_RATES: u32 = 263;
14
15bitflags! {
16    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
17    pub struct WlanRxInfoFlags: u32 {
18        /// The FCS for the received frame was invalid.
19        const FCS_INVALID = 1;
20        /// Padding was added after the MAC header to align the frame body to 4 bytes.
21        const FRAME_BODY_PADDING_4 = 2;
22    }
23}
24
25impl WlanRxInfoFlags {
26    #[inline(always)]
27    pub fn from_bits_allow_unknown(bits: u32) -> Self {
28        Self::from_bits_retain(bits)
29    }
30
31    #[inline(always)]
32    pub fn has_unknown_bits(&self) -> bool {
33        self.get_unknown_bits() != 0
34    }
35
36    #[inline(always)]
37    pub fn get_unknown_bits(&self) -> u32 {
38        self.bits() & !Self::all().bits()
39    }
40}
41
42bitflags! {
43    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
44    pub struct WlanRxInfoValid: u32 {
45        const PHY = 1;
46        const DATA_RATE = 2;
47        const CHAN_WIDTH = 4;
48        const MCS = 8;
49        const RSSI = 16;
50        const SNR = 32;
51    }
52}
53
54impl WlanRxInfoValid {
55    #[inline(always)]
56    pub fn from_bits_allow_unknown(bits: u32) -> Self {
57        Self::from_bits_retain(bits)
58    }
59
60    #[inline(always)]
61    pub fn has_unknown_bits(&self) -> bool {
62        self.get_unknown_bits() != 0
63    }
64
65    #[inline(always)]
66    pub fn get_unknown_bits(&self) -> u32 {
67        self.bits() & !Self::all().bits()
68    }
69}
70
71bitflags! {
72    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
73    pub struct WlanTxInfoFlags: u32 {
74        /// Indicate this packet should be protected.
75        const PROTECTED = 1;
76        /// For rate control: indicate an important data frame, such as EAPOL, which should be sent
77        /// _reliably_ rather than fast, and is exempt from rate probing
78        const FAVOR_RELIABILITY = 2;
79        /// Indicate that this packet should be sent out with QoS header when possible (11n+).
80        const QOS = 4;
81    }
82}
83
84impl WlanTxInfoFlags {
85    #[inline(always)]
86    pub fn from_bits_allow_unknown(bits: u32) -> Self {
87        Self::from_bits_retain(bits)
88    }
89
90    #[inline(always)]
91    pub fn has_unknown_bits(&self) -> bool {
92        self.get_unknown_bits() != 0
93    }
94
95    #[inline(always)]
96    pub fn get_unknown_bits(&self) -> u32 {
97        self.bits() & !Self::all().bits()
98    }
99}
100
101bitflags! {
102    #[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
103    pub struct WlanTxInfoValid: u32 {
104        const DATA_RATE = 1;
105        const TX_VECTOR_IDX = 2;
106        const PHY = 4;
107        const CHANNEL_BANDWIDTH = 8;
108        const MCS = 16;
109    }
110}
111
112impl WlanTxInfoValid {
113    #[inline(always)]
114    pub fn from_bits_allow_unknown(bits: u32) -> Self {
115        Self::from_bits_retain(bits)
116    }
117
118    #[inline(always)]
119    pub fn has_unknown_bits(&self) -> bool {
120        self.get_unknown_bits() != 0
121    }
122
123    #[inline(always)]
124    pub fn get_unknown_bits(&self) -> u32 {
125        self.bits() & !Self::all().bits()
126    }
127}
128
129#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
130#[repr(u8)]
131pub enum WlanProtection {
132    None = 0,
133    Rx = 1,
134    Tx = 2,
135    RxTx = 3,
136}
137
138impl WlanProtection {
139    #[inline]
140    pub fn from_primitive(prim: u8) -> Option<Self> {
141        match prim {
142            0 => Some(Self::None),
143            1 => Some(Self::Rx),
144            2 => Some(Self::Tx),
145            3 => Some(Self::RxTx),
146            _ => None,
147        }
148    }
149
150    #[inline]
151    pub const fn into_primitive(self) -> u8 {
152        self as u8
153    }
154
155    #[deprecated = "Strict enums should not use `is_unknown`"]
156    #[inline]
157    pub fn is_unknown(&self) -> bool {
158        false
159    }
160}
161
162#[derive(Clone, Debug, PartialEq)]
163pub struct WlanRxInfo {
164    /// Receive flags. These represent boolean flags as opposed to enums or value-based info which
165    /// are represented below. Values should be taken from the WLAN_RX_INFO_FLAGS_* enum.
166    pub rx_flags: WlanRxInfoFlags,
167    /// Bitmask indicating which of the following fields are valid in this struct. Reserved flags
168    /// must be zero.
169    pub valid_fields: WlanRxInfoValid,
170    /// The PHY format of the device at the time of the operation.
171    pub phy: fidl_fuchsia_wlan_common::WlanPhyType,
172    /// The data rate of the device, measured in units of 0.5 Mb/s.
173    pub data_rate: u32,
174    /// The channel of the device at the time of the operation. This field must be included.
175    pub channel: fidl_fuchsia_wlan_common::WlanChannel,
176    /// The modulation and coding scheme index of the device at the time of the operation. Depends
177    /// on the PHY format and channel width.
178    pub mcs: u8,
179    /// Received Signal Strength Indicator.
180    pub rssi_dbm: i8,
181    /// Signal-to-Noise Ratio, in 0.5 dB.
182    pub snr_dbh: i16,
183}
184
185impl fidl::Persistable for WlanRxInfo {}
186
187#[derive(Clone, Debug, PartialEq)]
188pub struct WlanRxPacket {
189    pub mac_frame: Vec<u8>,
190    pub info: WlanRxInfo,
191}
192
193impl fidl::Persistable for WlanRxPacket {}
194
195#[derive(Clone, Debug, PartialEq)]
196pub struct WlanSoftmacBaseJoinBssRequest {
197    pub join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
198}
199
200impl fidl::Persistable for WlanSoftmacBaseJoinBssRequest {}
201
202#[derive(Clone, Debug, PartialEq)]
203pub struct WlanSoftmacBaseNotifyAssociationCompleteRequest {
204    pub assoc_cfg: WlanAssociationConfig,
205}
206
207impl fidl::Persistable for WlanSoftmacBaseNotifyAssociationCompleteRequest {}
208
209#[derive(Clone, Debug, PartialEq)]
210pub struct WlanSoftmacBaseQueryDiscoverySupportResponse {
211    pub resp: fidl_fuchsia_wlan_common::DiscoverySupport,
212}
213
214impl fidl::Persistable for WlanSoftmacBaseQueryDiscoverySupportResponse {}
215
216#[derive(Clone, Debug, PartialEq)]
217pub struct WlanSoftmacBaseQueryMacSublayerSupportResponse {
218    pub resp: fidl_fuchsia_wlan_common::MacSublayerSupport,
219}
220
221impl fidl::Persistable for WlanSoftmacBaseQueryMacSublayerSupportResponse {}
222
223#[derive(Clone, Debug, PartialEq)]
224pub struct WlanSoftmacBaseQuerySecuritySupportResponse {
225    pub resp: fidl_fuchsia_wlan_common::SecuritySupport,
226}
227
228impl fidl::Persistable for WlanSoftmacBaseQuerySecuritySupportResponse {}
229
230#[derive(Clone, Debug, PartialEq)]
231pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
232    pub resp: fidl_fuchsia_wlan_common::SpectrumManagementSupport,
233}
234
235impl fidl::Persistable for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {}
236
237#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
238#[repr(C)]
239pub struct WlanSoftmacBridgeSetEthernetStatusRequest {
240    pub status: u32,
241}
242
243impl fidl::Persistable for WlanSoftmacBridgeSetEthernetStatusRequest {}
244
245#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
246pub struct WlanSoftmacBridgeStartRequest {
247    pub ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
248    pub ethernet_tx: u64,
249    pub wlan_rx: u64,
250}
251
252impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
253    for WlanSoftmacBridgeStartRequest
254{
255}
256
257#[derive(Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
258pub struct WlanSoftmacBridgeStartResponse {
259    pub sme_channel: fidl::Channel,
260}
261
262impl fidl::Standalone<fidl::encoding::DefaultFuchsiaResourceDialect>
263    for WlanSoftmacBridgeStartResponse
264{
265}
266
267#[derive(Clone, Debug, PartialEq)]
268pub struct WlanSoftmacIfcBaseReportTxResultRequest {
269    pub tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
270}
271
272impl fidl::Persistable for WlanSoftmacIfcBaseReportTxResultRequest {}
273
274#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
275pub struct WlanTxInfo {
276    /// Transmit flags. These represent boolean options as opposed to enums or other value-based
277    /// info which are represented below. Values should be taken from the WLAN_TX_INFO_FLAGS_* enum.
278    pub tx_flags: u32,
279    /// Bitmask indicating which of the following fields are valid in this struct. Reserved flags
280    /// must be zero. Values for fields not indicated by a flag may be chosen at the discretion of
281    /// the softmac driver.
282    pub valid_fields: u32,
283    pub tx_vector_idx: u16,
284    pub phy: fidl_fuchsia_wlan_common::WlanPhyType,
285    pub channel_bandwidth: fidl_fuchsia_wlan_common::ChannelBandwidth,
286    /// The modulation and coding scheme index for this packet. Depends on the PHY format and
287    /// channel width.
288    pub mcs: u8,
289}
290
291impl fidl::Persistable for WlanTxInfo {}
292
293#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
294pub struct WlanTxPacket {
295    pub mac_frame: Vec<u8>,
296    /// Additional data needed to transmit the packet.
297    /// TODO(https://fxbug.dev/42056823): This field is ignored by iwlwifi.
298    pub info: WlanTxInfo,
299}
300
301impl fidl::Persistable for WlanTxPacket {}
302
303#[derive(Clone, Debug, Default, PartialEq)]
304pub struct EthernetRxTransferRequest {
305    pub packet_address: Option<u64>,
306    pub packet_size: Option<u64>,
307    #[doc(hidden)]
308    pub __source_breaking: fidl::marker::SourceBreaking,
309}
310
311impl fidl::Persistable for EthernetRxTransferRequest {}
312
313#[derive(Clone, Debug, Default, PartialEq)]
314pub struct EthernetTxTransferRequest {
315    pub packet_address: Option<u64>,
316    pub packet_size: Option<u64>,
317    pub async_id: Option<u64>,
318    pub borrowed_operation: Option<u64>,
319    pub complete_borrowed_operation: Option<u64>,
320    #[doc(hidden)]
321    pub __source_breaking: fidl::marker::SourceBreaking,
322}
323
324impl fidl::Persistable for EthernetTxTransferRequest {}
325
326/// Argument table to be passed as the single argument to
327/// WlanSoftmac.NotifyAssociationComplete.
328/// All information here is relevant only in the context of the association with
329/// the given peer_addr.
330/// All fields in this table are required unless stated otherwise.
331#[derive(Clone, Debug, Default, PartialEq)]
332pub struct WlanAssociationConfig {
333    /// The MAC address of the peer with which we are now associated.
334    pub bssid: Option<[u8; 6]>,
335    /// A unique identifier for this specific association. This is unique among
336    /// active associations, not necessarily historical ones.
337    pub aid: Option<u16>,
338    pub listen_interval: Option<u16>,
339    /// The channel on which we have associated with this peer.
340    pub channel: Option<fidl_fuchsia_wlan_common::WlanChannel>,
341    /// QoS capable and parameters
342    pub qos: Option<bool>,
343    /// WFA WMM v1.2, 2.2.2
344    pub wmm_params: Option<fidl_fuchsia_wlan_common::WlanWmmParameters>,
345    /// Concatenation of SupportedRates and ExtendedSupportedRates
346    /// IEEE Std 802.11-2016, 9.4.2.3 & 9.4.2.13
347    pub rates: Option<Vec<u8>>,
348    /// IEEE Std 802.11-2016, 9.4.1.4
349    pub capability_info: Option<u16>,
350    /// IEEE Std 802.11-2016, 9.4.2.56, 57
351    /// Rx MCS Bitmask in Supported MCS Set field represents the set of MCS
352    /// the peer can receive at from this device, considering this device's Tx capability.
353    pub ht_cap: Option<fidl_fuchsia_wlan_ieee80211::HtCapabilities>,
354    pub ht_op: Option<fidl_fuchsia_wlan_ieee80211::HtOperation>,
355    /// IEEE Std 802.11-2016, 9.4.2.158, 159
356    pub vht_cap: Option<fidl_fuchsia_wlan_ieee80211::VhtCapabilities>,
357    pub vht_op: Option<fidl_fuchsia_wlan_ieee80211::VhtOperation>,
358    #[doc(hidden)]
359    pub __source_breaking: fidl::marker::SourceBreaking,
360}
361
362impl fidl::Persistable for WlanAssociationConfig {}
363
364#[derive(Clone, Debug, Default, PartialEq)]
365pub struct WlanKeyConfiguration {
366    /// Which path to protect: None, TX, RX, or TX and RX.
367    pub protection: Option<WlanProtection>,
368    /// IEEE Cipher suite selector.
369    /// See IEEE Std 802.11-2016, 9.4.2.25.2, Table 9-131
370    pub cipher_oui: Option<[u8; 3]>,
371    pub cipher_type: Option<u8>,
372    /// Whether this key is a pairwise, group or peer key.
373    pub key_type: Option<fidl_fuchsia_wlan_common::WlanKeyType>,
374    /// The peer MAC address for pairwise and peer keys.
375    /// For group keys this value is always the broadcast address.
376    pub peer_addr: Option<[u8; 6]>,
377    /// Index for rotating keys, e.g. group keys.
378    /// This value is always 0 for key types which aren't rotating, e.g. pairwise keys.
379    pub key_idx: Option<u8>,
380    pub key: Option<Vec<u8>>,
381    /// Receive Sequence Counter for group keys only.
382    /// In all other cases the RSC will be 0.
383    pub rsc: Option<u64>,
384    #[doc(hidden)]
385    pub __source_breaking: fidl::marker::SourceBreaking,
386}
387
388impl fidl::Persistable for WlanKeyConfiguration {}
389
390#[derive(Clone, Debug, Default, PartialEq)]
391pub struct WlanRxTransferRequest {
392    pub packet_address: Option<u64>,
393    pub packet_size: Option<u64>,
394    pub packet_info: Option<WlanRxInfo>,
395    pub async_id: Option<u64>,
396    pub arena: Option<u64>,
397    #[doc(hidden)]
398    pub __source_breaking: fidl::marker::SourceBreaking,
399}
400
401impl fidl::Persistable for WlanRxTransferRequest {}
402
403/// Describes the capabilities of a SoftMAC on a particular band.
404#[derive(Clone, Debug, Default, PartialEq)]
405pub struct WlanSoftmacBandCapability {
406    pub band: Option<fidl_fuchsia_wlan_ieee80211::WlanBand>,
407    /// Count of supported basic rates. If the `basic_rate_list` field is
408    /// present, then this field **must** also be present and **must** be
409    /// consistent with the `basic_rate_list` field.
410    ///
411    /// # Deprecation
412    ///
413    /// This field has been replaced by `basic_rates`. Servers (i.e., drivers)
414    /// that target platform versions wherein `basic_rate_count` is deprecated
415    /// should omit it and write basic rates to the `basic_rates` field instead.
416    /// Clients attempt to read `basic_rates` before `basic_rate_count`.
417    pub basic_rate_count: Option<u8>,
418    /// Set of supported basic rates in units of 500 Kbit/s (as defined in IEEE
419    /// Std 802.11-2016, 9.4.2.3), e.g., 0x02 represents 1 Mbps. This set
420    /// represents all of the non-HT rates that the device supports for both
421    /// transmitting and receiving.
422    ///
423    /// The count of rates present in this field **must** be consistent with the
424    /// `basic_rate_count` field when present.
425    ///
426    /// # Deprecation
427    ///
428    /// This field has been replaced by `basic_rates`. Servers (i.e., drivers)
429    /// that target platform versions wherein `basic_rate_list` is deprecated
430    /// should omit it and write basic rates to the `basic_rates` field instead.
431    /// Clients attempt to read `basic_rates` before `basic_rate_list`.
432    pub basic_rate_list: Option<[u8; 12]>,
433    /// Determines if the `ht_caps` fields should be read by clients. If the
434    /// device supports HT PHY mode, then `ht_supported` **must** be true and
435    /// the `ht_caps` field **must** be set and provide data that describes HT
436    /// capabilities. Any other configuration of these fields means that the
437    /// device does **not** support HT PHY mode. See `HtCapabilities`.
438    ///
439    /// # Deprecation
440    ///
441    /// This field determines whether or not the `ht_caps` field is read by
442    /// clients, but is not strictly necessary as table fields like `ht_caps`
443    /// may be set or unset. Servers (i.e., drivers) that target platform
444    /// versions wherein `ht_supported` is deprecated should always set the
445    /// field to true and set `ht_caps` if the device supports HT PHY mode or
446    /// unset `ht_caps` if the device does not.
447    pub ht_supported: Option<bool>,
448    pub ht_caps: Option<fidl_fuchsia_wlan_ieee80211::HtCapabilities>,
449    /// Determines if the `vht_caps` fields should be read by clients. If the
450    /// device supports VHT PHY mode, then `vht_supported` **must** be true and
451    /// the `vht_caps` field **must** be set and provide data that describes VHT
452    /// capabilities. Any other configuration of these fields means that the
453    /// device does **not** support VHT PHY mode. See `VhtCapabilities`.
454    ///
455    /// # Deprecation
456    ///
457    /// This field determines whether or not the `vht_caps` field is read by
458    /// clients, but is not strictly necessary as table fields like `vht_caps`
459    /// may be set or unset. Servers (i.e., drivers) that target platform
460    /// versions wherein `vht_supported` is deprecated should always set the
461    /// field to true and set `vht_caps` if the device supports VHT PHY mode or
462    /// unset `vht_caps` if the device does not.
463    pub vht_supported: Option<bool>,
464    pub vht_caps: Option<fidl_fuchsia_wlan_ieee80211::VhtCapabilities>,
465    /// Count of operating channels. If the `operating_channel_list` field is
466    /// present, then this field **must** also be present and **must** be
467    /// consistent with the `operating_channel_list` field.
468    ///
469    /// # Deprecation
470    ///
471    /// This field has been replaced by `operating_channels`. Servers (i.e.,
472    /// drivers) that target platform versions wherein `operating_channel_count`
473    /// is deprecated should omit it and write operating channels to the
474    /// `operating_channels` field instead. Clients attempt to read
475    /// `operating_channels` before `operating_channel_count`.
476    pub operating_channel_count: Option<u16>,
477    /// Set of valid operating channels per regulatory information as determined
478    /// by the device driver during iface creation. An operating channel refers
479    /// to a channel on which APs may transmit beacon frames.
480    ///
481    /// The count of channels present in this field **must** be consistent with
482    /// the `operating_channel_count` field when present.
483    ///
484    /// # Deprecation
485    ///
486    /// This field has been replaced by `operating_channels`. Servers (i.e.,
487    /// drivers) that target platform versions wherein `operating_channel_list`
488    /// is deprecated should omit it and write operating channels to the
489    /// `operating_channels` field instead. Clients attempt to read
490    /// `operating_channels` before `operating_channel_list`.
491    pub operating_channel_list: Option<[u8; 256]>,
492    /// Set of supported basic rates in units of 500 Kbit/s (as defined in IEEE
493    /// Std 802.11-2016, 9.4.2.3), e.g., 0x02 represents 1 Mbps. This set
494    /// represents all of the non-HT rates that the device supports for both
495    /// transmitting and receiving.
496    pub basic_rates: Option<Vec<u8>>,
497    /// Set of valid operating channels per regulatory information as determined
498    /// by the device driver during iface creation. An operating channel refers
499    /// to a channel on which APs may transmit beacon frames.
500    ///
501    /// The client must use this set to determine the efficacy of subsequent
502    /// requests to scan a subset of channels using the iface or to determine
503    /// which operating channel to use when starting an AP.
504    pub operating_channels: Option<Vec<u8>>,
505    #[doc(hidden)]
506    pub __source_breaking: fidl::marker::SourceBreaking,
507}
508
509impl fidl::Persistable for WlanSoftmacBandCapability {}
510
511#[derive(Clone, Debug, Default, PartialEq)]
512pub struct WlanSoftmacBaseCancelScanRequest {
513    pub scan_id: Option<u64>,
514    #[doc(hidden)]
515    pub __source_breaking: fidl::marker::SourceBreaking,
516}
517
518impl fidl::Persistable for WlanSoftmacBaseCancelScanRequest {}
519
520#[derive(Clone, Debug, Default, PartialEq)]
521pub struct WlanSoftmacBaseClearAssociationRequest {
522    pub peer_addr: Option<[u8; 6]>,
523    #[doc(hidden)]
524    pub __source_breaking: fidl::marker::SourceBreaking,
525}
526
527impl fidl::Persistable for WlanSoftmacBaseClearAssociationRequest {}
528
529#[derive(Clone, Debug, Default, PartialEq)]
530pub struct WlanSoftmacBaseEnableBeaconingRequest {
531    /// Beacon template. Since this is a template, some packet content can
532    /// only contain minimal valid information, because the content is later
533    /// modified by hardware, firmware, or software.
534    pub packet_template: Option<WlanTxPacket>,
535    /// TIM offset to the start of the `packet_template` field in bytes.
536    /// This must index the first byte of the TIM IE, which is the tag ID.
537    pub tim_ele_offset: Option<u64>,
538    /// Beacon interval period in TU.
539    pub beacon_interval: Option<u16>,
540    #[doc(hidden)]
541    pub __source_breaking: fidl::marker::SourceBreaking,
542}
543
544impl fidl::Persistable for WlanSoftmacBaseEnableBeaconingRequest {}
545
546#[derive(Clone, Debug, Default, PartialEq)]
547pub struct WlanSoftmacBaseSetChannelRequest {
548    pub channel: Option<fidl_fuchsia_wlan_common::WlanChannel>,
549    #[doc(hidden)]
550    pub __source_breaking: fidl::marker::SourceBreaking,
551}
552
553impl fidl::Persistable for WlanSoftmacBaseSetChannelRequest {}
554
555#[derive(Clone, Debug, Default, PartialEq)]
556pub struct WlanSoftmacBaseStartPassiveScanRequest {
557    /// List of channels to scan on. An empty list of channels will cause a
558    /// scan request to immediately return ZX_ERR_INVALID_ARGS.
559    ///
560    /// Invalid channel numbers will be silently ignored. The validity of a channel
561    /// number depends on the current regulatory region, and a SoftMAC driver cannot
562    /// always determine the region setting. This is especially the case when
563    /// firmware changes the region setting dynamically.
564    ///
565    /// This is a required parameter.
566    pub channels: Option<Vec<u8>>,
567    /// Minimum duration to spend on each channel during the scan.
568    pub min_channel_time: Option<i64>,
569    /// Maximum duration to spend on each channel during the scan.
570    pub max_channel_time: Option<i64>,
571    /// Minimum duration to spend on the home channel(s) between the dwell time on
572    /// each channel where a home channel corresponds to channels the device should
573    /// otherwise be present on while not scanning.
574    pub min_home_time: Option<i64>,
575    #[doc(hidden)]
576    pub __source_breaking: fidl::marker::SourceBreaking,
577}
578
579impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanRequest {}
580
581#[derive(Clone, Debug, Default, PartialEq)]
582pub struct WlanSoftmacBaseUpdateWmmParametersRequest {
583    pub ac: Option<fidl_fuchsia_wlan_ieee80211::WlanAccessCategory>,
584    pub params: Option<fidl_fuchsia_wlan_common::WlanWmmParameters>,
585    #[doc(hidden)]
586    pub __source_breaking: fidl::marker::SourceBreaking,
587}
588
589impl fidl::Persistable for WlanSoftmacBaseUpdateWmmParametersRequest {}
590
591#[derive(Clone, Debug, Default, PartialEq)]
592pub struct WlanSoftmacBaseStartActiveScanResponse {
593    pub scan_id: Option<u64>,
594    #[doc(hidden)]
595    pub __source_breaking: fidl::marker::SourceBreaking,
596}
597
598impl fidl::Persistable for WlanSoftmacBaseStartActiveScanResponse {}
599
600#[derive(Clone, Debug, Default, PartialEq)]
601pub struct WlanSoftmacBaseStartPassiveScanResponse {
602    pub scan_id: Option<u64>,
603    #[doc(hidden)]
604    pub __source_breaking: fidl::marker::SourceBreaking,
605}
606
607impl fidl::Persistable for WlanSoftmacBaseStartPassiveScanResponse {}
608
609#[derive(Clone, Debug, Default, PartialEq)]
610pub struct WlanSoftmacIfcBaseNotifyScanCompleteRequest {
611    pub status: Option<i32>,
612    pub scan_id: Option<u64>,
613    #[doc(hidden)]
614    pub __source_breaking: fidl::marker::SourceBreaking,
615}
616
617impl fidl::Persistable for WlanSoftmacIfcBaseNotifyScanCompleteRequest {}
618
619/// High-level information describing the state of a running softmac.
620/// All fields in this response are required.
621#[derive(Clone, Debug, Default, PartialEq)]
622pub struct WlanSoftmacQueryResponse {
623    /// Station address.
624    pub sta_addr: Option<[u8; 6]>,
625    /// MAC role
626    pub mac_role: Option<fidl_fuchsia_wlan_common::WlanMacRole>,
627    /// Bitmask indicating WlanInfoPhyType values supported by the hardware.
628    pub supported_phys: Option<Vec<fidl_fuchsia_wlan_common::WlanPhyType>>,
629    /// Bitmask indicating enabled WlanInfoHardwareCapability values. Values defined as fuchsia.wlan.common.WlanSoftmacHardwareCapability
630    pub hardware_capability: Option<u32>,
631    /// Supported bands.
632    pub band_caps: Option<Vec<WlanSoftmacBandCapability>>,
633    #[doc(hidden)]
634    pub __source_breaking: fidl::marker::SourceBreaking,
635}
636
637impl fidl::Persistable for WlanSoftmacQueryResponse {}
638
639/// Argument struct to be passed as the single argument to WlanSoftmac.StartActiveScan
640#[derive(Clone, Debug, Default, PartialEq)]
641pub struct WlanSoftmacStartActiveScanRequest {
642    /// List of channels to scan on. An empty list of channels will cause a
643    /// scan request to immediately return ZX_ERR_INVALID_ARGS.
644    ///
645    /// Invalid channel numbers will be silently ignored. The validity of a channel
646    /// number depends on the current regulatory region, and a SoftMAC driver cannot
647    /// always determine the region setting. This is especially the case when
648    /// firmware changes the region setting dynamically.
649    pub channels: Option<Vec<u8>>,
650    /// List of SSIDs to scan for. For a list with a single SSID, the SSID will be placed in
651    /// the SSID element in the Probe Request frame. For a list with more than one SSID,
652    /// all SSIDs will be placed in an SSID List element in the Probe Request frame with the
653    /// first SSID in the list in the required SSID element. An empty list is the same as
654    /// specifying a list containing only the wildcard SSID.
655    pub ssids: Option<Vec<fidl_fuchsia_wlan_ieee80211::CSsid>>,
656    /// Buffer containing a MAC header (as defined in IEEE Std 802.11-2016, 9.3.3.2) to
657    /// include in each Probe Request frame.
658    pub mac_header: Option<Vec<u8>>,
659    /// Buffer containing IE bytes to include in each Probe Request frame.
660    ///
661    /// The IEs specified must not result in a Probe Request MMPDU that exceed the
662    /// limits defined by IEEE Std 802.11-2016, 9.2.4.7. MMPDU limit constants can
663    /// be found in fuchsia.wlan.ieee80211. These limits are very large and will
664    /// likely not be exceeded by specifying the most common IEs found in
665    /// Probe Request frames.
666    pub ies: Option<Vec<u8>>,
667    /// Minimum duration to spend on each channel during the scan.
668    pub min_channel_time: Option<i64>,
669    /// Maximum duration to spend on each channel during the scan.
670    pub max_channel_time: Option<i64>,
671    /// Minimum duration to spend on the home channel(s) between the dwell time on each channel
672    /// where a home channel corresponds to channels the device should otherwise be present
673    /// on while not scanning.
674    pub min_home_time: Option<i64>,
675    /// Minimum number of Probe Request frames to transmit per channel visit during a scan.
676    /// The definition of a channel visit may differ between device drivers, but it is roughly
677    /// the interval of time spent on a specific channel during a scan.
678    ///
679    /// Sending more than one Probe Request frame on a channel may increase the probability that
680    /// it is received in a noisy environment.
681    pub min_probes_per_channel: Option<u8>,
682    /// Maximum number of Probe Request frames to transmit per channel visit during a scan.
683    /// The definition of a channel visit may differ between device drivers, but it is roughly
684    /// the interval of time spent on a specific channel during a scan. Specifying 0 is invalid
685    /// since at least one Probe Request frame must be transmitted for an active scan.
686    ///
687    /// Limiting the number of Probe Request frames sent on a channel reduces the time spent
688    /// transmitting frames, and thus increase the time spent receiving frames, while scanning.
689    pub max_probes_per_channel: Option<u8>,
690    #[doc(hidden)]
691    pub __source_breaking: fidl::marker::SourceBreaking,
692}
693
694impl fidl::Persistable for WlanSoftmacStartActiveScanRequest {}
695
696#[derive(Clone, Debug, Default, PartialEq)]
697pub struct WlanTxTransferRequest {
698    pub packet_address: Option<u64>,
699    pub packet_size: Option<u64>,
700    pub packet_info: Option<WlanTxInfo>,
701    pub async_id: Option<u64>,
702    pub arena: Option<u64>,
703    #[doc(hidden)]
704    pub __source_breaking: fidl::marker::SourceBreaking,
705}
706
707impl fidl::Persistable for WlanTxTransferRequest {}
708
709#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
710pub struct EthernetRxMarker;
711
712impl fidl::endpoints::ProtocolMarker for EthernetRxMarker {
713    type Proxy = EthernetRxProxy;
714    type RequestStream = EthernetRxRequestStream;
715    #[cfg(target_os = "fuchsia")]
716    type SynchronousProxy = EthernetRxSynchronousProxy;
717
718    const DEBUG_NAME: &'static str = "(anonymous) EthernetRx";
719}
720pub type EthernetRxTransferResult = Result<(), i32>;
721
722pub trait EthernetRxProxyInterface: Send + Sync {
723    type TransferResponseFut: std::future::Future<Output = Result<EthernetRxTransferResult, fidl::Error>>
724        + Send;
725    fn r#transfer(&self, payload: &EthernetRxTransferRequest) -> Self::TransferResponseFut;
726}
727#[derive(Debug)]
728#[cfg(target_os = "fuchsia")]
729pub struct EthernetRxSynchronousProxy {
730    client: fidl::client::sync::Client,
731}
732
733#[cfg(target_os = "fuchsia")]
734impl fidl::endpoints::SynchronousProxy for EthernetRxSynchronousProxy {
735    type Proxy = EthernetRxProxy;
736    type Protocol = EthernetRxMarker;
737
738    fn from_channel(inner: fidl::Channel) -> Self {
739        Self::new(inner)
740    }
741
742    fn into_channel(self) -> fidl::Channel {
743        self.client.into_channel()
744    }
745
746    fn as_channel(&self) -> &fidl::Channel {
747        self.client.as_channel()
748    }
749}
750
751#[cfg(target_os = "fuchsia")]
752impl EthernetRxSynchronousProxy {
753    pub fn new(channel: fidl::Channel) -> Self {
754        let protocol_name = <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
755        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
756    }
757
758    pub fn into_channel(self) -> fidl::Channel {
759        self.client.into_channel()
760    }
761
762    /// Waits until an event arrives and returns it. It is safe for other
763    /// threads to make concurrent requests while waiting for an event.
764    pub fn wait_for_event(
765        &self,
766        deadline: zx::MonotonicInstant,
767    ) -> Result<EthernetRxEvent, fidl::Error> {
768        EthernetRxEvent::decode(self.client.wait_for_event(deadline)?)
769    }
770
771    pub fn r#transfer(
772        &self,
773        mut payload: &EthernetRxTransferRequest,
774        ___deadline: zx::MonotonicInstant,
775    ) -> Result<EthernetRxTransferResult, fidl::Error> {
776        let _response = self.client.send_query::<
777            EthernetRxTransferRequest,
778            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
779        >(
780            payload,
781            0x199ff3498ef8a22a,
782            fidl::encoding::DynamicFlags::empty(),
783            ___deadline,
784        )?;
785        Ok(_response.map(|x| x))
786    }
787}
788
789#[derive(Debug, Clone)]
790pub struct EthernetRxProxy {
791    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
792}
793
794impl fidl::endpoints::Proxy for EthernetRxProxy {
795    type Protocol = EthernetRxMarker;
796
797    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
798        Self::new(inner)
799    }
800
801    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
802        self.client.into_channel().map_err(|client| Self { client })
803    }
804
805    fn as_channel(&self) -> &::fidl::AsyncChannel {
806        self.client.as_channel()
807    }
808}
809
810impl EthernetRxProxy {
811    /// Create a new Proxy for fuchsia.wlan.softmac/EthernetRx.
812    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
813        let protocol_name = <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
814        Self { client: fidl::client::Client::new(channel, protocol_name) }
815    }
816
817    /// Get a Stream of events from the remote end of the protocol.
818    ///
819    /// # Panics
820    ///
821    /// Panics if the event stream was already taken.
822    pub fn take_event_stream(&self) -> EthernetRxEventStream {
823        EthernetRxEventStream { event_receiver: self.client.take_event_receiver() }
824    }
825
826    pub fn r#transfer(
827        &self,
828        mut payload: &EthernetRxTransferRequest,
829    ) -> fidl::client::QueryResponseFut<
830        EthernetRxTransferResult,
831        fidl::encoding::DefaultFuchsiaResourceDialect,
832    > {
833        EthernetRxProxyInterface::r#transfer(self, payload)
834    }
835}
836
837impl EthernetRxProxyInterface for EthernetRxProxy {
838    type TransferResponseFut = fidl::client::QueryResponseFut<
839        EthernetRxTransferResult,
840        fidl::encoding::DefaultFuchsiaResourceDialect,
841    >;
842    fn r#transfer(&self, mut payload: &EthernetRxTransferRequest) -> Self::TransferResponseFut {
843        fn _decode(
844            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
845        ) -> Result<EthernetRxTransferResult, fidl::Error> {
846            let _response = fidl::client::decode_transaction_body::<
847                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
848                fidl::encoding::DefaultFuchsiaResourceDialect,
849                0x199ff3498ef8a22a,
850            >(_buf?)?;
851            Ok(_response.map(|x| x))
852        }
853        self.client.send_query_and_decode::<EthernetRxTransferRequest, EthernetRxTransferResult>(
854            payload,
855            0x199ff3498ef8a22a,
856            fidl::encoding::DynamicFlags::empty(),
857            _decode,
858        )
859    }
860}
861
862pub struct EthernetRxEventStream {
863    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
864}
865
866impl std::marker::Unpin for EthernetRxEventStream {}
867
868impl futures::stream::FusedStream for EthernetRxEventStream {
869    fn is_terminated(&self) -> bool {
870        self.event_receiver.is_terminated()
871    }
872}
873
874impl futures::Stream for EthernetRxEventStream {
875    type Item = Result<EthernetRxEvent, fidl::Error>;
876
877    fn poll_next(
878        mut self: std::pin::Pin<&mut Self>,
879        cx: &mut std::task::Context<'_>,
880    ) -> std::task::Poll<Option<Self::Item>> {
881        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
882            &mut self.event_receiver,
883            cx
884        )?) {
885            Some(buf) => std::task::Poll::Ready(Some(EthernetRxEvent::decode(buf))),
886            None => std::task::Poll::Ready(None),
887        }
888    }
889}
890
891#[derive(Debug)]
892pub enum EthernetRxEvent {}
893
894impl EthernetRxEvent {
895    /// Decodes a message buffer as a [`EthernetRxEvent`].
896    fn decode(
897        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
898    ) -> Result<EthernetRxEvent, fidl::Error> {
899        let (bytes, _handles) = buf.split_mut();
900        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
901        debug_assert_eq!(tx_header.tx_id, 0);
902        match tx_header.ordinal {
903            _ => Err(fidl::Error::UnknownOrdinal {
904                ordinal: tx_header.ordinal,
905                protocol_name: <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
906            }),
907        }
908    }
909}
910
911/// A Stream of incoming requests for fuchsia.wlan.softmac/EthernetRx.
912pub struct EthernetRxRequestStream {
913    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
914    is_terminated: bool,
915}
916
917impl std::marker::Unpin for EthernetRxRequestStream {}
918
919impl futures::stream::FusedStream for EthernetRxRequestStream {
920    fn is_terminated(&self) -> bool {
921        self.is_terminated
922    }
923}
924
925impl fidl::endpoints::RequestStream for EthernetRxRequestStream {
926    type Protocol = EthernetRxMarker;
927    type ControlHandle = EthernetRxControlHandle;
928
929    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
930        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
931    }
932
933    fn control_handle(&self) -> Self::ControlHandle {
934        EthernetRxControlHandle { inner: self.inner.clone() }
935    }
936
937    fn into_inner(
938        self,
939    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
940    {
941        (self.inner, self.is_terminated)
942    }
943
944    fn from_inner(
945        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
946        is_terminated: bool,
947    ) -> Self {
948        Self { inner, is_terminated }
949    }
950}
951
952impl futures::Stream for EthernetRxRequestStream {
953    type Item = Result<EthernetRxRequest, fidl::Error>;
954
955    fn poll_next(
956        mut self: std::pin::Pin<&mut Self>,
957        cx: &mut std::task::Context<'_>,
958    ) -> std::task::Poll<Option<Self::Item>> {
959        let this = &mut *self;
960        if this.inner.check_shutdown(cx) {
961            this.is_terminated = true;
962            return std::task::Poll::Ready(None);
963        }
964        if this.is_terminated {
965            panic!("polled EthernetRxRequestStream after completion");
966        }
967        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
968            |bytes, handles| {
969                match this.inner.channel().read_etc(cx, bytes, handles) {
970                    std::task::Poll::Ready(Ok(())) => {}
971                    std::task::Poll::Pending => return std::task::Poll::Pending,
972                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
973                        this.is_terminated = true;
974                        return std::task::Poll::Ready(None);
975                    }
976                    std::task::Poll::Ready(Err(e)) => {
977                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
978                            e.into(),
979                        ))))
980                    }
981                }
982
983                // A message has been received from the channel
984                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
985
986                std::task::Poll::Ready(Some(match header.ordinal {
987                    0x199ff3498ef8a22a => {
988                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
989                        let mut req = fidl::new_empty!(
990                            EthernetRxTransferRequest,
991                            fidl::encoding::DefaultFuchsiaResourceDialect
992                        );
993                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EthernetRxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
994                        let control_handle = EthernetRxControlHandle { inner: this.inner.clone() };
995                        Ok(EthernetRxRequest::Transfer {
996                            payload: req,
997                            responder: EthernetRxTransferResponder {
998                                control_handle: std::mem::ManuallyDrop::new(control_handle),
999                                tx_id: header.tx_id,
1000                            },
1001                        })
1002                    }
1003                    _ => Err(fidl::Error::UnknownOrdinal {
1004                        ordinal: header.ordinal,
1005                        protocol_name:
1006                            <EthernetRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1007                    }),
1008                }))
1009            },
1010        )
1011    }
1012}
1013
1014/// Protocol for sending an Ethernet frame from the bridged wlansoftmac
1015/// driver to the wlansoftmac driver.
1016///
1017/// # Experimental
1018///
1019/// This protocol is implemented as a foreign function interface (FFI)
1020/// between the wlansoftmac driver and the bridged driver solely to improve
1021/// the performance of processing data frames through the wlan-mlme library.
1022#[derive(Debug)]
1023pub enum EthernetRxRequest {
1024    Transfer { payload: EthernetRxTransferRequest, responder: EthernetRxTransferResponder },
1025}
1026
1027impl EthernetRxRequest {
1028    #[allow(irrefutable_let_patterns)]
1029    pub fn into_transfer(self) -> Option<(EthernetRxTransferRequest, EthernetRxTransferResponder)> {
1030        if let EthernetRxRequest::Transfer { payload, responder } = self {
1031            Some((payload, responder))
1032        } else {
1033            None
1034        }
1035    }
1036
1037    /// Name of the method defined in FIDL
1038    pub fn method_name(&self) -> &'static str {
1039        match *self {
1040            EthernetRxRequest::Transfer { .. } => "transfer",
1041        }
1042    }
1043}
1044
1045#[derive(Debug, Clone)]
1046pub struct EthernetRxControlHandle {
1047    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1048}
1049
1050impl fidl::endpoints::ControlHandle for EthernetRxControlHandle {
1051    fn shutdown(&self) {
1052        self.inner.shutdown()
1053    }
1054    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1055        self.inner.shutdown_with_epitaph(status)
1056    }
1057
1058    fn is_closed(&self) -> bool {
1059        self.inner.channel().is_closed()
1060    }
1061    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1062        self.inner.channel().on_closed()
1063    }
1064
1065    #[cfg(target_os = "fuchsia")]
1066    fn signal_peer(
1067        &self,
1068        clear_mask: zx::Signals,
1069        set_mask: zx::Signals,
1070    ) -> Result<(), zx_status::Status> {
1071        use fidl::Peered;
1072        self.inner.channel().signal_peer(clear_mask, set_mask)
1073    }
1074}
1075
1076impl EthernetRxControlHandle {}
1077
1078#[must_use = "FIDL methods require a response to be sent"]
1079#[derive(Debug)]
1080pub struct EthernetRxTransferResponder {
1081    control_handle: std::mem::ManuallyDrop<EthernetRxControlHandle>,
1082    tx_id: u32,
1083}
1084
1085/// Set the the channel to be shutdown (see [`EthernetRxControlHandle::shutdown`])
1086/// if the responder is dropped without sending a response, so that the client
1087/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1088impl std::ops::Drop for EthernetRxTransferResponder {
1089    fn drop(&mut self) {
1090        self.control_handle.shutdown();
1091        // Safety: drops once, never accessed again
1092        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1093    }
1094}
1095
1096impl fidl::endpoints::Responder for EthernetRxTransferResponder {
1097    type ControlHandle = EthernetRxControlHandle;
1098
1099    fn control_handle(&self) -> &EthernetRxControlHandle {
1100        &self.control_handle
1101    }
1102
1103    fn drop_without_shutdown(mut self) {
1104        // Safety: drops once, never accessed again due to mem::forget
1105        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1106        // Prevent Drop from running (which would shut down the channel)
1107        std::mem::forget(self);
1108    }
1109}
1110
1111impl EthernetRxTransferResponder {
1112    /// Sends a response to the FIDL transaction.
1113    ///
1114    /// Sets the channel to shutdown if an error occurs.
1115    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1116        let _result = self.send_raw(result);
1117        if _result.is_err() {
1118            self.control_handle.shutdown();
1119        }
1120        self.drop_without_shutdown();
1121        _result
1122    }
1123
1124    /// Similar to "send" but does not shutdown the channel if an error occurs.
1125    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1126        let _result = self.send_raw(result);
1127        self.drop_without_shutdown();
1128        _result
1129    }
1130
1131    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1132        self.control_handle
1133            .inner
1134            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1135                result,
1136                self.tx_id,
1137                0x199ff3498ef8a22a,
1138                fidl::encoding::DynamicFlags::empty(),
1139            )
1140    }
1141}
1142
1143#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1144pub struct EthernetTxMarker;
1145
1146impl fidl::endpoints::ProtocolMarker for EthernetTxMarker {
1147    type Proxy = EthernetTxProxy;
1148    type RequestStream = EthernetTxRequestStream;
1149    #[cfg(target_os = "fuchsia")]
1150    type SynchronousProxy = EthernetTxSynchronousProxy;
1151
1152    const DEBUG_NAME: &'static str = "(anonymous) EthernetTx";
1153}
1154pub type EthernetTxTransferResult = Result<(), i32>;
1155
1156pub trait EthernetTxProxyInterface: Send + Sync {
1157    type TransferResponseFut: std::future::Future<Output = Result<EthernetTxTransferResult, fidl::Error>>
1158        + Send;
1159    fn r#transfer(&self, payload: &EthernetTxTransferRequest) -> Self::TransferResponseFut;
1160}
1161#[derive(Debug)]
1162#[cfg(target_os = "fuchsia")]
1163pub struct EthernetTxSynchronousProxy {
1164    client: fidl::client::sync::Client,
1165}
1166
1167#[cfg(target_os = "fuchsia")]
1168impl fidl::endpoints::SynchronousProxy for EthernetTxSynchronousProxy {
1169    type Proxy = EthernetTxProxy;
1170    type Protocol = EthernetTxMarker;
1171
1172    fn from_channel(inner: fidl::Channel) -> Self {
1173        Self::new(inner)
1174    }
1175
1176    fn into_channel(self) -> fidl::Channel {
1177        self.client.into_channel()
1178    }
1179
1180    fn as_channel(&self) -> &fidl::Channel {
1181        self.client.as_channel()
1182    }
1183}
1184
1185#[cfg(target_os = "fuchsia")]
1186impl EthernetTxSynchronousProxy {
1187    pub fn new(channel: fidl::Channel) -> Self {
1188        let protocol_name = <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1189        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1190    }
1191
1192    pub fn into_channel(self) -> fidl::Channel {
1193        self.client.into_channel()
1194    }
1195
1196    /// Waits until an event arrives and returns it. It is safe for other
1197    /// threads to make concurrent requests while waiting for an event.
1198    pub fn wait_for_event(
1199        &self,
1200        deadline: zx::MonotonicInstant,
1201    ) -> Result<EthernetTxEvent, fidl::Error> {
1202        EthernetTxEvent::decode(self.client.wait_for_event(deadline)?)
1203    }
1204
1205    pub fn r#transfer(
1206        &self,
1207        mut payload: &EthernetTxTransferRequest,
1208        ___deadline: zx::MonotonicInstant,
1209    ) -> Result<EthernetTxTransferResult, fidl::Error> {
1210        let _response = self.client.send_query::<
1211            EthernetTxTransferRequest,
1212            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1213        >(
1214            payload,
1215            0x616dafedf07d00e7,
1216            fidl::encoding::DynamicFlags::empty(),
1217            ___deadline,
1218        )?;
1219        Ok(_response.map(|x| x))
1220    }
1221}
1222
1223#[derive(Debug, Clone)]
1224pub struct EthernetTxProxy {
1225    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1226}
1227
1228impl fidl::endpoints::Proxy for EthernetTxProxy {
1229    type Protocol = EthernetTxMarker;
1230
1231    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1232        Self::new(inner)
1233    }
1234
1235    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1236        self.client.into_channel().map_err(|client| Self { client })
1237    }
1238
1239    fn as_channel(&self) -> &::fidl::AsyncChannel {
1240        self.client.as_channel()
1241    }
1242}
1243
1244impl EthernetTxProxy {
1245    /// Create a new Proxy for fuchsia.wlan.softmac/EthernetTx.
1246    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1247        let protocol_name = <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1248        Self { client: fidl::client::Client::new(channel, protocol_name) }
1249    }
1250
1251    /// Get a Stream of events from the remote end of the protocol.
1252    ///
1253    /// # Panics
1254    ///
1255    /// Panics if the event stream was already taken.
1256    pub fn take_event_stream(&self) -> EthernetTxEventStream {
1257        EthernetTxEventStream { event_receiver: self.client.take_event_receiver() }
1258    }
1259
1260    pub fn r#transfer(
1261        &self,
1262        mut payload: &EthernetTxTransferRequest,
1263    ) -> fidl::client::QueryResponseFut<
1264        EthernetTxTransferResult,
1265        fidl::encoding::DefaultFuchsiaResourceDialect,
1266    > {
1267        EthernetTxProxyInterface::r#transfer(self, payload)
1268    }
1269}
1270
1271impl EthernetTxProxyInterface for EthernetTxProxy {
1272    type TransferResponseFut = fidl::client::QueryResponseFut<
1273        EthernetTxTransferResult,
1274        fidl::encoding::DefaultFuchsiaResourceDialect,
1275    >;
1276    fn r#transfer(&self, mut payload: &EthernetTxTransferRequest) -> Self::TransferResponseFut {
1277        fn _decode(
1278            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1279        ) -> Result<EthernetTxTransferResult, fidl::Error> {
1280            let _response = fidl::client::decode_transaction_body::<
1281                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
1282                fidl::encoding::DefaultFuchsiaResourceDialect,
1283                0x616dafedf07d00e7,
1284            >(_buf?)?;
1285            Ok(_response.map(|x| x))
1286        }
1287        self.client.send_query_and_decode::<EthernetTxTransferRequest, EthernetTxTransferResult>(
1288            payload,
1289            0x616dafedf07d00e7,
1290            fidl::encoding::DynamicFlags::empty(),
1291            _decode,
1292        )
1293    }
1294}
1295
1296pub struct EthernetTxEventStream {
1297    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1298}
1299
1300impl std::marker::Unpin for EthernetTxEventStream {}
1301
1302impl futures::stream::FusedStream for EthernetTxEventStream {
1303    fn is_terminated(&self) -> bool {
1304        self.event_receiver.is_terminated()
1305    }
1306}
1307
1308impl futures::Stream for EthernetTxEventStream {
1309    type Item = Result<EthernetTxEvent, fidl::Error>;
1310
1311    fn poll_next(
1312        mut self: std::pin::Pin<&mut Self>,
1313        cx: &mut std::task::Context<'_>,
1314    ) -> std::task::Poll<Option<Self::Item>> {
1315        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1316            &mut self.event_receiver,
1317            cx
1318        )?) {
1319            Some(buf) => std::task::Poll::Ready(Some(EthernetTxEvent::decode(buf))),
1320            None => std::task::Poll::Ready(None),
1321        }
1322    }
1323}
1324
1325#[derive(Debug)]
1326pub enum EthernetTxEvent {}
1327
1328impl EthernetTxEvent {
1329    /// Decodes a message buffer as a [`EthernetTxEvent`].
1330    fn decode(
1331        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1332    ) -> Result<EthernetTxEvent, fidl::Error> {
1333        let (bytes, _handles) = buf.split_mut();
1334        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1335        debug_assert_eq!(tx_header.tx_id, 0);
1336        match tx_header.ordinal {
1337            _ => Err(fidl::Error::UnknownOrdinal {
1338                ordinal: tx_header.ordinal,
1339                protocol_name: <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1340            }),
1341        }
1342    }
1343}
1344
1345/// A Stream of incoming requests for fuchsia.wlan.softmac/EthernetTx.
1346pub struct EthernetTxRequestStream {
1347    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1348    is_terminated: bool,
1349}
1350
1351impl std::marker::Unpin for EthernetTxRequestStream {}
1352
1353impl futures::stream::FusedStream for EthernetTxRequestStream {
1354    fn is_terminated(&self) -> bool {
1355        self.is_terminated
1356    }
1357}
1358
1359impl fidl::endpoints::RequestStream for EthernetTxRequestStream {
1360    type Protocol = EthernetTxMarker;
1361    type ControlHandle = EthernetTxControlHandle;
1362
1363    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1364        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1365    }
1366
1367    fn control_handle(&self) -> Self::ControlHandle {
1368        EthernetTxControlHandle { inner: self.inner.clone() }
1369    }
1370
1371    fn into_inner(
1372        self,
1373    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1374    {
1375        (self.inner, self.is_terminated)
1376    }
1377
1378    fn from_inner(
1379        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1380        is_terminated: bool,
1381    ) -> Self {
1382        Self { inner, is_terminated }
1383    }
1384}
1385
1386impl futures::Stream for EthernetTxRequestStream {
1387    type Item = Result<EthernetTxRequest, fidl::Error>;
1388
1389    fn poll_next(
1390        mut self: std::pin::Pin<&mut Self>,
1391        cx: &mut std::task::Context<'_>,
1392    ) -> std::task::Poll<Option<Self::Item>> {
1393        let this = &mut *self;
1394        if this.inner.check_shutdown(cx) {
1395            this.is_terminated = true;
1396            return std::task::Poll::Ready(None);
1397        }
1398        if this.is_terminated {
1399            panic!("polled EthernetTxRequestStream after completion");
1400        }
1401        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1402            |bytes, handles| {
1403                match this.inner.channel().read_etc(cx, bytes, handles) {
1404                    std::task::Poll::Ready(Ok(())) => {}
1405                    std::task::Poll::Pending => return std::task::Poll::Pending,
1406                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1407                        this.is_terminated = true;
1408                        return std::task::Poll::Ready(None);
1409                    }
1410                    std::task::Poll::Ready(Err(e)) => {
1411                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1412                            e.into(),
1413                        ))))
1414                    }
1415                }
1416
1417                // A message has been received from the channel
1418                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1419
1420                std::task::Poll::Ready(Some(match header.ordinal {
1421                    0x616dafedf07d00e7 => {
1422                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1423                        let mut req = fidl::new_empty!(
1424                            EthernetTxTransferRequest,
1425                            fidl::encoding::DefaultFuchsiaResourceDialect
1426                        );
1427                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<EthernetTxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
1428                        let control_handle = EthernetTxControlHandle { inner: this.inner.clone() };
1429                        Ok(EthernetTxRequest::Transfer {
1430                            payload: req,
1431                            responder: EthernetTxTransferResponder {
1432                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1433                                tx_id: header.tx_id,
1434                            },
1435                        })
1436                    }
1437                    _ => Err(fidl::Error::UnknownOrdinal {
1438                        ordinal: header.ordinal,
1439                        protocol_name:
1440                            <EthernetTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1441                    }),
1442                }))
1443            },
1444        )
1445    }
1446}
1447
1448/// Protocol for sending an Ethernet frame from the wlansoftmac driver to the bridged
1449/// wlansoftmac driver.
1450///
1451/// # Experimental
1452///
1453/// This protocol is implemented as a foreign function interface (FFI)
1454/// between the wlansoftmac driver and the bridged driver solely to improve
1455/// the performance of processing data frames through the wlan-mlme library.
1456///
1457/// # Safety
1458///
1459/// The `complete_borrowed_operation` field must be a function pointer of the type
1460/// void (*)(eth::BorrowedOperation<>*, zx_status_t) where the first argument
1461/// is the value of `borrowed_operation` field.
1462///
1463/// Calling `complete_borrowed_operation` will result in calling
1464/// `eth::BorrowedOperation<>::Complete()` to release ownership of the packet. This
1465/// must be called exactly once. Failing to call `complete_borrowed_operation`
1466/// will leak memory, and calling more than once will result in use-after-free.
1467#[derive(Debug)]
1468pub enum EthernetTxRequest {
1469    Transfer { payload: EthernetTxTransferRequest, responder: EthernetTxTransferResponder },
1470}
1471
1472impl EthernetTxRequest {
1473    #[allow(irrefutable_let_patterns)]
1474    pub fn into_transfer(self) -> Option<(EthernetTxTransferRequest, EthernetTxTransferResponder)> {
1475        if let EthernetTxRequest::Transfer { payload, responder } = self {
1476            Some((payload, responder))
1477        } else {
1478            None
1479        }
1480    }
1481
1482    /// Name of the method defined in FIDL
1483    pub fn method_name(&self) -> &'static str {
1484        match *self {
1485            EthernetTxRequest::Transfer { .. } => "transfer",
1486        }
1487    }
1488}
1489
1490#[derive(Debug, Clone)]
1491pub struct EthernetTxControlHandle {
1492    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1493}
1494
1495impl fidl::endpoints::ControlHandle for EthernetTxControlHandle {
1496    fn shutdown(&self) {
1497        self.inner.shutdown()
1498    }
1499    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1500        self.inner.shutdown_with_epitaph(status)
1501    }
1502
1503    fn is_closed(&self) -> bool {
1504        self.inner.channel().is_closed()
1505    }
1506    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1507        self.inner.channel().on_closed()
1508    }
1509
1510    #[cfg(target_os = "fuchsia")]
1511    fn signal_peer(
1512        &self,
1513        clear_mask: zx::Signals,
1514        set_mask: zx::Signals,
1515    ) -> Result<(), zx_status::Status> {
1516        use fidl::Peered;
1517        self.inner.channel().signal_peer(clear_mask, set_mask)
1518    }
1519}
1520
1521impl EthernetTxControlHandle {}
1522
1523#[must_use = "FIDL methods require a response to be sent"]
1524#[derive(Debug)]
1525pub struct EthernetTxTransferResponder {
1526    control_handle: std::mem::ManuallyDrop<EthernetTxControlHandle>,
1527    tx_id: u32,
1528}
1529
1530/// Set the the channel to be shutdown (see [`EthernetTxControlHandle::shutdown`])
1531/// if the responder is dropped without sending a response, so that the client
1532/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1533impl std::ops::Drop for EthernetTxTransferResponder {
1534    fn drop(&mut self) {
1535        self.control_handle.shutdown();
1536        // Safety: drops once, never accessed again
1537        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1538    }
1539}
1540
1541impl fidl::endpoints::Responder for EthernetTxTransferResponder {
1542    type ControlHandle = EthernetTxControlHandle;
1543
1544    fn control_handle(&self) -> &EthernetTxControlHandle {
1545        &self.control_handle
1546    }
1547
1548    fn drop_without_shutdown(mut self) {
1549        // Safety: drops once, never accessed again due to mem::forget
1550        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1551        // Prevent Drop from running (which would shut down the channel)
1552        std::mem::forget(self);
1553    }
1554}
1555
1556impl EthernetTxTransferResponder {
1557    /// Sends a response to the FIDL transaction.
1558    ///
1559    /// Sets the channel to shutdown if an error occurs.
1560    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1561        let _result = self.send_raw(result);
1562        if _result.is_err() {
1563            self.control_handle.shutdown();
1564        }
1565        self.drop_without_shutdown();
1566        _result
1567    }
1568
1569    /// Similar to "send" but does not shutdown the channel if an error occurs.
1570    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1571        let _result = self.send_raw(result);
1572        self.drop_without_shutdown();
1573        _result
1574    }
1575
1576    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
1577        self.control_handle
1578            .inner
1579            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
1580                result,
1581                self.tx_id,
1582                0x616dafedf07d00e7,
1583                fidl::encoding::DynamicFlags::empty(),
1584            )
1585    }
1586}
1587
1588#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
1589pub struct WlanRxMarker;
1590
1591impl fidl::endpoints::ProtocolMarker for WlanRxMarker {
1592    type Proxy = WlanRxProxy;
1593    type RequestStream = WlanRxRequestStream;
1594    #[cfg(target_os = "fuchsia")]
1595    type SynchronousProxy = WlanRxSynchronousProxy;
1596
1597    const DEBUG_NAME: &'static str = "(anonymous) WlanRx";
1598}
1599
1600pub trait WlanRxProxyInterface: Send + Sync {
1601    type TransferResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
1602    fn r#transfer(&self, payload: &WlanRxTransferRequest) -> Self::TransferResponseFut;
1603}
1604#[derive(Debug)]
1605#[cfg(target_os = "fuchsia")]
1606pub struct WlanRxSynchronousProxy {
1607    client: fidl::client::sync::Client,
1608}
1609
1610#[cfg(target_os = "fuchsia")]
1611impl fidl::endpoints::SynchronousProxy for WlanRxSynchronousProxy {
1612    type Proxy = WlanRxProxy;
1613    type Protocol = WlanRxMarker;
1614
1615    fn from_channel(inner: fidl::Channel) -> Self {
1616        Self::new(inner)
1617    }
1618
1619    fn into_channel(self) -> fidl::Channel {
1620        self.client.into_channel()
1621    }
1622
1623    fn as_channel(&self) -> &fidl::Channel {
1624        self.client.as_channel()
1625    }
1626}
1627
1628#[cfg(target_os = "fuchsia")]
1629impl WlanRxSynchronousProxy {
1630    pub fn new(channel: fidl::Channel) -> Self {
1631        let protocol_name = <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1632        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
1633    }
1634
1635    pub fn into_channel(self) -> fidl::Channel {
1636        self.client.into_channel()
1637    }
1638
1639    /// Waits until an event arrives and returns it. It is safe for other
1640    /// threads to make concurrent requests while waiting for an event.
1641    pub fn wait_for_event(
1642        &self,
1643        deadline: zx::MonotonicInstant,
1644    ) -> Result<WlanRxEvent, fidl::Error> {
1645        WlanRxEvent::decode(self.client.wait_for_event(deadline)?)
1646    }
1647
1648    pub fn r#transfer(
1649        &self,
1650        mut payload: &WlanRxTransferRequest,
1651        ___deadline: zx::MonotonicInstant,
1652    ) -> Result<(), fidl::Error> {
1653        let _response =
1654            self.client.send_query::<WlanRxTransferRequest, fidl::encoding::EmptyPayload>(
1655                payload,
1656                0x2c73b18cbfca6055,
1657                fidl::encoding::DynamicFlags::empty(),
1658                ___deadline,
1659            )?;
1660        Ok(_response)
1661    }
1662}
1663
1664#[derive(Debug, Clone)]
1665pub struct WlanRxProxy {
1666    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
1667}
1668
1669impl fidl::endpoints::Proxy for WlanRxProxy {
1670    type Protocol = WlanRxMarker;
1671
1672    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
1673        Self::new(inner)
1674    }
1675
1676    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
1677        self.client.into_channel().map_err(|client| Self { client })
1678    }
1679
1680    fn as_channel(&self) -> &::fidl::AsyncChannel {
1681        self.client.as_channel()
1682    }
1683}
1684
1685impl WlanRxProxy {
1686    /// Create a new Proxy for fuchsia.wlan.softmac/WlanRx.
1687    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
1688        let protocol_name = <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
1689        Self { client: fidl::client::Client::new(channel, protocol_name) }
1690    }
1691
1692    /// Get a Stream of events from the remote end of the protocol.
1693    ///
1694    /// # Panics
1695    ///
1696    /// Panics if the event stream was already taken.
1697    pub fn take_event_stream(&self) -> WlanRxEventStream {
1698        WlanRxEventStream { event_receiver: self.client.take_event_receiver() }
1699    }
1700
1701    pub fn r#transfer(
1702        &self,
1703        mut payload: &WlanRxTransferRequest,
1704    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
1705        WlanRxProxyInterface::r#transfer(self, payload)
1706    }
1707}
1708
1709impl WlanRxProxyInterface for WlanRxProxy {
1710    type TransferResponseFut =
1711        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
1712    fn r#transfer(&self, mut payload: &WlanRxTransferRequest) -> Self::TransferResponseFut {
1713        fn _decode(
1714            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
1715        ) -> Result<(), fidl::Error> {
1716            let _response = fidl::client::decode_transaction_body::<
1717                fidl::encoding::EmptyPayload,
1718                fidl::encoding::DefaultFuchsiaResourceDialect,
1719                0x2c73b18cbfca6055,
1720            >(_buf?)?;
1721            Ok(_response)
1722        }
1723        self.client.send_query_and_decode::<WlanRxTransferRequest, ()>(
1724            payload,
1725            0x2c73b18cbfca6055,
1726            fidl::encoding::DynamicFlags::empty(),
1727            _decode,
1728        )
1729    }
1730}
1731
1732pub struct WlanRxEventStream {
1733    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
1734}
1735
1736impl std::marker::Unpin for WlanRxEventStream {}
1737
1738impl futures::stream::FusedStream for WlanRxEventStream {
1739    fn is_terminated(&self) -> bool {
1740        self.event_receiver.is_terminated()
1741    }
1742}
1743
1744impl futures::Stream for WlanRxEventStream {
1745    type Item = Result<WlanRxEvent, fidl::Error>;
1746
1747    fn poll_next(
1748        mut self: std::pin::Pin<&mut Self>,
1749        cx: &mut std::task::Context<'_>,
1750    ) -> std::task::Poll<Option<Self::Item>> {
1751        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
1752            &mut self.event_receiver,
1753            cx
1754        )?) {
1755            Some(buf) => std::task::Poll::Ready(Some(WlanRxEvent::decode(buf))),
1756            None => std::task::Poll::Ready(None),
1757        }
1758    }
1759}
1760
1761#[derive(Debug)]
1762pub enum WlanRxEvent {}
1763
1764impl WlanRxEvent {
1765    /// Decodes a message buffer as a [`WlanRxEvent`].
1766    fn decode(
1767        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
1768    ) -> Result<WlanRxEvent, fidl::Error> {
1769        let (bytes, _handles) = buf.split_mut();
1770        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1771        debug_assert_eq!(tx_header.tx_id, 0);
1772        match tx_header.ordinal {
1773            _ => Err(fidl::Error::UnknownOrdinal {
1774                ordinal: tx_header.ordinal,
1775                protocol_name: <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1776            }),
1777        }
1778    }
1779}
1780
1781/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanRx.
1782pub struct WlanRxRequestStream {
1783    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1784    is_terminated: bool,
1785}
1786
1787impl std::marker::Unpin for WlanRxRequestStream {}
1788
1789impl futures::stream::FusedStream for WlanRxRequestStream {
1790    fn is_terminated(&self) -> bool {
1791        self.is_terminated
1792    }
1793}
1794
1795impl fidl::endpoints::RequestStream for WlanRxRequestStream {
1796    type Protocol = WlanRxMarker;
1797    type ControlHandle = WlanRxControlHandle;
1798
1799    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
1800        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
1801    }
1802
1803    fn control_handle(&self) -> Self::ControlHandle {
1804        WlanRxControlHandle { inner: self.inner.clone() }
1805    }
1806
1807    fn into_inner(
1808        self,
1809    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
1810    {
1811        (self.inner, self.is_terminated)
1812    }
1813
1814    fn from_inner(
1815        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1816        is_terminated: bool,
1817    ) -> Self {
1818        Self { inner, is_terminated }
1819    }
1820}
1821
1822impl futures::Stream for WlanRxRequestStream {
1823    type Item = Result<WlanRxRequest, fidl::Error>;
1824
1825    fn poll_next(
1826        mut self: std::pin::Pin<&mut Self>,
1827        cx: &mut std::task::Context<'_>,
1828    ) -> std::task::Poll<Option<Self::Item>> {
1829        let this = &mut *self;
1830        if this.inner.check_shutdown(cx) {
1831            this.is_terminated = true;
1832            return std::task::Poll::Ready(None);
1833        }
1834        if this.is_terminated {
1835            panic!("polled WlanRxRequestStream after completion");
1836        }
1837        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
1838            |bytes, handles| {
1839                match this.inner.channel().read_etc(cx, bytes, handles) {
1840                    std::task::Poll::Ready(Ok(())) => {}
1841                    std::task::Poll::Pending => return std::task::Poll::Pending,
1842                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
1843                        this.is_terminated = true;
1844                        return std::task::Poll::Ready(None);
1845                    }
1846                    std::task::Poll::Ready(Err(e)) => {
1847                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
1848                            e.into(),
1849                        ))))
1850                    }
1851                }
1852
1853                // A message has been received from the channel
1854                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
1855
1856                std::task::Poll::Ready(Some(match header.ordinal {
1857                    0x2c73b18cbfca6055 => {
1858                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
1859                        let mut req = fidl::new_empty!(
1860                            WlanRxTransferRequest,
1861                            fidl::encoding::DefaultFuchsiaResourceDialect
1862                        );
1863                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanRxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
1864                        let control_handle = WlanRxControlHandle { inner: this.inner.clone() };
1865                        Ok(WlanRxRequest::Transfer {
1866                            payload: req,
1867                            responder: WlanRxTransferResponder {
1868                                control_handle: std::mem::ManuallyDrop::new(control_handle),
1869                                tx_id: header.tx_id,
1870                            },
1871                        })
1872                    }
1873                    _ => Err(fidl::Error::UnknownOrdinal {
1874                        ordinal: header.ordinal,
1875                        protocol_name:
1876                            <WlanRxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
1877                    }),
1878                }))
1879            },
1880        )
1881    }
1882}
1883
1884/// Protocol for sending a WLAN frame from the wlansoftmac driver to the bridged
1885/// wlansoftmac driver.
1886///
1887/// # Experimental
1888///
1889/// This protocol is implemented as a foreign function interface (FFI)
1890/// between the wlansoftmac driver and the bridged driver solely to improve
1891/// the performance of processing data frames through the wlan-mlme library.
1892#[derive(Debug)]
1893pub enum WlanRxRequest {
1894    Transfer { payload: WlanRxTransferRequest, responder: WlanRxTransferResponder },
1895}
1896
1897impl WlanRxRequest {
1898    #[allow(irrefutable_let_patterns)]
1899    pub fn into_transfer(self) -> Option<(WlanRxTransferRequest, WlanRxTransferResponder)> {
1900        if let WlanRxRequest::Transfer { payload, responder } = self {
1901            Some((payload, responder))
1902        } else {
1903            None
1904        }
1905    }
1906
1907    /// Name of the method defined in FIDL
1908    pub fn method_name(&self) -> &'static str {
1909        match *self {
1910            WlanRxRequest::Transfer { .. } => "transfer",
1911        }
1912    }
1913}
1914
1915#[derive(Debug, Clone)]
1916pub struct WlanRxControlHandle {
1917    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
1918}
1919
1920impl fidl::endpoints::ControlHandle for WlanRxControlHandle {
1921    fn shutdown(&self) {
1922        self.inner.shutdown()
1923    }
1924    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
1925        self.inner.shutdown_with_epitaph(status)
1926    }
1927
1928    fn is_closed(&self) -> bool {
1929        self.inner.channel().is_closed()
1930    }
1931    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
1932        self.inner.channel().on_closed()
1933    }
1934
1935    #[cfg(target_os = "fuchsia")]
1936    fn signal_peer(
1937        &self,
1938        clear_mask: zx::Signals,
1939        set_mask: zx::Signals,
1940    ) -> Result<(), zx_status::Status> {
1941        use fidl::Peered;
1942        self.inner.channel().signal_peer(clear_mask, set_mask)
1943    }
1944}
1945
1946impl WlanRxControlHandle {}
1947
1948#[must_use = "FIDL methods require a response to be sent"]
1949#[derive(Debug)]
1950pub struct WlanRxTransferResponder {
1951    control_handle: std::mem::ManuallyDrop<WlanRxControlHandle>,
1952    tx_id: u32,
1953}
1954
1955/// Set the the channel to be shutdown (see [`WlanRxControlHandle::shutdown`])
1956/// if the responder is dropped without sending a response, so that the client
1957/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
1958impl std::ops::Drop for WlanRxTransferResponder {
1959    fn drop(&mut self) {
1960        self.control_handle.shutdown();
1961        // Safety: drops once, never accessed again
1962        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1963    }
1964}
1965
1966impl fidl::endpoints::Responder for WlanRxTransferResponder {
1967    type ControlHandle = WlanRxControlHandle;
1968
1969    fn control_handle(&self) -> &WlanRxControlHandle {
1970        &self.control_handle
1971    }
1972
1973    fn drop_without_shutdown(mut self) {
1974        // Safety: drops once, never accessed again due to mem::forget
1975        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
1976        // Prevent Drop from running (which would shut down the channel)
1977        std::mem::forget(self);
1978    }
1979}
1980
1981impl WlanRxTransferResponder {
1982    /// Sends a response to the FIDL transaction.
1983    ///
1984    /// Sets the channel to shutdown if an error occurs.
1985    pub fn send(self) -> Result<(), fidl::Error> {
1986        let _result = self.send_raw();
1987        if _result.is_err() {
1988            self.control_handle.shutdown();
1989        }
1990        self.drop_without_shutdown();
1991        _result
1992    }
1993
1994    /// Similar to "send" but does not shutdown the channel if an error occurs.
1995    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
1996        let _result = self.send_raw();
1997        self.drop_without_shutdown();
1998        _result
1999    }
2000
2001    fn send_raw(&self) -> Result<(), fidl::Error> {
2002        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
2003            (),
2004            self.tx_id,
2005            0x2c73b18cbfca6055,
2006            fidl::encoding::DynamicFlags::empty(),
2007        )
2008    }
2009}
2010
2011#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
2012pub struct WlanSoftmacBaseMarker;
2013
2014impl fidl::endpoints::ProtocolMarker for WlanSoftmacBaseMarker {
2015    type Proxy = WlanSoftmacBaseProxy;
2016    type RequestStream = WlanSoftmacBaseRequestStream;
2017    #[cfg(target_os = "fuchsia")]
2018    type SynchronousProxy = WlanSoftmacBaseSynchronousProxy;
2019
2020    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacBase";
2021}
2022pub type WlanSoftmacBaseQueryResult = Result<WlanSoftmacQueryResponse, i32>;
2023pub type WlanSoftmacBaseQueryDiscoverySupportResult =
2024    Result<fidl_fuchsia_wlan_common::DiscoverySupport, i32>;
2025pub type WlanSoftmacBaseQueryMacSublayerSupportResult =
2026    Result<fidl_fuchsia_wlan_common::MacSublayerSupport, i32>;
2027pub type WlanSoftmacBaseQuerySecuritySupportResult =
2028    Result<fidl_fuchsia_wlan_common::SecuritySupport, i32>;
2029pub type WlanSoftmacBaseQuerySpectrumManagementSupportResult =
2030    Result<fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>;
2031pub type WlanSoftmacBaseSetChannelResult = Result<(), i32>;
2032pub type WlanSoftmacBaseJoinBssResult = Result<(), i32>;
2033pub type WlanSoftmacBaseEnableBeaconingResult = Result<(), i32>;
2034pub type WlanSoftmacBaseDisableBeaconingResult = Result<(), i32>;
2035pub type WlanSoftmacBaseInstallKeyResult = Result<(), i32>;
2036pub type WlanSoftmacBaseNotifyAssociationCompleteResult = Result<(), i32>;
2037pub type WlanSoftmacBaseClearAssociationResult = Result<(), i32>;
2038pub type WlanSoftmacBaseStartPassiveScanResult =
2039    Result<WlanSoftmacBaseStartPassiveScanResponse, i32>;
2040pub type WlanSoftmacBaseStartActiveScanResult = Result<WlanSoftmacBaseStartActiveScanResponse, i32>;
2041pub type WlanSoftmacBaseCancelScanResult = Result<(), i32>;
2042pub type WlanSoftmacBaseUpdateWmmParametersResult = Result<(), i32>;
2043
2044pub trait WlanSoftmacBaseProxyInterface: Send + Sync {
2045    type QueryResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQueryResult, fidl::Error>>
2046        + Send;
2047    fn r#query(&self) -> Self::QueryResponseFut;
2048    type QueryDiscoverySupportResponseFut: std::future::Future<
2049            Output = Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error>,
2050        > + Send;
2051    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut;
2052    type QueryMacSublayerSupportResponseFut: std::future::Future<
2053            Output = Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error>,
2054        > + Send;
2055    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut;
2056    type QuerySecuritySupportResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error>>
2057        + Send;
2058    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut;
2059    type QuerySpectrumManagementSupportResponseFut: std::future::Future<
2060            Output = Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error>,
2061        > + Send;
2062    fn r#query_spectrum_management_support(
2063        &self,
2064    ) -> Self::QuerySpectrumManagementSupportResponseFut;
2065    type SetChannelResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseSetChannelResult, fidl::Error>>
2066        + Send;
2067    fn r#set_channel(
2068        &self,
2069        payload: &WlanSoftmacBaseSetChannelRequest,
2070    ) -> Self::SetChannelResponseFut;
2071    type JoinBssResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseJoinBssResult, fidl::Error>>
2072        + Send;
2073    fn r#join_bss(
2074        &self,
2075        join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
2076    ) -> Self::JoinBssResponseFut;
2077    type EnableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error>>
2078        + Send;
2079    fn r#enable_beaconing(
2080        &self,
2081        payload: &WlanSoftmacBaseEnableBeaconingRequest,
2082    ) -> Self::EnableBeaconingResponseFut;
2083    type DisableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error>>
2084        + Send;
2085    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut;
2086    type InstallKeyResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseInstallKeyResult, fidl::Error>>
2087        + Send;
2088    fn r#install_key(&self, payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut;
2089    type NotifyAssociationCompleteResponseFut: std::future::Future<
2090            Output = Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error>,
2091        > + Send;
2092    fn r#notify_association_complete(
2093        &self,
2094        assoc_cfg: &WlanAssociationConfig,
2095    ) -> Self::NotifyAssociationCompleteResponseFut;
2096    type ClearAssociationResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseClearAssociationResult, fidl::Error>>
2097        + Send;
2098    fn r#clear_association(
2099        &self,
2100        payload: &WlanSoftmacBaseClearAssociationRequest,
2101    ) -> Self::ClearAssociationResponseFut;
2102    type StartPassiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error>>
2103        + Send;
2104    fn r#start_passive_scan(
2105        &self,
2106        payload: &WlanSoftmacBaseStartPassiveScanRequest,
2107    ) -> Self::StartPassiveScanResponseFut;
2108    type StartActiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error>>
2109        + Send;
2110    fn r#start_active_scan(
2111        &self,
2112        payload: &WlanSoftmacStartActiveScanRequest,
2113    ) -> Self::StartActiveScanResponseFut;
2114    type CancelScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseCancelScanResult, fidl::Error>>
2115        + Send;
2116    fn r#cancel_scan(
2117        &self,
2118        payload: &WlanSoftmacBaseCancelScanRequest,
2119    ) -> Self::CancelScanResponseFut;
2120    type UpdateWmmParametersResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error>>
2121        + Send;
2122    fn r#update_wmm_parameters(
2123        &self,
2124        payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
2125    ) -> Self::UpdateWmmParametersResponseFut;
2126}
2127#[derive(Debug)]
2128#[cfg(target_os = "fuchsia")]
2129pub struct WlanSoftmacBaseSynchronousProxy {
2130    client: fidl::client::sync::Client,
2131}
2132
2133#[cfg(target_os = "fuchsia")]
2134impl fidl::endpoints::SynchronousProxy for WlanSoftmacBaseSynchronousProxy {
2135    type Proxy = WlanSoftmacBaseProxy;
2136    type Protocol = WlanSoftmacBaseMarker;
2137
2138    fn from_channel(inner: fidl::Channel) -> Self {
2139        Self::new(inner)
2140    }
2141
2142    fn into_channel(self) -> fidl::Channel {
2143        self.client.into_channel()
2144    }
2145
2146    fn as_channel(&self) -> &fidl::Channel {
2147        self.client.as_channel()
2148    }
2149}
2150
2151#[cfg(target_os = "fuchsia")]
2152impl WlanSoftmacBaseSynchronousProxy {
2153    pub fn new(channel: fidl::Channel) -> Self {
2154        let protocol_name = <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2155        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
2156    }
2157
2158    pub fn into_channel(self) -> fidl::Channel {
2159        self.client.into_channel()
2160    }
2161
2162    /// Waits until an event arrives and returns it. It is safe for other
2163    /// threads to make concurrent requests while waiting for an event.
2164    pub fn wait_for_event(
2165        &self,
2166        deadline: zx::MonotonicInstant,
2167    ) -> Result<WlanSoftmacBaseEvent, fidl::Error> {
2168        WlanSoftmacBaseEvent::decode(self.client.wait_for_event(deadline)?)
2169    }
2170
2171    /// Gets general information about the device and its supported features.
2172    /// This method is safe to call even when the SoftMAC has not yet started.
2173    ///
2174    /// Note: The implementation of this method must not depend on a response
2175    /// from an ethernet driver, otherwise there is a risk of deadlock.
2176    /// The wlansoftmac driver calls this method synchronously while
2177    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
2178    pub fn r#query(
2179        &self,
2180        ___deadline: zx::MonotonicInstant,
2181    ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
2182        let _response = self.client.send_query::<
2183            fidl::encoding::EmptyPayload,
2184            fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
2185        >(
2186            (),
2187            0x18231a638e508f9d,
2188            fidl::encoding::DynamicFlags::empty(),
2189            ___deadline,
2190        )?;
2191        Ok(_response.map(|x| x))
2192    }
2193
2194    /// Gets information about the station discovery (e.g., scanning and
2195    /// probing) features supported by the device. This method is safe to call
2196    /// even when the SoftMAC has not yet started.
2197    pub fn r#query_discovery_support(
2198        &self,
2199        ___deadline: zx::MonotonicInstant,
2200    ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
2201        let _response =
2202            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2203                WlanSoftmacBaseQueryDiscoverySupportResponse,
2204                i32,
2205            >>(
2206                (),
2207                0x16797affc0cb58ae,
2208                fidl::encoding::DynamicFlags::empty(),
2209                ___deadline,
2210            )?;
2211        Ok(_response.map(|x| x.resp))
2212    }
2213
2214    /// Gets information about the MAC features supported by the device. This
2215    /// method is safe to call even when the SoftMAC has not yet started.
2216    ///
2217    /// Note: The implementation of this method must not depend on a response
2218    /// from an ethernet driver, otherwise there is a risk of deadlock.
2219    /// The wlansoftmac driver calls this method synchronously while
2220    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
2221    pub fn r#query_mac_sublayer_support(
2222        &self,
2223        ___deadline: zx::MonotonicInstant,
2224    ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
2225        let _response =
2226            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2227                WlanSoftmacBaseQueryMacSublayerSupportResponse,
2228                i32,
2229            >>(
2230                (),
2231                0x7302c3f8c131f075,
2232                fidl::encoding::DynamicFlags::empty(),
2233                ___deadline,
2234            )?;
2235        Ok(_response.map(|x| x.resp))
2236    }
2237
2238    /// Gets information about the security features supported by the device.
2239    /// This method is safe to call even when the SoftMAC has not yet started.
2240    pub fn r#query_security_support(
2241        &self,
2242        ___deadline: zx::MonotonicInstant,
2243    ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
2244        let _response =
2245            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2246                WlanSoftmacBaseQuerySecuritySupportResponse,
2247                i32,
2248            >>(
2249                (),
2250                0x3691bb75abf6354,
2251                fidl::encoding::DynamicFlags::empty(),
2252                ___deadline,
2253            )?;
2254        Ok(_response.map(|x| x.resp))
2255    }
2256
2257    /// Gets information about the spectrum usage (e.g., DFS) features supported
2258    /// by the device. This method is safe to call even when the SoftMAC has not
2259    /// yet started.
2260    pub fn r#query_spectrum_management_support(
2261        &self,
2262        ___deadline: zx::MonotonicInstant,
2263    ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
2264        let _response = self
2265            .client
2266            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
2267                WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
2268                i32,
2269            >>(
2270                (), 0x347d78dc1d4d27bf, fidl::encoding::DynamicFlags::empty(), ___deadline
2271            )?;
2272        Ok(_response.map(|x| x.resp))
2273    }
2274
2275    /// Set the primary radio channel, e.g. in response to a channel switch event.
2276    /// If successful, this will trigger the channel switch immediately. This may
2277    /// impact the transmission of any frames that are in-flight, and might also
2278    /// interfere with an ongoing scan request.
2279    ///
2280    /// Common errors include: \
2281    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
2282    pub fn r#set_channel(
2283        &self,
2284        mut payload: &WlanSoftmacBaseSetChannelRequest,
2285        ___deadline: zx::MonotonicInstant,
2286    ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
2287        let _response = self.client.send_query::<
2288            WlanSoftmacBaseSetChannelRequest,
2289            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2290        >(
2291            payload,
2292            0x12836b533cd63ece,
2293            fidl::encoding::DynamicFlags::empty(),
2294            ___deadline,
2295        )?;
2296        Ok(_response.map(|x| x))
2297    }
2298
2299    /// Join a specific BSS in which we will participate.
2300    /// This applies regardless of if we are hosting the BSS or joining it
2301    /// (indicated by the `remote` flag in `JoinBssRequest`).
2302    /// If successful, the device will switch to the correct channel and perform
2303    /// any internal filtering/timing operations required to join the BSS.
2304    /// For client STAs, this is the first step before authenticating.
2305    ///
2306    /// Common errors include: \
2307    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
2308    pub fn r#join_bss(
2309        &self,
2310        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
2311        ___deadline: zx::MonotonicInstant,
2312    ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
2313        let _response = self.client.send_query::<
2314            WlanSoftmacBaseJoinBssRequest,
2315            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2316        >(
2317            (join_request,),
2318            0x1336fb5455b77a6e,
2319            fidl::encoding::DynamicFlags::empty(),
2320            ___deadline,
2321        )?;
2322        Ok(_response.map(|x| x))
2323    }
2324
2325    /// Enables hardware Beaconing.
2326    ///
2327    /// This method cannot be called while beaconing is enabled and so
2328    /// `DisableBeaconing` must be called prior to this method if beaconing is
2329    /// enabled.
2330    ///
2331    /// All request fields are required.
2332    ///
2333    /// Common errors include:
2334    ///
2335    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
2336    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
2337    ///                          beacon.
2338    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
2339    pub fn r#enable_beaconing(
2340        &self,
2341        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
2342        ___deadline: zx::MonotonicInstant,
2343    ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
2344        let _response = self.client.send_query::<
2345            WlanSoftmacBaseEnableBeaconingRequest,
2346            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2347        >(
2348            payload,
2349            0x6c35807632c64576,
2350            fidl::encoding::DynamicFlags::empty(),
2351            ___deadline,
2352        )?;
2353        Ok(_response.map(|x| x))
2354    }
2355
2356    /// Disables hardware beaconing.
2357    pub fn r#disable_beaconing(
2358        &self,
2359        ___deadline: zx::MonotonicInstant,
2360    ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
2361        let _response = self.client.send_query::<
2362            fidl::encoding::EmptyPayload,
2363            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2364        >(
2365            (),
2366            0x3303b30f99dbb406,
2367            fidl::encoding::DynamicFlags::empty(),
2368            ___deadline,
2369        )?;
2370        Ok(_response.map(|x| x))
2371    }
2372
2373    /// Install a key for encryption when transmitting or receiving protected
2374    /// frames.
2375    ///
2376    /// Common errors include:
2377    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
2378    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
2379    pub fn r#install_key(
2380        &self,
2381        mut payload: &WlanKeyConfiguration,
2382        ___deadline: zx::MonotonicInstant,
2383    ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
2384        let _response = self.client.send_query::<
2385            WlanKeyConfiguration,
2386            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2387        >(
2388            payload,
2389            0x7decf9b4200b9131,
2390            fidl::encoding::DynamicFlags::empty(),
2391            ___deadline,
2392        )?;
2393        Ok(_response.map(|x| x))
2394    }
2395
2396    /// Notifies the device of a successful association and configures
2397    /// additional parameters necessary to participate in that association.
2398    ///
2399    /// # Errors
2400    ///
2401    /// Common errors include:
2402    ///
2403    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
2404    ///                       via `WlanSoftmac.JoinBss`.
2405    pub fn r#notify_association_complete(
2406        &self,
2407        mut assoc_cfg: &WlanAssociationConfig,
2408        ___deadline: zx::MonotonicInstant,
2409    ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
2410        let _response = self.client.send_query::<
2411            WlanSoftmacBaseNotifyAssociationCompleteRequest,
2412            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2413        >(
2414            (assoc_cfg,),
2415            0x436ffe3ba461d6cd,
2416            fidl::encoding::DynamicFlags::empty(),
2417            ___deadline,
2418        )?;
2419        Ok(_response.map(|x| x))
2420    }
2421
2422    /// Notifies MAC and PHY that the peer has been de-associated.
2423    pub fn r#clear_association(
2424        &self,
2425        mut payload: &WlanSoftmacBaseClearAssociationRequest,
2426        ___deadline: zx::MonotonicInstant,
2427    ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
2428        let _response = self.client.send_query::<
2429            WlanSoftmacBaseClearAssociationRequest,
2430            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2431        >(
2432            payload,
2433            0x581d76c39190a7dd,
2434            fidl::encoding::DynamicFlags::empty(),
2435            ___deadline,
2436        )?;
2437        Ok(_response.map(|x| x))
2438    }
2439
2440    /// Starts a passive scan. The server will deliver scan results
2441    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
2442    /// the server will call WlanSoftmacIfc.ScanComplete() with the
2443    /// same `scan_id` returned by StartPassiveScan().
2444    ///
2445    /// The server indicates support for `StartPassiveScan()` using
2446    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
2447    ///
2448    /// Common errors include:
2449    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
2450    ///       requested scan, e.g. because an incompatible channel was requested.
2451    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
2452    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
2453    pub fn r#start_passive_scan(
2454        &self,
2455        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
2456        ___deadline: zx::MonotonicInstant,
2457    ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
2458        let _response = self.client.send_query::<
2459            WlanSoftmacBaseStartPassiveScanRequest,
2460            fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
2461        >(
2462            payload,
2463            0x5662f989cb4083bb,
2464            fidl::encoding::DynamicFlags::empty(),
2465            ___deadline,
2466        )?;
2467        Ok(_response.map(|x| x))
2468    }
2469
2470    /// Starts an active scan. The server will deliver scan results
2471    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
2472    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
2473    /// with the same `scan_id` returned by StartActiveScan().
2474    ///
2475    /// A device driver indicates support for `StartActiveScan()` using
2476    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
2477    ///
2478    /// Common errors include:
2479    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
2480    ///       requested scan, e.g. because an incompatible channel was requested.
2481    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
2482    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
2483    pub fn r#start_active_scan(
2484        &self,
2485        mut payload: &WlanSoftmacStartActiveScanRequest,
2486        ___deadline: zx::MonotonicInstant,
2487    ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
2488        let _response = self.client.send_query::<
2489            WlanSoftmacStartActiveScanRequest,
2490            fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
2491        >(
2492            payload,
2493            0x4896eafa9937751e,
2494            fidl::encoding::DynamicFlags::empty(),
2495            ___deadline,
2496        )?;
2497        Ok(_response.map(|x| x))
2498    }
2499
2500    /// Cancels the ongoing scan corresponding to `scan_id`,
2501    /// where `scan_id` is an identifier returned by
2502    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
2503    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
2504    /// `scan_id`.
2505    ///
2506    /// A device driver indicates support for `CancelScan()` using
2507    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
2508    ///
2509    /// Common errors include:
2510    ///
2511    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
2512    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
2513    pub fn r#cancel_scan(
2514        &self,
2515        mut payload: &WlanSoftmacBaseCancelScanRequest,
2516        ___deadline: zx::MonotonicInstant,
2517    ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
2518        let _response = self.client.send_query::<
2519            WlanSoftmacBaseCancelScanRequest,
2520            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2521        >(
2522            payload,
2523            0xf7d859369764556,
2524            fidl::encoding::DynamicFlags::empty(),
2525            ___deadline,
2526        )?;
2527        Ok(_response.map(|x| x))
2528    }
2529
2530    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
2531    /// particular access category (AC).
2532    pub fn r#update_wmm_parameters(
2533        &self,
2534        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
2535        ___deadline: zx::MonotonicInstant,
2536    ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
2537        let _response = self.client.send_query::<
2538            WlanSoftmacBaseUpdateWmmParametersRequest,
2539            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2540        >(
2541            payload,
2542            0x68522c7122d5f78c,
2543            fidl::encoding::DynamicFlags::empty(),
2544            ___deadline,
2545        )?;
2546        Ok(_response.map(|x| x))
2547    }
2548}
2549
2550#[derive(Debug, Clone)]
2551pub struct WlanSoftmacBaseProxy {
2552    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
2553}
2554
2555impl fidl::endpoints::Proxy for WlanSoftmacBaseProxy {
2556    type Protocol = WlanSoftmacBaseMarker;
2557
2558    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
2559        Self::new(inner)
2560    }
2561
2562    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
2563        self.client.into_channel().map_err(|client| Self { client })
2564    }
2565
2566    fn as_channel(&self) -> &::fidl::AsyncChannel {
2567        self.client.as_channel()
2568    }
2569}
2570
2571impl WlanSoftmacBaseProxy {
2572    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacBase.
2573    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
2574        let protocol_name = <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
2575        Self { client: fidl::client::Client::new(channel, protocol_name) }
2576    }
2577
2578    /// Get a Stream of events from the remote end of the protocol.
2579    ///
2580    /// # Panics
2581    ///
2582    /// Panics if the event stream was already taken.
2583    pub fn take_event_stream(&self) -> WlanSoftmacBaseEventStream {
2584        WlanSoftmacBaseEventStream { event_receiver: self.client.take_event_receiver() }
2585    }
2586
2587    /// Gets general information about the device and its supported features.
2588    /// This method is safe to call even when the SoftMAC has not yet started.
2589    ///
2590    /// Note: The implementation of this method must not depend on a response
2591    /// from an ethernet driver, otherwise there is a risk of deadlock.
2592    /// The wlansoftmac driver calls this method synchronously while
2593    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
2594    pub fn r#query(
2595        &self,
2596    ) -> fidl::client::QueryResponseFut<
2597        WlanSoftmacBaseQueryResult,
2598        fidl::encoding::DefaultFuchsiaResourceDialect,
2599    > {
2600        WlanSoftmacBaseProxyInterface::r#query(self)
2601    }
2602
2603    /// Gets information about the station discovery (e.g., scanning and
2604    /// probing) features supported by the device. This method is safe to call
2605    /// even when the SoftMAC has not yet started.
2606    pub fn r#query_discovery_support(
2607        &self,
2608    ) -> fidl::client::QueryResponseFut<
2609        WlanSoftmacBaseQueryDiscoverySupportResult,
2610        fidl::encoding::DefaultFuchsiaResourceDialect,
2611    > {
2612        WlanSoftmacBaseProxyInterface::r#query_discovery_support(self)
2613    }
2614
2615    /// Gets information about the MAC features supported by the device. This
2616    /// method is safe to call even when the SoftMAC has not yet started.
2617    ///
2618    /// Note: The implementation of this method must not depend on a response
2619    /// from an ethernet driver, otherwise there is a risk of deadlock.
2620    /// The wlansoftmac driver calls this method synchronously while
2621    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
2622    pub fn r#query_mac_sublayer_support(
2623        &self,
2624    ) -> fidl::client::QueryResponseFut<
2625        WlanSoftmacBaseQueryMacSublayerSupportResult,
2626        fidl::encoding::DefaultFuchsiaResourceDialect,
2627    > {
2628        WlanSoftmacBaseProxyInterface::r#query_mac_sublayer_support(self)
2629    }
2630
2631    /// Gets information about the security features supported by the device.
2632    /// This method is safe to call even when the SoftMAC has not yet started.
2633    pub fn r#query_security_support(
2634        &self,
2635    ) -> fidl::client::QueryResponseFut<
2636        WlanSoftmacBaseQuerySecuritySupportResult,
2637        fidl::encoding::DefaultFuchsiaResourceDialect,
2638    > {
2639        WlanSoftmacBaseProxyInterface::r#query_security_support(self)
2640    }
2641
2642    /// Gets information about the spectrum usage (e.g., DFS) features supported
2643    /// by the device. This method is safe to call even when the SoftMAC has not
2644    /// yet started.
2645    pub fn r#query_spectrum_management_support(
2646        &self,
2647    ) -> fidl::client::QueryResponseFut<
2648        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
2649        fidl::encoding::DefaultFuchsiaResourceDialect,
2650    > {
2651        WlanSoftmacBaseProxyInterface::r#query_spectrum_management_support(self)
2652    }
2653
2654    /// Set the primary radio channel, e.g. in response to a channel switch event.
2655    /// If successful, this will trigger the channel switch immediately. This may
2656    /// impact the transmission of any frames that are in-flight, and might also
2657    /// interfere with an ongoing scan request.
2658    ///
2659    /// Common errors include: \
2660    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
2661    pub fn r#set_channel(
2662        &self,
2663        mut payload: &WlanSoftmacBaseSetChannelRequest,
2664    ) -> fidl::client::QueryResponseFut<
2665        WlanSoftmacBaseSetChannelResult,
2666        fidl::encoding::DefaultFuchsiaResourceDialect,
2667    > {
2668        WlanSoftmacBaseProxyInterface::r#set_channel(self, payload)
2669    }
2670
2671    /// Join a specific BSS in which we will participate.
2672    /// This applies regardless of if we are hosting the BSS or joining it
2673    /// (indicated by the `remote` flag in `JoinBssRequest`).
2674    /// If successful, the device will switch to the correct channel and perform
2675    /// any internal filtering/timing operations required to join the BSS.
2676    /// For client STAs, this is the first step before authenticating.
2677    ///
2678    /// Common errors include: \
2679    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
2680    pub fn r#join_bss(
2681        &self,
2682        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
2683    ) -> fidl::client::QueryResponseFut<
2684        WlanSoftmacBaseJoinBssResult,
2685        fidl::encoding::DefaultFuchsiaResourceDialect,
2686    > {
2687        WlanSoftmacBaseProxyInterface::r#join_bss(self, join_request)
2688    }
2689
2690    /// Enables hardware Beaconing.
2691    ///
2692    /// This method cannot be called while beaconing is enabled and so
2693    /// `DisableBeaconing` must be called prior to this method if beaconing is
2694    /// enabled.
2695    ///
2696    /// All request fields are required.
2697    ///
2698    /// Common errors include:
2699    ///
2700    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
2701    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
2702    ///                          beacon.
2703    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
2704    pub fn r#enable_beaconing(
2705        &self,
2706        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
2707    ) -> fidl::client::QueryResponseFut<
2708        WlanSoftmacBaseEnableBeaconingResult,
2709        fidl::encoding::DefaultFuchsiaResourceDialect,
2710    > {
2711        WlanSoftmacBaseProxyInterface::r#enable_beaconing(self, payload)
2712    }
2713
2714    /// Disables hardware beaconing.
2715    pub fn r#disable_beaconing(
2716        &self,
2717    ) -> fidl::client::QueryResponseFut<
2718        WlanSoftmacBaseDisableBeaconingResult,
2719        fidl::encoding::DefaultFuchsiaResourceDialect,
2720    > {
2721        WlanSoftmacBaseProxyInterface::r#disable_beaconing(self)
2722    }
2723
2724    /// Install a key for encryption when transmitting or receiving protected
2725    /// frames.
2726    ///
2727    /// Common errors include:
2728    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
2729    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
2730    pub fn r#install_key(
2731        &self,
2732        mut payload: &WlanKeyConfiguration,
2733    ) -> fidl::client::QueryResponseFut<
2734        WlanSoftmacBaseInstallKeyResult,
2735        fidl::encoding::DefaultFuchsiaResourceDialect,
2736    > {
2737        WlanSoftmacBaseProxyInterface::r#install_key(self, payload)
2738    }
2739
2740    /// Notifies the device of a successful association and configures
2741    /// additional parameters necessary to participate in that association.
2742    ///
2743    /// # Errors
2744    ///
2745    /// Common errors include:
2746    ///
2747    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
2748    ///                       via `WlanSoftmac.JoinBss`.
2749    pub fn r#notify_association_complete(
2750        &self,
2751        mut assoc_cfg: &WlanAssociationConfig,
2752    ) -> fidl::client::QueryResponseFut<
2753        WlanSoftmacBaseNotifyAssociationCompleteResult,
2754        fidl::encoding::DefaultFuchsiaResourceDialect,
2755    > {
2756        WlanSoftmacBaseProxyInterface::r#notify_association_complete(self, assoc_cfg)
2757    }
2758
2759    /// Notifies MAC and PHY that the peer has been de-associated.
2760    pub fn r#clear_association(
2761        &self,
2762        mut payload: &WlanSoftmacBaseClearAssociationRequest,
2763    ) -> fidl::client::QueryResponseFut<
2764        WlanSoftmacBaseClearAssociationResult,
2765        fidl::encoding::DefaultFuchsiaResourceDialect,
2766    > {
2767        WlanSoftmacBaseProxyInterface::r#clear_association(self, payload)
2768    }
2769
2770    /// Starts a passive scan. The server will deliver scan results
2771    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
2772    /// the server will call WlanSoftmacIfc.ScanComplete() with the
2773    /// same `scan_id` returned by StartPassiveScan().
2774    ///
2775    /// The server indicates support for `StartPassiveScan()` using
2776    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
2777    ///
2778    /// Common errors include:
2779    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
2780    ///       requested scan, e.g. because an incompatible channel was requested.
2781    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
2782    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
2783    pub fn r#start_passive_scan(
2784        &self,
2785        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
2786    ) -> fidl::client::QueryResponseFut<
2787        WlanSoftmacBaseStartPassiveScanResult,
2788        fidl::encoding::DefaultFuchsiaResourceDialect,
2789    > {
2790        WlanSoftmacBaseProxyInterface::r#start_passive_scan(self, payload)
2791    }
2792
2793    /// Starts an active scan. The server will deliver scan results
2794    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
2795    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
2796    /// with the same `scan_id` returned by StartActiveScan().
2797    ///
2798    /// A device driver indicates support for `StartActiveScan()` using
2799    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
2800    ///
2801    /// Common errors include:
2802    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
2803    ///       requested scan, e.g. because an incompatible channel was requested.
2804    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
2805    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
2806    pub fn r#start_active_scan(
2807        &self,
2808        mut payload: &WlanSoftmacStartActiveScanRequest,
2809    ) -> fidl::client::QueryResponseFut<
2810        WlanSoftmacBaseStartActiveScanResult,
2811        fidl::encoding::DefaultFuchsiaResourceDialect,
2812    > {
2813        WlanSoftmacBaseProxyInterface::r#start_active_scan(self, payload)
2814    }
2815
2816    /// Cancels the ongoing scan corresponding to `scan_id`,
2817    /// where `scan_id` is an identifier returned by
2818    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
2819    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
2820    /// `scan_id`.
2821    ///
2822    /// A device driver indicates support for `CancelScan()` using
2823    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
2824    ///
2825    /// Common errors include:
2826    ///
2827    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
2828    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
2829    pub fn r#cancel_scan(
2830        &self,
2831        mut payload: &WlanSoftmacBaseCancelScanRequest,
2832    ) -> fidl::client::QueryResponseFut<
2833        WlanSoftmacBaseCancelScanResult,
2834        fidl::encoding::DefaultFuchsiaResourceDialect,
2835    > {
2836        WlanSoftmacBaseProxyInterface::r#cancel_scan(self, payload)
2837    }
2838
2839    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
2840    /// particular access category (AC).
2841    pub fn r#update_wmm_parameters(
2842        &self,
2843        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
2844    ) -> fidl::client::QueryResponseFut<
2845        WlanSoftmacBaseUpdateWmmParametersResult,
2846        fidl::encoding::DefaultFuchsiaResourceDialect,
2847    > {
2848        WlanSoftmacBaseProxyInterface::r#update_wmm_parameters(self, payload)
2849    }
2850}
2851
2852impl WlanSoftmacBaseProxyInterface for WlanSoftmacBaseProxy {
2853    type QueryResponseFut = fidl::client::QueryResponseFut<
2854        WlanSoftmacBaseQueryResult,
2855        fidl::encoding::DefaultFuchsiaResourceDialect,
2856    >;
2857    fn r#query(&self) -> Self::QueryResponseFut {
2858        fn _decode(
2859            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2860        ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
2861            let _response = fidl::client::decode_transaction_body::<
2862                fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
2863                fidl::encoding::DefaultFuchsiaResourceDialect,
2864                0x18231a638e508f9d,
2865            >(_buf?)?;
2866            Ok(_response.map(|x| x))
2867        }
2868        self.client
2869            .send_query_and_decode::<fidl::encoding::EmptyPayload, WlanSoftmacBaseQueryResult>(
2870                (),
2871                0x18231a638e508f9d,
2872                fidl::encoding::DynamicFlags::empty(),
2873                _decode,
2874            )
2875    }
2876
2877    type QueryDiscoverySupportResponseFut = fidl::client::QueryResponseFut<
2878        WlanSoftmacBaseQueryDiscoverySupportResult,
2879        fidl::encoding::DefaultFuchsiaResourceDialect,
2880    >;
2881    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut {
2882        fn _decode(
2883            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2884        ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
2885            let _response = fidl::client::decode_transaction_body::<
2886                fidl::encoding::ResultType<WlanSoftmacBaseQueryDiscoverySupportResponse, i32>,
2887                fidl::encoding::DefaultFuchsiaResourceDialect,
2888                0x16797affc0cb58ae,
2889            >(_buf?)?;
2890            Ok(_response.map(|x| x.resp))
2891        }
2892        self.client.send_query_and_decode::<
2893            fidl::encoding::EmptyPayload,
2894            WlanSoftmacBaseQueryDiscoverySupportResult,
2895        >(
2896            (),
2897            0x16797affc0cb58ae,
2898            fidl::encoding::DynamicFlags::empty(),
2899            _decode,
2900        )
2901    }
2902
2903    type QueryMacSublayerSupportResponseFut = fidl::client::QueryResponseFut<
2904        WlanSoftmacBaseQueryMacSublayerSupportResult,
2905        fidl::encoding::DefaultFuchsiaResourceDialect,
2906    >;
2907    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut {
2908        fn _decode(
2909            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2910        ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
2911            let _response = fidl::client::decode_transaction_body::<
2912                fidl::encoding::ResultType<WlanSoftmacBaseQueryMacSublayerSupportResponse, i32>,
2913                fidl::encoding::DefaultFuchsiaResourceDialect,
2914                0x7302c3f8c131f075,
2915            >(_buf?)?;
2916            Ok(_response.map(|x| x.resp))
2917        }
2918        self.client.send_query_and_decode::<
2919            fidl::encoding::EmptyPayload,
2920            WlanSoftmacBaseQueryMacSublayerSupportResult,
2921        >(
2922            (),
2923            0x7302c3f8c131f075,
2924            fidl::encoding::DynamicFlags::empty(),
2925            _decode,
2926        )
2927    }
2928
2929    type QuerySecuritySupportResponseFut = fidl::client::QueryResponseFut<
2930        WlanSoftmacBaseQuerySecuritySupportResult,
2931        fidl::encoding::DefaultFuchsiaResourceDialect,
2932    >;
2933    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut {
2934        fn _decode(
2935            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2936        ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
2937            let _response = fidl::client::decode_transaction_body::<
2938                fidl::encoding::ResultType<WlanSoftmacBaseQuerySecuritySupportResponse, i32>,
2939                fidl::encoding::DefaultFuchsiaResourceDialect,
2940                0x3691bb75abf6354,
2941            >(_buf?)?;
2942            Ok(_response.map(|x| x.resp))
2943        }
2944        self.client.send_query_and_decode::<
2945            fidl::encoding::EmptyPayload,
2946            WlanSoftmacBaseQuerySecuritySupportResult,
2947        >(
2948            (),
2949            0x3691bb75abf6354,
2950            fidl::encoding::DynamicFlags::empty(),
2951            _decode,
2952        )
2953    }
2954
2955    type QuerySpectrumManagementSupportResponseFut = fidl::client::QueryResponseFut<
2956        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
2957        fidl::encoding::DefaultFuchsiaResourceDialect,
2958    >;
2959    fn r#query_spectrum_management_support(
2960        &self,
2961    ) -> Self::QuerySpectrumManagementSupportResponseFut {
2962        fn _decode(
2963            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2964        ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
2965            let _response = fidl::client::decode_transaction_body::<
2966                fidl::encoding::ResultType<
2967                    WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
2968                    i32,
2969                >,
2970                fidl::encoding::DefaultFuchsiaResourceDialect,
2971                0x347d78dc1d4d27bf,
2972            >(_buf?)?;
2973            Ok(_response.map(|x| x.resp))
2974        }
2975        self.client.send_query_and_decode::<
2976            fidl::encoding::EmptyPayload,
2977            WlanSoftmacBaseQuerySpectrumManagementSupportResult,
2978        >(
2979            (),
2980            0x347d78dc1d4d27bf,
2981            fidl::encoding::DynamicFlags::empty(),
2982            _decode,
2983        )
2984    }
2985
2986    type SetChannelResponseFut = fidl::client::QueryResponseFut<
2987        WlanSoftmacBaseSetChannelResult,
2988        fidl::encoding::DefaultFuchsiaResourceDialect,
2989    >;
2990    fn r#set_channel(
2991        &self,
2992        mut payload: &WlanSoftmacBaseSetChannelRequest,
2993    ) -> Self::SetChannelResponseFut {
2994        fn _decode(
2995            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
2996        ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
2997            let _response = fidl::client::decode_transaction_body::<
2998                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
2999                fidl::encoding::DefaultFuchsiaResourceDialect,
3000                0x12836b533cd63ece,
3001            >(_buf?)?;
3002            Ok(_response.map(|x| x))
3003        }
3004        self.client.send_query_and_decode::<
3005            WlanSoftmacBaseSetChannelRequest,
3006            WlanSoftmacBaseSetChannelResult,
3007        >(
3008            payload,
3009            0x12836b533cd63ece,
3010            fidl::encoding::DynamicFlags::empty(),
3011            _decode,
3012        )
3013    }
3014
3015    type JoinBssResponseFut = fidl::client::QueryResponseFut<
3016        WlanSoftmacBaseJoinBssResult,
3017        fidl::encoding::DefaultFuchsiaResourceDialect,
3018    >;
3019    fn r#join_bss(
3020        &self,
3021        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
3022    ) -> Self::JoinBssResponseFut {
3023        fn _decode(
3024            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3025        ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
3026            let _response = fidl::client::decode_transaction_body::<
3027                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3028                fidl::encoding::DefaultFuchsiaResourceDialect,
3029                0x1336fb5455b77a6e,
3030            >(_buf?)?;
3031            Ok(_response.map(|x| x))
3032        }
3033        self.client
3034            .send_query_and_decode::<WlanSoftmacBaseJoinBssRequest, WlanSoftmacBaseJoinBssResult>(
3035                (join_request,),
3036                0x1336fb5455b77a6e,
3037                fidl::encoding::DynamicFlags::empty(),
3038                _decode,
3039            )
3040    }
3041
3042    type EnableBeaconingResponseFut = fidl::client::QueryResponseFut<
3043        WlanSoftmacBaseEnableBeaconingResult,
3044        fidl::encoding::DefaultFuchsiaResourceDialect,
3045    >;
3046    fn r#enable_beaconing(
3047        &self,
3048        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
3049    ) -> Self::EnableBeaconingResponseFut {
3050        fn _decode(
3051            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3052        ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
3053            let _response = fidl::client::decode_transaction_body::<
3054                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3055                fidl::encoding::DefaultFuchsiaResourceDialect,
3056                0x6c35807632c64576,
3057            >(_buf?)?;
3058            Ok(_response.map(|x| x))
3059        }
3060        self.client.send_query_and_decode::<
3061            WlanSoftmacBaseEnableBeaconingRequest,
3062            WlanSoftmacBaseEnableBeaconingResult,
3063        >(
3064            payload,
3065            0x6c35807632c64576,
3066            fidl::encoding::DynamicFlags::empty(),
3067            _decode,
3068        )
3069    }
3070
3071    type DisableBeaconingResponseFut = fidl::client::QueryResponseFut<
3072        WlanSoftmacBaseDisableBeaconingResult,
3073        fidl::encoding::DefaultFuchsiaResourceDialect,
3074    >;
3075    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut {
3076        fn _decode(
3077            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3078        ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
3079            let _response = fidl::client::decode_transaction_body::<
3080                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3081                fidl::encoding::DefaultFuchsiaResourceDialect,
3082                0x3303b30f99dbb406,
3083            >(_buf?)?;
3084            Ok(_response.map(|x| x))
3085        }
3086        self.client.send_query_and_decode::<
3087            fidl::encoding::EmptyPayload,
3088            WlanSoftmacBaseDisableBeaconingResult,
3089        >(
3090            (),
3091            0x3303b30f99dbb406,
3092            fidl::encoding::DynamicFlags::empty(),
3093            _decode,
3094        )
3095    }
3096
3097    type InstallKeyResponseFut = fidl::client::QueryResponseFut<
3098        WlanSoftmacBaseInstallKeyResult,
3099        fidl::encoding::DefaultFuchsiaResourceDialect,
3100    >;
3101    fn r#install_key(&self, mut payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut {
3102        fn _decode(
3103            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3104        ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
3105            let _response = fidl::client::decode_transaction_body::<
3106                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3107                fidl::encoding::DefaultFuchsiaResourceDialect,
3108                0x7decf9b4200b9131,
3109            >(_buf?)?;
3110            Ok(_response.map(|x| x))
3111        }
3112        self.client.send_query_and_decode::<WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResult>(
3113            payload,
3114            0x7decf9b4200b9131,
3115            fidl::encoding::DynamicFlags::empty(),
3116            _decode,
3117        )
3118    }
3119
3120    type NotifyAssociationCompleteResponseFut = fidl::client::QueryResponseFut<
3121        WlanSoftmacBaseNotifyAssociationCompleteResult,
3122        fidl::encoding::DefaultFuchsiaResourceDialect,
3123    >;
3124    fn r#notify_association_complete(
3125        &self,
3126        mut assoc_cfg: &WlanAssociationConfig,
3127    ) -> Self::NotifyAssociationCompleteResponseFut {
3128        fn _decode(
3129            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3130        ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
3131            let _response = fidl::client::decode_transaction_body::<
3132                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3133                fidl::encoding::DefaultFuchsiaResourceDialect,
3134                0x436ffe3ba461d6cd,
3135            >(_buf?)?;
3136            Ok(_response.map(|x| x))
3137        }
3138        self.client.send_query_and_decode::<
3139            WlanSoftmacBaseNotifyAssociationCompleteRequest,
3140            WlanSoftmacBaseNotifyAssociationCompleteResult,
3141        >(
3142            (assoc_cfg,),
3143            0x436ffe3ba461d6cd,
3144            fidl::encoding::DynamicFlags::empty(),
3145            _decode,
3146        )
3147    }
3148
3149    type ClearAssociationResponseFut = fidl::client::QueryResponseFut<
3150        WlanSoftmacBaseClearAssociationResult,
3151        fidl::encoding::DefaultFuchsiaResourceDialect,
3152    >;
3153    fn r#clear_association(
3154        &self,
3155        mut payload: &WlanSoftmacBaseClearAssociationRequest,
3156    ) -> Self::ClearAssociationResponseFut {
3157        fn _decode(
3158            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3159        ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
3160            let _response = fidl::client::decode_transaction_body::<
3161                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3162                fidl::encoding::DefaultFuchsiaResourceDialect,
3163                0x581d76c39190a7dd,
3164            >(_buf?)?;
3165            Ok(_response.map(|x| x))
3166        }
3167        self.client.send_query_and_decode::<
3168            WlanSoftmacBaseClearAssociationRequest,
3169            WlanSoftmacBaseClearAssociationResult,
3170        >(
3171            payload,
3172            0x581d76c39190a7dd,
3173            fidl::encoding::DynamicFlags::empty(),
3174            _decode,
3175        )
3176    }
3177
3178    type StartPassiveScanResponseFut = fidl::client::QueryResponseFut<
3179        WlanSoftmacBaseStartPassiveScanResult,
3180        fidl::encoding::DefaultFuchsiaResourceDialect,
3181    >;
3182    fn r#start_passive_scan(
3183        &self,
3184        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
3185    ) -> Self::StartPassiveScanResponseFut {
3186        fn _decode(
3187            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3188        ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
3189            let _response = fidl::client::decode_transaction_body::<
3190                fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
3191                fidl::encoding::DefaultFuchsiaResourceDialect,
3192                0x5662f989cb4083bb,
3193            >(_buf?)?;
3194            Ok(_response.map(|x| x))
3195        }
3196        self.client.send_query_and_decode::<
3197            WlanSoftmacBaseStartPassiveScanRequest,
3198            WlanSoftmacBaseStartPassiveScanResult,
3199        >(
3200            payload,
3201            0x5662f989cb4083bb,
3202            fidl::encoding::DynamicFlags::empty(),
3203            _decode,
3204        )
3205    }
3206
3207    type StartActiveScanResponseFut = fidl::client::QueryResponseFut<
3208        WlanSoftmacBaseStartActiveScanResult,
3209        fidl::encoding::DefaultFuchsiaResourceDialect,
3210    >;
3211    fn r#start_active_scan(
3212        &self,
3213        mut payload: &WlanSoftmacStartActiveScanRequest,
3214    ) -> Self::StartActiveScanResponseFut {
3215        fn _decode(
3216            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3217        ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
3218            let _response = fidl::client::decode_transaction_body::<
3219                fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
3220                fidl::encoding::DefaultFuchsiaResourceDialect,
3221                0x4896eafa9937751e,
3222            >(_buf?)?;
3223            Ok(_response.map(|x| x))
3224        }
3225        self.client.send_query_and_decode::<
3226            WlanSoftmacStartActiveScanRequest,
3227            WlanSoftmacBaseStartActiveScanResult,
3228        >(
3229            payload,
3230            0x4896eafa9937751e,
3231            fidl::encoding::DynamicFlags::empty(),
3232            _decode,
3233        )
3234    }
3235
3236    type CancelScanResponseFut = fidl::client::QueryResponseFut<
3237        WlanSoftmacBaseCancelScanResult,
3238        fidl::encoding::DefaultFuchsiaResourceDialect,
3239    >;
3240    fn r#cancel_scan(
3241        &self,
3242        mut payload: &WlanSoftmacBaseCancelScanRequest,
3243    ) -> Self::CancelScanResponseFut {
3244        fn _decode(
3245            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3246        ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
3247            let _response = fidl::client::decode_transaction_body::<
3248                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3249                fidl::encoding::DefaultFuchsiaResourceDialect,
3250                0xf7d859369764556,
3251            >(_buf?)?;
3252            Ok(_response.map(|x| x))
3253        }
3254        self.client.send_query_and_decode::<
3255            WlanSoftmacBaseCancelScanRequest,
3256            WlanSoftmacBaseCancelScanResult,
3257        >(
3258            payload,
3259            0xf7d859369764556,
3260            fidl::encoding::DynamicFlags::empty(),
3261            _decode,
3262        )
3263    }
3264
3265    type UpdateWmmParametersResponseFut = fidl::client::QueryResponseFut<
3266        WlanSoftmacBaseUpdateWmmParametersResult,
3267        fidl::encoding::DefaultFuchsiaResourceDialect,
3268    >;
3269    fn r#update_wmm_parameters(
3270        &self,
3271        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
3272    ) -> Self::UpdateWmmParametersResponseFut {
3273        fn _decode(
3274            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
3275        ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
3276            let _response = fidl::client::decode_transaction_body::<
3277                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
3278                fidl::encoding::DefaultFuchsiaResourceDialect,
3279                0x68522c7122d5f78c,
3280            >(_buf?)?;
3281            Ok(_response.map(|x| x))
3282        }
3283        self.client.send_query_and_decode::<
3284            WlanSoftmacBaseUpdateWmmParametersRequest,
3285            WlanSoftmacBaseUpdateWmmParametersResult,
3286        >(
3287            payload,
3288            0x68522c7122d5f78c,
3289            fidl::encoding::DynamicFlags::empty(),
3290            _decode,
3291        )
3292    }
3293}
3294
3295pub struct WlanSoftmacBaseEventStream {
3296    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
3297}
3298
3299impl std::marker::Unpin for WlanSoftmacBaseEventStream {}
3300
3301impl futures::stream::FusedStream for WlanSoftmacBaseEventStream {
3302    fn is_terminated(&self) -> bool {
3303        self.event_receiver.is_terminated()
3304    }
3305}
3306
3307impl futures::Stream for WlanSoftmacBaseEventStream {
3308    type Item = Result<WlanSoftmacBaseEvent, fidl::Error>;
3309
3310    fn poll_next(
3311        mut self: std::pin::Pin<&mut Self>,
3312        cx: &mut std::task::Context<'_>,
3313    ) -> std::task::Poll<Option<Self::Item>> {
3314        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
3315            &mut self.event_receiver,
3316            cx
3317        )?) {
3318            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacBaseEvent::decode(buf))),
3319            None => std::task::Poll::Ready(None),
3320        }
3321    }
3322}
3323
3324#[derive(Debug)]
3325pub enum WlanSoftmacBaseEvent {}
3326
3327impl WlanSoftmacBaseEvent {
3328    /// Decodes a message buffer as a [`WlanSoftmacBaseEvent`].
3329    fn decode(
3330        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
3331    ) -> Result<WlanSoftmacBaseEvent, fidl::Error> {
3332        let (bytes, _handles) = buf.split_mut();
3333        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3334        debug_assert_eq!(tx_header.tx_id, 0);
3335        match tx_header.ordinal {
3336            _ => Err(fidl::Error::UnknownOrdinal {
3337                ordinal: tx_header.ordinal,
3338                protocol_name:
3339                    <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3340            }),
3341        }
3342    }
3343}
3344
3345/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacBase.
3346pub struct WlanSoftmacBaseRequestStream {
3347    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3348    is_terminated: bool,
3349}
3350
3351impl std::marker::Unpin for WlanSoftmacBaseRequestStream {}
3352
3353impl futures::stream::FusedStream for WlanSoftmacBaseRequestStream {
3354    fn is_terminated(&self) -> bool {
3355        self.is_terminated
3356    }
3357}
3358
3359impl fidl::endpoints::RequestStream for WlanSoftmacBaseRequestStream {
3360    type Protocol = WlanSoftmacBaseMarker;
3361    type ControlHandle = WlanSoftmacBaseControlHandle;
3362
3363    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
3364        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
3365    }
3366
3367    fn control_handle(&self) -> Self::ControlHandle {
3368        WlanSoftmacBaseControlHandle { inner: self.inner.clone() }
3369    }
3370
3371    fn into_inner(
3372        self,
3373    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
3374    {
3375        (self.inner, self.is_terminated)
3376    }
3377
3378    fn from_inner(
3379        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
3380        is_terminated: bool,
3381    ) -> Self {
3382        Self { inner, is_terminated }
3383    }
3384}
3385
3386impl futures::Stream for WlanSoftmacBaseRequestStream {
3387    type Item = Result<WlanSoftmacBaseRequest, fidl::Error>;
3388
3389    fn poll_next(
3390        mut self: std::pin::Pin<&mut Self>,
3391        cx: &mut std::task::Context<'_>,
3392    ) -> std::task::Poll<Option<Self::Item>> {
3393        let this = &mut *self;
3394        if this.inner.check_shutdown(cx) {
3395            this.is_terminated = true;
3396            return std::task::Poll::Ready(None);
3397        }
3398        if this.is_terminated {
3399            panic!("polled WlanSoftmacBaseRequestStream after completion");
3400        }
3401        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
3402            |bytes, handles| {
3403                match this.inner.channel().read_etc(cx, bytes, handles) {
3404                    std::task::Poll::Ready(Ok(())) => {}
3405                    std::task::Poll::Pending => return std::task::Poll::Pending,
3406                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
3407                        this.is_terminated = true;
3408                        return std::task::Poll::Ready(None);
3409                    }
3410                    std::task::Poll::Ready(Err(e)) => {
3411                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
3412                            e.into(),
3413                        ))))
3414                    }
3415                }
3416
3417                // A message has been received from the channel
3418                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
3419
3420                std::task::Poll::Ready(Some(match header.ordinal {
3421                    0x18231a638e508f9d => {
3422                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3423                        let mut req = fidl::new_empty!(
3424                            fidl::encoding::EmptyPayload,
3425                            fidl::encoding::DefaultFuchsiaResourceDialect
3426                        );
3427                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3428                        let control_handle =
3429                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3430                        Ok(WlanSoftmacBaseRequest::Query {
3431                            responder: WlanSoftmacBaseQueryResponder {
3432                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3433                                tx_id: header.tx_id,
3434                            },
3435                        })
3436                    }
3437                    0x16797affc0cb58ae => {
3438                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3439                        let mut req = fidl::new_empty!(
3440                            fidl::encoding::EmptyPayload,
3441                            fidl::encoding::DefaultFuchsiaResourceDialect
3442                        );
3443                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3444                        let control_handle =
3445                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3446                        Ok(WlanSoftmacBaseRequest::QueryDiscoverySupport {
3447                            responder: WlanSoftmacBaseQueryDiscoverySupportResponder {
3448                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3449                                tx_id: header.tx_id,
3450                            },
3451                        })
3452                    }
3453                    0x7302c3f8c131f075 => {
3454                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3455                        let mut req = fidl::new_empty!(
3456                            fidl::encoding::EmptyPayload,
3457                            fidl::encoding::DefaultFuchsiaResourceDialect
3458                        );
3459                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3460                        let control_handle =
3461                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3462                        Ok(WlanSoftmacBaseRequest::QueryMacSublayerSupport {
3463                            responder: WlanSoftmacBaseQueryMacSublayerSupportResponder {
3464                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3465                                tx_id: header.tx_id,
3466                            },
3467                        })
3468                    }
3469                    0x3691bb75abf6354 => {
3470                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3471                        let mut req = fidl::new_empty!(
3472                            fidl::encoding::EmptyPayload,
3473                            fidl::encoding::DefaultFuchsiaResourceDialect
3474                        );
3475                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3476                        let control_handle =
3477                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3478                        Ok(WlanSoftmacBaseRequest::QuerySecuritySupport {
3479                            responder: WlanSoftmacBaseQuerySecuritySupportResponder {
3480                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3481                                tx_id: header.tx_id,
3482                            },
3483                        })
3484                    }
3485                    0x347d78dc1d4d27bf => {
3486                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3487                        let mut req = fidl::new_empty!(
3488                            fidl::encoding::EmptyPayload,
3489                            fidl::encoding::DefaultFuchsiaResourceDialect
3490                        );
3491                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3492                        let control_handle =
3493                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3494                        Ok(WlanSoftmacBaseRequest::QuerySpectrumManagementSupport {
3495                            responder: WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
3496                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3497                                tx_id: header.tx_id,
3498                            },
3499                        })
3500                    }
3501                    0x12836b533cd63ece => {
3502                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3503                        let mut req = fidl::new_empty!(
3504                            WlanSoftmacBaseSetChannelRequest,
3505                            fidl::encoding::DefaultFuchsiaResourceDialect
3506                        );
3507                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseSetChannelRequest>(&header, _body_bytes, handles, &mut req)?;
3508                        let control_handle =
3509                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3510                        Ok(WlanSoftmacBaseRequest::SetChannel {
3511                            payload: req,
3512                            responder: WlanSoftmacBaseSetChannelResponder {
3513                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3514                                tx_id: header.tx_id,
3515                            },
3516                        })
3517                    }
3518                    0x1336fb5455b77a6e => {
3519                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3520                        let mut req = fidl::new_empty!(
3521                            WlanSoftmacBaseJoinBssRequest,
3522                            fidl::encoding::DefaultFuchsiaResourceDialect
3523                        );
3524                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseJoinBssRequest>(&header, _body_bytes, handles, &mut req)?;
3525                        let control_handle =
3526                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3527                        Ok(WlanSoftmacBaseRequest::JoinBss {
3528                            join_request: req.join_request,
3529
3530                            responder: WlanSoftmacBaseJoinBssResponder {
3531                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3532                                tx_id: header.tx_id,
3533                            },
3534                        })
3535                    }
3536                    0x6c35807632c64576 => {
3537                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3538                        let mut req = fidl::new_empty!(
3539                            WlanSoftmacBaseEnableBeaconingRequest,
3540                            fidl::encoding::DefaultFuchsiaResourceDialect
3541                        );
3542                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseEnableBeaconingRequest>(&header, _body_bytes, handles, &mut req)?;
3543                        let control_handle =
3544                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3545                        Ok(WlanSoftmacBaseRequest::EnableBeaconing {
3546                            payload: req,
3547                            responder: WlanSoftmacBaseEnableBeaconingResponder {
3548                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3549                                tx_id: header.tx_id,
3550                            },
3551                        })
3552                    }
3553                    0x3303b30f99dbb406 => {
3554                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3555                        let mut req = fidl::new_empty!(
3556                            fidl::encoding::EmptyPayload,
3557                            fidl::encoding::DefaultFuchsiaResourceDialect
3558                        );
3559                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
3560                        let control_handle =
3561                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3562                        Ok(WlanSoftmacBaseRequest::DisableBeaconing {
3563                            responder: WlanSoftmacBaseDisableBeaconingResponder {
3564                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3565                                tx_id: header.tx_id,
3566                            },
3567                        })
3568                    }
3569                    0x7decf9b4200b9131 => {
3570                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3571                        let mut req = fidl::new_empty!(
3572                            WlanKeyConfiguration,
3573                            fidl::encoding::DefaultFuchsiaResourceDialect
3574                        );
3575                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanKeyConfiguration>(&header, _body_bytes, handles, &mut req)?;
3576                        let control_handle =
3577                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3578                        Ok(WlanSoftmacBaseRequest::InstallKey {
3579                            payload: req,
3580                            responder: WlanSoftmacBaseInstallKeyResponder {
3581                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3582                                tx_id: header.tx_id,
3583                            },
3584                        })
3585                    }
3586                    0x436ffe3ba461d6cd => {
3587                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3588                        let mut req = fidl::new_empty!(
3589                            WlanSoftmacBaseNotifyAssociationCompleteRequest,
3590                            fidl::encoding::DefaultFuchsiaResourceDialect
3591                        );
3592                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
3593                        let control_handle =
3594                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3595                        Ok(WlanSoftmacBaseRequest::NotifyAssociationComplete {
3596                            assoc_cfg: req.assoc_cfg,
3597
3598                            responder: WlanSoftmacBaseNotifyAssociationCompleteResponder {
3599                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3600                                tx_id: header.tx_id,
3601                            },
3602                        })
3603                    }
3604                    0x581d76c39190a7dd => {
3605                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3606                        let mut req = fidl::new_empty!(
3607                            WlanSoftmacBaseClearAssociationRequest,
3608                            fidl::encoding::DefaultFuchsiaResourceDialect
3609                        );
3610                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseClearAssociationRequest>(&header, _body_bytes, handles, &mut req)?;
3611                        let control_handle =
3612                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3613                        Ok(WlanSoftmacBaseRequest::ClearAssociation {
3614                            payload: req,
3615                            responder: WlanSoftmacBaseClearAssociationResponder {
3616                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3617                                tx_id: header.tx_id,
3618                            },
3619                        })
3620                    }
3621                    0x5662f989cb4083bb => {
3622                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3623                        let mut req = fidl::new_empty!(
3624                            WlanSoftmacBaseStartPassiveScanRequest,
3625                            fidl::encoding::DefaultFuchsiaResourceDialect
3626                        );
3627                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseStartPassiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
3628                        let control_handle =
3629                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3630                        Ok(WlanSoftmacBaseRequest::StartPassiveScan {
3631                            payload: req,
3632                            responder: WlanSoftmacBaseStartPassiveScanResponder {
3633                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3634                                tx_id: header.tx_id,
3635                            },
3636                        })
3637                    }
3638                    0x4896eafa9937751e => {
3639                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3640                        let mut req = fidl::new_empty!(
3641                            WlanSoftmacStartActiveScanRequest,
3642                            fidl::encoding::DefaultFuchsiaResourceDialect
3643                        );
3644                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacStartActiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
3645                        let control_handle =
3646                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3647                        Ok(WlanSoftmacBaseRequest::StartActiveScan {
3648                            payload: req,
3649                            responder: WlanSoftmacBaseStartActiveScanResponder {
3650                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3651                                tx_id: header.tx_id,
3652                            },
3653                        })
3654                    }
3655                    0xf7d859369764556 => {
3656                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3657                        let mut req = fidl::new_empty!(
3658                            WlanSoftmacBaseCancelScanRequest,
3659                            fidl::encoding::DefaultFuchsiaResourceDialect
3660                        );
3661                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseCancelScanRequest>(&header, _body_bytes, handles, &mut req)?;
3662                        let control_handle =
3663                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3664                        Ok(WlanSoftmacBaseRequest::CancelScan {
3665                            payload: req,
3666                            responder: WlanSoftmacBaseCancelScanResponder {
3667                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3668                                tx_id: header.tx_id,
3669                            },
3670                        })
3671                    }
3672                    0x68522c7122d5f78c => {
3673                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
3674                        let mut req = fidl::new_empty!(
3675                            WlanSoftmacBaseUpdateWmmParametersRequest,
3676                            fidl::encoding::DefaultFuchsiaResourceDialect
3677                        );
3678                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseUpdateWmmParametersRequest>(&header, _body_bytes, handles, &mut req)?;
3679                        let control_handle =
3680                            WlanSoftmacBaseControlHandle { inner: this.inner.clone() };
3681                        Ok(WlanSoftmacBaseRequest::UpdateWmmParameters {
3682                            payload: req,
3683                            responder: WlanSoftmacBaseUpdateWmmParametersResponder {
3684                                control_handle: std::mem::ManuallyDrop::new(control_handle),
3685                                tx_id: header.tx_id,
3686                            },
3687                        })
3688                    }
3689                    _ => Err(fidl::Error::UnknownOrdinal {
3690                        ordinal: header.ordinal,
3691                        protocol_name:
3692                            <WlanSoftmacBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
3693                    }),
3694                }))
3695            },
3696        )
3697    }
3698}
3699
3700/// `WlanSoftmacBase` is a template protocol intended to be composed into
3701/// `WlanSoftmacBridge` and `WlanSoftmac`. `WlanSoftmacBase` contains all method
3702/// that both `WlanSoftmacBridge` and `WlanSoftmac` have in common.
3703/// `WlanSoftmacBase` should not be implemented directly.
3704///
3705/// NOTE: All methods use a `selector` attribute to maintain their ordinal
3706///       following migration from `WlanSoftmac` into this protocol. This is necessary
3707///       to preserve API compatibility.
3708#[derive(Debug)]
3709pub enum WlanSoftmacBaseRequest {
3710    /// Gets general information about the device and its supported features.
3711    /// This method is safe to call even when the SoftMAC has not yet started.
3712    ///
3713    /// Note: The implementation of this method must not depend on a response
3714    /// from an ethernet driver, otherwise there is a risk of deadlock.
3715    /// The wlansoftmac driver calls this method synchronously while
3716    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
3717    Query { responder: WlanSoftmacBaseQueryResponder },
3718    /// Gets information about the station discovery (e.g., scanning and
3719    /// probing) features supported by the device. This method is safe to call
3720    /// even when the SoftMAC has not yet started.
3721    QueryDiscoverySupport { responder: WlanSoftmacBaseQueryDiscoverySupportResponder },
3722    /// Gets information about the MAC features supported by the device. This
3723    /// method is safe to call even when the SoftMAC has not yet started.
3724    ///
3725    /// Note: The implementation of this method must not depend on a response
3726    /// from an ethernet driver, otherwise there is a risk of deadlock.
3727    /// The wlansoftmac driver calls this method synchronously while
3728    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
3729    QueryMacSublayerSupport { responder: WlanSoftmacBaseQueryMacSublayerSupportResponder },
3730    /// Gets information about the security features supported by the device.
3731    /// This method is safe to call even when the SoftMAC has not yet started.
3732    QuerySecuritySupport { responder: WlanSoftmacBaseQuerySecuritySupportResponder },
3733    /// Gets information about the spectrum usage (e.g., DFS) features supported
3734    /// by the device. This method is safe to call even when the SoftMAC has not
3735    /// yet started.
3736    QuerySpectrumManagementSupport {
3737        responder: WlanSoftmacBaseQuerySpectrumManagementSupportResponder,
3738    },
3739    /// Set the primary radio channel, e.g. in response to a channel switch event.
3740    /// If successful, this will trigger the channel switch immediately. This may
3741    /// impact the transmission of any frames that are in-flight, and might also
3742    /// interfere with an ongoing scan request.
3743    ///
3744    /// Common errors include: \
3745    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
3746    SetChannel {
3747        payload: WlanSoftmacBaseSetChannelRequest,
3748        responder: WlanSoftmacBaseSetChannelResponder,
3749    },
3750    /// Join a specific BSS in which we will participate.
3751    /// This applies regardless of if we are hosting the BSS or joining it
3752    /// (indicated by the `remote` flag in `JoinBssRequest`).
3753    /// If successful, the device will switch to the correct channel and perform
3754    /// any internal filtering/timing operations required to join the BSS.
3755    /// For client STAs, this is the first step before authenticating.
3756    ///
3757    /// Common errors include: \
3758    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
3759    JoinBss {
3760        join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
3761        responder: WlanSoftmacBaseJoinBssResponder,
3762    },
3763    /// Enables hardware Beaconing.
3764    ///
3765    /// This method cannot be called while beaconing is enabled and so
3766    /// `DisableBeaconing` must be called prior to this method if beaconing is
3767    /// enabled.
3768    ///
3769    /// All request fields are required.
3770    ///
3771    /// Common errors include:
3772    ///
3773    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
3774    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
3775    ///                          beacon.
3776    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
3777    EnableBeaconing {
3778        payload: WlanSoftmacBaseEnableBeaconingRequest,
3779        responder: WlanSoftmacBaseEnableBeaconingResponder,
3780    },
3781    /// Disables hardware beaconing.
3782    DisableBeaconing { responder: WlanSoftmacBaseDisableBeaconingResponder },
3783    /// Install a key for encryption when transmitting or receiving protected
3784    /// frames.
3785    ///
3786    /// Common errors include:
3787    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
3788    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
3789    InstallKey { payload: WlanKeyConfiguration, responder: WlanSoftmacBaseInstallKeyResponder },
3790    /// Notifies the device of a successful association and configures
3791    /// additional parameters necessary to participate in that association.
3792    ///
3793    /// # Errors
3794    ///
3795    /// Common errors include:
3796    ///
3797    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
3798    ///                       via `WlanSoftmac.JoinBss`.
3799    NotifyAssociationComplete {
3800        assoc_cfg: WlanAssociationConfig,
3801        responder: WlanSoftmacBaseNotifyAssociationCompleteResponder,
3802    },
3803    /// Notifies MAC and PHY that the peer has been de-associated.
3804    ClearAssociation {
3805        payload: WlanSoftmacBaseClearAssociationRequest,
3806        responder: WlanSoftmacBaseClearAssociationResponder,
3807    },
3808    /// Starts a passive scan. The server will deliver scan results
3809    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
3810    /// the server will call WlanSoftmacIfc.ScanComplete() with the
3811    /// same `scan_id` returned by StartPassiveScan().
3812    ///
3813    /// The server indicates support for `StartPassiveScan()` using
3814    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
3815    ///
3816    /// Common errors include:
3817    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
3818    ///       requested scan, e.g. because an incompatible channel was requested.
3819    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
3820    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
3821    StartPassiveScan {
3822        payload: WlanSoftmacBaseStartPassiveScanRequest,
3823        responder: WlanSoftmacBaseStartPassiveScanResponder,
3824    },
3825    /// Starts an active scan. The server will deliver scan results
3826    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
3827    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
3828    /// with the same `scan_id` returned by StartActiveScan().
3829    ///
3830    /// A device driver indicates support for `StartActiveScan()` using
3831    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
3832    ///
3833    /// Common errors include:
3834    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
3835    ///       requested scan, e.g. because an incompatible channel was requested.
3836    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
3837    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
3838    StartActiveScan {
3839        payload: WlanSoftmacStartActiveScanRequest,
3840        responder: WlanSoftmacBaseStartActiveScanResponder,
3841    },
3842    /// Cancels the ongoing scan corresponding to `scan_id`,
3843    /// where `scan_id` is an identifier returned by
3844    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
3845    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
3846    /// `scan_id`.
3847    ///
3848    /// A device driver indicates support for `CancelScan()` using
3849    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
3850    ///
3851    /// Common errors include:
3852    ///
3853    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
3854    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
3855    CancelScan {
3856        payload: WlanSoftmacBaseCancelScanRequest,
3857        responder: WlanSoftmacBaseCancelScanResponder,
3858    },
3859    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
3860    /// particular access category (AC).
3861    UpdateWmmParameters {
3862        payload: WlanSoftmacBaseUpdateWmmParametersRequest,
3863        responder: WlanSoftmacBaseUpdateWmmParametersResponder,
3864    },
3865}
3866
3867impl WlanSoftmacBaseRequest {
3868    #[allow(irrefutable_let_patterns)]
3869    pub fn into_query(self) -> Option<(WlanSoftmacBaseQueryResponder)> {
3870        if let WlanSoftmacBaseRequest::Query { responder } = self {
3871            Some((responder))
3872        } else {
3873            None
3874        }
3875    }
3876
3877    #[allow(irrefutable_let_patterns)]
3878    pub fn into_query_discovery_support(
3879        self,
3880    ) -> Option<(WlanSoftmacBaseQueryDiscoverySupportResponder)> {
3881        if let WlanSoftmacBaseRequest::QueryDiscoverySupport { responder } = self {
3882            Some((responder))
3883        } else {
3884            None
3885        }
3886    }
3887
3888    #[allow(irrefutable_let_patterns)]
3889    pub fn into_query_mac_sublayer_support(
3890        self,
3891    ) -> Option<(WlanSoftmacBaseQueryMacSublayerSupportResponder)> {
3892        if let WlanSoftmacBaseRequest::QueryMacSublayerSupport { responder } = self {
3893            Some((responder))
3894        } else {
3895            None
3896        }
3897    }
3898
3899    #[allow(irrefutable_let_patterns)]
3900    pub fn into_query_security_support(
3901        self,
3902    ) -> Option<(WlanSoftmacBaseQuerySecuritySupportResponder)> {
3903        if let WlanSoftmacBaseRequest::QuerySecuritySupport { responder } = self {
3904            Some((responder))
3905        } else {
3906            None
3907        }
3908    }
3909
3910    #[allow(irrefutable_let_patterns)]
3911    pub fn into_query_spectrum_management_support(
3912        self,
3913    ) -> Option<(WlanSoftmacBaseQuerySpectrumManagementSupportResponder)> {
3914        if let WlanSoftmacBaseRequest::QuerySpectrumManagementSupport { responder } = self {
3915            Some((responder))
3916        } else {
3917            None
3918        }
3919    }
3920
3921    #[allow(irrefutable_let_patterns)]
3922    pub fn into_set_channel(
3923        self,
3924    ) -> Option<(WlanSoftmacBaseSetChannelRequest, WlanSoftmacBaseSetChannelResponder)> {
3925        if let WlanSoftmacBaseRequest::SetChannel { payload, responder } = self {
3926            Some((payload, responder))
3927        } else {
3928            None
3929        }
3930    }
3931
3932    #[allow(irrefutable_let_patterns)]
3933    pub fn into_join_bss(
3934        self,
3935    ) -> Option<(fidl_fuchsia_wlan_common::JoinBssRequest, WlanSoftmacBaseJoinBssResponder)> {
3936        if let WlanSoftmacBaseRequest::JoinBss { join_request, responder } = self {
3937            Some((join_request, responder))
3938        } else {
3939            None
3940        }
3941    }
3942
3943    #[allow(irrefutable_let_patterns)]
3944    pub fn into_enable_beaconing(
3945        self,
3946    ) -> Option<(WlanSoftmacBaseEnableBeaconingRequest, WlanSoftmacBaseEnableBeaconingResponder)>
3947    {
3948        if let WlanSoftmacBaseRequest::EnableBeaconing { payload, responder } = self {
3949            Some((payload, responder))
3950        } else {
3951            None
3952        }
3953    }
3954
3955    #[allow(irrefutable_let_patterns)]
3956    pub fn into_disable_beaconing(self) -> Option<(WlanSoftmacBaseDisableBeaconingResponder)> {
3957        if let WlanSoftmacBaseRequest::DisableBeaconing { responder } = self {
3958            Some((responder))
3959        } else {
3960            None
3961        }
3962    }
3963
3964    #[allow(irrefutable_let_patterns)]
3965    pub fn into_install_key(
3966        self,
3967    ) -> Option<(WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResponder)> {
3968        if let WlanSoftmacBaseRequest::InstallKey { payload, responder } = self {
3969            Some((payload, responder))
3970        } else {
3971            None
3972        }
3973    }
3974
3975    #[allow(irrefutable_let_patterns)]
3976    pub fn into_notify_association_complete(
3977        self,
3978    ) -> Option<(WlanAssociationConfig, WlanSoftmacBaseNotifyAssociationCompleteResponder)> {
3979        if let WlanSoftmacBaseRequest::NotifyAssociationComplete { assoc_cfg, responder } = self {
3980            Some((assoc_cfg, responder))
3981        } else {
3982            None
3983        }
3984    }
3985
3986    #[allow(irrefutable_let_patterns)]
3987    pub fn into_clear_association(
3988        self,
3989    ) -> Option<(WlanSoftmacBaseClearAssociationRequest, WlanSoftmacBaseClearAssociationResponder)>
3990    {
3991        if let WlanSoftmacBaseRequest::ClearAssociation { payload, responder } = self {
3992            Some((payload, responder))
3993        } else {
3994            None
3995        }
3996    }
3997
3998    #[allow(irrefutable_let_patterns)]
3999    pub fn into_start_passive_scan(
4000        self,
4001    ) -> Option<(WlanSoftmacBaseStartPassiveScanRequest, WlanSoftmacBaseStartPassiveScanResponder)>
4002    {
4003        if let WlanSoftmacBaseRequest::StartPassiveScan { payload, responder } = self {
4004            Some((payload, responder))
4005        } else {
4006            None
4007        }
4008    }
4009
4010    #[allow(irrefutable_let_patterns)]
4011    pub fn into_start_active_scan(
4012        self,
4013    ) -> Option<(WlanSoftmacStartActiveScanRequest, WlanSoftmacBaseStartActiveScanResponder)> {
4014        if let WlanSoftmacBaseRequest::StartActiveScan { payload, responder } = self {
4015            Some((payload, responder))
4016        } else {
4017            None
4018        }
4019    }
4020
4021    #[allow(irrefutable_let_patterns)]
4022    pub fn into_cancel_scan(
4023        self,
4024    ) -> Option<(WlanSoftmacBaseCancelScanRequest, WlanSoftmacBaseCancelScanResponder)> {
4025        if let WlanSoftmacBaseRequest::CancelScan { payload, responder } = self {
4026            Some((payload, responder))
4027        } else {
4028            None
4029        }
4030    }
4031
4032    #[allow(irrefutable_let_patterns)]
4033    pub fn into_update_wmm_parameters(
4034        self,
4035    ) -> Option<(
4036        WlanSoftmacBaseUpdateWmmParametersRequest,
4037        WlanSoftmacBaseUpdateWmmParametersResponder,
4038    )> {
4039        if let WlanSoftmacBaseRequest::UpdateWmmParameters { payload, responder } = self {
4040            Some((payload, responder))
4041        } else {
4042            None
4043        }
4044    }
4045
4046    /// Name of the method defined in FIDL
4047    pub fn method_name(&self) -> &'static str {
4048        match *self {
4049            WlanSoftmacBaseRequest::Query { .. } => "query",
4050            WlanSoftmacBaseRequest::QueryDiscoverySupport { .. } => "query_discovery_support",
4051            WlanSoftmacBaseRequest::QueryMacSublayerSupport { .. } => "query_mac_sublayer_support",
4052            WlanSoftmacBaseRequest::QuerySecuritySupport { .. } => "query_security_support",
4053            WlanSoftmacBaseRequest::QuerySpectrumManagementSupport { .. } => {
4054                "query_spectrum_management_support"
4055            }
4056            WlanSoftmacBaseRequest::SetChannel { .. } => "set_channel",
4057            WlanSoftmacBaseRequest::JoinBss { .. } => "join_bss",
4058            WlanSoftmacBaseRequest::EnableBeaconing { .. } => "enable_beaconing",
4059            WlanSoftmacBaseRequest::DisableBeaconing { .. } => "disable_beaconing",
4060            WlanSoftmacBaseRequest::InstallKey { .. } => "install_key",
4061            WlanSoftmacBaseRequest::NotifyAssociationComplete { .. } => {
4062                "notify_association_complete"
4063            }
4064            WlanSoftmacBaseRequest::ClearAssociation { .. } => "clear_association",
4065            WlanSoftmacBaseRequest::StartPassiveScan { .. } => "start_passive_scan",
4066            WlanSoftmacBaseRequest::StartActiveScan { .. } => "start_active_scan",
4067            WlanSoftmacBaseRequest::CancelScan { .. } => "cancel_scan",
4068            WlanSoftmacBaseRequest::UpdateWmmParameters { .. } => "update_wmm_parameters",
4069        }
4070    }
4071}
4072
4073#[derive(Debug, Clone)]
4074pub struct WlanSoftmacBaseControlHandle {
4075    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
4076}
4077
4078impl fidl::endpoints::ControlHandle for WlanSoftmacBaseControlHandle {
4079    fn shutdown(&self) {
4080        self.inner.shutdown()
4081    }
4082    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
4083        self.inner.shutdown_with_epitaph(status)
4084    }
4085
4086    fn is_closed(&self) -> bool {
4087        self.inner.channel().is_closed()
4088    }
4089    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
4090        self.inner.channel().on_closed()
4091    }
4092
4093    #[cfg(target_os = "fuchsia")]
4094    fn signal_peer(
4095        &self,
4096        clear_mask: zx::Signals,
4097        set_mask: zx::Signals,
4098    ) -> Result<(), zx_status::Status> {
4099        use fidl::Peered;
4100        self.inner.channel().signal_peer(clear_mask, set_mask)
4101    }
4102}
4103
4104impl WlanSoftmacBaseControlHandle {}
4105
4106#[must_use = "FIDL methods require a response to be sent"]
4107#[derive(Debug)]
4108pub struct WlanSoftmacBaseQueryResponder {
4109    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4110    tx_id: u32,
4111}
4112
4113/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4114/// if the responder is dropped without sending a response, so that the client
4115/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4116impl std::ops::Drop for WlanSoftmacBaseQueryResponder {
4117    fn drop(&mut self) {
4118        self.control_handle.shutdown();
4119        // Safety: drops once, never accessed again
4120        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4121    }
4122}
4123
4124impl fidl::endpoints::Responder for WlanSoftmacBaseQueryResponder {
4125    type ControlHandle = WlanSoftmacBaseControlHandle;
4126
4127    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4128        &self.control_handle
4129    }
4130
4131    fn drop_without_shutdown(mut self) {
4132        // Safety: drops once, never accessed again due to mem::forget
4133        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4134        // Prevent Drop from running (which would shut down the channel)
4135        std::mem::forget(self);
4136    }
4137}
4138
4139impl WlanSoftmacBaseQueryResponder {
4140    /// Sends a response to the FIDL transaction.
4141    ///
4142    /// Sets the channel to shutdown if an error occurs.
4143    pub fn send(
4144        self,
4145        mut result: Result<&WlanSoftmacQueryResponse, i32>,
4146    ) -> Result<(), fidl::Error> {
4147        let _result = self.send_raw(result);
4148        if _result.is_err() {
4149            self.control_handle.shutdown();
4150        }
4151        self.drop_without_shutdown();
4152        _result
4153    }
4154
4155    /// Similar to "send" but does not shutdown the channel if an error occurs.
4156    pub fn send_no_shutdown_on_err(
4157        self,
4158        mut result: Result<&WlanSoftmacQueryResponse, i32>,
4159    ) -> Result<(), fidl::Error> {
4160        let _result = self.send_raw(result);
4161        self.drop_without_shutdown();
4162        _result
4163    }
4164
4165    fn send_raw(
4166        &self,
4167        mut result: Result<&WlanSoftmacQueryResponse, i32>,
4168    ) -> Result<(), fidl::Error> {
4169        self.control_handle.inner.send::<fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>>(
4170            result,
4171            self.tx_id,
4172            0x18231a638e508f9d,
4173            fidl::encoding::DynamicFlags::empty(),
4174        )
4175    }
4176}
4177
4178#[must_use = "FIDL methods require a response to be sent"]
4179#[derive(Debug)]
4180pub struct WlanSoftmacBaseQueryDiscoverySupportResponder {
4181    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4182    tx_id: u32,
4183}
4184
4185/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4186/// if the responder is dropped without sending a response, so that the client
4187/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4188impl std::ops::Drop for WlanSoftmacBaseQueryDiscoverySupportResponder {
4189    fn drop(&mut self) {
4190        self.control_handle.shutdown();
4191        // Safety: drops once, never accessed again
4192        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4193    }
4194}
4195
4196impl fidl::endpoints::Responder for WlanSoftmacBaseQueryDiscoverySupportResponder {
4197    type ControlHandle = WlanSoftmacBaseControlHandle;
4198
4199    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4200        &self.control_handle
4201    }
4202
4203    fn drop_without_shutdown(mut self) {
4204        // Safety: drops once, never accessed again due to mem::forget
4205        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4206        // Prevent Drop from running (which would shut down the channel)
4207        std::mem::forget(self);
4208    }
4209}
4210
4211impl WlanSoftmacBaseQueryDiscoverySupportResponder {
4212    /// Sends a response to the FIDL transaction.
4213    ///
4214    /// Sets the channel to shutdown if an error occurs.
4215    pub fn send(
4216        self,
4217        mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
4218    ) -> Result<(), fidl::Error> {
4219        let _result = self.send_raw(result);
4220        if _result.is_err() {
4221            self.control_handle.shutdown();
4222        }
4223        self.drop_without_shutdown();
4224        _result
4225    }
4226
4227    /// Similar to "send" but does not shutdown the channel if an error occurs.
4228    pub fn send_no_shutdown_on_err(
4229        self,
4230        mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
4231    ) -> Result<(), fidl::Error> {
4232        let _result = self.send_raw(result);
4233        self.drop_without_shutdown();
4234        _result
4235    }
4236
4237    fn send_raw(
4238        &self,
4239        mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
4240    ) -> Result<(), fidl::Error> {
4241        self.control_handle.inner.send::<fidl::encoding::ResultType<
4242            WlanSoftmacBaseQueryDiscoverySupportResponse,
4243            i32,
4244        >>(
4245            result.map(|resp| (resp,)),
4246            self.tx_id,
4247            0x16797affc0cb58ae,
4248            fidl::encoding::DynamicFlags::empty(),
4249        )
4250    }
4251}
4252
4253#[must_use = "FIDL methods require a response to be sent"]
4254#[derive(Debug)]
4255pub struct WlanSoftmacBaseQueryMacSublayerSupportResponder {
4256    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4257    tx_id: u32,
4258}
4259
4260/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4261/// if the responder is dropped without sending a response, so that the client
4262/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4263impl std::ops::Drop for WlanSoftmacBaseQueryMacSublayerSupportResponder {
4264    fn drop(&mut self) {
4265        self.control_handle.shutdown();
4266        // Safety: drops once, never accessed again
4267        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4268    }
4269}
4270
4271impl fidl::endpoints::Responder for WlanSoftmacBaseQueryMacSublayerSupportResponder {
4272    type ControlHandle = WlanSoftmacBaseControlHandle;
4273
4274    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4275        &self.control_handle
4276    }
4277
4278    fn drop_without_shutdown(mut self) {
4279        // Safety: drops once, never accessed again due to mem::forget
4280        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4281        // Prevent Drop from running (which would shut down the channel)
4282        std::mem::forget(self);
4283    }
4284}
4285
4286impl WlanSoftmacBaseQueryMacSublayerSupportResponder {
4287    /// Sends a response to the FIDL transaction.
4288    ///
4289    /// Sets the channel to shutdown if an error occurs.
4290    pub fn send(
4291        self,
4292        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
4293    ) -> Result<(), fidl::Error> {
4294        let _result = self.send_raw(result);
4295        if _result.is_err() {
4296            self.control_handle.shutdown();
4297        }
4298        self.drop_without_shutdown();
4299        _result
4300    }
4301
4302    /// Similar to "send" but does not shutdown the channel if an error occurs.
4303    pub fn send_no_shutdown_on_err(
4304        self,
4305        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
4306    ) -> Result<(), fidl::Error> {
4307        let _result = self.send_raw(result);
4308        self.drop_without_shutdown();
4309        _result
4310    }
4311
4312    fn send_raw(
4313        &self,
4314        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
4315    ) -> Result<(), fidl::Error> {
4316        self.control_handle.inner.send::<fidl::encoding::ResultType<
4317            WlanSoftmacBaseQueryMacSublayerSupportResponse,
4318            i32,
4319        >>(
4320            result.map(|resp| (resp,)),
4321            self.tx_id,
4322            0x7302c3f8c131f075,
4323            fidl::encoding::DynamicFlags::empty(),
4324        )
4325    }
4326}
4327
4328#[must_use = "FIDL methods require a response to be sent"]
4329#[derive(Debug)]
4330pub struct WlanSoftmacBaseQuerySecuritySupportResponder {
4331    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4332    tx_id: u32,
4333}
4334
4335/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4336/// if the responder is dropped without sending a response, so that the client
4337/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4338impl std::ops::Drop for WlanSoftmacBaseQuerySecuritySupportResponder {
4339    fn drop(&mut self) {
4340        self.control_handle.shutdown();
4341        // Safety: drops once, never accessed again
4342        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4343    }
4344}
4345
4346impl fidl::endpoints::Responder for WlanSoftmacBaseQuerySecuritySupportResponder {
4347    type ControlHandle = WlanSoftmacBaseControlHandle;
4348
4349    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4350        &self.control_handle
4351    }
4352
4353    fn drop_without_shutdown(mut self) {
4354        // Safety: drops once, never accessed again due to mem::forget
4355        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4356        // Prevent Drop from running (which would shut down the channel)
4357        std::mem::forget(self);
4358    }
4359}
4360
4361impl WlanSoftmacBaseQuerySecuritySupportResponder {
4362    /// Sends a response to the FIDL transaction.
4363    ///
4364    /// Sets the channel to shutdown if an error occurs.
4365    pub fn send(
4366        self,
4367        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
4368    ) -> Result<(), fidl::Error> {
4369        let _result = self.send_raw(result);
4370        if _result.is_err() {
4371            self.control_handle.shutdown();
4372        }
4373        self.drop_without_shutdown();
4374        _result
4375    }
4376
4377    /// Similar to "send" but does not shutdown the channel if an error occurs.
4378    pub fn send_no_shutdown_on_err(
4379        self,
4380        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
4381    ) -> Result<(), fidl::Error> {
4382        let _result = self.send_raw(result);
4383        self.drop_without_shutdown();
4384        _result
4385    }
4386
4387    fn send_raw(
4388        &self,
4389        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
4390    ) -> Result<(), fidl::Error> {
4391        self.control_handle.inner.send::<fidl::encoding::ResultType<
4392            WlanSoftmacBaseQuerySecuritySupportResponse,
4393            i32,
4394        >>(
4395            result.map(|resp| (resp,)),
4396            self.tx_id,
4397            0x3691bb75abf6354,
4398            fidl::encoding::DynamicFlags::empty(),
4399        )
4400    }
4401}
4402
4403#[must_use = "FIDL methods require a response to be sent"]
4404#[derive(Debug)]
4405pub struct WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
4406    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4407    tx_id: u32,
4408}
4409
4410/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4411/// if the responder is dropped without sending a response, so that the client
4412/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4413impl std::ops::Drop for WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
4414    fn drop(&mut self) {
4415        self.control_handle.shutdown();
4416        // Safety: drops once, never accessed again
4417        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4418    }
4419}
4420
4421impl fidl::endpoints::Responder for WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
4422    type ControlHandle = WlanSoftmacBaseControlHandle;
4423
4424    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4425        &self.control_handle
4426    }
4427
4428    fn drop_without_shutdown(mut self) {
4429        // Safety: drops once, never accessed again due to mem::forget
4430        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4431        // Prevent Drop from running (which would shut down the channel)
4432        std::mem::forget(self);
4433    }
4434}
4435
4436impl WlanSoftmacBaseQuerySpectrumManagementSupportResponder {
4437    /// Sends a response to the FIDL transaction.
4438    ///
4439    /// Sets the channel to shutdown if an error occurs.
4440    pub fn send(
4441        self,
4442        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
4443    ) -> Result<(), fidl::Error> {
4444        let _result = self.send_raw(result);
4445        if _result.is_err() {
4446            self.control_handle.shutdown();
4447        }
4448        self.drop_without_shutdown();
4449        _result
4450    }
4451
4452    /// Similar to "send" but does not shutdown the channel if an error occurs.
4453    pub fn send_no_shutdown_on_err(
4454        self,
4455        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
4456    ) -> Result<(), fidl::Error> {
4457        let _result = self.send_raw(result);
4458        self.drop_without_shutdown();
4459        _result
4460    }
4461
4462    fn send_raw(
4463        &self,
4464        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
4465    ) -> Result<(), fidl::Error> {
4466        self.control_handle.inner.send::<fidl::encoding::ResultType<
4467            WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
4468            i32,
4469        >>(
4470            result.map(|resp| (resp,)),
4471            self.tx_id,
4472            0x347d78dc1d4d27bf,
4473            fidl::encoding::DynamicFlags::empty(),
4474        )
4475    }
4476}
4477
4478#[must_use = "FIDL methods require a response to be sent"]
4479#[derive(Debug)]
4480pub struct WlanSoftmacBaseSetChannelResponder {
4481    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4482    tx_id: u32,
4483}
4484
4485/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4486/// if the responder is dropped without sending a response, so that the client
4487/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4488impl std::ops::Drop for WlanSoftmacBaseSetChannelResponder {
4489    fn drop(&mut self) {
4490        self.control_handle.shutdown();
4491        // Safety: drops once, never accessed again
4492        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4493    }
4494}
4495
4496impl fidl::endpoints::Responder for WlanSoftmacBaseSetChannelResponder {
4497    type ControlHandle = WlanSoftmacBaseControlHandle;
4498
4499    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4500        &self.control_handle
4501    }
4502
4503    fn drop_without_shutdown(mut self) {
4504        // Safety: drops once, never accessed again due to mem::forget
4505        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4506        // Prevent Drop from running (which would shut down the channel)
4507        std::mem::forget(self);
4508    }
4509}
4510
4511impl WlanSoftmacBaseSetChannelResponder {
4512    /// Sends a response to the FIDL transaction.
4513    ///
4514    /// Sets the channel to shutdown if an error occurs.
4515    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4516        let _result = self.send_raw(result);
4517        if _result.is_err() {
4518            self.control_handle.shutdown();
4519        }
4520        self.drop_without_shutdown();
4521        _result
4522    }
4523
4524    /// Similar to "send" but does not shutdown the channel if an error occurs.
4525    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4526        let _result = self.send_raw(result);
4527        self.drop_without_shutdown();
4528        _result
4529    }
4530
4531    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4532        self.control_handle
4533            .inner
4534            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4535                result,
4536                self.tx_id,
4537                0x12836b533cd63ece,
4538                fidl::encoding::DynamicFlags::empty(),
4539            )
4540    }
4541}
4542
4543#[must_use = "FIDL methods require a response to be sent"]
4544#[derive(Debug)]
4545pub struct WlanSoftmacBaseJoinBssResponder {
4546    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4547    tx_id: u32,
4548}
4549
4550/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4551/// if the responder is dropped without sending a response, so that the client
4552/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4553impl std::ops::Drop for WlanSoftmacBaseJoinBssResponder {
4554    fn drop(&mut self) {
4555        self.control_handle.shutdown();
4556        // Safety: drops once, never accessed again
4557        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4558    }
4559}
4560
4561impl fidl::endpoints::Responder for WlanSoftmacBaseJoinBssResponder {
4562    type ControlHandle = WlanSoftmacBaseControlHandle;
4563
4564    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4565        &self.control_handle
4566    }
4567
4568    fn drop_without_shutdown(mut self) {
4569        // Safety: drops once, never accessed again due to mem::forget
4570        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4571        // Prevent Drop from running (which would shut down the channel)
4572        std::mem::forget(self);
4573    }
4574}
4575
4576impl WlanSoftmacBaseJoinBssResponder {
4577    /// Sends a response to the FIDL transaction.
4578    ///
4579    /// Sets the channel to shutdown if an error occurs.
4580    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4581        let _result = self.send_raw(result);
4582        if _result.is_err() {
4583            self.control_handle.shutdown();
4584        }
4585        self.drop_without_shutdown();
4586        _result
4587    }
4588
4589    /// Similar to "send" but does not shutdown the channel if an error occurs.
4590    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4591        let _result = self.send_raw(result);
4592        self.drop_without_shutdown();
4593        _result
4594    }
4595
4596    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4597        self.control_handle
4598            .inner
4599            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4600                result,
4601                self.tx_id,
4602                0x1336fb5455b77a6e,
4603                fidl::encoding::DynamicFlags::empty(),
4604            )
4605    }
4606}
4607
4608#[must_use = "FIDL methods require a response to be sent"]
4609#[derive(Debug)]
4610pub struct WlanSoftmacBaseEnableBeaconingResponder {
4611    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4612    tx_id: u32,
4613}
4614
4615/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4616/// if the responder is dropped without sending a response, so that the client
4617/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4618impl std::ops::Drop for WlanSoftmacBaseEnableBeaconingResponder {
4619    fn drop(&mut self) {
4620        self.control_handle.shutdown();
4621        // Safety: drops once, never accessed again
4622        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4623    }
4624}
4625
4626impl fidl::endpoints::Responder for WlanSoftmacBaseEnableBeaconingResponder {
4627    type ControlHandle = WlanSoftmacBaseControlHandle;
4628
4629    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4630        &self.control_handle
4631    }
4632
4633    fn drop_without_shutdown(mut self) {
4634        // Safety: drops once, never accessed again due to mem::forget
4635        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4636        // Prevent Drop from running (which would shut down the channel)
4637        std::mem::forget(self);
4638    }
4639}
4640
4641impl WlanSoftmacBaseEnableBeaconingResponder {
4642    /// Sends a response to the FIDL transaction.
4643    ///
4644    /// Sets the channel to shutdown if an error occurs.
4645    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4646        let _result = self.send_raw(result);
4647        if _result.is_err() {
4648            self.control_handle.shutdown();
4649        }
4650        self.drop_without_shutdown();
4651        _result
4652    }
4653
4654    /// Similar to "send" but does not shutdown the channel if an error occurs.
4655    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4656        let _result = self.send_raw(result);
4657        self.drop_without_shutdown();
4658        _result
4659    }
4660
4661    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4662        self.control_handle
4663            .inner
4664            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4665                result,
4666                self.tx_id,
4667                0x6c35807632c64576,
4668                fidl::encoding::DynamicFlags::empty(),
4669            )
4670    }
4671}
4672
4673#[must_use = "FIDL methods require a response to be sent"]
4674#[derive(Debug)]
4675pub struct WlanSoftmacBaseDisableBeaconingResponder {
4676    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4677    tx_id: u32,
4678}
4679
4680/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4681/// if the responder is dropped without sending a response, so that the client
4682/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4683impl std::ops::Drop for WlanSoftmacBaseDisableBeaconingResponder {
4684    fn drop(&mut self) {
4685        self.control_handle.shutdown();
4686        // Safety: drops once, never accessed again
4687        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4688    }
4689}
4690
4691impl fidl::endpoints::Responder for WlanSoftmacBaseDisableBeaconingResponder {
4692    type ControlHandle = WlanSoftmacBaseControlHandle;
4693
4694    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4695        &self.control_handle
4696    }
4697
4698    fn drop_without_shutdown(mut self) {
4699        // Safety: drops once, never accessed again due to mem::forget
4700        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4701        // Prevent Drop from running (which would shut down the channel)
4702        std::mem::forget(self);
4703    }
4704}
4705
4706impl WlanSoftmacBaseDisableBeaconingResponder {
4707    /// Sends a response to the FIDL transaction.
4708    ///
4709    /// Sets the channel to shutdown if an error occurs.
4710    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4711        let _result = self.send_raw(result);
4712        if _result.is_err() {
4713            self.control_handle.shutdown();
4714        }
4715        self.drop_without_shutdown();
4716        _result
4717    }
4718
4719    /// Similar to "send" but does not shutdown the channel if an error occurs.
4720    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4721        let _result = self.send_raw(result);
4722        self.drop_without_shutdown();
4723        _result
4724    }
4725
4726    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4727        self.control_handle
4728            .inner
4729            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4730                result,
4731                self.tx_id,
4732                0x3303b30f99dbb406,
4733                fidl::encoding::DynamicFlags::empty(),
4734            )
4735    }
4736}
4737
4738#[must_use = "FIDL methods require a response to be sent"]
4739#[derive(Debug)]
4740pub struct WlanSoftmacBaseInstallKeyResponder {
4741    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4742    tx_id: u32,
4743}
4744
4745/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4746/// if the responder is dropped without sending a response, so that the client
4747/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4748impl std::ops::Drop for WlanSoftmacBaseInstallKeyResponder {
4749    fn drop(&mut self) {
4750        self.control_handle.shutdown();
4751        // Safety: drops once, never accessed again
4752        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4753    }
4754}
4755
4756impl fidl::endpoints::Responder for WlanSoftmacBaseInstallKeyResponder {
4757    type ControlHandle = WlanSoftmacBaseControlHandle;
4758
4759    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4760        &self.control_handle
4761    }
4762
4763    fn drop_without_shutdown(mut self) {
4764        // Safety: drops once, never accessed again due to mem::forget
4765        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4766        // Prevent Drop from running (which would shut down the channel)
4767        std::mem::forget(self);
4768    }
4769}
4770
4771impl WlanSoftmacBaseInstallKeyResponder {
4772    /// Sends a response to the FIDL transaction.
4773    ///
4774    /// Sets the channel to shutdown if an error occurs.
4775    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4776        let _result = self.send_raw(result);
4777        if _result.is_err() {
4778            self.control_handle.shutdown();
4779        }
4780        self.drop_without_shutdown();
4781        _result
4782    }
4783
4784    /// Similar to "send" but does not shutdown the channel if an error occurs.
4785    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4786        let _result = self.send_raw(result);
4787        self.drop_without_shutdown();
4788        _result
4789    }
4790
4791    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4792        self.control_handle
4793            .inner
4794            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4795                result,
4796                self.tx_id,
4797                0x7decf9b4200b9131,
4798                fidl::encoding::DynamicFlags::empty(),
4799            )
4800    }
4801}
4802
4803#[must_use = "FIDL methods require a response to be sent"]
4804#[derive(Debug)]
4805pub struct WlanSoftmacBaseNotifyAssociationCompleteResponder {
4806    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4807    tx_id: u32,
4808}
4809
4810/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4811/// if the responder is dropped without sending a response, so that the client
4812/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4813impl std::ops::Drop for WlanSoftmacBaseNotifyAssociationCompleteResponder {
4814    fn drop(&mut self) {
4815        self.control_handle.shutdown();
4816        // Safety: drops once, never accessed again
4817        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4818    }
4819}
4820
4821impl fidl::endpoints::Responder for WlanSoftmacBaseNotifyAssociationCompleteResponder {
4822    type ControlHandle = WlanSoftmacBaseControlHandle;
4823
4824    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4825        &self.control_handle
4826    }
4827
4828    fn drop_without_shutdown(mut self) {
4829        // Safety: drops once, never accessed again due to mem::forget
4830        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4831        // Prevent Drop from running (which would shut down the channel)
4832        std::mem::forget(self);
4833    }
4834}
4835
4836impl WlanSoftmacBaseNotifyAssociationCompleteResponder {
4837    /// Sends a response to the FIDL transaction.
4838    ///
4839    /// Sets the channel to shutdown if an error occurs.
4840    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4841        let _result = self.send_raw(result);
4842        if _result.is_err() {
4843            self.control_handle.shutdown();
4844        }
4845        self.drop_without_shutdown();
4846        _result
4847    }
4848
4849    /// Similar to "send" but does not shutdown the channel if an error occurs.
4850    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4851        let _result = self.send_raw(result);
4852        self.drop_without_shutdown();
4853        _result
4854    }
4855
4856    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4857        self.control_handle
4858            .inner
4859            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4860                result,
4861                self.tx_id,
4862                0x436ffe3ba461d6cd,
4863                fidl::encoding::DynamicFlags::empty(),
4864            )
4865    }
4866}
4867
4868#[must_use = "FIDL methods require a response to be sent"]
4869#[derive(Debug)]
4870pub struct WlanSoftmacBaseClearAssociationResponder {
4871    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4872    tx_id: u32,
4873}
4874
4875/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4876/// if the responder is dropped without sending a response, so that the client
4877/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4878impl std::ops::Drop for WlanSoftmacBaseClearAssociationResponder {
4879    fn drop(&mut self) {
4880        self.control_handle.shutdown();
4881        // Safety: drops once, never accessed again
4882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4883    }
4884}
4885
4886impl fidl::endpoints::Responder for WlanSoftmacBaseClearAssociationResponder {
4887    type ControlHandle = WlanSoftmacBaseControlHandle;
4888
4889    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4890        &self.control_handle
4891    }
4892
4893    fn drop_without_shutdown(mut self) {
4894        // Safety: drops once, never accessed again due to mem::forget
4895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4896        // Prevent Drop from running (which would shut down the channel)
4897        std::mem::forget(self);
4898    }
4899}
4900
4901impl WlanSoftmacBaseClearAssociationResponder {
4902    /// Sends a response to the FIDL transaction.
4903    ///
4904    /// Sets the channel to shutdown if an error occurs.
4905    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4906        let _result = self.send_raw(result);
4907        if _result.is_err() {
4908            self.control_handle.shutdown();
4909        }
4910        self.drop_without_shutdown();
4911        _result
4912    }
4913
4914    /// Similar to "send" but does not shutdown the channel if an error occurs.
4915    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4916        let _result = self.send_raw(result);
4917        self.drop_without_shutdown();
4918        _result
4919    }
4920
4921    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
4922        self.control_handle
4923            .inner
4924            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
4925                result,
4926                self.tx_id,
4927                0x581d76c39190a7dd,
4928                fidl::encoding::DynamicFlags::empty(),
4929            )
4930    }
4931}
4932
4933#[must_use = "FIDL methods require a response to be sent"]
4934#[derive(Debug)]
4935pub struct WlanSoftmacBaseStartPassiveScanResponder {
4936    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
4937    tx_id: u32,
4938}
4939
4940/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
4941/// if the responder is dropped without sending a response, so that the client
4942/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
4943impl std::ops::Drop for WlanSoftmacBaseStartPassiveScanResponder {
4944    fn drop(&mut self) {
4945        self.control_handle.shutdown();
4946        // Safety: drops once, never accessed again
4947        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4948    }
4949}
4950
4951impl fidl::endpoints::Responder for WlanSoftmacBaseStartPassiveScanResponder {
4952    type ControlHandle = WlanSoftmacBaseControlHandle;
4953
4954    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
4955        &self.control_handle
4956    }
4957
4958    fn drop_without_shutdown(mut self) {
4959        // Safety: drops once, never accessed again due to mem::forget
4960        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
4961        // Prevent Drop from running (which would shut down the channel)
4962        std::mem::forget(self);
4963    }
4964}
4965
4966impl WlanSoftmacBaseStartPassiveScanResponder {
4967    /// Sends a response to the FIDL transaction.
4968    ///
4969    /// Sets the channel to shutdown if an error occurs.
4970    pub fn send(
4971        self,
4972        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
4973    ) -> Result<(), fidl::Error> {
4974        let _result = self.send_raw(result);
4975        if _result.is_err() {
4976            self.control_handle.shutdown();
4977        }
4978        self.drop_without_shutdown();
4979        _result
4980    }
4981
4982    /// Similar to "send" but does not shutdown the channel if an error occurs.
4983    pub fn send_no_shutdown_on_err(
4984        self,
4985        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
4986    ) -> Result<(), fidl::Error> {
4987        let _result = self.send_raw(result);
4988        self.drop_without_shutdown();
4989        _result
4990    }
4991
4992    fn send_raw(
4993        &self,
4994        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
4995    ) -> Result<(), fidl::Error> {
4996        self.control_handle.inner.send::<fidl::encoding::ResultType<
4997            WlanSoftmacBaseStartPassiveScanResponse,
4998            i32,
4999        >>(
5000            result,
5001            self.tx_id,
5002            0x5662f989cb4083bb,
5003            fidl::encoding::DynamicFlags::empty(),
5004        )
5005    }
5006}
5007
5008#[must_use = "FIDL methods require a response to be sent"]
5009#[derive(Debug)]
5010pub struct WlanSoftmacBaseStartActiveScanResponder {
5011    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
5012    tx_id: u32,
5013}
5014
5015/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
5016/// if the responder is dropped without sending a response, so that the client
5017/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5018impl std::ops::Drop for WlanSoftmacBaseStartActiveScanResponder {
5019    fn drop(&mut self) {
5020        self.control_handle.shutdown();
5021        // Safety: drops once, never accessed again
5022        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5023    }
5024}
5025
5026impl fidl::endpoints::Responder for WlanSoftmacBaseStartActiveScanResponder {
5027    type ControlHandle = WlanSoftmacBaseControlHandle;
5028
5029    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
5030        &self.control_handle
5031    }
5032
5033    fn drop_without_shutdown(mut self) {
5034        // Safety: drops once, never accessed again due to mem::forget
5035        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5036        // Prevent Drop from running (which would shut down the channel)
5037        std::mem::forget(self);
5038    }
5039}
5040
5041impl WlanSoftmacBaseStartActiveScanResponder {
5042    /// Sends a response to the FIDL transaction.
5043    ///
5044    /// Sets the channel to shutdown if an error occurs.
5045    pub fn send(
5046        self,
5047        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
5048    ) -> Result<(), fidl::Error> {
5049        let _result = self.send_raw(result);
5050        if _result.is_err() {
5051            self.control_handle.shutdown();
5052        }
5053        self.drop_without_shutdown();
5054        _result
5055    }
5056
5057    /// Similar to "send" but does not shutdown the channel if an error occurs.
5058    pub fn send_no_shutdown_on_err(
5059        self,
5060        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
5061    ) -> Result<(), fidl::Error> {
5062        let _result = self.send_raw(result);
5063        self.drop_without_shutdown();
5064        _result
5065    }
5066
5067    fn send_raw(
5068        &self,
5069        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
5070    ) -> Result<(), fidl::Error> {
5071        self.control_handle.inner.send::<fidl::encoding::ResultType<
5072            WlanSoftmacBaseStartActiveScanResponse,
5073            i32,
5074        >>(
5075            result,
5076            self.tx_id,
5077            0x4896eafa9937751e,
5078            fidl::encoding::DynamicFlags::empty(),
5079        )
5080    }
5081}
5082
5083#[must_use = "FIDL methods require a response to be sent"]
5084#[derive(Debug)]
5085pub struct WlanSoftmacBaseCancelScanResponder {
5086    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
5087    tx_id: u32,
5088}
5089
5090/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
5091/// if the responder is dropped without sending a response, so that the client
5092/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5093impl std::ops::Drop for WlanSoftmacBaseCancelScanResponder {
5094    fn drop(&mut self) {
5095        self.control_handle.shutdown();
5096        // Safety: drops once, never accessed again
5097        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5098    }
5099}
5100
5101impl fidl::endpoints::Responder for WlanSoftmacBaseCancelScanResponder {
5102    type ControlHandle = WlanSoftmacBaseControlHandle;
5103
5104    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
5105        &self.control_handle
5106    }
5107
5108    fn drop_without_shutdown(mut self) {
5109        // Safety: drops once, never accessed again due to mem::forget
5110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5111        // Prevent Drop from running (which would shut down the channel)
5112        std::mem::forget(self);
5113    }
5114}
5115
5116impl WlanSoftmacBaseCancelScanResponder {
5117    /// Sends a response to the FIDL transaction.
5118    ///
5119    /// Sets the channel to shutdown if an error occurs.
5120    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5121        let _result = self.send_raw(result);
5122        if _result.is_err() {
5123            self.control_handle.shutdown();
5124        }
5125        self.drop_without_shutdown();
5126        _result
5127    }
5128
5129    /// Similar to "send" but does not shutdown the channel if an error occurs.
5130    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5131        let _result = self.send_raw(result);
5132        self.drop_without_shutdown();
5133        _result
5134    }
5135
5136    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5137        self.control_handle
5138            .inner
5139            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5140                result,
5141                self.tx_id,
5142                0xf7d859369764556,
5143                fidl::encoding::DynamicFlags::empty(),
5144            )
5145    }
5146}
5147
5148#[must_use = "FIDL methods require a response to be sent"]
5149#[derive(Debug)]
5150pub struct WlanSoftmacBaseUpdateWmmParametersResponder {
5151    control_handle: std::mem::ManuallyDrop<WlanSoftmacBaseControlHandle>,
5152    tx_id: u32,
5153}
5154
5155/// Set the the channel to be shutdown (see [`WlanSoftmacBaseControlHandle::shutdown`])
5156/// if the responder is dropped without sending a response, so that the client
5157/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
5158impl std::ops::Drop for WlanSoftmacBaseUpdateWmmParametersResponder {
5159    fn drop(&mut self) {
5160        self.control_handle.shutdown();
5161        // Safety: drops once, never accessed again
5162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5163    }
5164}
5165
5166impl fidl::endpoints::Responder for WlanSoftmacBaseUpdateWmmParametersResponder {
5167    type ControlHandle = WlanSoftmacBaseControlHandle;
5168
5169    fn control_handle(&self) -> &WlanSoftmacBaseControlHandle {
5170        &self.control_handle
5171    }
5172
5173    fn drop_without_shutdown(mut self) {
5174        // Safety: drops once, never accessed again due to mem::forget
5175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
5176        // Prevent Drop from running (which would shut down the channel)
5177        std::mem::forget(self);
5178    }
5179}
5180
5181impl WlanSoftmacBaseUpdateWmmParametersResponder {
5182    /// Sends a response to the FIDL transaction.
5183    ///
5184    /// Sets the channel to shutdown if an error occurs.
5185    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5186        let _result = self.send_raw(result);
5187        if _result.is_err() {
5188            self.control_handle.shutdown();
5189        }
5190        self.drop_without_shutdown();
5191        _result
5192    }
5193
5194    /// Similar to "send" but does not shutdown the channel if an error occurs.
5195    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5196        let _result = self.send_raw(result);
5197        self.drop_without_shutdown();
5198        _result
5199    }
5200
5201    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
5202        self.control_handle
5203            .inner
5204            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
5205                result,
5206                self.tx_id,
5207                0x68522c7122d5f78c,
5208                fidl::encoding::DynamicFlags::empty(),
5209            )
5210    }
5211}
5212
5213#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
5214pub struct WlanSoftmacBridgeMarker;
5215
5216impl fidl::endpoints::ProtocolMarker for WlanSoftmacBridgeMarker {
5217    type Proxy = WlanSoftmacBridgeProxy;
5218    type RequestStream = WlanSoftmacBridgeRequestStream;
5219    #[cfg(target_os = "fuchsia")]
5220    type SynchronousProxy = WlanSoftmacBridgeSynchronousProxy;
5221
5222    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacBridge";
5223}
5224pub type WlanSoftmacBridgeStartResult = Result<fidl::Channel, i32>;
5225
5226pub trait WlanSoftmacBridgeProxyInterface: Send + Sync {
5227    type QueryResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQueryResult, fidl::Error>>
5228        + Send;
5229    fn r#query(&self) -> Self::QueryResponseFut;
5230    type QueryDiscoverySupportResponseFut: std::future::Future<
5231            Output = Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error>,
5232        > + Send;
5233    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut;
5234    type QueryMacSublayerSupportResponseFut: std::future::Future<
5235            Output = Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error>,
5236        > + Send;
5237    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut;
5238    type QuerySecuritySupportResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error>>
5239        + Send;
5240    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut;
5241    type QuerySpectrumManagementSupportResponseFut: std::future::Future<
5242            Output = Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error>,
5243        > + Send;
5244    fn r#query_spectrum_management_support(
5245        &self,
5246    ) -> Self::QuerySpectrumManagementSupportResponseFut;
5247    type SetChannelResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseSetChannelResult, fidl::Error>>
5248        + Send;
5249    fn r#set_channel(
5250        &self,
5251        payload: &WlanSoftmacBaseSetChannelRequest,
5252    ) -> Self::SetChannelResponseFut;
5253    type JoinBssResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseJoinBssResult, fidl::Error>>
5254        + Send;
5255    fn r#join_bss(
5256        &self,
5257        join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
5258    ) -> Self::JoinBssResponseFut;
5259    type EnableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error>>
5260        + Send;
5261    fn r#enable_beaconing(
5262        &self,
5263        payload: &WlanSoftmacBaseEnableBeaconingRequest,
5264    ) -> Self::EnableBeaconingResponseFut;
5265    type DisableBeaconingResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error>>
5266        + Send;
5267    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut;
5268    type InstallKeyResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseInstallKeyResult, fidl::Error>>
5269        + Send;
5270    fn r#install_key(&self, payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut;
5271    type NotifyAssociationCompleteResponseFut: std::future::Future<
5272            Output = Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error>,
5273        > + Send;
5274    fn r#notify_association_complete(
5275        &self,
5276        assoc_cfg: &WlanAssociationConfig,
5277    ) -> Self::NotifyAssociationCompleteResponseFut;
5278    type ClearAssociationResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseClearAssociationResult, fidl::Error>>
5279        + Send;
5280    fn r#clear_association(
5281        &self,
5282        payload: &WlanSoftmacBaseClearAssociationRequest,
5283    ) -> Self::ClearAssociationResponseFut;
5284    type StartPassiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error>>
5285        + Send;
5286    fn r#start_passive_scan(
5287        &self,
5288        payload: &WlanSoftmacBaseStartPassiveScanRequest,
5289    ) -> Self::StartPassiveScanResponseFut;
5290    type StartActiveScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error>>
5291        + Send;
5292    fn r#start_active_scan(
5293        &self,
5294        payload: &WlanSoftmacStartActiveScanRequest,
5295    ) -> Self::StartActiveScanResponseFut;
5296    type CancelScanResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseCancelScanResult, fidl::Error>>
5297        + Send;
5298    fn r#cancel_scan(
5299        &self,
5300        payload: &WlanSoftmacBaseCancelScanRequest,
5301    ) -> Self::CancelScanResponseFut;
5302    type UpdateWmmParametersResponseFut: std::future::Future<Output = Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error>>
5303        + Send;
5304    fn r#update_wmm_parameters(
5305        &self,
5306        payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
5307    ) -> Self::UpdateWmmParametersResponseFut;
5308    type StartResponseFut: std::future::Future<Output = Result<WlanSoftmacBridgeStartResult, fidl::Error>>
5309        + Send;
5310    fn r#start(
5311        &self,
5312        ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
5313        ethernet_tx: u64,
5314        wlan_rx: u64,
5315    ) -> Self::StartResponseFut;
5316    type SetEthernetStatusResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
5317    fn r#set_ethernet_status(&self, status: u32) -> Self::SetEthernetStatusResponseFut;
5318}
5319#[derive(Debug)]
5320#[cfg(target_os = "fuchsia")]
5321pub struct WlanSoftmacBridgeSynchronousProxy {
5322    client: fidl::client::sync::Client,
5323}
5324
5325#[cfg(target_os = "fuchsia")]
5326impl fidl::endpoints::SynchronousProxy for WlanSoftmacBridgeSynchronousProxy {
5327    type Proxy = WlanSoftmacBridgeProxy;
5328    type Protocol = WlanSoftmacBridgeMarker;
5329
5330    fn from_channel(inner: fidl::Channel) -> Self {
5331        Self::new(inner)
5332    }
5333
5334    fn into_channel(self) -> fidl::Channel {
5335        self.client.into_channel()
5336    }
5337
5338    fn as_channel(&self) -> &fidl::Channel {
5339        self.client.as_channel()
5340    }
5341}
5342
5343#[cfg(target_os = "fuchsia")]
5344impl WlanSoftmacBridgeSynchronousProxy {
5345    pub fn new(channel: fidl::Channel) -> Self {
5346        let protocol_name =
5347            <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5348        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
5349    }
5350
5351    pub fn into_channel(self) -> fidl::Channel {
5352        self.client.into_channel()
5353    }
5354
5355    /// Waits until an event arrives and returns it. It is safe for other
5356    /// threads to make concurrent requests while waiting for an event.
5357    pub fn wait_for_event(
5358        &self,
5359        deadline: zx::MonotonicInstant,
5360    ) -> Result<WlanSoftmacBridgeEvent, fidl::Error> {
5361        WlanSoftmacBridgeEvent::decode(self.client.wait_for_event(deadline)?)
5362    }
5363
5364    /// Gets general information about the device and its supported features.
5365    /// This method is safe to call even when the SoftMAC has not yet started.
5366    ///
5367    /// Note: The implementation of this method must not depend on a response
5368    /// from an ethernet driver, otherwise there is a risk of deadlock.
5369    /// The wlansoftmac driver calls this method synchronously while
5370    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
5371    pub fn r#query(
5372        &self,
5373        ___deadline: zx::MonotonicInstant,
5374    ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
5375        let _response = self.client.send_query::<
5376            fidl::encoding::EmptyPayload,
5377            fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
5378        >(
5379            (),
5380            0x18231a638e508f9d,
5381            fidl::encoding::DynamicFlags::empty(),
5382            ___deadline,
5383        )?;
5384        Ok(_response.map(|x| x))
5385    }
5386
5387    /// Gets information about the station discovery (e.g., scanning and
5388    /// probing) features supported by the device. This method is safe to call
5389    /// even when the SoftMAC has not yet started.
5390    pub fn r#query_discovery_support(
5391        &self,
5392        ___deadline: zx::MonotonicInstant,
5393    ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
5394        let _response =
5395            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5396                WlanSoftmacBaseQueryDiscoverySupportResponse,
5397                i32,
5398            >>(
5399                (),
5400                0x16797affc0cb58ae,
5401                fidl::encoding::DynamicFlags::empty(),
5402                ___deadline,
5403            )?;
5404        Ok(_response.map(|x| x.resp))
5405    }
5406
5407    /// Gets information about the MAC features supported by the device. This
5408    /// method is safe to call even when the SoftMAC has not yet started.
5409    ///
5410    /// Note: The implementation of this method must not depend on a response
5411    /// from an ethernet driver, otherwise there is a risk of deadlock.
5412    /// The wlansoftmac driver calls this method synchronously while
5413    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
5414    pub fn r#query_mac_sublayer_support(
5415        &self,
5416        ___deadline: zx::MonotonicInstant,
5417    ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
5418        let _response =
5419            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5420                WlanSoftmacBaseQueryMacSublayerSupportResponse,
5421                i32,
5422            >>(
5423                (),
5424                0x7302c3f8c131f075,
5425                fidl::encoding::DynamicFlags::empty(),
5426                ___deadline,
5427            )?;
5428        Ok(_response.map(|x| x.resp))
5429    }
5430
5431    /// Gets information about the security features supported by the device.
5432    /// This method is safe to call even when the SoftMAC has not yet started.
5433    pub fn r#query_security_support(
5434        &self,
5435        ___deadline: zx::MonotonicInstant,
5436    ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
5437        let _response =
5438            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5439                WlanSoftmacBaseQuerySecuritySupportResponse,
5440                i32,
5441            >>(
5442                (),
5443                0x3691bb75abf6354,
5444                fidl::encoding::DynamicFlags::empty(),
5445                ___deadline,
5446            )?;
5447        Ok(_response.map(|x| x.resp))
5448    }
5449
5450    /// Gets information about the spectrum usage (e.g., DFS) features supported
5451    /// by the device. This method is safe to call even when the SoftMAC has not
5452    /// yet started.
5453    pub fn r#query_spectrum_management_support(
5454        &self,
5455        ___deadline: zx::MonotonicInstant,
5456    ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
5457        let _response = self
5458            .client
5459            .send_query::<fidl::encoding::EmptyPayload, fidl::encoding::ResultType<
5460                WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
5461                i32,
5462            >>(
5463                (), 0x347d78dc1d4d27bf, fidl::encoding::DynamicFlags::empty(), ___deadline
5464            )?;
5465        Ok(_response.map(|x| x.resp))
5466    }
5467
5468    /// Set the primary radio channel, e.g. in response to a channel switch event.
5469    /// If successful, this will trigger the channel switch immediately. This may
5470    /// impact the transmission of any frames that are in-flight, and might also
5471    /// interfere with an ongoing scan request.
5472    ///
5473    /// Common errors include: \
5474    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
5475    pub fn r#set_channel(
5476        &self,
5477        mut payload: &WlanSoftmacBaseSetChannelRequest,
5478        ___deadline: zx::MonotonicInstant,
5479    ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
5480        let _response = self.client.send_query::<
5481            WlanSoftmacBaseSetChannelRequest,
5482            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5483        >(
5484            payload,
5485            0x12836b533cd63ece,
5486            fidl::encoding::DynamicFlags::empty(),
5487            ___deadline,
5488        )?;
5489        Ok(_response.map(|x| x))
5490    }
5491
5492    /// Join a specific BSS in which we will participate.
5493    /// This applies regardless of if we are hosting the BSS or joining it
5494    /// (indicated by the `remote` flag in `JoinBssRequest`).
5495    /// If successful, the device will switch to the correct channel and perform
5496    /// any internal filtering/timing operations required to join the BSS.
5497    /// For client STAs, this is the first step before authenticating.
5498    ///
5499    /// Common errors include: \
5500    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
5501    pub fn r#join_bss(
5502        &self,
5503        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
5504        ___deadline: zx::MonotonicInstant,
5505    ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
5506        let _response = self.client.send_query::<
5507            WlanSoftmacBaseJoinBssRequest,
5508            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5509        >(
5510            (join_request,),
5511            0x1336fb5455b77a6e,
5512            fidl::encoding::DynamicFlags::empty(),
5513            ___deadline,
5514        )?;
5515        Ok(_response.map(|x| x))
5516    }
5517
5518    /// Enables hardware Beaconing.
5519    ///
5520    /// This method cannot be called while beaconing is enabled and so
5521    /// `DisableBeaconing` must be called prior to this method if beaconing is
5522    /// enabled.
5523    ///
5524    /// All request fields are required.
5525    ///
5526    /// Common errors include:
5527    ///
5528    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
5529    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
5530    ///                          beacon.
5531    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
5532    pub fn r#enable_beaconing(
5533        &self,
5534        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
5535        ___deadline: zx::MonotonicInstant,
5536    ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
5537        let _response = self.client.send_query::<
5538            WlanSoftmacBaseEnableBeaconingRequest,
5539            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5540        >(
5541            payload,
5542            0x6c35807632c64576,
5543            fidl::encoding::DynamicFlags::empty(),
5544            ___deadline,
5545        )?;
5546        Ok(_response.map(|x| x))
5547    }
5548
5549    /// Disables hardware beaconing.
5550    pub fn r#disable_beaconing(
5551        &self,
5552        ___deadline: zx::MonotonicInstant,
5553    ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
5554        let _response = self.client.send_query::<
5555            fidl::encoding::EmptyPayload,
5556            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5557        >(
5558            (),
5559            0x3303b30f99dbb406,
5560            fidl::encoding::DynamicFlags::empty(),
5561            ___deadline,
5562        )?;
5563        Ok(_response.map(|x| x))
5564    }
5565
5566    /// Install a key for encryption when transmitting or receiving protected
5567    /// frames.
5568    ///
5569    /// Common errors include:
5570    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
5571    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
5572    pub fn r#install_key(
5573        &self,
5574        mut payload: &WlanKeyConfiguration,
5575        ___deadline: zx::MonotonicInstant,
5576    ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
5577        let _response = self.client.send_query::<
5578            WlanKeyConfiguration,
5579            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5580        >(
5581            payload,
5582            0x7decf9b4200b9131,
5583            fidl::encoding::DynamicFlags::empty(),
5584            ___deadline,
5585        )?;
5586        Ok(_response.map(|x| x))
5587    }
5588
5589    /// Notifies the device of a successful association and configures
5590    /// additional parameters necessary to participate in that association.
5591    ///
5592    /// # Errors
5593    ///
5594    /// Common errors include:
5595    ///
5596    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
5597    ///                       via `WlanSoftmac.JoinBss`.
5598    pub fn r#notify_association_complete(
5599        &self,
5600        mut assoc_cfg: &WlanAssociationConfig,
5601        ___deadline: zx::MonotonicInstant,
5602    ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
5603        let _response = self.client.send_query::<
5604            WlanSoftmacBaseNotifyAssociationCompleteRequest,
5605            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5606        >(
5607            (assoc_cfg,),
5608            0x436ffe3ba461d6cd,
5609            fidl::encoding::DynamicFlags::empty(),
5610            ___deadline,
5611        )?;
5612        Ok(_response.map(|x| x))
5613    }
5614
5615    /// Notifies MAC and PHY that the peer has been de-associated.
5616    pub fn r#clear_association(
5617        &self,
5618        mut payload: &WlanSoftmacBaseClearAssociationRequest,
5619        ___deadline: zx::MonotonicInstant,
5620    ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
5621        let _response = self.client.send_query::<
5622            WlanSoftmacBaseClearAssociationRequest,
5623            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5624        >(
5625            payload,
5626            0x581d76c39190a7dd,
5627            fidl::encoding::DynamicFlags::empty(),
5628            ___deadline,
5629        )?;
5630        Ok(_response.map(|x| x))
5631    }
5632
5633    /// Starts a passive scan. The server will deliver scan results
5634    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
5635    /// the server will call WlanSoftmacIfc.ScanComplete() with the
5636    /// same `scan_id` returned by StartPassiveScan().
5637    ///
5638    /// The server indicates support for `StartPassiveScan()` using
5639    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
5640    ///
5641    /// Common errors include:
5642    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
5643    ///       requested scan, e.g. because an incompatible channel was requested.
5644    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
5645    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
5646    pub fn r#start_passive_scan(
5647        &self,
5648        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
5649        ___deadline: zx::MonotonicInstant,
5650    ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
5651        let _response = self.client.send_query::<
5652            WlanSoftmacBaseStartPassiveScanRequest,
5653            fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
5654        >(
5655            payload,
5656            0x5662f989cb4083bb,
5657            fidl::encoding::DynamicFlags::empty(),
5658            ___deadline,
5659        )?;
5660        Ok(_response.map(|x| x))
5661    }
5662
5663    /// Starts an active scan. The server will deliver scan results
5664    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
5665    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
5666    /// with the same `scan_id` returned by StartActiveScan().
5667    ///
5668    /// A device driver indicates support for `StartActiveScan()` using
5669    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
5670    ///
5671    /// Common errors include:
5672    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
5673    ///       requested scan, e.g. because an incompatible channel was requested.
5674    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
5675    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
5676    pub fn r#start_active_scan(
5677        &self,
5678        mut payload: &WlanSoftmacStartActiveScanRequest,
5679        ___deadline: zx::MonotonicInstant,
5680    ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
5681        let _response = self.client.send_query::<
5682            WlanSoftmacStartActiveScanRequest,
5683            fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
5684        >(
5685            payload,
5686            0x4896eafa9937751e,
5687            fidl::encoding::DynamicFlags::empty(),
5688            ___deadline,
5689        )?;
5690        Ok(_response.map(|x| x))
5691    }
5692
5693    /// Cancels the ongoing scan corresponding to `scan_id`,
5694    /// where `scan_id` is an identifier returned by
5695    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
5696    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
5697    /// `scan_id`.
5698    ///
5699    /// A device driver indicates support for `CancelScan()` using
5700    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
5701    ///
5702    /// Common errors include:
5703    ///
5704    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
5705    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
5706    pub fn r#cancel_scan(
5707        &self,
5708        mut payload: &WlanSoftmacBaseCancelScanRequest,
5709        ___deadline: zx::MonotonicInstant,
5710    ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
5711        let _response = self.client.send_query::<
5712            WlanSoftmacBaseCancelScanRequest,
5713            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5714        >(
5715            payload,
5716            0xf7d859369764556,
5717            fidl::encoding::DynamicFlags::empty(),
5718            ___deadline,
5719        )?;
5720        Ok(_response.map(|x| x))
5721    }
5722
5723    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
5724    /// particular access category (AC).
5725    pub fn r#update_wmm_parameters(
5726        &self,
5727        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
5728        ___deadline: zx::MonotonicInstant,
5729    ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
5730        let _response = self.client.send_query::<
5731            WlanSoftmacBaseUpdateWmmParametersRequest,
5732            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
5733        >(
5734            payload,
5735            0x68522c7122d5f78c,
5736            fidl::encoding::DynamicFlags::empty(),
5737            ___deadline,
5738        )?;
5739        Ok(_response.map(|x| x))
5740    }
5741
5742    /// Signal to the server that the MLME for the iface is ready to send and receive
5743    /// frames.
5744    ///
5745    /// The client provides the following arguments:
5746    ///
5747    ///   - `ifc_bridge`: The client end of a `WlanSoftmacIfcBridge` server which the
5748    ///     `wlansoftmac` driver will use to forward `WlanSoftmacIfc` events to
5749    ///     the bridged driver.
5750    ///   - `ethernet_tx`: A `ethernet_tx_t*` casted to a `uint64`. The
5751    ///     `ethernet_tx_t` is defined in
5752    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
5753    ///   - `wlan_rx`: A `wlan_rx_t*` casted to a `uint64`. The
5754    ///     `wlan_rx_t` is defined in
5755    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
5756    ///
5757    /// The server must copy the contents of `ethernet_tx_t` and `wlan_rx_t` before
5758    /// returning from this method. The lifetimes of `ethernet_tx_t*` and `wlan_rx_t*` are only as
5759    /// long as this method call, but the contents of `ethernet_tx_t` and `wlan_rx_t` will
5760    /// live until the server stops the MLME.
5761    ///
5762    /// The server returns a server end of a `fuchsia.wlan.mlme/MLME` protocol. The SME
5763    /// for the iface owns the client end. Thus, this channel is used for SME <-> MLME
5764    /// communication.
5765    ///
5766    /// The `WlanSoftmacBridge.Start` method is different from `WlanSoftmac.Start`
5767    /// for two reasons. First, Rust bindings do not exist for Driver transported
5768    /// protocols, so `WlanSoftmacIfcBridge` protocol must be Zircon transported to be
5769    /// usable by the bridged driver. Second, the Zircon transport adds
5770    /// significant latency compared to the Driver transport. As a result, the
5771    /// `ethernet_tx` and `wlan_rx` arguments provide an FFI for the wlansoftmac driver
5772    /// to send Ethernet and receive WLAN packets to the bridged driver with
5773    /// latency comparable or better than a Driver transported protocol.
5774    ///
5775    /// Except where noted, `WlanSoftmacBridge` methods must only be called after
5776    /// a successful call to `WlanSoftmacBridge.Start`.
5777    ///
5778    /// Common errors include:
5779    ///
5780    ///   - `ZX_ERR_ALREADY_BOUND`: `Start` was already called on this softmac.
5781    pub fn r#start(
5782        &self,
5783        mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
5784        mut ethernet_tx: u64,
5785        mut wlan_rx: u64,
5786        ___deadline: zx::MonotonicInstant,
5787    ) -> Result<WlanSoftmacBridgeStartResult, fidl::Error> {
5788        let _response = self.client.send_query::<
5789            WlanSoftmacBridgeStartRequest,
5790            fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>,
5791        >(
5792            (ifc_bridge, ethernet_tx, wlan_rx,),
5793            0x7b2c15a507020d4d,
5794            fidl::encoding::DynamicFlags::empty(),
5795            ___deadline,
5796        )?;
5797        Ok(_response.map(|x| x.sme_channel))
5798    }
5799
5800    /// Forwards a status containing `ETHERNET_STATUS_*` flags to the
5801    /// `fuchsia.hardware.ethernet/EthernetImplIfc` proxy owned by
5802    /// the C++ portion of wlansoftmac.
5803    ///
5804    /// As documented, the value of `status` is set by bits defined in
5805    /// `ETHERNET_STATUS_*` flags. However, there is only one flag named
5806    /// `ETHERNET_STATUS_ONLINE` and no specification of for the meaning
5807    /// of specifying no flags. In practice, `0x1` means the status is up,
5808    /// and `0x0` means the status is down.
5809    ///
5810    /// While this method should belong in something like an
5811    /// "`EthernetImplIfcBridge` protocol", it's included in the
5812    /// `WlanSoftmacBridge` protocol as a convenience. The wlansoftmac driver
5813    /// will eventually cease using a `fuchsia.hardware.ethernet/EthernetImplIfc`
5814    /// proxy and use a `fuchsia.hardware.network.driver/NetworkDeviceIfc`
5815    /// proxy instead. At that time, an equivalent of this method should be
5816    /// refactored into a separate bridge.
5817    pub fn r#set_ethernet_status(
5818        &self,
5819        mut status: u32,
5820        ___deadline: zx::MonotonicInstant,
5821    ) -> Result<(), fidl::Error> {
5822        let _response = self
5823            .client
5824            .send_query::<WlanSoftmacBridgeSetEthernetStatusRequest, fidl::encoding::EmptyPayload>(
5825                (status,),
5826                0x412503cb3aaa350b,
5827                fidl::encoding::DynamicFlags::empty(),
5828                ___deadline,
5829            )?;
5830        Ok(_response)
5831    }
5832}
5833
5834#[derive(Debug, Clone)]
5835pub struct WlanSoftmacBridgeProxy {
5836    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
5837}
5838
5839impl fidl::endpoints::Proxy for WlanSoftmacBridgeProxy {
5840    type Protocol = WlanSoftmacBridgeMarker;
5841
5842    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
5843        Self::new(inner)
5844    }
5845
5846    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
5847        self.client.into_channel().map_err(|client| Self { client })
5848    }
5849
5850    fn as_channel(&self) -> &::fidl::AsyncChannel {
5851        self.client.as_channel()
5852    }
5853}
5854
5855impl WlanSoftmacBridgeProxy {
5856    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacBridge.
5857    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
5858        let protocol_name =
5859            <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
5860        Self { client: fidl::client::Client::new(channel, protocol_name) }
5861    }
5862
5863    /// Get a Stream of events from the remote end of the protocol.
5864    ///
5865    /// # Panics
5866    ///
5867    /// Panics if the event stream was already taken.
5868    pub fn take_event_stream(&self) -> WlanSoftmacBridgeEventStream {
5869        WlanSoftmacBridgeEventStream { event_receiver: self.client.take_event_receiver() }
5870    }
5871
5872    /// Gets general information about the device and its supported features.
5873    /// This method is safe to call even when the SoftMAC has not yet started.
5874    ///
5875    /// Note: The implementation of this method must not depend on a response
5876    /// from an ethernet driver, otherwise there is a risk of deadlock.
5877    /// The wlansoftmac driver calls this method synchronously while
5878    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
5879    pub fn r#query(
5880        &self,
5881    ) -> fidl::client::QueryResponseFut<
5882        WlanSoftmacBaseQueryResult,
5883        fidl::encoding::DefaultFuchsiaResourceDialect,
5884    > {
5885        WlanSoftmacBridgeProxyInterface::r#query(self)
5886    }
5887
5888    /// Gets information about the station discovery (e.g., scanning and
5889    /// probing) features supported by the device. This method is safe to call
5890    /// even when the SoftMAC has not yet started.
5891    pub fn r#query_discovery_support(
5892        &self,
5893    ) -> fidl::client::QueryResponseFut<
5894        WlanSoftmacBaseQueryDiscoverySupportResult,
5895        fidl::encoding::DefaultFuchsiaResourceDialect,
5896    > {
5897        WlanSoftmacBridgeProxyInterface::r#query_discovery_support(self)
5898    }
5899
5900    /// Gets information about the MAC features supported by the device. This
5901    /// method is safe to call even when the SoftMAC has not yet started.
5902    ///
5903    /// Note: The implementation of this method must not depend on a response
5904    /// from an ethernet driver, otherwise there is a risk of deadlock.
5905    /// The wlansoftmac driver calls this method synchronously while
5906    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
5907    pub fn r#query_mac_sublayer_support(
5908        &self,
5909    ) -> fidl::client::QueryResponseFut<
5910        WlanSoftmacBaseQueryMacSublayerSupportResult,
5911        fidl::encoding::DefaultFuchsiaResourceDialect,
5912    > {
5913        WlanSoftmacBridgeProxyInterface::r#query_mac_sublayer_support(self)
5914    }
5915
5916    /// Gets information about the security features supported by the device.
5917    /// This method is safe to call even when the SoftMAC has not yet started.
5918    pub fn r#query_security_support(
5919        &self,
5920    ) -> fidl::client::QueryResponseFut<
5921        WlanSoftmacBaseQuerySecuritySupportResult,
5922        fidl::encoding::DefaultFuchsiaResourceDialect,
5923    > {
5924        WlanSoftmacBridgeProxyInterface::r#query_security_support(self)
5925    }
5926
5927    /// Gets information about the spectrum usage (e.g., DFS) features supported
5928    /// by the device. This method is safe to call even when the SoftMAC has not
5929    /// yet started.
5930    pub fn r#query_spectrum_management_support(
5931        &self,
5932    ) -> fidl::client::QueryResponseFut<
5933        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
5934        fidl::encoding::DefaultFuchsiaResourceDialect,
5935    > {
5936        WlanSoftmacBridgeProxyInterface::r#query_spectrum_management_support(self)
5937    }
5938
5939    /// Set the primary radio channel, e.g. in response to a channel switch event.
5940    /// If successful, this will trigger the channel switch immediately. This may
5941    /// impact the transmission of any frames that are in-flight, and might also
5942    /// interfere with an ongoing scan request.
5943    ///
5944    /// Common errors include: \
5945    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
5946    pub fn r#set_channel(
5947        &self,
5948        mut payload: &WlanSoftmacBaseSetChannelRequest,
5949    ) -> fidl::client::QueryResponseFut<
5950        WlanSoftmacBaseSetChannelResult,
5951        fidl::encoding::DefaultFuchsiaResourceDialect,
5952    > {
5953        WlanSoftmacBridgeProxyInterface::r#set_channel(self, payload)
5954    }
5955
5956    /// Join a specific BSS in which we will participate.
5957    /// This applies regardless of if we are hosting the BSS or joining it
5958    /// (indicated by the `remote` flag in `JoinBssRequest`).
5959    /// If successful, the device will switch to the correct channel and perform
5960    /// any internal filtering/timing operations required to join the BSS.
5961    /// For client STAs, this is the first step before authenticating.
5962    ///
5963    /// Common errors include: \
5964    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
5965    pub fn r#join_bss(
5966        &self,
5967        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
5968    ) -> fidl::client::QueryResponseFut<
5969        WlanSoftmacBaseJoinBssResult,
5970        fidl::encoding::DefaultFuchsiaResourceDialect,
5971    > {
5972        WlanSoftmacBridgeProxyInterface::r#join_bss(self, join_request)
5973    }
5974
5975    /// Enables hardware Beaconing.
5976    ///
5977    /// This method cannot be called while beaconing is enabled and so
5978    /// `DisableBeaconing` must be called prior to this method if beaconing is
5979    /// enabled.
5980    ///
5981    /// All request fields are required.
5982    ///
5983    /// Common errors include:
5984    ///
5985    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
5986    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
5987    ///                          beacon.
5988    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
5989    pub fn r#enable_beaconing(
5990        &self,
5991        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
5992    ) -> fidl::client::QueryResponseFut<
5993        WlanSoftmacBaseEnableBeaconingResult,
5994        fidl::encoding::DefaultFuchsiaResourceDialect,
5995    > {
5996        WlanSoftmacBridgeProxyInterface::r#enable_beaconing(self, payload)
5997    }
5998
5999    /// Disables hardware beaconing.
6000    pub fn r#disable_beaconing(
6001        &self,
6002    ) -> fidl::client::QueryResponseFut<
6003        WlanSoftmacBaseDisableBeaconingResult,
6004        fidl::encoding::DefaultFuchsiaResourceDialect,
6005    > {
6006        WlanSoftmacBridgeProxyInterface::r#disable_beaconing(self)
6007    }
6008
6009    /// Install a key for encryption when transmitting or receiving protected
6010    /// frames.
6011    ///
6012    /// Common errors include:
6013    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
6014    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
6015    pub fn r#install_key(
6016        &self,
6017        mut payload: &WlanKeyConfiguration,
6018    ) -> fidl::client::QueryResponseFut<
6019        WlanSoftmacBaseInstallKeyResult,
6020        fidl::encoding::DefaultFuchsiaResourceDialect,
6021    > {
6022        WlanSoftmacBridgeProxyInterface::r#install_key(self, payload)
6023    }
6024
6025    /// Notifies the device of a successful association and configures
6026    /// additional parameters necessary to participate in that association.
6027    ///
6028    /// # Errors
6029    ///
6030    /// Common errors include:
6031    ///
6032    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
6033    ///                       via `WlanSoftmac.JoinBss`.
6034    pub fn r#notify_association_complete(
6035        &self,
6036        mut assoc_cfg: &WlanAssociationConfig,
6037    ) -> fidl::client::QueryResponseFut<
6038        WlanSoftmacBaseNotifyAssociationCompleteResult,
6039        fidl::encoding::DefaultFuchsiaResourceDialect,
6040    > {
6041        WlanSoftmacBridgeProxyInterface::r#notify_association_complete(self, assoc_cfg)
6042    }
6043
6044    /// Notifies MAC and PHY that the peer has been de-associated.
6045    pub fn r#clear_association(
6046        &self,
6047        mut payload: &WlanSoftmacBaseClearAssociationRequest,
6048    ) -> fidl::client::QueryResponseFut<
6049        WlanSoftmacBaseClearAssociationResult,
6050        fidl::encoding::DefaultFuchsiaResourceDialect,
6051    > {
6052        WlanSoftmacBridgeProxyInterface::r#clear_association(self, payload)
6053    }
6054
6055    /// Starts a passive scan. The server will deliver scan results
6056    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
6057    /// the server will call WlanSoftmacIfc.ScanComplete() with the
6058    /// same `scan_id` returned by StartPassiveScan().
6059    ///
6060    /// The server indicates support for `StartPassiveScan()` using
6061    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
6062    ///
6063    /// Common errors include:
6064    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
6065    ///       requested scan, e.g. because an incompatible channel was requested.
6066    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
6067    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
6068    pub fn r#start_passive_scan(
6069        &self,
6070        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
6071    ) -> fidl::client::QueryResponseFut<
6072        WlanSoftmacBaseStartPassiveScanResult,
6073        fidl::encoding::DefaultFuchsiaResourceDialect,
6074    > {
6075        WlanSoftmacBridgeProxyInterface::r#start_passive_scan(self, payload)
6076    }
6077
6078    /// Starts an active scan. The server will deliver scan results
6079    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
6080    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
6081    /// with the same `scan_id` returned by StartActiveScan().
6082    ///
6083    /// A device driver indicates support for `StartActiveScan()` using
6084    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
6085    ///
6086    /// Common errors include:
6087    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
6088    ///       requested scan, e.g. because an incompatible channel was requested.
6089    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
6090    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
6091    pub fn r#start_active_scan(
6092        &self,
6093        mut payload: &WlanSoftmacStartActiveScanRequest,
6094    ) -> fidl::client::QueryResponseFut<
6095        WlanSoftmacBaseStartActiveScanResult,
6096        fidl::encoding::DefaultFuchsiaResourceDialect,
6097    > {
6098        WlanSoftmacBridgeProxyInterface::r#start_active_scan(self, payload)
6099    }
6100
6101    /// Cancels the ongoing scan corresponding to `scan_id`,
6102    /// where `scan_id` is an identifier returned by
6103    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
6104    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
6105    /// `scan_id`.
6106    ///
6107    /// A device driver indicates support for `CancelScan()` using
6108    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
6109    ///
6110    /// Common errors include:
6111    ///
6112    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
6113    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
6114    pub fn r#cancel_scan(
6115        &self,
6116        mut payload: &WlanSoftmacBaseCancelScanRequest,
6117    ) -> fidl::client::QueryResponseFut<
6118        WlanSoftmacBaseCancelScanResult,
6119        fidl::encoding::DefaultFuchsiaResourceDialect,
6120    > {
6121        WlanSoftmacBridgeProxyInterface::r#cancel_scan(self, payload)
6122    }
6123
6124    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
6125    /// particular access category (AC).
6126    pub fn r#update_wmm_parameters(
6127        &self,
6128        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
6129    ) -> fidl::client::QueryResponseFut<
6130        WlanSoftmacBaseUpdateWmmParametersResult,
6131        fidl::encoding::DefaultFuchsiaResourceDialect,
6132    > {
6133        WlanSoftmacBridgeProxyInterface::r#update_wmm_parameters(self, payload)
6134    }
6135
6136    /// Signal to the server that the MLME for the iface is ready to send and receive
6137    /// frames.
6138    ///
6139    /// The client provides the following arguments:
6140    ///
6141    ///   - `ifc_bridge`: The client end of a `WlanSoftmacIfcBridge` server which the
6142    ///     `wlansoftmac` driver will use to forward `WlanSoftmacIfc` events to
6143    ///     the bridged driver.
6144    ///   - `ethernet_tx`: A `ethernet_tx_t*` casted to a `uint64`. The
6145    ///     `ethernet_tx_t` is defined in
6146    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
6147    ///   - `wlan_rx`: A `wlan_rx_t*` casted to a `uint64`. The
6148    ///     `wlan_rx_t` is defined in
6149    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
6150    ///
6151    /// The server must copy the contents of `ethernet_tx_t` and `wlan_rx_t` before
6152    /// returning from this method. The lifetimes of `ethernet_tx_t*` and `wlan_rx_t*` are only as
6153    /// long as this method call, but the contents of `ethernet_tx_t` and `wlan_rx_t` will
6154    /// live until the server stops the MLME.
6155    ///
6156    /// The server returns a server end of a `fuchsia.wlan.mlme/MLME` protocol. The SME
6157    /// for the iface owns the client end. Thus, this channel is used for SME <-> MLME
6158    /// communication.
6159    ///
6160    /// The `WlanSoftmacBridge.Start` method is different from `WlanSoftmac.Start`
6161    /// for two reasons. First, Rust bindings do not exist for Driver transported
6162    /// protocols, so `WlanSoftmacIfcBridge` protocol must be Zircon transported to be
6163    /// usable by the bridged driver. Second, the Zircon transport adds
6164    /// significant latency compared to the Driver transport. As a result, the
6165    /// `ethernet_tx` and `wlan_rx` arguments provide an FFI for the wlansoftmac driver
6166    /// to send Ethernet and receive WLAN packets to the bridged driver with
6167    /// latency comparable or better than a Driver transported protocol.
6168    ///
6169    /// Except where noted, `WlanSoftmacBridge` methods must only be called after
6170    /// a successful call to `WlanSoftmacBridge.Start`.
6171    ///
6172    /// Common errors include:
6173    ///
6174    ///   - `ZX_ERR_ALREADY_BOUND`: `Start` was already called on this softmac.
6175    pub fn r#start(
6176        &self,
6177        mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
6178        mut ethernet_tx: u64,
6179        mut wlan_rx: u64,
6180    ) -> fidl::client::QueryResponseFut<
6181        WlanSoftmacBridgeStartResult,
6182        fidl::encoding::DefaultFuchsiaResourceDialect,
6183    > {
6184        WlanSoftmacBridgeProxyInterface::r#start(self, ifc_bridge, ethernet_tx, wlan_rx)
6185    }
6186
6187    /// Forwards a status containing `ETHERNET_STATUS_*` flags to the
6188    /// `fuchsia.hardware.ethernet/EthernetImplIfc` proxy owned by
6189    /// the C++ portion of wlansoftmac.
6190    ///
6191    /// As documented, the value of `status` is set by bits defined in
6192    /// `ETHERNET_STATUS_*` flags. However, there is only one flag named
6193    /// `ETHERNET_STATUS_ONLINE` and no specification of for the meaning
6194    /// of specifying no flags. In practice, `0x1` means the status is up,
6195    /// and `0x0` means the status is down.
6196    ///
6197    /// While this method should belong in something like an
6198    /// "`EthernetImplIfcBridge` protocol", it's included in the
6199    /// `WlanSoftmacBridge` protocol as a convenience. The wlansoftmac driver
6200    /// will eventually cease using a `fuchsia.hardware.ethernet/EthernetImplIfc`
6201    /// proxy and use a `fuchsia.hardware.network.driver/NetworkDeviceIfc`
6202    /// proxy instead. At that time, an equivalent of this method should be
6203    /// refactored into a separate bridge.
6204    pub fn r#set_ethernet_status(
6205        &self,
6206        mut status: u32,
6207    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
6208        WlanSoftmacBridgeProxyInterface::r#set_ethernet_status(self, status)
6209    }
6210}
6211
6212impl WlanSoftmacBridgeProxyInterface for WlanSoftmacBridgeProxy {
6213    type QueryResponseFut = fidl::client::QueryResponseFut<
6214        WlanSoftmacBaseQueryResult,
6215        fidl::encoding::DefaultFuchsiaResourceDialect,
6216    >;
6217    fn r#query(&self) -> Self::QueryResponseFut {
6218        fn _decode(
6219            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6220        ) -> Result<WlanSoftmacBaseQueryResult, fidl::Error> {
6221            let _response = fidl::client::decode_transaction_body::<
6222                fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>,
6223                fidl::encoding::DefaultFuchsiaResourceDialect,
6224                0x18231a638e508f9d,
6225            >(_buf?)?;
6226            Ok(_response.map(|x| x))
6227        }
6228        self.client
6229            .send_query_and_decode::<fidl::encoding::EmptyPayload, WlanSoftmacBaseQueryResult>(
6230                (),
6231                0x18231a638e508f9d,
6232                fidl::encoding::DynamicFlags::empty(),
6233                _decode,
6234            )
6235    }
6236
6237    type QueryDiscoverySupportResponseFut = fidl::client::QueryResponseFut<
6238        WlanSoftmacBaseQueryDiscoverySupportResult,
6239        fidl::encoding::DefaultFuchsiaResourceDialect,
6240    >;
6241    fn r#query_discovery_support(&self) -> Self::QueryDiscoverySupportResponseFut {
6242        fn _decode(
6243            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6244        ) -> Result<WlanSoftmacBaseQueryDiscoverySupportResult, fidl::Error> {
6245            let _response = fidl::client::decode_transaction_body::<
6246                fidl::encoding::ResultType<WlanSoftmacBaseQueryDiscoverySupportResponse, i32>,
6247                fidl::encoding::DefaultFuchsiaResourceDialect,
6248                0x16797affc0cb58ae,
6249            >(_buf?)?;
6250            Ok(_response.map(|x| x.resp))
6251        }
6252        self.client.send_query_and_decode::<
6253            fidl::encoding::EmptyPayload,
6254            WlanSoftmacBaseQueryDiscoverySupportResult,
6255        >(
6256            (),
6257            0x16797affc0cb58ae,
6258            fidl::encoding::DynamicFlags::empty(),
6259            _decode,
6260        )
6261    }
6262
6263    type QueryMacSublayerSupportResponseFut = fidl::client::QueryResponseFut<
6264        WlanSoftmacBaseQueryMacSublayerSupportResult,
6265        fidl::encoding::DefaultFuchsiaResourceDialect,
6266    >;
6267    fn r#query_mac_sublayer_support(&self) -> Self::QueryMacSublayerSupportResponseFut {
6268        fn _decode(
6269            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6270        ) -> Result<WlanSoftmacBaseQueryMacSublayerSupportResult, fidl::Error> {
6271            let _response = fidl::client::decode_transaction_body::<
6272                fidl::encoding::ResultType<WlanSoftmacBaseQueryMacSublayerSupportResponse, i32>,
6273                fidl::encoding::DefaultFuchsiaResourceDialect,
6274                0x7302c3f8c131f075,
6275            >(_buf?)?;
6276            Ok(_response.map(|x| x.resp))
6277        }
6278        self.client.send_query_and_decode::<
6279            fidl::encoding::EmptyPayload,
6280            WlanSoftmacBaseQueryMacSublayerSupportResult,
6281        >(
6282            (),
6283            0x7302c3f8c131f075,
6284            fidl::encoding::DynamicFlags::empty(),
6285            _decode,
6286        )
6287    }
6288
6289    type QuerySecuritySupportResponseFut = fidl::client::QueryResponseFut<
6290        WlanSoftmacBaseQuerySecuritySupportResult,
6291        fidl::encoding::DefaultFuchsiaResourceDialect,
6292    >;
6293    fn r#query_security_support(&self) -> Self::QuerySecuritySupportResponseFut {
6294        fn _decode(
6295            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6296        ) -> Result<WlanSoftmacBaseQuerySecuritySupportResult, fidl::Error> {
6297            let _response = fidl::client::decode_transaction_body::<
6298                fidl::encoding::ResultType<WlanSoftmacBaseQuerySecuritySupportResponse, i32>,
6299                fidl::encoding::DefaultFuchsiaResourceDialect,
6300                0x3691bb75abf6354,
6301            >(_buf?)?;
6302            Ok(_response.map(|x| x.resp))
6303        }
6304        self.client.send_query_and_decode::<
6305            fidl::encoding::EmptyPayload,
6306            WlanSoftmacBaseQuerySecuritySupportResult,
6307        >(
6308            (),
6309            0x3691bb75abf6354,
6310            fidl::encoding::DynamicFlags::empty(),
6311            _decode,
6312        )
6313    }
6314
6315    type QuerySpectrumManagementSupportResponseFut = fidl::client::QueryResponseFut<
6316        WlanSoftmacBaseQuerySpectrumManagementSupportResult,
6317        fidl::encoding::DefaultFuchsiaResourceDialect,
6318    >;
6319    fn r#query_spectrum_management_support(
6320        &self,
6321    ) -> Self::QuerySpectrumManagementSupportResponseFut {
6322        fn _decode(
6323            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6324        ) -> Result<WlanSoftmacBaseQuerySpectrumManagementSupportResult, fidl::Error> {
6325            let _response = fidl::client::decode_transaction_body::<
6326                fidl::encoding::ResultType<
6327                    WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
6328                    i32,
6329                >,
6330                fidl::encoding::DefaultFuchsiaResourceDialect,
6331                0x347d78dc1d4d27bf,
6332            >(_buf?)?;
6333            Ok(_response.map(|x| x.resp))
6334        }
6335        self.client.send_query_and_decode::<
6336            fidl::encoding::EmptyPayload,
6337            WlanSoftmacBaseQuerySpectrumManagementSupportResult,
6338        >(
6339            (),
6340            0x347d78dc1d4d27bf,
6341            fidl::encoding::DynamicFlags::empty(),
6342            _decode,
6343        )
6344    }
6345
6346    type SetChannelResponseFut = fidl::client::QueryResponseFut<
6347        WlanSoftmacBaseSetChannelResult,
6348        fidl::encoding::DefaultFuchsiaResourceDialect,
6349    >;
6350    fn r#set_channel(
6351        &self,
6352        mut payload: &WlanSoftmacBaseSetChannelRequest,
6353    ) -> Self::SetChannelResponseFut {
6354        fn _decode(
6355            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6356        ) -> Result<WlanSoftmacBaseSetChannelResult, fidl::Error> {
6357            let _response = fidl::client::decode_transaction_body::<
6358                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6359                fidl::encoding::DefaultFuchsiaResourceDialect,
6360                0x12836b533cd63ece,
6361            >(_buf?)?;
6362            Ok(_response.map(|x| x))
6363        }
6364        self.client.send_query_and_decode::<
6365            WlanSoftmacBaseSetChannelRequest,
6366            WlanSoftmacBaseSetChannelResult,
6367        >(
6368            payload,
6369            0x12836b533cd63ece,
6370            fidl::encoding::DynamicFlags::empty(),
6371            _decode,
6372        )
6373    }
6374
6375    type JoinBssResponseFut = fidl::client::QueryResponseFut<
6376        WlanSoftmacBaseJoinBssResult,
6377        fidl::encoding::DefaultFuchsiaResourceDialect,
6378    >;
6379    fn r#join_bss(
6380        &self,
6381        mut join_request: &fidl_fuchsia_wlan_common::JoinBssRequest,
6382    ) -> Self::JoinBssResponseFut {
6383        fn _decode(
6384            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6385        ) -> Result<WlanSoftmacBaseJoinBssResult, fidl::Error> {
6386            let _response = fidl::client::decode_transaction_body::<
6387                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6388                fidl::encoding::DefaultFuchsiaResourceDialect,
6389                0x1336fb5455b77a6e,
6390            >(_buf?)?;
6391            Ok(_response.map(|x| x))
6392        }
6393        self.client
6394            .send_query_and_decode::<WlanSoftmacBaseJoinBssRequest, WlanSoftmacBaseJoinBssResult>(
6395                (join_request,),
6396                0x1336fb5455b77a6e,
6397                fidl::encoding::DynamicFlags::empty(),
6398                _decode,
6399            )
6400    }
6401
6402    type EnableBeaconingResponseFut = fidl::client::QueryResponseFut<
6403        WlanSoftmacBaseEnableBeaconingResult,
6404        fidl::encoding::DefaultFuchsiaResourceDialect,
6405    >;
6406    fn r#enable_beaconing(
6407        &self,
6408        mut payload: &WlanSoftmacBaseEnableBeaconingRequest,
6409    ) -> Self::EnableBeaconingResponseFut {
6410        fn _decode(
6411            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6412        ) -> Result<WlanSoftmacBaseEnableBeaconingResult, fidl::Error> {
6413            let _response = fidl::client::decode_transaction_body::<
6414                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6415                fidl::encoding::DefaultFuchsiaResourceDialect,
6416                0x6c35807632c64576,
6417            >(_buf?)?;
6418            Ok(_response.map(|x| x))
6419        }
6420        self.client.send_query_and_decode::<
6421            WlanSoftmacBaseEnableBeaconingRequest,
6422            WlanSoftmacBaseEnableBeaconingResult,
6423        >(
6424            payload,
6425            0x6c35807632c64576,
6426            fidl::encoding::DynamicFlags::empty(),
6427            _decode,
6428        )
6429    }
6430
6431    type DisableBeaconingResponseFut = fidl::client::QueryResponseFut<
6432        WlanSoftmacBaseDisableBeaconingResult,
6433        fidl::encoding::DefaultFuchsiaResourceDialect,
6434    >;
6435    fn r#disable_beaconing(&self) -> Self::DisableBeaconingResponseFut {
6436        fn _decode(
6437            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6438        ) -> Result<WlanSoftmacBaseDisableBeaconingResult, fidl::Error> {
6439            let _response = fidl::client::decode_transaction_body::<
6440                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6441                fidl::encoding::DefaultFuchsiaResourceDialect,
6442                0x3303b30f99dbb406,
6443            >(_buf?)?;
6444            Ok(_response.map(|x| x))
6445        }
6446        self.client.send_query_and_decode::<
6447            fidl::encoding::EmptyPayload,
6448            WlanSoftmacBaseDisableBeaconingResult,
6449        >(
6450            (),
6451            0x3303b30f99dbb406,
6452            fidl::encoding::DynamicFlags::empty(),
6453            _decode,
6454        )
6455    }
6456
6457    type InstallKeyResponseFut = fidl::client::QueryResponseFut<
6458        WlanSoftmacBaseInstallKeyResult,
6459        fidl::encoding::DefaultFuchsiaResourceDialect,
6460    >;
6461    fn r#install_key(&self, mut payload: &WlanKeyConfiguration) -> Self::InstallKeyResponseFut {
6462        fn _decode(
6463            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6464        ) -> Result<WlanSoftmacBaseInstallKeyResult, fidl::Error> {
6465            let _response = fidl::client::decode_transaction_body::<
6466                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6467                fidl::encoding::DefaultFuchsiaResourceDialect,
6468                0x7decf9b4200b9131,
6469            >(_buf?)?;
6470            Ok(_response.map(|x| x))
6471        }
6472        self.client.send_query_and_decode::<WlanKeyConfiguration, WlanSoftmacBaseInstallKeyResult>(
6473            payload,
6474            0x7decf9b4200b9131,
6475            fidl::encoding::DynamicFlags::empty(),
6476            _decode,
6477        )
6478    }
6479
6480    type NotifyAssociationCompleteResponseFut = fidl::client::QueryResponseFut<
6481        WlanSoftmacBaseNotifyAssociationCompleteResult,
6482        fidl::encoding::DefaultFuchsiaResourceDialect,
6483    >;
6484    fn r#notify_association_complete(
6485        &self,
6486        mut assoc_cfg: &WlanAssociationConfig,
6487    ) -> Self::NotifyAssociationCompleteResponseFut {
6488        fn _decode(
6489            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6490        ) -> Result<WlanSoftmacBaseNotifyAssociationCompleteResult, fidl::Error> {
6491            let _response = fidl::client::decode_transaction_body::<
6492                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6493                fidl::encoding::DefaultFuchsiaResourceDialect,
6494                0x436ffe3ba461d6cd,
6495            >(_buf?)?;
6496            Ok(_response.map(|x| x))
6497        }
6498        self.client.send_query_and_decode::<
6499            WlanSoftmacBaseNotifyAssociationCompleteRequest,
6500            WlanSoftmacBaseNotifyAssociationCompleteResult,
6501        >(
6502            (assoc_cfg,),
6503            0x436ffe3ba461d6cd,
6504            fidl::encoding::DynamicFlags::empty(),
6505            _decode,
6506        )
6507    }
6508
6509    type ClearAssociationResponseFut = fidl::client::QueryResponseFut<
6510        WlanSoftmacBaseClearAssociationResult,
6511        fidl::encoding::DefaultFuchsiaResourceDialect,
6512    >;
6513    fn r#clear_association(
6514        &self,
6515        mut payload: &WlanSoftmacBaseClearAssociationRequest,
6516    ) -> Self::ClearAssociationResponseFut {
6517        fn _decode(
6518            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6519        ) -> Result<WlanSoftmacBaseClearAssociationResult, fidl::Error> {
6520            let _response = fidl::client::decode_transaction_body::<
6521                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6522                fidl::encoding::DefaultFuchsiaResourceDialect,
6523                0x581d76c39190a7dd,
6524            >(_buf?)?;
6525            Ok(_response.map(|x| x))
6526        }
6527        self.client.send_query_and_decode::<
6528            WlanSoftmacBaseClearAssociationRequest,
6529            WlanSoftmacBaseClearAssociationResult,
6530        >(
6531            payload,
6532            0x581d76c39190a7dd,
6533            fidl::encoding::DynamicFlags::empty(),
6534            _decode,
6535        )
6536    }
6537
6538    type StartPassiveScanResponseFut = fidl::client::QueryResponseFut<
6539        WlanSoftmacBaseStartPassiveScanResult,
6540        fidl::encoding::DefaultFuchsiaResourceDialect,
6541    >;
6542    fn r#start_passive_scan(
6543        &self,
6544        mut payload: &WlanSoftmacBaseStartPassiveScanRequest,
6545    ) -> Self::StartPassiveScanResponseFut {
6546        fn _decode(
6547            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6548        ) -> Result<WlanSoftmacBaseStartPassiveScanResult, fidl::Error> {
6549            let _response = fidl::client::decode_transaction_body::<
6550                fidl::encoding::ResultType<WlanSoftmacBaseStartPassiveScanResponse, i32>,
6551                fidl::encoding::DefaultFuchsiaResourceDialect,
6552                0x5662f989cb4083bb,
6553            >(_buf?)?;
6554            Ok(_response.map(|x| x))
6555        }
6556        self.client.send_query_and_decode::<
6557            WlanSoftmacBaseStartPassiveScanRequest,
6558            WlanSoftmacBaseStartPassiveScanResult,
6559        >(
6560            payload,
6561            0x5662f989cb4083bb,
6562            fidl::encoding::DynamicFlags::empty(),
6563            _decode,
6564        )
6565    }
6566
6567    type StartActiveScanResponseFut = fidl::client::QueryResponseFut<
6568        WlanSoftmacBaseStartActiveScanResult,
6569        fidl::encoding::DefaultFuchsiaResourceDialect,
6570    >;
6571    fn r#start_active_scan(
6572        &self,
6573        mut payload: &WlanSoftmacStartActiveScanRequest,
6574    ) -> Self::StartActiveScanResponseFut {
6575        fn _decode(
6576            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6577        ) -> Result<WlanSoftmacBaseStartActiveScanResult, fidl::Error> {
6578            let _response = fidl::client::decode_transaction_body::<
6579                fidl::encoding::ResultType<WlanSoftmacBaseStartActiveScanResponse, i32>,
6580                fidl::encoding::DefaultFuchsiaResourceDialect,
6581                0x4896eafa9937751e,
6582            >(_buf?)?;
6583            Ok(_response.map(|x| x))
6584        }
6585        self.client.send_query_and_decode::<
6586            WlanSoftmacStartActiveScanRequest,
6587            WlanSoftmacBaseStartActiveScanResult,
6588        >(
6589            payload,
6590            0x4896eafa9937751e,
6591            fidl::encoding::DynamicFlags::empty(),
6592            _decode,
6593        )
6594    }
6595
6596    type CancelScanResponseFut = fidl::client::QueryResponseFut<
6597        WlanSoftmacBaseCancelScanResult,
6598        fidl::encoding::DefaultFuchsiaResourceDialect,
6599    >;
6600    fn r#cancel_scan(
6601        &self,
6602        mut payload: &WlanSoftmacBaseCancelScanRequest,
6603    ) -> Self::CancelScanResponseFut {
6604        fn _decode(
6605            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6606        ) -> Result<WlanSoftmacBaseCancelScanResult, fidl::Error> {
6607            let _response = fidl::client::decode_transaction_body::<
6608                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6609                fidl::encoding::DefaultFuchsiaResourceDialect,
6610                0xf7d859369764556,
6611            >(_buf?)?;
6612            Ok(_response.map(|x| x))
6613        }
6614        self.client.send_query_and_decode::<
6615            WlanSoftmacBaseCancelScanRequest,
6616            WlanSoftmacBaseCancelScanResult,
6617        >(
6618            payload,
6619            0xf7d859369764556,
6620            fidl::encoding::DynamicFlags::empty(),
6621            _decode,
6622        )
6623    }
6624
6625    type UpdateWmmParametersResponseFut = fidl::client::QueryResponseFut<
6626        WlanSoftmacBaseUpdateWmmParametersResult,
6627        fidl::encoding::DefaultFuchsiaResourceDialect,
6628    >;
6629    fn r#update_wmm_parameters(
6630        &self,
6631        mut payload: &WlanSoftmacBaseUpdateWmmParametersRequest,
6632    ) -> Self::UpdateWmmParametersResponseFut {
6633        fn _decode(
6634            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6635        ) -> Result<WlanSoftmacBaseUpdateWmmParametersResult, fidl::Error> {
6636            let _response = fidl::client::decode_transaction_body::<
6637                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
6638                fidl::encoding::DefaultFuchsiaResourceDialect,
6639                0x68522c7122d5f78c,
6640            >(_buf?)?;
6641            Ok(_response.map(|x| x))
6642        }
6643        self.client.send_query_and_decode::<
6644            WlanSoftmacBaseUpdateWmmParametersRequest,
6645            WlanSoftmacBaseUpdateWmmParametersResult,
6646        >(
6647            payload,
6648            0x68522c7122d5f78c,
6649            fidl::encoding::DynamicFlags::empty(),
6650            _decode,
6651        )
6652    }
6653
6654    type StartResponseFut = fidl::client::QueryResponseFut<
6655        WlanSoftmacBridgeStartResult,
6656        fidl::encoding::DefaultFuchsiaResourceDialect,
6657    >;
6658    fn r#start(
6659        &self,
6660        mut ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
6661        mut ethernet_tx: u64,
6662        mut wlan_rx: u64,
6663    ) -> Self::StartResponseFut {
6664        fn _decode(
6665            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6666        ) -> Result<WlanSoftmacBridgeStartResult, fidl::Error> {
6667            let _response = fidl::client::decode_transaction_body::<
6668                fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>,
6669                fidl::encoding::DefaultFuchsiaResourceDialect,
6670                0x7b2c15a507020d4d,
6671            >(_buf?)?;
6672            Ok(_response.map(|x| x.sme_channel))
6673        }
6674        self.client
6675            .send_query_and_decode::<WlanSoftmacBridgeStartRequest, WlanSoftmacBridgeStartResult>(
6676                (ifc_bridge, ethernet_tx, wlan_rx),
6677                0x7b2c15a507020d4d,
6678                fidl::encoding::DynamicFlags::empty(),
6679                _decode,
6680            )
6681    }
6682
6683    type SetEthernetStatusResponseFut =
6684        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
6685    fn r#set_ethernet_status(&self, mut status: u32) -> Self::SetEthernetStatusResponseFut {
6686        fn _decode(
6687            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
6688        ) -> Result<(), fidl::Error> {
6689            let _response = fidl::client::decode_transaction_body::<
6690                fidl::encoding::EmptyPayload,
6691                fidl::encoding::DefaultFuchsiaResourceDialect,
6692                0x412503cb3aaa350b,
6693            >(_buf?)?;
6694            Ok(_response)
6695        }
6696        self.client.send_query_and_decode::<WlanSoftmacBridgeSetEthernetStatusRequest, ()>(
6697            (status,),
6698            0x412503cb3aaa350b,
6699            fidl::encoding::DynamicFlags::empty(),
6700            _decode,
6701        )
6702    }
6703}
6704
6705pub struct WlanSoftmacBridgeEventStream {
6706    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
6707}
6708
6709impl std::marker::Unpin for WlanSoftmacBridgeEventStream {}
6710
6711impl futures::stream::FusedStream for WlanSoftmacBridgeEventStream {
6712    fn is_terminated(&self) -> bool {
6713        self.event_receiver.is_terminated()
6714    }
6715}
6716
6717impl futures::Stream for WlanSoftmacBridgeEventStream {
6718    type Item = Result<WlanSoftmacBridgeEvent, fidl::Error>;
6719
6720    fn poll_next(
6721        mut self: std::pin::Pin<&mut Self>,
6722        cx: &mut std::task::Context<'_>,
6723    ) -> std::task::Poll<Option<Self::Item>> {
6724        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
6725            &mut self.event_receiver,
6726            cx
6727        )?) {
6728            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacBridgeEvent::decode(buf))),
6729            None => std::task::Poll::Ready(None),
6730        }
6731    }
6732}
6733
6734#[derive(Debug)]
6735pub enum WlanSoftmacBridgeEvent {}
6736
6737impl WlanSoftmacBridgeEvent {
6738    /// Decodes a message buffer as a [`WlanSoftmacBridgeEvent`].
6739    fn decode(
6740        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
6741    ) -> Result<WlanSoftmacBridgeEvent, fidl::Error> {
6742        let (bytes, _handles) = buf.split_mut();
6743        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6744        debug_assert_eq!(tx_header.tx_id, 0);
6745        match tx_header.ordinal {
6746            _ => Err(fidl::Error::UnknownOrdinal {
6747                ordinal: tx_header.ordinal,
6748                protocol_name:
6749                    <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
6750            }),
6751        }
6752    }
6753}
6754
6755/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacBridge.
6756pub struct WlanSoftmacBridgeRequestStream {
6757    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6758    is_terminated: bool,
6759}
6760
6761impl std::marker::Unpin for WlanSoftmacBridgeRequestStream {}
6762
6763impl futures::stream::FusedStream for WlanSoftmacBridgeRequestStream {
6764    fn is_terminated(&self) -> bool {
6765        self.is_terminated
6766    }
6767}
6768
6769impl fidl::endpoints::RequestStream for WlanSoftmacBridgeRequestStream {
6770    type Protocol = WlanSoftmacBridgeMarker;
6771    type ControlHandle = WlanSoftmacBridgeControlHandle;
6772
6773    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
6774        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
6775    }
6776
6777    fn control_handle(&self) -> Self::ControlHandle {
6778        WlanSoftmacBridgeControlHandle { inner: self.inner.clone() }
6779    }
6780
6781    fn into_inner(
6782        self,
6783    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
6784    {
6785        (self.inner, self.is_terminated)
6786    }
6787
6788    fn from_inner(
6789        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
6790        is_terminated: bool,
6791    ) -> Self {
6792        Self { inner, is_terminated }
6793    }
6794}
6795
6796impl futures::Stream for WlanSoftmacBridgeRequestStream {
6797    type Item = Result<WlanSoftmacBridgeRequest, fidl::Error>;
6798
6799    fn poll_next(
6800        mut self: std::pin::Pin<&mut Self>,
6801        cx: &mut std::task::Context<'_>,
6802    ) -> std::task::Poll<Option<Self::Item>> {
6803        let this = &mut *self;
6804        if this.inner.check_shutdown(cx) {
6805            this.is_terminated = true;
6806            return std::task::Poll::Ready(None);
6807        }
6808        if this.is_terminated {
6809            panic!("polled WlanSoftmacBridgeRequestStream after completion");
6810        }
6811        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
6812            |bytes, handles| {
6813                match this.inner.channel().read_etc(cx, bytes, handles) {
6814                    std::task::Poll::Ready(Ok(())) => {}
6815                    std::task::Poll::Pending => return std::task::Poll::Pending,
6816                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
6817                        this.is_terminated = true;
6818                        return std::task::Poll::Ready(None);
6819                    }
6820                    std::task::Poll::Ready(Err(e)) => {
6821                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
6822                            e.into(),
6823                        ))))
6824                    }
6825                }
6826
6827                // A message has been received from the channel
6828                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
6829
6830                std::task::Poll::Ready(Some(match header.ordinal {
6831                    0x18231a638e508f9d => {
6832                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6833                        let mut req = fidl::new_empty!(
6834                            fidl::encoding::EmptyPayload,
6835                            fidl::encoding::DefaultFuchsiaResourceDialect
6836                        );
6837                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6838                        let control_handle =
6839                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6840                        Ok(WlanSoftmacBridgeRequest::Query {
6841                            responder: WlanSoftmacBridgeQueryResponder {
6842                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6843                                tx_id: header.tx_id,
6844                            },
6845                        })
6846                    }
6847                    0x16797affc0cb58ae => {
6848                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6849                        let mut req = fidl::new_empty!(
6850                            fidl::encoding::EmptyPayload,
6851                            fidl::encoding::DefaultFuchsiaResourceDialect
6852                        );
6853                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6854                        let control_handle =
6855                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6856                        Ok(WlanSoftmacBridgeRequest::QueryDiscoverySupport {
6857                            responder: WlanSoftmacBridgeQueryDiscoverySupportResponder {
6858                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6859                                tx_id: header.tx_id,
6860                            },
6861                        })
6862                    }
6863                    0x7302c3f8c131f075 => {
6864                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6865                        let mut req = fidl::new_empty!(
6866                            fidl::encoding::EmptyPayload,
6867                            fidl::encoding::DefaultFuchsiaResourceDialect
6868                        );
6869                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6870                        let control_handle =
6871                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6872                        Ok(WlanSoftmacBridgeRequest::QueryMacSublayerSupport {
6873                            responder: WlanSoftmacBridgeQueryMacSublayerSupportResponder {
6874                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6875                                tx_id: header.tx_id,
6876                            },
6877                        })
6878                    }
6879                    0x3691bb75abf6354 => {
6880                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6881                        let mut req = fidl::new_empty!(
6882                            fidl::encoding::EmptyPayload,
6883                            fidl::encoding::DefaultFuchsiaResourceDialect
6884                        );
6885                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6886                        let control_handle =
6887                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6888                        Ok(WlanSoftmacBridgeRequest::QuerySecuritySupport {
6889                            responder: WlanSoftmacBridgeQuerySecuritySupportResponder {
6890                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6891                                tx_id: header.tx_id,
6892                            },
6893                        })
6894                    }
6895                    0x347d78dc1d4d27bf => {
6896                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6897                        let mut req = fidl::new_empty!(
6898                            fidl::encoding::EmptyPayload,
6899                            fidl::encoding::DefaultFuchsiaResourceDialect
6900                        );
6901                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6902                        let control_handle =
6903                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6904                        Ok(WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport {
6905                            responder: WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
6906                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6907                                tx_id: header.tx_id,
6908                            },
6909                        })
6910                    }
6911                    0x12836b533cd63ece => {
6912                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6913                        let mut req = fidl::new_empty!(
6914                            WlanSoftmacBaseSetChannelRequest,
6915                            fidl::encoding::DefaultFuchsiaResourceDialect
6916                        );
6917                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseSetChannelRequest>(&header, _body_bytes, handles, &mut req)?;
6918                        let control_handle =
6919                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6920                        Ok(WlanSoftmacBridgeRequest::SetChannel {
6921                            payload: req,
6922                            responder: WlanSoftmacBridgeSetChannelResponder {
6923                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6924                                tx_id: header.tx_id,
6925                            },
6926                        })
6927                    }
6928                    0x1336fb5455b77a6e => {
6929                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6930                        let mut req = fidl::new_empty!(
6931                            WlanSoftmacBaseJoinBssRequest,
6932                            fidl::encoding::DefaultFuchsiaResourceDialect
6933                        );
6934                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseJoinBssRequest>(&header, _body_bytes, handles, &mut req)?;
6935                        let control_handle =
6936                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6937                        Ok(WlanSoftmacBridgeRequest::JoinBss {
6938                            join_request: req.join_request,
6939
6940                            responder: WlanSoftmacBridgeJoinBssResponder {
6941                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6942                                tx_id: header.tx_id,
6943                            },
6944                        })
6945                    }
6946                    0x6c35807632c64576 => {
6947                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6948                        let mut req = fidl::new_empty!(
6949                            WlanSoftmacBaseEnableBeaconingRequest,
6950                            fidl::encoding::DefaultFuchsiaResourceDialect
6951                        );
6952                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseEnableBeaconingRequest>(&header, _body_bytes, handles, &mut req)?;
6953                        let control_handle =
6954                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6955                        Ok(WlanSoftmacBridgeRequest::EnableBeaconing {
6956                            payload: req,
6957                            responder: WlanSoftmacBridgeEnableBeaconingResponder {
6958                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6959                                tx_id: header.tx_id,
6960                            },
6961                        })
6962                    }
6963                    0x3303b30f99dbb406 => {
6964                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6965                        let mut req = fidl::new_empty!(
6966                            fidl::encoding::EmptyPayload,
6967                            fidl::encoding::DefaultFuchsiaResourceDialect
6968                        );
6969                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
6970                        let control_handle =
6971                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6972                        Ok(WlanSoftmacBridgeRequest::DisableBeaconing {
6973                            responder: WlanSoftmacBridgeDisableBeaconingResponder {
6974                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6975                                tx_id: header.tx_id,
6976                            },
6977                        })
6978                    }
6979                    0x7decf9b4200b9131 => {
6980                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6981                        let mut req = fidl::new_empty!(
6982                            WlanKeyConfiguration,
6983                            fidl::encoding::DefaultFuchsiaResourceDialect
6984                        );
6985                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanKeyConfiguration>(&header, _body_bytes, handles, &mut req)?;
6986                        let control_handle =
6987                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
6988                        Ok(WlanSoftmacBridgeRequest::InstallKey {
6989                            payload: req,
6990                            responder: WlanSoftmacBridgeInstallKeyResponder {
6991                                control_handle: std::mem::ManuallyDrop::new(control_handle),
6992                                tx_id: header.tx_id,
6993                            },
6994                        })
6995                    }
6996                    0x436ffe3ba461d6cd => {
6997                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
6998                        let mut req = fidl::new_empty!(
6999                            WlanSoftmacBaseNotifyAssociationCompleteRequest,
7000                            fidl::encoding::DefaultFuchsiaResourceDialect
7001                        );
7002                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
7003                        let control_handle =
7004                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7005                        Ok(WlanSoftmacBridgeRequest::NotifyAssociationComplete {
7006                            assoc_cfg: req.assoc_cfg,
7007
7008                            responder: WlanSoftmacBridgeNotifyAssociationCompleteResponder {
7009                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7010                                tx_id: header.tx_id,
7011                            },
7012                        })
7013                    }
7014                    0x581d76c39190a7dd => {
7015                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7016                        let mut req = fidl::new_empty!(
7017                            WlanSoftmacBaseClearAssociationRequest,
7018                            fidl::encoding::DefaultFuchsiaResourceDialect
7019                        );
7020                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseClearAssociationRequest>(&header, _body_bytes, handles, &mut req)?;
7021                        let control_handle =
7022                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7023                        Ok(WlanSoftmacBridgeRequest::ClearAssociation {
7024                            payload: req,
7025                            responder: WlanSoftmacBridgeClearAssociationResponder {
7026                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7027                                tx_id: header.tx_id,
7028                            },
7029                        })
7030                    }
7031                    0x5662f989cb4083bb => {
7032                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7033                        let mut req = fidl::new_empty!(
7034                            WlanSoftmacBaseStartPassiveScanRequest,
7035                            fidl::encoding::DefaultFuchsiaResourceDialect
7036                        );
7037                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseStartPassiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
7038                        let control_handle =
7039                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7040                        Ok(WlanSoftmacBridgeRequest::StartPassiveScan {
7041                            payload: req,
7042                            responder: WlanSoftmacBridgeStartPassiveScanResponder {
7043                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7044                                tx_id: header.tx_id,
7045                            },
7046                        })
7047                    }
7048                    0x4896eafa9937751e => {
7049                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7050                        let mut req = fidl::new_empty!(
7051                            WlanSoftmacStartActiveScanRequest,
7052                            fidl::encoding::DefaultFuchsiaResourceDialect
7053                        );
7054                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacStartActiveScanRequest>(&header, _body_bytes, handles, &mut req)?;
7055                        let control_handle =
7056                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7057                        Ok(WlanSoftmacBridgeRequest::StartActiveScan {
7058                            payload: req,
7059                            responder: WlanSoftmacBridgeStartActiveScanResponder {
7060                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7061                                tx_id: header.tx_id,
7062                            },
7063                        })
7064                    }
7065                    0xf7d859369764556 => {
7066                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7067                        let mut req = fidl::new_empty!(
7068                            WlanSoftmacBaseCancelScanRequest,
7069                            fidl::encoding::DefaultFuchsiaResourceDialect
7070                        );
7071                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseCancelScanRequest>(&header, _body_bytes, handles, &mut req)?;
7072                        let control_handle =
7073                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7074                        Ok(WlanSoftmacBridgeRequest::CancelScan {
7075                            payload: req,
7076                            responder: WlanSoftmacBridgeCancelScanResponder {
7077                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7078                                tx_id: header.tx_id,
7079                            },
7080                        })
7081                    }
7082                    0x68522c7122d5f78c => {
7083                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7084                        let mut req = fidl::new_empty!(
7085                            WlanSoftmacBaseUpdateWmmParametersRequest,
7086                            fidl::encoding::DefaultFuchsiaResourceDialect
7087                        );
7088                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBaseUpdateWmmParametersRequest>(&header, _body_bytes, handles, &mut req)?;
7089                        let control_handle =
7090                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7091                        Ok(WlanSoftmacBridgeRequest::UpdateWmmParameters {
7092                            payload: req,
7093                            responder: WlanSoftmacBridgeUpdateWmmParametersResponder {
7094                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7095                                tx_id: header.tx_id,
7096                            },
7097                        })
7098                    }
7099                    0x7b2c15a507020d4d => {
7100                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7101                        let mut req = fidl::new_empty!(
7102                            WlanSoftmacBridgeStartRequest,
7103                            fidl::encoding::DefaultFuchsiaResourceDialect
7104                        );
7105                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBridgeStartRequest>(&header, _body_bytes, handles, &mut req)?;
7106                        let control_handle =
7107                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7108                        Ok(WlanSoftmacBridgeRequest::Start {
7109                            ifc_bridge: req.ifc_bridge,
7110                            ethernet_tx: req.ethernet_tx,
7111                            wlan_rx: req.wlan_rx,
7112
7113                            responder: WlanSoftmacBridgeStartResponder {
7114                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7115                                tx_id: header.tx_id,
7116                            },
7117                        })
7118                    }
7119                    0x412503cb3aaa350b => {
7120                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
7121                        let mut req = fidl::new_empty!(
7122                            WlanSoftmacBridgeSetEthernetStatusRequest,
7123                            fidl::encoding::DefaultFuchsiaResourceDialect
7124                        );
7125                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacBridgeSetEthernetStatusRequest>(&header, _body_bytes, handles, &mut req)?;
7126                        let control_handle =
7127                            WlanSoftmacBridgeControlHandle { inner: this.inner.clone() };
7128                        Ok(WlanSoftmacBridgeRequest::SetEthernetStatus {
7129                            status: req.status,
7130
7131                            responder: WlanSoftmacBridgeSetEthernetStatusResponder {
7132                                control_handle: std::mem::ManuallyDrop::new(control_handle),
7133                                tx_id: header.tx_id,
7134                            },
7135                        })
7136                    }
7137                    _ => Err(fidl::Error::UnknownOrdinal {
7138                        ordinal: header.ordinal,
7139                        protocol_name:
7140                            <WlanSoftmacBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
7141                    }),
7142                }))
7143            },
7144        )
7145    }
7146}
7147
7148/// `WlanSoftmacBridge` is the protocol the `wlansoftmac` driver serves
7149/// to the bridged driver. This protocol **should not** be implemented
7150/// by a vendor driver.
7151#[derive(Debug)]
7152pub enum WlanSoftmacBridgeRequest {
7153    /// Gets general information about the device and its supported features.
7154    /// This method is safe to call even when the SoftMAC has not yet started.
7155    ///
7156    /// Note: The implementation of this method must not depend on a response
7157    /// from an ethernet driver, otherwise there is a risk of deadlock.
7158    /// The wlansoftmac driver calls this method synchronously while
7159    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
7160    Query { responder: WlanSoftmacBridgeQueryResponder },
7161    /// Gets information about the station discovery (e.g., scanning and
7162    /// probing) features supported by the device. This method is safe to call
7163    /// even when the SoftMAC has not yet started.
7164    QueryDiscoverySupport { responder: WlanSoftmacBridgeQueryDiscoverySupportResponder },
7165    /// Gets information about the MAC features supported by the device. This
7166    /// method is safe to call even when the SoftMAC has not yet started.
7167    ///
7168    /// Note: The implementation of this method must not depend on a response
7169    /// from an ethernet driver, otherwise there is a risk of deadlock.
7170    /// The wlansoftmac driver calls this method synchronously while
7171    /// serving the fuchsia.hardware.ethernet/EthernetImpl.Query method.
7172    QueryMacSublayerSupport { responder: WlanSoftmacBridgeQueryMacSublayerSupportResponder },
7173    /// Gets information about the security features supported by the device.
7174    /// This method is safe to call even when the SoftMAC has not yet started.
7175    QuerySecuritySupport { responder: WlanSoftmacBridgeQuerySecuritySupportResponder },
7176    /// Gets information about the spectrum usage (e.g., DFS) features supported
7177    /// by the device. This method is safe to call even when the SoftMAC has not
7178    /// yet started.
7179    QuerySpectrumManagementSupport {
7180        responder: WlanSoftmacBridgeQuerySpectrumManagementSupportResponder,
7181    },
7182    /// Set the primary radio channel, e.g. in response to a channel switch event.
7183    /// If successful, this will trigger the channel switch immediately. This may
7184    /// impact the transmission of any frames that are in-flight, and might also
7185    /// interfere with an ongoing scan request.
7186    ///
7187    /// Common errors include: \
7188    ///   ZX_ERR_NOT_SUPPORTED: The device cannot switch to the requested channel.
7189    SetChannel {
7190        payload: WlanSoftmacBaseSetChannelRequest,
7191        responder: WlanSoftmacBridgeSetChannelResponder,
7192    },
7193    /// Join a specific BSS in which we will participate.
7194    /// This applies regardless of if we are hosting the BSS or joining it
7195    /// (indicated by the `remote` flag in `JoinBssRequest`).
7196    /// If successful, the device will switch to the correct channel and perform
7197    /// any internal filtering/timing operations required to join the BSS.
7198    /// For client STAs, this is the first step before authenticating.
7199    ///
7200    /// Common errors include: \
7201    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given bss config.
7202    JoinBss {
7203        join_request: fidl_fuchsia_wlan_common::JoinBssRequest,
7204        responder: WlanSoftmacBridgeJoinBssResponder,
7205    },
7206    /// Enables hardware Beaconing.
7207    ///
7208    /// This method cannot be called while beaconing is enabled and so
7209    /// `DisableBeaconing` must be called prior to this method if beaconing is
7210    /// enabled.
7211    ///
7212    /// All request fields are required.
7213    ///
7214    /// Common errors include:
7215    ///
7216    /// - `ZX_ERR_NOT_SUPPORTED`: The device does not support hardware beacons.
7217    /// - `ZX_ERR_INVALID_ARGS`: The device cannot transmit the requested
7218    ///                          beacon.
7219    /// - `ZX_ERR_BAD_STATE`: The device is already beaconing.
7220    EnableBeaconing {
7221        payload: WlanSoftmacBaseEnableBeaconingRequest,
7222        responder: WlanSoftmacBridgeEnableBeaconingResponder,
7223    },
7224    /// Disables hardware beaconing.
7225    DisableBeaconing { responder: WlanSoftmacBridgeDisableBeaconingResponder },
7226    /// Install a key for encryption when transmitting or receiving protected
7227    /// frames.
7228    ///
7229    /// Common errors include:
7230    ///   ZX_ERR_INVALID_ARGS: The given config does not specify a valid key.
7231    ///   ZX_ERR_NOT_SUPPORTED: The device does not support the given cipher.
7232    InstallKey { payload: WlanKeyConfiguration, responder: WlanSoftmacBridgeInstallKeyResponder },
7233    /// Notifies the device of a successful association and configures
7234    /// additional parameters necessary to participate in that association.
7235    ///
7236    /// # Errors
7237    ///
7238    /// Common errors include:
7239    ///
7240    /// - `ZX_ERR_BAD_STATE`: The device was not previously informed of this BSS
7241    ///                       via `WlanSoftmac.JoinBss`.
7242    NotifyAssociationComplete {
7243        assoc_cfg: WlanAssociationConfig,
7244        responder: WlanSoftmacBridgeNotifyAssociationCompleteResponder,
7245    },
7246    /// Notifies MAC and PHY that the peer has been de-associated.
7247    ClearAssociation {
7248        payload: WlanSoftmacBaseClearAssociationRequest,
7249        responder: WlanSoftmacBridgeClearAssociationResponder,
7250    },
7251    /// Starts a passive scan. The server will deliver scan results
7252    /// as Beacon frames using WlanSoftmacIfc.Recv(). When complete,
7253    /// the server will call WlanSoftmacIfc.ScanComplete() with the
7254    /// same `scan_id` returned by StartPassiveScan().
7255    ///
7256    /// The server indicates support for `StartPassiveScan()` using
7257    /// `fuchsia.wlan.common/ScanOffloadExtension.supported`.
7258    ///
7259    /// Common errors include:
7260    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
7261    ///       requested scan, e.g. because an incompatible channel was requested.
7262    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
7263    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
7264    StartPassiveScan {
7265        payload: WlanSoftmacBaseStartPassiveScanRequest,
7266        responder: WlanSoftmacBridgeStartPassiveScanResponder,
7267    },
7268    /// Starts an active scan. The server will deliver scan results
7269    /// as Beacon or Probe Response frames using WlanSoftmacIfc.Recv().
7270    /// When complete, the server will call WlanSoftmacIfc.ScanComplete()
7271    /// with the same `scan_id` returned by StartActiveScan().
7272    ///
7273    /// A device driver indicates support for `StartActiveScan()` using
7274    /// `fuchsia.wlan.common/ProbeRequestOffloadExtension.supported`.
7275    ///
7276    /// Common errors include:
7277    ///   ZX_ERR_INVALID_ARGS: The device is not capable of performing the
7278    ///       requested scan, e.g. because an incompatible channel was requested.
7279    ///   ZX_ERR_UNAVAILABLE: The device cannot currently perform scans.
7280    ///   ZX_ERR_SHOULD_WAIT: Another scan is already in-progress.
7281    StartActiveScan {
7282        payload: WlanSoftmacStartActiveScanRequest,
7283        responder: WlanSoftmacBridgeStartActiveScanResponder,
7284    },
7285    /// Cancels the ongoing scan corresponding to `scan_id`,
7286    /// where `scan_id` is an identifier returned by
7287    /// `StartPassiveScan()` or `StartActiveScan()`. If cancellation succeeds,
7288    /// the server will soon call WlanSoftmacIfc.ScanComplete() with the same
7289    /// `scan_id`.
7290    ///
7291    /// A device driver indicates support for `CancelScan()` using
7292    /// `fuchsia.wlan.common/ScanOffloadExtension.scan_cancel_supported`.
7293    ///
7294    /// Common errors include:
7295    ///
7296    /// - `ZX_ERR_NOT_FOUND`: `scan_id` does not match an ongoing scan.
7297    /// - `ZX_ERR_NOT_SUPPORTED`: Server does not support scan cancellation.
7298    CancelScan {
7299        payload: WlanSoftmacBaseCancelScanRequest,
7300        responder: WlanSoftmacBridgeCancelScanResponder,
7301    },
7302    /// Indicate the device of modified WiFi Multimedia (WMM) parameters for a
7303    /// particular access category (AC).
7304    UpdateWmmParameters {
7305        payload: WlanSoftmacBaseUpdateWmmParametersRequest,
7306        responder: WlanSoftmacBridgeUpdateWmmParametersResponder,
7307    },
7308    /// Signal to the server that the MLME for the iface is ready to send and receive
7309    /// frames.
7310    ///
7311    /// The client provides the following arguments:
7312    ///
7313    ///   - `ifc_bridge`: The client end of a `WlanSoftmacIfcBridge` server which the
7314    ///     `wlansoftmac` driver will use to forward `WlanSoftmacIfc` events to
7315    ///     the bridged driver.
7316    ///   - `ethernet_tx`: A `ethernet_tx_t*` casted to a `uint64`. The
7317    ///     `ethernet_tx_t` is defined in
7318    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
7319    ///   - `wlan_rx`: A `wlan_rx_t*` casted to a `uint64`. The
7320    ///     `wlan_rx_t` is defined in
7321    ///     `//src/connectivity/wlan/drivers/wlansoftmac/rust_driver/c-binding/bindings.h`.
7322    ///
7323    /// The server must copy the contents of `ethernet_tx_t` and `wlan_rx_t` before
7324    /// returning from this method. The lifetimes of `ethernet_tx_t*` and `wlan_rx_t*` are only as
7325    /// long as this method call, but the contents of `ethernet_tx_t` and `wlan_rx_t` will
7326    /// live until the server stops the MLME.
7327    ///
7328    /// The server returns a server end of a `fuchsia.wlan.mlme/MLME` protocol. The SME
7329    /// for the iface owns the client end. Thus, this channel is used for SME <-> MLME
7330    /// communication.
7331    ///
7332    /// The `WlanSoftmacBridge.Start` method is different from `WlanSoftmac.Start`
7333    /// for two reasons. First, Rust bindings do not exist for Driver transported
7334    /// protocols, so `WlanSoftmacIfcBridge` protocol must be Zircon transported to be
7335    /// usable by the bridged driver. Second, the Zircon transport adds
7336    /// significant latency compared to the Driver transport. As a result, the
7337    /// `ethernet_tx` and `wlan_rx` arguments provide an FFI for the wlansoftmac driver
7338    /// to send Ethernet and receive WLAN packets to the bridged driver with
7339    /// latency comparable or better than a Driver transported protocol.
7340    ///
7341    /// Except where noted, `WlanSoftmacBridge` methods must only be called after
7342    /// a successful call to `WlanSoftmacBridge.Start`.
7343    ///
7344    /// Common errors include:
7345    ///
7346    ///   - `ZX_ERR_ALREADY_BOUND`: `Start` was already called on this softmac.
7347    Start {
7348        ifc_bridge: fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
7349        ethernet_tx: u64,
7350        wlan_rx: u64,
7351        responder: WlanSoftmacBridgeStartResponder,
7352    },
7353    /// Forwards a status containing `ETHERNET_STATUS_*` flags to the
7354    /// `fuchsia.hardware.ethernet/EthernetImplIfc` proxy owned by
7355    /// the C++ portion of wlansoftmac.
7356    ///
7357    /// As documented, the value of `status` is set by bits defined in
7358    /// `ETHERNET_STATUS_*` flags. However, there is only one flag named
7359    /// `ETHERNET_STATUS_ONLINE` and no specification of for the meaning
7360    /// of specifying no flags. In practice, `0x1` means the status is up,
7361    /// and `0x0` means the status is down.
7362    ///
7363    /// While this method should belong in something like an
7364    /// "`EthernetImplIfcBridge` protocol", it's included in the
7365    /// `WlanSoftmacBridge` protocol as a convenience. The wlansoftmac driver
7366    /// will eventually cease using a `fuchsia.hardware.ethernet/EthernetImplIfc`
7367    /// proxy and use a `fuchsia.hardware.network.driver/NetworkDeviceIfc`
7368    /// proxy instead. At that time, an equivalent of this method should be
7369    /// refactored into a separate bridge.
7370    SetEthernetStatus { status: u32, responder: WlanSoftmacBridgeSetEthernetStatusResponder },
7371}
7372
7373impl WlanSoftmacBridgeRequest {
7374    #[allow(irrefutable_let_patterns)]
7375    pub fn into_query(self) -> Option<(WlanSoftmacBridgeQueryResponder)> {
7376        if let WlanSoftmacBridgeRequest::Query { responder } = self {
7377            Some((responder))
7378        } else {
7379            None
7380        }
7381    }
7382
7383    #[allow(irrefutable_let_patterns)]
7384    pub fn into_query_discovery_support(
7385        self,
7386    ) -> Option<(WlanSoftmacBridgeQueryDiscoverySupportResponder)> {
7387        if let WlanSoftmacBridgeRequest::QueryDiscoverySupport { responder } = self {
7388            Some((responder))
7389        } else {
7390            None
7391        }
7392    }
7393
7394    #[allow(irrefutable_let_patterns)]
7395    pub fn into_query_mac_sublayer_support(
7396        self,
7397    ) -> Option<(WlanSoftmacBridgeQueryMacSublayerSupportResponder)> {
7398        if let WlanSoftmacBridgeRequest::QueryMacSublayerSupport { responder } = self {
7399            Some((responder))
7400        } else {
7401            None
7402        }
7403    }
7404
7405    #[allow(irrefutable_let_patterns)]
7406    pub fn into_query_security_support(
7407        self,
7408    ) -> Option<(WlanSoftmacBridgeQuerySecuritySupportResponder)> {
7409        if let WlanSoftmacBridgeRequest::QuerySecuritySupport { responder } = self {
7410            Some((responder))
7411        } else {
7412            None
7413        }
7414    }
7415
7416    #[allow(irrefutable_let_patterns)]
7417    pub fn into_query_spectrum_management_support(
7418        self,
7419    ) -> Option<(WlanSoftmacBridgeQuerySpectrumManagementSupportResponder)> {
7420        if let WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport { responder } = self {
7421            Some((responder))
7422        } else {
7423            None
7424        }
7425    }
7426
7427    #[allow(irrefutable_let_patterns)]
7428    pub fn into_set_channel(
7429        self,
7430    ) -> Option<(WlanSoftmacBaseSetChannelRequest, WlanSoftmacBridgeSetChannelResponder)> {
7431        if let WlanSoftmacBridgeRequest::SetChannel { payload, responder } = self {
7432            Some((payload, responder))
7433        } else {
7434            None
7435        }
7436    }
7437
7438    #[allow(irrefutable_let_patterns)]
7439    pub fn into_join_bss(
7440        self,
7441    ) -> Option<(fidl_fuchsia_wlan_common::JoinBssRequest, WlanSoftmacBridgeJoinBssResponder)> {
7442        if let WlanSoftmacBridgeRequest::JoinBss { join_request, responder } = self {
7443            Some((join_request, responder))
7444        } else {
7445            None
7446        }
7447    }
7448
7449    #[allow(irrefutable_let_patterns)]
7450    pub fn into_enable_beaconing(
7451        self,
7452    ) -> Option<(WlanSoftmacBaseEnableBeaconingRequest, WlanSoftmacBridgeEnableBeaconingResponder)>
7453    {
7454        if let WlanSoftmacBridgeRequest::EnableBeaconing { payload, responder } = self {
7455            Some((payload, responder))
7456        } else {
7457            None
7458        }
7459    }
7460
7461    #[allow(irrefutable_let_patterns)]
7462    pub fn into_disable_beaconing(self) -> Option<(WlanSoftmacBridgeDisableBeaconingResponder)> {
7463        if let WlanSoftmacBridgeRequest::DisableBeaconing { responder } = self {
7464            Some((responder))
7465        } else {
7466            None
7467        }
7468    }
7469
7470    #[allow(irrefutable_let_patterns)]
7471    pub fn into_install_key(
7472        self,
7473    ) -> Option<(WlanKeyConfiguration, WlanSoftmacBridgeInstallKeyResponder)> {
7474        if let WlanSoftmacBridgeRequest::InstallKey { payload, responder } = self {
7475            Some((payload, responder))
7476        } else {
7477            None
7478        }
7479    }
7480
7481    #[allow(irrefutable_let_patterns)]
7482    pub fn into_notify_association_complete(
7483        self,
7484    ) -> Option<(WlanAssociationConfig, WlanSoftmacBridgeNotifyAssociationCompleteResponder)> {
7485        if let WlanSoftmacBridgeRequest::NotifyAssociationComplete { assoc_cfg, responder } = self {
7486            Some((assoc_cfg, responder))
7487        } else {
7488            None
7489        }
7490    }
7491
7492    #[allow(irrefutable_let_patterns)]
7493    pub fn into_clear_association(
7494        self,
7495    ) -> Option<(WlanSoftmacBaseClearAssociationRequest, WlanSoftmacBridgeClearAssociationResponder)>
7496    {
7497        if let WlanSoftmacBridgeRequest::ClearAssociation { payload, responder } = self {
7498            Some((payload, responder))
7499        } else {
7500            None
7501        }
7502    }
7503
7504    #[allow(irrefutable_let_patterns)]
7505    pub fn into_start_passive_scan(
7506        self,
7507    ) -> Option<(WlanSoftmacBaseStartPassiveScanRequest, WlanSoftmacBridgeStartPassiveScanResponder)>
7508    {
7509        if let WlanSoftmacBridgeRequest::StartPassiveScan { payload, responder } = self {
7510            Some((payload, responder))
7511        } else {
7512            None
7513        }
7514    }
7515
7516    #[allow(irrefutable_let_patterns)]
7517    pub fn into_start_active_scan(
7518        self,
7519    ) -> Option<(WlanSoftmacStartActiveScanRequest, WlanSoftmacBridgeStartActiveScanResponder)>
7520    {
7521        if let WlanSoftmacBridgeRequest::StartActiveScan { payload, responder } = self {
7522            Some((payload, responder))
7523        } else {
7524            None
7525        }
7526    }
7527
7528    #[allow(irrefutable_let_patterns)]
7529    pub fn into_cancel_scan(
7530        self,
7531    ) -> Option<(WlanSoftmacBaseCancelScanRequest, WlanSoftmacBridgeCancelScanResponder)> {
7532        if let WlanSoftmacBridgeRequest::CancelScan { payload, responder } = self {
7533            Some((payload, responder))
7534        } else {
7535            None
7536        }
7537    }
7538
7539    #[allow(irrefutable_let_patterns)]
7540    pub fn into_update_wmm_parameters(
7541        self,
7542    ) -> Option<(
7543        WlanSoftmacBaseUpdateWmmParametersRequest,
7544        WlanSoftmacBridgeUpdateWmmParametersResponder,
7545    )> {
7546        if let WlanSoftmacBridgeRequest::UpdateWmmParameters { payload, responder } = self {
7547            Some((payload, responder))
7548        } else {
7549            None
7550        }
7551    }
7552
7553    #[allow(irrefutable_let_patterns)]
7554    pub fn into_start(
7555        self,
7556    ) -> Option<(
7557        fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
7558        u64,
7559        u64,
7560        WlanSoftmacBridgeStartResponder,
7561    )> {
7562        if let WlanSoftmacBridgeRequest::Start { ifc_bridge, ethernet_tx, wlan_rx, responder } =
7563            self
7564        {
7565            Some((ifc_bridge, ethernet_tx, wlan_rx, responder))
7566        } else {
7567            None
7568        }
7569    }
7570
7571    #[allow(irrefutable_let_patterns)]
7572    pub fn into_set_ethernet_status(
7573        self,
7574    ) -> Option<(u32, WlanSoftmacBridgeSetEthernetStatusResponder)> {
7575        if let WlanSoftmacBridgeRequest::SetEthernetStatus { status, responder } = self {
7576            Some((status, responder))
7577        } else {
7578            None
7579        }
7580    }
7581
7582    /// Name of the method defined in FIDL
7583    pub fn method_name(&self) -> &'static str {
7584        match *self {
7585            WlanSoftmacBridgeRequest::Query { .. } => "query",
7586            WlanSoftmacBridgeRequest::QueryDiscoverySupport { .. } => "query_discovery_support",
7587            WlanSoftmacBridgeRequest::QueryMacSublayerSupport { .. } => {
7588                "query_mac_sublayer_support"
7589            }
7590            WlanSoftmacBridgeRequest::QuerySecuritySupport { .. } => "query_security_support",
7591            WlanSoftmacBridgeRequest::QuerySpectrumManagementSupport { .. } => {
7592                "query_spectrum_management_support"
7593            }
7594            WlanSoftmacBridgeRequest::SetChannel { .. } => "set_channel",
7595            WlanSoftmacBridgeRequest::JoinBss { .. } => "join_bss",
7596            WlanSoftmacBridgeRequest::EnableBeaconing { .. } => "enable_beaconing",
7597            WlanSoftmacBridgeRequest::DisableBeaconing { .. } => "disable_beaconing",
7598            WlanSoftmacBridgeRequest::InstallKey { .. } => "install_key",
7599            WlanSoftmacBridgeRequest::NotifyAssociationComplete { .. } => {
7600                "notify_association_complete"
7601            }
7602            WlanSoftmacBridgeRequest::ClearAssociation { .. } => "clear_association",
7603            WlanSoftmacBridgeRequest::StartPassiveScan { .. } => "start_passive_scan",
7604            WlanSoftmacBridgeRequest::StartActiveScan { .. } => "start_active_scan",
7605            WlanSoftmacBridgeRequest::CancelScan { .. } => "cancel_scan",
7606            WlanSoftmacBridgeRequest::UpdateWmmParameters { .. } => "update_wmm_parameters",
7607            WlanSoftmacBridgeRequest::Start { .. } => "start",
7608            WlanSoftmacBridgeRequest::SetEthernetStatus { .. } => "set_ethernet_status",
7609        }
7610    }
7611}
7612
7613#[derive(Debug, Clone)]
7614pub struct WlanSoftmacBridgeControlHandle {
7615    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
7616}
7617
7618impl fidl::endpoints::ControlHandle for WlanSoftmacBridgeControlHandle {
7619    fn shutdown(&self) {
7620        self.inner.shutdown()
7621    }
7622    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
7623        self.inner.shutdown_with_epitaph(status)
7624    }
7625
7626    fn is_closed(&self) -> bool {
7627        self.inner.channel().is_closed()
7628    }
7629    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
7630        self.inner.channel().on_closed()
7631    }
7632
7633    #[cfg(target_os = "fuchsia")]
7634    fn signal_peer(
7635        &self,
7636        clear_mask: zx::Signals,
7637        set_mask: zx::Signals,
7638    ) -> Result<(), zx_status::Status> {
7639        use fidl::Peered;
7640        self.inner.channel().signal_peer(clear_mask, set_mask)
7641    }
7642}
7643
7644impl WlanSoftmacBridgeControlHandle {}
7645
7646#[must_use = "FIDL methods require a response to be sent"]
7647#[derive(Debug)]
7648pub struct WlanSoftmacBridgeQueryResponder {
7649    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7650    tx_id: u32,
7651}
7652
7653/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7654/// if the responder is dropped without sending a response, so that the client
7655/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7656impl std::ops::Drop for WlanSoftmacBridgeQueryResponder {
7657    fn drop(&mut self) {
7658        self.control_handle.shutdown();
7659        // Safety: drops once, never accessed again
7660        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7661    }
7662}
7663
7664impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryResponder {
7665    type ControlHandle = WlanSoftmacBridgeControlHandle;
7666
7667    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7668        &self.control_handle
7669    }
7670
7671    fn drop_without_shutdown(mut self) {
7672        // Safety: drops once, never accessed again due to mem::forget
7673        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7674        // Prevent Drop from running (which would shut down the channel)
7675        std::mem::forget(self);
7676    }
7677}
7678
7679impl WlanSoftmacBridgeQueryResponder {
7680    /// Sends a response to the FIDL transaction.
7681    ///
7682    /// Sets the channel to shutdown if an error occurs.
7683    pub fn send(
7684        self,
7685        mut result: Result<&WlanSoftmacQueryResponse, i32>,
7686    ) -> Result<(), fidl::Error> {
7687        let _result = self.send_raw(result);
7688        if _result.is_err() {
7689            self.control_handle.shutdown();
7690        }
7691        self.drop_without_shutdown();
7692        _result
7693    }
7694
7695    /// Similar to "send" but does not shutdown the channel if an error occurs.
7696    pub fn send_no_shutdown_on_err(
7697        self,
7698        mut result: Result<&WlanSoftmacQueryResponse, i32>,
7699    ) -> Result<(), fidl::Error> {
7700        let _result = self.send_raw(result);
7701        self.drop_without_shutdown();
7702        _result
7703    }
7704
7705    fn send_raw(
7706        &self,
7707        mut result: Result<&WlanSoftmacQueryResponse, i32>,
7708    ) -> Result<(), fidl::Error> {
7709        self.control_handle.inner.send::<fidl::encoding::ResultType<WlanSoftmacQueryResponse, i32>>(
7710            result,
7711            self.tx_id,
7712            0x18231a638e508f9d,
7713            fidl::encoding::DynamicFlags::empty(),
7714        )
7715    }
7716}
7717
7718#[must_use = "FIDL methods require a response to be sent"]
7719#[derive(Debug)]
7720pub struct WlanSoftmacBridgeQueryDiscoverySupportResponder {
7721    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7722    tx_id: u32,
7723}
7724
7725/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7726/// if the responder is dropped without sending a response, so that the client
7727/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7728impl std::ops::Drop for WlanSoftmacBridgeQueryDiscoverySupportResponder {
7729    fn drop(&mut self) {
7730        self.control_handle.shutdown();
7731        // Safety: drops once, never accessed again
7732        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7733    }
7734}
7735
7736impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryDiscoverySupportResponder {
7737    type ControlHandle = WlanSoftmacBridgeControlHandle;
7738
7739    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7740        &self.control_handle
7741    }
7742
7743    fn drop_without_shutdown(mut self) {
7744        // Safety: drops once, never accessed again due to mem::forget
7745        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7746        // Prevent Drop from running (which would shut down the channel)
7747        std::mem::forget(self);
7748    }
7749}
7750
7751impl WlanSoftmacBridgeQueryDiscoverySupportResponder {
7752    /// Sends a response to the FIDL transaction.
7753    ///
7754    /// Sets the channel to shutdown if an error occurs.
7755    pub fn send(
7756        self,
7757        mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
7758    ) -> Result<(), fidl::Error> {
7759        let _result = self.send_raw(result);
7760        if _result.is_err() {
7761            self.control_handle.shutdown();
7762        }
7763        self.drop_without_shutdown();
7764        _result
7765    }
7766
7767    /// Similar to "send" but does not shutdown the channel if an error occurs.
7768    pub fn send_no_shutdown_on_err(
7769        self,
7770        mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
7771    ) -> Result<(), fidl::Error> {
7772        let _result = self.send_raw(result);
7773        self.drop_without_shutdown();
7774        _result
7775    }
7776
7777    fn send_raw(
7778        &self,
7779        mut result: Result<&fidl_fuchsia_wlan_common::DiscoverySupport, i32>,
7780    ) -> Result<(), fidl::Error> {
7781        self.control_handle.inner.send::<fidl::encoding::ResultType<
7782            WlanSoftmacBaseQueryDiscoverySupportResponse,
7783            i32,
7784        >>(
7785            result.map(|resp| (resp,)),
7786            self.tx_id,
7787            0x16797affc0cb58ae,
7788            fidl::encoding::DynamicFlags::empty(),
7789        )
7790    }
7791}
7792
7793#[must_use = "FIDL methods require a response to be sent"]
7794#[derive(Debug)]
7795pub struct WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7796    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7797    tx_id: u32,
7798}
7799
7800/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7801/// if the responder is dropped without sending a response, so that the client
7802/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7803impl std::ops::Drop for WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7804    fn drop(&mut self) {
7805        self.control_handle.shutdown();
7806        // Safety: drops once, never accessed again
7807        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7808    }
7809}
7810
7811impl fidl::endpoints::Responder for WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7812    type ControlHandle = WlanSoftmacBridgeControlHandle;
7813
7814    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7815        &self.control_handle
7816    }
7817
7818    fn drop_without_shutdown(mut self) {
7819        // Safety: drops once, never accessed again due to mem::forget
7820        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7821        // Prevent Drop from running (which would shut down the channel)
7822        std::mem::forget(self);
7823    }
7824}
7825
7826impl WlanSoftmacBridgeQueryMacSublayerSupportResponder {
7827    /// Sends a response to the FIDL transaction.
7828    ///
7829    /// Sets the channel to shutdown if an error occurs.
7830    pub fn send(
7831        self,
7832        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
7833    ) -> Result<(), fidl::Error> {
7834        let _result = self.send_raw(result);
7835        if _result.is_err() {
7836            self.control_handle.shutdown();
7837        }
7838        self.drop_without_shutdown();
7839        _result
7840    }
7841
7842    /// Similar to "send" but does not shutdown the channel if an error occurs.
7843    pub fn send_no_shutdown_on_err(
7844        self,
7845        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
7846    ) -> Result<(), fidl::Error> {
7847        let _result = self.send_raw(result);
7848        self.drop_without_shutdown();
7849        _result
7850    }
7851
7852    fn send_raw(
7853        &self,
7854        mut result: Result<&fidl_fuchsia_wlan_common::MacSublayerSupport, i32>,
7855    ) -> Result<(), fidl::Error> {
7856        self.control_handle.inner.send::<fidl::encoding::ResultType<
7857            WlanSoftmacBaseQueryMacSublayerSupportResponse,
7858            i32,
7859        >>(
7860            result.map(|resp| (resp,)),
7861            self.tx_id,
7862            0x7302c3f8c131f075,
7863            fidl::encoding::DynamicFlags::empty(),
7864        )
7865    }
7866}
7867
7868#[must_use = "FIDL methods require a response to be sent"]
7869#[derive(Debug)]
7870pub struct WlanSoftmacBridgeQuerySecuritySupportResponder {
7871    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7872    tx_id: u32,
7873}
7874
7875/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7876/// if the responder is dropped without sending a response, so that the client
7877/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7878impl std::ops::Drop for WlanSoftmacBridgeQuerySecuritySupportResponder {
7879    fn drop(&mut self) {
7880        self.control_handle.shutdown();
7881        // Safety: drops once, never accessed again
7882        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7883    }
7884}
7885
7886impl fidl::endpoints::Responder for WlanSoftmacBridgeQuerySecuritySupportResponder {
7887    type ControlHandle = WlanSoftmacBridgeControlHandle;
7888
7889    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7890        &self.control_handle
7891    }
7892
7893    fn drop_without_shutdown(mut self) {
7894        // Safety: drops once, never accessed again due to mem::forget
7895        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7896        // Prevent Drop from running (which would shut down the channel)
7897        std::mem::forget(self);
7898    }
7899}
7900
7901impl WlanSoftmacBridgeQuerySecuritySupportResponder {
7902    /// Sends a response to the FIDL transaction.
7903    ///
7904    /// Sets the channel to shutdown if an error occurs.
7905    pub fn send(
7906        self,
7907        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
7908    ) -> Result<(), fidl::Error> {
7909        let _result = self.send_raw(result);
7910        if _result.is_err() {
7911            self.control_handle.shutdown();
7912        }
7913        self.drop_without_shutdown();
7914        _result
7915    }
7916
7917    /// Similar to "send" but does not shutdown the channel if an error occurs.
7918    pub fn send_no_shutdown_on_err(
7919        self,
7920        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
7921    ) -> Result<(), fidl::Error> {
7922        let _result = self.send_raw(result);
7923        self.drop_without_shutdown();
7924        _result
7925    }
7926
7927    fn send_raw(
7928        &self,
7929        mut result: Result<&fidl_fuchsia_wlan_common::SecuritySupport, i32>,
7930    ) -> Result<(), fidl::Error> {
7931        self.control_handle.inner.send::<fidl::encoding::ResultType<
7932            WlanSoftmacBaseQuerySecuritySupportResponse,
7933            i32,
7934        >>(
7935            result.map(|resp| (resp,)),
7936            self.tx_id,
7937            0x3691bb75abf6354,
7938            fidl::encoding::DynamicFlags::empty(),
7939        )
7940    }
7941}
7942
7943#[must_use = "FIDL methods require a response to be sent"]
7944#[derive(Debug)]
7945pub struct WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7946    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
7947    tx_id: u32,
7948}
7949
7950/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
7951/// if the responder is dropped without sending a response, so that the client
7952/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
7953impl std::ops::Drop for WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7954    fn drop(&mut self) {
7955        self.control_handle.shutdown();
7956        // Safety: drops once, never accessed again
7957        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7958    }
7959}
7960
7961impl fidl::endpoints::Responder for WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7962    type ControlHandle = WlanSoftmacBridgeControlHandle;
7963
7964    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
7965        &self.control_handle
7966    }
7967
7968    fn drop_without_shutdown(mut self) {
7969        // Safety: drops once, never accessed again due to mem::forget
7970        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
7971        // Prevent Drop from running (which would shut down the channel)
7972        std::mem::forget(self);
7973    }
7974}
7975
7976impl WlanSoftmacBridgeQuerySpectrumManagementSupportResponder {
7977    /// Sends a response to the FIDL transaction.
7978    ///
7979    /// Sets the channel to shutdown if an error occurs.
7980    pub fn send(
7981        self,
7982        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
7983    ) -> Result<(), fidl::Error> {
7984        let _result = self.send_raw(result);
7985        if _result.is_err() {
7986            self.control_handle.shutdown();
7987        }
7988        self.drop_without_shutdown();
7989        _result
7990    }
7991
7992    /// Similar to "send" but does not shutdown the channel if an error occurs.
7993    pub fn send_no_shutdown_on_err(
7994        self,
7995        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
7996    ) -> Result<(), fidl::Error> {
7997        let _result = self.send_raw(result);
7998        self.drop_without_shutdown();
7999        _result
8000    }
8001
8002    fn send_raw(
8003        &self,
8004        mut result: Result<&fidl_fuchsia_wlan_common::SpectrumManagementSupport, i32>,
8005    ) -> Result<(), fidl::Error> {
8006        self.control_handle.inner.send::<fidl::encoding::ResultType<
8007            WlanSoftmacBaseQuerySpectrumManagementSupportResponse,
8008            i32,
8009        >>(
8010            result.map(|resp| (resp,)),
8011            self.tx_id,
8012            0x347d78dc1d4d27bf,
8013            fidl::encoding::DynamicFlags::empty(),
8014        )
8015    }
8016}
8017
8018#[must_use = "FIDL methods require a response to be sent"]
8019#[derive(Debug)]
8020pub struct WlanSoftmacBridgeSetChannelResponder {
8021    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8022    tx_id: u32,
8023}
8024
8025/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8026/// if the responder is dropped without sending a response, so that the client
8027/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8028impl std::ops::Drop for WlanSoftmacBridgeSetChannelResponder {
8029    fn drop(&mut self) {
8030        self.control_handle.shutdown();
8031        // Safety: drops once, never accessed again
8032        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8033    }
8034}
8035
8036impl fidl::endpoints::Responder for WlanSoftmacBridgeSetChannelResponder {
8037    type ControlHandle = WlanSoftmacBridgeControlHandle;
8038
8039    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8040        &self.control_handle
8041    }
8042
8043    fn drop_without_shutdown(mut self) {
8044        // Safety: drops once, never accessed again due to mem::forget
8045        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8046        // Prevent Drop from running (which would shut down the channel)
8047        std::mem::forget(self);
8048    }
8049}
8050
8051impl WlanSoftmacBridgeSetChannelResponder {
8052    /// Sends a response to the FIDL transaction.
8053    ///
8054    /// Sets the channel to shutdown if an error occurs.
8055    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8056        let _result = self.send_raw(result);
8057        if _result.is_err() {
8058            self.control_handle.shutdown();
8059        }
8060        self.drop_without_shutdown();
8061        _result
8062    }
8063
8064    /// Similar to "send" but does not shutdown the channel if an error occurs.
8065    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8066        let _result = self.send_raw(result);
8067        self.drop_without_shutdown();
8068        _result
8069    }
8070
8071    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8072        self.control_handle
8073            .inner
8074            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8075                result,
8076                self.tx_id,
8077                0x12836b533cd63ece,
8078                fidl::encoding::DynamicFlags::empty(),
8079            )
8080    }
8081}
8082
8083#[must_use = "FIDL methods require a response to be sent"]
8084#[derive(Debug)]
8085pub struct WlanSoftmacBridgeJoinBssResponder {
8086    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8087    tx_id: u32,
8088}
8089
8090/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8091/// if the responder is dropped without sending a response, so that the client
8092/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8093impl std::ops::Drop for WlanSoftmacBridgeJoinBssResponder {
8094    fn drop(&mut self) {
8095        self.control_handle.shutdown();
8096        // Safety: drops once, never accessed again
8097        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8098    }
8099}
8100
8101impl fidl::endpoints::Responder for WlanSoftmacBridgeJoinBssResponder {
8102    type ControlHandle = WlanSoftmacBridgeControlHandle;
8103
8104    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8105        &self.control_handle
8106    }
8107
8108    fn drop_without_shutdown(mut self) {
8109        // Safety: drops once, never accessed again due to mem::forget
8110        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8111        // Prevent Drop from running (which would shut down the channel)
8112        std::mem::forget(self);
8113    }
8114}
8115
8116impl WlanSoftmacBridgeJoinBssResponder {
8117    /// Sends a response to the FIDL transaction.
8118    ///
8119    /// Sets the channel to shutdown if an error occurs.
8120    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8121        let _result = self.send_raw(result);
8122        if _result.is_err() {
8123            self.control_handle.shutdown();
8124        }
8125        self.drop_without_shutdown();
8126        _result
8127    }
8128
8129    /// Similar to "send" but does not shutdown the channel if an error occurs.
8130    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8131        let _result = self.send_raw(result);
8132        self.drop_without_shutdown();
8133        _result
8134    }
8135
8136    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8137        self.control_handle
8138            .inner
8139            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8140                result,
8141                self.tx_id,
8142                0x1336fb5455b77a6e,
8143                fidl::encoding::DynamicFlags::empty(),
8144            )
8145    }
8146}
8147
8148#[must_use = "FIDL methods require a response to be sent"]
8149#[derive(Debug)]
8150pub struct WlanSoftmacBridgeEnableBeaconingResponder {
8151    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8152    tx_id: u32,
8153}
8154
8155/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8156/// if the responder is dropped without sending a response, so that the client
8157/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8158impl std::ops::Drop for WlanSoftmacBridgeEnableBeaconingResponder {
8159    fn drop(&mut self) {
8160        self.control_handle.shutdown();
8161        // Safety: drops once, never accessed again
8162        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8163    }
8164}
8165
8166impl fidl::endpoints::Responder for WlanSoftmacBridgeEnableBeaconingResponder {
8167    type ControlHandle = WlanSoftmacBridgeControlHandle;
8168
8169    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8170        &self.control_handle
8171    }
8172
8173    fn drop_without_shutdown(mut self) {
8174        // Safety: drops once, never accessed again due to mem::forget
8175        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8176        // Prevent Drop from running (which would shut down the channel)
8177        std::mem::forget(self);
8178    }
8179}
8180
8181impl WlanSoftmacBridgeEnableBeaconingResponder {
8182    /// Sends a response to the FIDL transaction.
8183    ///
8184    /// Sets the channel to shutdown if an error occurs.
8185    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8186        let _result = self.send_raw(result);
8187        if _result.is_err() {
8188            self.control_handle.shutdown();
8189        }
8190        self.drop_without_shutdown();
8191        _result
8192    }
8193
8194    /// Similar to "send" but does not shutdown the channel if an error occurs.
8195    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8196        let _result = self.send_raw(result);
8197        self.drop_without_shutdown();
8198        _result
8199    }
8200
8201    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8202        self.control_handle
8203            .inner
8204            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8205                result,
8206                self.tx_id,
8207                0x6c35807632c64576,
8208                fidl::encoding::DynamicFlags::empty(),
8209            )
8210    }
8211}
8212
8213#[must_use = "FIDL methods require a response to be sent"]
8214#[derive(Debug)]
8215pub struct WlanSoftmacBridgeDisableBeaconingResponder {
8216    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8217    tx_id: u32,
8218}
8219
8220/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8221/// if the responder is dropped without sending a response, so that the client
8222/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8223impl std::ops::Drop for WlanSoftmacBridgeDisableBeaconingResponder {
8224    fn drop(&mut self) {
8225        self.control_handle.shutdown();
8226        // Safety: drops once, never accessed again
8227        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8228    }
8229}
8230
8231impl fidl::endpoints::Responder for WlanSoftmacBridgeDisableBeaconingResponder {
8232    type ControlHandle = WlanSoftmacBridgeControlHandle;
8233
8234    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8235        &self.control_handle
8236    }
8237
8238    fn drop_without_shutdown(mut self) {
8239        // Safety: drops once, never accessed again due to mem::forget
8240        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8241        // Prevent Drop from running (which would shut down the channel)
8242        std::mem::forget(self);
8243    }
8244}
8245
8246impl WlanSoftmacBridgeDisableBeaconingResponder {
8247    /// Sends a response to the FIDL transaction.
8248    ///
8249    /// Sets the channel to shutdown if an error occurs.
8250    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8251        let _result = self.send_raw(result);
8252        if _result.is_err() {
8253            self.control_handle.shutdown();
8254        }
8255        self.drop_without_shutdown();
8256        _result
8257    }
8258
8259    /// Similar to "send" but does not shutdown the channel if an error occurs.
8260    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8261        let _result = self.send_raw(result);
8262        self.drop_without_shutdown();
8263        _result
8264    }
8265
8266    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8267        self.control_handle
8268            .inner
8269            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8270                result,
8271                self.tx_id,
8272                0x3303b30f99dbb406,
8273                fidl::encoding::DynamicFlags::empty(),
8274            )
8275    }
8276}
8277
8278#[must_use = "FIDL methods require a response to be sent"]
8279#[derive(Debug)]
8280pub struct WlanSoftmacBridgeInstallKeyResponder {
8281    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8282    tx_id: u32,
8283}
8284
8285/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8286/// if the responder is dropped without sending a response, so that the client
8287/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8288impl std::ops::Drop for WlanSoftmacBridgeInstallKeyResponder {
8289    fn drop(&mut self) {
8290        self.control_handle.shutdown();
8291        // Safety: drops once, never accessed again
8292        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8293    }
8294}
8295
8296impl fidl::endpoints::Responder for WlanSoftmacBridgeInstallKeyResponder {
8297    type ControlHandle = WlanSoftmacBridgeControlHandle;
8298
8299    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8300        &self.control_handle
8301    }
8302
8303    fn drop_without_shutdown(mut self) {
8304        // Safety: drops once, never accessed again due to mem::forget
8305        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8306        // Prevent Drop from running (which would shut down the channel)
8307        std::mem::forget(self);
8308    }
8309}
8310
8311impl WlanSoftmacBridgeInstallKeyResponder {
8312    /// Sends a response to the FIDL transaction.
8313    ///
8314    /// Sets the channel to shutdown if an error occurs.
8315    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8316        let _result = self.send_raw(result);
8317        if _result.is_err() {
8318            self.control_handle.shutdown();
8319        }
8320        self.drop_without_shutdown();
8321        _result
8322    }
8323
8324    /// Similar to "send" but does not shutdown the channel if an error occurs.
8325    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8326        let _result = self.send_raw(result);
8327        self.drop_without_shutdown();
8328        _result
8329    }
8330
8331    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8332        self.control_handle
8333            .inner
8334            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8335                result,
8336                self.tx_id,
8337                0x7decf9b4200b9131,
8338                fidl::encoding::DynamicFlags::empty(),
8339            )
8340    }
8341}
8342
8343#[must_use = "FIDL methods require a response to be sent"]
8344#[derive(Debug)]
8345pub struct WlanSoftmacBridgeNotifyAssociationCompleteResponder {
8346    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8347    tx_id: u32,
8348}
8349
8350/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8351/// if the responder is dropped without sending a response, so that the client
8352/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8353impl std::ops::Drop for WlanSoftmacBridgeNotifyAssociationCompleteResponder {
8354    fn drop(&mut self) {
8355        self.control_handle.shutdown();
8356        // Safety: drops once, never accessed again
8357        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8358    }
8359}
8360
8361impl fidl::endpoints::Responder for WlanSoftmacBridgeNotifyAssociationCompleteResponder {
8362    type ControlHandle = WlanSoftmacBridgeControlHandle;
8363
8364    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8365        &self.control_handle
8366    }
8367
8368    fn drop_without_shutdown(mut self) {
8369        // Safety: drops once, never accessed again due to mem::forget
8370        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8371        // Prevent Drop from running (which would shut down the channel)
8372        std::mem::forget(self);
8373    }
8374}
8375
8376impl WlanSoftmacBridgeNotifyAssociationCompleteResponder {
8377    /// Sends a response to the FIDL transaction.
8378    ///
8379    /// Sets the channel to shutdown if an error occurs.
8380    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8381        let _result = self.send_raw(result);
8382        if _result.is_err() {
8383            self.control_handle.shutdown();
8384        }
8385        self.drop_without_shutdown();
8386        _result
8387    }
8388
8389    /// Similar to "send" but does not shutdown the channel if an error occurs.
8390    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8391        let _result = self.send_raw(result);
8392        self.drop_without_shutdown();
8393        _result
8394    }
8395
8396    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8397        self.control_handle
8398            .inner
8399            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8400                result,
8401                self.tx_id,
8402                0x436ffe3ba461d6cd,
8403                fidl::encoding::DynamicFlags::empty(),
8404            )
8405    }
8406}
8407
8408#[must_use = "FIDL methods require a response to be sent"]
8409#[derive(Debug)]
8410pub struct WlanSoftmacBridgeClearAssociationResponder {
8411    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8412    tx_id: u32,
8413}
8414
8415/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8416/// if the responder is dropped without sending a response, so that the client
8417/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8418impl std::ops::Drop for WlanSoftmacBridgeClearAssociationResponder {
8419    fn drop(&mut self) {
8420        self.control_handle.shutdown();
8421        // Safety: drops once, never accessed again
8422        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8423    }
8424}
8425
8426impl fidl::endpoints::Responder for WlanSoftmacBridgeClearAssociationResponder {
8427    type ControlHandle = WlanSoftmacBridgeControlHandle;
8428
8429    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8430        &self.control_handle
8431    }
8432
8433    fn drop_without_shutdown(mut self) {
8434        // Safety: drops once, never accessed again due to mem::forget
8435        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8436        // Prevent Drop from running (which would shut down the channel)
8437        std::mem::forget(self);
8438    }
8439}
8440
8441impl WlanSoftmacBridgeClearAssociationResponder {
8442    /// Sends a response to the FIDL transaction.
8443    ///
8444    /// Sets the channel to shutdown if an error occurs.
8445    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8446        let _result = self.send_raw(result);
8447        if _result.is_err() {
8448            self.control_handle.shutdown();
8449        }
8450        self.drop_without_shutdown();
8451        _result
8452    }
8453
8454    /// Similar to "send" but does not shutdown the channel if an error occurs.
8455    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8456        let _result = self.send_raw(result);
8457        self.drop_without_shutdown();
8458        _result
8459    }
8460
8461    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8462        self.control_handle
8463            .inner
8464            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8465                result,
8466                self.tx_id,
8467                0x581d76c39190a7dd,
8468                fidl::encoding::DynamicFlags::empty(),
8469            )
8470    }
8471}
8472
8473#[must_use = "FIDL methods require a response to be sent"]
8474#[derive(Debug)]
8475pub struct WlanSoftmacBridgeStartPassiveScanResponder {
8476    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8477    tx_id: u32,
8478}
8479
8480/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8481/// if the responder is dropped without sending a response, so that the client
8482/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8483impl std::ops::Drop for WlanSoftmacBridgeStartPassiveScanResponder {
8484    fn drop(&mut self) {
8485        self.control_handle.shutdown();
8486        // Safety: drops once, never accessed again
8487        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8488    }
8489}
8490
8491impl fidl::endpoints::Responder for WlanSoftmacBridgeStartPassiveScanResponder {
8492    type ControlHandle = WlanSoftmacBridgeControlHandle;
8493
8494    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8495        &self.control_handle
8496    }
8497
8498    fn drop_without_shutdown(mut self) {
8499        // Safety: drops once, never accessed again due to mem::forget
8500        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8501        // Prevent Drop from running (which would shut down the channel)
8502        std::mem::forget(self);
8503    }
8504}
8505
8506impl WlanSoftmacBridgeStartPassiveScanResponder {
8507    /// Sends a response to the FIDL transaction.
8508    ///
8509    /// Sets the channel to shutdown if an error occurs.
8510    pub fn send(
8511        self,
8512        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
8513    ) -> Result<(), fidl::Error> {
8514        let _result = self.send_raw(result);
8515        if _result.is_err() {
8516            self.control_handle.shutdown();
8517        }
8518        self.drop_without_shutdown();
8519        _result
8520    }
8521
8522    /// Similar to "send" but does not shutdown the channel if an error occurs.
8523    pub fn send_no_shutdown_on_err(
8524        self,
8525        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
8526    ) -> Result<(), fidl::Error> {
8527        let _result = self.send_raw(result);
8528        self.drop_without_shutdown();
8529        _result
8530    }
8531
8532    fn send_raw(
8533        &self,
8534        mut result: Result<&WlanSoftmacBaseStartPassiveScanResponse, i32>,
8535    ) -> Result<(), fidl::Error> {
8536        self.control_handle.inner.send::<fidl::encoding::ResultType<
8537            WlanSoftmacBaseStartPassiveScanResponse,
8538            i32,
8539        >>(
8540            result,
8541            self.tx_id,
8542            0x5662f989cb4083bb,
8543            fidl::encoding::DynamicFlags::empty(),
8544        )
8545    }
8546}
8547
8548#[must_use = "FIDL methods require a response to be sent"]
8549#[derive(Debug)]
8550pub struct WlanSoftmacBridgeStartActiveScanResponder {
8551    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8552    tx_id: u32,
8553}
8554
8555/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8556/// if the responder is dropped without sending a response, so that the client
8557/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8558impl std::ops::Drop for WlanSoftmacBridgeStartActiveScanResponder {
8559    fn drop(&mut self) {
8560        self.control_handle.shutdown();
8561        // Safety: drops once, never accessed again
8562        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8563    }
8564}
8565
8566impl fidl::endpoints::Responder for WlanSoftmacBridgeStartActiveScanResponder {
8567    type ControlHandle = WlanSoftmacBridgeControlHandle;
8568
8569    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8570        &self.control_handle
8571    }
8572
8573    fn drop_without_shutdown(mut self) {
8574        // Safety: drops once, never accessed again due to mem::forget
8575        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8576        // Prevent Drop from running (which would shut down the channel)
8577        std::mem::forget(self);
8578    }
8579}
8580
8581impl WlanSoftmacBridgeStartActiveScanResponder {
8582    /// Sends a response to the FIDL transaction.
8583    ///
8584    /// Sets the channel to shutdown if an error occurs.
8585    pub fn send(
8586        self,
8587        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
8588    ) -> Result<(), fidl::Error> {
8589        let _result = self.send_raw(result);
8590        if _result.is_err() {
8591            self.control_handle.shutdown();
8592        }
8593        self.drop_without_shutdown();
8594        _result
8595    }
8596
8597    /// Similar to "send" but does not shutdown the channel if an error occurs.
8598    pub fn send_no_shutdown_on_err(
8599        self,
8600        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
8601    ) -> Result<(), fidl::Error> {
8602        let _result = self.send_raw(result);
8603        self.drop_without_shutdown();
8604        _result
8605    }
8606
8607    fn send_raw(
8608        &self,
8609        mut result: Result<&WlanSoftmacBaseStartActiveScanResponse, i32>,
8610    ) -> Result<(), fidl::Error> {
8611        self.control_handle.inner.send::<fidl::encoding::ResultType<
8612            WlanSoftmacBaseStartActiveScanResponse,
8613            i32,
8614        >>(
8615            result,
8616            self.tx_id,
8617            0x4896eafa9937751e,
8618            fidl::encoding::DynamicFlags::empty(),
8619        )
8620    }
8621}
8622
8623#[must_use = "FIDL methods require a response to be sent"]
8624#[derive(Debug)]
8625pub struct WlanSoftmacBridgeCancelScanResponder {
8626    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8627    tx_id: u32,
8628}
8629
8630/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8631/// if the responder is dropped without sending a response, so that the client
8632/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8633impl std::ops::Drop for WlanSoftmacBridgeCancelScanResponder {
8634    fn drop(&mut self) {
8635        self.control_handle.shutdown();
8636        // Safety: drops once, never accessed again
8637        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8638    }
8639}
8640
8641impl fidl::endpoints::Responder for WlanSoftmacBridgeCancelScanResponder {
8642    type ControlHandle = WlanSoftmacBridgeControlHandle;
8643
8644    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8645        &self.control_handle
8646    }
8647
8648    fn drop_without_shutdown(mut self) {
8649        // Safety: drops once, never accessed again due to mem::forget
8650        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8651        // Prevent Drop from running (which would shut down the channel)
8652        std::mem::forget(self);
8653    }
8654}
8655
8656impl WlanSoftmacBridgeCancelScanResponder {
8657    /// Sends a response to the FIDL transaction.
8658    ///
8659    /// Sets the channel to shutdown if an error occurs.
8660    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8661        let _result = self.send_raw(result);
8662        if _result.is_err() {
8663            self.control_handle.shutdown();
8664        }
8665        self.drop_without_shutdown();
8666        _result
8667    }
8668
8669    /// Similar to "send" but does not shutdown the channel if an error occurs.
8670    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8671        let _result = self.send_raw(result);
8672        self.drop_without_shutdown();
8673        _result
8674    }
8675
8676    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8677        self.control_handle
8678            .inner
8679            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8680                result,
8681                self.tx_id,
8682                0xf7d859369764556,
8683                fidl::encoding::DynamicFlags::empty(),
8684            )
8685    }
8686}
8687
8688#[must_use = "FIDL methods require a response to be sent"]
8689#[derive(Debug)]
8690pub struct WlanSoftmacBridgeUpdateWmmParametersResponder {
8691    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8692    tx_id: u32,
8693}
8694
8695/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8696/// if the responder is dropped without sending a response, so that the client
8697/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8698impl std::ops::Drop for WlanSoftmacBridgeUpdateWmmParametersResponder {
8699    fn drop(&mut self) {
8700        self.control_handle.shutdown();
8701        // Safety: drops once, never accessed again
8702        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8703    }
8704}
8705
8706impl fidl::endpoints::Responder for WlanSoftmacBridgeUpdateWmmParametersResponder {
8707    type ControlHandle = WlanSoftmacBridgeControlHandle;
8708
8709    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8710        &self.control_handle
8711    }
8712
8713    fn drop_without_shutdown(mut self) {
8714        // Safety: drops once, never accessed again due to mem::forget
8715        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8716        // Prevent Drop from running (which would shut down the channel)
8717        std::mem::forget(self);
8718    }
8719}
8720
8721impl WlanSoftmacBridgeUpdateWmmParametersResponder {
8722    /// Sends a response to the FIDL transaction.
8723    ///
8724    /// Sets the channel to shutdown if an error occurs.
8725    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8726        let _result = self.send_raw(result);
8727        if _result.is_err() {
8728            self.control_handle.shutdown();
8729        }
8730        self.drop_without_shutdown();
8731        _result
8732    }
8733
8734    /// Similar to "send" but does not shutdown the channel if an error occurs.
8735    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8736        let _result = self.send_raw(result);
8737        self.drop_without_shutdown();
8738        _result
8739    }
8740
8741    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
8742        self.control_handle
8743            .inner
8744            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
8745                result,
8746                self.tx_id,
8747                0x68522c7122d5f78c,
8748                fidl::encoding::DynamicFlags::empty(),
8749            )
8750    }
8751}
8752
8753#[must_use = "FIDL methods require a response to be sent"]
8754#[derive(Debug)]
8755pub struct WlanSoftmacBridgeStartResponder {
8756    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8757    tx_id: u32,
8758}
8759
8760/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8761/// if the responder is dropped without sending a response, so that the client
8762/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8763impl std::ops::Drop for WlanSoftmacBridgeStartResponder {
8764    fn drop(&mut self) {
8765        self.control_handle.shutdown();
8766        // Safety: drops once, never accessed again
8767        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8768    }
8769}
8770
8771impl fidl::endpoints::Responder for WlanSoftmacBridgeStartResponder {
8772    type ControlHandle = WlanSoftmacBridgeControlHandle;
8773
8774    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8775        &self.control_handle
8776    }
8777
8778    fn drop_without_shutdown(mut self) {
8779        // Safety: drops once, never accessed again due to mem::forget
8780        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8781        // Prevent Drop from running (which would shut down the channel)
8782        std::mem::forget(self);
8783    }
8784}
8785
8786impl WlanSoftmacBridgeStartResponder {
8787    /// Sends a response to the FIDL transaction.
8788    ///
8789    /// Sets the channel to shutdown if an error occurs.
8790    pub fn send(self, mut result: Result<fidl::Channel, i32>) -> Result<(), fidl::Error> {
8791        let _result = self.send_raw(result);
8792        if _result.is_err() {
8793            self.control_handle.shutdown();
8794        }
8795        self.drop_without_shutdown();
8796        _result
8797    }
8798
8799    /// Similar to "send" but does not shutdown the channel if an error occurs.
8800    pub fn send_no_shutdown_on_err(
8801        self,
8802        mut result: Result<fidl::Channel, i32>,
8803    ) -> Result<(), fidl::Error> {
8804        let _result = self.send_raw(result);
8805        self.drop_without_shutdown();
8806        _result
8807    }
8808
8809    fn send_raw(&self, mut result: Result<fidl::Channel, i32>) -> Result<(), fidl::Error> {
8810        self.control_handle
8811            .inner
8812            .send::<fidl::encoding::ResultType<WlanSoftmacBridgeStartResponse, i32>>(
8813                result.map(|sme_channel| (sme_channel,)),
8814                self.tx_id,
8815                0x7b2c15a507020d4d,
8816                fidl::encoding::DynamicFlags::empty(),
8817            )
8818    }
8819}
8820
8821#[must_use = "FIDL methods require a response to be sent"]
8822#[derive(Debug)]
8823pub struct WlanSoftmacBridgeSetEthernetStatusResponder {
8824    control_handle: std::mem::ManuallyDrop<WlanSoftmacBridgeControlHandle>,
8825    tx_id: u32,
8826}
8827
8828/// Set the the channel to be shutdown (see [`WlanSoftmacBridgeControlHandle::shutdown`])
8829/// if the responder is dropped without sending a response, so that the client
8830/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
8831impl std::ops::Drop for WlanSoftmacBridgeSetEthernetStatusResponder {
8832    fn drop(&mut self) {
8833        self.control_handle.shutdown();
8834        // Safety: drops once, never accessed again
8835        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8836    }
8837}
8838
8839impl fidl::endpoints::Responder for WlanSoftmacBridgeSetEthernetStatusResponder {
8840    type ControlHandle = WlanSoftmacBridgeControlHandle;
8841
8842    fn control_handle(&self) -> &WlanSoftmacBridgeControlHandle {
8843        &self.control_handle
8844    }
8845
8846    fn drop_without_shutdown(mut self) {
8847        // Safety: drops once, never accessed again due to mem::forget
8848        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
8849        // Prevent Drop from running (which would shut down the channel)
8850        std::mem::forget(self);
8851    }
8852}
8853
8854impl WlanSoftmacBridgeSetEthernetStatusResponder {
8855    /// Sends a response to the FIDL transaction.
8856    ///
8857    /// Sets the channel to shutdown if an error occurs.
8858    pub fn send(self) -> Result<(), fidl::Error> {
8859        let _result = self.send_raw();
8860        if _result.is_err() {
8861            self.control_handle.shutdown();
8862        }
8863        self.drop_without_shutdown();
8864        _result
8865    }
8866
8867    /// Similar to "send" but does not shutdown the channel if an error occurs.
8868    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
8869        let _result = self.send_raw();
8870        self.drop_without_shutdown();
8871        _result
8872    }
8873
8874    fn send_raw(&self) -> Result<(), fidl::Error> {
8875        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
8876            (),
8877            self.tx_id,
8878            0x412503cb3aaa350b,
8879            fidl::encoding::DynamicFlags::empty(),
8880        )
8881    }
8882}
8883
8884#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
8885pub struct WlanSoftmacIfcBaseMarker;
8886
8887impl fidl::endpoints::ProtocolMarker for WlanSoftmacIfcBaseMarker {
8888    type Proxy = WlanSoftmacIfcBaseProxy;
8889    type RequestStream = WlanSoftmacIfcBaseRequestStream;
8890    #[cfg(target_os = "fuchsia")]
8891    type SynchronousProxy = WlanSoftmacIfcBaseSynchronousProxy;
8892
8893    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacIfcBase";
8894}
8895
8896pub trait WlanSoftmacIfcBaseProxyInterface: Send + Sync {
8897    type ReportTxResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8898    fn r#report_tx_result(
8899        &self,
8900        tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
8901    ) -> Self::ReportTxResultResponseFut;
8902    type NotifyScanCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
8903    fn r#notify_scan_complete(
8904        &self,
8905        payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8906    ) -> Self::NotifyScanCompleteResponseFut;
8907}
8908#[derive(Debug)]
8909#[cfg(target_os = "fuchsia")]
8910pub struct WlanSoftmacIfcBaseSynchronousProxy {
8911    client: fidl::client::sync::Client,
8912}
8913
8914#[cfg(target_os = "fuchsia")]
8915impl fidl::endpoints::SynchronousProxy for WlanSoftmacIfcBaseSynchronousProxy {
8916    type Proxy = WlanSoftmacIfcBaseProxy;
8917    type Protocol = WlanSoftmacIfcBaseMarker;
8918
8919    fn from_channel(inner: fidl::Channel) -> Self {
8920        Self::new(inner)
8921    }
8922
8923    fn into_channel(self) -> fidl::Channel {
8924        self.client.into_channel()
8925    }
8926
8927    fn as_channel(&self) -> &fidl::Channel {
8928        self.client.as_channel()
8929    }
8930}
8931
8932#[cfg(target_os = "fuchsia")]
8933impl WlanSoftmacIfcBaseSynchronousProxy {
8934    pub fn new(channel: fidl::Channel) -> Self {
8935        let protocol_name =
8936            <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
8937        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
8938    }
8939
8940    pub fn into_channel(self) -> fidl::Channel {
8941        self.client.into_channel()
8942    }
8943
8944    /// Waits until an event arrives and returns it. It is safe for other
8945    /// threads to make concurrent requests while waiting for an event.
8946    pub fn wait_for_event(
8947        &self,
8948        deadline: zx::MonotonicInstant,
8949    ) -> Result<WlanSoftmacIfcBaseEvent, fidl::Error> {
8950        WlanSoftmacIfcBaseEvent::decode(self.client.wait_for_event(deadline)?)
8951    }
8952
8953    /// Reports the result of an attempted transmission.
8954    ///
8955    /// A device driver indicates support for `ReportTxResult()` using
8956    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
8957    pub fn r#report_tx_result(
8958        &self,
8959        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
8960        ___deadline: zx::MonotonicInstant,
8961    ) -> Result<(), fidl::Error> {
8962        let _response = self
8963            .client
8964            .send_query::<WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::EmptyPayload>(
8965                (tx_result,),
8966                0x5835c2f13d94e09a,
8967                fidl::encoding::DynamicFlags::empty(),
8968                ___deadline,
8969            )?;
8970        Ok(_response)
8971    }
8972
8973    /// Reports completion of a scan associated with the unique `scan_id`. `status`
8974    /// indicates whether the scan completed successfully, failed due to an error,
8975    /// or was cancelled.
8976    ///
8977    /// Return status indicates the reason for scan completion:
8978    ///   ZX_OK: All channels were scanned successfully.
8979    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
8980    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
8981    ///       incompatible request (e.g. connect).
8982    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
8983    ///       This may be due to the current country setting.
8984    pub fn r#notify_scan_complete(
8985        &self,
8986        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8987        ___deadline: zx::MonotonicInstant,
8988    ) -> Result<(), fidl::Error> {
8989        let _response = self.client.send_query::<
8990            WlanSoftmacIfcBaseNotifyScanCompleteRequest,
8991            fidl::encoding::EmptyPayload,
8992        >(
8993            payload,
8994            0x7045e3cd460dc42c,
8995            fidl::encoding::DynamicFlags::empty(),
8996            ___deadline,
8997        )?;
8998        Ok(_response)
8999    }
9000}
9001
9002#[derive(Debug, Clone)]
9003pub struct WlanSoftmacIfcBaseProxy {
9004    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9005}
9006
9007impl fidl::endpoints::Proxy for WlanSoftmacIfcBaseProxy {
9008    type Protocol = WlanSoftmacIfcBaseMarker;
9009
9010    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9011        Self::new(inner)
9012    }
9013
9014    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9015        self.client.into_channel().map_err(|client| Self { client })
9016    }
9017
9018    fn as_channel(&self) -> &::fidl::AsyncChannel {
9019        self.client.as_channel()
9020    }
9021}
9022
9023impl WlanSoftmacIfcBaseProxy {
9024    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacIfcBase.
9025    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9026        let protocol_name =
9027            <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9028        Self { client: fidl::client::Client::new(channel, protocol_name) }
9029    }
9030
9031    /// Get a Stream of events from the remote end of the protocol.
9032    ///
9033    /// # Panics
9034    ///
9035    /// Panics if the event stream was already taken.
9036    pub fn take_event_stream(&self) -> WlanSoftmacIfcBaseEventStream {
9037        WlanSoftmacIfcBaseEventStream { event_receiver: self.client.take_event_receiver() }
9038    }
9039
9040    /// Reports the result of an attempted transmission.
9041    ///
9042    /// A device driver indicates support for `ReportTxResult()` using
9043    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9044    pub fn r#report_tx_result(
9045        &self,
9046        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9047    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9048        WlanSoftmacIfcBaseProxyInterface::r#report_tx_result(self, tx_result)
9049    }
9050
9051    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9052    /// indicates whether the scan completed successfully, failed due to an error,
9053    /// or was cancelled.
9054    ///
9055    /// Return status indicates the reason for scan completion:
9056    ///   ZX_OK: All channels were scanned successfully.
9057    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9058    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9059    ///       incompatible request (e.g. connect).
9060    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9061    ///       This may be due to the current country setting.
9062    pub fn r#notify_scan_complete(
9063        &self,
9064        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9065    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9066        WlanSoftmacIfcBaseProxyInterface::r#notify_scan_complete(self, payload)
9067    }
9068}
9069
9070impl WlanSoftmacIfcBaseProxyInterface for WlanSoftmacIfcBaseProxy {
9071    type ReportTxResultResponseFut =
9072        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9073    fn r#report_tx_result(
9074        &self,
9075        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9076    ) -> Self::ReportTxResultResponseFut {
9077        fn _decode(
9078            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9079        ) -> Result<(), fidl::Error> {
9080            let _response = fidl::client::decode_transaction_body::<
9081                fidl::encoding::EmptyPayload,
9082                fidl::encoding::DefaultFuchsiaResourceDialect,
9083                0x5835c2f13d94e09a,
9084            >(_buf?)?;
9085            Ok(_response)
9086        }
9087        self.client.send_query_and_decode::<WlanSoftmacIfcBaseReportTxResultRequest, ()>(
9088            (tx_result,),
9089            0x5835c2f13d94e09a,
9090            fidl::encoding::DynamicFlags::empty(),
9091            _decode,
9092        )
9093    }
9094
9095    type NotifyScanCompleteResponseFut =
9096        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9097    fn r#notify_scan_complete(
9098        &self,
9099        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9100    ) -> Self::NotifyScanCompleteResponseFut {
9101        fn _decode(
9102            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9103        ) -> Result<(), fidl::Error> {
9104            let _response = fidl::client::decode_transaction_body::<
9105                fidl::encoding::EmptyPayload,
9106                fidl::encoding::DefaultFuchsiaResourceDialect,
9107                0x7045e3cd460dc42c,
9108            >(_buf?)?;
9109            Ok(_response)
9110        }
9111        self.client.send_query_and_decode::<WlanSoftmacIfcBaseNotifyScanCompleteRequest, ()>(
9112            payload,
9113            0x7045e3cd460dc42c,
9114            fidl::encoding::DynamicFlags::empty(),
9115            _decode,
9116        )
9117    }
9118}
9119
9120pub struct WlanSoftmacIfcBaseEventStream {
9121    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9122}
9123
9124impl std::marker::Unpin for WlanSoftmacIfcBaseEventStream {}
9125
9126impl futures::stream::FusedStream for WlanSoftmacIfcBaseEventStream {
9127    fn is_terminated(&self) -> bool {
9128        self.event_receiver.is_terminated()
9129    }
9130}
9131
9132impl futures::Stream for WlanSoftmacIfcBaseEventStream {
9133    type Item = Result<WlanSoftmacIfcBaseEvent, fidl::Error>;
9134
9135    fn poll_next(
9136        mut self: std::pin::Pin<&mut Self>,
9137        cx: &mut std::task::Context<'_>,
9138    ) -> std::task::Poll<Option<Self::Item>> {
9139        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9140            &mut self.event_receiver,
9141            cx
9142        )?) {
9143            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacIfcBaseEvent::decode(buf))),
9144            None => std::task::Poll::Ready(None),
9145        }
9146    }
9147}
9148
9149#[derive(Debug)]
9150pub enum WlanSoftmacIfcBaseEvent {}
9151
9152impl WlanSoftmacIfcBaseEvent {
9153    /// Decodes a message buffer as a [`WlanSoftmacIfcBaseEvent`].
9154    fn decode(
9155        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9156    ) -> Result<WlanSoftmacIfcBaseEvent, fidl::Error> {
9157        let (bytes, _handles) = buf.split_mut();
9158        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9159        debug_assert_eq!(tx_header.tx_id, 0);
9160        match tx_header.ordinal {
9161            _ => Err(fidl::Error::UnknownOrdinal {
9162                ordinal: tx_header.ordinal,
9163                protocol_name:
9164                    <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9165            }),
9166        }
9167    }
9168}
9169
9170/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacIfcBase.
9171pub struct WlanSoftmacIfcBaseRequestStream {
9172    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9173    is_terminated: bool,
9174}
9175
9176impl std::marker::Unpin for WlanSoftmacIfcBaseRequestStream {}
9177
9178impl futures::stream::FusedStream for WlanSoftmacIfcBaseRequestStream {
9179    fn is_terminated(&self) -> bool {
9180        self.is_terminated
9181    }
9182}
9183
9184impl fidl::endpoints::RequestStream for WlanSoftmacIfcBaseRequestStream {
9185    type Protocol = WlanSoftmacIfcBaseMarker;
9186    type ControlHandle = WlanSoftmacIfcBaseControlHandle;
9187
9188    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9189        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9190    }
9191
9192    fn control_handle(&self) -> Self::ControlHandle {
9193        WlanSoftmacIfcBaseControlHandle { inner: self.inner.clone() }
9194    }
9195
9196    fn into_inner(
9197        self,
9198    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9199    {
9200        (self.inner, self.is_terminated)
9201    }
9202
9203    fn from_inner(
9204        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9205        is_terminated: bool,
9206    ) -> Self {
9207        Self { inner, is_terminated }
9208    }
9209}
9210
9211impl futures::Stream for WlanSoftmacIfcBaseRequestStream {
9212    type Item = Result<WlanSoftmacIfcBaseRequest, fidl::Error>;
9213
9214    fn poll_next(
9215        mut self: std::pin::Pin<&mut Self>,
9216        cx: &mut std::task::Context<'_>,
9217    ) -> std::task::Poll<Option<Self::Item>> {
9218        let this = &mut *self;
9219        if this.inner.check_shutdown(cx) {
9220            this.is_terminated = true;
9221            return std::task::Poll::Ready(None);
9222        }
9223        if this.is_terminated {
9224            panic!("polled WlanSoftmacIfcBaseRequestStream after completion");
9225        }
9226        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9227            |bytes, handles| {
9228                match this.inner.channel().read_etc(cx, bytes, handles) {
9229                    std::task::Poll::Ready(Ok(())) => {}
9230                    std::task::Poll::Pending => return std::task::Poll::Pending,
9231                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9232                        this.is_terminated = true;
9233                        return std::task::Poll::Ready(None);
9234                    }
9235                    std::task::Poll::Ready(Err(e)) => {
9236                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9237                            e.into(),
9238                        ))))
9239                    }
9240                }
9241
9242                // A message has been received from the channel
9243                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9244
9245                std::task::Poll::Ready(Some(match header.ordinal {
9246                0x5835c2f13d94e09a => {
9247                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9248                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9249                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
9250                    let control_handle = WlanSoftmacIfcBaseControlHandle {
9251                        inner: this.inner.clone(),
9252                    };
9253                    Ok(WlanSoftmacIfcBaseRequest::ReportTxResult {tx_result: req.tx_result,
9254
9255                        responder: WlanSoftmacIfcBaseReportTxResultResponder {
9256                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9257                            tx_id: header.tx_id,
9258                        },
9259                    })
9260                }
9261                0x7045e3cd460dc42c => {
9262                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9263                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseNotifyScanCompleteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9264                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
9265                    let control_handle = WlanSoftmacIfcBaseControlHandle {
9266                        inner: this.inner.clone(),
9267                    };
9268                    Ok(WlanSoftmacIfcBaseRequest::NotifyScanComplete {payload: req,
9269                        responder: WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9270                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9271                            tx_id: header.tx_id,
9272                        },
9273                    })
9274                }
9275                _ => Err(fidl::Error::UnknownOrdinal {
9276                    ordinal: header.ordinal,
9277                    protocol_name: <WlanSoftmacIfcBaseMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9278                }),
9279            }))
9280            },
9281        )
9282    }
9283}
9284
9285/// Protocol containing methods common to both `WlanSoftmacIfc` and `WlanSoftmacIfcBridge`.
9286///
9287/// The `WlanSoftmacIfc` and `WlanSoftmacIfcBridge` protocols have common methods, as the latter
9288/// generally forwards `WlanSoftmacIfc` requests received in the wlansoftmac driver
9289/// to `WlanSoftmacIfcBridge` requests in the bridged driver. Composing this
9290/// protocol into `WlanSoftmacIfc` and `WlanSoftmacIfcBridge` minimizes the duplication of method
9291/// definitions (and associated request conversions that would be caused by such duplication).
9292///
9293/// **This protocol is not implemented directly by any component.** It is composed into `WlanSoftmacIfc`
9294/// and `WlanSoftmacIfcBridge`.
9295#[derive(Debug)]
9296pub enum WlanSoftmacIfcBaseRequest {
9297    /// Reports the result of an attempted transmission.
9298    ///
9299    /// A device driver indicates support for `ReportTxResult()` using
9300    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9301    ReportTxResult {
9302        tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
9303        responder: WlanSoftmacIfcBaseReportTxResultResponder,
9304    },
9305    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9306    /// indicates whether the scan completed successfully, failed due to an error,
9307    /// or was cancelled.
9308    ///
9309    /// Return status indicates the reason for scan completion:
9310    ///   ZX_OK: All channels were scanned successfully.
9311    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9312    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9313    ///       incompatible request (e.g. connect).
9314    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9315    ///       This may be due to the current country setting.
9316    NotifyScanComplete {
9317        payload: WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9318        responder: WlanSoftmacIfcBaseNotifyScanCompleteResponder,
9319    },
9320}
9321
9322impl WlanSoftmacIfcBaseRequest {
9323    #[allow(irrefutable_let_patterns)]
9324    pub fn into_report_tx_result(
9325        self,
9326    ) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlanSoftmacIfcBaseReportTxResultResponder)>
9327    {
9328        if let WlanSoftmacIfcBaseRequest::ReportTxResult { tx_result, responder } = self {
9329            Some((tx_result, responder))
9330        } else {
9331            None
9332        }
9333    }
9334
9335    #[allow(irrefutable_let_patterns)]
9336    pub fn into_notify_scan_complete(
9337        self,
9338    ) -> Option<(
9339        WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9340        WlanSoftmacIfcBaseNotifyScanCompleteResponder,
9341    )> {
9342        if let WlanSoftmacIfcBaseRequest::NotifyScanComplete { payload, responder } = self {
9343            Some((payload, responder))
9344        } else {
9345            None
9346        }
9347    }
9348
9349    /// Name of the method defined in FIDL
9350    pub fn method_name(&self) -> &'static str {
9351        match *self {
9352            WlanSoftmacIfcBaseRequest::ReportTxResult { .. } => "report_tx_result",
9353            WlanSoftmacIfcBaseRequest::NotifyScanComplete { .. } => "notify_scan_complete",
9354        }
9355    }
9356}
9357
9358#[derive(Debug, Clone)]
9359pub struct WlanSoftmacIfcBaseControlHandle {
9360    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9361}
9362
9363impl fidl::endpoints::ControlHandle for WlanSoftmacIfcBaseControlHandle {
9364    fn shutdown(&self) {
9365        self.inner.shutdown()
9366    }
9367    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
9368        self.inner.shutdown_with_epitaph(status)
9369    }
9370
9371    fn is_closed(&self) -> bool {
9372        self.inner.channel().is_closed()
9373    }
9374    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
9375        self.inner.channel().on_closed()
9376    }
9377
9378    #[cfg(target_os = "fuchsia")]
9379    fn signal_peer(
9380        &self,
9381        clear_mask: zx::Signals,
9382        set_mask: zx::Signals,
9383    ) -> Result<(), zx_status::Status> {
9384        use fidl::Peered;
9385        self.inner.channel().signal_peer(clear_mask, set_mask)
9386    }
9387}
9388
9389impl WlanSoftmacIfcBaseControlHandle {}
9390
9391#[must_use = "FIDL methods require a response to be sent"]
9392#[derive(Debug)]
9393pub struct WlanSoftmacIfcBaseReportTxResultResponder {
9394    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBaseControlHandle>,
9395    tx_id: u32,
9396}
9397
9398/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBaseControlHandle::shutdown`])
9399/// if the responder is dropped without sending a response, so that the client
9400/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9401impl std::ops::Drop for WlanSoftmacIfcBaseReportTxResultResponder {
9402    fn drop(&mut self) {
9403        self.control_handle.shutdown();
9404        // Safety: drops once, never accessed again
9405        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9406    }
9407}
9408
9409impl fidl::endpoints::Responder for WlanSoftmacIfcBaseReportTxResultResponder {
9410    type ControlHandle = WlanSoftmacIfcBaseControlHandle;
9411
9412    fn control_handle(&self) -> &WlanSoftmacIfcBaseControlHandle {
9413        &self.control_handle
9414    }
9415
9416    fn drop_without_shutdown(mut self) {
9417        // Safety: drops once, never accessed again due to mem::forget
9418        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9419        // Prevent Drop from running (which would shut down the channel)
9420        std::mem::forget(self);
9421    }
9422}
9423
9424impl WlanSoftmacIfcBaseReportTxResultResponder {
9425    /// Sends a response to the FIDL transaction.
9426    ///
9427    /// Sets the channel to shutdown if an error occurs.
9428    pub fn send(self) -> Result<(), fidl::Error> {
9429        let _result = self.send_raw();
9430        if _result.is_err() {
9431            self.control_handle.shutdown();
9432        }
9433        self.drop_without_shutdown();
9434        _result
9435    }
9436
9437    /// Similar to "send" but does not shutdown the channel if an error occurs.
9438    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9439        let _result = self.send_raw();
9440        self.drop_without_shutdown();
9441        _result
9442    }
9443
9444    fn send_raw(&self) -> Result<(), fidl::Error> {
9445        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9446            (),
9447            self.tx_id,
9448            0x5835c2f13d94e09a,
9449            fidl::encoding::DynamicFlags::empty(),
9450        )
9451    }
9452}
9453
9454#[must_use = "FIDL methods require a response to be sent"]
9455#[derive(Debug)]
9456pub struct WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9457    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBaseControlHandle>,
9458    tx_id: u32,
9459}
9460
9461/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBaseControlHandle::shutdown`])
9462/// if the responder is dropped without sending a response, so that the client
9463/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
9464impl std::ops::Drop for WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9465    fn drop(&mut self) {
9466        self.control_handle.shutdown();
9467        // Safety: drops once, never accessed again
9468        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9469    }
9470}
9471
9472impl fidl::endpoints::Responder for WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9473    type ControlHandle = WlanSoftmacIfcBaseControlHandle;
9474
9475    fn control_handle(&self) -> &WlanSoftmacIfcBaseControlHandle {
9476        &self.control_handle
9477    }
9478
9479    fn drop_without_shutdown(mut self) {
9480        // Safety: drops once, never accessed again due to mem::forget
9481        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
9482        // Prevent Drop from running (which would shut down the channel)
9483        std::mem::forget(self);
9484    }
9485}
9486
9487impl WlanSoftmacIfcBaseNotifyScanCompleteResponder {
9488    /// Sends a response to the FIDL transaction.
9489    ///
9490    /// Sets the channel to shutdown if an error occurs.
9491    pub fn send(self) -> Result<(), fidl::Error> {
9492        let _result = self.send_raw();
9493        if _result.is_err() {
9494            self.control_handle.shutdown();
9495        }
9496        self.drop_without_shutdown();
9497        _result
9498    }
9499
9500    /// Similar to "send" but does not shutdown the channel if an error occurs.
9501    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
9502        let _result = self.send_raw();
9503        self.drop_without_shutdown();
9504        _result
9505    }
9506
9507    fn send_raw(&self) -> Result<(), fidl::Error> {
9508        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
9509            (),
9510            self.tx_id,
9511            0x7045e3cd460dc42c,
9512            fidl::encoding::DynamicFlags::empty(),
9513        )
9514    }
9515}
9516
9517#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
9518pub struct WlanSoftmacIfcBridgeMarker;
9519
9520impl fidl::endpoints::ProtocolMarker for WlanSoftmacIfcBridgeMarker {
9521    type Proxy = WlanSoftmacIfcBridgeProxy;
9522    type RequestStream = WlanSoftmacIfcBridgeRequestStream;
9523    #[cfg(target_os = "fuchsia")]
9524    type SynchronousProxy = WlanSoftmacIfcBridgeSynchronousProxy;
9525
9526    const DEBUG_NAME: &'static str = "(anonymous) WlanSoftmacIfcBridge";
9527}
9528
9529pub trait WlanSoftmacIfcBridgeProxyInterface: Send + Sync {
9530    type ReportTxResultResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
9531    fn r#report_tx_result(
9532        &self,
9533        tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9534    ) -> Self::ReportTxResultResponseFut;
9535    type NotifyScanCompleteResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
9536    fn r#notify_scan_complete(
9537        &self,
9538        payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9539    ) -> Self::NotifyScanCompleteResponseFut;
9540    type StopBridgedDriverResponseFut: std::future::Future<Output = Result<(), fidl::Error>> + Send;
9541    fn r#stop_bridged_driver(&self) -> Self::StopBridgedDriverResponseFut;
9542}
9543#[derive(Debug)]
9544#[cfg(target_os = "fuchsia")]
9545pub struct WlanSoftmacIfcBridgeSynchronousProxy {
9546    client: fidl::client::sync::Client,
9547}
9548
9549#[cfg(target_os = "fuchsia")]
9550impl fidl::endpoints::SynchronousProxy for WlanSoftmacIfcBridgeSynchronousProxy {
9551    type Proxy = WlanSoftmacIfcBridgeProxy;
9552    type Protocol = WlanSoftmacIfcBridgeMarker;
9553
9554    fn from_channel(inner: fidl::Channel) -> Self {
9555        Self::new(inner)
9556    }
9557
9558    fn into_channel(self) -> fidl::Channel {
9559        self.client.into_channel()
9560    }
9561
9562    fn as_channel(&self) -> &fidl::Channel {
9563        self.client.as_channel()
9564    }
9565}
9566
9567#[cfg(target_os = "fuchsia")]
9568impl WlanSoftmacIfcBridgeSynchronousProxy {
9569    pub fn new(channel: fidl::Channel) -> Self {
9570        let protocol_name =
9571            <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9572        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
9573    }
9574
9575    pub fn into_channel(self) -> fidl::Channel {
9576        self.client.into_channel()
9577    }
9578
9579    /// Waits until an event arrives and returns it. It is safe for other
9580    /// threads to make concurrent requests while waiting for an event.
9581    pub fn wait_for_event(
9582        &self,
9583        deadline: zx::MonotonicInstant,
9584    ) -> Result<WlanSoftmacIfcBridgeEvent, fidl::Error> {
9585        WlanSoftmacIfcBridgeEvent::decode(self.client.wait_for_event(deadline)?)
9586    }
9587
9588    /// Reports the result of an attempted transmission.
9589    ///
9590    /// A device driver indicates support for `ReportTxResult()` using
9591    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9592    pub fn r#report_tx_result(
9593        &self,
9594        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9595        ___deadline: zx::MonotonicInstant,
9596    ) -> Result<(), fidl::Error> {
9597        let _response = self
9598            .client
9599            .send_query::<WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::EmptyPayload>(
9600                (tx_result,),
9601                0x5835c2f13d94e09a,
9602                fidl::encoding::DynamicFlags::empty(),
9603                ___deadline,
9604            )?;
9605        Ok(_response)
9606    }
9607
9608    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9609    /// indicates whether the scan completed successfully, failed due to an error,
9610    /// or was cancelled.
9611    ///
9612    /// Return status indicates the reason for scan completion:
9613    ///   ZX_OK: All channels were scanned successfully.
9614    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9615    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9616    ///       incompatible request (e.g. connect).
9617    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9618    ///       This may be due to the current country setting.
9619    pub fn r#notify_scan_complete(
9620        &self,
9621        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9622        ___deadline: zx::MonotonicInstant,
9623    ) -> Result<(), fidl::Error> {
9624        let _response = self.client.send_query::<
9625            WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9626            fidl::encoding::EmptyPayload,
9627        >(
9628            payload,
9629            0x7045e3cd460dc42c,
9630            fidl::encoding::DynamicFlags::empty(),
9631            ___deadline,
9632        )?;
9633        Ok(_response)
9634    }
9635
9636    /// Stop the bridged driver.
9637    ///
9638    /// Calling this method causes both the server end of this protocol (`WlanSoftmacIfcBridge`)
9639    /// to close and the client end of `WlanSoftmacBridge` to close. The server will not return a
9640    /// response from this method until after processing all queued events.
9641    ///
9642    /// In practice, the wlansoftmac driver calls this method during unbind.
9643    pub fn r#stop_bridged_driver(
9644        &self,
9645        ___deadline: zx::MonotonicInstant,
9646    ) -> Result<(), fidl::Error> {
9647        let _response =
9648            self.client.send_query::<fidl::encoding::EmptyPayload, fidl::encoding::EmptyPayload>(
9649                (),
9650                0x112dbd0cc2251151,
9651                fidl::encoding::DynamicFlags::empty(),
9652                ___deadline,
9653            )?;
9654        Ok(_response)
9655    }
9656}
9657
9658#[derive(Debug, Clone)]
9659pub struct WlanSoftmacIfcBridgeProxy {
9660    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
9661}
9662
9663impl fidl::endpoints::Proxy for WlanSoftmacIfcBridgeProxy {
9664    type Protocol = WlanSoftmacIfcBridgeMarker;
9665
9666    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
9667        Self::new(inner)
9668    }
9669
9670    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
9671        self.client.into_channel().map_err(|client| Self { client })
9672    }
9673
9674    fn as_channel(&self) -> &::fidl::AsyncChannel {
9675        self.client.as_channel()
9676    }
9677}
9678
9679impl WlanSoftmacIfcBridgeProxy {
9680    /// Create a new Proxy for fuchsia.wlan.softmac/WlanSoftmacIfcBridge.
9681    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
9682        let protocol_name =
9683            <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
9684        Self { client: fidl::client::Client::new(channel, protocol_name) }
9685    }
9686
9687    /// Get a Stream of events from the remote end of the protocol.
9688    ///
9689    /// # Panics
9690    ///
9691    /// Panics if the event stream was already taken.
9692    pub fn take_event_stream(&self) -> WlanSoftmacIfcBridgeEventStream {
9693        WlanSoftmacIfcBridgeEventStream { event_receiver: self.client.take_event_receiver() }
9694    }
9695
9696    /// Reports the result of an attempted transmission.
9697    ///
9698    /// A device driver indicates support for `ReportTxResult()` using
9699    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
9700    pub fn r#report_tx_result(
9701        &self,
9702        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9703    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9704        WlanSoftmacIfcBridgeProxyInterface::r#report_tx_result(self, tx_result)
9705    }
9706
9707    /// Reports completion of a scan associated with the unique `scan_id`. `status`
9708    /// indicates whether the scan completed successfully, failed due to an error,
9709    /// or was cancelled.
9710    ///
9711    /// Return status indicates the reason for scan completion:
9712    ///   ZX_OK: All channels were scanned successfully.
9713    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
9714    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
9715    ///       incompatible request (e.g. connect).
9716    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
9717    ///       This may be due to the current country setting.
9718    pub fn r#notify_scan_complete(
9719        &self,
9720        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9721    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9722        WlanSoftmacIfcBridgeProxyInterface::r#notify_scan_complete(self, payload)
9723    }
9724
9725    /// Stop the bridged driver.
9726    ///
9727    /// Calling this method causes both the server end of this protocol (`WlanSoftmacIfcBridge`)
9728    /// to close and the client end of `WlanSoftmacBridge` to close. The server will not return a
9729    /// response from this method until after processing all queued events.
9730    ///
9731    /// In practice, the wlansoftmac driver calls this method during unbind.
9732    pub fn r#stop_bridged_driver(
9733        &self,
9734    ) -> fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect> {
9735        WlanSoftmacIfcBridgeProxyInterface::r#stop_bridged_driver(self)
9736    }
9737}
9738
9739impl WlanSoftmacIfcBridgeProxyInterface for WlanSoftmacIfcBridgeProxy {
9740    type ReportTxResultResponseFut =
9741        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9742    fn r#report_tx_result(
9743        &self,
9744        mut tx_result: &fidl_fuchsia_wlan_common::WlanTxResult,
9745    ) -> Self::ReportTxResultResponseFut {
9746        fn _decode(
9747            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9748        ) -> Result<(), fidl::Error> {
9749            let _response = fidl::client::decode_transaction_body::<
9750                fidl::encoding::EmptyPayload,
9751                fidl::encoding::DefaultFuchsiaResourceDialect,
9752                0x5835c2f13d94e09a,
9753            >(_buf?)?;
9754            Ok(_response)
9755        }
9756        self.client.send_query_and_decode::<WlanSoftmacIfcBaseReportTxResultRequest, ()>(
9757            (tx_result,),
9758            0x5835c2f13d94e09a,
9759            fidl::encoding::DynamicFlags::empty(),
9760            _decode,
9761        )
9762    }
9763
9764    type NotifyScanCompleteResponseFut =
9765        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9766    fn r#notify_scan_complete(
9767        &self,
9768        mut payload: &WlanSoftmacIfcBaseNotifyScanCompleteRequest,
9769    ) -> Self::NotifyScanCompleteResponseFut {
9770        fn _decode(
9771            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9772        ) -> Result<(), fidl::Error> {
9773            let _response = fidl::client::decode_transaction_body::<
9774                fidl::encoding::EmptyPayload,
9775                fidl::encoding::DefaultFuchsiaResourceDialect,
9776                0x7045e3cd460dc42c,
9777            >(_buf?)?;
9778            Ok(_response)
9779        }
9780        self.client.send_query_and_decode::<WlanSoftmacIfcBaseNotifyScanCompleteRequest, ()>(
9781            payload,
9782            0x7045e3cd460dc42c,
9783            fidl::encoding::DynamicFlags::empty(),
9784            _decode,
9785        )
9786    }
9787
9788    type StopBridgedDriverResponseFut =
9789        fidl::client::QueryResponseFut<(), fidl::encoding::DefaultFuchsiaResourceDialect>;
9790    fn r#stop_bridged_driver(&self) -> Self::StopBridgedDriverResponseFut {
9791        fn _decode(
9792            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
9793        ) -> Result<(), fidl::Error> {
9794            let _response = fidl::client::decode_transaction_body::<
9795                fidl::encoding::EmptyPayload,
9796                fidl::encoding::DefaultFuchsiaResourceDialect,
9797                0x112dbd0cc2251151,
9798            >(_buf?)?;
9799            Ok(_response)
9800        }
9801        self.client.send_query_and_decode::<fidl::encoding::EmptyPayload, ()>(
9802            (),
9803            0x112dbd0cc2251151,
9804            fidl::encoding::DynamicFlags::empty(),
9805            _decode,
9806        )
9807    }
9808}
9809
9810pub struct WlanSoftmacIfcBridgeEventStream {
9811    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
9812}
9813
9814impl std::marker::Unpin for WlanSoftmacIfcBridgeEventStream {}
9815
9816impl futures::stream::FusedStream for WlanSoftmacIfcBridgeEventStream {
9817    fn is_terminated(&self) -> bool {
9818        self.event_receiver.is_terminated()
9819    }
9820}
9821
9822impl futures::Stream for WlanSoftmacIfcBridgeEventStream {
9823    type Item = Result<WlanSoftmacIfcBridgeEvent, fidl::Error>;
9824
9825    fn poll_next(
9826        mut self: std::pin::Pin<&mut Self>,
9827        cx: &mut std::task::Context<'_>,
9828    ) -> std::task::Poll<Option<Self::Item>> {
9829        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
9830            &mut self.event_receiver,
9831            cx
9832        )?) {
9833            Some(buf) => std::task::Poll::Ready(Some(WlanSoftmacIfcBridgeEvent::decode(buf))),
9834            None => std::task::Poll::Ready(None),
9835        }
9836    }
9837}
9838
9839#[derive(Debug)]
9840pub enum WlanSoftmacIfcBridgeEvent {}
9841
9842impl WlanSoftmacIfcBridgeEvent {
9843    /// Decodes a message buffer as a [`WlanSoftmacIfcBridgeEvent`].
9844    fn decode(
9845        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
9846    ) -> Result<WlanSoftmacIfcBridgeEvent, fidl::Error> {
9847        let (bytes, _handles) = buf.split_mut();
9848        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9849        debug_assert_eq!(tx_header.tx_id, 0);
9850        match tx_header.ordinal {
9851            _ => Err(fidl::Error::UnknownOrdinal {
9852                ordinal: tx_header.ordinal,
9853                protocol_name:
9854                    <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9855            }),
9856        }
9857    }
9858}
9859
9860/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanSoftmacIfcBridge.
9861pub struct WlanSoftmacIfcBridgeRequestStream {
9862    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9863    is_terminated: bool,
9864}
9865
9866impl std::marker::Unpin for WlanSoftmacIfcBridgeRequestStream {}
9867
9868impl futures::stream::FusedStream for WlanSoftmacIfcBridgeRequestStream {
9869    fn is_terminated(&self) -> bool {
9870        self.is_terminated
9871    }
9872}
9873
9874impl fidl::endpoints::RequestStream for WlanSoftmacIfcBridgeRequestStream {
9875    type Protocol = WlanSoftmacIfcBridgeMarker;
9876    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
9877
9878    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
9879        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
9880    }
9881
9882    fn control_handle(&self) -> Self::ControlHandle {
9883        WlanSoftmacIfcBridgeControlHandle { inner: self.inner.clone() }
9884    }
9885
9886    fn into_inner(
9887        self,
9888    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
9889    {
9890        (self.inner, self.is_terminated)
9891    }
9892
9893    fn from_inner(
9894        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
9895        is_terminated: bool,
9896    ) -> Self {
9897        Self { inner, is_terminated }
9898    }
9899}
9900
9901impl futures::Stream for WlanSoftmacIfcBridgeRequestStream {
9902    type Item = Result<WlanSoftmacIfcBridgeRequest, fidl::Error>;
9903
9904    fn poll_next(
9905        mut self: std::pin::Pin<&mut Self>,
9906        cx: &mut std::task::Context<'_>,
9907    ) -> std::task::Poll<Option<Self::Item>> {
9908        let this = &mut *self;
9909        if this.inner.check_shutdown(cx) {
9910            this.is_terminated = true;
9911            return std::task::Poll::Ready(None);
9912        }
9913        if this.is_terminated {
9914            panic!("polled WlanSoftmacIfcBridgeRequestStream after completion");
9915        }
9916        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
9917            |bytes, handles| {
9918                match this.inner.channel().read_etc(cx, bytes, handles) {
9919                    std::task::Poll::Ready(Ok(())) => {}
9920                    std::task::Poll::Pending => return std::task::Poll::Pending,
9921                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
9922                        this.is_terminated = true;
9923                        return std::task::Poll::Ready(None);
9924                    }
9925                    std::task::Poll::Ready(Err(e)) => {
9926                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
9927                            e.into(),
9928                        ))))
9929                    }
9930                }
9931
9932                // A message has been received from the channel
9933                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
9934
9935                std::task::Poll::Ready(Some(match header.ordinal {
9936                0x5835c2f13d94e09a => {
9937                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9938                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseReportTxResultRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9939                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseReportTxResultRequest>(&header, _body_bytes, handles, &mut req)?;
9940                    let control_handle = WlanSoftmacIfcBridgeControlHandle {
9941                        inner: this.inner.clone(),
9942                    };
9943                    Ok(WlanSoftmacIfcBridgeRequest::ReportTxResult {tx_result: req.tx_result,
9944
9945                        responder: WlanSoftmacIfcBridgeReportTxResultResponder {
9946                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9947                            tx_id: header.tx_id,
9948                        },
9949                    })
9950                }
9951                0x7045e3cd460dc42c => {
9952                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9953                    let mut req = fidl::new_empty!(WlanSoftmacIfcBaseNotifyScanCompleteRequest, fidl::encoding::DefaultFuchsiaResourceDialect);
9954                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(&header, _body_bytes, handles, &mut req)?;
9955                    let control_handle = WlanSoftmacIfcBridgeControlHandle {
9956                        inner: this.inner.clone(),
9957                    };
9958                    Ok(WlanSoftmacIfcBridgeRequest::NotifyScanComplete {payload: req,
9959                        responder: WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
9960                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9961                            tx_id: header.tx_id,
9962                        },
9963                    })
9964                }
9965                0x112dbd0cc2251151 => {
9966                    header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
9967                    let mut req = fidl::new_empty!(fidl::encoding::EmptyPayload, fidl::encoding::DefaultFuchsiaResourceDialect);
9968                    fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<fidl::encoding::EmptyPayload>(&header, _body_bytes, handles, &mut req)?;
9969                    let control_handle = WlanSoftmacIfcBridgeControlHandle {
9970                        inner: this.inner.clone(),
9971                    };
9972                    Ok(WlanSoftmacIfcBridgeRequest::StopBridgedDriver {
9973                        responder: WlanSoftmacIfcBridgeStopBridgedDriverResponder {
9974                            control_handle: std::mem::ManuallyDrop::new(control_handle),
9975                            tx_id: header.tx_id,
9976                        },
9977                    })
9978                }
9979                _ => Err(fidl::Error::UnknownOrdinal {
9980                    ordinal: header.ordinal,
9981                    protocol_name: <WlanSoftmacIfcBridgeMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
9982                }),
9983            }))
9984            },
9985        )
9986    }
9987}
9988
9989/// Protocol that transports `WlanSoftmacIfc` requests from the wlansoftmac driver to
9990/// the bridged driver.
9991///
9992/// This protocol should always be available at HEAD since it's intended to be an in-tree only protocol.
9993/// This protocol only exists because wlansoftmac cannot be implemented in Rust and must interact with
9994/// the wlansoftmac-c, wlansoftmac-rust, and wlan-mlme Rust crates.
9995#[derive(Debug)]
9996pub enum WlanSoftmacIfcBridgeRequest {
9997    /// Reports the result of an attempted transmission.
9998    ///
9999    /// A device driver indicates support for `ReportTxResult()` using
10000    /// `fuchsia.wlan.common/DeviceExtension.report_tx_result_supported`.
10001    ReportTxResult {
10002        tx_result: fidl_fuchsia_wlan_common::WlanTxResult,
10003        responder: WlanSoftmacIfcBridgeReportTxResultResponder,
10004    },
10005    /// Reports completion of a scan associated with the unique `scan_id`. `status`
10006    /// indicates whether the scan completed successfully, failed due to an error,
10007    /// or was cancelled.
10008    ///
10009    /// Return status indicates the reason for scan completion:
10010    ///   ZX_OK: All channels were scanned successfully.
10011    ///   ZX_ERR_CANCELLED: The scan was terminated by a user request, either an
10012    ///       explicit WlanSoftmac.CancelScan() or the initiation of an
10013    ///       incompatible request (e.g. connect).
10014    ///   ZX_ERR_OUT_OF_RANGE: The scan request included a prohibited channel.
10015    ///       This may be due to the current country setting.
10016    NotifyScanComplete {
10017        payload: WlanSoftmacIfcBaseNotifyScanCompleteRequest,
10018        responder: WlanSoftmacIfcBridgeNotifyScanCompleteResponder,
10019    },
10020    /// Stop the bridged driver.
10021    ///
10022    /// Calling this method causes both the server end of this protocol (`WlanSoftmacIfcBridge`)
10023    /// to close and the client end of `WlanSoftmacBridge` to close. The server will not return a
10024    /// response from this method until after processing all queued events.
10025    ///
10026    /// In practice, the wlansoftmac driver calls this method during unbind.
10027    StopBridgedDriver { responder: WlanSoftmacIfcBridgeStopBridgedDriverResponder },
10028}
10029
10030impl WlanSoftmacIfcBridgeRequest {
10031    #[allow(irrefutable_let_patterns)]
10032    pub fn into_report_tx_result(
10033        self,
10034    ) -> Option<(fidl_fuchsia_wlan_common::WlanTxResult, WlanSoftmacIfcBridgeReportTxResultResponder)>
10035    {
10036        if let WlanSoftmacIfcBridgeRequest::ReportTxResult { tx_result, responder } = self {
10037            Some((tx_result, responder))
10038        } else {
10039            None
10040        }
10041    }
10042
10043    #[allow(irrefutable_let_patterns)]
10044    pub fn into_notify_scan_complete(
10045        self,
10046    ) -> Option<(
10047        WlanSoftmacIfcBaseNotifyScanCompleteRequest,
10048        WlanSoftmacIfcBridgeNotifyScanCompleteResponder,
10049    )> {
10050        if let WlanSoftmacIfcBridgeRequest::NotifyScanComplete { payload, responder } = self {
10051            Some((payload, responder))
10052        } else {
10053            None
10054        }
10055    }
10056
10057    #[allow(irrefutable_let_patterns)]
10058    pub fn into_stop_bridged_driver(
10059        self,
10060    ) -> Option<(WlanSoftmacIfcBridgeStopBridgedDriverResponder)> {
10061        if let WlanSoftmacIfcBridgeRequest::StopBridgedDriver { responder } = self {
10062            Some((responder))
10063        } else {
10064            None
10065        }
10066    }
10067
10068    /// Name of the method defined in FIDL
10069    pub fn method_name(&self) -> &'static str {
10070        match *self {
10071            WlanSoftmacIfcBridgeRequest::ReportTxResult { .. } => "report_tx_result",
10072            WlanSoftmacIfcBridgeRequest::NotifyScanComplete { .. } => "notify_scan_complete",
10073            WlanSoftmacIfcBridgeRequest::StopBridgedDriver { .. } => "stop_bridged_driver",
10074        }
10075    }
10076}
10077
10078#[derive(Debug, Clone)]
10079pub struct WlanSoftmacIfcBridgeControlHandle {
10080    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10081}
10082
10083impl fidl::endpoints::ControlHandle for WlanSoftmacIfcBridgeControlHandle {
10084    fn shutdown(&self) {
10085        self.inner.shutdown()
10086    }
10087    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10088        self.inner.shutdown_with_epitaph(status)
10089    }
10090
10091    fn is_closed(&self) -> bool {
10092        self.inner.channel().is_closed()
10093    }
10094    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10095        self.inner.channel().on_closed()
10096    }
10097
10098    #[cfg(target_os = "fuchsia")]
10099    fn signal_peer(
10100        &self,
10101        clear_mask: zx::Signals,
10102        set_mask: zx::Signals,
10103    ) -> Result<(), zx_status::Status> {
10104        use fidl::Peered;
10105        self.inner.channel().signal_peer(clear_mask, set_mask)
10106    }
10107}
10108
10109impl WlanSoftmacIfcBridgeControlHandle {}
10110
10111#[must_use = "FIDL methods require a response to be sent"]
10112#[derive(Debug)]
10113pub struct WlanSoftmacIfcBridgeReportTxResultResponder {
10114    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
10115    tx_id: u32,
10116}
10117
10118/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBridgeControlHandle::shutdown`])
10119/// if the responder is dropped without sending a response, so that the client
10120/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10121impl std::ops::Drop for WlanSoftmacIfcBridgeReportTxResultResponder {
10122    fn drop(&mut self) {
10123        self.control_handle.shutdown();
10124        // Safety: drops once, never accessed again
10125        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10126    }
10127}
10128
10129impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeReportTxResultResponder {
10130    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
10131
10132    fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
10133        &self.control_handle
10134    }
10135
10136    fn drop_without_shutdown(mut self) {
10137        // Safety: drops once, never accessed again due to mem::forget
10138        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10139        // Prevent Drop from running (which would shut down the channel)
10140        std::mem::forget(self);
10141    }
10142}
10143
10144impl WlanSoftmacIfcBridgeReportTxResultResponder {
10145    /// Sends a response to the FIDL transaction.
10146    ///
10147    /// Sets the channel to shutdown if an error occurs.
10148    pub fn send(self) -> Result<(), fidl::Error> {
10149        let _result = self.send_raw();
10150        if _result.is_err() {
10151            self.control_handle.shutdown();
10152        }
10153        self.drop_without_shutdown();
10154        _result
10155    }
10156
10157    /// Similar to "send" but does not shutdown the channel if an error occurs.
10158    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
10159        let _result = self.send_raw();
10160        self.drop_without_shutdown();
10161        _result
10162    }
10163
10164    fn send_raw(&self) -> Result<(), fidl::Error> {
10165        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
10166            (),
10167            self.tx_id,
10168            0x5835c2f13d94e09a,
10169            fidl::encoding::DynamicFlags::empty(),
10170        )
10171    }
10172}
10173
10174#[must_use = "FIDL methods require a response to be sent"]
10175#[derive(Debug)]
10176pub struct WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
10177    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
10178    tx_id: u32,
10179}
10180
10181/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBridgeControlHandle::shutdown`])
10182/// if the responder is dropped without sending a response, so that the client
10183/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10184impl std::ops::Drop for WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
10185    fn drop(&mut self) {
10186        self.control_handle.shutdown();
10187        // Safety: drops once, never accessed again
10188        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10189    }
10190}
10191
10192impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
10193    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
10194
10195    fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
10196        &self.control_handle
10197    }
10198
10199    fn drop_without_shutdown(mut self) {
10200        // Safety: drops once, never accessed again due to mem::forget
10201        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10202        // Prevent Drop from running (which would shut down the channel)
10203        std::mem::forget(self);
10204    }
10205}
10206
10207impl WlanSoftmacIfcBridgeNotifyScanCompleteResponder {
10208    /// Sends a response to the FIDL transaction.
10209    ///
10210    /// Sets the channel to shutdown if an error occurs.
10211    pub fn send(self) -> Result<(), fidl::Error> {
10212        let _result = self.send_raw();
10213        if _result.is_err() {
10214            self.control_handle.shutdown();
10215        }
10216        self.drop_without_shutdown();
10217        _result
10218    }
10219
10220    /// Similar to "send" but does not shutdown the channel if an error occurs.
10221    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
10222        let _result = self.send_raw();
10223        self.drop_without_shutdown();
10224        _result
10225    }
10226
10227    fn send_raw(&self) -> Result<(), fidl::Error> {
10228        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
10229            (),
10230            self.tx_id,
10231            0x7045e3cd460dc42c,
10232            fidl::encoding::DynamicFlags::empty(),
10233        )
10234    }
10235}
10236
10237#[must_use = "FIDL methods require a response to be sent"]
10238#[derive(Debug)]
10239pub struct WlanSoftmacIfcBridgeStopBridgedDriverResponder {
10240    control_handle: std::mem::ManuallyDrop<WlanSoftmacIfcBridgeControlHandle>,
10241    tx_id: u32,
10242}
10243
10244/// Set the the channel to be shutdown (see [`WlanSoftmacIfcBridgeControlHandle::shutdown`])
10245/// if the responder is dropped without sending a response, so that the client
10246/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10247impl std::ops::Drop for WlanSoftmacIfcBridgeStopBridgedDriverResponder {
10248    fn drop(&mut self) {
10249        self.control_handle.shutdown();
10250        // Safety: drops once, never accessed again
10251        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10252    }
10253}
10254
10255impl fidl::endpoints::Responder for WlanSoftmacIfcBridgeStopBridgedDriverResponder {
10256    type ControlHandle = WlanSoftmacIfcBridgeControlHandle;
10257
10258    fn control_handle(&self) -> &WlanSoftmacIfcBridgeControlHandle {
10259        &self.control_handle
10260    }
10261
10262    fn drop_without_shutdown(mut self) {
10263        // Safety: drops once, never accessed again due to mem::forget
10264        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10265        // Prevent Drop from running (which would shut down the channel)
10266        std::mem::forget(self);
10267    }
10268}
10269
10270impl WlanSoftmacIfcBridgeStopBridgedDriverResponder {
10271    /// Sends a response to the FIDL transaction.
10272    ///
10273    /// Sets the channel to shutdown if an error occurs.
10274    pub fn send(self) -> Result<(), fidl::Error> {
10275        let _result = self.send_raw();
10276        if _result.is_err() {
10277            self.control_handle.shutdown();
10278        }
10279        self.drop_without_shutdown();
10280        _result
10281    }
10282
10283    /// Similar to "send" but does not shutdown the channel if an error occurs.
10284    pub fn send_no_shutdown_on_err(self) -> Result<(), fidl::Error> {
10285        let _result = self.send_raw();
10286        self.drop_without_shutdown();
10287        _result
10288    }
10289
10290    fn send_raw(&self) -> Result<(), fidl::Error> {
10291        self.control_handle.inner.send::<fidl::encoding::EmptyPayload>(
10292            (),
10293            self.tx_id,
10294            0x112dbd0cc2251151,
10295            fidl::encoding::DynamicFlags::empty(),
10296        )
10297    }
10298}
10299
10300#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
10301pub struct WlanTxMarker;
10302
10303impl fidl::endpoints::ProtocolMarker for WlanTxMarker {
10304    type Proxy = WlanTxProxy;
10305    type RequestStream = WlanTxRequestStream;
10306    #[cfg(target_os = "fuchsia")]
10307    type SynchronousProxy = WlanTxSynchronousProxy;
10308
10309    const DEBUG_NAME: &'static str = "(anonymous) WlanTx";
10310}
10311pub type WlanTxTransferResult = Result<(), i32>;
10312
10313pub trait WlanTxProxyInterface: Send + Sync {
10314    type TransferResponseFut: std::future::Future<Output = Result<WlanTxTransferResult, fidl::Error>>
10315        + Send;
10316    fn r#transfer(&self, payload: &WlanTxTransferRequest) -> Self::TransferResponseFut;
10317}
10318#[derive(Debug)]
10319#[cfg(target_os = "fuchsia")]
10320pub struct WlanTxSynchronousProxy {
10321    client: fidl::client::sync::Client,
10322}
10323
10324#[cfg(target_os = "fuchsia")]
10325impl fidl::endpoints::SynchronousProxy for WlanTxSynchronousProxy {
10326    type Proxy = WlanTxProxy;
10327    type Protocol = WlanTxMarker;
10328
10329    fn from_channel(inner: fidl::Channel) -> Self {
10330        Self::new(inner)
10331    }
10332
10333    fn into_channel(self) -> fidl::Channel {
10334        self.client.into_channel()
10335    }
10336
10337    fn as_channel(&self) -> &fidl::Channel {
10338        self.client.as_channel()
10339    }
10340}
10341
10342#[cfg(target_os = "fuchsia")]
10343impl WlanTxSynchronousProxy {
10344    pub fn new(channel: fidl::Channel) -> Self {
10345        let protocol_name = <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10346        Self { client: fidl::client::sync::Client::new(channel, protocol_name) }
10347    }
10348
10349    pub fn into_channel(self) -> fidl::Channel {
10350        self.client.into_channel()
10351    }
10352
10353    /// Waits until an event arrives and returns it. It is safe for other
10354    /// threads to make concurrent requests while waiting for an event.
10355    pub fn wait_for_event(
10356        &self,
10357        deadline: zx::MonotonicInstant,
10358    ) -> Result<WlanTxEvent, fidl::Error> {
10359        WlanTxEvent::decode(self.client.wait_for_event(deadline)?)
10360    }
10361
10362    pub fn r#transfer(
10363        &self,
10364        mut payload: &WlanTxTransferRequest,
10365        ___deadline: zx::MonotonicInstant,
10366    ) -> Result<WlanTxTransferResult, fidl::Error> {
10367        let _response = self.client.send_query::<
10368            WlanTxTransferRequest,
10369            fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10370        >(
10371            payload,
10372            0x19f8ff7a8b910ab3,
10373            fidl::encoding::DynamicFlags::empty(),
10374            ___deadline,
10375        )?;
10376        Ok(_response.map(|x| x))
10377    }
10378}
10379
10380#[derive(Debug, Clone)]
10381pub struct WlanTxProxy {
10382    client: fidl::client::Client<fidl::encoding::DefaultFuchsiaResourceDialect>,
10383}
10384
10385impl fidl::endpoints::Proxy for WlanTxProxy {
10386    type Protocol = WlanTxMarker;
10387
10388    fn from_channel(inner: ::fidl::AsyncChannel) -> Self {
10389        Self::new(inner)
10390    }
10391
10392    fn into_channel(self) -> Result<::fidl::AsyncChannel, Self> {
10393        self.client.into_channel().map_err(|client| Self { client })
10394    }
10395
10396    fn as_channel(&self) -> &::fidl::AsyncChannel {
10397        self.client.as_channel()
10398    }
10399}
10400
10401impl WlanTxProxy {
10402    /// Create a new Proxy for fuchsia.wlan.softmac/WlanTx.
10403    pub fn new(channel: ::fidl::AsyncChannel) -> Self {
10404        let protocol_name = <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME;
10405        Self { client: fidl::client::Client::new(channel, protocol_name) }
10406    }
10407
10408    /// Get a Stream of events from the remote end of the protocol.
10409    ///
10410    /// # Panics
10411    ///
10412    /// Panics if the event stream was already taken.
10413    pub fn take_event_stream(&self) -> WlanTxEventStream {
10414        WlanTxEventStream { event_receiver: self.client.take_event_receiver() }
10415    }
10416
10417    pub fn r#transfer(
10418        &self,
10419        mut payload: &WlanTxTransferRequest,
10420    ) -> fidl::client::QueryResponseFut<
10421        WlanTxTransferResult,
10422        fidl::encoding::DefaultFuchsiaResourceDialect,
10423    > {
10424        WlanTxProxyInterface::r#transfer(self, payload)
10425    }
10426}
10427
10428impl WlanTxProxyInterface for WlanTxProxy {
10429    type TransferResponseFut = fidl::client::QueryResponseFut<
10430        WlanTxTransferResult,
10431        fidl::encoding::DefaultFuchsiaResourceDialect,
10432    >;
10433    fn r#transfer(&self, mut payload: &WlanTxTransferRequest) -> Self::TransferResponseFut {
10434        fn _decode(
10435            mut _buf: Result<<fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc, fidl::Error>,
10436        ) -> Result<WlanTxTransferResult, fidl::Error> {
10437            let _response = fidl::client::decode_transaction_body::<
10438                fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>,
10439                fidl::encoding::DefaultFuchsiaResourceDialect,
10440                0x19f8ff7a8b910ab3,
10441            >(_buf?)?;
10442            Ok(_response.map(|x| x))
10443        }
10444        self.client.send_query_and_decode::<WlanTxTransferRequest, WlanTxTransferResult>(
10445            payload,
10446            0x19f8ff7a8b910ab3,
10447            fidl::encoding::DynamicFlags::empty(),
10448            _decode,
10449        )
10450    }
10451}
10452
10453pub struct WlanTxEventStream {
10454    event_receiver: fidl::client::EventReceiver<fidl::encoding::DefaultFuchsiaResourceDialect>,
10455}
10456
10457impl std::marker::Unpin for WlanTxEventStream {}
10458
10459impl futures::stream::FusedStream for WlanTxEventStream {
10460    fn is_terminated(&self) -> bool {
10461        self.event_receiver.is_terminated()
10462    }
10463}
10464
10465impl futures::Stream for WlanTxEventStream {
10466    type Item = Result<WlanTxEvent, fidl::Error>;
10467
10468    fn poll_next(
10469        mut self: std::pin::Pin<&mut Self>,
10470        cx: &mut std::task::Context<'_>,
10471    ) -> std::task::Poll<Option<Self::Item>> {
10472        match futures::ready!(futures::stream::StreamExt::poll_next_unpin(
10473            &mut self.event_receiver,
10474            cx
10475        )?) {
10476            Some(buf) => std::task::Poll::Ready(Some(WlanTxEvent::decode(buf))),
10477            None => std::task::Poll::Ready(None),
10478        }
10479    }
10480}
10481
10482#[derive(Debug)]
10483pub enum WlanTxEvent {}
10484
10485impl WlanTxEvent {
10486    /// Decodes a message buffer as a [`WlanTxEvent`].
10487    fn decode(
10488        mut buf: <fidl::encoding::DefaultFuchsiaResourceDialect as fidl::encoding::ResourceDialect>::MessageBufEtc,
10489    ) -> Result<WlanTxEvent, fidl::Error> {
10490        let (bytes, _handles) = buf.split_mut();
10491        let (tx_header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10492        debug_assert_eq!(tx_header.tx_id, 0);
10493        match tx_header.ordinal {
10494            _ => Err(fidl::Error::UnknownOrdinal {
10495                ordinal: tx_header.ordinal,
10496                protocol_name: <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10497            }),
10498        }
10499    }
10500}
10501
10502/// A Stream of incoming requests for fuchsia.wlan.softmac/WlanTx.
10503pub struct WlanTxRequestStream {
10504    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10505    is_terminated: bool,
10506}
10507
10508impl std::marker::Unpin for WlanTxRequestStream {}
10509
10510impl futures::stream::FusedStream for WlanTxRequestStream {
10511    fn is_terminated(&self) -> bool {
10512        self.is_terminated
10513    }
10514}
10515
10516impl fidl::endpoints::RequestStream for WlanTxRequestStream {
10517    type Protocol = WlanTxMarker;
10518    type ControlHandle = WlanTxControlHandle;
10519
10520    fn from_channel(channel: ::fidl::AsyncChannel) -> Self {
10521        Self { inner: std::sync::Arc::new(fidl::ServeInner::new(channel)), is_terminated: false }
10522    }
10523
10524    fn control_handle(&self) -> Self::ControlHandle {
10525        WlanTxControlHandle { inner: self.inner.clone() }
10526    }
10527
10528    fn into_inner(
10529        self,
10530    ) -> (::std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>, bool)
10531    {
10532        (self.inner, self.is_terminated)
10533    }
10534
10535    fn from_inner(
10536        inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10537        is_terminated: bool,
10538    ) -> Self {
10539        Self { inner, is_terminated }
10540    }
10541}
10542
10543impl futures::Stream for WlanTxRequestStream {
10544    type Item = Result<WlanTxRequest, fidl::Error>;
10545
10546    fn poll_next(
10547        mut self: std::pin::Pin<&mut Self>,
10548        cx: &mut std::task::Context<'_>,
10549    ) -> std::task::Poll<Option<Self::Item>> {
10550        let this = &mut *self;
10551        if this.inner.check_shutdown(cx) {
10552            this.is_terminated = true;
10553            return std::task::Poll::Ready(None);
10554        }
10555        if this.is_terminated {
10556            panic!("polled WlanTxRequestStream after completion");
10557        }
10558        fidl::encoding::with_tls_decode_buf::<_, fidl::encoding::DefaultFuchsiaResourceDialect>(
10559            |bytes, handles| {
10560                match this.inner.channel().read_etc(cx, bytes, handles) {
10561                    std::task::Poll::Ready(Ok(())) => {}
10562                    std::task::Poll::Pending => return std::task::Poll::Pending,
10563                    std::task::Poll::Ready(Err(zx_status::Status::PEER_CLOSED)) => {
10564                        this.is_terminated = true;
10565                        return std::task::Poll::Ready(None);
10566                    }
10567                    std::task::Poll::Ready(Err(e)) => {
10568                        return std::task::Poll::Ready(Some(Err(fidl::Error::ServerRequestRead(
10569                            e.into(),
10570                        ))))
10571                    }
10572                }
10573
10574                // A message has been received from the channel
10575                let (header, _body_bytes) = fidl::encoding::decode_transaction_header(bytes)?;
10576
10577                std::task::Poll::Ready(Some(match header.ordinal {
10578                    0x19f8ff7a8b910ab3 => {
10579                        header.validate_request_tx_id(fidl::MethodType::TwoWay)?;
10580                        let mut req = fidl::new_empty!(
10581                            WlanTxTransferRequest,
10582                            fidl::encoding::DefaultFuchsiaResourceDialect
10583                        );
10584                        fidl::encoding::Decoder::<fidl::encoding::DefaultFuchsiaResourceDialect>::decode_into::<WlanTxTransferRequest>(&header, _body_bytes, handles, &mut req)?;
10585                        let control_handle = WlanTxControlHandle { inner: this.inner.clone() };
10586                        Ok(WlanTxRequest::Transfer {
10587                            payload: req,
10588                            responder: WlanTxTransferResponder {
10589                                control_handle: std::mem::ManuallyDrop::new(control_handle),
10590                                tx_id: header.tx_id,
10591                            },
10592                        })
10593                    }
10594                    _ => Err(fidl::Error::UnknownOrdinal {
10595                        ordinal: header.ordinal,
10596                        protocol_name:
10597                            <WlanTxMarker as fidl::endpoints::ProtocolMarker>::DEBUG_NAME,
10598                    }),
10599                }))
10600            },
10601        )
10602    }
10603}
10604
10605/// Protocol for sending a WLAN frame from the bridged wlansoftmac
10606/// driver to the wlansoftmac driver.
10607///
10608/// # Experimental
10609///
10610/// This protocol is implemented as a foreign function interface (FFI)
10611/// between the wlansoftmac driver and the bridged driver solely to improve
10612/// the performance of processing data frames through the wlan-mlme library.
10613#[derive(Debug)]
10614pub enum WlanTxRequest {
10615    Transfer { payload: WlanTxTransferRequest, responder: WlanTxTransferResponder },
10616}
10617
10618impl WlanTxRequest {
10619    #[allow(irrefutable_let_patterns)]
10620    pub fn into_transfer(self) -> Option<(WlanTxTransferRequest, WlanTxTransferResponder)> {
10621        if let WlanTxRequest::Transfer { payload, responder } = self {
10622            Some((payload, responder))
10623        } else {
10624            None
10625        }
10626    }
10627
10628    /// Name of the method defined in FIDL
10629    pub fn method_name(&self) -> &'static str {
10630        match *self {
10631            WlanTxRequest::Transfer { .. } => "transfer",
10632        }
10633    }
10634}
10635
10636#[derive(Debug, Clone)]
10637pub struct WlanTxControlHandle {
10638    inner: std::sync::Arc<fidl::ServeInner<fidl::encoding::DefaultFuchsiaResourceDialect>>,
10639}
10640
10641impl fidl::endpoints::ControlHandle for WlanTxControlHandle {
10642    fn shutdown(&self) {
10643        self.inner.shutdown()
10644    }
10645    fn shutdown_with_epitaph(&self, status: zx_status::Status) {
10646        self.inner.shutdown_with_epitaph(status)
10647    }
10648
10649    fn is_closed(&self) -> bool {
10650        self.inner.channel().is_closed()
10651    }
10652    fn on_closed(&self) -> fidl::OnSignalsRef<'_> {
10653        self.inner.channel().on_closed()
10654    }
10655
10656    #[cfg(target_os = "fuchsia")]
10657    fn signal_peer(
10658        &self,
10659        clear_mask: zx::Signals,
10660        set_mask: zx::Signals,
10661    ) -> Result<(), zx_status::Status> {
10662        use fidl::Peered;
10663        self.inner.channel().signal_peer(clear_mask, set_mask)
10664    }
10665}
10666
10667impl WlanTxControlHandle {}
10668
10669#[must_use = "FIDL methods require a response to be sent"]
10670#[derive(Debug)]
10671pub struct WlanTxTransferResponder {
10672    control_handle: std::mem::ManuallyDrop<WlanTxControlHandle>,
10673    tx_id: u32,
10674}
10675
10676/// Set the the channel to be shutdown (see [`WlanTxControlHandle::shutdown`])
10677/// if the responder is dropped without sending a response, so that the client
10678/// doesn't hang. To prevent this behavior, call `drop_without_shutdown`.
10679impl std::ops::Drop for WlanTxTransferResponder {
10680    fn drop(&mut self) {
10681        self.control_handle.shutdown();
10682        // Safety: drops once, never accessed again
10683        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10684    }
10685}
10686
10687impl fidl::endpoints::Responder for WlanTxTransferResponder {
10688    type ControlHandle = WlanTxControlHandle;
10689
10690    fn control_handle(&self) -> &WlanTxControlHandle {
10691        &self.control_handle
10692    }
10693
10694    fn drop_without_shutdown(mut self) {
10695        // Safety: drops once, never accessed again due to mem::forget
10696        unsafe { std::mem::ManuallyDrop::drop(&mut self.control_handle) };
10697        // Prevent Drop from running (which would shut down the channel)
10698        std::mem::forget(self);
10699    }
10700}
10701
10702impl WlanTxTransferResponder {
10703    /// Sends a response to the FIDL transaction.
10704    ///
10705    /// Sets the channel to shutdown if an error occurs.
10706    pub fn send(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10707        let _result = self.send_raw(result);
10708        if _result.is_err() {
10709            self.control_handle.shutdown();
10710        }
10711        self.drop_without_shutdown();
10712        _result
10713    }
10714
10715    /// Similar to "send" but does not shutdown the channel if an error occurs.
10716    pub fn send_no_shutdown_on_err(self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10717        let _result = self.send_raw(result);
10718        self.drop_without_shutdown();
10719        _result
10720    }
10721
10722    fn send_raw(&self, mut result: Result<(), i32>) -> Result<(), fidl::Error> {
10723        self.control_handle
10724            .inner
10725            .send::<fidl::encoding::ResultType<fidl::encoding::EmptyStruct, i32>>(
10726                result,
10727                self.tx_id,
10728                0x19f8ff7a8b910ab3,
10729                fidl::encoding::DynamicFlags::empty(),
10730            )
10731    }
10732}
10733
10734mod internal {
10735    use super::*;
10736    unsafe impl fidl::encoding::TypeMarker for WlanRxInfoFlags {
10737        type Owned = Self;
10738
10739        #[inline(always)]
10740        fn inline_align(_context: fidl::encoding::Context) -> usize {
10741            4
10742        }
10743
10744        #[inline(always)]
10745        fn inline_size(_context: fidl::encoding::Context) -> usize {
10746            4
10747        }
10748    }
10749
10750    impl fidl::encoding::ValueTypeMarker for WlanRxInfoFlags {
10751        type Borrowed<'a> = Self;
10752        #[inline(always)]
10753        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10754            *value
10755        }
10756    }
10757
10758    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10759        for WlanRxInfoFlags
10760    {
10761        #[inline]
10762        unsafe fn encode(
10763            self,
10764            encoder: &mut fidl::encoding::Encoder<'_, D>,
10765            offset: usize,
10766            _depth: fidl::encoding::Depth,
10767        ) -> fidl::Result<()> {
10768            encoder.debug_check_bounds::<Self>(offset);
10769            encoder.write_num(self.bits(), offset);
10770            Ok(())
10771        }
10772    }
10773
10774    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoFlags {
10775        #[inline(always)]
10776        fn new_empty() -> Self {
10777            Self::empty()
10778        }
10779
10780        #[inline]
10781        unsafe fn decode(
10782            &mut self,
10783            decoder: &mut fidl::encoding::Decoder<'_, D>,
10784            offset: usize,
10785            _depth: fidl::encoding::Depth,
10786        ) -> fidl::Result<()> {
10787            decoder.debug_check_bounds::<Self>(offset);
10788            let prim = decoder.read_num::<u32>(offset);
10789            *self = Self::from_bits_allow_unknown(prim);
10790            Ok(())
10791        }
10792    }
10793    unsafe impl fidl::encoding::TypeMarker for WlanRxInfoValid {
10794        type Owned = Self;
10795
10796        #[inline(always)]
10797        fn inline_align(_context: fidl::encoding::Context) -> usize {
10798            4
10799        }
10800
10801        #[inline(always)]
10802        fn inline_size(_context: fidl::encoding::Context) -> usize {
10803            4
10804        }
10805    }
10806
10807    impl fidl::encoding::ValueTypeMarker for WlanRxInfoValid {
10808        type Borrowed<'a> = Self;
10809        #[inline(always)]
10810        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10811            *value
10812        }
10813    }
10814
10815    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10816        for WlanRxInfoValid
10817    {
10818        #[inline]
10819        unsafe fn encode(
10820            self,
10821            encoder: &mut fidl::encoding::Encoder<'_, D>,
10822            offset: usize,
10823            _depth: fidl::encoding::Depth,
10824        ) -> fidl::Result<()> {
10825            encoder.debug_check_bounds::<Self>(offset);
10826            encoder.write_num(self.bits(), offset);
10827            Ok(())
10828        }
10829    }
10830
10831    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfoValid {
10832        #[inline(always)]
10833        fn new_empty() -> Self {
10834            Self::empty()
10835        }
10836
10837        #[inline]
10838        unsafe fn decode(
10839            &mut self,
10840            decoder: &mut fidl::encoding::Decoder<'_, D>,
10841            offset: usize,
10842            _depth: fidl::encoding::Depth,
10843        ) -> fidl::Result<()> {
10844            decoder.debug_check_bounds::<Self>(offset);
10845            let prim = decoder.read_num::<u32>(offset);
10846            *self = Self::from_bits_allow_unknown(prim);
10847            Ok(())
10848        }
10849    }
10850    unsafe impl fidl::encoding::TypeMarker for WlanTxInfoFlags {
10851        type Owned = Self;
10852
10853        #[inline(always)]
10854        fn inline_align(_context: fidl::encoding::Context) -> usize {
10855            4
10856        }
10857
10858        #[inline(always)]
10859        fn inline_size(_context: fidl::encoding::Context) -> usize {
10860            4
10861        }
10862    }
10863
10864    impl fidl::encoding::ValueTypeMarker for WlanTxInfoFlags {
10865        type Borrowed<'a> = Self;
10866        #[inline(always)]
10867        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10868            *value
10869        }
10870    }
10871
10872    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10873        for WlanTxInfoFlags
10874    {
10875        #[inline]
10876        unsafe fn encode(
10877            self,
10878            encoder: &mut fidl::encoding::Encoder<'_, D>,
10879            offset: usize,
10880            _depth: fidl::encoding::Depth,
10881        ) -> fidl::Result<()> {
10882            encoder.debug_check_bounds::<Self>(offset);
10883            encoder.write_num(self.bits(), offset);
10884            Ok(())
10885        }
10886    }
10887
10888    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoFlags {
10889        #[inline(always)]
10890        fn new_empty() -> Self {
10891            Self::empty()
10892        }
10893
10894        #[inline]
10895        unsafe fn decode(
10896            &mut self,
10897            decoder: &mut fidl::encoding::Decoder<'_, D>,
10898            offset: usize,
10899            _depth: fidl::encoding::Depth,
10900        ) -> fidl::Result<()> {
10901            decoder.debug_check_bounds::<Self>(offset);
10902            let prim = decoder.read_num::<u32>(offset);
10903            *self = Self::from_bits_allow_unknown(prim);
10904            Ok(())
10905        }
10906    }
10907    unsafe impl fidl::encoding::TypeMarker for WlanTxInfoValid {
10908        type Owned = Self;
10909
10910        #[inline(always)]
10911        fn inline_align(_context: fidl::encoding::Context) -> usize {
10912            4
10913        }
10914
10915        #[inline(always)]
10916        fn inline_size(_context: fidl::encoding::Context) -> usize {
10917            4
10918        }
10919    }
10920
10921    impl fidl::encoding::ValueTypeMarker for WlanTxInfoValid {
10922        type Borrowed<'a> = Self;
10923        #[inline(always)]
10924        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10925            *value
10926        }
10927    }
10928
10929    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
10930        for WlanTxInfoValid
10931    {
10932        #[inline]
10933        unsafe fn encode(
10934            self,
10935            encoder: &mut fidl::encoding::Encoder<'_, D>,
10936            offset: usize,
10937            _depth: fidl::encoding::Depth,
10938        ) -> fidl::Result<()> {
10939            encoder.debug_check_bounds::<Self>(offset);
10940            encoder.write_num(self.bits(), offset);
10941            Ok(())
10942        }
10943    }
10944
10945    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfoValid {
10946        #[inline(always)]
10947        fn new_empty() -> Self {
10948            Self::empty()
10949        }
10950
10951        #[inline]
10952        unsafe fn decode(
10953            &mut self,
10954            decoder: &mut fidl::encoding::Decoder<'_, D>,
10955            offset: usize,
10956            _depth: fidl::encoding::Depth,
10957        ) -> fidl::Result<()> {
10958            decoder.debug_check_bounds::<Self>(offset);
10959            let prim = decoder.read_num::<u32>(offset);
10960            *self = Self::from_bits_allow_unknown(prim);
10961            Ok(())
10962        }
10963    }
10964    unsafe impl fidl::encoding::TypeMarker for WlanProtection {
10965        type Owned = Self;
10966
10967        #[inline(always)]
10968        fn inline_align(_context: fidl::encoding::Context) -> usize {
10969            std::mem::align_of::<u8>()
10970        }
10971
10972        #[inline(always)]
10973        fn inline_size(_context: fidl::encoding::Context) -> usize {
10974            std::mem::size_of::<u8>()
10975        }
10976
10977        #[inline(always)]
10978        fn encode_is_copy() -> bool {
10979            true
10980        }
10981
10982        #[inline(always)]
10983        fn decode_is_copy() -> bool {
10984            false
10985        }
10986    }
10987
10988    impl fidl::encoding::ValueTypeMarker for WlanProtection {
10989        type Borrowed<'a> = Self;
10990        #[inline(always)]
10991        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
10992            *value
10993        }
10994    }
10995
10996    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
10997        #[inline]
10998        unsafe fn encode(
10999            self,
11000            encoder: &mut fidl::encoding::Encoder<'_, D>,
11001            offset: usize,
11002            _depth: fidl::encoding::Depth,
11003        ) -> fidl::Result<()> {
11004            encoder.debug_check_bounds::<Self>(offset);
11005            encoder.write_num(self.into_primitive(), offset);
11006            Ok(())
11007        }
11008    }
11009
11010    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
11011        #[inline(always)]
11012        fn new_empty() -> Self {
11013            Self::None
11014        }
11015
11016        #[inline]
11017        unsafe fn decode(
11018            &mut self,
11019            decoder: &mut fidl::encoding::Decoder<'_, D>,
11020            offset: usize,
11021            _depth: fidl::encoding::Depth,
11022        ) -> fidl::Result<()> {
11023            decoder.debug_check_bounds::<Self>(offset);
11024            let prim = decoder.read_num::<u8>(offset);
11025
11026            *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
11027            Ok(())
11028        }
11029    }
11030
11031    impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
11032        type Borrowed<'a> = &'a Self;
11033        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11034            value
11035        }
11036    }
11037
11038    unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
11039        type Owned = Self;
11040
11041        #[inline(always)]
11042        fn inline_align(_context: fidl::encoding::Context) -> usize {
11043            4
11044        }
11045
11046        #[inline(always)]
11047        fn inline_size(_context: fidl::encoding::Context) -> usize {
11048            32
11049        }
11050    }
11051
11052    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
11053        for &WlanRxInfo
11054    {
11055        #[inline]
11056        unsafe fn encode(
11057            self,
11058            encoder: &mut fidl::encoding::Encoder<'_, D>,
11059            offset: usize,
11060            _depth: fidl::encoding::Depth,
11061        ) -> fidl::Result<()> {
11062            encoder.debug_check_bounds::<WlanRxInfo>(offset);
11063            // Delegate to tuple encoding.
11064            fidl::encoding::Encode::<WlanRxInfo, D>::encode(
11065                (
11066                    <WlanRxInfoFlags as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
11067                    <WlanRxInfoValid as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
11068                    <fidl_fuchsia_wlan_common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
11069                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
11070                    <fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
11071                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
11072                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
11073                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
11074                ),
11075                encoder, offset, _depth
11076            )
11077        }
11078    }
11079    unsafe impl<
11080            D: fidl::encoding::ResourceDialect,
11081            T0: fidl::encoding::Encode<WlanRxInfoFlags, D>,
11082            T1: fidl::encoding::Encode<WlanRxInfoValid, D>,
11083            T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanPhyType, D>,
11084            T3: fidl::encoding::Encode<u32, D>,
11085            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanChannel, D>,
11086            T5: fidl::encoding::Encode<u8, D>,
11087            T6: fidl::encoding::Encode<i8, D>,
11088            T7: fidl::encoding::Encode<i16, D>,
11089        > fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
11090    {
11091        #[inline]
11092        unsafe fn encode(
11093            self,
11094            encoder: &mut fidl::encoding::Encoder<'_, D>,
11095            offset: usize,
11096            depth: fidl::encoding::Depth,
11097        ) -> fidl::Result<()> {
11098            encoder.debug_check_bounds::<WlanRxInfo>(offset);
11099            // Zero out padding regions. There's no need to apply masks
11100            // because the unmasked parts will be overwritten by fields.
11101            // Write the fields.
11102            self.0.encode(encoder, offset + 0, depth)?;
11103            self.1.encode(encoder, offset + 4, depth)?;
11104            self.2.encode(encoder, offset + 8, depth)?;
11105            self.3.encode(encoder, offset + 12, depth)?;
11106            self.4.encode(encoder, offset + 16, depth)?;
11107            self.5.encode(encoder, offset + 28, depth)?;
11108            self.6.encode(encoder, offset + 29, depth)?;
11109            self.7.encode(encoder, offset + 30, depth)?;
11110            Ok(())
11111        }
11112    }
11113
11114    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
11115        #[inline(always)]
11116        fn new_empty() -> Self {
11117            Self {
11118                rx_flags: fidl::new_empty!(WlanRxInfoFlags, D),
11119                valid_fields: fidl::new_empty!(WlanRxInfoValid, D),
11120                phy: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanPhyType, D),
11121                data_rate: fidl::new_empty!(u32, D),
11122                channel: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D),
11123                mcs: fidl::new_empty!(u8, D),
11124                rssi_dbm: fidl::new_empty!(i8, D),
11125                snr_dbh: fidl::new_empty!(i16, D),
11126            }
11127        }
11128
11129        #[inline]
11130        unsafe fn decode(
11131            &mut self,
11132            decoder: &mut fidl::encoding::Decoder<'_, D>,
11133            offset: usize,
11134            _depth: fidl::encoding::Depth,
11135        ) -> fidl::Result<()> {
11136            decoder.debug_check_bounds::<Self>(offset);
11137            // Verify that padding bytes are zero.
11138            fidl::decode!(WlanRxInfoFlags, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
11139            fidl::decode!(WlanRxInfoValid, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
11140            fidl::decode!(
11141                fidl_fuchsia_wlan_common::WlanPhyType,
11142                D,
11143                &mut self.phy,
11144                decoder,
11145                offset + 8,
11146                _depth
11147            )?;
11148            fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
11149            fidl::decode!(
11150                fidl_fuchsia_wlan_common::WlanChannel,
11151                D,
11152                &mut self.channel,
11153                decoder,
11154                offset + 16,
11155                _depth
11156            )?;
11157            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
11158            fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
11159            fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
11160            Ok(())
11161        }
11162    }
11163
11164    impl fidl::encoding::ValueTypeMarker for WlanRxPacket {
11165        type Borrowed<'a> = &'a Self;
11166        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11167            value
11168        }
11169    }
11170
11171    unsafe impl fidl::encoding::TypeMarker for WlanRxPacket {
11172        type Owned = Self;
11173
11174        #[inline(always)]
11175        fn inline_align(_context: fidl::encoding::Context) -> usize {
11176            8
11177        }
11178
11179        #[inline(always)]
11180        fn inline_size(_context: fidl::encoding::Context) -> usize {
11181            48
11182        }
11183    }
11184
11185    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxPacket, D>
11186        for &WlanRxPacket
11187    {
11188        #[inline]
11189        unsafe fn encode(
11190            self,
11191            encoder: &mut fidl::encoding::Encoder<'_, D>,
11192            offset: usize,
11193            _depth: fidl::encoding::Depth,
11194        ) -> fidl::Result<()> {
11195            encoder.debug_check_bounds::<WlanRxPacket>(offset);
11196            // Delegate to tuple encoding.
11197            fidl::encoding::Encode::<WlanRxPacket, D>::encode(
11198                (
11199                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
11200                    <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
11201                ),
11202                encoder, offset, _depth
11203            )
11204        }
11205    }
11206    unsafe impl<
11207            D: fidl::encoding::ResourceDialect,
11208            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
11209            T1: fidl::encoding::Encode<WlanRxInfo, D>,
11210        > fidl::encoding::Encode<WlanRxPacket, D> for (T0, T1)
11211    {
11212        #[inline]
11213        unsafe fn encode(
11214            self,
11215            encoder: &mut fidl::encoding::Encoder<'_, D>,
11216            offset: usize,
11217            depth: fidl::encoding::Depth,
11218        ) -> fidl::Result<()> {
11219            encoder.debug_check_bounds::<WlanRxPacket>(offset);
11220            // Zero out padding regions. There's no need to apply masks
11221            // because the unmasked parts will be overwritten by fields.
11222            // Write the fields.
11223            self.0.encode(encoder, offset + 0, depth)?;
11224            self.1.encode(encoder, offset + 16, depth)?;
11225            Ok(())
11226        }
11227    }
11228
11229    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxPacket {
11230        #[inline(always)]
11231        fn new_empty() -> Self {
11232            Self {
11233                mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
11234                info: fidl::new_empty!(WlanRxInfo, D),
11235            }
11236        }
11237
11238        #[inline]
11239        unsafe fn decode(
11240            &mut self,
11241            decoder: &mut fidl::encoding::Decoder<'_, D>,
11242            offset: usize,
11243            _depth: fidl::encoding::Depth,
11244        ) -> fidl::Result<()> {
11245            decoder.debug_check_bounds::<Self>(offset);
11246            // Verify that padding bytes are zero.
11247            fidl::decode!(
11248                fidl::encoding::UnboundedVector<u8>,
11249                D,
11250                &mut self.mac_frame,
11251                decoder,
11252                offset + 0,
11253                _depth
11254            )?;
11255            fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
11256            Ok(())
11257        }
11258    }
11259
11260    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseJoinBssRequest {
11261        type Borrowed<'a> = &'a Self;
11262        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11263            value
11264        }
11265    }
11266
11267    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseJoinBssRequest {
11268        type Owned = Self;
11269
11270        #[inline(always)]
11271        fn inline_align(_context: fidl::encoding::Context) -> usize {
11272            8
11273        }
11274
11275        #[inline(always)]
11276        fn inline_size(_context: fidl::encoding::Context) -> usize {
11277            16
11278        }
11279    }
11280
11281    unsafe impl<D: fidl::encoding::ResourceDialect>
11282        fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D>
11283        for &WlanSoftmacBaseJoinBssRequest
11284    {
11285        #[inline]
11286        unsafe fn encode(
11287            self,
11288            encoder: &mut fidl::encoding::Encoder<'_, D>,
11289            offset: usize,
11290            _depth: fidl::encoding::Depth,
11291        ) -> fidl::Result<()> {
11292            encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
11293            // Delegate to tuple encoding.
11294            fidl::encoding::Encode::<WlanSoftmacBaseJoinBssRequest, D>::encode(
11295                (
11296                    <fidl_fuchsia_wlan_common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.join_request),
11297                ),
11298                encoder, offset, _depth
11299            )
11300        }
11301    }
11302    unsafe impl<
11303            D: fidl::encoding::ResourceDialect,
11304            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::JoinBssRequest, D>,
11305        > fidl::encoding::Encode<WlanSoftmacBaseJoinBssRequest, D> for (T0,)
11306    {
11307        #[inline]
11308        unsafe fn encode(
11309            self,
11310            encoder: &mut fidl::encoding::Encoder<'_, D>,
11311            offset: usize,
11312            depth: fidl::encoding::Depth,
11313        ) -> fidl::Result<()> {
11314            encoder.debug_check_bounds::<WlanSoftmacBaseJoinBssRequest>(offset);
11315            // Zero out padding regions. There's no need to apply masks
11316            // because the unmasked parts will be overwritten by fields.
11317            // Write the fields.
11318            self.0.encode(encoder, offset + 0, depth)?;
11319            Ok(())
11320        }
11321    }
11322
11323    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11324        for WlanSoftmacBaseJoinBssRequest
11325    {
11326        #[inline(always)]
11327        fn new_empty() -> Self {
11328            Self { join_request: fidl::new_empty!(fidl_fuchsia_wlan_common::JoinBssRequest, D) }
11329        }
11330
11331        #[inline]
11332        unsafe fn decode(
11333            &mut self,
11334            decoder: &mut fidl::encoding::Decoder<'_, D>,
11335            offset: usize,
11336            _depth: fidl::encoding::Depth,
11337        ) -> fidl::Result<()> {
11338            decoder.debug_check_bounds::<Self>(offset);
11339            // Verify that padding bytes are zero.
11340            fidl::decode!(
11341                fidl_fuchsia_wlan_common::JoinBssRequest,
11342                D,
11343                &mut self.join_request,
11344                decoder,
11345                offset + 0,
11346                _depth
11347            )?;
11348            Ok(())
11349        }
11350    }
11351
11352    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
11353        type Borrowed<'a> = &'a Self;
11354        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11355            value
11356        }
11357    }
11358
11359    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseNotifyAssociationCompleteRequest {
11360        type Owned = Self;
11361
11362        #[inline(always)]
11363        fn inline_align(_context: fidl::encoding::Context) -> usize {
11364            8
11365        }
11366
11367        #[inline(always)]
11368        fn inline_size(_context: fidl::encoding::Context) -> usize {
11369            16
11370        }
11371    }
11372
11373    unsafe impl<D: fidl::encoding::ResourceDialect>
11374        fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>
11375        for &WlanSoftmacBaseNotifyAssociationCompleteRequest
11376    {
11377        #[inline]
11378        unsafe fn encode(
11379            self,
11380            encoder: &mut fidl::encoding::Encoder<'_, D>,
11381            offset: usize,
11382            _depth: fidl::encoding::Depth,
11383        ) -> fidl::Result<()> {
11384            encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
11385            // Delegate to tuple encoding.
11386            fidl::encoding::Encode::<WlanSoftmacBaseNotifyAssociationCompleteRequest, D>::encode(
11387                (<WlanAssociationConfig as fidl::encoding::ValueTypeMarker>::borrow(
11388                    &self.assoc_cfg,
11389                ),),
11390                encoder,
11391                offset,
11392                _depth,
11393            )
11394        }
11395    }
11396    unsafe impl<
11397            D: fidl::encoding::ResourceDialect,
11398            T0: fidl::encoding::Encode<WlanAssociationConfig, D>,
11399        > fidl::encoding::Encode<WlanSoftmacBaseNotifyAssociationCompleteRequest, D> for (T0,)
11400    {
11401        #[inline]
11402        unsafe fn encode(
11403            self,
11404            encoder: &mut fidl::encoding::Encoder<'_, D>,
11405            offset: usize,
11406            depth: fidl::encoding::Depth,
11407        ) -> fidl::Result<()> {
11408            encoder.debug_check_bounds::<WlanSoftmacBaseNotifyAssociationCompleteRequest>(offset);
11409            // Zero out padding regions. There's no need to apply masks
11410            // because the unmasked parts will be overwritten by fields.
11411            // Write the fields.
11412            self.0.encode(encoder, offset + 0, depth)?;
11413            Ok(())
11414        }
11415    }
11416
11417    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11418        for WlanSoftmacBaseNotifyAssociationCompleteRequest
11419    {
11420        #[inline(always)]
11421        fn new_empty() -> Self {
11422            Self { assoc_cfg: fidl::new_empty!(WlanAssociationConfig, D) }
11423        }
11424
11425        #[inline]
11426        unsafe fn decode(
11427            &mut self,
11428            decoder: &mut fidl::encoding::Decoder<'_, D>,
11429            offset: usize,
11430            _depth: fidl::encoding::Depth,
11431        ) -> fidl::Result<()> {
11432            decoder.debug_check_bounds::<Self>(offset);
11433            // Verify that padding bytes are zero.
11434            fidl::decode!(
11435                WlanAssociationConfig,
11436                D,
11437                &mut self.assoc_cfg,
11438                decoder,
11439                offset + 0,
11440                _depth
11441            )?;
11442            Ok(())
11443        }
11444    }
11445
11446    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
11447        type Borrowed<'a> = &'a Self;
11448        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11449            value
11450        }
11451    }
11452
11453    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryDiscoverySupportResponse {
11454        type Owned = Self;
11455
11456        #[inline(always)]
11457        fn inline_align(_context: fidl::encoding::Context) -> usize {
11458            1
11459        }
11460
11461        #[inline(always)]
11462        fn inline_size(_context: fidl::encoding::Context) -> usize {
11463            3
11464        }
11465    }
11466
11467    unsafe impl<D: fidl::encoding::ResourceDialect>
11468        fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D>
11469        for &WlanSoftmacBaseQueryDiscoverySupportResponse
11470    {
11471        #[inline]
11472        unsafe fn encode(
11473            self,
11474            encoder: &mut fidl::encoding::Encoder<'_, D>,
11475            offset: usize,
11476            _depth: fidl::encoding::Depth,
11477        ) -> fidl::Result<()> {
11478            encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
11479            // Delegate to tuple encoding.
11480            fidl::encoding::Encode::<WlanSoftmacBaseQueryDiscoverySupportResponse, D>::encode(
11481                (
11482                    <fidl_fuchsia_wlan_common::DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
11483                ),
11484                encoder, offset, _depth
11485            )
11486        }
11487    }
11488    unsafe impl<
11489            D: fidl::encoding::ResourceDialect,
11490            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::DiscoverySupport, D>,
11491        > fidl::encoding::Encode<WlanSoftmacBaseQueryDiscoverySupportResponse, D> for (T0,)
11492    {
11493        #[inline]
11494        unsafe fn encode(
11495            self,
11496            encoder: &mut fidl::encoding::Encoder<'_, D>,
11497            offset: usize,
11498            depth: fidl::encoding::Depth,
11499        ) -> fidl::Result<()> {
11500            encoder.debug_check_bounds::<WlanSoftmacBaseQueryDiscoverySupportResponse>(offset);
11501            // Zero out padding regions. There's no need to apply masks
11502            // because the unmasked parts will be overwritten by fields.
11503            // Write the fields.
11504            self.0.encode(encoder, offset + 0, depth)?;
11505            Ok(())
11506        }
11507    }
11508
11509    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11510        for WlanSoftmacBaseQueryDiscoverySupportResponse
11511    {
11512        #[inline(always)]
11513        fn new_empty() -> Self {
11514            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::DiscoverySupport, D) }
11515        }
11516
11517        #[inline]
11518        unsafe fn decode(
11519            &mut self,
11520            decoder: &mut fidl::encoding::Decoder<'_, D>,
11521            offset: usize,
11522            _depth: fidl::encoding::Depth,
11523        ) -> fidl::Result<()> {
11524            decoder.debug_check_bounds::<Self>(offset);
11525            // Verify that padding bytes are zero.
11526            fidl::decode!(
11527                fidl_fuchsia_wlan_common::DiscoverySupport,
11528                D,
11529                &mut self.resp,
11530                decoder,
11531                offset + 0,
11532                _depth
11533            )?;
11534            Ok(())
11535        }
11536    }
11537
11538    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
11539        type Borrowed<'a> = &'a Self;
11540        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11541            value
11542        }
11543    }
11544
11545    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQueryMacSublayerSupportResponse {
11546        type Owned = Self;
11547
11548        #[inline(always)]
11549        fn inline_align(_context: fidl::encoding::Context) -> usize {
11550            1
11551        }
11552
11553        #[inline(always)]
11554        fn inline_size(_context: fidl::encoding::Context) -> usize {
11555            5
11556        }
11557    }
11558
11559    unsafe impl<D: fidl::encoding::ResourceDialect>
11560        fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>
11561        for &WlanSoftmacBaseQueryMacSublayerSupportResponse
11562    {
11563        #[inline]
11564        unsafe fn encode(
11565            self,
11566            encoder: &mut fidl::encoding::Encoder<'_, D>,
11567            offset: usize,
11568            _depth: fidl::encoding::Depth,
11569        ) -> fidl::Result<()> {
11570            encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
11571            // Delegate to tuple encoding.
11572            fidl::encoding::Encode::<WlanSoftmacBaseQueryMacSublayerSupportResponse, D>::encode(
11573                (
11574                    <fidl_fuchsia_wlan_common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
11575                ),
11576                encoder, offset, _depth
11577            )
11578        }
11579    }
11580    unsafe impl<
11581            D: fidl::encoding::ResourceDialect,
11582            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::MacSublayerSupport, D>,
11583        > fidl::encoding::Encode<WlanSoftmacBaseQueryMacSublayerSupportResponse, D> for (T0,)
11584    {
11585        #[inline]
11586        unsafe fn encode(
11587            self,
11588            encoder: &mut fidl::encoding::Encoder<'_, D>,
11589            offset: usize,
11590            depth: fidl::encoding::Depth,
11591        ) -> fidl::Result<()> {
11592            encoder.debug_check_bounds::<WlanSoftmacBaseQueryMacSublayerSupportResponse>(offset);
11593            // Zero out padding regions. There's no need to apply masks
11594            // because the unmasked parts will be overwritten by fields.
11595            // Write the fields.
11596            self.0.encode(encoder, offset + 0, depth)?;
11597            Ok(())
11598        }
11599    }
11600
11601    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11602        for WlanSoftmacBaseQueryMacSublayerSupportResponse
11603    {
11604        #[inline(always)]
11605        fn new_empty() -> Self {
11606            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::MacSublayerSupport, D) }
11607        }
11608
11609        #[inline]
11610        unsafe fn decode(
11611            &mut self,
11612            decoder: &mut fidl::encoding::Decoder<'_, D>,
11613            offset: usize,
11614            _depth: fidl::encoding::Depth,
11615        ) -> fidl::Result<()> {
11616            decoder.debug_check_bounds::<Self>(offset);
11617            // Verify that padding bytes are zero.
11618            fidl::decode!(
11619                fidl_fuchsia_wlan_common::MacSublayerSupport,
11620                D,
11621                &mut self.resp,
11622                decoder,
11623                offset + 0,
11624                _depth
11625            )?;
11626            Ok(())
11627        }
11628    }
11629
11630    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
11631        type Borrowed<'a> = &'a Self;
11632        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11633            value
11634        }
11635    }
11636
11637    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySecuritySupportResponse {
11638        type Owned = Self;
11639
11640        #[inline(always)]
11641        fn inline_align(_context: fidl::encoding::Context) -> usize {
11642            1
11643        }
11644
11645        #[inline(always)]
11646        fn inline_size(_context: fidl::encoding::Context) -> usize {
11647            3
11648        }
11649    }
11650
11651    unsafe impl<D: fidl::encoding::ResourceDialect>
11652        fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D>
11653        for &WlanSoftmacBaseQuerySecuritySupportResponse
11654    {
11655        #[inline]
11656        unsafe fn encode(
11657            self,
11658            encoder: &mut fidl::encoding::Encoder<'_, D>,
11659            offset: usize,
11660            _depth: fidl::encoding::Depth,
11661        ) -> fidl::Result<()> {
11662            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
11663            // Delegate to tuple encoding.
11664            fidl::encoding::Encode::<WlanSoftmacBaseQuerySecuritySupportResponse, D>::encode(
11665                (
11666                    <fidl_fuchsia_wlan_common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
11667                ),
11668                encoder, offset, _depth
11669            )
11670        }
11671    }
11672    unsafe impl<
11673            D: fidl::encoding::ResourceDialect,
11674            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SecuritySupport, D>,
11675        > fidl::encoding::Encode<WlanSoftmacBaseQuerySecuritySupportResponse, D> for (T0,)
11676    {
11677        #[inline]
11678        unsafe fn encode(
11679            self,
11680            encoder: &mut fidl::encoding::Encoder<'_, D>,
11681            offset: usize,
11682            depth: fidl::encoding::Depth,
11683        ) -> fidl::Result<()> {
11684            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySecuritySupportResponse>(offset);
11685            // Zero out padding regions. There's no need to apply masks
11686            // because the unmasked parts will be overwritten by fields.
11687            // Write the fields.
11688            self.0.encode(encoder, offset + 0, depth)?;
11689            Ok(())
11690        }
11691    }
11692
11693    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11694        for WlanSoftmacBaseQuerySecuritySupportResponse
11695    {
11696        #[inline(always)]
11697        fn new_empty() -> Self {
11698            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::SecuritySupport, D) }
11699        }
11700
11701        #[inline]
11702        unsafe fn decode(
11703            &mut self,
11704            decoder: &mut fidl::encoding::Decoder<'_, D>,
11705            offset: usize,
11706            _depth: fidl::encoding::Depth,
11707        ) -> fidl::Result<()> {
11708            decoder.debug_check_bounds::<Self>(offset);
11709            // Verify that padding bytes are zero.
11710            fidl::decode!(
11711                fidl_fuchsia_wlan_common::SecuritySupport,
11712                D,
11713                &mut self.resp,
11714                decoder,
11715                offset + 0,
11716                _depth
11717            )?;
11718            Ok(())
11719        }
11720    }
11721
11722    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
11723        type Borrowed<'a> = &'a Self;
11724        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11725            value
11726        }
11727    }
11728
11729    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseQuerySpectrumManagementSupportResponse {
11730        type Owned = Self;
11731
11732        #[inline(always)]
11733        fn inline_align(_context: fidl::encoding::Context) -> usize {
11734            1
11735        }
11736
11737        #[inline(always)]
11738        fn inline_size(_context: fidl::encoding::Context) -> usize {
11739            1
11740        }
11741    }
11742
11743    unsafe impl<D: fidl::encoding::ResourceDialect>
11744        fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
11745        for &WlanSoftmacBaseQuerySpectrumManagementSupportResponse
11746    {
11747        #[inline]
11748        unsafe fn encode(
11749            self,
11750            encoder: &mut fidl::encoding::Encoder<'_, D>,
11751            offset: usize,
11752            _depth: fidl::encoding::Depth,
11753        ) -> fidl::Result<()> {
11754            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
11755                offset,
11756            );
11757            // Delegate to tuple encoding.
11758            fidl::encoding::Encode::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>::encode(
11759                (
11760                    <fidl_fuchsia_wlan_common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.resp),
11761                ),
11762                encoder, offset, _depth
11763            )
11764        }
11765    }
11766    unsafe impl<
11767            D: fidl::encoding::ResourceDialect,
11768            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::SpectrumManagementSupport, D>,
11769        > fidl::encoding::Encode<WlanSoftmacBaseQuerySpectrumManagementSupportResponse, D>
11770        for (T0,)
11771    {
11772        #[inline]
11773        unsafe fn encode(
11774            self,
11775            encoder: &mut fidl::encoding::Encoder<'_, D>,
11776            offset: usize,
11777            depth: fidl::encoding::Depth,
11778        ) -> fidl::Result<()> {
11779            encoder.debug_check_bounds::<WlanSoftmacBaseQuerySpectrumManagementSupportResponse>(
11780                offset,
11781            );
11782            // Zero out padding regions. There's no need to apply masks
11783            // because the unmasked parts will be overwritten by fields.
11784            // Write the fields.
11785            self.0.encode(encoder, offset + 0, depth)?;
11786            Ok(())
11787        }
11788    }
11789
11790    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11791        for WlanSoftmacBaseQuerySpectrumManagementSupportResponse
11792    {
11793        #[inline(always)]
11794        fn new_empty() -> Self {
11795            Self { resp: fidl::new_empty!(fidl_fuchsia_wlan_common::SpectrumManagementSupport, D) }
11796        }
11797
11798        #[inline]
11799        unsafe fn decode(
11800            &mut self,
11801            decoder: &mut fidl::encoding::Decoder<'_, D>,
11802            offset: usize,
11803            _depth: fidl::encoding::Depth,
11804        ) -> fidl::Result<()> {
11805            decoder.debug_check_bounds::<Self>(offset);
11806            // Verify that padding bytes are zero.
11807            fidl::decode!(
11808                fidl_fuchsia_wlan_common::SpectrumManagementSupport,
11809                D,
11810                &mut self.resp,
11811                decoder,
11812                offset + 0,
11813                _depth
11814            )?;
11815            Ok(())
11816        }
11817    }
11818
11819    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
11820        type Borrowed<'a> = &'a Self;
11821        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
11822            value
11823        }
11824    }
11825
11826    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeSetEthernetStatusRequest {
11827        type Owned = Self;
11828
11829        #[inline(always)]
11830        fn inline_align(_context: fidl::encoding::Context) -> usize {
11831            4
11832        }
11833
11834        #[inline(always)]
11835        fn inline_size(_context: fidl::encoding::Context) -> usize {
11836            4
11837        }
11838        #[inline(always)]
11839        fn encode_is_copy() -> bool {
11840            true
11841        }
11842
11843        #[inline(always)]
11844        fn decode_is_copy() -> bool {
11845            true
11846        }
11847    }
11848
11849    unsafe impl<D: fidl::encoding::ResourceDialect>
11850        fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D>
11851        for &WlanSoftmacBridgeSetEthernetStatusRequest
11852    {
11853        #[inline]
11854        unsafe fn encode(
11855            self,
11856            encoder: &mut fidl::encoding::Encoder<'_, D>,
11857            offset: usize,
11858            _depth: fidl::encoding::Depth,
11859        ) -> fidl::Result<()> {
11860            encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
11861            unsafe {
11862                // Copy the object into the buffer.
11863                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
11864                (buf_ptr as *mut WlanSoftmacBridgeSetEthernetStatusRequest).write_unaligned(
11865                    (self as *const WlanSoftmacBridgeSetEthernetStatusRequest).read(),
11866                );
11867                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
11868                // done second because the memcpy will write garbage to these bytes.
11869            }
11870            Ok(())
11871        }
11872    }
11873    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<u32, D>>
11874        fidl::encoding::Encode<WlanSoftmacBridgeSetEthernetStatusRequest, D> for (T0,)
11875    {
11876        #[inline]
11877        unsafe fn encode(
11878            self,
11879            encoder: &mut fidl::encoding::Encoder<'_, D>,
11880            offset: usize,
11881            depth: fidl::encoding::Depth,
11882        ) -> fidl::Result<()> {
11883            encoder.debug_check_bounds::<WlanSoftmacBridgeSetEthernetStatusRequest>(offset);
11884            // Zero out padding regions. There's no need to apply masks
11885            // because the unmasked parts will be overwritten by fields.
11886            // Write the fields.
11887            self.0.encode(encoder, offset + 0, depth)?;
11888            Ok(())
11889        }
11890    }
11891
11892    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
11893        for WlanSoftmacBridgeSetEthernetStatusRequest
11894    {
11895        #[inline(always)]
11896        fn new_empty() -> Self {
11897            Self { status: fidl::new_empty!(u32, D) }
11898        }
11899
11900        #[inline]
11901        unsafe fn decode(
11902            &mut self,
11903            decoder: &mut fidl::encoding::Decoder<'_, D>,
11904            offset: usize,
11905            _depth: fidl::encoding::Depth,
11906        ) -> fidl::Result<()> {
11907            decoder.debug_check_bounds::<Self>(offset);
11908            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
11909            // Verify that padding bytes are zero.
11910            // Copy from the buffer into the object.
11911            unsafe {
11912                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
11913            }
11914            Ok(())
11915        }
11916    }
11917
11918    impl fidl::encoding::ResourceTypeMarker for WlanSoftmacBridgeStartRequest {
11919        type Borrowed<'a> = &'a mut Self;
11920        fn take_or_borrow<'a>(
11921            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
11922        ) -> Self::Borrowed<'a> {
11923            value
11924        }
11925    }
11926
11927    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeStartRequest {
11928        type Owned = Self;
11929
11930        #[inline(always)]
11931        fn inline_align(_context: fidl::encoding::Context) -> usize {
11932            8
11933        }
11934
11935        #[inline(always)]
11936        fn inline_size(_context: fidl::encoding::Context) -> usize {
11937            24
11938        }
11939    }
11940
11941    unsafe impl
11942        fidl::encoding::Encode<
11943            WlanSoftmacBridgeStartRequest,
11944            fidl::encoding::DefaultFuchsiaResourceDialect,
11945        > for &mut WlanSoftmacBridgeStartRequest
11946    {
11947        #[inline]
11948        unsafe fn encode(
11949            self,
11950            encoder: &mut fidl::encoding::Encoder<
11951                '_,
11952                fidl::encoding::DefaultFuchsiaResourceDialect,
11953            >,
11954            offset: usize,
11955            _depth: fidl::encoding::Depth,
11956        ) -> fidl::Result<()> {
11957            encoder.debug_check_bounds::<WlanSoftmacBridgeStartRequest>(offset);
11958            // Delegate to tuple encoding.
11959            fidl::encoding::Encode::<
11960                WlanSoftmacBridgeStartRequest,
11961                fidl::encoding::DefaultFuchsiaResourceDialect,
11962            >::encode(
11963                (
11964                    <fidl::encoding::Endpoint<
11965                        fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
11966                    > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
11967                        &mut self.ifc_bridge
11968                    ),
11969                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.ethernet_tx),
11970                    <u64 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_rx),
11971                ),
11972                encoder,
11973                offset,
11974                _depth,
11975            )
11976        }
11977    }
11978    unsafe impl<
11979            T0: fidl::encoding::Encode<
11980                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>>,
11981                fidl::encoding::DefaultFuchsiaResourceDialect,
11982            >,
11983            T1: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11984            T2: fidl::encoding::Encode<u64, fidl::encoding::DefaultFuchsiaResourceDialect>,
11985        >
11986        fidl::encoding::Encode<
11987            WlanSoftmacBridgeStartRequest,
11988            fidl::encoding::DefaultFuchsiaResourceDialect,
11989        > for (T0, T1, T2)
11990    {
11991        #[inline]
11992        unsafe fn encode(
11993            self,
11994            encoder: &mut fidl::encoding::Encoder<
11995                '_,
11996                fidl::encoding::DefaultFuchsiaResourceDialect,
11997            >,
11998            offset: usize,
11999            depth: fidl::encoding::Depth,
12000        ) -> fidl::Result<()> {
12001            encoder.debug_check_bounds::<WlanSoftmacBridgeStartRequest>(offset);
12002            // Zero out padding regions. There's no need to apply masks
12003            // because the unmasked parts will be overwritten by fields.
12004            unsafe {
12005                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
12006                (ptr as *mut u64).write_unaligned(0);
12007            }
12008            // Write the fields.
12009            self.0.encode(encoder, offset + 0, depth)?;
12010            self.1.encode(encoder, offset + 8, depth)?;
12011            self.2.encode(encoder, offset + 16, depth)?;
12012            Ok(())
12013        }
12014    }
12015
12016    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12017        for WlanSoftmacBridgeStartRequest
12018    {
12019        #[inline(always)]
12020        fn new_empty() -> Self {
12021            Self {
12022                ifc_bridge: fidl::new_empty!(
12023                    fidl::encoding::Endpoint<
12024                        fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>,
12025                    >,
12026                    fidl::encoding::DefaultFuchsiaResourceDialect
12027                ),
12028                ethernet_tx: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12029                wlan_rx: fidl::new_empty!(u64, fidl::encoding::DefaultFuchsiaResourceDialect),
12030            }
12031        }
12032
12033        #[inline]
12034        unsafe fn decode(
12035            &mut self,
12036            decoder: &mut fidl::encoding::Decoder<
12037                '_,
12038                fidl::encoding::DefaultFuchsiaResourceDialect,
12039            >,
12040            offset: usize,
12041            _depth: fidl::encoding::Depth,
12042        ) -> fidl::Result<()> {
12043            decoder.debug_check_bounds::<Self>(offset);
12044            // Verify that padding bytes are zero.
12045            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
12046            let padval = unsafe { (ptr as *const u64).read_unaligned() };
12047            let mask = 0xffffffff00000000u64;
12048            let maskedval = padval & mask;
12049            if maskedval != 0 {
12050                return Err(fidl::Error::NonZeroPadding {
12051                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
12052                });
12053            }
12054            fidl::decode!(
12055                fidl::encoding::Endpoint<fidl::endpoints::ClientEnd<WlanSoftmacIfcBridgeMarker>>,
12056                fidl::encoding::DefaultFuchsiaResourceDialect,
12057                &mut self.ifc_bridge,
12058                decoder,
12059                offset + 0,
12060                _depth
12061            )?;
12062            fidl::decode!(
12063                u64,
12064                fidl::encoding::DefaultFuchsiaResourceDialect,
12065                &mut self.ethernet_tx,
12066                decoder,
12067                offset + 8,
12068                _depth
12069            )?;
12070            fidl::decode!(
12071                u64,
12072                fidl::encoding::DefaultFuchsiaResourceDialect,
12073                &mut self.wlan_rx,
12074                decoder,
12075                offset + 16,
12076                _depth
12077            )?;
12078            Ok(())
12079        }
12080    }
12081
12082    impl fidl::encoding::ResourceTypeMarker for WlanSoftmacBridgeStartResponse {
12083        type Borrowed<'a> = &'a mut Self;
12084        fn take_or_borrow<'a>(
12085            value: &'a mut <Self as fidl::encoding::TypeMarker>::Owned,
12086        ) -> Self::Borrowed<'a> {
12087            value
12088        }
12089    }
12090
12091    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBridgeStartResponse {
12092        type Owned = Self;
12093
12094        #[inline(always)]
12095        fn inline_align(_context: fidl::encoding::Context) -> usize {
12096            4
12097        }
12098
12099        #[inline(always)]
12100        fn inline_size(_context: fidl::encoding::Context) -> usize {
12101            4
12102        }
12103    }
12104
12105    unsafe impl
12106        fidl::encoding::Encode<
12107            WlanSoftmacBridgeStartResponse,
12108            fidl::encoding::DefaultFuchsiaResourceDialect,
12109        > for &mut WlanSoftmacBridgeStartResponse
12110    {
12111        #[inline]
12112        unsafe fn encode(
12113            self,
12114            encoder: &mut fidl::encoding::Encoder<
12115                '_,
12116                fidl::encoding::DefaultFuchsiaResourceDialect,
12117            >,
12118            offset: usize,
12119            _depth: fidl::encoding::Depth,
12120        ) -> fidl::Result<()> {
12121            encoder.debug_check_bounds::<WlanSoftmacBridgeStartResponse>(offset);
12122            // Delegate to tuple encoding.
12123            fidl::encoding::Encode::<
12124                WlanSoftmacBridgeStartResponse,
12125                fidl::encoding::DefaultFuchsiaResourceDialect,
12126            >::encode(
12127                (<fidl::encoding::HandleType<
12128                    fidl::Channel,
12129                    { fidl::ObjectType::CHANNEL.into_raw() },
12130                    2147483648,
12131                > as fidl::encoding::ResourceTypeMarker>::take_or_borrow(
12132                    &mut self.sme_channel
12133                ),),
12134                encoder,
12135                offset,
12136                _depth,
12137            )
12138        }
12139    }
12140    unsafe impl<
12141            T0: fidl::encoding::Encode<
12142                fidl::encoding::HandleType<
12143                    fidl::Channel,
12144                    { fidl::ObjectType::CHANNEL.into_raw() },
12145                    2147483648,
12146                >,
12147                fidl::encoding::DefaultFuchsiaResourceDialect,
12148            >,
12149        >
12150        fidl::encoding::Encode<
12151            WlanSoftmacBridgeStartResponse,
12152            fidl::encoding::DefaultFuchsiaResourceDialect,
12153        > for (T0,)
12154    {
12155        #[inline]
12156        unsafe fn encode(
12157            self,
12158            encoder: &mut fidl::encoding::Encoder<
12159                '_,
12160                fidl::encoding::DefaultFuchsiaResourceDialect,
12161            >,
12162            offset: usize,
12163            depth: fidl::encoding::Depth,
12164        ) -> fidl::Result<()> {
12165            encoder.debug_check_bounds::<WlanSoftmacBridgeStartResponse>(offset);
12166            // Zero out padding regions. There's no need to apply masks
12167            // because the unmasked parts will be overwritten by fields.
12168            // Write the fields.
12169            self.0.encode(encoder, offset + 0, depth)?;
12170            Ok(())
12171        }
12172    }
12173
12174    impl fidl::encoding::Decode<Self, fidl::encoding::DefaultFuchsiaResourceDialect>
12175        for WlanSoftmacBridgeStartResponse
12176    {
12177        #[inline(always)]
12178        fn new_empty() -> Self {
12179            Self {
12180                sme_channel: fidl::new_empty!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect),
12181            }
12182        }
12183
12184        #[inline]
12185        unsafe fn decode(
12186            &mut self,
12187            decoder: &mut fidl::encoding::Decoder<
12188                '_,
12189                fidl::encoding::DefaultFuchsiaResourceDialect,
12190            >,
12191            offset: usize,
12192            _depth: fidl::encoding::Depth,
12193        ) -> fidl::Result<()> {
12194            decoder.debug_check_bounds::<Self>(offset);
12195            // Verify that padding bytes are zero.
12196            fidl::decode!(fidl::encoding::HandleType<fidl::Channel, { fidl::ObjectType::CHANNEL.into_raw() }, 2147483648>, fidl::encoding::DefaultFuchsiaResourceDialect, &mut self.sme_channel, decoder, offset + 0, _depth)?;
12197            Ok(())
12198        }
12199    }
12200
12201    impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
12202        type Borrowed<'a> = &'a Self;
12203        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12204            value
12205        }
12206    }
12207
12208    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseReportTxResultRequest {
12209        type Owned = Self;
12210
12211        #[inline(always)]
12212        fn inline_align(_context: fidl::encoding::Context) -> usize {
12213            2
12214        }
12215
12216        #[inline(always)]
12217        fn inline_size(_context: fidl::encoding::Context) -> usize {
12218            40
12219        }
12220    }
12221
12222    unsafe impl<D: fidl::encoding::ResourceDialect>
12223        fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D>
12224        for &WlanSoftmacIfcBaseReportTxResultRequest
12225    {
12226        #[inline]
12227        unsafe fn encode(
12228            self,
12229            encoder: &mut fidl::encoding::Encoder<'_, D>,
12230            offset: usize,
12231            _depth: fidl::encoding::Depth,
12232        ) -> fidl::Result<()> {
12233            encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
12234            // Delegate to tuple encoding.
12235            fidl::encoding::Encode::<WlanSoftmacIfcBaseReportTxResultRequest, D>::encode(
12236                (
12237                    <fidl_fuchsia_wlan_common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result),
12238                ),
12239                encoder, offset, _depth
12240            )
12241        }
12242    }
12243    unsafe impl<
12244            D: fidl::encoding::ResourceDialect,
12245            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanTxResult, D>,
12246        > fidl::encoding::Encode<WlanSoftmacIfcBaseReportTxResultRequest, D> for (T0,)
12247    {
12248        #[inline]
12249        unsafe fn encode(
12250            self,
12251            encoder: &mut fidl::encoding::Encoder<'_, D>,
12252            offset: usize,
12253            depth: fidl::encoding::Depth,
12254        ) -> fidl::Result<()> {
12255            encoder.debug_check_bounds::<WlanSoftmacIfcBaseReportTxResultRequest>(offset);
12256            // Zero out padding regions. There's no need to apply masks
12257            // because the unmasked parts will be overwritten by fields.
12258            // Write the fields.
12259            self.0.encode(encoder, offset + 0, depth)?;
12260            Ok(())
12261        }
12262    }
12263
12264    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12265        for WlanSoftmacIfcBaseReportTxResultRequest
12266    {
12267        #[inline(always)]
12268        fn new_empty() -> Self {
12269            Self { tx_result: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanTxResult, D) }
12270        }
12271
12272        #[inline]
12273        unsafe fn decode(
12274            &mut self,
12275            decoder: &mut fidl::encoding::Decoder<'_, D>,
12276            offset: usize,
12277            _depth: fidl::encoding::Depth,
12278        ) -> fidl::Result<()> {
12279            decoder.debug_check_bounds::<Self>(offset);
12280            // Verify that padding bytes are zero.
12281            fidl::decode!(
12282                fidl_fuchsia_wlan_common::WlanTxResult,
12283                D,
12284                &mut self.tx_result,
12285                decoder,
12286                offset + 0,
12287                _depth
12288            )?;
12289            Ok(())
12290        }
12291    }
12292
12293    impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
12294        type Borrowed<'a> = &'a Self;
12295        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12296            value
12297        }
12298    }
12299
12300    unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
12301        type Owned = Self;
12302
12303        #[inline(always)]
12304        fn inline_align(_context: fidl::encoding::Context) -> usize {
12305            4
12306        }
12307
12308        #[inline(always)]
12309        fn inline_size(_context: fidl::encoding::Context) -> usize {
12310            24
12311        }
12312    }
12313
12314    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
12315        for &WlanTxInfo
12316    {
12317        #[inline]
12318        unsafe fn encode(
12319            self,
12320            encoder: &mut fidl::encoding::Encoder<'_, D>,
12321            offset: usize,
12322            _depth: fidl::encoding::Depth,
12323        ) -> fidl::Result<()> {
12324            encoder.debug_check_bounds::<WlanTxInfo>(offset);
12325            // Delegate to tuple encoding.
12326            fidl::encoding::Encode::<WlanTxInfo, D>::encode(
12327                (
12328                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
12329                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
12330                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
12331                    <fidl_fuchsia_wlan_common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
12332                    <fidl_fuchsia_wlan_common::ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.channel_bandwidth),
12333                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
12334                ),
12335                encoder, offset, _depth
12336            )
12337        }
12338    }
12339    unsafe impl<
12340            D: fidl::encoding::ResourceDialect,
12341            T0: fidl::encoding::Encode<u32, D>,
12342            T1: fidl::encoding::Encode<u32, D>,
12343            T2: fidl::encoding::Encode<u16, D>,
12344            T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common::WlanPhyType, D>,
12345            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common::ChannelBandwidth, D>,
12346            T5: fidl::encoding::Encode<u8, D>,
12347        > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
12348    {
12349        #[inline]
12350        unsafe fn encode(
12351            self,
12352            encoder: &mut fidl::encoding::Encoder<'_, D>,
12353            offset: usize,
12354            depth: fidl::encoding::Depth,
12355        ) -> fidl::Result<()> {
12356            encoder.debug_check_bounds::<WlanTxInfo>(offset);
12357            // Zero out padding regions. There's no need to apply masks
12358            // because the unmasked parts will be overwritten by fields.
12359            unsafe {
12360                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
12361                (ptr as *mut u32).write_unaligned(0);
12362            }
12363            unsafe {
12364                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(20);
12365                (ptr as *mut u32).write_unaligned(0);
12366            }
12367            // Write the fields.
12368            self.0.encode(encoder, offset + 0, depth)?;
12369            self.1.encode(encoder, offset + 4, depth)?;
12370            self.2.encode(encoder, offset + 8, depth)?;
12371            self.3.encode(encoder, offset + 12, depth)?;
12372            self.4.encode(encoder, offset + 16, depth)?;
12373            self.5.encode(encoder, offset + 20, depth)?;
12374            Ok(())
12375        }
12376    }
12377
12378    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
12379        #[inline(always)]
12380        fn new_empty() -> Self {
12381            Self {
12382                tx_flags: fidl::new_empty!(u32, D),
12383                valid_fields: fidl::new_empty!(u32, D),
12384                tx_vector_idx: fidl::new_empty!(u16, D),
12385                phy: fidl::new_empty!(fidl_fuchsia_wlan_common::WlanPhyType, D),
12386                channel_bandwidth: fidl::new_empty!(fidl_fuchsia_wlan_common::ChannelBandwidth, D),
12387                mcs: fidl::new_empty!(u8, D),
12388            }
12389        }
12390
12391        #[inline]
12392        unsafe fn decode(
12393            &mut self,
12394            decoder: &mut fidl::encoding::Decoder<'_, D>,
12395            offset: usize,
12396            _depth: fidl::encoding::Depth,
12397        ) -> fidl::Result<()> {
12398            decoder.debug_check_bounds::<Self>(offset);
12399            // Verify that padding bytes are zero.
12400            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
12401            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12402            let mask = 0xffff0000u32;
12403            let maskedval = padval & mask;
12404            if maskedval != 0 {
12405                return Err(fidl::Error::NonZeroPadding {
12406                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
12407                });
12408            }
12409            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(20) };
12410            let padval = unsafe { (ptr as *const u32).read_unaligned() };
12411            let mask = 0xffffff00u32;
12412            let maskedval = padval & mask;
12413            if maskedval != 0 {
12414                return Err(fidl::Error::NonZeroPadding {
12415                    padding_start: offset + 20 + ((mask as u64).trailing_zeros() / 8) as usize,
12416                });
12417            }
12418            fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
12419            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
12420            fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
12421            fidl::decode!(
12422                fidl_fuchsia_wlan_common::WlanPhyType,
12423                D,
12424                &mut self.phy,
12425                decoder,
12426                offset + 12,
12427                _depth
12428            )?;
12429            fidl::decode!(
12430                fidl_fuchsia_wlan_common::ChannelBandwidth,
12431                D,
12432                &mut self.channel_bandwidth,
12433                decoder,
12434                offset + 16,
12435                _depth
12436            )?;
12437            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 20, _depth)?;
12438            Ok(())
12439        }
12440    }
12441
12442    impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
12443        type Borrowed<'a> = &'a Self;
12444        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12445            value
12446        }
12447    }
12448
12449    unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
12450        type Owned = Self;
12451
12452        #[inline(always)]
12453        fn inline_align(_context: fidl::encoding::Context) -> usize {
12454            8
12455        }
12456
12457        #[inline(always)]
12458        fn inline_size(_context: fidl::encoding::Context) -> usize {
12459            40
12460        }
12461    }
12462
12463    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
12464        for &WlanTxPacket
12465    {
12466        #[inline]
12467        unsafe fn encode(
12468            self,
12469            encoder: &mut fidl::encoding::Encoder<'_, D>,
12470            offset: usize,
12471            _depth: fidl::encoding::Depth,
12472        ) -> fidl::Result<()> {
12473            encoder.debug_check_bounds::<WlanTxPacket>(offset);
12474            // Delegate to tuple encoding.
12475            fidl::encoding::Encode::<WlanTxPacket, D>::encode(
12476                (
12477                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_frame),
12478                    <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
12479                ),
12480                encoder, offset, _depth
12481            )
12482        }
12483    }
12484    unsafe impl<
12485            D: fidl::encoding::ResourceDialect,
12486            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
12487            T1: fidl::encoding::Encode<WlanTxInfo, D>,
12488        > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
12489    {
12490        #[inline]
12491        unsafe fn encode(
12492            self,
12493            encoder: &mut fidl::encoding::Encoder<'_, D>,
12494            offset: usize,
12495            depth: fidl::encoding::Depth,
12496        ) -> fidl::Result<()> {
12497            encoder.debug_check_bounds::<WlanTxPacket>(offset);
12498            // Zero out padding regions. There's no need to apply masks
12499            // because the unmasked parts will be overwritten by fields.
12500            // Write the fields.
12501            self.0.encode(encoder, offset + 0, depth)?;
12502            self.1.encode(encoder, offset + 16, depth)?;
12503            Ok(())
12504        }
12505    }
12506
12507    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
12508        #[inline(always)]
12509        fn new_empty() -> Self {
12510            Self {
12511                mac_frame: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
12512                info: fidl::new_empty!(WlanTxInfo, D),
12513            }
12514        }
12515
12516        #[inline]
12517        unsafe fn decode(
12518            &mut self,
12519            decoder: &mut fidl::encoding::Decoder<'_, D>,
12520            offset: usize,
12521            _depth: fidl::encoding::Depth,
12522        ) -> fidl::Result<()> {
12523            decoder.debug_check_bounds::<Self>(offset);
12524            // Verify that padding bytes are zero.
12525            fidl::decode!(
12526                fidl::encoding::UnboundedVector<u8>,
12527                D,
12528                &mut self.mac_frame,
12529                decoder,
12530                offset + 0,
12531                _depth
12532            )?;
12533            fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
12534            Ok(())
12535        }
12536    }
12537
12538    impl EthernetRxTransferRequest {
12539        #[inline(always)]
12540        fn max_ordinal_present(&self) -> u64 {
12541            if let Some(_) = self.packet_size {
12542                return 2;
12543            }
12544            if let Some(_) = self.packet_address {
12545                return 1;
12546            }
12547            0
12548        }
12549    }
12550
12551    impl fidl::encoding::ValueTypeMarker for EthernetRxTransferRequest {
12552        type Borrowed<'a> = &'a Self;
12553        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12554            value
12555        }
12556    }
12557
12558    unsafe impl fidl::encoding::TypeMarker for EthernetRxTransferRequest {
12559        type Owned = Self;
12560
12561        #[inline(always)]
12562        fn inline_align(_context: fidl::encoding::Context) -> usize {
12563            8
12564        }
12565
12566        #[inline(always)]
12567        fn inline_size(_context: fidl::encoding::Context) -> usize {
12568            16
12569        }
12570    }
12571
12572    unsafe impl<D: fidl::encoding::ResourceDialect>
12573        fidl::encoding::Encode<EthernetRxTransferRequest, D> for &EthernetRxTransferRequest
12574    {
12575        unsafe fn encode(
12576            self,
12577            encoder: &mut fidl::encoding::Encoder<'_, D>,
12578            offset: usize,
12579            mut depth: fidl::encoding::Depth,
12580        ) -> fidl::Result<()> {
12581            encoder.debug_check_bounds::<EthernetRxTransferRequest>(offset);
12582            // Vector header
12583            let max_ordinal: u64 = self.max_ordinal_present();
12584            encoder.write_num(max_ordinal, offset);
12585            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12586            // Calling encoder.out_of_line_offset(0) is not allowed.
12587            if max_ordinal == 0 {
12588                return Ok(());
12589            }
12590            depth.increment()?;
12591            let envelope_size = 8;
12592            let bytes_len = max_ordinal as usize * envelope_size;
12593            #[allow(unused_variables)]
12594            let offset = encoder.out_of_line_offset(bytes_len);
12595            let mut _prev_end_offset: usize = 0;
12596            if 1 > max_ordinal {
12597                return Ok(());
12598            }
12599
12600            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12601            // are envelope_size bytes.
12602            let cur_offset: usize = (1 - 1) * envelope_size;
12603
12604            // Zero reserved fields.
12605            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12606
12607            // Safety:
12608            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12609            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12610            //   envelope_size bytes, there is always sufficient room.
12611            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12612                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12613                encoder,
12614                offset + cur_offset,
12615                depth,
12616            )?;
12617
12618            _prev_end_offset = cur_offset + envelope_size;
12619            if 2 > max_ordinal {
12620                return Ok(());
12621            }
12622
12623            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12624            // are envelope_size bytes.
12625            let cur_offset: usize = (2 - 1) * envelope_size;
12626
12627            // Zero reserved fields.
12628            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12629
12630            // Safety:
12631            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12632            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12633            //   envelope_size bytes, there is always sufficient room.
12634            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12635                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12636                encoder,
12637                offset + cur_offset,
12638                depth,
12639            )?;
12640
12641            _prev_end_offset = cur_offset + envelope_size;
12642
12643            Ok(())
12644        }
12645    }
12646
12647    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12648        for EthernetRxTransferRequest
12649    {
12650        #[inline(always)]
12651        fn new_empty() -> Self {
12652            Self::default()
12653        }
12654
12655        unsafe fn decode(
12656            &mut self,
12657            decoder: &mut fidl::encoding::Decoder<'_, D>,
12658            offset: usize,
12659            mut depth: fidl::encoding::Depth,
12660        ) -> fidl::Result<()> {
12661            decoder.debug_check_bounds::<Self>(offset);
12662            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12663                None => return Err(fidl::Error::NotNullable),
12664                Some(len) => len,
12665            };
12666            // Calling decoder.out_of_line_offset(0) is not allowed.
12667            if len == 0 {
12668                return Ok(());
12669            };
12670            depth.increment()?;
12671            let envelope_size = 8;
12672            let bytes_len = len * envelope_size;
12673            let offset = decoder.out_of_line_offset(bytes_len)?;
12674            // Decode the envelope for each type.
12675            let mut _next_ordinal_to_read = 0;
12676            let mut next_offset = offset;
12677            let end_offset = offset + bytes_len;
12678            _next_ordinal_to_read += 1;
12679            if next_offset >= end_offset {
12680                return Ok(());
12681            }
12682
12683            // Decode unknown envelopes for gaps in ordinals.
12684            while _next_ordinal_to_read < 1 {
12685                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12686                _next_ordinal_to_read += 1;
12687                next_offset += envelope_size;
12688            }
12689
12690            let next_out_of_line = decoder.next_out_of_line();
12691            let handles_before = decoder.remaining_handles();
12692            if let Some((inlined, num_bytes, num_handles)) =
12693                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12694            {
12695                let member_inline_size =
12696                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12697                if inlined != (member_inline_size <= 4) {
12698                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12699                }
12700                let inner_offset;
12701                let mut inner_depth = depth.clone();
12702                if inlined {
12703                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12704                    inner_offset = next_offset;
12705                } else {
12706                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12707                    inner_depth.increment()?;
12708                }
12709                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
12710                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
12711                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12712                {
12713                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12714                }
12715                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12716                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12717                }
12718            }
12719
12720            next_offset += envelope_size;
12721            _next_ordinal_to_read += 1;
12722            if next_offset >= end_offset {
12723                return Ok(());
12724            }
12725
12726            // Decode unknown envelopes for gaps in ordinals.
12727            while _next_ordinal_to_read < 2 {
12728                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12729                _next_ordinal_to_read += 1;
12730                next_offset += envelope_size;
12731            }
12732
12733            let next_out_of_line = decoder.next_out_of_line();
12734            let handles_before = decoder.remaining_handles();
12735            if let Some((inlined, num_bytes, num_handles)) =
12736                fidl::encoding::decode_envelope_header(decoder, next_offset)?
12737            {
12738                let member_inline_size =
12739                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
12740                if inlined != (member_inline_size <= 4) {
12741                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
12742                }
12743                let inner_offset;
12744                let mut inner_depth = depth.clone();
12745                if inlined {
12746                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
12747                    inner_offset = next_offset;
12748                } else {
12749                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
12750                    inner_depth.increment()?;
12751                }
12752                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
12753                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
12754                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
12755                {
12756                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
12757                }
12758                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
12759                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
12760                }
12761            }
12762
12763            next_offset += envelope_size;
12764
12765            // Decode the remaining unknown envelopes.
12766            while next_offset < end_offset {
12767                _next_ordinal_to_read += 1;
12768                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
12769                next_offset += envelope_size;
12770            }
12771
12772            Ok(())
12773        }
12774    }
12775
12776    impl EthernetTxTransferRequest {
12777        #[inline(always)]
12778        fn max_ordinal_present(&self) -> u64 {
12779            if let Some(_) = self.complete_borrowed_operation {
12780                return 5;
12781            }
12782            if let Some(_) = self.borrowed_operation {
12783                return 4;
12784            }
12785            if let Some(_) = self.async_id {
12786                return 3;
12787            }
12788            if let Some(_) = self.packet_size {
12789                return 2;
12790            }
12791            if let Some(_) = self.packet_address {
12792                return 1;
12793            }
12794            0
12795        }
12796    }
12797
12798    impl fidl::encoding::ValueTypeMarker for EthernetTxTransferRequest {
12799        type Borrowed<'a> = &'a Self;
12800        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
12801            value
12802        }
12803    }
12804
12805    unsafe impl fidl::encoding::TypeMarker for EthernetTxTransferRequest {
12806        type Owned = Self;
12807
12808        #[inline(always)]
12809        fn inline_align(_context: fidl::encoding::Context) -> usize {
12810            8
12811        }
12812
12813        #[inline(always)]
12814        fn inline_size(_context: fidl::encoding::Context) -> usize {
12815            16
12816        }
12817    }
12818
12819    unsafe impl<D: fidl::encoding::ResourceDialect>
12820        fidl::encoding::Encode<EthernetTxTransferRequest, D> for &EthernetTxTransferRequest
12821    {
12822        unsafe fn encode(
12823            self,
12824            encoder: &mut fidl::encoding::Encoder<'_, D>,
12825            offset: usize,
12826            mut depth: fidl::encoding::Depth,
12827        ) -> fidl::Result<()> {
12828            encoder.debug_check_bounds::<EthernetTxTransferRequest>(offset);
12829            // Vector header
12830            let max_ordinal: u64 = self.max_ordinal_present();
12831            encoder.write_num(max_ordinal, offset);
12832            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
12833            // Calling encoder.out_of_line_offset(0) is not allowed.
12834            if max_ordinal == 0 {
12835                return Ok(());
12836            }
12837            depth.increment()?;
12838            let envelope_size = 8;
12839            let bytes_len = max_ordinal as usize * envelope_size;
12840            #[allow(unused_variables)]
12841            let offset = encoder.out_of_line_offset(bytes_len);
12842            let mut _prev_end_offset: usize = 0;
12843            if 1 > max_ordinal {
12844                return Ok(());
12845            }
12846
12847            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12848            // are envelope_size bytes.
12849            let cur_offset: usize = (1 - 1) * envelope_size;
12850
12851            // Zero reserved fields.
12852            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12853
12854            // Safety:
12855            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12856            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12857            //   envelope_size bytes, there is always sufficient room.
12858            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12859                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12860                encoder,
12861                offset + cur_offset,
12862                depth,
12863            )?;
12864
12865            _prev_end_offset = cur_offset + envelope_size;
12866            if 2 > max_ordinal {
12867                return Ok(());
12868            }
12869
12870            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12871            // are envelope_size bytes.
12872            let cur_offset: usize = (2 - 1) * envelope_size;
12873
12874            // Zero reserved fields.
12875            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12876
12877            // Safety:
12878            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12879            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12880            //   envelope_size bytes, there is always sufficient room.
12881            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12882                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12883                encoder,
12884                offset + cur_offset,
12885                depth,
12886            )?;
12887
12888            _prev_end_offset = cur_offset + envelope_size;
12889            if 3 > max_ordinal {
12890                return Ok(());
12891            }
12892
12893            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12894            // are envelope_size bytes.
12895            let cur_offset: usize = (3 - 1) * envelope_size;
12896
12897            // Zero reserved fields.
12898            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12899
12900            // Safety:
12901            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12902            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12903            //   envelope_size bytes, there is always sufficient room.
12904            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12905                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12906                encoder,
12907                offset + cur_offset,
12908                depth,
12909            )?;
12910
12911            _prev_end_offset = cur_offset + envelope_size;
12912            if 4 > max_ordinal {
12913                return Ok(());
12914            }
12915
12916            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12917            // are envelope_size bytes.
12918            let cur_offset: usize = (4 - 1) * envelope_size;
12919
12920            // Zero reserved fields.
12921            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12922
12923            // Safety:
12924            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12925            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12926            //   envelope_size bytes, there is always sufficient room.
12927            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12928                self.borrowed_operation
12929                    .as_ref()
12930                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12931                encoder,
12932                offset + cur_offset,
12933                depth,
12934            )?;
12935
12936            _prev_end_offset = cur_offset + envelope_size;
12937            if 5 > max_ordinal {
12938                return Ok(());
12939            }
12940
12941            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
12942            // are envelope_size bytes.
12943            let cur_offset: usize = (5 - 1) * envelope_size;
12944
12945            // Zero reserved fields.
12946            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
12947
12948            // Safety:
12949            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
12950            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
12951            //   envelope_size bytes, there is always sufficient room.
12952            fidl::encoding::encode_in_envelope_optional::<u64, D>(
12953                self.complete_borrowed_operation
12954                    .as_ref()
12955                    .map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
12956                encoder,
12957                offset + cur_offset,
12958                depth,
12959            )?;
12960
12961            _prev_end_offset = cur_offset + envelope_size;
12962
12963            Ok(())
12964        }
12965    }
12966
12967    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
12968        for EthernetTxTransferRequest
12969    {
12970        #[inline(always)]
12971        fn new_empty() -> Self {
12972            Self::default()
12973        }
12974
12975        unsafe fn decode(
12976            &mut self,
12977            decoder: &mut fidl::encoding::Decoder<'_, D>,
12978            offset: usize,
12979            mut depth: fidl::encoding::Depth,
12980        ) -> fidl::Result<()> {
12981            decoder.debug_check_bounds::<Self>(offset);
12982            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
12983                None => return Err(fidl::Error::NotNullable),
12984                Some(len) => len,
12985            };
12986            // Calling decoder.out_of_line_offset(0) is not allowed.
12987            if len == 0 {
12988                return Ok(());
12989            };
12990            depth.increment()?;
12991            let envelope_size = 8;
12992            let bytes_len = len * envelope_size;
12993            let offset = decoder.out_of_line_offset(bytes_len)?;
12994            // Decode the envelope for each type.
12995            let mut _next_ordinal_to_read = 0;
12996            let mut next_offset = offset;
12997            let end_offset = offset + bytes_len;
12998            _next_ordinal_to_read += 1;
12999            if next_offset >= end_offset {
13000                return Ok(());
13001            }
13002
13003            // Decode unknown envelopes for gaps in ordinals.
13004            while _next_ordinal_to_read < 1 {
13005                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13006                _next_ordinal_to_read += 1;
13007                next_offset += envelope_size;
13008            }
13009
13010            let next_out_of_line = decoder.next_out_of_line();
13011            let handles_before = decoder.remaining_handles();
13012            if let Some((inlined, num_bytes, num_handles)) =
13013                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13014            {
13015                let member_inline_size =
13016                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13017                if inlined != (member_inline_size <= 4) {
13018                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13019                }
13020                let inner_offset;
13021                let mut inner_depth = depth.clone();
13022                if inlined {
13023                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13024                    inner_offset = next_offset;
13025                } else {
13026                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13027                    inner_depth.increment()?;
13028                }
13029                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
13030                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
13031                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13032                {
13033                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13034                }
13035                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13036                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13037                }
13038            }
13039
13040            next_offset += envelope_size;
13041            _next_ordinal_to_read += 1;
13042            if next_offset >= end_offset {
13043                return Ok(());
13044            }
13045
13046            // Decode unknown envelopes for gaps in ordinals.
13047            while _next_ordinal_to_read < 2 {
13048                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13049                _next_ordinal_to_read += 1;
13050                next_offset += envelope_size;
13051            }
13052
13053            let next_out_of_line = decoder.next_out_of_line();
13054            let handles_before = decoder.remaining_handles();
13055            if let Some((inlined, num_bytes, num_handles)) =
13056                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13057            {
13058                let member_inline_size =
13059                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13060                if inlined != (member_inline_size <= 4) {
13061                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13062                }
13063                let inner_offset;
13064                let mut inner_depth = depth.clone();
13065                if inlined {
13066                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13067                    inner_offset = next_offset;
13068                } else {
13069                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13070                    inner_depth.increment()?;
13071                }
13072                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
13073                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
13074                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13075                {
13076                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13077                }
13078                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13079                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13080                }
13081            }
13082
13083            next_offset += envelope_size;
13084            _next_ordinal_to_read += 1;
13085            if next_offset >= end_offset {
13086                return Ok(());
13087            }
13088
13089            // Decode unknown envelopes for gaps in ordinals.
13090            while _next_ordinal_to_read < 3 {
13091                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13092                _next_ordinal_to_read += 1;
13093                next_offset += envelope_size;
13094            }
13095
13096            let next_out_of_line = decoder.next_out_of_line();
13097            let handles_before = decoder.remaining_handles();
13098            if let Some((inlined, num_bytes, num_handles)) =
13099                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13100            {
13101                let member_inline_size =
13102                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13103                if inlined != (member_inline_size <= 4) {
13104                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13105                }
13106                let inner_offset;
13107                let mut inner_depth = depth.clone();
13108                if inlined {
13109                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13110                    inner_offset = next_offset;
13111                } else {
13112                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13113                    inner_depth.increment()?;
13114                }
13115                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
13116                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
13117                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13118                {
13119                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13120                }
13121                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13122                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13123                }
13124            }
13125
13126            next_offset += envelope_size;
13127            _next_ordinal_to_read += 1;
13128            if next_offset >= end_offset {
13129                return Ok(());
13130            }
13131
13132            // Decode unknown envelopes for gaps in ordinals.
13133            while _next_ordinal_to_read < 4 {
13134                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13135                _next_ordinal_to_read += 1;
13136                next_offset += envelope_size;
13137            }
13138
13139            let next_out_of_line = decoder.next_out_of_line();
13140            let handles_before = decoder.remaining_handles();
13141            if let Some((inlined, num_bytes, num_handles)) =
13142                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13143            {
13144                let member_inline_size =
13145                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13146                if inlined != (member_inline_size <= 4) {
13147                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13148                }
13149                let inner_offset;
13150                let mut inner_depth = depth.clone();
13151                if inlined {
13152                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13153                    inner_offset = next_offset;
13154                } else {
13155                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13156                    inner_depth.increment()?;
13157                }
13158                let val_ref =
13159                    self.borrowed_operation.get_or_insert_with(|| fidl::new_empty!(u64, D));
13160                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
13161                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13162                {
13163                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13164                }
13165                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13166                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13167                }
13168            }
13169
13170            next_offset += envelope_size;
13171            _next_ordinal_to_read += 1;
13172            if next_offset >= end_offset {
13173                return Ok(());
13174            }
13175
13176            // Decode unknown envelopes for gaps in ordinals.
13177            while _next_ordinal_to_read < 5 {
13178                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13179                _next_ordinal_to_read += 1;
13180                next_offset += envelope_size;
13181            }
13182
13183            let next_out_of_line = decoder.next_out_of_line();
13184            let handles_before = decoder.remaining_handles();
13185            if let Some((inlined, num_bytes, num_handles)) =
13186                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13187            {
13188                let member_inline_size =
13189                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13190                if inlined != (member_inline_size <= 4) {
13191                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13192                }
13193                let inner_offset;
13194                let mut inner_depth = depth.clone();
13195                if inlined {
13196                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13197                    inner_offset = next_offset;
13198                } else {
13199                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13200                    inner_depth.increment()?;
13201                }
13202                let val_ref = self
13203                    .complete_borrowed_operation
13204                    .get_or_insert_with(|| fidl::new_empty!(u64, D));
13205                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
13206                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13207                {
13208                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13209                }
13210                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13211                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13212                }
13213            }
13214
13215            next_offset += envelope_size;
13216
13217            // Decode the remaining unknown envelopes.
13218            while next_offset < end_offset {
13219                _next_ordinal_to_read += 1;
13220                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13221                next_offset += envelope_size;
13222            }
13223
13224            Ok(())
13225        }
13226    }
13227
13228    impl WlanAssociationConfig {
13229        #[inline(always)]
13230        fn max_ordinal_present(&self) -> u64 {
13231            if let Some(_) = self.vht_op {
13232                return 12;
13233            }
13234            if let Some(_) = self.vht_cap {
13235                return 11;
13236            }
13237            if let Some(_) = self.ht_op {
13238                return 10;
13239            }
13240            if let Some(_) = self.ht_cap {
13241                return 9;
13242            }
13243            if let Some(_) = self.capability_info {
13244                return 8;
13245            }
13246            if let Some(_) = self.rates {
13247                return 7;
13248            }
13249            if let Some(_) = self.wmm_params {
13250                return 6;
13251            }
13252            if let Some(_) = self.qos {
13253                return 5;
13254            }
13255            if let Some(_) = self.channel {
13256                return 4;
13257            }
13258            if let Some(_) = self.listen_interval {
13259                return 3;
13260            }
13261            if let Some(_) = self.aid {
13262                return 2;
13263            }
13264            if let Some(_) = self.bssid {
13265                return 1;
13266            }
13267            0
13268        }
13269    }
13270
13271    impl fidl::encoding::ValueTypeMarker for WlanAssociationConfig {
13272        type Borrowed<'a> = &'a Self;
13273        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
13274            value
13275        }
13276    }
13277
13278    unsafe impl fidl::encoding::TypeMarker for WlanAssociationConfig {
13279        type Owned = Self;
13280
13281        #[inline(always)]
13282        fn inline_align(_context: fidl::encoding::Context) -> usize {
13283            8
13284        }
13285
13286        #[inline(always)]
13287        fn inline_size(_context: fidl::encoding::Context) -> usize {
13288            16
13289        }
13290    }
13291
13292    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanAssociationConfig, D>
13293        for &WlanAssociationConfig
13294    {
13295        unsafe fn encode(
13296            self,
13297            encoder: &mut fidl::encoding::Encoder<'_, D>,
13298            offset: usize,
13299            mut depth: fidl::encoding::Depth,
13300        ) -> fidl::Result<()> {
13301            encoder.debug_check_bounds::<WlanAssociationConfig>(offset);
13302            // Vector header
13303            let max_ordinal: u64 = self.max_ordinal_present();
13304            encoder.write_num(max_ordinal, offset);
13305            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
13306            // Calling encoder.out_of_line_offset(0) is not allowed.
13307            if max_ordinal == 0 {
13308                return Ok(());
13309            }
13310            depth.increment()?;
13311            let envelope_size = 8;
13312            let bytes_len = max_ordinal as usize * envelope_size;
13313            #[allow(unused_variables)]
13314            let offset = encoder.out_of_line_offset(bytes_len);
13315            let mut _prev_end_offset: usize = 0;
13316            if 1 > max_ordinal {
13317                return Ok(());
13318            }
13319
13320            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13321            // are envelope_size bytes.
13322            let cur_offset: usize = (1 - 1) * envelope_size;
13323
13324            // Zero reserved fields.
13325            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13326
13327            // Safety:
13328            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13329            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13330            //   envelope_size bytes, there is always sufficient room.
13331            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
13332                self.bssid
13333                    .as_ref()
13334                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
13335                encoder,
13336                offset + cur_offset,
13337                depth,
13338            )?;
13339
13340            _prev_end_offset = cur_offset + envelope_size;
13341            if 2 > max_ordinal {
13342                return Ok(());
13343            }
13344
13345            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13346            // are envelope_size bytes.
13347            let cur_offset: usize = (2 - 1) * envelope_size;
13348
13349            // Zero reserved fields.
13350            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13351
13352            // Safety:
13353            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13354            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13355            //   envelope_size bytes, there is always sufficient room.
13356            fidl::encoding::encode_in_envelope_optional::<u16, D>(
13357                self.aid.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
13358                encoder,
13359                offset + cur_offset,
13360                depth,
13361            )?;
13362
13363            _prev_end_offset = cur_offset + envelope_size;
13364            if 3 > max_ordinal {
13365                return Ok(());
13366            }
13367
13368            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13369            // are envelope_size bytes.
13370            let cur_offset: usize = (3 - 1) * envelope_size;
13371
13372            // Zero reserved fields.
13373            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13374
13375            // Safety:
13376            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13377            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13378            //   envelope_size bytes, there is always sufficient room.
13379            fidl::encoding::encode_in_envelope_optional::<u16, D>(
13380                self.listen_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
13381                encoder,
13382                offset + cur_offset,
13383                depth,
13384            )?;
13385
13386            _prev_end_offset = cur_offset + envelope_size;
13387            if 4 > max_ordinal {
13388                return Ok(());
13389            }
13390
13391            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13392            // are envelope_size bytes.
13393            let cur_offset: usize = (4 - 1) * envelope_size;
13394
13395            // Zero reserved fields.
13396            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13397
13398            // Safety:
13399            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13400            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13401            //   envelope_size bytes, there is always sufficient room.
13402            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanChannel, D>(
13403            self.channel.as_ref().map(<fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
13404            encoder, offset + cur_offset, depth
13405        )?;
13406
13407            _prev_end_offset = cur_offset + envelope_size;
13408            if 5 > max_ordinal {
13409                return Ok(());
13410            }
13411
13412            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13413            // are envelope_size bytes.
13414            let cur_offset: usize = (5 - 1) * envelope_size;
13415
13416            // Zero reserved fields.
13417            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13418
13419            // Safety:
13420            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13421            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13422            //   envelope_size bytes, there is always sufficient room.
13423            fidl::encoding::encode_in_envelope_optional::<bool, D>(
13424                self.qos.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
13425                encoder,
13426                offset + cur_offset,
13427                depth,
13428            )?;
13429
13430            _prev_end_offset = cur_offset + envelope_size;
13431            if 6 > max_ordinal {
13432                return Ok(());
13433            }
13434
13435            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13436            // are envelope_size bytes.
13437            let cur_offset: usize = (6 - 1) * envelope_size;
13438
13439            // Zero reserved fields.
13440            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13441
13442            // Safety:
13443            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13444            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13445            //   envelope_size bytes, there is always sufficient room.
13446            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanWmmParameters, D>(
13447            self.wmm_params.as_ref().map(<fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
13448            encoder, offset + cur_offset, depth
13449        )?;
13450
13451            _prev_end_offset = cur_offset + envelope_size;
13452            if 7 > max_ordinal {
13453                return Ok(());
13454            }
13455
13456            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13457            // are envelope_size bytes.
13458            let cur_offset: usize = (7 - 1) * envelope_size;
13459
13460            // Zero reserved fields.
13461            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13462
13463            // Safety:
13464            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13465            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13466            //   envelope_size bytes, there is always sufficient room.
13467            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 263>, D>(
13468                self.rates.as_ref().map(
13469                    <fidl::encoding::Vector<u8, 263> as fidl::encoding::ValueTypeMarker>::borrow,
13470                ),
13471                encoder,
13472                offset + cur_offset,
13473                depth,
13474            )?;
13475
13476            _prev_end_offset = cur_offset + envelope_size;
13477            if 8 > max_ordinal {
13478                return Ok(());
13479            }
13480
13481            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13482            // are envelope_size bytes.
13483            let cur_offset: usize = (8 - 1) * envelope_size;
13484
13485            // Zero reserved fields.
13486            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13487
13488            // Safety:
13489            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13490            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13491            //   envelope_size bytes, there is always sufficient room.
13492            fidl::encoding::encode_in_envelope_optional::<u16, D>(
13493                self.capability_info.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
13494                encoder,
13495                offset + cur_offset,
13496                depth,
13497            )?;
13498
13499            _prev_end_offset = cur_offset + envelope_size;
13500            if 9 > max_ordinal {
13501                return Ok(());
13502            }
13503
13504            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13505            // are envelope_size bytes.
13506            let cur_offset: usize = (9 - 1) * envelope_size;
13507
13508            // Zero reserved fields.
13509            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13510
13511            // Safety:
13512            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13513            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13514            //   envelope_size bytes, there is always sufficient room.
13515            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtCapabilities, D>(
13516            self.ht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
13517            encoder, offset + cur_offset, depth
13518        )?;
13519
13520            _prev_end_offset = cur_offset + envelope_size;
13521            if 10 > max_ordinal {
13522                return Ok(());
13523            }
13524
13525            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13526            // are envelope_size bytes.
13527            let cur_offset: usize = (10 - 1) * envelope_size;
13528
13529            // Zero reserved fields.
13530            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13531
13532            // Safety:
13533            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13534            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13535            //   envelope_size bytes, there is always sufficient room.
13536            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtOperation, D>(
13537            self.ht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtOperation as fidl::encoding::ValueTypeMarker>::borrow),
13538            encoder, offset + cur_offset, depth
13539        )?;
13540
13541            _prev_end_offset = cur_offset + envelope_size;
13542            if 11 > max_ordinal {
13543                return Ok(());
13544            }
13545
13546            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13547            // are envelope_size bytes.
13548            let cur_offset: usize = (11 - 1) * envelope_size;
13549
13550            // Zero reserved fields.
13551            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13552
13553            // Safety:
13554            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13555            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13556            //   envelope_size bytes, there is always sufficient room.
13557            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D>(
13558            self.vht_cap.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
13559            encoder, offset + cur_offset, depth
13560        )?;
13561
13562            _prev_end_offset = cur_offset + envelope_size;
13563            if 12 > max_ordinal {
13564                return Ok(());
13565            }
13566
13567            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
13568            // are envelope_size bytes.
13569            let cur_offset: usize = (12 - 1) * envelope_size;
13570
13571            // Zero reserved fields.
13572            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
13573
13574            // Safety:
13575            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
13576            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
13577            //   envelope_size bytes, there is always sufficient room.
13578            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtOperation, D>(
13579            self.vht_op.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtOperation as fidl::encoding::ValueTypeMarker>::borrow),
13580            encoder, offset + cur_offset, depth
13581        )?;
13582
13583            _prev_end_offset = cur_offset + envelope_size;
13584
13585            Ok(())
13586        }
13587    }
13588
13589    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanAssociationConfig {
13590        #[inline(always)]
13591        fn new_empty() -> Self {
13592            Self::default()
13593        }
13594
13595        unsafe fn decode(
13596            &mut self,
13597            decoder: &mut fidl::encoding::Decoder<'_, D>,
13598            offset: usize,
13599            mut depth: fidl::encoding::Depth,
13600        ) -> fidl::Result<()> {
13601            decoder.debug_check_bounds::<Self>(offset);
13602            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
13603                None => return Err(fidl::Error::NotNullable),
13604                Some(len) => len,
13605            };
13606            // Calling decoder.out_of_line_offset(0) is not allowed.
13607            if len == 0 {
13608                return Ok(());
13609            };
13610            depth.increment()?;
13611            let envelope_size = 8;
13612            let bytes_len = len * envelope_size;
13613            let offset = decoder.out_of_line_offset(bytes_len)?;
13614            // Decode the envelope for each type.
13615            let mut _next_ordinal_to_read = 0;
13616            let mut next_offset = offset;
13617            let end_offset = offset + bytes_len;
13618            _next_ordinal_to_read += 1;
13619            if next_offset >= end_offset {
13620                return Ok(());
13621            }
13622
13623            // Decode unknown envelopes for gaps in ordinals.
13624            while _next_ordinal_to_read < 1 {
13625                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13626                _next_ordinal_to_read += 1;
13627                next_offset += envelope_size;
13628            }
13629
13630            let next_out_of_line = decoder.next_out_of_line();
13631            let handles_before = decoder.remaining_handles();
13632            if let Some((inlined, num_bytes, num_handles)) =
13633                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13634            {
13635                let member_inline_size =
13636                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
13637                        decoder.context,
13638                    );
13639                if inlined != (member_inline_size <= 4) {
13640                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13641                }
13642                let inner_offset;
13643                let mut inner_depth = depth.clone();
13644                if inlined {
13645                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13646                    inner_offset = next_offset;
13647                } else {
13648                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13649                    inner_depth.increment()?;
13650                }
13651                let val_ref = self
13652                    .bssid
13653                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
13654                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
13655                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13656                {
13657                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13658                }
13659                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13660                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13661                }
13662            }
13663
13664            next_offset += envelope_size;
13665            _next_ordinal_to_read += 1;
13666            if next_offset >= end_offset {
13667                return Ok(());
13668            }
13669
13670            // Decode unknown envelopes for gaps in ordinals.
13671            while _next_ordinal_to_read < 2 {
13672                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13673                _next_ordinal_to_read += 1;
13674                next_offset += envelope_size;
13675            }
13676
13677            let next_out_of_line = decoder.next_out_of_line();
13678            let handles_before = decoder.remaining_handles();
13679            if let Some((inlined, num_bytes, num_handles)) =
13680                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13681            {
13682                let member_inline_size =
13683                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13684                if inlined != (member_inline_size <= 4) {
13685                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13686                }
13687                let inner_offset;
13688                let mut inner_depth = depth.clone();
13689                if inlined {
13690                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13691                    inner_offset = next_offset;
13692                } else {
13693                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13694                    inner_depth.increment()?;
13695                }
13696                let val_ref = self.aid.get_or_insert_with(|| fidl::new_empty!(u16, D));
13697                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
13698                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13699                {
13700                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13701                }
13702                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13703                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13704                }
13705            }
13706
13707            next_offset += envelope_size;
13708            _next_ordinal_to_read += 1;
13709            if next_offset >= end_offset {
13710                return Ok(());
13711            }
13712
13713            // Decode unknown envelopes for gaps in ordinals.
13714            while _next_ordinal_to_read < 3 {
13715                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13716                _next_ordinal_to_read += 1;
13717                next_offset += envelope_size;
13718            }
13719
13720            let next_out_of_line = decoder.next_out_of_line();
13721            let handles_before = decoder.remaining_handles();
13722            if let Some((inlined, num_bytes, num_handles)) =
13723                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13724            {
13725                let member_inline_size =
13726                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13727                if inlined != (member_inline_size <= 4) {
13728                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13729                }
13730                let inner_offset;
13731                let mut inner_depth = depth.clone();
13732                if inlined {
13733                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13734                    inner_offset = next_offset;
13735                } else {
13736                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13737                    inner_depth.increment()?;
13738                }
13739                let val_ref = self.listen_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
13740                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
13741                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13742                {
13743                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13744                }
13745                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13746                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13747                }
13748            }
13749
13750            next_offset += envelope_size;
13751            _next_ordinal_to_read += 1;
13752            if next_offset >= end_offset {
13753                return Ok(());
13754            }
13755
13756            // Decode unknown envelopes for gaps in ordinals.
13757            while _next_ordinal_to_read < 4 {
13758                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13759                _next_ordinal_to_read += 1;
13760                next_offset += envelope_size;
13761            }
13762
13763            let next_out_of_line = decoder.next_out_of_line();
13764            let handles_before = decoder.remaining_handles();
13765            if let Some((inlined, num_bytes, num_handles)) =
13766                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13767            {
13768                let member_inline_size = <fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13769                if inlined != (member_inline_size <= 4) {
13770                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13771                }
13772                let inner_offset;
13773                let mut inner_depth = depth.clone();
13774                if inlined {
13775                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13776                    inner_offset = next_offset;
13777                } else {
13778                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13779                    inner_depth.increment()?;
13780                }
13781                let val_ref = self.channel.get_or_insert_with(|| {
13782                    fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D)
13783                });
13784                fidl::decode!(
13785                    fidl_fuchsia_wlan_common::WlanChannel,
13786                    D,
13787                    val_ref,
13788                    decoder,
13789                    inner_offset,
13790                    inner_depth
13791                )?;
13792                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13793                {
13794                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13795                }
13796                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13797                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13798                }
13799            }
13800
13801            next_offset += envelope_size;
13802            _next_ordinal_to_read += 1;
13803            if next_offset >= end_offset {
13804                return Ok(());
13805            }
13806
13807            // Decode unknown envelopes for gaps in ordinals.
13808            while _next_ordinal_to_read < 5 {
13809                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13810                _next_ordinal_to_read += 1;
13811                next_offset += envelope_size;
13812            }
13813
13814            let next_out_of_line = decoder.next_out_of_line();
13815            let handles_before = decoder.remaining_handles();
13816            if let Some((inlined, num_bytes, num_handles)) =
13817                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13818            {
13819                let member_inline_size =
13820                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13821                if inlined != (member_inline_size <= 4) {
13822                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13823                }
13824                let inner_offset;
13825                let mut inner_depth = depth.clone();
13826                if inlined {
13827                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13828                    inner_offset = next_offset;
13829                } else {
13830                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13831                    inner_depth.increment()?;
13832                }
13833                let val_ref = self.qos.get_or_insert_with(|| fidl::new_empty!(bool, D));
13834                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
13835                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13836                {
13837                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13838                }
13839                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13840                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13841                }
13842            }
13843
13844            next_offset += envelope_size;
13845            _next_ordinal_to_read += 1;
13846            if next_offset >= end_offset {
13847                return Ok(());
13848            }
13849
13850            // Decode unknown envelopes for gaps in ordinals.
13851            while _next_ordinal_to_read < 6 {
13852                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13853                _next_ordinal_to_read += 1;
13854                next_offset += envelope_size;
13855            }
13856
13857            let next_out_of_line = decoder.next_out_of_line();
13858            let handles_before = decoder.remaining_handles();
13859            if let Some((inlined, num_bytes, num_handles)) =
13860                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13861            {
13862                let member_inline_size = <fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13863                if inlined != (member_inline_size <= 4) {
13864                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13865                }
13866                let inner_offset;
13867                let mut inner_depth = depth.clone();
13868                if inlined {
13869                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13870                    inner_offset = next_offset;
13871                } else {
13872                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13873                    inner_depth.increment()?;
13874                }
13875                let val_ref = self.wmm_params.get_or_insert_with(|| {
13876                    fidl::new_empty!(fidl_fuchsia_wlan_common::WlanWmmParameters, D)
13877                });
13878                fidl::decode!(
13879                    fidl_fuchsia_wlan_common::WlanWmmParameters,
13880                    D,
13881                    val_ref,
13882                    decoder,
13883                    inner_offset,
13884                    inner_depth
13885                )?;
13886                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13887                {
13888                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13889                }
13890                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13891                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13892                }
13893            }
13894
13895            next_offset += envelope_size;
13896            _next_ordinal_to_read += 1;
13897            if next_offset >= end_offset {
13898                return Ok(());
13899            }
13900
13901            // Decode unknown envelopes for gaps in ordinals.
13902            while _next_ordinal_to_read < 7 {
13903                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13904                _next_ordinal_to_read += 1;
13905                next_offset += envelope_size;
13906            }
13907
13908            let next_out_of_line = decoder.next_out_of_line();
13909            let handles_before = decoder.remaining_handles();
13910            if let Some((inlined, num_bytes, num_handles)) =
13911                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13912            {
13913                let member_inline_size =
13914                    <fidl::encoding::Vector<u8, 263> as fidl::encoding::TypeMarker>::inline_size(
13915                        decoder.context,
13916                    );
13917                if inlined != (member_inline_size <= 4) {
13918                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13919                }
13920                let inner_offset;
13921                let mut inner_depth = depth.clone();
13922                if inlined {
13923                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13924                    inner_offset = next_offset;
13925                } else {
13926                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13927                    inner_depth.increment()?;
13928                }
13929                let val_ref = self
13930                    .rates
13931                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 263>, D));
13932                fidl::decode!(fidl::encoding::Vector<u8, 263>, D, val_ref, decoder, inner_offset, inner_depth)?;
13933                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13934                {
13935                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13936                }
13937                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13938                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13939                }
13940            }
13941
13942            next_offset += envelope_size;
13943            _next_ordinal_to_read += 1;
13944            if next_offset >= end_offset {
13945                return Ok(());
13946            }
13947
13948            // Decode unknown envelopes for gaps in ordinals.
13949            while _next_ordinal_to_read < 8 {
13950                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13951                _next_ordinal_to_read += 1;
13952                next_offset += envelope_size;
13953            }
13954
13955            let next_out_of_line = decoder.next_out_of_line();
13956            let handles_before = decoder.remaining_handles();
13957            if let Some((inlined, num_bytes, num_handles)) =
13958                fidl::encoding::decode_envelope_header(decoder, next_offset)?
13959            {
13960                let member_inline_size =
13961                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
13962                if inlined != (member_inline_size <= 4) {
13963                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
13964                }
13965                let inner_offset;
13966                let mut inner_depth = depth.clone();
13967                if inlined {
13968                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
13969                    inner_offset = next_offset;
13970                } else {
13971                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
13972                    inner_depth.increment()?;
13973                }
13974                let val_ref = self.capability_info.get_or_insert_with(|| fidl::new_empty!(u16, D));
13975                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
13976                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
13977                {
13978                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
13979                }
13980                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
13981                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
13982                }
13983            }
13984
13985            next_offset += envelope_size;
13986            _next_ordinal_to_read += 1;
13987            if next_offset >= end_offset {
13988                return Ok(());
13989            }
13990
13991            // Decode unknown envelopes for gaps in ordinals.
13992            while _next_ordinal_to_read < 9 {
13993                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
13994                _next_ordinal_to_read += 1;
13995                next_offset += envelope_size;
13996            }
13997
13998            let next_out_of_line = decoder.next_out_of_line();
13999            let handles_before = decoder.remaining_handles();
14000            if let Some((inlined, num_bytes, num_handles)) =
14001                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14002            {
14003                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14004                if inlined != (member_inline_size <= 4) {
14005                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14006                }
14007                let inner_offset;
14008                let mut inner_depth = depth.clone();
14009                if inlined {
14010                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14011                    inner_offset = next_offset;
14012                } else {
14013                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14014                    inner_depth.increment()?;
14015                }
14016                let val_ref = self.ht_cap.get_or_insert_with(|| {
14017                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtCapabilities, D)
14018                });
14019                fidl::decode!(
14020                    fidl_fuchsia_wlan_ieee80211::HtCapabilities,
14021                    D,
14022                    val_ref,
14023                    decoder,
14024                    inner_offset,
14025                    inner_depth
14026                )?;
14027                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14028                {
14029                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14030                }
14031                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14032                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14033                }
14034            }
14035
14036            next_offset += envelope_size;
14037            _next_ordinal_to_read += 1;
14038            if next_offset >= end_offset {
14039                return Ok(());
14040            }
14041
14042            // Decode unknown envelopes for gaps in ordinals.
14043            while _next_ordinal_to_read < 10 {
14044                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14045                _next_ordinal_to_read += 1;
14046                next_offset += envelope_size;
14047            }
14048
14049            let next_out_of_line = decoder.next_out_of_line();
14050            let handles_before = decoder.remaining_handles();
14051            if let Some((inlined, num_bytes, num_handles)) =
14052                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14053            {
14054                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14055                if inlined != (member_inline_size <= 4) {
14056                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14057                }
14058                let inner_offset;
14059                let mut inner_depth = depth.clone();
14060                if inlined {
14061                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14062                    inner_offset = next_offset;
14063                } else {
14064                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14065                    inner_depth.increment()?;
14066                }
14067                let val_ref = self.ht_op.get_or_insert_with(|| {
14068                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtOperation, D)
14069                });
14070                fidl::decode!(
14071                    fidl_fuchsia_wlan_ieee80211::HtOperation,
14072                    D,
14073                    val_ref,
14074                    decoder,
14075                    inner_offset,
14076                    inner_depth
14077                )?;
14078                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14079                {
14080                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14081                }
14082                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14083                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14084                }
14085            }
14086
14087            next_offset += envelope_size;
14088            _next_ordinal_to_read += 1;
14089            if next_offset >= end_offset {
14090                return Ok(());
14091            }
14092
14093            // Decode unknown envelopes for gaps in ordinals.
14094            while _next_ordinal_to_read < 11 {
14095                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14096                _next_ordinal_to_read += 1;
14097                next_offset += envelope_size;
14098            }
14099
14100            let next_out_of_line = decoder.next_out_of_line();
14101            let handles_before = decoder.remaining_handles();
14102            if let Some((inlined, num_bytes, num_handles)) =
14103                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14104            {
14105                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14106                if inlined != (member_inline_size <= 4) {
14107                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14108                }
14109                let inner_offset;
14110                let mut inner_depth = depth.clone();
14111                if inlined {
14112                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14113                    inner_offset = next_offset;
14114                } else {
14115                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14116                    inner_depth.increment()?;
14117                }
14118                let val_ref = self.vht_cap.get_or_insert_with(|| {
14119                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D)
14120                });
14121                fidl::decode!(
14122                    fidl_fuchsia_wlan_ieee80211::VhtCapabilities,
14123                    D,
14124                    val_ref,
14125                    decoder,
14126                    inner_offset,
14127                    inner_depth
14128                )?;
14129                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14130                {
14131                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14132                }
14133                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14134                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14135                }
14136            }
14137
14138            next_offset += envelope_size;
14139            _next_ordinal_to_read += 1;
14140            if next_offset >= end_offset {
14141                return Ok(());
14142            }
14143
14144            // Decode unknown envelopes for gaps in ordinals.
14145            while _next_ordinal_to_read < 12 {
14146                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14147                _next_ordinal_to_read += 1;
14148                next_offset += envelope_size;
14149            }
14150
14151            let next_out_of_line = decoder.next_out_of_line();
14152            let handles_before = decoder.remaining_handles();
14153            if let Some((inlined, num_bytes, num_handles)) =
14154                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14155            {
14156                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtOperation as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14157                if inlined != (member_inline_size <= 4) {
14158                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14159                }
14160                let inner_offset;
14161                let mut inner_depth = depth.clone();
14162                if inlined {
14163                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14164                    inner_offset = next_offset;
14165                } else {
14166                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14167                    inner_depth.increment()?;
14168                }
14169                let val_ref = self.vht_op.get_or_insert_with(|| {
14170                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtOperation, D)
14171                });
14172                fidl::decode!(
14173                    fidl_fuchsia_wlan_ieee80211::VhtOperation,
14174                    D,
14175                    val_ref,
14176                    decoder,
14177                    inner_offset,
14178                    inner_depth
14179                )?;
14180                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14181                {
14182                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14183                }
14184                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14185                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14186                }
14187            }
14188
14189            next_offset += envelope_size;
14190
14191            // Decode the remaining unknown envelopes.
14192            while next_offset < end_offset {
14193                _next_ordinal_to_read += 1;
14194                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14195                next_offset += envelope_size;
14196            }
14197
14198            Ok(())
14199        }
14200    }
14201
14202    impl WlanKeyConfiguration {
14203        #[inline(always)]
14204        fn max_ordinal_present(&self) -> u64 {
14205            if let Some(_) = self.rsc {
14206                return 8;
14207            }
14208            if let Some(_) = self.key {
14209                return 7;
14210            }
14211            if let Some(_) = self.key_idx {
14212                return 6;
14213            }
14214            if let Some(_) = self.peer_addr {
14215                return 5;
14216            }
14217            if let Some(_) = self.key_type {
14218                return 4;
14219            }
14220            if let Some(_) = self.cipher_type {
14221                return 3;
14222            }
14223            if let Some(_) = self.cipher_oui {
14224                return 2;
14225            }
14226            if let Some(_) = self.protection {
14227                return 1;
14228            }
14229            0
14230        }
14231    }
14232
14233    impl fidl::encoding::ValueTypeMarker for WlanKeyConfiguration {
14234        type Borrowed<'a> = &'a Self;
14235        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14236            value
14237        }
14238    }
14239
14240    unsafe impl fidl::encoding::TypeMarker for WlanKeyConfiguration {
14241        type Owned = Self;
14242
14243        #[inline(always)]
14244        fn inline_align(_context: fidl::encoding::Context) -> usize {
14245            8
14246        }
14247
14248        #[inline(always)]
14249        fn inline_size(_context: fidl::encoding::Context) -> usize {
14250            16
14251        }
14252    }
14253
14254    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfiguration, D>
14255        for &WlanKeyConfiguration
14256    {
14257        unsafe fn encode(
14258            self,
14259            encoder: &mut fidl::encoding::Encoder<'_, D>,
14260            offset: usize,
14261            mut depth: fidl::encoding::Depth,
14262        ) -> fidl::Result<()> {
14263            encoder.debug_check_bounds::<WlanKeyConfiguration>(offset);
14264            // Vector header
14265            let max_ordinal: u64 = self.max_ordinal_present();
14266            encoder.write_num(max_ordinal, offset);
14267            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14268            // Calling encoder.out_of_line_offset(0) is not allowed.
14269            if max_ordinal == 0 {
14270                return Ok(());
14271            }
14272            depth.increment()?;
14273            let envelope_size = 8;
14274            let bytes_len = max_ordinal as usize * envelope_size;
14275            #[allow(unused_variables)]
14276            let offset = encoder.out_of_line_offset(bytes_len);
14277            let mut _prev_end_offset: usize = 0;
14278            if 1 > max_ordinal {
14279                return Ok(());
14280            }
14281
14282            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14283            // are envelope_size bytes.
14284            let cur_offset: usize = (1 - 1) * envelope_size;
14285
14286            // Zero reserved fields.
14287            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14288
14289            // Safety:
14290            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14291            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14292            //   envelope_size bytes, there is always sufficient room.
14293            fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
14294                self.protection
14295                    .as_ref()
14296                    .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
14297                encoder,
14298                offset + cur_offset,
14299                depth,
14300            )?;
14301
14302            _prev_end_offset = cur_offset + envelope_size;
14303            if 2 > max_ordinal {
14304                return Ok(());
14305            }
14306
14307            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14308            // are envelope_size bytes.
14309            let cur_offset: usize = (2 - 1) * envelope_size;
14310
14311            // Zero reserved fields.
14312            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14313
14314            // Safety:
14315            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14316            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14317            //   envelope_size bytes, there is always sufficient room.
14318            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
14319                self.cipher_oui
14320                    .as_ref()
14321                    .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
14322                encoder,
14323                offset + cur_offset,
14324                depth,
14325            )?;
14326
14327            _prev_end_offset = cur_offset + envelope_size;
14328            if 3 > max_ordinal {
14329                return Ok(());
14330            }
14331
14332            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14333            // are envelope_size bytes.
14334            let cur_offset: usize = (3 - 1) * envelope_size;
14335
14336            // Zero reserved fields.
14337            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14338
14339            // Safety:
14340            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14341            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14342            //   envelope_size bytes, there is always sufficient room.
14343            fidl::encoding::encode_in_envelope_optional::<u8, D>(
14344                self.cipher_type.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
14345                encoder,
14346                offset + cur_offset,
14347                depth,
14348            )?;
14349
14350            _prev_end_offset = cur_offset + envelope_size;
14351            if 4 > max_ordinal {
14352                return Ok(());
14353            }
14354
14355            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14356            // are envelope_size bytes.
14357            let cur_offset: usize = (4 - 1) * envelope_size;
14358
14359            // Zero reserved fields.
14360            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14361
14362            // Safety:
14363            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14364            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14365            //   envelope_size bytes, there is always sufficient room.
14366            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanKeyType, D>(
14367            self.key_type.as_ref().map(<fidl_fuchsia_wlan_common::WlanKeyType as fidl::encoding::ValueTypeMarker>::borrow),
14368            encoder, offset + cur_offset, depth
14369        )?;
14370
14371            _prev_end_offset = cur_offset + envelope_size;
14372            if 5 > max_ordinal {
14373                return Ok(());
14374            }
14375
14376            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14377            // are envelope_size bytes.
14378            let cur_offset: usize = (5 - 1) * envelope_size;
14379
14380            // Zero reserved fields.
14381            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14382
14383            // Safety:
14384            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14385            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14386            //   envelope_size bytes, there is always sufficient room.
14387            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
14388                self.peer_addr
14389                    .as_ref()
14390                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
14391                encoder,
14392                offset + cur_offset,
14393                depth,
14394            )?;
14395
14396            _prev_end_offset = cur_offset + envelope_size;
14397            if 6 > max_ordinal {
14398                return Ok(());
14399            }
14400
14401            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14402            // are envelope_size bytes.
14403            let cur_offset: usize = (6 - 1) * envelope_size;
14404
14405            // Zero reserved fields.
14406            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14407
14408            // Safety:
14409            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14410            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14411            //   envelope_size bytes, there is always sufficient room.
14412            fidl::encoding::encode_in_envelope_optional::<u8, D>(
14413                self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
14414                encoder,
14415                offset + cur_offset,
14416                depth,
14417            )?;
14418
14419            _prev_end_offset = cur_offset + envelope_size;
14420            if 7 > max_ordinal {
14421                return Ok(());
14422            }
14423
14424            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14425            // are envelope_size bytes.
14426            let cur_offset: usize = (7 - 1) * envelope_size;
14427
14428            // Zero reserved fields.
14429            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14430
14431            // Safety:
14432            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14433            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14434            //   envelope_size bytes, there is always sufficient room.
14435            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
14436                self.key.as_ref().map(
14437                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
14438                ),
14439                encoder,
14440                offset + cur_offset,
14441                depth,
14442            )?;
14443
14444            _prev_end_offset = cur_offset + envelope_size;
14445            if 8 > max_ordinal {
14446                return Ok(());
14447            }
14448
14449            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14450            // are envelope_size bytes.
14451            let cur_offset: usize = (8 - 1) * envelope_size;
14452
14453            // Zero reserved fields.
14454            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14455
14456            // Safety:
14457            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14458            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14459            //   envelope_size bytes, there is always sufficient room.
14460            fidl::encoding::encode_in_envelope_optional::<u64, D>(
14461                self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
14462                encoder,
14463                offset + cur_offset,
14464                depth,
14465            )?;
14466
14467            _prev_end_offset = cur_offset + envelope_size;
14468
14469            Ok(())
14470        }
14471    }
14472
14473    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfiguration {
14474        #[inline(always)]
14475        fn new_empty() -> Self {
14476            Self::default()
14477        }
14478
14479        unsafe fn decode(
14480            &mut self,
14481            decoder: &mut fidl::encoding::Decoder<'_, D>,
14482            offset: usize,
14483            mut depth: fidl::encoding::Depth,
14484        ) -> fidl::Result<()> {
14485            decoder.debug_check_bounds::<Self>(offset);
14486            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
14487                None => return Err(fidl::Error::NotNullable),
14488                Some(len) => len,
14489            };
14490            // Calling decoder.out_of_line_offset(0) is not allowed.
14491            if len == 0 {
14492                return Ok(());
14493            };
14494            depth.increment()?;
14495            let envelope_size = 8;
14496            let bytes_len = len * envelope_size;
14497            let offset = decoder.out_of_line_offset(bytes_len)?;
14498            // Decode the envelope for each type.
14499            let mut _next_ordinal_to_read = 0;
14500            let mut next_offset = offset;
14501            let end_offset = offset + bytes_len;
14502            _next_ordinal_to_read += 1;
14503            if next_offset >= end_offset {
14504                return Ok(());
14505            }
14506
14507            // Decode unknown envelopes for gaps in ordinals.
14508            while _next_ordinal_to_read < 1 {
14509                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14510                _next_ordinal_to_read += 1;
14511                next_offset += envelope_size;
14512            }
14513
14514            let next_out_of_line = decoder.next_out_of_line();
14515            let handles_before = decoder.remaining_handles();
14516            if let Some((inlined, num_bytes, num_handles)) =
14517                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14518            {
14519                let member_inline_size =
14520                    <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14521                if inlined != (member_inline_size <= 4) {
14522                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14523                }
14524                let inner_offset;
14525                let mut inner_depth = depth.clone();
14526                if inlined {
14527                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14528                    inner_offset = next_offset;
14529                } else {
14530                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14531                    inner_depth.increment()?;
14532                }
14533                let val_ref =
14534                    self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
14535                fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
14536                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14537                {
14538                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14539                }
14540                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14541                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14542                }
14543            }
14544
14545            next_offset += envelope_size;
14546            _next_ordinal_to_read += 1;
14547            if next_offset >= end_offset {
14548                return Ok(());
14549            }
14550
14551            // Decode unknown envelopes for gaps in ordinals.
14552            while _next_ordinal_to_read < 2 {
14553                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14554                _next_ordinal_to_read += 1;
14555                next_offset += envelope_size;
14556            }
14557
14558            let next_out_of_line = decoder.next_out_of_line();
14559            let handles_before = decoder.remaining_handles();
14560            if let Some((inlined, num_bytes, num_handles)) =
14561                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14562            {
14563                let member_inline_size =
14564                    <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
14565                        decoder.context,
14566                    );
14567                if inlined != (member_inline_size <= 4) {
14568                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14569                }
14570                let inner_offset;
14571                let mut inner_depth = depth.clone();
14572                if inlined {
14573                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14574                    inner_offset = next_offset;
14575                } else {
14576                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14577                    inner_depth.increment()?;
14578                }
14579                let val_ref = self
14580                    .cipher_oui
14581                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
14582                fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
14583                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14584                {
14585                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14586                }
14587                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14588                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14589                }
14590            }
14591
14592            next_offset += envelope_size;
14593            _next_ordinal_to_read += 1;
14594            if next_offset >= end_offset {
14595                return Ok(());
14596            }
14597
14598            // Decode unknown envelopes for gaps in ordinals.
14599            while _next_ordinal_to_read < 3 {
14600                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14601                _next_ordinal_to_read += 1;
14602                next_offset += envelope_size;
14603            }
14604
14605            let next_out_of_line = decoder.next_out_of_line();
14606            let handles_before = decoder.remaining_handles();
14607            if let Some((inlined, num_bytes, num_handles)) =
14608                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14609            {
14610                let member_inline_size =
14611                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14612                if inlined != (member_inline_size <= 4) {
14613                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14614                }
14615                let inner_offset;
14616                let mut inner_depth = depth.clone();
14617                if inlined {
14618                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14619                    inner_offset = next_offset;
14620                } else {
14621                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14622                    inner_depth.increment()?;
14623                }
14624                let val_ref = self.cipher_type.get_or_insert_with(|| fidl::new_empty!(u8, D));
14625                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
14626                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14627                {
14628                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14629                }
14630                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14631                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14632                }
14633            }
14634
14635            next_offset += envelope_size;
14636            _next_ordinal_to_read += 1;
14637            if next_offset >= end_offset {
14638                return Ok(());
14639            }
14640
14641            // Decode unknown envelopes for gaps in ordinals.
14642            while _next_ordinal_to_read < 4 {
14643                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14644                _next_ordinal_to_read += 1;
14645                next_offset += envelope_size;
14646            }
14647
14648            let next_out_of_line = decoder.next_out_of_line();
14649            let handles_before = decoder.remaining_handles();
14650            if let Some((inlined, num_bytes, num_handles)) =
14651                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14652            {
14653                let member_inline_size = <fidl_fuchsia_wlan_common::WlanKeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14654                if inlined != (member_inline_size <= 4) {
14655                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14656                }
14657                let inner_offset;
14658                let mut inner_depth = depth.clone();
14659                if inlined {
14660                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14661                    inner_offset = next_offset;
14662                } else {
14663                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14664                    inner_depth.increment()?;
14665                }
14666                let val_ref = self.key_type.get_or_insert_with(|| {
14667                    fidl::new_empty!(fidl_fuchsia_wlan_common::WlanKeyType, D)
14668                });
14669                fidl::decode!(
14670                    fidl_fuchsia_wlan_common::WlanKeyType,
14671                    D,
14672                    val_ref,
14673                    decoder,
14674                    inner_offset,
14675                    inner_depth
14676                )?;
14677                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14678                {
14679                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14680                }
14681                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14682                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14683                }
14684            }
14685
14686            next_offset += envelope_size;
14687            _next_ordinal_to_read += 1;
14688            if next_offset >= end_offset {
14689                return Ok(());
14690            }
14691
14692            // Decode unknown envelopes for gaps in ordinals.
14693            while _next_ordinal_to_read < 5 {
14694                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14695                _next_ordinal_to_read += 1;
14696                next_offset += envelope_size;
14697            }
14698
14699            let next_out_of_line = decoder.next_out_of_line();
14700            let handles_before = decoder.remaining_handles();
14701            if let Some((inlined, num_bytes, num_handles)) =
14702                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14703            {
14704                let member_inline_size =
14705                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
14706                        decoder.context,
14707                    );
14708                if inlined != (member_inline_size <= 4) {
14709                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14710                }
14711                let inner_offset;
14712                let mut inner_depth = depth.clone();
14713                if inlined {
14714                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14715                    inner_offset = next_offset;
14716                } else {
14717                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14718                    inner_depth.increment()?;
14719                }
14720                let val_ref = self
14721                    .peer_addr
14722                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
14723                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
14724                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14725                {
14726                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14727                }
14728                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14729                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14730                }
14731            }
14732
14733            next_offset += envelope_size;
14734            _next_ordinal_to_read += 1;
14735            if next_offset >= end_offset {
14736                return Ok(());
14737            }
14738
14739            // Decode unknown envelopes for gaps in ordinals.
14740            while _next_ordinal_to_read < 6 {
14741                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14742                _next_ordinal_to_read += 1;
14743                next_offset += envelope_size;
14744            }
14745
14746            let next_out_of_line = decoder.next_out_of_line();
14747            let handles_before = decoder.remaining_handles();
14748            if let Some((inlined, num_bytes, num_handles)) =
14749                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14750            {
14751                let member_inline_size =
14752                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14753                if inlined != (member_inline_size <= 4) {
14754                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14755                }
14756                let inner_offset;
14757                let mut inner_depth = depth.clone();
14758                if inlined {
14759                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14760                    inner_offset = next_offset;
14761                } else {
14762                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14763                    inner_depth.increment()?;
14764                }
14765                let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
14766                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
14767                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14768                {
14769                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14770                }
14771                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14772                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14773                }
14774            }
14775
14776            next_offset += envelope_size;
14777            _next_ordinal_to_read += 1;
14778            if next_offset >= end_offset {
14779                return Ok(());
14780            }
14781
14782            // Decode unknown envelopes for gaps in ordinals.
14783            while _next_ordinal_to_read < 7 {
14784                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14785                _next_ordinal_to_read += 1;
14786                next_offset += envelope_size;
14787            }
14788
14789            let next_out_of_line = decoder.next_out_of_line();
14790            let handles_before = decoder.remaining_handles();
14791            if let Some((inlined, num_bytes, num_handles)) =
14792                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14793            {
14794                let member_inline_size =
14795                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
14796                        decoder.context,
14797                    );
14798                if inlined != (member_inline_size <= 4) {
14799                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14800                }
14801                let inner_offset;
14802                let mut inner_depth = depth.clone();
14803                if inlined {
14804                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14805                    inner_offset = next_offset;
14806                } else {
14807                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14808                    inner_depth.increment()?;
14809                }
14810                let val_ref = self
14811                    .key
14812                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
14813                fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
14814                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14815                {
14816                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14817                }
14818                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14819                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14820                }
14821            }
14822
14823            next_offset += envelope_size;
14824            _next_ordinal_to_read += 1;
14825            if next_offset >= end_offset {
14826                return Ok(());
14827            }
14828
14829            // Decode unknown envelopes for gaps in ordinals.
14830            while _next_ordinal_to_read < 8 {
14831                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14832                _next_ordinal_to_read += 1;
14833                next_offset += envelope_size;
14834            }
14835
14836            let next_out_of_line = decoder.next_out_of_line();
14837            let handles_before = decoder.remaining_handles();
14838            if let Some((inlined, num_bytes, num_handles)) =
14839                fidl::encoding::decode_envelope_header(decoder, next_offset)?
14840            {
14841                let member_inline_size =
14842                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
14843                if inlined != (member_inline_size <= 4) {
14844                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
14845                }
14846                let inner_offset;
14847                let mut inner_depth = depth.clone();
14848                if inlined {
14849                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
14850                    inner_offset = next_offset;
14851                } else {
14852                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
14853                    inner_depth.increment()?;
14854                }
14855                let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
14856                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
14857                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
14858                {
14859                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
14860                }
14861                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
14862                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
14863                }
14864            }
14865
14866            next_offset += envelope_size;
14867
14868            // Decode the remaining unknown envelopes.
14869            while next_offset < end_offset {
14870                _next_ordinal_to_read += 1;
14871                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
14872                next_offset += envelope_size;
14873            }
14874
14875            Ok(())
14876        }
14877    }
14878
14879    impl WlanRxTransferRequest {
14880        #[inline(always)]
14881        fn max_ordinal_present(&self) -> u64 {
14882            if let Some(_) = self.arena {
14883                return 5;
14884            }
14885            if let Some(_) = self.async_id {
14886                return 4;
14887            }
14888            if let Some(_) = self.packet_info {
14889                return 3;
14890            }
14891            if let Some(_) = self.packet_size {
14892                return 2;
14893            }
14894            if let Some(_) = self.packet_address {
14895                return 1;
14896            }
14897            0
14898        }
14899    }
14900
14901    impl fidl::encoding::ValueTypeMarker for WlanRxTransferRequest {
14902        type Borrowed<'a> = &'a Self;
14903        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
14904            value
14905        }
14906    }
14907
14908    unsafe impl fidl::encoding::TypeMarker for WlanRxTransferRequest {
14909        type Owned = Self;
14910
14911        #[inline(always)]
14912        fn inline_align(_context: fidl::encoding::Context) -> usize {
14913            8
14914        }
14915
14916        #[inline(always)]
14917        fn inline_size(_context: fidl::encoding::Context) -> usize {
14918            16
14919        }
14920    }
14921
14922    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxTransferRequest, D>
14923        for &WlanRxTransferRequest
14924    {
14925        unsafe fn encode(
14926            self,
14927            encoder: &mut fidl::encoding::Encoder<'_, D>,
14928            offset: usize,
14929            mut depth: fidl::encoding::Depth,
14930        ) -> fidl::Result<()> {
14931            encoder.debug_check_bounds::<WlanRxTransferRequest>(offset);
14932            // Vector header
14933            let max_ordinal: u64 = self.max_ordinal_present();
14934            encoder.write_num(max_ordinal, offset);
14935            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
14936            // Calling encoder.out_of_line_offset(0) is not allowed.
14937            if max_ordinal == 0 {
14938                return Ok(());
14939            }
14940            depth.increment()?;
14941            let envelope_size = 8;
14942            let bytes_len = max_ordinal as usize * envelope_size;
14943            #[allow(unused_variables)]
14944            let offset = encoder.out_of_line_offset(bytes_len);
14945            let mut _prev_end_offset: usize = 0;
14946            if 1 > max_ordinal {
14947                return Ok(());
14948            }
14949
14950            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14951            // are envelope_size bytes.
14952            let cur_offset: usize = (1 - 1) * envelope_size;
14953
14954            // Zero reserved fields.
14955            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14956
14957            // Safety:
14958            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14959            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14960            //   envelope_size bytes, there is always sufficient room.
14961            fidl::encoding::encode_in_envelope_optional::<u64, D>(
14962                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
14963                encoder,
14964                offset + cur_offset,
14965                depth,
14966            )?;
14967
14968            _prev_end_offset = cur_offset + envelope_size;
14969            if 2 > max_ordinal {
14970                return Ok(());
14971            }
14972
14973            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14974            // are envelope_size bytes.
14975            let cur_offset: usize = (2 - 1) * envelope_size;
14976
14977            // Zero reserved fields.
14978            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
14979
14980            // Safety:
14981            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
14982            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
14983            //   envelope_size bytes, there is always sufficient room.
14984            fidl::encoding::encode_in_envelope_optional::<u64, D>(
14985                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
14986                encoder,
14987                offset + cur_offset,
14988                depth,
14989            )?;
14990
14991            _prev_end_offset = cur_offset + envelope_size;
14992            if 3 > max_ordinal {
14993                return Ok(());
14994            }
14995
14996            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
14997            // are envelope_size bytes.
14998            let cur_offset: usize = (3 - 1) * envelope_size;
14999
15000            // Zero reserved fields.
15001            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15002
15003            // Safety:
15004            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15005            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15006            //   envelope_size bytes, there is always sufficient room.
15007            fidl::encoding::encode_in_envelope_optional::<WlanRxInfo, D>(
15008                self.packet_info
15009                    .as_ref()
15010                    .map(<WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow),
15011                encoder,
15012                offset + cur_offset,
15013                depth,
15014            )?;
15015
15016            _prev_end_offset = cur_offset + envelope_size;
15017            if 4 > max_ordinal {
15018                return Ok(());
15019            }
15020
15021            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15022            // are envelope_size bytes.
15023            let cur_offset: usize = (4 - 1) * envelope_size;
15024
15025            // Zero reserved fields.
15026            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15027
15028            // Safety:
15029            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15030            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15031            //   envelope_size bytes, there is always sufficient room.
15032            fidl::encoding::encode_in_envelope_optional::<u64, D>(
15033                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15034                encoder,
15035                offset + cur_offset,
15036                depth,
15037            )?;
15038
15039            _prev_end_offset = cur_offset + envelope_size;
15040            if 5 > max_ordinal {
15041                return Ok(());
15042            }
15043
15044            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15045            // are envelope_size bytes.
15046            let cur_offset: usize = (5 - 1) * envelope_size;
15047
15048            // Zero reserved fields.
15049            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15050
15051            // Safety:
15052            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15053            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15054            //   envelope_size bytes, there is always sufficient room.
15055            fidl::encoding::encode_in_envelope_optional::<u64, D>(
15056                self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
15057                encoder,
15058                offset + cur_offset,
15059                depth,
15060            )?;
15061
15062            _prev_end_offset = cur_offset + envelope_size;
15063
15064            Ok(())
15065        }
15066    }
15067
15068    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxTransferRequest {
15069        #[inline(always)]
15070        fn new_empty() -> Self {
15071            Self::default()
15072        }
15073
15074        unsafe fn decode(
15075            &mut self,
15076            decoder: &mut fidl::encoding::Decoder<'_, D>,
15077            offset: usize,
15078            mut depth: fidl::encoding::Depth,
15079        ) -> fidl::Result<()> {
15080            decoder.debug_check_bounds::<Self>(offset);
15081            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15082                None => return Err(fidl::Error::NotNullable),
15083                Some(len) => len,
15084            };
15085            // Calling decoder.out_of_line_offset(0) is not allowed.
15086            if len == 0 {
15087                return Ok(());
15088            };
15089            depth.increment()?;
15090            let envelope_size = 8;
15091            let bytes_len = len * envelope_size;
15092            let offset = decoder.out_of_line_offset(bytes_len)?;
15093            // Decode the envelope for each type.
15094            let mut _next_ordinal_to_read = 0;
15095            let mut next_offset = offset;
15096            let end_offset = offset + bytes_len;
15097            _next_ordinal_to_read += 1;
15098            if next_offset >= end_offset {
15099                return Ok(());
15100            }
15101
15102            // Decode unknown envelopes for gaps in ordinals.
15103            while _next_ordinal_to_read < 1 {
15104                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15105                _next_ordinal_to_read += 1;
15106                next_offset += envelope_size;
15107            }
15108
15109            let next_out_of_line = decoder.next_out_of_line();
15110            let handles_before = decoder.remaining_handles();
15111            if let Some((inlined, num_bytes, num_handles)) =
15112                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15113            {
15114                let member_inline_size =
15115                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15116                if inlined != (member_inline_size <= 4) {
15117                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15118                }
15119                let inner_offset;
15120                let mut inner_depth = depth.clone();
15121                if inlined {
15122                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15123                    inner_offset = next_offset;
15124                } else {
15125                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15126                    inner_depth.increment()?;
15127                }
15128                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
15129                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15130                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15131                {
15132                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15133                }
15134                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15135                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15136                }
15137            }
15138
15139            next_offset += envelope_size;
15140            _next_ordinal_to_read += 1;
15141            if next_offset >= end_offset {
15142                return Ok(());
15143            }
15144
15145            // Decode unknown envelopes for gaps in ordinals.
15146            while _next_ordinal_to_read < 2 {
15147                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15148                _next_ordinal_to_read += 1;
15149                next_offset += envelope_size;
15150            }
15151
15152            let next_out_of_line = decoder.next_out_of_line();
15153            let handles_before = decoder.remaining_handles();
15154            if let Some((inlined, num_bytes, num_handles)) =
15155                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15156            {
15157                let member_inline_size =
15158                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15159                if inlined != (member_inline_size <= 4) {
15160                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15161                }
15162                let inner_offset;
15163                let mut inner_depth = depth.clone();
15164                if inlined {
15165                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15166                    inner_offset = next_offset;
15167                } else {
15168                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15169                    inner_depth.increment()?;
15170                }
15171                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
15172                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15173                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15174                {
15175                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15176                }
15177                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15178                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15179                }
15180            }
15181
15182            next_offset += envelope_size;
15183            _next_ordinal_to_read += 1;
15184            if next_offset >= end_offset {
15185                return Ok(());
15186            }
15187
15188            // Decode unknown envelopes for gaps in ordinals.
15189            while _next_ordinal_to_read < 3 {
15190                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15191                _next_ordinal_to_read += 1;
15192                next_offset += envelope_size;
15193            }
15194
15195            let next_out_of_line = decoder.next_out_of_line();
15196            let handles_before = decoder.remaining_handles();
15197            if let Some((inlined, num_bytes, num_handles)) =
15198                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15199            {
15200                let member_inline_size =
15201                    <WlanRxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15202                if inlined != (member_inline_size <= 4) {
15203                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15204                }
15205                let inner_offset;
15206                let mut inner_depth = depth.clone();
15207                if inlined {
15208                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15209                    inner_offset = next_offset;
15210                } else {
15211                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15212                    inner_depth.increment()?;
15213                }
15214                let val_ref =
15215                    self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanRxInfo, D));
15216                fidl::decode!(WlanRxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
15217                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15218                {
15219                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15220                }
15221                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15222                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15223                }
15224            }
15225
15226            next_offset += envelope_size;
15227            _next_ordinal_to_read += 1;
15228            if next_offset >= end_offset {
15229                return Ok(());
15230            }
15231
15232            // Decode unknown envelopes for gaps in ordinals.
15233            while _next_ordinal_to_read < 4 {
15234                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15235                _next_ordinal_to_read += 1;
15236                next_offset += envelope_size;
15237            }
15238
15239            let next_out_of_line = decoder.next_out_of_line();
15240            let handles_before = decoder.remaining_handles();
15241            if let Some((inlined, num_bytes, num_handles)) =
15242                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15243            {
15244                let member_inline_size =
15245                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15246                if inlined != (member_inline_size <= 4) {
15247                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15248                }
15249                let inner_offset;
15250                let mut inner_depth = depth.clone();
15251                if inlined {
15252                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15253                    inner_offset = next_offset;
15254                } else {
15255                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15256                    inner_depth.increment()?;
15257                }
15258                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
15259                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15260                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15261                {
15262                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15263                }
15264                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15265                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15266                }
15267            }
15268
15269            next_offset += envelope_size;
15270            _next_ordinal_to_read += 1;
15271            if next_offset >= end_offset {
15272                return Ok(());
15273            }
15274
15275            // Decode unknown envelopes for gaps in ordinals.
15276            while _next_ordinal_to_read < 5 {
15277                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15278                _next_ordinal_to_read += 1;
15279                next_offset += envelope_size;
15280            }
15281
15282            let next_out_of_line = decoder.next_out_of_line();
15283            let handles_before = decoder.remaining_handles();
15284            if let Some((inlined, num_bytes, num_handles)) =
15285                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15286            {
15287                let member_inline_size =
15288                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15289                if inlined != (member_inline_size <= 4) {
15290                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15291                }
15292                let inner_offset;
15293                let mut inner_depth = depth.clone();
15294                if inlined {
15295                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15296                    inner_offset = next_offset;
15297                } else {
15298                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15299                    inner_depth.increment()?;
15300                }
15301                let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
15302                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
15303                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15304                {
15305                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15306                }
15307                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15308                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15309                }
15310            }
15311
15312            next_offset += envelope_size;
15313
15314            // Decode the remaining unknown envelopes.
15315            while next_offset < end_offset {
15316                _next_ordinal_to_read += 1;
15317                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15318                next_offset += envelope_size;
15319            }
15320
15321            Ok(())
15322        }
15323    }
15324
15325    impl WlanSoftmacBandCapability {
15326        #[inline(always)]
15327        fn max_ordinal_present(&self) -> u64 {
15328            if let Some(_) = self.operating_channels {
15329                return 11;
15330            }
15331            if let Some(_) = self.basic_rates {
15332                return 10;
15333            }
15334            if let Some(_) = self.operating_channel_list {
15335                return 9;
15336            }
15337            if let Some(_) = self.operating_channel_count {
15338                return 8;
15339            }
15340            if let Some(_) = self.vht_caps {
15341                return 7;
15342            }
15343            if let Some(_) = self.vht_supported {
15344                return 6;
15345            }
15346            if let Some(_) = self.ht_caps {
15347                return 5;
15348            }
15349            if let Some(_) = self.ht_supported {
15350                return 4;
15351            }
15352            if let Some(_) = self.basic_rate_list {
15353                return 3;
15354            }
15355            if let Some(_) = self.basic_rate_count {
15356                return 2;
15357            }
15358            if let Some(_) = self.band {
15359                return 1;
15360            }
15361            0
15362        }
15363    }
15364
15365    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBandCapability {
15366        type Borrowed<'a> = &'a Self;
15367        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
15368            value
15369        }
15370    }
15371
15372    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBandCapability {
15373        type Owned = Self;
15374
15375        #[inline(always)]
15376        fn inline_align(_context: fidl::encoding::Context) -> usize {
15377            8
15378        }
15379
15380        #[inline(always)]
15381        fn inline_size(_context: fidl::encoding::Context) -> usize {
15382            16
15383        }
15384    }
15385
15386    unsafe impl<D: fidl::encoding::ResourceDialect>
15387        fidl::encoding::Encode<WlanSoftmacBandCapability, D> for &WlanSoftmacBandCapability
15388    {
15389        unsafe fn encode(
15390            self,
15391            encoder: &mut fidl::encoding::Encoder<'_, D>,
15392            offset: usize,
15393            mut depth: fidl::encoding::Depth,
15394        ) -> fidl::Result<()> {
15395            encoder.debug_check_bounds::<WlanSoftmacBandCapability>(offset);
15396            // Vector header
15397            let max_ordinal: u64 = self.max_ordinal_present();
15398            encoder.write_num(max_ordinal, offset);
15399            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
15400            // Calling encoder.out_of_line_offset(0) is not allowed.
15401            if max_ordinal == 0 {
15402                return Ok(());
15403            }
15404            depth.increment()?;
15405            let envelope_size = 8;
15406            let bytes_len = max_ordinal as usize * envelope_size;
15407            #[allow(unused_variables)]
15408            let offset = encoder.out_of_line_offset(bytes_len);
15409            let mut _prev_end_offset: usize = 0;
15410            if 1 > max_ordinal {
15411                return Ok(());
15412            }
15413
15414            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15415            // are envelope_size bytes.
15416            let cur_offset: usize = (1 - 1) * envelope_size;
15417
15418            // Zero reserved fields.
15419            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15420
15421            // Safety:
15422            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15423            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15424            //   envelope_size bytes, there is always sufficient room.
15425            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::WlanBand, D>(
15426            self.band.as_ref().map(<fidl_fuchsia_wlan_ieee80211::WlanBand as fidl::encoding::ValueTypeMarker>::borrow),
15427            encoder, offset + cur_offset, depth
15428        )?;
15429
15430            _prev_end_offset = cur_offset + envelope_size;
15431            if 2 > max_ordinal {
15432                return Ok(());
15433            }
15434
15435            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15436            // are envelope_size bytes.
15437            let cur_offset: usize = (2 - 1) * envelope_size;
15438
15439            // Zero reserved fields.
15440            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15441
15442            // Safety:
15443            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15444            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15445            //   envelope_size bytes, there is always sufficient room.
15446            fidl::encoding::encode_in_envelope_optional::<u8, D>(
15447                self.basic_rate_count.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
15448                encoder,
15449                offset + cur_offset,
15450                depth,
15451            )?;
15452
15453            _prev_end_offset = cur_offset + envelope_size;
15454            if 3 > max_ordinal {
15455                return Ok(());
15456            }
15457
15458            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15459            // are envelope_size bytes.
15460            let cur_offset: usize = (3 - 1) * envelope_size;
15461
15462            // Zero reserved fields.
15463            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15464
15465            // Safety:
15466            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15467            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15468            //   envelope_size bytes, there is always sufficient room.
15469            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 12>, D>(
15470                self.basic_rate_list.as_ref().map(
15471                    <fidl::encoding::Array<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
15472                ),
15473                encoder,
15474                offset + cur_offset,
15475                depth,
15476            )?;
15477
15478            _prev_end_offset = cur_offset + envelope_size;
15479            if 4 > max_ordinal {
15480                return Ok(());
15481            }
15482
15483            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15484            // are envelope_size bytes.
15485            let cur_offset: usize = (4 - 1) * envelope_size;
15486
15487            // Zero reserved fields.
15488            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15489
15490            // Safety:
15491            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15492            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15493            //   envelope_size bytes, there is always sufficient room.
15494            fidl::encoding::encode_in_envelope_optional::<bool, D>(
15495                self.ht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15496                encoder,
15497                offset + cur_offset,
15498                depth,
15499            )?;
15500
15501            _prev_end_offset = cur_offset + envelope_size;
15502            if 5 > max_ordinal {
15503                return Ok(());
15504            }
15505
15506            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15507            // are envelope_size bytes.
15508            let cur_offset: usize = (5 - 1) * envelope_size;
15509
15510            // Zero reserved fields.
15511            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15512
15513            // Safety:
15514            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15515            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15516            //   envelope_size bytes, there is always sufficient room.
15517            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::HtCapabilities, D>(
15518            self.ht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
15519            encoder, offset + cur_offset, depth
15520        )?;
15521
15522            _prev_end_offset = cur_offset + envelope_size;
15523            if 6 > max_ordinal {
15524                return Ok(());
15525            }
15526
15527            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15528            // are envelope_size bytes.
15529            let cur_offset: usize = (6 - 1) * envelope_size;
15530
15531            // Zero reserved fields.
15532            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15533
15534            // Safety:
15535            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15536            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15537            //   envelope_size bytes, there is always sufficient room.
15538            fidl::encoding::encode_in_envelope_optional::<bool, D>(
15539                self.vht_supported.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
15540                encoder,
15541                offset + cur_offset,
15542                depth,
15543            )?;
15544
15545            _prev_end_offset = cur_offset + envelope_size;
15546            if 7 > max_ordinal {
15547                return Ok(());
15548            }
15549
15550            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15551            // are envelope_size bytes.
15552            let cur_offset: usize = (7 - 1) * envelope_size;
15553
15554            // Zero reserved fields.
15555            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15556
15557            // Safety:
15558            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15559            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15560            //   envelope_size bytes, there is always sufficient room.
15561            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D>(
15562            self.vht_caps.as_ref().map(<fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::ValueTypeMarker>::borrow),
15563            encoder, offset + cur_offset, depth
15564        )?;
15565
15566            _prev_end_offset = cur_offset + envelope_size;
15567            if 8 > max_ordinal {
15568                return Ok(());
15569            }
15570
15571            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15572            // are envelope_size bytes.
15573            let cur_offset: usize = (8 - 1) * envelope_size;
15574
15575            // Zero reserved fields.
15576            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15577
15578            // Safety:
15579            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15580            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15581            //   envelope_size bytes, there is always sufficient room.
15582            fidl::encoding::encode_in_envelope_optional::<u16, D>(
15583                self.operating_channel_count
15584                    .as_ref()
15585                    .map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
15586                encoder,
15587                offset + cur_offset,
15588                depth,
15589            )?;
15590
15591            _prev_end_offset = cur_offset + envelope_size;
15592            if 9 > max_ordinal {
15593                return Ok(());
15594            }
15595
15596            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15597            // are envelope_size bytes.
15598            let cur_offset: usize = (9 - 1) * envelope_size;
15599
15600            // Zero reserved fields.
15601            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15602
15603            // Safety:
15604            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15605            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15606            //   envelope_size bytes, there is always sufficient room.
15607            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 256>, D>(
15608                self.operating_channel_list.as_ref().map(
15609                    <fidl::encoding::Array<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
15610                ),
15611                encoder,
15612                offset + cur_offset,
15613                depth,
15614            )?;
15615
15616            _prev_end_offset = cur_offset + envelope_size;
15617            if 10 > max_ordinal {
15618                return Ok(());
15619            }
15620
15621            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15622            // are envelope_size bytes.
15623            let cur_offset: usize = (10 - 1) * envelope_size;
15624
15625            // Zero reserved fields.
15626            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15627
15628            // Safety:
15629            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15630            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15631            //   envelope_size bytes, there is always sufficient room.
15632            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 12>, D>(
15633                self.basic_rates.as_ref().map(
15634                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::ValueTypeMarker>::borrow,
15635                ),
15636                encoder,
15637                offset + cur_offset,
15638                depth,
15639            )?;
15640
15641            _prev_end_offset = cur_offset + envelope_size;
15642            if 11 > max_ordinal {
15643                return Ok(());
15644            }
15645
15646            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
15647            // are envelope_size bytes.
15648            let cur_offset: usize = (11 - 1) * envelope_size;
15649
15650            // Zero reserved fields.
15651            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
15652
15653            // Safety:
15654            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
15655            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
15656            //   envelope_size bytes, there is always sufficient room.
15657            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
15658                self.operating_channels.as_ref().map(
15659                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
15660                ),
15661                encoder,
15662                offset + cur_offset,
15663                depth,
15664            )?;
15665
15666            _prev_end_offset = cur_offset + envelope_size;
15667
15668            Ok(())
15669        }
15670    }
15671
15672    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
15673        for WlanSoftmacBandCapability
15674    {
15675        #[inline(always)]
15676        fn new_empty() -> Self {
15677            Self::default()
15678        }
15679
15680        unsafe fn decode(
15681            &mut self,
15682            decoder: &mut fidl::encoding::Decoder<'_, D>,
15683            offset: usize,
15684            mut depth: fidl::encoding::Depth,
15685        ) -> fidl::Result<()> {
15686            decoder.debug_check_bounds::<Self>(offset);
15687            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
15688                None => return Err(fidl::Error::NotNullable),
15689                Some(len) => len,
15690            };
15691            // Calling decoder.out_of_line_offset(0) is not allowed.
15692            if len == 0 {
15693                return Ok(());
15694            };
15695            depth.increment()?;
15696            let envelope_size = 8;
15697            let bytes_len = len * envelope_size;
15698            let offset = decoder.out_of_line_offset(bytes_len)?;
15699            // Decode the envelope for each type.
15700            let mut _next_ordinal_to_read = 0;
15701            let mut next_offset = offset;
15702            let end_offset = offset + bytes_len;
15703            _next_ordinal_to_read += 1;
15704            if next_offset >= end_offset {
15705                return Ok(());
15706            }
15707
15708            // Decode unknown envelopes for gaps in ordinals.
15709            while _next_ordinal_to_read < 1 {
15710                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15711                _next_ordinal_to_read += 1;
15712                next_offset += envelope_size;
15713            }
15714
15715            let next_out_of_line = decoder.next_out_of_line();
15716            let handles_before = decoder.remaining_handles();
15717            if let Some((inlined, num_bytes, num_handles)) =
15718                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15719            {
15720                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::WlanBand as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15721                if inlined != (member_inline_size <= 4) {
15722                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15723                }
15724                let inner_offset;
15725                let mut inner_depth = depth.clone();
15726                if inlined {
15727                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15728                    inner_offset = next_offset;
15729                } else {
15730                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15731                    inner_depth.increment()?;
15732                }
15733                let val_ref = self.band.get_or_insert_with(|| {
15734                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::WlanBand, D)
15735                });
15736                fidl::decode!(
15737                    fidl_fuchsia_wlan_ieee80211::WlanBand,
15738                    D,
15739                    val_ref,
15740                    decoder,
15741                    inner_offset,
15742                    inner_depth
15743                )?;
15744                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15745                {
15746                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15747                }
15748                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15749                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15750                }
15751            }
15752
15753            next_offset += envelope_size;
15754            _next_ordinal_to_read += 1;
15755            if next_offset >= end_offset {
15756                return Ok(());
15757            }
15758
15759            // Decode unknown envelopes for gaps in ordinals.
15760            while _next_ordinal_to_read < 2 {
15761                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15762                _next_ordinal_to_read += 1;
15763                next_offset += envelope_size;
15764            }
15765
15766            let next_out_of_line = decoder.next_out_of_line();
15767            let handles_before = decoder.remaining_handles();
15768            if let Some((inlined, num_bytes, num_handles)) =
15769                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15770            {
15771                let member_inline_size =
15772                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15773                if inlined != (member_inline_size <= 4) {
15774                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15775                }
15776                let inner_offset;
15777                let mut inner_depth = depth.clone();
15778                if inlined {
15779                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15780                    inner_offset = next_offset;
15781                } else {
15782                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15783                    inner_depth.increment()?;
15784                }
15785                let val_ref = self.basic_rate_count.get_or_insert_with(|| fidl::new_empty!(u8, D));
15786                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
15787                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15788                {
15789                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15790                }
15791                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15792                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15793                }
15794            }
15795
15796            next_offset += envelope_size;
15797            _next_ordinal_to_read += 1;
15798            if next_offset >= end_offset {
15799                return Ok(());
15800            }
15801
15802            // Decode unknown envelopes for gaps in ordinals.
15803            while _next_ordinal_to_read < 3 {
15804                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15805                _next_ordinal_to_read += 1;
15806                next_offset += envelope_size;
15807            }
15808
15809            let next_out_of_line = decoder.next_out_of_line();
15810            let handles_before = decoder.remaining_handles();
15811            if let Some((inlined, num_bytes, num_handles)) =
15812                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15813            {
15814                let member_inline_size =
15815                    <fidl::encoding::Array<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
15816                        decoder.context,
15817                    );
15818                if inlined != (member_inline_size <= 4) {
15819                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15820                }
15821                let inner_offset;
15822                let mut inner_depth = depth.clone();
15823                if inlined {
15824                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15825                    inner_offset = next_offset;
15826                } else {
15827                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15828                    inner_depth.increment()?;
15829                }
15830                let val_ref = self
15831                    .basic_rate_list
15832                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 12>, D));
15833                fidl::decode!(fidl::encoding::Array<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
15834                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15835                {
15836                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15837                }
15838                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15839                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15840                }
15841            }
15842
15843            next_offset += envelope_size;
15844            _next_ordinal_to_read += 1;
15845            if next_offset >= end_offset {
15846                return Ok(());
15847            }
15848
15849            // Decode unknown envelopes for gaps in ordinals.
15850            while _next_ordinal_to_read < 4 {
15851                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15852                _next_ordinal_to_read += 1;
15853                next_offset += envelope_size;
15854            }
15855
15856            let next_out_of_line = decoder.next_out_of_line();
15857            let handles_before = decoder.remaining_handles();
15858            if let Some((inlined, num_bytes, num_handles)) =
15859                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15860            {
15861                let member_inline_size =
15862                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15863                if inlined != (member_inline_size <= 4) {
15864                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15865                }
15866                let inner_offset;
15867                let mut inner_depth = depth.clone();
15868                if inlined {
15869                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15870                    inner_offset = next_offset;
15871                } else {
15872                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15873                    inner_depth.increment()?;
15874                }
15875                let val_ref = self.ht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
15876                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
15877                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15878                {
15879                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15880                }
15881                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15882                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15883                }
15884            }
15885
15886            next_offset += envelope_size;
15887            _next_ordinal_to_read += 1;
15888            if next_offset >= end_offset {
15889                return Ok(());
15890            }
15891
15892            // Decode unknown envelopes for gaps in ordinals.
15893            while _next_ordinal_to_read < 5 {
15894                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15895                _next_ordinal_to_read += 1;
15896                next_offset += envelope_size;
15897            }
15898
15899            let next_out_of_line = decoder.next_out_of_line();
15900            let handles_before = decoder.remaining_handles();
15901            if let Some((inlined, num_bytes, num_handles)) =
15902                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15903            {
15904                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::HtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15905                if inlined != (member_inline_size <= 4) {
15906                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15907                }
15908                let inner_offset;
15909                let mut inner_depth = depth.clone();
15910                if inlined {
15911                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15912                    inner_offset = next_offset;
15913                } else {
15914                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15915                    inner_depth.increment()?;
15916                }
15917                let val_ref = self.ht_caps.get_or_insert_with(|| {
15918                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::HtCapabilities, D)
15919                });
15920                fidl::decode!(
15921                    fidl_fuchsia_wlan_ieee80211::HtCapabilities,
15922                    D,
15923                    val_ref,
15924                    decoder,
15925                    inner_offset,
15926                    inner_depth
15927                )?;
15928                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15929                {
15930                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15931                }
15932                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15933                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15934                }
15935            }
15936
15937            next_offset += envelope_size;
15938            _next_ordinal_to_read += 1;
15939            if next_offset >= end_offset {
15940                return Ok(());
15941            }
15942
15943            // Decode unknown envelopes for gaps in ordinals.
15944            while _next_ordinal_to_read < 6 {
15945                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15946                _next_ordinal_to_read += 1;
15947                next_offset += envelope_size;
15948            }
15949
15950            let next_out_of_line = decoder.next_out_of_line();
15951            let handles_before = decoder.remaining_handles();
15952            if let Some((inlined, num_bytes, num_handles)) =
15953                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15954            {
15955                let member_inline_size =
15956                    <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15957                if inlined != (member_inline_size <= 4) {
15958                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
15959                }
15960                let inner_offset;
15961                let mut inner_depth = depth.clone();
15962                if inlined {
15963                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
15964                    inner_offset = next_offset;
15965                } else {
15966                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
15967                    inner_depth.increment()?;
15968                }
15969                let val_ref = self.vht_supported.get_or_insert_with(|| fidl::new_empty!(bool, D));
15970                fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
15971                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
15972                {
15973                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
15974                }
15975                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
15976                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
15977                }
15978            }
15979
15980            next_offset += envelope_size;
15981            _next_ordinal_to_read += 1;
15982            if next_offset >= end_offset {
15983                return Ok(());
15984            }
15985
15986            // Decode unknown envelopes for gaps in ordinals.
15987            while _next_ordinal_to_read < 7 {
15988                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
15989                _next_ordinal_to_read += 1;
15990                next_offset += envelope_size;
15991            }
15992
15993            let next_out_of_line = decoder.next_out_of_line();
15994            let handles_before = decoder.remaining_handles();
15995            if let Some((inlined, num_bytes, num_handles)) =
15996                fidl::encoding::decode_envelope_header(decoder, next_offset)?
15997            {
15998                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::VhtCapabilities as fidl::encoding::TypeMarker>::inline_size(decoder.context);
15999                if inlined != (member_inline_size <= 4) {
16000                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16001                }
16002                let inner_offset;
16003                let mut inner_depth = depth.clone();
16004                if inlined {
16005                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16006                    inner_offset = next_offset;
16007                } else {
16008                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16009                    inner_depth.increment()?;
16010                }
16011                let val_ref = self.vht_caps.get_or_insert_with(|| {
16012                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::VhtCapabilities, D)
16013                });
16014                fidl::decode!(
16015                    fidl_fuchsia_wlan_ieee80211::VhtCapabilities,
16016                    D,
16017                    val_ref,
16018                    decoder,
16019                    inner_offset,
16020                    inner_depth
16021                )?;
16022                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16023                {
16024                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16025                }
16026                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16027                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16028                }
16029            }
16030
16031            next_offset += envelope_size;
16032            _next_ordinal_to_read += 1;
16033            if next_offset >= end_offset {
16034                return Ok(());
16035            }
16036
16037            // Decode unknown envelopes for gaps in ordinals.
16038            while _next_ordinal_to_read < 8 {
16039                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16040                _next_ordinal_to_read += 1;
16041                next_offset += envelope_size;
16042            }
16043
16044            let next_out_of_line = decoder.next_out_of_line();
16045            let handles_before = decoder.remaining_handles();
16046            if let Some((inlined, num_bytes, num_handles)) =
16047                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16048            {
16049                let member_inline_size =
16050                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16051                if inlined != (member_inline_size <= 4) {
16052                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16053                }
16054                let inner_offset;
16055                let mut inner_depth = depth.clone();
16056                if inlined {
16057                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16058                    inner_offset = next_offset;
16059                } else {
16060                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16061                    inner_depth.increment()?;
16062                }
16063                let val_ref =
16064                    self.operating_channel_count.get_or_insert_with(|| fidl::new_empty!(u16, D));
16065                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
16066                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16067                {
16068                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16069                }
16070                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16071                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16072                }
16073            }
16074
16075            next_offset += envelope_size;
16076            _next_ordinal_to_read += 1;
16077            if next_offset >= end_offset {
16078                return Ok(());
16079            }
16080
16081            // Decode unknown envelopes for gaps in ordinals.
16082            while _next_ordinal_to_read < 9 {
16083                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16084                _next_ordinal_to_read += 1;
16085                next_offset += envelope_size;
16086            }
16087
16088            let next_out_of_line = decoder.next_out_of_line();
16089            let handles_before = decoder.remaining_handles();
16090            if let Some((inlined, num_bytes, num_handles)) =
16091                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16092            {
16093                let member_inline_size =
16094                    <fidl::encoding::Array<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
16095                        decoder.context,
16096                    );
16097                if inlined != (member_inline_size <= 4) {
16098                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16099                }
16100                let inner_offset;
16101                let mut inner_depth = depth.clone();
16102                if inlined {
16103                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16104                    inner_offset = next_offset;
16105                } else {
16106                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16107                    inner_depth.increment()?;
16108                }
16109                let val_ref = self
16110                    .operating_channel_list
16111                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 256>, D));
16112                fidl::decode!(fidl::encoding::Array<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
16113                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16114                {
16115                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16116                }
16117                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16118                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16119                }
16120            }
16121
16122            next_offset += envelope_size;
16123            _next_ordinal_to_read += 1;
16124            if next_offset >= end_offset {
16125                return Ok(());
16126            }
16127
16128            // Decode unknown envelopes for gaps in ordinals.
16129            while _next_ordinal_to_read < 10 {
16130                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16131                _next_ordinal_to_read += 1;
16132                next_offset += envelope_size;
16133            }
16134
16135            let next_out_of_line = decoder.next_out_of_line();
16136            let handles_before = decoder.remaining_handles();
16137            if let Some((inlined, num_bytes, num_handles)) =
16138                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16139            {
16140                let member_inline_size =
16141                    <fidl::encoding::Vector<u8, 12> as fidl::encoding::TypeMarker>::inline_size(
16142                        decoder.context,
16143                    );
16144                if inlined != (member_inline_size <= 4) {
16145                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16146                }
16147                let inner_offset;
16148                let mut inner_depth = depth.clone();
16149                if inlined {
16150                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16151                    inner_offset = next_offset;
16152                } else {
16153                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16154                    inner_depth.increment()?;
16155                }
16156                let val_ref = self
16157                    .basic_rates
16158                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 12>, D));
16159                fidl::decode!(fidl::encoding::Vector<u8, 12>, D, val_ref, decoder, inner_offset, inner_depth)?;
16160                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16161                {
16162                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16163                }
16164                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16165                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16166                }
16167            }
16168
16169            next_offset += envelope_size;
16170            _next_ordinal_to_read += 1;
16171            if next_offset >= end_offset {
16172                return Ok(());
16173            }
16174
16175            // Decode unknown envelopes for gaps in ordinals.
16176            while _next_ordinal_to_read < 11 {
16177                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16178                _next_ordinal_to_read += 1;
16179                next_offset += envelope_size;
16180            }
16181
16182            let next_out_of_line = decoder.next_out_of_line();
16183            let handles_before = decoder.remaining_handles();
16184            if let Some((inlined, num_bytes, num_handles)) =
16185                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16186            {
16187                let member_inline_size =
16188                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
16189                        decoder.context,
16190                    );
16191                if inlined != (member_inline_size <= 4) {
16192                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16193                }
16194                let inner_offset;
16195                let mut inner_depth = depth.clone();
16196                if inlined {
16197                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16198                    inner_offset = next_offset;
16199                } else {
16200                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16201                    inner_depth.increment()?;
16202                }
16203                let val_ref = self
16204                    .operating_channels
16205                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
16206                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
16207                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16208                {
16209                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16210                }
16211                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16212                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16213                }
16214            }
16215
16216            next_offset += envelope_size;
16217
16218            // Decode the remaining unknown envelopes.
16219            while next_offset < end_offset {
16220                _next_ordinal_to_read += 1;
16221                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16222                next_offset += envelope_size;
16223            }
16224
16225            Ok(())
16226        }
16227    }
16228
16229    impl WlanSoftmacBaseCancelScanRequest {
16230        #[inline(always)]
16231        fn max_ordinal_present(&self) -> u64 {
16232            if let Some(_) = self.scan_id {
16233                return 1;
16234            }
16235            0
16236        }
16237    }
16238
16239    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseCancelScanRequest {
16240        type Borrowed<'a> = &'a Self;
16241        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16242            value
16243        }
16244    }
16245
16246    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseCancelScanRequest {
16247        type Owned = Self;
16248
16249        #[inline(always)]
16250        fn inline_align(_context: fidl::encoding::Context) -> usize {
16251            8
16252        }
16253
16254        #[inline(always)]
16255        fn inline_size(_context: fidl::encoding::Context) -> usize {
16256            16
16257        }
16258    }
16259
16260    unsafe impl<D: fidl::encoding::ResourceDialect>
16261        fidl::encoding::Encode<WlanSoftmacBaseCancelScanRequest, D>
16262        for &WlanSoftmacBaseCancelScanRequest
16263    {
16264        unsafe fn encode(
16265            self,
16266            encoder: &mut fidl::encoding::Encoder<'_, D>,
16267            offset: usize,
16268            mut depth: fidl::encoding::Depth,
16269        ) -> fidl::Result<()> {
16270            encoder.debug_check_bounds::<WlanSoftmacBaseCancelScanRequest>(offset);
16271            // Vector header
16272            let max_ordinal: u64 = self.max_ordinal_present();
16273            encoder.write_num(max_ordinal, offset);
16274            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16275            // Calling encoder.out_of_line_offset(0) is not allowed.
16276            if max_ordinal == 0 {
16277                return Ok(());
16278            }
16279            depth.increment()?;
16280            let envelope_size = 8;
16281            let bytes_len = max_ordinal as usize * envelope_size;
16282            #[allow(unused_variables)]
16283            let offset = encoder.out_of_line_offset(bytes_len);
16284            let mut _prev_end_offset: usize = 0;
16285            if 1 > max_ordinal {
16286                return Ok(());
16287            }
16288
16289            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16290            // are envelope_size bytes.
16291            let cur_offset: usize = (1 - 1) * envelope_size;
16292
16293            // Zero reserved fields.
16294            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16295
16296            // Safety:
16297            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16298            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16299            //   envelope_size bytes, there is always sufficient room.
16300            fidl::encoding::encode_in_envelope_optional::<u64, D>(
16301                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16302                encoder,
16303                offset + cur_offset,
16304                depth,
16305            )?;
16306
16307            _prev_end_offset = cur_offset + envelope_size;
16308
16309            Ok(())
16310        }
16311    }
16312
16313    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
16314        for WlanSoftmacBaseCancelScanRequest
16315    {
16316        #[inline(always)]
16317        fn new_empty() -> Self {
16318            Self::default()
16319        }
16320
16321        unsafe fn decode(
16322            &mut self,
16323            decoder: &mut fidl::encoding::Decoder<'_, D>,
16324            offset: usize,
16325            mut depth: fidl::encoding::Depth,
16326        ) -> fidl::Result<()> {
16327            decoder.debug_check_bounds::<Self>(offset);
16328            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16329                None => return Err(fidl::Error::NotNullable),
16330                Some(len) => len,
16331            };
16332            // Calling decoder.out_of_line_offset(0) is not allowed.
16333            if len == 0 {
16334                return Ok(());
16335            };
16336            depth.increment()?;
16337            let envelope_size = 8;
16338            let bytes_len = len * envelope_size;
16339            let offset = decoder.out_of_line_offset(bytes_len)?;
16340            // Decode the envelope for each type.
16341            let mut _next_ordinal_to_read = 0;
16342            let mut next_offset = offset;
16343            let end_offset = offset + bytes_len;
16344            _next_ordinal_to_read += 1;
16345            if next_offset >= end_offset {
16346                return Ok(());
16347            }
16348
16349            // Decode unknown envelopes for gaps in ordinals.
16350            while _next_ordinal_to_read < 1 {
16351                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16352                _next_ordinal_to_read += 1;
16353                next_offset += envelope_size;
16354            }
16355
16356            let next_out_of_line = decoder.next_out_of_line();
16357            let handles_before = decoder.remaining_handles();
16358            if let Some((inlined, num_bytes, num_handles)) =
16359                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16360            {
16361                let member_inline_size =
16362                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16363                if inlined != (member_inline_size <= 4) {
16364                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16365                }
16366                let inner_offset;
16367                let mut inner_depth = depth.clone();
16368                if inlined {
16369                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16370                    inner_offset = next_offset;
16371                } else {
16372                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16373                    inner_depth.increment()?;
16374                }
16375                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
16376                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
16377                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16378                {
16379                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16380                }
16381                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16382                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16383                }
16384            }
16385
16386            next_offset += envelope_size;
16387
16388            // Decode the remaining unknown envelopes.
16389            while next_offset < end_offset {
16390                _next_ordinal_to_read += 1;
16391                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16392                next_offset += envelope_size;
16393            }
16394
16395            Ok(())
16396        }
16397    }
16398
16399    impl WlanSoftmacBaseClearAssociationRequest {
16400        #[inline(always)]
16401        fn max_ordinal_present(&self) -> u64 {
16402            if let Some(_) = self.peer_addr {
16403                return 1;
16404            }
16405            0
16406        }
16407    }
16408
16409    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseClearAssociationRequest {
16410        type Borrowed<'a> = &'a Self;
16411        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16412            value
16413        }
16414    }
16415
16416    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseClearAssociationRequest {
16417        type Owned = Self;
16418
16419        #[inline(always)]
16420        fn inline_align(_context: fidl::encoding::Context) -> usize {
16421            8
16422        }
16423
16424        #[inline(always)]
16425        fn inline_size(_context: fidl::encoding::Context) -> usize {
16426            16
16427        }
16428    }
16429
16430    unsafe impl<D: fidl::encoding::ResourceDialect>
16431        fidl::encoding::Encode<WlanSoftmacBaseClearAssociationRequest, D>
16432        for &WlanSoftmacBaseClearAssociationRequest
16433    {
16434        unsafe fn encode(
16435            self,
16436            encoder: &mut fidl::encoding::Encoder<'_, D>,
16437            offset: usize,
16438            mut depth: fidl::encoding::Depth,
16439        ) -> fidl::Result<()> {
16440            encoder.debug_check_bounds::<WlanSoftmacBaseClearAssociationRequest>(offset);
16441            // Vector header
16442            let max_ordinal: u64 = self.max_ordinal_present();
16443            encoder.write_num(max_ordinal, offset);
16444            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16445            // Calling encoder.out_of_line_offset(0) is not allowed.
16446            if max_ordinal == 0 {
16447                return Ok(());
16448            }
16449            depth.increment()?;
16450            let envelope_size = 8;
16451            let bytes_len = max_ordinal as usize * envelope_size;
16452            #[allow(unused_variables)]
16453            let offset = encoder.out_of_line_offset(bytes_len);
16454            let mut _prev_end_offset: usize = 0;
16455            if 1 > max_ordinal {
16456                return Ok(());
16457            }
16458
16459            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16460            // are envelope_size bytes.
16461            let cur_offset: usize = (1 - 1) * envelope_size;
16462
16463            // Zero reserved fields.
16464            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16465
16466            // Safety:
16467            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16468            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16469            //   envelope_size bytes, there is always sufficient room.
16470            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
16471                self.peer_addr
16472                    .as_ref()
16473                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
16474                encoder,
16475                offset + cur_offset,
16476                depth,
16477            )?;
16478
16479            _prev_end_offset = cur_offset + envelope_size;
16480
16481            Ok(())
16482        }
16483    }
16484
16485    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
16486        for WlanSoftmacBaseClearAssociationRequest
16487    {
16488        #[inline(always)]
16489        fn new_empty() -> Self {
16490            Self::default()
16491        }
16492
16493        unsafe fn decode(
16494            &mut self,
16495            decoder: &mut fidl::encoding::Decoder<'_, D>,
16496            offset: usize,
16497            mut depth: fidl::encoding::Depth,
16498        ) -> fidl::Result<()> {
16499            decoder.debug_check_bounds::<Self>(offset);
16500            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16501                None => return Err(fidl::Error::NotNullable),
16502                Some(len) => len,
16503            };
16504            // Calling decoder.out_of_line_offset(0) is not allowed.
16505            if len == 0 {
16506                return Ok(());
16507            };
16508            depth.increment()?;
16509            let envelope_size = 8;
16510            let bytes_len = len * envelope_size;
16511            let offset = decoder.out_of_line_offset(bytes_len)?;
16512            // Decode the envelope for each type.
16513            let mut _next_ordinal_to_read = 0;
16514            let mut next_offset = offset;
16515            let end_offset = offset + bytes_len;
16516            _next_ordinal_to_read += 1;
16517            if next_offset >= end_offset {
16518                return Ok(());
16519            }
16520
16521            // Decode unknown envelopes for gaps in ordinals.
16522            while _next_ordinal_to_read < 1 {
16523                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16524                _next_ordinal_to_read += 1;
16525                next_offset += envelope_size;
16526            }
16527
16528            let next_out_of_line = decoder.next_out_of_line();
16529            let handles_before = decoder.remaining_handles();
16530            if let Some((inlined, num_bytes, num_handles)) =
16531                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16532            {
16533                let member_inline_size =
16534                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
16535                        decoder.context,
16536                    );
16537                if inlined != (member_inline_size <= 4) {
16538                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16539                }
16540                let inner_offset;
16541                let mut inner_depth = depth.clone();
16542                if inlined {
16543                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16544                    inner_offset = next_offset;
16545                } else {
16546                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16547                    inner_depth.increment()?;
16548                }
16549                let val_ref = self
16550                    .peer_addr
16551                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
16552                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
16553                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16554                {
16555                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16556                }
16557                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16558                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16559                }
16560            }
16561
16562            next_offset += envelope_size;
16563
16564            // Decode the remaining unknown envelopes.
16565            while next_offset < end_offset {
16566                _next_ordinal_to_read += 1;
16567                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16568                next_offset += envelope_size;
16569            }
16570
16571            Ok(())
16572        }
16573    }
16574
16575    impl WlanSoftmacBaseEnableBeaconingRequest {
16576        #[inline(always)]
16577        fn max_ordinal_present(&self) -> u64 {
16578            if let Some(_) = self.beacon_interval {
16579                return 3;
16580            }
16581            if let Some(_) = self.tim_ele_offset {
16582                return 2;
16583            }
16584            if let Some(_) = self.packet_template {
16585                return 1;
16586            }
16587            0
16588        }
16589    }
16590
16591    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
16592        type Borrowed<'a> = &'a Self;
16593        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16594            value
16595        }
16596    }
16597
16598    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseEnableBeaconingRequest {
16599        type Owned = Self;
16600
16601        #[inline(always)]
16602        fn inline_align(_context: fidl::encoding::Context) -> usize {
16603            8
16604        }
16605
16606        #[inline(always)]
16607        fn inline_size(_context: fidl::encoding::Context) -> usize {
16608            16
16609        }
16610    }
16611
16612    unsafe impl<D: fidl::encoding::ResourceDialect>
16613        fidl::encoding::Encode<WlanSoftmacBaseEnableBeaconingRequest, D>
16614        for &WlanSoftmacBaseEnableBeaconingRequest
16615    {
16616        unsafe fn encode(
16617            self,
16618            encoder: &mut fidl::encoding::Encoder<'_, D>,
16619            offset: usize,
16620            mut depth: fidl::encoding::Depth,
16621        ) -> fidl::Result<()> {
16622            encoder.debug_check_bounds::<WlanSoftmacBaseEnableBeaconingRequest>(offset);
16623            // Vector header
16624            let max_ordinal: u64 = self.max_ordinal_present();
16625            encoder.write_num(max_ordinal, offset);
16626            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16627            // Calling encoder.out_of_line_offset(0) is not allowed.
16628            if max_ordinal == 0 {
16629                return Ok(());
16630            }
16631            depth.increment()?;
16632            let envelope_size = 8;
16633            let bytes_len = max_ordinal as usize * envelope_size;
16634            #[allow(unused_variables)]
16635            let offset = encoder.out_of_line_offset(bytes_len);
16636            let mut _prev_end_offset: usize = 0;
16637            if 1 > max_ordinal {
16638                return Ok(());
16639            }
16640
16641            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16642            // are envelope_size bytes.
16643            let cur_offset: usize = (1 - 1) * envelope_size;
16644
16645            // Zero reserved fields.
16646            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16647
16648            // Safety:
16649            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16650            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16651            //   envelope_size bytes, there is always sufficient room.
16652            fidl::encoding::encode_in_envelope_optional::<WlanTxPacket, D>(
16653                self.packet_template
16654                    .as_ref()
16655                    .map(<WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow),
16656                encoder,
16657                offset + cur_offset,
16658                depth,
16659            )?;
16660
16661            _prev_end_offset = cur_offset + envelope_size;
16662            if 2 > max_ordinal {
16663                return Ok(());
16664            }
16665
16666            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16667            // are envelope_size bytes.
16668            let cur_offset: usize = (2 - 1) * envelope_size;
16669
16670            // Zero reserved fields.
16671            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16672
16673            // Safety:
16674            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16675            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16676            //   envelope_size bytes, there is always sufficient room.
16677            fidl::encoding::encode_in_envelope_optional::<u64, D>(
16678                self.tim_ele_offset.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
16679                encoder,
16680                offset + cur_offset,
16681                depth,
16682            )?;
16683
16684            _prev_end_offset = cur_offset + envelope_size;
16685            if 3 > max_ordinal {
16686                return Ok(());
16687            }
16688
16689            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16690            // are envelope_size bytes.
16691            let cur_offset: usize = (3 - 1) * envelope_size;
16692
16693            // Zero reserved fields.
16694            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16695
16696            // Safety:
16697            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16698            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16699            //   envelope_size bytes, there is always sufficient room.
16700            fidl::encoding::encode_in_envelope_optional::<u16, D>(
16701                self.beacon_interval.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
16702                encoder,
16703                offset + cur_offset,
16704                depth,
16705            )?;
16706
16707            _prev_end_offset = cur_offset + envelope_size;
16708
16709            Ok(())
16710        }
16711    }
16712
16713    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
16714        for WlanSoftmacBaseEnableBeaconingRequest
16715    {
16716        #[inline(always)]
16717        fn new_empty() -> Self {
16718            Self::default()
16719        }
16720
16721        unsafe fn decode(
16722            &mut self,
16723            decoder: &mut fidl::encoding::Decoder<'_, D>,
16724            offset: usize,
16725            mut depth: fidl::encoding::Depth,
16726        ) -> fidl::Result<()> {
16727            decoder.debug_check_bounds::<Self>(offset);
16728            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16729                None => return Err(fidl::Error::NotNullable),
16730                Some(len) => len,
16731            };
16732            // Calling decoder.out_of_line_offset(0) is not allowed.
16733            if len == 0 {
16734                return Ok(());
16735            };
16736            depth.increment()?;
16737            let envelope_size = 8;
16738            let bytes_len = len * envelope_size;
16739            let offset = decoder.out_of_line_offset(bytes_len)?;
16740            // Decode the envelope for each type.
16741            let mut _next_ordinal_to_read = 0;
16742            let mut next_offset = offset;
16743            let end_offset = offset + bytes_len;
16744            _next_ordinal_to_read += 1;
16745            if next_offset >= end_offset {
16746                return Ok(());
16747            }
16748
16749            // Decode unknown envelopes for gaps in ordinals.
16750            while _next_ordinal_to_read < 1 {
16751                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16752                _next_ordinal_to_read += 1;
16753                next_offset += envelope_size;
16754            }
16755
16756            let next_out_of_line = decoder.next_out_of_line();
16757            let handles_before = decoder.remaining_handles();
16758            if let Some((inlined, num_bytes, num_handles)) =
16759                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16760            {
16761                let member_inline_size =
16762                    <WlanTxPacket as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16763                if inlined != (member_inline_size <= 4) {
16764                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16765                }
16766                let inner_offset;
16767                let mut inner_depth = depth.clone();
16768                if inlined {
16769                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16770                    inner_offset = next_offset;
16771                } else {
16772                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16773                    inner_depth.increment()?;
16774                }
16775                let val_ref =
16776                    self.packet_template.get_or_insert_with(|| fidl::new_empty!(WlanTxPacket, D));
16777                fidl::decode!(WlanTxPacket, D, val_ref, decoder, inner_offset, inner_depth)?;
16778                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16779                {
16780                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16781                }
16782                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16783                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16784                }
16785            }
16786
16787            next_offset += envelope_size;
16788            _next_ordinal_to_read += 1;
16789            if next_offset >= end_offset {
16790                return Ok(());
16791            }
16792
16793            // Decode unknown envelopes for gaps in ordinals.
16794            while _next_ordinal_to_read < 2 {
16795                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16796                _next_ordinal_to_read += 1;
16797                next_offset += envelope_size;
16798            }
16799
16800            let next_out_of_line = decoder.next_out_of_line();
16801            let handles_before = decoder.remaining_handles();
16802            if let Some((inlined, num_bytes, num_handles)) =
16803                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16804            {
16805                let member_inline_size =
16806                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16807                if inlined != (member_inline_size <= 4) {
16808                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16809                }
16810                let inner_offset;
16811                let mut inner_depth = depth.clone();
16812                if inlined {
16813                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16814                    inner_offset = next_offset;
16815                } else {
16816                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16817                    inner_depth.increment()?;
16818                }
16819                let val_ref = self.tim_ele_offset.get_or_insert_with(|| fidl::new_empty!(u64, D));
16820                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
16821                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16822                {
16823                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16824                }
16825                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16826                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16827                }
16828            }
16829
16830            next_offset += envelope_size;
16831            _next_ordinal_to_read += 1;
16832            if next_offset >= end_offset {
16833                return Ok(());
16834            }
16835
16836            // Decode unknown envelopes for gaps in ordinals.
16837            while _next_ordinal_to_read < 3 {
16838                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16839                _next_ordinal_to_read += 1;
16840                next_offset += envelope_size;
16841            }
16842
16843            let next_out_of_line = decoder.next_out_of_line();
16844            let handles_before = decoder.remaining_handles();
16845            if let Some((inlined, num_bytes, num_handles)) =
16846                fidl::encoding::decode_envelope_header(decoder, next_offset)?
16847            {
16848                let member_inline_size =
16849                    <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
16850                if inlined != (member_inline_size <= 4) {
16851                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
16852                }
16853                let inner_offset;
16854                let mut inner_depth = depth.clone();
16855                if inlined {
16856                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
16857                    inner_offset = next_offset;
16858                } else {
16859                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
16860                    inner_depth.increment()?;
16861                }
16862                let val_ref = self.beacon_interval.get_or_insert_with(|| fidl::new_empty!(u16, D));
16863                fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
16864                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
16865                {
16866                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
16867                }
16868                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
16869                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
16870                }
16871            }
16872
16873            next_offset += envelope_size;
16874
16875            // Decode the remaining unknown envelopes.
16876            while next_offset < end_offset {
16877                _next_ordinal_to_read += 1;
16878                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
16879                next_offset += envelope_size;
16880            }
16881
16882            Ok(())
16883        }
16884    }
16885
16886    impl WlanSoftmacBaseSetChannelRequest {
16887        #[inline(always)]
16888        fn max_ordinal_present(&self) -> u64 {
16889            if let Some(_) = self.channel {
16890                return 1;
16891            }
16892            0
16893        }
16894    }
16895
16896    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseSetChannelRequest {
16897        type Borrowed<'a> = &'a Self;
16898        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
16899            value
16900        }
16901    }
16902
16903    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseSetChannelRequest {
16904        type Owned = Self;
16905
16906        #[inline(always)]
16907        fn inline_align(_context: fidl::encoding::Context) -> usize {
16908            8
16909        }
16910
16911        #[inline(always)]
16912        fn inline_size(_context: fidl::encoding::Context) -> usize {
16913            16
16914        }
16915    }
16916
16917    unsafe impl<D: fidl::encoding::ResourceDialect>
16918        fidl::encoding::Encode<WlanSoftmacBaseSetChannelRequest, D>
16919        for &WlanSoftmacBaseSetChannelRequest
16920    {
16921        unsafe fn encode(
16922            self,
16923            encoder: &mut fidl::encoding::Encoder<'_, D>,
16924            offset: usize,
16925            mut depth: fidl::encoding::Depth,
16926        ) -> fidl::Result<()> {
16927            encoder.debug_check_bounds::<WlanSoftmacBaseSetChannelRequest>(offset);
16928            // Vector header
16929            let max_ordinal: u64 = self.max_ordinal_present();
16930            encoder.write_num(max_ordinal, offset);
16931            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
16932            // Calling encoder.out_of_line_offset(0) is not allowed.
16933            if max_ordinal == 0 {
16934                return Ok(());
16935            }
16936            depth.increment()?;
16937            let envelope_size = 8;
16938            let bytes_len = max_ordinal as usize * envelope_size;
16939            #[allow(unused_variables)]
16940            let offset = encoder.out_of_line_offset(bytes_len);
16941            let mut _prev_end_offset: usize = 0;
16942            if 1 > max_ordinal {
16943                return Ok(());
16944            }
16945
16946            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
16947            // are envelope_size bytes.
16948            let cur_offset: usize = (1 - 1) * envelope_size;
16949
16950            // Zero reserved fields.
16951            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
16952
16953            // Safety:
16954            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
16955            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
16956            //   envelope_size bytes, there is always sufficient room.
16957            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanChannel, D>(
16958            self.channel.as_ref().map(<fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow),
16959            encoder, offset + cur_offset, depth
16960        )?;
16961
16962            _prev_end_offset = cur_offset + envelope_size;
16963
16964            Ok(())
16965        }
16966    }
16967
16968    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
16969        for WlanSoftmacBaseSetChannelRequest
16970    {
16971        #[inline(always)]
16972        fn new_empty() -> Self {
16973            Self::default()
16974        }
16975
16976        unsafe fn decode(
16977            &mut self,
16978            decoder: &mut fidl::encoding::Decoder<'_, D>,
16979            offset: usize,
16980            mut depth: fidl::encoding::Depth,
16981        ) -> fidl::Result<()> {
16982            decoder.debug_check_bounds::<Self>(offset);
16983            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
16984                None => return Err(fidl::Error::NotNullable),
16985                Some(len) => len,
16986            };
16987            // Calling decoder.out_of_line_offset(0) is not allowed.
16988            if len == 0 {
16989                return Ok(());
16990            };
16991            depth.increment()?;
16992            let envelope_size = 8;
16993            let bytes_len = len * envelope_size;
16994            let offset = decoder.out_of_line_offset(bytes_len)?;
16995            // Decode the envelope for each type.
16996            let mut _next_ordinal_to_read = 0;
16997            let mut next_offset = offset;
16998            let end_offset = offset + bytes_len;
16999            _next_ordinal_to_read += 1;
17000            if next_offset >= end_offset {
17001                return Ok(());
17002            }
17003
17004            // Decode unknown envelopes for gaps in ordinals.
17005            while _next_ordinal_to_read < 1 {
17006                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17007                _next_ordinal_to_read += 1;
17008                next_offset += envelope_size;
17009            }
17010
17011            let next_out_of_line = decoder.next_out_of_line();
17012            let handles_before = decoder.remaining_handles();
17013            if let Some((inlined, num_bytes, num_handles)) =
17014                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17015            {
17016                let member_inline_size = <fidl_fuchsia_wlan_common::WlanChannel as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17017                if inlined != (member_inline_size <= 4) {
17018                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17019                }
17020                let inner_offset;
17021                let mut inner_depth = depth.clone();
17022                if inlined {
17023                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17024                    inner_offset = next_offset;
17025                } else {
17026                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17027                    inner_depth.increment()?;
17028                }
17029                let val_ref = self.channel.get_or_insert_with(|| {
17030                    fidl::new_empty!(fidl_fuchsia_wlan_common::WlanChannel, D)
17031                });
17032                fidl::decode!(
17033                    fidl_fuchsia_wlan_common::WlanChannel,
17034                    D,
17035                    val_ref,
17036                    decoder,
17037                    inner_offset,
17038                    inner_depth
17039                )?;
17040                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17041                {
17042                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17043                }
17044                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17045                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17046                }
17047            }
17048
17049            next_offset += envelope_size;
17050
17051            // Decode the remaining unknown envelopes.
17052            while next_offset < end_offset {
17053                _next_ordinal_to_read += 1;
17054                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17055                next_offset += envelope_size;
17056            }
17057
17058            Ok(())
17059        }
17060    }
17061
17062    impl WlanSoftmacBaseStartPassiveScanRequest {
17063        #[inline(always)]
17064        fn max_ordinal_present(&self) -> u64 {
17065            if let Some(_) = self.min_home_time {
17066                return 4;
17067            }
17068            if let Some(_) = self.max_channel_time {
17069                return 3;
17070            }
17071            if let Some(_) = self.min_channel_time {
17072                return 2;
17073            }
17074            if let Some(_) = self.channels {
17075                return 1;
17076            }
17077            0
17078        }
17079    }
17080
17081    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
17082        type Borrowed<'a> = &'a Self;
17083        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17084            value
17085        }
17086    }
17087
17088    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanRequest {
17089        type Owned = Self;
17090
17091        #[inline(always)]
17092        fn inline_align(_context: fidl::encoding::Context) -> usize {
17093            8
17094        }
17095
17096        #[inline(always)]
17097        fn inline_size(_context: fidl::encoding::Context) -> usize {
17098            16
17099        }
17100    }
17101
17102    unsafe impl<D: fidl::encoding::ResourceDialect>
17103        fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanRequest, D>
17104        for &WlanSoftmacBaseStartPassiveScanRequest
17105    {
17106        unsafe fn encode(
17107            self,
17108            encoder: &mut fidl::encoding::Encoder<'_, D>,
17109            offset: usize,
17110            mut depth: fidl::encoding::Depth,
17111        ) -> fidl::Result<()> {
17112            encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanRequest>(offset);
17113            // Vector header
17114            let max_ordinal: u64 = self.max_ordinal_present();
17115            encoder.write_num(max_ordinal, offset);
17116            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17117            // Calling encoder.out_of_line_offset(0) is not allowed.
17118            if max_ordinal == 0 {
17119                return Ok(());
17120            }
17121            depth.increment()?;
17122            let envelope_size = 8;
17123            let bytes_len = max_ordinal as usize * envelope_size;
17124            #[allow(unused_variables)]
17125            let offset = encoder.out_of_line_offset(bytes_len);
17126            let mut _prev_end_offset: usize = 0;
17127            if 1 > max_ordinal {
17128                return Ok(());
17129            }
17130
17131            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17132            // are envelope_size bytes.
17133            let cur_offset: usize = (1 - 1) * envelope_size;
17134
17135            // Zero reserved fields.
17136            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17137
17138            // Safety:
17139            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17140            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17141            //   envelope_size bytes, there is always sufficient room.
17142            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
17143                self.channels.as_ref().map(
17144                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
17145                ),
17146                encoder,
17147                offset + cur_offset,
17148                depth,
17149            )?;
17150
17151            _prev_end_offset = cur_offset + envelope_size;
17152            if 2 > max_ordinal {
17153                return Ok(());
17154            }
17155
17156            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17157            // are envelope_size bytes.
17158            let cur_offset: usize = (2 - 1) * envelope_size;
17159
17160            // Zero reserved fields.
17161            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17162
17163            // Safety:
17164            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17165            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17166            //   envelope_size bytes, there is always sufficient room.
17167            fidl::encoding::encode_in_envelope_optional::<i64, D>(
17168                self.min_channel_time
17169                    .as_ref()
17170                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
17171                encoder,
17172                offset + cur_offset,
17173                depth,
17174            )?;
17175
17176            _prev_end_offset = cur_offset + envelope_size;
17177            if 3 > max_ordinal {
17178                return Ok(());
17179            }
17180
17181            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17182            // are envelope_size bytes.
17183            let cur_offset: usize = (3 - 1) * envelope_size;
17184
17185            // Zero reserved fields.
17186            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17187
17188            // Safety:
17189            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17190            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17191            //   envelope_size bytes, there is always sufficient room.
17192            fidl::encoding::encode_in_envelope_optional::<i64, D>(
17193                self.max_channel_time
17194                    .as_ref()
17195                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
17196                encoder,
17197                offset + cur_offset,
17198                depth,
17199            )?;
17200
17201            _prev_end_offset = cur_offset + envelope_size;
17202            if 4 > max_ordinal {
17203                return Ok(());
17204            }
17205
17206            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17207            // are envelope_size bytes.
17208            let cur_offset: usize = (4 - 1) * envelope_size;
17209
17210            // Zero reserved fields.
17211            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17212
17213            // Safety:
17214            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17215            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17216            //   envelope_size bytes, there is always sufficient room.
17217            fidl::encoding::encode_in_envelope_optional::<i64, D>(
17218                self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
17219                encoder,
17220                offset + cur_offset,
17221                depth,
17222            )?;
17223
17224            _prev_end_offset = cur_offset + envelope_size;
17225
17226            Ok(())
17227        }
17228    }
17229
17230    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17231        for WlanSoftmacBaseStartPassiveScanRequest
17232    {
17233        #[inline(always)]
17234        fn new_empty() -> Self {
17235            Self::default()
17236        }
17237
17238        unsafe fn decode(
17239            &mut self,
17240            decoder: &mut fidl::encoding::Decoder<'_, D>,
17241            offset: usize,
17242            mut depth: fidl::encoding::Depth,
17243        ) -> fidl::Result<()> {
17244            decoder.debug_check_bounds::<Self>(offset);
17245            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17246                None => return Err(fidl::Error::NotNullable),
17247                Some(len) => len,
17248            };
17249            // Calling decoder.out_of_line_offset(0) is not allowed.
17250            if len == 0 {
17251                return Ok(());
17252            };
17253            depth.increment()?;
17254            let envelope_size = 8;
17255            let bytes_len = len * envelope_size;
17256            let offset = decoder.out_of_line_offset(bytes_len)?;
17257            // Decode the envelope for each type.
17258            let mut _next_ordinal_to_read = 0;
17259            let mut next_offset = offset;
17260            let end_offset = offset + bytes_len;
17261            _next_ordinal_to_read += 1;
17262            if next_offset >= end_offset {
17263                return Ok(());
17264            }
17265
17266            // Decode unknown envelopes for gaps in ordinals.
17267            while _next_ordinal_to_read < 1 {
17268                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17269                _next_ordinal_to_read += 1;
17270                next_offset += envelope_size;
17271            }
17272
17273            let next_out_of_line = decoder.next_out_of_line();
17274            let handles_before = decoder.remaining_handles();
17275            if let Some((inlined, num_bytes, num_handles)) =
17276                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17277            {
17278                let member_inline_size =
17279                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
17280                        decoder.context,
17281                    );
17282                if inlined != (member_inline_size <= 4) {
17283                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17284                }
17285                let inner_offset;
17286                let mut inner_depth = depth.clone();
17287                if inlined {
17288                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17289                    inner_offset = next_offset;
17290                } else {
17291                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17292                    inner_depth.increment()?;
17293                }
17294                let val_ref = self
17295                    .channels
17296                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
17297                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
17298                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17299                {
17300                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17301                }
17302                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17303                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17304                }
17305            }
17306
17307            next_offset += envelope_size;
17308            _next_ordinal_to_read += 1;
17309            if next_offset >= end_offset {
17310                return Ok(());
17311            }
17312
17313            // Decode unknown envelopes for gaps in ordinals.
17314            while _next_ordinal_to_read < 2 {
17315                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17316                _next_ordinal_to_read += 1;
17317                next_offset += envelope_size;
17318            }
17319
17320            let next_out_of_line = decoder.next_out_of_line();
17321            let handles_before = decoder.remaining_handles();
17322            if let Some((inlined, num_bytes, num_handles)) =
17323                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17324            {
17325                let member_inline_size =
17326                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17327                if inlined != (member_inline_size <= 4) {
17328                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17329                }
17330                let inner_offset;
17331                let mut inner_depth = depth.clone();
17332                if inlined {
17333                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17334                    inner_offset = next_offset;
17335                } else {
17336                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17337                    inner_depth.increment()?;
17338                }
17339                let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
17340                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
17341                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17342                {
17343                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17344                }
17345                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17346                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17347                }
17348            }
17349
17350            next_offset += envelope_size;
17351            _next_ordinal_to_read += 1;
17352            if next_offset >= end_offset {
17353                return Ok(());
17354            }
17355
17356            // Decode unknown envelopes for gaps in ordinals.
17357            while _next_ordinal_to_read < 3 {
17358                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17359                _next_ordinal_to_read += 1;
17360                next_offset += envelope_size;
17361            }
17362
17363            let next_out_of_line = decoder.next_out_of_line();
17364            let handles_before = decoder.remaining_handles();
17365            if let Some((inlined, num_bytes, num_handles)) =
17366                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17367            {
17368                let member_inline_size =
17369                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17370                if inlined != (member_inline_size <= 4) {
17371                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17372                }
17373                let inner_offset;
17374                let mut inner_depth = depth.clone();
17375                if inlined {
17376                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17377                    inner_offset = next_offset;
17378                } else {
17379                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17380                    inner_depth.increment()?;
17381                }
17382                let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
17383                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
17384                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17385                {
17386                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17387                }
17388                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17389                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17390                }
17391            }
17392
17393            next_offset += envelope_size;
17394            _next_ordinal_to_read += 1;
17395            if next_offset >= end_offset {
17396                return Ok(());
17397            }
17398
17399            // Decode unknown envelopes for gaps in ordinals.
17400            while _next_ordinal_to_read < 4 {
17401                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17402                _next_ordinal_to_read += 1;
17403                next_offset += envelope_size;
17404            }
17405
17406            let next_out_of_line = decoder.next_out_of_line();
17407            let handles_before = decoder.remaining_handles();
17408            if let Some((inlined, num_bytes, num_handles)) =
17409                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17410            {
17411                let member_inline_size =
17412                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17413                if inlined != (member_inline_size <= 4) {
17414                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17415                }
17416                let inner_offset;
17417                let mut inner_depth = depth.clone();
17418                if inlined {
17419                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17420                    inner_offset = next_offset;
17421                } else {
17422                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17423                    inner_depth.increment()?;
17424                }
17425                let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
17426                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
17427                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17428                {
17429                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17430                }
17431                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17432                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17433                }
17434            }
17435
17436            next_offset += envelope_size;
17437
17438            // Decode the remaining unknown envelopes.
17439            while next_offset < end_offset {
17440                _next_ordinal_to_read += 1;
17441                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17442                next_offset += envelope_size;
17443            }
17444
17445            Ok(())
17446        }
17447    }
17448
17449    impl WlanSoftmacBaseUpdateWmmParametersRequest {
17450        #[inline(always)]
17451        fn max_ordinal_present(&self) -> u64 {
17452            if let Some(_) = self.params {
17453                return 2;
17454            }
17455            if let Some(_) = self.ac {
17456                return 1;
17457            }
17458            0
17459        }
17460    }
17461
17462    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
17463        type Borrowed<'a> = &'a Self;
17464        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17465            value
17466        }
17467    }
17468
17469    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseUpdateWmmParametersRequest {
17470        type Owned = Self;
17471
17472        #[inline(always)]
17473        fn inline_align(_context: fidl::encoding::Context) -> usize {
17474            8
17475        }
17476
17477        #[inline(always)]
17478        fn inline_size(_context: fidl::encoding::Context) -> usize {
17479            16
17480        }
17481    }
17482
17483    unsafe impl<D: fidl::encoding::ResourceDialect>
17484        fidl::encoding::Encode<WlanSoftmacBaseUpdateWmmParametersRequest, D>
17485        for &WlanSoftmacBaseUpdateWmmParametersRequest
17486    {
17487        unsafe fn encode(
17488            self,
17489            encoder: &mut fidl::encoding::Encoder<'_, D>,
17490            offset: usize,
17491            mut depth: fidl::encoding::Depth,
17492        ) -> fidl::Result<()> {
17493            encoder.debug_check_bounds::<WlanSoftmacBaseUpdateWmmParametersRequest>(offset);
17494            // Vector header
17495            let max_ordinal: u64 = self.max_ordinal_present();
17496            encoder.write_num(max_ordinal, offset);
17497            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17498            // Calling encoder.out_of_line_offset(0) is not allowed.
17499            if max_ordinal == 0 {
17500                return Ok(());
17501            }
17502            depth.increment()?;
17503            let envelope_size = 8;
17504            let bytes_len = max_ordinal as usize * envelope_size;
17505            #[allow(unused_variables)]
17506            let offset = encoder.out_of_line_offset(bytes_len);
17507            let mut _prev_end_offset: usize = 0;
17508            if 1 > max_ordinal {
17509                return Ok(());
17510            }
17511
17512            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17513            // are envelope_size bytes.
17514            let cur_offset: usize = (1 - 1) * envelope_size;
17515
17516            // Zero reserved fields.
17517            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17518
17519            // Safety:
17520            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17521            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17522            //   envelope_size bytes, there is always sufficient room.
17523            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211::WlanAccessCategory, D>(
17524            self.ac.as_ref().map(<fidl_fuchsia_wlan_ieee80211::WlanAccessCategory as fidl::encoding::ValueTypeMarker>::borrow),
17525            encoder, offset + cur_offset, depth
17526        )?;
17527
17528            _prev_end_offset = cur_offset + envelope_size;
17529            if 2 > max_ordinal {
17530                return Ok(());
17531            }
17532
17533            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17534            // are envelope_size bytes.
17535            let cur_offset: usize = (2 - 1) * envelope_size;
17536
17537            // Zero reserved fields.
17538            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17539
17540            // Safety:
17541            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17542            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17543            //   envelope_size bytes, there is always sufficient room.
17544            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanWmmParameters, D>(
17545            self.params.as_ref().map(<fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::ValueTypeMarker>::borrow),
17546            encoder, offset + cur_offset, depth
17547        )?;
17548
17549            _prev_end_offset = cur_offset + envelope_size;
17550
17551            Ok(())
17552        }
17553    }
17554
17555    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17556        for WlanSoftmacBaseUpdateWmmParametersRequest
17557    {
17558        #[inline(always)]
17559        fn new_empty() -> Self {
17560            Self::default()
17561        }
17562
17563        unsafe fn decode(
17564            &mut self,
17565            decoder: &mut fidl::encoding::Decoder<'_, D>,
17566            offset: usize,
17567            mut depth: fidl::encoding::Depth,
17568        ) -> fidl::Result<()> {
17569            decoder.debug_check_bounds::<Self>(offset);
17570            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17571                None => return Err(fidl::Error::NotNullable),
17572                Some(len) => len,
17573            };
17574            // Calling decoder.out_of_line_offset(0) is not allowed.
17575            if len == 0 {
17576                return Ok(());
17577            };
17578            depth.increment()?;
17579            let envelope_size = 8;
17580            let bytes_len = len * envelope_size;
17581            let offset = decoder.out_of_line_offset(bytes_len)?;
17582            // Decode the envelope for each type.
17583            let mut _next_ordinal_to_read = 0;
17584            let mut next_offset = offset;
17585            let end_offset = offset + bytes_len;
17586            _next_ordinal_to_read += 1;
17587            if next_offset >= end_offset {
17588                return Ok(());
17589            }
17590
17591            // Decode unknown envelopes for gaps in ordinals.
17592            while _next_ordinal_to_read < 1 {
17593                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17594                _next_ordinal_to_read += 1;
17595                next_offset += envelope_size;
17596            }
17597
17598            let next_out_of_line = decoder.next_out_of_line();
17599            let handles_before = decoder.remaining_handles();
17600            if let Some((inlined, num_bytes, num_handles)) =
17601                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17602            {
17603                let member_inline_size = <fidl_fuchsia_wlan_ieee80211::WlanAccessCategory as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17604                if inlined != (member_inline_size <= 4) {
17605                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17606                }
17607                let inner_offset;
17608                let mut inner_depth = depth.clone();
17609                if inlined {
17610                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17611                    inner_offset = next_offset;
17612                } else {
17613                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17614                    inner_depth.increment()?;
17615                }
17616                let val_ref = self.ac.get_or_insert_with(|| {
17617                    fidl::new_empty!(fidl_fuchsia_wlan_ieee80211::WlanAccessCategory, D)
17618                });
17619                fidl::decode!(
17620                    fidl_fuchsia_wlan_ieee80211::WlanAccessCategory,
17621                    D,
17622                    val_ref,
17623                    decoder,
17624                    inner_offset,
17625                    inner_depth
17626                )?;
17627                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17628                {
17629                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17630                }
17631                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17632                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17633                }
17634            }
17635
17636            next_offset += envelope_size;
17637            _next_ordinal_to_read += 1;
17638            if next_offset >= end_offset {
17639                return Ok(());
17640            }
17641
17642            // Decode unknown envelopes for gaps in ordinals.
17643            while _next_ordinal_to_read < 2 {
17644                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17645                _next_ordinal_to_read += 1;
17646                next_offset += envelope_size;
17647            }
17648
17649            let next_out_of_line = decoder.next_out_of_line();
17650            let handles_before = decoder.remaining_handles();
17651            if let Some((inlined, num_bytes, num_handles)) =
17652                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17653            {
17654                let member_inline_size = <fidl_fuchsia_wlan_common::WlanWmmParameters as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17655                if inlined != (member_inline_size <= 4) {
17656                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17657                }
17658                let inner_offset;
17659                let mut inner_depth = depth.clone();
17660                if inlined {
17661                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17662                    inner_offset = next_offset;
17663                } else {
17664                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17665                    inner_depth.increment()?;
17666                }
17667                let val_ref = self.params.get_or_insert_with(|| {
17668                    fidl::new_empty!(fidl_fuchsia_wlan_common::WlanWmmParameters, D)
17669                });
17670                fidl::decode!(
17671                    fidl_fuchsia_wlan_common::WlanWmmParameters,
17672                    D,
17673                    val_ref,
17674                    decoder,
17675                    inner_offset,
17676                    inner_depth
17677                )?;
17678                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17679                {
17680                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17681                }
17682                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17683                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17684                }
17685            }
17686
17687            next_offset += envelope_size;
17688
17689            // Decode the remaining unknown envelopes.
17690            while next_offset < end_offset {
17691                _next_ordinal_to_read += 1;
17692                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17693                next_offset += envelope_size;
17694            }
17695
17696            Ok(())
17697        }
17698    }
17699
17700    impl WlanSoftmacBaseStartActiveScanResponse {
17701        #[inline(always)]
17702        fn max_ordinal_present(&self) -> u64 {
17703            if let Some(_) = self.scan_id {
17704                return 1;
17705            }
17706            0
17707        }
17708    }
17709
17710    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartActiveScanResponse {
17711        type Borrowed<'a> = &'a Self;
17712        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17713            value
17714        }
17715    }
17716
17717    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartActiveScanResponse {
17718        type Owned = Self;
17719
17720        #[inline(always)]
17721        fn inline_align(_context: fidl::encoding::Context) -> usize {
17722            8
17723        }
17724
17725        #[inline(always)]
17726        fn inline_size(_context: fidl::encoding::Context) -> usize {
17727            16
17728        }
17729    }
17730
17731    unsafe impl<D: fidl::encoding::ResourceDialect>
17732        fidl::encoding::Encode<WlanSoftmacBaseStartActiveScanResponse, D>
17733        for &WlanSoftmacBaseStartActiveScanResponse
17734    {
17735        unsafe fn encode(
17736            self,
17737            encoder: &mut fidl::encoding::Encoder<'_, D>,
17738            offset: usize,
17739            mut depth: fidl::encoding::Depth,
17740        ) -> fidl::Result<()> {
17741            encoder.debug_check_bounds::<WlanSoftmacBaseStartActiveScanResponse>(offset);
17742            // Vector header
17743            let max_ordinal: u64 = self.max_ordinal_present();
17744            encoder.write_num(max_ordinal, offset);
17745            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17746            // Calling encoder.out_of_line_offset(0) is not allowed.
17747            if max_ordinal == 0 {
17748                return Ok(());
17749            }
17750            depth.increment()?;
17751            let envelope_size = 8;
17752            let bytes_len = max_ordinal as usize * envelope_size;
17753            #[allow(unused_variables)]
17754            let offset = encoder.out_of_line_offset(bytes_len);
17755            let mut _prev_end_offset: usize = 0;
17756            if 1 > max_ordinal {
17757                return Ok(());
17758            }
17759
17760            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17761            // are envelope_size bytes.
17762            let cur_offset: usize = (1 - 1) * envelope_size;
17763
17764            // Zero reserved fields.
17765            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17766
17767            // Safety:
17768            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17769            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17770            //   envelope_size bytes, there is always sufficient room.
17771            fidl::encoding::encode_in_envelope_optional::<u64, D>(
17772                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
17773                encoder,
17774                offset + cur_offset,
17775                depth,
17776            )?;
17777
17778            _prev_end_offset = cur_offset + envelope_size;
17779
17780            Ok(())
17781        }
17782    }
17783
17784    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17785        for WlanSoftmacBaseStartActiveScanResponse
17786    {
17787        #[inline(always)]
17788        fn new_empty() -> Self {
17789            Self::default()
17790        }
17791
17792        unsafe fn decode(
17793            &mut self,
17794            decoder: &mut fidl::encoding::Decoder<'_, D>,
17795            offset: usize,
17796            mut depth: fidl::encoding::Depth,
17797        ) -> fidl::Result<()> {
17798            decoder.debug_check_bounds::<Self>(offset);
17799            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17800                None => return Err(fidl::Error::NotNullable),
17801                Some(len) => len,
17802            };
17803            // Calling decoder.out_of_line_offset(0) is not allowed.
17804            if len == 0 {
17805                return Ok(());
17806            };
17807            depth.increment()?;
17808            let envelope_size = 8;
17809            let bytes_len = len * envelope_size;
17810            let offset = decoder.out_of_line_offset(bytes_len)?;
17811            // Decode the envelope for each type.
17812            let mut _next_ordinal_to_read = 0;
17813            let mut next_offset = offset;
17814            let end_offset = offset + bytes_len;
17815            _next_ordinal_to_read += 1;
17816            if next_offset >= end_offset {
17817                return Ok(());
17818            }
17819
17820            // Decode unknown envelopes for gaps in ordinals.
17821            while _next_ordinal_to_read < 1 {
17822                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17823                _next_ordinal_to_read += 1;
17824                next_offset += envelope_size;
17825            }
17826
17827            let next_out_of_line = decoder.next_out_of_line();
17828            let handles_before = decoder.remaining_handles();
17829            if let Some((inlined, num_bytes, num_handles)) =
17830                fidl::encoding::decode_envelope_header(decoder, next_offset)?
17831            {
17832                let member_inline_size =
17833                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
17834                if inlined != (member_inline_size <= 4) {
17835                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
17836                }
17837                let inner_offset;
17838                let mut inner_depth = depth.clone();
17839                if inlined {
17840                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
17841                    inner_offset = next_offset;
17842                } else {
17843                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
17844                    inner_depth.increment()?;
17845                }
17846                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
17847                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
17848                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
17849                {
17850                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
17851                }
17852                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
17853                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
17854                }
17855            }
17856
17857            next_offset += envelope_size;
17858
17859            // Decode the remaining unknown envelopes.
17860            while next_offset < end_offset {
17861                _next_ordinal_to_read += 1;
17862                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17863                next_offset += envelope_size;
17864            }
17865
17866            Ok(())
17867        }
17868    }
17869
17870    impl WlanSoftmacBaseStartPassiveScanResponse {
17871        #[inline(always)]
17872        fn max_ordinal_present(&self) -> u64 {
17873            if let Some(_) = self.scan_id {
17874                return 1;
17875            }
17876            0
17877        }
17878    }
17879
17880    impl fidl::encoding::ValueTypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
17881        type Borrowed<'a> = &'a Self;
17882        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
17883            value
17884        }
17885    }
17886
17887    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacBaseStartPassiveScanResponse {
17888        type Owned = Self;
17889
17890        #[inline(always)]
17891        fn inline_align(_context: fidl::encoding::Context) -> usize {
17892            8
17893        }
17894
17895        #[inline(always)]
17896        fn inline_size(_context: fidl::encoding::Context) -> usize {
17897            16
17898        }
17899    }
17900
17901    unsafe impl<D: fidl::encoding::ResourceDialect>
17902        fidl::encoding::Encode<WlanSoftmacBaseStartPassiveScanResponse, D>
17903        for &WlanSoftmacBaseStartPassiveScanResponse
17904    {
17905        unsafe fn encode(
17906            self,
17907            encoder: &mut fidl::encoding::Encoder<'_, D>,
17908            offset: usize,
17909            mut depth: fidl::encoding::Depth,
17910        ) -> fidl::Result<()> {
17911            encoder.debug_check_bounds::<WlanSoftmacBaseStartPassiveScanResponse>(offset);
17912            // Vector header
17913            let max_ordinal: u64 = self.max_ordinal_present();
17914            encoder.write_num(max_ordinal, offset);
17915            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
17916            // Calling encoder.out_of_line_offset(0) is not allowed.
17917            if max_ordinal == 0 {
17918                return Ok(());
17919            }
17920            depth.increment()?;
17921            let envelope_size = 8;
17922            let bytes_len = max_ordinal as usize * envelope_size;
17923            #[allow(unused_variables)]
17924            let offset = encoder.out_of_line_offset(bytes_len);
17925            let mut _prev_end_offset: usize = 0;
17926            if 1 > max_ordinal {
17927                return Ok(());
17928            }
17929
17930            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
17931            // are envelope_size bytes.
17932            let cur_offset: usize = (1 - 1) * envelope_size;
17933
17934            // Zero reserved fields.
17935            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
17936
17937            // Safety:
17938            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
17939            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
17940            //   envelope_size bytes, there is always sufficient room.
17941            fidl::encoding::encode_in_envelope_optional::<u64, D>(
17942                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
17943                encoder,
17944                offset + cur_offset,
17945                depth,
17946            )?;
17947
17948            _prev_end_offset = cur_offset + envelope_size;
17949
17950            Ok(())
17951        }
17952    }
17953
17954    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
17955        for WlanSoftmacBaseStartPassiveScanResponse
17956    {
17957        #[inline(always)]
17958        fn new_empty() -> Self {
17959            Self::default()
17960        }
17961
17962        unsafe fn decode(
17963            &mut self,
17964            decoder: &mut fidl::encoding::Decoder<'_, D>,
17965            offset: usize,
17966            mut depth: fidl::encoding::Depth,
17967        ) -> fidl::Result<()> {
17968            decoder.debug_check_bounds::<Self>(offset);
17969            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
17970                None => return Err(fidl::Error::NotNullable),
17971                Some(len) => len,
17972            };
17973            // Calling decoder.out_of_line_offset(0) is not allowed.
17974            if len == 0 {
17975                return Ok(());
17976            };
17977            depth.increment()?;
17978            let envelope_size = 8;
17979            let bytes_len = len * envelope_size;
17980            let offset = decoder.out_of_line_offset(bytes_len)?;
17981            // Decode the envelope for each type.
17982            let mut _next_ordinal_to_read = 0;
17983            let mut next_offset = offset;
17984            let end_offset = offset + bytes_len;
17985            _next_ordinal_to_read += 1;
17986            if next_offset >= end_offset {
17987                return Ok(());
17988            }
17989
17990            // Decode unknown envelopes for gaps in ordinals.
17991            while _next_ordinal_to_read < 1 {
17992                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
17993                _next_ordinal_to_read += 1;
17994                next_offset += envelope_size;
17995            }
17996
17997            let next_out_of_line = decoder.next_out_of_line();
17998            let handles_before = decoder.remaining_handles();
17999            if let Some((inlined, num_bytes, num_handles)) =
18000                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18001            {
18002                let member_inline_size =
18003                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18004                if inlined != (member_inline_size <= 4) {
18005                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18006                }
18007                let inner_offset;
18008                let mut inner_depth = depth.clone();
18009                if inlined {
18010                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18011                    inner_offset = next_offset;
18012                } else {
18013                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18014                    inner_depth.increment()?;
18015                }
18016                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
18017                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
18018                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18019                {
18020                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18021                }
18022                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18023                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18024                }
18025            }
18026
18027            next_offset += envelope_size;
18028
18029            // Decode the remaining unknown envelopes.
18030            while next_offset < end_offset {
18031                _next_ordinal_to_read += 1;
18032                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18033                next_offset += envelope_size;
18034            }
18035
18036            Ok(())
18037        }
18038    }
18039
18040    impl WlanSoftmacIfcBaseNotifyScanCompleteRequest {
18041        #[inline(always)]
18042        fn max_ordinal_present(&self) -> u64 {
18043            if let Some(_) = self.scan_id {
18044                return 2;
18045            }
18046            if let Some(_) = self.status {
18047                return 1;
18048            }
18049            0
18050        }
18051    }
18052
18053    impl fidl::encoding::ValueTypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
18054        type Borrowed<'a> = &'a Self;
18055        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18056            value
18057        }
18058    }
18059
18060    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacIfcBaseNotifyScanCompleteRequest {
18061        type Owned = Self;
18062
18063        #[inline(always)]
18064        fn inline_align(_context: fidl::encoding::Context) -> usize {
18065            8
18066        }
18067
18068        #[inline(always)]
18069        fn inline_size(_context: fidl::encoding::Context) -> usize {
18070            16
18071        }
18072    }
18073
18074    unsafe impl<D: fidl::encoding::ResourceDialect>
18075        fidl::encoding::Encode<WlanSoftmacIfcBaseNotifyScanCompleteRequest, D>
18076        for &WlanSoftmacIfcBaseNotifyScanCompleteRequest
18077    {
18078        unsafe fn encode(
18079            self,
18080            encoder: &mut fidl::encoding::Encoder<'_, D>,
18081            offset: usize,
18082            mut depth: fidl::encoding::Depth,
18083        ) -> fidl::Result<()> {
18084            encoder.debug_check_bounds::<WlanSoftmacIfcBaseNotifyScanCompleteRequest>(offset);
18085            // Vector header
18086            let max_ordinal: u64 = self.max_ordinal_present();
18087            encoder.write_num(max_ordinal, offset);
18088            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18089            // Calling encoder.out_of_line_offset(0) is not allowed.
18090            if max_ordinal == 0 {
18091                return Ok(());
18092            }
18093            depth.increment()?;
18094            let envelope_size = 8;
18095            let bytes_len = max_ordinal as usize * envelope_size;
18096            #[allow(unused_variables)]
18097            let offset = encoder.out_of_line_offset(bytes_len);
18098            let mut _prev_end_offset: usize = 0;
18099            if 1 > max_ordinal {
18100                return Ok(());
18101            }
18102
18103            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18104            // are envelope_size bytes.
18105            let cur_offset: usize = (1 - 1) * envelope_size;
18106
18107            // Zero reserved fields.
18108            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18109
18110            // Safety:
18111            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18112            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18113            //   envelope_size bytes, there is always sufficient room.
18114            fidl::encoding::encode_in_envelope_optional::<i32, D>(
18115                self.status.as_ref().map(<i32 as fidl::encoding::ValueTypeMarker>::borrow),
18116                encoder,
18117                offset + cur_offset,
18118                depth,
18119            )?;
18120
18121            _prev_end_offset = cur_offset + envelope_size;
18122            if 2 > max_ordinal {
18123                return Ok(());
18124            }
18125
18126            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18127            // are envelope_size bytes.
18128            let cur_offset: usize = (2 - 1) * envelope_size;
18129
18130            // Zero reserved fields.
18131            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18132
18133            // Safety:
18134            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18135            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18136            //   envelope_size bytes, there is always sufficient room.
18137            fidl::encoding::encode_in_envelope_optional::<u64, D>(
18138                self.scan_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
18139                encoder,
18140                offset + cur_offset,
18141                depth,
18142            )?;
18143
18144            _prev_end_offset = cur_offset + envelope_size;
18145
18146            Ok(())
18147        }
18148    }
18149
18150    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
18151        for WlanSoftmacIfcBaseNotifyScanCompleteRequest
18152    {
18153        #[inline(always)]
18154        fn new_empty() -> Self {
18155            Self::default()
18156        }
18157
18158        unsafe fn decode(
18159            &mut self,
18160            decoder: &mut fidl::encoding::Decoder<'_, D>,
18161            offset: usize,
18162            mut depth: fidl::encoding::Depth,
18163        ) -> fidl::Result<()> {
18164            decoder.debug_check_bounds::<Self>(offset);
18165            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18166                None => return Err(fidl::Error::NotNullable),
18167                Some(len) => len,
18168            };
18169            // Calling decoder.out_of_line_offset(0) is not allowed.
18170            if len == 0 {
18171                return Ok(());
18172            };
18173            depth.increment()?;
18174            let envelope_size = 8;
18175            let bytes_len = len * envelope_size;
18176            let offset = decoder.out_of_line_offset(bytes_len)?;
18177            // Decode the envelope for each type.
18178            let mut _next_ordinal_to_read = 0;
18179            let mut next_offset = offset;
18180            let end_offset = offset + bytes_len;
18181            _next_ordinal_to_read += 1;
18182            if next_offset >= end_offset {
18183                return Ok(());
18184            }
18185
18186            // Decode unknown envelopes for gaps in ordinals.
18187            while _next_ordinal_to_read < 1 {
18188                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18189                _next_ordinal_to_read += 1;
18190                next_offset += envelope_size;
18191            }
18192
18193            let next_out_of_line = decoder.next_out_of_line();
18194            let handles_before = decoder.remaining_handles();
18195            if let Some((inlined, num_bytes, num_handles)) =
18196                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18197            {
18198                let member_inline_size =
18199                    <i32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18200                if inlined != (member_inline_size <= 4) {
18201                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18202                }
18203                let inner_offset;
18204                let mut inner_depth = depth.clone();
18205                if inlined {
18206                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18207                    inner_offset = next_offset;
18208                } else {
18209                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18210                    inner_depth.increment()?;
18211                }
18212                let val_ref = self.status.get_or_insert_with(|| fidl::new_empty!(i32, D));
18213                fidl::decode!(i32, D, val_ref, decoder, inner_offset, inner_depth)?;
18214                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18215                {
18216                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18217                }
18218                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18219                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18220                }
18221            }
18222
18223            next_offset += envelope_size;
18224            _next_ordinal_to_read += 1;
18225            if next_offset >= end_offset {
18226                return Ok(());
18227            }
18228
18229            // Decode unknown envelopes for gaps in ordinals.
18230            while _next_ordinal_to_read < 2 {
18231                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18232                _next_ordinal_to_read += 1;
18233                next_offset += envelope_size;
18234            }
18235
18236            let next_out_of_line = decoder.next_out_of_line();
18237            let handles_before = decoder.remaining_handles();
18238            if let Some((inlined, num_bytes, num_handles)) =
18239                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18240            {
18241                let member_inline_size =
18242                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18243                if inlined != (member_inline_size <= 4) {
18244                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18245                }
18246                let inner_offset;
18247                let mut inner_depth = depth.clone();
18248                if inlined {
18249                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18250                    inner_offset = next_offset;
18251                } else {
18252                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18253                    inner_depth.increment()?;
18254                }
18255                let val_ref = self.scan_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
18256                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
18257                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18258                {
18259                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18260                }
18261                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18262                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18263                }
18264            }
18265
18266            next_offset += envelope_size;
18267
18268            // Decode the remaining unknown envelopes.
18269            while next_offset < end_offset {
18270                _next_ordinal_to_read += 1;
18271                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18272                next_offset += envelope_size;
18273            }
18274
18275            Ok(())
18276        }
18277    }
18278
18279    impl WlanSoftmacQueryResponse {
18280        #[inline(always)]
18281        fn max_ordinal_present(&self) -> u64 {
18282            if let Some(_) = self.band_caps {
18283                return 5;
18284            }
18285            if let Some(_) = self.hardware_capability {
18286                return 4;
18287            }
18288            if let Some(_) = self.supported_phys {
18289                return 3;
18290            }
18291            if let Some(_) = self.mac_role {
18292                return 2;
18293            }
18294            if let Some(_) = self.sta_addr {
18295                return 1;
18296            }
18297            0
18298        }
18299    }
18300
18301    impl fidl::encoding::ValueTypeMarker for WlanSoftmacQueryResponse {
18302        type Borrowed<'a> = &'a Self;
18303        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18304            value
18305        }
18306    }
18307
18308    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacQueryResponse {
18309        type Owned = Self;
18310
18311        #[inline(always)]
18312        fn inline_align(_context: fidl::encoding::Context) -> usize {
18313            8
18314        }
18315
18316        #[inline(always)]
18317        fn inline_size(_context: fidl::encoding::Context) -> usize {
18318            16
18319        }
18320    }
18321
18322    unsafe impl<D: fidl::encoding::ResourceDialect>
18323        fidl::encoding::Encode<WlanSoftmacQueryResponse, D> for &WlanSoftmacQueryResponse
18324    {
18325        unsafe fn encode(
18326            self,
18327            encoder: &mut fidl::encoding::Encoder<'_, D>,
18328            offset: usize,
18329            mut depth: fidl::encoding::Depth,
18330        ) -> fidl::Result<()> {
18331            encoder.debug_check_bounds::<WlanSoftmacQueryResponse>(offset);
18332            // Vector header
18333            let max_ordinal: u64 = self.max_ordinal_present();
18334            encoder.write_num(max_ordinal, offset);
18335            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18336            // Calling encoder.out_of_line_offset(0) is not allowed.
18337            if max_ordinal == 0 {
18338                return Ok(());
18339            }
18340            depth.increment()?;
18341            let envelope_size = 8;
18342            let bytes_len = max_ordinal as usize * envelope_size;
18343            #[allow(unused_variables)]
18344            let offset = encoder.out_of_line_offset(bytes_len);
18345            let mut _prev_end_offset: usize = 0;
18346            if 1 > max_ordinal {
18347                return Ok(());
18348            }
18349
18350            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18351            // are envelope_size bytes.
18352            let cur_offset: usize = (1 - 1) * envelope_size;
18353
18354            // Zero reserved fields.
18355            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18356
18357            // Safety:
18358            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18359            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18360            //   envelope_size bytes, there is always sufficient room.
18361            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
18362                self.sta_addr
18363                    .as_ref()
18364                    .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
18365                encoder,
18366                offset + cur_offset,
18367                depth,
18368            )?;
18369
18370            _prev_end_offset = cur_offset + envelope_size;
18371            if 2 > max_ordinal {
18372                return Ok(());
18373            }
18374
18375            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18376            // are envelope_size bytes.
18377            let cur_offset: usize = (2 - 1) * envelope_size;
18378
18379            // Zero reserved fields.
18380            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18381
18382            // Safety:
18383            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18384            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18385            //   envelope_size bytes, there is always sufficient room.
18386            fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_common::WlanMacRole, D>(
18387            self.mac_role.as_ref().map(<fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow),
18388            encoder, offset + cur_offset, depth
18389        )?;
18390
18391            _prev_end_offset = cur_offset + envelope_size;
18392            if 3 > max_ordinal {
18393                return Ok(());
18394            }
18395
18396            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18397            // are envelope_size bytes.
18398            let cur_offset: usize = (3 - 1) * envelope_size;
18399
18400            // Zero reserved fields.
18401            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18402
18403            // Safety:
18404            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18405            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18406            //   envelope_size bytes, there is always sufficient room.
18407            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D>(
18408            self.supported_phys.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow),
18409            encoder, offset + cur_offset, depth
18410        )?;
18411
18412            _prev_end_offset = cur_offset + envelope_size;
18413            if 4 > max_ordinal {
18414                return Ok(());
18415            }
18416
18417            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18418            // are envelope_size bytes.
18419            let cur_offset: usize = (4 - 1) * envelope_size;
18420
18421            // Zero reserved fields.
18422            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18423
18424            // Safety:
18425            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18426            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18427            //   envelope_size bytes, there is always sufficient room.
18428            fidl::encoding::encode_in_envelope_optional::<u32, D>(
18429                self.hardware_capability
18430                    .as_ref()
18431                    .map(<u32 as fidl::encoding::ValueTypeMarker>::borrow),
18432                encoder,
18433                offset + cur_offset,
18434                depth,
18435            )?;
18436
18437            _prev_end_offset = cur_offset + envelope_size;
18438            if 5 > max_ordinal {
18439                return Ok(());
18440            }
18441
18442            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18443            // are envelope_size bytes.
18444            let cur_offset: usize = (5 - 1) * envelope_size;
18445
18446            // Zero reserved fields.
18447            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18448
18449            // Safety:
18450            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18451            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18452            //   envelope_size bytes, there is always sufficient room.
18453            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D>(
18454            self.band_caps.as_ref().map(<fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::ValueTypeMarker>::borrow),
18455            encoder, offset + cur_offset, depth
18456        )?;
18457
18458            _prev_end_offset = cur_offset + envelope_size;
18459
18460            Ok(())
18461        }
18462    }
18463
18464    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
18465        for WlanSoftmacQueryResponse
18466    {
18467        #[inline(always)]
18468        fn new_empty() -> Self {
18469            Self::default()
18470        }
18471
18472        unsafe fn decode(
18473            &mut self,
18474            decoder: &mut fidl::encoding::Decoder<'_, D>,
18475            offset: usize,
18476            mut depth: fidl::encoding::Depth,
18477        ) -> fidl::Result<()> {
18478            decoder.debug_check_bounds::<Self>(offset);
18479            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
18480                None => return Err(fidl::Error::NotNullable),
18481                Some(len) => len,
18482            };
18483            // Calling decoder.out_of_line_offset(0) is not allowed.
18484            if len == 0 {
18485                return Ok(());
18486            };
18487            depth.increment()?;
18488            let envelope_size = 8;
18489            let bytes_len = len * envelope_size;
18490            let offset = decoder.out_of_line_offset(bytes_len)?;
18491            // Decode the envelope for each type.
18492            let mut _next_ordinal_to_read = 0;
18493            let mut next_offset = offset;
18494            let end_offset = offset + bytes_len;
18495            _next_ordinal_to_read += 1;
18496            if next_offset >= end_offset {
18497                return Ok(());
18498            }
18499
18500            // Decode unknown envelopes for gaps in ordinals.
18501            while _next_ordinal_to_read < 1 {
18502                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18503                _next_ordinal_to_read += 1;
18504                next_offset += envelope_size;
18505            }
18506
18507            let next_out_of_line = decoder.next_out_of_line();
18508            let handles_before = decoder.remaining_handles();
18509            if let Some((inlined, num_bytes, num_handles)) =
18510                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18511            {
18512                let member_inline_size =
18513                    <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
18514                        decoder.context,
18515                    );
18516                if inlined != (member_inline_size <= 4) {
18517                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18518                }
18519                let inner_offset;
18520                let mut inner_depth = depth.clone();
18521                if inlined {
18522                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18523                    inner_offset = next_offset;
18524                } else {
18525                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18526                    inner_depth.increment()?;
18527                }
18528                let val_ref = self
18529                    .sta_addr
18530                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
18531                fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
18532                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18533                {
18534                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18535                }
18536                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18537                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18538                }
18539            }
18540
18541            next_offset += envelope_size;
18542            _next_ordinal_to_read += 1;
18543            if next_offset >= end_offset {
18544                return Ok(());
18545            }
18546
18547            // Decode unknown envelopes for gaps in ordinals.
18548            while _next_ordinal_to_read < 2 {
18549                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18550                _next_ordinal_to_read += 1;
18551                next_offset += envelope_size;
18552            }
18553
18554            let next_out_of_line = decoder.next_out_of_line();
18555            let handles_before = decoder.remaining_handles();
18556            if let Some((inlined, num_bytes, num_handles)) =
18557                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18558            {
18559                let member_inline_size = <fidl_fuchsia_wlan_common::WlanMacRole as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18560                if inlined != (member_inline_size <= 4) {
18561                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18562                }
18563                let inner_offset;
18564                let mut inner_depth = depth.clone();
18565                if inlined {
18566                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18567                    inner_offset = next_offset;
18568                } else {
18569                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18570                    inner_depth.increment()?;
18571                }
18572                let val_ref = self.mac_role.get_or_insert_with(|| {
18573                    fidl::new_empty!(fidl_fuchsia_wlan_common::WlanMacRole, D)
18574                });
18575                fidl::decode!(
18576                    fidl_fuchsia_wlan_common::WlanMacRole,
18577                    D,
18578                    val_ref,
18579                    decoder,
18580                    inner_offset,
18581                    inner_depth
18582                )?;
18583                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18584                {
18585                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18586                }
18587                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18588                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18589                }
18590            }
18591
18592            next_offset += envelope_size;
18593            _next_ordinal_to_read += 1;
18594            if next_offset >= end_offset {
18595                return Ok(());
18596            }
18597
18598            // Decode unknown envelopes for gaps in ordinals.
18599            while _next_ordinal_to_read < 3 {
18600                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18601                _next_ordinal_to_read += 1;
18602                next_offset += envelope_size;
18603            }
18604
18605            let next_out_of_line = decoder.next_out_of_line();
18606            let handles_before = decoder.remaining_handles();
18607            if let Some((inlined, num_bytes, num_handles)) =
18608                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18609            {
18610                let member_inline_size = <fidl::encoding::Vector<
18611                    fidl_fuchsia_wlan_common::WlanPhyType,
18612                    64,
18613                > as fidl::encoding::TypeMarker>::inline_size(
18614                    decoder.context
18615                );
18616                if inlined != (member_inline_size <= 4) {
18617                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18618                }
18619                let inner_offset;
18620                let mut inner_depth = depth.clone();
18621                if inlined {
18622                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18623                    inner_offset = next_offset;
18624                } else {
18625                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18626                    inner_depth.increment()?;
18627                }
18628                let val_ref =
18629                self.supported_phys.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D));
18630                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common::WlanPhyType, 64>, D, val_ref, decoder, inner_offset, inner_depth)?;
18631                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18632                {
18633                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18634                }
18635                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18636                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18637                }
18638            }
18639
18640            next_offset += envelope_size;
18641            _next_ordinal_to_read += 1;
18642            if next_offset >= end_offset {
18643                return Ok(());
18644            }
18645
18646            // Decode unknown envelopes for gaps in ordinals.
18647            while _next_ordinal_to_read < 4 {
18648                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18649                _next_ordinal_to_read += 1;
18650                next_offset += envelope_size;
18651            }
18652
18653            let next_out_of_line = decoder.next_out_of_line();
18654            let handles_before = decoder.remaining_handles();
18655            if let Some((inlined, num_bytes, num_handles)) =
18656                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18657            {
18658                let member_inline_size =
18659                    <u32 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18660                if inlined != (member_inline_size <= 4) {
18661                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18662                }
18663                let inner_offset;
18664                let mut inner_depth = depth.clone();
18665                if inlined {
18666                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18667                    inner_offset = next_offset;
18668                } else {
18669                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18670                    inner_depth.increment()?;
18671                }
18672                let val_ref =
18673                    self.hardware_capability.get_or_insert_with(|| fidl::new_empty!(u32, D));
18674                fidl::decode!(u32, D, val_ref, decoder, inner_offset, inner_depth)?;
18675                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18676                {
18677                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18678                }
18679                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18680                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18681                }
18682            }
18683
18684            next_offset += envelope_size;
18685            _next_ordinal_to_read += 1;
18686            if next_offset >= end_offset {
18687                return Ok(());
18688            }
18689
18690            // Decode unknown envelopes for gaps in ordinals.
18691            while _next_ordinal_to_read < 5 {
18692                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18693                _next_ordinal_to_read += 1;
18694                next_offset += envelope_size;
18695            }
18696
18697            let next_out_of_line = decoder.next_out_of_line();
18698            let handles_before = decoder.remaining_handles();
18699            if let Some((inlined, num_bytes, num_handles)) =
18700                fidl::encoding::decode_envelope_header(decoder, next_offset)?
18701            {
18702                let member_inline_size = <fidl::encoding::Vector<WlanSoftmacBandCapability, 16> as fidl::encoding::TypeMarker>::inline_size(decoder.context);
18703                if inlined != (member_inline_size <= 4) {
18704                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
18705                }
18706                let inner_offset;
18707                let mut inner_depth = depth.clone();
18708                if inlined {
18709                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
18710                    inner_offset = next_offset;
18711                } else {
18712                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
18713                    inner_depth.increment()?;
18714                }
18715                let val_ref = self.band_caps.get_or_insert_with(
18716                    || fidl::new_empty!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D),
18717                );
18718                fidl::decode!(fidl::encoding::Vector<WlanSoftmacBandCapability, 16>, D, val_ref, decoder, inner_offset, inner_depth)?;
18719                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
18720                {
18721                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
18722                }
18723                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
18724                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
18725                }
18726            }
18727
18728            next_offset += envelope_size;
18729
18730            // Decode the remaining unknown envelopes.
18731            while next_offset < end_offset {
18732                _next_ordinal_to_read += 1;
18733                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
18734                next_offset += envelope_size;
18735            }
18736
18737            Ok(())
18738        }
18739    }
18740
18741    impl WlanSoftmacStartActiveScanRequest {
18742        #[inline(always)]
18743        fn max_ordinal_present(&self) -> u64 {
18744            if let Some(_) = self.max_probes_per_channel {
18745                return 9;
18746            }
18747            if let Some(_) = self.min_probes_per_channel {
18748                return 8;
18749            }
18750            if let Some(_) = self.min_home_time {
18751                return 7;
18752            }
18753            if let Some(_) = self.max_channel_time {
18754                return 6;
18755            }
18756            if let Some(_) = self.min_channel_time {
18757                return 5;
18758            }
18759            if let Some(_) = self.ies {
18760                return 4;
18761            }
18762            if let Some(_) = self.mac_header {
18763                return 3;
18764            }
18765            if let Some(_) = self.ssids {
18766                return 2;
18767            }
18768            if let Some(_) = self.channels {
18769                return 1;
18770            }
18771            0
18772        }
18773    }
18774
18775    impl fidl::encoding::ValueTypeMarker for WlanSoftmacStartActiveScanRequest {
18776        type Borrowed<'a> = &'a Self;
18777        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
18778            value
18779        }
18780    }
18781
18782    unsafe impl fidl::encoding::TypeMarker for WlanSoftmacStartActiveScanRequest {
18783        type Owned = Self;
18784
18785        #[inline(always)]
18786        fn inline_align(_context: fidl::encoding::Context) -> usize {
18787            8
18788        }
18789
18790        #[inline(always)]
18791        fn inline_size(_context: fidl::encoding::Context) -> usize {
18792            16
18793        }
18794    }
18795
18796    unsafe impl<D: fidl::encoding::ResourceDialect>
18797        fidl::encoding::Encode<WlanSoftmacStartActiveScanRequest, D>
18798        for &WlanSoftmacStartActiveScanRequest
18799    {
18800        unsafe fn encode(
18801            self,
18802            encoder: &mut fidl::encoding::Encoder<'_, D>,
18803            offset: usize,
18804            mut depth: fidl::encoding::Depth,
18805        ) -> fidl::Result<()> {
18806            encoder.debug_check_bounds::<WlanSoftmacStartActiveScanRequest>(offset);
18807            // Vector header
18808            let max_ordinal: u64 = self.max_ordinal_present();
18809            encoder.write_num(max_ordinal, offset);
18810            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
18811            // Calling encoder.out_of_line_offset(0) is not allowed.
18812            if max_ordinal == 0 {
18813                return Ok(());
18814            }
18815            depth.increment()?;
18816            let envelope_size = 8;
18817            let bytes_len = max_ordinal as usize * envelope_size;
18818            #[allow(unused_variables)]
18819            let offset = encoder.out_of_line_offset(bytes_len);
18820            let mut _prev_end_offset: usize = 0;
18821            if 1 > max_ordinal {
18822                return Ok(());
18823            }
18824
18825            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18826            // are envelope_size bytes.
18827            let cur_offset: usize = (1 - 1) * envelope_size;
18828
18829            // Zero reserved fields.
18830            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18831
18832            // Safety:
18833            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18834            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18835            //   envelope_size bytes, there is always sufficient room.
18836            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 256>, D>(
18837                self.channels.as_ref().map(
18838                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::ValueTypeMarker>::borrow,
18839                ),
18840                encoder,
18841                offset + cur_offset,
18842                depth,
18843            )?;
18844
18845            _prev_end_offset = cur_offset + envelope_size;
18846            if 2 > max_ordinal {
18847                return Ok(());
18848            }
18849
18850            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18851            // are envelope_size bytes.
18852            let cur_offset: usize = (2 - 1) * envelope_size;
18853
18854            // Zero reserved fields.
18855            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18856
18857            // Safety:
18858            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18859            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18860            //   envelope_size bytes, there is always sufficient room.
18861            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84>, D>(
18862            self.ssids.as_ref().map(<fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84> as fidl::encoding::ValueTypeMarker>::borrow),
18863            encoder, offset + cur_offset, depth
18864        )?;
18865
18866            _prev_end_offset = cur_offset + envelope_size;
18867            if 3 > max_ordinal {
18868                return Ok(());
18869            }
18870
18871            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18872            // are envelope_size bytes.
18873            let cur_offset: usize = (3 - 1) * envelope_size;
18874
18875            // Zero reserved fields.
18876            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18877
18878            // Safety:
18879            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18880            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18881            //   envelope_size bytes, there is always sufficient room.
18882            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 28>, D>(
18883                self.mac_header.as_ref().map(
18884                    <fidl::encoding::Vector<u8, 28> as fidl::encoding::ValueTypeMarker>::borrow,
18885                ),
18886                encoder,
18887                offset + cur_offset,
18888                depth,
18889            )?;
18890
18891            _prev_end_offset = cur_offset + envelope_size;
18892            if 4 > max_ordinal {
18893                return Ok(());
18894            }
18895
18896            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18897            // are envelope_size bytes.
18898            let cur_offset: usize = (4 - 1) * envelope_size;
18899
18900            // Zero reserved fields.
18901            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18902
18903            // Safety:
18904            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18905            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18906            //   envelope_size bytes, there is always sufficient room.
18907            fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 11454>, D>(
18908                self.ies.as_ref().map(
18909                    <fidl::encoding::Vector<u8, 11454> as fidl::encoding::ValueTypeMarker>::borrow,
18910                ),
18911                encoder,
18912                offset + cur_offset,
18913                depth,
18914            )?;
18915
18916            _prev_end_offset = cur_offset + envelope_size;
18917            if 5 > max_ordinal {
18918                return Ok(());
18919            }
18920
18921            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18922            // are envelope_size bytes.
18923            let cur_offset: usize = (5 - 1) * envelope_size;
18924
18925            // Zero reserved fields.
18926            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18927
18928            // Safety:
18929            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18930            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18931            //   envelope_size bytes, there is always sufficient room.
18932            fidl::encoding::encode_in_envelope_optional::<i64, D>(
18933                self.min_channel_time
18934                    .as_ref()
18935                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
18936                encoder,
18937                offset + cur_offset,
18938                depth,
18939            )?;
18940
18941            _prev_end_offset = cur_offset + envelope_size;
18942            if 6 > max_ordinal {
18943                return Ok(());
18944            }
18945
18946            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18947            // are envelope_size bytes.
18948            let cur_offset: usize = (6 - 1) * envelope_size;
18949
18950            // Zero reserved fields.
18951            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18952
18953            // Safety:
18954            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18955            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18956            //   envelope_size bytes, there is always sufficient room.
18957            fidl::encoding::encode_in_envelope_optional::<i64, D>(
18958                self.max_channel_time
18959                    .as_ref()
18960                    .map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
18961                encoder,
18962                offset + cur_offset,
18963                depth,
18964            )?;
18965
18966            _prev_end_offset = cur_offset + envelope_size;
18967            if 7 > max_ordinal {
18968                return Ok(());
18969            }
18970
18971            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18972            // are envelope_size bytes.
18973            let cur_offset: usize = (7 - 1) * envelope_size;
18974
18975            // Zero reserved fields.
18976            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
18977
18978            // Safety:
18979            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
18980            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
18981            //   envelope_size bytes, there is always sufficient room.
18982            fidl::encoding::encode_in_envelope_optional::<i64, D>(
18983                self.min_home_time.as_ref().map(<i64 as fidl::encoding::ValueTypeMarker>::borrow),
18984                encoder,
18985                offset + cur_offset,
18986                depth,
18987            )?;
18988
18989            _prev_end_offset = cur_offset + envelope_size;
18990            if 8 > max_ordinal {
18991                return Ok(());
18992            }
18993
18994            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
18995            // are envelope_size bytes.
18996            let cur_offset: usize = (8 - 1) * envelope_size;
18997
18998            // Zero reserved fields.
18999            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19000
19001            // Safety:
19002            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19003            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19004            //   envelope_size bytes, there is always sufficient room.
19005            fidl::encoding::encode_in_envelope_optional::<u8, D>(
19006                self.min_probes_per_channel
19007                    .as_ref()
19008                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
19009                encoder,
19010                offset + cur_offset,
19011                depth,
19012            )?;
19013
19014            _prev_end_offset = cur_offset + envelope_size;
19015            if 9 > max_ordinal {
19016                return Ok(());
19017            }
19018
19019            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19020            // are envelope_size bytes.
19021            let cur_offset: usize = (9 - 1) * envelope_size;
19022
19023            // Zero reserved fields.
19024            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19025
19026            // Safety:
19027            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19028            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19029            //   envelope_size bytes, there is always sufficient room.
19030            fidl::encoding::encode_in_envelope_optional::<u8, D>(
19031                self.max_probes_per_channel
19032                    .as_ref()
19033                    .map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
19034                encoder,
19035                offset + cur_offset,
19036                depth,
19037            )?;
19038
19039            _prev_end_offset = cur_offset + envelope_size;
19040
19041            Ok(())
19042        }
19043    }
19044
19045    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
19046        for WlanSoftmacStartActiveScanRequest
19047    {
19048        #[inline(always)]
19049        fn new_empty() -> Self {
19050            Self::default()
19051        }
19052
19053        unsafe fn decode(
19054            &mut self,
19055            decoder: &mut fidl::encoding::Decoder<'_, D>,
19056            offset: usize,
19057            mut depth: fidl::encoding::Depth,
19058        ) -> fidl::Result<()> {
19059            decoder.debug_check_bounds::<Self>(offset);
19060            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19061                None => return Err(fidl::Error::NotNullable),
19062                Some(len) => len,
19063            };
19064            // Calling decoder.out_of_line_offset(0) is not allowed.
19065            if len == 0 {
19066                return Ok(());
19067            };
19068            depth.increment()?;
19069            let envelope_size = 8;
19070            let bytes_len = len * envelope_size;
19071            let offset = decoder.out_of_line_offset(bytes_len)?;
19072            // Decode the envelope for each type.
19073            let mut _next_ordinal_to_read = 0;
19074            let mut next_offset = offset;
19075            let end_offset = offset + bytes_len;
19076            _next_ordinal_to_read += 1;
19077            if next_offset >= end_offset {
19078                return Ok(());
19079            }
19080
19081            // Decode unknown envelopes for gaps in ordinals.
19082            while _next_ordinal_to_read < 1 {
19083                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19084                _next_ordinal_to_read += 1;
19085                next_offset += envelope_size;
19086            }
19087
19088            let next_out_of_line = decoder.next_out_of_line();
19089            let handles_before = decoder.remaining_handles();
19090            if let Some((inlined, num_bytes, num_handles)) =
19091                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19092            {
19093                let member_inline_size =
19094                    <fidl::encoding::Vector<u8, 256> as fidl::encoding::TypeMarker>::inline_size(
19095                        decoder.context,
19096                    );
19097                if inlined != (member_inline_size <= 4) {
19098                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19099                }
19100                let inner_offset;
19101                let mut inner_depth = depth.clone();
19102                if inlined {
19103                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19104                    inner_offset = next_offset;
19105                } else {
19106                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19107                    inner_depth.increment()?;
19108                }
19109                let val_ref = self
19110                    .channels
19111                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 256>, D));
19112                fidl::decode!(fidl::encoding::Vector<u8, 256>, D, val_ref, decoder, inner_offset, inner_depth)?;
19113                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19114                {
19115                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19116                }
19117                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19118                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19119                }
19120            }
19121
19122            next_offset += envelope_size;
19123            _next_ordinal_to_read += 1;
19124            if next_offset >= end_offset {
19125                return Ok(());
19126            }
19127
19128            // Decode unknown envelopes for gaps in ordinals.
19129            while _next_ordinal_to_read < 2 {
19130                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19131                _next_ordinal_to_read += 1;
19132                next_offset += envelope_size;
19133            }
19134
19135            let next_out_of_line = decoder.next_out_of_line();
19136            let handles_before = decoder.remaining_handles();
19137            if let Some((inlined, num_bytes, num_handles)) =
19138                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19139            {
19140                let member_inline_size = <fidl::encoding::Vector<
19141                    fidl_fuchsia_wlan_ieee80211::CSsid,
19142                    84,
19143                > as fidl::encoding::TypeMarker>::inline_size(
19144                    decoder.context
19145                );
19146                if inlined != (member_inline_size <= 4) {
19147                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19148                }
19149                let inner_offset;
19150                let mut inner_depth = depth.clone();
19151                if inlined {
19152                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19153                    inner_offset = next_offset;
19154                } else {
19155                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19156                    inner_depth.increment()?;
19157                }
19158                let val_ref =
19159                self.ssids.get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84>, D));
19160                fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_ieee80211::CSsid, 84>, D, val_ref, decoder, inner_offset, inner_depth)?;
19161                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19162                {
19163                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19164                }
19165                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19166                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19167                }
19168            }
19169
19170            next_offset += envelope_size;
19171            _next_ordinal_to_read += 1;
19172            if next_offset >= end_offset {
19173                return Ok(());
19174            }
19175
19176            // Decode unknown envelopes for gaps in ordinals.
19177            while _next_ordinal_to_read < 3 {
19178                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19179                _next_ordinal_to_read += 1;
19180                next_offset += envelope_size;
19181            }
19182
19183            let next_out_of_line = decoder.next_out_of_line();
19184            let handles_before = decoder.remaining_handles();
19185            if let Some((inlined, num_bytes, num_handles)) =
19186                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19187            {
19188                let member_inline_size =
19189                    <fidl::encoding::Vector<u8, 28> as fidl::encoding::TypeMarker>::inline_size(
19190                        decoder.context,
19191                    );
19192                if inlined != (member_inline_size <= 4) {
19193                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19194                }
19195                let inner_offset;
19196                let mut inner_depth = depth.clone();
19197                if inlined {
19198                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19199                    inner_offset = next_offset;
19200                } else {
19201                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19202                    inner_depth.increment()?;
19203                }
19204                let val_ref = self
19205                    .mac_header
19206                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 28>, D));
19207                fidl::decode!(fidl::encoding::Vector<u8, 28>, D, val_ref, decoder, inner_offset, inner_depth)?;
19208                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19209                {
19210                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19211                }
19212                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19213                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19214                }
19215            }
19216
19217            next_offset += envelope_size;
19218            _next_ordinal_to_read += 1;
19219            if next_offset >= end_offset {
19220                return Ok(());
19221            }
19222
19223            // Decode unknown envelopes for gaps in ordinals.
19224            while _next_ordinal_to_read < 4 {
19225                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19226                _next_ordinal_to_read += 1;
19227                next_offset += envelope_size;
19228            }
19229
19230            let next_out_of_line = decoder.next_out_of_line();
19231            let handles_before = decoder.remaining_handles();
19232            if let Some((inlined, num_bytes, num_handles)) =
19233                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19234            {
19235                let member_inline_size =
19236                    <fidl::encoding::Vector<u8, 11454> as fidl::encoding::TypeMarker>::inline_size(
19237                        decoder.context,
19238                    );
19239                if inlined != (member_inline_size <= 4) {
19240                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19241                }
19242                let inner_offset;
19243                let mut inner_depth = depth.clone();
19244                if inlined {
19245                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19246                    inner_offset = next_offset;
19247                } else {
19248                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19249                    inner_depth.increment()?;
19250                }
19251                let val_ref = self
19252                    .ies
19253                    .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 11454>, D));
19254                fidl::decode!(fidl::encoding::Vector<u8, 11454>, D, val_ref, decoder, inner_offset, inner_depth)?;
19255                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19256                {
19257                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19258                }
19259                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19260                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19261                }
19262            }
19263
19264            next_offset += envelope_size;
19265            _next_ordinal_to_read += 1;
19266            if next_offset >= end_offset {
19267                return Ok(());
19268            }
19269
19270            // Decode unknown envelopes for gaps in ordinals.
19271            while _next_ordinal_to_read < 5 {
19272                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19273                _next_ordinal_to_read += 1;
19274                next_offset += envelope_size;
19275            }
19276
19277            let next_out_of_line = decoder.next_out_of_line();
19278            let handles_before = decoder.remaining_handles();
19279            if let Some((inlined, num_bytes, num_handles)) =
19280                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19281            {
19282                let member_inline_size =
19283                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19284                if inlined != (member_inline_size <= 4) {
19285                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19286                }
19287                let inner_offset;
19288                let mut inner_depth = depth.clone();
19289                if inlined {
19290                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19291                    inner_offset = next_offset;
19292                } else {
19293                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19294                    inner_depth.increment()?;
19295                }
19296                let val_ref = self.min_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
19297                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
19298                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19299                {
19300                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19301                }
19302                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19303                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19304                }
19305            }
19306
19307            next_offset += envelope_size;
19308            _next_ordinal_to_read += 1;
19309            if next_offset >= end_offset {
19310                return Ok(());
19311            }
19312
19313            // Decode unknown envelopes for gaps in ordinals.
19314            while _next_ordinal_to_read < 6 {
19315                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19316                _next_ordinal_to_read += 1;
19317                next_offset += envelope_size;
19318            }
19319
19320            let next_out_of_line = decoder.next_out_of_line();
19321            let handles_before = decoder.remaining_handles();
19322            if let Some((inlined, num_bytes, num_handles)) =
19323                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19324            {
19325                let member_inline_size =
19326                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19327                if inlined != (member_inline_size <= 4) {
19328                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19329                }
19330                let inner_offset;
19331                let mut inner_depth = depth.clone();
19332                if inlined {
19333                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19334                    inner_offset = next_offset;
19335                } else {
19336                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19337                    inner_depth.increment()?;
19338                }
19339                let val_ref = self.max_channel_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
19340                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
19341                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19342                {
19343                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19344                }
19345                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19346                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19347                }
19348            }
19349
19350            next_offset += envelope_size;
19351            _next_ordinal_to_read += 1;
19352            if next_offset >= end_offset {
19353                return Ok(());
19354            }
19355
19356            // Decode unknown envelopes for gaps in ordinals.
19357            while _next_ordinal_to_read < 7 {
19358                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19359                _next_ordinal_to_read += 1;
19360                next_offset += envelope_size;
19361            }
19362
19363            let next_out_of_line = decoder.next_out_of_line();
19364            let handles_before = decoder.remaining_handles();
19365            if let Some((inlined, num_bytes, num_handles)) =
19366                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19367            {
19368                let member_inline_size =
19369                    <i64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19370                if inlined != (member_inline_size <= 4) {
19371                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19372                }
19373                let inner_offset;
19374                let mut inner_depth = depth.clone();
19375                if inlined {
19376                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19377                    inner_offset = next_offset;
19378                } else {
19379                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19380                    inner_depth.increment()?;
19381                }
19382                let val_ref = self.min_home_time.get_or_insert_with(|| fidl::new_empty!(i64, D));
19383                fidl::decode!(i64, D, val_ref, decoder, inner_offset, inner_depth)?;
19384                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19385                {
19386                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19387                }
19388                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19389                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19390                }
19391            }
19392
19393            next_offset += envelope_size;
19394            _next_ordinal_to_read += 1;
19395            if next_offset >= end_offset {
19396                return Ok(());
19397            }
19398
19399            // Decode unknown envelopes for gaps in ordinals.
19400            while _next_ordinal_to_read < 8 {
19401                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19402                _next_ordinal_to_read += 1;
19403                next_offset += envelope_size;
19404            }
19405
19406            let next_out_of_line = decoder.next_out_of_line();
19407            let handles_before = decoder.remaining_handles();
19408            if let Some((inlined, num_bytes, num_handles)) =
19409                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19410            {
19411                let member_inline_size =
19412                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19413                if inlined != (member_inline_size <= 4) {
19414                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19415                }
19416                let inner_offset;
19417                let mut inner_depth = depth.clone();
19418                if inlined {
19419                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19420                    inner_offset = next_offset;
19421                } else {
19422                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19423                    inner_depth.increment()?;
19424                }
19425                let val_ref =
19426                    self.min_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
19427                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
19428                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19429                {
19430                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19431                }
19432                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19433                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19434                }
19435            }
19436
19437            next_offset += envelope_size;
19438            _next_ordinal_to_read += 1;
19439            if next_offset >= end_offset {
19440                return Ok(());
19441            }
19442
19443            // Decode unknown envelopes for gaps in ordinals.
19444            while _next_ordinal_to_read < 9 {
19445                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19446                _next_ordinal_to_read += 1;
19447                next_offset += envelope_size;
19448            }
19449
19450            let next_out_of_line = decoder.next_out_of_line();
19451            let handles_before = decoder.remaining_handles();
19452            if let Some((inlined, num_bytes, num_handles)) =
19453                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19454            {
19455                let member_inline_size =
19456                    <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19457                if inlined != (member_inline_size <= 4) {
19458                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19459                }
19460                let inner_offset;
19461                let mut inner_depth = depth.clone();
19462                if inlined {
19463                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19464                    inner_offset = next_offset;
19465                } else {
19466                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19467                    inner_depth.increment()?;
19468                }
19469                let val_ref =
19470                    self.max_probes_per_channel.get_or_insert_with(|| fidl::new_empty!(u8, D));
19471                fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
19472                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19473                {
19474                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19475                }
19476                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19477                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19478                }
19479            }
19480
19481            next_offset += envelope_size;
19482
19483            // Decode the remaining unknown envelopes.
19484            while next_offset < end_offset {
19485                _next_ordinal_to_read += 1;
19486                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19487                next_offset += envelope_size;
19488            }
19489
19490            Ok(())
19491        }
19492    }
19493
19494    impl WlanTxTransferRequest {
19495        #[inline(always)]
19496        fn max_ordinal_present(&self) -> u64 {
19497            if let Some(_) = self.arena {
19498                return 5;
19499            }
19500            if let Some(_) = self.async_id {
19501                return 4;
19502            }
19503            if let Some(_) = self.packet_info {
19504                return 3;
19505            }
19506            if let Some(_) = self.packet_size {
19507                return 2;
19508            }
19509            if let Some(_) = self.packet_address {
19510                return 1;
19511            }
19512            0
19513        }
19514    }
19515
19516    impl fidl::encoding::ValueTypeMarker for WlanTxTransferRequest {
19517        type Borrowed<'a> = &'a Self;
19518        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
19519            value
19520        }
19521    }
19522
19523    unsafe impl fidl::encoding::TypeMarker for WlanTxTransferRequest {
19524        type Owned = Self;
19525
19526        #[inline(always)]
19527        fn inline_align(_context: fidl::encoding::Context) -> usize {
19528            8
19529        }
19530
19531        #[inline(always)]
19532        fn inline_size(_context: fidl::encoding::Context) -> usize {
19533            16
19534        }
19535    }
19536
19537    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxTransferRequest, D>
19538        for &WlanTxTransferRequest
19539    {
19540        unsafe fn encode(
19541            self,
19542            encoder: &mut fidl::encoding::Encoder<'_, D>,
19543            offset: usize,
19544            mut depth: fidl::encoding::Depth,
19545        ) -> fidl::Result<()> {
19546            encoder.debug_check_bounds::<WlanTxTransferRequest>(offset);
19547            // Vector header
19548            let max_ordinal: u64 = self.max_ordinal_present();
19549            encoder.write_num(max_ordinal, offset);
19550            encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
19551            // Calling encoder.out_of_line_offset(0) is not allowed.
19552            if max_ordinal == 0 {
19553                return Ok(());
19554            }
19555            depth.increment()?;
19556            let envelope_size = 8;
19557            let bytes_len = max_ordinal as usize * envelope_size;
19558            #[allow(unused_variables)]
19559            let offset = encoder.out_of_line_offset(bytes_len);
19560            let mut _prev_end_offset: usize = 0;
19561            if 1 > max_ordinal {
19562                return Ok(());
19563            }
19564
19565            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19566            // are envelope_size bytes.
19567            let cur_offset: usize = (1 - 1) * envelope_size;
19568
19569            // Zero reserved fields.
19570            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19571
19572            // Safety:
19573            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19574            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19575            //   envelope_size bytes, there is always sufficient room.
19576            fidl::encoding::encode_in_envelope_optional::<u64, D>(
19577                self.packet_address.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19578                encoder,
19579                offset + cur_offset,
19580                depth,
19581            )?;
19582
19583            _prev_end_offset = cur_offset + envelope_size;
19584            if 2 > max_ordinal {
19585                return Ok(());
19586            }
19587
19588            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19589            // are envelope_size bytes.
19590            let cur_offset: usize = (2 - 1) * envelope_size;
19591
19592            // Zero reserved fields.
19593            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19594
19595            // Safety:
19596            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19597            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19598            //   envelope_size bytes, there is always sufficient room.
19599            fidl::encoding::encode_in_envelope_optional::<u64, D>(
19600                self.packet_size.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19601                encoder,
19602                offset + cur_offset,
19603                depth,
19604            )?;
19605
19606            _prev_end_offset = cur_offset + envelope_size;
19607            if 3 > max_ordinal {
19608                return Ok(());
19609            }
19610
19611            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19612            // are envelope_size bytes.
19613            let cur_offset: usize = (3 - 1) * envelope_size;
19614
19615            // Zero reserved fields.
19616            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19617
19618            // Safety:
19619            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19620            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19621            //   envelope_size bytes, there is always sufficient room.
19622            fidl::encoding::encode_in_envelope_optional::<WlanTxInfo, D>(
19623                self.packet_info
19624                    .as_ref()
19625                    .map(<WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow),
19626                encoder,
19627                offset + cur_offset,
19628                depth,
19629            )?;
19630
19631            _prev_end_offset = cur_offset + envelope_size;
19632            if 4 > max_ordinal {
19633                return Ok(());
19634            }
19635
19636            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19637            // are envelope_size bytes.
19638            let cur_offset: usize = (4 - 1) * envelope_size;
19639
19640            // Zero reserved fields.
19641            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19642
19643            // Safety:
19644            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19645            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19646            //   envelope_size bytes, there is always sufficient room.
19647            fidl::encoding::encode_in_envelope_optional::<u64, D>(
19648                self.async_id.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19649                encoder,
19650                offset + cur_offset,
19651                depth,
19652            )?;
19653
19654            _prev_end_offset = cur_offset + envelope_size;
19655            if 5 > max_ordinal {
19656                return Ok(());
19657            }
19658
19659            // Write at offset+(ordinal-1)*envelope_size, since ordinals are one-based and envelopes
19660            // are envelope_size bytes.
19661            let cur_offset: usize = (5 - 1) * envelope_size;
19662
19663            // Zero reserved fields.
19664            encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
19665
19666            // Safety:
19667            // - bytes_len is calculated to fit envelope_size*max(member.ordinal).
19668            // - Since cur_offset is envelope_size*(member.ordinal - 1) and the envelope takes
19669            //   envelope_size bytes, there is always sufficient room.
19670            fidl::encoding::encode_in_envelope_optional::<u64, D>(
19671                self.arena.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
19672                encoder,
19673                offset + cur_offset,
19674                depth,
19675            )?;
19676
19677            _prev_end_offset = cur_offset + envelope_size;
19678
19679            Ok(())
19680        }
19681    }
19682
19683    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxTransferRequest {
19684        #[inline(always)]
19685        fn new_empty() -> Self {
19686            Self::default()
19687        }
19688
19689        unsafe fn decode(
19690            &mut self,
19691            decoder: &mut fidl::encoding::Decoder<'_, D>,
19692            offset: usize,
19693            mut depth: fidl::encoding::Depth,
19694        ) -> fidl::Result<()> {
19695            decoder.debug_check_bounds::<Self>(offset);
19696            let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
19697                None => return Err(fidl::Error::NotNullable),
19698                Some(len) => len,
19699            };
19700            // Calling decoder.out_of_line_offset(0) is not allowed.
19701            if len == 0 {
19702                return Ok(());
19703            };
19704            depth.increment()?;
19705            let envelope_size = 8;
19706            let bytes_len = len * envelope_size;
19707            let offset = decoder.out_of_line_offset(bytes_len)?;
19708            // Decode the envelope for each type.
19709            let mut _next_ordinal_to_read = 0;
19710            let mut next_offset = offset;
19711            let end_offset = offset + bytes_len;
19712            _next_ordinal_to_read += 1;
19713            if next_offset >= end_offset {
19714                return Ok(());
19715            }
19716
19717            // Decode unknown envelopes for gaps in ordinals.
19718            while _next_ordinal_to_read < 1 {
19719                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19720                _next_ordinal_to_read += 1;
19721                next_offset += envelope_size;
19722            }
19723
19724            let next_out_of_line = decoder.next_out_of_line();
19725            let handles_before = decoder.remaining_handles();
19726            if let Some((inlined, num_bytes, num_handles)) =
19727                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19728            {
19729                let member_inline_size =
19730                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19731                if inlined != (member_inline_size <= 4) {
19732                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19733                }
19734                let inner_offset;
19735                let mut inner_depth = depth.clone();
19736                if inlined {
19737                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19738                    inner_offset = next_offset;
19739                } else {
19740                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19741                    inner_depth.increment()?;
19742                }
19743                let val_ref = self.packet_address.get_or_insert_with(|| fidl::new_empty!(u64, D));
19744                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19745                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19746                {
19747                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19748                }
19749                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19750                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19751                }
19752            }
19753
19754            next_offset += envelope_size;
19755            _next_ordinal_to_read += 1;
19756            if next_offset >= end_offset {
19757                return Ok(());
19758            }
19759
19760            // Decode unknown envelopes for gaps in ordinals.
19761            while _next_ordinal_to_read < 2 {
19762                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19763                _next_ordinal_to_read += 1;
19764                next_offset += envelope_size;
19765            }
19766
19767            let next_out_of_line = decoder.next_out_of_line();
19768            let handles_before = decoder.remaining_handles();
19769            if let Some((inlined, num_bytes, num_handles)) =
19770                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19771            {
19772                let member_inline_size =
19773                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19774                if inlined != (member_inline_size <= 4) {
19775                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19776                }
19777                let inner_offset;
19778                let mut inner_depth = depth.clone();
19779                if inlined {
19780                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19781                    inner_offset = next_offset;
19782                } else {
19783                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19784                    inner_depth.increment()?;
19785                }
19786                let val_ref = self.packet_size.get_or_insert_with(|| fidl::new_empty!(u64, D));
19787                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19788                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19789                {
19790                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19791                }
19792                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19793                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19794                }
19795            }
19796
19797            next_offset += envelope_size;
19798            _next_ordinal_to_read += 1;
19799            if next_offset >= end_offset {
19800                return Ok(());
19801            }
19802
19803            // Decode unknown envelopes for gaps in ordinals.
19804            while _next_ordinal_to_read < 3 {
19805                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19806                _next_ordinal_to_read += 1;
19807                next_offset += envelope_size;
19808            }
19809
19810            let next_out_of_line = decoder.next_out_of_line();
19811            let handles_before = decoder.remaining_handles();
19812            if let Some((inlined, num_bytes, num_handles)) =
19813                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19814            {
19815                let member_inline_size =
19816                    <WlanTxInfo as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19817                if inlined != (member_inline_size <= 4) {
19818                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19819                }
19820                let inner_offset;
19821                let mut inner_depth = depth.clone();
19822                if inlined {
19823                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19824                    inner_offset = next_offset;
19825                } else {
19826                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19827                    inner_depth.increment()?;
19828                }
19829                let val_ref =
19830                    self.packet_info.get_or_insert_with(|| fidl::new_empty!(WlanTxInfo, D));
19831                fidl::decode!(WlanTxInfo, D, val_ref, decoder, inner_offset, inner_depth)?;
19832                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19833                {
19834                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19835                }
19836                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19837                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19838                }
19839            }
19840
19841            next_offset += envelope_size;
19842            _next_ordinal_to_read += 1;
19843            if next_offset >= end_offset {
19844                return Ok(());
19845            }
19846
19847            // Decode unknown envelopes for gaps in ordinals.
19848            while _next_ordinal_to_read < 4 {
19849                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19850                _next_ordinal_to_read += 1;
19851                next_offset += envelope_size;
19852            }
19853
19854            let next_out_of_line = decoder.next_out_of_line();
19855            let handles_before = decoder.remaining_handles();
19856            if let Some((inlined, num_bytes, num_handles)) =
19857                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19858            {
19859                let member_inline_size =
19860                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19861                if inlined != (member_inline_size <= 4) {
19862                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19863                }
19864                let inner_offset;
19865                let mut inner_depth = depth.clone();
19866                if inlined {
19867                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19868                    inner_offset = next_offset;
19869                } else {
19870                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19871                    inner_depth.increment()?;
19872                }
19873                let val_ref = self.async_id.get_or_insert_with(|| fidl::new_empty!(u64, D));
19874                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19875                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19876                {
19877                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19878                }
19879                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19880                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19881                }
19882            }
19883
19884            next_offset += envelope_size;
19885            _next_ordinal_to_read += 1;
19886            if next_offset >= end_offset {
19887                return Ok(());
19888            }
19889
19890            // Decode unknown envelopes for gaps in ordinals.
19891            while _next_ordinal_to_read < 5 {
19892                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19893                _next_ordinal_to_read += 1;
19894                next_offset += envelope_size;
19895            }
19896
19897            let next_out_of_line = decoder.next_out_of_line();
19898            let handles_before = decoder.remaining_handles();
19899            if let Some((inlined, num_bytes, num_handles)) =
19900                fidl::encoding::decode_envelope_header(decoder, next_offset)?
19901            {
19902                let member_inline_size =
19903                    <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
19904                if inlined != (member_inline_size <= 4) {
19905                    return Err(fidl::Error::InvalidInlineBitInEnvelope);
19906                }
19907                let inner_offset;
19908                let mut inner_depth = depth.clone();
19909                if inlined {
19910                    decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
19911                    inner_offset = next_offset;
19912                } else {
19913                    inner_offset = decoder.out_of_line_offset(member_inline_size)?;
19914                    inner_depth.increment()?;
19915                }
19916                let val_ref = self.arena.get_or_insert_with(|| fidl::new_empty!(u64, D));
19917                fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
19918                if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
19919                {
19920                    return Err(fidl::Error::InvalidNumBytesInEnvelope);
19921                }
19922                if handles_before != decoder.remaining_handles() + (num_handles as usize) {
19923                    return Err(fidl::Error::InvalidNumHandlesInEnvelope);
19924                }
19925            }
19926
19927            next_offset += envelope_size;
19928
19929            // Decode the remaining unknown envelopes.
19930            while next_offset < end_offset {
19931                _next_ordinal_to_read += 1;
19932                fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
19933                next_offset += envelope_size;
19934            }
19935
19936            Ok(())
19937        }
19938    }
19939}