Skip to main content

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