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