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 type CapabilityInfo = u16;
16
17pub type WlanSoftmacHardwareCapability = u32;
18
19pub const MAX_BANDS: u8 = 16;
22
23pub const MAX_SUPPORTED_MAC_ROLES: u8 = 16;
26
27pub const MAX_SUPPORTED_PHY_TYPES: u8 = 64;
30
31pub const WLAN_MAC_MAX_EXT_RATES: u32 = 255;
32
33pub const WLAN_MAC_MAX_SUPP_RATES: u32 = 8;
40
41pub const WLAN_TX_RESULT_MAX_ENTRY: u32 = 8;
42
43pub const WLAN_TX_VECTOR_IDX_INVALID: u16 = 0;
44
45#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
46pub enum BssType {
47 Unknown,
48 Infrastructure,
49 Independent,
50 Mesh,
51 Personal,
52 #[doc(hidden)]
53 __SourceBreaking {
54 unknown_ordinal: u32,
55 },
56}
57
58#[macro_export]
60macro_rules! BssTypeUnknown {
61 () => {
62 _
63 };
64}
65
66impl BssType {
67 #[inline]
68 pub fn from_primitive(prim: u32) -> Option<Self> {
69 match prim {
70 0 => Some(Self::Unknown),
71 1 => Some(Self::Infrastructure),
72 2 => Some(Self::Independent),
73 3 => Some(Self::Mesh),
74 4 => Some(Self::Personal),
75 _ => None,
76 }
77 }
78
79 #[inline]
80 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
81 match prim {
82 0 => Self::Unknown,
83 1 => Self::Infrastructure,
84 2 => Self::Independent,
85 3 => Self::Mesh,
86 4 => Self::Personal,
87 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
88 }
89 }
90
91 #[inline]
92 pub fn unknown() -> Self {
93 Self::__SourceBreaking { unknown_ordinal: 0x0 }
94 }
95
96 #[inline]
97 pub const fn into_primitive(self) -> u32 {
98 match self {
99 Self::Unknown => 0,
100 Self::Infrastructure => 1,
101 Self::Independent => 2,
102 Self::Mesh => 3,
103 Self::Personal => 4,
104 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
105 }
106 }
107
108 #[inline]
109 pub fn is_unknown(&self) -> bool {
110 match self {
111 Self::__SourceBreaking { unknown_ordinal: _ } => true,
112 _ => false,
113 }
114 }
115}
116
117#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
118pub enum ChannelBandwidth {
119 Cbw20,
120 Cbw40,
121 Cbw40Below,
122 Cbw80,
123 Cbw160,
124 Cbw80P80,
125 #[doc(hidden)]
126 __SourceBreaking {
127 unknown_ordinal: u32,
128 },
129}
130
131#[macro_export]
133macro_rules! ChannelBandwidthUnknown {
134 () => {
135 _
136 };
137}
138
139impl ChannelBandwidth {
140 #[inline]
141 pub fn from_primitive(prim: u32) -> Option<Self> {
142 match prim {
143 1 => Some(Self::Cbw20),
144 2 => Some(Self::Cbw40),
145 3 => Some(Self::Cbw40Below),
146 4 => Some(Self::Cbw80),
147 5 => Some(Self::Cbw160),
148 6 => Some(Self::Cbw80P80),
149 _ => None,
150 }
151 }
152
153 #[inline]
154 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
155 match prim {
156 1 => Self::Cbw20,
157 2 => Self::Cbw40,
158 3 => Self::Cbw40Below,
159 4 => Self::Cbw80,
160 5 => Self::Cbw160,
161 6 => Self::Cbw80P80,
162 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
163 }
164 }
165
166 #[inline]
167 pub fn unknown() -> Self {
168 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
169 }
170
171 #[inline]
172 pub const fn into_primitive(self) -> u32 {
173 match self {
174 Self::Cbw20 => 1,
175 Self::Cbw40 => 2,
176 Self::Cbw40Below => 3,
177 Self::Cbw80 => 4,
178 Self::Cbw160 => 5,
179 Self::Cbw80P80 => 6,
180 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
181 }
182 }
183
184 #[inline]
185 pub fn is_unknown(&self) -> bool {
186 match self {
187 Self::__SourceBreaking { unknown_ordinal: _ } => true,
188 _ => false,
189 }
190 }
191}
192
193#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
195#[repr(u8)]
196pub enum DataPlaneType {
197 EthernetDevice = 1,
198 GenericNetworkDevice = 2,
199}
200
201impl DataPlaneType {
202 #[inline]
203 pub fn from_primitive(prim: u8) -> Option<Self> {
204 match prim {
205 1 => Some(Self::EthernetDevice),
206 2 => Some(Self::GenericNetworkDevice),
207 _ => None,
208 }
209 }
210
211 #[inline]
212 pub const fn into_primitive(self) -> u8 {
213 self as u8
214 }
215}
216
217#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
220#[repr(u8)]
221pub enum GuardInterval {
222 LongGi = 1,
223 ShortGi = 2,
224}
225
226impl GuardInterval {
227 #[inline]
228 pub fn from_primitive(prim: u8) -> Option<Self> {
229 match prim {
230 1 => Some(Self::LongGi),
231 2 => Some(Self::ShortGi),
232 _ => None,
233 }
234 }
235
236 #[inline]
237 pub const fn into_primitive(self) -> u8 {
238 self as u8
239 }
240}
241
242#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
244#[repr(u8)]
245pub enum MacImplementationType {
246 Softmac = 1,
247 Fullmac = 2,
248}
249
250impl MacImplementationType {
251 #[inline]
252 pub fn from_primitive(prim: u8) -> Option<Self> {
253 match prim {
254 1 => Some(Self::Softmac),
255 2 => Some(Self::Fullmac),
256 _ => None,
257 }
258 }
259
260 #[inline]
261 pub const fn into_primitive(self) -> u8 {
262 self as u8
263 }
264}
265
266#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
267#[repr(u32)]
268pub enum PowerSaveType {
269 PsModeUltraLowPower = 0,
270 PsModeLowPower = 1,
271 PsModeBalanced = 2,
272 PsModePerformance = 3,
273}
274
275impl PowerSaveType {
276 #[inline]
277 pub fn from_primitive(prim: u32) -> Option<Self> {
278 match prim {
279 0 => Some(Self::PsModeUltraLowPower),
280 1 => Some(Self::PsModeLowPower),
281 2 => Some(Self::PsModeBalanced),
282 3 => Some(Self::PsModePerformance),
283 _ => None,
284 }
285 }
286
287 #[inline]
288 pub const fn into_primitive(self) -> u32 {
289 self as u32
290 }
291}
292
293#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
294#[repr(u32)]
295pub enum ScanType {
296 Active = 1,
297 Passive = 2,
298}
299
300impl ScanType {
301 #[inline]
302 pub fn from_primitive(prim: u32) -> Option<Self> {
303 match prim {
304 1 => Some(Self::Active),
305 2 => Some(Self::Passive),
306 _ => None,
307 }
308 }
309
310 #[inline]
311 pub const fn into_primitive(self) -> u32 {
312 self as u32
313 }
314}
315
316#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
317pub enum WlanKeyType {
318 Pairwise,
319 Group,
320 Igtk,
321 Peer,
322 #[doc(hidden)]
323 __SourceBreaking {
324 unknown_ordinal: u8,
325 },
326}
327
328#[macro_export]
330macro_rules! WlanKeyTypeUnknown {
331 () => {
332 _
333 };
334}
335
336impl WlanKeyType {
337 #[inline]
338 pub fn from_primitive(prim: u8) -> Option<Self> {
339 match prim {
340 1 => Some(Self::Pairwise),
341 2 => Some(Self::Group),
342 3 => Some(Self::Igtk),
343 4 => Some(Self::Peer),
344 _ => None,
345 }
346 }
347
348 #[inline]
349 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
350 match prim {
351 1 => Self::Pairwise,
352 2 => Self::Group,
353 3 => Self::Igtk,
354 4 => Self::Peer,
355 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
356 }
357 }
358
359 #[inline]
360 pub fn unknown() -> Self {
361 Self::__SourceBreaking { unknown_ordinal: 0xff }
362 }
363
364 #[inline]
365 pub const fn into_primitive(self) -> u8 {
366 match self {
367 Self::Pairwise => 1,
368 Self::Group => 2,
369 Self::Igtk => 3,
370 Self::Peer => 4,
371 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
372 }
373 }
374
375 #[inline]
376 pub fn is_unknown(&self) -> bool {
377 match self {
378 Self::__SourceBreaking { unknown_ordinal: _ } => true,
379 _ => false,
380 }
381 }
382}
383
384#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
385pub enum WlanMacRole {
386 Client,
387 Ap,
388 Mesh,
389 #[doc(hidden)]
390 __SourceBreaking {
391 unknown_ordinal: u32,
392 },
393}
394
395#[macro_export]
397macro_rules! WlanMacRoleUnknown {
398 () => {
399 _
400 };
401}
402
403impl WlanMacRole {
404 #[inline]
405 pub fn from_primitive(prim: u32) -> Option<Self> {
406 match prim {
407 1 => Some(Self::Client),
408 2 => Some(Self::Ap),
409 3 => Some(Self::Mesh),
410 _ => None,
411 }
412 }
413
414 #[inline]
415 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
416 match prim {
417 1 => Self::Client,
418 2 => Self::Ap,
419 3 => Self::Mesh,
420 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
421 }
422 }
423
424 #[inline]
425 pub fn unknown() -> Self {
426 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
427 }
428
429 #[inline]
430 pub const fn into_primitive(self) -> u32 {
431 match self {
432 Self::Client => 1,
433 Self::Ap => 2,
434 Self::Mesh => 3,
435 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
436 }
437 }
438
439 #[inline]
440 pub fn is_unknown(&self) -> bool {
441 match self {
442 Self::__SourceBreaking { unknown_ordinal: _ } => true,
443 _ => false,
444 }
445 }
446}
447
448#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
451pub enum WlanPhyType {
452 Dsss,
456 Hr,
461 Ofdm,
465 Erp,
470 Ht,
474 Dmg,
477 Vht,
481 Tvht,
485 S1G,
488 Cdmg,
491 Cmmg,
494 He,
497 #[doc(hidden)]
498 __SourceBreaking { unknown_ordinal: u32 },
499}
500
501#[macro_export]
503macro_rules! WlanPhyTypeUnknown {
504 () => {
505 _
506 };
507}
508
509impl WlanPhyType {
510 #[inline]
511 pub fn from_primitive(prim: u32) -> Option<Self> {
512 match prim {
513 1 => Some(Self::Dsss),
514 2 => Some(Self::Hr),
515 3 => Some(Self::Ofdm),
516 4 => Some(Self::Erp),
517 5 => Some(Self::Ht),
518 6 => Some(Self::Dmg),
519 7 => Some(Self::Vht),
520 8 => Some(Self::Tvht),
521 9 => Some(Self::S1G),
522 10 => Some(Self::Cdmg),
523 11 => Some(Self::Cmmg),
524 12 => Some(Self::He),
525 _ => None,
526 }
527 }
528
529 #[inline]
530 pub fn from_primitive_allow_unknown(prim: u32) -> Self {
531 match prim {
532 1 => Self::Dsss,
533 2 => Self::Hr,
534 3 => Self::Ofdm,
535 4 => Self::Erp,
536 5 => Self::Ht,
537 6 => Self::Dmg,
538 7 => Self::Vht,
539 8 => Self::Tvht,
540 9 => Self::S1G,
541 10 => Self::Cdmg,
542 11 => Self::Cmmg,
543 12 => Self::He,
544 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
545 }
546 }
547
548 #[inline]
549 pub fn unknown() -> Self {
550 Self::__SourceBreaking { unknown_ordinal: 0xffffffff }
551 }
552
553 #[inline]
554 pub const fn into_primitive(self) -> u32 {
555 match self {
556 Self::Dsss => 1,
557 Self::Hr => 2,
558 Self::Ofdm => 3,
559 Self::Erp => 4,
560 Self::Ht => 5,
561 Self::Dmg => 6,
562 Self::Vht => 7,
563 Self::Tvht => 8,
564 Self::S1G => 9,
565 Self::Cdmg => 10,
566 Self::Cmmg => 11,
567 Self::He => 12,
568 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
569 }
570 }
571
572 #[inline]
573 pub fn is_unknown(&self) -> bool {
574 match self {
575 Self::__SourceBreaking { unknown_ordinal: _ } => true,
576 _ => false,
577 }
578 }
579}
580
581#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
582#[repr(u8)]
583pub enum WlanProtection {
584 None = 0,
585 Rx = 1,
586 Tx = 2,
587 RxTx = 3,
588}
589
590impl WlanProtection {
591 #[inline]
592 pub fn from_primitive(prim: u8) -> Option<Self> {
593 match prim {
594 0 => Some(Self::None),
595 1 => Some(Self::Rx),
596 2 => Some(Self::Tx),
597 3 => Some(Self::RxTx),
598 _ => None,
599 }
600 }
601
602 #[inline]
603 pub const fn into_primitive(self) -> u8 {
604 self as u8
605 }
606}
607
608#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
609#[repr(u32)]
610pub enum WlanSoftmacHardwareCapabilityBit {
611 ShortPreamble = 32,
613 SpectrumMgmt = 256,
615 Qos = 512,
616 ShortSlotTime = 1024,
618 RadioMsmt = 4096,
620 SimultaneousClientAp = 65536,
621}
622
623impl WlanSoftmacHardwareCapabilityBit {
624 #[inline]
625 pub fn from_primitive(prim: u32) -> Option<Self> {
626 match prim {
627 32 => Some(Self::ShortPreamble),
628 256 => Some(Self::SpectrumMgmt),
629 512 => Some(Self::Qos),
630 1024 => Some(Self::ShortSlotTime),
631 4096 => Some(Self::RadioMsmt),
632 65536 => Some(Self::SimultaneousClientAp),
633 _ => None,
634 }
635 }
636
637 #[inline]
638 pub const fn into_primitive(self) -> u32 {
639 self as u32
640 }
641}
642
643#[derive(Copy, Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
645pub enum WlanTxResultCode {
646 Failed,
648 Success,
650 #[doc(hidden)]
651 __SourceBreaking { unknown_ordinal: u8 },
652}
653
654#[macro_export]
656macro_rules! WlanTxResultCodeUnknown {
657 () => {
658 _
659 };
660}
661
662impl WlanTxResultCode {
663 #[inline]
664 pub fn from_primitive(prim: u8) -> Option<Self> {
665 match prim {
666 0 => Some(Self::Failed),
667 1 => Some(Self::Success),
668 _ => None,
669 }
670 }
671
672 #[inline]
673 pub fn from_primitive_allow_unknown(prim: u8) -> Self {
674 match prim {
675 0 => Self::Failed,
676 1 => Self::Success,
677 unknown_ordinal => Self::__SourceBreaking { unknown_ordinal },
678 }
679 }
680
681 #[inline]
682 pub fn unknown() -> Self {
683 Self::__SourceBreaking { unknown_ordinal: 0xff }
684 }
685
686 #[inline]
687 pub const fn into_primitive(self) -> u8 {
688 match self {
689 Self::Failed => 0,
690 Self::Success => 1,
691 Self::__SourceBreaking { unknown_ordinal } => unknown_ordinal,
692 }
693 }
694
695 #[inline]
696 pub fn is_unknown(&self) -> bool {
697 match self {
698 Self::__SourceBreaking { unknown_ordinal: _ } => true,
699 _ => false,
700 }
701 }
702}
703
704#[derive(Clone, Debug, PartialEq)]
715pub struct BssDescription {
716 pub bssid: [u8; 6],
717 pub bss_type: BssType,
718 pub beacon_period: u16,
719 pub capability_info: u16,
720 pub ies: Vec<u8>,
723 pub channel: fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
725 pub rssi_dbm: i8,
727 pub snr_db: i8,
729}
730
731impl fidl::Persistable for BssDescription {}
732
733#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
737pub struct DataPlaneExtension {
738 pub data_plane_type: DataPlaneType,
739}
740
741impl fidl::Persistable for DataPlaneExtension {}
742
743#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
747pub struct DeviceExtension {
748 pub is_synthetic: bool,
752 pub mac_implementation_type: MacImplementationType,
754 pub tx_status_report_supported: bool,
756}
757
758impl fidl::Persistable for DeviceExtension {}
759
760#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
764pub struct DfsFeature {
765 pub supported: bool,
770}
771
772impl fidl::Persistable for DfsFeature {}
773
774#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
777pub struct DiscoverySupport {
778 pub scan_offload: ScanOffloadExtension,
779 pub probe_response_offload: ProbeResponseOffloadExtension,
780}
781
782impl fidl::Persistable for DiscoverySupport {}
783
784#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
787pub struct MacSublayerSupport {
788 pub rate_selection_offload: RateSelectionOffloadExtension,
789 pub data_plane: DataPlaneExtension,
790 pub device: DeviceExtension,
791}
792
793impl fidl::Persistable for MacSublayerSupport {}
794
795#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
799pub struct MfpFeature {
800 pub supported: bool,
801}
802
803impl fidl::Persistable for MfpFeature {}
804
805#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
809pub struct ProbeResponseOffloadExtension {
810 pub supported: bool,
812}
813
814impl fidl::Persistable for ProbeResponseOffloadExtension {}
815
816#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
820pub struct RateSelectionOffloadExtension {
821 pub supported: bool,
823}
824
825impl fidl::Persistable for RateSelectionOffloadExtension {}
826
827#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
831pub struct SaeFeature {
832 pub driver_handler_supported: bool,
834 pub sme_handler_supported: bool,
836}
837
838impl fidl::Persistable for SaeFeature {}
839
840#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
844pub struct ScanOffloadExtension {
845 pub supported: bool,
847 pub scan_cancel_supported: bool,
848}
849
850impl fidl::Persistable for ScanOffloadExtension {}
851
852#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
855pub struct SecuritySupport {
856 pub sae: SaeFeature,
857 pub mfp: MfpFeature,
858}
859
860impl fidl::Persistable for SecuritySupport {}
861
862#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
865pub struct SpectrumManagementSupport {
866 pub dfs: DfsFeature,
867}
868
869impl fidl::Persistable for SpectrumManagementSupport {}
870
871#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
872pub struct WlanChannel {
873 pub primary: u8,
874 pub cbw: ChannelBandwidth,
875 pub secondary80: u8,
876}
877
878impl fidl::Persistable for WlanChannel {}
879
880#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
883pub struct WlanTxResult {
884 pub tx_result_entry: [WlanTxResultEntry; 8],
887 pub peer_addr: [u8; 6],
889 pub result_code: WlanTxResultCode,
890}
891
892impl fidl::Persistable for WlanTxResult {}
893
894#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
897#[repr(C)]
898pub struct WlanTxResultEntry {
899 pub tx_vector_idx: u16,
900 pub attempts: u8,
903}
904
905impl fidl::Persistable for WlanTxResultEntry {}
906
907#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
909pub struct WlanWmmAccessCategoryParameters {
910 pub ecw_min: u8,
914 pub ecw_max: u8,
918 pub aifsn: u8,
920 pub txop_limit: u16,
922 pub acm: bool,
924}
925
926impl fidl::Persistable for WlanWmmAccessCategoryParameters {}
927
928#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
929pub struct WlanWmmParameters {
930 pub apsd: bool,
931 pub ac_be_params: WlanWmmAccessCategoryParameters,
932 pub ac_bk_params: WlanWmmAccessCategoryParameters,
933 pub ac_vi_params: WlanWmmAccessCategoryParameters,
934 pub ac_vo_params: WlanWmmAccessCategoryParameters,
935}
936
937impl fidl::Persistable for WlanWmmParameters {}
938
939#[derive(Clone, Debug, Default, PartialEq)]
940pub struct JoinBssRequest {
941 pub bssid: Option<[u8; 6]>,
942 pub bss_type: Option<BssType>,
943 pub remote: Option<bool>,
944 pub beacon_period: Option<u16>,
945 #[doc(hidden)]
946 pub __source_breaking: fidl::marker::SourceBreaking,
947}
948
949impl fidl::Persistable for JoinBssRequest {}
950
951#[derive(Clone, Debug, Default, PartialEq)]
952pub struct WlanKeyConfig {
953 pub protection: Option<WlanProtection>,
955 pub cipher_oui: Option<[u8; 3]>,
959 pub cipher_type: Option<fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType>,
962 pub key_type: Option<WlanKeyType>,
965 pub peer_addr: Option<[u8; 6]>,
969 pub key_idx: Option<u8>,
977 pub key: Option<Vec<u8>>,
980 pub rsc: Option<u64>,
984 #[doc(hidden)]
985 pub __source_breaking: fidl::marker::SourceBreaking,
986}
987
988impl fidl::Persistable for WlanKeyConfig {}
989
990mod internal {
991 use super::*;
992 unsafe impl fidl::encoding::TypeMarker for BssType {
993 type Owned = Self;
994
995 #[inline(always)]
996 fn inline_align(_context: fidl::encoding::Context) -> usize {
997 std::mem::align_of::<u32>()
998 }
999
1000 #[inline(always)]
1001 fn inline_size(_context: fidl::encoding::Context) -> usize {
1002 std::mem::size_of::<u32>()
1003 }
1004
1005 #[inline(always)]
1006 fn encode_is_copy() -> bool {
1007 false
1008 }
1009
1010 #[inline(always)]
1011 fn decode_is_copy() -> bool {
1012 false
1013 }
1014 }
1015
1016 impl fidl::encoding::ValueTypeMarker for BssType {
1017 type Borrowed<'a> = Self;
1018 #[inline(always)]
1019 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1020 *value
1021 }
1022 }
1023
1024 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for BssType {
1025 #[inline]
1026 unsafe fn encode(
1027 self,
1028 encoder: &mut fidl::encoding::Encoder<'_, D>,
1029 offset: usize,
1030 _depth: fidl::encoding::Depth,
1031 ) -> fidl::Result<()> {
1032 encoder.debug_check_bounds::<Self>(offset);
1033 encoder.write_num(self.into_primitive(), offset);
1034 Ok(())
1035 }
1036 }
1037
1038 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BssType {
1039 #[inline(always)]
1040 fn new_empty() -> Self {
1041 Self::unknown()
1042 }
1043
1044 #[inline]
1045 unsafe fn decode(
1046 &mut self,
1047 decoder: &mut fidl::encoding::Decoder<'_, D>,
1048 offset: usize,
1049 _depth: fidl::encoding::Depth,
1050 ) -> fidl::Result<()> {
1051 decoder.debug_check_bounds::<Self>(offset);
1052 let prim = decoder.read_num::<u32>(offset);
1053
1054 *self = Self::from_primitive_allow_unknown(prim);
1055 Ok(())
1056 }
1057 }
1058 unsafe impl fidl::encoding::TypeMarker for ChannelBandwidth {
1059 type Owned = Self;
1060
1061 #[inline(always)]
1062 fn inline_align(_context: fidl::encoding::Context) -> usize {
1063 std::mem::align_of::<u32>()
1064 }
1065
1066 #[inline(always)]
1067 fn inline_size(_context: fidl::encoding::Context) -> usize {
1068 std::mem::size_of::<u32>()
1069 }
1070
1071 #[inline(always)]
1072 fn encode_is_copy() -> bool {
1073 false
1074 }
1075
1076 #[inline(always)]
1077 fn decode_is_copy() -> bool {
1078 false
1079 }
1080 }
1081
1082 impl fidl::encoding::ValueTypeMarker for ChannelBandwidth {
1083 type Borrowed<'a> = Self;
1084 #[inline(always)]
1085 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1086 *value
1087 }
1088 }
1089
1090 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1091 for ChannelBandwidth
1092 {
1093 #[inline]
1094 unsafe fn encode(
1095 self,
1096 encoder: &mut fidl::encoding::Encoder<'_, D>,
1097 offset: usize,
1098 _depth: fidl::encoding::Depth,
1099 ) -> fidl::Result<()> {
1100 encoder.debug_check_bounds::<Self>(offset);
1101 encoder.write_num(self.into_primitive(), offset);
1102 Ok(())
1103 }
1104 }
1105
1106 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ChannelBandwidth {
1107 #[inline(always)]
1108 fn new_empty() -> Self {
1109 Self::unknown()
1110 }
1111
1112 #[inline]
1113 unsafe fn decode(
1114 &mut self,
1115 decoder: &mut fidl::encoding::Decoder<'_, D>,
1116 offset: usize,
1117 _depth: fidl::encoding::Depth,
1118 ) -> fidl::Result<()> {
1119 decoder.debug_check_bounds::<Self>(offset);
1120 let prim = decoder.read_num::<u32>(offset);
1121
1122 *self = Self::from_primitive_allow_unknown(prim);
1123 Ok(())
1124 }
1125 }
1126 unsafe impl fidl::encoding::TypeMarker for DataPlaneType {
1127 type Owned = Self;
1128
1129 #[inline(always)]
1130 fn inline_align(_context: fidl::encoding::Context) -> usize {
1131 std::mem::align_of::<u8>()
1132 }
1133
1134 #[inline(always)]
1135 fn inline_size(_context: fidl::encoding::Context) -> usize {
1136 std::mem::size_of::<u8>()
1137 }
1138
1139 #[inline(always)]
1140 fn encode_is_copy() -> bool {
1141 true
1142 }
1143
1144 #[inline(always)]
1145 fn decode_is_copy() -> bool {
1146 false
1147 }
1148 }
1149
1150 impl fidl::encoding::ValueTypeMarker for DataPlaneType {
1151 type Borrowed<'a> = Self;
1152 #[inline(always)]
1153 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1154 *value
1155 }
1156 }
1157
1158 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for DataPlaneType {
1159 #[inline]
1160 unsafe fn encode(
1161 self,
1162 encoder: &mut fidl::encoding::Encoder<'_, D>,
1163 offset: usize,
1164 _depth: fidl::encoding::Depth,
1165 ) -> fidl::Result<()> {
1166 encoder.debug_check_bounds::<Self>(offset);
1167 encoder.write_num(self.into_primitive(), offset);
1168 Ok(())
1169 }
1170 }
1171
1172 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataPlaneType {
1173 #[inline(always)]
1174 fn new_empty() -> Self {
1175 Self::EthernetDevice
1176 }
1177
1178 #[inline]
1179 unsafe fn decode(
1180 &mut self,
1181 decoder: &mut fidl::encoding::Decoder<'_, D>,
1182 offset: usize,
1183 _depth: fidl::encoding::Depth,
1184 ) -> fidl::Result<()> {
1185 decoder.debug_check_bounds::<Self>(offset);
1186 let prim = decoder.read_num::<u8>(offset);
1187
1188 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1189 Ok(())
1190 }
1191 }
1192 unsafe impl fidl::encoding::TypeMarker for GuardInterval {
1193 type Owned = Self;
1194
1195 #[inline(always)]
1196 fn inline_align(_context: fidl::encoding::Context) -> usize {
1197 std::mem::align_of::<u8>()
1198 }
1199
1200 #[inline(always)]
1201 fn inline_size(_context: fidl::encoding::Context) -> usize {
1202 std::mem::size_of::<u8>()
1203 }
1204
1205 #[inline(always)]
1206 fn encode_is_copy() -> bool {
1207 true
1208 }
1209
1210 #[inline(always)]
1211 fn decode_is_copy() -> bool {
1212 false
1213 }
1214 }
1215
1216 impl fidl::encoding::ValueTypeMarker for GuardInterval {
1217 type Borrowed<'a> = Self;
1218 #[inline(always)]
1219 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1220 *value
1221 }
1222 }
1223
1224 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for GuardInterval {
1225 #[inline]
1226 unsafe fn encode(
1227 self,
1228 encoder: &mut fidl::encoding::Encoder<'_, D>,
1229 offset: usize,
1230 _depth: fidl::encoding::Depth,
1231 ) -> fidl::Result<()> {
1232 encoder.debug_check_bounds::<Self>(offset);
1233 encoder.write_num(self.into_primitive(), offset);
1234 Ok(())
1235 }
1236 }
1237
1238 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for GuardInterval {
1239 #[inline(always)]
1240 fn new_empty() -> Self {
1241 Self::LongGi
1242 }
1243
1244 #[inline]
1245 unsafe fn decode(
1246 &mut self,
1247 decoder: &mut fidl::encoding::Decoder<'_, D>,
1248 offset: usize,
1249 _depth: fidl::encoding::Depth,
1250 ) -> fidl::Result<()> {
1251 decoder.debug_check_bounds::<Self>(offset);
1252 let prim = decoder.read_num::<u8>(offset);
1253
1254 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1255 Ok(())
1256 }
1257 }
1258 unsafe impl fidl::encoding::TypeMarker for MacImplementationType {
1259 type Owned = Self;
1260
1261 #[inline(always)]
1262 fn inline_align(_context: fidl::encoding::Context) -> usize {
1263 std::mem::align_of::<u8>()
1264 }
1265
1266 #[inline(always)]
1267 fn inline_size(_context: fidl::encoding::Context) -> usize {
1268 std::mem::size_of::<u8>()
1269 }
1270
1271 #[inline(always)]
1272 fn encode_is_copy() -> bool {
1273 true
1274 }
1275
1276 #[inline(always)]
1277 fn decode_is_copy() -> bool {
1278 false
1279 }
1280 }
1281
1282 impl fidl::encoding::ValueTypeMarker for MacImplementationType {
1283 type Borrowed<'a> = Self;
1284 #[inline(always)]
1285 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1286 *value
1287 }
1288 }
1289
1290 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1291 for MacImplementationType
1292 {
1293 #[inline]
1294 unsafe fn encode(
1295 self,
1296 encoder: &mut fidl::encoding::Encoder<'_, D>,
1297 offset: usize,
1298 _depth: fidl::encoding::Depth,
1299 ) -> fidl::Result<()> {
1300 encoder.debug_check_bounds::<Self>(offset);
1301 encoder.write_num(self.into_primitive(), offset);
1302 Ok(())
1303 }
1304 }
1305
1306 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacImplementationType {
1307 #[inline(always)]
1308 fn new_empty() -> Self {
1309 Self::Softmac
1310 }
1311
1312 #[inline]
1313 unsafe fn decode(
1314 &mut self,
1315 decoder: &mut fidl::encoding::Decoder<'_, D>,
1316 offset: usize,
1317 _depth: fidl::encoding::Depth,
1318 ) -> fidl::Result<()> {
1319 decoder.debug_check_bounds::<Self>(offset);
1320 let prim = decoder.read_num::<u8>(offset);
1321
1322 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1323 Ok(())
1324 }
1325 }
1326 unsafe impl fidl::encoding::TypeMarker for PowerSaveType {
1327 type Owned = Self;
1328
1329 #[inline(always)]
1330 fn inline_align(_context: fidl::encoding::Context) -> usize {
1331 std::mem::align_of::<u32>()
1332 }
1333
1334 #[inline(always)]
1335 fn inline_size(_context: fidl::encoding::Context) -> usize {
1336 std::mem::size_of::<u32>()
1337 }
1338
1339 #[inline(always)]
1340 fn encode_is_copy() -> bool {
1341 true
1342 }
1343
1344 #[inline(always)]
1345 fn decode_is_copy() -> bool {
1346 false
1347 }
1348 }
1349
1350 impl fidl::encoding::ValueTypeMarker for PowerSaveType {
1351 type Borrowed<'a> = Self;
1352 #[inline(always)]
1353 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1354 *value
1355 }
1356 }
1357
1358 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for PowerSaveType {
1359 #[inline]
1360 unsafe fn encode(
1361 self,
1362 encoder: &mut fidl::encoding::Encoder<'_, D>,
1363 offset: usize,
1364 _depth: fidl::encoding::Depth,
1365 ) -> fidl::Result<()> {
1366 encoder.debug_check_bounds::<Self>(offset);
1367 encoder.write_num(self.into_primitive(), offset);
1368 Ok(())
1369 }
1370 }
1371
1372 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for PowerSaveType {
1373 #[inline(always)]
1374 fn new_empty() -> Self {
1375 Self::PsModeUltraLowPower
1376 }
1377
1378 #[inline]
1379 unsafe fn decode(
1380 &mut self,
1381 decoder: &mut fidl::encoding::Decoder<'_, D>,
1382 offset: usize,
1383 _depth: fidl::encoding::Depth,
1384 ) -> fidl::Result<()> {
1385 decoder.debug_check_bounds::<Self>(offset);
1386 let prim = decoder.read_num::<u32>(offset);
1387
1388 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1389 Ok(())
1390 }
1391 }
1392 unsafe impl fidl::encoding::TypeMarker for ScanType {
1393 type Owned = Self;
1394
1395 #[inline(always)]
1396 fn inline_align(_context: fidl::encoding::Context) -> usize {
1397 std::mem::align_of::<u32>()
1398 }
1399
1400 #[inline(always)]
1401 fn inline_size(_context: fidl::encoding::Context) -> usize {
1402 std::mem::size_of::<u32>()
1403 }
1404
1405 #[inline(always)]
1406 fn encode_is_copy() -> bool {
1407 true
1408 }
1409
1410 #[inline(always)]
1411 fn decode_is_copy() -> bool {
1412 false
1413 }
1414 }
1415
1416 impl fidl::encoding::ValueTypeMarker for ScanType {
1417 type Borrowed<'a> = Self;
1418 #[inline(always)]
1419 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1420 *value
1421 }
1422 }
1423
1424 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for ScanType {
1425 #[inline]
1426 unsafe fn encode(
1427 self,
1428 encoder: &mut fidl::encoding::Encoder<'_, D>,
1429 offset: usize,
1430 _depth: fidl::encoding::Depth,
1431 ) -> fidl::Result<()> {
1432 encoder.debug_check_bounds::<Self>(offset);
1433 encoder.write_num(self.into_primitive(), offset);
1434 Ok(())
1435 }
1436 }
1437
1438 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanType {
1439 #[inline(always)]
1440 fn new_empty() -> Self {
1441 Self::Active
1442 }
1443
1444 #[inline]
1445 unsafe fn decode(
1446 &mut self,
1447 decoder: &mut fidl::encoding::Decoder<'_, D>,
1448 offset: usize,
1449 _depth: fidl::encoding::Depth,
1450 ) -> fidl::Result<()> {
1451 decoder.debug_check_bounds::<Self>(offset);
1452 let prim = decoder.read_num::<u32>(offset);
1453
1454 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1455 Ok(())
1456 }
1457 }
1458 unsafe impl fidl::encoding::TypeMarker for WlanKeyType {
1459 type Owned = Self;
1460
1461 #[inline(always)]
1462 fn inline_align(_context: fidl::encoding::Context) -> usize {
1463 std::mem::align_of::<u8>()
1464 }
1465
1466 #[inline(always)]
1467 fn inline_size(_context: fidl::encoding::Context) -> usize {
1468 std::mem::size_of::<u8>()
1469 }
1470
1471 #[inline(always)]
1472 fn encode_is_copy() -> bool {
1473 false
1474 }
1475
1476 #[inline(always)]
1477 fn decode_is_copy() -> bool {
1478 false
1479 }
1480 }
1481
1482 impl fidl::encoding::ValueTypeMarker for WlanKeyType {
1483 type Borrowed<'a> = Self;
1484 #[inline(always)]
1485 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1486 *value
1487 }
1488 }
1489
1490 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanKeyType {
1491 #[inline]
1492 unsafe fn encode(
1493 self,
1494 encoder: &mut fidl::encoding::Encoder<'_, D>,
1495 offset: usize,
1496 _depth: fidl::encoding::Depth,
1497 ) -> fidl::Result<()> {
1498 encoder.debug_check_bounds::<Self>(offset);
1499 encoder.write_num(self.into_primitive(), offset);
1500 Ok(())
1501 }
1502 }
1503
1504 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyType {
1505 #[inline(always)]
1506 fn new_empty() -> Self {
1507 Self::unknown()
1508 }
1509
1510 #[inline]
1511 unsafe fn decode(
1512 &mut self,
1513 decoder: &mut fidl::encoding::Decoder<'_, D>,
1514 offset: usize,
1515 _depth: fidl::encoding::Depth,
1516 ) -> fidl::Result<()> {
1517 decoder.debug_check_bounds::<Self>(offset);
1518 let prim = decoder.read_num::<u8>(offset);
1519
1520 *self = Self::from_primitive_allow_unknown(prim);
1521 Ok(())
1522 }
1523 }
1524 unsafe impl fidl::encoding::TypeMarker for WlanMacRole {
1525 type Owned = Self;
1526
1527 #[inline(always)]
1528 fn inline_align(_context: fidl::encoding::Context) -> usize {
1529 std::mem::align_of::<u32>()
1530 }
1531
1532 #[inline(always)]
1533 fn inline_size(_context: fidl::encoding::Context) -> usize {
1534 std::mem::size_of::<u32>()
1535 }
1536
1537 #[inline(always)]
1538 fn encode_is_copy() -> bool {
1539 false
1540 }
1541
1542 #[inline(always)]
1543 fn decode_is_copy() -> bool {
1544 false
1545 }
1546 }
1547
1548 impl fidl::encoding::ValueTypeMarker for WlanMacRole {
1549 type Borrowed<'a> = Self;
1550 #[inline(always)]
1551 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1552 *value
1553 }
1554 }
1555
1556 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanMacRole {
1557 #[inline]
1558 unsafe fn encode(
1559 self,
1560 encoder: &mut fidl::encoding::Encoder<'_, D>,
1561 offset: usize,
1562 _depth: fidl::encoding::Depth,
1563 ) -> fidl::Result<()> {
1564 encoder.debug_check_bounds::<Self>(offset);
1565 encoder.write_num(self.into_primitive(), offset);
1566 Ok(())
1567 }
1568 }
1569
1570 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanMacRole {
1571 #[inline(always)]
1572 fn new_empty() -> Self {
1573 Self::unknown()
1574 }
1575
1576 #[inline]
1577 unsafe fn decode(
1578 &mut self,
1579 decoder: &mut fidl::encoding::Decoder<'_, D>,
1580 offset: usize,
1581 _depth: fidl::encoding::Depth,
1582 ) -> fidl::Result<()> {
1583 decoder.debug_check_bounds::<Self>(offset);
1584 let prim = decoder.read_num::<u32>(offset);
1585
1586 *self = Self::from_primitive_allow_unknown(prim);
1587 Ok(())
1588 }
1589 }
1590 unsafe impl fidl::encoding::TypeMarker for WlanPhyType {
1591 type Owned = Self;
1592
1593 #[inline(always)]
1594 fn inline_align(_context: fidl::encoding::Context) -> usize {
1595 std::mem::align_of::<u32>()
1596 }
1597
1598 #[inline(always)]
1599 fn inline_size(_context: fidl::encoding::Context) -> usize {
1600 std::mem::size_of::<u32>()
1601 }
1602
1603 #[inline(always)]
1604 fn encode_is_copy() -> bool {
1605 false
1606 }
1607
1608 #[inline(always)]
1609 fn decode_is_copy() -> bool {
1610 false
1611 }
1612 }
1613
1614 impl fidl::encoding::ValueTypeMarker for WlanPhyType {
1615 type Borrowed<'a> = Self;
1616 #[inline(always)]
1617 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1618 *value
1619 }
1620 }
1621
1622 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanPhyType {
1623 #[inline]
1624 unsafe fn encode(
1625 self,
1626 encoder: &mut fidl::encoding::Encoder<'_, D>,
1627 offset: usize,
1628 _depth: fidl::encoding::Depth,
1629 ) -> fidl::Result<()> {
1630 encoder.debug_check_bounds::<Self>(offset);
1631 encoder.write_num(self.into_primitive(), offset);
1632 Ok(())
1633 }
1634 }
1635
1636 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanPhyType {
1637 #[inline(always)]
1638 fn new_empty() -> Self {
1639 Self::unknown()
1640 }
1641
1642 #[inline]
1643 unsafe fn decode(
1644 &mut self,
1645 decoder: &mut fidl::encoding::Decoder<'_, D>,
1646 offset: usize,
1647 _depth: fidl::encoding::Depth,
1648 ) -> fidl::Result<()> {
1649 decoder.debug_check_bounds::<Self>(offset);
1650 let prim = decoder.read_num::<u32>(offset);
1651
1652 *self = Self::from_primitive_allow_unknown(prim);
1653 Ok(())
1654 }
1655 }
1656 unsafe impl fidl::encoding::TypeMarker for WlanProtection {
1657 type Owned = Self;
1658
1659 #[inline(always)]
1660 fn inline_align(_context: fidl::encoding::Context) -> usize {
1661 std::mem::align_of::<u8>()
1662 }
1663
1664 #[inline(always)]
1665 fn inline_size(_context: fidl::encoding::Context) -> usize {
1666 std::mem::size_of::<u8>()
1667 }
1668
1669 #[inline(always)]
1670 fn encode_is_copy() -> bool {
1671 true
1672 }
1673
1674 #[inline(always)]
1675 fn decode_is_copy() -> bool {
1676 false
1677 }
1678 }
1679
1680 impl fidl::encoding::ValueTypeMarker for WlanProtection {
1681 type Borrowed<'a> = Self;
1682 #[inline(always)]
1683 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1684 *value
1685 }
1686 }
1687
1688 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D> for WlanProtection {
1689 #[inline]
1690 unsafe fn encode(
1691 self,
1692 encoder: &mut fidl::encoding::Encoder<'_, D>,
1693 offset: usize,
1694 _depth: fidl::encoding::Depth,
1695 ) -> fidl::Result<()> {
1696 encoder.debug_check_bounds::<Self>(offset);
1697 encoder.write_num(self.into_primitive(), offset);
1698 Ok(())
1699 }
1700 }
1701
1702 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanProtection {
1703 #[inline(always)]
1704 fn new_empty() -> Self {
1705 Self::None
1706 }
1707
1708 #[inline]
1709 unsafe fn decode(
1710 &mut self,
1711 decoder: &mut fidl::encoding::Decoder<'_, D>,
1712 offset: usize,
1713 _depth: fidl::encoding::Depth,
1714 ) -> fidl::Result<()> {
1715 decoder.debug_check_bounds::<Self>(offset);
1716 let prim = decoder.read_num::<u8>(offset);
1717
1718 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1719 Ok(())
1720 }
1721 }
1722 unsafe impl fidl::encoding::TypeMarker for WlanSoftmacHardwareCapabilityBit {
1723 type Owned = Self;
1724
1725 #[inline(always)]
1726 fn inline_align(_context: fidl::encoding::Context) -> usize {
1727 std::mem::align_of::<u32>()
1728 }
1729
1730 #[inline(always)]
1731 fn inline_size(_context: fidl::encoding::Context) -> usize {
1732 std::mem::size_of::<u32>()
1733 }
1734
1735 #[inline(always)]
1736 fn encode_is_copy() -> bool {
1737 true
1738 }
1739
1740 #[inline(always)]
1741 fn decode_is_copy() -> bool {
1742 false
1743 }
1744 }
1745
1746 impl fidl::encoding::ValueTypeMarker for WlanSoftmacHardwareCapabilityBit {
1747 type Borrowed<'a> = Self;
1748 #[inline(always)]
1749 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1750 *value
1751 }
1752 }
1753
1754 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1755 for WlanSoftmacHardwareCapabilityBit
1756 {
1757 #[inline]
1758 unsafe fn encode(
1759 self,
1760 encoder: &mut fidl::encoding::Encoder<'_, D>,
1761 offset: usize,
1762 _depth: fidl::encoding::Depth,
1763 ) -> fidl::Result<()> {
1764 encoder.debug_check_bounds::<Self>(offset);
1765 encoder.write_num(self.into_primitive(), offset);
1766 Ok(())
1767 }
1768 }
1769
1770 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1771 for WlanSoftmacHardwareCapabilityBit
1772 {
1773 #[inline(always)]
1774 fn new_empty() -> Self {
1775 Self::ShortPreamble
1776 }
1777
1778 #[inline]
1779 unsafe fn decode(
1780 &mut self,
1781 decoder: &mut fidl::encoding::Decoder<'_, D>,
1782 offset: usize,
1783 _depth: fidl::encoding::Depth,
1784 ) -> fidl::Result<()> {
1785 decoder.debug_check_bounds::<Self>(offset);
1786 let prim = decoder.read_num::<u32>(offset);
1787
1788 *self = Self::from_primitive(prim).ok_or(fidl::Error::InvalidEnumValue)?;
1789 Ok(())
1790 }
1791 }
1792 unsafe impl fidl::encoding::TypeMarker for WlanTxResultCode {
1793 type Owned = Self;
1794
1795 #[inline(always)]
1796 fn inline_align(_context: fidl::encoding::Context) -> usize {
1797 std::mem::align_of::<u8>()
1798 }
1799
1800 #[inline(always)]
1801 fn inline_size(_context: fidl::encoding::Context) -> usize {
1802 std::mem::size_of::<u8>()
1803 }
1804
1805 #[inline(always)]
1806 fn encode_is_copy() -> bool {
1807 false
1808 }
1809
1810 #[inline(always)]
1811 fn decode_is_copy() -> bool {
1812 false
1813 }
1814 }
1815
1816 impl fidl::encoding::ValueTypeMarker for WlanTxResultCode {
1817 type Borrowed<'a> = Self;
1818 #[inline(always)]
1819 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1820 *value
1821 }
1822 }
1823
1824 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<Self, D>
1825 for WlanTxResultCode
1826 {
1827 #[inline]
1828 unsafe fn encode(
1829 self,
1830 encoder: &mut fidl::encoding::Encoder<'_, D>,
1831 offset: usize,
1832 _depth: fidl::encoding::Depth,
1833 ) -> fidl::Result<()> {
1834 encoder.debug_check_bounds::<Self>(offset);
1835 encoder.write_num(self.into_primitive(), offset);
1836 Ok(())
1837 }
1838 }
1839
1840 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResultCode {
1841 #[inline(always)]
1842 fn new_empty() -> Self {
1843 Self::unknown()
1844 }
1845
1846 #[inline]
1847 unsafe fn decode(
1848 &mut self,
1849 decoder: &mut fidl::encoding::Decoder<'_, D>,
1850 offset: usize,
1851 _depth: fidl::encoding::Depth,
1852 ) -> fidl::Result<()> {
1853 decoder.debug_check_bounds::<Self>(offset);
1854 let prim = decoder.read_num::<u8>(offset);
1855
1856 *self = Self::from_primitive_allow_unknown(prim);
1857 Ok(())
1858 }
1859 }
1860
1861 impl fidl::encoding::ValueTypeMarker for BssDescription {
1862 type Borrowed<'a> = &'a Self;
1863 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1864 value
1865 }
1866 }
1867
1868 unsafe impl fidl::encoding::TypeMarker for BssDescription {
1869 type Owned = Self;
1870
1871 #[inline(always)]
1872 fn inline_align(_context: fidl::encoding::Context) -> usize {
1873 8
1874 }
1875
1876 #[inline(always)]
1877 fn inline_size(_context: fidl::encoding::Context) -> usize {
1878 48
1879 }
1880 }
1881
1882 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<BssDescription, D>
1883 for &BssDescription
1884 {
1885 #[inline]
1886 unsafe fn encode(
1887 self,
1888 encoder: &mut fidl::encoding::Encoder<'_, D>,
1889 offset: usize,
1890 _depth: fidl::encoding::Depth,
1891 ) -> fidl::Result<()> {
1892 encoder.debug_check_bounds::<BssDescription>(offset);
1893 fidl::encoding::Encode::<BssDescription, D>::encode(
1895 (
1896 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.bssid),
1897 <BssType as fidl::encoding::ValueTypeMarker>::borrow(&self.bss_type),
1898 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.beacon_period),
1899 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.capability_info),
1900 <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.ies),
1901 <fidl_fuchsia_wlan_ieee80211__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
1902 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
1903 <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_db),
1904 ),
1905 encoder, offset, _depth
1906 )
1907 }
1908 }
1909 unsafe impl<
1910 D: fidl::encoding::ResourceDialect,
1911 T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
1912 T1: fidl::encoding::Encode<BssType, D>,
1913 T2: fidl::encoding::Encode<u16, D>,
1914 T3: fidl::encoding::Encode<u16, D>,
1915 T4: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1916 T5: fidl::encoding::Encode<fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D>,
1917 T6: fidl::encoding::Encode<i8, D>,
1918 T7: fidl::encoding::Encode<i8, D>,
1919 > fidl::encoding::Encode<BssDescription, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
1920 {
1921 #[inline]
1922 unsafe fn encode(
1923 self,
1924 encoder: &mut fidl::encoding::Encoder<'_, D>,
1925 offset: usize,
1926 depth: fidl::encoding::Depth,
1927 ) -> fidl::Result<()> {
1928 encoder.debug_check_bounds::<BssDescription>(offset);
1929 unsafe {
1932 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1933 (ptr as *mut u64).write_unaligned(0);
1934 }
1935 unsafe {
1936 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(40);
1937 (ptr as *mut u64).write_unaligned(0);
1938 }
1939 self.0.encode(encoder, offset + 0, depth)?;
1941 self.1.encode(encoder, offset + 8, depth)?;
1942 self.2.encode(encoder, offset + 12, depth)?;
1943 self.3.encode(encoder, offset + 14, depth)?;
1944 self.4.encode(encoder, offset + 16, depth)?;
1945 self.5.encode(encoder, offset + 32, depth)?;
1946 self.6.encode(encoder, offset + 44, depth)?;
1947 self.7.encode(encoder, offset + 45, depth)?;
1948 Ok(())
1949 }
1950 }
1951
1952 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for BssDescription {
1953 #[inline(always)]
1954 fn new_empty() -> Self {
1955 Self {
1956 bssid: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
1957 bss_type: fidl::new_empty!(BssType, D),
1958 beacon_period: fidl::new_empty!(u16, D),
1959 capability_info: fidl::new_empty!(u16, D),
1960 ies: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1961 channel: fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::WlanChannel, D),
1962 rssi_dbm: fidl::new_empty!(i8, D),
1963 snr_db: fidl::new_empty!(i8, D),
1964 }
1965 }
1966
1967 #[inline]
1968 unsafe fn decode(
1969 &mut self,
1970 decoder: &mut fidl::encoding::Decoder<'_, D>,
1971 offset: usize,
1972 _depth: fidl::encoding::Depth,
1973 ) -> fidl::Result<()> {
1974 decoder.debug_check_bounds::<Self>(offset);
1975 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1977 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1978 let mask = 0xffff000000000000u64;
1979 let maskedval = padval & mask;
1980 if maskedval != 0 {
1981 return Err(fidl::Error::NonZeroPadding {
1982 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1983 });
1984 }
1985 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(40) };
1986 let padval = unsafe { (ptr as *const u64).read_unaligned() };
1987 let mask = 0xffff000000000000u64;
1988 let maskedval = padval & mask;
1989 if maskedval != 0 {
1990 return Err(fidl::Error::NonZeroPadding {
1991 padding_start: offset + 40 + ((mask as u64).trailing_zeros() / 8) as usize,
1992 });
1993 }
1994 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.bssid, decoder, offset + 0, _depth)?;
1995 fidl::decode!(BssType, D, &mut self.bss_type, decoder, offset + 8, _depth)?;
1996 fidl::decode!(u16, D, &mut self.beacon_period, decoder, offset + 12, _depth)?;
1997 fidl::decode!(u16, D, &mut self.capability_info, decoder, offset + 14, _depth)?;
1998 fidl::decode!(
1999 fidl::encoding::UnboundedVector<u8>,
2000 D,
2001 &mut self.ies,
2002 decoder,
2003 offset + 16,
2004 _depth
2005 )?;
2006 fidl::decode!(
2007 fidl_fuchsia_wlan_ieee80211__common::WlanChannel,
2008 D,
2009 &mut self.channel,
2010 decoder,
2011 offset + 32,
2012 _depth
2013 )?;
2014 fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 44, _depth)?;
2015 fidl::decode!(i8, D, &mut self.snr_db, decoder, offset + 45, _depth)?;
2016 Ok(())
2017 }
2018 }
2019
2020 impl fidl::encoding::ValueTypeMarker for DataPlaneExtension {
2021 type Borrowed<'a> = &'a Self;
2022 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2023 value
2024 }
2025 }
2026
2027 unsafe impl fidl::encoding::TypeMarker for DataPlaneExtension {
2028 type Owned = Self;
2029
2030 #[inline(always)]
2031 fn inline_align(_context: fidl::encoding::Context) -> usize {
2032 1
2033 }
2034
2035 #[inline(always)]
2036 fn inline_size(_context: fidl::encoding::Context) -> usize {
2037 1
2038 }
2039 }
2040
2041 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DataPlaneExtension, D>
2042 for &DataPlaneExtension
2043 {
2044 #[inline]
2045 unsafe fn encode(
2046 self,
2047 encoder: &mut fidl::encoding::Encoder<'_, D>,
2048 offset: usize,
2049 _depth: fidl::encoding::Depth,
2050 ) -> fidl::Result<()> {
2051 encoder.debug_check_bounds::<DataPlaneExtension>(offset);
2052 fidl::encoding::Encode::<DataPlaneExtension, D>::encode(
2054 (<DataPlaneType as fidl::encoding::ValueTypeMarker>::borrow(&self.data_plane_type),),
2055 encoder,
2056 offset,
2057 _depth,
2058 )
2059 }
2060 }
2061 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DataPlaneType, D>>
2062 fidl::encoding::Encode<DataPlaneExtension, D> for (T0,)
2063 {
2064 #[inline]
2065 unsafe fn encode(
2066 self,
2067 encoder: &mut fidl::encoding::Encoder<'_, D>,
2068 offset: usize,
2069 depth: fidl::encoding::Depth,
2070 ) -> fidl::Result<()> {
2071 encoder.debug_check_bounds::<DataPlaneExtension>(offset);
2072 self.0.encode(encoder, offset + 0, depth)?;
2076 Ok(())
2077 }
2078 }
2079
2080 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DataPlaneExtension {
2081 #[inline(always)]
2082 fn new_empty() -> Self {
2083 Self { data_plane_type: fidl::new_empty!(DataPlaneType, D) }
2084 }
2085
2086 #[inline]
2087 unsafe fn decode(
2088 &mut self,
2089 decoder: &mut fidl::encoding::Decoder<'_, D>,
2090 offset: usize,
2091 _depth: fidl::encoding::Depth,
2092 ) -> fidl::Result<()> {
2093 decoder.debug_check_bounds::<Self>(offset);
2094 fidl::decode!(
2096 DataPlaneType,
2097 D,
2098 &mut self.data_plane_type,
2099 decoder,
2100 offset + 0,
2101 _depth
2102 )?;
2103 Ok(())
2104 }
2105 }
2106
2107 impl fidl::encoding::ValueTypeMarker for DeviceExtension {
2108 type Borrowed<'a> = &'a Self;
2109 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2110 value
2111 }
2112 }
2113
2114 unsafe impl fidl::encoding::TypeMarker for DeviceExtension {
2115 type Owned = Self;
2116
2117 #[inline(always)]
2118 fn inline_align(_context: fidl::encoding::Context) -> usize {
2119 1
2120 }
2121
2122 #[inline(always)]
2123 fn inline_size(_context: fidl::encoding::Context) -> usize {
2124 3
2125 }
2126 }
2127
2128 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DeviceExtension, D>
2129 for &DeviceExtension
2130 {
2131 #[inline]
2132 unsafe fn encode(
2133 self,
2134 encoder: &mut fidl::encoding::Encoder<'_, D>,
2135 offset: usize,
2136 _depth: fidl::encoding::Depth,
2137 ) -> fidl::Result<()> {
2138 encoder.debug_check_bounds::<DeviceExtension>(offset);
2139 fidl::encoding::Encode::<DeviceExtension, D>::encode(
2141 (
2142 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.is_synthetic),
2143 <MacImplementationType as fidl::encoding::ValueTypeMarker>::borrow(
2144 &self.mac_implementation_type,
2145 ),
2146 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2147 &self.tx_status_report_supported,
2148 ),
2149 ),
2150 encoder,
2151 offset,
2152 _depth,
2153 )
2154 }
2155 }
2156 unsafe impl<
2157 D: fidl::encoding::ResourceDialect,
2158 T0: fidl::encoding::Encode<bool, D>,
2159 T1: fidl::encoding::Encode<MacImplementationType, D>,
2160 T2: fidl::encoding::Encode<bool, D>,
2161 > fidl::encoding::Encode<DeviceExtension, D> for (T0, T1, T2)
2162 {
2163 #[inline]
2164 unsafe fn encode(
2165 self,
2166 encoder: &mut fidl::encoding::Encoder<'_, D>,
2167 offset: usize,
2168 depth: fidl::encoding::Depth,
2169 ) -> fidl::Result<()> {
2170 encoder.debug_check_bounds::<DeviceExtension>(offset);
2171 self.0.encode(encoder, offset + 0, depth)?;
2175 self.1.encode(encoder, offset + 1, depth)?;
2176 self.2.encode(encoder, offset + 2, depth)?;
2177 Ok(())
2178 }
2179 }
2180
2181 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DeviceExtension {
2182 #[inline(always)]
2183 fn new_empty() -> Self {
2184 Self {
2185 is_synthetic: fidl::new_empty!(bool, D),
2186 mac_implementation_type: fidl::new_empty!(MacImplementationType, D),
2187 tx_status_report_supported: fidl::new_empty!(bool, D),
2188 }
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!(bool, D, &mut self.is_synthetic, decoder, offset + 0, _depth)?;
2201 fidl::decode!(
2202 MacImplementationType,
2203 D,
2204 &mut self.mac_implementation_type,
2205 decoder,
2206 offset + 1,
2207 _depth
2208 )?;
2209 fidl::decode!(
2210 bool,
2211 D,
2212 &mut self.tx_status_report_supported,
2213 decoder,
2214 offset + 2,
2215 _depth
2216 )?;
2217 Ok(())
2218 }
2219 }
2220
2221 impl fidl::encoding::ValueTypeMarker for DfsFeature {
2222 type Borrowed<'a> = &'a Self;
2223 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2224 value
2225 }
2226 }
2227
2228 unsafe impl fidl::encoding::TypeMarker for DfsFeature {
2229 type Owned = Self;
2230
2231 #[inline(always)]
2232 fn inline_align(_context: fidl::encoding::Context) -> usize {
2233 1
2234 }
2235
2236 #[inline(always)]
2237 fn inline_size(_context: fidl::encoding::Context) -> usize {
2238 1
2239 }
2240 }
2241
2242 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DfsFeature, D>
2243 for &DfsFeature
2244 {
2245 #[inline]
2246 unsafe fn encode(
2247 self,
2248 encoder: &mut fidl::encoding::Encoder<'_, D>,
2249 offset: usize,
2250 _depth: fidl::encoding::Depth,
2251 ) -> fidl::Result<()> {
2252 encoder.debug_check_bounds::<DfsFeature>(offset);
2253 fidl::encoding::Encode::<DfsFeature, D>::encode(
2255 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2256 encoder,
2257 offset,
2258 _depth,
2259 )
2260 }
2261 }
2262 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2263 fidl::encoding::Encode<DfsFeature, D> for (T0,)
2264 {
2265 #[inline]
2266 unsafe fn encode(
2267 self,
2268 encoder: &mut fidl::encoding::Encoder<'_, D>,
2269 offset: usize,
2270 depth: fidl::encoding::Depth,
2271 ) -> fidl::Result<()> {
2272 encoder.debug_check_bounds::<DfsFeature>(offset);
2273 self.0.encode(encoder, offset + 0, depth)?;
2277 Ok(())
2278 }
2279 }
2280
2281 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DfsFeature {
2282 #[inline(always)]
2283 fn new_empty() -> Self {
2284 Self { supported: fidl::new_empty!(bool, D) }
2285 }
2286
2287 #[inline]
2288 unsafe fn decode(
2289 &mut self,
2290 decoder: &mut fidl::encoding::Decoder<'_, D>,
2291 offset: usize,
2292 _depth: fidl::encoding::Depth,
2293 ) -> fidl::Result<()> {
2294 decoder.debug_check_bounds::<Self>(offset);
2295 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2297 Ok(())
2298 }
2299 }
2300
2301 impl fidl::encoding::ValueTypeMarker for DiscoverySupport {
2302 type Borrowed<'a> = &'a Self;
2303 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2304 value
2305 }
2306 }
2307
2308 unsafe impl fidl::encoding::TypeMarker for DiscoverySupport {
2309 type Owned = Self;
2310
2311 #[inline(always)]
2312 fn inline_align(_context: fidl::encoding::Context) -> usize {
2313 1
2314 }
2315
2316 #[inline(always)]
2317 fn inline_size(_context: fidl::encoding::Context) -> usize {
2318 3
2319 }
2320 }
2321
2322 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<DiscoverySupport, D>
2323 for &DiscoverySupport
2324 {
2325 #[inline]
2326 unsafe fn encode(
2327 self,
2328 encoder: &mut fidl::encoding::Encoder<'_, D>,
2329 offset: usize,
2330 _depth: fidl::encoding::Depth,
2331 ) -> fidl::Result<()> {
2332 encoder.debug_check_bounds::<DiscoverySupport>(offset);
2333 fidl::encoding::Encode::<DiscoverySupport, D>::encode(
2335 (
2336 <ScanOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2337 &self.scan_offload,
2338 ),
2339 <ProbeResponseOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2340 &self.probe_response_offload,
2341 ),
2342 ),
2343 encoder,
2344 offset,
2345 _depth,
2346 )
2347 }
2348 }
2349 unsafe impl<
2350 D: fidl::encoding::ResourceDialect,
2351 T0: fidl::encoding::Encode<ScanOffloadExtension, D>,
2352 T1: fidl::encoding::Encode<ProbeResponseOffloadExtension, D>,
2353 > fidl::encoding::Encode<DiscoverySupport, D> for (T0, T1)
2354 {
2355 #[inline]
2356 unsafe fn encode(
2357 self,
2358 encoder: &mut fidl::encoding::Encoder<'_, D>,
2359 offset: usize,
2360 depth: fidl::encoding::Depth,
2361 ) -> fidl::Result<()> {
2362 encoder.debug_check_bounds::<DiscoverySupport>(offset);
2363 self.0.encode(encoder, offset + 0, depth)?;
2367 self.1.encode(encoder, offset + 2, depth)?;
2368 Ok(())
2369 }
2370 }
2371
2372 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for DiscoverySupport {
2373 #[inline(always)]
2374 fn new_empty() -> Self {
2375 Self {
2376 scan_offload: fidl::new_empty!(ScanOffloadExtension, D),
2377 probe_response_offload: fidl::new_empty!(ProbeResponseOffloadExtension, D),
2378 }
2379 }
2380
2381 #[inline]
2382 unsafe fn decode(
2383 &mut self,
2384 decoder: &mut fidl::encoding::Decoder<'_, D>,
2385 offset: usize,
2386 _depth: fidl::encoding::Depth,
2387 ) -> fidl::Result<()> {
2388 decoder.debug_check_bounds::<Self>(offset);
2389 fidl::decode!(
2391 ScanOffloadExtension,
2392 D,
2393 &mut self.scan_offload,
2394 decoder,
2395 offset + 0,
2396 _depth
2397 )?;
2398 fidl::decode!(
2399 ProbeResponseOffloadExtension,
2400 D,
2401 &mut self.probe_response_offload,
2402 decoder,
2403 offset + 2,
2404 _depth
2405 )?;
2406 Ok(())
2407 }
2408 }
2409
2410 impl fidl::encoding::ValueTypeMarker for MacSublayerSupport {
2411 type Borrowed<'a> = &'a Self;
2412 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2413 value
2414 }
2415 }
2416
2417 unsafe impl fidl::encoding::TypeMarker for MacSublayerSupport {
2418 type Owned = Self;
2419
2420 #[inline(always)]
2421 fn inline_align(_context: fidl::encoding::Context) -> usize {
2422 1
2423 }
2424
2425 #[inline(always)]
2426 fn inline_size(_context: fidl::encoding::Context) -> usize {
2427 5
2428 }
2429 }
2430
2431 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MacSublayerSupport, D>
2432 for &MacSublayerSupport
2433 {
2434 #[inline]
2435 unsafe fn encode(
2436 self,
2437 encoder: &mut fidl::encoding::Encoder<'_, D>,
2438 offset: usize,
2439 _depth: fidl::encoding::Depth,
2440 ) -> fidl::Result<()> {
2441 encoder.debug_check_bounds::<MacSublayerSupport>(offset);
2442 fidl::encoding::Encode::<MacSublayerSupport, D>::encode(
2444 (
2445 <RateSelectionOffloadExtension as fidl::encoding::ValueTypeMarker>::borrow(
2446 &self.rate_selection_offload,
2447 ),
2448 <DataPlaneExtension as fidl::encoding::ValueTypeMarker>::borrow(
2449 &self.data_plane,
2450 ),
2451 <DeviceExtension as fidl::encoding::ValueTypeMarker>::borrow(&self.device),
2452 ),
2453 encoder,
2454 offset,
2455 _depth,
2456 )
2457 }
2458 }
2459 unsafe impl<
2460 D: fidl::encoding::ResourceDialect,
2461 T0: fidl::encoding::Encode<RateSelectionOffloadExtension, D>,
2462 T1: fidl::encoding::Encode<DataPlaneExtension, D>,
2463 T2: fidl::encoding::Encode<DeviceExtension, D>,
2464 > fidl::encoding::Encode<MacSublayerSupport, D> for (T0, T1, T2)
2465 {
2466 #[inline]
2467 unsafe fn encode(
2468 self,
2469 encoder: &mut fidl::encoding::Encoder<'_, D>,
2470 offset: usize,
2471 depth: fidl::encoding::Depth,
2472 ) -> fidl::Result<()> {
2473 encoder.debug_check_bounds::<MacSublayerSupport>(offset);
2474 self.0.encode(encoder, offset + 0, depth)?;
2478 self.1.encode(encoder, offset + 1, depth)?;
2479 self.2.encode(encoder, offset + 2, depth)?;
2480 Ok(())
2481 }
2482 }
2483
2484 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MacSublayerSupport {
2485 #[inline(always)]
2486 fn new_empty() -> Self {
2487 Self {
2488 rate_selection_offload: fidl::new_empty!(RateSelectionOffloadExtension, D),
2489 data_plane: fidl::new_empty!(DataPlaneExtension, D),
2490 device: fidl::new_empty!(DeviceExtension, D),
2491 }
2492 }
2493
2494 #[inline]
2495 unsafe fn decode(
2496 &mut self,
2497 decoder: &mut fidl::encoding::Decoder<'_, D>,
2498 offset: usize,
2499 _depth: fidl::encoding::Depth,
2500 ) -> fidl::Result<()> {
2501 decoder.debug_check_bounds::<Self>(offset);
2502 fidl::decode!(
2504 RateSelectionOffloadExtension,
2505 D,
2506 &mut self.rate_selection_offload,
2507 decoder,
2508 offset + 0,
2509 _depth
2510 )?;
2511 fidl::decode!(
2512 DataPlaneExtension,
2513 D,
2514 &mut self.data_plane,
2515 decoder,
2516 offset + 1,
2517 _depth
2518 )?;
2519 fidl::decode!(DeviceExtension, D, &mut self.device, decoder, offset + 2, _depth)?;
2520 Ok(())
2521 }
2522 }
2523
2524 impl fidl::encoding::ValueTypeMarker for MfpFeature {
2525 type Borrowed<'a> = &'a Self;
2526 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2527 value
2528 }
2529 }
2530
2531 unsafe impl fidl::encoding::TypeMarker for MfpFeature {
2532 type Owned = Self;
2533
2534 #[inline(always)]
2535 fn inline_align(_context: fidl::encoding::Context) -> usize {
2536 1
2537 }
2538
2539 #[inline(always)]
2540 fn inline_size(_context: fidl::encoding::Context) -> usize {
2541 1
2542 }
2543 }
2544
2545 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<MfpFeature, D>
2546 for &MfpFeature
2547 {
2548 #[inline]
2549 unsafe fn encode(
2550 self,
2551 encoder: &mut fidl::encoding::Encoder<'_, D>,
2552 offset: usize,
2553 _depth: fidl::encoding::Depth,
2554 ) -> fidl::Result<()> {
2555 encoder.debug_check_bounds::<MfpFeature>(offset);
2556 fidl::encoding::Encode::<MfpFeature, D>::encode(
2558 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2559 encoder,
2560 offset,
2561 _depth,
2562 )
2563 }
2564 }
2565 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2566 fidl::encoding::Encode<MfpFeature, D> for (T0,)
2567 {
2568 #[inline]
2569 unsafe fn encode(
2570 self,
2571 encoder: &mut fidl::encoding::Encoder<'_, D>,
2572 offset: usize,
2573 depth: fidl::encoding::Depth,
2574 ) -> fidl::Result<()> {
2575 encoder.debug_check_bounds::<MfpFeature>(offset);
2576 self.0.encode(encoder, offset + 0, depth)?;
2580 Ok(())
2581 }
2582 }
2583
2584 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for MfpFeature {
2585 #[inline(always)]
2586 fn new_empty() -> Self {
2587 Self { supported: fidl::new_empty!(bool, D) }
2588 }
2589
2590 #[inline]
2591 unsafe fn decode(
2592 &mut self,
2593 decoder: &mut fidl::encoding::Decoder<'_, D>,
2594 offset: usize,
2595 _depth: fidl::encoding::Depth,
2596 ) -> fidl::Result<()> {
2597 decoder.debug_check_bounds::<Self>(offset);
2598 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2600 Ok(())
2601 }
2602 }
2603
2604 impl fidl::encoding::ValueTypeMarker for ProbeResponseOffloadExtension {
2605 type Borrowed<'a> = &'a Self;
2606 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2607 value
2608 }
2609 }
2610
2611 unsafe impl fidl::encoding::TypeMarker for ProbeResponseOffloadExtension {
2612 type Owned = Self;
2613
2614 #[inline(always)]
2615 fn inline_align(_context: fidl::encoding::Context) -> usize {
2616 1
2617 }
2618
2619 #[inline(always)]
2620 fn inline_size(_context: fidl::encoding::Context) -> usize {
2621 1
2622 }
2623 }
2624
2625 unsafe impl<D: fidl::encoding::ResourceDialect>
2626 fidl::encoding::Encode<ProbeResponseOffloadExtension, D>
2627 for &ProbeResponseOffloadExtension
2628 {
2629 #[inline]
2630 unsafe fn encode(
2631 self,
2632 encoder: &mut fidl::encoding::Encoder<'_, D>,
2633 offset: usize,
2634 _depth: fidl::encoding::Depth,
2635 ) -> fidl::Result<()> {
2636 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
2637 fidl::encoding::Encode::<ProbeResponseOffloadExtension, D>::encode(
2639 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2640 encoder,
2641 offset,
2642 _depth,
2643 )
2644 }
2645 }
2646 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2647 fidl::encoding::Encode<ProbeResponseOffloadExtension, D> for (T0,)
2648 {
2649 #[inline]
2650 unsafe fn encode(
2651 self,
2652 encoder: &mut fidl::encoding::Encoder<'_, D>,
2653 offset: usize,
2654 depth: fidl::encoding::Depth,
2655 ) -> fidl::Result<()> {
2656 encoder.debug_check_bounds::<ProbeResponseOffloadExtension>(offset);
2657 self.0.encode(encoder, offset + 0, depth)?;
2661 Ok(())
2662 }
2663 }
2664
2665 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2666 for ProbeResponseOffloadExtension
2667 {
2668 #[inline(always)]
2669 fn new_empty() -> Self {
2670 Self { supported: fidl::new_empty!(bool, D) }
2671 }
2672
2673 #[inline]
2674 unsafe fn decode(
2675 &mut self,
2676 decoder: &mut fidl::encoding::Decoder<'_, D>,
2677 offset: usize,
2678 _depth: fidl::encoding::Depth,
2679 ) -> fidl::Result<()> {
2680 decoder.debug_check_bounds::<Self>(offset);
2681 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2683 Ok(())
2684 }
2685 }
2686
2687 impl fidl::encoding::ValueTypeMarker for RateSelectionOffloadExtension {
2688 type Borrowed<'a> = &'a Self;
2689 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2690 value
2691 }
2692 }
2693
2694 unsafe impl fidl::encoding::TypeMarker for RateSelectionOffloadExtension {
2695 type Owned = Self;
2696
2697 #[inline(always)]
2698 fn inline_align(_context: fidl::encoding::Context) -> usize {
2699 1
2700 }
2701
2702 #[inline(always)]
2703 fn inline_size(_context: fidl::encoding::Context) -> usize {
2704 1
2705 }
2706 }
2707
2708 unsafe impl<D: fidl::encoding::ResourceDialect>
2709 fidl::encoding::Encode<RateSelectionOffloadExtension, D>
2710 for &RateSelectionOffloadExtension
2711 {
2712 #[inline]
2713 unsafe fn encode(
2714 self,
2715 encoder: &mut fidl::encoding::Encoder<'_, D>,
2716 offset: usize,
2717 _depth: fidl::encoding::Depth,
2718 ) -> fidl::Result<()> {
2719 encoder.debug_check_bounds::<RateSelectionOffloadExtension>(offset);
2720 fidl::encoding::Encode::<RateSelectionOffloadExtension, D>::encode(
2722 (<bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),),
2723 encoder,
2724 offset,
2725 _depth,
2726 )
2727 }
2728 }
2729 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<bool, D>>
2730 fidl::encoding::Encode<RateSelectionOffloadExtension, D> for (T0,)
2731 {
2732 #[inline]
2733 unsafe fn encode(
2734 self,
2735 encoder: &mut fidl::encoding::Encoder<'_, D>,
2736 offset: usize,
2737 depth: fidl::encoding::Depth,
2738 ) -> fidl::Result<()> {
2739 encoder.debug_check_bounds::<RateSelectionOffloadExtension>(offset);
2740 self.0.encode(encoder, offset + 0, depth)?;
2744 Ok(())
2745 }
2746 }
2747
2748 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2749 for RateSelectionOffloadExtension
2750 {
2751 #[inline(always)]
2752 fn new_empty() -> Self {
2753 Self { supported: fidl::new_empty!(bool, D) }
2754 }
2755
2756 #[inline]
2757 unsafe fn decode(
2758 &mut self,
2759 decoder: &mut fidl::encoding::Decoder<'_, D>,
2760 offset: usize,
2761 _depth: fidl::encoding::Depth,
2762 ) -> fidl::Result<()> {
2763 decoder.debug_check_bounds::<Self>(offset);
2764 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2766 Ok(())
2767 }
2768 }
2769
2770 impl fidl::encoding::ValueTypeMarker for SaeFeature {
2771 type Borrowed<'a> = &'a Self;
2772 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2773 value
2774 }
2775 }
2776
2777 unsafe impl fidl::encoding::TypeMarker for SaeFeature {
2778 type Owned = Self;
2779
2780 #[inline(always)]
2781 fn inline_align(_context: fidl::encoding::Context) -> usize {
2782 1
2783 }
2784
2785 #[inline(always)]
2786 fn inline_size(_context: fidl::encoding::Context) -> usize {
2787 2
2788 }
2789 }
2790
2791 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SaeFeature, D>
2792 for &SaeFeature
2793 {
2794 #[inline]
2795 unsafe fn encode(
2796 self,
2797 encoder: &mut fidl::encoding::Encoder<'_, D>,
2798 offset: usize,
2799 _depth: fidl::encoding::Depth,
2800 ) -> fidl::Result<()> {
2801 encoder.debug_check_bounds::<SaeFeature>(offset);
2802 fidl::encoding::Encode::<SaeFeature, D>::encode(
2804 (
2805 <bool as fidl::encoding::ValueTypeMarker>::borrow(
2806 &self.driver_handler_supported,
2807 ),
2808 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.sme_handler_supported),
2809 ),
2810 encoder,
2811 offset,
2812 _depth,
2813 )
2814 }
2815 }
2816 unsafe impl<
2817 D: fidl::encoding::ResourceDialect,
2818 T0: fidl::encoding::Encode<bool, D>,
2819 T1: fidl::encoding::Encode<bool, D>,
2820 > fidl::encoding::Encode<SaeFeature, D> for (T0, T1)
2821 {
2822 #[inline]
2823 unsafe fn encode(
2824 self,
2825 encoder: &mut fidl::encoding::Encoder<'_, D>,
2826 offset: usize,
2827 depth: fidl::encoding::Depth,
2828 ) -> fidl::Result<()> {
2829 encoder.debug_check_bounds::<SaeFeature>(offset);
2830 self.0.encode(encoder, offset + 0, depth)?;
2834 self.1.encode(encoder, offset + 1, depth)?;
2835 Ok(())
2836 }
2837 }
2838
2839 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SaeFeature {
2840 #[inline(always)]
2841 fn new_empty() -> Self {
2842 Self {
2843 driver_handler_supported: fidl::new_empty!(bool, D),
2844 sme_handler_supported: fidl::new_empty!(bool, D),
2845 }
2846 }
2847
2848 #[inline]
2849 unsafe fn decode(
2850 &mut self,
2851 decoder: &mut fidl::encoding::Decoder<'_, D>,
2852 offset: usize,
2853 _depth: fidl::encoding::Depth,
2854 ) -> fidl::Result<()> {
2855 decoder.debug_check_bounds::<Self>(offset);
2856 fidl::decode!(
2858 bool,
2859 D,
2860 &mut self.driver_handler_supported,
2861 decoder,
2862 offset + 0,
2863 _depth
2864 )?;
2865 fidl::decode!(bool, D, &mut self.sme_handler_supported, decoder, offset + 1, _depth)?;
2866 Ok(())
2867 }
2868 }
2869
2870 impl fidl::encoding::ValueTypeMarker for ScanOffloadExtension {
2871 type Borrowed<'a> = &'a Self;
2872 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2873 value
2874 }
2875 }
2876
2877 unsafe impl fidl::encoding::TypeMarker for ScanOffloadExtension {
2878 type Owned = Self;
2879
2880 #[inline(always)]
2881 fn inline_align(_context: fidl::encoding::Context) -> usize {
2882 1
2883 }
2884
2885 #[inline(always)]
2886 fn inline_size(_context: fidl::encoding::Context) -> usize {
2887 2
2888 }
2889 }
2890
2891 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<ScanOffloadExtension, D>
2892 for &ScanOffloadExtension
2893 {
2894 #[inline]
2895 unsafe fn encode(
2896 self,
2897 encoder: &mut fidl::encoding::Encoder<'_, D>,
2898 offset: usize,
2899 _depth: fidl::encoding::Depth,
2900 ) -> fidl::Result<()> {
2901 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
2902 fidl::encoding::Encode::<ScanOffloadExtension, D>::encode(
2904 (
2905 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.supported),
2906 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.scan_cancel_supported),
2907 ),
2908 encoder,
2909 offset,
2910 _depth,
2911 )
2912 }
2913 }
2914 unsafe impl<
2915 D: fidl::encoding::ResourceDialect,
2916 T0: fidl::encoding::Encode<bool, D>,
2917 T1: fidl::encoding::Encode<bool, D>,
2918 > fidl::encoding::Encode<ScanOffloadExtension, D> for (T0, T1)
2919 {
2920 #[inline]
2921 unsafe fn encode(
2922 self,
2923 encoder: &mut fidl::encoding::Encoder<'_, D>,
2924 offset: usize,
2925 depth: fidl::encoding::Depth,
2926 ) -> fidl::Result<()> {
2927 encoder.debug_check_bounds::<ScanOffloadExtension>(offset);
2928 self.0.encode(encoder, offset + 0, depth)?;
2932 self.1.encode(encoder, offset + 1, depth)?;
2933 Ok(())
2934 }
2935 }
2936
2937 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for ScanOffloadExtension {
2938 #[inline(always)]
2939 fn new_empty() -> Self {
2940 Self {
2941 supported: fidl::new_empty!(bool, D),
2942 scan_cancel_supported: fidl::new_empty!(bool, D),
2943 }
2944 }
2945
2946 #[inline]
2947 unsafe fn decode(
2948 &mut self,
2949 decoder: &mut fidl::encoding::Decoder<'_, D>,
2950 offset: usize,
2951 _depth: fidl::encoding::Depth,
2952 ) -> fidl::Result<()> {
2953 decoder.debug_check_bounds::<Self>(offset);
2954 fidl::decode!(bool, D, &mut self.supported, decoder, offset + 0, _depth)?;
2956 fidl::decode!(bool, D, &mut self.scan_cancel_supported, decoder, offset + 1, _depth)?;
2957 Ok(())
2958 }
2959 }
2960
2961 impl fidl::encoding::ValueTypeMarker for SecuritySupport {
2962 type Borrowed<'a> = &'a Self;
2963 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2964 value
2965 }
2966 }
2967
2968 unsafe impl fidl::encoding::TypeMarker for SecuritySupport {
2969 type Owned = Self;
2970
2971 #[inline(always)]
2972 fn inline_align(_context: fidl::encoding::Context) -> usize {
2973 1
2974 }
2975
2976 #[inline(always)]
2977 fn inline_size(_context: fidl::encoding::Context) -> usize {
2978 3
2979 }
2980 }
2981
2982 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SecuritySupport, D>
2983 for &SecuritySupport
2984 {
2985 #[inline]
2986 unsafe fn encode(
2987 self,
2988 encoder: &mut fidl::encoding::Encoder<'_, D>,
2989 offset: usize,
2990 _depth: fidl::encoding::Depth,
2991 ) -> fidl::Result<()> {
2992 encoder.debug_check_bounds::<SecuritySupport>(offset);
2993 fidl::encoding::Encode::<SecuritySupport, D>::encode(
2995 (
2996 <SaeFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.sae),
2997 <MfpFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.mfp),
2998 ),
2999 encoder,
3000 offset,
3001 _depth,
3002 )
3003 }
3004 }
3005 unsafe impl<
3006 D: fidl::encoding::ResourceDialect,
3007 T0: fidl::encoding::Encode<SaeFeature, D>,
3008 T1: fidl::encoding::Encode<MfpFeature, D>,
3009 > fidl::encoding::Encode<SecuritySupport, D> for (T0, T1)
3010 {
3011 #[inline]
3012 unsafe fn encode(
3013 self,
3014 encoder: &mut fidl::encoding::Encoder<'_, D>,
3015 offset: usize,
3016 depth: fidl::encoding::Depth,
3017 ) -> fidl::Result<()> {
3018 encoder.debug_check_bounds::<SecuritySupport>(offset);
3019 self.0.encode(encoder, offset + 0, depth)?;
3023 self.1.encode(encoder, offset + 2, depth)?;
3024 Ok(())
3025 }
3026 }
3027
3028 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SecuritySupport {
3029 #[inline(always)]
3030 fn new_empty() -> Self {
3031 Self { sae: fidl::new_empty!(SaeFeature, D), mfp: fidl::new_empty!(MfpFeature, D) }
3032 }
3033
3034 #[inline]
3035 unsafe fn decode(
3036 &mut self,
3037 decoder: &mut fidl::encoding::Decoder<'_, D>,
3038 offset: usize,
3039 _depth: fidl::encoding::Depth,
3040 ) -> fidl::Result<()> {
3041 decoder.debug_check_bounds::<Self>(offset);
3042 fidl::decode!(SaeFeature, D, &mut self.sae, decoder, offset + 0, _depth)?;
3044 fidl::decode!(MfpFeature, D, &mut self.mfp, decoder, offset + 2, _depth)?;
3045 Ok(())
3046 }
3047 }
3048
3049 impl fidl::encoding::ValueTypeMarker for SpectrumManagementSupport {
3050 type Borrowed<'a> = &'a Self;
3051 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3052 value
3053 }
3054 }
3055
3056 unsafe impl fidl::encoding::TypeMarker for SpectrumManagementSupport {
3057 type Owned = Self;
3058
3059 #[inline(always)]
3060 fn inline_align(_context: fidl::encoding::Context) -> usize {
3061 1
3062 }
3063
3064 #[inline(always)]
3065 fn inline_size(_context: fidl::encoding::Context) -> usize {
3066 1
3067 }
3068 }
3069
3070 unsafe impl<D: fidl::encoding::ResourceDialect>
3071 fidl::encoding::Encode<SpectrumManagementSupport, D> for &SpectrumManagementSupport
3072 {
3073 #[inline]
3074 unsafe fn encode(
3075 self,
3076 encoder: &mut fidl::encoding::Encoder<'_, D>,
3077 offset: usize,
3078 _depth: fidl::encoding::Depth,
3079 ) -> fidl::Result<()> {
3080 encoder.debug_check_bounds::<SpectrumManagementSupport>(offset);
3081 fidl::encoding::Encode::<SpectrumManagementSupport, D>::encode(
3083 (<DfsFeature as fidl::encoding::ValueTypeMarker>::borrow(&self.dfs),),
3084 encoder,
3085 offset,
3086 _depth,
3087 )
3088 }
3089 }
3090 unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<DfsFeature, D>>
3091 fidl::encoding::Encode<SpectrumManagementSupport, D> for (T0,)
3092 {
3093 #[inline]
3094 unsafe fn encode(
3095 self,
3096 encoder: &mut fidl::encoding::Encoder<'_, D>,
3097 offset: usize,
3098 depth: fidl::encoding::Depth,
3099 ) -> fidl::Result<()> {
3100 encoder.debug_check_bounds::<SpectrumManagementSupport>(offset);
3101 self.0.encode(encoder, offset + 0, depth)?;
3105 Ok(())
3106 }
3107 }
3108
3109 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3110 for SpectrumManagementSupport
3111 {
3112 #[inline(always)]
3113 fn new_empty() -> Self {
3114 Self { dfs: fidl::new_empty!(DfsFeature, D) }
3115 }
3116
3117 #[inline]
3118 unsafe fn decode(
3119 &mut self,
3120 decoder: &mut fidl::encoding::Decoder<'_, D>,
3121 offset: usize,
3122 _depth: fidl::encoding::Depth,
3123 ) -> fidl::Result<()> {
3124 decoder.debug_check_bounds::<Self>(offset);
3125 fidl::decode!(DfsFeature, D, &mut self.dfs, decoder, offset + 0, _depth)?;
3127 Ok(())
3128 }
3129 }
3130
3131 impl fidl::encoding::ValueTypeMarker for WlanChannel {
3132 type Borrowed<'a> = &'a Self;
3133 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3134 value
3135 }
3136 }
3137
3138 unsafe impl fidl::encoding::TypeMarker for WlanChannel {
3139 type Owned = Self;
3140
3141 #[inline(always)]
3142 fn inline_align(_context: fidl::encoding::Context) -> usize {
3143 4
3144 }
3145
3146 #[inline(always)]
3147 fn inline_size(_context: fidl::encoding::Context) -> usize {
3148 12
3149 }
3150 }
3151
3152 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanChannel, D>
3153 for &WlanChannel
3154 {
3155 #[inline]
3156 unsafe fn encode(
3157 self,
3158 encoder: &mut fidl::encoding::Encoder<'_, D>,
3159 offset: usize,
3160 _depth: fidl::encoding::Depth,
3161 ) -> fidl::Result<()> {
3162 encoder.debug_check_bounds::<WlanChannel>(offset);
3163 fidl::encoding::Encode::<WlanChannel, D>::encode(
3165 (
3166 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.primary),
3167 <ChannelBandwidth as fidl::encoding::ValueTypeMarker>::borrow(&self.cbw),
3168 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.secondary80),
3169 ),
3170 encoder,
3171 offset,
3172 _depth,
3173 )
3174 }
3175 }
3176 unsafe impl<
3177 D: fidl::encoding::ResourceDialect,
3178 T0: fidl::encoding::Encode<u8, D>,
3179 T1: fidl::encoding::Encode<ChannelBandwidth, D>,
3180 T2: fidl::encoding::Encode<u8, D>,
3181 > fidl::encoding::Encode<WlanChannel, D> for (T0, T1, T2)
3182 {
3183 #[inline]
3184 unsafe fn encode(
3185 self,
3186 encoder: &mut fidl::encoding::Encoder<'_, D>,
3187 offset: usize,
3188 depth: fidl::encoding::Depth,
3189 ) -> fidl::Result<()> {
3190 encoder.debug_check_bounds::<WlanChannel>(offset);
3191 unsafe {
3194 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3195 (ptr as *mut u32).write_unaligned(0);
3196 }
3197 unsafe {
3198 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
3199 (ptr as *mut u32).write_unaligned(0);
3200 }
3201 self.0.encode(encoder, offset + 0, depth)?;
3203 self.1.encode(encoder, offset + 4, depth)?;
3204 self.2.encode(encoder, offset + 8, depth)?;
3205 Ok(())
3206 }
3207 }
3208
3209 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanChannel {
3210 #[inline(always)]
3211 fn new_empty() -> Self {
3212 Self {
3213 primary: fidl::new_empty!(u8, D),
3214 cbw: fidl::new_empty!(ChannelBandwidth, D),
3215 secondary80: fidl::new_empty!(u8, D),
3216 }
3217 }
3218
3219 #[inline]
3220 unsafe fn decode(
3221 &mut self,
3222 decoder: &mut fidl::encoding::Decoder<'_, D>,
3223 offset: usize,
3224 _depth: fidl::encoding::Depth,
3225 ) -> fidl::Result<()> {
3226 decoder.debug_check_bounds::<Self>(offset);
3227 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3229 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3230 let mask = 0xffffff00u32;
3231 let maskedval = padval & mask;
3232 if maskedval != 0 {
3233 return Err(fidl::Error::NonZeroPadding {
3234 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3235 });
3236 }
3237 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
3238 let padval = unsafe { (ptr as *const u32).read_unaligned() };
3239 let mask = 0xffffff00u32;
3240 let maskedval = padval & mask;
3241 if maskedval != 0 {
3242 return Err(fidl::Error::NonZeroPadding {
3243 padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
3244 });
3245 }
3246 fidl::decode!(u8, D, &mut self.primary, decoder, offset + 0, _depth)?;
3247 fidl::decode!(ChannelBandwidth, D, &mut self.cbw, decoder, offset + 4, _depth)?;
3248 fidl::decode!(u8, D, &mut self.secondary80, decoder, offset + 8, _depth)?;
3249 Ok(())
3250 }
3251 }
3252
3253 impl fidl::encoding::ValueTypeMarker for WlanTxResult {
3254 type Borrowed<'a> = &'a Self;
3255 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3256 value
3257 }
3258 }
3259
3260 unsafe impl fidl::encoding::TypeMarker for WlanTxResult {
3261 type Owned = Self;
3262
3263 #[inline(always)]
3264 fn inline_align(_context: fidl::encoding::Context) -> usize {
3265 2
3266 }
3267
3268 #[inline(always)]
3269 fn inline_size(_context: fidl::encoding::Context) -> usize {
3270 40
3271 }
3272 }
3273
3274 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxResult, D>
3275 for &WlanTxResult
3276 {
3277 #[inline]
3278 unsafe fn encode(
3279 self,
3280 encoder: &mut fidl::encoding::Encoder<'_, D>,
3281 offset: usize,
3282 _depth: fidl::encoding::Depth,
3283 ) -> fidl::Result<()> {
3284 encoder.debug_check_bounds::<WlanTxResult>(offset);
3285 fidl::encoding::Encode::<WlanTxResult, D>::encode(
3287 (
3288 <fidl::encoding::Array<WlanTxResultEntry, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_result_entry),
3289 <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.peer_addr),
3290 <WlanTxResultCode as fidl::encoding::ValueTypeMarker>::borrow(&self.result_code),
3291 ),
3292 encoder, offset, _depth
3293 )
3294 }
3295 }
3296 unsafe impl<
3297 D: fidl::encoding::ResourceDialect,
3298 T0: fidl::encoding::Encode<fidl::encoding::Array<WlanTxResultEntry, 8>, D>,
3299 T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
3300 T2: fidl::encoding::Encode<WlanTxResultCode, D>,
3301 > fidl::encoding::Encode<WlanTxResult, D> for (T0, T1, T2)
3302 {
3303 #[inline]
3304 unsafe fn encode(
3305 self,
3306 encoder: &mut fidl::encoding::Encoder<'_, D>,
3307 offset: usize,
3308 depth: fidl::encoding::Depth,
3309 ) -> fidl::Result<()> {
3310 encoder.debug_check_bounds::<WlanTxResult>(offset);
3311 unsafe {
3314 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(38);
3315 (ptr as *mut u16).write_unaligned(0);
3316 }
3317 self.0.encode(encoder, offset + 0, depth)?;
3319 self.1.encode(encoder, offset + 32, depth)?;
3320 self.2.encode(encoder, offset + 38, depth)?;
3321 Ok(())
3322 }
3323 }
3324
3325 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResult {
3326 #[inline(always)]
3327 fn new_empty() -> Self {
3328 Self {
3329 tx_result_entry: fidl::new_empty!(fidl::encoding::Array<WlanTxResultEntry, 8>, D),
3330 peer_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
3331 result_code: fidl::new_empty!(WlanTxResultCode, D),
3332 }
3333 }
3334
3335 #[inline]
3336 unsafe fn decode(
3337 &mut self,
3338 decoder: &mut fidl::encoding::Decoder<'_, D>,
3339 offset: usize,
3340 _depth: fidl::encoding::Depth,
3341 ) -> fidl::Result<()> {
3342 decoder.debug_check_bounds::<Self>(offset);
3343 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(38) };
3345 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3346 let mask = 0xff00u16;
3347 let maskedval = padval & mask;
3348 if maskedval != 0 {
3349 return Err(fidl::Error::NonZeroPadding {
3350 padding_start: offset + 38 + ((mask as u64).trailing_zeros() / 8) as usize,
3351 });
3352 }
3353 fidl::decode!(fidl::encoding::Array<WlanTxResultEntry, 8>, D, &mut self.tx_result_entry, decoder, offset + 0, _depth)?;
3354 fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.peer_addr, decoder, offset + 32, _depth)?;
3355 fidl::decode!(
3356 WlanTxResultCode,
3357 D,
3358 &mut self.result_code,
3359 decoder,
3360 offset + 38,
3361 _depth
3362 )?;
3363 Ok(())
3364 }
3365 }
3366
3367 impl fidl::encoding::ValueTypeMarker for WlanTxResultEntry {
3368 type Borrowed<'a> = &'a Self;
3369 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3370 value
3371 }
3372 }
3373
3374 unsafe impl fidl::encoding::TypeMarker for WlanTxResultEntry {
3375 type Owned = Self;
3376
3377 #[inline(always)]
3378 fn inline_align(_context: fidl::encoding::Context) -> usize {
3379 2
3380 }
3381
3382 #[inline(always)]
3383 fn inline_size(_context: fidl::encoding::Context) -> usize {
3384 4
3385 }
3386 }
3387
3388 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxResultEntry, D>
3389 for &WlanTxResultEntry
3390 {
3391 #[inline]
3392 unsafe fn encode(
3393 self,
3394 encoder: &mut fidl::encoding::Encoder<'_, D>,
3395 offset: usize,
3396 _depth: fidl::encoding::Depth,
3397 ) -> fidl::Result<()> {
3398 encoder.debug_check_bounds::<WlanTxResultEntry>(offset);
3399 unsafe {
3400 let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
3402 (buf_ptr as *mut WlanTxResultEntry)
3403 .write_unaligned((self as *const WlanTxResultEntry).read());
3404 let padding_ptr = buf_ptr.offset(2) as *mut u16;
3407 let padding_mask = 0xff00u16;
3408 padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
3409 }
3410 Ok(())
3411 }
3412 }
3413 unsafe impl<
3414 D: fidl::encoding::ResourceDialect,
3415 T0: fidl::encoding::Encode<u16, D>,
3416 T1: fidl::encoding::Encode<u8, D>,
3417 > fidl::encoding::Encode<WlanTxResultEntry, D> for (T0, T1)
3418 {
3419 #[inline]
3420 unsafe fn encode(
3421 self,
3422 encoder: &mut fidl::encoding::Encoder<'_, D>,
3423 offset: usize,
3424 depth: fidl::encoding::Depth,
3425 ) -> fidl::Result<()> {
3426 encoder.debug_check_bounds::<WlanTxResultEntry>(offset);
3427 unsafe {
3430 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
3431 (ptr as *mut u16).write_unaligned(0);
3432 }
3433 self.0.encode(encoder, offset + 0, depth)?;
3435 self.1.encode(encoder, offset + 2, depth)?;
3436 Ok(())
3437 }
3438 }
3439
3440 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxResultEntry {
3441 #[inline(always)]
3442 fn new_empty() -> Self {
3443 Self { tx_vector_idx: fidl::new_empty!(u16, D), attempts: fidl::new_empty!(u8, D) }
3444 }
3445
3446 #[inline]
3447 unsafe fn decode(
3448 &mut self,
3449 decoder: &mut fidl::encoding::Decoder<'_, D>,
3450 offset: usize,
3451 _depth: fidl::encoding::Depth,
3452 ) -> fidl::Result<()> {
3453 decoder.debug_check_bounds::<Self>(offset);
3454 let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
3455 let ptr = unsafe { buf_ptr.offset(2) };
3457 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3458 let mask = 0xff00u16;
3459 let maskedval = padval & mask;
3460 if maskedval != 0 {
3461 return Err(fidl::Error::NonZeroPadding {
3462 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
3463 });
3464 }
3465 unsafe {
3467 std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
3468 }
3469 Ok(())
3470 }
3471 }
3472
3473 impl fidl::encoding::ValueTypeMarker for WlanWmmAccessCategoryParameters {
3474 type Borrowed<'a> = &'a Self;
3475 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3476 value
3477 }
3478 }
3479
3480 unsafe impl fidl::encoding::TypeMarker for WlanWmmAccessCategoryParameters {
3481 type Owned = Self;
3482
3483 #[inline(always)]
3484 fn inline_align(_context: fidl::encoding::Context) -> usize {
3485 2
3486 }
3487
3488 #[inline(always)]
3489 fn inline_size(_context: fidl::encoding::Context) -> usize {
3490 8
3491 }
3492 }
3493
3494 unsafe impl<D: fidl::encoding::ResourceDialect>
3495 fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>
3496 for &WlanWmmAccessCategoryParameters
3497 {
3498 #[inline]
3499 unsafe fn encode(
3500 self,
3501 encoder: &mut fidl::encoding::Encoder<'_, D>,
3502 offset: usize,
3503 _depth: fidl::encoding::Depth,
3504 ) -> fidl::Result<()> {
3505 encoder.debug_check_bounds::<WlanWmmAccessCategoryParameters>(offset);
3506 fidl::encoding::Encode::<WlanWmmAccessCategoryParameters, D>::encode(
3508 (
3509 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_min),
3510 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.ecw_max),
3511 <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.aifsn),
3512 <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.txop_limit),
3513 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.acm),
3514 ),
3515 encoder,
3516 offset,
3517 _depth,
3518 )
3519 }
3520 }
3521 unsafe impl<
3522 D: fidl::encoding::ResourceDialect,
3523 T0: fidl::encoding::Encode<u8, D>,
3524 T1: fidl::encoding::Encode<u8, D>,
3525 T2: fidl::encoding::Encode<u8, D>,
3526 T3: fidl::encoding::Encode<u16, D>,
3527 T4: fidl::encoding::Encode<bool, D>,
3528 > fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D> for (T0, T1, T2, T3, T4)
3529 {
3530 #[inline]
3531 unsafe fn encode(
3532 self,
3533 encoder: &mut fidl::encoding::Encoder<'_, D>,
3534 offset: usize,
3535 depth: fidl::encoding::Depth,
3536 ) -> fidl::Result<()> {
3537 encoder.debug_check_bounds::<WlanWmmAccessCategoryParameters>(offset);
3538 unsafe {
3541 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(2);
3542 (ptr as *mut u16).write_unaligned(0);
3543 }
3544 unsafe {
3545 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(6);
3546 (ptr as *mut u16).write_unaligned(0);
3547 }
3548 self.0.encode(encoder, offset + 0, depth)?;
3550 self.1.encode(encoder, offset + 1, depth)?;
3551 self.2.encode(encoder, offset + 2, depth)?;
3552 self.3.encode(encoder, offset + 4, depth)?;
3553 self.4.encode(encoder, offset + 6, depth)?;
3554 Ok(())
3555 }
3556 }
3557
3558 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
3559 for WlanWmmAccessCategoryParameters
3560 {
3561 #[inline(always)]
3562 fn new_empty() -> Self {
3563 Self {
3564 ecw_min: fidl::new_empty!(u8, D),
3565 ecw_max: fidl::new_empty!(u8, D),
3566 aifsn: fidl::new_empty!(u8, D),
3567 txop_limit: fidl::new_empty!(u16, D),
3568 acm: fidl::new_empty!(bool, D),
3569 }
3570 }
3571
3572 #[inline]
3573 unsafe fn decode(
3574 &mut self,
3575 decoder: &mut fidl::encoding::Decoder<'_, D>,
3576 offset: usize,
3577 _depth: fidl::encoding::Depth,
3578 ) -> fidl::Result<()> {
3579 decoder.debug_check_bounds::<Self>(offset);
3580 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(2) };
3582 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3583 let mask = 0xff00u16;
3584 let maskedval = padval & mask;
3585 if maskedval != 0 {
3586 return Err(fidl::Error::NonZeroPadding {
3587 padding_start: offset + 2 + ((mask as u64).trailing_zeros() / 8) as usize,
3588 });
3589 }
3590 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(6) };
3591 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3592 let mask = 0xff00u16;
3593 let maskedval = padval & mask;
3594 if maskedval != 0 {
3595 return Err(fidl::Error::NonZeroPadding {
3596 padding_start: offset + 6 + ((mask as u64).trailing_zeros() / 8) as usize,
3597 });
3598 }
3599 fidl::decode!(u8, D, &mut self.ecw_min, decoder, offset + 0, _depth)?;
3600 fidl::decode!(u8, D, &mut self.ecw_max, decoder, offset + 1, _depth)?;
3601 fidl::decode!(u8, D, &mut self.aifsn, decoder, offset + 2, _depth)?;
3602 fidl::decode!(u16, D, &mut self.txop_limit, decoder, offset + 4, _depth)?;
3603 fidl::decode!(bool, D, &mut self.acm, decoder, offset + 6, _depth)?;
3604 Ok(())
3605 }
3606 }
3607
3608 impl fidl::encoding::ValueTypeMarker for WlanWmmParameters {
3609 type Borrowed<'a> = &'a Self;
3610 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3611 value
3612 }
3613 }
3614
3615 unsafe impl fidl::encoding::TypeMarker for WlanWmmParameters {
3616 type Owned = Self;
3617
3618 #[inline(always)]
3619 fn inline_align(_context: fidl::encoding::Context) -> usize {
3620 2
3621 }
3622
3623 #[inline(always)]
3624 fn inline_size(_context: fidl::encoding::Context) -> usize {
3625 34
3626 }
3627 }
3628
3629 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanWmmParameters, D>
3630 for &WlanWmmParameters
3631 {
3632 #[inline]
3633 unsafe fn encode(
3634 self,
3635 encoder: &mut fidl::encoding::Encoder<'_, D>,
3636 offset: usize,
3637 _depth: fidl::encoding::Depth,
3638 ) -> fidl::Result<()> {
3639 encoder.debug_check_bounds::<WlanWmmParameters>(offset);
3640 fidl::encoding::Encode::<WlanWmmParameters, D>::encode(
3642 (
3643 <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.apsd),
3644 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3645 &self.ac_be_params,
3646 ),
3647 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3648 &self.ac_bk_params,
3649 ),
3650 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3651 &self.ac_vi_params,
3652 ),
3653 <WlanWmmAccessCategoryParameters as fidl::encoding::ValueTypeMarker>::borrow(
3654 &self.ac_vo_params,
3655 ),
3656 ),
3657 encoder,
3658 offset,
3659 _depth,
3660 )
3661 }
3662 }
3663 unsafe impl<
3664 D: fidl::encoding::ResourceDialect,
3665 T0: fidl::encoding::Encode<bool, D>,
3666 T1: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3667 T2: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3668 T3: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3669 T4: fidl::encoding::Encode<WlanWmmAccessCategoryParameters, D>,
3670 > fidl::encoding::Encode<WlanWmmParameters, D> for (T0, T1, T2, T3, T4)
3671 {
3672 #[inline]
3673 unsafe fn encode(
3674 self,
3675 encoder: &mut fidl::encoding::Encoder<'_, D>,
3676 offset: usize,
3677 depth: fidl::encoding::Depth,
3678 ) -> fidl::Result<()> {
3679 encoder.debug_check_bounds::<WlanWmmParameters>(offset);
3680 unsafe {
3683 let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
3684 (ptr as *mut u16).write_unaligned(0);
3685 }
3686 self.0.encode(encoder, offset + 0, depth)?;
3688 self.1.encode(encoder, offset + 2, depth)?;
3689 self.2.encode(encoder, offset + 10, depth)?;
3690 self.3.encode(encoder, offset + 18, depth)?;
3691 self.4.encode(encoder, offset + 26, depth)?;
3692 Ok(())
3693 }
3694 }
3695
3696 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanWmmParameters {
3697 #[inline(always)]
3698 fn new_empty() -> Self {
3699 Self {
3700 apsd: fidl::new_empty!(bool, D),
3701 ac_be_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3702 ac_bk_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3703 ac_vi_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3704 ac_vo_params: fidl::new_empty!(WlanWmmAccessCategoryParameters, D),
3705 }
3706 }
3707
3708 #[inline]
3709 unsafe fn decode(
3710 &mut self,
3711 decoder: &mut fidl::encoding::Decoder<'_, D>,
3712 offset: usize,
3713 _depth: fidl::encoding::Depth,
3714 ) -> fidl::Result<()> {
3715 decoder.debug_check_bounds::<Self>(offset);
3716 let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
3718 let padval = unsafe { (ptr as *const u16).read_unaligned() };
3719 let mask = 0xff00u16;
3720 let maskedval = padval & mask;
3721 if maskedval != 0 {
3722 return Err(fidl::Error::NonZeroPadding {
3723 padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
3724 });
3725 }
3726 fidl::decode!(bool, D, &mut self.apsd, decoder, offset + 0, _depth)?;
3727 fidl::decode!(
3728 WlanWmmAccessCategoryParameters,
3729 D,
3730 &mut self.ac_be_params,
3731 decoder,
3732 offset + 2,
3733 _depth
3734 )?;
3735 fidl::decode!(
3736 WlanWmmAccessCategoryParameters,
3737 D,
3738 &mut self.ac_bk_params,
3739 decoder,
3740 offset + 10,
3741 _depth
3742 )?;
3743 fidl::decode!(
3744 WlanWmmAccessCategoryParameters,
3745 D,
3746 &mut self.ac_vi_params,
3747 decoder,
3748 offset + 18,
3749 _depth
3750 )?;
3751 fidl::decode!(
3752 WlanWmmAccessCategoryParameters,
3753 D,
3754 &mut self.ac_vo_params,
3755 decoder,
3756 offset + 26,
3757 _depth
3758 )?;
3759 Ok(())
3760 }
3761 }
3762
3763 impl JoinBssRequest {
3764 #[inline(always)]
3765 fn max_ordinal_present(&self) -> u64 {
3766 if let Some(_) = self.beacon_period {
3767 return 4;
3768 }
3769 if let Some(_) = self.remote {
3770 return 3;
3771 }
3772 if let Some(_) = self.bss_type {
3773 return 2;
3774 }
3775 if let Some(_) = self.bssid {
3776 return 1;
3777 }
3778 0
3779 }
3780 }
3781
3782 impl fidl::encoding::ValueTypeMarker for JoinBssRequest {
3783 type Borrowed<'a> = &'a Self;
3784 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
3785 value
3786 }
3787 }
3788
3789 unsafe impl fidl::encoding::TypeMarker for JoinBssRequest {
3790 type Owned = Self;
3791
3792 #[inline(always)]
3793 fn inline_align(_context: fidl::encoding::Context) -> usize {
3794 8
3795 }
3796
3797 #[inline(always)]
3798 fn inline_size(_context: fidl::encoding::Context) -> usize {
3799 16
3800 }
3801 }
3802
3803 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JoinBssRequest, D>
3804 for &JoinBssRequest
3805 {
3806 unsafe fn encode(
3807 self,
3808 encoder: &mut fidl::encoding::Encoder<'_, D>,
3809 offset: usize,
3810 mut depth: fidl::encoding::Depth,
3811 ) -> fidl::Result<()> {
3812 encoder.debug_check_bounds::<JoinBssRequest>(offset);
3813 let max_ordinal: u64 = self.max_ordinal_present();
3815 encoder.write_num(max_ordinal, offset);
3816 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
3817 if max_ordinal == 0 {
3819 return Ok(());
3820 }
3821 depth.increment()?;
3822 let envelope_size = 8;
3823 let bytes_len = max_ordinal as usize * envelope_size;
3824 #[allow(unused_variables)]
3825 let offset = encoder.out_of_line_offset(bytes_len);
3826 let mut _prev_end_offset: usize = 0;
3827 if 1 > max_ordinal {
3828 return Ok(());
3829 }
3830
3831 let cur_offset: usize = (1 - 1) * envelope_size;
3834
3835 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3837
3838 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
3843 self.bssid
3844 .as_ref()
3845 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
3846 encoder,
3847 offset + cur_offset,
3848 depth,
3849 )?;
3850
3851 _prev_end_offset = cur_offset + envelope_size;
3852 if 2 > max_ordinal {
3853 return Ok(());
3854 }
3855
3856 let cur_offset: usize = (2 - 1) * envelope_size;
3859
3860 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3862
3863 fidl::encoding::encode_in_envelope_optional::<BssType, D>(
3868 self.bss_type.as_ref().map(<BssType as fidl::encoding::ValueTypeMarker>::borrow),
3869 encoder,
3870 offset + cur_offset,
3871 depth,
3872 )?;
3873
3874 _prev_end_offset = cur_offset + envelope_size;
3875 if 3 > max_ordinal {
3876 return Ok(());
3877 }
3878
3879 let cur_offset: usize = (3 - 1) * envelope_size;
3882
3883 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3885
3886 fidl::encoding::encode_in_envelope_optional::<bool, D>(
3891 self.remote.as_ref().map(<bool as fidl::encoding::ValueTypeMarker>::borrow),
3892 encoder,
3893 offset + cur_offset,
3894 depth,
3895 )?;
3896
3897 _prev_end_offset = cur_offset + envelope_size;
3898 if 4 > max_ordinal {
3899 return Ok(());
3900 }
3901
3902 let cur_offset: usize = (4 - 1) * envelope_size;
3905
3906 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
3908
3909 fidl::encoding::encode_in_envelope_optional::<u16, D>(
3914 self.beacon_period.as_ref().map(<u16 as fidl::encoding::ValueTypeMarker>::borrow),
3915 encoder,
3916 offset + cur_offset,
3917 depth,
3918 )?;
3919
3920 _prev_end_offset = cur_offset + envelope_size;
3921
3922 Ok(())
3923 }
3924 }
3925
3926 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JoinBssRequest {
3927 #[inline(always)]
3928 fn new_empty() -> Self {
3929 Self::default()
3930 }
3931
3932 unsafe fn decode(
3933 &mut self,
3934 decoder: &mut fidl::encoding::Decoder<'_, D>,
3935 offset: usize,
3936 mut depth: fidl::encoding::Depth,
3937 ) -> fidl::Result<()> {
3938 decoder.debug_check_bounds::<Self>(offset);
3939 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
3940 None => return Err(fidl::Error::NotNullable),
3941 Some(len) => len,
3942 };
3943 if len == 0 {
3945 return Ok(());
3946 };
3947 depth.increment()?;
3948 let envelope_size = 8;
3949 let bytes_len = len * envelope_size;
3950 let offset = decoder.out_of_line_offset(bytes_len)?;
3951 let mut _next_ordinal_to_read = 0;
3953 let mut next_offset = offset;
3954 let end_offset = offset + bytes_len;
3955 _next_ordinal_to_read += 1;
3956 if next_offset >= end_offset {
3957 return Ok(());
3958 }
3959
3960 while _next_ordinal_to_read < 1 {
3962 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
3963 _next_ordinal_to_read += 1;
3964 next_offset += envelope_size;
3965 }
3966
3967 let next_out_of_line = decoder.next_out_of_line();
3968 let handles_before = decoder.remaining_handles();
3969 if let Some((inlined, num_bytes, num_handles)) =
3970 fidl::encoding::decode_envelope_header(decoder, next_offset)?
3971 {
3972 let member_inline_size =
3973 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
3974 decoder.context,
3975 );
3976 if inlined != (member_inline_size <= 4) {
3977 return Err(fidl::Error::InvalidInlineBitInEnvelope);
3978 }
3979 let inner_offset;
3980 let mut inner_depth = depth.clone();
3981 if inlined {
3982 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
3983 inner_offset = next_offset;
3984 } else {
3985 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
3986 inner_depth.increment()?;
3987 }
3988 let val_ref = self
3989 .bssid
3990 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
3991 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
3992 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
3993 {
3994 return Err(fidl::Error::InvalidNumBytesInEnvelope);
3995 }
3996 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
3997 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
3998 }
3999 }
4000
4001 next_offset += envelope_size;
4002 _next_ordinal_to_read += 1;
4003 if next_offset >= end_offset {
4004 return Ok(());
4005 }
4006
4007 while _next_ordinal_to_read < 2 {
4009 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4010 _next_ordinal_to_read += 1;
4011 next_offset += envelope_size;
4012 }
4013
4014 let next_out_of_line = decoder.next_out_of_line();
4015 let handles_before = decoder.remaining_handles();
4016 if let Some((inlined, num_bytes, num_handles)) =
4017 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4018 {
4019 let member_inline_size =
4020 <BssType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4021 if inlined != (member_inline_size <= 4) {
4022 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4023 }
4024 let inner_offset;
4025 let mut inner_depth = depth.clone();
4026 if inlined {
4027 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4028 inner_offset = next_offset;
4029 } else {
4030 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4031 inner_depth.increment()?;
4032 }
4033 let val_ref = self.bss_type.get_or_insert_with(|| fidl::new_empty!(BssType, D));
4034 fidl::decode!(BssType, D, val_ref, decoder, inner_offset, inner_depth)?;
4035 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4036 {
4037 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4038 }
4039 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4040 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4041 }
4042 }
4043
4044 next_offset += envelope_size;
4045 _next_ordinal_to_read += 1;
4046 if next_offset >= end_offset {
4047 return Ok(());
4048 }
4049
4050 while _next_ordinal_to_read < 3 {
4052 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4053 _next_ordinal_to_read += 1;
4054 next_offset += envelope_size;
4055 }
4056
4057 let next_out_of_line = decoder.next_out_of_line();
4058 let handles_before = decoder.remaining_handles();
4059 if let Some((inlined, num_bytes, num_handles)) =
4060 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4061 {
4062 let member_inline_size =
4063 <bool as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4064 if inlined != (member_inline_size <= 4) {
4065 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4066 }
4067 let inner_offset;
4068 let mut inner_depth = depth.clone();
4069 if inlined {
4070 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4071 inner_offset = next_offset;
4072 } else {
4073 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4074 inner_depth.increment()?;
4075 }
4076 let val_ref = self.remote.get_or_insert_with(|| fidl::new_empty!(bool, D));
4077 fidl::decode!(bool, D, val_ref, decoder, inner_offset, inner_depth)?;
4078 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4079 {
4080 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4081 }
4082 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4083 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4084 }
4085 }
4086
4087 next_offset += envelope_size;
4088 _next_ordinal_to_read += 1;
4089 if next_offset >= end_offset {
4090 return Ok(());
4091 }
4092
4093 while _next_ordinal_to_read < 4 {
4095 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4096 _next_ordinal_to_read += 1;
4097 next_offset += envelope_size;
4098 }
4099
4100 let next_out_of_line = decoder.next_out_of_line();
4101 let handles_before = decoder.remaining_handles();
4102 if let Some((inlined, num_bytes, num_handles)) =
4103 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4104 {
4105 let member_inline_size =
4106 <u16 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4107 if inlined != (member_inline_size <= 4) {
4108 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4109 }
4110 let inner_offset;
4111 let mut inner_depth = depth.clone();
4112 if inlined {
4113 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4114 inner_offset = next_offset;
4115 } else {
4116 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4117 inner_depth.increment()?;
4118 }
4119 let val_ref = self.beacon_period.get_or_insert_with(|| fidl::new_empty!(u16, D));
4120 fidl::decode!(u16, D, val_ref, decoder, inner_offset, inner_depth)?;
4121 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4122 {
4123 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4124 }
4125 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4126 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4127 }
4128 }
4129
4130 next_offset += envelope_size;
4131
4132 while next_offset < end_offset {
4134 _next_ordinal_to_read += 1;
4135 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4136 next_offset += envelope_size;
4137 }
4138
4139 Ok(())
4140 }
4141 }
4142
4143 impl WlanKeyConfig {
4144 #[inline(always)]
4145 fn max_ordinal_present(&self) -> u64 {
4146 if let Some(_) = self.rsc {
4147 return 8;
4148 }
4149 if let Some(_) = self.key {
4150 return 7;
4151 }
4152 if let Some(_) = self.key_idx {
4153 return 6;
4154 }
4155 if let Some(_) = self.peer_addr {
4156 return 5;
4157 }
4158 if let Some(_) = self.key_type {
4159 return 4;
4160 }
4161 if let Some(_) = self.cipher_type {
4162 return 3;
4163 }
4164 if let Some(_) = self.cipher_oui {
4165 return 2;
4166 }
4167 if let Some(_) = self.protection {
4168 return 1;
4169 }
4170 0
4171 }
4172 }
4173
4174 impl fidl::encoding::ValueTypeMarker for WlanKeyConfig {
4175 type Borrowed<'a> = &'a Self;
4176 fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
4177 value
4178 }
4179 }
4180
4181 unsafe impl fidl::encoding::TypeMarker for WlanKeyConfig {
4182 type Owned = Self;
4183
4184 #[inline(always)]
4185 fn inline_align(_context: fidl::encoding::Context) -> usize {
4186 8
4187 }
4188
4189 #[inline(always)]
4190 fn inline_size(_context: fidl::encoding::Context) -> usize {
4191 16
4192 }
4193 }
4194
4195 unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfig, D>
4196 for &WlanKeyConfig
4197 {
4198 unsafe fn encode(
4199 self,
4200 encoder: &mut fidl::encoding::Encoder<'_, D>,
4201 offset: usize,
4202 mut depth: fidl::encoding::Depth,
4203 ) -> fidl::Result<()> {
4204 encoder.debug_check_bounds::<WlanKeyConfig>(offset);
4205 let max_ordinal: u64 = self.max_ordinal_present();
4207 encoder.write_num(max_ordinal, offset);
4208 encoder.write_num(fidl::encoding::ALLOC_PRESENT_U64, offset + 8);
4209 if max_ordinal == 0 {
4211 return Ok(());
4212 }
4213 depth.increment()?;
4214 let envelope_size = 8;
4215 let bytes_len = max_ordinal as usize * envelope_size;
4216 #[allow(unused_variables)]
4217 let offset = encoder.out_of_line_offset(bytes_len);
4218 let mut _prev_end_offset: usize = 0;
4219 if 1 > max_ordinal {
4220 return Ok(());
4221 }
4222
4223 let cur_offset: usize = (1 - 1) * envelope_size;
4226
4227 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4229
4230 fidl::encoding::encode_in_envelope_optional::<WlanProtection, D>(
4235 self.protection
4236 .as_ref()
4237 .map(<WlanProtection as fidl::encoding::ValueTypeMarker>::borrow),
4238 encoder,
4239 offset + cur_offset,
4240 depth,
4241 )?;
4242
4243 _prev_end_offset = cur_offset + envelope_size;
4244 if 2 > max_ordinal {
4245 return Ok(());
4246 }
4247
4248 let cur_offset: usize = (2 - 1) * envelope_size;
4251
4252 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4254
4255 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 3>, D>(
4260 self.cipher_oui
4261 .as_ref()
4262 .map(<fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow),
4263 encoder,
4264 offset + cur_offset,
4265 depth,
4266 )?;
4267
4268 _prev_end_offset = cur_offset + envelope_size;
4269 if 3 > max_ordinal {
4270 return Ok(());
4271 }
4272
4273 let cur_offset: usize = (3 - 1) * envelope_size;
4276
4277 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4279
4280 fidl::encoding::encode_in_envelope_optional::<fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType, D>(
4285 self.cipher_type.as_ref().map(<fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType as fidl::encoding::ValueTypeMarker>::borrow),
4286 encoder, offset + cur_offset, depth
4287 )?;
4288
4289 _prev_end_offset = cur_offset + envelope_size;
4290 if 4 > max_ordinal {
4291 return Ok(());
4292 }
4293
4294 let cur_offset: usize = (4 - 1) * envelope_size;
4297
4298 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4300
4301 fidl::encoding::encode_in_envelope_optional::<WlanKeyType, D>(
4306 self.key_type
4307 .as_ref()
4308 .map(<WlanKeyType as fidl::encoding::ValueTypeMarker>::borrow),
4309 encoder,
4310 offset + cur_offset,
4311 depth,
4312 )?;
4313
4314 _prev_end_offset = cur_offset + envelope_size;
4315 if 5 > max_ordinal {
4316 return Ok(());
4317 }
4318
4319 let cur_offset: usize = (5 - 1) * envelope_size;
4322
4323 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4325
4326 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Array<u8, 6>, D>(
4331 self.peer_addr
4332 .as_ref()
4333 .map(<fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow),
4334 encoder,
4335 offset + cur_offset,
4336 depth,
4337 )?;
4338
4339 _prev_end_offset = cur_offset + envelope_size;
4340 if 6 > max_ordinal {
4341 return Ok(());
4342 }
4343
4344 let cur_offset: usize = (6 - 1) * envelope_size;
4347
4348 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4350
4351 fidl::encoding::encode_in_envelope_optional::<u8, D>(
4356 self.key_idx.as_ref().map(<u8 as fidl::encoding::ValueTypeMarker>::borrow),
4357 encoder,
4358 offset + cur_offset,
4359 depth,
4360 )?;
4361
4362 _prev_end_offset = cur_offset + envelope_size;
4363 if 7 > max_ordinal {
4364 return Ok(());
4365 }
4366
4367 let cur_offset: usize = (7 - 1) * envelope_size;
4370
4371 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4373
4374 fidl::encoding::encode_in_envelope_optional::<fidl::encoding::Vector<u8, 32>, D>(
4379 self.key.as_ref().map(
4380 <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow,
4381 ),
4382 encoder,
4383 offset + cur_offset,
4384 depth,
4385 )?;
4386
4387 _prev_end_offset = cur_offset + envelope_size;
4388 if 8 > max_ordinal {
4389 return Ok(());
4390 }
4391
4392 let cur_offset: usize = (8 - 1) * envelope_size;
4395
4396 encoder.padding(offset + _prev_end_offset, cur_offset - _prev_end_offset);
4398
4399 fidl::encoding::encode_in_envelope_optional::<u64, D>(
4404 self.rsc.as_ref().map(<u64 as fidl::encoding::ValueTypeMarker>::borrow),
4405 encoder,
4406 offset + cur_offset,
4407 depth,
4408 )?;
4409
4410 _prev_end_offset = cur_offset + envelope_size;
4411
4412 Ok(())
4413 }
4414 }
4415
4416 impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfig {
4417 #[inline(always)]
4418 fn new_empty() -> Self {
4419 Self::default()
4420 }
4421
4422 unsafe fn decode(
4423 &mut self,
4424 decoder: &mut fidl::encoding::Decoder<'_, D>,
4425 offset: usize,
4426 mut depth: fidl::encoding::Depth,
4427 ) -> fidl::Result<()> {
4428 decoder.debug_check_bounds::<Self>(offset);
4429 let len = match fidl::encoding::decode_vector_header(decoder, offset)? {
4430 None => return Err(fidl::Error::NotNullable),
4431 Some(len) => len,
4432 };
4433 if len == 0 {
4435 return Ok(());
4436 };
4437 depth.increment()?;
4438 let envelope_size = 8;
4439 let bytes_len = len * envelope_size;
4440 let offset = decoder.out_of_line_offset(bytes_len)?;
4441 let mut _next_ordinal_to_read = 0;
4443 let mut next_offset = offset;
4444 let end_offset = offset + bytes_len;
4445 _next_ordinal_to_read += 1;
4446 if next_offset >= end_offset {
4447 return Ok(());
4448 }
4449
4450 while _next_ordinal_to_read < 1 {
4452 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4453 _next_ordinal_to_read += 1;
4454 next_offset += envelope_size;
4455 }
4456
4457 let next_out_of_line = decoder.next_out_of_line();
4458 let handles_before = decoder.remaining_handles();
4459 if let Some((inlined, num_bytes, num_handles)) =
4460 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4461 {
4462 let member_inline_size =
4463 <WlanProtection as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4464 if inlined != (member_inline_size <= 4) {
4465 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4466 }
4467 let inner_offset;
4468 let mut inner_depth = depth.clone();
4469 if inlined {
4470 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4471 inner_offset = next_offset;
4472 } else {
4473 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4474 inner_depth.increment()?;
4475 }
4476 let val_ref =
4477 self.protection.get_or_insert_with(|| fidl::new_empty!(WlanProtection, D));
4478 fidl::decode!(WlanProtection, D, val_ref, decoder, inner_offset, inner_depth)?;
4479 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4480 {
4481 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4482 }
4483 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4484 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4485 }
4486 }
4487
4488 next_offset += envelope_size;
4489 _next_ordinal_to_read += 1;
4490 if next_offset >= end_offset {
4491 return Ok(());
4492 }
4493
4494 while _next_ordinal_to_read < 2 {
4496 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4497 _next_ordinal_to_read += 1;
4498 next_offset += envelope_size;
4499 }
4500
4501 let next_out_of_line = decoder.next_out_of_line();
4502 let handles_before = decoder.remaining_handles();
4503 if let Some((inlined, num_bytes, num_handles)) =
4504 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4505 {
4506 let member_inline_size =
4507 <fidl::encoding::Array<u8, 3> as fidl::encoding::TypeMarker>::inline_size(
4508 decoder.context,
4509 );
4510 if inlined != (member_inline_size <= 4) {
4511 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4512 }
4513 let inner_offset;
4514 let mut inner_depth = depth.clone();
4515 if inlined {
4516 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4517 inner_offset = next_offset;
4518 } else {
4519 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4520 inner_depth.increment()?;
4521 }
4522 let val_ref = self
4523 .cipher_oui
4524 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 3>, D));
4525 fidl::decode!(fidl::encoding::Array<u8, 3>, D, val_ref, decoder, inner_offset, inner_depth)?;
4526 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4527 {
4528 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4529 }
4530 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4531 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4532 }
4533 }
4534
4535 next_offset += envelope_size;
4536 _next_ordinal_to_read += 1;
4537 if next_offset >= end_offset {
4538 return Ok(());
4539 }
4540
4541 while _next_ordinal_to_read < 3 {
4543 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4544 _next_ordinal_to_read += 1;
4545 next_offset += envelope_size;
4546 }
4547
4548 let next_out_of_line = decoder.next_out_of_line();
4549 let handles_before = decoder.remaining_handles();
4550 if let Some((inlined, num_bytes, num_handles)) =
4551 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4552 {
4553 let member_inline_size = <fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4554 if inlined != (member_inline_size <= 4) {
4555 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4556 }
4557 let inner_offset;
4558 let mut inner_depth = depth.clone();
4559 if inlined {
4560 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4561 inner_offset = next_offset;
4562 } else {
4563 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4564 inner_depth.increment()?;
4565 }
4566 let val_ref = self.cipher_type.get_or_insert_with(|| {
4567 fidl::new_empty!(fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType, D)
4568 });
4569 fidl::decode!(
4570 fidl_fuchsia_wlan_ieee80211__common::CipherSuiteType,
4571 D,
4572 val_ref,
4573 decoder,
4574 inner_offset,
4575 inner_depth
4576 )?;
4577 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4578 {
4579 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4580 }
4581 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4582 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4583 }
4584 }
4585
4586 next_offset += envelope_size;
4587 _next_ordinal_to_read += 1;
4588 if next_offset >= end_offset {
4589 return Ok(());
4590 }
4591
4592 while _next_ordinal_to_read < 4 {
4594 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4595 _next_ordinal_to_read += 1;
4596 next_offset += envelope_size;
4597 }
4598
4599 let next_out_of_line = decoder.next_out_of_line();
4600 let handles_before = decoder.remaining_handles();
4601 if let Some((inlined, num_bytes, num_handles)) =
4602 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4603 {
4604 let member_inline_size =
4605 <WlanKeyType as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4606 if inlined != (member_inline_size <= 4) {
4607 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4608 }
4609 let inner_offset;
4610 let mut inner_depth = depth.clone();
4611 if inlined {
4612 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4613 inner_offset = next_offset;
4614 } else {
4615 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4616 inner_depth.increment()?;
4617 }
4618 let val_ref = self.key_type.get_or_insert_with(|| fidl::new_empty!(WlanKeyType, D));
4619 fidl::decode!(WlanKeyType, D, val_ref, decoder, inner_offset, inner_depth)?;
4620 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4621 {
4622 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4623 }
4624 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4625 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4626 }
4627 }
4628
4629 next_offset += envelope_size;
4630 _next_ordinal_to_read += 1;
4631 if next_offset >= end_offset {
4632 return Ok(());
4633 }
4634
4635 while _next_ordinal_to_read < 5 {
4637 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4638 _next_ordinal_to_read += 1;
4639 next_offset += envelope_size;
4640 }
4641
4642 let next_out_of_line = decoder.next_out_of_line();
4643 let handles_before = decoder.remaining_handles();
4644 if let Some((inlined, num_bytes, num_handles)) =
4645 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4646 {
4647 let member_inline_size =
4648 <fidl::encoding::Array<u8, 6> as fidl::encoding::TypeMarker>::inline_size(
4649 decoder.context,
4650 );
4651 if inlined != (member_inline_size <= 4) {
4652 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4653 }
4654 let inner_offset;
4655 let mut inner_depth = depth.clone();
4656 if inlined {
4657 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4658 inner_offset = next_offset;
4659 } else {
4660 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4661 inner_depth.increment()?;
4662 }
4663 let val_ref = self
4664 .peer_addr
4665 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Array<u8, 6>, D));
4666 fidl::decode!(fidl::encoding::Array<u8, 6>, D, val_ref, decoder, inner_offset, inner_depth)?;
4667 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4668 {
4669 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4670 }
4671 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4672 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4673 }
4674 }
4675
4676 next_offset += envelope_size;
4677 _next_ordinal_to_read += 1;
4678 if next_offset >= end_offset {
4679 return Ok(());
4680 }
4681
4682 while _next_ordinal_to_read < 6 {
4684 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4685 _next_ordinal_to_read += 1;
4686 next_offset += envelope_size;
4687 }
4688
4689 let next_out_of_line = decoder.next_out_of_line();
4690 let handles_before = decoder.remaining_handles();
4691 if let Some((inlined, num_bytes, num_handles)) =
4692 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4693 {
4694 let member_inline_size =
4695 <u8 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4696 if inlined != (member_inline_size <= 4) {
4697 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4698 }
4699 let inner_offset;
4700 let mut inner_depth = depth.clone();
4701 if inlined {
4702 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4703 inner_offset = next_offset;
4704 } else {
4705 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4706 inner_depth.increment()?;
4707 }
4708 let val_ref = self.key_idx.get_or_insert_with(|| fidl::new_empty!(u8, D));
4709 fidl::decode!(u8, D, val_ref, decoder, inner_offset, inner_depth)?;
4710 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4711 {
4712 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4713 }
4714 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4715 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4716 }
4717 }
4718
4719 next_offset += envelope_size;
4720 _next_ordinal_to_read += 1;
4721 if next_offset >= end_offset {
4722 return Ok(());
4723 }
4724
4725 while _next_ordinal_to_read < 7 {
4727 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4728 _next_ordinal_to_read += 1;
4729 next_offset += envelope_size;
4730 }
4731
4732 let next_out_of_line = decoder.next_out_of_line();
4733 let handles_before = decoder.remaining_handles();
4734 if let Some((inlined, num_bytes, num_handles)) =
4735 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4736 {
4737 let member_inline_size =
4738 <fidl::encoding::Vector<u8, 32> as fidl::encoding::TypeMarker>::inline_size(
4739 decoder.context,
4740 );
4741 if inlined != (member_inline_size <= 4) {
4742 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4743 }
4744 let inner_offset;
4745 let mut inner_depth = depth.clone();
4746 if inlined {
4747 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4748 inner_offset = next_offset;
4749 } else {
4750 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4751 inner_depth.increment()?;
4752 }
4753 let val_ref = self
4754 .key
4755 .get_or_insert_with(|| fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D));
4756 fidl::decode!(fidl::encoding::Vector<u8, 32>, D, val_ref, decoder, inner_offset, inner_depth)?;
4757 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4758 {
4759 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4760 }
4761 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4762 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4763 }
4764 }
4765
4766 next_offset += envelope_size;
4767 _next_ordinal_to_read += 1;
4768 if next_offset >= end_offset {
4769 return Ok(());
4770 }
4771
4772 while _next_ordinal_to_read < 8 {
4774 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4775 _next_ordinal_to_read += 1;
4776 next_offset += envelope_size;
4777 }
4778
4779 let next_out_of_line = decoder.next_out_of_line();
4780 let handles_before = decoder.remaining_handles();
4781 if let Some((inlined, num_bytes, num_handles)) =
4782 fidl::encoding::decode_envelope_header(decoder, next_offset)?
4783 {
4784 let member_inline_size =
4785 <u64 as fidl::encoding::TypeMarker>::inline_size(decoder.context);
4786 if inlined != (member_inline_size <= 4) {
4787 return Err(fidl::Error::InvalidInlineBitInEnvelope);
4788 }
4789 let inner_offset;
4790 let mut inner_depth = depth.clone();
4791 if inlined {
4792 decoder.check_inline_envelope_padding(next_offset, member_inline_size)?;
4793 inner_offset = next_offset;
4794 } else {
4795 inner_offset = decoder.out_of_line_offset(member_inline_size)?;
4796 inner_depth.increment()?;
4797 }
4798 let val_ref = self.rsc.get_or_insert_with(|| fidl::new_empty!(u64, D));
4799 fidl::decode!(u64, D, val_ref, decoder, inner_offset, inner_depth)?;
4800 if !inlined && decoder.next_out_of_line() != next_out_of_line + (num_bytes as usize)
4801 {
4802 return Err(fidl::Error::InvalidNumBytesInEnvelope);
4803 }
4804 if handles_before != decoder.remaining_handles() + (num_handles as usize) {
4805 return Err(fidl::Error::InvalidNumHandlesInEnvelope);
4806 }
4807 }
4808
4809 next_offset += envelope_size;
4810
4811 while next_offset < end_offset {
4813 _next_ordinal_to_read += 1;
4814 fidl::encoding::decode_unknown_envelope(decoder, next_offset, depth)?;
4815 next_offset += envelope_size;
4816 }
4817
4818 Ok(())
4819 }
4820 }
4821}