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