fidl_fuchsia_wlan_tap__common/
fidl_fuchsia_wlan_tap__common.rs

1// WARNING: This file is machine generated by fidlgen.
2
3#![warn(clippy::all)]
4#![allow(unused_parens, unused_mut, unused_imports, nonstandard_style)]
5
6use bitflags::bitflags;
7use fidl::encoding::{MessageBufFor, ProxyChannelBox, ResourceDialect};
8use futures::future::{self, MaybeDone, TryFutureExt};
9use zx_status;
10
11#[derive(Clone, Debug, PartialEq)]
12pub struct JoinBssArgs {
13    pub wlan_softmac_id: u16,
14    pub config: fidl_fuchsia_wlan_common__common::JoinBssRequest,
15}
16
17impl fidl::Persistable for JoinBssArgs {}
18
19#[derive(Clone, Debug, PartialEq)]
20pub struct SetChannelArgs {
21    pub wlan_softmac_id: u16,
22    pub channel: fidl_fuchsia_wlan_common__common::WlanChannel,
23}
24
25impl fidl::Persistable for SetChannelArgs {}
26
27/// Country code the device is to switch to.
28/// These values are populated by the wlantap driver and should not be specified manually.
29/// See also phy.fidl CountryCode.
30#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
31#[repr(C)]
32pub struct SetCountryArgs {
33    pub alpha2: [u8; 2],
34}
35
36impl fidl::Persistable for SetCountryArgs {}
37
38#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
39pub struct SetKeyArgs {
40    pub wlan_softmac_id: u16,
41    pub config: WlanKeyConfig,
42}
43
44impl fidl::Persistable for SetKeyArgs {}
45
46#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
47#[repr(C)]
48pub struct StartScanArgs {
49    pub wlan_softmac_id: u16,
50    pub scan_id: u64,
51}
52
53impl fidl::Persistable for StartScanArgs {}
54
55#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
56pub struct TxArgs {
57    pub wlan_softmac_id: u16,
58    pub packet: WlanTxPacket,
59}
60
61impl fidl::Persistable for TxArgs {}
62
63/// Configuration pertaining to security keys, often used by RSN and other secure authentication.
64/// These values are populated by the wlantap driver and should not be specified manually.
65/// See wlan_key_config_t for details about each field.
66#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
67pub struct WlanKeyConfig {
68    pub protection: u8,
69    pub cipher_oui: [u8; 3],
70    pub cipher_type: u8,
71    pub key_type: u8,
72    pub peer_addr: [u8; 6],
73    pub key_idx: u8,
74    pub key: Vec<u8>,
75}
76
77impl fidl::Persistable for WlanKeyConfig {}
78
79/// Information pertaining to incoming packets. One WlanRxInfo is associated with each packet.
80/// You are encouraged to use the default value in //src/connectivity/wlan/testing/hw-sim/src/lib.rs
81/// See wlan_rx_info_t for details about each field.
82#[derive(Clone, Debug, PartialEq)]
83pub struct WlanRxInfo {
84    pub rx_flags: u32,
85    pub valid_fields: u32,
86    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
87    pub data_rate: u32,
88    pub channel: fidl_fuchsia_wlan_common__common::WlanChannel,
89    pub mcs: u8,
90    pub rssi_dbm: i8,
91    pub snr_dbh: i16,
92}
93
94impl fidl::Persistable for WlanRxInfo {}
95
96/// Instruction from generic WLAN driver on how to send a packet. One WlanTxInfo per packet.
97/// These values are populated by the wlantap driver and should not be specified manually.
98/// See wlan_tx_info_t for details about each field.
99#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
100pub struct WlanTxInfo {
101    pub tx_flags: u32,
102    pub valid_fields: u32,
103    pub tx_vector_idx: u16,
104    pub phy: fidl_fuchsia_wlan_common__common::WlanPhyType,
105    pub cbw: u8,
106    pub mcs: u8,
107}
108
109impl fidl::Persistable for WlanTxInfo {}
110
111/// An outgoing packet that is to be "sent" by the wlantap device. `data` contains the packet
112/// in its wire format.
113#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
114pub struct WlanTxPacket {
115    pub data: Vec<u8>,
116    pub info: WlanTxInfo,
117}
118
119impl fidl::Persistable for WlanTxPacket {}
120
121#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
122#[repr(C)]
123pub struct WlantapCtlCreatePhyResponse {
124    pub status: i32,
125}
126
127impl fidl::Persistable for WlantapCtlCreatePhyResponse {}
128
129/// Describes the capabilities of the fake wlantap-phy device to be created.
130#[derive(Clone, Debug, PartialEq)]
131pub struct WlantapPhyConfig {
132    pub sta_addr: [u8; 6],
133    pub mac_role: fidl_fuchsia_wlan_common__common::WlanMacRole,
134    pub supported_phys: Vec<fidl_fuchsia_wlan_common__common::WlanPhyType>,
135    pub hardware_capability: u32,
136    pub bands: Vec<fidl_fuchsia_wlan_device__common::BandInfo>,
137    pub name: String,
138    pub quiet: bool,
139    pub discovery_support: fidl_fuchsia_wlan_softmac__common::DiscoverySupport,
140    pub mac_sublayer_support: fidl_fuchsia_wlan_common__common::MacSublayerSupport,
141    pub security_support: fidl_fuchsia_wlan_common__common::SecuritySupport,
142    pub spectrum_management_support: fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
143}
144
145impl fidl::Persistable for WlantapPhyConfig {}
146
147#[derive(Clone, Debug, PartialEq)]
148pub struct WlantapPhyJoinBssRequest {
149    pub args: JoinBssArgs,
150}
151
152impl fidl::Persistable for WlantapPhyJoinBssRequest {}
153
154#[derive(Clone, Debug, PartialEq)]
155pub struct WlantapPhyReportTxResultRequest {
156    pub txr: fidl_fuchsia_wlan_common__common::WlanTxResult,
157}
158
159impl fidl::Persistable for WlantapPhyReportTxResultRequest {}
160
161#[derive(Clone, Debug, PartialEq)]
162pub struct WlantapPhyRxRequest {
163    pub data: Vec<u8>,
164    pub info: WlanRxInfo,
165}
166
167impl fidl::Persistable for WlantapPhyRxRequest {}
168
169#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
170#[repr(C)]
171pub struct WlantapPhyScanCompleteRequest {
172    pub scan_id: u64,
173    pub status: i32,
174}
175
176impl fidl::Persistable for WlantapPhyScanCompleteRequest {}
177
178#[derive(Clone, Debug, PartialEq)]
179pub struct WlantapPhySetChannelRequest {
180    pub args: SetChannelArgs,
181}
182
183impl fidl::Persistable for WlantapPhySetChannelRequest {}
184
185#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
186#[repr(C)]
187pub struct WlantapPhySetCountryRequest {
188    pub args: SetCountryArgs,
189}
190
191impl fidl::Persistable for WlantapPhySetCountryRequest {}
192
193#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
194pub struct WlantapPhySetKeyRequest {
195    pub args: SetKeyArgs,
196}
197
198impl fidl::Persistable for WlantapPhySetKeyRequest {}
199
200#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
201#[repr(C)]
202pub struct WlantapPhyStartScanRequest {
203    pub args: StartScanArgs,
204}
205
206impl fidl::Persistable for WlantapPhyStartScanRequest {}
207
208#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
209pub struct WlantapPhyTxRequest {
210    pub args: TxArgs,
211}
212
213impl fidl::Persistable for WlantapPhyTxRequest {}
214
215pub mod wlantap_ctl_ordinals {
216    pub const CREATE_PHY: u64 = 0x50273d8f10ceb35d;
217}
218
219pub mod wlantap_phy_ordinals {
220    pub const SHUTDOWN: u64 = 0x1df8087c49fa9a5e;
221    pub const RX: u64 = 0x165a656419ab3b41;
222    pub const REPORT_TX_RESULT: u64 = 0x2c27ed678c1e7eb4;
223    pub const SCAN_COMPLETE: u64 = 0x61a579015cff7674;
224    pub const TX: u64 = 0x3ccc6c207280b569;
225    pub const WLAN_SOFTMAC_START: u64 = 0x328bcae20dec2b88;
226    pub const SET_CHANNEL: u64 = 0x60eb9a607f96a948;
227    pub const JOIN_BSS: u64 = 0xef930e871dbf2f9;
228    pub const START_SCAN: u64 = 0x75ed87321e05cdbb;
229    pub const SET_KEY: u64 = 0xff7bf591b026267;
230    pub const SET_COUNTRY: u64 = 0x4cd2f84e3ccfcd14;
231}
232
233mod internal {
234    use super::*;
235
236    impl fidl::encoding::ValueTypeMarker for JoinBssArgs {
237        type Borrowed<'a> = &'a Self;
238        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
239            value
240        }
241    }
242
243    unsafe impl fidl::encoding::TypeMarker for JoinBssArgs {
244        type Owned = Self;
245
246        #[inline(always)]
247        fn inline_align(_context: fidl::encoding::Context) -> usize {
248            8
249        }
250
251        #[inline(always)]
252        fn inline_size(_context: fidl::encoding::Context) -> usize {
253            24
254        }
255    }
256
257    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<JoinBssArgs, D>
258        for &JoinBssArgs
259    {
260        #[inline]
261        unsafe fn encode(
262            self,
263            encoder: &mut fidl::encoding::Encoder<'_, D>,
264            offset: usize,
265            _depth: fidl::encoding::Depth,
266        ) -> fidl::Result<()> {
267            encoder.debug_check_bounds::<JoinBssArgs>(offset);
268            // Delegate to tuple encoding.
269            fidl::encoding::Encode::<JoinBssArgs, D>::encode(
270                (
271                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
272                    <fidl_fuchsia_wlan_common__common::JoinBssRequest as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
273                ),
274                encoder, offset, _depth
275            )
276        }
277    }
278    unsafe impl<
279            D: fidl::encoding::ResourceDialect,
280            T0: fidl::encoding::Encode<u16, D>,
281            T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::JoinBssRequest, D>,
282        > fidl::encoding::Encode<JoinBssArgs, D> for (T0, T1)
283    {
284        #[inline]
285        unsafe fn encode(
286            self,
287            encoder: &mut fidl::encoding::Encoder<'_, D>,
288            offset: usize,
289            depth: fidl::encoding::Depth,
290        ) -> fidl::Result<()> {
291            encoder.debug_check_bounds::<JoinBssArgs>(offset);
292            // Zero out padding regions. There's no need to apply masks
293            // because the unmasked parts will be overwritten by fields.
294            unsafe {
295                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
296                (ptr as *mut u64).write_unaligned(0);
297            }
298            // Write the fields.
299            self.0.encode(encoder, offset + 0, depth)?;
300            self.1.encode(encoder, offset + 8, depth)?;
301            Ok(())
302        }
303    }
304
305    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for JoinBssArgs {
306        #[inline(always)]
307        fn new_empty() -> Self {
308            Self {
309                wlan_softmac_id: fidl::new_empty!(u16, D),
310                config: fidl::new_empty!(fidl_fuchsia_wlan_common__common::JoinBssRequest, D),
311            }
312        }
313
314        #[inline]
315        unsafe fn decode(
316            &mut self,
317            decoder: &mut fidl::encoding::Decoder<'_, D>,
318            offset: usize,
319            _depth: fidl::encoding::Depth,
320        ) -> fidl::Result<()> {
321            decoder.debug_check_bounds::<Self>(offset);
322            // Verify that padding bytes are zero.
323            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
324            let padval = unsafe { (ptr as *const u64).read_unaligned() };
325            let mask = 0xffffffffffff0000u64;
326            let maskedval = padval & mask;
327            if maskedval != 0 {
328                return Err(fidl::Error::NonZeroPadding {
329                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
330                });
331            }
332            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
333            fidl::decode!(
334                fidl_fuchsia_wlan_common__common::JoinBssRequest,
335                D,
336                &mut self.config,
337                decoder,
338                offset + 8,
339                _depth
340            )?;
341            Ok(())
342        }
343    }
344
345    impl fidl::encoding::ValueTypeMarker for SetChannelArgs {
346        type Borrowed<'a> = &'a Self;
347        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
348            value
349        }
350    }
351
352    unsafe impl fidl::encoding::TypeMarker for SetChannelArgs {
353        type Owned = Self;
354
355        #[inline(always)]
356        fn inline_align(_context: fidl::encoding::Context) -> usize {
357            4
358        }
359
360        #[inline(always)]
361        fn inline_size(_context: fidl::encoding::Context) -> usize {
362            16
363        }
364    }
365
366    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetChannelArgs, D>
367        for &SetChannelArgs
368    {
369        #[inline]
370        unsafe fn encode(
371            self,
372            encoder: &mut fidl::encoding::Encoder<'_, D>,
373            offset: usize,
374            _depth: fidl::encoding::Depth,
375        ) -> fidl::Result<()> {
376            encoder.debug_check_bounds::<SetChannelArgs>(offset);
377            // Delegate to tuple encoding.
378            fidl::encoding::Encode::<SetChannelArgs, D>::encode(
379                (
380                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
381                    <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
382                ),
383                encoder, offset, _depth
384            )
385        }
386    }
387    unsafe impl<
388            D: fidl::encoding::ResourceDialect,
389            T0: fidl::encoding::Encode<u16, D>,
390            T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanChannel, D>,
391        > fidl::encoding::Encode<SetChannelArgs, D> for (T0, T1)
392    {
393        #[inline]
394        unsafe fn encode(
395            self,
396            encoder: &mut fidl::encoding::Encoder<'_, D>,
397            offset: usize,
398            depth: fidl::encoding::Depth,
399        ) -> fidl::Result<()> {
400            encoder.debug_check_bounds::<SetChannelArgs>(offset);
401            // Zero out padding regions. There's no need to apply masks
402            // because the unmasked parts will be overwritten by fields.
403            unsafe {
404                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
405                (ptr as *mut u32).write_unaligned(0);
406            }
407            // Write the fields.
408            self.0.encode(encoder, offset + 0, depth)?;
409            self.1.encode(encoder, offset + 4, depth)?;
410            Ok(())
411        }
412    }
413
414    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetChannelArgs {
415        #[inline(always)]
416        fn new_empty() -> Self {
417            Self {
418                wlan_softmac_id: fidl::new_empty!(u16, D),
419                channel: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D),
420            }
421        }
422
423        #[inline]
424        unsafe fn decode(
425            &mut self,
426            decoder: &mut fidl::encoding::Decoder<'_, D>,
427            offset: usize,
428            _depth: fidl::encoding::Depth,
429        ) -> fidl::Result<()> {
430            decoder.debug_check_bounds::<Self>(offset);
431            // Verify that padding bytes are zero.
432            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
433            let padval = unsafe { (ptr as *const u32).read_unaligned() };
434            let mask = 0xffff0000u32;
435            let maskedval = padval & mask;
436            if maskedval != 0 {
437                return Err(fidl::Error::NonZeroPadding {
438                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
439                });
440            }
441            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
442            fidl::decode!(
443                fidl_fuchsia_wlan_common__common::WlanChannel,
444                D,
445                &mut self.channel,
446                decoder,
447                offset + 4,
448                _depth
449            )?;
450            Ok(())
451        }
452    }
453
454    impl fidl::encoding::ValueTypeMarker for SetCountryArgs {
455        type Borrowed<'a> = &'a Self;
456        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
457            value
458        }
459    }
460
461    unsafe impl fidl::encoding::TypeMarker for SetCountryArgs {
462        type Owned = Self;
463
464        #[inline(always)]
465        fn inline_align(_context: fidl::encoding::Context) -> usize {
466            1
467        }
468
469        #[inline(always)]
470        fn inline_size(_context: fidl::encoding::Context) -> usize {
471            2
472        }
473        #[inline(always)]
474        fn encode_is_copy() -> bool {
475            true
476        }
477
478        #[inline(always)]
479        fn decode_is_copy() -> bool {
480            true
481        }
482    }
483
484    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetCountryArgs, D>
485        for &SetCountryArgs
486    {
487        #[inline]
488        unsafe fn encode(
489            self,
490            encoder: &mut fidl::encoding::Encoder<'_, D>,
491            offset: usize,
492            _depth: fidl::encoding::Depth,
493        ) -> fidl::Result<()> {
494            encoder.debug_check_bounds::<SetCountryArgs>(offset);
495            unsafe {
496                // Copy the object into the buffer.
497                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
498                (buf_ptr as *mut SetCountryArgs)
499                    .write_unaligned((self as *const SetCountryArgs).read());
500                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
501                // done second because the memcpy will write garbage to these bytes.
502            }
503            Ok(())
504        }
505    }
506    unsafe impl<
507            D: fidl::encoding::ResourceDialect,
508            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 2>, D>,
509        > fidl::encoding::Encode<SetCountryArgs, D> for (T0,)
510    {
511        #[inline]
512        unsafe fn encode(
513            self,
514            encoder: &mut fidl::encoding::Encoder<'_, D>,
515            offset: usize,
516            depth: fidl::encoding::Depth,
517        ) -> fidl::Result<()> {
518            encoder.debug_check_bounds::<SetCountryArgs>(offset);
519            // Zero out padding regions. There's no need to apply masks
520            // because the unmasked parts will be overwritten by fields.
521            // Write the fields.
522            self.0.encode(encoder, offset + 0, depth)?;
523            Ok(())
524        }
525    }
526
527    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetCountryArgs {
528        #[inline(always)]
529        fn new_empty() -> Self {
530            Self { alpha2: fidl::new_empty!(fidl::encoding::Array<u8, 2>, D) }
531        }
532
533        #[inline]
534        unsafe fn decode(
535            &mut self,
536            decoder: &mut fidl::encoding::Decoder<'_, D>,
537            offset: usize,
538            _depth: fidl::encoding::Depth,
539        ) -> fidl::Result<()> {
540            decoder.debug_check_bounds::<Self>(offset);
541            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
542            // Verify that padding bytes are zero.
543            // Copy from the buffer into the object.
544            unsafe {
545                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
546            }
547            Ok(())
548        }
549    }
550
551    impl fidl::encoding::ValueTypeMarker for SetKeyArgs {
552        type Borrowed<'a> = &'a Self;
553        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
554            value
555        }
556    }
557
558    unsafe impl fidl::encoding::TypeMarker for SetKeyArgs {
559        type Owned = Self;
560
561        #[inline(always)]
562        fn inline_align(_context: fidl::encoding::Context) -> usize {
563            8
564        }
565
566        #[inline(always)]
567        fn inline_size(_context: fidl::encoding::Context) -> usize {
568            40
569        }
570    }
571
572    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<SetKeyArgs, D>
573        for &SetKeyArgs
574    {
575        #[inline]
576        unsafe fn encode(
577            self,
578            encoder: &mut fidl::encoding::Encoder<'_, D>,
579            offset: usize,
580            _depth: fidl::encoding::Depth,
581        ) -> fidl::Result<()> {
582            encoder.debug_check_bounds::<SetKeyArgs>(offset);
583            // Delegate to tuple encoding.
584            fidl::encoding::Encode::<SetKeyArgs, D>::encode(
585                (
586                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
587                    <WlanKeyConfig as fidl::encoding::ValueTypeMarker>::borrow(&self.config),
588                ),
589                encoder,
590                offset,
591                _depth,
592            )
593        }
594    }
595    unsafe impl<
596            D: fidl::encoding::ResourceDialect,
597            T0: fidl::encoding::Encode<u16, D>,
598            T1: fidl::encoding::Encode<WlanKeyConfig, D>,
599        > fidl::encoding::Encode<SetKeyArgs, D> for (T0, T1)
600    {
601        #[inline]
602        unsafe fn encode(
603            self,
604            encoder: &mut fidl::encoding::Encoder<'_, D>,
605            offset: usize,
606            depth: fidl::encoding::Depth,
607        ) -> fidl::Result<()> {
608            encoder.debug_check_bounds::<SetKeyArgs>(offset);
609            // Zero out padding regions. There's no need to apply masks
610            // because the unmasked parts will be overwritten by fields.
611            unsafe {
612                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
613                (ptr as *mut u64).write_unaligned(0);
614            }
615            // Write the fields.
616            self.0.encode(encoder, offset + 0, depth)?;
617            self.1.encode(encoder, offset + 8, depth)?;
618            Ok(())
619        }
620    }
621
622    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for SetKeyArgs {
623        #[inline(always)]
624        fn new_empty() -> Self {
625            Self {
626                wlan_softmac_id: fidl::new_empty!(u16, D),
627                config: fidl::new_empty!(WlanKeyConfig, D),
628            }
629        }
630
631        #[inline]
632        unsafe fn decode(
633            &mut self,
634            decoder: &mut fidl::encoding::Decoder<'_, D>,
635            offset: usize,
636            _depth: fidl::encoding::Depth,
637        ) -> fidl::Result<()> {
638            decoder.debug_check_bounds::<Self>(offset);
639            // Verify that padding bytes are zero.
640            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
641            let padval = unsafe { (ptr as *const u64).read_unaligned() };
642            let mask = 0xffffffffffff0000u64;
643            let maskedval = padval & mask;
644            if maskedval != 0 {
645                return Err(fidl::Error::NonZeroPadding {
646                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
647                });
648            }
649            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
650            fidl::decode!(WlanKeyConfig, D, &mut self.config, decoder, offset + 8, _depth)?;
651            Ok(())
652        }
653    }
654
655    impl fidl::encoding::ValueTypeMarker for StartScanArgs {
656        type Borrowed<'a> = &'a Self;
657        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
658            value
659        }
660    }
661
662    unsafe impl fidl::encoding::TypeMarker for StartScanArgs {
663        type Owned = Self;
664
665        #[inline(always)]
666        fn inline_align(_context: fidl::encoding::Context) -> usize {
667            8
668        }
669
670        #[inline(always)]
671        fn inline_size(_context: fidl::encoding::Context) -> usize {
672            16
673        }
674    }
675
676    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<StartScanArgs, D>
677        for &StartScanArgs
678    {
679        #[inline]
680        unsafe fn encode(
681            self,
682            encoder: &mut fidl::encoding::Encoder<'_, D>,
683            offset: usize,
684            _depth: fidl::encoding::Depth,
685        ) -> fidl::Result<()> {
686            encoder.debug_check_bounds::<StartScanArgs>(offset);
687            unsafe {
688                // Copy the object into the buffer.
689                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
690                (buf_ptr as *mut StartScanArgs)
691                    .write_unaligned((self as *const StartScanArgs).read());
692                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
693                // done second because the memcpy will write garbage to these bytes.
694                let padding_ptr = buf_ptr.offset(0) as *mut u64;
695                let padding_mask = 0xffffffffffff0000u64;
696                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
697            }
698            Ok(())
699        }
700    }
701    unsafe impl<
702            D: fidl::encoding::ResourceDialect,
703            T0: fidl::encoding::Encode<u16, D>,
704            T1: fidl::encoding::Encode<u64, D>,
705        > fidl::encoding::Encode<StartScanArgs, D> for (T0, T1)
706    {
707        #[inline]
708        unsafe fn encode(
709            self,
710            encoder: &mut fidl::encoding::Encoder<'_, D>,
711            offset: usize,
712            depth: fidl::encoding::Depth,
713        ) -> fidl::Result<()> {
714            encoder.debug_check_bounds::<StartScanArgs>(offset);
715            // Zero out padding regions. There's no need to apply masks
716            // because the unmasked parts will be overwritten by fields.
717            unsafe {
718                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
719                (ptr as *mut u64).write_unaligned(0);
720            }
721            // Write the fields.
722            self.0.encode(encoder, offset + 0, depth)?;
723            self.1.encode(encoder, offset + 8, depth)?;
724            Ok(())
725        }
726    }
727
728    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for StartScanArgs {
729        #[inline(always)]
730        fn new_empty() -> Self {
731            Self { wlan_softmac_id: fidl::new_empty!(u16, D), scan_id: fidl::new_empty!(u64, D) }
732        }
733
734        #[inline]
735        unsafe fn decode(
736            &mut self,
737            decoder: &mut fidl::encoding::Decoder<'_, D>,
738            offset: usize,
739            _depth: fidl::encoding::Depth,
740        ) -> fidl::Result<()> {
741            decoder.debug_check_bounds::<Self>(offset);
742            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
743            // Verify that padding bytes are zero.
744            let ptr = unsafe { buf_ptr.offset(0) };
745            let padval = unsafe { (ptr as *const u64).read_unaligned() };
746            let mask = 0xffffffffffff0000u64;
747            let maskedval = padval & mask;
748            if maskedval != 0 {
749                return Err(fidl::Error::NonZeroPadding {
750                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
751                });
752            }
753            // Copy from the buffer into the object.
754            unsafe {
755                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
756            }
757            Ok(())
758        }
759    }
760
761    impl fidl::encoding::ValueTypeMarker for TxArgs {
762        type Borrowed<'a> = &'a Self;
763        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
764            value
765        }
766    }
767
768    unsafe impl fidl::encoding::TypeMarker for TxArgs {
769        type Owned = Self;
770
771        #[inline(always)]
772        fn inline_align(_context: fidl::encoding::Context) -> usize {
773            8
774        }
775
776        #[inline(always)]
777        fn inline_size(_context: fidl::encoding::Context) -> usize {
778            48
779        }
780    }
781
782    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<TxArgs, D> for &TxArgs {
783        #[inline]
784        unsafe fn encode(
785            self,
786            encoder: &mut fidl::encoding::Encoder<'_, D>,
787            offset: usize,
788            _depth: fidl::encoding::Depth,
789        ) -> fidl::Result<()> {
790            encoder.debug_check_bounds::<TxArgs>(offset);
791            // Delegate to tuple encoding.
792            fidl::encoding::Encode::<TxArgs, D>::encode(
793                (
794                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.wlan_softmac_id),
795                    <WlanTxPacket as fidl::encoding::ValueTypeMarker>::borrow(&self.packet),
796                ),
797                encoder,
798                offset,
799                _depth,
800            )
801        }
802    }
803    unsafe impl<
804            D: fidl::encoding::ResourceDialect,
805            T0: fidl::encoding::Encode<u16, D>,
806            T1: fidl::encoding::Encode<WlanTxPacket, D>,
807        > fidl::encoding::Encode<TxArgs, D> for (T0, T1)
808    {
809        #[inline]
810        unsafe fn encode(
811            self,
812            encoder: &mut fidl::encoding::Encoder<'_, D>,
813            offset: usize,
814            depth: fidl::encoding::Depth,
815        ) -> fidl::Result<()> {
816            encoder.debug_check_bounds::<TxArgs>(offset);
817            // Zero out padding regions. There's no need to apply masks
818            // because the unmasked parts will be overwritten by fields.
819            unsafe {
820                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
821                (ptr as *mut u64).write_unaligned(0);
822            }
823            // Write the fields.
824            self.0.encode(encoder, offset + 0, depth)?;
825            self.1.encode(encoder, offset + 8, depth)?;
826            Ok(())
827        }
828    }
829
830    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for TxArgs {
831        #[inline(always)]
832        fn new_empty() -> Self {
833            Self {
834                wlan_softmac_id: fidl::new_empty!(u16, D),
835                packet: fidl::new_empty!(WlanTxPacket, D),
836            }
837        }
838
839        #[inline]
840        unsafe fn decode(
841            &mut self,
842            decoder: &mut fidl::encoding::Decoder<'_, D>,
843            offset: usize,
844            _depth: fidl::encoding::Depth,
845        ) -> fidl::Result<()> {
846            decoder.debug_check_bounds::<Self>(offset);
847            // Verify that padding bytes are zero.
848            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
849            let padval = unsafe { (ptr as *const u64).read_unaligned() };
850            let mask = 0xffffffffffff0000u64;
851            let maskedval = padval & mask;
852            if maskedval != 0 {
853                return Err(fidl::Error::NonZeroPadding {
854                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
855                });
856            }
857            fidl::decode!(u16, D, &mut self.wlan_softmac_id, decoder, offset + 0, _depth)?;
858            fidl::decode!(WlanTxPacket, D, &mut self.packet, decoder, offset + 8, _depth)?;
859            Ok(())
860        }
861    }
862
863    impl fidl::encoding::ValueTypeMarker for WlanKeyConfig {
864        type Borrowed<'a> = &'a Self;
865        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
866            value
867        }
868    }
869
870    unsafe impl fidl::encoding::TypeMarker for WlanKeyConfig {
871        type Owned = Self;
872
873        #[inline(always)]
874        fn inline_align(_context: fidl::encoding::Context) -> usize {
875            8
876        }
877
878        #[inline(always)]
879        fn inline_size(_context: fidl::encoding::Context) -> usize {
880            32
881        }
882    }
883
884    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanKeyConfig, D>
885        for &WlanKeyConfig
886    {
887        #[inline]
888        unsafe fn encode(
889            self,
890            encoder: &mut fidl::encoding::Encoder<'_, D>,
891            offset: usize,
892            _depth: fidl::encoding::Depth,
893        ) -> fidl::Result<()> {
894            encoder.debug_check_bounds::<WlanKeyConfig>(offset);
895            // Delegate to tuple encoding.
896            fidl::encoding::Encode::<WlanKeyConfig, D>::encode(
897                (
898                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.protection),
899                    <fidl::encoding::Array<u8, 3> as fidl::encoding::ValueTypeMarker>::borrow(
900                        &self.cipher_oui,
901                    ),
902                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.cipher_type),
903                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.key_type),
904                    <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(
905                        &self.peer_addr,
906                    ),
907                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.key_idx),
908                    <fidl::encoding::Vector<u8, 32> as fidl::encoding::ValueTypeMarker>::borrow(
909                        &self.key,
910                    ),
911                ),
912                encoder,
913                offset,
914                _depth,
915            )
916        }
917    }
918    unsafe impl<
919            D: fidl::encoding::ResourceDialect,
920            T0: fidl::encoding::Encode<u8, D>,
921            T1: fidl::encoding::Encode<fidl::encoding::Array<u8, 3>, D>,
922            T2: fidl::encoding::Encode<u8, D>,
923            T3: fidl::encoding::Encode<u8, D>,
924            T4: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
925            T5: fidl::encoding::Encode<u8, D>,
926            T6: fidl::encoding::Encode<fidl::encoding::Vector<u8, 32>, D>,
927        > fidl::encoding::Encode<WlanKeyConfig, D> for (T0, T1, T2, T3, T4, T5, T6)
928    {
929        #[inline]
930        unsafe fn encode(
931            self,
932            encoder: &mut fidl::encoding::Encoder<'_, D>,
933            offset: usize,
934            depth: fidl::encoding::Depth,
935        ) -> fidl::Result<()> {
936            encoder.debug_check_bounds::<WlanKeyConfig>(offset);
937            // Zero out padding regions. There's no need to apply masks
938            // because the unmasked parts will be overwritten by fields.
939            unsafe {
940                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
941                (ptr as *mut u64).write_unaligned(0);
942            }
943            // Write the fields.
944            self.0.encode(encoder, offset + 0, depth)?;
945            self.1.encode(encoder, offset + 1, depth)?;
946            self.2.encode(encoder, offset + 4, depth)?;
947            self.3.encode(encoder, offset + 5, depth)?;
948            self.4.encode(encoder, offset + 6, depth)?;
949            self.5.encode(encoder, offset + 12, depth)?;
950            self.6.encode(encoder, offset + 16, depth)?;
951            Ok(())
952        }
953    }
954
955    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanKeyConfig {
956        #[inline(always)]
957        fn new_empty() -> Self {
958            Self {
959                protection: fidl::new_empty!(u8, D),
960                cipher_oui: fidl::new_empty!(fidl::encoding::Array<u8, 3>, D),
961                cipher_type: fidl::new_empty!(u8, D),
962                key_type: fidl::new_empty!(u8, D),
963                peer_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
964                key_idx: fidl::new_empty!(u8, D),
965                key: fidl::new_empty!(fidl::encoding::Vector<u8, 32>, D),
966            }
967        }
968
969        #[inline]
970        unsafe fn decode(
971            &mut self,
972            decoder: &mut fidl::encoding::Decoder<'_, D>,
973            offset: usize,
974            _depth: fidl::encoding::Depth,
975        ) -> fidl::Result<()> {
976            decoder.debug_check_bounds::<Self>(offset);
977            // Verify that padding bytes are zero.
978            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
979            let padval = unsafe { (ptr as *const u64).read_unaligned() };
980            let mask = 0xffffff0000000000u64;
981            let maskedval = padval & mask;
982            if maskedval != 0 {
983                return Err(fidl::Error::NonZeroPadding {
984                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
985                });
986            }
987            fidl::decode!(u8, D, &mut self.protection, decoder, offset + 0, _depth)?;
988            fidl::decode!(fidl::encoding::Array<u8, 3>, D, &mut self.cipher_oui, decoder, offset + 1, _depth)?;
989            fidl::decode!(u8, D, &mut self.cipher_type, decoder, offset + 4, _depth)?;
990            fidl::decode!(u8, D, &mut self.key_type, decoder, offset + 5, _depth)?;
991            fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.peer_addr, decoder, offset + 6, _depth)?;
992            fidl::decode!(u8, D, &mut self.key_idx, decoder, offset + 12, _depth)?;
993            fidl::decode!(fidl::encoding::Vector<u8, 32>, D, &mut self.key, decoder, offset + 16, _depth)?;
994            Ok(())
995        }
996    }
997
998    impl fidl::encoding::ValueTypeMarker for WlanRxInfo {
999        type Borrowed<'a> = &'a Self;
1000        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1001            value
1002        }
1003    }
1004
1005    unsafe impl fidl::encoding::TypeMarker for WlanRxInfo {
1006        type Owned = Self;
1007
1008        #[inline(always)]
1009        fn inline_align(_context: fidl::encoding::Context) -> usize {
1010            4
1011        }
1012
1013        #[inline(always)]
1014        fn inline_size(_context: fidl::encoding::Context) -> usize {
1015            32
1016        }
1017    }
1018
1019    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanRxInfo, D>
1020        for &WlanRxInfo
1021    {
1022        #[inline]
1023        unsafe fn encode(
1024            self,
1025            encoder: &mut fidl::encoding::Encoder<'_, D>,
1026            offset: usize,
1027            _depth: fidl::encoding::Depth,
1028        ) -> fidl::Result<()> {
1029            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1030            // Delegate to tuple encoding.
1031            fidl::encoding::Encode::<WlanRxInfo, D>::encode(
1032                (
1033                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.rx_flags),
1034                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1035                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1036                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.data_rate),
1037                    <fidl_fuchsia_wlan_common__common::WlanChannel as fidl::encoding::ValueTypeMarker>::borrow(&self.channel),
1038                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1039                    <i8 as fidl::encoding::ValueTypeMarker>::borrow(&self.rssi_dbm),
1040                    <i16 as fidl::encoding::ValueTypeMarker>::borrow(&self.snr_dbh),
1041                ),
1042                encoder, offset, _depth
1043            )
1044        }
1045    }
1046    unsafe impl<
1047            D: fidl::encoding::ResourceDialect,
1048            T0: fidl::encoding::Encode<u32, D>,
1049            T1: fidl::encoding::Encode<u32, D>,
1050            T2: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1051            T3: fidl::encoding::Encode<u32, D>,
1052            T4: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanChannel, D>,
1053            T5: fidl::encoding::Encode<u8, D>,
1054            T6: fidl::encoding::Encode<i8, D>,
1055            T7: fidl::encoding::Encode<i16, D>,
1056        > fidl::encoding::Encode<WlanRxInfo, D> for (T0, T1, T2, T3, T4, T5, T6, T7)
1057    {
1058        #[inline]
1059        unsafe fn encode(
1060            self,
1061            encoder: &mut fidl::encoding::Encoder<'_, D>,
1062            offset: usize,
1063            depth: fidl::encoding::Depth,
1064        ) -> fidl::Result<()> {
1065            encoder.debug_check_bounds::<WlanRxInfo>(offset);
1066            // Zero out padding regions. There's no need to apply masks
1067            // because the unmasked parts will be overwritten by fields.
1068            // Write the fields.
1069            self.0.encode(encoder, offset + 0, depth)?;
1070            self.1.encode(encoder, offset + 4, depth)?;
1071            self.2.encode(encoder, offset + 8, depth)?;
1072            self.3.encode(encoder, offset + 12, depth)?;
1073            self.4.encode(encoder, offset + 16, depth)?;
1074            self.5.encode(encoder, offset + 28, depth)?;
1075            self.6.encode(encoder, offset + 29, depth)?;
1076            self.7.encode(encoder, offset + 30, depth)?;
1077            Ok(())
1078        }
1079    }
1080
1081    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanRxInfo {
1082        #[inline(always)]
1083        fn new_empty() -> Self {
1084            Self {
1085                rx_flags: fidl::new_empty!(u32, D),
1086                valid_fields: fidl::new_empty!(u32, D),
1087                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1088                data_rate: fidl::new_empty!(u32, D),
1089                channel: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanChannel, D),
1090                mcs: fidl::new_empty!(u8, D),
1091                rssi_dbm: fidl::new_empty!(i8, D),
1092                snr_dbh: fidl::new_empty!(i16, D),
1093            }
1094        }
1095
1096        #[inline]
1097        unsafe fn decode(
1098            &mut self,
1099            decoder: &mut fidl::encoding::Decoder<'_, D>,
1100            offset: usize,
1101            _depth: fidl::encoding::Depth,
1102        ) -> fidl::Result<()> {
1103            decoder.debug_check_bounds::<Self>(offset);
1104            // Verify that padding bytes are zero.
1105            fidl::decode!(u32, D, &mut self.rx_flags, decoder, offset + 0, _depth)?;
1106            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1107            fidl::decode!(
1108                fidl_fuchsia_wlan_common__common::WlanPhyType,
1109                D,
1110                &mut self.phy,
1111                decoder,
1112                offset + 8,
1113                _depth
1114            )?;
1115            fidl::decode!(u32, D, &mut self.data_rate, decoder, offset + 12, _depth)?;
1116            fidl::decode!(
1117                fidl_fuchsia_wlan_common__common::WlanChannel,
1118                D,
1119                &mut self.channel,
1120                decoder,
1121                offset + 16,
1122                _depth
1123            )?;
1124            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 28, _depth)?;
1125            fidl::decode!(i8, D, &mut self.rssi_dbm, decoder, offset + 29, _depth)?;
1126            fidl::decode!(i16, D, &mut self.snr_dbh, decoder, offset + 30, _depth)?;
1127            Ok(())
1128        }
1129    }
1130
1131    impl fidl::encoding::ValueTypeMarker for WlanTxInfo {
1132        type Borrowed<'a> = &'a Self;
1133        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1134            value
1135        }
1136    }
1137
1138    unsafe impl fidl::encoding::TypeMarker for WlanTxInfo {
1139        type Owned = Self;
1140
1141        #[inline(always)]
1142        fn inline_align(_context: fidl::encoding::Context) -> usize {
1143            4
1144        }
1145
1146        #[inline(always)]
1147        fn inline_size(_context: fidl::encoding::Context) -> usize {
1148            20
1149        }
1150    }
1151
1152    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxInfo, D>
1153        for &WlanTxInfo
1154    {
1155        #[inline]
1156        unsafe fn encode(
1157            self,
1158            encoder: &mut fidl::encoding::Encoder<'_, D>,
1159            offset: usize,
1160            _depth: fidl::encoding::Depth,
1161        ) -> fidl::Result<()> {
1162            encoder.debug_check_bounds::<WlanTxInfo>(offset);
1163            // Delegate to tuple encoding.
1164            fidl::encoding::Encode::<WlanTxInfo, D>::encode(
1165                (
1166                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_flags),
1167                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.valid_fields),
1168                    <u16 as fidl::encoding::ValueTypeMarker>::borrow(&self.tx_vector_idx),
1169                    <fidl_fuchsia_wlan_common__common::WlanPhyType as fidl::encoding::ValueTypeMarker>::borrow(&self.phy),
1170                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.cbw),
1171                    <u8 as fidl::encoding::ValueTypeMarker>::borrow(&self.mcs),
1172                ),
1173                encoder, offset, _depth
1174            )
1175        }
1176    }
1177    unsafe impl<
1178            D: fidl::encoding::ResourceDialect,
1179            T0: fidl::encoding::Encode<u32, D>,
1180            T1: fidl::encoding::Encode<u32, D>,
1181            T2: fidl::encoding::Encode<u16, D>,
1182            T3: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanPhyType, D>,
1183            T4: fidl::encoding::Encode<u8, D>,
1184            T5: fidl::encoding::Encode<u8, D>,
1185        > fidl::encoding::Encode<WlanTxInfo, D> for (T0, T1, T2, T3, T4, T5)
1186    {
1187        #[inline]
1188        unsafe fn encode(
1189            self,
1190            encoder: &mut fidl::encoding::Encoder<'_, D>,
1191            offset: usize,
1192            depth: fidl::encoding::Depth,
1193        ) -> fidl::Result<()> {
1194            encoder.debug_check_bounds::<WlanTxInfo>(offset);
1195            // Zero out padding regions. There's no need to apply masks
1196            // because the unmasked parts will be overwritten by fields.
1197            unsafe {
1198                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1199                (ptr as *mut u32).write_unaligned(0);
1200            }
1201            unsafe {
1202                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(16);
1203                (ptr as *mut u32).write_unaligned(0);
1204            }
1205            // Write the fields.
1206            self.0.encode(encoder, offset + 0, depth)?;
1207            self.1.encode(encoder, offset + 4, depth)?;
1208            self.2.encode(encoder, offset + 8, depth)?;
1209            self.3.encode(encoder, offset + 12, depth)?;
1210            self.4.encode(encoder, offset + 16, depth)?;
1211            self.5.encode(encoder, offset + 17, depth)?;
1212            Ok(())
1213        }
1214    }
1215
1216    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxInfo {
1217        #[inline(always)]
1218        fn new_empty() -> Self {
1219            Self {
1220                tx_flags: fidl::new_empty!(u32, D),
1221                valid_fields: fidl::new_empty!(u32, D),
1222                tx_vector_idx: fidl::new_empty!(u16, D),
1223                phy: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanPhyType, D),
1224                cbw: fidl::new_empty!(u8, D),
1225                mcs: fidl::new_empty!(u8, D),
1226            }
1227        }
1228
1229        #[inline]
1230        unsafe fn decode(
1231            &mut self,
1232            decoder: &mut fidl::encoding::Decoder<'_, D>,
1233            offset: usize,
1234            _depth: fidl::encoding::Depth,
1235        ) -> fidl::Result<()> {
1236            decoder.debug_check_bounds::<Self>(offset);
1237            // Verify that padding bytes are zero.
1238            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1239            let padval = unsafe { (ptr as *const u32).read_unaligned() };
1240            let mask = 0xffff0000u32;
1241            let maskedval = padval & mask;
1242            if maskedval != 0 {
1243                return Err(fidl::Error::NonZeroPadding {
1244                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1245                });
1246            }
1247            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(16) };
1248            let padval = unsafe { (ptr as *const u32).read_unaligned() };
1249            let mask = 0xffff0000u32;
1250            let maskedval = padval & mask;
1251            if maskedval != 0 {
1252                return Err(fidl::Error::NonZeroPadding {
1253                    padding_start: offset + 16 + ((mask as u64).trailing_zeros() / 8) as usize,
1254                });
1255            }
1256            fidl::decode!(u32, D, &mut self.tx_flags, decoder, offset + 0, _depth)?;
1257            fidl::decode!(u32, D, &mut self.valid_fields, decoder, offset + 4, _depth)?;
1258            fidl::decode!(u16, D, &mut self.tx_vector_idx, decoder, offset + 8, _depth)?;
1259            fidl::decode!(
1260                fidl_fuchsia_wlan_common__common::WlanPhyType,
1261                D,
1262                &mut self.phy,
1263                decoder,
1264                offset + 12,
1265                _depth
1266            )?;
1267            fidl::decode!(u8, D, &mut self.cbw, decoder, offset + 16, _depth)?;
1268            fidl::decode!(u8, D, &mut self.mcs, decoder, offset + 17, _depth)?;
1269            Ok(())
1270        }
1271    }
1272
1273    impl fidl::encoding::ValueTypeMarker for WlanTxPacket {
1274        type Borrowed<'a> = &'a Self;
1275        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1276            value
1277        }
1278    }
1279
1280    unsafe impl fidl::encoding::TypeMarker for WlanTxPacket {
1281        type Owned = Self;
1282
1283        #[inline(always)]
1284        fn inline_align(_context: fidl::encoding::Context) -> usize {
1285            8
1286        }
1287
1288        #[inline(always)]
1289        fn inline_size(_context: fidl::encoding::Context) -> usize {
1290            40
1291        }
1292    }
1293
1294    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlanTxPacket, D>
1295        for &WlanTxPacket
1296    {
1297        #[inline]
1298        unsafe fn encode(
1299            self,
1300            encoder: &mut fidl::encoding::Encoder<'_, D>,
1301            offset: usize,
1302            _depth: fidl::encoding::Depth,
1303        ) -> fidl::Result<()> {
1304            encoder.debug_check_bounds::<WlanTxPacket>(offset);
1305            // Delegate to tuple encoding.
1306            fidl::encoding::Encode::<WlanTxPacket, D>::encode(
1307                (
1308                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1309                    <WlanTxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1310                ),
1311                encoder, offset, _depth
1312            )
1313        }
1314    }
1315    unsafe impl<
1316            D: fidl::encoding::ResourceDialect,
1317            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1318            T1: fidl::encoding::Encode<WlanTxInfo, D>,
1319        > fidl::encoding::Encode<WlanTxPacket, D> for (T0, T1)
1320    {
1321        #[inline]
1322        unsafe fn encode(
1323            self,
1324            encoder: &mut fidl::encoding::Encoder<'_, D>,
1325            offset: usize,
1326            depth: fidl::encoding::Depth,
1327        ) -> fidl::Result<()> {
1328            encoder.debug_check_bounds::<WlanTxPacket>(offset);
1329            // Zero out padding regions. There's no need to apply masks
1330            // because the unmasked parts will be overwritten by fields.
1331            unsafe {
1332                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
1333                (ptr as *mut u64).write_unaligned(0);
1334            }
1335            // Write the fields.
1336            self.0.encode(encoder, offset + 0, depth)?;
1337            self.1.encode(encoder, offset + 16, depth)?;
1338            Ok(())
1339        }
1340    }
1341
1342    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlanTxPacket {
1343        #[inline(always)]
1344        fn new_empty() -> Self {
1345            Self {
1346                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1347                info: fidl::new_empty!(WlanTxInfo, D),
1348            }
1349        }
1350
1351        #[inline]
1352        unsafe fn decode(
1353            &mut self,
1354            decoder: &mut fidl::encoding::Decoder<'_, D>,
1355            offset: usize,
1356            _depth: fidl::encoding::Depth,
1357        ) -> fidl::Result<()> {
1358            decoder.debug_check_bounds::<Self>(offset);
1359            // Verify that padding bytes are zero.
1360            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
1361            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1362            let mask = 0xffffffff00000000u64;
1363            let maskedval = padval & mask;
1364            if maskedval != 0 {
1365                return Err(fidl::Error::NonZeroPadding {
1366                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
1367                });
1368            }
1369            fidl::decode!(
1370                fidl::encoding::UnboundedVector<u8>,
1371                D,
1372                &mut self.data,
1373                decoder,
1374                offset + 0,
1375                _depth
1376            )?;
1377            fidl::decode!(WlanTxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1378            Ok(())
1379        }
1380    }
1381
1382    impl fidl::encoding::ValueTypeMarker for WlantapCtlCreatePhyResponse {
1383        type Borrowed<'a> = &'a Self;
1384        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1385            value
1386        }
1387    }
1388
1389    unsafe impl fidl::encoding::TypeMarker for WlantapCtlCreatePhyResponse {
1390        type Owned = Self;
1391
1392        #[inline(always)]
1393        fn inline_align(_context: fidl::encoding::Context) -> usize {
1394            4
1395        }
1396
1397        #[inline(always)]
1398        fn inline_size(_context: fidl::encoding::Context) -> usize {
1399            4
1400        }
1401        #[inline(always)]
1402        fn encode_is_copy() -> bool {
1403            true
1404        }
1405
1406        #[inline(always)]
1407        fn decode_is_copy() -> bool {
1408            true
1409        }
1410    }
1411
1412    unsafe impl<D: fidl::encoding::ResourceDialect>
1413        fidl::encoding::Encode<WlantapCtlCreatePhyResponse, D> for &WlantapCtlCreatePhyResponse
1414    {
1415        #[inline]
1416        unsafe fn encode(
1417            self,
1418            encoder: &mut fidl::encoding::Encoder<'_, D>,
1419            offset: usize,
1420            _depth: fidl::encoding::Depth,
1421        ) -> fidl::Result<()> {
1422            encoder.debug_check_bounds::<WlantapCtlCreatePhyResponse>(offset);
1423            unsafe {
1424                // Copy the object into the buffer.
1425                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
1426                (buf_ptr as *mut WlantapCtlCreatePhyResponse)
1427                    .write_unaligned((self as *const WlantapCtlCreatePhyResponse).read());
1428                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
1429                // done second because the memcpy will write garbage to these bytes.
1430            }
1431            Ok(())
1432        }
1433    }
1434    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<i32, D>>
1435        fidl::encoding::Encode<WlantapCtlCreatePhyResponse, D> for (T0,)
1436    {
1437        #[inline]
1438        unsafe fn encode(
1439            self,
1440            encoder: &mut fidl::encoding::Encoder<'_, D>,
1441            offset: usize,
1442            depth: fidl::encoding::Depth,
1443        ) -> fidl::Result<()> {
1444            encoder.debug_check_bounds::<WlantapCtlCreatePhyResponse>(offset);
1445            // Zero out padding regions. There's no need to apply masks
1446            // because the unmasked parts will be overwritten by fields.
1447            // Write the fields.
1448            self.0.encode(encoder, offset + 0, depth)?;
1449            Ok(())
1450        }
1451    }
1452
1453    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1454        for WlantapCtlCreatePhyResponse
1455    {
1456        #[inline(always)]
1457        fn new_empty() -> Self {
1458            Self { status: fidl::new_empty!(i32, D) }
1459        }
1460
1461        #[inline]
1462        unsafe fn decode(
1463            &mut self,
1464            decoder: &mut fidl::encoding::Decoder<'_, D>,
1465            offset: usize,
1466            _depth: fidl::encoding::Depth,
1467        ) -> fidl::Result<()> {
1468            decoder.debug_check_bounds::<Self>(offset);
1469            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
1470            // Verify that padding bytes are zero.
1471            // Copy from the buffer into the object.
1472            unsafe {
1473                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 4);
1474            }
1475            Ok(())
1476        }
1477    }
1478
1479    impl fidl::encoding::ValueTypeMarker for WlantapPhyConfig {
1480        type Borrowed<'a> = &'a Self;
1481        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1482            value
1483        }
1484    }
1485
1486    unsafe impl fidl::encoding::TypeMarker for WlantapPhyConfig {
1487        type Owned = Self;
1488
1489        #[inline(always)]
1490        fn inline_align(_context: fidl::encoding::Context) -> usize {
1491            8
1492        }
1493
1494        #[inline(always)]
1495        fn inline_size(_context: fidl::encoding::Context) -> usize {
1496            88
1497        }
1498    }
1499
1500    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyConfig, D>
1501        for &WlantapPhyConfig
1502    {
1503        #[inline]
1504        unsafe fn encode(
1505            self,
1506            encoder: &mut fidl::encoding::Encoder<'_, D>,
1507            offset: usize,
1508            _depth: fidl::encoding::Depth,
1509        ) -> fidl::Result<()> {
1510            encoder.debug_check_bounds::<WlantapPhyConfig>(offset);
1511            // Delegate to tuple encoding.
1512            fidl::encoding::Encode::<WlantapPhyConfig, D>::encode(
1513                (
1514                    <fidl::encoding::Array<u8, 6> as fidl::encoding::ValueTypeMarker>::borrow(&self.sta_addr),
1515                    <fidl_fuchsia_wlan_common__common::WlanMacRole as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_role),
1516                    <fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64> as fidl::encoding::ValueTypeMarker>::borrow(&self.supported_phys),
1517                    <u32 as fidl::encoding::ValueTypeMarker>::borrow(&self.hardware_capability),
1518                    <fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8> as fidl::encoding::ValueTypeMarker>::borrow(&self.bands),
1519                    <fidl::encoding::BoundedString<32> as fidl::encoding::ValueTypeMarker>::borrow(&self.name),
1520                    <bool as fidl::encoding::ValueTypeMarker>::borrow(&self.quiet),
1521                    <fidl_fuchsia_wlan_softmac__common::DiscoverySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.discovery_support),
1522                    <fidl_fuchsia_wlan_common__common::MacSublayerSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.mac_sublayer_support),
1523                    <fidl_fuchsia_wlan_common__common::SecuritySupport as fidl::encoding::ValueTypeMarker>::borrow(&self.security_support),
1524                    <fidl_fuchsia_wlan_common__common::SpectrumManagementSupport as fidl::encoding::ValueTypeMarker>::borrow(&self.spectrum_management_support),
1525                ),
1526                encoder, offset, _depth
1527            )
1528        }
1529    }
1530    unsafe impl<
1531            D: fidl::encoding::ResourceDialect,
1532            T0: fidl::encoding::Encode<fidl::encoding::Array<u8, 6>, D>,
1533            T1: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanMacRole, D>,
1534            T2: fidl::encoding::Encode<
1535                fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>,
1536                D,
1537            >,
1538            T3: fidl::encoding::Encode<u32, D>,
1539            T4: fidl::encoding::Encode<
1540                fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8>,
1541                D,
1542            >,
1543            T5: fidl::encoding::Encode<fidl::encoding::BoundedString<32>, D>,
1544            T6: fidl::encoding::Encode<bool, D>,
1545            T7: fidl::encoding::Encode<fidl_fuchsia_wlan_softmac__common::DiscoverySupport, D>,
1546            T8: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::MacSublayerSupport, D>,
1547            T9: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SecuritySupport, D>,
1548            T10: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::SpectrumManagementSupport, D>,
1549        > fidl::encoding::Encode<WlantapPhyConfig, D>
1550        for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
1551    {
1552        #[inline]
1553        unsafe fn encode(
1554            self,
1555            encoder: &mut fidl::encoding::Encoder<'_, D>,
1556            offset: usize,
1557            depth: fidl::encoding::Depth,
1558        ) -> fidl::Result<()> {
1559            encoder.debug_check_bounds::<WlantapPhyConfig>(offset);
1560            // Zero out padding regions. There's no need to apply masks
1561            // because the unmasked parts will be overwritten by fields.
1562            unsafe {
1563                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(0);
1564                (ptr as *mut u64).write_unaligned(0);
1565            }
1566            unsafe {
1567                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
1568                (ptr as *mut u64).write_unaligned(0);
1569            }
1570            unsafe {
1571                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(32);
1572                (ptr as *mut u64).write_unaligned(0);
1573            }
1574            unsafe {
1575                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(80);
1576                (ptr as *mut u64).write_unaligned(0);
1577            }
1578            // Write the fields.
1579            self.0.encode(encoder, offset + 0, depth)?;
1580            self.1.encode(encoder, offset + 8, depth)?;
1581            self.2.encode(encoder, offset + 16, depth)?;
1582            self.3.encode(encoder, offset + 32, depth)?;
1583            self.4.encode(encoder, offset + 40, depth)?;
1584            self.5.encode(encoder, offset + 56, depth)?;
1585            self.6.encode(encoder, offset + 72, depth)?;
1586            self.7.encode(encoder, offset + 73, depth)?;
1587            self.8.encode(encoder, offset + 76, depth)?;
1588            self.9.encode(encoder, offset + 81, depth)?;
1589            self.10.encode(encoder, offset + 84, depth)?;
1590            Ok(())
1591        }
1592    }
1593
1594    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyConfig {
1595        #[inline(always)]
1596        fn new_empty() -> Self {
1597            Self {
1598                sta_addr: fidl::new_empty!(fidl::encoding::Array<u8, 6>, D),
1599                mac_role: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanMacRole, D),
1600                supported_phys: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D),
1601                hardware_capability: fidl::new_empty!(u32, D),
1602                bands: fidl::new_empty!(fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8>, D),
1603                name: fidl::new_empty!(fidl::encoding::BoundedString<32>, D),
1604                quiet: fidl::new_empty!(bool, D),
1605                discovery_support: fidl::new_empty!(
1606                    fidl_fuchsia_wlan_softmac__common::DiscoverySupport,
1607                    D
1608                ),
1609                mac_sublayer_support: fidl::new_empty!(
1610                    fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1611                    D
1612                ),
1613                security_support: fidl::new_empty!(
1614                    fidl_fuchsia_wlan_common__common::SecuritySupport,
1615                    D
1616                ),
1617                spectrum_management_support: fidl::new_empty!(
1618                    fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
1619                    D
1620                ),
1621            }
1622        }
1623
1624        #[inline]
1625        unsafe fn decode(
1626            &mut self,
1627            decoder: &mut fidl::encoding::Decoder<'_, D>,
1628            offset: usize,
1629            _depth: fidl::encoding::Depth,
1630        ) -> fidl::Result<()> {
1631            decoder.debug_check_bounds::<Self>(offset);
1632            // Verify that padding bytes are zero.
1633            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(0) };
1634            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1635            let mask = 0xffff000000000000u64;
1636            let maskedval = padval & mask;
1637            if maskedval != 0 {
1638                return Err(fidl::Error::NonZeroPadding {
1639                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
1640                });
1641            }
1642            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(8) };
1643            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1644            let mask = 0xffffffff00000000u64;
1645            let maskedval = padval & mask;
1646            if maskedval != 0 {
1647                return Err(fidl::Error::NonZeroPadding {
1648                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
1649                });
1650            }
1651            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(32) };
1652            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1653            let mask = 0xffffffff00000000u64;
1654            let maskedval = padval & mask;
1655            if maskedval != 0 {
1656                return Err(fidl::Error::NonZeroPadding {
1657                    padding_start: offset + 32 + ((mask as u64).trailing_zeros() / 8) as usize,
1658                });
1659            }
1660            let ptr = unsafe { decoder.buf.as_ptr().add(offset).offset(80) };
1661            let padval = unsafe { (ptr as *const u64).read_unaligned() };
1662            let mask = 0xffffff0000000000u64;
1663            let maskedval = padval & mask;
1664            if maskedval != 0 {
1665                return Err(fidl::Error::NonZeroPadding {
1666                    padding_start: offset + 80 + ((mask as u64).trailing_zeros() / 8) as usize,
1667                });
1668            }
1669            fidl::decode!(fidl::encoding::Array<u8, 6>, D, &mut self.sta_addr, decoder, offset + 0, _depth)?;
1670            fidl::decode!(
1671                fidl_fuchsia_wlan_common__common::WlanMacRole,
1672                D,
1673                &mut self.mac_role,
1674                decoder,
1675                offset + 8,
1676                _depth
1677            )?;
1678            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_common__common::WlanPhyType, 64>, D, &mut self.supported_phys, decoder, offset + 16, _depth)?;
1679            fidl::decode!(u32, D, &mut self.hardware_capability, decoder, offset + 32, _depth)?;
1680            fidl::decode!(fidl::encoding::Vector<fidl_fuchsia_wlan_device__common::BandInfo, 8>, D, &mut self.bands, decoder, offset + 40, _depth)?;
1681            fidl::decode!(
1682                fidl::encoding::BoundedString<32>,
1683                D,
1684                &mut self.name,
1685                decoder,
1686                offset + 56,
1687                _depth
1688            )?;
1689            fidl::decode!(bool, D, &mut self.quiet, decoder, offset + 72, _depth)?;
1690            fidl::decode!(
1691                fidl_fuchsia_wlan_softmac__common::DiscoverySupport,
1692                D,
1693                &mut self.discovery_support,
1694                decoder,
1695                offset + 73,
1696                _depth
1697            )?;
1698            fidl::decode!(
1699                fidl_fuchsia_wlan_common__common::MacSublayerSupport,
1700                D,
1701                &mut self.mac_sublayer_support,
1702                decoder,
1703                offset + 76,
1704                _depth
1705            )?;
1706            fidl::decode!(
1707                fidl_fuchsia_wlan_common__common::SecuritySupport,
1708                D,
1709                &mut self.security_support,
1710                decoder,
1711                offset + 81,
1712                _depth
1713            )?;
1714            fidl::decode!(
1715                fidl_fuchsia_wlan_common__common::SpectrumManagementSupport,
1716                D,
1717                &mut self.spectrum_management_support,
1718                decoder,
1719                offset + 84,
1720                _depth
1721            )?;
1722            Ok(())
1723        }
1724    }
1725
1726    impl fidl::encoding::ValueTypeMarker for WlantapPhyJoinBssRequest {
1727        type Borrowed<'a> = &'a Self;
1728        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1729            value
1730        }
1731    }
1732
1733    unsafe impl fidl::encoding::TypeMarker for WlantapPhyJoinBssRequest {
1734        type Owned = Self;
1735
1736        #[inline(always)]
1737        fn inline_align(_context: fidl::encoding::Context) -> usize {
1738            8
1739        }
1740
1741        #[inline(always)]
1742        fn inline_size(_context: fidl::encoding::Context) -> usize {
1743            24
1744        }
1745    }
1746
1747    unsafe impl<D: fidl::encoding::ResourceDialect>
1748        fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for &WlantapPhyJoinBssRequest
1749    {
1750        #[inline]
1751        unsafe fn encode(
1752            self,
1753            encoder: &mut fidl::encoding::Encoder<'_, D>,
1754            offset: usize,
1755            _depth: fidl::encoding::Depth,
1756        ) -> fidl::Result<()> {
1757            encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
1758            // Delegate to tuple encoding.
1759            fidl::encoding::Encode::<WlantapPhyJoinBssRequest, D>::encode(
1760                (<JoinBssArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
1761                encoder,
1762                offset,
1763                _depth,
1764            )
1765        }
1766    }
1767    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<JoinBssArgs, D>>
1768        fidl::encoding::Encode<WlantapPhyJoinBssRequest, D> for (T0,)
1769    {
1770        #[inline]
1771        unsafe fn encode(
1772            self,
1773            encoder: &mut fidl::encoding::Encoder<'_, D>,
1774            offset: usize,
1775            depth: fidl::encoding::Depth,
1776        ) -> fidl::Result<()> {
1777            encoder.debug_check_bounds::<WlantapPhyJoinBssRequest>(offset);
1778            // Zero out padding regions. There's no need to apply masks
1779            // because the unmasked parts will be overwritten by fields.
1780            // Write the fields.
1781            self.0.encode(encoder, offset + 0, depth)?;
1782            Ok(())
1783        }
1784    }
1785
1786    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1787        for WlantapPhyJoinBssRequest
1788    {
1789        #[inline(always)]
1790        fn new_empty() -> Self {
1791            Self { args: fidl::new_empty!(JoinBssArgs, D) }
1792        }
1793
1794        #[inline]
1795        unsafe fn decode(
1796            &mut self,
1797            decoder: &mut fidl::encoding::Decoder<'_, D>,
1798            offset: usize,
1799            _depth: fidl::encoding::Depth,
1800        ) -> fidl::Result<()> {
1801            decoder.debug_check_bounds::<Self>(offset);
1802            // Verify that padding bytes are zero.
1803            fidl::decode!(JoinBssArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
1804            Ok(())
1805        }
1806    }
1807
1808    impl fidl::encoding::ValueTypeMarker for WlantapPhyReportTxResultRequest {
1809        type Borrowed<'a> = &'a Self;
1810        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1811            value
1812        }
1813    }
1814
1815    unsafe impl fidl::encoding::TypeMarker for WlantapPhyReportTxResultRequest {
1816        type Owned = Self;
1817
1818        #[inline(always)]
1819        fn inline_align(_context: fidl::encoding::Context) -> usize {
1820            2
1821        }
1822
1823        #[inline(always)]
1824        fn inline_size(_context: fidl::encoding::Context) -> usize {
1825            40
1826        }
1827    }
1828
1829    unsafe impl<D: fidl::encoding::ResourceDialect>
1830        fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D>
1831        for &WlantapPhyReportTxResultRequest
1832    {
1833        #[inline]
1834        unsafe fn encode(
1835            self,
1836            encoder: &mut fidl::encoding::Encoder<'_, D>,
1837            offset: usize,
1838            _depth: fidl::encoding::Depth,
1839        ) -> fidl::Result<()> {
1840            encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
1841            // Delegate to tuple encoding.
1842            fidl::encoding::Encode::<WlantapPhyReportTxResultRequest, D>::encode(
1843                (
1844                    <fidl_fuchsia_wlan_common__common::WlanTxResult as fidl::encoding::ValueTypeMarker>::borrow(&self.txr),
1845                ),
1846                encoder, offset, _depth
1847            )
1848        }
1849    }
1850    unsafe impl<
1851            D: fidl::encoding::ResourceDialect,
1852            T0: fidl::encoding::Encode<fidl_fuchsia_wlan_common__common::WlanTxResult, D>,
1853        > fidl::encoding::Encode<WlantapPhyReportTxResultRequest, D> for (T0,)
1854    {
1855        #[inline]
1856        unsafe fn encode(
1857            self,
1858            encoder: &mut fidl::encoding::Encoder<'_, D>,
1859            offset: usize,
1860            depth: fidl::encoding::Depth,
1861        ) -> fidl::Result<()> {
1862            encoder.debug_check_bounds::<WlantapPhyReportTxResultRequest>(offset);
1863            // Zero out padding regions. There's no need to apply masks
1864            // because the unmasked parts will be overwritten by fields.
1865            // Write the fields.
1866            self.0.encode(encoder, offset + 0, depth)?;
1867            Ok(())
1868        }
1869    }
1870
1871    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
1872        for WlantapPhyReportTxResultRequest
1873    {
1874        #[inline(always)]
1875        fn new_empty() -> Self {
1876            Self { txr: fidl::new_empty!(fidl_fuchsia_wlan_common__common::WlanTxResult, D) }
1877        }
1878
1879        #[inline]
1880        unsafe fn decode(
1881            &mut self,
1882            decoder: &mut fidl::encoding::Decoder<'_, D>,
1883            offset: usize,
1884            _depth: fidl::encoding::Depth,
1885        ) -> fidl::Result<()> {
1886            decoder.debug_check_bounds::<Self>(offset);
1887            // Verify that padding bytes are zero.
1888            fidl::decode!(
1889                fidl_fuchsia_wlan_common__common::WlanTxResult,
1890                D,
1891                &mut self.txr,
1892                decoder,
1893                offset + 0,
1894                _depth
1895            )?;
1896            Ok(())
1897        }
1898    }
1899
1900    impl fidl::encoding::ValueTypeMarker for WlantapPhyRxRequest {
1901        type Borrowed<'a> = &'a Self;
1902        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1903            value
1904        }
1905    }
1906
1907    unsafe impl fidl::encoding::TypeMarker for WlantapPhyRxRequest {
1908        type Owned = Self;
1909
1910        #[inline(always)]
1911        fn inline_align(_context: fidl::encoding::Context) -> usize {
1912            8
1913        }
1914
1915        #[inline(always)]
1916        fn inline_size(_context: fidl::encoding::Context) -> usize {
1917            48
1918        }
1919    }
1920
1921    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyRxRequest, D>
1922        for &WlantapPhyRxRequest
1923    {
1924        #[inline]
1925        unsafe fn encode(
1926            self,
1927            encoder: &mut fidl::encoding::Encoder<'_, D>,
1928            offset: usize,
1929            _depth: fidl::encoding::Depth,
1930        ) -> fidl::Result<()> {
1931            encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
1932            // Delegate to tuple encoding.
1933            fidl::encoding::Encode::<WlantapPhyRxRequest, D>::encode(
1934                (
1935                    <fidl::encoding::UnboundedVector<u8> as fidl::encoding::ValueTypeMarker>::borrow(&self.data),
1936                    <WlanRxInfo as fidl::encoding::ValueTypeMarker>::borrow(&self.info),
1937                ),
1938                encoder, offset, _depth
1939            )
1940        }
1941    }
1942    unsafe impl<
1943            D: fidl::encoding::ResourceDialect,
1944            T0: fidl::encoding::Encode<fidl::encoding::UnboundedVector<u8>, D>,
1945            T1: fidl::encoding::Encode<WlanRxInfo, D>,
1946        > fidl::encoding::Encode<WlantapPhyRxRequest, D> for (T0, T1)
1947    {
1948        #[inline]
1949        unsafe fn encode(
1950            self,
1951            encoder: &mut fidl::encoding::Encoder<'_, D>,
1952            offset: usize,
1953            depth: fidl::encoding::Depth,
1954        ) -> fidl::Result<()> {
1955            encoder.debug_check_bounds::<WlantapPhyRxRequest>(offset);
1956            // Zero out padding regions. There's no need to apply masks
1957            // because the unmasked parts will be overwritten by fields.
1958            // Write the fields.
1959            self.0.encode(encoder, offset + 0, depth)?;
1960            self.1.encode(encoder, offset + 16, depth)?;
1961            Ok(())
1962        }
1963    }
1964
1965    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyRxRequest {
1966        #[inline(always)]
1967        fn new_empty() -> Self {
1968            Self {
1969                data: fidl::new_empty!(fidl::encoding::UnboundedVector<u8>, D),
1970                info: fidl::new_empty!(WlanRxInfo, D),
1971            }
1972        }
1973
1974        #[inline]
1975        unsafe fn decode(
1976            &mut self,
1977            decoder: &mut fidl::encoding::Decoder<'_, D>,
1978            offset: usize,
1979            _depth: fidl::encoding::Depth,
1980        ) -> fidl::Result<()> {
1981            decoder.debug_check_bounds::<Self>(offset);
1982            // Verify that padding bytes are zero.
1983            fidl::decode!(
1984                fidl::encoding::UnboundedVector<u8>,
1985                D,
1986                &mut self.data,
1987                decoder,
1988                offset + 0,
1989                _depth
1990            )?;
1991            fidl::decode!(WlanRxInfo, D, &mut self.info, decoder, offset + 16, _depth)?;
1992            Ok(())
1993        }
1994    }
1995
1996    impl fidl::encoding::ValueTypeMarker for WlantapPhyScanCompleteRequest {
1997        type Borrowed<'a> = &'a Self;
1998        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
1999            value
2000        }
2001    }
2002
2003    unsafe impl fidl::encoding::TypeMarker for WlantapPhyScanCompleteRequest {
2004        type Owned = Self;
2005
2006        #[inline(always)]
2007        fn inline_align(_context: fidl::encoding::Context) -> usize {
2008            8
2009        }
2010
2011        #[inline(always)]
2012        fn inline_size(_context: fidl::encoding::Context) -> usize {
2013            16
2014        }
2015    }
2016
2017    unsafe impl<D: fidl::encoding::ResourceDialect>
2018        fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D>
2019        for &WlantapPhyScanCompleteRequest
2020    {
2021        #[inline]
2022        unsafe fn encode(
2023            self,
2024            encoder: &mut fidl::encoding::Encoder<'_, D>,
2025            offset: usize,
2026            _depth: fidl::encoding::Depth,
2027        ) -> fidl::Result<()> {
2028            encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
2029            unsafe {
2030                // Copy the object into the buffer.
2031                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2032                (buf_ptr as *mut WlantapPhyScanCompleteRequest)
2033                    .write_unaligned((self as *const WlantapPhyScanCompleteRequest).read());
2034                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2035                // done second because the memcpy will write garbage to these bytes.
2036                let padding_ptr = buf_ptr.offset(8) as *mut u64;
2037                let padding_mask = 0xffffffff00000000u64;
2038                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
2039            }
2040            Ok(())
2041        }
2042    }
2043    unsafe impl<
2044            D: fidl::encoding::ResourceDialect,
2045            T0: fidl::encoding::Encode<u64, D>,
2046            T1: fidl::encoding::Encode<i32, D>,
2047        > fidl::encoding::Encode<WlantapPhyScanCompleteRequest, D> for (T0, T1)
2048    {
2049        #[inline]
2050        unsafe fn encode(
2051            self,
2052            encoder: &mut fidl::encoding::Encoder<'_, D>,
2053            offset: usize,
2054            depth: fidl::encoding::Depth,
2055        ) -> fidl::Result<()> {
2056            encoder.debug_check_bounds::<WlantapPhyScanCompleteRequest>(offset);
2057            // Zero out padding regions. There's no need to apply masks
2058            // because the unmasked parts will be overwritten by fields.
2059            unsafe {
2060                let ptr = encoder.buf.as_mut_ptr().add(offset).offset(8);
2061                (ptr as *mut u64).write_unaligned(0);
2062            }
2063            // Write the fields.
2064            self.0.encode(encoder, offset + 0, depth)?;
2065            self.1.encode(encoder, offset + 8, depth)?;
2066            Ok(())
2067        }
2068    }
2069
2070    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2071        for WlantapPhyScanCompleteRequest
2072    {
2073        #[inline(always)]
2074        fn new_empty() -> Self {
2075            Self { scan_id: fidl::new_empty!(u64, D), status: fidl::new_empty!(i32, D) }
2076        }
2077
2078        #[inline]
2079        unsafe fn decode(
2080            &mut self,
2081            decoder: &mut fidl::encoding::Decoder<'_, D>,
2082            offset: usize,
2083            _depth: fidl::encoding::Depth,
2084        ) -> fidl::Result<()> {
2085            decoder.debug_check_bounds::<Self>(offset);
2086            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2087            // Verify that padding bytes are zero.
2088            let ptr = unsafe { buf_ptr.offset(8) };
2089            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2090            let mask = 0xffffffff00000000u64;
2091            let maskedval = padval & mask;
2092            if maskedval != 0 {
2093                return Err(fidl::Error::NonZeroPadding {
2094                    padding_start: offset + 8 + ((mask as u64).trailing_zeros() / 8) as usize,
2095                });
2096            }
2097            // Copy from the buffer into the object.
2098            unsafe {
2099                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2100            }
2101            Ok(())
2102        }
2103    }
2104
2105    impl fidl::encoding::ValueTypeMarker for WlantapPhySetChannelRequest {
2106        type Borrowed<'a> = &'a Self;
2107        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2108            value
2109        }
2110    }
2111
2112    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetChannelRequest {
2113        type Owned = Self;
2114
2115        #[inline(always)]
2116        fn inline_align(_context: fidl::encoding::Context) -> usize {
2117            4
2118        }
2119
2120        #[inline(always)]
2121        fn inline_size(_context: fidl::encoding::Context) -> usize {
2122            16
2123        }
2124    }
2125
2126    unsafe impl<D: fidl::encoding::ResourceDialect>
2127        fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for &WlantapPhySetChannelRequest
2128    {
2129        #[inline]
2130        unsafe fn encode(
2131            self,
2132            encoder: &mut fidl::encoding::Encoder<'_, D>,
2133            offset: usize,
2134            _depth: fidl::encoding::Depth,
2135        ) -> fidl::Result<()> {
2136            encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
2137            // Delegate to tuple encoding.
2138            fidl::encoding::Encode::<WlantapPhySetChannelRequest, D>::encode(
2139                (<SetChannelArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2140                encoder,
2141                offset,
2142                _depth,
2143            )
2144        }
2145    }
2146    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetChannelArgs, D>>
2147        fidl::encoding::Encode<WlantapPhySetChannelRequest, D> for (T0,)
2148    {
2149        #[inline]
2150        unsafe fn encode(
2151            self,
2152            encoder: &mut fidl::encoding::Encoder<'_, D>,
2153            offset: usize,
2154            depth: fidl::encoding::Depth,
2155        ) -> fidl::Result<()> {
2156            encoder.debug_check_bounds::<WlantapPhySetChannelRequest>(offset);
2157            // Zero out padding regions. There's no need to apply masks
2158            // because the unmasked parts will be overwritten by fields.
2159            // Write the fields.
2160            self.0.encode(encoder, offset + 0, depth)?;
2161            Ok(())
2162        }
2163    }
2164
2165    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2166        for WlantapPhySetChannelRequest
2167    {
2168        #[inline(always)]
2169        fn new_empty() -> Self {
2170            Self { args: fidl::new_empty!(SetChannelArgs, D) }
2171        }
2172
2173        #[inline]
2174        unsafe fn decode(
2175            &mut self,
2176            decoder: &mut fidl::encoding::Decoder<'_, D>,
2177            offset: usize,
2178            _depth: fidl::encoding::Depth,
2179        ) -> fidl::Result<()> {
2180            decoder.debug_check_bounds::<Self>(offset);
2181            // Verify that padding bytes are zero.
2182            fidl::decode!(SetChannelArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2183            Ok(())
2184        }
2185    }
2186
2187    impl fidl::encoding::ValueTypeMarker for WlantapPhySetCountryRequest {
2188        type Borrowed<'a> = &'a Self;
2189        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2190            value
2191        }
2192    }
2193
2194    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetCountryRequest {
2195        type Owned = Self;
2196
2197        #[inline(always)]
2198        fn inline_align(_context: fidl::encoding::Context) -> usize {
2199            1
2200        }
2201
2202        #[inline(always)]
2203        fn inline_size(_context: fidl::encoding::Context) -> usize {
2204            2
2205        }
2206        #[inline(always)]
2207        fn encode_is_copy() -> bool {
2208            true
2209        }
2210
2211        #[inline(always)]
2212        fn decode_is_copy() -> bool {
2213            true
2214        }
2215    }
2216
2217    unsafe impl<D: fidl::encoding::ResourceDialect>
2218        fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for &WlantapPhySetCountryRequest
2219    {
2220        #[inline]
2221        unsafe fn encode(
2222            self,
2223            encoder: &mut fidl::encoding::Encoder<'_, D>,
2224            offset: usize,
2225            _depth: fidl::encoding::Depth,
2226        ) -> fidl::Result<()> {
2227            encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
2228            unsafe {
2229                // Copy the object into the buffer.
2230                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2231                (buf_ptr as *mut WlantapPhySetCountryRequest)
2232                    .write_unaligned((self as *const WlantapPhySetCountryRequest).read());
2233                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2234                // done second because the memcpy will write garbage to these bytes.
2235            }
2236            Ok(())
2237        }
2238    }
2239    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetCountryArgs, D>>
2240        fidl::encoding::Encode<WlantapPhySetCountryRequest, D> for (T0,)
2241    {
2242        #[inline]
2243        unsafe fn encode(
2244            self,
2245            encoder: &mut fidl::encoding::Encoder<'_, D>,
2246            offset: usize,
2247            depth: fidl::encoding::Depth,
2248        ) -> fidl::Result<()> {
2249            encoder.debug_check_bounds::<WlantapPhySetCountryRequest>(offset);
2250            // Zero out padding regions. There's no need to apply masks
2251            // because the unmasked parts will be overwritten by fields.
2252            // Write the fields.
2253            self.0.encode(encoder, offset + 0, depth)?;
2254            Ok(())
2255        }
2256    }
2257
2258    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2259        for WlantapPhySetCountryRequest
2260    {
2261        #[inline(always)]
2262        fn new_empty() -> Self {
2263            Self { args: fidl::new_empty!(SetCountryArgs, D) }
2264        }
2265
2266        #[inline]
2267        unsafe fn decode(
2268            &mut self,
2269            decoder: &mut fidl::encoding::Decoder<'_, D>,
2270            offset: usize,
2271            _depth: fidl::encoding::Depth,
2272        ) -> fidl::Result<()> {
2273            decoder.debug_check_bounds::<Self>(offset);
2274            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2275            // Verify that padding bytes are zero.
2276            // Copy from the buffer into the object.
2277            unsafe {
2278                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 2);
2279            }
2280            Ok(())
2281        }
2282    }
2283
2284    impl fidl::encoding::ValueTypeMarker for WlantapPhySetKeyRequest {
2285        type Borrowed<'a> = &'a Self;
2286        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2287            value
2288        }
2289    }
2290
2291    unsafe impl fidl::encoding::TypeMarker for WlantapPhySetKeyRequest {
2292        type Owned = Self;
2293
2294        #[inline(always)]
2295        fn inline_align(_context: fidl::encoding::Context) -> usize {
2296            8
2297        }
2298
2299        #[inline(always)]
2300        fn inline_size(_context: fidl::encoding::Context) -> usize {
2301            40
2302        }
2303    }
2304
2305    unsafe impl<D: fidl::encoding::ResourceDialect>
2306        fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for &WlantapPhySetKeyRequest
2307    {
2308        #[inline]
2309        unsafe fn encode(
2310            self,
2311            encoder: &mut fidl::encoding::Encoder<'_, D>,
2312            offset: usize,
2313            _depth: fidl::encoding::Depth,
2314        ) -> fidl::Result<()> {
2315            encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
2316            // Delegate to tuple encoding.
2317            fidl::encoding::Encode::<WlantapPhySetKeyRequest, D>::encode(
2318                (<SetKeyArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2319                encoder,
2320                offset,
2321                _depth,
2322            )
2323        }
2324    }
2325    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<SetKeyArgs, D>>
2326        fidl::encoding::Encode<WlantapPhySetKeyRequest, D> for (T0,)
2327    {
2328        #[inline]
2329        unsafe fn encode(
2330            self,
2331            encoder: &mut fidl::encoding::Encoder<'_, D>,
2332            offset: usize,
2333            depth: fidl::encoding::Depth,
2334        ) -> fidl::Result<()> {
2335            encoder.debug_check_bounds::<WlantapPhySetKeyRequest>(offset);
2336            // Zero out padding regions. There's no need to apply masks
2337            // because the unmasked parts will be overwritten by fields.
2338            // Write the fields.
2339            self.0.encode(encoder, offset + 0, depth)?;
2340            Ok(())
2341        }
2342    }
2343
2344    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2345        for WlantapPhySetKeyRequest
2346    {
2347        #[inline(always)]
2348        fn new_empty() -> Self {
2349            Self { args: fidl::new_empty!(SetKeyArgs, D) }
2350        }
2351
2352        #[inline]
2353        unsafe fn decode(
2354            &mut self,
2355            decoder: &mut fidl::encoding::Decoder<'_, D>,
2356            offset: usize,
2357            _depth: fidl::encoding::Depth,
2358        ) -> fidl::Result<()> {
2359            decoder.debug_check_bounds::<Self>(offset);
2360            // Verify that padding bytes are zero.
2361            fidl::decode!(SetKeyArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2362            Ok(())
2363        }
2364    }
2365
2366    impl fidl::encoding::ValueTypeMarker for WlantapPhyStartScanRequest {
2367        type Borrowed<'a> = &'a Self;
2368        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2369            value
2370        }
2371    }
2372
2373    unsafe impl fidl::encoding::TypeMarker for WlantapPhyStartScanRequest {
2374        type Owned = Self;
2375
2376        #[inline(always)]
2377        fn inline_align(_context: fidl::encoding::Context) -> usize {
2378            8
2379        }
2380
2381        #[inline(always)]
2382        fn inline_size(_context: fidl::encoding::Context) -> usize {
2383            16
2384        }
2385    }
2386
2387    unsafe impl<D: fidl::encoding::ResourceDialect>
2388        fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for &WlantapPhyStartScanRequest
2389    {
2390        #[inline]
2391        unsafe fn encode(
2392            self,
2393            encoder: &mut fidl::encoding::Encoder<'_, D>,
2394            offset: usize,
2395            _depth: fidl::encoding::Depth,
2396        ) -> fidl::Result<()> {
2397            encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
2398            unsafe {
2399                // Copy the object into the buffer.
2400                let buf_ptr = encoder.buf.as_mut_ptr().add(offset);
2401                (buf_ptr as *mut WlantapPhyStartScanRequest)
2402                    .write_unaligned((self as *const WlantapPhyStartScanRequest).read());
2403                // Zero out padding regions. Unlike `fidl_struct_impl_noncopy!`, this must be
2404                // done second because the memcpy will write garbage to these bytes.
2405                let padding_ptr = buf_ptr.offset(0) as *mut u64;
2406                let padding_mask = 0xffffffffffff0000u64;
2407                padding_ptr.write_unaligned(padding_ptr.read_unaligned() & !padding_mask);
2408            }
2409            Ok(())
2410        }
2411    }
2412    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<StartScanArgs, D>>
2413        fidl::encoding::Encode<WlantapPhyStartScanRequest, D> for (T0,)
2414    {
2415        #[inline]
2416        unsafe fn encode(
2417            self,
2418            encoder: &mut fidl::encoding::Encoder<'_, D>,
2419            offset: usize,
2420            depth: fidl::encoding::Depth,
2421        ) -> fidl::Result<()> {
2422            encoder.debug_check_bounds::<WlantapPhyStartScanRequest>(offset);
2423            // Zero out padding regions. There's no need to apply masks
2424            // because the unmasked parts will be overwritten by fields.
2425            // Write the fields.
2426            self.0.encode(encoder, offset + 0, depth)?;
2427            Ok(())
2428        }
2429    }
2430
2431    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D>
2432        for WlantapPhyStartScanRequest
2433    {
2434        #[inline(always)]
2435        fn new_empty() -> Self {
2436            Self { args: fidl::new_empty!(StartScanArgs, D) }
2437        }
2438
2439        #[inline]
2440        unsafe fn decode(
2441            &mut self,
2442            decoder: &mut fidl::encoding::Decoder<'_, D>,
2443            offset: usize,
2444            _depth: fidl::encoding::Depth,
2445        ) -> fidl::Result<()> {
2446            decoder.debug_check_bounds::<Self>(offset);
2447            let buf_ptr = unsafe { decoder.buf.as_ptr().add(offset) };
2448            // Verify that padding bytes are zero.
2449            let ptr = unsafe { buf_ptr.offset(0) };
2450            let padval = unsafe { (ptr as *const u64).read_unaligned() };
2451            let mask = 0xffffffffffff0000u64;
2452            let maskedval = padval & mask;
2453            if maskedval != 0 {
2454                return Err(fidl::Error::NonZeroPadding {
2455                    padding_start: offset + 0 + ((mask as u64).trailing_zeros() / 8) as usize,
2456                });
2457            }
2458            // Copy from the buffer into the object.
2459            unsafe {
2460                std::ptr::copy_nonoverlapping(buf_ptr, self as *mut Self as *mut u8, 16);
2461            }
2462            Ok(())
2463        }
2464    }
2465
2466    impl fidl::encoding::ValueTypeMarker for WlantapPhyTxRequest {
2467        type Borrowed<'a> = &'a Self;
2468        fn borrow(value: &<Self as fidl::encoding::TypeMarker>::Owned) -> Self::Borrowed<'_> {
2469            value
2470        }
2471    }
2472
2473    unsafe impl fidl::encoding::TypeMarker for WlantapPhyTxRequest {
2474        type Owned = Self;
2475
2476        #[inline(always)]
2477        fn inline_align(_context: fidl::encoding::Context) -> usize {
2478            8
2479        }
2480
2481        #[inline(always)]
2482        fn inline_size(_context: fidl::encoding::Context) -> usize {
2483            48
2484        }
2485    }
2486
2487    unsafe impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Encode<WlantapPhyTxRequest, D>
2488        for &WlantapPhyTxRequest
2489    {
2490        #[inline]
2491        unsafe fn encode(
2492            self,
2493            encoder: &mut fidl::encoding::Encoder<'_, D>,
2494            offset: usize,
2495            _depth: fidl::encoding::Depth,
2496        ) -> fidl::Result<()> {
2497            encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
2498            // Delegate to tuple encoding.
2499            fidl::encoding::Encode::<WlantapPhyTxRequest, D>::encode(
2500                (<TxArgs as fidl::encoding::ValueTypeMarker>::borrow(&self.args),),
2501                encoder,
2502                offset,
2503                _depth,
2504            )
2505        }
2506    }
2507    unsafe impl<D: fidl::encoding::ResourceDialect, T0: fidl::encoding::Encode<TxArgs, D>>
2508        fidl::encoding::Encode<WlantapPhyTxRequest, D> for (T0,)
2509    {
2510        #[inline]
2511        unsafe fn encode(
2512            self,
2513            encoder: &mut fidl::encoding::Encoder<'_, D>,
2514            offset: usize,
2515            depth: fidl::encoding::Depth,
2516        ) -> fidl::Result<()> {
2517            encoder.debug_check_bounds::<WlantapPhyTxRequest>(offset);
2518            // Zero out padding regions. There's no need to apply masks
2519            // because the unmasked parts will be overwritten by fields.
2520            // Write the fields.
2521            self.0.encode(encoder, offset + 0, depth)?;
2522            Ok(())
2523        }
2524    }
2525
2526    impl<D: fidl::encoding::ResourceDialect> fidl::encoding::Decode<Self, D> for WlantapPhyTxRequest {
2527        #[inline(always)]
2528        fn new_empty() -> Self {
2529            Self { args: fidl::new_empty!(TxArgs, D) }
2530        }
2531
2532        #[inline]
2533        unsafe fn decode(
2534            &mut self,
2535            decoder: &mut fidl::encoding::Decoder<'_, D>,
2536            offset: usize,
2537            _depth: fidl::encoding::Depth,
2538        ) -> fidl::Result<()> {
2539            decoder.debug_check_bounds::<Self>(offset);
2540            // Verify that padding bytes are zero.
2541            fidl::decode!(TxArgs, D, &mut self.args, decoder, offset + 0, _depth)?;
2542            Ok(())
2543        }
2544    }
2545}