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